|
|
@@ -323,12 +323,15 @@
|
|
|
message: '请选择供应商'
|
|
|
}"
|
|
|
>
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- @click.native="(e) => handleGetSup(e, scope.row, scope.$index)"
|
|
|
- v-model="scope.row.supplierName"
|
|
|
- placeholder="请输入"
|
|
|
- ></el-input>
|
|
|
+ <el-select v-model="scope.row.supplierId" clearable filterable>
|
|
|
+ <el-option
|
|
|
+ v-for="i in scope.row.supplierList"
|
|
|
+ :key="i.id"
|
|
|
+ :value="i.id"
|
|
|
+ :label="i.name"
|
|
|
+ @click.native="getSupInfo(i, scope.$index)"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:provenance="scope">
|
|
|
@@ -414,7 +417,6 @@
|
|
|
<el-form-item
|
|
|
style="margin-bottom: 20px"
|
|
|
:prop="'datasource.' + scope.$index + '.purchaseUnitId'"
|
|
|
-
|
|
|
>
|
|
|
<el-select
|
|
|
v-model="scope.row.purchaseUnitId"
|
|
|
@@ -465,14 +467,15 @@
|
|
|
@changeParent="changeParent"
|
|
|
:is-show-c-bom="true"
|
|
|
@getSelectionCbom="getSelectionCbom"
|
|
|
+ :isSupplier="true"
|
|
|
></product-list>
|
|
|
<head-list ref="headRef" @changeParent="changeAnswer"></head-list>
|
|
|
<timeDialog @chooseTime="chooseTime" ref="timeDialogRef"></timeDialog>
|
|
|
- <supplierList
|
|
|
+ <!-- <supplierList
|
|
|
ref="supplierListRef"
|
|
|
:classType="2"
|
|
|
@changeParent="getSupInfo"
|
|
|
- ></supplierList>
|
|
|
+ ></supplierList> -->
|
|
|
<taskinstance-dialog
|
|
|
ref="taskinstanceDialogRef"
|
|
|
v-if="taskinstanceDialogFlag"
|
|
|
@@ -489,7 +492,7 @@
|
|
|
import headList from '@/BIZComponents/user-select/user-select.vue';
|
|
|
import timeDialog from '@/components/timeDialog/index.vue';
|
|
|
import { copyObj } from '@/utils/util';
|
|
|
- import supplierList from '@/views/purchasingManage/supplierManage/components/parentList.vue';
|
|
|
+ // import supplierList from '@/views/purchasingManage/supplierManage/components/parentList.vue';
|
|
|
import { getInventoryTotalAPI } from '@/api/wms';
|
|
|
// import fileMain from '@/components/addDoc/index.vue';
|
|
|
import taskinstanceDialog from '@/BIZComponents/procedure/taskinstanceDialog.vue';
|
|
|
@@ -499,6 +502,7 @@
|
|
|
import warehouseAll from '@/BIZComponents/warehouseAll.vue';
|
|
|
import { levelList } from '@/enum/dict.js';
|
|
|
import { changeCount } from '@/BIZComponents/setProduct.js';
|
|
|
+ import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
|
|
|
|
|
|
export default {
|
|
|
mixins: [dictMixins, tabMixins],
|
|
|
@@ -518,7 +522,7 @@
|
|
|
components: {
|
|
|
taskinstanceDialog,
|
|
|
// fileMain,
|
|
|
- supplierList,
|
|
|
+ // supplierList,
|
|
|
productList,
|
|
|
fileUpload,
|
|
|
headList,
|
|
|
@@ -622,6 +626,14 @@
|
|
|
// headerSlot: 'headerTotalCount',
|
|
|
align: 'center'
|
|
|
},
|
|
|
+ {
|
|
|
+ width: 100,
|
|
|
+ prop: 'measuringUnit',
|
|
|
+ label: '计量单位',
|
|
|
+ slot: 'measuringUnit',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+
|
|
|
{
|
|
|
minWidth: 120,
|
|
|
prop: 'goodsLevel',
|
|
|
@@ -676,7 +688,7 @@
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- width: 130,
|
|
|
+ width: 180,
|
|
|
prop: 'supplierName',
|
|
|
label: '供应商',
|
|
|
slot: 'supplierName',
|
|
|
@@ -750,14 +762,6 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- {
|
|
|
- width: 100,
|
|
|
- prop: 'measuringUnit',
|
|
|
- label: '单位',
|
|
|
- slot: 'measuringUnit',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
-
|
|
|
{
|
|
|
width: 220,
|
|
|
prop: 'remark',
|
|
|
@@ -874,15 +878,36 @@
|
|
|
};
|
|
|
this.form.datasource.push(item);
|
|
|
});
|
|
|
- let codeList = this.form.datasource.map((item) => item.productCode);
|
|
|
+ console.log(this.form.datasource, 'this.form.datasource');
|
|
|
//获取仓库库存
|
|
|
- let inventoryTotalList = await getInventoryTotalAPI(codeList);
|
|
|
- this.form.datasource.forEach((item) => {
|
|
|
- let find =
|
|
|
- inventoryTotalList.find((key) => key.code == item.productCode) ||
|
|
|
- {};
|
|
|
- item.availableCountBase = find.availableCountBase;
|
|
|
- });
|
|
|
+ let productId = this.form.datasource
|
|
|
+ .filter((item) => item.productCode)
|
|
|
+ .map((item) => item.productId);
|
|
|
+ let productCode = this.form.datasource
|
|
|
+ .filter((item) => item.productCode)
|
|
|
+ .map((item) => item.productCode);
|
|
|
+ if (productId?.length) {
|
|
|
+ let inventoryTotalList = await getInventoryTotalAPI(productCode);
|
|
|
+ let supplierObj = await contactQueryByCategoryIdsAPI({
|
|
|
+ categoryIds: productId
|
|
|
+ });
|
|
|
+ this.form.datasource.forEach((item, index) => {
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'supplierList',
|
|
|
+ supplierObj[item.productId] || []
|
|
|
+ );
|
|
|
+ let find =
|
|
|
+ inventoryTotalList.find(
|
|
|
+ (key) => key.code == item.productCode
|
|
|
+ ) || {};
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'availableCountBase',
|
|
|
+ find.availableCountBase
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
this.$refs.table.reload();
|
|
|
}
|
|
|
},
|
|
|
@@ -924,40 +949,23 @@
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- //获取供应商信息
|
|
|
- handleGetSup(e, row, index) {
|
|
|
- this.curIndex = index;
|
|
|
- if (e.target.nodeName == 'I') {
|
|
|
- this.$set(this.form.datasource[this.curIndex], 'supplierCode', '');
|
|
|
- this.$set(this.form.datasource[this.curIndex], 'supplierId', '');
|
|
|
- this.$set(this.form.datasource[this.curIndex], 'supplierName', '');
|
|
|
- return;
|
|
|
- }
|
|
|
- let item = { id: row.supplierId };
|
|
|
- this.$refs.supplierListRef.open(item);
|
|
|
- },
|
|
|
+ // //获取供应商信息
|
|
|
+ // handleGetSup(e, row, index) {
|
|
|
+ // this.curIndex = index;
|
|
|
+ // if (e.target.nodeName == 'I') {
|
|
|
+ // this.$set(this.form.datasource[this.curIndex], 'supplierCode', '');
|
|
|
+ // this.$set(this.form.datasource[this.curIndex], 'supplierId', '');
|
|
|
+ // this.$set(this.form.datasource[this.curIndex], 'supplierName', '');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // let item = { id: row.supplierId };
|
|
|
+ // this.$refs.supplierListRef.open(item);
|
|
|
+ // },
|
|
|
//选择供应商信息回调
|
|
|
- getSupInfo(obj) {
|
|
|
- let params = {
|
|
|
- supplierCode: obj.code,
|
|
|
- supplierId: obj.id,
|
|
|
- supplierName: obj.name
|
|
|
- };
|
|
|
- this.$set(
|
|
|
- this.form.datasource[this.curIndex],
|
|
|
- 'supplierCode',
|
|
|
- params.supplierCode
|
|
|
- );
|
|
|
- this.$set(
|
|
|
- this.form.datasource[this.curIndex],
|
|
|
- 'supplierId',
|
|
|
- params.supplierId
|
|
|
- );
|
|
|
- this.$set(
|
|
|
- this.form.datasource[this.curIndex],
|
|
|
- 'supplierName',
|
|
|
- params.supplierName
|
|
|
- );
|
|
|
+ getSupInfo(obj, index) {
|
|
|
+ this.$set(this.form.datasource[index], 'supplierCode', obj.code);
|
|
|
+ this.$set(this.form.datasource[index], 'supplierId', obj.id);
|
|
|
+ this.$set(this.form.datasource[index], 'supplierName', obj.name);
|
|
|
},
|
|
|
async warehouseChange(index, row) {
|
|
|
const data = this.warehouseList.find(
|
|
|
@@ -1016,6 +1024,11 @@
|
|
|
this.$set(parasm, 'singleWeight', item.roughWeight);
|
|
|
this.$set(parasm, 'goodsLevel', item.level);
|
|
|
this.$set(parasm, 'approvalNumber', item.extField.approvalNumber);
|
|
|
+ this.$set(parasm, 'supplierList', item.supplierList);
|
|
|
+ this.$set(parasm, 'supplierCode', item.supplierCode);
|
|
|
+ this.$set(parasm, 'supplierId', item.supplierId);
|
|
|
+ this.$set(parasm, 'supplierName', item.supplierName);
|
|
|
+
|
|
|
this.$set(
|
|
|
parasm,
|
|
|
'packingSpecification',
|
|
|
@@ -1027,7 +1040,11 @@
|
|
|
item.packageDispositionList
|
|
|
);
|
|
|
if (item.packageDispositionList?.length) {
|
|
|
- this.$set(parasm, 'purchaseUnitId', item.packageDispositionList[0].id);
|
|
|
+ this.$set(
|
|
|
+ parasm,
|
|
|
+ 'purchaseUnitId',
|
|
|
+ item.packageDispositionList[0].id
|
|
|
+ );
|
|
|
this.$set(
|
|
|
parasm,
|
|
|
'purchaseUnit',
|
|
|
@@ -1035,6 +1052,7 @@
|
|
|
);
|
|
|
}
|
|
|
this.$set(parasm, 'provenance', item.purchaseOrigins || []);
|
|
|
+
|
|
|
if (idx == -1) {
|
|
|
this.form.datasource.push(row);
|
|
|
}
|
|
|
@@ -1070,7 +1088,10 @@
|
|
|
this.$set(parasm, 'specification', item.specification);
|
|
|
this.$set(parasm, 'singleWeight', item.netWeight);
|
|
|
row['arrivalWay'] = row.arrivalWay || 1;
|
|
|
-
|
|
|
+ this.$set(parasm, 'supplierList', item.supplierList);
|
|
|
+ this.$set(parasm, 'supplierCode', item.supplierCode);
|
|
|
+ this.$set(parasm, 'supplierId', item.supplierId);
|
|
|
+ this.$set(parasm, 'supplierName', item.supplierName);
|
|
|
this.$set(parasm, 'remark', '');
|
|
|
this.$set(parasm, 'imgCode', item.imgCode);
|
|
|
this.$set(parasm, 'produceType', item.componentAttribute);
|
|
|
@@ -1086,7 +1107,11 @@
|
|
|
item.packageDispositionList
|
|
|
);
|
|
|
if (item.packageDispositionList?.length) {
|
|
|
- this.$set(parasm, 'purchaseUnitId', item.packageDispositionList[0].id);
|
|
|
+ this.$set(
|
|
|
+ parasm,
|
|
|
+ 'purchaseUnitId',
|
|
|
+ item.packageDispositionList[0].id
|
|
|
+ );
|
|
|
this.$set(
|
|
|
parasm,
|
|
|
'purchaseUnit',
|
|
|
@@ -1096,6 +1121,8 @@
|
|
|
if (item.purchaseOrigins?.length > 0) {
|
|
|
item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
|
|
|
}
|
|
|
+ console.log(parasm);
|
|
|
+ console.log(item);
|
|
|
this.$set(parasm, 'provenance', item.purchaseOrigins || []);
|
|
|
if (idx == -1) {
|
|
|
this.form.datasource.push(row);
|