|
|
|
@ -423,510 +423,521 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
getStatistics() { |
|
|
|
getStatistics() { |
|
|
|
let arr = JSON.parse(JSON.stringify(this.sizeForm.inTableData)); |
|
|
|
let arr = this.sizeForm.inTableData; |
|
|
|
|
|
|
|
|
|
|
|
arr.forEach((row) => { |
|
|
|
arr.forEach((row) => { |
|
|
|
row.id = row.oneFormId; |
|
|
|
row.id = row.oneFormId; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
getStatistics(arr).then((res) => { |
|
|
|
getStatistics(arr).then((res) => { |
|
|
|
this.statisticsList = res.data.result; |
|
|
|
// this.statisticsList = res.data.result; |
|
|
|
this.statisticsList = this.statisticsList.map((stat) => { |
|
|
|
let data_ = res.data.result |
|
|
|
|
|
|
|
// this.statisticsList = |
|
|
|
|
|
|
|
console.log('批量易耗品', this.sizeForm.inTableData, data_) |
|
|
|
|
|
|
|
data_.forEach((stat,index) => { |
|
|
|
const detail = this.sizeForm.inTableData.find( |
|
|
|
const detail = this.sizeForm.inTableData.find( |
|
|
|
(item) => item.materialCode === stat.materialCode |
|
|
|
(item) => item.materialCode === stat.materialCode |
|
|
|
); |
|
|
|
); |
|
|
|
// |
|
|
|
|
|
|
|
if ( |
|
|
|
if (detail) { |
|
|
|
(this.sizeForm.options == 1 && |
|
|
|
// console.log(99999,index, detail, stat.materialCode) |
|
|
|
this.inBatchForm.optionType == "NY") || |
|
|
|
if ( |
|
|
|
(this.sizeForm.options == 2 && this.sizeForm.optionType == "NY") |
|
|
|
(this.sizeForm.options == 1 && |
|
|
|
) { |
|
|
|
this.inBatchForm.optionType == "NY") || |
|
|
|
const detailList = this.sizeForm.inTableData.filter( |
|
|
|
(this.sizeForm.options == 2 && this.sizeForm.optionType == "NY") |
|
|
|
(item) => |
|
|
|
) { |
|
|
|
item.materialCode === stat.materialCode && |
|
|
|
|
|
|
|
item.materialName === stat.materialName |
|
|
|
const detailList = this.sizeForm.inTableData.filter( |
|
|
|
); |
|
|
|
(item) => |
|
|
|
console.log(8989898989, detailList) |
|
|
|
item.materialCode === stat.materialCode && |
|
|
|
detail.theOutboundQuantity = detailList.reduce( |
|
|
|
item.materialName === stat.materialName |
|
|
|
(acc, cur) => acc + cur.theOutboundQuantity, |
|
|
|
); |
|
|
|
0 |
|
|
|
detail.theOutboundQuantity = detailList.reduce( |
|
|
|
); |
|
|
|
(acc, cur) => cur.theOutboundQuantity, |
|
|
|
} |
|
|
|
0 |
|
|
|
|
|
|
|
); |
|
|
|
return { |
|
|
|
} |
|
|
|
...stat, |
|
|
|
this.statisticsList.push({ |
|
|
|
theOutboundQuantity: detail.theOutboundQuantity, //本次出库数量 |
|
|
|
...stat, |
|
|
|
unitPrice: detail.unitPrice, |
|
|
|
theOutboundQuantity: detail.theOutboundQuantity, //本次出库数量 |
|
|
|
totalQuantity: stat.num - detail.theOutboundQuantity, |
|
|
|
unitPrice: detail.unitPrice, |
|
|
|
department: detail.department, // 部门ID |
|
|
|
totalQuantity: stat.num - detail.theOutboundQuantity, |
|
|
|
departmentName: |
|
|
|
department: detail.department, // 部门ID |
|
|
|
detail.departmentName || |
|
|
|
departmentName: |
|
|
|
this.getDepartmentName(detail.department), |
|
|
|
detail.departmentName || |
|
|
|
}; |
|
|
|
this.getDepartmentName(detail.department), |
|
|
|
}); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
changeDepartment() { |
|
|
|
|
|
|
|
this.getStatistics(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
batchclose() { |
|
|
|
|
|
|
|
this.batchSelectionVisible = false; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
selectionChange(row) { |
|
|
|
|
|
|
|
this.batchSelectionVisible = false; |
|
|
|
|
|
|
|
row.forEach((item) => { |
|
|
|
|
|
|
|
item.outboundQuantity = 1; |
|
|
|
|
|
|
|
item.theOutboundQuantity = 1; |
|
|
|
|
|
|
|
item.oneFormId = item.id |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.sizeForm.inTableData = row; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getStatistics(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
confirm(allSelectedList) { |
|
|
|
|
|
|
|
this.consumableVisible = false; |
|
|
|
|
|
|
|
allSelectedList.forEach((item) => { |
|
|
|
|
|
|
|
item.outboundQuantity = 1; |
|
|
|
|
|
|
|
item.theOutboundQuantity = 1; |
|
|
|
|
|
|
|
item.oneFormId = item.id |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.sizeForm.inTableData = allSelectedList; |
|
|
|
|
|
|
|
this.getStatistics(); |
|
|
|
|
|
|
|
}, // 处理搜索 |
|
|
|
|
|
|
|
async handleSearch() { |
|
|
|
|
|
|
|
// 重置当前页 |
|
|
|
|
|
|
|
this.currentPage = 1; |
|
|
|
|
|
|
|
await this.loadGoodsList(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 分页大小改变 |
|
|
|
|
|
|
|
handleSizeChange(val) { |
|
|
|
|
|
|
|
this.pageSize = val; |
|
|
|
|
|
|
|
this.currentPage = 1; |
|
|
|
|
|
|
|
this.loadGoodsList(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 当前页改变 |
|
|
|
|
|
|
|
handleCurrentChange(val) { |
|
|
|
|
|
|
|
this.currentPage = val; |
|
|
|
|
|
|
|
this.loadGoodsList(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
depchange(value) { |
|
|
|
|
|
|
|
this.departmentList = this.departmentList; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//关闭 |
|
|
|
|
|
|
|
handleBatchClose() { |
|
|
|
|
|
|
|
this.inBatchDialogVisible = false; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 添加出库数据 |
|
|
|
|
|
|
|
inTableAdd() { |
|
|
|
|
|
|
|
const requiredFields = [ |
|
|
|
|
|
|
|
{ value: this.sizeForm.reason, message: "请填写事由" }, |
|
|
|
|
|
|
|
{ value: this.sizeForm.materialType, message: "请选择物资类型" }, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
value: this.sizeForm.optionType, |
|
|
|
|
|
|
|
message: "请选择类别(易耗品/耐用品)", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
// 检查所有必填项 |
|
|
|
|
|
|
|
for (const field of requiredFields) { |
|
|
|
|
|
|
|
if (!field.value) { |
|
|
|
|
|
|
|
this.$message.warning(field.message); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.sizeForm.inTableData.push({}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
addInit() { |
|
|
|
|
|
|
|
this.sizeForm.outDate = new Date(); //出库时间 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//本次出库数量 |
|
|
|
|
|
|
|
syncInboundQuantity(row) { |
|
|
|
|
|
|
|
row.theOutboundQuantity = Number(row.theOutboundQuantity); |
|
|
|
|
|
|
|
if (this.sizeForm.options === 1) { |
|
|
|
|
|
|
|
const maxAllowQuantity = |
|
|
|
|
|
|
|
(row.applicationQuantity || 0) - (row.outboundQuantity || 0); |
|
|
|
|
|
|
|
if (row.theOutboundQuantity > maxAllowQuantity) { |
|
|
|
|
|
|
|
this.$message.error(`本次出库数量不能大于${maxAllowQuantity}`); |
|
|
|
|
|
|
|
row.theOutboundQuantity = maxAllowQuantity; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.sizeForm.optionType === "NY") { |
|
|
|
|
|
|
|
row.outboundQuantity = 1; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
this.getStatistics(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//关闭新增弹窗 |
|
|
|
|
|
|
|
handleCloseDetail() { |
|
|
|
|
|
|
|
this.outDialogVisible = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$emit("handleCloseDetail"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
console.log('detail', this.statisticsList) |
|
|
|
closeDialog() { |
|
|
|
}); |
|
|
|
this.consumableVisible = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
changeDepartment() { |
|
|
|
|
|
|
|
this.getStatistics(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
batchclose() { |
|
|
|
|
|
|
|
this.batchSelectionVisible = false; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
selectionChange(row) { |
|
|
|
|
|
|
|
this.batchSelectionVisible = false; |
|
|
|
|
|
|
|
row.forEach((item) => { |
|
|
|
|
|
|
|
item.outboundQuantity = 1; |
|
|
|
|
|
|
|
item.theOutboundQuantity = 1; |
|
|
|
|
|
|
|
item.oneFormId = item.id |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.sizeForm.inTableData = row; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getStatistics(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
confirm(allSelectedList) { |
|
|
|
|
|
|
|
this.consumableVisible = false; |
|
|
|
|
|
|
|
allSelectedList.forEach((item) => { |
|
|
|
|
|
|
|
item.outboundQuantity = 1; |
|
|
|
|
|
|
|
item.theOutboundQuantity = 1; |
|
|
|
|
|
|
|
item.oneFormId = item.id |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.sizeForm.inTableData = allSelectedList; |
|
|
|
|
|
|
|
this.getStatistics(); |
|
|
|
|
|
|
|
}, // 处理搜索 |
|
|
|
|
|
|
|
async handleSearch() { |
|
|
|
|
|
|
|
// 重置当前页 |
|
|
|
|
|
|
|
this.currentPage = 1; |
|
|
|
|
|
|
|
await this.loadGoodsList(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 分页大小改变 |
|
|
|
|
|
|
|
handleSizeChange(val) { |
|
|
|
|
|
|
|
this.pageSize = val; |
|
|
|
|
|
|
|
this.currentPage = 1; |
|
|
|
|
|
|
|
this.loadGoodsList(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 当前页改变 |
|
|
|
|
|
|
|
handleCurrentChange(val) { |
|
|
|
|
|
|
|
this.currentPage = val; |
|
|
|
|
|
|
|
this.loadGoodsList(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
depchange(value) { |
|
|
|
|
|
|
|
this.departmentList = this.departmentList; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//关闭 |
|
|
|
|
|
|
|
handleBatchClose() { |
|
|
|
|
|
|
|
this.inBatchDialogVisible = false; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 添加出库数据 |
|
|
|
|
|
|
|
inTableAdd() { |
|
|
|
|
|
|
|
const requiredFields = [ |
|
|
|
|
|
|
|
{ value: this.sizeForm.reason, message: "请填写事由" }, |
|
|
|
|
|
|
|
{ value: this.sizeForm.materialType, message: "请选择物资类型" }, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
value: this.sizeForm.optionType, |
|
|
|
|
|
|
|
message: "请选择类别(易耗品/耐用品)", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
// 检查所有必填项 |
|
|
|
|
|
|
|
for (const field of requiredFields) { |
|
|
|
|
|
|
|
if (!field.value) { |
|
|
|
|
|
|
|
this.$message.warning(field.message); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.sizeForm.inTableData.push({}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
addInit() { |
|
|
|
|
|
|
|
this.sizeForm.outDate = new Date(); //出库时间 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//本次出库数量 |
|
|
|
|
|
|
|
syncInboundQuantity(row) { |
|
|
|
|
|
|
|
row.theOutboundQuantity = Number(row.theOutboundQuantity); |
|
|
|
|
|
|
|
if (this.sizeForm.options === 1) { |
|
|
|
|
|
|
|
const maxAllowQuantity = |
|
|
|
|
|
|
|
(row.applicationQuantity || 0) - (row.outboundQuantity || 0); |
|
|
|
|
|
|
|
if (row.theOutboundQuantity > maxAllowQuantity) { |
|
|
|
|
|
|
|
this.$message.error(`本次出库数量不能大于${maxAllowQuantity}`); |
|
|
|
|
|
|
|
row.theOutboundQuantity = maxAllowQuantity; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.sizeForm.optionType === "NY") { |
|
|
|
|
|
|
|
row.outboundQuantity = 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.getStatistics(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//关闭新增弹窗 |
|
|
|
|
|
|
|
handleCloseDetail() { |
|
|
|
|
|
|
|
this.outDialogVisible = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$emit("handleCloseDetail"); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
closeDialog() { |
|
|
|
|
|
|
|
this.consumableVisible = false; |
|
|
|
|
|
|
|
}, |
|
|
|
// 获取批量需求单列表 |
|
|
|
// 获取批量需求单列表 |
|
|
|
async getQuarterList() { |
|
|
|
async getQuarterList() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
const res = await getQuarterList(); |
|
|
|
const res = await getQuarterList(); |
|
|
|
if (res.data && res.data.result) { |
|
|
|
if (res.data && res.data.result) { |
|
|
|
this.quarterList = res.data.result; |
|
|
|
this.quarterList = res.data.result; |
|
|
|
this.quarterList.forEach((item) => { |
|
|
|
this.quarterList.forEach((item) => { |
|
|
|
if (item.year && item.quarter && item.ids) { |
|
|
|
if (item.year && item.quarter && item.ids) { |
|
|
|
this.quarterYearMap[item.ids] = item.year; |
|
|
|
this.quarterYearMap[item.ids] = item.year; |
|
|
|
this.quarterQuarterMap[item.ids] = item.quarter; |
|
|
|
this.quarterQuarterMap[item.ids] = item.quarter; |
|
|
|
this.sizeForm.inTableData.ldDemandEndId = item.ids; |
|
|
|
this.sizeForm.inTableData.ldDemandEndId = item.ids; |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
}); |
|
|
|
this.$message.error("获取需求单列表失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
}, |
|
|
|
this.$message.error("获取需求单列表失败"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 批量需求单选择变化,获取部门列表 |
|
|
|
// 批量需求单选择变化,获取部门列表 |
|
|
|
async onQuarterSelectChange(ids) { |
|
|
|
async onQuarterSelectChange(ids) { |
|
|
|
if (!ids) return; |
|
|
|
if (!ids) return; |
|
|
|
const year = this.quarterYearMap[ids]; |
|
|
|
const year = this.quarterYearMap[ids]; |
|
|
|
const quarter = this.quarterQuarterMap[ids]; |
|
|
|
const quarter = this.quarterQuarterMap[ids]; |
|
|
|
if (year && quarter) { |
|
|
|
if (year && quarter) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
const res = await getDepartmentList({ |
|
|
|
const res = await getDepartmentList({ |
|
|
|
year: year, |
|
|
|
year: year, |
|
|
|
quarter: quarter, |
|
|
|
quarter: quarter, |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (res.data && res.data.result) { |
|
|
|
if (res.data && res.data.result) { |
|
|
|
this.departmentList = res.data.result; |
|
|
|
this.departmentList = res.data.result; |
|
|
|
} else { |
|
|
|
|
|
|
|
this.departmentList = []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
this.$message.error("获取部门列表失败"); |
|
|
|
|
|
|
|
this.departmentList = []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.departmentList = []; |
|
|
|
this.departmentList = []; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
this.$message.error("获取部门列表失败"); |
|
|
|
|
|
|
|
this.departmentList = []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.departmentList = []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async batchSubmit() { |
|
|
|
async batchSubmit() { |
|
|
|
if (!this.inBatchForm.batchType) { |
|
|
|
if (!this.inBatchForm.batchType) { |
|
|
|
this.$message.error("请选择需求单"); |
|
|
|
this.$message.error("请选择需求单"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!this.inBatchForm.department) { |
|
|
|
if (!this.inBatchForm.department) { |
|
|
|
this.$message.error("请选择部门"); |
|
|
|
this.$message.error("请选择部门"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!this.inBatchForm.optionType) { |
|
|
|
if (!this.inBatchForm.optionType) { |
|
|
|
this.$message.error("请选择类别"); |
|
|
|
this.$message.error("请选择类别"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const requestParams = { |
|
|
|
|
|
|
|
ids: this.inBatchForm.batchType, |
|
|
|
|
|
|
|
departmentId: this.inBatchForm.department, |
|
|
|
|
|
|
|
optionType: this.inBatchForm.optionType, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
let res; |
|
|
|
|
|
|
|
if (this.inBatchForm.optionType === "YH") { |
|
|
|
|
|
|
|
res = await getDetailedList(requestParams); |
|
|
|
|
|
|
|
} else if (this.inBatchForm.optionType === "NY") { |
|
|
|
|
|
|
|
res = await batchList(requestParams); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const requestParams = { |
|
|
|
if (res.data && res.data.result) { |
|
|
|
ids: this.inBatchForm.batchType, |
|
|
|
// this.sizeForm.inTableData = res.data.result; |
|
|
|
departmentId: this.inBatchForm.department, |
|
|
|
const selectedDept = this.departmentList.find( |
|
|
|
optionType: this.inBatchForm.optionType, |
|
|
|
(dept) => dept.departmentId === this.inBatchForm.department |
|
|
|
}; |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const processedData = res.data.result.map((item) => { |
|
|
|
|
|
|
|
// 计算剩余可出库数量:申请数量 - 已出库数量 |
|
|
|
|
|
|
|
// 如果字段不存在,默认为 0 |
|
|
|
|
|
|
|
const appQty = Number(item.applicationQuantity || 0); |
|
|
|
|
|
|
|
const outQty = Number(item.outboundQuantity || 0); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
const defaultQty = appQty - outQty; |
|
|
|
let res; |
|
|
|
|
|
|
|
if (this.inBatchForm.optionType === "YH") { |
|
|
|
if (this.inBatchForm.optionType === "YH") { |
|
|
|
res = await getDetailedList(requestParams); |
|
|
|
item.department = selectedDept.departmentId |
|
|
|
} else if (this.inBatchForm.optionType === "NY") { |
|
|
|
item.departmentName = selectedDept.department |
|
|
|
res = await batchList(requestParams); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
...item, |
|
|
|
|
|
|
|
IdDemandEndld: this.inBatchForm.batchType, |
|
|
|
|
|
|
|
// department: deptName, // 注意:这里存的是名称还是ID需根据后续submit逻辑确认,原代码存的是名称 |
|
|
|
|
|
|
|
// 设置本次出库数量默认值,且不能小于0 |
|
|
|
|
|
|
|
theOutboundQuantity: defaultQty > 0 ? defaultQty : 0, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (res.data && res.data.result) { |
|
|
|
this.sizeForm.inTableData = processedData; |
|
|
|
this.sizeForm.inTableData = res.data.result; |
|
|
|
// |
|
|
|
const selectedDept = this.departmentList.find( |
|
|
|
// 关闭批量选择弹窗 |
|
|
|
(dept) => dept.departmentId === this.inBatchForm.department |
|
|
|
this.inBatchDialogVisible = false; |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const processedData = res.data.result.map((item) => { |
|
|
|
|
|
|
|
// 计算剩余可出库数量:申请数量 - 已出库数量 |
|
|
|
|
|
|
|
// 如果字段不存在,默认为 0 |
|
|
|
|
|
|
|
const appQty = Number(item.applicationQuantity || 0); |
|
|
|
|
|
|
|
const outQty = Number(item.outboundQuantity || 0); |
|
|
|
|
|
|
|
const defaultQty = appQty - outQty; |
|
|
|
|
|
|
|
if (this.inBatchForm.optionType === "YH") { |
|
|
|
|
|
|
|
item.department = selectedDept.departmentId |
|
|
|
|
|
|
|
item.departmentName = selectedDept.department |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
...item, |
|
|
|
|
|
|
|
IdDemandEndld: this.inBatchForm.batchType, |
|
|
|
|
|
|
|
// department: deptName, // 注意:这里存的是名称还是ID需根据后续submit逻辑确认,原代码存的是名称 |
|
|
|
|
|
|
|
// 设置本次出库数量默认值,且不能小于0 |
|
|
|
|
|
|
|
theOutboundQuantity: defaultQty > 0 ? defaultQty : 0, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.sizeForm.inTableData = processedData; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 关闭批量选择弹窗 |
|
|
|
|
|
|
|
this.inBatchDialogVisible = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 设置需求单名称 |
|
|
|
|
|
|
|
const selectedQuarter = this.quarterList.find( |
|
|
|
|
|
|
|
(item) => item.ids === this.inBatchForm.batchType |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
if (selectedQuarter) { |
|
|
|
|
|
|
|
this.sizeForm.demandEndInfo = selectedQuarter.quarterName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 耐用品特殊处理(打开批量选择弹窗) |
|
|
|
// 设置需求单名称 |
|
|
|
if (this.inBatchForm.optionType === "NY") { |
|
|
|
const selectedQuarter = this.quarterList.find( |
|
|
|
this.batchSelectionVisible = true; |
|
|
|
(item) => item.ids === this.inBatchForm.batchType |
|
|
|
this.dialogVisible = true; |
|
|
|
); |
|
|
|
this.batchTableData = res.data.result; |
|
|
|
if (selectedQuarter) { |
|
|
|
} else { |
|
|
|
this.sizeForm.demandEndInfo = selectedQuarter.quarterName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.getStatistics(); |
|
|
|
// 耐用品特殊处理(打开批量选择弹窗) |
|
|
|
} |
|
|
|
if (this.inBatchForm.optionType === "NY") { |
|
|
|
|
|
|
|
this.batchSelectionVisible = true; |
|
|
|
|
|
|
|
this.dialogVisible = true; |
|
|
|
|
|
|
|
this.batchTableData = res.data.result; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
// 强制更新视图 |
|
|
|
this.getStatistics(); |
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.$forceUpdate(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message.warning("未获取到详细数据"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
this.$message.error( |
|
|
|
|
|
|
|
`获取${this.inBatchForm.optionType === "YH" ? "易耗品" : "耐用品" |
|
|
|
|
|
|
|
}数据失败:${error.message}` |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 强制更新视图 |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.$forceUpdate(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message.warning("未获取到详细数据"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
this.$message.error( |
|
|
|
|
|
|
|
`获取${this.inBatchForm.optionType === "YH" ? "易耗品" : "耐用品" |
|
|
|
|
|
|
|
}数据失败:${error.message}` |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
//获取单条选择的部门名称列表 |
|
|
|
//获取单条选择的部门名称列表 |
|
|
|
async getDetailedItems() { |
|
|
|
async getDetailedItems() { |
|
|
|
this.loading = true; |
|
|
|
this.loading = true; |
|
|
|
try { |
|
|
|
try { |
|
|
|
// const res = await ; |
|
|
|
// const res = await ; |
|
|
|
// this.list = res.data.result; |
|
|
|
// this.list = res.data.result; |
|
|
|
getDetailedItems().then(res=>{ |
|
|
|
getDetailedItems().then(res => { |
|
|
|
this.list = res.data.result; |
|
|
|
this.list = res.data.result; |
|
|
|
}) |
|
|
|
}) |
|
|
|
} catch (error) { |
|
|
|
} catch (error) { |
|
|
|
this.$message.error("获取数据来源失败,请重试"); |
|
|
|
this.$message.error("获取数据来源失败,请重试"); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
getDepartmentName(departmentId) { |
|
|
|
getDepartmentName(departmentId) { |
|
|
|
const department = this.list.find( |
|
|
|
const department = this.list.find( |
|
|
|
(item) => item.departmentId === departmentId |
|
|
|
(item) => item.departmentId === departmentId |
|
|
|
); |
|
|
|
); |
|
|
|
return department ? department.department : ""; |
|
|
|
return department ? department.department : ""; |
|
|
|
}, |
|
|
|
}, |
|
|
|
//获取单条选择的物资名称列表 |
|
|
|
//获取单条选择的物资名称列表 |
|
|
|
async getMaterialList() { |
|
|
|
async getMaterialList() { |
|
|
|
this.loading = true; |
|
|
|
this.loading = true; |
|
|
|
this.consumableVisible = false; |
|
|
|
this.consumableVisible = false; |
|
|
|
try { |
|
|
|
try { |
|
|
|
if ( |
|
|
|
if ( |
|
|
|
this.sizeForm.optionType === "NY" && |
|
|
|
this.sizeForm.optionType === "NY" && |
|
|
|
this.outDialogType !== "details" |
|
|
|
this.outDialogType !== "details" |
|
|
|
) { |
|
|
|
) { |
|
|
|
this.consumableVisible = true; |
|
|
|
this.consumableVisible = true; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
getMaterialList({ |
|
|
|
getMaterialList({ |
|
|
|
optionType: this.sizeForm.optionType, |
|
|
|
optionType: this.sizeForm.optionType, |
|
|
|
}).then((res) => { |
|
|
|
}).then((res) => { |
|
|
|
this.materials = res.data.result; |
|
|
|
this.materials = res.data.result; |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
} catch (error) { |
|
|
|
this.$message.error("获取失败,请重试"); |
|
|
|
this.$message.error("获取失败,请重试"); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 处理物资选择变化 |
|
|
|
// 处理物资选择变化 |
|
|
|
handleMaterialChange(row, index) { |
|
|
|
handleMaterialChange(row, index) { |
|
|
|
let select = this.materials.filter( |
|
|
|
let select = this.materials.filter( |
|
|
|
(item) => item.materialId === row.materialId |
|
|
|
(item) => item.materialId === row.materialId |
|
|
|
)[0]; |
|
|
|
)[0]; |
|
|
|
|
|
|
|
|
|
|
|
this.sizeForm.inTableData[index].materialId = select.materialId; |
|
|
|
this.sizeForm.inTableData[index].materialId = select.materialId; |
|
|
|
this.sizeForm.inTableData[index].model = select.model; |
|
|
|
this.sizeForm.inTableData[index].model = select.model; |
|
|
|
this.sizeForm.inTableData[index].materialCode = select.materialCode; |
|
|
|
this.sizeForm.inTableData[index].materialCode = select.materialCode; |
|
|
|
this.sizeForm.inTableData[index].materialName = select.materialName; |
|
|
|
this.sizeForm.inTableData[index].materialName = select.materialName; |
|
|
|
this.sizeForm.inTableData[index].type = select.type; |
|
|
|
this.sizeForm.inTableData[index].type = select.type; |
|
|
|
this.sizeForm.inTableData[index].unit = select.unit; |
|
|
|
this.sizeForm.inTableData[index].unit = select.unit; |
|
|
|
this.sizeForm.inTableData[index].num = select.num; |
|
|
|
this.sizeForm.inTableData[index].num = select.num; |
|
|
|
this.getStatistics(); |
|
|
|
this.getStatistics(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 提交 |
|
|
|
// 提交 |
|
|
|
async submit(index) { |
|
|
|
async submit(index) { |
|
|
|
if (!this.sizeForm.reason) { |
|
|
|
if (!this.sizeForm.reason) { |
|
|
|
this.$message.error("事由不能为空"); |
|
|
|
this.$message.error("事由不能为空"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!this.sizeForm.materialType) { |
|
|
|
if (!this.sizeForm.materialType) { |
|
|
|
this.$message.error("请选择物资类型"); |
|
|
|
this.$message.error("请选择物资类型"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.sizeForm.options === 1) { |
|
|
|
if (this.sizeForm.options === 1) { |
|
|
|
if (!this.sizeForm.demandEndInfo) { |
|
|
|
if (!this.sizeForm.demandEndInfo) { |
|
|
|
this.$message.error("请选择需求单名称"); |
|
|
|
this.$message.error("请选择需求单名称"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if ( |
|
|
|
if ( |
|
|
|
!this.sizeForm.inTableData || |
|
|
|
!this.sizeForm.inTableData || |
|
|
|
this.sizeForm.inTableData.length === 0 |
|
|
|
this.sizeForm.inTableData.length === 0 |
|
|
|
) { |
|
|
|
) { |
|
|
|
this.$message.error("请添加批量选择数据"); |
|
|
|
this.$message.error("请添加批量选择数据"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.sizeForm.options === 2) { |
|
|
|
if (this.sizeForm.options === 2) { |
|
|
|
for (const row of this.sizeForm.inTableData) { |
|
|
|
for (const row of this.sizeForm.inTableData) { |
|
|
|
if (!row.departmentName) { |
|
|
|
if (!row.departmentName) { |
|
|
|
this.$message.error("请选择部门"); |
|
|
|
this.$message.error("请选择部门"); |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.sizeForm.options == 2) { |
|
|
|
|
|
|
|
console.log(898989, "易耗是否选择部门!"); |
|
|
|
|
|
|
|
const invalidRow = this.sizeForm.inTableData.find( |
|
|
|
|
|
|
|
(row) => !row.department |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
if (invalidRow) { |
|
|
|
|
|
|
|
this.$message.error("存在未选择部门的物资,请补充完整"); |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// status == 1 暂存 ,2提交 |
|
|
|
} |
|
|
|
this.sizeForm.status = index; |
|
|
|
} |
|
|
|
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData; |
|
|
|
if (this.sizeForm.options == 2) { |
|
|
|
let arr = this.list.find( |
|
|
|
console.log(898989, "易耗是否选择部门!"); |
|
|
|
(item) => item.departmentId === this.inBatchForm.department |
|
|
|
const invalidRow = this.sizeForm.inTableData.find( |
|
|
|
); |
|
|
|
(row) => !row.department |
|
|
|
|
|
|
|
); |
|
|
|
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData.map( |
|
|
|
if (invalidRow) { |
|
|
|
(row) => { |
|
|
|
this.$message.error("存在未选择部门的物资,请补充完整"); |
|
|
|
const deptId = row.department; |
|
|
|
return; |
|
|
|
const dept = this.list.find((item) => item.departmentId === deptId); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
let select = this.sizeForm.inTableData.find( |
|
|
|
// status == 1 暂存 ,2提交 |
|
|
|
(item) => item.materialId === row.materialId |
|
|
|
this.sizeForm.status = index; |
|
|
|
); |
|
|
|
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData; |
|
|
|
console.log(99999, select, this.sizeForm.inTableData); |
|
|
|
let arr = this.list.find( |
|
|
|
const oneFormId = row.oneFormId |
|
|
|
(item) => item.departmentId === this.inBatchForm.department |
|
|
|
|
|
|
|
); |
|
|
|
return { |
|
|
|
|
|
|
|
...row, |
|
|
|
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData.map( |
|
|
|
department: deptId, |
|
|
|
(row) => { |
|
|
|
departmentName: dept.department, |
|
|
|
const deptId = row.department; |
|
|
|
oneFormId: oneFormId, |
|
|
|
const dept = this.list.find((item) => item.departmentId === deptId); |
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
let select = this.sizeForm.inTableData.find( |
|
|
|
|
|
|
|
(item) => item.materialId === row.materialId |
|
|
|
); |
|
|
|
); |
|
|
|
if (this.outDialogTiltle == "编辑") { |
|
|
|
console.log(99999, select, this.sizeForm.inTableData); |
|
|
|
this.sizeForm.id = this.id; |
|
|
|
const oneFormId = row.oneFormId |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
if (this.sizeForm.options == 1) { |
|
|
|
...row, |
|
|
|
this.sizeForm.optionType = this.inBatchForm.optionType; |
|
|
|
department: deptId, |
|
|
|
} |
|
|
|
departmentName: dept.department, |
|
|
|
|
|
|
|
oneFormId: oneFormId, |
|
|
|
try { |
|
|
|
}; |
|
|
|
console.log(this.sizeForm, "提交数据"); |
|
|
|
} |
|
|
|
this.saveLoading = true; |
|
|
|
); |
|
|
|
const res = await submitData(this.sizeForm); |
|
|
|
if (this.outDialogTiltle == "编辑") { |
|
|
|
if (res.data.success) { |
|
|
|
this.sizeForm.id = this.id; |
|
|
|
this.$message({ |
|
|
|
} |
|
|
|
type: "success", |
|
|
|
|
|
|
|
message: "提交成功", |
|
|
|
if (this.sizeForm.options == 1) { |
|
|
|
}); |
|
|
|
this.sizeForm.optionType = this.inBatchForm.optionType; |
|
|
|
this.$emit("submitSuccess"); |
|
|
|
} |
|
|
|
this.saveLoading = false; |
|
|
|
|
|
|
|
this.handleCloseDetail(); |
|
|
|
try { |
|
|
|
} else { |
|
|
|
console.log(this.sizeForm, "提交数据"); |
|
|
|
this.saveLoading = false; |
|
|
|
this.saveLoading = true; |
|
|
|
this.$message.error(res.data.message || "提交失败"); |
|
|
|
const res = await submitData(this.sizeForm); |
|
|
|
} |
|
|
|
if (res.data.success) { |
|
|
|
} catch (error) { |
|
|
|
this.$message({ |
|
|
|
this.saveLoading = false; |
|
|
|
type: "success", |
|
|
|
this.$message.error(error.message || "服务器错误"); |
|
|
|
message: "提交成功", |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
this.$emit("submitSuccess"); |
|
|
|
|
|
|
|
this.saveLoading = false; |
|
|
|
|
|
|
|
this.handleCloseDetail(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.saveLoading = false; |
|
|
|
|
|
|
|
this.$message.error(res.data.message || "提交失败"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
this.saveLoading = false; |
|
|
|
|
|
|
|
this.$message.error(error.message || "服务器错误"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//编辑和详情 |
|
|
|
//编辑和详情 |
|
|
|
async inInit() { |
|
|
|
async inInit() { |
|
|
|
if (this.outDialogType == "details" || this.outDialogType == "edit") { |
|
|
|
if (this.outDialogType == "details" || this.outDialogType == "edit") { |
|
|
|
editList(this.id).then((res) => { |
|
|
|
editList(this.id).then((res) => { |
|
|
|
const { ldOneOutStorage, ldOneOutStorageDetails } = |
|
|
|
const { ldOneOutStorage, ldOneOutStorageDetails } = |
|
|
|
res.data.result || {}; |
|
|
|
res.data.result || {}; |
|
|
|
// this.sizeForm = res.data.result.ldOneOutStorage |
|
|
|
// this.sizeForm = res.data.result.ldOneOutStorage |
|
|
|
// this.sizeForm.id = |
|
|
|
// this.sizeForm.id = |
|
|
|
this.sizeForm.inTableData = res.data.result.ldOneOutStorageDetails; |
|
|
|
this.sizeForm.inTableData = res.data.result.ldOneOutStorageDetails; |
|
|
|
this.sizeForm.orderNo = ldOneOutStorage.orderNo; |
|
|
|
this.sizeForm.orderNo = ldOneOutStorage.orderNo; |
|
|
|
this.sizeForm.reason = ldOneOutStorage.reason; |
|
|
|
this.sizeForm.reason = ldOneOutStorage.reason; |
|
|
|
this.sizeForm.demandEndInfo = ldOneOutStorage.demandEndInfo; |
|
|
|
this.sizeForm.demandEndInfo = ldOneOutStorage.demandEndInfo; |
|
|
|
this.sizeForm.outDate = ldOneOutStorage.outDate; |
|
|
|
this.sizeForm.outDate = ldOneOutStorage.outDate; |
|
|
|
this.sizeForm.options = Number(ldOneOutStorage.options); |
|
|
|
this.sizeForm.options = Number(ldOneOutStorage.options); |
|
|
|
this.sizeForm.optionType = ldOneOutStorage.optionType; |
|
|
|
this.sizeForm.optionType = ldOneOutStorage.optionType; |
|
|
|
this.batchSelectionVisible = false; |
|
|
|
|
|
|
|
this.inBatchForm.optionType = ldOneOutStorage.optionType; |
|
|
|
|
|
|
|
if (this.sizeForm.options == 2 && this.sizeForm.optionType == "YH") { |
|
|
|
|
|
|
|
this.getMaterialList(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$set(this.sizeForm, "inTableData", ldOneOutStorageDetails); |
|
|
|
|
|
|
|
this.getStatistics(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 选项选择 |
|
|
|
|
|
|
|
radioChange() { |
|
|
|
|
|
|
|
this.sizeForm.inTableData = []; |
|
|
|
|
|
|
|
this.statisticsList = []; |
|
|
|
|
|
|
|
this.sizeForm.optionType = ""; |
|
|
|
|
|
|
|
this.inBatchDialogVisible = false; |
|
|
|
|
|
|
|
this.consumableVisible = false; |
|
|
|
|
|
|
|
this.inBatchDialogVisible = false; |
|
|
|
|
|
|
|
this.batchSelectionVisible = false; |
|
|
|
this.batchSelectionVisible = false; |
|
|
|
this.batchTableData = []; |
|
|
|
this.inBatchForm.optionType = ldOneOutStorage.optionType; |
|
|
|
// this.inBatchForm.batchType = "" |
|
|
|
if (this.sizeForm.options == 2 && this.sizeForm.optionType == "YH") { |
|
|
|
// this.inBatchForm.department = "" |
|
|
|
this.getMaterialList(); |
|
|
|
this.sizeForm.demandEndInfo = ""; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.sizeForm.options === 1) { |
|
|
|
|
|
|
|
this.getQuarterList(); |
|
|
|
|
|
|
|
this.inBatchDialogVisible = true; |
|
|
|
|
|
|
|
(this.inBatchForm.batchType = ""), (this.inBatchForm.department = ""); |
|
|
|
|
|
|
|
this.inBatchForm.optionType = ""; |
|
|
|
|
|
|
|
this.inBatchForm.optionType = ""; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 删除表格行数据 |
|
|
|
this.$set(this.sizeForm, "inTableData", ldOneOutStorageDetails); |
|
|
|
handleDelete(index, row) { |
|
|
|
|
|
|
|
this.sizeForm.inTableData.splice(index, 1); |
|
|
|
|
|
|
|
this.$message.success("已成功删除该条记录"); |
|
|
|
|
|
|
|
this.getStatistics(); |
|
|
|
this.getStatistics(); |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
} |
|
|
|
watch: { |
|
|
|
}, |
|
|
|
// 监听需求单选择变化 |
|
|
|
|
|
|
|
// "inBatchForm.batchType": function (newVal) { |
|
|
|
// 选项选择 |
|
|
|
// (this.inBatchForm.department = ""), (this.inBatchForm.optionType = 1); |
|
|
|
radioChange() { |
|
|
|
// if (newVal) { |
|
|
|
this.sizeForm.inTableData = []; |
|
|
|
// this.onQuarterSelectChange(newVal); |
|
|
|
this.statisticsList = []; |
|
|
|
// } |
|
|
|
this.sizeForm.optionType = ""; |
|
|
|
// }, |
|
|
|
this.inBatchDialogVisible = false; |
|
|
|
// "sizeForm.optionType": function (newVal) { |
|
|
|
this.consumableVisible = false; |
|
|
|
// if (newVal && this.outDialogType === "add") { |
|
|
|
this.inBatchDialogVisible = false; |
|
|
|
// this.sizeForm.inTableData = []; |
|
|
|
this.batchSelectionVisible = false; |
|
|
|
// this.getMaterialList(); |
|
|
|
this.batchTableData = []; |
|
|
|
// } else if (newVal && this.outDialogType !== "add") { |
|
|
|
// this.inBatchForm.batchType = "" |
|
|
|
// this.getMaterialList(); |
|
|
|
// this.inBatchForm.department = "" |
|
|
|
// } |
|
|
|
this.sizeForm.demandEndInfo = ""; |
|
|
|
// }, |
|
|
|
|
|
|
|
|
|
|
|
if (this.sizeForm.options === 1) { |
|
|
|
|
|
|
|
this.getQuarterList(); |
|
|
|
|
|
|
|
this.inBatchDialogVisible = true; |
|
|
|
|
|
|
|
(this.inBatchForm.batchType = ""), (this.inBatchForm.department = ""); |
|
|
|
|
|
|
|
this.inBatchForm.optionType = ""; |
|
|
|
|
|
|
|
this.inBatchForm.optionType = ""; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 删除表格行数据 |
|
|
|
|
|
|
|
handleDelete(index, row) { |
|
|
|
|
|
|
|
this.sizeForm.inTableData.splice(index, 1); |
|
|
|
|
|
|
|
this.$message.success("已成功删除该条记录"); |
|
|
|
|
|
|
|
this.getStatistics(); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
|
|
|
|
// 监听需求单选择变化 |
|
|
|
|
|
|
|
// "inBatchForm.batchType": function (newVal) { |
|
|
|
|
|
|
|
// (this.inBatchForm.department = ""), (this.inBatchForm.optionType = 1); |
|
|
|
|
|
|
|
// if (newVal) { |
|
|
|
|
|
|
|
// this.onQuarterSelectChange(newVal); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// "sizeForm.optionType": function (newVal) { |
|
|
|
|
|
|
|
// if (newVal && this.outDialogType === "add") { |
|
|
|
|
|
|
|
// this.sizeForm.inTableData = []; |
|
|
|
|
|
|
|
// this.getMaterialList(); |
|
|
|
|
|
|
|
// } else if (newVal && this.outDialogType !== "add") { |
|
|
|
|
|
|
|
// this.getMaterialList(); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
|