From 9f225bb1f1e26d25c1652d3e1ec2a8f239f69615 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期二, 18 三月 2025 10:41:29 +0800 Subject: [PATCH] 1 --- 项目代码/WMS/WIDESEA_WMSClient/src/extension/basic/locationInfo.js | 143 ++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 126 insertions(+), 17 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/basic/locationInfo.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/basic/locationInfo.js" index 862e1a8..087439a 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/basic/locationInfo.js" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/basic/locationInfo.js" @@ -1,11 +1,11 @@ //姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜 - +import gridBody from './extend/LocationStatus.vue' let extension = { components: { //鏌ヨ鐣岄潰鎵╁睍缁勪欢 gridHeader: '', - gridBody: '', + gridBody: gridBody, gridFooter: '', //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢 modelHeader: '', @@ -17,34 +17,143 @@ methods: { //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄� onInit() { + //绗簩涓寜閽悗闈㈡坊鍔犳寜閽粍 + // this.buttons.splice(2, 1, { + // name: '绂佺敤鐘舵��', + // type: 'primary', + // value:"", + // plain: true, + // data: [ + // { + // name: '姝e父', + // icon: 'el-icon-plus', + // onClick: () => { + // this.$message.info('姝e父'); + // } + // }, + // { + // name: '鍙叆', + // icon: 'el-icon-zoom-out', + // onClick: () => { + // this.$message.info('鍙叆'); + // } + // } + // ] + // }); + let params = { + // MethodName: null, + // Remark: null, + Extra: null, + DelKeys: null + } + let enableStatusBtn = this.buttons.find(x => x.value == 'enableStatus'); + if (enableStatusBtn) { + enableStatusBtn.data = [ + { + name: '姝e父', + icon: 'el-icon-circle-check', + onClick: () => { + // this.$message.info('姝e父'); + // params.Remark = "姝e父"; + params.Extra = 0 + // this.$message.info(params.Remark); + this.enableStatus(params, "姝e父") + } + }, + { + name: '鍙叆', + icon: 'el-icon-circle-plus-outline', + onClick: () => { + // let params = { + // MethodName: "LocationDisableStatus", + // Remark: "绂佺敤", + // } + // this.enableStatus(params) + params.Extra = 1 + this.enableStatus(params, "鍙叆") + } + }, + { + name: '鍙嚭', + icon: 'el-icon-remove-outline', + onClick:()=>{ + this.$message.info('鍙嚭'); + params.Extra = 2 + this.enableStatus(params, "鍙嚭") + } + }, + { + name: '绂佺敤', + icon: 'el-icon-circle-close', + onClick:()=>{ + params.Extra = 3 + this.enableStatus(params, "绂佺敤") + } + } + ] + } let enableBtn = this.buttons.find(x => x.value == 'Enable'); if (enableBtn) { enableBtn.onClick = function () { this.$message.success('鑷畾涔夋寜閽偣鍑讳簨浠�'); + // let params = { + // MethodName: "LocationEnableStatus", + // Remark: "鍚敤", + // keys: null + // } + // this.enableStatus(params) } } let disableBtn = this.buttons.find(x => x.value == 'Disable'); if (disableBtn) { disableBtn.onClick = function () { - this.$message.success('鑷畾涔夋寜閽偣鍑讳簨浠�'); + // let params = { + // MethodName: "LocationDisableStatus", + // Remark: "绂佺敤", + // keys: null + // } + // this.enableStatus(params) } } - this.columns.push({ - field: '鎿嶄綔', - title: '鎿嶄綔', - width: 90, - fixed: 'right', - align: 'center', - formatter: (row) => { - return ( - '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">鏌ョ湅鏄庣粏</i>' - ); - }, - click: (row) => { - this.$refs.gridBody.open(row); - } + // this.columns.push({ + // field: '鎿嶄綔', + // title: '鎿嶄綔', + // width: 90, + // fixed: 'right', + // align: 'center', + // formatter: (row) => { + // return ( + // '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">鏌ョ湅鏄庣粏</i>' + // ); + // }, + // click: (row) => { + // // this.$message.success('鑷畾涔夋寜閽偣鍑讳簨浠�'); + // this.$refs.gridBody.open(row); + // } + // }); + }, + enableStatus(params, Remark) { + let rows = this.$refs.table.getSelected(); + if (rows.length == 0) return this.$error("璇烽�夋嫨璐т綅!"); + params.DelKeys = rows.map(x => { + return x[this.table.key]; }); + if (!params.DelKeys || params.DelKeys.Length == 0) return this.$error("鏈幏鍙栧埌璐т綅淇℃伅!"); + this.$confirm("鏄惁纭瑕佸皢璐т綅銆愮鐢ㄧ姸鎬併�戣缃负" + Remark + "锛�", "鎻愮ず", { + // iconClass:"el-icon-success",//el-icon-remove鑷畾涔夊浘鏍囨牱寮� + confirmButtonText: "纭",//纭鎸夐挳鏂囧瓧鏇存崲 + cancelButtonText: "鍙栨秷",//鍙栨秷鎸夐挳鏂囧瓧鏇存崲 + // cancelBtn:"鍙栨秷",//鍙栨秷鎸夐挳鏂囧瓧鏇存崲 + showClose: true,//鏄惁鏄剧ず鍙充笂瑙掑叧闂寜閽� + type: "warning",//鎻愮ず绫诲瀷 success:鎴愬姛/info:淇℃伅/warning:璀﹀憡/error:鎶ラ敊 + }).then(() => { + this.http.post("api/LocationInfo/UpdateEnableStatus", params, "姝e湪璁剧疆璐т綅....").then(x => { + if (!x.status) return this.$error(x.message); + this.$success("璐т綅銆愮鐢ㄧ姸鎬併�戣缃负" + Remark + "鎴愬姛!"); + this.refresh(); + }); + }) }, onInited() { //妗嗘灦鍒濆鍖栭厤缃悗 -- Gitblit v1.9.3