فهرست منبع

feat(工单管理): 添加pageName参数控制配件列表审核和出库状态列的显示,优化代码格式

yusheng 7 ماه پیش
والد
کامیت
fbe4391d30

+ 8 - 2
src/views/salesServiceManagement/components/sparePartsList.vue

@@ -295,6 +295,10 @@
       hideFeeType: {
         type: Boolean,
         default: false
+      },
+      pageName: {
+        type: String,
+        default: ''
       }
     },
     data() {
@@ -438,6 +442,7 @@
             fixed: 'right',
             label: '审核状态',
             align: 'center',
+            isNone: this.pageName != 'workOrder',
             formatter: (row) => {
               if (row.typeId == 2) {
                 return !row.sparePartsApplyApprovalStatus
@@ -451,6 +456,7 @@
             prop: 'sparePartsApplyApprovalStatus',
             width: 120,
             fixed: 'right',
+            isNone: this.pageName != 'workOrder',
             label: '出库状态',
             formatter: (row) => {
               if (row.typeId == 2) {
@@ -473,7 +479,7 @@
             showOverflowTooltip: true,
             show: this.type != 'view'
           }
-        ];
+        ].filter((el) => !el.isNone);
       },
       chooseShow() {
         return (scope) => {
@@ -702,7 +708,7 @@
         this.$set(
           this.form.tableList[this.currentIndex],
           'measureUnit',
-          data[0].measuringUnit||data[0].measureUnit
+          data[0].measuringUnit || data[0].measureUnit
         );
         this.$set(this.form.tableList[this.currentIndex], 'totalCount', 1);
         this.$set(

+ 7 - 3
src/views/salesServiceManagement/workOrder/components/declarationDialog.vue

@@ -170,8 +170,9 @@
                 <spareParts
                   ref="sparePartsRef2"
                   :state="type == 'edit' || type == 'report' ? '可操作' : ''"
-                  :type="type == 'edit'|| type == 'report' ? 'edit' : 'view'"
+                  :type="type == 'edit' || type == 'report' ? 'edit' : 'view'"
                   obtain="仓库"
+                  pageName="workOrder"
                 ></spareParts>
                 <!--  source="报工信息" -->
               </el-col>
@@ -260,6 +261,7 @@
                   ref="sparePartsRef"
                   :state="type == 'edit' ? '可操作' : ''"
                   :type="type == 'edit' ? 'edit' : 'view'"
+                  pageName="workOrder"
                 ></spareParts>
                 <!-- source="报工信息" -->
               </el-col>
@@ -405,7 +407,9 @@
           if (this.infoShow) {
             this.detailList = res.accessoryApply?.detailList;
             this.$refs.infoRef.init(res.afterSalesDemandVO);
-            this.$refs.sparePartsRef.setTableValue(res?.costListVOS.filter(item=>item.typeId==2) || []);
+            this.$refs.sparePartsRef.setTableValue(
+              res?.costListVOS.filter((item) => item.typeId == 2) || []
+            );
             this.$refs.infoRef2.init(res.afterSalesDemandVO);
             this.$refs.sparePartsRef2.setTableValue(res?.costListVOS || []);
             this.$set(this.addForm, 'startTime', this.addForm.acceptTime);
@@ -413,7 +417,7 @@
             this.calculateTimeConversion(res.inFactDuration);
           } else {
             this.$refs.infoRef2.init(res.afterSalesDemandVO);
-            this.$refs.sparePartsRef2.setTableValue(res?.costListVOS|| []);
+            this.$refs.sparePartsRef2.setTableValue(res?.costListVOS || []);
           }
           this.$refs.plan.init(res.afterSalesPlanVO);
         });