From 87f7f7a7588e926c6535eea2910ae98ca4101994 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期二, 29 八月 2023 18:52:49 +0800 Subject: [PATCH] 采购 添加 列表编辑 子段补充,联调 --- src/views/purchaseManage/returned/index.vue | 74 +++++++++++++++++++++--------------- 1 files changed, 43 insertions(+), 31 deletions(-) diff --git a/src/views/purchaseManage/returned/index.vue b/src/views/purchaseManage/returned/index.vue index f5d798d..3554cf8 100644 --- a/src/views/purchaseManage/returned/index.vue +++ b/src/views/purchaseManage/returned/index.vue @@ -17,9 +17,13 @@ ref="tableListRef" :table-list="tableList" @selCommonClick="selCommonClick" - @getSelectArray="getSelectArray" > <template slot="tableButton"> + <el-table-column label="鐘舵��" width="120"> + <template slot-scope="scope"> + {{ getReturnedStatus(scope.row.member_name) }} + </template> + </el-table-column> <el-table-column label="鎿嶄綔" width="120"> <template slot-scope="scope"> <el-button @click="confirmClick(scope.row)" type="text" size="small">纭鍙戣揣</el-button> @@ -42,9 +46,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/returned/DetailSupplier" - +import { getDataByType } from "@/api/data"; export default { name: "SupplierManage", props: {}, @@ -59,7 +65,8 @@ visible: false, infomation: {} }, - search_map: {} + search: '', + returnedStatusList:getDataByType('returnedStatus'), } }, created() { @@ -67,6 +74,17 @@ this.getData() }, methods: { + getReturnedStatus(val) { + if (val) { + for (let i in this.returnedStatusList) { + if (this.returnedStatusList[i].id == val) { + return this.returnedStatusList[i].name; + } + } + } else { + return "--"; + } + }, setTable() { this.tableList = { tableInfomation: [], @@ -81,29 +99,21 @@ { label: "缁忓姙浜�", prop: "city", min: 130 }, { label: "鍒跺崟浜�", prop: "member_name", min: 130 }, { label: "閫�璐ф棩鏈�", prop: "member_name", min: 150 }, - { label: "鐘舵��", prop: "member_name", min: 110 } + // { label: "鐘舵��", prop: "member_name", min: 110 } ] } }, // 璇锋眰鏁版嵁 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.total }) .catch((err) => { console.log(err) @@ -112,13 +122,12 @@ // 鎼滅储 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() }, @@ -131,7 +140,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() @@ -142,18 +151,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