|
|
|
|
@ -112,12 +112,10 @@ |
|
|
|
|
<el-table-column prop="materialName" label="物资名称"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-select |
|
|
|
|
v-model="scope.row.materialitem" |
|
|
|
|
v-model="scope.row.materialId" |
|
|
|
|
placeholder="请选择物资名称" |
|
|
|
|
style="width: 100%" |
|
|
|
|
@change=" |
|
|
|
|
handleMaterialChange(scope.row.materialitem, scope.$index) |
|
|
|
|
" |
|
|
|
|
@change="handleMaterialChange(scope.row, scope.$index)" |
|
|
|
|
v-if=" |
|
|
|
|
outDialogType != 'details' && |
|
|
|
|
sizeForm.options == 2 && |
|
|
|
|
@ -129,7 +127,7 @@ |
|
|
|
|
v-for="item in materials" |
|
|
|
|
:key="item.materialId" |
|
|
|
|
:label="item.materialName" |
|
|
|
|
:value="item" |
|
|
|
|
:value="item.materialId" |
|
|
|
|
> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
@ -191,8 +189,6 @@ |
|
|
|
|
v-if="sizeForm.options == 1" |
|
|
|
|
> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<!-- <span v-if="outDialogType != 'details'">{{ scope.row.outboundQuantity || 0 }}</span> |
|
|
|
|
<span v-else>{{ scope.row.outboundSumQuantity || 0 }}</span> --> |
|
|
|
|
<span>{{ scope.row.outboundQuantity || 0 }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
@ -500,6 +496,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
quarterYearMap: {}, |
|
|
|
|
quarterQuarterMap: {}, |
|
|
|
|
materials:[],//需求单的物料 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
@ -565,7 +562,6 @@ export default { |
|
|
|
|
const detail = this.sizeForm.inTableData.find( |
|
|
|
|
(item) => item.materialCode === stat.materialCode |
|
|
|
|
); |
|
|
|
|
console.log("detail", detail, stat); |
|
|
|
|
// |
|
|
|
|
if ( |
|
|
|
|
(this.sizeForm.options == 1 && |
|
|
|
|
@ -835,25 +831,30 @@ export default { |
|
|
|
|
) { |
|
|
|
|
this.consumableVisible = true; |
|
|
|
|
} else { |
|
|
|
|
const res = await getMaterialList({ |
|
|
|
|
getMaterialList({ |
|
|
|
|
optionType: this.sizeForm.optionType, |
|
|
|
|
}).then((res) => { |
|
|
|
|
this.materials = res.data.result; |
|
|
|
|
}); |
|
|
|
|
this.materials = res.data.result; |
|
|
|
|
} |
|
|
|
|
} catch (error) { |
|
|
|
|
this.$message.error("获取数据来源失败,请重试"); |
|
|
|
|
this.$message.error("获取失败,请重试"); |
|
|
|
|
} finally { |
|
|
|
|
this.loading = false; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 处理物资选择变化 |
|
|
|
|
handleMaterialChange(row, index) { |
|
|
|
|
this.sizeForm.inTableData[index].materialId = row.materialId; |
|
|
|
|
this.sizeForm.inTableData[index].model = row.model; |
|
|
|
|
this.sizeForm.inTableData[index].materialCode = row.materialCode; |
|
|
|
|
this.sizeForm.inTableData[index].materialName = row.materialName; |
|
|
|
|
this.sizeForm.inTableData[index].type = row.type; |
|
|
|
|
this.sizeForm.inTableData[index].unit = row.unit; |
|
|
|
|
let select = this.materials.filter( |
|
|
|
|
(item) => item.materialId === row.materialId |
|
|
|
|
)[0]; |
|
|
|
|
|
|
|
|
|
this.sizeForm.inTableData[index].materialId = select.materialId; |
|
|
|
|
this.sizeForm.inTableData[index].model = select.model; |
|
|
|
|
this.sizeForm.inTableData[index].materialCode = select.materialCode; |
|
|
|
|
this.sizeForm.inTableData[index].materialName = select.materialName; |
|
|
|
|
this.sizeForm.inTableData[index].type = select.type; |
|
|
|
|
this.sizeForm.inTableData[index].unit = select.unit; |
|
|
|
|
this.getStatistics(); |
|
|
|
|
}, |
|
|
|
|
// 提交 |
|
|
|
|
@ -895,7 +896,6 @@ export default { |
|
|
|
|
); |
|
|
|
|
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData.map( |
|
|
|
|
(row) => { |
|
|
|
|
console.log(row, "row"); |
|
|
|
|
const deptId = row.department; |
|
|
|
|
const dept = this.list.find((item) => item.departmentId === deptId); |
|
|
|
|
const oneFormId = row.id; |
|
|
|
|
@ -909,17 +909,14 @@ export default { |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
if(this.sizeForm.status == 1){ |
|
|
|
|
this.sizeForm.id = this.id |
|
|
|
|
if (this.outDialogTiltle == "编辑") { |
|
|
|
|
this.sizeForm.id = this.id; |
|
|
|
|
} |
|
|
|
|
console.log(this.sizeForm, "111"); |
|
|
|
|
// this.sizeForm.inTableData = []; |
|
|
|
|
if (this.sizeForm.options === 1) { |
|
|
|
|
this.sizeForm.optionType = this.inBatchForm.optionType; |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
const res = await submitData(this.sizeForm); |
|
|
|
|
console.log(this.sizeForm, "222"); |
|
|
|
|
if (res.data.success) { |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
@ -951,18 +948,12 @@ export default { |
|
|
|
|
this.sizeForm.options = Number(ldOneOutStorage.options); |
|
|
|
|
this.sizeForm.optionType = ldOneOutStorage.optionType; |
|
|
|
|
this.batchSelectionVisible = false; |
|
|
|
|
console.log( |
|
|
|
|
res.data.result.ldOneOutStorageDetails, |
|
|
|
|
"this.sizeForm.options" |
|
|
|
|
); |
|
|
|
|
ldOneOutStorageDetails.foreach(item=>{ |
|
|
|
|
item.materialId = item.materialId+''; |
|
|
|
|
}) |
|
|
|
|
this.$set( |
|
|
|
|
this.sizeForm, |
|
|
|
|
"inTableData", |
|
|
|
|
ldOneOutStorageDetails |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (this.sizeForm.options == 2 && this.sizeForm.optionType == "YH") { |
|
|
|
|
|
|
|
|
|
this.getMaterialList(); |
|
|
|
|
} |
|
|
|
|
this.$set(this.sizeForm, "inTableData", ldOneOutStorageDetails); |
|
|
|
|
this.getStatistics(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|