Просмотр исходного кода

fix(库存表格详情): 修复单位显示为空时的undefined问题

yusheng 7 месяцев назад
Родитель
Сommit
d0589445d2

+ 4 - 4
src/BIZComponents/inventoryTableDetails.vue

@@ -57,7 +57,7 @@
           :prop="'datasource.' + scope.$index + '.' + countObj.countKey"
         >
           {{ scope.row[countObj.countKey] }}
-          {{ scope.row[countObj.unitKey] }}
+          {{ scope.row[countObj.unitKey] || '' }}
         </el-form-item>
       </template>
       <!-- <template v-slot:saleUnit="scope">
@@ -392,7 +392,7 @@
             headerSlot: 'headerTotalCount',
             formatter: (row, column) => {
               if (row.totalCount) {
-                return row.totalCount + ' ' + row.measuringUnit;
+                return row.totalCount + ' ' + (row.measuringUnit || '');
               }
             },
             align: 'center'
@@ -406,7 +406,7 @@
             headerSlot: 'headerSingleWeight',
             formatter: (row, column) => {
               if (row.singleWeight) {
-                return row.singleWeight + ' ' + row.weightUnit;
+                return row.singleWeight + ' ' + (row.weightUnit || '');
               }
             },
             align: 'center'
@@ -418,7 +418,7 @@
             slot: 'totalWeight',
             formatter: (row, column) => {
               if (row.totalWeight) {
-                return row.totalWeight + ' ' + row.weightUnit;
+                return row.totalWeight + ' ' + (row.weightUnit || '');
               }
             },
             align: 'center'

+ 2 - 2
src/views/bpm/handleTask/components/purchaseNeedManage/detailDialog.vue

@@ -179,7 +179,7 @@
             align: 'center',
             formatter: (row, column) => {
               if (row.purchaseCount) {
-                return row.purchaseCount + ' ' + row.purchaseUnit;
+                return row.purchaseCount + ' ' + (row.purchaseUnit || '');
               }
             }
           },
@@ -198,7 +198,7 @@
             align: 'center',
             formatter: (row, column) => {
               if (row.totalCount) {
-                return row.totalCount + ' ' + row.measuringUnit;
+                return row.totalCount + ' ' + (row.measuringUnit || '');
               }
             }
           },

+ 7 - 7
src/views/bpm/handleTask/components/purchaseOrder/detailDialog.vue

@@ -349,7 +349,7 @@
             align: 'center',
             formatter: (row, column) => {
               if (row.purchaseCount) {
-                return row.purchaseCount + ' ' + row.purchaseUnit;
+                return row.purchaseCount + ' ' + (row.purchaseUnit || '');
               }
             }
           },
@@ -372,7 +372,7 @@
             label: '计量数量',
             formatter: (row, column) => {
               if (row.totalCount) {
-                return row.totalCount + ' ' + row.measuringUnit;
+                return row.totalCount + ' ' + (row.measuringUnit || '');
               }
             },
             align: 'center'
@@ -415,7 +415,7 @@
             label: '单重',
             formatter: (row, column) => {
               if (row.singleWeight) {
-                return row.singleWeight + ' ' + row.weightUnit;
+                return row.singleWeight + ' ' + (row.weightUnit || '');
               }
             },
             align: 'center'
@@ -426,7 +426,7 @@
             label: '总重',
             formatter: (row, column) => {
               if (row.totalWeight) {
-                return row.totalWeight + ' ' + row.weightUnit;
+                return row.totalWeight + ' ' + (row.weightUnit || '');
               }
             },
             align: 'center'
@@ -679,7 +679,7 @@
             slot: 'totalCount',
             formatter: (row, column) => {
               if (row.totalCount) {
-                return row.totalCount + ' ' + row.measuringUnit;
+                return row.totalCount + ' ' + (row.measuringUnit || '');
               }
             },
             align: 'center'
@@ -691,7 +691,7 @@
             label: '单重',
             formatter: (row, column) => {
               if (row.singleWeight) {
-                return row.singleWeight + ' ' + row.weightUnit;
+                return row.singleWeight + ' ' + (row.weightUnit || '');
               }
             },
             align: 'center'
@@ -702,7 +702,7 @@
             label: '总重',
             formatter: (row, column) => {
               if (row.totalWeight) {
-                return row.totalWeight + ' ' + row.weightUnit;
+                return row.totalWeight + ' ' + (row.weightUnit || '');
               }
             },
             align: 'center'

+ 3 - 3
src/views/bpm/handleTask/components/purchasePlanManage/detailDialog.vue

@@ -312,7 +312,7 @@
             align: 'center',
             formatter: (row, column) => {
               if (row.purchaseCount) {
-                return row.purchaseCount + ' ' + row.purchaseUnit;
+                return row.purchaseCount + ' ' + (row.purchaseUnit || '');
               }
             }
           },
@@ -336,7 +336,7 @@
             align: 'center',
             formatter: (row, column) => {
               if (row.totalCount) {
-                return row.totalCount + ' ' + row.measuringUnit;
+                return row.totalCount + ' ' + (row.measuringUnit || '');
               }
             }
             // slot: 'totalCount'
@@ -371,7 +371,7 @@
             label: '重量',
             formatter: (row, column) => {
               if (row.totalWeight) {
-                return row.totalWeight + ' ' + row.weightUnit;
+                return row.totalWeight + ' ' + (row.weightUnit || '');
               }
             },
             align: 'center'