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

refactor(purchasing): 优化采购相关表格单位显示及数量格式化

yusheng 9 месяцев назад
Родитель
Сommit
e78fb42b81
18 измененных файлов с 854 добавлено и 571 удалено
  1. 3 0
      src/styles/index.scss
  2. 3 3
      src/views/purchasingManage/inquiryManage/components/detailDialog.vue
  3. 62 24
      src/views/purchasingManage/inquiryManage/components/inquiryTable.vue
  4. 43 22
      src/views/purchasingManage/inquiryManage/components/inventoryTable.vue
  5. 2 2
      src/views/purchasingManage/inquiryManage/index.vue
  6. 33 27
      src/views/purchasingManage/purchaseNeedManage/components/detailDialog.vue
  7. 38 19
      src/views/purchasingManage/purchaseNeedManage/components/inventoryTable.vue
  8. 106 98
      src/views/purchasingManage/purchaseOrder/components/detailDialog.vue
  9. 64 39
      src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue
  10. 56 55
      src/views/purchasingManage/purchaseOrder/invoice/components/detailDialog.vue
  11. 105 47
      src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue
  12. 15 11
      src/views/purchasingManage/purchaseOrder/invoiceConfirm/components/addInvoiceDialog.vue
  13. 46 26
      src/views/purchasingManage/purchaseOrder/outSourceSend/components/detailDialog.vue
  14. 58 28
      src/views/purchasingManage/purchaseOrder/outSourceSend/components/inventoryTable.vue
  15. 67 56
      src/views/purchasingManage/purchaseOrder/returnGoods/components/detailDialog.vue
  16. 44 23
      src/views/purchasingManage/purchaseOrder/returnGoods/components/inventoryTable.vue
  17. 51 23
      src/views/purchasingManage/purchasePlanManage/components/detailDialog.vue
  18. 58 68
      src/views/purchasingManage/purchasePlanManage/components/inventoryTable.vue

+ 3 - 0
src/styles/index.scss

@@ -22,3 +22,6 @@ table th .is-required::before{
   .switch {
     padding-bottom: 20px;
   }
+  .el-input-group__append{
+    color: #606266;
+  }

+ 3 - 3
src/views/purchasingManage/inquiryManage/components/detailDialog.vue

@@ -128,7 +128,7 @@
     <div slot="footer" class="footer">
       <el-button @click="cancel">返回</el-button>
     </div>
-    <planDetaillog ref="planDetaillogRef" :isModal="false"></planDetaillog>
+    <!-- <planDetaillog ref="planDetaillogRef" :isModal="false"></planDetaillog> -->
   </ele-modal>
 </template>
 
@@ -138,7 +138,7 @@
   import dictMixins from '@/mixins/dictMixins';
   import { copyObj } from '@/utils/util';
   import inquiryTable from './inquiryTable.vue';
-  import planDetaillog from '../../../purchasingManage/purchasePlanManage/components/detailDialog.vue';
+  // import planDetaillog from '../../../purchasingManage/purchasePlanManage/components/detailDialog.vue';
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
   // import fileMain from '@/components/addDoc/index.vue';
   import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
@@ -151,7 +151,7 @@
     components: {
       // fileMain,
       inquiryTable,
-      planDetaillog,
+      // planDetaillog,
       bpmDetail
     },
     props: {

+ 62 - 24
src/views/purchasingManage/inquiryManage/components/inquiryTable.vue

@@ -318,6 +318,22 @@
             :min="0"
             @input="changeCount(scope.row, scope.$index)"
           >
+            <template slot="append">
+              <el-select
+                v-model="scope.row.purchaseUnitId"
+                style="width: 80px"
+                @change="changeCount(scope.row, scope.$index)"
+                :disabled="status == 'Detail'"
+              >
+                <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>
@@ -548,29 +564,37 @@
             prop: 'reqTotalCount',
             label: '需求数量',
             showOverflowTooltip: true,
+            formatter: (row, column) => {
+              if (row.reqTotalCount) {
+                return row.reqTotalCount + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
           {
-            width: 150,
+            width: 250,
             prop: 'purchaseCount',
             label: '数量',
             slot: 'purchaseCount',
             headerSlot: 'isRequired',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            slot: 'purchaseUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 150,
+          //   prop: 'purchaseUnit',
+          //   label: '单位',
+          //   slot: 'purchaseUnit',
+          //   align: 'center'
+          // },
           {
             minWidth: 130,
             prop: 'totalCount',
             label: '购买数量',
-            // slot: 'totalCount',
-            // headerSlot: 'isRequired',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            },
             showOverflowTooltip: true,
             align: 'center'
           },
@@ -579,17 +603,17 @@
             minWidth: 80,
             prop: 'availableCountBase',
             label: '库存数量',
-            slot: 'availableCountBase',
-            align: 'center'
-          },
-          {
-            minWidth: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            showOverflowTooltip: true,
+
             align: 'center'
           },
+          // {
+          //   minWidth: 80,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
           {
             minWidth: 120,
             prop: 'modelType',
@@ -604,6 +628,7 @@
             prop: 'specification',
             label: '规格',
             slot: 'specification',
+
             showOverflowTooltip: true,
             align: 'center'
           },
@@ -611,18 +636,33 @@
             minWidth: 120,
             prop: 'minimumOrderQuantity',
             label: '最低订购量',
+            formatter: (row, column) => {
+              if (row.minimumOrderQuantity) {
+                return row.minimumOrderQuantity + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
           {
             minWidth: 80,
             prop: 'doneTotalCount',
             label: '已采数量',
+            formatter: (row, column) => {
+              if (row.doneTotalCount) {
+                return row.doneTotalCount + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
           {
             minWidth: 80,
             prop: 'waitTotalCount',
             label: '待采数量',
+            formatter: (row, column) => {
+              if (row.waitTotalCount) {
+                return row.waitTotalCount + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
 
@@ -673,21 +713,19 @@
             minWidth: 200
           },
 
-            {
+          {
             minWidth: 120,
             prop: 'modelKey',
             label: '机型',
             showOverflowTooltip: true,
-            align: 'center',
-
+            align: 'center'
           },
           {
             minWidth: 120,
             prop: 'colorKey',
             showOverflowTooltip: true,
             label: '颜色',
-            align: 'center',
-
+            align: 'center'
           },
           {
             minWidth: 80,

+ 43 - 22
src/views/purchasingManage/inquiryManage/components/inventoryTable.vue

@@ -276,14 +276,19 @@
             width: 150,
             prop: 'purchaseCount',
             label: '数量',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.purchaseCount) {
+                return row.purchaseCount + ' ' + row.purchaseUnit;
+              }
+            }
           },
+          // {
+          //   width: 150,
+          //   prop: 'purchaseUnit',
+          //   label: '单位',
+          //   align: 'center'
+          // },
 
           {
             minWidth: 180,
@@ -296,18 +301,22 @@
             minWidth: 80,
             prop: 'totalCount',
             label: '计量数量',
-            slot: 'totalCount',
-            showOverflowTooltip: true,
-            align: 'center'
-          },
-          {
-            minWidth: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            },
             showOverflowTooltip: true,
             align: 'center'
           },
+          // {
+          //   minWidth: 80,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
           {
             minWidth: 120,
             prop: 'goodsLevel',
@@ -347,6 +356,11 @@
             width: 150,
             prop: 'inquiryNum',
             label: '已核价数量',
+            formatter: (row, column) => {
+              if (row.inquiryNum) {
+                return row.inquiryNum + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
 
@@ -354,13 +368,22 @@
             width: 120,
             prop: 'totalWeight',
             label: '重量',
-            slot: 'totalWeight',
+            formatter: (row, column) => {
+              if (row.totalWeight) {
+                return row.totalWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
           {
             width: 150,
             prop: 'inquiryWeight',
             label: '已核价重量',
+            formatter: (row, column) => {
+              if (row.inquiryWeight) {
+                return row.inquiryWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
           {
@@ -393,21 +416,19 @@
             }
           },
 
-            {
+          {
             minWidth: 120,
             prop: 'modelKey',
             label: '机型',
             showOverflowTooltip: true,
-            align: 'center',
-
+            align: 'center'
           },
           {
             minWidth: 120,
             prop: 'colorKey',
             showOverflowTooltip: true,
             label: '颜色',
-            align: 'center',
-
+            align: 'center'
           },
 
           {

+ 2 - 2
src/views/purchasingManage/inquiryManage/index.vue

@@ -18,7 +18,7 @@
           :cache-key="cacheKeyUrl"
         >
           <!-- 表头工具栏 -->
-          <template v-slot:toolbar v-if="!purchasePlanId">
+          <template v-slot:toolbar >
             <el-button
               size="small"
               type="primary"
@@ -56,7 +56,7 @@
             >
           </template>
           <!-- 查看详情列 -->
-          <template v-slot:planCode="{ row }" v-if="!purchasePlanId">
+          <template v-slot:planCode="{ row }" >
             <el-link
               type="primary"
               :underline="false"

+ 33 - 27
src/views/purchasingManage/purchaseNeedManage/components/detailDialog.vue

@@ -207,7 +207,8 @@
             type: 'index',
             columnKey: 'index',
             align: 'center',
-            fixed: 'left'
+            fixed: 'left',
+            label: '序号'
           },
           {
             width: 150,
@@ -238,16 +239,15 @@
             align: 'center'
           },
           {
-            width: 150,
+            width: 190,
             prop: 'purchaseCount',
             label: '数量',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.purchaseCount) {
+                return row.purchaseCount + ' ' + row.purchaseUnit;
+              }
+            }
           },
 
           {
@@ -258,11 +258,15 @@
             showOverflowTooltip: true
           },
           {
-            width: 80,
+            width: 140,
             prop: 'totalCount',
             label: '计量数量',
-            slot: 'totalCount',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           {
             minWidth: 120,
@@ -275,24 +279,28 @@
             align: 'center'
           },
           {
-            width: 80,
+            width: 140,
             prop: 'doneTotalCount',
             label: '已采数量',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.doneTotalCount) {
+                return row.doneTotalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           {
             width: 80,
             prop: 'waitTotalCount',
             label: '待采数量',
-            align: 'center'
-          },
-          {
-            width: 100,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.waitTotalCount) {
+                return row.waitTotalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
+
           {
             minWidth: 120,
             prop: 'taskName',
@@ -352,21 +360,19 @@
             slot: 'brand',
             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: 150,

+ 38 - 19
src/views/purchasingManage/purchaseNeedManage/components/inventoryTable.vue

@@ -369,6 +369,21 @@
             :min="0"
             @input="changeCount(scope.row, scope.$index)"
           >
+            <template slot="append">
+              <el-select
+                v-model="scope.row.purchaseUnitId"
+                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>
@@ -516,6 +531,7 @@
             width: 45,
             type: 'index',
             columnKey: 'index',
+            label: '序号',
             align: 'center'
           },
           {
@@ -549,20 +565,20 @@
             align: 'center'
           },
           {
-            width: 150,
+            width: 250,
             prop: 'purchaseCount',
             label: '数量',
             slot: 'purchaseCount',
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            slot: 'purchaseUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 150,
+          //   prop: 'purchaseUnit',
+          //   label: '单位',
+          //   slot: 'purchaseUnit',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'packingSpecification',
@@ -571,20 +587,23 @@
             showOverflowTooltip: true
           },
           {
-            width: 80,
+            width: 120,
             prop: 'totalCount',
             label: '计量数量',
-            // slot: 'totalCount',
-            // headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 100,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
+          // {
+          //   width: 100,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+          //   align: 'center'
+          // },
           {
             minWidth: 120,
             prop: 'goodsLevel',

+ 106 - 98
src/views/purchasingManage/purchaseOrder/components/detailDialog.vue

@@ -302,31 +302,39 @@
               <el-button type="text" @click="handleGetBillDetail(row, 1)">{{
                 row.requirementTotalCount
               }}</el-button>
+              <span v-if="row.requirementTotalCount">{{
+                row.measuringUnit
+              }}</span>
             </template>
             <template v-slot:planTotalCount="{ row, $index }">
               <el-button type="text" @click="handleGetBillDetail(row, 2)">{{
                 row.planTotalCount
               }}</el-button>
+              <span v-if="row.planTotalCount">{{ row.measuringUnit }}</span>
             </template>
             <template v-slot:inquiryTotalCount="{ row, $index }">
               <el-button type="text" @click="handleGetBillDetail(row, 3)">{{
                 row.inquiryTotalCount
               }}</el-button>
+              <span v-if="row.inquiryTotalCount">{{ row.measuringUnit }}</span>
             </template>
             <template v-slot:contractTotalCount="{ row, $index }">
               <el-button type="text" @click="handleGetBillDetail(row, 4)">{{
                 row.contractTotalCount
               }}</el-button>
+              <span v-if="row.contractTotalCount">{{ row.measuringUnit }}</span>
             </template>
             <template v-slot:doneTotalCount="{ row, $index }">
               <el-button type="text" @click="handleGetBillDetail(row, 5)">{{
                 row.doneTotalCount
               }}</el-button>
+              <span v-if="row.doneTotalCount">{{ row.measuringUnit }}</span>
             </template>
             <template v-slot:waitTotalCount="{ row, $index }">
               <el-button type="text" @click="handleGetBillDetail(row, 6)">{{
                 row.waitTotalCount
               }}</el-button>
+              <span v-if="row.waitTotalCount">{{ row.measuringUnit }}</span>
             </template>
           </ele-pro-table>
         </el-tab-pane>
@@ -568,36 +576,56 @@
             align: 'center'
           },
           {
-            width: 80,
+            width: 100,
             prop: 'waitTotalCount',
             label: '待采数量',
             // slot: 'waitTotalCount',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.waitTotalCount) {
+                return row.waitTotalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           {
-            width: 80,
+            width: 100,
             prop: 'doneReceiveCount',
             label: '已收货数量',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.doneReceiveCount) {
+                return row.doneReceiveCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           {
-            width: 80,
+            width: 100,
             prop: 'waitReceiveCount',
             label: '未收货数量',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.waitReceiveCount) {
+                return row.waitReceiveCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           {
-            width: 150,
+            width: 170,
             prop: 'purchaseCount',
             label: '数量',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.purchaseCount) {
+                return row.purchaseCount + ' ' + row.purchaseUnit;
+              }
+            }
           },
+          // {
+          //   width: 150,
+          //   prop: 'purchaseUnit',
+          //   label: '单位',
+          //   align: 'center'
+          // },
           {
             minWidth: 180,
             prop: 'packingSpecification',
@@ -606,19 +634,24 @@
             showOverflowTooltip: true
           },
           {
-            width: 120,
+            width: 150,
             prop: 'totalCount',
             label: '计量数量',
             slot: 'totalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
+          // {
+          //   width: 120,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'produceType',
@@ -641,23 +674,33 @@
             prop: 'singleWeight',
             label: '单重',
             slot: 'singleWeight',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.singleWeight) {
+                return row.singleWeight + ' ' + row.weightUnit;
+              }
+            }
           },
           {
             width: 120,
             prop: 'totalWeight',
             label: '总重',
             slot: 'totalWeight',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalWeight) {
+                return row.totalWeight + ' ' + row.weightUnit;
+              }
+            }
           },
           // {
+          //   width: 120,
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   slot: 'weightUnit',
+          //   align: 'center'
+          // },
+          // {
           //   width: 160,
           //   prop: 'pricingWay',
           //   label: '计价方式',
@@ -752,21 +795,19 @@
                 : '';
             }
           },
-            {
+          {
             minWidth: 120,
             prop: 'modelKey',
             label: '机型',
             showOverflowTooltip: true,
-            align: 'center',
-
+            align: 'center'
           },
           {
             minWidth: 120,
             prop: 'colorKey',
             showOverflowTooltip: true,
             label: '颜色',
-            align: 'center',
-
+            align: 'center'
           },
           {
             width: 160,
@@ -892,82 +933,49 @@
             slot: 'taskName',
             align: 'center'
           },
+
           {
-            width: 120,
-            prop: 'requirementTotalCount',
-            label: '采购需求数量',
-            slot: 'requirementTotalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'planTotalCount',
-            label: '采购计划数量',
-            slot: 'planTotalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'inquiryTotalCount',
-            label: '采购核价数量',
-            slot: 'inquiryTotalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'contractTotalCount',
-            label: '采购合同数量',
-            slot: 'contractTotalCount',
-            align: 'center'
-          },
-          {
-            width: 80,
-            prop: 'doneTotalCount',
-            label: '已采数量',
-            slot: 'doneTotalCount',
-            align: 'center'
-          },
-          {
-            width: 80,
-            prop: 'waitTotalCount',
-            label: '待采数量',
-            // slot: 'waitTotalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
+            width: 150,
             prop: 'totalCount',
-            label: '数量',
+            label: '计量数量',
             slot: 'totalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
+          // {
+          //   width: 120,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'singleWeight',
             label: '单重',
             slot: 'singleWeight',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.singleWeight) {
+                return row.singleWeight + ' ' + row.weightUnit;
+              }
+            }
           },
           {
             width: 120,
             prop: 'totalWeight',
             label: '总重',
             slot: 'totalWeight',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalWeight) {
+                return row.totalWeight + ' ' + row.weightUnit;
+              }
+            }
           },
 
           {

+ 64 - 39
src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue

@@ -87,7 +87,6 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.taskName'"
         >
-
           <span>
             {{ scope.row.taskName }}
           </span>
@@ -104,9 +103,8 @@
         <div @click="handParent(row, $index)">
           {{ row.productName }}
         </div>
-     
       </template>
-    
+
       <template v-slot:taxRate="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -117,7 +115,7 @@
           </el-input>
         </el-form-item>
       </template>
-   
+
       <template v-slot:totalPrice="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -127,7 +125,6 @@
         </el-form-item>
       </template>
 
-     
       <template v-slot:specification="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -136,7 +133,7 @@
           <el-input v-model="scope.row.specification"></el-input>
         </el-form-item>
       </template>
-      
+
       <template v-slot:guaranteePeriod="scope">
         <div class="period">
           <div class="borderleftnone">
@@ -207,7 +204,6 @@
             trigger: 'change'
           }"
         >
-         
           <el-popover
             placement="right"
             width="600"
@@ -280,7 +276,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:technicalAnswerName="{ row, $index }">
@@ -439,7 +439,7 @@
           </template>
         </el-popconfirm>
       </template>
-      
+
       <template v-slot:headerPricingWay="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
@@ -460,10 +460,25 @@
             :min="0"
             @input="changeCount(scope.row, scope.$index)"
           >
+            <template slot="append">
+              <el-select
+                v-model="scope.row.purchaseUnitId"
+                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:purchaseUnit="scope">
+      <!-- <template v-slot:purchaseUnit="scope">
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
@@ -482,7 +497,7 @@
             ></el-option>
           </el-select>
         </el-form-item>
-      </template>
+      </template> -->
     </ele-pro-table>
 
     <product-list
@@ -543,7 +558,7 @@
       detailType: {
         default: 0
       },
-      cacheKeyUrl:{
+      cacheKeyUrl: {
         default: 'eos-purchasingManage-purchaseOrder-inventoryTable'
       }
     },
@@ -657,20 +672,20 @@
             align: 'center'
           },
           {
-            width: 150,
+            width: 250,
             prop: 'purchaseCount',
             label: '数量',
             slot: 'purchaseCount',
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            slot: 'purchaseUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 150,
+          //   prop: 'purchaseUnit',
+          //   label: '单位',
+          //   slot: 'purchaseUnit',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'packingSpecification',
@@ -679,21 +694,26 @@
             showOverflowTooltip: true
           },
           {
-            width: 150,
+            width: 170,
             prop: 'totalCount',
             label: '计量数量',
             // slot: 'totalCount',
             // headerSlot: 'headerTotalCount',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
 
-          {
-            width: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 80,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'availableCountBase',
@@ -827,26 +847,31 @@
           },
 
           {
-            width: 120,
+            width: 180,
             prop: 'singleWeight',
             label: '单重',
             slot: 'singleWeight',
             align: 'center'
           },
           {
-            width: 120,
+            width: 150,
             prop: 'totalWeight',
             label: '总重',
             slot: 'totalWeight',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalWeight) {
+                return row.totalWeight + ' ' + row.weightUnit;
+              }
+            }
           },
+          // {
+          //   width: 120,
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   slot: 'weightUnit',
+          //   align: 'center'
+          // },
 
           !this.detailType
             ? {

+ 56 - 55
src/views/purchasingManage/purchaseOrder/invoice/components/detailDialog.vue

@@ -305,19 +305,21 @@
               prop: 'purchaseCount',
               show: v != 2,
               label: '数量',
-              slot: 'purchaseCount',
-              headerSlot: 'headerTotalCount',
-              align: 'center'
-            },
-            {
-              width: 150,
-              prop: 'purchaseUnit',
-              show: v != 2,
-              label: '单位',
-              slot: 'purchaseUnit',
-              headerSlot: 'headerTotalCount',
-              align: 'center'
+              align: 'center',
+              formatter: (row, column) => {
+                if (row.purchaseCount) {
+                  return row.purchaseCount + ' ' + row.purchaseUnit;
+                }
+              }
             },
+            // {
+            //   width: 150,
+            //   prop: 'purchaseUnit',
+            //   show: v != 2,
+            //   label: '单位',
+            //   slot: 'purchaseUnit',
+            //   align: 'center'
+            // },
             {
               width: 120,
               prop: 'packingSpecification',
@@ -329,87 +331,86 @@
               width: 80,
               prop: 'totalCount',
               label: '收货数量',
-              slot: 'totalCount',
-              align: 'center'
+              align: 'center',
+              formatter: (row, column) => {
+                if (row.totalCount) {
+                  return row.totalCount + ' ' + row.measuringUnit;
+                }
+              }
             },
             {
               width: 120,
               prop: 'orderTotalCount',
               label: '采购总数',
-              slot: 'orderTotalCount',
               show: v != 2,
-              align: 'center'
+              align: 'center',
+              formatter: (row, column) => {
+                if (row.orderTotalCount) {
+                  return row.orderTotalCount + ' ' + row.measuringUnit;
+                }
+              }
             },
             {
               width: 120,
               prop: 'receiveTotalCount',
               label: '已收货总数',
-              slot: 'receiveTotalCount',
               show: v != 2,
-              align: 'center'
-            },
-            {
-              width: 80,
-              prop: 'measuringUnit',
-              label: '计量单位',
-              slot: 'measuringUnit',
-              align: 'center'
+              align: 'center',
+              formatter: (row, column) => {
+                if (row.receiveTotalCount) {
+                  return row.receiveTotalCount + ' ' + row.measuringUnit;
+                }
+              }
             },
+
             {
               width: 120,
               prop: 'singleWeight',
               label: '重量',
-              slot: 'singleWeight',
-              align: 'center'
+              align: 'center',
+              formatter: (row, column) => {
+                if (row.singleWeight) {
+                  return row.singleWeight + ' ' + row.weightUnit;
+                }
+              }
             },
             {
               width: 200,
               prop: 'sendTotalWeight',
               label: '发货总重',
-              slot: 'sendTotalWeight',
               align: 'center',
-              headerSlot: 'headerTotalCount',
+              formatter: (row, column) => {
+                if (row.sendTotalWeight) {
+                  return row.sendTotalWeight + ' ' + row.weightUnit;
+                }
+              },
               show: v != 2
             },
             {
               width: 100,
               prop: 'receiveTotalWeight',
               label: '收货总重',
-              slot: 'receiveTotalWeight',
               align: 'center',
+              formatter: (row, column) => {
+                if (row.receiveTotalWeight) {
+                  return row.receiveTotalWeight + ' ' + row.weightUnit;
+                }
+              },
               show: v != 2
             },
             {
               width: 100,
               prop: 'increaseTotalWeight',
               label: '增重重量',
-              slot: 'increaseTotalWeight',
-              align: 'center',
-              show: v != 2
-            },
-            {
-              width: 100,
-              prop: 'weightUnit',
-              label: '重量单位',
-              slot: 'weightUnit',
               align: 'center',
+              formatter: (row, column) => {
+                if (row.increaseTotalWeight) {
+                  return row.increaseTotalWeight + ' ' + row.weightUnit;
+                }
+              },
               show: v != 2
             },
-            // {
-            //   width: 160,
-            //   prop: 'pricingWay',
-            //   label: '计价方式',
-            //   slot: 'pricingWay',
-            //   align: 'center',
-            //   show: v != 2,
-            //   formatter: (row, column) => {
-            //     return row.pricingWay == 1
-            //       ? '按数量计费'
-            //       : row.pricingWay == 2
-            //       ? '按重量计费'
-            //       : '';
-            //   }
-            // },
+
             {
               minWidth: 120,
               prop: 'goodsLevel',
@@ -568,7 +569,7 @@
               align: 'center',
               show: v != 2
             },
-            
+
             {
               width: 220,
               prop: 'qualityName',

+ 105 - 47
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -94,14 +94,17 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.sendTotalWeight'"
         >
-          <el-input-number
-            :controls="false"
+          <el-input
+            type="number"
             v-model="scope.row.sendTotalWeight"
             @blur="setIcreaseTotalWeight(scope.$index)"
-            style="width: 60%; margin-right: 10px"
+            style="width: calc(100% - 67px); margin-right: 10px"
             :disabled="!outsourceSendCode"
           >
-          </el-input-number>
+            <template slot="append">
+              {{ scope.row.weightUnit }}
+            </template>
+          </el-input>
           <el-button
             size="small"
             type="primary"
@@ -115,27 +118,34 @@
         <el-form-item
           :prop="'datasource.' + scope.$index + '.receiveTotalWeight'"
         >
-          <el-input-number
-            :controls="false"
+          <el-input
+            type="number"
             v-model="scope.row.receiveTotalWeight"
             @blur="setIcreaseTotalWeight(scope.$index)"
             style="width: 100%"
             :disabled="isDis(scope.row)"
           >
-          </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
+          <el-input
+            type="number"
             :controls="false"
             v-model="scope.row.increaseTotalWeight"
             :disabled="true"
             style="width: 100%"
           >
-          </el-input-number>
+            <template slot="append">
+              {{ scope.row.weightUnit }}
+            </template>
+          </el-input>
         </el-form-item>
       </template>
 
@@ -266,10 +276,25 @@
             :min="0"
             @input="changeCount(scope.row, scope.$index)"
           >
+            <template slot="append">
+              <el-select
+                v-model="scope.row.purchaseUnitId"
+                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:purchaseUnit="scope">
+      <!-- <template v-slot:purchaseUnit="scope">
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
@@ -288,7 +313,7 @@
             ></el-option>
           </el-select>
         </el-form-item>
-      </template>
+      </template> -->
       <template v-slot:modelKey="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.' + 'modelKey'">
           <DictSelection
@@ -582,20 +607,20 @@
             align: 'center'
           },
           {
-            width: 150,
+            width: 250,
             prop: 'purchaseCount',
             label: '收货数量',
             slot: 'purchaseCount',
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            slot: 'purchaseUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 150,
+          //   prop: 'purchaseUnit',
+          //   label: '单位',
+          //   slot: 'purchaseUnit',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'packingSpecification',
@@ -605,43 +630,60 @@
           },
 
           {
-            width: 120,
+            width: 140,
             prop: 'totalCount',
             label: '计量数量',
-            // slot: 'totalCount',
-            // headerSlot: 'headerTotalCount',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           {
-            width: 120,
+            width: 140,
             prop: 'orderTotalCount',
             label: '采购总数',
             slot: 'orderTotalCount',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.orderTotalCount) {
+                return row.orderTotalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           {
-            width: 120,
+            width: 140,
             prop: 'receiveTotalCount',
             label: '已收货总数',
-            // slot: 'receiveTotalCount',
-            align: 'center'
-          },
-          {
-            width: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.receiveTotalCount) {
+                return row.receiveTotalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
+          // {
+          //   width: 80,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+          //   align: 'center'
+          // },
           {
-            width: 120,
+            width: 140,
             prop: 'singleWeight',
             label: '单重',
             slot: 'singleWeight',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.singleWeight) {
+                return row.singleWeight + ' ' + row.weightUnit;
+              }
+            }
           },
           {
-            width: 200,
+            width: 250,
             prop: 'sendTotalWeight',
             label: '发货总重',
             slot: 'sendTotalWeight',
@@ -649,26 +691,26 @@
             headerSlot: 'headerTotalCount'
           },
           {
-            width: 100,
+            width: 170,
             prop: 'receiveTotalWeight',
             label: '收货总重',
             slot: 'receiveTotalWeight',
             align: 'center'
           },
           {
-            width: 100,
+            width: 170,
             prop: 'increaseTotalWeight',
             label: '增重重量',
             slot: 'increaseTotalWeight',
             align: 'center'
           },
-          {
-            width: 100,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 100,
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   slot: 'weightUnit',
+          //   align: 'center'
+          // },
           // {
           //   width: 160,
           //   prop: 'pricingWay',
@@ -1020,6 +1062,22 @@
           'increaseTotalWeight',
           (receiveTotalWeight - sendTotalWeight).toFixed(2)
         );
+        if (
+          this.form.datasource[index].measuringUnit ==
+          this.form.datasource[index].weightUnit
+        ) {
+          this.$set(
+            this.form.datasource[index],
+            'totalCount',
+            receiveTotalWeight
+          );
+        }else{
+          this.$set(
+            this.form.datasource[index],
+            'singleWeight',
+            Number((receiveTotalWeight/this.form.datasource[index].totalCount).toFixed(2))
+          );
+        }
         this.$refs.table.reload();
       },
       //选择产品回调

+ 15 - 11
src/views/purchasingManage/purchaseOrder/invoiceConfirm/components/addInvoiceDialog.vue

@@ -155,7 +155,12 @@
           @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
@@ -367,23 +372,22 @@
             width: 80,
             prop: 'totalCount',
             label: '收货数量',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           {
-            width: 150,
+            width: 180,
             prop: 'confirmCount',
             label: '确认数量',
             slot: 'totalCount',
-            align: 'center'
+            align: 'center',
+          
           },
 
-          {
-            width: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
-          },
           // {
           //   width: 120,
           //   prop: 'singleWeight',

+ 46 - 26
src/views/purchasingManage/purchaseOrder/outSourceSend/components/detailDialog.vue

@@ -274,16 +274,21 @@
             label: '发货数量',
             slot: 'purchaseCount',
             headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            slot: 'purchaseUnit',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.purchaseCount) {
+                return row.purchaseCount + ' ' + row.purchaseUnit;
+              }
+            }
           },
+          // {
+          //   width: 150,
+          //   prop: 'purchaseUnit',
+          //   label: '单位',
+          //   slot: 'purchaseUnit',
+          //   headerSlot: 'headerTotalCount',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'packingSpecification',
@@ -296,7 +301,12 @@
             prop: 'totalCount',
             label: '计量数量',
             // slot: 'totalCount',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           {
             minWidth: 120,
@@ -312,35 +322,45 @@
             slot: 'batchNo',
             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',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.singleWeight) {
+                return row.singleWeight + ' ' + row.weightUnit;
+              }
+            }
           },
           {
             width: 100,
             prop: 'sendTotalWeight',
             label: '发货总重',
             slot: 'sendTotalWeight',
-            align: 'center'
-          },
-          {
-            width: 100,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.sendTotalWeight) {
+                return row.sendTotalWeight + ' ' + row.weightUnit;
+              }
+            }
           },
           // {
+          //   width: 100,
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   slot: 'weightUnit',
+          //   align: 'center'
+          // },
+          // {
           //   width: 160,
           //   prop: 'pricingWay',
           //   label: '计价方式',

+ 58 - 28
src/views/purchasingManage/purchaseOrder/outSourceSend/components/inventoryTable.vue

@@ -180,10 +180,25 @@
             :min="0"
             @input="changeCount(scope.row, scope.$index)"
           >
+            <template slot="append">
+              <el-select
+                v-model="scope.row.purchaseUnitId"
+                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:purchaseUnit="scope">
+      <!-- <template v-slot:purchaseUnit="scope">
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
@@ -202,7 +217,7 @@
             ></el-option>
           </el-select>
         </el-form-item>
-      </template>
+      </template> -->
       <template v-slot:modelKey="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.' + 'modelKey'">
           <DictSelection
@@ -419,20 +434,20 @@
             align: 'center'
           },
           {
-            width: 150,
+            width: 250,
             prop: 'purchaseCount',
             label: '发货数量',
             slot: 'purchaseCount',
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            slot: 'purchaseUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 150,
+          //   prop: 'purchaseUnit',
+          //   label: '单位',
+          //   slot: 'purchaseUnit',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'packingSpecification',
@@ -441,12 +456,17 @@
             showOverflowTooltip: true
           },
           {
-            width: 100,
+            width: 120,
             prop: 'totalCount',
             label: '计量数量',
             // slot: 'totalCount',
             // headerSlot: 'headerTotalCount',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           // {
           //   width: 120,
@@ -468,35 +488,45 @@
             slot: 'batchNo',
             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',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.singleWeight) {
+                return row.singleWeight + ' ' + row.weightUnit;
+              }
+            }
           },
           {
             width: 100,
             prop: 'sendTotalWeight',
             label: '发货总重',
             slot: 'sendTotalWeight',
-            align: 'center'
-          },
-          {
-            width: 100,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.sendTotalWeight) {
+                return row.sendTotalWeight + ' ' + row.weightUnit;
+              }
+            }
           },
           // {
+          //   width: 100,
+          //   prop: 'weightUnit',
+          //   label: '重量单位',
+          //   slot: 'weightUnit',
+          //   align: 'center'
+          // },
+          // {
           //   width: 160,
           //   prop: 'pricingWay',
           //   label: '计价方式',

+ 67 - 56
src/views/purchasingManage/purchaseOrder/returnGoods/components/detailDialog.vue

@@ -145,11 +145,10 @@
         :needPage="false"
         :columns="columns"
         @columns-change="handleColumnChange"
-      :cache-key="cacheKeyUrl"
+        :cache-key="cacheKeyUrl"
         :datasource="detailData.productList"
         row-key="id"
         max-height="350px"
-
       >
         <!-- <template v-slot:toolbar>
           <div class="headbox">
@@ -198,10 +197,13 @@
   import innerBoundDetails from '@/BIZComponents/innerdetails.vue';
   import outBoundDetails from '@/BIZComponents/outdetails.vue';
   export default {
-    components: { 
+    components: {
       // fileMain,
-       bpmDetail, innerBoundDetails,outBoundDetails },
-    mixins: [dictMixins,tabMixins],
+      bpmDetail,
+      innerBoundDetails,
+      outBoundDetails
+    },
+    mixins: [dictMixins, tabMixins],
     data() {
       return {
         fullscreen: false,
@@ -219,7 +221,7 @@
         },
         rules: {},
         detailData: {},
-        cacheKeyUrl:'eos-purchaseOrder-returnorder-inventoryTable',
+        cacheKeyUrl: 'eos-purchaseOrder-returnorder-inventoryTable',
         columns: [
           {
             width: 45,
@@ -293,74 +295,86 @@
           },
 
           {
-            width: 120,
+            width: 150,
             prop: 'receiveTotalCount',
             label: '收货数量',
-            slot: 'receiveTotalCount',
+            formatter: (row, column) => {
+              if (row.receiveTotalCount) {
+                return row.receiveTotalCount + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
           {
-            width: 120,
+            width: 150,
             prop: 'totalCount',
             label: '退货数量',
-            slot: 'totalCount',
-            align: 'center'
-          },
-          {
-            width: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
+          // {
+          //   width: 80,
+          //   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: 200,
             prop: 'sendTotalWeight',
             label: '发货总重',
-            slot: 'sendTotalWeight',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.sendTotalWeight) {
+                return row.sendTotalWeight + ' ' + row.weightUnit;
+              }
+            }
           },
           {
             width: 200,
             prop: 'receiveTotalWeight',
             label: '收货总重',
-            slot: 'receiveTotalWeight',
+            formatter: (row, column) => {
+              if (row.receiveTotalWeight) {
+                return row.receiveTotalWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
           {
             width: 100,
             prop: 'increaseTotalWeight',
             label: '增重重量',
-            slot: 'increaseTotalWeight',
+            formatter: (row, column) => {
+              if (row.increaseTotalWeight) {
+                return row.increaseTotalWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
+
           {
             minWidth: 120,
             prop: 'goodsLevel',
             label: '物品级别',
             formatter: (_row, _column, cellValue) => {
-              return levelList.find(item=>item.value==_row.goodsLevel)?.label
+              return levelList.find((item) => item.value == _row.goodsLevel)
+                ?.label;
             },
             align: 'center'
           },
@@ -368,7 +382,7 @@
             width: 160,
             prop: 'singlePrice',
             label: '单价',
-            slot: 'singlePrice',
+
             align: 'center'
           },
           {
@@ -422,21 +436,19 @@
                 : '';
             }
           },
-                    {
+          {
             minWidth: 120,
             prop: 'modelKey',
             label: '机型',
             showOverflowTooltip: true,
-            align: 'center',
-
+            align: 'center'
           },
           {
             minWidth: 120,
             prop: 'colorKey',
             showOverflowTooltip: true,
             label: '颜色',
-            align: 'center',
-
+            align: 'center'
           },
           {
             width: 200,
@@ -542,20 +554,19 @@
         this.loading = true;
         await this.getcode('sale_return_type');
         const data = await getReturnSaleOrderrecordDetail(id);
-        if(data.reviewStatus==2){
+        if (data.reviewStatus == 2) {
           if (data.returnSourceType == 2) {
-          this.tabOptions = [
-            ...this.tabOptions,
-            { key: 'store', name: '入库单详情' }
-          ];
-        } else {
-          this.tabOptions = [
-            ...this.tabOptions,
-            { key: 'store1', name: '出库单详情' }
-          ];
-        }
+            this.tabOptions = [
+              ...this.tabOptions,
+              { key: 'store', name: '入库单详情' }
+            ];
+          } else {
+            this.tabOptions = [
+              ...this.tabOptions,
+              { key: 'store1', name: '出库单详情' }
+            ];
+          }
         }
-      
 
         this.loading = false;
         if (data) {

+ 44 - 23
src/views/purchasingManage/purchaseOrder/returnGoods/components/inventoryTable.vue

@@ -111,7 +111,11 @@
           <el-input
             v-model="scope.row.totalCount"
             @input="(val) => changeNum(val, scope.$index, scope.row)"
-          ></el-input>
+          >
+            <template slot="append">
+              {{ scope.row.measuringUnit }}
+            </template>
+          </el-input>
         </el-form-item>
       </template>
       <!--   发货总重   -->
@@ -124,8 +128,11 @@
             v-model="scope.row.sendTotalWeight"
             @blur="changeSendTotalWeight(scope.$index)"
             :disabled="!outsourceSendCode"
-            style="width: 60%; margin-right: 10px"
+            style="width: calc(100% - 70px); margin-right: 10px"
           >
+            <template slot="append">
+              {{ scope.row.weightUnit }}
+            </template>
           </el-input>
           <el-button
             size="small"
@@ -145,9 +152,13 @@
           <el-input
             v-model="scope.row.receiveTotalWeight"
             @blur="changeReceiveTotalWeight(scope.$index)"
-            style="width: 60%; margin-right: 10px"
+            style="width: calc(100% - 70px); margin-right: 10px"
           >
+            <template slot="append">
+              {{ scope.row.weightUnit }}
+            </template>
           </el-input>
+
           <el-button
             size="small"
             type="primary"
@@ -409,53 +420,63 @@
             width: 120,
             prop: 'receiveTotalCount',
             label: '收货数量',
-            slot: 'receiveTotalCount',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.receiveTotalCount) {
+                return row.receiveTotalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           {
-            width: 120,
+            width: 180,
             prop: 'totalCount',
             label: '退货数量',
             slot: 'totalCount',
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
-          {
-            width: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 80,
+          //   prop: 'measuringUnit',
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'singleWeight',
             label: '单重',
-            slot: 'singleWeight',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.increaseTotalWeight) {
+                return row.increaseTotalWeight + ' ' + row.weightUnit;
+              }
+            }
           },
           {
-            width: 200,
+            width: 250,
             prop: 'sendTotalWeight',
             label: '发货总重',
             slot: 'sendTotalWeight',
-            align: 'center',
-            headerSlot: 'headerSendTotalWeight'
+            align: 'center'
           },
           {
-            width: 200,
+            width: 250,
             prop: 'receiveTotalWeight',
             label: '收货总重',
             slot: 'receiveTotalWeight',
-            align: 'center',
-            headerSlot: 'headerSendTotalWeight'
+            align: 'center'
           },
           {
             width: 100,
             prop: 'increaseTotalWeight',
             label: '增重重量',
-            slot: 'increaseTotalWeight',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.increaseTotalWeight) {
+                return row.increaseTotalWeight + ' ' + row.weightUnit;
+              }
+            }
           },
           // {
           //   width: 160,

+ 51 - 23
src/views/purchasingManage/purchasePlanManage/components/detailDialog.vue

@@ -402,17 +402,22 @@
             align: 'center'
           },
           {
-            width: 150,
+            width: 190,
             prop: 'purchaseCount',
             label: '数量',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            label: '单位',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.purchaseCount) {
+                return row.purchaseCount + ' ' + row.purchaseUnit;
+              }
+            }
           },
+          // {
+          //   width: 150,
+          //   prop: 'purchaseUnit',
+          //   label: '单位',
+          //   align: 'center'
+          // },
           {
             minWidth: 180,
             prop: 'packingSpecification',
@@ -421,19 +426,17 @@
             showOverflowTooltip: true
           },
           {
-            width: 80,
+            width: 140,
             prop: 'totalCount',
             label: '计量数量',
-            slot: 'totalCount',
-            align: 'center'
-          },
-          {
-            width: 100,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
+
           {
             minWidth: 120,
             prop: 'goodsLevel',
@@ -452,33 +455,58 @@
           },
           {
             width: 150,
-            prop: 'purchaseCount',
+            prop: 'reqTotalCount',
             label: '需求数量',
             align: 'center',
+            formatter: (row, column) => {
+              if (row.reqTotalCount) {
+                return row.reqTotalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           {
             width: 150,
             prop: 'inquiryNum',
             label: '已核价数量',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.inquiryNum) {
+                return row.inquiryNum + ' ' + row.measuringUnit;
+              }
+            }
           },
           {
             width: 150,
             prop: 'splitTotalCount',
             label: '已拆分数量',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.splitTotalCount) {
+                return row.splitTotalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           {
             width: 80,
             prop: 'doneTotalCount',
             label: '已采数量',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.doneTotalCount) {
+                return row.doneTotalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           {
             width: 80,
             prop: 'waitTotalCount',
             label: '待采数量',
-            align: 'center'
+            align: 'center',
+            formatter: (row, column) => {
+              if (row.waitTotalCount) {
+                return row.waitTotalCount + ' ' + row.measuringUnit;
+              }
+            }
           },
           // {
           //   width: 120,

+ 58 - 68
src/views/purchasingManage/purchasePlanManage/components/inventoryTable.vue

@@ -52,7 +52,6 @@
       </template>
       <template v-slot:productName="{ row, $index }">
         <el-form-item
-          style="margin-bottom: 20px"
           :prop="'datasource.' + $index + '.productName'"
           :rules="{
             required: true,
@@ -63,12 +62,12 @@
           <el-input
             v-model="row.productName"
             placeholder="请输入"
-            style="width: 60%; margin-right: 10px"
+            style="width: calc(100% - 70px); margin-right: 10px"
             v-if="!row.productCode"
           ></el-input>
           <div
             v-else
-            style="width: 60%; margin-right: 10px"
+            style="width: calc(100% - 70px); margin-right: 10px"
             class="ellipsis-single"
             :title="row.productName"
             >{{ row.productName }}</div
@@ -87,17 +86,8 @@
         </el-form-item>
       </template>
 
-      <!-- <template v-slot:productCategoryName="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.productCategoryName'"
-        >
-          <el-input v-model="scope.row.productCategoryName" disabled></el-input>
-        </el-form-item>
-      </template> -->
       <template v-slot:totalCount="scope">
         <el-form-item
-          style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.totalCount'"
           :rules="{
             required: true,
@@ -116,7 +106,6 @@
 
       <template v-slot:productBrand="scope">
         <el-form-item
-          style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.productBrand'"
           v-if="!scope.row.productCode"
         >
@@ -125,17 +114,13 @@
         <div v-else>{{ scope.row.productBrand }}</div>
       </template>
       <template v-slot:brand="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.brand'"
-        >
+        <el-form-item :prop="'datasource.' + scope.$index + '.brand'">
           <el-input v-model="scope.row.brand"></el-input>
         </el-form-item>
       </template>
 
       <template v-slot:modelType="scope">
         <el-form-item
-          style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.modelType'"
           v-if="!scope.row.productCode"
         >
@@ -146,7 +131,6 @@
 
       <template v-slot:specification="scope">
         <el-form-item
-          style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.specification'"
           v-if="!scope.row.productCode"
         >
@@ -156,7 +140,6 @@
       </template>
       <template v-slot:measuringUnit="scope">
         <el-form-item
-          style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.measuringUnit'"
           v-if="!scope.row.productCode"
         >
@@ -168,10 +151,7 @@
         <div v-else>{{ scope.row.measuringUnit }}</div>
       </template>
       <template v-slot:remark="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.remark'"
-        >
+        <el-form-item :prop="'datasource.' + scope.$index + '.remark'">
           <el-input
             v-model="scope.row.remark"
             type="textarea"
@@ -180,14 +160,11 @@
         </el-form-item>
       </template>
       <template v-slot:taskName="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.taskName'"
-        >
+        <el-form-item :prop="'datasource.' + scope.$index + '.taskName'">
           <el-input
             v-model="scope.row.taskName"
             placeholder="请选择"
-            style="width: 60%; margin-right: 10px"
+            style="width: calc(100% - 70px); margin-right: 10px"
             disabled
           ></el-input>
           <el-button
@@ -201,7 +178,6 @@
       </template>
       <template v-slot:technicalAnswerName="{ row, $index }">
         <el-form-item
-          style="margin-bottom: 20px"
           :prop="'datasource.' + $index + '.technicalAnswerName'"
           :rules="{
             required: false,
@@ -218,7 +194,6 @@
       </template>
       <template v-slot:technicalParams="scope">
         <el-form-item
-          style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.technicalParams'"
           :rules="{
             required: false,
@@ -234,16 +209,12 @@
         </el-form-item>
       </template>
       <template v-slot:files="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.files'"
-        >
+        <el-form-item :prop="'datasource.' + scope.$index + '.files'">
           <fileMain v-model="scope.row.files"></fileMain>
         </el-form-item>
       </template>
       <template v-slot:technicalDrawings="scope">
         <el-form-item
-          style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.technicalDrawings'"
         >
           <fileMain v-model="scope.row.technicalDrawings"></fileMain>
@@ -253,7 +224,6 @@
       <template v-slot:expectReceiveDate="scope">
         <el-form-item
           v-if="scope.row.arrivalWay == 1"
-          style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.expectReceiveDate'"
           :rules="{
             required: true,
@@ -271,10 +241,7 @@
           >
           </el-date-picker>
         </el-form-item>
-        <el-form-item
-          style="margin-bottom: 20px"
-          v-if="scope.row.arrivalWay == 2"
-        >
+        <el-form-item v-if="scope.row.arrivalWay == 2">
           <el-link
             type="primary"
             :underline="false"
@@ -311,7 +278,6 @@
 
       <template v-slot:supplierName="scope">
         <el-form-item
-          style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.supplierName'"
           :rules="{
             required: isSupplier ? true : false,
@@ -337,7 +303,7 @@
             clearable
             v-model="scope.row.provenance"
             multiple
-            :isOne="scope.$index==0"
+            :isOne="scope.$index == 0"
           >
           </DictSelection>
         </el-form-item>
@@ -365,7 +331,6 @@
       </template>
       <template v-slot:warehouseId="scope">
         <el-form-item
-          style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.warehouseId'"
           :rules="[
             {
@@ -392,7 +357,6 @@
       </template>
       <template v-slot:purchaseCount="scope">
         <el-form-item
-          style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.purchaseCount'"
           :rules="{
             required: true,
@@ -407,10 +371,25 @@
             :min="0"
             @input="changeCount(scope.row, scope.$index)"
           >
+            <template slot="append">
+              <el-select
+                v-model="scope.row.purchaseUnitId"
+                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:purchaseUnit="scope">
+      <!-- <template v-slot:purchaseUnit="scope">
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
@@ -429,7 +408,7 @@
             ></el-option>
           </el-select>
         </el-form-item>
-      </template>
+      </template> -->
       <template v-slot:modelKey="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.' + 'modelKey'">
           <DictSelection
@@ -582,7 +561,6 @@
             prop: 'productCategoryName',
             label: '分类',
             showOverflowTooltip: true,
-
             align: 'center'
           },
           {
@@ -590,7 +568,6 @@
             prop: 'productCode',
             label: '编码',
             showOverflowTooltip: true,
-
             align: 'center'
           },
           {
@@ -632,10 +609,15 @@
             prop: 'reqTotalCount',
             label: '需求数量',
             showOverflowTooltip: true,
+            formatter: (row, column) => {
+              if (row.reqTotalCount) {
+                return row.reqTotalCount + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
           {
-            width: 150,
+            width: 250,
             prop: 'purchaseCount',
             showOverflowTooltip: true,
             label: '数量',
@@ -643,14 +625,14 @@
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
-          {
-            width: 150,
-            prop: 'purchaseUnit',
-            showOverflowTooltip: true,
-            label: '单位',
-            slot: 'purchaseUnit',
-            align: 'center'
-          },
+          // {
+          //   width: 150,
+          //   prop: 'purchaseUnit',
+          //   showOverflowTooltip: true,
+          //   label: '单位',
+          //   slot: 'purchaseUnit',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'packingSpecification',
@@ -663,17 +645,21 @@
             prop: 'totalCount',
             label: '计量数量',
             showOverflowTooltip: true,
-
-            align: 'center'
-          },
-          {
-            width: 100,
-            prop: 'measuringUnit',
-            showOverflowTooltip: true,
-            label: '计量单位',
-            slot: 'measuringUnit',
+            formatter: (row, column) => {
+              if (row.totalCount) {
+                return row.totalCount + ' ' + row.measuringUnit;
+              }
+            },
             align: 'center'
           },
+          // {
+          //   width: 100,
+          //   prop: 'measuringUnit',
+          //   showOverflowTooltip: true,
+          //   label: '计量单位',
+          //   slot: 'measuringUnit',
+          //   align: 'center'
+          // },
 
           {
             minWidth: 120,
@@ -712,7 +698,11 @@
             prop: 'totalWeight',
             showOverflowTooltip: true,
             label: '重量',
-            slot: 'totalWeight',
+            formatter: (row, column) => {
+              if (row.totalWeight) {
+                return row.totalWeight + ' ' + row.weightUnit;
+              }
+            },
             align: 'center'
           },
           {