Ver código fonte

refactor(inventoryTable): 优化单位显示方式,将单位与数值合并显示并移除独立单位列

yusheng 10 meses atrás
pai
commit
7d4108c53a

+ 58 - 27
src/BIZComponents/inventoryTable.vue

@@ -534,7 +534,11 @@
             v-model="scope.row.singleWeight"
             @input="changeCount(scope.row, scope.$index)"
             placeholder="请输入"
-          ></el-input>
+          >
+            <template slot="append">
+              {{ scope.row.weightUnit }}
+            </template>
+          </el-input>
         </el-form-item>
       </template>
       <template v-slot:technologyRouteName="scope">
@@ -690,10 +694,25 @@
             :min="0"
             @input="changeCount(scope.row, scope.$index)"
           >
+            <template slot="append">
+              <el-select
+                v-model="scope.row[countObj.unitIdKey]"
+                style="width: 80px"
+                @change="changeCount(scope.row, scope.$index)"
+              >
+                <el-option
+                  :label="item.conversionUnit"
+                  :value="item.id"
+                  @click.native="packingChange(item, scope.$index)"
+                  v-for="(item, index) in scope.row.packageDispositionList"
+                  :key="index"
+                ></el-option>
+              </el-select>
+            </template>
           </el-input>
         </el-form-item>
       </template>
-      <template v-slot:saleUnit="scope">
+      <!-- <template v-slot:saleUnit="scope">
         <el-form-item
           :prop="'datasource.' + scope.$index + '.' + countObj.unitIdKey"
         >
@@ -711,7 +730,7 @@
             ></el-option>
           </el-select>
         </el-form-item>
-      </template>
+      </template> -->
       <template v-slot:modelKey="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.' + 'modelKey'">
           <DictSelection
@@ -1181,20 +1200,20 @@
                 width: 1
               },
           {
-            width: 150,
+            width: 250,
             prop: 'saleCount',
             label: '数量',
             slot: 'saleCount',
             headerSlot: this.isTotalCount ? 'headerTotalCount' : '',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'saleUnit',
-            label: '单位',
-            slot: 'saleUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 150,
+          //   prop: 'saleUnit',
+          //   label: '单位',
+          //   slot: 'saleUnit',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'packingSpecification',
@@ -1209,15 +1228,21 @@
             prop: 'totalCount',
             label: '计量数量',
             headerSlot: 'headerTotalCount',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
-          {
-            width: 120,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 120,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+
+          //   align: 'center'
+          // },
           {
             minWidth: 120,
             prop: 'goodsLevel',
@@ -1321,26 +1346,32 @@
           },
 
           {
-            width: 120,
+            width: 180,
             prop: 'singleWeight',
             label: '单重',
             slot: 'singleWeight',
+
             align: 'center'
           },
           {
-            width: 120,
+            width: 150,
             prop: 'totalWeight',
             label: '总重',
             slot: 'totalWeight',
+            formatter: (row, column) => {
+              if (row.totalWeight) {
+                return row.totalWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
-          {
-            width: 120,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 120,
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   slot: 'weightUnit',
+          //   align: 'center'
+          // },
           {
             width: 160,
             prop: 'productBrand',

+ 57 - 32
src/BIZComponents/inventoryTableDetails.vue

@@ -67,17 +67,17 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.' + countObj.countKey"
         >
-          {{ scope.row[countObj.countKey] }}
+          {{ scope.row[countObj.countKey] }}{{ scope.row[countObj.unitKey] }}
         </el-form-item>
       </template>
-      <template v-slot:saleUnit="scope">
+      <!-- <template v-slot:saleUnit="scope">
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.' + countObj.unitKey"
         >
           {{ scope.row[countObj.unitKey] }}
         </el-form-item>
-      </template>
+      </template> -->
 
       <!-- 新增字段插槽 -->
       <template v-slot:thickNess="scope">
@@ -447,21 +447,21 @@
                 width: 1
               },
           {
-            width: 150,
+            width: 180,
             prop: 'saleCount',
             label: '数量',
             slot: 'saleCount',
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'saleUnit',
-            label: '单位',
-            slot: 'saleUnit',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
+          // {
+          //   width: 150,
+          //   prop: 'saleUnit',
+          //   label: '单位',
+          //   slot: 'saleUnit',
+          //   headerSlot: 'headerTotalCount',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'packingSpecification',
@@ -475,61 +475,86 @@
             label: '计量数量',
             slot: 'totalCount',
             headerSlot: 'headerTotalCount',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
-          {
-            width: 120,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 120,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+          //   align: 'center'
+          // },
           wmsColumn,
           this.pageName == 'send'
             ? {
-                minWidth: 110,
+                minWidth: 140,
                 prop: 'sendTotalCount',
                 label: '已发货数量',
                 slot: 'sendTotalCount',
-                align: 'center'
+                align: 'center',
+                formatter: (row, column) => {
+                  if (row.sendTotalCount) {
+                    return row.sendTotalCount + ' ' + row.measuringUnit;
+                  }
+                }
               }
             : {
                 width: 1
               },
           this.pageName == 'send'
             ? {
-                minWidth: 110,
+                minWidth: 140,
                 prop: 'notSendTotalCount',
                 label: '未发货数量',
                 slot: 'notSendTotalCount',
-                align: 'center'
+                align: 'center',
+                formatter: (row, column) => {
+                  if (row.notSendTotalCount) {
+                    return row.notSendTotalCount + ' ' + row.measuringUnit;
+                  }
+                }
               }
             : {
                 width: 1
               },
 
           {
-            width: 120,
+            width: 140,
             prop: 'singleWeight',
             label: '单重',
             slot: 'singleWeight',
             headerSlot: 'headerSingleWeight',
+            formatter: (row, column) => {
+              if (row.singleWeight) {
+                return row.singleWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
           {
-            width: 120,
+            width: 140,
             prop: 'totalWeight',
             label: '总重',
             slot: 'totalWeight',
+            formatter: (row, column) => {
+              if (row.totalWeight) {
+                return row.totalWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
-          {
-            width: 120,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 120,
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   slot: 'weightUnit',
+          //   align: 'center'
+          // },
 
           {
             width: 160,

+ 43 - 27
src/views/saleManage/saleOrder/customerReturnOrder/addOrEditDialog.vue

@@ -111,8 +111,13 @@
             <el-input
               v-if="dialogType !== 'view'"
               v-model="row.weight"
-            ></el-input>
-            <div v-else>{{ row.weight }}</div>
+            >
+           <template slot="append">
+             {{ row.weightUnit }}
+           </template>
+          </el-input>
+            <div v-else>{{ row.weight }}  {{ row.weightUnit }}</div>
+           
           </el-form-item>
         </template>
 
@@ -274,7 +279,7 @@
       // outboundDetailsDialog,
       // headList,
       returnOrderDialog,
-      ProductionVersion,
+      ProductionVersion
       // fileMain
     },
     data() {
@@ -299,12 +304,12 @@
         rules: {
           returnNo: { required: true, message: '请选择', trigger: 'change' }
         },
-        columnsVersion:1
+        columnsVersion: 1
       };
     },
     computed: {
       columns() {
-        let columnsVersion=this.columnsVersion
+        let columnsVersion = this.columnsVersion;
         let basicFields = [
           {
             width: 45,
@@ -377,29 +382,39 @@
             prop: 'packingQuantity',
             align: 'center',
             label: '包装数量',
+            formatter: (row, column) => {
+              if (row.packingQuantity) {
+                return row.packingQuantity + ' ' + row.packingUnit;
+              }
+            },
             showOverflowTooltip: true
           },
-          {
-            minWidth: 120,
-            prop: 'packingUnit',
-            align: 'center',
-            label: '包装单位',
-            showOverflowTooltip: true
-          },
+          // {
+          //   minWidth: 120,
+          //   prop: 'packingUnit',
+          //   align: 'center',
+          //   label: '包装单位',
+          //   showOverflowTooltip: true
+          // },
           {
             minWidth: 100,
             prop: 'measurementCount',
             label: '计量数量',
+            formatter: (row, column) => {
+              if (row.measurementCount) {
+                return row.measurementCount + ' ' + row.measurementUnit;
+              }
+            },
             showOverflowTooltip: true,
             align: 'center'
           },
-          {
-            minWidth: 150,
-            prop: 'measurementUnit',
-            label: '计量单位',
-            showOverflowTooltip: true,
-            align: 'center'
-          },
+          // {
+          //   minWidth: 150,
+          //   prop: 'measurementUnit',
+          //   label: '计量单位',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
           // {
           //   width: 100,
           //   prop: 'singlePrice',
@@ -415,20 +430,21 @@
           // },
 
           {
-            minWidth: 80,
+            minWidth: 180,
             prop: 'weight',
             label: '重量',
             slot: 'weight',
+ 
             showOverflowTooltip: true,
             align: 'center'
           },
-          {
-            minWidth: 100,
-            prop: 'weightUnit',
-            label: '重量单位',
-            showOverflowTooltip: true,
-            align: 'center'
-          },
+          // {
+          //   minWidth: 100,
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
           {
             width: 240,
             prop: 'technologyRouteName',

+ 33 - 32
src/views/saleManage/saleOrder/entrustedReceive/components/detailDialog.vue

@@ -169,14 +169,12 @@
             minWidth: 140,
             prop: 'productName',
             label: '名称',
-            slot: 'productName',
             align: 'center'
           },
           {
             minWidth: 120,
             prop: 'productCode',
             label: '编码',
-            slot: 'productCode',
             align: 'center'
           },
           // {
@@ -190,51 +188,44 @@
             width: 160,
             prop: 'productBrand',
             label: '牌号',
-            slot: 'productBrand',
             align: 'center'
           },
           {
             width: 120,
             prop: 'modelType',
             label: '型号',
-            slot: 'modelType',
             align: 'center'
           },
           {
             width: 120,
             prop: 'specification',
             label: '规格',
-            slot: 'specification',
             align: 'center'
           },
-           {
+          {
             minWidth: 120,
             prop: 'modelKey',
             label: '机型',
             showOverflowTooltip: true,
-            align: 'center',
-
+            align: 'center'
           },
           {
             minWidth: 120,
             prop: 'colorKey',
             showOverflowTooltip: true,
             label: '颜色',
-            align: 'center',
-
+            align: 'center'
           },
           {
             width: 200,
             prop: 'customerMark',
             label: '客户代号',
-            slot: 'customerMark',
             align: 'center'
           },
           {
             width: 200,
             prop: 'warehouseName',
             label: '仓库名称',
-            slot: 'warehouseName',
             align: 'center'
           },
           // {
@@ -248,7 +239,11 @@
             width: 120,
             prop: 'totalCount',
             label: '本次收货数量',
-            slot: 'totalCount',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            },
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
@@ -259,35 +254,43 @@
           //   slot: 'receiveTotalCount',
           //   align: 'center'
           // },
-          {
-            width: 120,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 120,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'singleWeight',
             label: '单重',
-            slot: 'singleWeight',
+            formatter: (row, column) => {
+              if (row.singleWeight) {
+                return row.singleWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
           {
             width: 100,
             prop: 'receiveTotalWeight',
             label: '收货总重',
-            slot: 'receiveTotalWeight',
-            align: 'center'
-          },
-          {
-            width: 100,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit',
+            formatter: (row, column) => {
+              if (row.receiveTotalWeight) {
+                return row.receiveTotalWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
           // {
+          //   width: 100,
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   slot: 'weightUnit',
+          //   align: 'center'
+          // },
+          // {
           //   width: 160,
           //   prop: 'pricingWay',
           //   label: '计价方式',
@@ -413,9 +416,7 @@
         ]
       };
     },
-    created() {
-   
-    },
+    created() {},
     methods: {
       async open(row) {
         this.form = row;

+ 36 - 21
src/views/saleManage/saleOrder/entrustedReceive/components/inventoryTable.vue

@@ -89,7 +89,11 @@
             v-model="scope.row.totalCount"
             type="number"
             @input="(val) => changeNum(val, scope.row, scope.$index)"
-          ></el-input>
+          >
+        <template slot="append">
+          {{ scope.row.measuringUnit }}
+        </template>
+        </el-input>
         </el-form-item>
       </template>
       <template v-slot:batchNo="scope">
@@ -112,7 +116,6 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.singlePrice'"
-         
         >
           <el-input
             v-model="scope.row.singlePrice"
@@ -271,7 +274,7 @@
       },
       pricingWay: [Number, String],
       customerMark: '',
-      batchNo:''
+      batchNo: ''
     },
     components: {
       warehouseAll,
@@ -404,7 +407,7 @@
           //   align: 'center'
           // },
           {
-            width: 150,
+            width: 200,
             prop: 'totalCount',
             label: '本次收货数量',
             slot: 'totalCount',
@@ -418,34 +421,42 @@
           //   slot: 'receiveTotalCount',
           //   align: 'center'
           // },
-          {
-            minWidth: 100,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
-          },
+          // {
+          //   minWidth: 100,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'singleWeight',
             label: '单重',
-            slot: 'singleWeight',
+            formatter: (row, column) => {
+              if (row.singleWeight) {
+                return row.singleWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
           {
             width: 100,
             prop: 'receiveTotalWeight',
             label: '收货总重',
-            slot: 'receiveTotalWeight',
-            align: 'center'
-          },
-          {
-            width: 100,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit',
+            formatter: (row, column) => {
+              if (row.receiveTotalWeight) {
+                return row.receiveTotalWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
+          // {
+          //   width: 100,
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   slot: 'weightUnit',
+          //   align: 'center'
+          // },
 
           {
             width: 150,
@@ -647,7 +658,11 @@
           'totalPrice',
           this.getTotalPrice(row).toFixed(2)
         );
-        this.$set(this.form.datasource[index], 'discountSinglePrice', row.singlePrice);
+        this.$set(
+          this.form.datasource[index],
+          'discountSinglePrice',
+          row.singlePrice
+        );
         this.$set(
           this.form.datasource[index],
           'discountTotalPrice',

+ 422 - 417
src/views/saleManage/saleOrder/exceptionManagement/components/addOrEditDialog.vue

@@ -146,7 +146,11 @@
             v-model="scope.row.totalCount"
             type="number"
             placeholder="请输入"
-          ></el-input>
+          >
+            <template slot="append">
+              {{ scope.row.measuringUnit }}
+            </template>
+          </el-input>
         </template>
         <!-- 操作列 -->
         <template v-slot:action="scope" v-if="title != '详情'">
@@ -207,448 +211,449 @@
 </template>
 
 <script>
-import dictMixins from '@/mixins/dictMixins';
-import { getById, update, save } from '@/api/exceptionManagement/index';
-import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
-import { getSendSaleOrderConfirmDetail } from '@/api/saleManage/invoiceConfirm';
-import { getReceiveConfirmDetail } from '@/api/purchasingManage/invoiceConfirm';
-import { relationTypeOption } from '@/enum/dict.js';
-import bpmDetail from '@/views/bpm/processInstance/detail.vue';
-import sendConfirmDialog from '@/views/saleManage/saleOrder/invoiceConfirm/components/sendConfirmDialog.vue';
-import receiveTListDialog from '@/views/purchasingManage/purchaseOrder/invoiceConfirm/components/receiveTListDialog.vue';
-import { getCurrentUser, setCurrentUser } from '@/utils/token-util';
+  import dictMixins from '@/mixins/dictMixins';
+  import { getById, update, save } from '@/api/exceptionManagement/index';
+  import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
+  import { getSendSaleOrderConfirmDetail } from '@/api/saleManage/invoiceConfirm';
+  import { getReceiveConfirmDetail } from '@/api/purchasingManage/invoiceConfirm';
+  import { relationTypeOption } from '@/enum/dict.js';
+  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
+  import sendConfirmDialog from '@/views/saleManage/saleOrder/invoiceConfirm/components/sendConfirmDialog.vue';
+  import receiveTListDialog from '@/views/purchasingManage/purchaseOrder/invoiceConfirm/components/receiveTListDialog.vue';
+  import { getCurrentUser, setCurrentUser } from '@/utils/token-util';
 
-const def = {
-  name: '',
-  relationCode: '',
-  relationType: '',
-  relationName: '',
-  relationTypeName: '',
-  relationId: '',
-  formCreateUserId: '',
-  detailList: [],
-  currentUser: '',
-  businessId: ''
-};
-export default {
-  mixins: [dictMixins],
-  components: {
-    processSubmitDialog,
-    bpmDetail,
-    sendConfirmDialog,
-    receiveTListDialog
-  },
-  props: {
-    // 1: 销售订单, 2: 采购订单
-    relationType: {
-      default: 1
-    }
-  },
-  created() {
-    this.currentUser = getCurrentUser();
-    console.log(this.currentUser);
-  },
-  data() {
-    return {
-      activeComp: 'main',
-      tabOptions: [
-        { key: 'main', name: '处置详情' },
-        { key: 'bpm', name: '流程详情' }
-      ],
-      title: '',
-      addOrEditDialogFlag: false,
-      fullscreen: false,
-      processSubmitDialogFlag: false,
+  const def = {
+    name: '',
+    relationCode: '',
+    relationType: '',
+    relationName: '',
+    relationTypeName: '',
+    relationId: '',
+    formCreateUserId: '',
+    detailList: [],
+    currentUser: '',
+    businessId: ''
+  };
+  export default {
+    mixins: [dictMixins],
+    components: {
+      processSubmitDialog,
+      bpmDetail,
+      sendConfirmDialog,
+      receiveTListDialog
+    },
+    props: {
+      // 1: 销售订单, 2: 采购订单
+      relationType: {
+        default: 1
+      }
+    },
+    created() {
+      this.currentUser = getCurrentUser();
+      console.log(this.currentUser);
+    },
+    data() {
+      return {
+        activeComp: 'main',
+        tabOptions: [
+          { key: 'main', name: '处置详情' },
+          { key: 'bpm', name: '流程详情' }
+        ],
+        title: '',
+        addOrEditDialogFlag: false,
+        fullscreen: false,
+        processSubmitDialogFlag: false,
 
-      rules: {
-        name: [{ required: true, message: '请输入名称', trigger: 'change' }],
+        rules: {
+          name: [{ required: true, message: '请输入名称', trigger: 'change' }],
 
-        relationCode: [
-          { required: true, message: '请选择来源', trigger: 'change' }
-        ]
-      },
-      form: { ...def }
-    };
-  },
-  computed: {
-    columns() {
-      return [
-        {
-          width: 45,
-          type: 'index',
-          columnKey: 'index',
-          align: 'center',
-          fixed: 'left'
+          relationCode: [
+            { required: true, message: '请选择来源', trigger: 'change' }
+          ]
         },
+        form: { ...def }
+      };
+    },
+    computed: {
+      columns() {
+        return [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
 
-        {
-          width: 220,
-          prop: 'exceptionDetermine',
-          label: '异常类型',
-          slot: 'exceptionDetermine',
-          fixed: 'left',
-          align: 'center',
-          headerSlot: 'headerExceptionDispose'
-        },
-        {
-          width: 220,
-          prop: 'exceptionDispose',
-          label: '处置方式',
-          slot: 'exceptionDispose',
-          fixed: 'left',
-          align: 'center',
-          headerSlot: 'headerExceptionDispose'
-        },
-        {
-          minWidth: 160,
-          prop: 'productCode',
-          label: '编码',
-          showOverflowTooltip: true,
-          align: 'center'
-        },
-        {
-          minWidth: 120,
-          prop: 'productName',
-          label: '名称',
-          showOverflowTooltip: true,
-          align: 'center'
-        },
-        {
-          width: 120,
-          prop: 'specification',
-          label: '规格',
-          slot: 'specification',
-          align: 'center'
-        },
-        {
-          width: 120,
-          prop: 'modelType',
-          label: '型号',
-          slot: 'modelType',
-          align: 'center'
-        },
-        {
-          width: 120,
-          prop: 'productBrand',
-          label: '牌号',
-          align: 'center'
-        },
+          {
+            width: 220,
+            prop: 'exceptionDetermine',
+            label: '异常类型',
+            slot: 'exceptionDetermine',
+            fixed: 'left',
+            align: 'center',
+            headerSlot: 'headerExceptionDispose'
+          },
+          {
+            width: 220,
+            prop: 'exceptionDispose',
+            label: '处置方式',
+            slot: 'exceptionDispose',
+            fixed: 'left',
+            align: 'center',
+            headerSlot: 'headerExceptionDispose'
+          },
+          {
+            minWidth: 160,
+            prop: 'productCode',
+            label: '编码',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'productName',
+            label: '名称',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'specification',
+            label: '规格',
+            slot: 'specification',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'modelType',
+            label: '型号',
+            slot: 'modelType',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'productBrand',
+            label: '牌号',
+            align: 'center'
+          },
 
-        // {
-        //   minWidth: 100,
-        //   prop: 'saleCount',
-        //   label: '发货数量',
-        //   showOverflowTooltip: true,
-        //   align: 'center'
-        // },
-        {
-          minWidth: 100,
-          prop: 'totalCount',
-          slot: 'totalCount',
-          label: '异常数量',
-          showOverflowTooltip: true,
-          align: 'center'
-        },
-        {
-          minWidth: 160,
-          prop: 'batchNo',
-          label: '批次号',
-          showOverflowTooltip: true,
-          slot: 'batchNo',
-          align: 'center'
-        },
-        {
-          minWidth: 160,
-          prop: 'barcodes',
-          label: '发货条码',
-          showOverflowTooltip: true,
-          slot: 'barcodes',
-          align: 'center'
-        },
-        {
-          minWidth: 120,
-          prop: 'materielDesignation',
-          label: '物料代号',
-          showOverflowTooltip: true,
-          align: 'center'
-        },
-        {
-          minWidth: 120,
-          prop: 'clientCode',
-          label: this.relationType == 1 ? '客户代号' : '供应商代号',
-          showOverflowTooltip: true,
-          align: 'center'
-        },
-        {
-          minWidth: 120,
-          prop: 'engrave',
-          label: '刻码',
-          showOverflowTooltip: true,
-          align: 'center'
-        },
-        // {
-        //   minWidth: 160,
-        //   prop: 'packageNo',
-        //   align: 'center',
-        //   label: '包装编码',
-        //   showOverflowTooltip: true
-        // },
-        // {
-        //   minWidth: 100,
-        //   prop: 'packingQuantity',
-        //   align: 'center',
-        //   label: '包装数量',
-        //   showOverflowTooltip: true
-        // },
-        // {
-        //   minWidth: 120,
-        //   prop: 'packingUnit',
-        //   align: 'center',
-        //   label: '包装单位',
-        //   showOverflowTooltip: true
-        // },
+          // {
+          //   minWidth: 100,
+          //   prop: 'saleCount',
+          //   label: '发货数量',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
+          {
+            minWidth: 180,
+            prop: 'totalCount',
+            slot: 'totalCount',
+            label: '异常数量',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 160,
+            prop: 'batchNo',
+            label: '批次号',
+            showOverflowTooltip: true,
+            slot: 'batchNo',
+            align: 'center'
+          },
+          {
+            minWidth: 160,
+            prop: 'barcodes',
+            label: '发货条码',
+            showOverflowTooltip: true,
+            slot: 'barcodes',
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'materielDesignation',
+            label: '物料代号',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'clientCode',
+            label: this.relationType == 1 ? '客户代号' : '供应商代号',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'engrave',
+            label: '刻码',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          // {
+          //   minWidth: 160,
+          //   prop: 'packageNo',
+          //   align: 'center',
+          //   label: '包装编码',
+          //   showOverflowTooltip: true
+          // },
+          // {
+          //   minWidth: 100,
+          //   prop: 'packingQuantity',
+          //   align: 'center',
+          //   label: '包装数量',
+          //   showOverflowTooltip: true
+          // },
+          // {
+          //   minWidth: 120,
+          //   prop: 'packingUnit',
+          //   align: 'center',
+          //   label: '包装单位',
+          //   showOverflowTooltip: true
+          // },
 
-        {
-          minWidth: 150,
-          prop: 'measuringUnit',
-          label: '计量单位',
-          showOverflowTooltip: true,
-          align: 'center'
-        },
-        {
-          minWidth: 120,
-          prop: 'modelKey',
-          label: '机型',
-          showOverflowTooltip: true,
-          align: 'center'
-        },
-        {
-          minWidth: 120,
-          prop: 'colorKey',
-          showOverflowTooltip: true,
-          label: '颜色',
-          align: 'center'
-        },
+          // {
+          //   minWidth: 150,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
+          {
+            minWidth: 120,
+            prop: 'modelKey',
+            label: '机型',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'colorKey',
+            showOverflowTooltip: true,
+            label: '颜色',
+            align: 'center'
+          },
 
-        {
-          width: 220,
-          prop: 'describes',
-          label: '描述',
-          slot: 'describes',
-          align: 'center'
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 120,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          fixed: 'right',
-          showOverflowTooltip: true
-        }
-      ];
-    },
-    options() {
-      return this.relationType == 1
-        ? [
-            { label: '退货入库', value: 1 },
-            { label: '返工返修', value: 2 },
-            { label: '报损', value: 3 },
-            { label: '报废', value: 4 }
-          ]
-        : [
-            { label: '退货出库', value: 1 },
-            { label: '返工返修', value: 2 },
-            { label: '报损', value: 3 },
-            { label: '报废', value: 4 }
-          ];
+          {
+            width: 220,
+            prop: 'describes',
+            label: '描述',
+            slot: 'describes',
+            align: 'center'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 120,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            fixed: 'right',
+            showOverflowTooltip: true
+          }
+        ];
+      },
+      options() {
+        return this.relationType == 1
+          ? [
+              { label: '退货入库', value: 1 },
+              { label: '返工返修', value: 2 },
+              { label: '报损', value: 3 },
+              { label: '报废', value: 4 }
+            ]
+          : [
+              { label: '退货出库', value: 1 },
+              { label: '返工返修', value: 2 },
+              { label: '报损', value: 3 },
+              { label: '报废', value: 4 }
+            ];
+      },
+      options1() {
+        return this.relationType == 1
+          ? [
+              { label: '多发', value: 1 },
+              { label: '少发', value: 2 },
+              { label: '错发', value: 3 },
+              { label: '损坏', value: 4 }
+            ]
+          : [
+              { label: '多收', value: 1 },
+              { label: '少收', value: 2 },
+              { label: '错收', value: 3 },
+              { label: '损坏', value: 4 }
+            ];
+      }
     },
-    options1() {
-      return this.relationType == 1
-        ? [
-            { label: '多发', value: 1 },
-            { label: '少发', value: 2 },
-            { label: '错发', value: 3 },
-            { label: '损坏', value: 4 }
-          ]
-        : [
-            { label: '多收', value: 1 },
-            { label: '少收', value: 2 },
-            { label: '错收', value: 3 },
-            { label: '损坏', value: 4 }
-          ];
-    }
-  },
 
-  methods: {
-    openDialog() {
-      let ref =
-        this.relationType == 1
-          ? 'sendConfirmDialogRef'
-          : 'receiveTListDialogRef';
-      this.$refs[ref].open();
-    },
-    //打开新增编辑弹框
-    async open(type, row) {
-      this.title = type == 'edit' ? '处置' : type == 'add' ? '新建' : '详情';
+    methods: {
+      openDialog() {
+        let ref =
+          this.relationType == 1
+            ? 'sendConfirmDialogRef'
+            : 'receiveTListDialogRef';
+        this.$refs[ref].open();
+      },
+      //打开新增编辑弹框
+      async open(type, row) {
+        this.title = type == 'edit' ? '处置' : type == 'add' ? '新建' : '详情';
 
-      this.addOrEditDialogFlag = true;
-      console.log(row);
-      if (row && row?.id) {
-        await this.getById(row?.id);
-      } else {
-        this.form.relationType = this.relationType;
-        this.form.relationTypeName = relationTypeOption[this.relationType];
-      }
-    },
-    async changeParent(data) {
-      console.log('data~~~~~~', this.relationType, data);
-      if (this.relationType == 1) {
-        const res = await getSendSaleOrderConfirmDetail(data.id);
-        this.form.relationCode = res.docNo;
-        this.form.relationId = res.id;
-        this.form.relationName = res.contactName + '-' + res.docNo;
-        this.$set(this.form, 'detailList', res.productList);
-      }
-      if (this.relationType == 2) {
-        const res = await getReceiveConfirmDetail(data.id);
-        this.form.relationCode = res.receiveConfirmNo;
-        this.form.relationId = res.id;
-        res.productList = res.productList.map((item) => {
-          item['clientCode'] = item.supplierMark;
-          return item;
-        });
+        this.addOrEditDialogFlag = true;
+        console.log(row);
+        if (row && row?.id) {
+          await this.getById(row?.id);
+        } else {
+          this.form.relationType = this.relationType;
+          this.form.relationTypeName = relationTypeOption[this.relationType];
+        }
+      },
+      async changeParent(data) {
+        console.log('data~~~~~~', this.relationType, data);
+        if (this.relationType == 1) {
+          const res = await getSendSaleOrderConfirmDetail(data.id);
+          this.form.relationCode = res.docNo;
+          this.form.relationId = res.id;
+          this.form.relationName = res.contactName + '-' + res.docNo;
+          this.$set(this.form, 'detailList', res.productList);
+        }
+        if (this.relationType == 2) {
+          const res = await getReceiveConfirmDetail(data.id);
+          this.form.relationCode = res.receiveConfirmNo;
+          this.form.relationId = res.id;
+          res.productList = res.productList.map((item) => {
+            item['clientCode'] = item.supplierMark;
+            return item;
+          });
 
-        this.form.relationName = res.supplierName + '-' + res.receiveConfirmNo;
-        this.$set(this.form, 'detailList', res.productList);
-      }
-    },
+          this.form.relationName =
+            res.supplierName + '-' + res.receiveConfirmNo;
+          this.$set(this.form, 'detailList', res.productList);
+        }
+      },
 
-    //获取订单详情
-    async getById(id) {
-      this.loading = true;
-      let data = await getById(id);
-      data['relationTypeName'] = relationTypeOption[data.relationType];
+      //获取订单详情
+      async getById(id) {
+        this.loading = true;
+        let data = await getById(id);
+        data['relationTypeName'] = relationTypeOption[data.relationType];
 
-      this.loading = false;
-      if (data) {
-        this.form = data;
-      }
-    },
-    getValidate() {
-      return Promise.all([
-        new Promise((resolve, reject) => {
-          this.$refs.form.validate((valid) => {
-            if (!valid) {
-              reject(false);
-            } else {
-              resolve(true);
+        this.loading = false;
+        if (data) {
+          this.form = data;
+        }
+      },
+      getValidate() {
+        return Promise.all([
+          new Promise((resolve, reject) => {
+            this.$refs.form.validate((valid) => {
+              if (!valid) {
+                reject(false);
+              } else {
+                resolve(true);
+              }
+            });
+          })
+        ]).catch((e) => {
+          this.$message.warning('有必填项未填写,请检查');
+          return Promise.reject(e);
+        });
+      },
+      async save(type) {
+        try {
+          await this.getValidate();
+          this.loading = true;
+          let isExceptionDispose = false;
+          let isExceptionDetermine = false;
+
+          this.form.formCreateUserId = this.currentUser.currentRoleId;
+          this.form.detailList.forEach((item) => {
+            if (!item.exceptionDispose) {
+              isExceptionDispose = true;
             }
-          });
-        })
-      ]).catch((e) => {
-        this.$message.warning('有必填项未填写,请检查');
-        return Promise.reject(e);
-      });
-    },
-    async save(type) {
-      try {
-        await this.getValidate();
-        this.loading = true;
-        let isExceptionDispose = false;
-        let isExceptionDetermine = false;
 
-        this.form.formCreateUserId = this.currentUser.currentRoleId;
-        this.form.detailList.forEach((item) => {
-          if (!item.exceptionDispose) {
-            isExceptionDispose = true;
+            if (!item.exceptionDetermine) {
+              isExceptionDetermine = true;
+            }
+          });
+          if (isExceptionDispose) {
+            this.$message.error('处置方式不能为空');
+            return;
           }
-
-          if (!item.exceptionDetermine) {
-            isExceptionDetermine = true;
+          if (isExceptionDetermine) {
+            this.$message.error('异常类型不能为空');
+            return;
           }
-        });
-        if (isExceptionDispose) {
-          this.$message.error('处置方式不能为空');
-          return;
-        }
-        if (isExceptionDetermine) {
-          this.$message.error('异常类型不能为空');
-          return;
+          let api = this.form.id ? update : save;
+          api(this.form)
+            .then((res) => {
+              this.loading = false;
+              this.businessId = res;
+              console.log(this.businessId);
+              this.$message.success('操作成功');
+              if (type === 'sub') {
+                this.submit(res);
+                return;
+              }
+              this.cancel();
+            })
+            .catch((e) => {
+              this.loading = false;
+            });
+        } catch (error) {
+          console.log(error);
+          // 表单验证未通过,不执行保存操作
         }
-        let api = this.form.id ? update : save;
-        api(this.form)
-          .then((res) => {
-            this.loading = false;
-            this.businessId = res;
-            console.log(this.businessId);
-            this.$message.success('操作成功');
-            if (type === 'sub') {
-              this.submit(res);
-              return;
-            }
-            this.cancel();
-          })
-          .catch((e) => {
-            this.loading = false;
-          });
-      } catch (error) {
-        console.log(error);
-        // 表单验证未通过,不执行保存操作
-      }
-    },
-    remove(index) {
-      this.form.detailList.splice(index, 1);
-    },
+      },
+      remove(index) {
+        this.form.detailList.splice(index, 1);
+      },
 
-    async submit() {
-      this.processSubmitDialogFlag = true;
+      async submit() {
+        this.processSubmitDialogFlag = true;
 
-      this.$nextTick(() => {
-        console.log(this.businessId);
-        let params = {
-          businessId: this.form.id || this.businessId || '',
-          businessKey: 'eom_exception_approve',
-          formCreateUserId:
-            this.form.createUserId || this.currentUser?.currentRoleId || '',
-          variables: {
-            businessCode: this.form.code,
-            businessName: this.form.name,
-            businessType: this.form.relationName
-          }
+        this.$nextTick(() => {
+          console.log(this.businessId);
+          let params = {
+            businessId: this.form.id || this.businessId || '',
+            businessKey: 'eom_exception_approve',
+            formCreateUserId:
+              this.form.createUserId || this.currentUser?.currentRoleId || '',
+            variables: {
+              businessCode: this.form.code,
+              businessName: this.form.name,
+              businessType: this.form.relationName
+            }
+          };
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
+      reload() {
+        this.cancel();
+      },
+      cancel() {
+        this.form = {
+          ...def
         };
-        this.$refs.processSubmitDialogRef.init(params);
-      });
-    },
-    reload() {
-      this.cancel();
-    },
-    cancel() {
-      this.form = {
-        ...def
-      };
-      this.addOrEditDialogFlag = false;
-      this.$emit('done');
+        this.addOrEditDialogFlag = false;
+        this.$emit('done');
+      }
     }
-  }
-};
+  };
 </script>
 <style scoped lang="scss">
-.TotalAmount {
-  font-size: 16px;
-  padding-right: 30px;
-}
+  .TotalAmount {
+    font-size: 16px;
+    padding-right: 30px;
+  }
 
-.headbox {
-  display: flex;
-  justify-content: flex-start;
-  align-items: center;
+  .headbox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
 
-  .amount {
-    font-size: 14px;
-    font-weight: bold;
-    margin-right: 20px;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      margin-right: 20px;
+    }
   }
-}
 </style>

+ 82 - 59
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -117,13 +117,16 @@
         <el-form-item
           :prop="'datasource.' + scope.$index + '.receiveTotalWeight'"
         >
-          <el-input-number
-            :controls="false"
+          <el-input
+            type="number"
             v-model="scope.row.receiveTotalWeight"
             @input="changeSendTotalWeight(scope.row, scope.$index)"
-            style="width: 60%; margin-right: 10px"
+            style="width: calc(100% - 70px); margin-right: 10px"
           >
-          </el-input-number>
+            <template slot="append">
+              {{ scope.row.weightUnit }}
+            </template>
+          </el-input>
           <el-button
             size="small"
             type="primary"
@@ -135,25 +138,31 @@
       </template>
       <template v-slot:sendTotalWeight="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.sendTotalWeight'">
-          <el-input-number
-            :controls="false"
+          <el-input
+            type="number"
             v-model="scope.row.sendTotalWeight"
             style="width: 100%"
             @input="changeSendTotalWeight(scope.row, scope.$index)"
           >
-          </el-input-number>
+            <template slot="append">
+              {{ scope.row.weightUnit }}
+            </template>
+          </el-input>
         </el-form-item>
       </template>
       <template v-slot:increaseTotalWeight="scope">
         <el-form-item
           :prop="'datasource.' + scope.$index + '.increaseTotalWeight'"
         >
-          <el-input-number
-            :controls="false"
+          <el-input
+            type="number"
             v-model="scope.row.increaseTotalWeight"
             style="width: 100%"
           >
-          </el-input-number>
+            <template slot="append">
+              {{ scope.row.weightUnit }}
+            </template>
+          </el-input>
         </el-form-item>
       </template>
       <template v-slot:warehouseId="scope">
@@ -204,7 +213,7 @@
         </el-form-item>
       </template>
 
-      <template v-slot:singleWeight="scope" v-if="needProduce == 4">
+      <template v-slot:singleWeight="scope" >
         <el-form-item
           style="margin-bottom: 20px"
           :rules="{
@@ -218,7 +227,12 @@
             v-model="scope.row.singleWeight"
             type="number"
             placeholder="请输入"
-          ></el-input>
+            :disabled="needProduce == 4"
+          >
+            <template slot="append">
+              {{ scope.row.weightUnit }}
+            </template>
+          </el-input>
         </el-form-item>
       </template>
       <template v-slot:headerWarehouseNum="{ column }">
@@ -255,10 +269,26 @@
             :min="0"
             @input="changeCount(scope.row, scope.$index, false)"
           >
+            <template slot="append">
+              <el-select
+                v-model="scope.row.saleUnitId"
+                style="width: 80px"
+                @change="changeCount(scope.row, scope.$index)"
+                :disabled="clientEnvironmentId == 4"
+              >
+                <el-option
+                  :label="item.conversionUnit"
+                  :value="item.id"
+                  @click.native="packingChange(item, scope.$index)"
+                  v-for="(item, index) in scope.row.packageDispositionList"
+                  :key="index"
+                ></el-option>
+              </el-select>
+            </template>
           </el-input>
         </el-form-item>
       </template>
-      <template v-slot:saleUnit="scope">
+      <!-- <template v-slot:saleUnit="scope">
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.saleUnitId'"
@@ -278,7 +308,7 @@
             ></el-option>
           </el-select>
         </el-form-item>
-      </template>
+      </template> -->
       <template v-slot:modelKey="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.' + 'modelKey'">
           <DictSelection
@@ -651,7 +681,7 @@
           // },
 
           {
-            width: 150,
+            width: 250,
             prop: 'saleCount',
             label: '发货数量',
             slot: 'saleCount',
@@ -663,15 +693,19 @@
             prop: 'notSendTotalCount',
             label: '未发数量',
             align: 'center',
-            slot: 'notSendTotalCount'
-          },
-          {
-            width: 150,
-            prop: 'saleUnit',
-            label: '单位',
-            slot: 'saleUnit',
-            align: 'center'
+            formatter: (row, column) => {
+              if (row.notSendTotalCount) {
+                return row.notSendTotalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
+          // {
+          //   width: 150,
+          //   prop: 'saleUnit',
+          //   label: '单位',
+          //   slot: 'saleUnit',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'packingSpecification',
@@ -684,25 +718,32 @@
             width: 120,
             prop: 'totalCount',
             label: '计量数量',
-            // slot: 'totalCount',
-            // headerSlot: 'headerTotalCount',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
           {
             width: 120,
             prop: 'orderTotalCount',
             label: '订单数量',
-            slot: 'orderTotalCount',
+            formatter: (row, column) => {
+              if (row.orderTotalCount) {
+                return row.orderTotalCount + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
 
-          {
-            width: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 80,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+          //   align: 'center'
+          // },
           this.clientEnvironmentId == 4
             ? {
                 width: 150,
@@ -714,14 +755,15 @@
             : { width: 1 },
 
           {
-            width: 120,
+            width: 200,
             prop: 'singleWeight',
-            label: '单重',
             slot: 'singleWeight',
+            label: '单重',
+    
             align: 'center'
           },
           {
-            width: 200,
+            width: 250,
             prop: 'receiveTotalWeight',
             label: '收货总重',
             slot: 'receiveTotalWeight',
@@ -729,7 +771,7 @@
             headerSlot: 'headerReceiveTotalWeight'
           },
           {
-            width: 100,
+            width: 220,
             prop: 'sendTotalWeight',
             label: '发货总重',
             slot: 'sendTotalWeight',
@@ -737,33 +779,14 @@
           },
 
           {
-            width: 100,
+            width: 220,
             prop: 'increaseTotalWeight',
             label: '增重重量',
             slot: 'increaseTotalWeight',
+
             align: 'center'
           },
-          {
-            width: 100,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit',
-            align: 'center'
-          },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+
           {
             width: 180,
             prop: 'singlePrice',

+ 57 - 30
src/views/saleManage/saleOrder/invoice/components/inventoryTableDetails.vue

@@ -204,18 +204,22 @@
             width: 150,
             prop: 'saleCount',
             label: '发货数量',
-            slot: 'saleCount',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'saleUnit',
-            label: '单位',
-            slot: 'saleUnit',
+            formatter: (row, column) => {
+              if (row.saleCount) {
+                return row.saleCount + ' ' + row.saleUnit;
+              }
+            },
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
+          // {
+          //   width: 150,
+          //   prop: 'saleUnit',
+          //   label: '单位',
+          //   slot: 'saleUnit',
+          //   headerSlot: 'headerTotalCount',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'packingSpecification',
@@ -227,25 +231,32 @@
             width: 120,
             prop: 'totalCount',
             label: '计量数量',
-            // slot: 'totalCount',
-            // headerSlot: 'headerTotalCount',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
           {
             width: 120,
             prop: 'orderTotalCount',
             label: '订单数量',
-            slot: 'orderTotalCount',
+            formatter: (row, column) => {
+              if (row.orderTotalCount) {
+                return row.orderTotalCount + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
 
-          {
-            width: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 80,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+          //   align: 'center'
+          // },
 
           {
             width: 120,
@@ -259,14 +270,22 @@
             width: 120,
             prop: 'singleWeight',
             label: '单重',
-            slot: 'singleWeight',
+            formatter: (row, column) => {
+              if (row.singleWeight) {
+                return row.singleWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
           {
             width: 200,
             prop: 'receiveTotalWeight',
             label: '收货总重',
-            slot: 'receiveTotalWeight',
+            formatter: (row, column) => {
+              if (row.receiveTotalWeight) {
+                return row.receiveTotalWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center',
             headerSlot: 'headerTotalCount'
           },
@@ -274,7 +293,11 @@
             width: 100,
             prop: 'sendTotalWeight',
             label: '发货总重',
-            slot: 'sendTotalWeight',
+            formatter: (row, column) => {
+              if (row.sendTotalWeight) {
+                return row.sendTotalWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
 
@@ -282,17 +305,21 @@
             width: 100,
             prop: 'increaseTotalWeight',
             label: '增重重量',
-            slot: 'increaseTotalWeight',
-            align: 'center'
-          },
-          {
-            width: 100,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit',
+            formatter: (row, column) => {
+              if (row.increaseTotalWeight) {
+                return row.increaseTotalWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
           // {
+          //   width: 100,
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   slot: 'weightUnit',
+          //   align: 'center'
+          // },
+          // {
           //   width: 160,
           //   prop: 'pricingWay',
           //   label: '计价方式',

+ 39 - 33
src/views/saleManage/saleOrder/invoiceConfirm/components/addInvoiceDialog.vue

@@ -153,7 +153,11 @@
               @input="totalCountChange(scope.row, scope.$index)"
               type="number"
               placeholder="请输入"
-            ></el-input>
+            >
+              <template slot="append">
+                {{ scope.row.measuringUnit }}
+              </template>
+            </el-input>
           </template>
           <template v-slot:remark="scope">
             <el-input
@@ -375,7 +379,7 @@
             label: '牌号',
             showOverflowTooltip: true,
             align: 'center'
-          },  
+          },
           {
             minWidth: 160,
             prop: 'batchNo',
@@ -425,37 +429,47 @@
             prop: 'packingQuantity',
             align: 'center',
             label: '包装数量',
+            formatter: (row, column) => {
+              if (row.packingQuantity) {
+                return row.packingQuantity + ' ' + row.packingUnit;
+              }
+            },
             showOverflowTooltip: true
           },
-          {
-            minWidth: 120,
-            prop: 'packingUnit',
-            align: 'center',
-            label: '包装单位',
-            showOverflowTooltip: true
-          },
+          // {
+          //   minWidth: 120,
+          //   prop: 'packingUnit',
+          //   align: 'center',
+          //   label: '包装单位',
+          //   showOverflowTooltip: true
+          // },
           {
             minWidth: 100,
             prop: 'saleCount',
             label: '发货数量',
+            formatter: (row, column) => {
+              if (row.saleCount) {
+                return row.saleCount + ' ' + row.measuringUnit;
+              }
+            },
             showOverflowTooltip: true,
             align: 'center'
           },
           {
-            minWidth: 100,
+            minWidth: 180,
             prop: 'totalCount',
             label: '确认数量',
             slot: 'totalCount',
             showOverflowTooltip: true,
             align: 'center'
           },
-          {
-            minWidth: 150,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            showOverflowTooltip: true,
-            align: 'center'
-          },
+          // {
+          //   minWidth: 150,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
           // {
           //   width: 160,
           //   prop: 'pricingWay',
@@ -512,16 +526,14 @@
             prop: 'modelKey',
             label: '机型',
             showOverflowTooltip: true,
-            align: 'center',
-
+            align: 'center'
           },
           {
             minWidth: 120,
             prop: 'colorKey',
             showOverflowTooltip: true,
             label: '颜色',
-            align: 'center',
-
+            align: 'center'
           },
           {
             minWidth: 80,
@@ -783,7 +795,9 @@
               item['modelKey'] = val.modelKey;
               item['colorKey'] = val.colorKey;
 
-              item.totalPrice = (item.singlePrice * item.measureQuantity).toFixed(2);
+              item.totalPrice = (
+                item.singlePrice * item.measureQuantity
+              ).toFixed(2);
             }
           });
         });
@@ -896,18 +910,10 @@
           );
         }
         // console.log(row.totalCount, row.saleCount);
-        if(+row.totalCount === +row.saleCount) {
-          this.$set(
-            this.form.productList[index],
-            'isException',
-            0
-          );
+        if (+row.totalCount === +row.saleCount) {
+          this.$set(this.form.productList[index], 'isException', 0);
         } else {
-          this.$set(
-            this.form.productList[index],
-            'isException',
-            1
-          );
+          this.$set(this.form.productList[index], 'isException', 1);
         }
       },
       getValidate() {

+ 49 - 32
src/views/saleManage/saleOrder/invoiceConfirm/components/detailDialog.vue

@@ -240,29 +240,39 @@
             prop: 'packingQuantity',
             align: 'center',
             label: '包装数量',
+            formatter: (row, column) => {
+              if (row.packingQuantity) {
+                return row.packingQuantity + ' ' + row.packingUnit;
+              }
+            },
             showOverflowTooltip: true
           },
-          {
-            minWidth: 120,
-            prop: 'packingUnit',
-            align: 'center',
-            label: '包装单位',
-            showOverflowTooltip: true
-          },
+          // {
+          //   minWidth: 120,
+          //   prop: 'packingUnit',
+          //   align: 'center',
+          //   label: '包装单位',
+          //   showOverflowTooltip: true
+          // },
           {
             minWidth: 100,
             prop: 'totalCount',
             label: '计量数量',
             showOverflowTooltip: true,
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
-          {
-            minWidth: 150,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            showOverflowTooltip: true,
-            align: 'center'
-          },
+          // {
+          //   minWidth: 150,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
           {
             width: 120,
             slot: 'type',
@@ -361,20 +371,24 @@
             prop: 'packingQuantity',
             align: 'center',
             label: '包装数量',
+            formatter: (row, column) => {
+              if (row.packingQuantity) {
+                return row.packingQuantity + ' ' + row.packingUnit;
+              }
+            },
             showOverflowTooltip: true
           },
-          {
-            minWidth: 120,
-            prop: 'packingUnit',
-            align: 'center',
-            label: '包装单位',
-            showOverflowTooltip: true
-          },
+
           {
             minWidth: 100,
             prop: 'saleCount',
             label: '发货数量',
             showOverflowTooltip: true,
+            formatter: (row, column) => {
+              if (row.saleCount) {
+                return row.saleCount + ' ' + row.saleUnit;
+              }
+            },
             align: 'center'
           },
           {
@@ -383,16 +397,21 @@
             label: '确认数量',
             slot: 'totalCount',
             showOverflowTooltip: true,
-            align: 'center'
-          },
-          {
-            minWidth: 150,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
           // {
+          //   minWidth: 150,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
+          // {
           //   width: 160,
           //   prop: 'pricingWay',
           //   label: '计价方式',
@@ -449,16 +468,14 @@
             prop: 'modelKey',
             label: '机型',
             showOverflowTooltip: true,
-            align: 'center',
-
+            align: 'center'
           },
           {
             minWidth: 120,
             prop: 'colorKey',
             showOverflowTooltip: true,
             label: '颜色',
-            align: 'center',
-
+            align: 'center'
           },
           {
             minWidth: 80,

+ 40 - 25
src/views/saleManage/saleOrder/returnGoods/components/detailDialog.vue

@@ -17,7 +17,7 @@
         <ul>
           <template v-for="item in tabOptions">
             <li
-            v-if="item.key"
+              v-if="item.key"
               :key="item.key"
               :class="{ active: activeComp == item.key }"
               @click="handleTag(item.key)"
@@ -307,34 +307,44 @@
             showOverflowTooltip: true
           },
           {
-            minWidth: 100,
+            minWidth: 130,
             prop: 'packingQuantity',
             align: 'center',
             label: '包装数量',
+            formatter: (row, column) => {
+              if (row.packingQuantity) {
+                return row.packingQuantity + ' ' + row.packingUnit;
+              }
+            },
             showOverflowTooltip: true
           },
+          // {
+          //   minWidth: 120,
+          //   prop: 'packingUnit',
+          //   align: 'center',
+          //   label: '包装单位',
+          //   showOverflowTooltip: true
+          // },
           {
-            minWidth: 120,
-            prop: 'packingUnit',
-            align: 'center',
-            label: '包装单位',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 100,
+            minWidth: 130,
             prop: 'totalCount',
-            label: '计量数量',
-            showOverflowTooltip: true,
-            align: 'center'
-          },
-          {
-            minWidth: 150,
-            prop: 'measuringUnit',
-            label: '计量单位',
+            label: '退货数量',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            },
             showOverflowTooltip: true,
             align: 'center'
           },
           // {
+          //   minWidth: 150,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
+          // {
           //   width: 160,
           //   prop: 'pricingWay',
           //   label: '计价方式',
@@ -393,15 +403,20 @@
             label: '重量',
             // slot: 'singleWeight',
             showOverflowTooltip: true,
+            formatter: (row, column) => {
+              if (row.receiveTotalWeight) {
+                return row.receiveTotalWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
-          {
-            minWidth: 100,
-            prop: 'weightUnit',
-            label: '重量单位',
-            showOverflowTooltip: true,
-            align: 'center'
-          },
+          // {
+          //   minWidth: 100,
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
           {
             prop: 'provenance',
             label: '产地',

+ 37 - 24
src/views/saleManage/saleOrder/returnGoods/components/inventoryTable.vue

@@ -182,7 +182,11 @@
             v-model="scope.row.totalCount"
             type="number"
             @input="changeNum(scope.row, scope.$index)"
-          ></el-input>
+          >
+            <template slot="append">
+              {{ scope.row.measuringUnit }}
+            </template>
+        </el-input>
         </el-form-item>
       </template>
 
@@ -417,30 +421,35 @@
             prop: 'packingQuantity',
             align: 'center',
             label: '包装数量',
+            formatter: (row, column) => {
+              if (row.packingQuantity) {
+                return row.packingQuantity + ' ' + row.packingUnit;
+              }
+            },
             showOverflowTooltip: true
           },
+          // {
+          //   minWidth: 120,
+          //   prop: 'packingUnit',
+          //   align: 'center',
+          //   label: '包装单位',
+          //   showOverflowTooltip: true
+          // },
           {
-            minWidth: 120,
-            prop: 'packingUnit',
-            align: 'center',
-            label: '包装单位',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 150,
+            minWidth: 220,
             prop: 'totalCount',
             slot: 'totalCount',
             label: '退货数量',
             showOverflowTooltip: true,
             align: 'center'
           },
-          {
-            minWidth: 150,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            showOverflowTooltip: true,
-            align: 'center'
-          },
+          // {
+          //   minWidth: 150,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
           // {
           //   width: 160,
           //   prop: 'pricingWay',
@@ -505,17 +514,21 @@
             minWidth: 120,
             prop: 'receiveTotalWeight',
             label: '重量',
-            // slot: 'singleWeight',
-            showOverflowTooltip: true,
-            align: 'center'
-          },
-          {
-            minWidth: 100,
-            prop: 'weightUnit',
-            label: '重量单位',
+            formatter: (row, column) => {
+              if (row.receiveTotalWeight) {
+                return row.receiveTotalWeight + ' ' + row.weightUnit;
+              }
+            },
             showOverflowTooltip: true,
             align: 'center'
           },
+          // {
+          //   minWidth: 100,
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
           {
             prop: 'provenance',
             label: '产地',