Explorar o código

Merge branch 'test' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wt into dev

yusheng hai 1 ano
pai
achega
006662dd85

+ 71 - 49
src/BIZComponents/inventoryTable.vue

@@ -33,11 +33,10 @@
             >
               新增
             </el-button>
-     
           </div>
           <div class="pricebox">
             <span class="amount">总计:{{ allPrice }}元</span>
-        
+
             <el-form-item
               style="width: 300px"
               v-if="isDiscountTotalPrice"
@@ -93,10 +92,7 @@
         <span class="is-required">{{ column.label }}</span>
       </template>
       <template v-slot:customerMark="{ row, $index }">
-        <el-form-item
-          :prop="'datasource.' + $index + '.customerMark'"
-      
-        >
+        <el-form-item :prop="'datasource.' + $index + '.customerMark'">
           <el-input v-model="row.customerMark" placeholder="请输入"></el-input>
         </el-form-item>
       </template>
@@ -125,11 +121,10 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.totalCount'"
           :rules="{
-            required: isTotalCount?true:false,
+            required: isTotalCount ? true : false,
             message: '请输入单价',
             trigger: 'change'
           }"
-          
         >
           <el-input
             :disabled="isContractId"
@@ -140,11 +135,8 @@
           ></el-input>
         </el-form-item>
       </template>
-      <template
-        v-slot:headerTotalCount="{ column }"
-
-      >
-        <span :class="{'is-required':isTotalCount}">{{ column.label }}</span>
+      <template v-slot:headerTotalCount="{ column }">
+        <span :class="{ 'is-required': isTotalCount }">{{ column.label }}</span>
       </template>
       <template v-slot:totalPrice="scope">
         <el-form-item
@@ -257,7 +249,7 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.singlePrice'"
           :rules="{
-            required: isSinglePrice?true:false,
+            required: isSinglePrice ? true : false,
             message: '请输入单价',
             trigger: 'change'
           }"
@@ -283,18 +275,16 @@
             v-model="scope.row.taxRate"
             placeholder="请输入"
             type="number"
-            
           >
             <template slot="append">%</template>
           </el-input>
         </el-form-item>
       </template>
-      
-      <template
-        v-slot:headerSinglePrice="{ column }"
-       
-      >
-        <span :class="isSinglePrice?'is-required':''">{{ column.label }}</span>
+
+      <template v-slot:headerSinglePrice="{ column }">
+        <span :class="isSinglePrice ? 'is-required' : ''">{{
+          column.label
+        }}</span>
       </template>
       <template v-slot:headerCustomerExpectDeliveryDeadline="{ column }">
         <span :class="contractBookType == 1 ? 'is-required' : ''">{{
@@ -377,14 +367,23 @@
           ></fileMain>
         </el-form-item>
       </template>
+      <template v-slot:headerProduceDeliveryDeadline="{ column }">
+        <span :class="isProduceDeliveryDeadline ? 'is-required' : ''">{{
+          column.label
+        }}</span>
+      </template>
       <template v-slot:produceDeliveryDeadline="scope">
         <el-form-item
           :prop="'datasource.' + scope.$index + '.produceDeliveryDeadline'"
+          :rules="{
+            required: isProduceDeliveryDeadline ? true : false,
+            message: '选择生产交付交期',
+            trigger: 'change'
+          }"
         >
           <el-date-picker
             style="width: 140px"
             v-model="scope.row.produceDeliveryDeadline"
-            :disabled="isContractId"
             type="date"
             placeholder="选择日期"
           >
@@ -393,7 +392,7 @@
       </template>
       <template v-slot:customerExpectDeliveryDeadline="scope">
         <el-form-item
-        :rules="{
+          :rules="{
             required: true,
             message:
               contractBookType == 1 ? '请选择客户期望交期' : '请选择交付日期',
@@ -431,7 +430,6 @@
       <template v-slot:singleWeight="scope">
         <el-form-item
           style="margin-bottom: 20px"
-         
           :prop="'datasource.' + scope.$index + '.singleWeight'"
         >
           <el-input
@@ -461,7 +459,15 @@
       </template>
       <template v-slot:pricingWay="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.pricingWay'">
-          <el-select v-model="scope.row.pricingWay" placeholder="请选择">
+          <el-select
+            v-model="scope.row.pricingWay"
+            placeholder="请选择"
+            :rules="{
+              required: true,
+              message: '请选择计价方式',
+              trigger: 'change'
+            }"
+          >
             <el-option
               v-for="item in pricingWayList"
               :key="item.id"
@@ -473,7 +479,9 @@
           </el-select>
         </el-form-item>
       </template>
-
+      <template v-slot:headerPricingWay="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
       <!-- 操作列 -->
       <template v-slot:action="scope">
         <el-popconfirm
@@ -534,12 +542,17 @@
         default: false,
         type: Boolean
       },
-  
+
       isGuaranteePeriod: {
         default: true,
         type: Boolean
       },
 
+      isProduceDeliveryDeadline: {
+        //生产交付交期必填
+        type: Boolean,
+        default: false
+      },
       customerMark: {
         default: '',
         type: String
@@ -549,16 +562,18 @@
         type: Boolean,
         default: false
       },
-      
-      isSinglePrice: { //单价必填
+
+      isSinglePrice: {
+        //单价必填
         type: Boolean,
         default: true
       },
-      isTotalCount: { //数量必填
+      isTotalCount: {
+        //数量必填
         type: Boolean,
         default: true
       },
-      
+
       isDrawer: {
         type: Boolean,
         default: false
@@ -582,6 +597,11 @@
         //临时
         type: Boolean,
         default: false
+      },
+      isDiscount: {
+        //折让
+        type: Boolean,
+        default: true
       }
     },
     data() {
@@ -600,7 +620,7 @@
         numberReg,
         defaultForm,
         form: {
-        discountTotalPrice: 0,
+          discountTotalPrice: 0,
 
           datasource: []
         },
@@ -749,6 +769,7 @@
             width: 160,
             prop: 'pricingWay',
             label: '计价方式',
+            headerSlot: 'headerPricingWay',
             slot: 'pricingWay',
             align: 'center'
           },
@@ -812,7 +833,8 @@
             prop: 'produceDeliveryDeadline',
             label: '生产交付交期',
             slot: 'produceDeliveryDeadline',
-
+            headerSlot: 'headerProduceDeliveryDeadline',
+            show: this.contractBookType == 1,
             align: 'center'
           },
 
@@ -1011,21 +1033,20 @@
       //改变数量
       changeCount(row, index) {
         const { allPrice, arr } = changeCount(row, index, this.form.datasource);
-        this.form.datasource=arr
-        this.allPrice=allPrice||0
+        this.form.datasource = arr;
+        this.allPrice = allPrice || 0;
         if (this.isDiscountTotalPrice) {
           this.form.discountTotalPrice = allPrice;
         }
         this.$emit('setCountAmount', this.allPrice);
-      
       },
       setCustomerMark(customerMark) {
         this.form.datasource.forEach((item) => {
-         item['customerMark'] = customerMark;
+          item['customerMark'] = customerMark;
           this.$forceUpdate();
         });
       },
-     
+
       //修改回显
       async putTableValue(data) {
         let productList =
@@ -1057,7 +1078,8 @@
           }
 
           if (this.isDiscountTotalPrice) {
-            this.form.discountTotalPrice = data.payAmount||data?.contractVO?.discountTotalPrice;
+            this.form.discountTotalPrice =
+              data.payAmount || data?.contractVO?.discountTotalPrice;
           }
 
           let codeList = this.form.datasource.map((item) => item.productCode);
@@ -1114,7 +1136,7 @@
           this.$set(parasm, 'specification', item.specification);
           this.$set(parasm, 'weightUnit', item.weightUnit);
           this.$set(parasm, 'singleWeight', item.roughWeight);
-          this.$set(parasm, 'pricingWay',item.pricingWay||1);
+          this.$set(parasm, 'pricingWay', item.pricingWay || 1);
 
           this.$set(parasm, 'imgCode', item.imgCode);
           this.$set(parasm, 'produceType', item.produceType);
@@ -1153,16 +1175,16 @@
       },
 
       validateForm(callback) {
-        let singleWeightData={}
-        this.form.datasource.forEach(item=>{
-
-          if(item.pricingWay==2&&!item.singleWeight){
-            singleWeightData['name']=item.productName
+        let singleWeightData = {};
+        this.form.datasource.forEach((item) => {
+          if (item.pricingWay == 2 && !item.singleWeight) {
+            singleWeightData['name'] = item.productName;
           }
-
-        })
-        if(singleWeightData.name){
-          this.$message.warning(singleWeightData.name+'计价方式为重量,单重不能为空');
+        });
+        if (singleWeightData.name) {
+          this.$message.warning(
+            singleWeightData.name + '计价方式为重量,单重不能为空'
+          );
           callback(false);
         }
         //开始表单校验

+ 22 - 16
src/BIZComponents/inventoryTableDetails.vue

@@ -13,7 +13,7 @@
       <template v-slot:toolbar>
         <div class="headbox">
           <div class="pricebox">
-            <span class="amount">总计:{{ allPrice }}元</span>
+            <span class="amount" v-if="isAllPrice">总计:{{ allPrice }}元</span>
             <span class="amount" v-if="isDiscountTotalPrice"
               >优惠后总金额:{{ form.discountTotalPrice }}元</span
             >
@@ -65,6 +65,12 @@
         type: [String, Number],
         default: 1
       },
+      isAllPrice: {
+        //是否显示合计
+        type: Boolean,
+        default: true
+      },
+      
     },
     data() {
       return {
@@ -407,17 +413,17 @@
       this.requestDict('生产类型');
     },
     methods: {
-      async getSupplierObj(productList, queryName) {
-        try {
-          let categoryIds = productList.map((item) => item[queryName]);
-          return await contactQueryByCategoryIdsAPI({
-            categoryIds,
-            isQueryEE: 1
-          });
-        } catch (e) {
-          return Promise.resolve({});
-        }
-      },
+      // async getSupplierObj(productList, queryName) {
+      //   try {
+      //     let categoryIds = productList.map((item) => item[queryName]);
+      //     return await contactQueryByCategoryIdsAPI({
+      //       categoryIds,
+      //       isQueryEE: 1
+      //     });
+      //   } catch (e) {
+      //     return Promise.resolve({});
+      //   }
+      // },
 
       // 返回列表数据
       getTableValue() {
@@ -451,10 +457,10 @@
           if (this.isDiscountTotalPrice) {
             this.form.discountTotalPrice = data.payAmount||data.discountTotalPrice||data?.contractVO?.discountTotalPrice;
           }
-          this.supplierObj = await this.getSupplierObj(
-            productList,
-            'productId'
-          );
+          // this.supplierObj = await this.getSupplierObj(
+          //   productList,
+          //   'productId'
+          // );
           this.$refs.table.reload();
         }
       }

+ 1 - 3
src/views/bpm/handleTask/components/purchaseOrder/returnGoods/detailDialog.vue

@@ -200,12 +200,10 @@
   import { getFile } from '@/api/system/file';
   import dictMixins from '@/mixins/dictMixins';
   import fileUpload from '@/components/upload/fileUpload';
-  // import add from './purchaseReturnsOutboundShipments';
-  // import detailDialog from '@/views/bpm/handleTask/components/outBound/detailDialog.vue';
+
   import add from '@/views/bpm/outgoingManagement/outbound.vue';
   import detailDialog from '@/views/bpm/outgoingManagement/details.vue';
   import { reviewStatusEnum } from '@/enum/dict';
-  import { getOutInBySourceBizNo } from '@/api/classifyManage';
   import fileMain from "@/components/addDoc/index.vue";
   export default {
     components: {

+ 24 - 20
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrder.vue

@@ -386,7 +386,6 @@
                 <!-- <el-input v-if="isTrue" v-model="row.improveCorrect"></el-input>
                 <div v-else>{{ row.improveCorrect }}</div> -->
 
-
                 <el-select
                   v-if="isTrue"
                   v-model="row.improveCorrect"
@@ -399,7 +398,6 @@
                   <el-option label="否" value="否" />
                 </el-select>
                 <div v-else>{{ row.improveCorrect }}</div>
-
               </el-form-item>
             </template>
             <template v-slot:headerImproveCorrect="{ column }">
@@ -745,15 +743,15 @@
               align: 'center',
               slot: 'ifReasonMatch',
               headerSlot: 'headerIfReasonMatch'
-            },
-            {
-              minWidth: 140,
-              prop: 'reason',
-              label: '客户退货理由',
-              align: 'center',
-              slot: 'reason',
-              headerSlot: 'headerReason'
             }
+            // {
+            //   minWidth: 140,
+            //   prop: 'reason',
+            //   label: '客户退货理由',
+            //   align: 'center',
+            //   slot: 'reason',
+            //   headerSlot: 'headerReason'
+            // }
           ],
           //技术部主管指派
           techLeader: [
@@ -764,15 +762,15 @@
               align: 'center',
               slot: 'ifReasonMatch',
               headerSlot: 'headerIfReasonMatch'
-            },
-            {
-              minWidth: 140,
-              prop: 'reason',
-              label: '客户退货理由',
-              align: 'center',
-              slot: 'reason',
-              headerSlot: 'headerReason'
             }
+            // {
+            //   minWidth: 140,
+            //   prop: 'reason',
+            //   label: '客户退货理由',
+            //   align: 'center',
+            //   slot: 'reason',
+            //   headerSlot: 'headerReason'
+            // }
           ],
           //技术员审核
           techApprove: [
@@ -940,7 +938,13 @@
       listChange(key, value, row) {
         this.form.detailList.forEach((item, index) => {
           if (!this.form.detailList[index][key]) {
-            this.$set(this.form.detailList[index], key, value);
+            if (row == 'outerInfo') {
+              if (this.form.detailList[index].inOrOut == 2) {
+                this.$set(this.form.detailList[index], key, value);
+              }
+            } else {
+              this.$set(this.form.detailList[index], key, value);
+            }
           }
         });
         if (key == 'inOrOut') {
@@ -991,7 +995,7 @@
         this.$refs.parentListRef.open();
       },
       changeParent(data) {
-        this.listChange('outerInfo', data.name);
+        this.listChange('outerInfo', data.name, 'outerInfo');
       },
       getTableValue() {
         return new Promise((resolve) => {

+ 92 - 71
src/views/bpm/handleTask/components/saleOrder/returnGoods/addReturnGoodsDialog.vue

@@ -38,18 +38,21 @@
             </el-select>
           </el-form-item> -->
           <el-form-item label="总金额:" prop="totalAmount">
-              <el-input v-model="totalAmount" disabled>
-                <template slot="append">元</template>
-              </el-input>
-            </el-form-item>
+            <el-input v-model="totalAmount" disabled>
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
           <el-form-item
             label="赔偿金额"
             prop="redressAmount"
             style="margin-bottom: 22px"
             :rules="{
-              required: ['30', '50'].includes(form.type)&&form.returnSourceType==1
+              required:
+                ['30', '50'].includes(form.type) && form.returnSourceType == 1
             }"
-            v-show="['30', '50'].includes(form.type)&&form.returnSourceType==1"
+            v-show="
+              ['30', '50'].includes(form.type) && form.returnSourceType == 1
+            "
           >
             <el-input
               clearable
@@ -101,11 +104,7 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <headerTitle
-        title="原产品清单"
-        style="margin-top: 30px"
-   
-      ></headerTitle>
+      <headerTitle title="原产品清单" style="margin-top: 30px"></headerTitle>
       <ele-pro-table
         ref="table"
         :needPage="false"
@@ -114,13 +113,15 @@
         :datasource="productList"
         row-key="id"
       >
-
       </ele-pro-table>
-      <headerTitle title="退货产品明细" style="margin-top: 30px"    v-show="!['40', '50'].includes(form.type)||form.returnSourceType!=1"></headerTitle>
+      <headerTitle
+        title="退货产品明细"
+        style="margin-top: 30px"
+        v-show="!['40', '50'].includes(form.type) || form.returnSourceType != 1"
+      ></headerTitle>
       <inventoryTable
-      v-show="!['40', '50'].includes(form.type)||form.returnSourceType!=1"
+        v-show="!['40', '50'].includes(form.type) || form.returnSourceType != 1"
         ref="inventoryTableref"
-        :pricingWay="form.pricingWay"
         :entrustedCode="form.sendNo"
         :sendId="form.sendId"
         :type="form.type"
@@ -129,18 +130,15 @@
       ></inventoryTable>
       <headerTitle
         title="实物赔偿清单"
-        v-show="['20', '40'].includes(form.type)&&form.returnSourceType==1"
+        v-show="['20', '40'].includes(form.type) && form.returnSourceType == 1"
         style="margin-top: 30px"
       ></headerTitle>
       <inventoryTable1
-      v-show="['20', '40'].includes(form.type)&&form.returnSourceType==1"
+        v-show="['20', '40'].includes(form.type) && form.returnSourceType == 1"
         ref="inventoryTableref1"
-        :type="form.type"
-        :pricingWay="form.pricingWay"
-        :entrustedCode="form.sendNo"
-        :sendId="form.sendId"
-        :isSinglePrice="false"
-        :taskDefinitionKey="this.taskDefinitionKey"
+        :customerMark="customerMark"
+        :isDiscount="false"
+        :isProduceDeliveryDeadline="taskDefinitionKey == 'produceLeader'"
       ></inventoryTable1>
     </el-form>
     <!--出库详情-->
@@ -162,7 +160,10 @@
     getSendSaleOrderrecordDetail
   } from '@/api/bpm/components/saleManage/saleorder';
   import inventoryTable from './inventoryTable.vue';
-  import inventoryTable1 from './inventoryTableReturn.vue';
+  // import inventoryTable1 from './inventoryTableReturn.vue';
+  import inventoryTable1 from '@/BIZComponents/inventoryTable.vue';
+  import { contactDetail } from '@/api/bpm/components/saleManage/contact';
+
   import sendListDialog from './sendListDialog.vue';
   import { copyObj } from '@/utils/util';
   import fileMain from '@/components/addDoc/index.vue';
@@ -175,7 +176,8 @@
       fileUpload,
       sendListDialog,
       inventoryTable,
-      inventoryTable1,outboundDetailsDialog
+      inventoryTable1,
+      outboundDetailsDialog
     },
     props: {
       businessId: {
@@ -204,9 +206,10 @@
       };
 
       return {
-        outboundDetailsDialogFlag:false,
+        outboundDetailsDialogFlag: false,
+        customerMark: '',
         oldColumns: [
-        {
+          {
             width: 45,
             type: 'index',
             columnKey: 'index',
@@ -336,6 +339,20 @@
             slot: 'weightUnit',
             align: 'center'
           },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
           {
             width: 160,
             prop: 'singlePrice',
@@ -423,7 +440,7 @@
             align: 'center'
           }
         ],
-        productList:[],
+        productList: [],
         detailData: {},
         payWayOptions: [],
         delDetailIds: [],
@@ -462,41 +479,41 @@
     computed: {
       totalAmount() {
         let allcountAmount = 0;
-        if(this.form.returnSourceType==1){
+        if (this.form.returnSourceType == 1) {
           if (this.form.type === '10') {
-          allcountAmount =
-            his.$refs.inventoryTableref &&
-            this.$refs.inventoryTableref.totalAmount;
-        }
-        if (this.form.type === '20') {
-          allcountAmount =
-            (this.$refs.inventoryTableref &&
-              this.$refs.inventoryTableref.totalAmount) +
-            Number(
+            allcountAmount =
+              his.$refs.inventoryTableref &&
+              this.$refs.inventoryTableref.totalAmount;
+          }
+          if (this.form.type === '20') {
+            allcountAmount =
+              (this.$refs.inventoryTableref &&
+                this.$refs.inventoryTableref.totalAmount) +
+              Number(
+                this.$refs.inventoryTableref1 &&
+                  this.$refs.inventoryTableref1.getPrice()[0]
+              );
+          }
+          if (this.form.type === '30') {
+            allcountAmount =
+              (this.$refs.inventoryTableref &&
+                this.$refs.inventoryTableref.totalAmount) +
+              Number(this.form.redressAmount);
+          }
+          if (this.form.type === '40') {
+            allcountAmount =
               this.$refs.inventoryTableref1 &&
-                this.$refs.inventoryTableref1.getPrice()[0]
-            );
-        }
-        if (this.form.type === '30') {
-          allcountAmount =
-            (this.$refs.inventoryTableref &&
-              this.$refs.inventoryTableref.totalAmount) +
-            Number(this.form.redressAmount);
-        }
-        if (this.form.type === '40') {
-          allcountAmount =
-            this.$refs.inventoryTableref1 &&
-            this.$refs.inventoryTableref1.getPrice()[0];
-        }
-        if (this.form.type === '50') {
-          allcountAmount = Number(this.form.redressAmount);
-        }
-        }else{
+              this.$refs.inventoryTableref1.getPrice()[0];
+          }
+          if (this.form.type === '50') {
+            allcountAmount = Number(this.form.redressAmount);
+          }
+        } else {
           allcountAmount =
             this.$refs.inventoryTableref &&
             this.$refs.inventoryTableref.totalAmount;
         }
-       
+
         return allcountAmount;
       }
     },
@@ -530,8 +547,7 @@
       //发货单详情
       async getSendSaleOrderDetail(id) {
         const data = await getSendSaleOrderrecordDetail(id);
-        this.productList=data.productList
-  
+        this.productList = data.productList;
       },
 
       //获取退货单详情
@@ -541,16 +557,22 @@
         this.loading = false;
         if (data) {
           this.form = data;
-            this.form.pricingWay = data?.saleOrder?.pricingWay;
-            this.form.entrustedCode = data?.entrustedReceiveCode;
-            this.form.entrustedId = data?.entrustedReceiveId;
+          // this.form.pricingWay = data?.saleOrder?.pricingWay;
+          this.form.entrustedCode = data?.entrustedReceiveCode;
+          this.form.entrustedId = data?.entrustedReceiveId;
+          if (data.contactId) {
+            const { base } = await contactDetail(data.contactId);
+            this.customerMark = base.serialNo;
+          }
+
           this.$nextTick(() => {
-          
             this.$refs.inventoryTableref &&
               this.$refs.inventoryTableref.putTableValue(data.productList);
             this.$refs.inventoryTableref1 &&
-              this.$refs.inventoryTableref1.putTableValue(data);
-              this.getSendSaleOrderDetail(data.sendId)
+              this.$refs.inventoryTableref1.putTableValue({
+                productList: data.redressProductList
+              });
+            this.getSendSaleOrderDetail(data.sendId);
           });
         }
       },
@@ -618,9 +640,8 @@
         ]);
       },
       onchangeLink() {
-        if(this.form.type=='10'){
-          this.handleSelectGoods()
-
+        if (this.form.type == '10') {
+          this.handleSelectGoods();
         }
         // this.getSendSaleOrderDetail(this.form.sendId);
       },
@@ -661,7 +682,7 @@
       handleSelectGoods(list) {
         this.outboundDetailsDialogFlag = true;
         this.$nextTick(() => {
-          this.$refs.outboundDetailsDialogRef.init(this.form,list);
+          this.$refs.outboundDetailsDialogRef.init(this.form, list);
         });
       },
       saveDate(data) {
@@ -672,8 +693,8 @@
           this.productList.forEach((val) => {
             if (item.productCode == val.productCode) {
               item['singlePrice'] = val.singlePrice;
-              item['clientCode']= item.clientCode||val.customerMark;
-              item['pricingWay'] = item.pricingWay || this.form.pricingWay||1;
+              item['clientCode'] = item.clientCode || val.customerMark;
+              item['pricingWay'] = item.pricingWay || val.pricingWay;
             }
           });
         });

+ 21 - 6
src/views/bpm/handleTask/components/saleOrder/returnGoods/detailDialog.vue

@@ -159,16 +159,19 @@
         ['20', '40'].includes(form.type) && taskDefinitionKey != 'produceLeader'
       "
       ref="inventoryTabledetailRef"
-      :isSinglePrice="false"
+      :isDiscount="false"
+      :isAllPrice="false"
+
     ></inventoryTabledetail>
     <inventoryTable
       v-if="
         ['20', '40'].includes(form.type) && taskDefinitionKey == 'produceLeader'
       "
       ref="inventoryTabledetailRef"
-      :isSinglePrice="false"
-      :taskDefinitionKey="taskDefinitionKey"
+      :isProduceDeliveryDeadline="taskDefinitionKey == 'produceLeader'"
+      :isDiscount="false"
     ></inventoryTable>
+    
   </div>
 </template>
 
@@ -177,8 +180,9 @@
   import { getFile } from '@/api/system/file';
   import dictMixins from '@/mixins/dictMixins';
   import { reviewStatusEnum } from '@/enum/dict';
-  import inventoryTabledetail from './inventoryTableReturnDetail.vue';
-  import inventoryTable from './inventoryTableReturn.vue';
+  import inventoryTabledetail from '@/BIZComponents/inventoryTableDetails.vue';
+  import inventoryTable from '@/BIZComponents/inventoryTable.vue';
+
 
   export default {
     mixins: [dictMixins],
@@ -332,6 +336,17 @@
             slot: 'weightUnit',
             align: 'center'
           },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
+
+            }
+          },
           {
             width: 160,
             prop: 'singlePrice',
@@ -675,7 +690,7 @@
           this.form.pricingWay = data?.saleOrder?.pricingWay;
           this.$nextTick(() => {
             this.$refs.inventoryTabledetailRef &&
-              this.$refs.inventoryTabledetailRef.putTableValue(data);
+              this.$refs.inventoryTabledetailRef.putTableValue({productList:data.redressProductList});
               this.getSendSaleOrderDetail(data.sendId)
           });
         }

+ 15 - 19
src/views/bpm/handleTask/components/saleOrder/returnGoods/inventoryTable.vue

@@ -79,13 +79,7 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.sendTotalWeight'"
-          :rules="[
-            {
-              required: entrustedCode && pricingWay == 2,
-              message: '请输入数字',
-              trigger: 'blur'
-            }
-          ]"
+
         >
           <el-input
             v-model="scope.row.sendTotalWeight"
@@ -380,7 +374,7 @@
           //   align: 'center'
           // },
           {
-            minWidth: 80,
+            minWidth: 150,
             prop: 'receiveTotalWeight',
             label: '重量',
             slot: 'receiveTotalWeight',
@@ -461,16 +455,18 @@
     computed: {
       totalAmount() {
         let num = 0;
-        this.form.datasource.forEach((item) => {
+        this.form.datasource.forEach((item, index) => {
           if (item.pricingWay == 1) {
-            item.totalPrice = item.singlePrice * item.totalCount;
+            this.$set(
+              this.form.datasource[index],
+              'totalPrice',
+              item.singlePrice * item.totalCount || 0
+            );
           }
-          if (item.pricingWay == 2) {
-            item.totalPrice =
-              item.singlePrice * item.totalCount * receiveTotalWeight;
+      
+          if (item.totalPrice) {
+            num += Number(item.totalPrice);
           }
-
-          num += item.totalPrice;
         });
         return num;
       }
@@ -551,7 +547,7 @@
           this.form.datasource[this.curIndex].receiveTotalWeight
         );
         // if (this.entrustedCode) {
-        if (this.pricingWay == 2) {
+        if (this.form.datasource[this.curIndex].pricingWay == 2) {
           if (isNaN(receiveTotalWeight) || isNaN(sendTotalWeight)) {
             return this.$set(
               this.form.datasource[this.curIndex],
@@ -575,7 +571,7 @@
         // } else {
         //   this.$set(this.form.datasource[this.curIndex], 'increaseTotalWeight', sendTotalWeight);
         // }
-        if (this.pricingWay == 2) {
+        if (this.form.datasource[this.curIndex].pricingWay == 2) {
           this.getWeightPrice();
         }
         this.$refs.table.reload();
@@ -641,14 +637,14 @@
           //   //   );
           //   // }
           // });
-          this.gettotalAmount();
+          // this.gettotalAmount();
         }
       },
 
       remove(index) {
         this.form.datasource.splice(index, 1);
         this.setSort();
-        this.gettotalAmount();
+        // this.gettotalAmount();
       },
       // 清空表格
       restTable() {

+ 11 - 0
src/views/bpm/handleTask/components/saleOrder/returnGoods/inventoryTableReturn.vue

@@ -596,6 +596,17 @@
             align: 'center',
             show: this.clientEnvironmentId == '4'
           },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
+
+            }
+          },
           {
             width: 150,
             prop: 'singlePrice',

+ 10 - 0
src/views/bpm/handleTask/components/saleOrder/returnGoods/inventoryTabledetail.vue

@@ -204,7 +204,17 @@ export default {
           slot: 'weightUnit',
           align: 'center'
         },
+        {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
 
+            }
+          },
         {
           width: 160,
           prop: 'singlePrice',

+ 6 - 13
src/views/bpm/stockManagement/storage.vue

@@ -1238,8 +1238,6 @@
         } else {
           this.$message.warning('未获取到物品类型!');
         }
-
-        console.log('this.detailList---------', this.detailList);
         if (this.sourceBizNo != null && this.sourceBizNo != '') {
           this.formData.sourceBizNo = this.sourceBizNo;
         } else {
@@ -1254,14 +1252,13 @@
 
         // this.formData.extInfo.supplierName = this.form.supplierName;
         // this.formData.extInfo.supplierId = this.form.supplierId;
-        console.log('this.saleProductList---------', this.saleProductList);
+        
         if (this.saleProductList?.length > 0) {
           // 物品列表
           let codeList = this.saleProductList.map((item) => {
             return item.productCode;
           });
           storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
-            console.log('res---------', res);
             if (res.length <= 0) {
               this.$message.warning('未获取到物品信息!');
               return;
@@ -1666,7 +1663,7 @@
                     ).index
                   : this.productList[0].index, // 产品索引
                 batchNo: item.batchNo || this.productList[0].batchNo, // 批次号
-                packageNo: packingCodeList[index]?.onlyCode, // 包装编码
+                packageNo: item.packageNo||packingCodeList[index]?.onlyCode, // 包装编码
                 packingQuantity: 1, // 包装数量
                 packingUnit: item.packingUnit, // 单位
                 measureQuantity: item.quantity, // 计量数量
@@ -1735,7 +1732,7 @@
       },
       // 赋值入库时间
       getNowFormatDate() {
-        if (this.bizType == '2') {
+        if (this.bizType == '2' || this.bizType == '6') {
           let time = '00:00:00';
           this.formData.storageTime = this.form.receiveDate + ' ' + time;
         } else {
@@ -1953,10 +1950,6 @@
               _workOrderId = this.detailProductList[0]?.workOrderId;
               _taskId = this.detailProductList[0]?.taskId;
             }
-            // workOrderId: this.detailProductList[0]?.workOrderId,
-            // taskId: this.detailProductList[0]?.taskId,
-            // taskId: this.detailList[0]?.taskId,
-            // workOrderId: this.detailList[0]?.workOrderId,
             return {
               ...packingItem,
               workOrderId: _workOrderId,
@@ -2347,7 +2340,6 @@
           };
         });
         this.productList = this.productList.concat(productList);
-        console.log('this.productList--------', this.productList);
       },
       // 物品保存验证表单(批量)
       validateForm() {
@@ -2798,7 +2790,7 @@
         let num = row.packingQuantity;
         let filterArr = [];
         // 处理单位为KG类的情况
-
+        console.log(packingBoolen, 'packingBoolenpackingBoolen');
         if (packingBoolen) {
           filterArr = row.packingSpecificationOption.filter((item) => {
             return (
@@ -2836,8 +2828,9 @@
               }
             }
           } else {
+            console.log(row, 'row123');
             // num = row.packingQuantity;
-            num = this.productList.length;
+            num = 1;
           }
         }
         for (let index = 0; index < num; index++) {