Browse Source

fix: 修复台账资产列表及编辑页配置问题

统一应用全局默认分页大小,调整表格高度计算,使用后端返回的父级分类ID替代前端字符串解析,并修正部分代码格式
yusheng 2 weeks ago
parent
commit
39b6c8fa0c

+ 1 - 1
src/main.js

@@ -47,7 +47,7 @@ Vue.use(VueClipboard);
 
 // 全局分页大小配置
 Vue.prototype.tablePageSizes = [10, 20, 30, 40, 50, 100, 200, 500];
-
+Vue.prototype.defPageSize = 20;
 let instance = null;
 
 function render(props = {}) {

+ 2 - 1
src/views/ledgerAssets/accountingLedger/components/list.vue

@@ -9,9 +9,10 @@
     <ele-pro-table
       ref="table"
       :pageSizes="tablePageSizes"
+      :page-size="defPageSize"
       :columns="columns"
       :datasource="datasource"
-      height="calc(100vh - 500px)"
+      height="calc(100vh - 320px)"
       full-height="calc(100vh - 115px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"

+ 10 - 5
src/views/ledgerAssets/accountingLedger/edit.vue

@@ -13,8 +13,14 @@
           >
         </div>
       </div>
-      <div >
-        <el-button type="primary" plain @click="handlwpbm" v-if="pageType == 'add'">选择物品</el-button>
+      <div>
+        <el-button
+          type="primary"
+          plain
+          @click="handlwpbm"
+          v-if="pageType == 'add'"
+          >选择物品</el-button
+        >
         <el-button type="primary" plain @click="meterModelOpen"
           >选择表计型号</el-button
         >
@@ -342,9 +348,8 @@
         this.form = data;
         this.form.category = res;
         this.basicInfo = data;
-        this.form.rootCategoryLevelId = this.basicInfo.categoryLevelPathId
-          .split(',')[0]
-          .replace('[', '');
+        this.form.rootCategoryLevelId =
+          this.basicInfo.categoryLevelPathIdParent;
         this.form.categoryId = this.basicInfo.id;
         this.form.name = this.basicInfo.name;
         this.form.code = data.code; //Date.now(); //res.data[0].onlyCode;

+ 2 - 1
src/views/ledgerAssets/boat/components/boat-list.vue

@@ -10,9 +10,10 @@
     <ele-pro-table
       ref="table"
       :pageSizes="tablePageSizes"
+      :page-size="defPageSize"
       :columns="columns"
       :datasource="datasource"
-      height="calc(100vh - 500px)"
+      height="calc(100vh - 320px)"
       full-height="calc(100vh - 115px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"

+ 1 - 3
src/views/ledgerAssets/boat/edit.vue

@@ -310,9 +310,7 @@
         this.form = data;
         this.form.category = res;
         this.basicInfo = data;
-        this.form.rootCategoryLevelId = this.basicInfo.categoryLevelPathId
-          .split(',')[0]
-          .replace('[', '');
+        this.form.rootCategoryLevelId =  this.basicInfo.categoryLevelPathIdParent;
         this.form.categoryId = this.basicInfo.id;
         this.form.name = this.basicInfo.name;
         this.form.code = data.code; //Date.now(); //res.data[0].onlyCode;

+ 2 - 1
src/views/ledgerAssets/equipment/components/equipment-list.vue

@@ -9,9 +9,10 @@
     <ele-pro-table
       ref="table"
       :pageSizes="tablePageSizes"
+      :page-size="defPageSize"
       :columns="columns"
       :datasource="datasource"
-      height="calc(100vh - 500px)"
+      height="calc(100vh - 320px)"
       full-height="calc(100vh - 115px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"

+ 2 - 1
src/views/ledgerAssets/material/components/material-list.vue

@@ -12,7 +12,8 @@
       :pageSizes="tablePageSizes"
       :columns="columns"
       :datasource="datasource"
-      height="calc(100vh - 500px)"
+      :page-size="defPageSize"
+      height="calc(100vh - 320px)"
       full-height="calc(100vh - 115px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"

+ 5 - 5
src/views/ledgerAssets/material/edit.vue

@@ -63,7 +63,8 @@
                 <el-input
                   class="input"
                   v-model="form.iotSubstanceCode"
-                ></el-input></el-form-item>
+                ></el-input
+              ></el-form-item>
             </el-col>
           </el-row>
           <div class="basic-details-title border-none">
@@ -178,7 +179,7 @@
         form: {
           extInfoSelf: [],
           // 基本信息
-            iotSubstanceCode: '',
+          iotSubstanceCode: '',
           iotProductKey: '',
           code: '',
           name: '',
@@ -309,9 +310,8 @@
         this.form = data;
         this.form.category = res;
         this.basicInfo = data;
-        this.form.rootCategoryLevelId = this.basicInfo.categoryLevelPathId
-          .split(',')[0]
-          .replace('[', '');
+        this.form.rootCategoryLevelId =
+          this.basicInfo.categoryLevelPathIdParent;
         this.form.categoryId = this.basicInfo.id;
         this.form.name = this.basicInfo.name;
         this.form.code = data.code; //Date.now(); //res.data[0].onlyCode;

+ 2 - 1
src/views/ledgerAssets/meter/components/equipment-list.vue

@@ -9,8 +9,9 @@
     <ele-pro-table
       ref="table"
       :columns="columns"
+      :page-size="defPageSize"
       :datasource="datasource"
-      height="calc(100vh - 500px)"
+      height="calc(100vh - 320px)"
       full-height="calc(100vh - 115px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"

+ 11 - 11
src/views/ledgerAssets/meter/edit.vue

@@ -67,7 +67,8 @@
                 <el-input
                   class="input"
                   v-model="form.iotSubstanceCode"
-                ></el-input></el-form-item>
+                ></el-input
+              ></el-form-item>
             </el-col>
           </el-row>
           <div class="basic-details-title border-none">
@@ -182,7 +183,7 @@
         form: {
           extInfoSelf: [],
           // 基本信息
-            iotSubstanceCode: '',
+          iotSubstanceCode: '',
           iotProductKey: '',
           code: '',
           name: '',
@@ -313,9 +314,8 @@
         this.form = data;
         this.form.category = res;
         this.basicInfo = data;
-        this.form.rootCategoryLevelId = this.basicInfo.categoryLevelPathId
-          .split(',')[0]
-          .replace('[', '');
+        this.form.rootCategoryLevelId =
+          this.basicInfo.categoryLevelPathIdParent;
         this.form.categoryId = this.basicInfo.id;
         this.form.name = this.basicInfo.name;
         this.form.code = data.code; //Date.now(); //res.data[0].onlyCode;
@@ -369,14 +369,14 @@
         }
         this.$refs.form.validate(async (valid) => {
           if (valid) {
-            if(!this.form.areaPersonInChargeGroupId){
+            if (!this.form.areaPersonInChargeGroupId) {
               this.$message.error('请选片区负责人部门');
-              return
-             }
-             if(!this.form.areaPersonInChargeUserId){
+              return;
+            }
+            if (!this.form.areaPersonInChargeUserId) {
               this.$message.error('请选片区负责人');
-              return
-             }
+              return;
+            }
             let par = {
               //基本信息
               ...this.form,

+ 7 - 4
src/views/ledgerAssets/mould/components/mould-list.vue

@@ -9,10 +9,11 @@
     <!-- 数据表格 -->
     <ele-pro-table
       ref="table"
-:pageSizes="tablePageSizes"
+      :pageSizes="tablePageSizes"
       :columns="columns"
+      :page-size="defPageSize"
       :datasource="datasource"
-      height="calc(100vh - 500px)"
+      height="calc(100vh - 320px)"
       full-height="calc(100vh - 115px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"
@@ -114,7 +115,9 @@
         >
           编辑
         </el-link>
-        <el-link type="primary" @click="$refs.accountingLedgerListRef.open(row)">表计BOM</el-link>
+        <el-link type="primary" @click="$refs.accountingLedgerListRef.open(row)"
+          >表计BOM</el-link
+        >
         <el-link type="primary" @click="handelBOM(row)">BOM</el-link>
       </template>
     </ele-pro-table>
@@ -218,7 +221,7 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
- 
+
           {
             prop: 'codeNumber',
             label: '编号',

+ 2 - 1
src/views/ledgerAssets/office/components/data-list.vue

@@ -11,7 +11,8 @@
       ref="table"
       :columns="columns"
       :datasource="datasource"
-      height="calc(100vh - 500px)"
+      :page-size="defPageSize"
+      height="calc(100vh - 320px)"
       full-height="calc(100vh - 115px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"

+ 5 - 5
src/views/ledgerAssets/office/edit.vue

@@ -63,7 +63,8 @@
                 <el-input
                   class="input"
                   v-model="form.iotSubstanceCode"
-                ></el-input></el-form-item>
+                ></el-input
+              ></el-form-item>
             </el-col>
           </el-row>
           <div class="basic-details-title border-none">
@@ -178,7 +179,7 @@
         form: {
           extInfoSelf: [],
           // 基本信息
-            iotSubstanceCode: '',
+          iotSubstanceCode: '',
           iotProductKey: '',
           code: '',
           name: '',
@@ -309,9 +310,8 @@
         this.form = data;
         this.form.category = res;
         this.basicInfo = data;
-        this.form.rootCategoryLevelId = this.basicInfo.categoryLevelPathId
-          .split(',')[0]
-          .replace('[', '');
+        this.form.rootCategoryLevelId =
+          this.basicInfo.categoryLevelPathIdParent;
         this.form.categoryId = this.basicInfo.id;
         this.form.name = this.basicInfo.name;
         this.form.code = data.code; //Date.now(); //res.data[0].onlyCode;

+ 2 - 1
src/views/ledgerAssets/sparepart/components/sparepart-list.vue

@@ -11,7 +11,8 @@
       ref="table"
       :columns="columns"
       :datasource="datasource"
-      height="calc(100vh - 500px)"
+      :page-size="defPageSize"
+      height="calc(100vh - 320px)"
       full-height="calc(100vh - 115px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"

+ 5 - 5
src/views/ledgerAssets/sparepart/edit.vue

@@ -63,7 +63,8 @@
                 <el-input
                   class="input"
                   v-model="form.iotSubstanceCode"
-                ></el-input></el-form-item>
+                ></el-input
+              ></el-form-item>
             </el-col>
           </el-row>
           <div class="basic-details-title border-none">
@@ -178,7 +179,7 @@
         form: {
           extInfoSelf: [],
           // 基本信息
-            iotSubstanceCode: '',
+          iotSubstanceCode: '',
           iotProductKey: '',
           code: '',
           name: '',
@@ -309,9 +310,8 @@
         this.form = data;
         this.form.category = res;
         this.basicInfo = data;
-        this.form.rootCategoryLevelId = this.basicInfo.categoryLevelPathId
-          .split(',')[0]
-          .replace('[', '');
+        this.form.rootCategoryLevelId =
+          this.basicInfo.categoryLevelPathIdParent;
         this.form.categoryId = this.basicInfo.id;
         this.form.name = this.basicInfo.name;
         this.form.code = data.code; //Date.now(); //res.data[0].onlyCode;

+ 2 - 1
src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue

@@ -10,9 +10,10 @@
     <ele-pro-table
       ref="table"
       :pageSizes="tablePageSizes"
+      :page-size="defPageSize"
       :columns="columns"
       :datasource="datasource"
-      height="calc(100vh - 500px)"
+      height="calc(100vh - 320px)"
       full-height="calc(100vh - 115px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"

+ 11 - 11
src/views/ledgerAssets/turnoverCar/edit.vue

@@ -64,7 +64,8 @@
                 <el-input
                   class="input"
                   v-model="form.iotSubstanceCode"
-                ></el-input></el-form-item>
+                ></el-input
+              ></el-form-item>
             </el-col>
           </el-row>
           <div class="basic-details-title border-none">
@@ -181,7 +182,7 @@
         form: {
           extInfoSelf: [],
           // 基本信息
-            iotSubstanceCode: '',
+          iotSubstanceCode: '',
           iotProductKey: '',
           code: '',
           name: '',
@@ -312,9 +313,8 @@
         this.form = data;
         this.form.category = res;
         this.basicInfo = data;
-        this.form.rootCategoryLevelId = this.basicInfo.categoryLevelPathId
-          .split(',')[0]
-          .replace('[', '');
+        this.form.rootCategoryLevelId =
+          this.basicInfo.categoryLevelPathIdParent;
         this.form.categoryId = this.basicInfo.id;
         this.form.name = this.basicInfo.name;
         this.form.code = data.code; //Date.now(); //res.data[0].onlyCode;
@@ -368,14 +368,14 @@
         }
         this.$refs.form.validate(async (valid) => {
           if (valid) {
-            if(!this.form.areaPersonInChargeGroupId){
+            if (!this.form.areaPersonInChargeGroupId) {
               this.$message.error('请选片区负责人部门');
-              return
-             }
-             if(!this.form.areaPersonInChargeUserId){
+              return;
+            }
+            if (!this.form.areaPersonInChargeUserId) {
               this.$message.error('请选片区负责人');
-              return
-             }
+              return;
+            }
             let par = {
               //基本信息
               ...this.form,

+ 2 - 2
src/views/ledgerAssets/turnoverDisks/components/equipment-list.vue

@@ -10,8 +10,9 @@
       ref="table"
       :pageSizes="tablePageSizes"
       :columns="columns"
+      :page-size="defPageSize"
       :datasource="datasource"
-      height="calc(100vh - 500px)"
+      height="calc(100vh - 320px)"
       full-height="calc(100vh - 115px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"
@@ -119,7 +120,6 @@
   import { businessStatus, sourceStatus } from '@/utils/dict/warehouse';
   import EquipmentSearch from '@/views/ledgerAssets/equipment/components/equipment-search.vue';
 
-
   import {
     getAssetList,
     downloadAsset,

+ 11 - 11
src/views/ledgerAssets/turnoverDisks/edit.vue

@@ -63,7 +63,8 @@
                 <el-input
                   class="input"
                   v-model="form.iotSubstanceCode"
-                ></el-input></el-form-item>
+                ></el-input
+              ></el-form-item>
             </el-col>
           </el-row>
           <div class="basic-details-title border-none">
@@ -178,7 +179,7 @@
         form: {
           extInfoSelf: [],
           // 基本信息
-            iotSubstanceCode: '',
+          iotSubstanceCode: '',
           iotProductKey: '',
           code: '',
           name: '',
@@ -309,9 +310,8 @@
         this.form = data;
         this.form.category = res;
         this.basicInfo = data;
-        this.form.rootCategoryLevelId = this.basicInfo.categoryLevelPathId
-          .split(',')[0]
-          .replace('[', '');
+        this.form.rootCategoryLevelId =
+          this.basicInfo.categoryLevelPathIdParent;
         this.form.categoryId = this.basicInfo.id;
         this.form.name = this.basicInfo.name;
         this.form.code = data.code; //Date.now(); //res.data[0].onlyCode;
@@ -365,14 +365,14 @@
         }
         this.$refs.form.validate(async (valid) => {
           if (valid) {
-            if(!this.form.areaPersonInChargeGroupId){
+            if (!this.form.areaPersonInChargeGroupId) {
               this.$message.error('请选片区负责人部门');
-              return
-             }
-             if(!this.form.areaPersonInChargeUserId){
+              return;
+            }
+            if (!this.form.areaPersonInChargeUserId) {
               this.$message.error('请选片区负责人');
-              return
-             }
+              return;
+            }
             let par = {
               //基本信息
               ...this.form,