lilei 1 年之前
父節點
當前提交
28745efb41

+ 7 - 8
src/views/numsGoodsShelves/shelfProductTempl/addHwModal.vue

@@ -17,10 +17,10 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol">
         <a-form-model-item label="货位号" prop="shelfPlaceCode">
-          <a-input v-model="form.shelfPlaceCode" @input="placeCodeBlur" placeholder="请输入货位号(字母+数字格式)"></a-input>
+          <a-input id="shelfSet-newHw-shelfPlaceCode" v-model="form.shelfPlaceCode" @input="placeCodeBlur" placeholder="请输入货位号(字母+数字格式)"></a-input>
         </a-form-model-item>
         <a-form-model-item label="绑定产品" prop="productSn">
-          <productJqList ref="productJqList" dataType="jg" @change="productJqChange"></productJqList>
+          <productJqList id="shelfSet-newHw-productJqList" ref="productJqList" dataType="jg" @change="productJqChange"></productJqList>
         </a-form-model-item>
         <a-form-model-item label="车主价">
           <a-input-number
@@ -75,11 +75,11 @@ export default {
       type: Boolean,
       default: false
     },
-    type: {
+    type: { // 编辑or新增
       type: String,
       default: ''
     },
-    nowData: {
+    nowData: { // 当前操作数据
       type: Object,
       default: () => {
         return {}
@@ -130,7 +130,6 @@ export default {
   methods: {
     // 选择产品 change
     productJqChange (obj) {
-      console.log(obj)
       this.form.productSn = obj.key || undefined
       if (obj && obj.row) {
         this.form.productCode = obj.row.code || ''
@@ -140,9 +139,9 @@ export default {
     },
     // 货位号变更
     placeCodeBlur (v) {
-    	this.$nextTick(() => {
-    		this.form.shelfPlaceCode = this.form.shelfPlaceCode.toLocaleUpperCase()
-    	})
+      this.$nextTick(() => {
+        this.form.shelfPlaceCode = this.form.shelfPlaceCode.toLocaleUpperCase()
+      })
     },
     // 保存
     handleSave () {

+ 7 - 6
src/views/numsGoodsShelves/shelfProductTempl/basicInfoModal.vue

@@ -16,12 +16,12 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol">
         <a-form-model-item label="模板名称" prop="templateName">
-          <a-input v-model="form.templateName" :maxLength="30" placeholder="请输入模板名称"></a-input>
+          <a-input id="shelfTpl-templateName" v-model="form.templateName" :maxLength="30" placeholder="请输入模板名称"></a-input>
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
-        <a-button type="primary" @click="handleSave">保存</a-button>
-        <a-button @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+        <a-button id="shelfTpl-save" type="primary" @click="handleSave">保存</a-button>
+        <a-button id="shelfTpl-cancel" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -41,7 +41,7 @@ export default {
       type: Boolean,
       default: false
     },
-    nowData: {
+    nowData: { // 当前操作数据
       type: Object,
       default: () => {
         return {}
@@ -57,8 +57,8 @@ export default {
         wrapperCol: { span: 17 }
       },
       form: {
-        templateName: '',
-        templateSn: undefined
+        templateName: '', // 模板名称
+        templateSn: undefined // 模板sn
       },
       rules: {
         templateName: [{ required: true, message: '请输入模板名称', trigger: 'change' }]
@@ -100,6 +100,7 @@ export default {
         this.$refs.ruleForm.resetFields()
       } else {
         const _this = this
+        // 如果是编辑
         if (_this.nowData) {
           this.$nextTick(() => {
             _this.form.templateName = _this.nowData.templateName || ''

+ 5 - 4
src/views/numsGoodsShelves/shelfProductTempl/chooseImportModal.vue

@@ -79,7 +79,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: { // 参数
       type: Object,
       default: () => {
         return {}
@@ -100,7 +100,7 @@ export default {
         { title: '结算价', dataIndex: 'cost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) && text.length ? _this.toThousands(text, 2) : '--') } },
         { title: '最大库容', dataIndex: 'maxQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
-      loadData: [],
+      loadData: [], // 正确数据
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '货位号', dataIndex: 'shelfPlaceCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -111,12 +111,13 @@ export default {
         { title: '最大库容', dataIndex: 'maxQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '错误原因', dataIndex: 'remark', width: '25%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      unLoadData: [],
+      unLoadData: [], // 错误数据
       loading: false,
       disabled: false
     }
   },
   methods: {
+    // 获取数据
     getData () {
       const paramsData = JSON.parse(JSON.stringify(this.paramsData))
       this.loadData = paramsData.rightList || []
@@ -141,7 +142,7 @@ export default {
         this.isShow = false
       }
     },
-    // 导出
+    // 导出错误项
     handleError () {
       const _this = this
       if (_this.paramsData.errorList.length < 1) {

+ 2 - 2
src/views/numsGoodsShelves/shelfProductTempl/importGuideModal.vue

@@ -81,7 +81,7 @@ export default {
       type: Boolean,
       default: false
     },
-    params: {
+    params: { // 参数
       type: Object,
       default: null
     }
@@ -93,7 +93,7 @@ export default {
       attachAction: process.env.VUE_APP_API_BASE_URL + '/shelfTemplate/detail/importDetail',
       filePath: location.protocol + '//' + location.host + '/templ/绑定产品导入模板.xlsx',
       paramsData: null,
-      uploadParams: {
+      uploadParams: { // 参数
         savePathType: 'local',
         templateSn: this.params.templateSn
       }

+ 24 - 11
src/views/numsGoodsShelves/shelfProductTempl/list.vue

@@ -7,12 +7,13 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="模板名称">
-                <a-input v-model.trim="queryParam.templateName" allowClear placeholder="请输入模板名称"/>
+                <a-input id="shelfPlList-templateName" v-model.trim="queryParam.templateName" allowClear placeholder="请输入模板名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="模板类型">
                 <v-select
+                  id="shelfPlList-sysFlag"
                   v-model="queryParam.sysFlag"
                   code="SHELF_TEMPLATE_SYS_FLAG"
                   placeholder="请选择模板类型"
@@ -20,14 +21,14 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shelfSetList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="shelfSetList-reset">重置</a-button>
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shelfPlList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="shelfPlList-reset">重置</a-button>
             </a-col>
           </a-row>
         </a-form>
       </div>
       <div class="table-operator">
-        <a-button type="primary" class="button-error" @click="addTemp">新增</a-button>
+        <a-button type="primary" class="button-error" @click="addTemp" id="shelfPlList-addTemp">新增</a-button>
       </div>
       <!-- 列表 -->
       <s-table
@@ -43,19 +44,31 @@
         bordered>
         <!-- 模板名称 -->
         <template slot="templateName" slot-scope="text, record">
-          <span class="table-td-link" @click="handleDetail(record)">{{ record.templateName }}</span>
+          <span class="table-td-link" id="shelfPlList-links" @click="handleDetail(record)">{{ record.templateName }}</span>
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <div>
-            <a-button size="small" v-if="record.sysFlag==0" type="link" class="button-primary" @click="addTemp(record)">更改名称</a-button>
-            <a-button size="small" type="link" class="button-primary" @click="handleCopy(record)">复制</a-button>
-            <a-button size="small" v-if="record.sysFlag==0" type="link" class="button-error" @click="handleCancel(record)">删除</a-button>
+            <a-button
+              id="shelfPlList-edit"
+              size="small"
+              v-if="record.sysFlag==0"
+              type="link"
+              class="button-primary"
+              @click="addTemp(record)">更改名称</a-button>
+            <a-button id="shelfPlList-copy" size="small" type="link" class="button-primary" @click="handleCopy(record)">复制</a-button>
+            <a-button
+              id="shelfPlList-del"
+              size="small"
+              v-if="record.sysFlag==0"
+              type="link"
+              class="button-error"
+              @click="handleCancel(record)">删除</a-button>
           </div>
         </template>
       </s-table>
     </a-spin>
-    <!-- 基础设置 -->
+    <!-- 基础设置弹框 -->
     <basic-info-modal :openModal="openModal" :nowData="nowData" @ok="saveOk" @close="openModal=false" />
   </a-card>
 </template>
@@ -104,8 +117,8 @@ export default {
           return data
         })
       },
-      openModal: false,
-      nowData: null
+      openModal: false, // 打开新增编辑弹框
+      nowData: null // 当前操作数据
     }
   },
   methods: {

+ 10 - 6
src/views/numsGoodsShelves/shelfProductTempl/set.vue

@@ -16,18 +16,18 @@
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
                 <a-form-item label="货位号">
-                  <a-input v-model.trim="queryParam.shelfPlaceCode" allowClear placeholder="请输入货位号"/>
+                  <a-input id="shelfPlSet-shelfPlaceCode" v-model.trim="queryParam.shelfPlaceCode" allowClear placeholder="请输入货位号"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品编码">
-                  <a-input v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+                  <a-input id="shelfPlSet-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <span class="table-page-search-submitButtons">
-                  <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shelfSet-refresh">查询</a-button>
-                  <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="shelfSet-reset">重置</a-button>
+                  <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shelfPlSet-refresh">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="shelfPlSet-reset">重置</a-button>
                 </span>
               </a-col>
             </a-row>
@@ -35,8 +35,8 @@
         </div>
         <!-- 操作按钮 -->
         <div class="table-operator" v-if="basicInfoData&&basicInfoData.sysFlag==0">
-          <a-button type="primary" class="button-error" @click="addHW">新增</a-button>
-          <a-button type="primary" class="button-info" @click="openGuideModal=true">导入</a-button>
+          <a-button id="shelfPlSet-addHW" type="primary" class="button-error" @click="addHW">新增</a-button>
+          <a-button id="shelfPlSet-import" type="primary" class="button-info" @click="openGuideModal=true">导入</a-button>
         </div>
         <!-- 列表 -->
         <s-table
@@ -65,12 +65,14 @@
               type="link"
               class="button-primary"
               @click="editHW(record)"
+              id="shelfPlSet-detail-edit"
             >编辑</a-button>
             <a-button
               size="small"
               type="link"
               class="button-error"
               @click="handleDel(record)"
+              id="shelfPlSet-detail-del"
             >删除</a-button>
           </template>
         </s-table>
@@ -217,10 +219,12 @@ export default {
       this.queryParam.shelfPlaceCode = ''
       this.$refs.table.refresh(true)
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 350
     },
+    // 初始页面
     pageInit () {
       this.setTableH()
       this.getDetail()