From 5ecb7958c96d3f0b6d47b79aff7eb306c2cf690f Mon Sep 17 00:00:00 2001 From: charles <981744753@qq.com> Date: 星期二, 06 八月 2024 11:16:58 +0800 Subject: [PATCH] gitlab上面的wms转移到公司git --- src/views/warehouseManage/bussinessType/index.vue | 114 +++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 79 insertions(+), 35 deletions(-) diff --git a/src/views/warehouseManage/bussinessType/index.vue b/src/views/warehouseManage/bussinessType/index.vue index 0d1f4d2..6ab18e4 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,12 +11,17 @@ </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="120"> + <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> + <el-button @click.stop="deleteRow(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" /> @@ -29,7 +34,7 @@ <script> import pageMixin from "@/components/makepager/pager/mixin/pageMixin" -import { getOperationTypeList } from "@/api/warehouseManage/warehouse" +import { getOperationTypeList,deleteOperationType } from "@/api/warehouseManage/warehouse" // import DetailProduct from "@/views/productManage/product/DetailProduct" import AddBussinessType from "@/views/warehouseManage/bussinessType/AddBussinessType" @@ -42,7 +47,7 @@ data() { return { tableList: {}, - keyword:'', + keyword: "", editConfig: { visible: false, title: "鏂板缓", @@ -77,15 +82,15 @@ console.log(showcol) let tableColumn = [ { - label: "鍏ュ簱绫诲瀷", + label: "涓氬姟绫诲瀷", prop: "name", isShowColumn: true, default: true }, { label: "浠撳簱", - propType:'mulitple', - propTwo:'name', + propType: "mulitple", + propTwo: "name", prop: "warehouse", isShowColumn: true, default: true @@ -104,54 +109,93 @@ page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }).then((res) => { - if (res.data.code === 200) { - const list = res.data.data + 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 + refresh() { + this.pagerOptions.currPage = 1 this.getData() }, // 鎼滅储 getList(val) { - this.keyword=val; - this.pagerOptions.currPage=1 + this.keyword = val + this.pagerOptions.currPage = 1 this.getData() }, // 琛岀偣鍑� - tableRowClick(row) { - this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { ...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 }, // 鏂板缓 addBtnClick() { this.editConfig.title = "鏂板缓" - this.editConfig.infomation={ - name:'', - prefix:'', - // 浣滀笟绫诲瀷 - baseOperationType:null, + this.editConfig.infomation = { + name: "", + prefix: "", + // 浣滀笟绫诲瀷 + baseOperationType: null, // 閫�璐х被鍨� - returnOperationTypeID:null, + returnOperationTypeID: null, // 鍒涘缓娆犲崟 - createBackorder:null, + createBackorder: null, // 浠撳簱 - warehouseId:null, + warehouseId: null, // 鏄剧ず浣滀笟璇︽儏 - showOperations:null, - earlyOperations:null, + showOperations: false, + earlyOperations: null, // 淇濈暀鏂瑰紡 - reservationMethod:null, + reservationMethod: 1, // 榛樿鍘熶綅缃� - defaultLocationSrcId:null, + defaultLocationSrcId: null, // 榛樿鐩爣浣嶇疆 - defaultLocationDestId:null, + defaultLocationDestId: null } this.editConfig.visible = true + }, + + //鍒犻櫎 + deleteRow(row){ + this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ヤ笟鍔$被鍨�, 鏄惁缁х画?', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning', + }) + .then(() => { + deleteOperationType({ + id: row.id, + }).then((res) => { + if (res.code == 200) { + this.$message({ + type: 'success', + message: '鍒犻櫎鎴愬姛!', + }) + this.getData() + }else{ + this.$message.error('鍒犻櫎鏃跺嚭閿欙紝璇风◢鍚庨噸璇曟垨鑱旂郴绠$悊鍛�...'); + + } + }) + }) + .catch(() => { + // this.$message({ + // type: 'info', + // message: '宸插彇娑堝垹闄�', + // }) + }) } } } -- Gitblit v1.8.0