|
|
@@ -80,7 +80,7 @@
|
|
|
<!-- <el-input v-model="scope.row.batchNo" v-no-chinese></el-input> -->
|
|
|
<el-select
|
|
|
v-model="scope.row.batchStockId"
|
|
|
- clearable
|
|
|
+ clearable
|
|
|
placeholder="请选择"
|
|
|
@change="batchNoChange(scope.$index, scope.row)"
|
|
|
>
|
|
|
@@ -159,6 +159,7 @@
|
|
|
type="number"
|
|
|
v-model="scope.row.increaseTotalWeight"
|
|
|
style="width: 100%"
|
|
|
+ disabled
|
|
|
>
|
|
|
<template slot="append">
|
|
|
{{ scope.row.weightUnit }}
|
|
|
@@ -214,7 +215,7 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
|
|
|
- <template v-slot:singleWeight="scope" >
|
|
|
+ <template v-slot:singleWeight="scope">
|
|
|
<el-form-item
|
|
|
style="margin-bottom: 20px"
|
|
|
:rules="{
|
|
|
@@ -229,6 +230,7 @@
|
|
|
type="number"
|
|
|
placeholder="请输入"
|
|
|
:disabled="needProduce == 4"
|
|
|
+ @input="changeCount(scope.row, scope.$index)"
|
|
|
>
|
|
|
<template slot="append">
|
|
|
{{ scope.row.weightUnit }}
|
|
|
@@ -290,10 +292,7 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:warehouseNum="scope">
|
|
|
- <el-form-item
|
|
|
- :prop="'datasource.' + scope.$index + '.warehouseNum'"
|
|
|
- >
|
|
|
-
|
|
|
+ <el-form-item :prop="'datasource.' + scope.$index + '.warehouseNum'">
|
|
|
<span>{{ scope.row.warehouseNum }}</span>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
@@ -333,6 +332,7 @@
|
|
|
</DictSelection>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
+
|
|
|
<template v-slot:colorKey="scope">
|
|
|
<el-form-item :prop="'datasource.' + scope.$index + '.' + 'colorKey'">
|
|
|
<DictSelection
|
|
|
@@ -413,17 +413,14 @@
|
|
|
} from '@/api/saleManage/saleorder';
|
|
|
|
|
|
import { copyObj } from '@/utils/util';
|
|
|
- import { getFile } from '@/api/system/file';
|
|
|
import innertboundDetailsDialog from '@/BIZComponents/innerboundDetailsDialog.vue';
|
|
|
import stockLedgerDialog from './stockLedger/stockLedgerDialog.vue';
|
|
|
|
|
|
import getDynamicsColumns from '@/mixins/getDynamicsColumns';
|
|
|
- // import fileMain from '@/components/addDoc/index.vue';
|
|
|
import selectStockLedgerDialog from '@/BIZComponents/selectStockLedger/selectStockLedgerDialog.vue'; //库存台账
|
|
|
import BIZproductList from '@/BIZComponents/product-list.vue';
|
|
|
- import { lbjtList } from '@/enum/dict.js';
|
|
|
import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
- import { levelList } from '@/enum/dict.js';
|
|
|
+ import { levelList, pricingWayList, lbjtList } from '@/enum/dict.js';
|
|
|
import { changeCount } from '@/BIZComponents/setProduct.js';
|
|
|
import { parameterGetByCode } from '@/api/main/index.js';
|
|
|
import { getSummaries } from '@/utils/util.js';
|
|
|
@@ -463,7 +460,7 @@
|
|
|
productListNew,
|
|
|
stockLedgerDialog,
|
|
|
selectStockLedgerDialog,
|
|
|
- BIZproductList,
|
|
|
+ BIZproductList
|
|
|
},
|
|
|
data() {
|
|
|
const defaultForm = {
|
|
|
@@ -531,7 +528,7 @@
|
|
|
datasource: []
|
|
|
},
|
|
|
rules: {},
|
|
|
- columnsVersion: 1,
|
|
|
+ columnsVersion: 1
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
@@ -591,6 +588,18 @@
|
|
|
slot: 'productCategoryName',
|
|
|
align: 'center'
|
|
|
},
|
|
|
+ {
|
|
|
+ width: 140,
|
|
|
+ prop: 'pricingWay',
|
|
|
+ label: '计价方式',
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left',
|
|
|
+
|
|
|
+ formatter: (row, column) => {
|
|
|
+ return pricingWayList.find((item) => item.id == row.pricingWay)
|
|
|
+ ?.name;
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
width: 160,
|
|
|
prop: 'batchStockId',
|
|
|
@@ -708,13 +717,6 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- // {
|
|
|
- // width: 150,
|
|
|
- // prop: 'saleUnit',
|
|
|
- // label: '单位',
|
|
|
- // slot: 'saleUnit',
|
|
|
- // align: 'center'
|
|
|
- // },
|
|
|
{
|
|
|
width: 120,
|
|
|
prop: 'packingSpecification',
|
|
|
@@ -768,7 +770,7 @@
|
|
|
prop: 'singleWeight',
|
|
|
slot: 'singleWeight',
|
|
|
label: '单重',
|
|
|
-
|
|
|
+
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
@@ -964,9 +966,7 @@
|
|
|
' '
|
|
|
);
|
|
|
},
|
|
|
- downloadFile(file) {
|
|
|
- getFile({ objectName: file.storePath }, file.name);
|
|
|
- },
|
|
|
+
|
|
|
//发货明细选择
|
|
|
stockLedgerSelect(row, index) {
|
|
|
this.curIndex = index;
|
|
|
@@ -976,44 +976,10 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- // changeCount1(row, index) {
|
|
|
- // this.tableHandleKeyUp(row, index, 'sum');
|
|
|
- // this.changeCount(row, index);
|
|
|
- // },
|
|
|
packingChange(item, index) {
|
|
|
this.$set(this.form.datasource[index], 'saleUnit', item.conversionUnit);
|
|
|
},
|
|
|
- //改变数量
|
|
|
- // changeCount() {
|
|
|
- // this.form.datasource.forEach((item, index) => {
|
|
|
- // if (item.pricingWay == 1) {
|
|
|
- // this.$set(
|
|
|
- // this.form.datasource[index],
|
|
|
- // 'discountTotalPrice',
|
|
|
- // item.discountSinglePrice * item.totalCount
|
|
|
- // );
|
|
|
- // this.$set(
|
|
|
- // this.form.datasource[index],
|
|
|
- // 'totalPrice',
|
|
|
- // item.singlePrice * item.totalCount
|
|
|
- // );
|
|
|
- // }
|
|
|
- // if (item.pricingWay == 2) {
|
|
|
- // this.$set(
|
|
|
- // this.form.datasource[index],
|
|
|
- // 'discountTotalPrice',
|
|
|
- // item.discountSinglePrice *
|
|
|
- // item.totalCount *
|
|
|
- // (item.singleWeight || 0)
|
|
|
- // );
|
|
|
- // this.$set(
|
|
|
- // this.form.datasource[index],
|
|
|
- // 'totalPrice',
|
|
|
- // item.singlePrice * item.totalCount * (item.singleWeight || 0)
|
|
|
- // );
|
|
|
- // }
|
|
|
- // });
|
|
|
- // },
|
|
|
+
|
|
|
//获取
|
|
|
getStockLedger(sendProductDetail) {
|
|
|
if (!this.form.datasource[this.curIndex].sendProductDetail)
|
|
|
@@ -1065,30 +1031,29 @@
|
|
|
);
|
|
|
|
|
|
const tempBatchNoList = await getBatchList({
|
|
|
- warehouseId: data.warehouseId,
|
|
|
- categoryCode: row.productCode
|
|
|
- });
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'batchNoList',
|
|
|
- tempBatchNoList?.list || []
|
|
|
- );
|
|
|
-
|
|
|
- if(isReset) {
|
|
|
+ warehouseId: data.warehouseId,
|
|
|
+ categoryCode: row.productCode
|
|
|
+ });
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'batchNoList',
|
|
|
+ tempBatchNoList?.list || []
|
|
|
+ );
|
|
|
+
|
|
|
+ if (isReset) {
|
|
|
this.$set(this.form.datasource[index], 'batchStockId', '');
|
|
|
this.$set(this.form.datasource[index], 'batchNo', '');
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
|
|
|
//批次号选择
|
|
|
async batchNoChange(index, row) {
|
|
|
- if(!row.batchStockId) {
|
|
|
+ if (!row.batchStockId) {
|
|
|
this.$set(this.form.datasource[index], 'batchNo', '');
|
|
|
// this.$set(this.form.datasource[index], 'warehouseNum', '');
|
|
|
const tempWarehouse = await getIdWarehouseList({
|
|
|
- categoryId: this.form.datasource[index].productId,
|
|
|
- })
|
|
|
+ categoryId: this.form.datasource[index].productId
|
|
|
+ });
|
|
|
// 有仓库列表
|
|
|
if (tempWarehouse?.length) {
|
|
|
console.log('666~~~~!!', index, tempWarehouse);
|
|
|
@@ -1098,12 +1063,18 @@
|
|
|
tempWarehouse
|
|
|
);
|
|
|
}
|
|
|
-
|
|
|
- this.$set(this.form.datasource[index], 'warehouseNum', row.warehouseId ? await getWarehouseOutStock({
|
|
|
- warehouseId: row.warehouseId,
|
|
|
- code: row.productCode
|
|
|
- }) : '');
|
|
|
-
|
|
|
+
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'warehouseNum',
|
|
|
+ row.warehouseId
|
|
|
+ ? await getWarehouseOutStock({
|
|
|
+ warehouseId: row.warehouseId,
|
|
|
+ code: row.productCode
|
|
|
+ })
|
|
|
+ : ''
|
|
|
+ );
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
const data = row.batchNoList.find(
|
|
|
@@ -1161,12 +1132,20 @@
|
|
|
let sendTotalWeight = Number(
|
|
|
this.form.datasource[this.curIndex]?.sendTotalWeight
|
|
|
);
|
|
|
- if (sendTotalWeight && receiveTotalWeight) {
|
|
|
+ if (sendTotalWeight) {
|
|
|
+ let increaseTotalWeight = sendTotalWeight - receiveTotalWeight;
|
|
|
this.$set(
|
|
|
this.form.datasource[this.curIndex],
|
|
|
'increaseTotalWeight',
|
|
|
- (sendTotalWeight - receiveTotalWeight).toFixed(2)
|
|
|
+ increaseTotalWeight.toFixed(4)
|
|
|
);
|
|
|
+ if (row.pricingWay == 3) {
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[this.curIndex],
|
|
|
+ 'totalPrice',
|
|
|
+ (increaseTotalWeight * row.singlePrice).toFixed(2)
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
this.$refs.table.reload();
|
|
|
@@ -1448,7 +1427,7 @@
|
|
|
});
|
|
|
this.form.datasource.forEach(async (item, index) => {
|
|
|
if (indexS.includes(index)) {
|
|
|
- if(!item.batchNo) {
|
|
|
+ if (!item.batchNo) {
|
|
|
console.log('111~~~~', index);
|
|
|
this.$set(
|
|
|
this.form.datasource[index],
|
|
|
@@ -1493,117 +1472,104 @@
|
|
|
} else {
|
|
|
this.setBatchAndWarehouse(item, index);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
async setBatchAndWarehouse(item, index) {
|
|
|
- console.log('333~~~~', index);
|
|
|
- // 通过产品编码查仓库
|
|
|
- const tempWarehouse = await getIdWarehouseList({
|
|
|
- categoryId: item.productId,
|
|
|
- })
|
|
|
- // 有仓库列表
|
|
|
- if (tempWarehouse?.length) {
|
|
|
- console.log('666~~~~', index, tempWarehouse);
|
|
|
+ console.log('333~~~~', index);
|
|
|
+ // 通过产品编码查仓库
|
|
|
+ const tempWarehouse = await getIdWarehouseList({
|
|
|
+ categoryId: item.productId
|
|
|
+ });
|
|
|
+ // 有仓库列表
|
|
|
+ if (tempWarehouse?.length) {
|
|
|
+ console.log('666~~~~', index, tempWarehouse);
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'warehouseList',
|
|
|
+ tempWarehouse
|
|
|
+ );
|
|
|
+ if (item.warehouseId) {
|
|
|
this.$set(
|
|
|
this.form.datasource[index],
|
|
|
- 'warehouseList',
|
|
|
- tempWarehouse
|
|
|
+ 'warehouseNum',
|
|
|
+ await getWarehouseOutStock({
|
|
|
+ warehouseId: item.warehouseId,
|
|
|
+ code: item.productCode
|
|
|
+ })
|
|
|
);
|
|
|
- if (item.warehouseId) {
|
|
|
+ } else {
|
|
|
+ if (this.form.datasource[index]?.warehouseList?.length) {
|
|
|
this.$set(
|
|
|
this.form.datasource[index],
|
|
|
- 'warehouseNum',
|
|
|
- await getWarehouseOutStock({
|
|
|
- warehouseId: item.warehouseId,
|
|
|
- code: item.productCode
|
|
|
- })
|
|
|
+ 'warehouseId',
|
|
|
+ this.form.datasource[index]?.warehouseList[0].warehouseId
|
|
|
);
|
|
|
- } else {
|
|
|
- if (this.form.datasource[index]?.warehouseList?.length) {
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'warehouseId',
|
|
|
- this.form.datasource[index]?.warehouseList[0].warehouseId
|
|
|
- );
|
|
|
- await this.warehouseChange(index, this.form.datasource[index]);
|
|
|
- }
|
|
|
-
|
|
|
+ await this.warehouseChange(index, this.form.datasource[index]);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- const templist1 = await getBatchList({
|
|
|
- categoryCode: item.productCode,
|
|
|
- warehouseId: item.warehouseId,
|
|
|
- size: -1
|
|
|
- });
|
|
|
+ const templist1 = await getBatchList({
|
|
|
+ categoryCode: item.productCode,
|
|
|
+ warehouseId: item.warehouseId,
|
|
|
+ size: -1
|
|
|
+ });
|
|
|
|
|
|
- let tempBatchNoList = templist1?.list || [];
|
|
|
- console.log('888~~~~', index, item.batchNo);
|
|
|
+ let tempBatchNoList = templist1?.list || [];
|
|
|
+ console.log('888~~~~', index, item.batchNo);
|
|
|
|
|
|
- const batchNoObj = tempBatchNoList.find(i => i.batchNo == item.batchNo);
|
|
|
-
|
|
|
- if(batchNoObj) {
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'batchStockId',
|
|
|
- batchNoObj.id
|
|
|
- );
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'warehouseNum',
|
|
|
- batchNoObj.measureQuantity || 0
|
|
|
- );
|
|
|
- } else { //不存在
|
|
|
- // 批次列表添加不存在的批次号对象
|
|
|
- tempBatchNoList.push({
|
|
|
- batchNo: item.batchNo,
|
|
|
- id: 999,
|
|
|
- measureQuantity: 0
|
|
|
- })
|
|
|
- // 设置为不存在的批次ID
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'batchStockId',
|
|
|
- 999
|
|
|
- );
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'warehouseNum',
|
|
|
- ''
|
|
|
- );
|
|
|
- }
|
|
|
+ const batchNoObj = tempBatchNoList.find(
|
|
|
+ (i) => i.batchNo == item.batchNo
|
|
|
+ );
|
|
|
|
|
|
- // // 批次号
|
|
|
+ if (batchNoObj) {
|
|
|
this.$set(
|
|
|
this.form.datasource[index],
|
|
|
- 'batchNoList',
|
|
|
- tempBatchNoList
|
|
|
+ 'batchStockId',
|
|
|
+ batchNoObj.id
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'warehouseNum',
|
|
|
+ batchNoObj.measureQuantity || 0
|
|
|
);
|
|
|
} else {
|
|
|
- if(item.batchNo) {
|
|
|
- const tempBatchNoList = [{
|
|
|
+ //不存在
|
|
|
+ // 批次列表添加不存在的批次号对象
|
|
|
+ tempBatchNoList.push({
|
|
|
+ batchNo: item.batchNo,
|
|
|
+ id: 999,
|
|
|
+ measureQuantity: 0
|
|
|
+ });
|
|
|
+ // 设置为不存在的批次ID
|
|
|
+ this.$set(this.form.datasource[index], 'batchStockId', 999);
|
|
|
+ this.$set(this.form.datasource[index], 'warehouseNum', '');
|
|
|
+ }
|
|
|
+
|
|
|
+ // // 批次号
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'batchNoList',
|
|
|
+ tempBatchNoList
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ if (item.batchNo) {
|
|
|
+ const tempBatchNoList = [
|
|
|
+ {
|
|
|
batchNo: item.batchNo,
|
|
|
id: 999,
|
|
|
measureQuantity: 0
|
|
|
- }]
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'batchNoList',
|
|
|
- tempBatchNoList
|
|
|
- );
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'batchStockId',
|
|
|
- 999
|
|
|
- );
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'warehouseNum',
|
|
|
- ''
|
|
|
- );
|
|
|
- }
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'batchNoList',
|
|
|
+ tempBatchNoList
|
|
|
+ );
|
|
|
+ this.$set(this.form.datasource[index], 'batchStockId', 999);
|
|
|
+ this.$set(this.form.datasource[index], 'warehouseNum', '');
|
|
|
}
|
|
|
+ }
|
|
|
},
|
|
|
remove(i) {
|
|
|
this.form.datasource.splice(i, 1);
|
|
|
@@ -1658,7 +1624,7 @@
|
|
|
|
|
|
callback(valid);
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|