Explorar o código

退货处理单->发起发货单申请,发给客户
合同列表的合同类型字段取合同分类名称字段
供应商加注册资金、法人等信息,与客户维护一样;寄件人信息不做必填。
采购订单中的供应商代号不做必填

Z %!s(int64=2) %!d(string=hai) anos
pai
achega
a9ccc918a9

+ 20 - 0
src/api/saleManage/returnGoods.js

@@ -144,6 +144,26 @@ export async function salesOrderReturnSubmit(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+/**
+ * 客户退货处理单-获取销售发货单数据
+ */
+export async function getSaleOrderSendInfoAPI(returnHandleId) {
+  const res = await request.get(`/eom/salereturnhandle/getSaleOrderSendInfo/${returnHandleId}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 客户退货处理单-更新各种单据字段
+ */
+export async function saleReturnHandleUpdateReceipt(data) {
+  const res = await request.post(`/eom/salereturnhandle/updateReceipt`,data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
 
 

+ 2 - 2
src/views/contractManage/contractBook/index.vue

@@ -197,8 +197,8 @@ export default {
           minWidth: 200
         },
         {
-          prop: 'typeName',
-          label: '合同类型',
+          prop: 'categoryName',
+          label: '合同分类',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 140

+ 1 - 1
src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue

@@ -436,7 +436,7 @@ export default {
           width: 120,
           prop: 'supplierMark',
           label: '供应商代号',
-          headerSlot: 'headerSupplierMark',
+          // headerSlot: 'headerSupplierMark',
           slot: 'supplierMark'
         },
         {

+ 24 - 4
src/views/purchasingManage/supplierManage/components/addContactDialog.vue

@@ -28,6 +28,24 @@
                 <el-input placeholder="请输入" v-model="form.simpleName" maxlength="50"></el-input>
               </el-form-item>
             </el-col>
+            <el-col :span="8">
+              <el-form-item label="法定代表人" prop="legalPerson">
+                <el-input
+                  placeholder="请输入"
+                  v-model="form.legalPerson"
+                  maxlength="50"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="注册资金" prop="registeredCapital">
+                <el-input
+                  placeholder="请输入"
+                  v-model="form.registeredCapital"
+                  maxlength="50"
+                ></el-input>
+              </el-form-item>
+            </el-col>
             <el-col :span="8">
               <el-form-item label="授信额度" prop="authorizationLimit">
                 <el-input placeholder="请输入" v-model="form.authorizationLimit" maxlength="17"
@@ -227,23 +245,23 @@
             </el-col> -->
 
             <el-col :span="8">
-              <el-form-item label="寄件人" prop="sender">
+              <el-form-item label="寄件人" >
                 <el-input placeholder="请输入" v-model="otherForm.sender" maxlength="50"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="寄件人电话" prop="senderPhone">
+              <el-form-item label="寄件人电话">
                 <el-input placeholder="请输入" v-model="otherForm.senderPhone" maxlength="20"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="寄件人地址" prop="addressId">
+              <el-form-item label="寄件人地址">
                 <el-cascader clearable v-model="otherForm.addressId" :options="options.cityData" ref="sendAddress"
                   style="width: 100%"></el-cascader>
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="寄件人详细地址" prop="address" label-width="130px">
+              <el-form-item label="寄件人详细地址" label-width="130px">
                 <el-input placeholder="请输入" v-model="otherForm.address" maxlength="50"></el-input>
               </el-form-item>
             </el-col>
@@ -307,6 +325,8 @@ export default {
       officialIndustry: '',
       phone: '',
       registerDate: '',
+      legalPerson: '',
+      registeredCapital: '',
       remark: '',
       serialNo: '',
       simpleName: '',

+ 249 - 236
src/views/purchasingManage/supplierManage/components/contactDetailDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <ele-modal
-  custom-class="ele-dialog-form long-dialog-form"
+    custom-class="ele-dialog-form long-dialog-form"
     :centered="true"
     v-if="visible"
     :visible.sync="visible"
@@ -24,42 +24,52 @@
                 label="供应商分类:"
                 prop="categoryId"
               >
-                {{form.categoryName}}
+                {{ form.categoryName }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="供应商名称:" prop="name">
-                {{form.name}}
+                {{ form.name }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="供应商代号:" prop="serialNo">
-                {{form.serialNo}}
+                {{ form.serialNo }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="供应商简称:" prop="simpleName">
-                {{form.simpleName}}
+                {{ form.simpleName }}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="法定代表人:" prop="legalPerson">
+                {{ form.legalPerson }}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="注册资金:" prop="registeredCapital">
+                {{ form.registeredCapital }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="授信额度:" prop="authorizationLimit">
-                {{form.authorizationLimit}}
+                {{ form.authorizationLimit }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="单位电话:" prop="phone">
-                {{form.phone}}
+                {{ form.phone }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="地址:" prop="addressId">
-                {{form.addressName}}
+                {{ form.addressName }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="详细地址:" prop="address">
-                {{form.address}}
+                {{ form.address }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -67,32 +77,32 @@
                 label="统一社会信用代码:"
                 prop="unifiedSocialCreditCode"
               >
-                {{form.unifiedSocialCreditCode}}
+                {{ form.unifiedSocialCreditCode }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="所属行业:" prop="industry">
-                {{form.industryFullName}}
+                {{ form.industryFullName }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="营业类型:" prop="companyCategoryId">
-                {{form.companyCategoryName}}
+                {{ form.companyCategoryName }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="登记日期:" prop="registerDate">
-                {{form.registerDate}}
+                {{ form.registerDate }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="经营范围:" prop="businessScope">
-                {{form.businessScope}}
+                {{ form.businessScope }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="主营产品:" prop="mainProduct">
-                {{form.mainProduct}}
+                {{ form.mainProduct }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -101,19 +111,20 @@
                 prop="hasParentGroup"
                 label-width="170px"
               >
-                {{ form.hasParentGroup === 1 ? "是" : "否"}}
+                {{ form.hasParentGroup === 1 ? "是" : "否" }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item prop="businessLicenseFile" label="营业执照附件:">
                 <el-link v-if="form.businessLicenseFile && form.businessLicenseFile !== ''"
                          type="primary" :underline="false"
-                         @click="downloadFile(form.businessLicenseFile)"> {{ form.businessLicenseFile.name }}</el-link>
+                         @click="downloadFile(form.businessLicenseFile)"> {{ form.businessLicenseFile.name }}
+                </el-link>
               </el-form-item>
             </el-col>
             <el-col :span="16">
               <el-form-item label="备注:" prop="remark">
-                {{form.remark}}
+                {{ form.remark }}
               </el-form-item>
             </el-col>
           </el-row>
@@ -133,16 +144,16 @@
           </template>
 
           <template v-slot:accountName="{ row }">
-            {{row.accountName}}
+            {{ row.accountName }}
           </template>
           <template v-slot:accountNo="{ row }">
-            {{row.accountNo}}
+            {{ row.accountNo }}
           </template>
           <template v-slot:bankName="{ row }">
-            {{row.bankName}}
+            {{ row.bankName }}
           </template>
           <template v-slot:interbankNo="{ row }">
-            {{row.interbankNo}}
+            {{ row.interbankNo }}
           </template>
         </ele-pro-table>
       </el-tab-pane>
@@ -166,19 +177,19 @@
           </template>
 
           <template v-slot:linkName="{ row }">
-            {{row.linkName}}
+            {{ row.linkName }}
           </template>
           <template v-slot:mobilePhone="{ row }">
-            {{row.mobilePhone}}
+            {{ row.mobilePhone }}
           </template>
           <template v-slot:phone="{ row }">
-            {{row.phone}}
+            {{ row.phone }}
           </template>
           <template v-slot:email="{ row }">
-            {{row.email}}
+            {{ row.email }}
           </template>
           <template v-slot:post="{ row }">
-            {{row.post}}
+            {{ row.post }}
           </template>
           <template v-slot:ifChief="{ row, $index }">
             <el-select v-model="row.ifChief" class="w100" disabled>
@@ -198,7 +209,7 @@
             ></DictSelection>
           </template>
           <template v-slot:remark="{ row }">
-            {{row.remark}}
+            {{ row.remark }}
           </template>
         </ele-pro-table>
       </el-tab-pane>
@@ -212,17 +223,17 @@
           <el-row>
             <el-col :span="8">
               <el-form-item label="结算方式:" prop="settlementMode">
-                {{otherForm.settlementModeName}}
+                {{ otherForm.settlementModeName }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="税率:" prop="taxRate">
-                {{otherForm.taxRate}} %
+                {{ otherForm.taxRate }} %
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="折扣率:" prop="discount">
-                {{otherForm.discount}} %
+                {{ otherForm.discount }} %
               </el-form-item>
             </el-col>
             <!-- <el-col :span="8">
@@ -242,22 +253,22 @@
 
             <el-col :span="8">
               <el-form-item label="寄件人:" prop="sender">
-                {{otherForm.sender}}
+                {{ otherForm.sender }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="寄件人电话:" prop="senderPhone">
-                {{otherForm.senderPhone}}
+                {{ otherForm.senderPhone }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="寄件人地址:" prop="addressId">
-                {{otherForm.addressName}}
+                {{ otherForm.addressName }}
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="寄件人详细地址:" prop="address" >
-                {{otherForm.address}}
+              <el-form-item label="寄件人详细地址:" prop="address">
+                {{ otherForm.address }}
               </el-form-item>
             </el-col>
           </el-row>
@@ -283,213 +294,215 @@ import {copyObj} from '@/utils/util';
 
 
 export default {
-    props: {
-      categoryTreeList: Array
-    },
-    mixins: [dictMixins],
-    components: {
-      fileUpload,
-      deptSelect,
-      personSelect
-    },
-    data() {
-      let formDef = {
-          address: '',
-          addressId: 0,
-          addressName: '',
-          authorizationLimit: 0,
-          businessLicenseFile: {},
-          businessScope: '',
-          categoryId: '',
-          categoryName: '',
-          companyCategoryId: '',
-          companyCategoryName: '',
-          hasParentGroup: 0,
-          industry: '',
-          industryCode: '',
-          industryFullName: '',
-          mainProduct: '',
-          name: '',
-          officialIndustry: '',
-          phone: '',
-          registerDate: '',
-          remark: '',
-          serialNo: '',
-          simpleName: '',
-          type: 1,
-          unifiedSocialCreditCode: ''
-        };
-      let otherFormDef = {
-        settlementMode: '',
-        settlementModeName: '',
-        taxRate: 0,
-        address: '',
-        addressId: '',
-        deptId: '',
-        deptName: '',
-        discount: 0,
-        salesmanId: '',
-        salesmanName: '',
-        sender: '',
-        senderPhone: ''
-      };
-      return {
-        visible: false,
-        title: '供应商详情',
-        row: {},
-        activeName: 'base',
-        formDef,
-        otherFormDef,
-        form: copyObj(formDef),
-        otherForm: copyObj(otherFormDef),
-        tableBankData: [],
-        tableLinkData: [],
-        ifChiefList: [
-          {
-            value: 0,
-            label: '否'
-          },
-          {
-            value: 1,
-            label: '是'
-          }
-        ],
-        bankColumns: [
-          {
-            type: 'index',
-            width: 55,
-            align: 'center'
-          },
-          {
-            label: '单位名称',
-            prop: 'accountName',
-            slot: 'accountName',
-            action: 'accountName',
-            headerSlot: 'accountNameHeader'
-          },
-          {
-            label: '银行账号',
-            prop: 'accountNo',
-            slot: 'accountNo',
-            action: 'accountNo'
-          },
-          {
-            label: '开户行',
-            prop: 'bankName',
-            slot: 'bankName',
-            action: 'bankName'
-          },
-          {
-            label: '银行银联号',
-            prop: 'interbankNo',
-            slot: 'interbankNo',
-            action: 'interbankNo'
-          },
-        ],
-        linkColumns: [
-          {
-            type: 'index',
-            width: 55,
-            align: 'center'
-          },
-          {
-            label: '姓名',
-            prop: 'linkName',
-            slot: 'linkName',
-            action: 'linkName',
-            headerSlot: 'linkNameHeader'
-          },
-          {
-            label: '手机',
-            prop: 'mobilePhone',
-            slot: 'mobilePhone',
-            action: 'mobilePhone',
-            headerSlot: 'mobilePhoneHeader'
-          },
-          {
-            label: '电话',
-            prop: 'phone',
-            slot: 'phone',
-            action: 'phone'
-          },
-          {
-            label: '微信号',
-            prop: 'wechat',
-            slot: 'wechat',
-            action: 'wechat'
-          },
-          {
-            label: '邮箱',
-            prop: 'email',
-            slot: 'email',
-            action: 'email'
-          },
-          {
-            label: '职务',
-            prop: 'post',
-            slot: 'post',
-            action: 'post'
-          },
-          {
-            label: '状态',
-            prop: 'status',
-            slot: 'status',
-            action: 'status',
-            headerSlot: 'statusHeader'
-          },
-          {
-            label: '是否首要',
-            prop: 'ifChief',
-            slot: 'ifChief',
-            action: 'ifChief'
-          },
-          {
-            label: '备注',
-            prop: 'remark',
-            slot: 'remark',
-            action: 'remark'
-          },
-        ],
-      };
+  props: {
+    categoryTreeList: Array
+  },
+  mixins: [dictMixins],
+  components: {
+    fileUpload,
+    deptSelect,
+    personSelect
+  },
+  data() {
+    let formDef = {
+      address: '',
+      addressId: 0,
+      addressName: '',
+      authorizationLimit: 0,
+      businessLicenseFile: {},
+      businessScope: '',
+      categoryId: '',
+      categoryName: '',
+      companyCategoryId: '',
+      companyCategoryName: '',
+      hasParentGroup: 0,
+      industry: '',
+      industryCode: '',
+      industryFullName: '',
+      mainProduct: '',
+      name: '',
+      officialIndustry: '',
+      phone: '',
+      registerDate: '',
+      legalPerson: '',
+      registeredCapital: '',
+      remark: '',
+      serialNo: '',
+      simpleName: '',
+      type: 1,
+      unifiedSocialCreditCode: ''
+    };
+    let otherFormDef = {
+      settlementMode: '',
+      settlementModeName: '',
+      taxRate: 0,
+      address: '',
+      addressId: '',
+      deptId: '',
+      deptName: '',
+      discount: 0,
+      salesmanId: '',
+      salesmanName: '',
+      sender: '',
+      senderPhone: ''
+    };
+    return {
+      visible: false,
+      title: '供应商详情',
+      row: {},
+      activeName: 'base',
+      formDef,
+      otherFormDef,
+      form: copyObj(formDef),
+      otherForm: copyObj(otherFormDef),
+      tableBankData: [],
+      tableLinkData: [],
+      ifChiefList: [
+        {
+          value: 0,
+          label: '否'
+        },
+        {
+          value: 1,
+          label: '是'
+        }
+      ],
+      bankColumns: [
+        {
+          type: 'index',
+          width: 55,
+          align: 'center'
+        },
+        {
+          label: '单位名称',
+          prop: 'accountName',
+          slot: 'accountName',
+          action: 'accountName',
+          headerSlot: 'accountNameHeader'
+        },
+        {
+          label: '银行账号',
+          prop: 'accountNo',
+          slot: 'accountNo',
+          action: 'accountNo'
+        },
+        {
+          label: '开户行',
+          prop: 'bankName',
+          slot: 'bankName',
+          action: 'bankName'
+        },
+        {
+          label: '银行银联号',
+          prop: 'interbankNo',
+          slot: 'interbankNo',
+          action: 'interbankNo'
+        },
+      ],
+      linkColumns: [
+        {
+          type: 'index',
+          width: 55,
+          align: 'center'
+        },
+        {
+          label: '姓名',
+          prop: 'linkName',
+          slot: 'linkName',
+          action: 'linkName',
+          headerSlot: 'linkNameHeader'
+        },
+        {
+          label: '手机',
+          prop: 'mobilePhone',
+          slot: 'mobilePhone',
+          action: 'mobilePhone',
+          headerSlot: 'mobilePhoneHeader'
+        },
+        {
+          label: '电话',
+          prop: 'phone',
+          slot: 'phone',
+          action: 'phone'
+        },
+        {
+          label: '微信号',
+          prop: 'wechat',
+          slot: 'wechat',
+          action: 'wechat'
+        },
+        {
+          label: '邮箱',
+          prop: 'email',
+          slot: 'email',
+          action: 'email'
+        },
+        {
+          label: '职务',
+          prop: 'post',
+          slot: 'post',
+          action: 'post'
+        },
+        {
+          label: '状态',
+          prop: 'status',
+          slot: 'status',
+          action: 'status',
+          headerSlot: 'statusHeader'
+        },
+        {
+          label: '是否首要',
+          prop: 'ifChief',
+          slot: 'ifChief',
+          action: 'ifChief'
+        },
+        {
+          label: '备注',
+          prop: 'remark',
+          slot: 'remark',
+          action: 'remark'
+        },
+      ],
+    };
+  },
+  methods: {
+    async open(row) {
+      this.row = row;
+      this.visible = true;
+      await this._getById(row.id);
     },
-    methods: {
-      async open(row) {
-        this.row = row;
-        this.visible = true;
-        await this._getById(row.id);
-      },
 
-      cancel() {
-        this.$nextTick(() => {
-          // 关闭后,销毁所有的表单数据
-          this.form = copyObj(this.formDef),
+    cancel() {
+      this.$nextTick(() => {
+        // 关闭后,销毁所有的表单数据
+        this.form = copyObj(this.formDef),
           this.otherForm = copyObj(this.otherFormDef),
           this.tableBankData = []
-          this.tableLinkData = []
-          this.visible = false;
-        })
-      },
+        this.tableLinkData = []
+        this.visible = false;
+      })
+    },
 
-      async _getById(id) {
-        const data = await contactDetail(id);
-        this.form = data.base;
-        this.otherForm = data.other;
-        this.tableBankData = data.bankList;
-        this.tableLinkData = data.linkList;
+    async _getById(id) {
+      const data = await contactDetail(id);
+      this.form = data.base;
+      this.otherForm = data.other;
+      this.tableBankData = data.bankList;
+      this.tableLinkData = data.linkList;
 
-        if(this.tableLinkData && this.tableLinkData.length > 0){
-          this.tableLinkData.forEach(e => e.status = e.status+"");
-        }
+      if (this.tableLinkData && this.tableLinkData.length > 0) {
+        this.tableLinkData.forEach(e => e.status = e.status + "");
+      }
 
-        await getCategoryInfo(this.form.categoryId).then((res) => {
-          this.$set(this.form,'categoryName', res.data.name)
-        });
-      },
+      await getCategoryInfo(this.form.categoryId).then((res) => {
+        this.$set(this.form, 'categoryName', res.data.name)
+      });
+    },
 
-      downloadFile(file){
-        getFile({ objectName: file.storePath }, file.name);
-      },
+    downloadFile(file) {
+      getFile({objectName: file.storePath}, file.name);
+    },
 
-    }
-  };
+  }
+};
 </script>

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

@@ -0,0 +1,291 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    :visible.sync="addSaleOrderDialogFlag"
+    :title="title"
+    :close-on-click-modal="false"
+    width="80%"
+    :before-close="cancel"
+  >
+    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+      <headerTitle title="发货信息"></headerTitle>
+      <el-row>
+        <el-col :span="12">
+          <el-form-item
+            label="选择订单"
+            prop="orderNo"
+
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              disabled
+              v-model="form.orderNo"
+              placeholder="请输入"
+            />
+          </el-form-item>
+          <el-form-item
+            label="客户名称"
+            prop="contactName"
+            style="margin-bottom: 22px"
+          >
+            <span>{{ form.contactName }}</span>
+          </el-form-item>
+          <el-form-item
+            label="客户联系人"
+            prop="linkName"
+            style="margin-bottom: 22px"
+          >
+            <el-input clearable v-model="form.linkName" placeholder="请输入"/>
+          </el-form-item>
+
+          <el-form-item prop="sendFiles" label="发货附件">
+            <fileUpload
+              v-model="form.sendFiles"
+              module="main"
+              :showLib="false"
+              :limit="10"
+            />
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="车辆号" prop="carNo" style="margin-bottom: 22px">
+            <el-input clearable v-model="form.carNo" placeholder="请输入"/>
+          </el-form-item>
+
+          <!-- <el-form-item
+              label="订单编码"
+              prop="orderNo"
+              style="margin-bottom: 22px"
+            >
+            <span>{{form.orderNo}}</span>
+
+            </el-form-item> -->
+
+          <el-form-item
+            label="客户电话"
+            prop="linkPhone"
+            style="margin-bottom: 22px"
+          >
+            <el-input clearable v-model="form.linkPhone" placeholder="请输入"/>
+          </el-form-item>
+          <el-form-item
+            label="收货地址"
+            prop="receiveAddress"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              clearable
+              v-model="form.receiveAddress"
+              placeholder="请输入"
+            />
+          </el-form-item>
+          <el-form-item prop="repliedFiles" label="回执附件">
+            <fileUpload
+              v-model="form.repliedFiles"
+              module="main"
+              :showLib="false"
+              :limit="10"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <headerTitle title="产品清单" style="margin-top: 30px"></headerTitle>
+    <inventoryTable
+      :isShowAdd='false'
+      ref="inventoryTableref"
+      :orderId="form.orderId"
+    ></inventoryTable>
+
+    <div slot="footer" class="footer">
+      <el-button type="primary" @click="save">保存</el-button>
+      <el-button type="primary" @click="save('sub')">提交</el-button>
+
+      <el-button @click="cancel">返回</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+import fileUpload from '@/components/upload/fileUpload';
+import dictMixins from '@/mixins/dictMixins';
+import parentList from '@/views/saleManage/contact/components/parentList.vue';
+import {
+  addSendInformation,
+  UpdateSendInformation,
+  submit
+} from '@/api/saleManage/saleordersendrecord';
+import {getSaleOrderSendInfoAPI, saleReturnHandleUpdateReceipt} from '@/api/saleManage/returnGoods';
+import inventoryTable from '../invoice/components/inventoryTable.vue';
+import {copyObj} from '@/utils/util';
+
+export default {
+  name: 'add-sale-order-dialog',
+  props: ['addSaleOrderDialogFlag'],
+  mixins: [dictMixins],
+  components: {
+    fileUpload,
+    inventoryTable,
+    parentList
+  },
+  data() {
+    let formDef = {
+      id: '',
+      contractId: '',
+      sendFiles: [],
+      repliedFiles: [],
+      contractName: '',
+      receiveAddress: '',
+      carNo: '',
+      carId: '',
+      linkName: '',
+      linkPhone: '',
+      orderNo: '',
+      orderId: '',
+      replied: 0
+    };
+
+    return {
+      title: '',
+      row: {},
+      formDef,
+      form: copyObj(formDef),
+      rules: {
+        partaName: [
+          {required: true, message: '请选择客户名称', trigger: 'change'}
+        ],
+        linkName: [
+          {required: true, message: '请输入', trigger: ['blur', 'change']}
+        ],
+        orderNo: [
+          {required: true, message: '请选择', trigger: 'change'}
+        ],
+        receiveAddress: [
+          {required: true, message: '请输入', trigger: 'change'}
+        ],
+      },
+      // 提交状态
+      loading: false,
+      // 是否是修改
+      isUpdate: false,
+      businessId: ''
+    };
+  },
+  methods: {
+    //初始化数据
+    init(row = {}) {
+      this.title = '新增发货单';
+      this.currentRow = row;
+      this.getSendSaleOrderDetail(row.id)
+    },
+    //发货单详情
+    async getSendSaleOrderDetail(id) {
+      this.businessId = id;
+      this.loading = true;
+      const data = await getSaleOrderSendInfoAPI(id);
+      this.loading = false;
+      if (data) {
+        this.$nextTick(() => {
+          this.form = data;
+          this.$refs.inventoryTableref &&
+          this.$refs.inventoryTableref.putTableValue(data.productList);
+        });
+      }
+    },
+
+    getValidate() {
+      return Promise.all([
+        new Promise((resolve, reject) => {
+          this.$refs.form.validate((valid) => {
+            if (!valid) {
+              reject(false);
+            } else {
+              resolve(true);
+            }
+          });
+        }),
+        new Promise((resolve, reject) => {
+          this.$refs.inventoryTableref.validateForm((valid) => {
+            if (!valid) {
+              reject(false);
+            } else {
+              resolve(true);
+            }
+          });
+        })
+      ]);
+    },
+    async save(type) {
+      try {
+        await this.getValidate();
+        // 表单验证通过,执行保存操作
+        this.loading = true;
+
+        if (!this.isUpdate) {
+          delete this.form.id;
+        }
+        this.form.repliedFiles = this.form.repliedFiles || [];
+        this.form.replied = this.form.repliedFiles.length > 0 ? 1 : 0;
+        let commitData = Object.assign({}, this.form, {
+          productList: this.$refs.inventoryTableref.getTableValue()
+        });
+
+        addSendInformation(commitData)
+          .then((res) => {
+            this.loading = false;
+            this.$message.success('新增成功');
+            saleReturnHandleUpdateReceipt({id: this.currentRow.id, resendId: res})
+            if (type === 'sub') {
+              this.sendSubmit(res);
+              return;
+            }
+            this.cancel();
+            this.$emit('done');
+          })
+          .catch((e) => {
+            //this.loading = false;
+          });
+      } catch (error) {
+        console.log(error);
+        // 表单验证未通过,不执行保存操作
+      }
+    },
+    sendSubmit(res) {
+      submit({
+        businessId: this.businessId || res
+        // productionSupervisorId
+      }).then((res) => {
+        this.cancel();
+        this.$emit('done');
+      });
+    },
+    cancel() {
+      this.$emit('update:addSaleOrderDialogFlag', false)
+    },
+    reload() {
+      this.$emit('done')
+    }
+  }
+};
+</script>
+<style scoped lang="scss">
+.TotalAmount {
+  font-size: 16px;
+  padding-right: 30px;
+}
+
+.headbox {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
+    margin-right: 20px;
+  }
+}
+</style>

+ 57 - 10
src/views/saleManage/saleOrder/customerReturnOrder/index.vue

@@ -41,6 +41,16 @@
 
           <!-- 查看详情列 -->
 
+          <template v-slot:returnHandleNo="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="openorderDetail(row, 'returnNo')"
+            >
+              {{ row.returnHandleNo }}
+            </el-link
+            >
+          </template>
           <template v-slot:returnNo="{ row }">
             <el-link
               type="primary"
@@ -80,7 +90,15 @@
             >
               提交
             </el-link>
-
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="handleAddSaleOrder(row)"
+              v-if="[2].includes(row.approvalStatus)&&!row.resendId"
+            >
+              创建发货单
+            </el-link>
             <el-popconfirm
               class="ele-action"
               title="确定要删除此信息吗?"
@@ -104,15 +122,19 @@
 
     <!--  客户真实退货单  -->
     <add-or-edit-dialog :add-or-edit-dialog-flag.sync="addOrEditDialogFlag" ref="addOrEditDialogRef"
-                        v-if="addOrEditDialogFlag"  @done="reload"></add-or-edit-dialog>
-<!--详情-->
-    <detail-dialog :detailDialogFlag.sync="detailDialogFlag" ref="detailDialogRef" v-if="detailDialogFlag"></detail-dialog>
+                        v-if="addOrEditDialogFlag" @done="reload"></add-or-edit-dialog>
+    <!--详情-->
+    <detail-dialog ref="DetailDialogRef"
+    ></detail-dialog>
     <!-- 多选删除弹窗 -->
     <pop-modal
       :visible.sync="delVisible"
       content="是否确定删除?"
       @done="commitBtn"
     />
+    <!--发货单    -->
+    <add-sale-order-dialog v-if="addSaleOrderDialogFlag" :addSaleOrderDialogFlag.sync="addSaleOrderDialogFlag"
+                           ref="addSaleOrderDialogRef" @done="reload"></add-sale-order-dialog>
   </div>
 </template>
 
@@ -124,7 +146,8 @@ import popModal from '@/components/pop-modal';
 import addOrEditDialog from "@/views/saleManage/saleOrder/customerReturnOrder/addOrEditDialog.vue";
 import {reviewStatusEnum} from '@/enum/dict';
 import searchTablePage from "@/views/saleManage/saleOrder/customerReturnOrder/searchTable-page.vue";
-import detailDialog from "./detailDialog.vue";
+import detailDialog from "../returnGoods/components/detailDialog.vue";
+import addSaleOrderDialog from "@/views/saleManage/saleOrder/customerReturnOrder/add-sale-order-dialog.vue";
 import {
   saleReturnPageList,
   deleteSaleReturnAPI,
@@ -132,11 +155,13 @@ import {
 } from '@/api/saleManage/returnGoods';
 import dictMixins from '@/mixins/dictMixins';
 import addReturnGoodsDialog from "@/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog.vue";
+import AddSaleOrderDialog from "@/views/saleManage/saleOrder/customerReturnOrder/add-sale-order-dialog.vue";
 
 
 export default {
   mixins: [dictMixins],
   components: {
+    AddSaleOrderDialog,
     addReturnGoodsDialog,
     sendDetailDialog,
     orderDetailDialog,
@@ -159,6 +184,7 @@ export default {
       loading: false, // 加载状态
       addOrEditDialogFlag: false, // 客户真实退货单
       detailDialogFlag: false, // 客户真实退货单详情
+      addSaleOrderDialogFlag: false, // 新增发货单
       columns: [
         {
           width: 45,
@@ -175,6 +201,14 @@ export default {
           showOverflowTooltip: true,
           fixed: 'left'
         },
+        {
+          prop: 'returnHandleNo',
+          label: '退货处理单编码',
+          align: 'center',
+          slot: 'returnHandleNo',
+          showOverflowTooltip: true,
+          minWidth: 200
+        },
         {
           prop: 'returnNo',
           label: '退货单编码',
@@ -183,6 +217,7 @@ export default {
           showOverflowTooltip: true,
           minWidth: 200
         },
+
         {
           prop: 'orderNo',
           label: '销售订单编码',
@@ -259,7 +294,6 @@ export default {
       this.$nextTick(() => {
         this.$refs.addOrEditDialogRef.init(type, row)
       })
-
     },
 
     //批量删除
@@ -291,13 +325,26 @@ export default {
         this.reload();
       });
     },
+    handleAddSaleOrder(row) {
+      this.addSaleOrderDialogFlag = true
+      this.$nextTick(() => {
+        this.$refs.addSaleOrderDialogRef.init({...row})
+      })
+    },
     //查看详情
     openorderDetail(row, type) {
       if (type === 'returnNo') {
-        this.detailDialogFlag = true
-        this.$nextTick(() => {
-          this.$refs.detailDialogRef.init('view', row)
-        })
+        let params = {
+          handleReceiptId: row.id,
+          id: row.returnRecordId,
+          type: '10'
+
+        }
+        this.$refs.DetailDialogRef.open(params);
+        // this.detailDialogFlag = true
+        // this.$nextTick(() => {
+        //   this.$refs.detailDialogRef.init('view', row)
+        // })
       }
       if (type === 'sendNo') {
         this.$refs.sendDetailDialogRef.open({id: row.sendId});

+ 19 - 12
src/views/saleManage/saleOrder/customerReturnOrder/searchTable-page.vue

@@ -8,29 +8,29 @@
   >
     <el-row :gutter="15">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="退货单编码:" prop="returnNo">
+        <el-form-item label="处理单编码:" prop="returnHandleNo">
           <el-input
             clearable
             placeholder="请输入"
-            v-model.trim="params.returnNo"
+            v-model.trim="params.returnHandleNo"
           ></el-input>
         </el-form-item>
-        <el-form-item label="订单编码:" prop="orderNo">
+        <el-form-item label="退货单编码:" prop="returnNo">
           <el-input
             clearable
             placeholder="请输入"
-            v-model.trim="params.orderNo"
+            v-model.trim="params.returnNo"
           ></el-input>
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
-        <el-form-item label="发货单编码:" prop="sendNo">
-          <el-input
-            clearable
-            placeholder="请输入"
-            v-model.trim="params.sendNo"
-          ></el-input>
-        </el-form-item>
+<!--        <el-form-item label="发货单编码:" prop="sendNo">-->
+<!--          <el-input-->
+<!--            clearable-->
+<!--            placeholder="请输入"-->
+<!--            v-model.trim="params.sendNo"-->
+<!--          ></el-input>-->
+<!--        </el-form-item>-->
         <el-form-item label="审核状态:" prop="reviewStatus">
           <el-select v-model="params.reviewStatus" placeholder="请选择" class="w100" clearable>
             <el-option
@@ -43,7 +43,13 @@
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
-
+<!--        <el-form-item label="订单编码:" prop="orderNo">-->
+<!--          <el-input-->
+<!--            clearable-->
+<!--            placeholder="请输入"-->
+<!--            v-model.trim="params.orderNo"-->
+<!--          ></el-input>-->
+<!--        </el-form-item>-->
         <el-form-item label="客户名称:" prop="contactName">
           <el-input
             placeholder="请输入"
@@ -85,6 +91,7 @@ export default {
       contractId:'',
       docNo:'',
       orderId:'',
+      returnHandleNo:'',
       replied:null,
       reviewStatus:null
     };

+ 457 - 442
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -11,7 +11,7 @@
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
-        <div class="headbox" v-if="!contractId">
+        <div class="headbox" v-if="!contractId&&isShowAdd">
           <el-button
             size="small"
             type="primary"
@@ -36,7 +36,8 @@
               :underline="false"
               @click="downloadFile(link)"
             >
-              {{ link.name }}</el-link
+              {{ link.name }}
+            </el-link
             >
           </div>
         </el-form-item>
@@ -54,7 +55,8 @@
               :underline="false"
               @click="downloadFile(link)"
             >
-              {{ link.name }}</el-link
+              {{ link.name }}
+            </el-link
             >
           </div>
         </el-form-item>
@@ -72,7 +74,8 @@
               :underline="false"
               @click="downloadFile(link)"
             >
-              {{ link.name }}</el-link
+              {{ link.name }}
+            </el-link
             >
           </div>
         </el-form-item>
@@ -90,7 +93,8 @@
               :underline="false"
               @click="downloadFile(link)"
             >
-              {{ link.name }}</el-link
+              {{ link.name }}
+            </el-link
             >
           </div>
         </el-form-item>
@@ -115,9 +119,10 @@
           :prop="'datasource.' + scope.$index + '.totalCount'"
           :rules="[
             { required: true, message: '请输入数字', trigger: 'blur' },
-            { validator: validateTotalCount(scope.row), trigger: 'blur' }
+
           ]"
         >
+          <!--           { validator: validateTotalCount(scope.row), trigger: 'blur' }-->
           <el-input
             v-model="scope.row.totalCount"
             @input="(val) => changeNum(val, scope.$index)"
@@ -179,464 +184,474 @@
   </el-form>
 </template>
 <script>
-  import { emailReg, phoneReg, numberReg } from 'ele-admin';
-  import dictMixins from '@/mixins/dictMixins';
-  import productList from './product-list.vue';
-  import {
-    getWarehouseList,
-    getWarehouseOutStock
-  } from '@/api/saleManage/saleorder';
+import {emailReg, phoneReg, numberReg} from 'ele-admin';
+import dictMixins from '@/mixins/dictMixins';
+import productList from './product-list.vue';
+import {
+  getWarehouseList,
+  getWarehouseOutStock
+} from '@/api/saleManage/saleorder';
+
+import {copyObj} from '@/utils/util';
+import {getFile} from "@/api/system/file";
 
-  import { copyObj } from '@/utils/util';
-  import {getFile} from "@/api/system/file";
-  export default {
-    mixins: [dictMixins],
-    props: {
-      orderId: String
+export default {
+  mixins: [dictMixins],
+  props: {
+    orderId: String,
+    isShowAdd: {
+      type: Boolean,
+      default: true
+    }
+  },
+  components: {
+    productList
+  },
+  data() {
+    const defaultForm = {
+      key: null,
+      endTime: '',
+      isFirst: 0,
+      name: '',
+      startTime: '',
+      workHour: '',
+      technicalDrawings: []
+      // warehouseCode:"",
+      // warehouseId:'',
+      // warehouseName:'',
+    };
+    return {
+      discountTotalPrice: 0.0,
+      allPrice: 0.0,
+      numberReg,
+      defaultForm,
+      warehouseList: [],
+      form: {
+        datasource: []
+      },
+      rules: {},
+
+      columns: [
+        {
+          width: 45,
+          type: 'index',
+          columnKey: 'index',
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          width: 200,
+          prop: 'productName',
+          label: '名称',
+          slot: 'productName'
+        },
+        {
+          width: 120,
+          prop: 'productCode',
+          label: '编码',
+          slot: 'productCode'
+        },
+        {
+          width: 200,
+          prop: 'productCategoryName',
+          label: '类型',
+          slot: 'productCategoryName'
+        },
+        {
+          width: 160,
+          prop: 'productBrand',
+          label: '牌号',
+          slot: 'productBrand'
+        },
+        {
+          width: 120,
+          prop: 'modelType',
+          label: '型号',
+          slot: 'modelType'
+        },
+        {
+          width: 120,
+          prop: 'specification',
+          label: '规格',
+          slot: 'specification'
+        },
+        {
+          width: 200,
+          prop: 'customerMark',
+          label: '客户代号',
+          slot: 'customerMark'
+        },
+        {
+          width: 200,
+          prop: 'warehouseId',
+          label: '仓库名称',
+          slot: 'warehouseId',
+          headerSlot: 'headerWarehouseId'
+        },
+        {
+          width: 100,
+          prop: 'warehouseNum',
+          label: '库存',
+          slot: 'warehouseNum'
+        },
+        {
+          width: 120,
+          prop: 'totalCount',
+          label: '发货数量',
+          slot: 'totalCount',
+          headerSlot: 'headerTotalCount'
+        },
+        // {
+        //   width: 120,
+        //   prop: 'orderTotalCount',
+        //   label: '总数量',
+        //   slot: 'orderTotalCount'
+        // },
+        {
+          width: 80,
+          prop: 'measuringUnit',
+          label: '计量单位',
+          slot: 'measuringUnit'
+        },
+        {
+          width: 160,
+          prop: 'singlePrice',
+          label: '单价',
+          slot: 'singlePrice'
+        },
+        {
+          width: 120,
+          prop: 'totalPrice',
+          label: '合计',
+          slot: 'totalPrice'
+        },
+        {
+          width: 120,
+          prop: 'singleWeight',
+          label: '单重',
+          slot: 'singleWeight'
+        },
+        {
+          width: 120,
+          prop: 'totalWeight',
+          label: '总重',
+          slot: 'totalWeight'
+        },
+        {
+          width: 120,
+          prop: 'weightUnit',
+          label: '重量单位',
+          slot: 'weightUnit'
+        },
+        // {
+        //   width: 80,
+        //   prop: 'deliveryDays',
+        //   label: '交期(天)',
+        //   slot: 'deliveryDays'
+        // },
+        // {
+        //   width: 160,
+        //   prop: 'deliveryDeadline',
+        //   label: '交期截止日期',
+        //   slot: 'deliveryDeadline',
+        //   show: this.isDeliveryDeadline
+        // },
+        {
+          width: 160,
+          prop: 'customerExpectDeliveryDeadline',
+          label: '客户期望交期',
+          slot: 'customerExpectDeliveryDeadline',
+          headerSlot: 'headerCustomerExpectDeliveryDeadline'
+        },
+        {
+          width: 160,
+          prop: 'produceDeliveryDeadline',
+          label: '生产交付交期',
+          slot: 'produceDeliveryDeadline'
+        },
+        {
+          width: 200,
+          prop: 'guaranteePeriod',
+          label: '质保期',
+          slot: 'guaranteePeriod',
+          formatter: (_row, _column, cellValue) => {
+            return (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName;
+          }
+        },
+        {
+          width: 160,
+          prop: 'guaranteePeriodDeadline',
+          label: '质保截止日期'
+        },
+        {
+          width: 240,
+          prop: 'customerReqFiles',
+          label: '客户需求',
+          slot: 'customerReqFiles'
+        },
+        {
+          width: 130,
+          prop: 'technicalAnswerName',
+          label: '技术答疑人',
+          slot: 'technicalAnswerName'
+        },
+        {
+          width: 220,
+          prop: 'technicalParams',
+          label: '技术参数',
+          slot: 'technicalParams'
+        },
+        {
+          width: 240,
+          prop: 'technicalDrawings',
+          label: '技术图纸',
+          slot: 'technicalDrawings'
+        },
+        {
+          width: 240,
+          prop: 'industryArtFiles',
+          label: '工艺附件',
+          slot: 'industryArtFiles'
+        },
+        {
+          width: 240,
+          prop: 'otherFiles',
+          label: '其他附件',
+          slot: 'otherFiles'
+        },
+        {
+          width: 220,
+          prop: 'remark',
+          label: '备注',
+          slot: 'remark'
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 120,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          fixed: 'right',
+          showOverflowTooltip: true
+        }
+      ]
+    };
+  },
+  created() {
+    getWarehouseList().then((res) => {
+      this.warehouseList = res;
+    });
+  },
+  computed: {
+    canHandl() {
+      return this.form.datasource.length;
     },
-    components: {
-      productList
+    contractId() {
+      return this.$store.state.order.contractId;
+    }
+  },
+  methods: {
+    downloadFile(file) {
+      getFile({objectName: file.storePath}, file.name);
     },
-    data() {
-      const defaultForm = {
-        key: null,
-        endTime: '',
-        isFirst: 0,
-        name: '',
-        startTime: '',
-        workHour: '',
-        technicalDrawings: []
-        // warehouseCode:"",
-        // warehouseId:'',
-        // warehouseName:'',
-      };
-      return {
-        discountTotalPrice: 0.0,
-        allPrice: 0.0,
-        numberReg,
-        defaultForm,
-        warehouseList: [],
-        form: {
-          datasource: []
-        },
-        rules: {},
+    async warehouseChange(index, row) {
+      let warehouseIds =
+        this.form.datasource
+          .filter(
+            (item, i) => row.productCode == item.productCode && index != i
+          )
+          .map((item) => item.warehouseId) || [];
+      const data = this.warehouseList.find(
+        (item) => item.id == row.warehouseId
+      );
+      if (warehouseIds.length > 0 && warehouseIds.includes(row.warehouseId)) {
+        row.warehouseId = '';
+        return this.$message.error('同一个产品不能选择相同的仓库');
+      }
 
-        columns: [
-          {
-            width: 45,
-            type: 'index',
-            columnKey: 'index',
-            align: 'center',
-            fixed: 'left'
-          },
-          {
-            width: 200,
-            prop: 'productName',
-            label: '名称',
-            slot: 'productName'
-          },
-          {
-            width: 120,
-            prop: 'productCode',
-            label: '编码',
-            slot: 'productCode'
-          },
-          {
-            width: 200,
-            prop: 'productCategoryName',
-            label: '类型',
-            slot: 'productCategoryName'
-          },
-          {
-            width: 160,
-            prop: 'productBrand',
-            label: '牌号',
-            slot: 'productBrand'
-          },
-          {
-            width: 120,
-            prop: 'modelType',
-            label: '型号',
-            slot: 'modelType'
-          },
-          {
-            width: 120,
-            prop: 'specification',
-            label: '规格',
-            slot: 'specification'
-          },
-          {
-            width: 200,
-            prop: 'customerMark',
-            label: '客户代号',
-            slot: 'customerMark'
-          },
-          {
-            width: 200,
-            prop: 'warehouseId',
-            label: '仓库名称',
-            slot: 'warehouseId',
-            headerSlot: 'headerWarehouseId'
-          },
-          {
-            width: 100,
-            prop: 'warehouseNum',
-            label: '库存',
-            slot: 'warehouseNum'
-          },
-          {
-            width: 120,
-            prop: 'totalCount',
-            label: '发货数量',
-            slot: 'totalCount',
-            headerSlot: 'headerTotalCount'
-          },
-          {
-            width: 120,
-            prop: 'orderTotalCount',
-            label: '总数量',
-            slot: 'orderTotalCount'
-          },
-          {
-            width: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit'
-          },
-          {
-            width: 160,
-            prop: 'singlePrice',
-            label: '单价',
-            slot: 'singlePrice'
-          },
-          {
-            width: 120,
-            prop: 'totalPrice',
-            label: '合计',
-            slot: 'totalPrice'
-          },
-          {
-            width: 120,
-            prop: 'singleWeight',
-            label: '单重',
-            slot: 'singleWeight'
-          },
-          {
-            width: 120,
-            prop: 'totalWeight',
-            label: '总重',
-            slot: 'totalWeight'
-          },
-          {
-            width: 120,
-            prop: 'weightUnit',
-            label: '重量单位',
-            slot: 'weightUnit'
-          },
-          // {
-          //   width: 80,
-          //   prop: 'deliveryDays',
-          //   label: '交期(天)',
-          //   slot: 'deliveryDays'
-          // },
-          // {
-          //   width: 160,
-          //   prop: 'deliveryDeadline',
-          //   label: '交期截止日期',
-          //   slot: 'deliveryDeadline',
-          //   show: this.isDeliveryDeadline
-          // },
-          {
-            width: 160,
-            prop: 'customerExpectDeliveryDeadline',
-            label: '客户期望交期',
-            slot: 'customerExpectDeliveryDeadline',
-            headerSlot: 'headerCustomerExpectDeliveryDeadline'
-          },
-          {
-            width: 160,
-            prop: 'produceDeliveryDeadline',
-            label: '生产交付交期',
-            slot: 'produceDeliveryDeadline'
-          },
-          {
-            width: 200,
-            prop: 'guaranteePeriod',
-            label: '质保期',
-            slot: 'guaranteePeriod',
-            formatter: (_row, _column, cellValue) => {
-              return (_row.guaranteePeriod||'') + _row.guaranteePeriodUnitName;
-            }
-          },
-          {
-            width: 160,
-            prop: 'guaranteePeriodDeadline',
-            label: '质保截止日期'
-          },
-          {
-            width: 240,
-            prop: 'customerReqFiles',
-            label: '客户需求',
-            slot: 'customerReqFiles'
-          },
-          {
-            width: 130,
-            prop: 'technicalAnswerName',
-            label: '技术答疑人',
-            slot: 'technicalAnswerName'
-          },
-          {
-            width: 220,
-            prop: 'technicalParams',
-            label: '技术参数',
-            slot: 'technicalParams'
-          },
-          {
-            width: 240,
-            prop: 'technicalDrawings',
-            label: '技术图纸',
-            slot: 'technicalDrawings'
-          },
-          {
-            width: 240,
-            prop: 'industryArtFiles',
-            label: '工艺附件',
-            slot: 'industryArtFiles'
-          },
-          {
-            width: 240,
-            prop: 'otherFiles',
-            label: '其他附件',
-            slot: 'otherFiles'
-          },
-          {
-            width: 220,
-            prop: 'remark',
-            label: '备注',
-            slot: 'remark'
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 120,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            fixed: 'right',
-            showOverflowTooltip: true
-          }
-        ]
+      this.$set(this.form.datasource[index], 'warehouseName', data.name);
+      this.$set(this.form.datasource[index], 'warehouseCode', data.code);
+      const warehouseOutStock = await getWarehouseOutStock({
+        warehouseId: data.id,
+        code: row.productCode
+      });
+      this.$set(
+        this.form.datasource[index],
+        'warehouseNum',
+        warehouseOutStock
+      );
+    },
+
+    //修改数量更新合计
+    changeNum(val, index) {
+      this.$set(
+        this.form.datasource[index],
+        'totalPrice',
+        (Number(this.form.datasource[index].singlePrice) * val).toFixed(2)
+      );
+    },
+    //选择产品回调
+    changeParent(obj, idx) {
+      obj.orderTotalCount = obj.totalCount;
+      obj.id = '';
+      this.$set(
+        this.form.datasource,
+        this.form.datasource.length,
+        copyObj(obj)
+      );
+    },
+    validateTotalCount(row) {
+      return (rule, value, callback) => {
+        if (isNaN(value) || Number(value) <= 0) {
+          this.$message.error('请输入大于0的数');
+          callback(new Error('请输入大于0的数字'));
+        } else if (Number(value) > row.warehouseNum) {
+          // this.$message.error('输入的数字不能大于仓库物品数');
+          // callback(new Error('输入的数字不能大于仓库物品数'));
+          callback();
+        } else if (Number(value) > row.orderTotalCount) {
+          this.$message.error('输入的数字不能大于最大发货值');
+          callback(new Error('输入的数字不能大于最大发货值'));
+        } else {
+          callback();
+        }
       };
     },
-    created() {
-      getWarehouseList().then((res) => {
-        this.warehouseList = res;
+    // 返回列表数据
+    getTableValue() {
+      let comitDatasource = this.form.datasource;
+      if (comitDatasource.length === 0) return [];
+      comitDatasource.forEach(async (v) => {
+        v.totalCount = Number(v.totalCount);
+        v.technicalDrawings = Array.isArray(v.technicalDrawings)
+          ? v.technicalDrawings
+          : [];
+        v.customerReqFiles = Array.isArray(v.customerReqFiles)
+          ? v.customerReqFiles
+          : [];
+        v.industryArtFiles = v.industryArtFiles || [];
+        v.otherFiles = v.otherFiles || [];
       });
+      return comitDatasource;
     },
-    computed: {
-      canHandl() {
-        return this.form.datasource.length;
-      },
-      contractId() {
-        return this.$store.state.order.contractId;
-      }
+    getPrice() {
+      return [this.allPrice];
     },
-    methods: {
-      downloadFile(file) {
-        getFile({ objectName: file.storePath }, file.name);
-      },
-      async warehouseChange(index, row) {
-        let warehouseIds =
-          this.form.datasource
-            .filter(
-              (item, i) => row.productCode == item.productCode && index != i
-            )
-            .map((item) => item.warehouseId) || [];
-        const data = this.warehouseList.find(
-          (item) => item.id == row.warehouseId
-        );
-        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);
-        const warehouseOutStock = await getWarehouseOutStock({
-          warehouseId: data.id,
-          code: row.productCode
-        });
-        this.$set(
-          this.form.datasource[index],
-          'warehouseNum',
-          warehouseOutStock
-        );
-      },
-
-      //修改数量更新合计
-      changeNum(val, index) {
-        this.$set(
-          this.form.datasource[index],
-          'totalPrice',
-          (Number(this.form.datasource[index].singlePrice) * val).toFixed(2)
-        );
-      },
-      //选择产品回调
-      changeParent(obj, idx) {
-        obj.orderTotalCount = obj.totalCount;
-        obj.id = '';
-        this.$set(
-          this.form.datasource,
-          this.form.datasource.length,
-          copyObj(obj)
-        );
-      },
-      validateTotalCount(row) {
-        return (rule, value, callback) => {
-          if (isNaN(value) || Number(value) <= 0) {
-            this.$message.error('请输入大于0的数');
-            callback(new Error('请输入大于0的数字'));
-          } else if (Number(value) > row.warehouseNum) {
-            // this.$message.error('输入的数字不能大于仓库物品数');
-            // callback(new Error('输入的数字不能大于仓库物品数'));
-            callback();
-          } else if (Number(value) > row.orderTotalCount) {
-            this.$message.error('输入的数字不能大于最大发货值');
-            callback(new Error('输入的数字不能大于最大发货值'));
-          } else {
-            callback();
+    //修改回显
+    putTableValue(data) {
+      if (data) {
+        this.form.datasource = data;
+        data.forEach(async (item, index) => {
+          if (item.warehouseId) {
+            this.$set(
+              this.form.datasource[index],
+              'warehouseNum',
+              await getWarehouseOutStock({
+                warehouseId: item.warehouseId,
+                code: item.productCode
+              })
+            );
           }
-        };
-      },
-      // 返回列表数据
-      getTableValue() {
-        let comitDatasource = this.form.datasource;
-        if (comitDatasource.length === 0) return [];
-        comitDatasource.forEach(async (v) => {
-          v.totalCount = Number(v.totalCount);
-          v.technicalDrawings = Array.isArray(v.technicalDrawings)
-            ? v.technicalDrawings
-            : [];
-          v.customerReqFiles = Array.isArray(v.customerReqFiles)
-            ? v.customerReqFiles
-            : [];
-          v.industryArtFiles = v.industryArtFiles || [];
-          v.otherFiles = v.otherFiles || [];
         });
-        return comitDatasource;
-      },
-      getPrice() {
-        return [this.allPrice];
-      },
-
-      //修改回显
-      putTableValue(data) {
-        if (data) {
-          this.form.datasource = data;
-          data.forEach(async (item, index) => {
-            if (item.warehouseId) {
-              this.$set(
-                this.form.datasource[index],
-                'warehouseNum',
-                await getWarehouseOutStock({
-                  warehouseId: item.warehouseId,
-                  code: item.productCode
-                })
-              );
-            }
-          });
-        }
-      },
-      //选择产品
-      handParent(row, index) {
-        let item = {
-          id: row.productCode
-        };
-        this.$refs.productListRef.open(item, index);
-      },
-      //选择技术人回调
-      changeAnswer(obj, idx) {
-        this.$set(this.form.datasource[idx], 'technicalAnswerId', obj.id);
-        this.$set(this.form.datasource[idx], 'technicalAnswerName', obj.name);
-      },
-      handHead(row, index) {
-        let item = {
-          id: row.technicalAnswerId
-        };
-        this.$refs.headRef.open(item, index);
-      },
+      }
+    },
+    //选择产品
+    handParent(row, index) {
+      let item = {
+        id: row.productCode
+      };
+      this.$refs.productListRef.open(item, index);
+    },
+    //选择技术人回调
+    changeAnswer(obj, idx) {
+      this.$set(this.form.datasource[idx], 'technicalAnswerId', obj.id);
+      this.$set(this.form.datasource[idx], 'technicalAnswerName', obj.name);
+    },
+    handHead(row, index) {
+      let item = {
+        id: row.technicalAnswerId
+      };
+      this.$refs.headRef.open(item, index);
+    },
 
-      remove(i) {
-        this.form.datasource.splice(i, 1);
-        this.setSort();
-      },
-      // 清空表格
-      restTable() {
-        this.form.datasource = [];
-      },
-      // 重新排序
-      setSort() {
-        this.form.datasource.forEach((n, index) => {
-          n.key = index + 1;
-        });
-      },
-      // 添加
-      handlAdd() {
-        if (!this.orderId) return this.$message.error('请先选择订单');
-        this.$refs.productListRef.open(this.form.datasource);
-      },
+    remove(i) {
+      this.form.datasource.splice(i, 1);
+      this.setSort();
+    },
+    // 清空表格
+    restTable() {
+      this.form.datasource = [];
+    },
+    // 重新排序
+    setSort() {
+      this.form.datasource.forEach((n, index) => {
+        n.key = index + 1;
+      });
+    },
+    // 添加
+    handlAdd() {
+      if (!this.orderId) return this.$message.error('请先选择订单');
+      this.$refs.productListRef.open(this.form.datasource);
+    },
 
-      validateForm(callback) {
-        //开始表单校验
-        this.$refs.form.validate((valid) => {
-          callback(valid);
-        });
-      }
+    validateForm(callback) {
+      //开始表单校验
+      this.$refs.form.validate((valid) => {
+        callback(valid);
+      });
     }
-  };
+  }
+};
 </script>
 <style lang="scss" scoped>
-  .headbox {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    .amount {
-      font-size: 14px;
-      font-weight: bold;
-      padding-right: 30px;
-    }
-  }
-  .time-form .el-form-item {
-    margin-bottom: 0 !important;
+.headbox {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
+    padding-right: 30px;
   }
+}
 
-  ::v-deep .period {
-    display: flex;
-    .borderleftnone {
-      .el-input--medium .el-input__inner {
-        border-top-right-radius: 0;
-        border-bottom-right-radius: 0;
-      }
-    }
-    .borderrightnone {
-      .el-input--medium .el-input__inner {
-        border-top-left-radius: 0;
-        border-bottom-left-radius: 0;
-      }
+.time-form .el-form-item {
+  margin-bottom: 0 !important;
+}
+
+::v-deep .period {
+  display: flex;
+
+  .borderleftnone {
+    .el-input--medium .el-input__inner {
+      border-top-right-radius: 0;
+      border-bottom-right-radius: 0;
     }
   }
 
-  ::v-deep .time-form tbody > tr:hover > td {
-    background-color: transparent !important;
-  }
-  ::v-deep .time-form .el-table tr {
-    background-color: #ffffff;
+  .borderrightnone {
+    .el-input--medium .el-input__inner {
+      border-top-left-radius: 0;
+      border-bottom-left-radius: 0;
+    }
   }
+}
 
-  .pricebox {
-    display: flex;
-    justify-content: flex-start;
-    align-items: center;
-    font-weight: bold;
-  }
+::v-deep .time-form tbody > tr:hover > td {
+  background-color: transparent !important;
+}
+
+::v-deep .time-form .el-table tr {
+  background-color: #ffffff;
+}
+
+.pricebox {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  font-weight: bold;
+}
 </style>

+ 13 - 6
src/views/saleManage/saleOrder/returnGoods/components/detailDialog.vue

@@ -197,9 +197,9 @@
       ></inventoryTabledetail>
     </div>
 
-    <bpmDetail v-if="activeComp==='bpm'&&form.processInstanceId" :id="form.processInstanceId"></bpmDetail>
-    <customerReturnOrderDetail v-if="activeComp==='cMain'" :row='form'></customerReturnOrderDetail>
-    <bpmDetail v-if="activeComp==='cBpm'&&data.processInstanceId" :id="data.processInstanceId"></bpmDetail>
+    <bpmDetail :key="activeComp" v-if="activeComp==='bpm'&&form.processInstanceId" :id="form.processInstanceId"></bpmDetail>
+    <customerReturnOrderDetail v-if="activeComp==='cMain'" :row='data'></customerReturnOrderDetail>
+    <bpmDetail :key="activeComp" v-if="activeComp==='cBpm'&&data.processInstanceId" :id="data.processInstanceId"></bpmDetail>
     <div slot="footer" class="footer">
       <el-button @click="cancel">返回</el-button>
     </div>
@@ -231,8 +231,8 @@ export default {
       tabOptions: [
         {key: 'main', name: '退货单详情'},
         {key: 'bpm', name: '流程详情'},
-        {key: 'cMain', name: '客户退货单详情'},
-        {key: 'cBpm', name: '客户退货单流程详情'},
+        {key: 'cMain', name: '退货处理单详情'},
+        {key: 'cBpm', name: '退货处理单流程详情'},
       ],
       codeData: [],
       reviewStatusEnum,
@@ -379,12 +379,17 @@ export default {
       this.codeData = res.data;
     },
     async open(row) {
-      this.form = row;
+      //this.form = row;
       this.visible = true;
       this.getDetailData(row.id);
       this.detailId = row.id;
       if(row.handleReceiptId){
         this.data = await saleReturnGetByIdAPI(row.handleReceiptId)
+        this.data = {
+          processInstanceId:this.data.processInstanceId,
+          handleReceiptId:this.data.id,
+          sendNo:this.data.sendNo
+        }
       }
     },
 
@@ -406,6 +411,8 @@ export default {
       await this.getcode('sale_return_type');
       const data = await getReturnSaleOrderrecordDetail(id);
       this.loading = false;
+      this.form = data
+      console.log(data);
       if (data) {
         this.$nextTick(() => {
           this.$refs.inventoryTabledetailRef &&

+ 6 - 6
src/views/saleManage/saleOrder/returnGoods/index.vue

@@ -79,7 +79,7 @@
               icon="el-icon-edit"
               @click="handleCreateCROrder('add', row)"
               v-if="[1].includes(row.canCreateHandleReceipt)&&!row.handleReceiptId">
-             退货处理
+              退货处理
             </el-link>
             <el-link
               type="primary"
@@ -299,8 +299,8 @@ export default {
     //批量删除
     allDelBtn() {
       if (this.selection.length === 0) return;
-      let flag =  this.selection.some(item=>[1,2].includes(item.reviewStatus))
-      if(flag) return this.$message.warning('抱歉已审核、审核中的数据不能删除,请检查')
+      let flag = this.selection.some(item => [1, 2].includes(item.reviewStatus))
+      if (flag) return this.$message.warning('抱歉已审核、审核中的数据不能删除,请检查')
       this.delVisible = true;
     },
 
@@ -326,10 +326,10 @@ export default {
       });
     },
     //创建/修改客户退货单
-    handleCreateCROrder(type,row){
+    handleCreateCROrder(type, row) {
       this.customerReturnOrderDialogFlag = true
-      this.$nextTick(()=>{
-        this.$refs.customerReturnOrderDialogRef.init(type,row)
+      this.$nextTick(() => {
+        this.$refs.customerReturnOrderDialogRef.init(type, row)
       })
     },
     //查看详情