From ed6c6350015d52ea1cb033c7558f72b721ece84a Mon Sep 17 00:00:00 2001 From: WangHan <wwh_work@126,com> Date: 星期四, 19 十二月 2024 19:58:55 +0800 Subject: [PATCH] 打包名称修改,去除错误输出 --- admin-web/src/views/foundation/material/specs/list.vue | 50 +++++++++++++++++++++++++++++++++++++------------- 1 files changed, 37 insertions(+), 13 deletions(-) diff --git a/admin-web/src/views/foundation/material/specs/list.vue b/admin-web/src/views/foundation/material/specs/list.vue index aff54dc..3ac7c61 100644 --- a/admin-web/src/views/foundation/material/specs/list.vue +++ b/admin-web/src/views/foundation/material/specs/list.vue @@ -1,7 +1,7 @@ <template> <win-md title="瑙勬牸鍨嬪彿" @close="close" :width="'800px'"> <!--鍒楄〃--> - <my-table-v2 ref="myTable" :table="table"/> + <my-table-v2 ref="myTable" :filter="{goodsTemplatesId: setting.goodsTemplatesId}" :table="table"/> <div slot="footer" align="center" class="dialog-footer"> <my-button name="鍙栨秷" site="form" @click="close"/> </div> @@ -12,7 +12,7 @@ <script> import winMd from '@/components/win/win-md' import myButton from '@/components/myButton/myButton' -import {delSpecs} from "@/api/foudation/material"; +import {delSpecs, updSpecsStatus} from "@/api/foudation/material"; import specsAdd from "@/views/foundation/material/specs/specsAdd.vue"; import {mapGetters} from 'vuex' import MyTableV2 from "@/components/myTable/myTableV2.vue"; @@ -37,9 +37,11 @@ }, // 琛ㄦ牸鏁版嵁 table: { + autoLoad: false, showIndex: true, // 鏄惁鏄剧ず搴忓彿 expand: false, // 鏄惁鏄剧ず璇︽儏鏁版嵁 - url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/list', // 璇锋眰鍦板潃 + dataIndex: 'goodsTemplatesId', + url: SettingIplatform.apiBaseURL + '/pc/base/goods/models/query/goodsModel', // 璇锋眰鍦板潃 // 宸ュ叿鏉� tools: { columnsCtrl: {// 鍒楁帶鍒舵寜閽� @@ -60,8 +62,8 @@ }, // 鍒椾俊鎭� columns: [ - {title: '瑙勬牸鍨嬪彿', field: 'goodsCode', align: 'left', minWidth: 120}, - {title: '鍗曚綅', field: 'classification', align: 'center', width: 100}, + {title: '瑙勬牸鍨嬪彿', field: 'modelName', align: 'left', minWidth: 120}, + {title: '鍗曚綅', field: 'unit', align: 'center', width: 100}, { field: 'states', title: '鐘舵��', @@ -104,7 +106,7 @@ ], }, paging: { - show: true, // 鏄剧ず鍒嗛〉 + show: false, // 鏄剧ず鍒嗛〉 // 鍒嗛〉淇℃伅 page: { small: false, @@ -119,23 +121,45 @@ computed: { ...mapGetters(['userInfo']) }, - created() { + mounted() { + this.$nextTick(() => { + this.search() + }) + }, methods: { - showAdd(){ - this.specsSetting.mid = this.setting.id;//鐗╁搧ID + showAdd() { + this.specsSetting.goodsTemplatesId = this.setting.goodsTemplatesId;//鐗╁搧ID this.specsSetting.show = true; + }, + updState(row) { + let vm = this + let text = row.states == 0 ? "鍚敤" : "绂佺敤"; + vm.$modal.confirm('纭瑕�' + text + '"' + row.modelName + '"瑙勬牸鍚楋紵').then(function () { + let params = Object.assign({}, row) + params.states = row.states == 1 ? 0 : 1 + updSpecsStatus(params).then(res => { + if (res) { + row.states = row.states === 1 ? 0 : 1 + vm.$modal.msgSuccess(text + "鎴愬姛"); + vm.search() + } + }) + }) }, del(row) { this.$modal - .confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.categoryName + '"鐨勬満鏋勫悧锛�') + .confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.modelName + '"鐨勮鏍煎悧锛�') .then(function () { - delSpecs({ id: row.id }).then((res) => {}); + delSpecs({id: row.id}).then((res) => { + }); }) .then((res) => { - this.$message.success('鍒犻櫎鎴愬姛锛�');this.$refs.myTable.search(); + this.$message.success('鍒犻櫎鎴愬姛锛�'); + this.$refs.myTable.search(); }) - .catch(() => {}); + .catch(() => { + }); }, close() { this.$emit('close') -- Gitblit v1.9.1