ソースを参照

退货处理单

yusheng 1 年間 前
親
コミット
28fde88d85

+ 2 - 2
src/BIZComponents/outdetails.vue

@@ -691,9 +691,9 @@
           item['packageCount']=item.packingQuantity
           item['measurementCount']=item.measureQuantity
           item['measurementUnit']=item.measureUnit
-          item['productCategoryId']=item.categoryId
+          item['productId']=item.categoryId
           item['carveCode']=item.engrave
-          item['productCategoryName']=item.categoryName
+ 
           item['warehouseId']=this.productList[0].warehouseId
           item['warehouseName']= this.productList[0].warehouseName
    

+ 12 - 2
src/api/saleManage/saleordersendrecord.js

@@ -10,7 +10,14 @@ export async function getSendTableList(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
-
+// 获取入库详情
+export async function getInboundDetailsById(id) {
+  const res = await request.get(`/wms/outintwo/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 /**
  * 获取信息详情
  */
@@ -25,7 +32,10 @@ export async function getSendSaleOrderrecordDetail(id) {
  * 获取信息详情
  */
 export async function getSendSaleOrderrecordDetailSplit(id) {
-  const res = await request.get(`/eom/saleordersendrecord/getByIdSplit/${id}`, {});
+  const res = await request.get(
+    `/eom/saleordersendrecord/getByIdSplit/${id}`,
+    {}
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 36 - 16
src/views/purchasingManage/purchaseOrder/components/addDialog.vue

@@ -1387,6 +1387,7 @@
         ]);
       },
       async save(type) {
+        let is=false
         try {
           await this.getValidate();
           // 表单验证通过,执行保存操作
@@ -1410,23 +1411,42 @@
             (this.$refs.inventoryTable &&
               this.$refs.inventoryTable.getTableValue()) ||
             [];
-          let productList = [...tabList, ...rawDetailList.map(item=>{
-            item.singlePrice=item.singlePrice||0
-            item.discountSinglePrice=item.discountSinglePrice||0
-            item.totalPrice=item.totalPrice||0
-            item.discountTotalPrice=item.discountTotalPrice||0
-            
-            
-            return item
-          }), ...outputDetailList.map(item=>{
-            item.singlePrice=item.singlePrice||0
-            item.discountSinglePrice=item.discountSinglePrice||0
-            item.discountTotalPrice=item.discountTotalPrice||0
-            item.totalPrice=item.totalPrice||0
+          tabList.forEach((v, i) => {
+            tabList.forEach((v2, j) => {
+              if (
+                v.productCode == v2.productCode &&
+                v.taskId == v2.taskId &&
+                v.batchNo == v2.batchNo &&
+                i != j
+              ) {
+                is = true;
+              }
+            });
+          });
+          if (is) {
+            this.$message.error('同产品,工序、批次号不能完全一致!');
+            return;
+          }
+          let productList = [
+            ...tabList,
+            ...rawDetailList.map((item) => {
+              item.singlePrice = item.singlePrice || 0;
+              item.discountSinglePrice = item.discountSinglePrice || 0;
+              item.totalPrice = item.totalPrice || 0;
+              item.discountTotalPrice = item.discountTotalPrice || 0;
+
+              return item;
+            }),
+            ...outputDetailList.map((item) => {
+              item.singlePrice = item.singlePrice || 0;
+              item.discountSinglePrice = item.discountSinglePrice || 0;
+              item.discountTotalPrice = item.discountTotalPrice || 0;
+              item.totalPrice = item.totalPrice || 0;
+
+              return item;
+            })
+          ];
 
-            return item
-          })];
-          productList.forEach((item) => {});
           let commitData = Object.assign({}, this.form, {
             productList,
             // purchaseTypeName: this.getDictValue(

+ 12 - 0
src/views/purchasingManage/purchaseOrder/components/detailDialog.vue

@@ -617,6 +617,18 @@
             // slot: 'waitTotalCount',
             align: 'center'
           },
+          {
+            width: 80,
+            prop: 'doneReceiveCount',
+            label: '已收货数量',
+            align: 'center'
+          },
+          {
+            width: 80,
+            prop: 'waitReceiveCount',
+            label: '未收货数量',
+            align: 'center'
+          },
           {
             width: 120,
             prop: 'totalCount',

+ 18 - 2
src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue

@@ -423,6 +423,15 @@
         <template v-slot:headerSinglePrice="{ column }">
           <span class="is-required">{{ column.label }}</span>
         </template>
+        <template v-slot:batchNo="scope">
+          <el-form-item
+            style="margin-bottom: 20px"
+            :prop="'datasource.' + scope.$index + '.batchNo'"
+          >
+            <el-input v-model="scope.row.batchNo" placeholder="请输入">
+            </el-input>
+          </el-form-item>
+        </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row, $index }">
           <el-popconfirm
@@ -471,6 +480,8 @@
   import fileMain from '@/components/addDoc/index.vue';
   import billDetailDialog from './billDetailDialog.vue';
   import taskinstanceDialog from '@/BIZComponents/procedure/taskinstanceDialog.vue';
+  import { getCode } from '@/components/addDoc/api/index.js';
+
   const dayjs = require('dayjs');
 
   export default {
@@ -599,6 +610,7 @@
             // slot: 'waitTotalCount',
             align: 'center'
           },
+
           {
             width: 150,
             prop: 'totalCount',
@@ -878,8 +890,9 @@
       // 返回列表数据
       getTableValue() {
         let comitDatasource = this.form.datasource;
+
         if (comitDatasource.length === 0) return [];
-        comitDatasource.forEach((v) => {
+        comitDatasource.forEach((v,i) => {
           v.detailType = this.detailType;
           // v.totalPrice = (v.totalCount * v.singlePrice)?.toFixed(2) || 0;
           v.guaranteePeriodUnitName = this.getDictValue(
@@ -890,6 +903,7 @@
             ? v.technicalDrawings
             : [];
         });
+
         return comitDatasource;
       },
       getPrice() {
@@ -1080,7 +1094,7 @@
       },
       //选择产品回调
       changeParent(obj = [], idx) {
-        obj.forEach((item, index) => {
+        obj.forEach(async (item, index) => {
           let i = idx == -1 ? index : idx;
           let row = JSON.parse(JSON.stringify(this.defaultForm));
           row.key = this.form.datasource.length + 1;
@@ -1106,6 +1120,8 @@
             item.extField?.packingSpecification
           );
           this.$set(parasm, 'supplierMark', this.supplierMark);
+          this.$set(parasm, 'batchNo', await getCode('1900101420390125570'));
+
           if (idx == -1) {
             this.form.datasource.push(row);
           }

+ 1 - 0
src/views/purchasingManage/purchaseOrder/invoice/components/addInvoiceDialog.vue

@@ -553,6 +553,7 @@ export default {
               //this.loading = false;
             });
         } else {
+          commitData.createTime=''
           addReceiveInformation(commitData)
             .then(async (res) => {
               this.loading = false;

+ 7 - 2
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -545,13 +545,15 @@
         this.form.datasource.forEach((item,i)=>{
           if(row.productCode==item.productCode&&!item.warehouseId){
             this.$set(this.form.datasource[i], 'warehouseName', data.name);
-            this.$set(this.form.datasource[i], 'warehouseCode', data.warehouseCode);
-            this.$set(this.form.datasource[i], 'warehouseId', row.warehouseId);
+            this.$set(this.form.datasource[i], 'warehouseCode', data.code);
+            this.$set(this.form.datasource[i], 'warehouseId', data.id);
           }
         
         })
         this.$set(this.form.datasource[index], 'warehouseName', data.name);
         this.$set(this.form.datasource[index], 'warehouseCode', data.code);
+        this.$set(this.form.datasource[index], 'warehouseId', data.id);
+
       },
       //修改发货总重
       changeSendTotalWeight(index) {
@@ -747,9 +749,12 @@
               item.increaseTotalWeight =
                 item.increaseTotalWeight || item.receiveTotalWeight || 0;
             }
+            item.sendTotalWeight=item.sendTotalWeight||0
             this.changeNum(item.totalCount, index);
           });
           this.$refs.table.reload();
+          this.$forceUpdate()
+          
         });
       },
 

+ 4 - 0
src/views/saleManage/saleOrder/customerReturnOrder/add-sale-order-dialog.vue

@@ -202,6 +202,10 @@ export default {
         this.$nextTick(() => {
           this.form = data;
           this.form.pricingWay = data.saleOrder.pricingWay
+          data.productList.forEach(item=>{
+            item.singleWeight=item.singleWeight||0
+            item.receiveTotalWeight=item.receiveTotalWeight||0
+          })
           this.$nextTick(()=>{
             this.$refs.inventoryTableref &&
             this.$refs.inventoryTableref.putTableValue(data.productList);

+ 54 - 6
src/views/saleManage/saleOrder/customerReturnOrder/addOrEditDialog.vue

@@ -76,7 +76,22 @@
             </template>
           </el-popconfirm>
         </template>
-
+        <template v-slot:technologyRouteName="scope">
+        <el-form-item
+          :prop="'detailList.' + scope.$index + '.technologyRouteName'"
+          :rules="{
+            required: false,
+            message: '请选择',
+            trigger: 'change'
+          }"
+        >
+          <el-input
+            v-model="scope.row.technologyRouteName"
+            placeholder="请选择"
+            @click.native="openVersion(scope.$index)"
+          ></el-input>
+        </el-form-item>
+      </template>
 
         <template v-slot:packageCount="{ row,$index }">
           <el-form-item
@@ -117,7 +132,14 @@
             <div v-else>{{ row.carveCode }}</div>
           </el-form-item>
         </template>
-
+        <template v-slot:technicalDrawings="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'detailList.' + scope.$index + '.technicalDrawings'"
+        >
+          <fileMain v-model="scope.row.technicalDrawings"  ></fileMain>
+        </el-form-item>
+        </template>
         <!--  ///  发起人展示字段 -->
         <template v-slot:reason="{ row,$index }">
           <el-form-item
@@ -180,7 +202,10 @@
       ref="returnOrderDialogRef">
     </return-order-dialog>
     <process-submit-dialog :isNotNeedProcess="false" :processSubmitDialogFlag.sync="processSubmitDialogFlag" v-if="processSubmitDialogFlag" ref="processSubmitDialogRef" @reload="reload"></process-submit-dialog>
-
+    <ProductionVersion
+      ref="versionRefs"
+      @changeProduct="changeProduct"
+    ></ProductionVersion>
   </ele-modal>
 </template>
 
@@ -205,6 +230,8 @@ import fileUpload from "@/components/upload/fileUpload.vue";
 import {getDetail} from "@/api/saleManage/businessOpportunity";
 import processSubmitDialog from "@/BIZComponents/processSubmitDialog/processSubmitDialog.vue";
 import modalTitle from '@/BIZComponents/modalTitle.vue';
+import ProductionVersion from '@/components/ProductionVersion2/index.vue';
+import fileMain from "@/components/addDoc/index.vue";
 
 
 export default {
@@ -220,7 +247,7 @@ export default {
     fileUpload,
     outboundDetailsDialog,
     headList,
-    returnOrderDialog,modalTitle
+    returnOrderDialog,modalTitle,ProductionVersion,fileMain
   },
   data() {
     return {
@@ -328,7 +355,6 @@ export default {
           prop: 'measurementUnit',
           label: '计量单位',
           align: 'center',
-          slot: 'measuringUnit'
         },
         {
           minWidth: 80,
@@ -345,6 +371,20 @@ export default {
           align: 'center',
           slot: 'weightUnit'
         },
+        {
+          width: 240,
+          prop: 'technologyRouteName',
+          label: '工艺路线',
+          slot: 'technologyRouteName',
+          align: 'center'
+        },
+        {
+          width: 240,
+          prop: 'technicalDrawings',
+          label: '技术图纸',
+          slot: 'technicalDrawings',
+          align: 'center'
+        },
         {
           minWidth: 80,
           prop: 'carveCode',
@@ -472,6 +512,7 @@ export default {
           }
         ],
       }
+      console.log(processNodes[this.dialogType],'processNodes[this.dialogType]')
       processNodes[this.dialogType] && basicFields.push(...processNodes[this.dialogType])
       return basicFields
     }
@@ -488,7 +529,14 @@ export default {
         this.getReturnInfo(row)
       }
     },
-
+    //工艺路线
+    changeProduct(data, index) {
+      this.$set(this.form.detailList[index], 'technologyRouteName', data.name);
+      this.$set(this.form.detailList[index], 'technologyRouteId', data.id);
+    },
+    openVersion(index) {
+      this.$refs.versionRefs.open(index);
+    },
     //获取详情
     async getReturnInfo(row) {
       this.form = await saleReturnGetByIdAPI(row.id)

+ 4 - 4
src/views/saleManage/saleOrder/customerReturnOrder/inventoryTable.vue

@@ -577,10 +577,10 @@ export default {
       const data = this.warehouseList.find(
         (item) => item.id == row.warehouseId
       );
-      if (warehouseIds.length > 0 && warehouseIds.includes(row.warehouseId)) {
-        row.warehouseId = '';
-        return this.$message.error('同一个产品不能选择相同的仓库');
-      }
+      // if (warehouseIds.length > 0 && warehouseIds.includes(row.warehouseId)) {
+      //   row.warehouseId = '';
+      //   return this.$message.error('同一个产品不能选择相同的仓库');
+      // }
 
       this.$set(this.form.datasource[index], 'warehouseName', data.name);
       this.$set(this.form.datasource[index], 'warehouseCode', data.code);

+ 4 - 3
src/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog.vue

@@ -446,6 +446,8 @@ export default {
         data.productList.forEach((item) => {
           item.sendProductId = item.id;
           item.id = '';
+          item['sendTotalCount']=item.sendTotalCount||0
+
         });
         this.$nextTick(() => {
           let {
@@ -473,9 +475,8 @@ export default {
             entrustedReceiveId: id,
             entrustedReceiveCode: code
           });
-          productList.forEach((item) => {
-            item.id = '';
-          });
+    
+          console.log(productList,'productList')
           this.$refs.inventoryTableref &&
             this.$refs.inventoryTableref.putTableValue(productList, code);
         });

+ 343 - 255
src/views/saleManage/saleOrder/returnGoods/components/customerReturnOrderDetail.vue

@@ -1,11 +1,6 @@
 <template>
-
   <div>
-    <el-form
-      :rules="rules"
-      ref="formRef"
-      :model="form">
-
+    <el-form :rules="rules" ref="formRef" :model="form">
       <header-title title="退货物品明细" size="16px"></header-title>
 
       <ele-pro-table
@@ -15,273 +10,366 @@
         :toolkit="[]"
         :datasource="datasource"
         cache-key="customerReturnOrderDialog"
-        class="time-form">
-        <!--////-->
+        class="time-form"
+      >
+        <template v-slot:technicalDrawings="scope">
+          <el-form-item
+            style="margin-bottom: 20px"
+            :prop="'detailList.' + scope.$index + '.technicalDrawings'"
+          >
+            <fileMain v-model="scope.row.technicalDrawings" type="view"></fileMain>
+          </el-form-item>
+        </template>
       </ele-pro-table>
     </el-form>
-
+    
   </div>
-
-
 </template>
 
-
 <script>
-import {
-  getOutInBySourceBizNoAPI,
-  saleReturnGetByIdAPI,
-} from "@/api/saleManage/returnGoods";
-import {deepClone} from "@/utils";
-import bpmDetail from "@/views/bpm/processInstance/detail.vue";
-import {reviewStatusEnum} from "@/enum/dict";
-
+  import {
+    getOutInBySourceBizNoAPI,
+    saleReturnGetByIdAPI
+  } from '@/api/saleManage/returnGoods';
+  import { deepClone } from '@/utils';
+  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
+  import { reviewStatusEnum } from '@/enum/dict';
+  import fileMain from '@/components/addDoc/index.vue';
 
-export default {
-  name: "customerReturnOrderDetail",
-  components: {bpmDetail},
-  props: ['row'],
-  data() {
-    return {
-      title: '客户退货处理单',
-      outboundDetailsDialogFlag: false,
-      loading: false,
+  export default {
+    name: 'customerReturnOrderDetail',
+    components: { bpmDetail,fileMain },
+    props: ['row'],
+    data() {
+      return {
+        title: '客户退货处理单',
+        outboundDetailsDialogFlag: false,
+        loading: false,
 
-      datasource: [],
-      warehousingMaterialList: [],
-      materialCodeReqList: [],
-      metaList: [],
-      currentRow: {},
-      form: {},
-      rules: {}
+        datasource: [],
+        warehousingMaterialList: [],
+        materialCodeReqList: [],
+        metaList: [],
+        currentRow: {},
+        form: {},
+        rules: {}
+      };
+    },
+    computed: {
+      columns() {
+        let basicFields = [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            minWidth: 120,
+            prop: 'productName',
+            label: '名称',
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'productCode',
+            label: '编码',
+            align: 'center'
+          },
+          // {
+          //   minWidth: 120,
+          //   prop: 'modelType',
+          //   label: '型号',
+          //   align: 'center',
+          //   slot: 'modelType'
+          // },
+          {
+            minWidth: 120,
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            slot: 'specification'
+          },
+          {
+            minWidth: 120,
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'barcodes',
+            label: '发货条码',
+            align: 'center'
+          },
+          {
+            minWidth: 180,
+            prop: 'packageNo',
+            label: '包装编码',
+            align: 'center'
+          },
+          {
+            minWidth: 80,
+            prop: 'packageCount',
+            label: '包装数量',
+            align: 'center',
+            // slot: 'packageCount',
+            headerSlot: 'headerPackingCount'
+          },
+          {
+            minWidth: 80,
+            prop: 'packingUnit',
+            label: '包装单位',
+            align: 'center',
+            slot: 'packingUnit'
+          },
+          // {
+          //   minWidth: 80,
+          //   prop: 'measurementCount',
+          //   label: '计量数量',
+          //   align: 'center',
+          //   // slot: 'measurementCount',
+          //   headerSlot: 'headerCount'
+          // },
+          // {
+          //   minWidth: 80,
+          //   prop: 'measurementUnit',
+          //   label: '计量单位',
+          //   align: 'center',
+          //   slot: 'measuringUnit'
+          // },
+          {
+            minWidth: 80,
+            prop: 'weight',
+            label: '重量',
+            align: 'center',
+            // slot: 'weight',
+            headerSlot: 'headerWeight'
+          },
+          {
+            minWidth: 80,
+            prop: 'weightUnit',
+            label: '重量单位',
+            align: 'center',
+            slot: 'weightUnit'
+          },
+          {
+            width: 240,
+            prop: 'technologyRouteName',
+            label: '工艺路线',
+            align: 'center'
+          },
+          {
+            width: 240,
+            prop: 'technicalDrawings',
+            label: '技术图纸',
+            slot: 'technicalDrawings',
+            align: 'center'
+          },
+          {
+            minWidth: 80,
+            prop: 'carveCode',
+            label: '刻码',
+            // slot: 'carveCode',
+            align: 'center',
+            headerSlot: 'headerEngrave'
+          },
+          {
+            minWidth: 140,
+            prop: 'reason',
+            label: '客户退货理由',
+            align: 'center',
+            slot: 'reason',
+            headerSlot: 'headerReason'
+          },
+          {
+            minWidth: 180,
+            prop: 'feedbackDate',
+            label: '客户反馈日期',
+            align: 'center',
+            slot: 'feedbackDate'
+          },
+          {
+            minWidth: 180,
+            prop: 'sendDate',
+            label: '客户发出日期',
+            slot: 'sendDate',
+            align: 'center',
+            headerSlot: 'headerSendDate'
+          },
+          {
+            minWidth: 140,
+            prop: 'ifPackageOk',
+            label: '包装完好与否',
+            align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              return _column == 1 ? '是' :_column===0? '否':'';
+            }
+          },
+          {
+            minWidth: 140,
+            prop: 'unpackUserName',
+            label: '拆包装责任人',
+            align: 'center'
+          },
+          {
+            minWidth: 250,
+            prop: 'ifReasonMatch',
+            label: '退货原因是否与退货信息一致',
+            align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              return _column == 1 ? '是' :_column===0? '否':'';
+            }
+          },
+          {
+            minWidth: 140,
+            prop: 'reason',
+            label: '客户退货理由',
+            align: 'center'
+          },
+          {
+            minWidth: 250,
+            prop: 'unqualifiedReasonAnalysis',
+            label: '不合格原因分析',
+            align: 'center'
+          },
+          {
+            minWidth: 250,
+            prop: 'unqualifiedTypeName',
+            label: '不合格类型',
+            align: 'center'
+          },
+          {
+            minWidth: 250,
+            prop: 'handleOpinion',
+            label: '对不合格品的处理意见',
+            align: 'center'
+          },
 
-    }
-  },
-  computed: {
-    columns() {
-      let basicFields = [
-      {
-          width: 45,
-          type: 'index',
-          columnKey: 'index',
-          align: 'center',
-          fixed: 'left'
-        },
-        {
-          minWidth: 120,
-          prop: 'productName',
-          label: '名称',
-          align: 'center',
-        },
-        {
-          minWidth: 120,
-          prop: 'productCode',
-          label: '编码',
-          align: 'center',
-        },
-        // {
-        //   minWidth: 120,
-        //   prop: 'modelType',
-        //   label: '型号',
-        //   align: 'center',
-        //   slot: 'modelType'
-        // },
-        {
-          minWidth: 120,
-          prop: 'specification',
-          label: '规格',
-          align: 'center',
-          slot: 'specification'
-        },
-        {
-          minWidth: 120,
-          prop: 'batchNo',
-          label: '批次号',
-          align: 'center',
-        },
-        {
-          minWidth: 120,
-          prop: 'barcodes',
-          label: '发货条码',
-          align: 'center',
-        },   {
-          minWidth: 120,
-          prop: 'packageNo',
-          label: '包装编码',
-          align: 'center',
-        },
-        {
-          minWidth: 80,
-          prop: 'packageCount',
-          label: '包装数量',
-          align: 'center',
-          // slot: 'packageCount',
-          headerSlot: 'headerPackingCount'
-        },
-        {
-          minWidth: 80,
-          prop: 'packingUnit',
-          label: '包装单位',
-          align: 'center',
-          slot: 'packingUnit'
-        },
-        // {
-        //   minWidth: 80,
-        //   prop: 'measurementCount',
-        //   label: '计量数量',
-        //   align: 'center',
-        //   // slot: 'measurementCount',
-        //   headerSlot: 'headerCount'
-        // },
-        // {
-        //   minWidth: 80,
-        //   prop: 'measurementUnit',
-        //   label: '计量单位',
-        //   align: 'center',
-        //   slot: 'measuringUnit'
-        // },
-        {
-          minWidth: 80,
-          prop: 'weight',
-          label: '重量',
-          align: 'center',
-          // slot: 'weight',
-          headerSlot: 'headerWeight'
-        },
-        {
-          minWidth: 80,
-          prop: 'weightUnit',
-          label: '重量单位',
-          align: 'center',
-          slot: 'weightUnit'
-        },
-        {
-          minWidth: 80,
-          prop: 'carveCode',
-          label: '刻码',
-          // slot: 'carveCode',
-          align: 'center',
-          headerSlot: 'headerEngrave'
-        },
-        {
-          minWidth: 140,
-          prop: 'reason',
-          label: '客户退货理由',
-          align: 'center',
-          slot: 'reason',
-          headerSlot: 'headerReason'
-        },
-        {
-          minWidth: 180,
-          prop: 'feedbackDate',
-          label: '客户反馈日期',
-          align: 'center',
-          slot: 'feedbackDate'
-        },
-        {
-          minWidth: 180,
-          prop: 'sendDate',
-          label: '客户发出日期',
-          slot: 'sendDate',
-          align: 'center',
-          headerSlot: 'headerSendDate'
-        },
-      ]
-      this.activeComp = this.taskDefinitionKey
-      return basicFields
-    }
-  },
-  mounted() {
-    this.init('', this.row)
-  },
-  methods: {
+          {
+            minWidth: 130,
+            prop: 'inOrOut',
+            label: '内部或外部',
+            align: 'center',
+            slot: 'inOrOut',
+            formatter: (_row, _column, cellValue) => {
+              return _column == 1 ? '内部' :_column === 0?'外部':'';
+            }
+          },
+          {
+            minWidth: 250,
+            prop: 'outerInfo',
+            label: '外协单位',
+            align: 'center'
+          },
+          {
+            minWidth: 250,
+            prop: 'improveCorrect',
+            label: '不合格原因是否改善到位',
+            align: 'center'
+          },
+          {
+            minWidth: 250,
+            prop: 'improveOpinion',
+            label: '对改善后产品处理意见',
+            align: 'center'
+          }
+        ];
 
-    init(type, row = {}) {
-      this.dialogType = type
-      this.currentRow = row
-      if (type !== 'add') {
-        this.getReturnInfo(row)
+        this.activeComp = this.taskDefinitionKey;
+        return basicFields;
       }
     },
-    async getReturnInfo(row) {
-      if (!row.handleReceiptId) return
-      this.form = await saleReturnGetByIdAPI(row.handleReceiptId)
+    mounted() {
+      this.init('', this.row);
+    },
+    methods: {
+      init(type, row = {}) {
+        this.dialogType = type;
+        console.log(type);
+        this.currentRow = row;
+        if (type !== 'add') {
+          this.getReturnInfo(row);
+        }
+      },
+      async getReturnInfo(row) {
+        if (!row.handleReceiptId) return;
+        this.form = await saleReturnGetByIdAPI(row.handleReceiptId);
 
-      //拼接信息
-      const data = await getOutInBySourceBizNoAPI(row.sendNo)
-      this.infoData = deepClone(data)
+        //拼接信息
+        const data = await getOutInBySourceBizNoAPI(row.sendNo);
+        this.infoData = deepClone(data);
 
-      //出库物料明细
-      this.warehousingMaterialList = this.infoData?.outInDetailVOList || []
+        //出库物料明细
+        this.warehousingMaterialList = this.infoData?.outInDetailVOList || [];
 
-      // 出库包装明细
-      if (this.warehousingMaterialList.length) {
-        this.materialCodeReqList = []
-        this.metaList = []
+        // 出库包装明细
+        if (this.warehousingMaterialList.length) {
+          this.materialCodeReqList = [];
+          this.metaList = [];
 
-        this.warehousingMaterialList.forEach(item => {
-          if (item.outInDetailRecordVOList?.length) {
-            item.outInDetailRecordVOList.forEach(i => {
-              const newItem = {
-                ...i,
-                outInCode: this.infoData.bizNo,
-                outInId: item.outInId,
-                measurementCount: i.totalCount,
-                outboundDetailId: i.id,
-                outboundType: 1,
-                packageCount: i.packingCount,
-                packingUnit: i.packingUnit,
-                weight: i.weight,
-                specification: item.specification,
-                name: i.name,
-                carveCode: i.carveCode,
-                categoryCode: i.categoryCode,
-                id: ''
-              }
-              this.materialCodeReqList.push(newItem)
+          this.warehousingMaterialList.forEach((item) => {
+            if (item.outInDetailRecordVOList?.length) {
+              item.outInDetailRecordVOList.forEach((i) => {
+                const newItem = {
+                  ...i,
+                  outInCode: this.infoData.bizNo,
+                  outInId: item.outInId,
+                  measurementCount: i.totalCount,
+                  outboundDetailId: i.id,
+                  outboundType: 1,
+                  packageCount: i.packingCount,
+                  packingUnit: i.packingUnit,
+                  weight: i.weight,
+                  specification: item.specification,
+                  name: i.name,
+                  carveCode: i.carveCode,
+                  categoryCode: i.categoryCode,
+                  id: ''
+                };
+                this.materialCodeReqList.push(newItem);
 
-              if (i.outInDetailRecordMaterialDetailVOList?.length) {
-                i.outInDetailRecordMaterialDetailVOList.forEach(detail => {
-                  const newDetail = {
-                    ...detail,
-                    outInId: item.outInId,
-                    outInCode: item.outInCode,
-                    measurementCount: 1,
-                    outboundDetailId: detail.id,
-                    outboundType: 2,
-                    packageCount: detail.packingCount,
-                    packingUnit: detail.packingUnit,
-                    weight: detail.weight,
-                    weightUtil: detail.weightUnit,
-                    specification: item.specification,
-                    categoryCode: detail.assetCode,
-                    name: detail.assetName,
-                    carveCode: detail.carveCode,
-                    id: ''
-                  }
-                  this.metaList.push(newDetail)
-                })
-              }
-            })
-          }
-        })
-      }
+                if (i.outInDetailRecordMaterialDetailVOList?.length) {
+                  i.outInDetailRecordMaterialDetailVOList.forEach((detail) => {
+                    const newDetail = {
+                      ...detail,
+                      outInId: item.outInId,
+                      outInCode: item.outInCode,
+                      measurementCount: 1,
+                      outboundDetailId: detail.id,
+                      outboundType: 2,
+                      packageCount: detail.packingCount,
+                      packingUnit: detail.packingUnit,
+                      weight: detail.weight,
+                      weightUtil: detail.weightUnit,
+                      specification: item.specification,
+                      categoryCode: detail.assetCode,
+                      name: detail.assetName,
+                      carveCode: detail.carveCode,
+                      id: ''
+                    };
+                    this.metaList.push(newDetail);
+                  });
+                }
+              });
+            }
+          });
+        }
 
-      // this.form.detailList.forEach(item => {
-      //   const findItem = item.outboundType === 1 ? this.materialCodeReqList.find(i => i.outboundDetailId === item.outboundDetailId) : this.metaList.find(i => i.outboundDetailId === item.outboundDetailId) || {}
-      //   item.name = findItem.name
-      //   item.categoryCode = findItem.categoryCode
-      //   item.specification = findItem.specification
-      //   item.weightUtil = findItem.weightUtil
-      //   item.packingUnit = findItem.packingUnit
-      //   item.measuringUnit = findItem.measuringUnit
-      // })
+        // this.form.detailList.forEach(item => {
+        //   const findItem = item.outboundType === 1 ? this.materialCodeReqList.find(i => i.outboundDetailId === item.outboundDetailId) : this.metaList.find(i => i.outboundDetailId === item.outboundDetailId) || {}
+        //   item.name = findItem.name
+        //   item.categoryCode = findItem.categoryCode
+        //   item.specification = findItem.specification
+        //   item.weightUtil = findItem.weightUtil
+        //   item.packingUnit = findItem.packingUnit
+        //   item.measuringUnit = findItem.measuringUnit
+        // })
 
-      this.datasource = this.form.detailList
+        this.datasource = this.form.detailList;
+      }
     }
-
-  }
-}
+  };
 </script>
-<style scoped lang="scss">
-
-</style>
+<style scoped lang="scss"></style>

+ 524 - 402
src/views/saleManage/saleOrder/returnGoods/components/customerReturnOrderDialog.vue

@@ -6,7 +6,8 @@
     :title="title"
     :close-on-click-modal="false"
     width="70%"
-    :before-close="cancel">
+    :before-close="cancel"
+  >
     <el-card shadow="never" v-loading="loading">
       <div class="switch">
         <div class="switch_left">
@@ -23,13 +24,12 @@
         </div>
       </div>
       <el-form
-        v-if="activeComp!=='bpm'"
+        v-if="activeComp !== 'bpm'"
         :rules="rules"
         ref="formRef"
-        :model="form">
-        <el-form-item>
-
-        </el-form-item>
+        :model="form"
+      >
+        <el-form-item> </el-form-item>
         <header-title title="退货物品明细" size="16px"></header-title>
 
         <ele-pro-table
@@ -49,17 +49,17 @@
               icon="el-icon-plus"
               class="ele-btn-icon"
               @click="handleSelectGoods"
-              v-if="dialogType!=='view'&&taskDefinitionKey=='stater'"
-
+              v-if="dialogType !== 'view' && taskDefinitionKey == 'stater'"
             >
               选择退货物品
             </el-button>
           </template>
-          <template v-slot:action="{ row,$index }">
+          <template v-slot:action="{ row, $index }">
             <el-popconfirm
               class="ele-action"
               title="确定要删除吗?"
-              @confirm="remove(row,$index)">
+              @confirm="remove(row, $index)"
+            >
               <template v-slot:reference>
                 <el-link type="danger" :underline="false" icon="el-icon-delete">
                   删除
@@ -68,267 +68,352 @@
             </el-popconfirm>
           </template>
 
-
-          <template v-slot:packageCount="{ row,$index }">
+          <template v-slot:packageCount="{ row, $index }">
             <el-form-item
-              :prop="'detailList.'+$index+'.packageCount'"
-              :rules="{required:row.outboundType!=2?true:false,trigger:'blur',message:'请输入'}">
-              <el-input v-if="activeComp == taskDefinitionKey&&dialogType!=='view'&&row.outboundType!=2"
-                        v-model="row.packageCount"></el-input>
+              :prop="'detailList.' + $index + '.packageCount'"
+              :rules="{
+                required: row.outboundType != 2 ? true : false,
+                trigger: 'blur',
+                message: '请输入'
+              }"
+            >
+              <el-input
+                v-if="
+                  activeComp == taskDefinitionKey &&
+                  dialogType !== 'view' &&
+                  row.outboundType != 2
+                "
+                v-model="row.packageCount"
+              ></el-input>
               <div v-else>{{ row.packageCount }}</div>
             </el-form-item>
           </template>
 
-          <template v-slot:measurementCount="{ row,$index }">
+          <template v-slot:measurementCount="{ row, $index }">
             <el-form-item
-              :prop="'detailList.'+$index+'.measurementCount'"
-              :rules="{required:true,trigger:'blur',message:'请输入'}">
-              <el-input v-if="activeComp == taskDefinitionKey&&dialogType!=='view'"
-                        v-model="row.measurementCount"></el-input>
+              :prop="'detailList.' + $index + '.measurementCount'"
+              :rules="{ required: true, trigger: 'blur', message: '请输入' }"
+            >
+              <el-input
+                v-if="activeComp == taskDefinitionKey && dialogType !== 'view'"
+                v-model="row.measurementCount"
+              ></el-input>
               <div v-else>{{ row.measurementCount }}</div>
             </el-form-item>
           </template>
 
-          <template v-slot:weight="{ row,$index }">
+          <template v-slot:weight="{ row, $index }">
             <el-form-item
-              :prop="'detailList.'+$index+'.weight'"
-              :rules="{required:true,trigger:'blur',message:'请输入'}">
-              <el-input v-if="activeComp == taskDefinitionKey&&dialogType!=='view'"
-                        v-model="row.weight"></el-input>
+              :prop="'detailList.' + $index + '.weight'"
+              :rules="{ required: true, trigger: 'blur', message: '请输入' }"
+            >
+              <el-input
+                v-if="activeComp == taskDefinitionKey && dialogType !== 'view'"
+                v-model="row.weight"
+              ></el-input>
               <div v-else>{{ row.weight }}</div>
             </el-form-item>
           </template>
 
-          <template v-slot:carveCode="{ row,$index }">
+          <template v-slot:carveCode="{ row, $index }">
             <el-form-item
-              :prop="'detailList.'+$index+'.carveCode'"
-              :rules="{required:true,trigger:'blur',message:'请输入'}">
-              <el-input v-if="activeComp == taskDefinitionKey&&dialogType!=='view'"
-                        v-model="row.carveCode"></el-input>
+              :prop="'detailList.' + $index + '.carveCode'"
+              :rules="{ required: true, trigger: 'blur', message: '请输入' }"
+            >
+              <el-input
+                v-if="activeComp == taskDefinitionKey && dialogType !== 'view'"
+                v-model="row.carveCode"
+              ></el-input>
               <div v-else>{{ row.carveCode }}</div>
             </el-form-item>
           </template>
 
           <!--  ///  发起人展示字段 -->
-          <template v-slot:reason="{ row,$index }">
+          <template v-slot:reason="{ row, $index }">
             <el-form-item
-              :prop="'detailList.'+$index+'.reason'"
-              :rules="{required:true,trigger:'blur',message:'请输入'}">
-              <el-input v-if="activeComp == taskDefinitionKey&&dialogType!=='view'"
-                        v-model="row.reason"></el-input>
+              :prop="'detailList.' + $index + '.reason'"
+              :rules="{ required: true, trigger: 'blur', message: '请输入' }"
+            >
+              <el-input
+                v-if="activeComp == taskDefinitionKey && dialogType !== 'view'"
+                v-model="row.reason"
+              ></el-input>
               <div v-else>{{ row.reason }}</div>
             </el-form-item>
           </template>
-          <template v-slot:feedbackDate="{ row,$index }">
+          <template v-slot:feedbackDate="{ row, $index }">
             <el-form-item
-              :prop="'detailList.'+$index+'.feedbackDate'"
-              :rules="{required:true,trigger:'change',message:'请选择'}"
+              :prop="'detailList.' + $index + '.feedbackDate'"
+              :rules="{ required: true, trigger: 'change', message: '请选择' }"
             >
               <el-date-picker
-                v-if="activeComp == taskDefinitionKey&&dialogType!=='view'"
+                v-if="activeComp == taskDefinitionKey && dialogType !== 'view'"
                 v-model="row.feedbackDate"
                 style="width: 100%"
                 type="date"
                 value-format="yyyy-MM-dd"
-                placeholder="选择日期">
+                placeholder="选择日期"
+              >
               </el-date-picker>
               <div v-else>{{ row.feedbackDate }}</div>
             </el-form-item>
-
           </template>
-          <template v-slot:sendDate="{ row,$index }">
+          <template v-slot:sendDate="{ row, $index }">
             <el-form-item
-              :prop="'detailList.'+$index+'.sendDate'"
-              :rules="{required:true,trigger:'change',message:'请选择'}"
+              :prop="'detailList.' + $index + '.sendDate'"
+              :rules="{ required: true, trigger: 'change', message: '请选择' }"
             >
               <el-date-picker
-                v-if="activeComp == taskDefinitionKey&&dialogType!=='view'"
+                v-if="activeComp == taskDefinitionKey && dialogType !== 'view'"
                 v-model="row.sendDate"
                 style="width: 100%"
                 value-format="yyyy-MM-dd"
                 type="date"
-                placeholder="选择日期">
+                placeholder="选择日期"
+              >
               </el-date-picker>
               <div v-else>{{ row.sendDate }}</div>
             </el-form-item>
-
+          </template>
+          <template v-slot:technicalDrawings="scope">
+            <el-form-item
+              style="margin-bottom: 20px"
+              :prop="'detailList.' + scope.$index + '.technicalDrawings'"
+            >
+              <fileMain v-model="scope.row.technicalDrawings"></fileMain>
+            </el-form-item>
+          </template>
+          <template v-slot:technologyRouteName="scope">
+            <el-form-item
+              :prop="'detailList.' + scope.$index + '.technologyRouteName'"
+              :rules="{
+                required: false,
+                message: '请选择',
+                trigger: 'change'
+              }"
+            >
+              <el-input
+                v-model="scope.row.technologyRouteName"
+                placeholder="请选择"
+                @click.native="openVersion(scope.$index)"
+              ></el-input>
+            </el-form-item>
           </template>
           <!--////-->
         </ele-pro-table>
       </el-form>
       <!--      流程详情-->
-      <bpmDetail v-if="activeComp==='bpm'&& form.processInstanceId" :id="form.processInstanceId"></bpmDetail>
+      <bpmDetail
+        v-if="activeComp === 'bpm' && form.processInstanceId"
+        :id="form.processInstanceId"
+      ></bpmDetail>
     </el-card>
-    <div slot="footer" v-if="activeComp == taskDefinitionKey&&dialogType!=='view'">
+    <div
+      slot="footer"
+      v-if="activeComp == taskDefinitionKey && dialogType !== 'view'"
+    >
       <el-button type="primary" @click="handleSubmit('save')">保存</el-button>
-      <el-button type="primary" v-if="isNeed_process_is_close" @click="handleSubmit('sub')">提交</el-button>
+      <el-button
+        type="primary"
+        v-if="isNeed_process_is_close"
+        @click="handleSubmit('sub')"
+        >提交</el-button
+      >
       <el-button type="info" @click="cancel">关闭</el-button>
     </div>
     <!--出库详情-->
-    <outbound-details-dialog v-if="outboundDetailsDialogFlag" ref="outboundDetailsDialogRef"
-                             :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag"
-                             @saveDate="saveDate"></outbound-details-dialog>
+    <outbound-details-dialog
+      v-if="outboundDetailsDialogFlag"
+      ref="outboundDetailsDialogRef"
+      :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag"
+      @saveDate="saveDate"
+    ></outbound-details-dialog>
     <head-list ref="headRef" @changeParent="changeHead"></head-list>
+    <ProductionVersion
+      ref="versionRefs"
+      @changeProduct="changeProduct"
+    ></ProductionVersion>
   </ele-modal>
 </template>
 
-
 <script>
-
-import outboundDetailsDialog from './outboundDetailsDialog.vue'
-import headList from "@/BIZComponents/user-select/user-select.vue";
-import {
-  getOutInBySourceBizNoAPI,
-  saleReturnGetByIdAPI,
-  saleReturnSaveAPI,
-  saleReturnUpdateAPI,
-  salesOrderReturnSubmit
-} from "@/api/saleManage/returnGoods";
-import {deepClone} from "@/utils";
-import bpmDetail from "@/views/bpm/processInstance/detail.vue";
-
-
-export default {
-  name: "customerReturnOrderDialog",
-  props: {
-    taskDefinitionKey: {
-      type: String,
-      default: 'stater',
-    },
-    customerReturnOrderDialogFlag: {
-      type: Boolean,
-      default: false,
-    }
-  },
-  components: {bpmDetail, outboundDetailsDialog, headList},
-  data() {
-    return {
-      title: '客户退货处理单',
-      dialogType: 'add',
-      tabOptions: [
-        {key: 'stater', name: '发起人申请'},
-        {key: 'bpm', name: '流程详情'},
-      ],
-      activeComp: '',
-      outboundDetailsDialogFlag: false,
-      loading: false,
-      warehousingMaterialList: [],
-      materialCodeReqList: [],
-      metaList: [],
-      currentRow: {},
-      form: {
-        detailList: [],
+  import outboundDetailsDialog from './outboundDetailsDialog.vue';
+  import headList from '@/BIZComponents/user-select/user-select.vue';
+  import {
+    getOutInBySourceBizNoAPI,
+    saleReturnGetByIdAPI,
+    saleReturnSaveAPI,
+    saleReturnUpdateAPI,
+    salesOrderReturnSubmit
+  } from '@/api/saleManage/returnGoods';
+  import { deepClone } from '@/utils';
+  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
+  import ProductionVersion from '@/components/ProductionVersion2/index.vue';
+  import fileMain from '@/components/addDoc/index.vue';
+  export default {
+    name: 'customerReturnOrderDialog',
+    props: {
+      taskDefinitionKey: {
+        type: String,
+        default: 'stater'
       },
-      rules: {}
-
-    }
-  },
-  computed: {
-    columns() {
-      let basicFields = [
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 120,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          fixed: 'right',
-          showOverflowTooltip: true,
-
-        },
-        {
-          width: 45,
-          type: 'index',
-          columnKey: 'index',
-          align: 'center',
-          fixed: 'left'
-        },
-        {
-          minWidth: 120,
-          prop: 'name',
-          label: '名称',
-          align: 'center',
-          slot: 'name'
-        },
-        {
-          minWidth: 120,
-          prop: 'categoryCode',
-          label: '编码',
-          align: 'center',
-          slot: 'categoryCode'
-        },
-        // {
-        //   minWidth: 120,
-        //   prop: 'modelType',
-        //   label: '型号',
-        //   align: 'center',
-        //   slot: 'modelType'
-        // },
-        {
-          minWidth: 120,
-          prop: 'specification',
-          label: '规格',
-          align: 'center',
-          slot: 'specification'
-        },
-        {
-          minWidth: 80,
-          prop: 'packageCount',
-          label: '包装数量',
-          align: 'center',
-          slot: 'packageCount',
-          headerSlot: 'headerPackingCount'
-        },
-        {
-          minWidth: 80,
-          prop: 'packingUnit',
-          label: '包装单位',
-          align: 'center',
-          slot: 'packingUnit'
-        },
-        {
-          minWidth: 80,
-          prop: 'measurementCount',
-          label: '计量数量',
-          align: 'center',
-          slot: 'measurementCount',
-          headerSlot: 'headerCount'
-        },
-        {
-          minWidth: 80,
-          prop: 'measuringUnit',
-          label: '计量单位',
-          align: 'center',
-          slot: 'measuringUnit'
-        },
-        {
-          minWidth: 80,
-          prop: 'weight',
-          label: '重量',
-          align: 'center',
-          slot: 'weight',
-          headerSlot: 'headerWeight'
-        },
-        {
-          minWidth: 80,
-          prop: 'weightUtil',
-          label: '重量单位',
-          align: 'center',
-          slot: 'weightUtil'
-        },
-        {
-          minWidth: 80,
-          prop: 'carveCode',
-          label: '刻码',
-          slot: 'carveCode',
-          align: 'center',
-          headerSlot: 'headerEngrave'
+      customerReturnOrderDialogFlag: {
+        type: Boolean,
+        default: false
+      }
+    },
+    components: { bpmDetail, outboundDetailsDialog, headList,ProductionVersion,fileMain },
+    data() {
+      return {
+        title: '客户退货处理单',
+        dialogType: 'add',
+        tabOptions: [
+          { key: 'stater', name: '发起人申请' },
+          { key: 'bpm', name: '流程详情' }
+        ],
+        activeComp: '',
+        outboundDetailsDialogFlag: false,
+        loading: false,
+        warehousingMaterialList: [],
+        materialCodeReqList: [],
+        metaList: [],
+        currentRow: {},
+        form: {
+          detailList: []
         },
-      ]
-      let processNodes = {
-        //发起人
-        stater: [
+        rules: {}
+      };
+    },
+    computed: {
+      columns() {
+        let basicFields = [
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 120,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            fixed: 'right',
+            showOverflowTooltip: true
+          },
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            minWidth: 120,
+            prop: 'productName',
+            label: '名称',
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'productCode',
+            label: '编码',
+            align: 'center'
+          },
+          // {
+          //   minWidth: 120,
+          //   prop: 'modelType',
+          //   label: '型号',
+          //   align: 'center',
+          //   slot: 'modelType'
+          // },
+          {
+            minWidth: 120,
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            slot: 'specification'
+          },
+          {
+            minWidth: 120,
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'barcodes',
+            label: '发货条码',
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'packageNo',
+            label: '包装编码',
+            align: 'center'
+          },
+          {
+            minWidth: 80,
+            prop: 'packageCount',
+            label: '包装数量',
+            align: 'center',
+            // slot: 'packageCount',
+            headerSlot: 'headerPackingCount'
+          },
+          {
+            minWidth: 80,
+            prop: 'packingUnit',
+            label: '包装单位',
+            align: 'center',
+            slot: 'packingUnit'
+          },
+          {
+            minWidth: 80,
+            prop: 'measurementCount',
+            label: '计量数量',
+            align: 'center',
+            // slot: 'measurementCount',
+            headerSlot: 'headerCount'
+          },
+          {
+            minWidth: 80,
+            prop: 'measurementUnit',
+            label: '计量单位',
+            align: 'center'
+          },
+          {
+            minWidth: 80,
+            prop: 'weight',
+            label: '重量',
+            align: 'center',
+            // slot: 'weight',
+            headerSlot: 'headerWeight'
+          },
+          {
+            minWidth: 80,
+            prop: 'weightUnit',
+            label: '重量单位',
+            align: 'center',
+            slot: 'weightUnit'
+          },
+          {
+            width: 240,
+            prop: 'technologyRouteName',
+            label: '工艺路线',
+            slot: 'technologyRouteName',
+            align: 'center'
+          },
+          {
+            width: 240,
+            prop: 'technicalDrawings',
+            label: '技术图纸',
+            slot: 'technicalDrawings',
+            align: 'center'
+          },
+          {
+            minWidth: 80,
+            prop: 'carveCode',
+            label: '刻码',
+            // slot: 'carveCode',
+            align: 'center',
+            headerSlot: 'headerEngrave'
+          },
           {
             minWidth: 140,
             prop: 'reason',
@@ -351,209 +436,246 @@ export default {
             slot: 'sendDate',
             align: 'center',
             headerSlot: 'headerSendDate'
-          },
-        ],
-        //仓管入库
-        storeman: [
-          {
-            minWidth: 140,
-            prop: 'ifPackageOk',
-            label: '包装完好与否',
-            align: 'center',
-            slot: 'ifPackageOk',
-            headerSlot: 'headerIfPackageOk'
-          },
-          {
-            minWidth: 140,
-            prop: 'unpackUserName',
-            label: '责任人',
-            align: 'center',
-            slot: 'unpackUserName'
           }
-        ],
-      }
-      processNodes[this.taskDefinitionKey] && basicFields.push(...processNodes[this.taskDefinitionKey])
-      this.activeComp = this.taskDefinitionKey
-      return basicFields
-    }
-  },
-  methods: {
-    //删除
-    remove(row, index) {
-      this.form.detailList.splice(index, 1)
-    },
-    //初始化
-    init(type, row = {}) {
-      this.dialogType = type
-      this.currentRow = row
-      if (type !== 'add') {
-        this.getReturnInfo(row)
+        ];
+        let processNodes = {
+          //发起人
+          stater: [
+            {
+              minWidth: 140,
+              prop: 'reason',
+              label: '客户退货理由',
+              align: 'center',
+              slot: 'reason',
+              headerSlot: 'headerReason'
+            },
+            {
+              minWidth: 180,
+              prop: 'feedbackDate',
+              label: '客户反馈日期',
+              align: 'center',
+              slot: 'feedbackDate'
+            },
+            {
+              minWidth: 180,
+              prop: 'sendDate',
+              label: '客户发出日期',
+              slot: 'sendDate',
+              align: 'center',
+              headerSlot: 'headerSendDate'
+            }
+          ],
+          //仓管入库
+          storeman: [
+            {
+              minWidth: 140,
+              prop: 'ifPackageOk',
+              label: '包装完好与否',
+              align: 'center',
+              slot: 'ifPackageOk',
+              headerSlot: 'headerIfPackageOk'
+            },
+            {
+              minWidth: 140,
+              prop: 'unpackUserName',
+              label: '责任人',
+              align: 'center',
+              slot: 'unpackUserName'
+            }
+          ]
+        };
+        processNodes[this.taskDefinitionKey] &&
+          basicFields.push(...processNodes[this.taskDefinitionKey]);
+        this.activeComp = this.taskDefinitionKey;
+        return basicFields;
       }
     },
-    //获取详情
-    async getReturnInfo(row) {
-      this.form = await saleReturnGetByIdAPI(row.handleReceiptId)
-      //拼接信息
-      const data = await getOutInBySourceBizNoAPI(row.sendNo)
-      this.infoData = deepClone(data)
+    methods: {
+      //删除
+      remove(row, index) {
+        this.form.detailList.splice(index, 1);
+      },
+      //初始化
+      init(type, row = {}) {
+        this.dialogType = type;
+        this.currentRow = row;
+        if (type !== 'add') {
+          this.getReturnInfo(row);
+        }
+      },
+      //工艺路线
+      changeProduct(data, index) {
+        this.$set(
+          this.form.detailList[index],
+          'technologyRouteName',
+          data.name
+        );
+        this.$set(this.form.detailList[index], 'technologyRouteId', data.id);
+      },
+      openVersion(index) {
+        this.$refs.versionRefs.open(index);
+      },
+      //获取详情
+      async getReturnInfo(row) {
+        this.form = await saleReturnGetByIdAPI(row.handleReceiptId);
+        //拼接信息
+        const data = await getOutInBySourceBizNoAPI(row.sendNo);
+        this.infoData = deepClone(data);
 
+        //出库物料明细
+        this.warehousingMaterialList = this.infoData?.outInDetailVOList || [];
+        //出库包装明细
+        if (this.warehousingMaterialList.length) {
+          this.materialCodeReqList = [];
+          this.warehousingMaterialList.forEach((item) => {
+            if (item.outInDetailRecordVOList?.length) {
+              item.outInDetailRecordVOList = item.outInDetailRecordVOList.map(
+                (i) => {
+                  return {
+                    ...i,
+                    outInCode: this.infoData.bizNo,
+                    outInId: item.outInId,
+                    measurementCount: i.totalCount,
+                    outboundDetailId: i.id,
+                    outboundType: 1,
+                    packageCount: i.packingCount,
+                    packingUnit: i.packingUnit,
+                    weight: i.weight,
+                    specification: item.specification,
+                    name: i.name,
+                    carveCode: i.carveCode,
+                    categoryCode: i.categoryCode,
+                    id: ''
+                  };
+                }
+              );
+              this.materialCodeReqList.push(...item.outInDetailRecordVOList);
+            }
+          });
+          //出库物料明细
+          if (this.materialCodeReqList.length) {
+            this.metaList = [];
+            this.materialCodeReqList.forEach((item) => {
+              if (item.outInDetailRecordMaterialDetailVOList?.length) {
+                item.outInDetailRecordMaterialDetailVOList =
+                  item.outInDetailRecordMaterialDetailVOList.map((i) => {
+                    return {
+                      ...i,
+                      outInId: item.outInId,
+                      outInCode: item.outInCode,
+                      measurementCount: 1,
+                      outboundDetailId: i.id,
+                      outboundType: 2,
+                      packageCount: i.packingCount,
+                      packingUnit: i.packingUnit,
+                      weight: i.weight,
+                      weightUtil: i.weightUnit,
+                      specification: item.specification,
+                      categoryCode: i.assetCode,
+                      name: i.assetName,
+                      carveCode: i.carveCode,
+                      id: ''
+                    };
+                  });
+                this.metaList.push(
+                  ...item.outInDetailRecordMaterialDetailVOList
+                );
+              }
+            });
+          }
+        }
+
+        // this.form.detailList.forEach(item => {
+        //   if (item.outboundType == 1) {
+        //     let find = this.materialCodeReqList.find(i => i.outboundDetailId == item.outboundDetailId) || {}
+        //     item.name = find.name
+        //     item.categoryCode = find.categoryCode
+        //     item.specification = find.specification
+        //     item.weightUtil = find.weightUtil
+        //     item.packingUnit = find.packingUnit
+        //     item.measuringUnit = find.measuringUnit
+        //   } else {
+        //     let find = this.metaList.find(i => i.outboundDetailId == item.outboundDetailId) || {}
+        //     item.name = find.name
+        //     item.categoryCode = find.categoryCode
+        //     item.specification = find.specification
+        //     item.weightUtil = find.weightUtil
+        //     item.packingUnit = find.packingUnit
+        //     item.measuringUnit = find.measuringUnit
+        //   }
+        // })
 
-      //出库物料明细
-      this.warehousingMaterialList = this.infoData?.outInDetailVOList || []
-      //出库包装明细
-      if (this.warehousingMaterialList.length) {
-        this.materialCodeReqList = []
-        this.warehousingMaterialList.forEach(item => {
-          if (item.outInDetailRecordVOList?.length) {
-            item.outInDetailRecordVOList = item.outInDetailRecordVOList.map(i => {
+        this.$nextTick(() => {
+          this.$refs.table.reRenderTable();
+        });
+      },
+      handleSelectGoods() {
+        this.outboundDetailsDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.outboundDetailsDialogRef.init(this.currentRow);
+        });
+      },
+      //选择退货信息回调
+      saveDate(data) {
+        this.form.detailList.push(...data);
+      },
+      //选择负责人
+      handHead(row, index) {
+        let item = {
+          id: row.unpackUserId
+        };
+        this.$refs.headRef.open(item, index);
+      },
+      //选择负责人回调
+      changeHead(obj, index) {
+        this.$set(this.form.detailList[index], 'unpackUserId', obj.id);
+        this.$set(this.form.detailList[index], 'unpackUserName', obj.name);
+      },
+      cancel() {
+        this.$emit('update:customerReturnOrderDialogFlag', false);
+      },
+      async handleSubmit(type) {
+        await this.$refs.formRef.validate(async (validate) => {
+          if (!validate) return this.$message.warning('有必填项未填,请检查');
+          let params = {
+            detailList: this.form.detailList.map((i) => {
               return {
-                ...i,
-                outInCode: this.infoData.bizNo,
-                outInId: item.outInId,
-                measurementCount: i.totalCount,
-                outboundDetailId: i.id,
-                outboundType: 1,
-                packageCount: i.packingCount,
+                outInId: i.outInId,
+                outInCode: i.outInCode,
+                measurementCount: i.measurementCount,
+                measurementUnit: i.measuringUnit,
+                outboundDetailId: i.outboundDetailId,
+                outboundType: i.outboundType,
+                productName: i.name,
+                productCode: i.categoryCode,
+                packageCount: i.packageCount,
                 packingUnit: i.packingUnit,
                 weight: i.weight,
-                specification: item.specification,
-                name: i.name,
+                weightUtil: i.weightUtil,
+                specification: i.specification,
+                modelType: i.modelType,
                 carveCode: i.carveCode,
-                categoryCode: i.categoryCode,
-                id: ''
-              }
-            })
-            this.materialCodeReqList.push(...item.outInDetailRecordVOList)
+                reason: i.reason,
+                sendDate: i.sendDate,
+                feedbackDate: i.feedbackDate,
+                id: i.id
+              };
+            }),
+            returnRecordId: this.currentRow.id,
+            id: this.currentRow.handleReceiptId
+          };
+          let api =
+            this.dialogType == 'add' ? saleReturnSaveAPI : saleReturnUpdateAPI;
+          const data = await api(params);
+          console.log(data, '===');
+          this.$message.success('操作成功');
+          if (type == 'sub') {
+            await salesOrderReturnSubmit({ businessId: data });
           }
-        })
-        //出库物料明细
-        if (this.materialCodeReqList.length) {
-          this.metaList = []
-          this.materialCodeReqList.forEach(item => {
-            if (item.outInDetailRecordMaterialDetailVOList?.length) {
-              item.outInDetailRecordMaterialDetailVOList = item.outInDetailRecordMaterialDetailVOList.map(i => {
-                return {
-                  ...i,
-                  outInId: item.outInId,
-                  outInCode: item.outInCode,
-                  measurementCount: 1,
-                  outboundDetailId: i.id,
-                  outboundType: 2,
-                  packageCount: i.packingCount,
-                  packingUnit: i.packingUnit,
-                  weight: i.weight,
-                  weightUtil: i.weightUnit,
-                  specification: item.specification,
-                  categoryCode: i.assetCode,
-                  name: i.assetName,
-                  carveCode: i.carveCode,
-                  id: ''
-                }
-              })
-              this.metaList.push(...item.outInDetailRecordMaterialDetailVOList)
-            }
-          })
-        }
+          this.cancel();
+        });
       }
-
-      this.form.detailList.forEach(item => {
-        if (item.outboundType == 1) {
-          let find = this.materialCodeReqList.find(i => i.outboundDetailId == item.outboundDetailId) || {}
-          item.name = find.name
-          item.categoryCode = find.categoryCode
-          item.specification = find.specification
-          item.weightUtil = find.weightUtil
-          item.packingUnit = find.packingUnit
-          item.measuringUnit = find.measuringUnit
-        } else {
-          let find = this.metaList.find(i => i.outboundDetailId == item.outboundDetailId) || {}
-          item.name = find.name
-          item.categoryCode = find.categoryCode
-          item.specification = find.specification
-          item.weightUtil = find.weightUtil
-          item.packingUnit = find.packingUnit
-          item.measuringUnit = find.measuringUnit
-        }
-      })
-
-      this.$nextTick(() => {
-        this.$refs.table.reRenderTable()
-      })
-
-
-    },
-    handleSelectGoods() {
-      this.outboundDetailsDialogFlag = true
-      this.$nextTick(() => {
-        this.$refs.outboundDetailsDialogRef.init(this.currentRow )
-      })
-    },
-    //选择退货信息回调
-    saveDate(data) {
-      this.form.detailList.push(...data)
-    },
-    //选择负责人
-    handHead(row, index) {
-      let item = {
-        id: row.unpackUserId
-      };
-      this.$refs.headRef.open(item, index);
-    },
-    //选择负责人回调
-    changeHead(obj, index) {
-      this.$set(this.form.detailList[index], 'unpackUserId', obj.id);
-      this.$set(this.form.detailList[index], 'unpackUserName', obj.name);
-    },
-    cancel() {
-      this.$emit('update:customerReturnOrderDialogFlag', false)
-    },
-    async handleSubmit(type) {
-
-      await this.$refs.formRef.validate(async validate => {
-        if (!validate) return this.$message.warning('有必填项未填,请检查')
-        let params = {
-          detailList: this.form.detailList.map(i => {
-            return {
-              outInId: i.outInId,
-              outInCode: i.outInCode,
-              measurementCount: i.measurementCount,
-              measurementUnit: i.measuringUnit,
-              outboundDetailId: i.outboundDetailId,
-              outboundType: i.outboundType,
-              productName: i.name,
-              productCode: i.categoryCode,
-              packageCount: i.packageCount,
-              packingUnit: i.packingUnit,
-              weight: i.weight,
-              weightUtil: i.weightUtil,
-              specification: i.specification,
-              modelType: i.modelType,
-              carveCode: i.carveCode,
-              reason: i.reason,
-              sendDate: i.sendDate,
-              feedbackDate: i.feedbackDate,
-              id: i.id
-            }
-          }),
-          returnRecordId: this.currentRow.id,
-          id: this.currentRow.handleReceiptId
-        }
-        let api = this.dialogType == 'add' ? saleReturnSaveAPI : saleReturnUpdateAPI
-        const data = await api(params)
-        console.log(data, '===');
-        this.$message.success('操作成功')
-        if (type == 'sub') {
-          await salesOrderReturnSubmit({businessId: data})
-
-        }
-        this.cancel()
-      })
-
-
-    },
-  }
-}
+    }
+  };
 </script>
-<style scoped lang="scss">
-
-</style>
+<style scoped lang="scss"></style>

+ 10 - 23
src/views/saleManage/saleOrder/returnGoods/components/detailDialog.vue

@@ -82,18 +82,7 @@
             <el-form-item
               label="回执附件:"
               prop="sendFiles">
-              <div
-                v-if="detailData.repliedFiles && detailData.repliedFiles?.length">
-                <el-link
-                  v-for="link in detailData.repliedFiles"
-                  :key="link.id"
-                  type="primary"
-                  :underline="false"
-                  @click="downloadFile(link)">
-                  {{ link.name }}
-                </el-link
-                >
-              </div>
+              <fileMain v-model="row.repliedFiles" type="view"></fileMain>
             </el-form-item>
 
           </el-col>
@@ -144,16 +133,7 @@
               label="退货附件:"
               prop="returnFiles"
             >
-              <div v-if="detailData.returnFiles && detailData.returnFiles?.length">
-                <el-link
-                  v-for="link in detailData.returnFiles"
-                  :key="link.id"
-                  type="primary"
-                  :underline="false"
-                  @click="downloadFile(link)">
-                  {{ link.name }}
-                </el-link>
-              </div>
+            <fileMain v-model="row.returnFiles" type="view"></fileMain>
             </el-form-item>
           </el-col>
         </el-row>
@@ -224,6 +204,7 @@ import customerReturnOrderDetail
   from "@/views/saleManage/saleOrder/returnGoods/components/customerReturnOrderDetail.vue";
 import outBoundDetails from "@/BIZComponents/outdetails.vue";
 import modalTitle from '@/BIZComponents/modalTitle.vue';
+import fileMain from "@/components/addDoc/index.vue";
 
 
 export default {
@@ -231,7 +212,7 @@ export default {
   components: {
     outBoundDetails,
     bpmDetail, inventoryTabledetail,
-    customerReturnOrderDetail,modalTitle
+    customerReturnOrderDetail,modalTitle,fileMain
   },
   data() {
     return {
@@ -468,6 +449,12 @@ export default {
           this.$refs.outBoundDetailsRef._getInfo(this.form.orderNo);
         })
       }
+      if(val =='main'){
+        this.$nextTick(() => {
+          this.$refs.inventoryTabledetailRef &&
+          this.$refs.inventoryTabledetailRef.putTableValue(this.form);
+        });
+      }
     },
     cancel() {
       this.$nextTick(() => {

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

@@ -796,7 +796,7 @@ export default {
         data.forEach((v) => {
           v.returnReason = v.returnReason || '';
           v.returnType = v.returnType || '';
-          v.sendTotalCount = v.sendRecordTotalCount;
+          v.sendTotalCount = v.sendRecordTotalCount||0;
           v.sendProductId = v.sendProductId || v.id;
         });
         this.oldSendTotalWeightList = data.map(item => {

+ 0 - 1
src/views/saleManage/saleOrder/returnGoods/components/sendListMultipleDialog.vue

@@ -356,7 +356,6 @@
       },
       /* 刷新表格 */
       reload(where) {
-        alert(1)
         where = {
           ...where,
           reviewStatus: 2