|
@@ -327,6 +327,15 @@
|
|
|
:model="{ warehousingMaterialList: warehousingMaterialList }"
|
|
:model="{ warehousingMaterialList: warehousingMaterialList }"
|
|
|
:show-message="false"
|
|
:show-message="false"
|
|
|
>
|
|
>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="warehousingMaterialList.length != 0"
|
|
|
|
|
+ type="success"
|
|
|
|
|
+ plain
|
|
|
|
|
+ style="margin-bottom: 20px; float: right; margin-right: 20px"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="listSaveArrs"
|
|
|
|
|
+ >批量保存</el-button
|
|
|
|
|
+ >
|
|
|
<el-table
|
|
<el-table
|
|
|
:header-cell-style="rowClass"
|
|
:header-cell-style="rowClass"
|
|
|
ref="multipleTable"
|
|
ref="multipleTable"
|
|
@@ -498,6 +507,13 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column label="总数" prop="counts">
|
|
|
|
|
+ <template slot-scope="{ row, $index }">
|
|
|
|
|
+ {{ row.minPackingCount * row.outInNum }}/{{
|
|
|
|
|
+ handleRowUnit(row)
|
|
|
|
|
+ }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="单价"
|
|
label="单价"
|
|
|
prop="univalence"
|
|
prop="univalence"
|
|
@@ -707,6 +723,7 @@
|
|
|
fixed="right"
|
|
fixed="right"
|
|
|
align="center"
|
|
align="center"
|
|
|
>
|
|
>
|
|
|
|
|
+ <template slot="header" slot-scope="scope"> 操作 </template>
|
|
|
<template slot-scope="{ row, $index }">
|
|
<template slot-scope="{ row, $index }">
|
|
|
<el-button
|
|
<el-button
|
|
|
type="text"
|
|
type="text"
|
|
@@ -1068,13 +1085,10 @@
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
async searchContact(id) {
|
|
async searchContact(id) {
|
|
|
- console.log(id);
|
|
|
|
|
const data = await contactlink({ contactId: id });
|
|
const data = await contactlink({ contactId: id });
|
|
|
- console.log(data);
|
|
|
|
|
this.contactList = data.data;
|
|
this.contactList = data.data;
|
|
|
},
|
|
},
|
|
|
async pickerSuccess(row) {
|
|
async pickerSuccess(row) {
|
|
|
- console.log('===row', row);
|
|
|
|
|
this.pickerRow = row;
|
|
this.pickerRow = row;
|
|
|
this.formData.extInfo.documentSource = row.orderNo;
|
|
this.formData.extInfo.documentSource = row.orderNo;
|
|
|
this.formData.clientName = row.partaName;
|
|
this.formData.clientName = row.partaName;
|
|
@@ -1108,12 +1122,10 @@
|
|
|
this.$refs.pickerRef.open();
|
|
this.$refs.pickerRef.open();
|
|
|
},
|
|
},
|
|
|
codeListValue(val) {
|
|
codeListValue(val) {
|
|
|
- console.log(val);
|
|
|
|
|
this.formData.extInfo.assetType = val.id;
|
|
this.formData.extInfo.assetType = val.id;
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
this.title = val?.name;
|
|
this.title = val?.name;
|
|
|
this.selectEquiType = val?.id;
|
|
this.selectEquiType = val?.id;
|
|
|
- console.log(this.title);
|
|
|
|
|
},
|
|
},
|
|
|
//计算生产设备重量
|
|
//计算生产设备重量
|
|
|
deviceWeight(row, num) {
|
|
deviceWeight(row, num) {
|
|
@@ -1142,17 +1154,16 @@
|
|
|
return total.PackingCount * total.outInNum * total.univalence;
|
|
return total.PackingCount * total.outInNum * total.univalence;
|
|
|
},
|
|
},
|
|
|
handleRowUnit(row) {
|
|
handleRowUnit(row) {
|
|
|
- console.log('===sss', this.formData);
|
|
|
|
|
if (this.formData.extInfo.assetType == 1) {
|
|
if (this.formData.extInfo.assetType == 1) {
|
|
|
- console.log(row);
|
|
|
|
|
return row.weightUnit;
|
|
return row.weightUnit;
|
|
|
} else if (this.formData.extInfo.assetType == 4) {
|
|
} else if (this.formData.extInfo.assetType == 4) {
|
|
|
return row.measuringUnit;
|
|
return row.measuringUnit;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return row.measuringUnit;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
changeVerfy(it) {
|
|
changeVerfy(it) {
|
|
|
this.formData.verifyName = it.name;
|
|
this.formData.verifyName = it.name;
|
|
|
- console.log(this.formData.verifyName);
|
|
|
|
|
},
|
|
},
|
|
|
//选择供应啥的操作
|
|
//选择供应啥的操作
|
|
|
ChangeSupplier(data) {
|
|
ChangeSupplier(data) {
|
|
@@ -1174,8 +1185,6 @@
|
|
|
return { background: '#EEEEEE', border: 'none' };
|
|
return { background: '#EEEEEE', border: 'none' };
|
|
|
},
|
|
},
|
|
|
calcSum(a, b, c, row) {
|
|
calcSum(a, b, c, row) {
|
|
|
- console.log(a, b, c);
|
|
|
|
|
-
|
|
|
|
|
if (
|
|
if (
|
|
|
(Number.isNaN(+a) && a !== '') ||
|
|
(Number.isNaN(+a) && a !== '') ||
|
|
|
(Number.isNaN(+b) && b !== '') ||
|
|
(Number.isNaN(+b) && b !== '') ||
|
|
@@ -1183,14 +1192,12 @@
|
|
|
) {
|
|
) {
|
|
|
return '';
|
|
return '';
|
|
|
}
|
|
}
|
|
|
- console.log(row);
|
|
|
|
|
|
|
|
|
|
return a * b * c + { yuan: '元', wanyuan: '万元' }[row.univalenceUnit];
|
|
return a * b * c + { yuan: '元', wanyuan: '万元' }[row.univalenceUnit];
|
|
|
// return a * b * c;
|
|
// return a * b * c;
|
|
|
},
|
|
},
|
|
|
// 部门 点击事件
|
|
// 部门 点击事件
|
|
|
async auditorDeptClick(data) {
|
|
async auditorDeptClick(data) {
|
|
|
- console.log(data);
|
|
|
|
|
this.formData.extInfo.verifyDeptCode = data?.id;
|
|
this.formData.extInfo.verifyDeptCode = data?.id;
|
|
|
this.formData.extInfo.verifyDeptName = data?.name;
|
|
this.formData.extInfo.verifyDeptName = data?.name;
|
|
|
this.formData.verifyId = '';
|
|
this.formData.verifyId = '';
|
|
@@ -1243,7 +1250,6 @@
|
|
|
},
|
|
},
|
|
|
// 仓库编辑
|
|
// 仓库编辑
|
|
|
handleWareHouse(row, idx) {
|
|
handleWareHouse(row, idx) {
|
|
|
- console.log('row===', row);
|
|
|
|
|
this.$refs.wareHouseDailogRef.open(row, idx);
|
|
this.$refs.wareHouseDailogRef.open(row, idx);
|
|
|
},
|
|
},
|
|
|
// 入库操作
|
|
// 入库操作
|
|
@@ -1253,7 +1259,6 @@
|
|
|
row.warehouseLedgerDetails = [];
|
|
row.warehouseLedgerDetails = [];
|
|
|
},
|
|
},
|
|
|
listSave(row, index) {
|
|
listSave(row, index) {
|
|
|
- console.log(this.formData);
|
|
|
|
|
const fileds = [
|
|
const fileds = [
|
|
|
// `warehousingMaterialList.${index}.cargoSpaceCode`,
|
|
// `warehousingMaterialList.${index}.cargoSpaceCode`,
|
|
|
`warehousingMaterialList.${index}.batchNo`,
|
|
`warehousingMaterialList.${index}.batchNo`,
|
|
@@ -1279,12 +1284,10 @@
|
|
|
this.$message.error('请选择资产编号!');
|
|
this.$message.error('请选择资产编号!');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- console.log(fileds);
|
|
|
|
|
Promise.all(
|
|
Promise.all(
|
|
|
fileds.map(
|
|
fileds.map(
|
|
|
(item) =>
|
|
(item) =>
|
|
|
new Promise(async (resolve, rej) => {
|
|
new Promise(async (resolve, rej) => {
|
|
|
- console.log('item', item);
|
|
|
|
|
this.$refs.warehousingMaterialListRef.validateField(
|
|
this.$refs.warehousingMaterialListRef.validateField(
|
|
|
item,
|
|
item,
|
|
|
(err) => {
|
|
(err) => {
|
|
@@ -1311,6 +1314,75 @@
|
|
|
this.$message.error('请填入必填项!');
|
|
this.$message.error('请填入必填项!');
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ listSaveArrs() {
|
|
|
|
|
+ const rows = this.warehousingMaterialList;
|
|
|
|
|
+ const indexes = Array.from(
|
|
|
|
|
+ { length: this.warehousingMaterialList.length },
|
|
|
|
|
+ (_, index) => index
|
|
|
|
|
+ );
|
|
|
|
|
+ rows.forEach((row, i) => {
|
|
|
|
|
+ const index = indexes[i];
|
|
|
|
|
+ console.log('rowroworoworworworworworworoworworoworoworw', row);
|
|
|
|
|
+ console.log('indexindexindexirnjkdfnjfndjkfn', index);
|
|
|
|
|
+ const fileds = [
|
|
|
|
|
+ // `warehousingMaterialList.${index}.cargoSpaceCode`,
|
|
|
|
|
+ `warehousingMaterialList.${index}.batchNo`,
|
|
|
|
|
+ `warehousingMaterialList.${index}.houseList`
|
|
|
|
|
+ ];
|
|
|
|
|
+ if (this.formData.bizType == 1) {
|
|
|
|
|
+ // fileds.push(...[`warehousingMaterialList.${index}.customCode`]);
|
|
|
|
|
+ } else if (this.formData.bizType == 2) {
|
|
|
|
|
+ // fileds.push(...[`warehousingMaterialList.${index}.supplierCode`]);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.formData.bizType != 5) {
|
|
|
|
|
+ fileds.push(
|
|
|
|
|
+ ...[
|
|
|
|
|
+ `warehousingMaterialList.${index}.outInNum`,
|
|
|
|
|
+ `warehousingMaterialList.${index}.minPackingCount`
|
|
|
|
|
+ ]
|
|
|
|
|
+ );
|
|
|
|
|
+ } else if (
|
|
|
|
|
+ this.warehousingMaterialList.some(
|
|
|
|
|
+ (i) => !i.selfWarehouseLedgerDetails?.length
|
|
|
|
|
+ )
|
|
|
|
|
+ ) {
|
|
|
|
|
+ this.$message.error('请选择资产编号!');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ Promise.all(
|
|
|
|
|
+ fileds.map(
|
|
|
|
|
+ (item) =>
|
|
|
|
|
+ new Promise(async (resolve, rej) => {
|
|
|
|
|
+ this.$refs.warehousingMaterialListRef.validateField(
|
|
|
|
|
+ item,
|
|
|
|
|
+ (err) => {
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ rej(err);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ resolve();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ })
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ this.$set(row, 'isSave', true);
|
|
|
|
|
+ if (this.formData.bizType != 5) {
|
|
|
|
|
+ this.createMaterialCode(row);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 退还
|
|
|
|
|
+ this.createMaterialCodeReturn(row);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ // this.$message.error('请填入必填项!');
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // listSaveArrs() {
|
|
|
|
|
+ // console.log(this.warehousingMaterialList);
|
|
|
|
|
+ // },
|
|
|
// 批量设置生产日期
|
|
// 批量设置生产日期
|
|
|
handleSelectionChange(val) {
|
|
handleSelectionChange(val) {
|
|
|
this.materialCodeReqListSelected = val;
|
|
this.materialCodeReqListSelected = val;
|
|
@@ -1333,6 +1405,7 @@
|
|
|
},
|
|
},
|
|
|
// 入库明细生成条码信息
|
|
// 入库明细生成条码信息
|
|
|
async createMaterialCode(row) {
|
|
async createMaterialCode(row) {
|
|
|
|
|
+ console.lot('====', row);
|
|
|
// 添加相同物品、批次号重新更新明细 原料编码
|
|
// 添加相同物品、批次号重新更新明细 原料编码
|
|
|
const list = this.warehousingMaterialList.filter(
|
|
const list = this.warehousingMaterialList.filter(
|
|
|
(i) =>
|
|
(i) =>
|
|
@@ -1340,7 +1413,6 @@
|
|
|
i.batchNo === row.batchNo &&
|
|
i.batchNo === row.batchNo &&
|
|
|
i.isSave
|
|
i.isSave
|
|
|
);
|
|
);
|
|
|
-
|
|
|
|
|
const num = list.reduce((num, pre) => {
|
|
const num = list.reduce((num, pre) => {
|
|
|
num += row.isUnpack
|
|
num += row.isUnpack
|
|
|
? pre.outInNum * pre.minPackingCount
|
|
? pre.outInNum * pre.minPackingCount
|
|
@@ -1348,10 +1420,16 @@
|
|
|
return num;
|
|
return num;
|
|
|
}, 0);
|
|
}, 0);
|
|
|
|
|
|
|
|
|
|
+ const nums = list.reduce((num, pre) => {
|
|
|
|
|
+ num += pre.outInNum * pre.minPackingCount;
|
|
|
|
|
+
|
|
|
|
|
+ return num;
|
|
|
|
|
+ }, 0);
|
|
|
|
|
+
|
|
|
const res = await outin.getAssetNum({
|
|
const res = await outin.getAssetNum({
|
|
|
assetCode: row.assetCode,
|
|
assetCode: row.assetCode,
|
|
|
batchNum: row.batchNo,
|
|
batchNum: row.batchNo,
|
|
|
- num
|
|
|
|
|
|
|
+ num: row.measuringUnit == 'PCS' ? nums : num
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
list.forEach((item) => {
|
|
list.forEach((item) => {
|
|
@@ -1360,6 +1438,15 @@
|
|
|
i.onlyCode = res.shift().onlyCode;
|
|
i.onlyCode = res.shift().onlyCode;
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ console.log(' item.isUnpack', item.isUnpack);
|
|
|
|
|
+ console.log('1', +item.outInNum);
|
|
|
|
|
+ console.log('2', item);
|
|
|
|
|
+ console.log(
|
|
|
|
|
+ '3',
|
|
|
|
|
+ item.isUnpack
|
|
|
|
|
+ ? item.outInNum * item.minPackingCount
|
|
|
|
|
+ : +item.minPackingCount
|
|
|
|
|
+ );
|
|
|
this.$set(
|
|
this.$set(
|
|
|
item,
|
|
item,
|
|
|
'warehouseLedgerDetails',
|
|
'warehouseLedgerDetails',
|
|
@@ -1367,6 +1454,8 @@
|
|
|
new Array(
|
|
new Array(
|
|
|
item.isUnpack
|
|
item.isUnpack
|
|
|
? item.outInNum * item.minPackingCount
|
|
? item.outInNum * item.minPackingCount
|
|
|
|
|
+ : item.measuringUnit == 'PCS'
|
|
|
|
|
+ ? +item.outInNum * parseInt(item.minPackingCount)
|
|
|
: +item.outInNum
|
|
: +item.outInNum
|
|
|
),
|
|
),
|
|
|
(val, idx) => {
|
|
(val, idx) => {
|
|
@@ -1426,7 +1515,6 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- console.log('rrrrr', this.warehousingMaterialList);
|
|
|
|
|
},
|
|
},
|
|
|
// 入库明细生成条码信息 退还
|
|
// 入库明细生成条码信息 退还
|
|
|
async createMaterialCodeReturn(row) {
|
|
async createMaterialCodeReturn(row) {
|
|
@@ -1537,7 +1625,6 @@
|
|
|
outInWarehouse: { ...this.formData, type: 1 },
|
|
outInWarehouse: { ...this.formData, type: 1 },
|
|
|
warehouseLedgerInfos: this.warehousingMaterialList
|
|
warehouseLedgerInfos: this.warehousingMaterialList
|
|
|
};
|
|
};
|
|
|
- console.log('第一层', this.warehousingMaterialList);
|
|
|
|
|
|
|
|
|
|
for (let key in this.warehousingMaterialList) {
|
|
for (let key in this.warehousingMaterialList) {
|
|
|
for (let k in this.warehousingMaterialList[key].houseList) {
|
|
for (let k in this.warehousingMaterialList[key].houseList) {
|
|
@@ -1568,7 +1655,7 @@
|
|
|
this.warehousingMaterialList[key].houseList[k].num;
|
|
this.warehousingMaterialList[key].houseList[k].num;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- // console.log('充值', this.warehousingMaterialList);
|
|
|
|
|
|
|
+ console.log('===', this.warehousingMaterialList);
|
|
|
let arr = this.warehousingMaterialList.map((item) => {
|
|
let arr = this.warehousingMaterialList.map((item) => {
|
|
|
return {
|
|
return {
|
|
|
num: item.num,
|
|
num: item.num,
|
|
@@ -1579,7 +1666,7 @@
|
|
|
? item.categoryId
|
|
? item.categoryId
|
|
|
: item.id
|
|
: item.id
|
|
|
: item.id,
|
|
: item.id,
|
|
|
- count: item.outInNum,
|
|
|
|
|
|
|
+ count: parseInt(item.outInNum) * parseInt(item.minPackingCount),
|
|
|
minPackingCount: item.minPackingCount,
|
|
minPackingCount: item.minPackingCount,
|
|
|
packingCount: item.outInNum,
|
|
packingCount: item.outInNum,
|
|
|
price: item.univalence,
|
|
price: item.univalence,
|
|
@@ -1673,8 +1760,6 @@
|
|
|
return cur;
|
|
return cur;
|
|
|
})
|
|
})
|
|
|
);
|
|
);
|
|
|
-
|
|
|
|
|
- console.log('sasasa===', this.warehousingMaterialList);
|
|
|
|
|
},
|
|
},
|
|
|
async initData() {
|
|
async initData() {
|
|
|
const { data } = await getTreeByGroup({ type: 1 });
|
|
const { data } = await getTreeByGroup({ type: 1 });
|