From d69d36ed932e81327d60a0fc4b21686b4d5b067a Mon Sep 17 00:00:00 2001
From: pengyongcheng <pyc_1215@163.com>
Date: Fri, 2 Aug 2024 14:58:28 +0800
Subject: [PATCH] fix: 修复前端控制台报错

---
 ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------
 1 file changed, 94 insertions(+), 103 deletions(-)

diff --git a/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue b/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue
index 9138841..e256c10 100644
--- a/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue
+++ b/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue
@@ -23,17 +23,19 @@
     <div class="table-operator">
       <a-button v-has="'cycleCountHeader:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button>
       <a-button v-has="'cycleCountHeader:export'" type="primary" icon="download" @click="handleExportXls('盘点主表')">导出</a-button>
-      <a-upload v-has="'cycleCountHeader:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+      <a-upload v-has="'cycleCountHeader:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
+                :action="importExcelUrl" @change="handleImportExcel">
         <a-button type="primary" icon="import">导入</a-button>
       </a-upload>
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel">
-            <a-icon type="delete"/> 删除
+            <a-icon type="delete" />
+            删除
           </a-menu-item>
         </a-menu>
         <a-button style="margin-left: 8px"> 批量操作
-          <a-icon type="down"/>
+          <a-icon type="down" />
         </a-button>
       </a-dropdown>
     </div>
@@ -60,13 +62,13 @@
         class="j-table-force-nowrap"
         @change="handleTableChange">
         <!-- 内嵌table区域 begin -->
-<!--        <template slot="expandedRowRender" slot-scope="record">-->
-<!--          <a-tabs tabPosition="top">-->
-<!--            <a-tab-pane tab="盘点明细" key="cycleCountDetailId" forceRender>-->
-<!--              <cycle-count-detail-list :record="record" :isLoad="true"/>-->
-<!--            </a-tab-pane>-->
-<!--          </a-tabs>-->
-<!--        </template>-->
+        <!--        <template slot="expandedRowRender" slot-scope="record">-->
+        <!--          <a-tabs tabPosition="top">-->
+        <!--            <a-tab-pane tab="盘点明细" key="cycleCountDetailId" forceRender>-->
+        <!--              <cycle-count-detail-list :record="record" :isLoad="true"/>-->
+        <!--            </a-tab-pane>-->
+        <!--          </a-tabs>-->
+        <!--        </template>-->
         <!-- 内嵌table区域 end -->
         <span slot="companyCode" slot-scope="companyCode">
           <a-tag :key="companyCode" color=blue>
@@ -88,9 +90,9 @@
 
         <span slot="action" slot-scope="text, record">
           <a v-if="record.statusCyc === 1" @click="cycleCountDetailAdd(record)">新增</a>
-          <a-divider type="vertical" v-if="record.statusCyc !== 100"/>
+          <a-divider type="vertical" v-if="record.statusCyc !== 100" />
           <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
             <a-menu slot="overlay">
               <a-menu-item v-has="'cycleCountHeader:edit'">
                 <a v-if="record.statusCyc === 1" @click="handleEdit(record)">编辑</a>
@@ -106,7 +108,6 @@
             </a-menu>
           </a-dropdown>
         </span>
-
       </a-table>
     </div>
 
@@ -116,20 +117,20 @@
       </a-tab-pane>
     </a-tabs>
     <cycle-count-header-modal ref="modalForm" @ok="modalFormOk"></cycle-count-header-modal>
-    <cycle-count-detail-modal ref="detailModalForm" @ok="detailModalFormOk"/>
+    <cycle-count-detail-modal ref="detailModalForm" @ok="detailModalFormOk" />
   </a-card>
 </template>
 
 <script>
 
 import '@/assets/less/TableExpand.less'
-import {mixinDevice} from '@/utils/mixin'
-import {JeecgListMixin} from '@/mixins/JeecgListMixin'
-import {getCompanyList, getCountTypeList} from '@/api/api'
+import { mixinDevice } from '@/utils/mixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { getCompanyList, getCountTypeList } from '@/api/api'
 import CycleCountHeaderModal from './modules/CycleCountHeaderModal'
-import CycleCountDetailList from "./CycleCountDetailList";
-import Utils from "../../../components/jeecgbiz/JButtonBizComponent/util.js"
-import CycleCountDetailModal from "./modules/CycleCountDetailModal";
+import CycleCountDetailList from './CycleCountDetailList'
+import Utils from '@/components/jeecgbiz/JButtonBizComponent/util.js'
+import CycleCountDetailModal from './modules/CycleCountDetailModal'
 
 export default {
   name: 'CycleCountHeaderList',
@@ -137,158 +138,148 @@ export default {
   components: {
     CycleCountDetailModal,
     CycleCountHeaderModal,
-    CycleCountDetailList,
+    CycleCountDetailList
   },
   data() {
     return {
-      // 选择用户查询条件配置
-      selectUserQueryConfig: [
-        {key: 'locationCode', label: '库位'},
-      ],
       description: '盘点主表管理页面',
       companyList: [],
-      CountTypeList: [],
+      countTypeList: [],
       // 表头
       columns: [
         {
           title: 'ID',
-          dataIndex: '',
-          key: 'rowIndex',
+          dataIndex: 'id',
           width: 60,
-          align: "center",
-          customRender: function (t, r, index) {
-            return parseInt(index) + 1;
-          }
+          align: 'center'
+          /* key: 'rowIndex',
+          customRender: function(t, r, index) {
+            return parseInt(index) + 1
+          }*/
         },
         {
           title: '盘点单编码',
-          align: "center",
+          align: 'center',
           dataIndex: 'code'
         },
         {
           title: '货主编码',
-          align: "center",
+          align: 'center',
           dataIndex: 'companyCode',
           key: 'companyCode',
-          scopedSlots: {customRender: 'companyCode'}
+          scopedSlots: { customRender: 'companyCode' }
         },
         {
           title: '总货位数',
-          align: "center",
+          align: 'center',
           dataIndex: 'totalLocs'
         },
         {
           title: '总物料数',
-          align: "center",
+          align: 'center',
           dataIndex: 'totalItems'
         },
         {
           title: '盘点类型',
-          align: "center",
+          align: 'center',
           dataIndex: 'countType',
           key: 'countType',
-          scopedSlots: {customRender: 'countType'}
+          scopedSlots: { customRender: 'countType' }
         },
         {
           title: '盘点主单状态',
-          align: "center",
+          align: 'center',
           dataIndex: 'statusCyc_dictText',
-          scopedSlots: {customRender: 'statusCyc_dictText'}
+          scopedSlots: { customRender: 'statusCyc_dictText' }
         },
         {
           title: '指定盘点人员',
-          align: "center",
+          align: 'center',
           dataIndex: 'stocktakingAs'
         },
         {
           title: '实际盘点人员',
-          align: "center",
+          align: 'center',
           dataIndex: 'stocktakingAc'
         },
         {
           title: '是否有效',
-          align: "center",
+          align: 'center',
           dataIndex: 'enable_dictText'
         },
         {
           title: '备注',
-          align: "center",
+          align: 'center',
           dataIndex: 'remark'
         },
         {
           title: '操作',
           dataIndex: 'action',
-          align: "center",
-          // fixed:"right",
+          align: 'center',
           width: 147,
-          scopedSlots: {customRender: 'action'}
+          scopedSlots: { customRender: 'action' }
         }
       ],
       url: {
-        list: "/cycleCountHeader/cycleCountHeader/list",
-        delete: "/cycleCountHeader/cycleCountHeader/delete",
-        deleteBatch: "/cycleCountHeader/cycleCountHeader/deleteBatch",
-        exportXlsUrl: "/cycleCountHeader/cycleCountHeader/exportXls",
-        importExcelUrl: "cycleCountHeader/cycleCountHeader/importExcel",
+        list: '/cycleCountHeader/cycleCountHeader/list',
+        delete: '/cycleCountHeader/cycleCountHeader/delete',
+        deleteBatch: '/cycleCountHeader/cycleCountHeader/deleteBatch',
+        exportXlsUrl: '/cycleCountHeader/cycleCountHeader/exportXls',
+        importExcelUrl: 'cycleCountHeader/cycleCountHeader/importExcel'
       },
-      dictOptions: {
-        status: [],
-      },
-      superFieldList: [],
+      superFieldList: []
     }
   },
   created() {
-    this.getSuperFieldList();
-    this.loadFrom();
+    this.getSuperFieldList()
+    this.loadFrom()
   },
   mounted() {
-    let that = this;
+    let that = this
     Utils.$on('refreshCycleCountHeader', () => {
       that.loadData()
     })
   },
   computed: {
-    importExcelUrl: function () {
-      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-    },
+    importExcelUrl: function() {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+    }
   },
   methods: {
     initDictConfig() {
     },
     getSuperFieldList() {
-      let fieldList = [];
-      fieldList.push({type: 'string', value: 'code', text: '盘点主表编号', dictCode: ''})
-      fieldList.push({type: 'string', value: 'companyCode', text: '货主编码', dictCode: ''})
-      fieldList.push({type: 'string', value: 'countType', text: '盘点类型', dictCode: ''})
-      fieldList.push({type: 'int', value: 'statusCyc', text: '盘点状态', dictCode: 'cycleCount_status'})
-      fieldList.push({type: 'string', value: 'remark', text: '备注', dictCode: ''})
-      fieldList.push({type: 'int', value: 'totalLocs', text: '总货位数', dictCode: ''})
-      fieldList.push({type: 'int', value: 'totalItems', text: '总物料数', dictCode: ''})
-      fieldList.push({type: 'string', value: 'stocktakingAs', text: '指定盘点人员', dictCode: ''})
-      fieldList.push({type: 'string', value: 'stocktakingAc', text: '实际盘点人员', dictCode: ''})
-      fieldList.push({type: 'int', value: 'enable', text: '是否有效', dictCode: 'valid_status'})
-      fieldList.push({type: 'datetime', value: 'uploadTime', text: '回传时间'})
-      fieldList.push({type: 'int', value: 'uploadStatus', text: '回传状态', dictCode: 'valid_status'})
-      fieldList.push({type: 'string', value: 'closedBy', text: '关闭人', dictCode: ''})
+      let fieldList = []
+      fieldList.push({ type: 'string', value: 'code', text: '盘点主表编号', dictCode: '' })
+      fieldList.push({ type: 'string', value: 'companyCode', text: '货主编码', dictCode: '' })
+      fieldList.push({ type: 'string', value: 'countType', text: '盘点类型', dictCode: '' })
+      fieldList.push({ type: 'int', value: 'statusCyc', text: '盘点状态', dictCode: 'cycleCount_status' })
+      fieldList.push({ type: 'string', value: 'remark', text: '备注', dictCode: '' })
+      fieldList.push({ type: 'int', value: 'totalLocs', text: '总货位数', dictCode: '' })
+      fieldList.push({ type: 'int', value: 'totalItems', text: '总物料数', dictCode: '' })
+      fieldList.push({ type: 'string', value: 'stocktakingAs', text: '指定盘点人员', dictCode: '' })
+      fieldList.push({ type: 'string', value: 'stocktakingAc', text: '实际盘点人员', dictCode: '' })
+      fieldList.push({ type: 'int', value: 'enable', text: '是否有效', dictCode: 'valid_status' })
+      fieldList.push({ type: 'datetime', value: 'uploadTime', text: '回传时间' })
+      fieldList.push({ type: 'int', value: 'uploadStatus', text: '回传状态', dictCode: 'valid_status' })
+      fieldList.push({ type: 'string', value: 'closedBy', text: '关闭人', dictCode: '' })
       this.superFieldList = fieldList
     },
     onClearSelected() {
-      this.selectedRowKeys = [];
-      this.selectionRows = [];
-      this.selectedMainId = ''
+      this.selectedRowKeys = []
+      this.selectionRows = []
     },
     onSelectChange(selectedRowKeys, selectionRows) {
-      this.selectedMainId = selectedRowKeys[0].toString();
-      this.selectedRowKeys = selectedRowKeys;
-      this.selectionRows = selectionRows;
-      this.$refs.CycleCountDetailList.loadDatas(this.selectedRowKeys[0]);
+      this.selectedRowKeys = selectedRowKeys
+      this.selectionRows = selectionRows
+      this.$refs.CycleCountDetailList.loadDatas(this.selectedRowKeys[0])
     },
-    clickThenSelect(record,index) {
+    clickThenSelect(record, index) {
       return {
         on: {
           click: () => {
-            this.selectIndex=index
-            this.onSelectChange(record.id.toString().split(","), [record]);
+            this.selectIndex = index
+            this.onSelectChange([record.id], [record])
           }
         }
       }
@@ -301,12 +292,12 @@ export default {
         if (res.success) {
           this.companyList = res.result
         }
-      });
+      })
       getCountTypeList().then((res) => {
         if (res.success) {
-          this.CountTypeList = res.result
+          this.countTypeList = res.result
         }
-      });
+      })
     },
     solutionCompany(value) {
       let actions = []
@@ -320,21 +311,21 @@ export default {
     },
     solutionCountType(value) {
       let actions = []
-      Object.keys(this.CountTypeList).some((key) => {
-        if (this.CountTypeList[key].code === ('' + value)) {
-          actions.push(this.CountTypeList[key].name)
+      Object.keys(this.countTypeList).some((key) => {
+        if (this.countTypeList[key].code === ('' + value)) {
+          actions.push(this.countTypeList[key].name)
           return true
         }
       })
       return actions.join('')
     },
-    cycleCountDetailAdd(record){
-      this.$refs.detailModalForm.title = "库存";
-      this.$refs.detailModalForm.cycleCountHeader = record;
-      this.$refs.detailModalForm.visible = true;
+    cycleCountDetailAdd(record) {
+      this.$refs.detailModalForm.title = '库存'
+      this.$refs.detailModalForm.cycleCountHeader = record
+      this.$refs.detailModalForm.visible = true
     },
-    detailModalFormOk(){
-        this.loadData();
+    detailModalFormOk() {
+      this.loadData()
       // this.searchQuery();
     },
     getStatusColor(status) {
@@ -343,8 +334,8 @@ export default {
         '已登记': 'orange',
         '盘点完成': 'grey',
         default: 'blue'
-      };
-      return colors[status] || colors.default;
+      }
+      return colors[status] || colors.default
     },
     getCountTypeColor(countType) {
       const colors = {
@@ -353,8 +344,8 @@ export default {
         '明盘': 'cyan',
         '暗盘': 'purple',
         default: 'blue'
-      };
-      return colors[countType] || colors.default;
+      }
+      return colors[countType] || colors.default
     }
   }
 }
--
libgit2 0.22.2