From 5458ac7c681ea32708229ca312dc7d8446720dc7 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期一, 12 五月 2025 14:34:59 +0800
Subject: [PATCH] 工具管理-货架标签信息管理页面

---
 src/views/tms/modules/GoodsShelvesMarkForm.vue  |  216 +++++++++++++++++++++
 src/views/tms/modules/GoodsShelvesMarkModal.vue |   60 ++++++
 src/views/tms/GoodsShelvesMarkList.vue          |  284 ++++++++++++++++++++++++++++
 3 files changed, 560 insertions(+), 0 deletions(-)

diff --git a/src/views/tms/GoodsShelvesMarkList.vue b/src/views/tms/GoodsShelvesMarkList.vue
new file mode 100644
index 0000000..b1bfc6e
--- /dev/null
+++ b/src/views/tms/GoodsShelvesMarkList.vue
@@ -0,0 +1,284 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 鏌ヨ鍖哄煙 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+          <a-col
+            :md="5"
+            :sm="8"
+          >
+            <a-form-item label="浠撳簱缂栧彿">
+              <a-select
+                show-search
+                :filter-option="filterOption"
+                placeholder="璇疯緭鍏ヤ粨搴撶紪鍙�"
+                v-model="queryParam.warehouseId"
+                :options="warehouseOptions"
+                @change="warehouseChange"
+              ></a-select>
+            </a-form-item>
+          </a-col>
+          <a-col
+            :md="5"
+            :sm="8"
+          >
+            <a-form-item label="璐ф灦缂栧彿">
+              <a-select
+                show-search
+                :filter-option="filterOption"
+                placeholder="璇疯緭鍏ヨ揣鏋剁紪鍙�"
+                v-model="queryParam.goodsShelves"
+                :options="goodsShelvesOptions"
+                @change="goodsShelvesChange"
+              ></a-select>
+            </a-form-item>
+          </a-col>
+          <a-col
+            :md="5"
+            :sm="8"
+          >
+            <a-form-item label="灞傛暟">
+              <a-select
+                show-search
+                :filter-option="filterOption"
+                placeholder="璇疯緭鍏ュ眰鏁�"
+                v-model="queryParam.storey"
+                :options="storeyOptions"
+              ></a-select>
+            </a-form-item>
+          </a-col>
+
+          <a-col :md="4" :sm="4">
+            <a-space>
+              <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>
+            </a-space>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 鏌ヨ鍖哄煙-END -->
+
+    <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button>
+<!--      <a-button type="primary" icon="download" @click="handleExportXls('tms_goods_shelves_mark')">瀵煎嚭</a-button>-->
+<!--      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
+<!--        <a-button type="primary" icon="import">瀵煎叆</a-button>-->
+<!--      </a-upload>-->
+      <!-- 楂樼骇鏌ヨ鍖哄煙 -->
+<!--      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
+<!--      <a-dropdown v-if="selectedRowKeys.length > 0">-->
+<!--        <a-menu slot="overlay">-->
+<!--          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item>-->
+<!--        </a-menu>-->
+<!--        <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button>-->
+<!--      </a-dropdown>-->
+    </div>
+
+    <!-- table鍖哄煙-begin -->
+    <div>
+<!--      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">-->
+<!--        <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤�-->
+<!--        <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a>-->
+<!--      </div>-->
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="null"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleDetail(record)">璇︽儏</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleEdit(record)">缂栬緫</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)">
+                  <a>鍒犻櫎</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <goods-shelves-mark-modal ref="modalForm" @ok="modalFormOk"></goods-shelves-mark-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import GoodsShelvesMarkModal from './modules/GoodsShelvesMarkModal'
+  import { getAction } from '../../api/manage'
+
+  export default {
+    name: 'GoodsShelvesMarkList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      GoodsShelvesMarkModal
+    },
+    data () {
+      return {
+        description: 'tms_goods_shelves_mark',
+        // 琛ㄥご
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'浠撳簱缂栧彿',
+            align:"center",
+            dataIndex: 'warehouseId',
+            customRender:function (text,r) {
+              return r.warehouseNum + '/' + r.warehouseName
+            }
+          },
+          {
+            title:'璐ф灦缂栧彿',
+            align:"center",
+            dataIndex: 'goodsShelves',
+            customRender:function (text,r) {
+              return r.goodsShelves + '/' + r.shelfName
+            }
+          },
+          {
+            title:'灞傛暟',
+            align:"center",
+            dataIndex: 'storey'
+          },
+          {
+            title:'鍝佺(瀛樻斁鍒�鍏峰搧绉嶄俊鎭�)',
+            align:"center",
+            dataIndex: 'variety'
+          },
+          {
+            title:'鍒涘缓浜�',
+            align:"center",
+            dataIndex: 'createBy'
+          },
+          {
+            title:'鍒涘缓鏃堕棿',
+            align:"center",
+            dataIndex: 'createTime'
+          },
+          {
+            title: '鎿嶄綔',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/tms/goodsShelvesMark/list",
+          queryWarehouseDictList: '/tms/warehouse/queryWarehouseDictList',
+          queryGoodsShelvesDictList: '/tms/goodsShelves/queryGoodsShelvesDictList',
+          queryGoodsShelvesStoreyDictList: '/tms/goodsShelves/queryGoodsShelvesStoreyDictList',
+          delete: "/tms/goodsShelvesMark/delete",
+          deleteBatch: "/tms/goodsShelvesMark/deleteBatch",
+          exportXlsUrl: "/tms/goodsShelvesMark/exportXls",
+          importExcelUrl: "tms/goodsShelvesMark/importExcel",
+
+        },
+        warehouseId: '',
+        warehouseOptions: [],
+        goodsShelvesOptions: [],
+        storeyOptions: [],
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+      this.getSuperFieldList();
+      getAction(this.url.queryWarehouseDictList, null).then((res)=>{
+        if(res.success){
+          this.warehouseOptions = res.result
+        }
+      })
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      searchReset() {
+        this.queryParam = {}
+        this.warehouseId = ''
+        this.goodsShelvesOptions = []
+        this.storeyOptions = []
+        this.loadData(1);
+      },
+      warehouseChange(warehouseId) {
+        this.goodsShelvesOptions = []
+        this.storeyOptions = []
+        this.warehouseId = warehouseId
+        getAction(this.url.queryGoodsShelvesDictList, {warehouseId: warehouseId}).then(res => {
+          if (res.success) {
+            this.goodsShelvesOptions = res.result
+          }
+        })
+      },
+      goodsShelvesChange(shelfNumber) {
+        this.storeyOptions = []
+        getAction(this.url.queryGoodsShelvesStoreyDictList, {
+          warehouseId: this.warehouseId,
+          shelfNumber: shelfNumber
+        }).then(res => {
+          if (res.success) {
+            this.storeyOptions = res.result
+          }
+        })
+      },
+      filterOption(input, option) {
+        return (
+          option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+        );
+      },
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'string',value:'warehouseId',text:'浠撳簱缂栧彿',dictCode:''})
+        fieldList.push({type:'string',value:'goodsShelves',text:'璐ф灦缂栧彿',dictCode:''})
+        fieldList.push({type:'string',value:'storey',text:'灞傛暟淇℃伅',dictCode:''})
+        fieldList.push({type:'string',value:'variety',text:'鍝佺-鏍囨敞瀛樻斁鍒�鍏峰搧绉嶄俊鎭�',dictCode:''})
+        fieldList.push({type:'string',value:'createBy',text:'鍒涘缓浜�',dictCode:''})
+        fieldList.push({type:'date',value:'createTime',text:'鍒涘缓鏃堕棿'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>
\ No newline at end of file
diff --git a/src/views/tms/modules/GoodsShelvesMarkForm.vue b/src/views/tms/modules/GoodsShelvesMarkForm.vue
new file mode 100644
index 0000000..6150ce0
--- /dev/null
+++ b/src/views/tms/modules/GoodsShelvesMarkForm.vue
@@ -0,0 +1,216 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="浠撳簱缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warehouseId">
+              <a-select :disabled="editDisabled" show-search :filterOption="filterOption" :options="warehouseOptions" @change="warehouseChange" v-model="model.warehouseId" placeholder="璇疯緭鍏ヤ粨搴撶紪鍙�"  ></a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="璐ф灦缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsShelves">
+              <a-select :disabled="editDisabled" show-search :filterOption="filterOption" :options="goodsShelvesOptions" @change="goodsShelvesChange" v-model="model.goodsShelves" placeholder="璇疯緭鍏ヨ揣鏋剁紪鍙�"  ></a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="灞傛暟淇℃伅" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="storey">
+              <a-select :disabled="editDisabled" show-search :filterOption="filterOption" :options="storeyOptions" v-model="model.storey" placeholder="璇疯緭鍏ュ眰鏁颁俊鎭�"  ></a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="鍝佺(瀛樻斁鍒�鍏峰搧绉嶄俊鎭�)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="variety">
+              <a-input v-model="model.variety" placeholder="璇疯緭鍏ュ搧绉�(瀛樻斁鍒�鍏峰搧绉嶄俊鎭�)"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'GoodsShelvesMarkForm',
+    components: {
+    },
+    props: {
+      //琛ㄥ崟绂佺敤
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      },
+      title: {
+        type: String,
+        default: '',
+        required: false
+      },
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+          warehouseId: [
+            { required: true, message: '璇烽�夋嫨浠撳簱!'},
+          ],
+          goodsShelves: [
+            { required: true, message: '璇烽�夋嫨璐ф灦!'},
+          ],
+          storey: [
+            { required: true, message: '璇烽�夋嫨灞�!'},
+            { validator: this.validateDuplicate }
+          ],
+          variety: [
+            { required: true, message: '璇疯緭鍏ュ搧绉嶄俊鎭�!'}
+          ]
+        },
+        url: {
+          add: "/tms/goodsShelvesMark/add",
+          queryWarehouseDictList: '/tms/warehouse/queryWarehouseDictList',
+          queryGoodsShelvesDictList: '/tms/goodsShelves/queryGoodsShelvesDictList',
+          queryGoodsShelvesStoreyDictList: '/tms/goodsShelves/queryGoodsShelvesStoreyDictList',
+          edit: "/tms/goodsShelvesMark/edit",
+          queryById: "/tms/goodsShelvesMark/queryById",
+          duplicateCheckSelect: '/tms/goodsShelvesMark/duplicateCheckSelect'
+        },
+        editDisabled: false,
+        warehouseOptions: [],
+        goodsShelvesOptions: [],
+        storeyOptions: []
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //澶囦唤model鍘熷鍊�
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      validateDuplicate(rule, value, callback) {
+        getAction(this.url.duplicateCheckSelect, {
+          warehouseId: this.model.warehouseId,
+          goodsShelves: this.model.goodsShelves,
+          storey: this.model.storey,
+        }).then(res => {
+          if (res.success) {
+            if (this.title === '鏂板' && res.result.length > 0) {
+              callback(new Error('璇ヨ揣鏋舵墍鍦ㄥ眰鏍囩淇℃伅宸插瓨鍦�!'))
+            }
+            if (this.title === '缂栬緫' && res.result.length > 0) {
+              const result = res.result.filter(item => item.id !== this.model.id)
+              if (result.length > 0) {
+                callback(new Error('璇ヨ揣鏋舵墍鍦ㄥ眰鏍囩淇℃伅宸插瓨鍦�!'))
+              } else {
+                callback()
+              }
+            }
+            callback()
+          } else {
+            callback(new Error(res.message))
+          }
+        })
+      },
+      warehouseChange(warehouseId) {
+        this.goodsShelvesOptions = []
+        this.storeyOptions = []
+        this.warehouseId = warehouseId
+        getAction(this.url.queryGoodsShelvesDictList, {warehouseId: warehouseId}).then(res => {
+          if (res.success) {
+            this.goodsShelvesOptions = res.result
+          }
+        })
+      },
+      goodsShelvesChange(shelfNumber) {
+        this.storeyOptions = []
+        getAction(this.url.queryGoodsShelvesStoreyDictList, {
+          warehouseId: this.warehouseId,
+          shelfNumber: shelfNumber
+        }).then(res => {
+          if (res.success) {
+            this.storeyOptions = res.result
+          }
+        })
+      },
+      filterOption(input, option) {
+        return (
+          option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+        );
+      },
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        getAction(this.url.queryWarehouseDictList, null).then((res)=>{
+          if(res.success){
+            this.warehouseOptions = res.result
+          }
+        })
+        getAction(this.url.queryGoodsShelvesDictList, { warehouseId: record.warehouseId }).then(res => {
+          if (res.success) {
+            this.goodsShelvesOptions = res.result
+          }
+        })
+        getAction(this.url.queryGoodsShelvesStoreyDictList,  { warehouseId: record.warehouseId, shelfNumber: record.goodsShelves }).then(res => {
+          if (res.success) {
+            this.storeyOptions = res.result
+          }
+        })
+        if (this.title === '鏂板' || this.title === '璇︽儏') {
+          this.editDisabled = false
+        }
+        if (this.title === '缂栬緫') {
+          this.editDisabled = true
+        }
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 瑙﹀彂琛ㄥ崟楠岃瘉
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+
+        })
+      },
+    }
+  }
+</script>
\ No newline at end of file
diff --git a/src/views/tms/modules/GoodsShelvesMarkModal.vue b/src/views/tms/modules/GoodsShelvesMarkModal.vue
new file mode 100644
index 0000000..afc85bd
--- /dev/null
+++ b/src/views/tms/modules/GoodsShelvesMarkModal.vue
@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="鍏抽棴">
+    <goods-shelves-mark-form ref="realForm" @ok="submitCallback" :title="title" :disabled="disableSubmit"></goods-shelves-mark-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import GoodsShelvesMarkForm from './GoodsShelvesMarkForm'
+  export default {
+    name: 'GoodsShelvesMarkModal',
+    components: {
+      GoodsShelvesMarkForm
+    },
+    data () {
+      return {
+        title:'',
+        width:896,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
\ No newline at end of file

--
Gitblit v1.9.3