From 87f7f7a7588e926c6535eea2910ae98ca4101994 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期二, 29 八月 2023 18:52:49 +0800 Subject: [PATCH] 采购 添加 列表编辑 子段补充,联调 --- src/views/purchaseManage/quality/index.vue | 73 +++++++++++++++++++++--------------- 1 files changed, 42 insertions(+), 31 deletions(-) diff --git a/src/views/purchaseManage/quality/index.vue b/src/views/purchaseManage/quality/index.vue index 9a987ef..68dc484 100644 --- a/src/views/purchaseManage/quality/index.vue +++ b/src/views/purchaseManage/quality/index.vue @@ -16,9 +16,13 @@ ref="tableListRef" :table-list="tableList" @selCommonClick="selCommonClick" - @getSelectArray="getSelectArray" > <template slot="tableButton"> + <el-table-column label="鐘舵��" width="120"> + <template slot-scope="scope"> + {{ getQualityStatus(scope.row.member_name) }} + </template> + </el-table-column> <el-table-column label="鎿嶄綔" width="120" fixed="right"> <template slot-scope="scope"> <el-button @click="qualityClick(scope.row)" type="text" size="small">鍘昏川妫�</el-button> @@ -41,9 +45,11 @@ <script> import pageMixin from "@/components/makepager/pager/mixin/pageMixin" -import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead" +import { + getPurchaseList,getPurchaseInfo,submitPurchase, +} from "@/api/purchaseManage/purchase"; import DetailSupplier from "@/views/purchaseManage/quality/DetailSupplier" - +import { getDataByType } from "@/api/data"; export default { name: "SupplierManage", props: {}, @@ -58,7 +64,8 @@ visible: false, infomation: {} }, - search_map: {} + search: {}, + qualityStatusList:getDataByType('qualityStatus'), } }, created() { @@ -66,6 +73,17 @@ this.getData() }, methods: { + getQualityStatus(val) { + if (val) { + for (let i in this.qualityStatusList) { + if (this.qualityStatusList[i].id == val) { + return this.qualityStatusList[i].name; + } + } + } else { + return "--"; + } + }, setTable() { this.tableList = { tableInfomation: [], @@ -78,30 +96,22 @@ { label: "鍒拌揣浠撳簱", prop: "sales_resources", min: 130 }, { label: "璐ㄦ鏁伴噺", prop: "province", min: 130 }, { label: "妫�楠屽憳", prop: "city", min: 130 }, - { label: "鐘舵��", prop: "member_name", min: 110 }, + // { label: "鐘舵��", prop: "member_name", min: 110 }, { label: "璐ㄦ鏃堕棿", prop: "member_name", min: 150 }, ] } }, // 璇锋眰鏁版嵁 async getData() { - await getSalesLeadsList({ - search_map: this.search_map, + await getPurchaseList({ + keyword: this.search, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) .then((res) => { - const list = res.data.list.map((item) => { - return { - ...item, - province: item.Province.name, - city: item.City.name, - sales_resources: item.sales_sources.name, - member_name: item.member.username - } - }) + const list = res.data.data.list this.tableList.tableInfomation = list || [] - this.pagerOptions.totalCount = res.data.count + this.pagerOptions.totalCount = res.data.data.total }) .catch((err) => { console.log(err) @@ -110,13 +120,11 @@ // 鎼滅储 searchClick(val, content) { console.log(val, content) - this.search_map = { - [val.value]: content - } + this.search = content this.getData() }, resetClick() { - this.search_map = {} + this.search = '' this.getData() }, @@ -129,7 +137,7 @@ }) .then(() => { console.log("dddd") - getDeleteSalesLeads({ ids: this.selValueList }).then((response) => { + submitPurchase({ ids: this.selValueList }).then((response) => { if (response.code === 200) { this.$message.success("纭鍙戣揣鎴愬姛") this.getData() @@ -140,18 +148,21 @@ }) .catch(() => {}) }, - getSelectArray(val) { - this.selValueList = [] - const list = val.map((item) => { - return item.id - }) - this.selValueList = list - }, + // 璇︽儏 selCommonClick(row) { console.log(row) - this.commonDetail.visible = true - this.commonDetail.infomation = { ...row } + getPurchaseInfo({id:row.ID}).then((res) => { + if (res.code == 200) { + this.commonDetail.visible = true + this.commonDetail.infomation = { + productList:res.data.productList, + ...res.data.purchase + } + }else{ + this.$message.error(res.msg?res.msg+',':''+'鑾峰彇淇℃伅澶辫触锛�') + } + }) } } } -- Gitblit v1.8.0