|
@@ -22,9 +22,7 @@
|
|
|
prop="inquiryName"
|
|
prop="inquiryName"
|
|
|
style="margin-bottom: 22px"
|
|
style="margin-bottom: 22px"
|
|
|
>
|
|
>
|
|
|
- <el-input
|
|
|
|
|
- v-model="form.inquiryName"
|
|
|
|
|
- ></el-input>
|
|
|
|
|
|
|
+ <el-input v-model="form.inquiryName"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
@@ -47,13 +45,13 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item prop="files" label="附件">
|
|
<el-form-item prop="files" label="附件">
|
|
|
- <fileMain v-model="form.files" ></fileMain>
|
|
|
|
|
-<!-- <fileUpload-->
|
|
|
|
|
-<!-- v-model="form.files"-->
|
|
|
|
|
-<!-- module="main"-->
|
|
|
|
|
-<!-- :showLib="false"-->
|
|
|
|
|
-<!-- :limit="1"-->
|
|
|
|
|
-<!-- />-->
|
|
|
|
|
|
|
+ <fileMain v-model="form.files"></fileMain>
|
|
|
|
|
+ <!-- <fileUpload-->
|
|
|
|
|
+ <!-- v-model="form.files"-->
|
|
|
|
|
+ <!-- module="main"-->
|
|
|
|
|
+ <!-- :showLib="false"-->
|
|
|
|
|
+ <!-- :limit="1"-->
|
|
|
|
|
+ <!-- />-->
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
@@ -86,7 +84,6 @@
|
|
|
@changeInquiryManageList="changeInquiryManageList"
|
|
@changeInquiryManageList="changeInquiryManageList"
|
|
|
@supplierSelect="supplierSelect"
|
|
@supplierSelect="supplierSelect"
|
|
|
@supplierManageChange="supplierManageChange"
|
|
@supplierManageChange="supplierManageChange"
|
|
|
-
|
|
|
|
|
></inquiryManageList>
|
|
></inquiryManageList>
|
|
|
<supplierManageDialog
|
|
<supplierManageDialog
|
|
|
ref="supplierManageDialogRef"
|
|
ref="supplierManageDialogRef"
|
|
@@ -101,8 +98,6 @@
|
|
|
:obj="item"
|
|
:obj="item"
|
|
|
:isUpdate="isUpdate"
|
|
:isUpdate="isUpdate"
|
|
|
@deliveryDateChange="deliveryDateChange"
|
|
@deliveryDateChange="deliveryDateChange"
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
></inquiryTable>
|
|
></inquiryTable>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -116,7 +111,7 @@
|
|
|
|
|
|
|
|
import fileUpload from '@/components/upload/fileUpload';
|
|
import fileUpload from '@/components/upload/fileUpload';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
- import {deepClone} from "@/utils";
|
|
|
|
|
|
|
+ import { deepClone } from '@/utils';
|
|
|
import { getplanDetail } from '@/api/bpm/components/purchasingManage/purchasePlanManage';
|
|
import { getplanDetail } from '@/api/bpm/components/purchasingManage/purchasePlanManage';
|
|
|
import {
|
|
import {
|
|
|
getpurchaseinquiry,
|
|
getpurchaseinquiry,
|
|
@@ -126,9 +121,9 @@
|
|
|
import { copyObj } from '@/utils/util';
|
|
import { copyObj } from '@/utils/util';
|
|
|
|
|
|
|
|
import { getFile } from '@/api/system/file';
|
|
import { getFile } from '@/api/system/file';
|
|
|
- import {contactQueryByCategoryIdsAPI} from "@/api/bpm/components/supplierManage/contact";
|
|
|
|
|
- import {contactDetail} from "@/api/bpm/components/saleManage/contact";
|
|
|
|
|
- import fileMain from "@/components/addDoc/index.vue";
|
|
|
|
|
|
|
+ import { contactQueryByCategoryIdsAPI } from '@/api/bpm/components/supplierManage/contact';
|
|
|
|
|
+ import { contactDetail } from '@/api/bpm/components/saleManage/contact';
|
|
|
|
|
+ import fileMain from '@/components/addDoc/index.vue';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
mixins: [dictMixins],
|
|
@@ -170,8 +165,8 @@
|
|
|
delDetailIds: [],
|
|
delDetailIds: [],
|
|
|
supplierProducts: {},
|
|
supplierProducts: {},
|
|
|
formDef,
|
|
formDef,
|
|
|
- rawList:[],
|
|
|
|
|
- outputList:[],
|
|
|
|
|
|
|
+ rawList: [],
|
|
|
|
|
+ outputList: [],
|
|
|
|
|
|
|
|
acceptUnpackList: [
|
|
acceptUnpackList: [
|
|
|
{
|
|
{
|
|
@@ -193,7 +188,7 @@
|
|
|
],
|
|
],
|
|
|
inquiryName: [
|
|
inquiryName: [
|
|
|
{ required: true, message: '请输入询价单名称', trigger: 'blur' }
|
|
{ required: true, message: '请输入询价单名称', trigger: 'blur' }
|
|
|
- ],
|
|
|
|
|
|
|
+ ]
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 提交状态
|
|
// 提交状态
|
|
@@ -222,9 +217,12 @@
|
|
|
if (data) {
|
|
if (data) {
|
|
|
this.form = data;
|
|
this.form = data;
|
|
|
this.supplierList = data.supplierList;
|
|
this.supplierList = data.supplierList;
|
|
|
- let supplierObj = await this.getSupplierObj(data.detailList,'productId');
|
|
|
|
|
|
|
+ let supplierObj = await this.getSupplierObj(
|
|
|
|
|
+ data.detailList,
|
|
|
|
|
+ 'productId'
|
|
|
|
|
+ );
|
|
|
data.detailList.forEach((item) => {
|
|
data.detailList.forEach((item) => {
|
|
|
- item.supplierList = supplierObj[item.productId] || []
|
|
|
|
|
|
|
+ item.supplierList = supplierObj[item.productId] || [];
|
|
|
});
|
|
});
|
|
|
this.list = [...data.detailList, ...data.rawList, ...data.outputList];
|
|
this.list = [...data.detailList, ...data.rawList, ...data.outputList];
|
|
|
this.rawList = data.rawList;
|
|
this.rawList = data.rawList;
|
|
@@ -233,8 +231,7 @@
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.$refs.inventoryTable &&
|
|
this.$refs.inventoryTable &&
|
|
|
this.$refs.inventoryTable.putTableValue(data.detailList);
|
|
this.$refs.inventoryTable.putTableValue(data.detailList);
|
|
|
- // this.setIsInquiry()
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // this.setIsInquiry()
|
|
|
});
|
|
});
|
|
|
if (type == 'init') {
|
|
if (type == 'init') {
|
|
|
this.getplanData(data.planId, type);
|
|
this.getplanData(data.planId, type);
|
|
@@ -259,7 +256,7 @@
|
|
|
this.$refs['inquiryTable' + item.supplierId][0].getTableValue()
|
|
this.$refs['inquiryTable' + item.supplierId][0].getTableValue()
|
|
|
);
|
|
);
|
|
|
});
|
|
});
|
|
|
- this.$refs.inventoryTable.setIsInquiry(supplierList)
|
|
|
|
|
|
|
+ this.$refs.inventoryTable.setIsInquiry(supplierList);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
//获取计划详情
|
|
//获取计划详情
|
|
@@ -270,15 +267,18 @@
|
|
|
this.outputList = data.outputDetailList;
|
|
this.outputList = data.outputDetailList;
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
if (data) {
|
|
if (data) {
|
|
|
- let supplierObj = await this.getSupplierObj(data.detailList,'productId');
|
|
|
|
|
|
|
+ let supplierObj = await this.getSupplierObj(
|
|
|
|
|
+ data.detailList,
|
|
|
|
|
+ 'productId'
|
|
|
|
|
+ );
|
|
|
data.detailList.forEach((item) => {
|
|
data.detailList.forEach((item) => {
|
|
|
if (item.arrivalWay == 2 && item.arrivalBatch.length > 0) {
|
|
if (item.arrivalWay == 2 && item.arrivalBatch.length > 0) {
|
|
|
item.expectReceiveDate =
|
|
item.expectReceiveDate =
|
|
|
item.arrivalBatch[item.arrivalBatch.length - 1].arriveDate;
|
|
item.arrivalBatch[item.arrivalBatch.length - 1].arriveDate;
|
|
|
}
|
|
}
|
|
|
- item.supplierList = supplierObj[item.productId] || []
|
|
|
|
|
- if(item.supplierList.length === 1){
|
|
|
|
|
- item.supplierIds = [item.supplierList[0].id]
|
|
|
|
|
|
|
+ item.supplierList = supplierObj[item.productId] || [];
|
|
|
|
|
+ if (item.supplierList.length === 1) {
|
|
|
|
|
+ item.supplierIds = [item.supplierList[0].id];
|
|
|
// this.supplierSelect(item)
|
|
// this.supplierSelect(item)
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -308,14 +308,14 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- async getSupplierObj(productList,queryName){
|
|
|
|
|
|
|
+ async getSupplierObj(productList, queryName) {
|
|
|
try {
|
|
try {
|
|
|
- let categoryIds = productList.map(item => item[queryName])
|
|
|
|
|
- return await contactQueryByCategoryIdsAPI({categoryIds})
|
|
|
|
|
- }catch (e) {
|
|
|
|
|
|
|
+ let categoryIds = productList.map((item) => item[queryName]);
|
|
|
|
|
+ return await contactQueryByCategoryIdsAPI({ categoryIds });
|
|
|
|
|
+ } catch (e) {
|
|
|
return Promise.resolve({});
|
|
return Promise.resolve({});
|
|
|
}
|
|
}
|
|
|
- } ,
|
|
|
|
|
|
|
+ },
|
|
|
getValidate() {
|
|
getValidate() {
|
|
|
let promises = [];
|
|
let promises = [];
|
|
|
this.supplierList.forEach((item) => {
|
|
this.supplierList.forEach((item) => {
|
|
@@ -358,7 +358,6 @@
|
|
|
(item) => item.supplierId != supplierId
|
|
(item) => item.supplierId != supplierId
|
|
|
);
|
|
);
|
|
|
// this.setIsInquiry()
|
|
// this.setIsInquiry()
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
//选择产品
|
|
//选择产品
|
|
@@ -372,25 +371,29 @@
|
|
|
async supplierSelect(row) {
|
|
async supplierSelect(row) {
|
|
|
let supplierIds = Object.keys(this.supplierProducts);
|
|
let supplierIds = Object.keys(this.supplierProducts);
|
|
|
const promises = [];
|
|
const promises = [];
|
|
|
- row.supplierIds.forEach(item => {
|
|
|
|
|
|
|
+ row.supplierIds.forEach((item) => {
|
|
|
if (!supplierIds.includes(item)) {
|
|
if (!supplierIds.includes(item)) {
|
|
|
promises.push(contactDetail(item));
|
|
promises.push(contactDetail(item));
|
|
|
} else {
|
|
} else {
|
|
|
- this.productSetSupplier(this.supplierProducts[item], row)
|
|
|
|
|
|
|
+ this.productSetSupplier(this.supplierProducts[item], row);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- Promise.all(promises).then(results => {
|
|
|
|
|
|
|
+ Promise.all(promises).then((results) => {
|
|
|
results.forEach((data, index) => {
|
|
results.forEach((data, index) => {
|
|
|
this.supplierProducts[data.base.id] = data;
|
|
this.supplierProducts[data.base.id] = data;
|
|
|
- this.productSetSupplier(this.supplierProducts[data.base.id], row)
|
|
|
|
|
|
|
+ this.productSetSupplier(this.supplierProducts[data.base.id], row);
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
productSetSupplier(data, row) {
|
|
productSetSupplier(data, row) {
|
|
|
let obj = deepClone(row);
|
|
let obj = deepClone(row);
|
|
|
- obj.supplierProductName = data.productList.find(item => item.productCode == row.productCode)?.productName
|
|
|
|
|
- obj.supplierProductCode = data.productList.find(item => item.productCode == row.productCode)?.productCode
|
|
|
|
|
- obj.supplierName = data.base.name
|
|
|
|
|
|
|
+ obj.supplierProductName = data.productList.find(
|
|
|
|
|
+ (item) => item.productCode == row.productCode
|
|
|
|
|
+ )?.productName;
|
|
|
|
|
+ obj.supplierProductCode = data.productList.find(
|
|
|
|
|
+ (item) => item.productCode == row.productCode
|
|
|
|
|
+ )?.productCode;
|
|
|
|
|
+ obj.supplierName = data.base.name;
|
|
|
let params = {
|
|
let params = {
|
|
|
...data.base,
|
|
...data.base,
|
|
|
supplierId: data.base.id,
|
|
supplierId: data.base.id,
|
|
@@ -402,22 +405,29 @@
|
|
|
settlementModeName: '',
|
|
settlementModeName: '',
|
|
|
taxRate: '',
|
|
taxRate: '',
|
|
|
totalPrice: '',
|
|
totalPrice: '',
|
|
|
- resultList: [obj],
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ resultList: [obj]
|
|
|
|
|
+ };
|
|
|
let supplierIds = this.supplierList.map((item) => item.supplierId);
|
|
let supplierIds = this.supplierList.map((item) => item.supplierId);
|
|
|
- let supplierIndex = supplierIds.indexOf(data.base.id)
|
|
|
|
|
|
|
+ let supplierIndex = supplierIds.indexOf(data.base.id);
|
|
|
if (supplierIndex == -1) {
|
|
if (supplierIndex == -1) {
|
|
|
this.supplierList.push(params);
|
|
this.supplierList.push(params);
|
|
|
} else {
|
|
} else {
|
|
|
- let isHave = this.supplierList[supplierIndex].resultList.some(item => item.productCode == obj.productCode)
|
|
|
|
|
|
|
+ let isHave = this.supplierList[supplierIndex].resultList.some(
|
|
|
|
|
+ (item) => item.productCode == obj.productCode
|
|
|
|
|
+ );
|
|
|
if (!isHave) {
|
|
if (!isHave) {
|
|
|
// putTableValue
|
|
// putTableValue
|
|
|
//this.supplierList[supplierIndex].resultList.push(obj)
|
|
//this.supplierList[supplierIndex].resultList.push(obj)
|
|
|
- this.$set(this.supplierList[supplierIndex],'resultList',[ ...this.supplierList[supplierIndex].resultList,obj])
|
|
|
|
|
|
|
+ this.$set(this.supplierList[supplierIndex], 'resultList', [
|
|
|
|
|
+ ...this.supplierList[supplierIndex].resultList,
|
|
|
|
|
+ obj
|
|
|
|
|
+ ]);
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
- this.$refs['inquiryTable' + data.base.id][0]?.putTableValue(this.supplierList[supplierIndex].resultList)
|
|
|
|
|
|
|
+ this.$refs['inquiryTable' + data.base.id][0]?.putTableValue(
|
|
|
|
|
+ this.supplierList[supplierIndex].resultList
|
|
|
|
|
+ );
|
|
|
this.$refs['inquiryTable' + data.base.id][0]?.getSpanArr();
|
|
this.$refs['inquiryTable' + data.base.id][0]?.getSpanArr();
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -432,47 +442,60 @@
|
|
|
item['settlementModeName'] = '';
|
|
item['settlementModeName'] = '';
|
|
|
item['taxRate'] = '';
|
|
item['taxRate'] = '';
|
|
|
item['totalPrice'] = '';
|
|
item['totalPrice'] = '';
|
|
|
- item['resultList'] = copyObj(this.$refs.inventoryTable.selection)
|
|
|
|
|
|
|
+ item['resultList'] = copyObj(this.$refs.inventoryTable.selection);
|
|
|
item['resultList'].forEach((val) => {
|
|
item['resultList'].forEach((val) => {
|
|
|
val['remark'] = '';
|
|
val['remark'] = '';
|
|
|
item['deliveryDate'] = val.expectReceiveDate;
|
|
item['deliveryDate'] = val.expectReceiveDate;
|
|
|
val.supplierName = item.name;
|
|
val.supplierName = item.name;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- let supplierIndex = supplierIds.indexOf(item.supplierId)
|
|
|
|
|
|
|
+ let supplierIndex = supplierIds.indexOf(item.supplierId);
|
|
|
if (supplierIndex == -1) {
|
|
if (supplierIndex == -1) {
|
|
|
this.supplierList.push(item);
|
|
this.supplierList.push(item);
|
|
|
} else {
|
|
} else {
|
|
|
item['resultList'].forEach((val) => {
|
|
item['resultList'].forEach((val) => {
|
|
|
- let isHave = this.supplierList[supplierIndex].resultList.some(i => i.productCode == val.productCode)
|
|
|
|
|
- console.log(isHave,supplierIndex);
|
|
|
|
|
|
|
+ let isHave = this.supplierList[supplierIndex].resultList.some(
|
|
|
|
|
+ (i) => i.productCode == val.productCode
|
|
|
|
|
+ );
|
|
|
|
|
+ console.log(isHave, supplierIndex);
|
|
|
if (!isHave) {
|
|
if (!isHave) {
|
|
|
-
|
|
|
|
|
- this.$set(this.supplierList[supplierIndex],'resultList',[ ...this.supplierList[supplierIndex].resultList,val])
|
|
|
|
|
- this.$refs['inquiryTable' + item.id][0]?.putTableValue(this.supplierList[supplierIndex].resultList)
|
|
|
|
|
|
|
+ this.$set(this.supplierList[supplierIndex], 'resultList', [
|
|
|
|
|
+ ...this.supplierList[supplierIndex].resultList,
|
|
|
|
|
+ val
|
|
|
|
|
+ ]);
|
|
|
|
|
+ this.$refs['inquiryTable' + item.id][0]?.putTableValue(
|
|
|
|
|
+ this.supplierList[supplierIndex].resultList
|
|
|
|
|
+ );
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.$refs['inquiryTable' + item.id][0]?.getSpanArr();
|
|
this.$refs['inquiryTable' + item.id][0]?.getSpanArr();
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
async getTableValue() {
|
|
async getTableValue() {
|
|
|
let supplierList = [];
|
|
let supplierList = [];
|
|
|
- this.setIsInquiry()
|
|
|
|
|
|
|
+ this.setIsInquiry();
|
|
|
this.supplierList.forEach((item) => {
|
|
this.supplierList.forEach((item) => {
|
|
|
supplierList.push(
|
|
supplierList.push(
|
|
|
this.$refs['inquiryTable' + item.supplierId][0].getTableValue()
|
|
this.$refs['inquiryTable' + item.supplierId][0].getTableValue()
|
|
|
);
|
|
);
|
|
|
});
|
|
});
|
|
|
|
|
+ let is = false;
|
|
|
supplierList.forEach((item) => {
|
|
supplierList.forEach((item) => {
|
|
|
item.resultList.forEach((val) => {
|
|
item.resultList.forEach((val) => {
|
|
|
val['technicalDrawings'] = [];
|
|
val['technicalDrawings'] = [];
|
|
|
|
|
+ if (val.minimumOrderQuantity > val.totalCount) {
|
|
|
|
|
+ is = true;
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+ if (is) {
|
|
|
|
|
+ this.$message.warning('购买数量不能小于最低订购量!');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
this.form.detailList = this.list;
|
|
this.form.detailList = this.list;
|
|
|
this.form.supplierList = supplierList;
|
|
this.form.supplierList = supplierList;
|
|
|
|
|
|
|
@@ -485,7 +508,7 @@
|
|
|
this.$message.warning('物品清单不能为空');
|
|
this.$message.warning('物品清单不能为空');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.form.supplierList.forEach((item) => {
|
|
this.form.supplierList.forEach((item) => {
|
|
|
item.resultList = [
|
|
item.resultList = [
|
|
|
...item.resultList,
|
|
...item.resultList,
|