|
@@ -286,7 +286,7 @@
|
|
|
|
|
|
<el-table
|
|
|
v-loading="loading"
|
|
|
- :data="materialInfo"
|
|
|
+ :data="basicForm.materialInfo"
|
|
|
fit
|
|
|
border
|
|
|
max-height="280"
|
|
@@ -316,9 +316,10 @@
|
|
|
align="center"
|
|
|
prop="materialCode"
|
|
|
width="200px"
|
|
|
+ :render-header="addRedStar"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-form-item class="hang" :prop="'materialInfo.' + scope.$index + '.materialCode'" :rules="basicForm.materialCode">
|
|
|
+ <el-form-item class="hang" :prop="'materialInfo.' + scope.$index + '.materialCode'" :show-message="false" :rules="{ required: true, message: '请选择物料', trigger: 'blur' }">
|
|
|
<el-input
|
|
|
clearable
|
|
|
:disabled="sonDisable"
|
|
@@ -397,9 +398,11 @@
|
|
|
align="center"
|
|
|
prop="qty"
|
|
|
width="150px"
|
|
|
+ :render-header="addRedStar"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-form-item class="hang">
|
|
|
+
|
|
|
+ <el-form-item class="hang" :prop="'materialInfo.' + scope.$index + '.qty'" :show-message="false" :rules="{ required: true, message: '请填写数量', trigger: 'blur' }">
|
|
|
<el-input
|
|
|
type="number"
|
|
|
min="0"
|
|
@@ -502,9 +505,10 @@
|
|
|
align="center"
|
|
|
prop="storageDeptName"
|
|
|
width="220px"
|
|
|
+ :render-header="addRedStar"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-form-item class="hang">
|
|
|
+ <el-form-item class="hang" :prop="'materialInfo.' + scope.$index + '.storageDeptName'" :show-message="false" :rules="{ required: true, message: '请填写调入部门', trigger: 'blur' }">
|
|
|
<el-input
|
|
|
clearable
|
|
|
:disabled="sonDisable || isOrg"
|
|
@@ -648,9 +652,10 @@
|
|
|
align="center"
|
|
|
prop="allotDate"
|
|
|
width="230px"
|
|
|
+ :render-header="addRedStar"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-form-item class="hang">
|
|
|
+ <el-form-item class="hang" :prop="'materialInfo.' + scope.$index + '.allotDate'" :show-message="false" :rules="{ required: true, message: '请填写调拨日期', trigger: 'blur' }">
|
|
|
<el-date-picker
|
|
|
ref="findDate"
|
|
|
v-model="scope.row.allotDate"
|
|
@@ -1481,6 +1486,7 @@ export default {
|
|
|
createByName: "",
|
|
|
updateByName: "",
|
|
|
delFlag: "",
|
|
|
+ materialInfo: [],
|
|
|
},
|
|
|
referCondition: {
|
|
|
type: "",
|
|
@@ -1532,11 +1538,8 @@ export default {
|
|
|
deliveryDept:[
|
|
|
{ required: true, message: "调出部门不能为空", trigger: "blur" },
|
|
|
],
|
|
|
- materialCode:[
|
|
|
- { required: true, message: "明细物料不能为空", trigger: "blur" },
|
|
|
- ],
|
|
|
},
|
|
|
- materialInfo: [],
|
|
|
+ // materialInfo: [],
|
|
|
receiveInfo: [],
|
|
|
priceList: [],
|
|
|
resultList: [],
|
|
@@ -1568,7 +1571,7 @@ export default {
|
|
|
methods: {
|
|
|
// 改变单据日期时清空子表的调拨日期
|
|
|
changeBillDate() {
|
|
|
- this.materialInfo.forEach((item) => {
|
|
|
+ this.basicForm.materialInfo.forEach((item) => {
|
|
|
item.allotDate = null;
|
|
|
});
|
|
|
},
|
|
@@ -1593,7 +1596,7 @@ export default {
|
|
|
controlDCHW() {
|
|
|
console.log("🚀 ~ file: add.vue:735 调出货位");
|
|
|
this.isDCCk = true;
|
|
|
- this.materialInfo.forEach((item) => {
|
|
|
+ this.basicForm.materialInfo.forEach((item) => {
|
|
|
item.deliveryAllocation = null;
|
|
|
item.deliveryAllocationName = null;
|
|
|
});
|
|
@@ -1601,7 +1604,7 @@ export default {
|
|
|
controlDRHW() {
|
|
|
console.log("🚀 ~ file: add.vue:735 调入货位");
|
|
|
this.isDRCk = true;
|
|
|
- this.materialInfo.forEach((item) => {
|
|
|
+ this.basicForm.materialInfo.forEach((item) => {
|
|
|
item.storageAllocation = null;
|
|
|
item.storageAllocationName = null;
|
|
|
});
|
|
@@ -1610,7 +1613,7 @@ export default {
|
|
|
getZSL(scope) {
|
|
|
scope.row.qty = scope.row.mainQty;
|
|
|
let sum = 0
|
|
|
- this.materialInfo.forEach(item => {
|
|
|
+ this.basicForm.materialInfo.forEach(item => {
|
|
|
sum += Number(item.qty)
|
|
|
this.basicForm.qty = sum
|
|
|
})
|
|
@@ -1618,7 +1621,7 @@ export default {
|
|
|
getSL(scope) {
|
|
|
scope.row.mainQty = scope.row.qty;
|
|
|
let sum = 0
|
|
|
- this.materialInfo.forEach(item => {
|
|
|
+ this.basicForm.materialInfo.forEach(item => {
|
|
|
sum += Number(item.qty)
|
|
|
this.basicForm.qty = sum
|
|
|
})
|
|
@@ -1642,8 +1645,8 @@ export default {
|
|
|
this.basicForm.storageCode = "";
|
|
|
this.basicForm.deliveryCode = "";
|
|
|
// 复制新增把id,编码,创建人置为空,子表去掉id
|
|
|
- if (this.materialInfo.length !== 0) {
|
|
|
- this.materialInfo.forEach((item) => {
|
|
|
+ if (this.basicForm.materialInfo.length !== 0) {
|
|
|
+ this.basicForm.materialInfo.forEach((item) => {
|
|
|
if (item.deliveryCode) {
|
|
|
item.deliveryCode = "";
|
|
|
}
|
|
@@ -1689,7 +1692,7 @@ export default {
|
|
|
},
|
|
|
submit() {
|
|
|
this.$modal.loading("提交中...");
|
|
|
- this.basicForm.stAllotMaterialList = this.materialInfo;
|
|
|
+ this.basicForm.stAllotMaterialList = this.basicForm.materialInfo;
|
|
|
this.basicForm.stAllotReceiveDeliverList = this.receiveInfo;
|
|
|
this.basicForm.stAllotReceiveExecuteList = this.priceList;
|
|
|
this.basicForm.stAllotReceiveExpenseList = this.resultList;
|
|
@@ -1708,9 +1711,9 @@ export default {
|
|
|
save() {
|
|
|
this.$refs["basic"].validate(async (valid, obj) => {
|
|
|
if (valid) {
|
|
|
- if (this.materialInfo.length !== 0) {
|
|
|
+ if (this.basicForm.materialInfo.length !== 0) {
|
|
|
if (this.sonPageStu == "add") {
|
|
|
- this.basicForm.stAllotMaterialList = this.materialInfo;
|
|
|
+ this.basicForm.stAllotMaterialList = this.basicForm.materialInfo;
|
|
|
this.basicForm.stAllotReceiveDeliverList = this.receiveInfo;
|
|
|
this.basicForm.stAllotReceiveExecuteList = this.priceList;
|
|
|
this.basicForm.stAllotReceiveExpenseList = this.resultList;
|
|
@@ -1727,7 +1730,7 @@ export default {
|
|
|
this.$modal.closeLoading();
|
|
|
});
|
|
|
} else if (this.sonPageStu == "edit") {
|
|
|
- this.basicForm.stAllotMaterialList = this.materialInfo;
|
|
|
+ this.basicForm.stAllotMaterialList = this.basicForm.materialInfo;
|
|
|
this.basicForm.stAllotReceiveDeliverList = this.receiveInfo;
|
|
|
this.basicForm.stAllotReceiveExecuteList = this.priceList;
|
|
|
this.basicForm.stAllotReceiveExpenseList = this.resultList;
|
|
@@ -1748,6 +1751,7 @@ export default {
|
|
|
this.$modal.notifyWarning("明细行不能为空");
|
|
|
}
|
|
|
} else {
|
|
|
+ console.log("obj",obj);
|
|
|
const jiaoyan = []
|
|
|
for(let key in obj) {
|
|
|
jiaoyan.push(obj[key][0].message);
|
|
@@ -1771,7 +1775,7 @@ export default {
|
|
|
getOrderDetail(row.id).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
this.basicForm = res.data;
|
|
|
- this.materialInfo = res.data.stAllotMaterialList;
|
|
|
+ this.basicForm.materialInfo = res.data.stAllotMaterialList;
|
|
|
this.receiveInfo = res.data.stAllotReceiveDeliverList;
|
|
|
this.priceList = res.data.stAllotReceiveExecuteList;
|
|
|
this.resultList = res.data.stAllotReceiveExpenseList;
|
|
@@ -1861,7 +1865,7 @@ export default {
|
|
|
this.chuHouseOptions = res.rows;
|
|
|
}
|
|
|
if (type == "UNIT_PARAM") {
|
|
|
- this.materialInfo[this.tableIndex].unitCode = res.rows[0].code;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].unitCode = res.rows[0].code;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -1915,15 +1919,24 @@ export default {
|
|
|
customerLogisticName: null,
|
|
|
delFlag: 0,
|
|
|
};
|
|
|
- this.materialInfo.push(newLine);
|
|
|
+ this.basicForm.materialInfo.push(newLine);
|
|
|
},
|
|
|
- delLine($index) {
|
|
|
- console.log("删除行:", $index);
|
|
|
- this.materialInfo = this.materialInfo.map((item, index) => ({
|
|
|
- ...item,
|
|
|
- delFlag: index === $index ? "2" : item.delFlag,
|
|
|
- }));
|
|
|
- console.log("看看列表", this.materialInfo);
|
|
|
+ delLine(index,row) {
|
|
|
+ // this.basicForm.materialInfo = this.basicForm.materialInfo.map((item, index) => ({
|
|
|
+ // ...item,
|
|
|
+ // delFlag: index === $index ? "2" : item.delFlag,
|
|
|
+ // }));
|
|
|
+
|
|
|
+ if (row.id) {
|
|
|
+ this.basicForm.materialInfo.forEach(e => {
|
|
|
+ if(e.id == row.id){
|
|
|
+ e.delFlag = '2'
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.basicForm.materialInfo.splice(index, 1);
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
//
|
|
|
rowClassName(prop) {
|
|
@@ -1988,7 +2001,7 @@ export default {
|
|
|
this.basicForm.storageWarehouseName = selection[0].name;
|
|
|
console.log("1111", selection[0].csFlag);
|
|
|
// 清空调入货位
|
|
|
- this.materialInfo.forEach((item) => {
|
|
|
+ this.basicForm.materialInfo.forEach((item) => {
|
|
|
item.storageAllocation = null;
|
|
|
item.storageAllocationName = null;
|
|
|
});
|
|
@@ -2005,7 +2018,7 @@ export default {
|
|
|
this.basicForm.deliveryWarehouseName = selection[0].name;
|
|
|
console.log("2222", selection[0].csFlag);
|
|
|
// 清空调出货位
|
|
|
- this.materialInfo.forEach((item) => {
|
|
|
+ this.basicForm.materialInfo.forEach((item) => {
|
|
|
item.deliveryAllocation = null;
|
|
|
item.deliveryAllocationName = null;
|
|
|
});
|
|
@@ -2016,22 +2029,29 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if (this.referCondition.title == "调出货位") {
|
|
|
- this.materialInfo[this.tableIndex].deliveryAllocationName =
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].deliveryAllocationName =
|
|
|
selection[0].name;
|
|
|
- this.materialInfo[this.tableIndex].deliveryAllocation = selection[0].id;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].deliveryAllocation = selection[0].id;
|
|
|
}
|
|
|
if (this.referCondition.title == "调入货位") {
|
|
|
- this.materialInfo[this.tableIndex].storageAllocationName =
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].storageAllocationName =
|
|
|
selection[0].name;
|
|
|
- this.materialInfo[this.tableIndex].storageAllocation = selection[0].id;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].storageAllocation = selection[0].id;
|
|
|
}
|
|
|
if (this.referCondition.title == "调入部门") {
|
|
|
- this.materialInfo[this.tableIndex].storageDeptName = selection[0].name;
|
|
|
- this.materialInfo[this.tableIndex].storageDept = selection[0].id;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].storageDeptName = selection[0].name;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].storageDept = selection[0].id;
|
|
|
}
|
|
|
// 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
|
|
|
this.controlCk();
|
|
|
},
|
|
|
+ // 必选标识
|
|
|
+ addRedStar(h, { column }) {
|
|
|
+ return [
|
|
|
+ h('span', { style: 'color: #F56C6C' }, '*'),
|
|
|
+ h('span', ' ' + column.label)
|
|
|
+ ];
|
|
|
+ },
|
|
|
// 调出库存组织清空相关数据
|
|
|
clearDCZZ() {
|
|
|
// 清空调出仓库,部门
|
|
@@ -2041,7 +2061,7 @@ export default {
|
|
|
this.basicForm.deliveryDept = "";
|
|
|
this.basicForm.deliveryDeptName = "";
|
|
|
// 清空调出货位且禁用
|
|
|
- this.materialInfo.forEach((item) => {
|
|
|
+ this.basicForm.materialInfo.forEach((item) => {
|
|
|
item.deliveryAllocation = null;
|
|
|
item.deliveryAllocationName = null;
|
|
|
});
|
|
@@ -2062,12 +2082,12 @@ export default {
|
|
|
this.basicForm.storageWarehouse = "";
|
|
|
this.basicForm.storageWarehouseName = "";
|
|
|
// 清空调入部门
|
|
|
- this.materialInfo.forEach((item) => {
|
|
|
+ this.basicForm.materialInfo.forEach((item) => {
|
|
|
item.storageDept = null;
|
|
|
item.storageDeptName = null;
|
|
|
});
|
|
|
// 清空调入货位且禁用
|
|
|
- this.materialInfo.forEach((item) => {
|
|
|
+ this.basicForm.materialInfo.forEach((item) => {
|
|
|
item.storageAllocation = null;
|
|
|
item.storageAllocationName = null;
|
|
|
});
|
|
@@ -2107,22 +2127,22 @@ export default {
|
|
|
selectMaterial(selection) {
|
|
|
console.log("选中的物料", selection);
|
|
|
// 先清空通用名,调入调出结算规则明细
|
|
|
- this.materialInfo[this.tableIndex].ruleDetail = ''
|
|
|
- this.materialInfo[this.tableIndex].commonCode = ''
|
|
|
- this.materialInfo[this.tableIndex].material = selection[0].id;
|
|
|
- this.materialInfo[this.tableIndex].materialCode = selection[0].code;
|
|
|
- this.materialInfo[this.tableIndex].materialName = selection[0].name;
|
|
|
- this.materialInfo[this.tableIndex].specification = selection[0].specification;
|
|
|
- this.materialInfo[this.tableIndex].model = selection[0].model;
|
|
|
- this.materialInfo[this.tableIndex].originPlace = selection[0].originPlace;
|
|
|
- this.materialInfo[this.tableIndex].originPlaceName = selection[0].originPlaceName;
|
|
|
- this.materialInfo[this.tableIndex].unit = selection[0].unitId;
|
|
|
- this.materialInfo[this.tableIndex].mainUnit = selection[0].unitId;
|
|
|
- this.materialInfo[this.tableIndex].unitName = selection[0].unitIdName;
|
|
|
- this.materialInfo[this.tableIndex].mainUnitName = selection[0].unitIdName;
|
|
|
- this.materialInfo[this.tableIndex].manufacturer = selection[0].manufacturerIdName;
|
|
|
- this.materialInfo[this.tableIndex].marketingApprovalPersonal = selection[0].registrant;
|
|
|
- this.materialInfo[this.tableIndex].production = selection[0].productionPermit;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].ruleDetail = ''
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].commonCode = ''
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].material = selection[0].id;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].materialCode = selection[0].code;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].materialName = selection[0].name;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].specification = selection[0].specification;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].model = selection[0].model;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].originPlace = selection[0].originPlace;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].originPlaceName = selection[0].originPlaceName;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].unit = selection[0].unitId;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].mainUnit = selection[0].unitId;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].unitName = selection[0].unitIdName;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].mainUnitName = selection[0].unitIdName;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].manufacturer = selection[0].manufacturerIdName;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].marketingApprovalPersonal = selection[0].registrant;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].production = selection[0].productionPermit;
|
|
|
// 根据物料单位id查询单位code
|
|
|
this.reBackRefer("UNIT_PARAM", selection[0].unitId);
|
|
|
},
|
|
@@ -2131,8 +2151,8 @@ export default {
|
|
|
this.tableIndex = index;
|
|
|
this.referCondition.orgId = this.basicForm.deliveryInventoryOrg;
|
|
|
this.referCondition.materialCode =
|
|
|
- this.materialInfo[this.tableIndex].materialCode;
|
|
|
- this.referCondition.unitId = this.materialInfo[this.tableIndex].unit;
|
|
|
+ this.basicForm.materialInfo[this.tableIndex].materialCode;
|
|
|
+ this.referCondition.unitId = this.basicForm.materialInfo[this.tableIndex].unit;
|
|
|
this.referCondition.warehouseId = this.basicForm.deliveryWarehouse;
|
|
|
this.$refs.batchRefer.init(this.referCondition);
|
|
|
},
|
|
@@ -2173,7 +2193,7 @@ export default {
|
|
|
if (val == "调入仓库") {
|
|
|
this.basicForm.storageWarehouse = "";
|
|
|
this.basicForm.storageWarehouseName = "";
|
|
|
- this.materialInfo.forEach((item) => {
|
|
|
+ this.basicForm.materialInfo.forEach((item) => {
|
|
|
item.storageAllocation = null;
|
|
|
item.storageAllocationName = null;
|
|
|
});
|
|
@@ -2192,35 +2212,35 @@ export default {
|
|
|
// 明细选择框清空
|
|
|
cleanMx(index, val) {
|
|
|
if (val == "物料编码") {
|
|
|
- this.materialInfo[index].material = "";
|
|
|
- this.materialInfo[index].materialCode = "";
|
|
|
- this.materialInfo[index].materialName = "";
|
|
|
- this.materialInfo[index].specification = "";
|
|
|
- this.materialInfo[index].model = "";
|
|
|
- this.materialInfo[index].originPlace = "";
|
|
|
- this.materialInfo[index].originPlaceName = "";
|
|
|
- this.materialInfo[index].unit = "";
|
|
|
- this.materialInfo[index].mainUnit = "";
|
|
|
- this.materialInfo[index].unitName = "";
|
|
|
- this.materialInfo[index].mainUnitName = "";
|
|
|
- this.materialInfo[index].manufacturer = "";
|
|
|
- this.materialInfo[index].ruleDetail = ''
|
|
|
- this.materialInfo[index].commonCode = ''
|
|
|
- this.materialInfo[index].marketingApprovalPersonal = "";
|
|
|
- this.materialInfo[index].production = "";
|
|
|
- this.materialInfo[index].unitCode = "";
|
|
|
+ this.basicForm.materialInfo[index].material = "";
|
|
|
+ this.basicForm.materialInfo[index].materialCode = "";
|
|
|
+ this.basicForm.materialInfo[index].materialName = "";
|
|
|
+ this.basicForm.materialInfo[index].specification = "";
|
|
|
+ this.basicForm.materialInfo[index].model = "";
|
|
|
+ this.basicForm.materialInfo[index].originPlace = "";
|
|
|
+ this.basicForm.materialInfo[index].originPlaceName = "";
|
|
|
+ this.basicForm.materialInfo[index].unit = "";
|
|
|
+ this.basicForm.materialInfo[index].mainUnit = "";
|
|
|
+ this.basicForm.materialInfo[index].unitName = "";
|
|
|
+ this.basicForm.materialInfo[index].mainUnitName = "";
|
|
|
+ this.basicForm.materialInfo[index].manufacturer = "";
|
|
|
+ this.basicForm.materialInfo[index].ruleDetail = ''
|
|
|
+ this.basicForm.materialInfo[index].commonCode = ''
|
|
|
+ this.basicForm.materialInfo[index].marketingApprovalPersonal = "";
|
|
|
+ this.basicForm.materialInfo[index].production = "";
|
|
|
+ this.basicForm.materialInfo[index].unitCode = "";
|
|
|
}
|
|
|
if (val == "调出货位") {
|
|
|
- this.materialInfo[index].deliveryAllocationName = "";
|
|
|
- this.materialInfo[index].deliveryAllocation = "";
|
|
|
+ this.basicForm.materialInfo[index].deliveryAllocationName = "";
|
|
|
+ this.basicForm.materialInfo[index].deliveryAllocation = "";
|
|
|
}
|
|
|
if (val == "调入部门") {
|
|
|
- this.materialInfo[index].storageDeptName = "";
|
|
|
- this.materialInfo[index].storageDept = "";
|
|
|
+ this.basicForm.materialInfo[index].storageDeptName = "";
|
|
|
+ this.basicForm.materialInfo[index].storageDept = "";
|
|
|
}
|
|
|
if (val == "调入货位") {
|
|
|
- this.materialInfo[index].storageAllocationName = "";
|
|
|
- this.materialInfo[index].storageAllocation = "";
|
|
|
+ this.basicForm.materialInfo[index].storageAllocationName = "";
|
|
|
+ this.basicForm.materialInfo[index].storageAllocation = "";
|
|
|
}
|
|
|
},
|
|
|
jumpOA() {
|