Prechádzať zdrojové kódy

隐藏分拆单字段

chensibo 5 dní pred
rodič
commit
a5ac85572f
1 zmenil súbory, kde vykonal 115 pridanie a 94 odobranie
  1. 115 94
      src/views/wms/inLibrary/demergeOrder/index.vue

+ 115 - 94
src/views/wms/inLibrary/demergeOrder/index.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="app-container">
-
     <!-- 搜索工作栏 -->
     <el-form
       v-show="showSearch"
@@ -30,27 +29,30 @@
             />
           </el-form-item>
         </el-col>
-        <el-col :span="8">
-          <el-form-item label="母条码" prop="wmsLabelMasterId">
+        <!-- <el-col :span="8">
+          <el-form-item label="母条码" prop="wmsLabelMasterId">
             <el-input
               v-model="queryParams.wmsLabelMasterId"
-              placeholder="请输入母条码"
+              placeholder="请输入母条码"
               clearable
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
-
-        </el-col>
+        </el-col> -->
         <div slot="right">
           <el-form-item label-width="0" class="text-right" style="word">
-            <EasyAdvancedQuery class="mr10" label-width="98px" @advQuery="advQuery">
-              <template #default="{model}">
+            <EasyAdvancedQuery
+              class="mr10"
+              label-width="98px"
+              @advQuery="advQuery"
+            >
+              <template #default="{ model }">
                 <el-row :gutter="10" type="flex">
                   <el-col :span="12">
-                    <el-form-item label="批号" prop="batchNumber">
+                    <el-form-item label="条码号" prop="batchNumber">
                       <el-input
                         v-model="model.batchNumber"
-                        placeholder="请输入号"
+                        placeholder="请输入条码号"
                         clearable
                         @keyup.enter.native="handleQuery"
                       />
@@ -69,8 +71,12 @@
                 </el-row>
               </template>
             </EasyAdvancedQuery>
-            <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
-            <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+            <el-button type="primary" icon="el-icon-search" @click="handleQuery"
+              >搜索</el-button
+            >
+            <el-button icon="el-icon-refresh" @click="resetQuery"
+              >重置</el-button
+            >
           </el-form-item>
         </div>
       </QueryFormWrapper>
@@ -85,7 +91,8 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-        >新增</el-button>
+          >新增</el-button
+        >
       </el-col>
       <right-toolbar
         :columns="columnsList"
@@ -97,7 +104,7 @@
 
     <!-- 列表 -->
     <AutoResizer :given-height="188">
-      <template #default="{height}">
+      <template #default="{ height }">
         <el-table
           v-if="columnsList.length > 0"
           v-loading="loading"
@@ -118,25 +125,26 @@
                 size="mini"
                 type="text"
                 @click="handleToDemerge(scope.row)"
-              >{{ scope.row.splitNo }}</el-button>
+                >{{ scope.row.splitNo }}</el-button
+              >
             </template>
           </el-table-column>
           <el-table-column
             v-if="columnsList[1].visible"
             :key="Math.random()"
-            label="母条码"
+            label="母条码"
             align="center"
             prop="wmsLabelMasterId"
-            width="120"
+            width="210"
             show-overflow-tooltip
           />
           <el-table-column
             v-if="columnsList[8].visible"
             :key="Math.random()"
-            label="号"
+            label="条码号"
             align="center"
             prop="batchNumber"
-            width="120"
+            width="210"
             show-overflow-tooltip
           />
           <el-table-column
@@ -165,7 +173,10 @@
             prop="splitType"
           >
             <template slot-scope="scope">
-              <dict-tag :type="DICT_TYPE.WMS_SPLIT_TYPE" :value="scope.row.splitType" />
+              <dict-tag
+                :type="DICT_TYPE.WMS_SPLIT_TYPE"
+                :value="scope.row.splitType"
+              />
             </template>
           </el-table-column>
           <el-table-column
@@ -226,19 +237,17 @@
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
-
   </div>
 </template>
 
 <script>
-import { getSplitOrderMasterPage2 } from '@/api/wms/inLibrary/demergeOrder'
-import { getFormColumnsList } from '@/api/system/saveColumns/index'
-import { isArray } from 'min-dash'
+import { getSplitOrderMasterPage2 } from "@/api/wms/inLibrary/demergeOrder";
+import { getFormColumnsList } from "@/api/system/saveColumns/index";
+import { isArray } from "min-dash";
 
 export default {
-  name: 'DemergeOrder',
-  components: {
-  },
+  name: "DemergeOrder",
+  components: {},
   data() {
     return {
       // 遮罩层
@@ -252,7 +261,7 @@ export default {
       // 分拆单列表
       list: [],
       // 弹出层标题
-      title: '',
+      title: "",
       // 是否显示弹出层
       open: false,
       // 高级查询参数
@@ -266,89 +275,92 @@ export default {
         materialName: null,
         createTime: [],
         creator: null,
-        wmsLabelMasterId: null
+        wmsLabelMasterId: null,
       },
       // 表单参数
       form: {},
       // 表单校验
-      rules: {
-      },
+      rules: {},
       // 显示隐藏列参数
       columns: [
-        { key: 0, label: '分拆单号', visible: true },
-        { key: 1, label: '母材条码', visible: true },
-        { key: 2, label: '物料编码', visible: true },
-        { key: 3, label: '分拆类型', visible: true },
-        { key: 4, label: '备注', visible: true },
-        { key: 5, label: '创建时间', visible: true },
-        { key: 6, label: '创建人', visible: true },
-        { key: 7, label: '物料名称', visible: true },
-        { key: 8, label: '批号', visible: true }
+        { key: 0, label: "分拆单号", visible: true },
+        { key: 1, label: "母条码", visible: false },
+        { key: 2, label: "物料编码", visible: true },
+        { key: 3, label: "分拆类型", visible: true },
+        { key: 4, label: "备注", visible: true },
+        { key: 5, label: "创建时间", visible: true },
+        { key: 6, label: "创建人", visible: true },
+        { key: 7, label: "物料名称", visible: true },
+        { key: 8, label: "条码号", visible: true },
       ],
       // 显示隐藏持久化参数
-      columnsList: []
-    }
+      columnsList: [],
+    };
   },
   created() {
     // 获取显隐列列表
-    this.getColumnsList()
-    this.getList()
+    this.getColumnsList();
+    this.getList();
   },
   methods: {
     /** 查询列表 */
     getList() {
-      this.loading = true
+      this.loading = true;
       // 执行查询
       const params = {
         ...this.queryParams,
-        ...this.advParams
-      }
-      getSplitOrderMasterPage2(params).then(res => {
-        this.list = res.data.list
-        this.total = res.data.total
-      }).finally(() => {
-        this.loading = false
-      })
+        ...this.advParams,
+      };
+      getSplitOrderMasterPage2(params)
+        .then((res) => {
+          this.list = res.data.list;
+          this.total = res.data.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     /** 取消按钮 */
     cancel() {
-      this.open = false
-      this.reset()
+      this.open = false;
+      this.reset();
     },
     /** 表单重置 */
     reset() {
-      this.form = {
-      }
-      this.resetForm('form')
+      this.form = {};
+      this.resetForm("form");
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNo = 1
-      this.getList()
+      this.queryParams.pageNo = 1;
+      this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm('queryForm')
-      this.advParams = {}
-      this.handleQuery()
+      this.resetForm("queryForm");
+      this.advParams = {};
+      this.handleQuery();
     },
     // 跳转分拆单详情
     handleToDemerge(row) {
-      const { id, splitNo } = row
-      this.$router.push({ path: '/inLibrary/demerge-order-details', query: { id, splitNo }})
+      const { id, splitNo } = row;
+      this.$router.push({
+        path: "/inLibrary/demerge-order-details",
+        query: { id, splitNo },
+      });
     },
     // 开单
     handleAdd() {
-      this.$router.push({ path: '/inLibrary/demerge-order-details' })
+      this.$router.push({ path: "/inLibrary/demerge-order-details" });
     },
     // 高级查询
     advQuery(advQueryParams) {
-      this.advParams = advQueryParams
-      this.handleQuery()
+      this.advParams = advQueryParams;
+      this.handleQuery();
     },
     // 删除
     handleDelete(row) {
-      this.$modal.msgWarning('该功能暂未开放')
+      this.$modal.msgWarning("该功能暂未开放");
       // const { id, ebillNo } = row
       // this.$modal.confirm('是否确认删除分切单号为"' + ebillNo + '"的数据项?').then(function() {
       //   // return deleteSlittingOrderMaster(id)
@@ -360,31 +372,40 @@ export default {
     },
     // 获取显示隐藏列
     getColumnsList() {
-      const { componentName } = this.$route.meta || null
+      const { componentName } = this.$route.meta || null;
       const params = {
         userId: this.userId,
-        vueForm: componentName
-      }
-      getFormColumnsList(params).then(res => {
-        if (isArray(res.data)) {
-          this.columnsList = res.data.length === 0 ? this.columns : res.data
-          // 对比默认数据和接口数据,将缺失的列添加到接口数据中
-          this.columnsList = this.columns.reduce((acc, defaultColumn) => {
-            const found = res.data.find(apiColumn => apiColumn.key === defaultColumn.key)
-            if (!found) {
-              acc.push({ ...defaultColumn, vueForm: componentName, userId: this.userId, id: null })
-            }
-            return acc
-          }, res.data)
-        } else {
-          this.columnsList = this.columns
-        }
-      }).catch((err) => {
-        if (err) {
-          this.columnsList = this.columns
-        }
-      })
-    }
-  }
-}
+        vueForm: componentName,
+      };
+      getFormColumnsList(params)
+        .then((res) => {
+          if (isArray(res.data)) {
+            this.columnsList = res.data.length === 0 ? this.columns : res.data;
+            // 对比默认数据和接口数据,将缺失的列添加到接口数据中
+            this.columnsList = this.columns.reduce((acc, defaultColumn) => {
+              const found = res.data.find(
+                (apiColumn) => apiColumn.key === defaultColumn.key
+              );
+              if (!found) {
+                acc.push({
+                  ...defaultColumn,
+                  vueForm: componentName,
+                  userId: this.userId,
+                  id: null,
+                });
+              }
+              return acc;
+            }, res.data);
+          } else {
+            this.columnsList = this.columns;
+          }
+        })
+        .catch((err) => {
+          if (err) {
+            this.columnsList = this.columns;
+          }
+        });
+    },
+  },
+};
 </script>