From cf6a4b874aed82592eea78294715c7c688f9b248 Mon Sep 17 00:00:00 2001 From: songshankun <songshankun@foxmail.com> Date: 星期五, 03 十一月 2023 14:50:31 +0800 Subject: [PATCH] Merge branch 'dev' into songshankun/add-token --- src/views/warehouseManage/bussinessType/index.vue | 100 +++++++++++++++++++++++++++++++++---------------- 1 files changed, 67 insertions(+), 33 deletions(-) diff --git a/src/views/warehouseManage/bussinessType/index.vue b/src/views/warehouseManage/bussinessType/index.vue index 8f3b512..679d229 100644 --- a/src/views/warehouseManage/bussinessType/index.vue +++ b/src/views/warehouseManage/bussinessType/index.vue @@ -3,7 +3,7 @@ <div class="top"> <SearchCommonView :add-title="'鏂板缓'" - :placeholder="'璇疯緭鍏ュ崟鍙�'" + :placeholder="'璇疯緭鍏ヤ笟鍔$被鍨�'" :amount-view="false" @addCommonClick="addBtnClick" @searchClick="getList" @@ -11,25 +11,29 @@ </div> <div class="list-view"> <div class="table"> - <TableCommonView - ref="tableListRef" - :table-list="tableList" - :show-checkcol="false" - @tableRowClick="tableRowClick" - ></TableCommonView> + <TableCommonView ref="tableListRef" :table-list="tableList" :show-checkcol="false"> + <template slot="tableButton"> + <el-table-column label="鎿嶄綔" width="100"> + <template slot-scope="scope"> + <el-button @click="tableRowClick(scope.row, '鏌ョ湅')" type="text" size="small">鏌ョ湅</el-button> + <el-button @click="tableRowClick(scope.row, '缂栬緫')" type="text" size="small">缂栬緫</el-button> + </template> + </el-table-column> + </template> + </TableCommonView> </div> <div class="btn-pager"> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> <!-- 鏂板缓/缂栬緫 --> - <AddBussinessType v-if="editConfig.visible" :edit-common-config="editConfig" /> + <AddBussinessType v-if="editConfig.visible" @refresh="refresh" :edit-common-config="editConfig" /> </div> </template> <script> import pageMixin from "@/components/makepager/pager/mixin/pageMixin" -import { getProductList } from "@/api/product/product" +import { getOperationTypeList } from "@/api/warehouseManage/warehouse" // import DetailProduct from "@/views/productManage/product/DetailProduct" import AddBussinessType from "@/views/warehouseManage/bussinessType/AddBussinessType" @@ -42,7 +46,7 @@ data() { return { tableList: {}, - searchOptions: [], + keyword: "", editConfig: { visible: false, title: "鏂板缓", @@ -58,7 +62,8 @@ setTable() { this.tableList = { tableInfomation: [], - selectBox: true, + selectBox: false, + selectIndex: true, showcol: this.showcol, allcol: [], tableColumn: this.setTableColumn(this.showcol) @@ -76,14 +81,16 @@ console.log(showcol) let tableColumn = [ { - label: "鍏ュ簱绫诲瀷", - prop: "id", + label: "涓氬姟绫诲瀷", + prop: "name", isShowColumn: true, default: true }, { label: "浠撳簱", - prop: "deviceName", + propType: "mulitple", + propTwo: "name", + prop: "warehouse", isShowColumn: true, default: true } @@ -95,41 +102,68 @@ this.tableList.tableColumn = this.setTableColumn(val) }, // 璇锋眰鏁版嵁 - async getData(val, content) { - await getProductList({ - [val]: content, + async getData() { + await getOperationTypeList({ + keyword: this.keyword, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }).then((res) => { - if (res.data.code === 200) { - const list = res.data.data.list.map((item) => { - return { - ...item, - supplierNumber: item.supplier.number, - status: "鑽夌", - preTime: "2023-09-04 11:20:00" - } - }) + if (res.code === 200) { + const list = res.data this.tableList.tableInfomation = list || [] - this.pagerOptions.totalCount = res.data.data.total + this.pagerOptions.totalCount = res.total } }) }, + refresh() { + this.pagerOptions.currPage = 1 + this.getData() + }, // 鎼滅储 getList(val) { - console.log(val) + this.keyword = val + this.pagerOptions.currPage = 1 + this.getData() }, // 琛岀偣鍑� - tableRowClick(row) { - console.log(row) + tableRowClick(row, val) { + this.editConfig.title = val + let obj = JSON.parse(JSON.stringify(row)) + for (let i in obj) { + if (i == "name" || i == "prefix") { + obj[i] = obj[i] ? obj[i] : "" + } else { + obj[i] = obj[i] ? obj[i] : null + } + } + this.editConfig.infomation = { ...obj } this.editConfig.visible = true - this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { ...row } }, // 鏂板缓 addBtnClick() { - this.editConfig.visible = true this.editConfig.title = "鏂板缓" + this.editConfig.infomation = { + name: "", + prefix: "", + // 浣滀笟绫诲瀷 + baseOperationType: null, + // 閫�璐х被鍨� + returnOperationTypeID: null, + // 鍒涘缓娆犲崟 + createBackorder: null, + // 浠撳簱 + warehouseId: null, + // 鏄剧ず浣滀笟璇︽儏 + showOperations: false, + earlyOperations: null, + // 淇濈暀鏂瑰紡 + reservationMethod: 1, + // 榛樿鍘熶綅缃� + defaultLocationSrcId: null, + // 榛樿鐩爣浣嶇疆 + defaultLocationDestId: null + } + this.editConfig.visible = true } } } -- Gitblit v1.8.0