From 45bfb77d4b4d1b1d3204475caba9b9c0e3e04ef9 Mon Sep 17 00:00:00 2001 From: 石广澎 <shiguangpeng@163.com> Date: 星期二, 12 十二月 2023 16:58:29 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- admin-web/src/views/foundation/material/specs/list.vue | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 150 insertions(+), 0 deletions(-) diff --git a/admin-web/src/views/foundation/material/specs/list.vue b/admin-web/src/views/foundation/material/specs/list.vue new file mode 100644 index 0000000..aff54dc --- /dev/null +++ b/admin-web/src/views/foundation/material/specs/list.vue @@ -0,0 +1,150 @@ +<template> + <win-md title="瑙勬牸鍨嬪彿" @close="close" :width="'800px'"> + <!--鍒楄〃--> + <my-table-v2 ref="myTable" :table="table"/> + <div slot="footer" align="center" class="dialog-footer"> + <my-button name="鍙栨秷" site="form" @click="close"/> + </div> + <specsAdd v-if="specsSetting.show" :setting="specsSetting" @close="specsSetting.show = false" @search="search"/> + </win-md> +</template> + +<script> +import winMd from '@/components/win/win-md' +import myButton from '@/components/myButton/myButton' +import {delSpecs} from "@/api/foudation/material"; +import specsAdd from "@/views/foundation/material/specs/specsAdd.vue"; +import {mapGetters} from 'vuex' +import MyTableV2 from "@/components/myTable/myTableV2.vue"; +import SettingIplatform from "@/utils/settingIplatform"; + +export default { + name: 'specs', + components: {MyTableV2, winMd, myButton, specsAdd}, + props: { + setting: { + type: Object, + default: () => { + } + } + }, + data() { + return { + specsSetting: { + title: '', + id: '', + show: false, + }, + // 琛ㄦ牸鏁版嵁 + table: { + showIndex: true, // 鏄惁鏄剧ず搴忓彿 + expand: false, // 鏄惁鏄剧ず璇︽儏鏁版嵁 + url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/list', // 璇锋眰鍦板潃 + // 宸ュ叿鏉� + tools: { + columnsCtrl: {// 鍒楁帶鍒舵寜閽� + show: false + }, + generalExport: {// 閫氱敤瀵煎嚭鎸夐挳 + show: false + }, + // 鑷畾涔夊伐鍏锋潯鎸夐挳 + custom: [ + { + name: '鏂板', + click: () => { + this.showAdd(null); + }, + }, + ] + }, + // 鍒椾俊鎭� + columns: [ + {title: '瑙勬牸鍨嬪彿', field: 'goodsCode', align: 'left', minWidth: 120}, + {title: '鍗曚綅', field: 'classification', align: 'center', width: 100}, + { + field: 'states', + title: '鐘舵��', + align: 'center', + width: 100, + switch: row => { + const result = {} + if (row.states == 1) { + Object.assign(result, { + value: true, // 寮� + label: '鏄�', // 寮�鐨勬弿杩� + click: () => { // 鐐瑰嚮浜嬩欢 + this.updState(row) + } + }) + } else { + Object.assign(result, { + value: false, // 鍏� + label: '鍚�', // 鍏崇殑鎻忚堪 + click: () => { + this.updState(row) + } + }) + } + return result + } + } + ], + // 鎿嶄綔淇℃伅 + operation: { + show: true, // 鏄剧ず鎿嶄綔鍒� + width: 100, // 鍒楀 + attr: [ + { + title: '鍒犻櫎', + events: (row) => { + this.del(row); + }, + }, + ], + }, + paging: { + show: true, // 鏄剧ず鍒嗛〉 + // 鍒嗛〉淇℃伅 + page: { + small: false, + pageNum: 1, + pageSize: 10, + total: 0 + } + } + }, + } + }, + computed: { + ...mapGetters(['userInfo']) + }, + created() { + }, + methods: { + showAdd(){ + this.specsSetting.mid = this.setting.id;//鐗╁搧ID + this.specsSetting.show = true; + }, + del(row) { + this.$modal + .confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.categoryName + '"鐨勬満鏋勫悧锛�') + .then(function () { + delSpecs({ id: row.id }).then((res) => {}); + }) + .then((res) => { + this.$message.success('鍒犻櫎鎴愬姛锛�');this.$refs.myTable.search(); + }) + .catch(() => {}); + }, + close() { + this.$emit('close') + }, + // 鏌ヨtable鍒楄〃 + search() { + this.$refs.myTable.search() + }, + + } +} +</script> -- Gitblit v1.9.1