فهرست منبع

'报价单提交'

zhujun 2 سال پیش
والد
کامیت
052515f71b
24فایلهای تغییر یافته به همراه4355 افزوده شده و 203 حذف شده
  1. 61 0
      src/api/saleManage/returnGoods.js
  2. 71 0
      src/api/saleManage/saleordersendrecord.js
  3. 8 1
      src/enum/dict.js
  4. 1 1
      src/store/modules/order.js
  5. 2 2
      src/views/contractManage/contractBook/components/detailDialog.vue
  6. 39 13
      src/views/saleManage/quotation/components/addDialog.vue
  7. 8 0
      src/views/saleManage/quotation/components/detailDialog.vue
  8. 103 10
      src/views/saleManage/saleOrder/components/addDialog.vue
  9. 95 60
      src/views/saleManage/saleOrder/components/detailDialog.vue
  10. 1 1
      src/views/saleManage/saleOrder/components/inventoryTable.vue
  11. 30 25
      src/views/saleManage/saleOrder/components/searchTable.vue
  12. 114 90
      src/views/saleManage/saleOrder/index.vue
  13. 417 0
      src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue
  14. 380 0
      src/views/saleManage/saleOrder/invoice/components/detailDialog.vue
  15. 498 0
      src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue
  16. 240 0
      src/views/saleManage/saleOrder/invoice/components/orderListDialog.vue
  17. 233 0
      src/views/saleManage/saleOrder/invoice/components/product-list.vue
  18. 127 0
      src/views/saleManage/saleOrder/invoice/components/searchTable.vue
  19. 293 0
      src/views/saleManage/saleOrder/invoice/index.vue
  20. 582 0
      src/views/saleManage/saleOrder/returnGoods/components/addInvoiceDialog.vue
  21. 381 0
      src/views/saleManage/saleOrder/returnGoods/components/detailDialog.vue
  22. 240 0
      src/views/saleManage/saleOrder/returnGoods/components/orderListDialog.vue
  23. 127 0
      src/views/saleManage/saleOrder/returnGoods/components/searchTable.vue
  24. 304 0
      src/views/saleManage/saleOrder/returnGoods/index.vue

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

@@ -0,0 +1,61 @@
+import request from '@/utils/request';
+import { download } from '@/utils/file';
+/**
+ * 获取信息列表
+ */
+export async function getReturnTableList(params) {
+  const res = await request.get(`/eom/saleorderreturnrecord/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取信息详情
+ */
+export async function getReturnSaleOrderrecordDetail(id) {
+  const res = await request.get(`/eom/saleorderreturnrecord/getById/${id}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新信息
+ */
+export async function UpdateReturnInformation(data) {
+  const res = await request.put(`/eom/saleorderreturnrecord/update`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 新增信息
+ */
+export async function addReturnInformation(data) {
+  const res = await request.post(`/eom/saleorderreturnrecord/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 删除
+ */
+export async function deleteReturnInformation(data) {
+  const res = await request.delete('/eom/saleorderreturnrecord/delete', { data });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+
+

+ 71 - 0
src/api/saleManage/saleordersendrecord.js

@@ -0,0 +1,71 @@
+import request from '@/utils/request';
+import { download } from '@/utils/file';
+/**
+ * 获取信息列表
+ */
+export async function getSendTableList(params) {
+  const res = await request.get(`/eom/saleordersendrecord/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取信息详情
+ */
+export async function getSendSaleOrderrecordDetail(id) {
+  const res = await request.get(`/eom/saleordersendrecord/getById/${id}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新信息
+ */
+export async function UpdateSendInformation(data) {
+  const res = await request.put(`/eom/saleordersendrecord/update`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 新增信息
+ */
+export async function addSendInformation(data) {
+  const res = await request.post(`/eom/saleordersendrecord/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 删除
+ */
+export async function deleteSendInformation(data) {
+  const res = await request.delete('/eom/saleordersendrecord/delete', { data });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+
+
+/**
+ * 通过销售发货获取发货清单
+ */
+export async function getProductListByRecordId(recordId) {
+    const res = await request.get(`/eom/saleordersendrecord/getProductListByRecordId/${recordId}`, {});
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }

+ 8 - 1
src/enum/dict.js

@@ -20,7 +20,6 @@ export default {
   客户状态: 'contact_status',
   企业类型: 'company_category',
   结算方式: 'settlement_mode',
-  付款方式: 'pay_way',
   商机来源:'business_opport_code',
   影响力:'influence_level_code',
   态度:'attittude_code',
@@ -81,3 +80,11 @@ export const payStatusOptions=[
   {value:2,label:'已付款'}
 ]
 
+
+//发货审核状态
+export const reviewStatusEnum=[
+  {value:0,label:'未提交'},
+  {value:1,label:'待审核'},
+  {value:2,label:'已审核'},
+  {value:3,label:'审核未通过'}
+]

+ 1 - 1
src/store/modules/order.js

@@ -3,7 +3,7 @@ import Vue from 'vue';
 const state = {allcountAmount:0.00,contractId:''};
 
 const mutations = {
-   // 设置应付金额
+   // 设置金额
    setAllcountAmount(state, val) {
     state.allcountAmount = val;
   },

+ 2 - 2
src/views/contractManage/contractBook/components/detailDialog.vue

@@ -191,7 +191,7 @@
 
 
        
-        <headerTitle title="报价单产品清单"></headerTitle>
+        <headerTitle title="产品清单"></headerTitle>
         <ele-pro-table ref="table" :needPage="false" :columns="competAnalysisListcolumns"  :toolkit="[]" :datasource="detailData.productList" row-key="id">
           <template v-slot:toolbar>
         <div class="headbox">
@@ -443,7 +443,7 @@
           this.loading = false;
           if (data) {
             this.detailData = data;
-            
+            this.form = data.contractVO;
           }
         },
   

+ 39 - 13
src/views/saleManage/quotation/components/addDialog.vue

@@ -27,6 +27,20 @@
                 placeholder="请输入"
               />
             </el-form-item>
+            <el-form-item
+              label="关联商机"
+              prop="opportunityId"
+              style="margin-bottom: 22px"
+            >
+               <el-select v-model="form.opportunityId" placeholder="请选择"  >
+                 <el-option
+                   v-for="item in businessList"
+                   :key="item.id"
+                   :label="item.name"
+                   :value="item.id">
+                 </el-option>
+               </el-select>
+            </el-form-item>
             <el-form-item
               label="询价方联系人"
               prop="contactLinkName"
@@ -202,11 +216,11 @@
             </el-col>
             <el-col :span="6">
             <el-form-item
-              label="付款方式"
-              prop="payWay"
+              label="结算方式"
+              prop="settlementMode"
               style="margin-bottom: 22px"
             >
-            <DictSelection dictName="付款方式" clearable v-model="form.payWay">
+            <DictSelection dictName="结算方式" clearable v-model="form.settlementMode">
                 </DictSelection>
             </el-form-item>
           </el-col>
@@ -250,6 +264,7 @@ import deptSelect from '@/components/CommomSelect/dept-select.vue';
 import personSelect from '@/components/CommomSelect/person-select.vue';
 import parentList from '@/views/saleManage/contact/components/parentList.vue'
 import { getDetail, UpdateInformation, addInformation,deleteInformation,updateStatus} from '@/api/saleManage/quotation';
+import {getTableList} from '@/api/saleManage/businessOpportunity';
 import {getcontactlink} from '@/api/saleManage/businessFollow';
 import headList from '@/views/saleManage/businessOpportunity/components/headList.vue'
 import {copyObj} from '@/utils/util';
@@ -274,6 +289,7 @@ export default {
           acceptUnpack: null,
           askFile: null,
           contactAddress: '',
+          opportunityId:'',
           contactEmail: '',
           contactFax: '',
           contactId: '',
@@ -282,8 +298,8 @@ export default {
           contactName:'',
           contactTel:'',
           deliveryDate:'',
-          payWay:'',
-          payWayName:'',
+          settlementMode:'',
+          settlementModeName:'',
           quoteAddress:'',
           quoteEmail:'',
           quoteFax:'',
@@ -310,7 +326,7 @@ export default {
         // removeLinkList: [],
         tableBankData: [],
         tableLinkData: [],
-     
+        businessList:[],    //商机列表
         rules: {
           contactName: [
             { required: true, message: '请选择客户', trigger: 'change' }
@@ -330,11 +346,8 @@ export default {
           deliveryDate: [
             { required: true, message: '请选择交货日期', trigger: 'change' }
           ],
-          payWay: [
-            { required: true, message: '请选择付款方式', trigger: 'change' }
-          ],
-          payWayName: [
-            { required: true, message: '请输入报价方名称', trigger: 'blur' }
+          settlementMode: [
+            { required: true, message: '请选择结算方式', trigger: 'change' }
           ],
           quoteLinkName: [
             { required: true, message: '请输入报价方联系人', trigger: 'change' }
@@ -387,6 +400,7 @@ export default {
            }
             this.$refs.inventoryTable&&this.$refs.inventoryTable.putTableValue(data.quoteProductList)
             this.getLinkInfo(data.contactId)
+            this.getBusinessList(data.contactName)
           })
           
           
@@ -406,6 +420,17 @@ export default {
     return this.$message.error('请先选择名称')
    }
     },
+    //获取客户的商机列表
+    async getBusinessList(name){
+      if(!this.form.contactName) return this.$message.error('请先选择询价方名称')
+      const data = await getTableList({
+          pageNum: 1,
+          size: 30,
+          contactName:name
+        });
+        console.log(data,'3333')
+        this.businessList=data.list
+    },
     //选择下拉框
     onchangeLink(selectedOptions){
       const option = this.linkNameOptions.find(opt => opt.id === selectedOptions);
@@ -440,6 +465,7 @@ export default {
          contactTel:''
         })
       this.getLinkInfo(obj.id)
+      this.getBusinessList(obj.name)
       },
     
       
@@ -521,14 +547,14 @@ export default {
         if (!this.isUpdate) {
           delete this.form.id;
         } 
-        let payWayName=this.getDictValue('付款方式', this.form.payWay);
+        let settlementModeName=this.getDictValue('结算方式', this.form.settlementMode);
 
         if(this.form.askFile && this.form.askFile.length > 0){
           this.form.askFile = this.form.askFile[0];
         } else {
           this.form.askFile = null;
         }
-        let commitData=Object.assign({},this.form,{payWayName,
+        let commitData=Object.assign({},this.form,{settlementModeName,
           quoteProductList:this.$refs.inventoryTable.getTableValue(),
           totalPrice:this.$refs.inventoryTable.getTotalPrice()})
         if (this.isUpdate) {

+ 8 - 0
src/views/saleManage/quotation/components/detailDialog.vue

@@ -32,6 +32,13 @@
            >
            {{form.contactName}}
            </el-form-item>
+           <el-form-item
+             label="关联商机名称"
+             prop="opportunityName"
+             style="margin-bottom: 22px"
+           >
+           {{detailData.opportunityName}}
+           </el-form-item>
            <el-form-item
              label="询价方联系人"
              prop="contactLinkName"
@@ -39,6 +46,7 @@
            >
            {{form.contactLinkName}}
            </el-form-item>
+           
            <el-form-item
              label="询价方电话"
              prop="contactTel"

+ 103 - 10
src/views/saleManage/saleOrder/components/addDialog.vue

@@ -34,7 +34,22 @@
                  </DictSelection>
              </el-form-item>
            
-        
+             <el-form-item
+                label="销售部门"
+                prop="salesDeptId"
+                style="margin-bottom: 22px"
+              >
+                <ele-tree-select
+                  clearable
+                  :data="groupTreeData"
+                  v-model="form.salesDeptId"
+                  valueKey="id"
+                  labelKey="name"
+                  placeholder="请选择"
+                  @change="change_principalDep"
+                  default-expand-all
+                />
+              </el-form-item>
             <el-form-item prop="orderFiles" label="订单附件">
                 <fileUpload
                   v-model="form.orderFiles"
@@ -49,12 +64,14 @@
                label="选择合同"
                prop="contractName"
                style="margin-bottom: 22px;"
+              
              >
              <el-input
                 clearable
                 v-model="form.contractName"
-                placeholder="请输入"
                 @click.native="handleContractBtn"
+                @clear="clearContrcat"
+                placeholder="请输入"
               />
              </el-form-item>
              <el-form-item
@@ -68,6 +85,16 @@
                placeholder="选择日期">
              </el-date-picker>
             </el-form-item>
+            <el-form-item label="结算方式" prop="settlementMode">
+                <DictSelection
+                  dictName="结算方式"
+                  clearable
+                  @itemChange="settlementModeChange"
+                  v-model="form.settlementMode"
+                >
+                </DictSelection>
+              </el-form-item>
+             
            </el-col>
      </el-row>
       <headerTitle title="基本信息"></headerTitle>
@@ -86,6 +113,18 @@
                 placeholder="请选择"
               />
             </el-form-item>
+            <el-form-item
+              label="客户统一社会信用代码"
+              prop="partaUnifiedSocialCreditCode"
+              label-width="160px"
+              style="margin-bottom: 22px"
+            >
+              <el-input
+                clearable
+                v-model="form.partaUnifiedSocialCreditCode"
+                placeholder="请输入"
+              />
+            </el-form-item>
             <el-form-item
               label="客户联系人"
               prop="partaLinkName"
@@ -165,6 +204,18 @@
                 placeholder="请输入"
               />
             </el-form-item>
+            <el-form-item
+              label="售出方统一社会信用代码"
+              prop="partbUnifiedSocialCreditCode"
+              label-width="170px"
+              style="margin-bottom: 22px"
+            >
+              <el-input
+                clearable
+                v-model="form.partbUnifiedSocialCreditCode"
+                placeholder="请输入"
+              />
+            </el-form-item>
             <el-form-item
               label="售出方联系人"
               prop="partbLinkName"
@@ -308,6 +359,7 @@ import {getcontactlink} from '@/api/saleManage/businessFollow';
 import headList from '@/views/saleManage/businessOpportunity/components/headList.vue'
 import contractListDialog from './contractListDialog.vue'
 import paymentList from './paymentList.vue'
+import {listOrganizations} from '@/api/system/organization';
 import {copyObj} from '@/utils/util';
 
 
@@ -360,6 +412,7 @@ export default {
         };
    
       return {
+        clearing:false,   //是否清除合同
         payWayOptions:[],
         delDetailIds:[],
         linkNameOptions:[],
@@ -372,7 +425,9 @@ export default {
         form: copyObj(formDef),
         tableBankData: [],
         tableLinkData: [],
-     
+     // 组织机构树形结构数据
+       groupTreeData: [],
+       groupData:[],
         rules: {
           deliveryDate:[
             { required: true, message: '请选择交货日期', trigger: 'change' }
@@ -420,9 +475,26 @@ export default {
         return this.$store.state.order.allcountAmount
       }
     },
+    created () {
+      this.getGroupAll();
+    },
     methods: {
-   
-  
+    // 选择负责人部门
+    change_principalDep(id) {
+        const info = this.groupData.find(e => e.id == id);
+        this.form.salesDeptName = info.name;
+      },
+   // 获取公司数据
+   getGroupAll () {
+        listOrganizations().then((list) => {
+          this.groupData = list;
+          this.groupTreeData = this.$util.toTreeData({
+            data: list,
+            idField: 'id',
+            parentIdField: 'parentId'
+          });
+        });
+      },
   
     //选择供应商
     changeSupplier(obj) {
@@ -446,10 +518,11 @@ export default {
           this.$nextTick(()=>{
             let {contractVO}=data
            // this.form=contractVOform.receiveAddress
-           let {partaAddress,partaEmail,partaFax,partaId,partaLinkId,partaLinkName,partaName,partaTel,partbAddress,partbEmail,partbFax,partbId,partbLinkId,partbLinkName,partbName,partbTel,totalPrice,discountTotalPrice}=contractVO
-           this.form=Object.assign({},this.form,{partaAddress,partaEmail,partaFax,partaId,partaLinkId,partaLinkName,partaName,partaTel,partbAddress,partbEmail,partbFax,partbId,partbLinkId,partbLinkName,partbName,partbTel,totalPrice,discountTotalPrice,totalAmount:totalPrice,payAmount:discountTotalPrice,receiveAddress:partaAddress})
+           let {partaAddress,partaEmail,partaFax,partaId,partaLinkId,partaLinkName,partaName,partaTel,partbAddress,partbEmail,partbFax,partbId,partbLinkId,partbLinkName,partbName,partbTel,totalPrice,discountTotalPrice,partaUnifiedSocialCreditCode,partbUnifiedSocialCreditCode}=contractVO
+           this.form=Object.assign({},this.form,{partaAddress,partaEmail,partaFax,partaId,partaLinkId,partaLinkName,partaName,partaTel,partbAddress,partbEmail,partbFax,partbId,partbLinkId,partbLinkName,partbName,partbTel,totalPrice,discountTotalPrice,partaUnifiedSocialCreditCode,partbUnifiedSocialCreditCode,totalAmount:totalPrice,payAmount:discountTotalPrice,receiveAddress:partaAddress})
            this.getLinkInfo(partaId)
             this.$refs.inventoryTable&&this.$refs.inventoryTable.putTableValue(data.productList)
+           this.$store.commit('order/setAllcountAmount',totalPrice);
           
           })
           
@@ -460,13 +533,15 @@ export default {
       //获取订单详情
       async getSaleOrderDetail(id){
         this.loading = true;
-        const data = await getDetail(id);
+        const data = await getSaleOrderDetail(id);
         this.loading = false;
         if (data) {
           this.$nextTick(()=>{
             this.form = data;
             this.$refs.inventoryTable&&this.$refs.inventoryTable.putTableValue(data.productList)
             this.getLinkInfo(data.partaId)
+            this.$store.commit('order/setAllcountAmount',data.totalAmount);
+            this.$store.commit('order/setContractId',data.contractId);
           })
           
           
@@ -535,7 +610,7 @@ export default {
         this.form = Object.assign({},this.form,{
           contractId: obj.id,
           contractName: obj.contractName,
-          contractNo:obj.contractNo
+          contractNo:obj.contractNo,
         })
         this.getDetailData(obj.id)
         this.$store.commit('order/setContractId',obj.id);
@@ -545,12 +620,30 @@ export default {
 
     //选择合同弹框
     handleContractBtn(){
+      console.log('5556666')
+        if(this.clearing) return 
       let item = {
         id: this.form.contractId
       }
       this.$refs.selectContractRef.open(item)
     },
+    //清除合同
+    clearContrcat(){
+      this.clearing=true
+      let {id,projectName,saleType,saleTypeName,deliveryDate,orderFiles,remark}=this.form;
+      this.form =Object.assign({},copyObj(this.formDef),{id,projectName,saleType,saleTypeName,deliveryDate,orderFiles,remark}) 
+      
+        this.$store.commit('order/setContractId','');
+        this.$store.commit('order/setAllcountAmount',0);
+        this.$refs.inventoryTable.putTableValue([])
+
+      setTimeout(()=>{
+        this.clearing=false
+      },500)
+    },
+
       handParent() {
+       
         if(this.form.contractId){
           return this.$message.error('选择了合同不能更改客户名称')
         }
@@ -577,7 +670,7 @@ export default {
         this.otherForm.salesmanName = info.name;
       },
       settlementModeChange(info){
-        this.otherForm.settlementModeName = info.dictValue;
+        this.form.settlementModeName = info.dictValue;
       },
       ifChiefChange(value, idx){
         if(value === 1){

+ 95 - 60
src/views/saleManage/saleOrder/components/detailDialog.vue

@@ -12,17 +12,18 @@
  
         <el-form ref="form" :model="form" :rules="rules" label-width="120px">
          
-     <headerTitle title="合同信息"></headerTitle>
+     <headerTitle title="订单信息"></headerTitle>
      <el-row>
           <el-col :span="12">
-             <el-form-item
-               label="合同类型:"
-               prop="type"
-               style="margin-bottom: 16px"
-             >
-             {{form.typeName}} {{form.categoryName }}
-             </el-form-item>
-             <el-form-item
+            
+            <el-form-item
+              label="订单编号:"
+              prop="orderNo"
+              style="margin-bottom: 16px"
+            >
+            {{form.orderNo}}
+            </el-form-item>
+            <el-form-item
               label="合同名称:"
               prop="contractName"
               style="margin-bottom: 16px"
@@ -30,97 +31,130 @@
             {{form.contractName}}
             </el-form-item>
             <el-form-item
-              label="编码:"
-              prop="contractNumber"
+              label="结算方式:"
+              prop="settlementModeName"
               style="margin-bottom: 16px"
             >
-            {{form.contractNo}}
+            {{detailData.settlementModeName}}
+            </el-form-item>
+             <el-form-item prop="orderFiles" label="订单附件:">
+              <div v-if="detailData.orderFiles && detailData.orderFiles?.length">
+               <el-link v-for="link in detailData.orderFiles" :key="link.id"
+                         type="primary" :underline="false"
+                         @click="downloadFile(link)"> {{ link.name }}</el-link> 
+                        </div>
+
+              </el-form-item>
+         
+              <el-form-item
+              label="客户收货地址:"
+              prop="receiveAddress"
+              style="margin-bottom: 16px"
+            >
+            {{form.receiveAddress}}
             </el-form-item>
             <el-form-item
-              label="编号:"
-              prop="contractNumber"
+              label="订单备注:"
+              prop="remark"
               style="margin-bottom: 16px"
             >
-            {{form.contractNumber}}
+            {{form.remark}}
             </el-form-item>
-          
           </el-col>
             <el-col :span="12">
             <el-form-item
-              label="签订日期:"
-              prop="contractStartDate"
+              label="交货日期:"
+              prop="deliveryDate"
               style="margin-bottom: 16px"
             >
-            {{form.contractStartDate}}
+            {{form.deliveryDate}}
             </el-form-item>
+           
             <el-form-item
-              label="结束日期:"
-              prop="contractEndDate"
+               label="项目名称:"
+               prop="projectName"
+               style="margin-bottom: 16px"
+             >
+             {{form.projectName }}
+             </el-form-item>
+             <el-form-item
+              label="销售部门:"
+              prop="salesDeptName"
               style="margin-bottom: 16px"
             >
-            {{form.contractEndDate}}
+            {{form.salesDeptName}}
             </el-form-item>
             <el-form-item
-              :label="form.type=='2'?'付款类型:':'收款类型:'"
-              prop="receiptPaymentType"
+              label="应付金额:"
+              prop="payAmount"
               style="margin-bottom: 16px"
             >
-            {{form.receiptPaymentType==1?'固定':'分期'}}
+            {{form.payAmount}}元
+            </el-form-item>
+            <el-form-item
+              label="订单总金额:"
+              prop="totalAmount"
+              style="margin-bottom: 16px"
+            >
+            {{form.totalAmount}}元
             </el-form-item>
-            <el-form-item prop="contractFile" label="合同附件:">
-              <el-link v-if="form.contractFile && form.contractFile !== ''"
-                         type="primary" :underline="false"
-                         @click="downloadFile(form.contractFile)"> {{ form.contractFile.name }}</el-link>
-              </el-form-item>
            </el-col>
      </el-row>
      <headerTitle title="基本信息"></headerTitle>
        <el-row>
         <el-col :span="12">
             <el-form-item
-              label="甲方名称:"
+              label="客户名称:"
               prop="partaName"
               style="margin-bottom: 16px"
             >
             {{form.partaName}}
             </el-form-item>
             <el-form-item
-              label="甲方联系人:"
+              label="客户统一社会信用代码"
+              prop="partaUnifiedSocialCreditCode"
+              label-width="160px"
+              style="margin-bottom: 16px"
+            >
+            {{form.partaUnifiedSocialCreditCode}}
+            </el-form-item>
+            <el-form-item
+              label="客户联系人:"
               prop="partaLinkName"
               style="margin-bottom: 16px"
             >
             {{form.partaLinkName}}
             </el-form-item>
             <el-form-item
-              label="甲方电话:"
+              label="客户电话:"
               prop="partaTel"
               style="margin-bottom: 16px"
             >
             {{form.partaTel}}
             </el-form-item>
             <el-form-item
-              label="甲方传真:"
+              label="客户传真:"
               prop="partaFax"
               style="margin-bottom: 16px"
             >
             {{form.partaFax}}
             </el-form-item>
             <el-form-item
-              label="	甲方Email:"
+              label="	客户Email:"
               prop="partaEmail"
               style="margin-bottom: 16px"
             >
             {{form.partaEmail}}
             </el-form-item>
             <el-form-item
-              label="甲方地址:"
+              label="客户地址:"
               prop="partaAddress"
               style="margin-bottom: 16px"
             >
             {{form.partaAddress}}
             </el-form-item>
             <!-- <el-form-item
-              label="甲方税号"
+              label="客户税号"
               prop="contactAddress"
               style="margin-bottom: 16px"
             >
@@ -138,28 +172,36 @@
 
           <el-col :span="12">
             <el-form-item
-              label="方名称:"
+              label="售出方名称:"
               prop="partbName"
               style="margin-bottom: 16px"
             >
             {{form.partbName}}
             </el-form-item>
             <el-form-item
-              label="乙方联系人:"
+              label="售出方统一社会信用代码"
+              prop="partbUnifiedSocialCreditCode"
+              label-width="180px"
+              style="margin-bottom: 16px"
+            >
+            {{form.partbUnifiedSocialCreditCode}}
+            </el-form-item>
+            <el-form-item
+              label="售出方联系人:"
               prop="partbLinkName"
               style="margin-bottom: 16px"
             >
             {{form.partbLinkName}}
             </el-form-item>
-            <el-form-item prop="partbTel" label="乙方联系电话:">
+            <el-form-item prop="partbTel" label="售出方联系电话:"  label-width="140px">
               {{form.partbTel}}
               </el-form-item>
-              <el-form-item prop="partbFax" label="方传真:">
+              <el-form-item prop="partbFax" label="售出方传真:">
                 {{form.partbFax}}
               </el-form-item>
 
               <el-form-item
-              label="方Email:"
+              label="售出方Email:"
               prop="partbEmail"
               style="margin-bottom: 16px"
             >
@@ -167,14 +209,14 @@
             </el-form-item>
 
             <el-form-item
-              label="方地址:"
+              label="售出方地址:"
               prop="partbAddress"
               style="margin-bottom: 16px"
             >
             {{form.partbAddress}}
             </el-form-item>
             <!-- <el-form-item
-              label="方税号"
+              label="售出方税号"
               prop="contactAddress"
               style="margin-bottom: 16px"
             >
@@ -191,12 +233,12 @@
 
 
        
-        <headerTitle title="报价单产品清单"></headerTitle>
+        <headerTitle title="产品清单"></headerTitle>
         <ele-pro-table ref="table" :needPage="false" :columns="competAnalysisListcolumns"  :toolkit="[]" :datasource="detailData.productList" row-key="id">
           <template v-slot:toolbar>
         <div class="headbox">
-        <span class="amount">总计:{{form.totalPrice}}元</span>
-        <span class="amount">优惠总金额:{{form.discountTotalPrice}}元</span>
+        <span class="amount">总计:{{detailData.totalAmount}}元</span>
+        <span class="amount">应付金额:{{detailData.payAmount}}元</span>
       </div>
       </template>
           <template v-slot:technicalDrawings="{ row }">
@@ -209,10 +251,6 @@
                         </template>
                      
           </ele-pro-table>
-
-          <headerTitle :title="form.type=='2'?'付款清单':'收款清单'" style="margin-top:30px;"></headerTitle>
-          <ele-pro-table ref="table" :needPage="false" :columns="receiptPaymentListcolumns"  :toolkit="[]" :datasource="detailData.receiptPaymentList" row-key="id">                     
-          </ele-pro-table>
        
       <div slot="footer" class="footer">
         <el-button @click="cancel">返回</el-button>
@@ -221,7 +259,7 @@
   </template>
   
   <script>
-  import { getDetail,getExport} from '@/api/contractManage/contractBook';
+  import { getSaleOrderDetail} from '@/api/saleManage/saleorder';
   import {getFile} from '@/api/system/file';
   import dictMixins from '@/mixins/dictMixins';
   import {download } from '@/utils/file';
@@ -238,7 +276,9 @@
           title: '详情',
           row: {},
           activeName: 'base',
-          form:{},
+          form:{
+            orderFiles:[{name:'222'}]
+          },
           rules:{},
           detailData:{},
           receiptPaymentListcolumns:[
@@ -411,12 +451,7 @@
         };
       },
       methods: {
-         //导出
-       async exportTable(){
-        this.loading = true;
-          const response = await getExport(this.detailId);
-         
-     },
+     
         async open(row) {
           this.form = row;
           this.visible = true;
@@ -439,7 +474,7 @@
       },
         async getDetailData (id) {
           this.loading = true;
-          const data = await getDetail(id);
+          const data = await getSaleOrderDetail(id);
           this.loading = false;
           if (data) {
             this.detailData = data;

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

@@ -9,7 +9,7 @@
       cache-key="systemRoleTable17" class="time-form">
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
-        <div class="headbox" >
+        <div class="headbox" v-if="!contractId">
         <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="handlAdd">
           新增
         </el-button>

+ 30 - 25
src/views/saleManage/saleOrder/components/searchTable.vue

@@ -8,22 +8,29 @@
   >
     <el-row :gutter="15">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="合同名称:" prop="contractName">
-          <el-input
-            clearable
-            placeholder="请输入"
-            v-model.trim="params.contractName"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="订单编号:" prop="orderNo">
+        <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="createTimeStart">
+          <el-date-picker
+            v-model="createTime"
+            @change="changeDate"
+            type="datetimerange"
+            style="width:320px"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            start-placeholder="开始时间"
+            end-placeholder="结束时间"
+            :default-time="['00:00:00', '23:59:59']">
+          </el-date-picker>
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
+      <!-- <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
         <el-form-item label="发货状态:" prop="deliveryStatus">
           <el-select v-model="params.deliveryStatus" placeholder="请选择" class="w100" clearable>
             <el-option
@@ -44,10 +51,10 @@
             ></el-option>
           </el-select>
         </el-form-item>
-      </el-col> 
-      <el-col v-bind="styleResponsive ? { lg:8, md: 12 } : { span:6 }">
+      </el-col>  -->
+      <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
        
-        <el-form-item label="甲方名称:" prop="partaName">
+        <el-form-item label="客户名称:" prop="partaName">
           <el-input
           placeholder="请输入"
           style="max-width:320px"
@@ -55,21 +62,19 @@
           </el-input>
          
         </el-form-item>
-        <el-form-item label="创建时间:" prop="createTimeStart">
-          <el-date-picker
-            v-model="createTime"
-            @change="changeDate"
-            type="datetimerange"
-            style="width:320px"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            start-placeholder="开始时间"
-            end-placeholder="结束时间"
-            :default-time="['00:00:00', '23:59:59']">
-          </el-date-picker>
+        
+      </el-col> 
+      <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
+        <el-form-item label="合同名称:" prop="contractName">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="params.contractName"
+          ></el-input>
         </el-form-item>
       </el-col> 
-
-      <el-col v-bind="styleResponsive ? { lg:4, md: 12 } : { span:4 }">
+      <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:4 }">
+      
         <div class="ele-form-actions">
           <el-button
             type="primary"

+ 114 - 90
src/views/saleManage/saleOrder/index.vue

@@ -1,8 +1,24 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
-    
-      <div class="ele-border-lighter form-content" v-loading="loading">
+      <div class="switch">
+        <div class="switch_left">
+          <ul>
+            <li
+              v-for="item in tabOptions"
+              :key="item.key"
+              :class="{ active: activeComp == item.key }"
+              @click="activeComp = item.key"
+            >
+              {{ item.name }}
+            </li>
+          </ul>
+        </div>
+      </div>
+      <div class="main">
+        <div v-if="activeComp == 'saleorder'">
+
+          <div class="ele-border-lighter form-content" v-loading="loading">
             <search-table @search="reload"> </search-table>
 
             <!-- 数据表格 -->
@@ -10,7 +26,7 @@
               ref="table"
               :columns="columns"
               :datasource="datasource"
-              height="calc(100vh - 350px)"
+              height="calc(100vh - 385px)"
               full-height="calc(100vh - 116px)"
               tool-class="ele-toolbar-form"
               :selection.sync="selection"
@@ -42,9 +58,11 @@
 
               <!-- 查看详情列 -->
               <template v-slot:contractName="{ row }">
-                <el-link type="primary" :underline="false" @click="openDetail(row)"> {{ row.contractName }}</el-link>
+                <el-link type="primary" :underline="false" @click="opencontractDetail(row)"> {{ row.contractName }}</el-link>
+              </template>
+              <template v-slot:orderNo="{ row }">
+                <el-link type="primary" :underline="false" @click="openorderDetail(row)"> {{ row.orderNo }}</el-link>
               </template>
-
               <!-- 操作列 -->
               <template v-slot:action="{ row }">
                 
@@ -71,14 +89,34 @@
                     </el-link>
                   </template>
                 </el-popconfirm>
+                <el-dropdown @command="(command)=>handleCommand(command,row)">
+                  <span class="el-dropdown-link">
+                    操作菜单<i class="el-icon-arrow-down el-icon--right"></i>
+                  </span>
+                  <el-dropdown-menu slot="dropdown">
+                    <el-dropdown-item command="invoice">创建发货单</el-dropdown-item>
+                    <el-dropdown-item command="returnOrder">创建退货单</el-dropdown-item>
+                  </el-dropdown-menu>
+                </el-dropdown>
               </template>
             </ele-pro-table>
           </div>
-      
+
+        </div>
+        <div v-if="activeComp == 'invoice'">
+          <invoice></invoice>
+        </div>
+        <div v-if="activeComp == 'returnorder'" class="returnorder">
+        
+        </div>
+         
+      </div>
     </el-card>
 
 
     <add-dialog ref="addDialogRef"  @done="reload"></add-dialog>
+    <add-invoice-dialog ref="invoiceDialogRef"  @done="reload"></add-invoice-dialog>
+    <contractr-detail ref="contractDetailRef"></contractr-detail>
     <detail-dialog ref="contactDetailDialogRef"></detail-dialog>
 <!-- 多选删除弹窗 -->
     <pop-modal :visible.sync="delVisible" content="是否确定删除?" @done="commitBtn"/>
@@ -88,7 +126,10 @@
 <script>
 import searchTable from './components/searchTable.vue';
 import addDialog from './components/addDialog.vue';
+import invoice from './invoice/index.vue';
 import detailDialog from './components/detailDialog.vue';
+import contractrDetail from "@/views/contractManage/contractBook/components/detailDialog.vue";
+import addInvoiceDialog from '@/views/saleManage/saleOrder/invoice/components/addInvoiceDialog';
 import popModal from '@/components/pop-modal';
 import {deliveryStatusOptions,orderStatusOptions,payStatusOptions} from '@/enum/dict';
 import {contactTypeTree} from '@/api/saleManage/contact';
@@ -101,11 +142,20 @@ export default {
     components: {
       searchTable,
       popModal,
+      contractrDetail,
+      addInvoiceDialog,
+      invoice,
       addDialog,
       detailDialog,
     },
     data() {
       return {
+        activeComp: 'saleorder',
+        tabOptions: [
+          { key: 'saleorder', name: '销售订单' },
+          { key: 'invoice', name: '发货单' },
+          { key: 'returnorder', name: '退货单' }
+        ],
         selection:[],   //单选中集合
         delVisible:false,  //批量删除弹框状态
         loading: false,  // 加载状态
@@ -126,64 +176,45 @@ export default {
             fixed: 'left'
           },
           {
-            prop: 'contractName',
-            label: '合同名称',
+            prop: 'orderNo',
+            label: '订单编码',
             align: 'center',
-            slot: 'contractName',
+            slot: 'orderNo',
             showOverflowTooltip: true,
             minWidth: 200
-          },
-          {
-            prop: 'deliveryStatus',
-            label: '发货状态',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 140,
-            formatter: (_row, _column, cellValue) => {
-              return deliveryStatusOptions[_row.deliveryStatus].label
-            }
-          },
+          }, 
           {
-            prop: 'discountAmount',
-            label: '折让金额',
+            prop: 'contractName',
+            label: '合同名称',
             align: 'center',
+            slot: 'contractName',
             showOverflowTooltip: true,
-            minWidth: 140
+            minWidth: 200
           },
           {
-            prop: 'makerName',
-            label: '制单人名称',
+            prop: 'deliveryDate',
+            label: '交货日期',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 140
+            minWidth: 200
           },
           {
-            prop: 'orderNo',
-            label: '订单编号',
+            prop: 'saleTypeName',
+            label: '销售类型',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 140
           },
-          {
-            prop: 'orderStatus',
-            label: '订单状态',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 140,
-            formatter: (_row, _column, cellValue) => {
-              return orderStatusOptions[_row.orderStatus].label
-            }
-          },
           {
             prop: 'partaName',
-            label: '甲方名称',
+            label: '客户名称',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 150,
+            minWidth: 180,
           },
           {
             prop: 'partaLinkName',
-            label: '甲方联系人',
+            label: '客户联系人',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 130,
@@ -191,33 +222,32 @@ export default {
          
           {
             prop: 'partaTel',
-            label: '甲方联系电话',
+            label: '客户联系电话',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 130,
           },
           {
             prop: 'partbName',
-            label: '方名称',
+            label: '售出方名称',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 130,
           },
           {
             prop: 'partbLinkName',
-            label: '方联系人',
+            label: '售出方联系人',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 130,
           },
           {
             prop: 'partbTel',
-            label: '方联系电话',
+            label: '售出方联系电话',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 130,
           },
-       
           {
             prop: 'payAmount',
             label: '应付金额(元)',
@@ -226,51 +256,11 @@ export default {
             minWidth: 170
           },
           {
-            prop: 'payStatus',
-            label: '支付状态',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 140,
-            formatter: (_row, _column, cellValue) => {
-              return payStatusOptions[_row.payStatus].label
-            }
-          },
-         
-        
-          {
-            prop: 'projectName',
-            label: '项目名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 200
-          },
-          {
-            prop: 'receiveAddress',
-            label: '客户收货地址',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 200
-          },
-          {
-            prop: 'saleTypeName',
-            label: '销售类型',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 140
-          },
-          {
-            prop: 'salesmanName',
-            label: '销售员',
+            prop: 'createTime',
+            label: '创建时间',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 130
-          },
-          {
-            prop: 'totalAmount',
-            label: '订单总金额',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 130
+            minWidth: 170
           },
           {
             columnKey: 'action',
@@ -290,6 +280,13 @@ export default {
       this.requestDict('客户状态');
     },
     methods: {
+      //更多菜单
+      handleCommand(command,row) {
+        console.log(command,row)
+        if(command==='invoice'){
+         this.$refs.invoiceDialogRef.open( 'add',{}, row.id)
+        }
+      },
       //点击左边分类
       handleNodeClick(data, node) {
        // this.curNodeData = data;
@@ -338,14 +335,25 @@ export default {
       },
 
     //查看详情
-      openDetail(row){
+    openorderDetail(row){
         this.$refs.contactDetailDialogRef.open(row);
       },
+
+      //查看合同详情
+      opencontractDetail(row){
+        let data={
+          id:row.contractId
+        }
+        this.$refs.contractDetailRef.open(data)
+      }
     }
   };
 </script>
 
 <style lang="scss" scoped>
+:deep .el-card__body{
+  padding: 0;
+}
 :deep(.el-link--inner){
   margin-left: 0px !important;
 }
@@ -363,4 +371,20 @@ export default {
     margin-left: 10px;
   }
 }
+
+ .switch_left ul .active{
+   border-top: 4px solid var(--color-primary);
+     color: var(--color-primary-5);
+ }
+.switch{
+  padding-bottom: 20px;
+}
+
+.el-dropdown-link {
+    cursor: pointer;
+    color: var(--color-primary-5);
+  }
+  .el-icon-arrow-down {
+    font-size: 12px;
+  }
 </style>

+ 417 - 0
src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue

@@ -0,0 +1,417 @@
+<template>
+  <ele-modal
+  custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    v-if="visible"
+    :visible.sync="visible"
+    :title="title"
+    :close-on-click-modal="false"
+    width="80%"
+    @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
+                clearable
+                v-model="form.orderNo"
+                @click.native="handleOrderBtn"
+                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-col>
+        </el-row>
+
+
+      </el-form>
+
+      
+    
+      <headerTitle title="产品清单" style="margin-top:30px;"></headerTitle>
+     <inventoryTable  ref="inventoryTableref" :orderId="form.orderId"></inventoryTable>
+
+    <div slot="footer" class="footer">
+      <el-button type="primary" @click="save">保存</el-button>
+      <el-button @click="cancel">返回</el-button>
+    </div>
+    <orderListDialog ref="orderListDialogRef" @changeParent="changeOrder"></orderListDialog>
+  </ele-modal>
+</template>
+
+<script>
+import { emailReg, phoneReg,numberReg } from 'ele-admin';
+import {acceptUnpackoptions} from '@/enum/dict';
+import fileUpload from '@/components/upload/fileUpload';
+import dictMixins from '@/mixins/dictMixins';
+import deptSelect from '@/components/CommomSelect/dept-select.vue';
+import personSelect from '@/components/CommomSelect/person-select.vue';
+import parentList from '@/views/saleManage/contact/components/parentList.vue'
+import { getDetail} from '@/api/contractManage/contractBook';
+import { getSaleOrderDetail, UpdateInformation, addInformation,deleteInformation,updateStatus} from '@/api/saleManage/saleorder';
+import { addSendInformation,UpdateSendInformation,getSendSaleOrderrecordDetail} from '@/api/saleManage/saleordersendrecord';
+import {getcontactlink} from '@/api/saleManage/businessFollow';
+import inventoryTable from './inventoryTable.vue';
+import {listOrganizations} from '@/api/system/organization';
+import orderListDialog from './orderListDialog.vue';
+import {copyObj} from '@/utils/util';
+
+
+export default {
+    mixins: [dictMixins],
+    components: {
+      fileUpload,
+      deptSelect,
+      inventoryTable,
+      orderListDialog,
+      parentList,
+      personSelect
+    },
+    data() {
+      let formDef = {
+          id:'',
+          contractId: '',
+          sendFiles:[],
+          contractName: '',
+          receiveAddress:'',
+          carNo:'',
+          carId:'',
+          linkName:'',
+          linkPhone:'',
+          orderNo:'',
+          orderId:''
+        };
+   
+      return {
+        detailData:{},   
+        payWayOptions:[],
+        delDetailIds:[],
+        linkNameOptions:[],
+        acceptUnpackoptions,
+        visible: false,
+        title: '',
+        row: {},
+        activeName: 'base',
+        formDef,
+        form: copyObj(formDef),
+        tableBankData: [],
+        tableLinkData: [],
+     // 组织机构树形结构数据
+       groupTreeData: [],
+       groupData:[],
+        rules: {        
+          partaName: [
+            { required: true, message: '请选择客户名称', trigger: 'change' }
+          ],
+        },
+     
+        // 提交状态
+        loading: false,
+        // 是否是修改
+        isUpdate: false,
+      };
+    },
+    computed: {
+     
+      allcountAmount(){
+        return this.$store.state.order.allcountAmount
+      }
+    },
+   
+    methods: {
+
+  
+       //选择订单回调
+       changeOrder(obj){
+        this.form = Object.assign({},this.form,{
+          orderId: obj.id,
+          orderNo: obj.orderNo,
+        })
+        this.getSaleOrderDetail(obj.id)
+        
+      },
+      //获取订单详情
+      async getSaleOrderDetail(id){
+        this.loading = true;
+        const data = await getSaleOrderDetail(id);
+        this.loading = false;
+        if (data) {
+          this.$nextTick(()=>{
+            let {partaId,partaName,partaTel,orderNo,id,partaLinkName,receiveAddress,productList,totalAmount,payAmount}=data
+            if(productList&&productList.length>0){
+              productList.forEach(v=>{
+                v.orderTotalCount=v.totalCount
+              })
+            }
+            this.form =Object.assign({}, this.form,{contactId:partaId,contactName:partaName,linkName:partaLinkName,linkPhone:partaTel,orderNo,orderId:id,receiveAddress,productList,totalAmount,payAmount}) ;
+            this.$refs.inventoryTableref&&this.$refs.inventoryTableref.putTableValue(productList)
+          })
+          
+          
+        }
+      },
+
+      //发货单详情
+      async getSendSaleOrderDetail(id){
+        this.loading = true;
+        const data = await getSendSaleOrderrecordDetail(id);
+        this.loading = false;
+        if (data) {
+          this.$nextTick(()=>{
+            this.form = data;
+            this.$refs.inventoryTableref&&this.$refs.inventoryTableref.putTableValue(data.productList)
+          })          
+        }
+      },
+
+   //更新联系人数据
+   async getLinkInfo(contactId) {
+      const data = await getcontactlink({contactId});
+         if(data&&data?.length){
+           this.linkNameOptions=data
+         }
+    },
+      selectFocus(){
+   if(this.linkNameOptions.length===0){
+    return this.$message.error('请先选择名称')
+   }
+    },
+
+ 
+  
+    handHead(){
+      
+      let item={
+          id:this.form.partbLinkId
+        }
+        this.$refs.headRef.open(item)
+     },
+
+
+
+  
+    
+
+    
+      //选择订单弹框
+       handleOrderBtn(){
+         let item = {
+           id: this.form.orderId
+      }
+        this.$refs.orderListDialogRef.open(item)
+    },
+
+    
+      //打开新增编辑弹框
+      async open(type, row,orderId) {
+        this.title = type==='add'?'新增发货单':'修改';
+        this.row = row;
+        this.visible = true;
+        if(orderId){
+          this.getSaleOrderDetail(orderId)
+        }
+        if(row&&row?.id){
+          this.getSendSaleOrderDetail(row?.id)
+        }
+        
+        if (type == 'add') {
+          this.isUpdate = false;
+        } else {
+          this.isUpdate = true;
+         
+        }
+      },
+
+      salesmanChange(val, info){
+        this.otherForm.salesmanName = info.name;
+      },
+      settlementModeChange(info){
+        this.form.settlementModeName = info.dictValue;
+      },
+      ifChiefChange(value, idx){
+        if(value === 1){
+          this.tableLinkData.forEach(e => e.ifChief = 0);
+          this.tableLinkData[idx].ifChief = 1;
+        }
+      },
+ 
+    
+     getValidate() {
+        return Promise.all([
+            new Promise((resolve, reject) => {
+              this.$refs.form.validate((valid) => {
+                if (!valid) {
+                  reject(false);
+                } else {
+                  resolve(true);
+                }
+              });
+            })
+          
+          ]);
+     },
+      async save() {
+        try {
+           await this.getValidate();
+           // 表单验证通过,执行保存操作
+           this.loading = true;
+      
+        if (!this.isUpdate) {
+          delete this.form.id;
+        } 
+        let commitData=Object.assign({},this.form,{
+          productList:this.$refs.inventoryTableref.getTableValue()
+        })
+
+        if (this.isUpdate) {
+          UpdateSendInformation(commitData)
+            .then((res) => {
+              this.loading = false;
+              this.$message.success("修改成功");
+              this.cancel();
+              this.$emit('done');
+            })
+            .catch((e) => {
+              //this.loading = false;
+            });
+        } else {
+          addSendInformation(commitData)
+            .then((res) => {
+              this.loading = false;
+              this.$message.success("新增成功");
+              this.cancel();
+              this.$emit('done');
+            })
+            .catch((e) => {
+              //this.loading = false;
+            });
+          }
+        } catch (error) {
+          console.log(error)
+          // 表单验证未通过,不执行保存操作
+        }
+       
+      },
+      cancel() {
+        this.$nextTick(() => {
+          this.activeName = 'base';
+          // 关闭后,销毁所有的表单数据
+          this.$refs['otherForm'] &&  this.$refs['otherForm'].resetFields();
+          this.$refs['formRef'] &&  this.$refs['formRef'].resetFields();
+          this.$store.commit('order/clearUserData');
+          this.form = copyObj(this.formDef)
+          this.visible = false;
+        })
+      },
+ 
+    
+
+    }
+  };
+</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>

+ 380 - 0
src/views/saleManage/saleOrder/invoice/components/detailDialog.vue

@@ -0,0 +1,380 @@
+<template>
+    <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+      :centered="true"
+      v-if="visible"
+      :visible.sync="visible"
+      :title="title"
+      :close-on-click-modal="false"
+      width="80%"
+      @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="contactName"
+              style="margin-bottom: 16px"
+            >
+            {{form.contactName}}
+            </el-form-item>
+            <el-form-item
+              label="客户联系人:"
+              prop="linkName"
+              style="margin-bottom: 16px"
+            >
+            {{form.linkName}}
+            </el-form-item>
+            <el-form-item
+              label="客户电话:"
+              prop="linkPhone"
+              style="margin-bottom: 16px"
+            >
+            {{form.linkPhone}}
+            </el-form-item>
+       
+            <el-form-item
+              label="客户地址:"
+              prop="partaAddress"
+              style="margin-bottom: 16px"
+            >
+            {{form.receiveAddress}}
+            </el-form-item>
+            <el-form-item
+              label="发货附件:"
+              prop="sendFiles"
+              style="margin-bottom: 16px"
+            >
+            <div v-if="detailData.sendFiles && detailData.sendFiles?.length">
+               <el-link v-for="link in detailData.sendFiles" :key="link.id"
+                         type="primary" :underline="false"
+                         @click="downloadFile(link)"> {{ link.name }}</el-link> 
+                        </div>
+            </el-form-item>
+          </el-col>
+
+
+
+
+          <el-col :span="12">
+            <el-form-item
+              label="车牌号:"
+              prop="carNo"
+              style="margin-bottom: 16px"
+            >
+            {{form.carNo}}
+            </el-form-item>
+            <el-form-item
+              label="发货单据编码:"
+              prop="docNo"
+              style="margin-bottom: 16px"
+            >
+            {{form.docNo}}
+            </el-form-item>
+            <el-form-item
+              label="制单人:"
+              prop="makerName"
+              style="margin-bottom: 16px"
+            >
+            {{form.makerName}}
+            </el-form-item>
+            <el-form-item prop="orderNo" label="订单编码:" >
+              {{form.orderNo}}
+              </el-form-item>
+              <el-form-item prop="replied" label="是否回执:">
+                {{form.replied==1?'是':'否'}}
+              </el-form-item>
+
+              <el-form-item
+              label="审核状态:"
+              prop="reviewStatus"
+              style="margin-bottom: 16px"
+            >
+            {{reviewStatusEnum[form.reviewStatus].label}}
+            </el-form-item>
+
+           
+          </el-col>
+       </el-row>
+
+   </el-form>
+
+
+       
+        <headerTitle title="产品清单"></headerTitle>
+        <ele-pro-table ref="table" :needPage="false" :columns="competAnalysisListcolumns"  :toolkit="[]" :datasource="detailData.productList" row-key="id">
+          <!-- <template v-slot:toolbar>
+        <div class="headbox">
+        <span class="amount">总计:{{detailData.totalAmount}}元</span>
+        <span class="amount">应付金额:{{detailData.payAmount}}元</span>
+      </div>
+      </template> -->
+          <template v-slot:technicalDrawings="{ row }">
+            <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
+            <el-link 
+            v-for="link in row.technicalDrawings" :key="link.id"
+                         type="primary" :underline="false"
+                         @click="downloadFile(link)"> {{ link.name }}</el-link>
+                        </div>
+                        </template>
+                     
+          </ele-pro-table>
+       
+      <div slot="footer" class="footer">
+        <el-button @click="cancel">返回</el-button>
+      </div>
+    </ele-modal>
+  </template>
+  
+  <script>
+  import {getFile} from '@/api/system/file';
+  import dictMixins from '@/mixins/dictMixins';
+  import {download } from '@/utils/file';
+  import {reviewStatusEnum} from '@/enum/dict';
+  import {copyObj} from '@/utils/util';
+  
+  
+  export default {
+      mixins: [dictMixins],
+      data() {
+      
+        return {
+          reviewStatusEnum,
+          visible: false,
+          detailId:'',
+          title: '详情',
+          row: {},
+          activeName: 'base',
+          form:{
+            orderFiles:[{name:'222'}]
+          },
+          rules:{},
+          detailData:{},
+          receiptPaymentListcolumns:[
+          {
+          width: 45,
+          type: 'index',
+          columnKey: 'index',
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          width: 200,
+          prop: 'moneyName',
+          label: '款项名称',
+          slot: 'moneyName'
+        },
+        {
+          width: 100,
+          prop: 'price',
+          label: '金额',
+          slot: 'price',
+          formatter: (_row, _column, cellValue) => {
+              return _row.price+'元'
+            }
+        },
+        {
+          width: 100,
+          prop: 'ratio',
+          label: '比例',
+          slot: 'ratio',
+          formatter: (_row, _column, cellValue) => {
+              return _row.ratio+'%'
+            }
+        },
+        {
+          width: 160,
+          prop: 'deadLine',
+          label: '截止日期',
+          slot: 'deadLine'
+        },
+        {
+          prop: 'remark',
+          label: '	说明',
+          slot: 'remark'
+        }
+          ],
+          competAnalysisListcolumns: [
+        
+          {
+          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: 160,
+          prop: 'singlePrice',
+          label: '单价',
+          slot: 'singlePrice'
+        },
+        {
+          width: 120,
+          prop: 'totalCount',
+          label: '数量',
+          slot: 'totalCount'
+        },
+        {
+          width: 120,
+          prop: 'totalPrice',
+          label: '销售总金额',
+          slot: 'totalPrice',
+          formatter: (_row, _column, cellValue) => {
+              return _row.totalPrice+'元'
+            }
+        },
+        {
+          width: 120,
+          prop: 'measuringUnit',
+          label: '计量单位',
+          slot: 'measuringUnit'
+        },
+        {
+          width: 120,
+          prop: 'deliveryDays',
+          label: '交期(天)',
+          slot: 'deliveryDays'
+        },
+        {
+          width: 200,
+          prop: 'guaranteePeriod',
+          label: '质保期',
+          slot: 'guaranteePeriod',
+          formatter: (_row, _column, cellValue) => {
+              return _row.guaranteePeriod+_row.guaranteePeriodUnitName
+            }
+        },
+        // {
+        //   width: 120,
+        //   prop: 'guaranteePeriodUnitCode',
+        //   label: '',
+        //   slot: 'guaranteePeriodUnitCode'
+        // },
+         {
+          width: 120,
+          prop: 'technicalAnswerName',
+          label: '技术答疑人',
+          slot: 'technicalAnswerName'
+        },
+        {
+          width: 220,
+          prop: 'technicalParams',
+          label: '技术参数',
+          slot: 'technicalParams'
+        },
+        {
+          width:240,
+          prop: 'technicalDrawings',
+          label: '技术图纸',
+          slot: 'technicalDrawings',
+          formatter: (_row, _column, cellValue) => {
+              return _row.guaranteePeriod+_row.guaranteePeriodUnitName
+            }
+
+        },
+        {
+          width: 220,
+          prop: 'remark',
+          label: '备注',
+          slot: 'remark'
+        }
+           ],
+        };
+      },
+      methods: {
+     
+        async open(row) {
+          this.form = row;
+          this.visible = true;
+          this.getDetailData(row.id)
+          this.detailId=row.id
+        },
+  
+        cancel() {
+          this.$nextTick(() => {
+            // 关闭后,销毁所有的表单数据
+            this.form = copyObj(this.formDef),
+            this.otherForm = copyObj(this.otherFormDef),
+            this.tableBankData = []
+            this.tableLinkData = []
+            this.visible = false;
+          })
+        },
+        downloadFile(file){
+        getFile({ objectName: file.storePath }, file.name);
+      },
+        async getDetailData (id) {
+          this.loading = true;
+          const data = await getSendSaleOrderrecordDetail(id);
+          this.loading = false;
+          if (data) {
+            this.detailData = data;
+            
+          }
+        },
+  
+      }
+    };
+  </script>
+  
+  <style scoped lang="scss">
+  .ele-dialog-form{
+    .el-form-item{
+      margin-bottom: 10px;
+    }
+  }
+
+  .headbox{
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  .amount{
+    font-size: 14px;
+    font-weight: bold;
+    margin-right: 20px;
+  }
+}
+  </style>
+  

+ 498 - 0
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -0,0 +1,498 @@
+<template>
+  <el-form ref="form" :model="form" :rules="rules">
+
+    <ele-pro-table ref="table" :needPage="false" :columns="columns" :toolkit="[]" :datasource="form.datasource"
+      cache-key="systemRoleTable17" class="time-form">
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <div class="headbox" v-if="!contractId">
+        <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="handlAdd">
+          新增
+        </el-button>
+       
+      </div>
+      </template>
+      <template v-slot:technicalDrawings="{ row,$index }">
+        <el-form-item style="margin-bottom: 20px;" :prop="'datasource.' + $index + '.technicalDrawings'">
+            <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
+            <el-link 
+            v-for="link in row.technicalDrawings" :key="link.id"
+                         type="primary" :underline="false"
+                         @click="downloadFile(link)"> {{ link.name }}</el-link>
+                        </div>
+                      </el-form-item>
+           </template>
+      <template v-slot:remark="{ row, $index }">
+        <el-form-item style="margin-bottom: 20px;" :prop="'datasource.' + $index + '.remark'">
+          <el-input
+                clearable
+                v-model="row.remark"
+                type="textarea"
+                placeholder="请输入"
+              />
+        </el-form-item>
+      </template>
+      <template v-slot:totalCount="scope">
+        <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.totalCount'" :rules="[
+                  { required: true, message: '请输入数字', trigger: 'blur' },
+                  { validator: validateTotalCount(scope.row), trigger: 'blur' }
+              ]">
+          <el-input v-model="scope.row.totalCount" @input="(val)=>changeNum(val,scope.$index)"></el-input>
+        </el-form-item>
+      </template>
+     
+    
+     
+      <!-- 操作列 -->
+      <template v-slot:action="{ row }">
+        <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(row)">
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+    <product-list ref="productListRef" :orderId="orderId"  @changeParent="changeParent"></product-list>
+  </el-form>
+</template>
+<script>
+import { emailReg, phoneReg,numberReg } from 'ele-admin';
+import dictMixins from '@/mixins/dictMixins';
+import productList from './product-list.vue'
+import store from '@/store';
+export default {
+  mixins: [dictMixins],
+  props:{
+    orderId:String
+  },
+  components: {
+    productList,
+    },
+  data() {
+    const defaultForm = {
+      key: null,
+      endTime: '',
+      isFirst: 0,
+      name: '',
+      startTime: '',
+      workHour: '',
+      technicalDrawings:[]
+    };
+    return {
+      discountTotalPrice:0.00,
+      allPrice:0.00,
+      numberReg,
+      defaultForm,
+      form: {
+        datasource: []
+      },
+      rules: {},
+      competAnalysisListcolumns: [
+        
+        {
+        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: 160,
+        prop: 'singlePrice',
+        label: '单价',
+        slot: 'singlePrice'
+      },
+      {
+        width: 120,
+        prop: 'totalCount',
+        label: '数量',
+        slot: 'totalCount'
+      },
+      {
+        width: 120,
+        prop: 'totalPrice',
+        label: '销售总金额',
+        slot: 'totalPrice',
+        formatter: (_row, _column, cellValue) => {
+            return _row.totalPrice+'元'
+          }
+      },
+      {
+        width: 120,
+        prop: 'measuringUnit',
+        label: '计量单位',
+        slot: 'measuringUnit'
+      },
+      {
+        width: 120,
+        prop: 'deliveryDays',
+        label: '交期(天)',
+        slot: 'deliveryDays'
+      },
+      {
+        width: 200,
+        prop: 'guaranteePeriod',
+        label: '质保期',
+        slot: 'guaranteePeriod',
+        formatter: (_row, _column, cellValue) => {
+            return _row.guaranteePeriod+_row.guaranteePeriodUnitName
+          }
+      },
+      // {
+      //   width: 120,
+      //   prop: 'guaranteePeriodUnitCode',
+      //   label: '',
+      //   slot: 'guaranteePeriodUnitCode'
+      // },
+       {
+        width: 120,
+        prop: 'technicalAnswerName',
+        label: '技术答疑人',
+        slot: 'technicalAnswerName'
+      },
+      {
+        width: 220,
+        prop: 'technicalParams',
+        label: '技术参数',
+        slot: 'technicalParams'
+      },
+      {
+        width:240,
+        prop: 'technicalDrawings',
+        label: '技术图纸',
+        slot: 'technicalDrawings',
+        formatter: (_row, _column, cellValue) => {
+            return _row.guaranteePeriod+_row.guaranteePeriodUnitName
+          }
+
+      },
+      {
+        width: 220,
+        prop: 'remark',
+        label: '备注',
+        slot: 'remark'
+      }
+         ],
+      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: 160,
+          prop: 'singlePrice',
+          label: '单价',
+          slot: 'singlePrice'
+        },
+        
+        {
+          width: 120,
+          prop: 'totalCount',
+          label: '本次发货数量',
+          slot: 'totalCount'
+        },
+        {
+          width: 120,
+          prop: 'orderTotalCount',
+          label: '订单总数量',
+          slot: 'orderTotalCount'
+        },
+        {
+          width: 80,
+          prop: 'measuringUnit',
+          label: '计量单位',
+          slot: 'measuringUnit'
+        },
+        {
+          width: 120,
+          prop: 'totalPrice',
+          label: '金额',
+          slot: 'totalPrice'
+        },
+        {
+          width: 80,
+          prop: 'deliveryDays',
+          label: '交期(天)',
+          slot: 'deliveryDays'
+        },
+        {
+          width: 200,
+          prop: 'guaranteePeriod',
+          label: '质保期',
+          slot: 'guaranteePeriod'
+        },
+        // {
+        //   width: 120,
+        //   prop: 'guaranteePeriodUnitCode',
+        //   label: '',
+        //   slot: 'guaranteePeriodUnitCode'
+        // },
+         {
+          width: 130,
+          prop: 'technicalAnswerName',
+          label: '技术答疑人',
+          slot: 'technicalAnswerName'
+        },
+        {
+          width: 220,
+          prop: 'technicalParams',
+          label: '技术参数',
+          slot: 'technicalParams'
+        },
+        {
+          width:240,
+          prop: 'technicalDrawings',
+          label: '技术图纸',
+          slot: 'technicalDrawings'
+        },
+        {
+          width: 220,
+          prop: 'remark',
+          label: '备注',
+          slot: 'remark'
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 120,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          fixed:'right',
+          showOverflowTooltip: true
+        }
+      ],
+    };
+  },
+  computed: {
+    canHandl() {
+      return this.form.datasource.length;
+    },
+    contractId(){
+      return this.$store.state.order.contractId
+    }
+  },
+  methods: {
+    //修改数量更新合计
+    changeNum(val,index){
+      this.$set(this.form.datasource[index], 'totalPrice', (Number(this.form.datasource[index].singlePrice)*val).toFixed(2));
+    },
+      //选择产品回调
+      changeParent(obj,idx) {
+        console.log(obj,'9999')  
+        obj.orderTotalCount=obj.totalCount
+        this.$set(this.form.datasource, this.form.datasource.length, 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.orderTotalCount) {
+            this.$message.error('输入的数字不能大于最大发货值')
+             callback(new Error('输入的数字不能大于最大发货值'));
+           } else {
+             callback();
+           }
+         }
+       },
+      // 返回列表数据
+      getTableValue(){
+        let comitDatasource=this.form.datasource
+        if(comitDatasource.length===0) return []
+        comitDatasource.forEach(v=>{
+          v.totalCount=Number(v.totalCount)
+          v.technicalDrawings=Array.isArray(v.technicalDrawings)?v.technicalDrawings:[]
+        })
+         return comitDatasource
+      },
+      getPrice(){
+        return [this.allPrice]
+      },
+
+   
+      //修改回显
+      putTableValue(data){
+        if(data){
+            this.form.datasource=data
+        }
+      },
+    //选择产品
+    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(row) {
+      let index = this.form.datasource.findIndex((n) => n.key == row.key);
+      if (index !== -1) {
+        this.form.datasource.splice(index, 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);
+        });
+      },
+ 
+  }
+};
+</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;
+}
+
+::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;
+  }
+}
+ 
+}
+
+::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>

+ 240 - 0
src/views/saleManage/saleOrder/invoice/components/orderListDialog.vue

@@ -0,0 +1,240 @@
+<template>
+      <el-dialog title="选择订单"  custom-class="ele-dialog-form long-dialog-form" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false" top="5vh"
+        :close-on-press-escape="false" append-to-body width="80%">
+        <el-card shadow="never">
+            <searchTable @search="reload"></searchTable>
+            <ele-pro-table ref="table" :columns="columns" :datasource="datasource" row-key="id"
+                        height="calc(100vh - 500px)" class="dict-table" @cell-click="cellClick">
+                        <!-- 表头工具栏 -->
+                        <template v-slot:action="{ row }">
+                            <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
+                        </template>
+                    </ele-pro-table>
+     </el-card>
+
+        <div class="btns" slot="footer">
+            <el-button type="primary" size="small" @click="selected">选择</el-button>
+            <el-button size="small" @click="handleClose">关闭</el-button>
+        </div>
+
+    </el-dialog>
+</template>
+  
+<script>
+
+
+import {contactTypeTree} from '@/api/saleManage/contact';
+import searchTable from '@/views/saleManage/saleOrder/components/searchTable.vue';
+import {getTableList} from '@/api/saleManage/saleorder';
+import AssetTree from '@/components/AssetTree';
+export default {
+    components: {
+        AssetTree,
+        searchTable
+    },
+ 
+    data() {
+        return {
+            visible: false,
+            currentIndex:null,
+             columns: [
+                {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+                    action: 'action',
+                    slot: 'action',
+                    align: 'center',
+                    label: '选择',
+                   
+                },
+             
+          {
+            prop: 'orderNo',
+            label: '订单编码',
+            align: 'center',
+            slot: 'orderNo',
+            showOverflowTooltip: true,
+            minWidth: 200
+          }, 
+          {
+            prop: 'contractName',
+            label: '合同名称',
+            align: 'center',
+            slot: 'contractName',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'deliveryDate',
+            label: '交货日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'saleTypeName',
+            label: '销售类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'partaName',
+            label: '客户名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180,
+          },
+          {
+            prop: 'partaLinkName',
+            label: '客户联系人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+          },
+         
+          {
+            prop: 'partaTel',
+            label: '客户联系电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+          },
+          {
+            prop: 'partbName',
+            label: '售出方名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+          },
+          {
+            prop: 'partbLinkName',
+            label: '售出方联系人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+          },
+          {
+            prop: 'partbTel',
+            label: '售出方联系电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+          },
+          {
+            prop: 'payAmount',
+            label: '应付金额(元)',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+               ],
+
+            radio: null,
+        }
+    },
+
+    methods: {
+        open(item,currentIndex) {
+            this.currentIndex = currentIndex
+            if (item&&item.id) {
+                this.radio = item.id
+            }
+           
+            this.visible = true
+        },
+
+
+        /* 表格数据源 */
+        datasource({ page, limit, where, order }) {
+            return getTableList({
+                pageNum: page,
+                size: limit,
+                ...where
+            });
+        },
+
+        /* 刷新表格 */
+        reload(where) {
+            this.$refs.table.reload({ pageNum: 1, where: where  });
+        },
+
+        handleNodeClick(data, node) {
+            this.reload({ categoryId: data.id });
+        },
+
+
+        // 单击获取id
+        cellClick(row) {
+            this.current = row
+            console.log(row)
+            this.radio = row.id
+        },
+        handleClose() {
+            this.visible = false
+            this.current = null
+            this.radio = ''
+        },
+
+        selected() {
+            if (!this.current) {
+                return this.$message.warning('请至少选择一条数据')
+            }
+            this.$emit('changeParent', this.current,this.currentIndex)
+            this.handleClose()
+        },
+
+
+
+
+
+    }
+}
+</script>
+  
+<style lang="scss" scoped>
+.tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+}
+
+.table_col {
+    padding-left: 10px;
+
+    ::v-deep .el-table th.el-table__cell {
+        background: #f2f2f2;
+    }
+}
+
+.pagination {
+    text-align: right;
+    padding: 10px 0;
+}
+
+.btns {
+    text-align: center;
+    padding: 10px 0;
+}
+
+.topsearch {
+    margin-bottom: 15px;
+}
+</style>
+  

+ 233 - 0
src/views/saleManage/saleOrder/invoice/components/product-list.vue

@@ -0,0 +1,233 @@
+<template>
+    <el-dialog title="选择产品" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"  top="5vh"
+        :close-on-press-escape="false" append-to-body width="80%">
+        <el-card shadow="never">
+            <ele-pro-table ref="table" :columns="columns" :datasource="datasource" row-key="id"
+                        height="calc(100vh - 350px)" class="dict-table" @cell-click="cellClick">
+                        <!-- 表头工具栏 -->
+                        <template v-slot:action="{ row }">
+                            <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
+                        </template>
+                    </ele-pro-table>
+        </el-card>
+
+        <div class="btns">
+            <el-button type="primary" size="small" @click="selected">选择</el-button>
+            <el-button size="small" @click="handleClose">关闭</el-button>
+        </div>
+
+    </el-dialog>
+</template>
+  
+<script>
+
+import { getSaleOrderDetail, UpdateInformation, addInformation,deleteInformation,updateStatus} from '@/api/saleManage/saleorder';
+export default {
+   props:{
+    orderId:String
+   },
+    data() {
+        return {
+            visible: false,
+            currentIndex:null,
+            currentData:[],   //已经存在的产品
+            datasource:[],
+             columns: [
+
+                {
+                    action: 'action',
+                    slot: 'action',
+                    align: 'center',
+                    label: '选择'
+                },
+                {
+          columnKey: 'index',
+          type: 'index',
+          width: 50,
+          align: 'center',
+          showOverflowTooltip: true,
+          label: '序号'
+        },
+        {
+        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: 160,
+        prop: 'singlePrice',
+        label: '单价',
+        slot: 'singlePrice'
+      },
+      {
+        width: 120,
+        prop: 'totalCount',
+        label: '数量',
+        slot: 'totalCount'
+      },
+      {
+        width: 120,
+        prop: 'totalPrice',
+        label: '销售总金额',
+        slot: 'totalPrice',
+        formatter: (_row, _column, cellValue) => {
+            return _row.totalPrice+'元'
+          }
+      },
+      {
+        width: 120,
+        prop: 'measuringUnit',
+        label: '计量单位',
+        slot: 'measuringUnit'
+      },
+      {
+        width: 120,
+        prop: 'deliveryDays',
+        label: '交期(天)',
+        slot: 'deliveryDays'
+      },
+      {
+        width: 200,
+        prop: 'guaranteePeriod',
+        label: '质保期',
+        slot: 'guaranteePeriod',
+        formatter: (_row, _column, cellValue) => {
+            return _row.guaranteePeriod+_row.guaranteePeriodUnitName
+          }
+      } ],
+
+            radio: null,
+        }
+    },
+
+    watch: {
+        orderId(id){
+            this.getSaleOrderDetail(id)
+        }
+    },
+    methods: {
+        open(data) {
+            this.currentData = data||[]           
+            this.visible = true
+        },
+ //获取订单详情
+ async getSaleOrderDetail(id){
+        this.loading = true;
+        const data = await getSaleOrderDetail(id);
+        this.loading = false;
+        if (data) {
+          this.$nextTick(()=>{
+            let {partaId,partaName,partaTel,orderNo,id,partaLinkName,receiveAddress,productList,totalAmount,payAmount}=data
+             this.datasource=productList
+          })
+          
+          
+        }
+      },
+
+        /* 刷新表格 */
+        reload(where) {
+            this.$refs.table.reload({ pageNum: 1, where: where  });
+        },
+
+        handleNodeClick(data, node) {
+            this.curNodeData = data;
+            this.reload({ categoryLevelId: data.id });
+        },
+
+
+        // 单击获取id
+        cellClick(row) {
+            this.current = row
+            this.radio = row.id
+        },
+        handleClose() {
+            this.visible = false
+            this.current = null
+            this.radio = ''
+        },
+
+        selected() {
+            if (!this.current) {
+                return this.$message.warning('请至少选择一条数据')
+            }
+           let index=  this.currentData.findIndex(r=>r.id==this.current.id)
+           if(index!=-1){
+            return this.$message.error('选择的产品已经存在列表了')
+           }
+            this.$emit('changeParent', this.current,this.currentIndex)
+            this.handleClose()
+        },
+
+
+
+
+
+    }
+}
+</script>
+  
+<style lang="scss" scoped>
+.tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+}
+
+.table_col {
+    padding-left: 10px;
+
+    ::v-deep .el-table th.el-table__cell {
+        background: #f2f2f2;
+    }
+}
+
+.pagination {
+    text-align: right;
+    padding: 10px 0;
+}
+
+.btns {
+    text-align: center;
+    padding: 10px 0;
+}
+
+.topsearch {
+    margin-bottom: 15px;
+}
+</style>
+  

+ 127 - 0
src/views/saleManage/saleOrder/invoice/components/searchTable.vue

@@ -0,0 +1,127 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="100px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="发货单编码:" prop="docNo">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="params.docNo"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="订单编码:" prop="orderNo">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="params.orderNo"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+       <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
+        <el-form-item label="是否回执:" prop="replied">
+          <el-select v-model="params.replied" placeholder="请选择" class="w100" clearable>
+            <el-option
+              v-for="item in repliedOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="审核状态:" prop="reviewStatus">
+          <el-select v-model="params.reviewStatus" placeholder="请选择" class="w100" clearable>
+            <el-option
+              v-for="item in reviewStatusEnum"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>  
+      <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
+       
+        <el-form-item label="客户名称:" prop="contactName">
+          <el-input
+          placeholder="请输入"
+          style="max-width:320px"
+           v-model.trim="params.contactName" controls-position="right" >
+          </el-input>
+         
+        </el-form-item>
+        
+      </el-col> 
+      <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:4 }">
+      
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset">重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+<script>
+import {reviewStatusEnum} from '@/enum/dict';
+const repliedOptions=[
+  {value:0,label:'否'},
+  {value:1,label:'是'},
+]
+  export default {
+    data () {
+      // 默认表单数据
+      const defaultParams = {
+        contractName: '',
+        contractId:'',
+        docNo:'',
+        orderId:'',
+        replied:null,
+        reviewStatus:null
+      };
+      return {
+        reviewStatusEnum,
+        defaultParams,
+        repliedOptions,
+        // 表单数据
+        params: { ...defaultParams }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive () {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      //选择时间
+      changeDate(e){
+       this.createTime=e
+      },
+      /* 搜索 */
+      search () {
+        this.$emit('search', {
+          ...this.params
+        });
+      },
+      /*  重置 */
+      reset () {
+        this.createTime=[]
+        this.params = Object.assign({},{ ...this.defaultParams });
+        this.search();
+      }
+    }
+  };
+</script>

+ 293 - 0
src/views/saleManage/saleOrder/invoice/index.vue

@@ -0,0 +1,293 @@
+<template>
+    <div class="ele-body">
+      <el-card shadow="never" v-loading="loading">
+           <div class="ele-border-lighter form-content" v-loading="loading">
+              <search-table @search="reload"> </search-table>
+  
+              <!-- 数据表格 -->
+              <ele-pro-table
+                ref="table"
+                :columns="columns"
+                :datasource="datasource"
+                height="calc(100vh - 385px)"
+                full-height="calc(100vh - 116px)"
+                tool-class="ele-toolbar-form"
+                :selection.sync="selection"
+                cache-key="eomContactPageTable"
+              >
+                <!-- 表头工具栏 -->
+                <template v-slot:toolbar>
+                  <el-button
+                    size="small"
+                    type="primary"
+                    icon="el-icon-plus"
+                    class="ele-btn-icon"
+                    @click="openEdit('add',{})"
+                  >
+                    新建
+                  </el-button>
+                
+                  <el-button
+                    size="small"
+                    type="danger"
+                    el-icon-delete
+                    class="ele-btn-icon"
+                    @click="allDelBtn"
+                    :disabled="selection?.length===0"
+                  >
+                    批量删除
+                  </el-button>
+                </template>
+  
+                <!-- 查看详情列 -->
+             
+                <template v-slot:docNo="{ row }">
+                  <el-link type="primary" :underline="false" @click="openorderDetail(row)"> {{ row.docNo }}</el-link>
+                </template>
+                <!-- 操作列 -->
+                <template v-slot:action="{ row }">
+                  
+                  <el-link
+                    type="primary"
+                    :underline="false"
+                    icon="el-icon-edit"
+                    @click="openEdit('edit',row)"
+                  >
+                    修改
+                  </el-link>
+                  <el-popconfirm
+                    class="ele-action"
+                    title="确定要删除此信息吗?"
+                    @confirm="remove([row.id])"
+                  >
+                    <template v-slot:reference>
+                      <el-link
+                        type="danger"
+                        :underline="false"
+                        icon="el-icon-delete"
+                      >
+                        删除
+                      </el-link>
+                    </template>
+                  </el-popconfirm>
+                </template>
+              </ele-pro-table>
+            </div>
+      </el-card>
+  
+  
+      <add-invoice-dialog ref="invoiceDialogRef"  @done="reload"></add-invoice-dialog>
+      <detail-dialog ref="DetailDialogRef"></detail-dialog>
+  <!-- 多选删除弹窗 -->
+      <pop-modal :visible.sync="delVisible" content="是否确定删除?" @done="commitBtn"/>
+    </div>
+  </template>
+  
+  <script>
+  import searchTable from './components/searchTable.vue';
+  import addInvoiceDialog from './components/addInvoiceDialog.vue';
+  import detailDialog from './components/detailDialog.vue';
+  import popModal from '@/components/pop-modal';
+  import {reviewStatusEnum} from '@/enum/dict';
+  import {contactTypeTree} from '@/api/saleManage/contact';
+  import {getTableList, getDetail, UpdateInformation, addInformation,deleteInformation} from '@/api/saleManage/saleorder';
+  import {getSendTableList, getSendSaleOrderrecordDetail, UpdateSendInformation, addSendInformation,deleteSendInformation} from '@/api/saleManage/saleordersendrecord';
+  import dictMixins from '@/mixins/dictMixins';
+  
+  
+  export default {
+      mixins: [dictMixins],
+      components: {
+        searchTable,
+        popModal,
+        addInvoiceDialog,
+        detailDialog,
+      },
+      data() {
+        return {
+          activeComp: 'saleorder',
+          tabOptions: [
+            { key: 'saleorder', name: '销售订单' },
+            { key: 'invoice', name: '发货单' },
+            { key: 'returnorder', name: '退货单' }
+          ],
+          selection:[],   //单选中集合
+          delVisible:false,  //批量删除弹框状态
+          loading: false,  // 加载状态
+          columns: [
+            {
+               width: 45,
+               type: 'selection',
+               columnKey: 'selection',
+               align: 'center'
+            },
+            {
+              columnKey: 'index',
+              label: '序号',
+              type: 'index',
+              width: 55,
+              align: 'center',
+              showOverflowTooltip: true,
+              fixed: 'left'
+            },
+            {
+              prop: 'docNo',
+              label: '发货编码',
+              align: 'center',
+              slot: 'docNo',
+              showOverflowTooltip: true,
+              minWidth: 200
+            },
+            {
+              prop: 'orderNo',
+              label: '订单编码',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 200
+            }, 
+            {
+              prop: 'contactName',
+              label: '客户名称',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 180,
+            },
+            {
+              prop: 'replied',
+              label: '是否回执',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 200,
+              formatter: (_row, _column, cellValue) => {
+              return _row.replied==1?'是':'否';
+            }
+            },
+            {
+              prop: 'reviewStatus',
+              label: '状态',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 200,
+              formatter: (_row, _column, cellValue) => {
+              return reviewStatusEnum[_row.reviewStatus].label;
+            }
+            },
+            {
+              prop: 'createTime',
+              label: '创建时间',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 170
+            },
+            {
+              columnKey: 'action',
+              label: '操作',
+              width: 230,
+              align: 'center',
+              resizable: false,
+              slot: 'action',
+              showOverflowTooltip: true,
+              fixed: 'right',
+            }
+          ]
+        };
+      },
+      computed: {},
+   
+      methods: {
+      
+      
+        /* 表格数据源 */
+        datasource({ page, limit, where, order }) {
+          return getSendTableList({
+            pageNum: page,
+            size: limit,
+            ...where
+          });
+        },
+      
+    
+        /* 刷新表格 */
+        reload(where) {
+          this.$refs.table.reload({ page: 1, where });
+        },
+        
+        //新增编辑
+        openEdit(type,row) {
+          this.$refs.invoiceDialogRef.open( type,row);
+          this.$refs.invoiceDialogRef.$refs.form &&
+          this.$refs.invoiceDialogRef.$refs.form.clearValidate();
+        },
+       
+        //批量删除
+        allDelBtn(){
+          if(this.selection.length===0) return
+          this.delVisible=true
+        },
+        
+        //删除接口
+        remove(delData) {
+            deleteSendInformation(delData).then((res) => {
+            this.$message.success('删除成功!');
+            this.reload();
+          });
+        },
+  
+      //删除弹框确定
+        commitBtn(){
+          const dataId=this.selection.map(v=>v.id)
+          this.remove(dataId)
+        },
+  
+      //查看详情
+      openorderDetail(row){
+          this.$refs.DetailDialogRef.open(row);
+        },
+  
+      }
+    };
+  </script>
+  
+  <style lang="scss" scoped>
+  .ele-body{
+    padding-top:0;
+    padding-bottom: 0;
+  }
+ :deep .el-card__body{
+  padding: 0;
+}
+  :deep(.el-link--inner){
+    margin-left: 0px !important;
+  }
+  
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+  
+  .switch_left ul .active{
+    border-top: 4px solid var(--color-primary);
+      color: var(--color-primary-5);
+  }
+  .switch{
+    padding-bottom: 20px;
+  }
+  
+  .el-dropdown-link {
+      cursor: pointer;
+      color: var(--color-primary-5);
+    }
+    .el-icon-arrow-down {
+      font-size: 12px;
+    }
+  </style>
+  

+ 582 - 0
src/views/saleManage/saleOrder/returnGoods/components/addInvoiceDialog.vue

@@ -0,0 +1,582 @@
+<template>
+  <ele-modal
+  custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    v-if="visible"
+    :visible.sync="visible"
+    :title="title"
+    :close-on-click-modal="false"
+    width="80%"
+    @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
+                clearable
+                v-model="form.orderNo"
+                @click.native="handleOrderBtn"
+                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-col>
+        </el-row>
+
+
+
+      
+    
+      <headerTitle title="产品清单" style="margin-top:30px;"></headerTitle>
+        <ele-pro-table ref="table" :needPage="false" :columns="competAnalysisListcolumns"  :toolkit="[]" :datasource="form.productList" row-key="id">
+          <!-- <template v-slot:toolbar>
+        <div class="headbox">
+        <span class="amount">总计:{{form.totalAmount}}元</span>
+        <span class="amount">应付金额:{{form.payAmount}}元</span>
+      </div>
+      </template> -->
+          <template v-slot:technicalDrawings="{ row }">
+            <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
+            <el-link 
+            v-for="link in row.technicalDrawings" :key="link.id"
+                         type="primary" :underline="false"
+                         @click="downloadFile(link)"> {{ link.name }}</el-link>
+                        </div>
+                        </template>
+          <template v-slot:remark="{ row }">
+            <el-input
+                clearable
+                v-model="row.remark"
+                type="textarea"
+                placeholder="请输入"
+              />
+          </template>
+         <!-- 操作列 -->
+      <template v-slot:action="{ row }">
+        <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(row)">
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+                     
+          </ele-pro-table>
+       
+    </el-form>
+
+    <div slot="footer" class="footer">
+      <el-button type="primary" @click="save">保存</el-button>
+      <el-button @click="cancel">返回</el-button>
+    </div>
+    <orderListDialog ref="orderListDialogRef" @changeParent="changeOrder"></orderListDialog>
+  </ele-modal>
+</template>
+
+<script>
+import { emailReg, phoneReg,numberReg } from 'ele-admin';
+import {acceptUnpackoptions} from '@/enum/dict';
+import fileUpload from '@/components/upload/fileUpload';
+import dictMixins from '@/mixins/dictMixins';
+import deptSelect from '@/components/CommomSelect/dept-select.vue';
+import personSelect from '@/components/CommomSelect/person-select.vue';
+import parentList from '@/views/saleManage/contact/components/parentList.vue'
+import { getDetail} from '@/api/contractManage/contractBook';
+import { getSaleOrderDetail, UpdateInformation, addInformation,deleteInformation,updateStatus} from '@/api/saleManage/saleorder';
+import { addSendInformation,UpdateSendInformation,getSendSaleOrderrecordDetail} from '@/api/saleManage/saleordersendrecord';
+import {getcontactlink} from '@/api/saleManage/businessFollow';
+import {listOrganizations} from '@/api/system/organization';
+import orderListDialog from './orderListDialog.vue';
+import {copyObj} from '@/utils/util';
+
+
+export default {
+    mixins: [dictMixins],
+    components: {
+      fileUpload,
+      deptSelect,
+      orderListDialog,
+      parentList,
+      personSelect
+    },
+    data() {
+      let formDef = {
+          id:'',
+          contractId: '',
+          sendFiles:[],
+          contractName: '',
+          receiveAddress:'',
+          carNo:'',
+          carId:'',
+          linkName:'',
+          linkPhone:'',
+          orderNo:'',
+          orderId:''
+        };
+   
+      return {
+        detailData:{},   
+        payWayOptions:[],
+        delDetailIds:[],
+        linkNameOptions:[],
+        acceptUnpackoptions,
+        visible: false,
+        title: '',
+        row: {},
+        activeName: 'base',
+        formDef,
+        form: copyObj(formDef),
+        tableBankData: [],
+        tableLinkData: [],
+     // 组织机构树形结构数据
+       groupTreeData: [],
+       groupData:[],
+        rules: {        
+          partaName: [
+            { required: true, message: '请选择客户名称', trigger: 'change' }
+          ],
+        },
+        competAnalysisListcolumns: [
+        
+        {
+        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: 160,
+        prop: 'singlePrice',
+        label: '单价',
+        slot: 'singlePrice'
+      },
+      {
+        width: 120,
+        prop: 'totalCount',
+        label: '数量',
+        slot: 'totalCount'
+      },
+      {
+        width: 120,
+        prop: 'totalPrice',
+        label: '销售总金额',
+        slot: 'totalPrice',
+        formatter: (_row, _column, cellValue) => {
+            return _row.totalPrice+'元'
+          }
+      },
+      {
+        width: 120,
+        prop: 'measuringUnit',
+        label: '计量单位',
+        slot: 'measuringUnit'
+      },
+      {
+        width: 120,
+        prop: 'deliveryDays',
+        label: '交期(天)',
+        slot: 'deliveryDays'
+      },
+      {
+        width: 200,
+        prop: 'guaranteePeriod',
+        label: '质保期',
+        slot: 'guaranteePeriod',
+        formatter: (_row, _column, cellValue) => {
+            return _row.guaranteePeriod+_row.guaranteePeriodUnitName
+          }
+      },
+      // {
+      //   width: 120,
+      //   prop: 'guaranteePeriodUnitCode',
+      //   label: '',
+      //   slot: 'guaranteePeriodUnitCode'
+      // },
+       {
+        width: 120,
+        prop: 'technicalAnswerName',
+        label: '技术答疑人',
+        slot: 'technicalAnswerName'
+      },
+      {
+        width: 220,
+        prop: 'technicalParams',
+        label: '技术参数',
+        slot: 'technicalParams'
+      },
+      {
+        width:240,
+        prop: 'technicalDrawings',
+        label: '技术图纸',
+        slot: 'technicalDrawings',
+        formatter: (_row, _column, cellValue) => {
+            return _row.guaranteePeriod+_row.guaranteePeriodUnitName
+          }
+
+      },
+      {
+        width: 220,
+        prop: 'remark',
+        label: '备注',
+        slot: 'remark'
+      },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 120,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          fixed:'right',
+          showOverflowTooltip: true
+        }
+         ],
+        // 提交状态
+        loading: false,
+        // 是否是修改
+        isUpdate: false,
+      };
+    },
+    computed: {
+     
+      allcountAmount(){
+        return this.$store.state.order.allcountAmount
+      }
+    },
+   
+    methods: {
+      //删除产品
+      remove(row) {
+        if( this.form.productList.length===1) return this.$message.error('必须要留一个产品')
+      let index = this.form.productList.findIndex((n) => n.key == row.key);
+      if (index !== -1) {
+        this.form.productList.splice(index, 1);
+      }
+    },
+  
+       //选择订单回调
+       changeOrder(obj){
+        this.form = Object.assign({},this.form,{
+          orderId: obj.id,
+          orderNo: obj.orderNo,
+        })
+        this.getSaleOrderDetail(obj.id)
+        
+      },
+      //获取订单详情
+      async getSaleOrderDetail(id){
+        this.loading = true;
+        const data = await getSaleOrderDetail(id);
+        this.loading = false;
+        console.log(this.form,'9999999')
+        if (data) {
+          this.$nextTick(()=>{
+            let {partaId,partaName,partaTel,orderNo,id,partaLinkName,receiveAddress,productList,totalAmount,payAmount}=data
+            this.form =Object.assign({}, this.form,{contactId:partaId,contactName:partaName,linkName:partaLinkName,linkPhone:partaTel,orderNo,orderId:id,receiveAddress,productList,totalAmount,payAmount}) ;
+         console.log(this.form,'7777777777777777')
+          })
+          
+          
+        }
+      },
+
+      //发货单详情
+      async getSendSaleOrderDetail(id){
+        this.loading = true;
+        const data = await getSendSaleOrderrecordDetail(id);
+        this.loading = false;
+        if (data) {
+          this.$nextTick(()=>{
+            this.form = data;
+          })          
+        }
+      },
+
+   //更新联系人数据
+   async getLinkInfo(contactId) {
+      const data = await getcontactlink({contactId});
+         if(data&&data?.length){
+           this.linkNameOptions=data
+         }
+    },
+      selectFocus(){
+   if(this.linkNameOptions.length===0){
+    return this.$message.error('请先选择名称')
+   }
+    },
+
+ 
+  
+    handHead(){
+      
+      let item={
+          id:this.form.partbLinkId
+        }
+        this.$refs.headRef.open(item)
+     },
+
+
+
+  
+    
+
+    
+      //选择订单弹框
+       handleOrderBtn(){
+         let item = {
+           id: this.form.orderId
+      }
+        this.$refs.orderListDialogRef.open(item)
+    },
+
+    
+      //打开新增编辑弹框
+      async open(type, row,orderId) {
+        this.title = type==='add'?'新增':'修改';
+        this.row = row;
+        this.visible = true;
+        if(orderId){
+          this.getSaleOrderDetail(orderId)
+        }
+        if(row&&row?.id){
+          this.getSendSaleOrderDetail(row?.id)
+        }
+        
+        if (type == 'add') {
+          this.isUpdate = false;
+        } else {
+          this.isUpdate = true;
+         
+        }
+      },
+
+      salesmanChange(val, info){
+        this.otherForm.salesmanName = info.name;
+      },
+      settlementModeChange(info){
+        this.form.settlementModeName = info.dictValue;
+      },
+      ifChiefChange(value, idx){
+        if(value === 1){
+          this.tableLinkData.forEach(e => e.ifChief = 0);
+          this.tableLinkData[idx].ifChief = 1;
+        }
+      },
+ 
+    
+     getValidate() {
+        return Promise.all([
+            new Promise((resolve, reject) => {
+              this.$refs.form.validate((valid) => {
+                if (!valid) {
+                  reject(false);
+                } else {
+                  resolve(true);
+                }
+              });
+            })
+          
+          ]);
+     },
+      async save() {
+        try {
+           await this.getValidate();
+           // 表单验证通过,执行保存操作
+           this.loading = true;
+      
+        if (!this.isUpdate) {
+          delete this.form.id;
+        } 
+       
+
+        if (this.isUpdate) {
+          UpdateSendInformation(this.form)
+            .then((res) => {
+              this.loading = false;
+              this.$message.success("修改成功");
+              this.cancel();
+              this.$emit('done');
+            })
+            .catch((e) => {
+              //this.loading = false;
+            });
+        } else {
+          addSendInformation(this.form)
+            .then((res) => {
+              this.loading = false;
+              this.$message.success("新增成功");
+              this.cancel();
+              this.$emit('done');
+            })
+            .catch((e) => {
+              //this.loading = false;
+            });
+          }
+        } catch (error) {
+          console.log(error)
+          // 表单验证未通过,不执行保存操作
+        }
+       
+      },
+      cancel() {
+        this.$nextTick(() => {
+          this.activeName = 'base';
+          // 关闭后,销毁所有的表单数据
+          this.$refs['otherForm'] &&  this.$refs['otherForm'].resetFields();
+          this.$refs['formRef'] &&  this.$refs['formRef'].resetFields();
+          this.$store.commit('order/clearUserData');
+          this.form = copyObj(this.formDef)
+          this.visible = false;
+        })
+      },
+ 
+    
+
+    }
+  };
+</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>

+ 381 - 0
src/views/saleManage/saleOrder/returnGoods/components/detailDialog.vue

@@ -0,0 +1,381 @@
+<template>
+    <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+      :centered="true"
+      v-if="visible"
+      :visible.sync="visible"
+      :title="title"
+      :close-on-click-modal="false"
+      width="80%"
+      @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="contactName"
+              style="margin-bottom: 16px"
+            >
+            {{form.contactName}}
+            </el-form-item>
+            <el-form-item
+              label="客户联系人:"
+              prop="linkName"
+              style="margin-bottom: 16px"
+            >
+            {{form.linkName}}
+            </el-form-item>
+            <el-form-item
+              label="客户电话:"
+              prop="linkPhone"
+              style="margin-bottom: 16px"
+            >
+            {{form.linkPhone}}
+            </el-form-item>
+       
+            <el-form-item
+              label="客户地址:"
+              prop="partaAddress"
+              style="margin-bottom: 16px"
+            >
+            {{form.receiveAddress}}
+            </el-form-item>
+            <el-form-item
+              label="发货附件:"
+              prop="sendFiles"
+              style="margin-bottom: 16px"
+            >
+            <div v-if="detailData.sendFiles && detailData.sendFiles?.length">
+               <el-link v-for="link in detailData.sendFiles" :key="link.id"
+                         type="primary" :underline="false"
+                         @click="downloadFile(link)"> {{ link.name }}</el-link> 
+                        </div>
+            </el-form-item>
+          </el-col>
+
+
+
+
+          <el-col :span="12">
+            <el-form-item
+              label="车牌号:"
+              prop="carNo"
+              style="margin-bottom: 16px"
+            >
+            {{form.carNo}}
+            </el-form-item>
+            <el-form-item
+              label="发货单据编码:"
+              prop="docNo"
+              style="margin-bottom: 16px"
+            >
+            {{form.docNo}}
+            </el-form-item>
+            <el-form-item
+              label="制单人:"
+              prop="makerName"
+              style="margin-bottom: 16px"
+            >
+            {{form.makerName}}
+            </el-form-item>
+            <el-form-item prop="orderNo" label="订单编码:" >
+              {{form.orderNo}}
+              </el-form-item>
+              <el-form-item prop="replied" label="是否回执:">
+                {{form.replied==1?'是':'否'}}
+              </el-form-item>
+
+              <el-form-item
+              label="审核状态:"
+              prop="reviewStatus"
+              style="margin-bottom: 16px"
+            >
+            {{reviewStatusEnum[form.reviewStatus].label}}
+            </el-form-item>
+
+           
+          </el-col>
+       </el-row>
+
+   </el-form>
+
+
+       
+        <headerTitle title="产品清单"></headerTitle>
+        <ele-pro-table ref="table" :needPage="false" :columns="competAnalysisListcolumns"  :toolkit="[]" :datasource="detailData.productList" row-key="id">
+          <!-- <template v-slot:toolbar>
+        <div class="headbox">
+        <span class="amount">总计:{{detailData.totalAmount}}元</span>
+        <span class="amount">应付金额:{{detailData.payAmount}}元</span>
+      </div>
+      </template> -->
+          <template v-slot:technicalDrawings="{ row }">
+            <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
+            <el-link 
+            v-for="link in row.technicalDrawings" :key="link.id"
+                         type="primary" :underline="false"
+                         @click="downloadFile(link)"> {{ link.name }}</el-link>
+                        </div>
+                        </template>
+                     
+          </ele-pro-table>
+       
+      <div slot="footer" class="footer">
+        <el-button @click="cancel">返回</el-button>
+      </div>
+    </ele-modal>
+  </template>
+  
+  <script>
+  import { getSendSaleOrderrecordDetail} from '@/api/saleManage/saleordersendrecord';
+  import {getFile} from '@/api/system/file';
+  import dictMixins from '@/mixins/dictMixins';
+  import {download } from '@/utils/file';
+  import {reviewStatusEnum} from '@/enum/dict';
+  import {copyObj} from '@/utils/util';
+  
+  
+  export default {
+      mixins: [dictMixins],
+      data() {
+      
+        return {
+          reviewStatusEnum,
+          visible: false,
+          detailId:'',
+          title: '详情',
+          row: {},
+          activeName: 'base',
+          form:{
+            orderFiles:[{name:'222'}]
+          },
+          rules:{},
+          detailData:{},
+          receiptPaymentListcolumns:[
+          {
+          width: 45,
+          type: 'index',
+          columnKey: 'index',
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          width: 200,
+          prop: 'moneyName',
+          label: '款项名称',
+          slot: 'moneyName'
+        },
+        {
+          width: 100,
+          prop: 'price',
+          label: '金额',
+          slot: 'price',
+          formatter: (_row, _column, cellValue) => {
+              return _row.price+'元'
+            }
+        },
+        {
+          width: 100,
+          prop: 'ratio',
+          label: '比例',
+          slot: 'ratio',
+          formatter: (_row, _column, cellValue) => {
+              return _row.ratio+'%'
+            }
+        },
+        {
+          width: 160,
+          prop: 'deadLine',
+          label: '截止日期',
+          slot: 'deadLine'
+        },
+        {
+          prop: 'remark',
+          label: '	说明',
+          slot: 'remark'
+        }
+          ],
+          competAnalysisListcolumns: [
+        
+          {
+          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: 160,
+          prop: 'singlePrice',
+          label: '单价',
+          slot: 'singlePrice'
+        },
+        {
+          width: 120,
+          prop: 'totalCount',
+          label: '数量',
+          slot: 'totalCount'
+        },
+        {
+          width: 120,
+          prop: 'totalPrice',
+          label: '销售总金额',
+          slot: 'totalPrice',
+          formatter: (_row, _column, cellValue) => {
+              return _row.totalPrice+'元'
+            }
+        },
+        {
+          width: 120,
+          prop: 'measuringUnit',
+          label: '计量单位',
+          slot: 'measuringUnit'
+        },
+        {
+          width: 120,
+          prop: 'deliveryDays',
+          label: '交期(天)',
+          slot: 'deliveryDays'
+        },
+        {
+          width: 200,
+          prop: 'guaranteePeriod',
+          label: '质保期',
+          slot: 'guaranteePeriod',
+          formatter: (_row, _column, cellValue) => {
+              return _row.guaranteePeriod+_row.guaranteePeriodUnitName
+            }
+        },
+        // {
+        //   width: 120,
+        //   prop: 'guaranteePeriodUnitCode',
+        //   label: '',
+        //   slot: 'guaranteePeriodUnitCode'
+        // },
+         {
+          width: 120,
+          prop: 'technicalAnswerName',
+          label: '技术答疑人',
+          slot: 'technicalAnswerName'
+        },
+        {
+          width: 220,
+          prop: 'technicalParams',
+          label: '技术参数',
+          slot: 'technicalParams'
+        },
+        {
+          width:240,
+          prop: 'technicalDrawings',
+          label: '技术图纸',
+          slot: 'technicalDrawings',
+          formatter: (_row, _column, cellValue) => {
+              return _row.guaranteePeriod+_row.guaranteePeriodUnitName
+            }
+
+        },
+        {
+          width: 220,
+          prop: 'remark',
+          label: '备注',
+          slot: 'remark'
+        }
+           ],
+        };
+      },
+      methods: {
+     
+        async open(row) {
+          this.form = row;
+          this.visible = true;
+          this.getDetailData(row.id)
+          this.detailId=row.id
+        },
+  
+        cancel() {
+          this.$nextTick(() => {
+            // 关闭后,销毁所有的表单数据
+            this.form = copyObj(this.formDef),
+            this.otherForm = copyObj(this.otherFormDef),
+            this.tableBankData = []
+            this.tableLinkData = []
+            this.visible = false;
+          })
+        },
+        downloadFile(file){
+        getFile({ objectName: file.storePath }, file.name);
+      },
+        async getDetailData (id) {
+          this.loading = true;
+          const data = await getSendSaleOrderrecordDetail(id);
+          this.loading = false;
+          if (data) {
+            this.detailData = data;
+            
+          }
+        },
+  
+      }
+    };
+  </script>
+  
+  <style scoped lang="scss">
+  .ele-dialog-form{
+    .el-form-item{
+      margin-bottom: 10px;
+    }
+  }
+
+  .headbox{
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  .amount{
+    font-size: 14px;
+    font-weight: bold;
+    margin-right: 20px;
+  }
+}
+  </style>
+  

+ 240 - 0
src/views/saleManage/saleOrder/returnGoods/components/orderListDialog.vue

@@ -0,0 +1,240 @@
+<template>
+      <el-dialog title="选择订单"  custom-class="ele-dialog-form long-dialog-form" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false" top="5vh"
+        :close-on-press-escape="false" append-to-body width="80%">
+        <el-card shadow="never">
+            <searchTable @search="reload"></searchTable>
+            <ele-pro-table ref="table" :columns="columns" :datasource="datasource" row-key="id"
+                        height="calc(100vh - 500px)" class="dict-table" @cell-click="cellClick">
+                        <!-- 表头工具栏 -->
+                        <template v-slot:action="{ row }">
+                            <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
+                        </template>
+                    </ele-pro-table>
+     </el-card>
+
+        <div class="btns" slot="footer">
+            <el-button type="primary" size="small" @click="selected">选择</el-button>
+            <el-button size="small" @click="handleClose">关闭</el-button>
+        </div>
+
+    </el-dialog>
+</template>
+  
+<script>
+
+
+import {contactTypeTree} from '@/api/saleManage/contact';
+import searchTable from '@/views/saleManage/saleOrder/components/searchTable.vue';
+import {getTableList} from '@/api/saleManage/saleorder';
+import AssetTree from '@/components/AssetTree';
+export default {
+    components: {
+        AssetTree,
+        searchTable
+    },
+ 
+    data() {
+        return {
+            visible: false,
+            currentIndex:null,
+             columns: [
+                {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+                    action: 'action',
+                    slot: 'action',
+                    align: 'center',
+                    label: '选择',
+                   
+                },
+             
+          {
+            prop: 'orderNo',
+            label: '订单编码',
+            align: 'center',
+            slot: 'orderNo',
+            showOverflowTooltip: true,
+            minWidth: 200
+          }, 
+          {
+            prop: 'contractName',
+            label: '合同名称',
+            align: 'center',
+            slot: 'contractName',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'deliveryDate',
+            label: '交货日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'saleTypeName',
+            label: '销售类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'partaName',
+            label: '客户名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180,
+          },
+          {
+            prop: 'partaLinkName',
+            label: '客户联系人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+          },
+         
+          {
+            prop: 'partaTel',
+            label: '客户联系电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+          },
+          {
+            prop: 'partbName',
+            label: '售出方名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+          },
+          {
+            prop: 'partbLinkName',
+            label: '售出方联系人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+          },
+          {
+            prop: 'partbTel',
+            label: '售出方联系电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+          },
+          {
+            prop: 'payAmount',
+            label: '应付金额(元)',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+               ],
+
+            radio: null,
+        }
+    },
+
+    methods: {
+        open(item,currentIndex) {
+            this.currentIndex = currentIndex
+            if (item&&item.id) {
+                this.radio = item.id
+            }
+           
+            this.visible = true
+        },
+
+
+        /* 表格数据源 */
+        datasource({ page, limit, where, order }) {
+            return getTableList({
+                pageNum: page,
+                size: limit,
+                ...where
+            });
+        },
+
+        /* 刷新表格 */
+        reload(where) {
+            this.$refs.table.reload({ pageNum: 1, where: where  });
+        },
+
+        handleNodeClick(data, node) {
+            this.reload({ categoryId: data.id });
+        },
+
+
+        // 单击获取id
+        cellClick(row) {
+            this.current = row
+            console.log(row)
+            this.radio = row.id
+        },
+        handleClose() {
+            this.visible = false
+            this.current = null
+            this.radio = ''
+        },
+
+        selected() {
+            if (!this.current) {
+                return this.$message.warning('请至少选择一条数据')
+            }
+            this.$emit('changeParent', this.current,this.currentIndex)
+            this.handleClose()
+        },
+
+
+
+
+
+    }
+}
+</script>
+  
+<style lang="scss" scoped>
+.tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+}
+
+.table_col {
+    padding-left: 10px;
+
+    ::v-deep .el-table th.el-table__cell {
+        background: #f2f2f2;
+    }
+}
+
+.pagination {
+    text-align: right;
+    padding: 10px 0;
+}
+
+.btns {
+    text-align: center;
+    padding: 10px 0;
+}
+
+.topsearch {
+    margin-bottom: 15px;
+}
+</style>
+  

+ 127 - 0
src/views/saleManage/saleOrder/returnGoods/components/searchTable.vue

@@ -0,0 +1,127 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="100px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="发货单编码:" prop="docNo">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="params.docNo"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="订单编码:" prop="orderNo">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="params.orderNo"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+       <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
+        <el-form-item label="是否回执:" prop="replied">
+          <el-select v-model="params.replied" placeholder="请选择" class="w100" clearable>
+            <el-option
+              v-for="item in repliedOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="审核状态:" prop="reviewStatus">
+          <el-select v-model="params.reviewStatus" placeholder="请选择" class="w100" clearable>
+            <el-option
+              v-for="item in reviewStatusEnum"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>  
+      <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
+       
+        <el-form-item label="客户名称:" prop="contactName">
+          <el-input
+          placeholder="请输入"
+          style="max-width:320px"
+           v-model.trim="params.contactName" controls-position="right" >
+          </el-input>
+         
+        </el-form-item>
+        
+      </el-col> 
+      <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:4 }">
+      
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset">重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+<script>
+import {reviewStatusEnum} from '@/enum/dict';
+const repliedOptions=[
+  {value:0,label:'否'},
+  {value:1,label:'是'},
+]
+  export default {
+    data () {
+      // 默认表单数据
+      const defaultParams = {
+        contractName: '',
+        contractId:'',
+        docNo:'',
+        orderId:'',
+        replied:null,
+        reviewStatus:null
+      };
+      return {
+        reviewStatusEnum,
+        defaultParams,
+        repliedOptions,
+        // 表单数据
+        params: { ...defaultParams }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive () {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      //选择时间
+      changeDate(e){
+       this.createTime=e
+      },
+      /* 搜索 */
+      search () {
+        this.$emit('search', {
+          ...this.params
+        });
+      },
+      /*  重置 */
+      reset () {
+        this.createTime=[]
+        this.params = Object.assign({},{ ...this.defaultParams });
+        this.search();
+      }
+    }
+  };
+</script>

+ 304 - 0
src/views/saleManage/saleOrder/returnGoods/index.vue

@@ -0,0 +1,304 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+         <div class="ele-border-lighter form-content" v-loading="loading">
+            <search-table @search="reload"> </search-table>
+
+            <!-- 数据表格 -->
+            <ele-pro-table
+              ref="table"
+              :columns="columns"
+              :datasource="datasource"
+              height="calc(100vh - 385px)"
+              full-height="calc(100vh - 116px)"
+              tool-class="ele-toolbar-form"
+              :selection.sync="selection"
+              cache-key="eomContactPageTable"
+            >
+              <!-- 表头工具栏 -->
+              <template v-slot:toolbar>
+                <el-button
+                  size="small"
+                  type="primary"
+                  icon="el-icon-plus"
+                  class="ele-btn-icon"
+                  @click="openEdit('add',{})"
+                >
+                  新建
+                </el-button>
+              
+                <el-button
+                  size="small"
+                  type="danger"
+                  el-icon-delete
+                  class="ele-btn-icon"
+                  @click="allDelBtn"
+                  :disabled="selection?.length===0"
+                >
+                  批量删除
+                </el-button>
+              </template>
+
+              <!-- 查看详情列 -->
+           
+              <template v-slot:docNo="{ row }">
+                <el-link type="primary" :underline="false" @click="openorderDetail(row)"> {{ row.docNo }}</el-link>
+              </template>
+              <!-- 操作列 -->
+              <template v-slot:action="{ row }">
+                
+                <el-link
+                  type="primary"
+                  :underline="false"
+                  icon="el-icon-edit"
+                  @click="openEdit('edit',row)"
+                >
+                  修改
+                </el-link>
+                <el-popconfirm
+                  class="ele-action"
+                  title="确定要删除此信息吗?"
+                  @confirm="remove([row.id])"
+                >
+                  <template v-slot:reference>
+                    <el-link
+                      type="danger"
+                      :underline="false"
+                      icon="el-icon-delete"
+                    >
+                      删除
+                    </el-link>
+                  </template>
+                </el-popconfirm>
+              </template>
+            </ele-pro-table>
+          </div>
+    </el-card>
+
+
+    <add-invoice-dialog ref="invoiceDialogRef"  @done="reload"></add-invoice-dialog>
+    <detail-dialog ref="DetailDialogRef"></detail-dialog>
+<!-- 多选删除弹窗 -->
+    <pop-modal :visible.sync="delVisible" content="是否确定删除?" @done="commitBtn"/>
+  </div>
+</template>
+
+<script>
+import searchTable from './components/searchTable.vue';
+import addInvoiceDialog from './components/addInvoiceDialog.vue';
+import detailDialog from './components/detailDialog.vue';
+import popModal from '@/components/pop-modal';
+import {reviewStatusEnum} from '@/enum/dict';
+import {contactTypeTree} from '@/api/saleManage/contact';
+import {getTableList, getDetail, UpdateInformation, addInformation,deleteInformation} from '@/api/saleManage/saleorder';
+import {getReturnTableList,deleteReturnInformation} from '@/api/saleManage/returnGoods';
+import dictMixins from '@/mixins/dictMixins';
+
+
+export default {
+    mixins: [dictMixins],
+    components: {
+      searchTable,
+      popModal,
+      addInvoiceDialog,
+      detailDialog,
+    },
+    data() {
+      return {
+        activeComp: 'saleorder',
+        tabOptions: [
+          { key: 'saleorder', name: '销售订单' },
+          { key: 'invoice', name: '发货单' },
+          { key: 'returnorder', name: '退货单' }
+        ],
+        selection:[],   //单选中集合
+        delVisible:false,  //批量删除弹框状态
+        loading: false,  // 加载状态
+        columns: [
+          {
+             width: 45,
+             type: 'selection',
+             columnKey: 'selection',
+             align: 'center'
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'returnNo',
+            label: '退货编码',
+            align: 'center',
+            slot: 'returnNo',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'discountAmount',
+            label: '退货金额',
+            align: 'center',
+            slot: 'discountAmount',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'orderNo',
+            label: '订单编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          }, 
+          {
+            prop: 'contactName',
+            label: '客户名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180,
+          },
+          {
+            prop: 'payAmount',
+            label: '应付金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180,
+          },
+          {
+            prop: 'totalAmount',
+            label: '订单总金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180,
+          },
+          {
+            prop: 'reviewStatus',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (_row, _column, cellValue) => {
+            return reviewStatusEnum[_row.reviewStatus].label;
+          }
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 230,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true,
+            fixed: 'right',
+          }
+        ]
+      };
+    },
+    computed: {},
+ 
+    methods: {
+    
+    
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getReturnTableList({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
+      },
+    
+  
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
+      
+      //新增编辑
+      openEdit(type,row) {
+        this.$refs.invoiceDialogRef.open( type,row);
+        this.$refs.invoiceDialogRef.$refs.form &&
+        this.$refs.invoiceDialogRef.$refs.form.clearValidate();
+      },
+     
+      //批量删除
+      allDelBtn(){
+        if(this.selection.length===0) return
+        this.delVisible=true
+      },
+      
+      //删除接口
+      remove(delData) {
+          deleteSendInformation(delData).then((res) => {
+          this.$message.success('删除成功!');
+          this.reload();
+        });
+      },
+
+    //删除弹框确定
+      commitBtn(){
+        const dataId=this.selection.map(v=>v.id)
+        this.remove(dataId)
+      },
+
+    //查看详情
+    openorderDetail(row){
+        this.$refs.DetailDialogRef.open(row);
+      },
+
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+.ele-body{
+  padding-top:0;
+  padding-bottom: 0;
+}
+:deep .el-card__body{
+padding: 0;
+}
+:deep(.el-link--inner){
+  margin-left: 0px !important;
+}
+
+.sys-organization-list {
+  height: calc(100vh - 264px);
+  box-sizing: border-box;
+  border-width: 1px;
+  border-style: solid;
+  overflow: auto;
+}
+.sys-organization-list :deep(.el-tree-node__content) {
+  height: 40px;
+  & > .el-tree-node__expand-icon {
+    margin-left: 10px;
+  }
+}
+
+.switch_left ul .active{
+  border-top: 4px solid var(--color-primary);
+    color: var(--color-primary-5);
+}
+.switch{
+  padding-bottom: 20px;
+}
+
+.el-dropdown-link {
+    cursor: pointer;
+    color: var(--color-primary-5);
+  }
+  .el-icon-arrow-down {
+    font-size: 12px;
+  }
+</style>