From 73364cc369f036193eec2c3f947bb368473896e3 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期日, 28 四月 2024 13:34:19 +0800 Subject: [PATCH] 产品查供应商接口修改 --- src/views/purchaseManage/purchase/components/AddPurchase.vue | 45 ++++++++++++++++++++++++++++++++++++--------- 1 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/views/purchaseManage/purchase/components/AddPurchase.vue b/src/views/purchaseManage/purchase/components/AddPurchase.vue index 34a32d7..1985dc6 100644 --- a/src/views/purchaseManage/purchase/components/AddPurchase.vue +++ b/src/views/purchaseManage/purchase/components/AddPurchase.vue @@ -144,6 +144,7 @@ clearable placeholder="閫夋嫨鏃ユ湡" value-format="yyyy-MM-dd" + :picker-options="pickerOptionsBefore" > </el-date-picker> </el-form-item> @@ -158,6 +159,7 @@ clearable placeholder="閫夋嫨鏃ユ湡" value-format="yyyy-MM-dd" + :picker-options="pickerOptions" > </el-date-picker> </el-form-item> @@ -228,6 +230,7 @@ <div class="basic-info-title" style="display: flex">浜у搧淇℃伅</div> <div class="product-view"> <CommonFormTableView + ref="tableRef" :detailEnter="editCommonConfig.detailEnter" :show-summary="showSummary" :recalculateShow="false" @@ -370,7 +373,7 @@ editConfig: this.editCommonConfig, rules: { purchaseTypeId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], - supplierName: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], + supplierName: [{ required: true, message: "璇烽�夋嫨渚涘簲鍟嗗悕绉�", trigger: "change" }], phone: [ { required: false, @@ -396,7 +399,9 @@ { validator: this.validatorNumThree, trigger: "change" } ], number: [{ required: true, validator: this.validateCheckCode, trigger: ["change", "blur"] }], - warehouse: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }] + warehouse: [{ required: true, message: "璇烽�夋嫨鏀惰揣浠撳簱", trigger: "change" }], + signingDate: [{ required: true, message: "璇烽�夋嫨绛剧害鏃ユ湡", trigger: "change" }], + deliveryDate: [{ required: true, message: "璇烽�夋嫨浜や粯鏃ユ湡", trigger: "change" }], }, productTableList: {}, showSummary: { @@ -404,7 +409,7 @@ total: false, sumProp: ["price", "total"], multiply: ["amount", "price"], - titleProp: ["缂栧彿", "浜у搧鍚嶇О", "浜у搧缂栧彿", "璁¢噺鍗曚綅", "瑙勬牸鍨嬪彿", "閲囪喘鍗曚环", "鎻忚堪"], + titleProp: ["缂栧彿", "浜у搧鍚嶇О", "浜у搧缂栧彿", "璁¢噺鍗曚綅", "瑙勬牸", "鍨嬪彿", "閲囪喘鍗曚环", "鎻忚堪"], mergeNumber: 4, totalName: "灏忚" }, @@ -427,11 +432,20 @@ totalTwo: 0, productListIdx: 0, lacks: [], + pickerOptions: { + disabledDate(time) { + return time.getTime() < Date.now() - 8.64e7 + } + }, + pickerOptionsBefore: { + disabledDate(time) { + return time.getTime() > Date.now() + } + }, receiveWhouseList: [] // 鏀惰揣浠撳簱鍒楄〃 } }, created() { - console.log(this.editConfig, "鍙傛暟") this.handleGetBomKindDictList() this.getWarehouseInfo() this.$store.dispatch("getSupplier") @@ -506,9 +520,6 @@ this.plcBrandList = res.data this.setTableForm() if (val) { - // this.plcBrandList.map((item)=>{ - // item.purchaseTypeId=item.id - // }) for (let i in this.plcBrandList) { if (this.plcBrandList[i][this.editRow.isDefault]) { this.editConfig.infomation.purchaseTypeId = this.editConfig.infomation.purchaseTypeId @@ -744,6 +755,7 @@ }, // 閫夋嫨渚涘簲鍟� async handleSelectClient(value, item) { + this.$refs.tableRef.supplierId=item.id this.productTableList.supplierId = item.id if (value === "client") { this.supplierId = item.id @@ -756,6 +768,7 @@ }).then((res) => { if (res.code === 200) { this.productTableList.tableProductList = res.data.list + this.$refs.tableRef.productList=res.data.list console.log(this.productTableList.tableProductList, "pop") } }) @@ -764,12 +777,14 @@ this.editSelectSupplierConfig.editVisible = true }, async selClient(row) { + this.$refs.tableRef.supplierId=row.id await getProductList({ supplierId: row.id, page: 1, pageSize: 100 }).then((res) => { if (res.code === 200) { + this.$refs.tableRef.productList=res.data.list this.productTableList.tableProductList = res.data.list } }) @@ -779,11 +794,22 @@ this.editConfig.infomation.supplierId = row.id }, // 娓呴櫎宸查�夋嫨鐢ㄦ埛 - clearupClient(value) { + async clearupClient(value) { if (value == "client") { + this.$refs.tableRef.supplierId=null this.$set(this.editConfig.infomation, "supplierName", "") this.supplierId = null this.$forceUpdate() + await getProductList({ + page: 1, + pageSize: 100 + }).then((res) => { + if (res.code === 200) { + this.productTableList.tableProductList = res.data.list + this.$refs.tableRef.productList=res.data.list + console.log(this.productTableList.tableProductList, "pop") + } + }) } }, setTableForm() { @@ -830,7 +856,8 @@ }, { label: "浜у搧缂栧彿", prop: "number", min: 150 }, { label: "璁¢噺鍗曚綅", prop: "unit" }, - { label: "瑙勬牸鍨嬪彿", prop: "specifications" }, + { label: "瑙勬牸", prop: "specifications" }, + { label: "鍨嬪彿", prop: "modelNumber" }, { label: "鏁伴噺", prop: "amount", inputNumber: true, disabled: this.editConfig.isDisabled }, { label: "閲囪喘鍗曚环", -- Gitblit v1.8.0