yusheng 2 лет назад
Родитель
Сommit
64816fd158
23 измененных файлов с 3091 добавлено и 2881 удалено
  1. 10 0
      src/api/contractManage/contractBook.js
  2. 22 13
      src/api/saleManage/accountstatement.js
  3. 10 0
      src/api/saleManage/returnGoods.js
  4. 23 18
      src/api/saleManage/saleorder.js
  5. 19 10
      src/api/saleManage/saleordersendrecord.js
  6. 30 9
      src/views/contractManage/contractBook/components/addDialog.vue
  7. 12 4
      src/views/contractManage/contractBook/components/detailDialog.vue
  8. 109 81
      src/views/contractManage/contractBook/index.vue
  9. 1 1
      src/views/saleManage/businessOpportunity/components/headList.vue
  10. 329 325
      src/views/saleManage/saleOrder/accountstatement/components/addAccountDialog.vue
  11. 21 2
      src/views/saleManage/saleOrder/accountstatement/components/detailDialog.vue
  12. 324 301
      src/views/saleManage/saleOrder/accountstatement/index.vue
  13. 26 11
      src/views/saleManage/saleOrder/components/addDialog.vue
  14. 25 13
      src/views/saleManage/saleOrder/components/inventoryTable.vue
  15. 143 107
      src/views/saleManage/saleOrder/index.vue
  16. 296 287
      src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue
  17. 374 357
      src/views/saleManage/saleOrder/invoice/components/detailDialog.vue
  18. 17 129
      src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue
  19. 307 281
      src/views/saleManage/saleOrder/invoice/index.vue
  20. 410 393
      src/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog.vue
  21. 393 373
      src/views/saleManage/saleOrder/returnGoods/components/detailDialog.vue
  22. 5 2
      src/views/saleManage/saleOrder/returnGoods/components/inventoryTable.vue
  23. 185 164
      src/views/saleManage/saleOrder/returnGoods/index.vue

+ 10 - 0
src/api/contractManage/contractBook.js

@@ -91,3 +91,13 @@ export async function enterprisePage(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+/**
+ * 提交
+ */
+export async function submit(data) {
+  const res = await request.post(`/bpm/contractApprove/submit`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 22 - 13
src/api/saleManage/accountstatement.js

@@ -33,6 +33,19 @@ export async function UpdatetAccountstatement(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+/**
+ * 查询待导入的账单明细
+ */
+export async function getsearchDetailListByType(params) {
+  const res = await request.get(
+    `/eom/accountstatement/searchDetailListByType`,
+    { params }
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 /**
  * 新增信息
  */
@@ -55,17 +68,13 @@ export async function deletetAccountstatement(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
-
-
-
 /**
- * 查询待导入的账单明细
- */
-export async function getsearchDetailListByType(params) {
-    const res = await request.get(`/eom/accountstatement/searchDetailListByType`, {params});
-    if (res.data.code == 0) {
-      return res.data.data;
-    }
-    return Promise.reject(new Error(res.data.message));
-  }
+* 提交
+*/
+export async function submit(data) {
+ const res = await request.post(`/bpm/accountStatementApprove/submit`, data);
+ if (res.data.code == 0) {
+   return res.data.data;
+ }
+ return Promise.reject(new Error(res.data.message));
+}

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

@@ -56,6 +56,16 @@ export async function deleteReturnInformation(data) {
 }
 
 
+/**
+ * 提交
+ */
+export async function submit(data) {
+  const res = await request.post(`/bpm/salesOrderReturnApprove/submit`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
 
 

+ 23 - 18
src/api/saleManage/saleorder.js

@@ -14,7 +14,9 @@ export async function getTableList(params) {
  * 查询仓库列表
  */
 export async function getWarehouseList() {
-  const res = await request.post(`/wms/warehouse/select/warehouseList`, { params:{status:1} });
+  const res = await request.post(`/wms/warehouse/select/warehouseList`, {
+    params: { status: 1 }
+  });
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -24,14 +26,13 @@ export async function getWarehouseList() {
  * 查询库存可用数
  */
 export async function getWarehouseOutStock(params) {
-  const res = await request.get(`/wms/outin/getWarehouseOutStock`, { params});
+  const res = await request.get(`/wms/outin/getWarehouseOutStock`, { params });
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
 
-
 /**
  * 获取信息详情
  */
@@ -80,26 +81,30 @@ export async function deleteInformation(data) {
  * 导出报价单
  */
 export async function getExport(id) {
-  const res = await request.get(
-    `/eom/quote/export/${id}`,
-    {
-      responseType: 'blob'
-    },
-
-  );
+  const res = await request.get(`/eom/quote/export/${id}`, {
+    responseType: 'blob'
+  });
 
   download(res.data, '报价单.xlsx');
 }
 
-
-
 /**
  * 销售订单变更
  */
 export async function orderChange(data) {
-    const res = await request.post(`/eom/saleorder/change`, data);
-    if (res.data.code == 0) {
-      return res.data.data;
-    }
-    return Promise.reject(new Error(res.data.message));
-  }
+  const res = await request.post(`/eom/saleorder/change`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 提交
+ */
+export async function submit(data) {
+  const res = await request.post(`/bpm/salesOrderApprove/submit`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 19 - 10
src/api/saleManage/saleordersendrecord.js

@@ -55,17 +55,26 @@ export async function deleteSendInformation(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));
-  }
+  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));
+}
+/**
+ * 提交
+ */
+export async function submit(data) {
+  const res = await request.post(`/bpm/salesOrderSendApprove/submit`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 30 - 9
src/views/contractManage/contractBook/components/addDialog.vue

@@ -375,6 +375,7 @@
 
     <div slot="footer" class="footer">
       <el-button type="primary" @click="save">保存</el-button>
+      <el-button type="primary" @click="save('sub')">提交</el-button>
       <el-button @click="cancel">返回</el-button>
     </div>
 
@@ -403,8 +404,7 @@
     getDetail,
     UpdateInformation,
     addInformation,
-    deleteInformation,
-    updateStatus
+    submit
   } from '@/api/contractManage/contractBook';
   import { getcontactlink } from '@/api/saleManage/businessFollow';
   import headList from '@/views/saleManage/businessOpportunity/components/headList.vue';
@@ -572,7 +572,8 @@
         // 组织机构平铺数据
         groupData: [],
         enterprisePage: [],
-        create: false
+        create: false,
+        businessId:''
       };
     },
     created() {
@@ -623,6 +624,8 @@
       },
       //获取详情
       async getDetailData(id) {
+        this.businessId = id;
+
         this.loading = true;
         const data = await getDetail(id);
         this.loading = false;
@@ -748,22 +751,23 @@
         }
       },
 
-      handHead() {
+      handHead(title) {
         if (this.form.type == '2') {
           let item = {
             id: this.form.partaLinkId
           };
-          this.$refs.headRef.open(item);
+          this.$refs.headRef.open(item,0,title);
         } else {
           let item = {
             id: this.form.partbLinkId
           };
-          this.$refs.headRef.open(item);
+          this.$refs.headRef.open(item,0,title);
         }
       },
 
       //选择乙方人和采购合同下的甲方人回调
-      changePersonel(obj) {
+      changePersonel(obj,index, title) {
+
         if (this.form.type == '2') {
           this.$set(this.form, 'partaLinkId', obj.id);
           this.$set(this.form, 'partaLinkName', obj.name);
@@ -816,7 +820,7 @@
             //核价单生成的合同
             this.$nextTick(() => {
               let { contractVO } = row;
-              console.log(row,'row')
+              console.log(row, 'row');
               this.form = contractVO;
               this.$refs.inventoryTable &&
                 this.$refs.inventoryTable.putTableValue(row);
@@ -891,7 +895,7 @@
           })
         ]);
       },
-      async save() {
+      async save(type) {
         try {
           await this.getValidate();
           // 表单验证通过,执行保存操作
@@ -924,6 +928,10 @@
               .then((res) => {
                 this.loading = false;
                 this.$message.success('修改成功');
+                if (type === 'sub') {
+                  this.contractBookSubmit(res);
+                  return;
+                }
                 this.cancel();
                 this.$emit('done');
               })
@@ -935,6 +943,10 @@
               .then((res) => {
                 this.loading = false;
                 this.$message.success('新增成功');
+                if (type === 'sub') {
+                  this.contractBookSubmit(res);
+                  return;
+                }
                 this.cancel();
                 this.$emit('done');
               })
@@ -947,6 +959,15 @@
           // 表单验证未通过,不执行保存操作
         }
       },
+      contractBookSubmit(res) {
+        submit({
+          businessId: this.businessId || res,
+          // productionSupervisorId
+        }).then((res) => {
+          this.cancel();
+          this.$emit('done');
+        });
+      },
       cancel() {
         this.$nextTick(() => {
           this.activeName = 'base';

+ 12 - 4
src/views/contractManage/contractBook/components/detailDialog.vue

@@ -68,10 +68,18 @@
             {{form.receiptPaymentType==1?'固定':'分期'}}
             </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>
+            <div v-if="form.contractFile && form.contractFile?.length">
+              <el-link
+                v-for="link in form.contractFile"
+                :key="link.id"
+                type="primary"
+                :underline="false"
+                @click="downloadFile(link)"
+              >
+                {{ link.name }}</el-link
+              >
+            </div>
+          </el-form-item>
            </el-col>
      </el-row>
      <headerTitle title="基本信息"></headerTitle>

+ 109 - 81
src/views/contractManage/contractBook/index.vue

@@ -17,7 +17,7 @@
           </div>
         </div>
         <template v-slot:content>
-      <div class="ele-border-lighter form-content" v-loading="loading">
+          <div class="ele-border-lighter form-content" v-loading="loading">
             <search-contract @search="reload"> </search-contract>
 
             <!-- 数据表格 -->
@@ -38,18 +38,18 @@
                   type="primary"
                   icon="el-icon-plus"
                   class="ele-btn-icon"
-                  @click="openEdit('add',{})"
+                  @click="openEdit('add', {})"
                 >
                   新建
                 </el-button>
-              
+
                 <el-button
                   size="small"
                   type="danger"
                   el-icon-delete
                   class="ele-btn-icon"
                   @click="allDelBtn"
-                  :disabled="selection?.length===0"
+                  :disabled="selection?.length === 0"
                 >
                   批量删除
                 </el-button>
@@ -57,21 +57,28 @@
 
               <!-- 查看详情列 -->
               <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="openDetail(row)"
+                >
+                  {{ row.contractName }}</el-link
+                >
               </template>
 
               <!-- 操作列 -->
               <template v-slot:action="{ row }">
-                
                 <el-link
                   type="primary"
+                  v-if="[0, 3].includes(row.status)"
                   :underline="false"
                   icon="el-icon-edit"
-                  @click="openEdit('edit',row)"
+                  @click="openEdit('edit', row)"
                 >
                   修改
                 </el-link>
                 <el-popconfirm
+                  v-if="[0, 3].includes(row.status)"
                   class="ele-action"
                   title="确定要删除此信息吗?"
                   @confirm="remove([row.id])"
@@ -93,47 +100,60 @@
       </ele-split-layout>
     </el-card>
 
-
-    <add-dialog ref="addDialogRef"  @done="reload" :categoryTreeList="treeList"></add-dialog>
+    <add-dialog
+      ref="addDialogRef"
+      @done="reload"
+      :categoryTreeList="treeList"
+    ></add-dialog>
     <detail-dialog ref="contactDetailDialogRef"></detail-dialog>
-<!-- 多选删除弹窗 -->
-    <pop-modal :visible.sync="delVisible" content="是否确定删除?" @done="commitBtn"/>
+    <!-- 多选删除弹窗 -->
+    <pop-modal
+      :visible.sync="delVisible"
+      content="是否确定删除?"
+      @done="commitBtn"
+    />
   </div>
 </template>
 
 <script>
-import searchContract from './components/searchContract.vue';
-import addDialog from './components/addDialog.vue';
-import detailDialog from './components/detailDialog.vue';
-import popModal from '@/components/pop-modal';
-import AssetTree from '@/components/AssetTree';
-import {reviewStatus} from '@/enum/dict';
-import {contactTypeTree} from '@/api/saleManage/contact';
-import {getTableList, getDetail, UpdateInformation, addInformation,deleteInformation,updateStatus} from '@/api/contractManage/contractBook';
-import dictMixins from '@/mixins/dictMixins';
-
+  import searchContract from './components/searchContract.vue';
+  import addDialog from './components/addDialog.vue';
+  import detailDialog from './components/detailDialog.vue';
+  import popModal from '@/components/pop-modal';
+  import AssetTree from '@/components/AssetTree';
+  import { reviewStatus } from '@/enum/dict';
+  import { contactTypeTree } from '@/api/saleManage/contact';
+  import {
+    getTableList,
+    getDetail,
+    UpdateInformation,
+    addInformation,
+    deleteInformation,
+    updateStatus
+  } from '@/api/contractManage/contractBook';
+  import dictMixins from '@/mixins/dictMixins';
 
-export default {
+  export default {
     mixins: [dictMixins],
     components: {
       AssetTree,
       searchContract,
       popModal,
       addDialog,
-      detailDialog,
+      detailDialog
     },
     data() {
       return {
-        selection:[],   //单选中集合
-        delVisible:false,  //批量删除弹框状态
-        loading: false,  // 加载状态
-        treeList: [],   //左边分类数据
+        selection: [], //单选中集合
+        delVisible: false, //批量删除弹框状态
+        loading: false, // 加载状态
+        treeList: [], //左边分类数据
         columns: [
           {
-             width: 45,
-             type: 'selection',
-             columnKey: 'selection',
-             align: 'center'
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
           },
           {
             columnKey: 'index',
@@ -164,45 +184,45 @@ export default {
             label: '甲方名称',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 150,
+            minWidth: 150
           },
           {
             prop: 'partaLinkName',
             label: '甲方联系人',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 130,
+            minWidth: 130
           },
-         
+
           {
             prop: 'partaTel',
             label: '甲方联系电话',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 130,
+            minWidth: 130
           },
           {
             prop: 'partbName',
             label: '乙方名称',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 130,
+            minWidth: 130
           },
           {
             prop: 'partbLinkName',
             label: '乙方联系人',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 130,
+            minWidth: 130
           },
           {
             prop: 'partbTel',
             label: '乙方联系电话',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 130,
+            minWidth: 130
           },
-       
+
           {
             prop: 'contractNo',
             label: '编码',
@@ -217,8 +237,7 @@ export default {
             showOverflowTooltip: true,
             minWidth: 200
           },
-         
-        
+
           {
             prop: 'enabled',
             label: '是否可用',
@@ -226,7 +245,7 @@ export default {
             showOverflowTooltip: true,
             minWidth: 140,
             formatter: (_row, _column, cellValue) => {
-              return _row.enabled?'是':'否'
+              return _row.enabled ? '是' : '否';
             }
           },
           {
@@ -250,7 +269,7 @@ export default {
             showOverflowTooltip: true,
             minWidth: 130,
             formatter: (_row, _column, cellValue) => {
-              return _row.receiptPaymentType==1?'固定':'分期'
+              return _row.receiptPaymentType == 1 ? '固定' : '分期';
             }
           },
           {
@@ -260,8 +279,17 @@ export default {
             showOverflowTooltip: true,
             minWidth: 130
           },
-        
-        
+
+          {
+            prop: 'status',
+            label: '审核状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return reviewStatus[_row.status];
+            }
+          },
           {
             prop: 'createTime',
             label: '创建时间',
@@ -277,7 +305,7 @@ export default {
             resizable: false,
             slot: 'action',
             showOverflowTooltip: true,
-            fixed: 'right',
+            fixed: 'right'
           }
         ]
       };
@@ -285,12 +313,12 @@ export default {
     computed: {},
     created() {
       this.requestDict('客户状态');
-      this.getTreeData()
+      this.getTreeData();
     },
     methods: {
       //点击左边分类
       handleNodeClick(data, node) {
-       // this.curNodeData = data;
+        // this.curNodeData = data;
         this.reload({ categoryId: data.id });
       },
       /* 表格数据源 */
@@ -301,7 +329,7 @@ export default {
           ...where
         });
       },
-    
+
       //获取左边分类
       async getTreeData() {
         try {
@@ -310,7 +338,7 @@ export default {
           this.treeLoading = false;
           if (res?.code === '0') {
             this.treeList = res.data;
-          
+
             return this.treeList;
           }
         } catch (error) {}
@@ -320,20 +348,20 @@ export default {
       reload(where) {
         this.$refs.table.reload({ page: 1, where });
       },
-      
+
       //新增编辑
-      openEdit(type,row) {
-        this.$refs.addDialogRef.open( type,row);
+      openEdit(type, row) {
+        this.$refs.addDialogRef.open(type, row);
         this.$refs.addDialogRef.$refs.form &&
-        this.$refs.addDialogRef.$refs.form.clearValidate();
+          this.$refs.addDialogRef.$refs.form.clearValidate();
       },
-     
+
       //批量删除
-      allDelBtn(){
-        if(this.selection.length===0) return
-        this.delVisible=true
+      allDelBtn() {
+        if (this.selection.length === 0) return;
+        this.delVisible = true;
       },
-      
+
       //删除接口
       remove(delData) {
         deleteInformation(delData).then((res) => {
@@ -342,36 +370,36 @@ export default {
         });
       },
 
-    //删除弹框确定
-      commitBtn(){
-        const dataId=this.selection.map(v=>v.id)
-        this.remove(dataId)
+      //删除弹框确定
+      commitBtn() {
+        const dataId = this.selection.map((v) => v.id);
+        this.remove(dataId);
       },
 
-    //查看详情
-      openDetail(row){
+      //查看详情
+      openDetail(row) {
         this.$refs.contactDetailDialogRef.open(row);
-      },
+      }
     }
   };
 </script>
 
 <style lang="scss" scoped>
-:deep(.el-link--inner){
-  margin-left: 0px !important;
-}
+  :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;
+  .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;
+    }
   }
-}
 </style>

+ 1 - 1
src/views/saleManage/businessOpportunity/components/headList.vue

@@ -141,6 +141,7 @@
     watch: {},
     methods: {
       open(item, index = 0, title) {
+        this.title=''
         if (item) {
           this.radio = item.id;
         }
@@ -148,7 +149,6 @@
         if (title) {
           this.title = title;
           this.radio = '';
-
         }
        
         this.visible = true;

+ 329 - 325
src/views/saleManage/saleOrder/accountstatement/components/addAccountDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <ele-modal
-  custom-class="ele-dialog-form long-dialog-form"
+    custom-class="ele-dialog-form long-dialog-form"
     :centered="true"
     v-if="visible"
     :visible.sync="visible"
@@ -9,149 +9,140 @@
     width="80%"
     @close="cancel"
   >
-  
-  <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-   
+    <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-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"
-            >
+              clearable
+              v-model="form.orderNo"
+              @click.native="handleOrderBtn"
+              placeholder="请输入"
+            />
+          </el-form-item>
+          <el-form-item
+            label="客户名称"
+            prop="contactName"
+            style="margin-bottom: 22px"
+          >
+            <el-input clearable v-model="form.contactName" disabled />
+          </el-form-item>
+          <el-form-item
+            label="项目名称"
+            prop="projectName"
+            style="margin-bottom: 22px"
+          >
+            <el-input clearable v-model="form.projectName" disabled />
+          </el-form-item>
+          <el-form-item label="备注" prop="remark" style="margin-bottom: 22px">
             <el-input
-                clearable
-                v-model="form.contactName"
-                disabled
-              />
-            </el-form-item>
-            <el-form-item
-              label="项目名称"
-              prop="projectName"
-              style="margin-bottom: 22px"
-            >
-            <el-input
-                clearable
-                v-model="form.projectName"
-                disabled
-              />
-            </el-form-item>
-            <el-form-item
-              label="备注"
-              prop="remark"
-              style="margin-bottom: 22px"
-            >
-            <el-input
-                clearable
-                v-model="form.remark"
-                type="textarea"
-                placeholder="请输入"
-              />
-            </el-form-item>
-          </el-col>
+              clearable
+              v-model="form.remark"
+              type="textarea"
+              placeholder="请输入"
+            />
+          </el-form-item>
+          <el-form-item prop="repliedFiles" label="回执附件">
+            <fileUpload
+              v-model="form.repliedFiles"
+              module="main"
+              :showLib="false"
+              :limit="10"
+            />
+          </el-form-item>
+        </el-col>
 
-          <el-col :span="12">
-          
-              <el-form-item
-              label="账期"
-              prop="accountPeriod"
-              style="margin-bottom: 22px"
+        <el-col :span="12">
+          <el-form-item
+            label="账期"
+            prop="accountPeriod"
+            style="margin-bottom: 22px"
+          >
+            <el-date-picker
+              v-model="form.accountPeriod"
+              value-format="yyyy-MM"
+              type="month"
+              placeholder="选择月"
             >
-                <el-date-picker
-                   v-model="form.accountPeriod"
-                   value-format="yyyy-MM"
-                   type="month"
-                   placeholder="选择月">
-                 </el-date-picker>
-            </el-form-item>
+            </el-date-picker>
+          </el-form-item>
 
-           
-              <el-form-item
-              label="开始日期"
-              prop="startDate"
-              style="margin-bottom: 22px"
+          <el-form-item
+            label="开始日期"
+            prop="startDate"
+            style="margin-bottom: 22px"
+          >
+            <el-date-picker
+              v-model="form.startDate"
+              type="date"
+              value-format="yyyy-MM-dd"
+              placeholder="选择日期"
             >
-                 <el-date-picker
-                 v-model="form.startDate"
-                 type="date"
-                 value-format="yyyy-MM-dd"
-                 placeholder="选择日期">
-               </el-date-picker>
-            </el-form-item>
-            <el-form-item
-              label="结束日期"
-              prop="endDate"
-              style="margin-bottom: 22px"
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item
+            label="结束日期"
+            prop="endDate"
+            style="margin-bottom: 22px"
+          >
+            <el-date-picker
+              v-model="form.endDate"
+              type="date"
+              value-format="yyyy-MM-dd"
+              placeholder="选择日期"
             >
-                 <el-date-picker
-                 v-model="form.endDate"
-                 type="date"
-                 value-format="yyyy-MM-dd"
-                 placeholder="选择日期">
-               </el-date-picker>
-            </el-form-item>
-            <el-form-item
-              label=""
-              prop=""
-              style="margin-bottom: 22px"
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="" prop="" style="margin-bottom: 22px">
+            <el-button type="primary" @click="seachAccountDetail"
+              >查询明细</el-button
             >
-            <el-button type="primary" @click="seachAccountDetail">查询明细</el-button>
-            </el-form-item>
-           
-          </el-col>
-        </el-row>
-        
-
+          </el-form-item>
+        </el-col>
+      </el-row>
 
-      
-
-      
-    
-      <headerTitle title="对账明细" style="margin-top:30px;"></headerTitle>
-     <inventoryTable  ref="inventoryTableref" ></inventoryTable>
-        
+      <headerTitle title="对账明细" style="margin-top: 30px"></headerTitle>
+      <inventoryTable ref="inventoryTableref"></inventoryTable>
     </el-form>
     <div slot="footer" class="footer">
       <el-button type="primary" @click="save">保存</el-button>
+      <el-button type="primary" @click="save('sub')">提交</el-button>
       <el-button @click="cancel">返回</el-button>
     </div>
-    <orderListDialog ref="orderListDialogRef" @changeParent="changeOrder"></orderListDialog>
+    <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 { addtAccountstatement,UpdatetAccountstatement,gettAccountstatementDetail,getsearchDetailListByType} from '@/api/saleManage/accountstatement';
-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';
+  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 {
+    addtAccountstatement,
+    UpdatetAccountstatement,
+    gettAccountstatementDetail,
+    getsearchDetailListByType,submit
+  } from '@/api/saleManage/accountstatement';
+  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 {
+  export default {
     mixins: [dictMixins],
     components: {
       fileUpload,
@@ -163,27 +154,28 @@ export default {
     },
     data() {
       let formDef = {
-          id:'',
-          contractId: '',
-          contractName: '',
-          type:1,
-          orderNo:'',
-          orderId:'',
-          orderNum:null,
-          productNum:null,
-          projectName:'',
-          projectId:'',
-          remark:'',
-          startDate:'',
-          endDate:'',
-          totalPrice:null
-        };
-   
+        id: '',
+        contractId: '',
+        contractName: '',
+        type: 1,
+        orderNo: '',
+        orderId: '',
+        orderNum: null,
+        productNum: null,
+        projectName: '',
+        projectId: '',
+        remark: '',
+        startDate: '',
+        endDate: '',
+        totalPrice: null,
+        repliedFiles: []
+      };
+
       return {
-        detailData:{},   
-        payWayOptions:[],
-        delDetailIds:[],
-        linkNameOptions:[],
+        detailData: {},
+        payWayOptions: [],
+        delDetailIds: [],
+        linkNameOptions: [],
         acceptUnpackoptions,
         visible: false,
         title: '',
@@ -193,10 +185,10 @@ export default {
         form: copyObj(formDef),
         tableBankData: [],
         tableLinkData: [],
-     // 组织机构树形结构数据
-       groupTreeData: [],
-       groupData:[],
-        rules: {        
+        // 组织机构树形结构数据
+        groupTreeData: [],
+        groupData: [],
+        rules: {
           orderNo: [
             { required: true, message: '请选择订单', trigger: 'change' }
           ],
@@ -204,253 +196,265 @@ export default {
             { required: true, message: '请选择账期', trigger: 'change' }
           ],
           startDate: [
-            { required: true, message: '请选择正确的开始日期',validator: this.validateStartDate, trigger: 'change' }
+            {
+              required: true,
+              message: '请选择正确的开始日期',
+              validator: this.validateStartDate,
+              trigger: 'change'
+            }
           ],
           endDate: [
-            { required: true, message: '请选择正确的结束日期',validator: this.validateEndDate, trigger: 'change' }
-          ],
+            {
+              required: true,
+              message: '请选择正确的结束日期',
+              validator: this.validateEndDate,
+              trigger: 'change'
+            }
+          ]
         },
-     
+
         // 提交状态
         loading: false,
         // 是否是修改
         isUpdate: false,
+        businessId: ''
       };
     },
     computed: {
-     
-      allcountAmount(){
-        return this.$store.state.order.allcountAmount
+      allcountAmount() {
+        return this.$store.state.order.allcountAmount;
       }
     },
-   
+
     methods: {
- //开始日期验证
- validateStartDate(rule, value, callback) {
-      if (this.form.endDate && value > this.form.endDate) {
-        callback(new Error('开始日期不能大于结束日期'));
-      } else {
-        callback();
-      }
-    },
-    //结束日期验证
-    validateEndDate(rule, value, callback) {
-      if (this.form.endDate&&this.form.startDate && value < this.form.startDate) {
-        callback(new Error('结束日期不能小于开始日期'));
-      } else {
-        callback();
-      }
-    },
-       //查询对账单明细
-       async seachAccountDetail(){
-        let {orderId,endDate,startDate}=this.form
-        try {
-          await this.getValidate();
-          let parms={
-          type:1,    //1销售订单2采购
-          orderId,
-          startDate,
-          endDate
-        }
-        const data = await getsearchDetailListByType(parms);
-        if(data&&data.length===0){
-          return this.$message.error('没有数据')
+      //开始日期验证
+      validateStartDate(rule, value, callback) {
+        if (this.form.endDate && value > this.form.endDate) {
+          callback(new Error('开始日期不能大于结束日期'));
+        } else {
+          callback();
         }
-        this.$refs.inventoryTableref&&this.$refs.inventoryTableref.putTableValue(data)
-
-        } catch (error) {
-          
+      },
+      //结束日期验证
+      validateEndDate(rule, value, callback) {
+        if (
+          this.form.endDate &&
+          this.form.startDate &&
+          value < this.form.startDate
+        ) {
+          callback(new Error('结束日期不能小于开始日期'));
+        } else {
+          callback();
         }
-       
-        
-     
-       },
-       //选择订单回调
-       changeOrder(obj){
-        this.form = Object.assign({},this.form,{
+      },
+      //查询对账单明细
+      async seachAccountDetail() {
+        let { orderId, endDate, startDate } = this.form;
+        try {
+          await this.getValidate();
+          let parms = {
+            type: 1, //1销售订单2采购
+            orderId,
+            startDate,
+            endDate
+          };
+          const data = await getsearchDetailListByType(parms);
+          if (data && data.length === 0) {
+            return this.$message.error('没有数据');
+          }
+          this.$refs.inventoryTableref &&
+            this.$refs.inventoryTableref.putTableValue(data);
+        } catch (error) {}
+      },
+      //选择订单回调
+      changeOrder(obj) {
+        this.form = Object.assign({}, this.form, {
           orderId: obj.id,
           orderNo: obj.orderNo,
-          contactId:obj.partaId,
-          contactName:obj.partaName,
-          projectName:obj.projectName,
-          projectId:obj.projectId
-        })
-        
+          contactId: obj.partaId,
+          contactName: obj.partaName,
+          projectName: obj.projectName,
+          projectId: obj.projectId
+        });
       },
 
-
       //对账单详情
-      async gettAccountstatementDetail(id){
+      async gettAccountstatementDetail(id) {
+        this.businessId=id
         this.loading = true;
         const data = await gettAccountstatementDetail(id);
         this.loading = false;
         if (data) {
           this.form = data;
-            this.$refs.inventoryTableref&&this.$refs.inventoryTableref.putTableValue(data.detailList)
-          this.$nextTick(()=>{
+          this.$refs.inventoryTableref &&
+            this.$refs.inventoryTableref.putTableValue(data.detailList);
+          this.$nextTick(() => {
             this.$refs.form.validate();
-          })          
+          });
         }
       },
 
-   //更新联系人数据
-   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
+      //更新联系人数据
+      async getLinkInfo(contactId) {
+        const data = await getcontactlink({ contactId });
+        if (data && data?.length) {
+          this.linkNameOptions = data;
         }
-        this.$refs.headRef.open(item)
-     },
-
-
+      },
+      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)
-    },
+      handleOrderBtn() {
+        let item = {
+          id: this.form.orderId
+        };
+        this.$refs.orderListDialogRef.open(item);
+      },
 
-    
       //打开新增编辑弹框
-      async open(type, row,orderId) {
-        this.title = type==='add'?'新增对账单':'修改对账单';
+      async open(type, row, orderId) {
+        this.title = type === 'add' ? '新增对账单' : '修改对账单';
         this.row = row;
         this.visible = true;
-        if(row&&row?.id){
-          this.gettAccountstatementDetail(row?.id)
+        if (row && row?.id) {
+          this.gettAccountstatementDetail(row?.id);
         }
-        
+
         if (type == 'add') {
           this.isUpdate = false;
         } else {
           this.isUpdate = true;
-         
         }
       },
 
-      salesmanChange(val, info){
+      salesmanChange(val, info) {
         this.otherForm.salesmanName = info.name;
       },
-      settlementModeChange(info){
+      settlementModeChange(info) {
         this.form.settlementModeName = info.dictValue;
       },
-      ifChiefChange(value, idx){
-        if(value === 1){
-          this.tableLinkData.forEach(e => e.ifChief = 0);
+      ifChiefChange(value, idx) {
+        if (value === 1) {
+          this.tableLinkData.forEach((e) => (e.ifChief = 0));
           this.tableLinkData[idx].ifChief = 1;
         }
       },
- 
-    
-     getValidate() {
+
+      getValidate() {
         return Promise.all([
-            new Promise((resolve, reject) => {
-              this.$refs.form.validate((valid) => {
-                if (!valid) {
-                  reject(false);
-                } else {
-                  resolve(true);
-                }
-              });
-            })
-          
-          ]);
-     },
-      async save() {
+          new Promise((resolve, reject) => {
+            this.$refs.form.validate((valid) => {
+              if (!valid) {
+                reject(false);
+              } else {
+                resolve(true);
+              }
+            });
+          })
+        ]);
+      },
+      async save(type) {
         try {
-           await this.getValidate();
-           // 表单验证通过,执行保存操作
-           this.loading = true;
-      
-        if (!this.isUpdate) {
-          delete this.form.id;
-        } 
-        let [detailList,amountData]=this.$refs.inventoryTableref.getTableValue()
-        let commitData=Object.assign({},this.form,{
-          detailList,
-          ...amountData
-        })
+          await this.getValidate();
+          // 表单验证通过,执行保存操作
+          this.loading = true;
 
-        if (this.isUpdate) {
-          UpdatetAccountstatement(commitData)
-            .then((res) => {
-              this.loading = false;
-              this.$message.success("修改成功");
-              this.cancel();
-              this.$emit('done');
-            })
-            .catch((e) => {
-              //this.loading = false;
-            });
-        } else {
-          addtAccountstatement(commitData)
-            .then((res) => {
-              this.loading = false;
-              this.$message.success("新增成功");
-              this.cancel();
-              this.$emit('done');
-            })
-            .catch((e) => {
-              //this.loading = false;
-            });
+          if (!this.isUpdate) {
+            delete this.form.id;
+          }
+          let [detailList, amountData] =
+            this.$refs.inventoryTableref.getTableValue();
+          this.form.repliedFiles = this.form.repliedFiles || [];
+          this.form.replied = this.form.repliedFiles.length > 0 ? 1 : 0;
+          let commitData = Object.assign({}, this.form, {
+            detailList,
+            ...amountData
+          });
+
+          if (this.isUpdate) {
+            UpdatetAccountstatement(commitData)
+              .then((res) => {
+                this.loading = false;
+                this.$message.success('修改成功');
+                if (type === 'sub') {
+                  this.accountstatementSubmit(res);
+                  return;
+                }
+                this.cancel();
+                this.$emit('done');
+              })
+              .catch((e) => {
+                //this.loading = false;
+              });
+          } else {
+            addtAccountstatement(commitData)
+              .then((res) => {
+                this.loading = false;
+                this.$message.success('新增成功');
+                if (type === 'sub') {
+                  this.accountstatementSubmit(res);
+                  return;
+                }
+                this.cancel();
+                this.$emit('done');
+              })
+              .catch((e) => {
+                //this.loading = false;
+              });
           }
         } catch (error) {
-          console.log(error)
+          console.log(error);
           // 表单验证未通过,不执行保存操作
         }
-       
+      },
+      accountstatementSubmit(res) {
+        submit({
+          businessId: this.businessId || res
+          // productionSupervisorId
+        }).then((res) => {
+          this.cancel();
+          this.$emit('done');
+        });
       },
       cancel() {
         this.$nextTick(() => {
           this.activeName = 'base';
           // 关闭后,销毁所有的表单数据
-          this.$refs['otherForm'] &&  this.$refs['otherForm'].resetFields();
-          this.$refs['formRef'] &&  this.$refs['formRef'].resetFields();
+          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.form = copyObj(this.formDef);
           this.visible = false;
-        })
-      },
- 
-    
-
+        });
+      }
     }
   };
 </script>
 <style scoped lang="scss">
-.TotalAmount{
-  font-size: 16px;
-  padding-right: 30px;
-}
+  .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;
+  .headbox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      margin-right: 20px;
+    }
   }
-}
-</style>
+</style>

+ 21 - 2
src/views/saleManage/saleOrder/accountstatement/components/detailDialog.vue

@@ -83,6 +83,25 @@
           >
             {{ reviewStatusEnum[form.reviewStatus].label }}
           </el-form-item>
+          <el-form-item
+            label="回执附件:"
+            prop="sendFiles"
+            style="margin-bottom: 16px"
+          >
+            <div
+              v-if="detailData.repliedFiles && detailData.repliedFiles?.length"
+            >
+              <el-link
+                v-for="link in detailData.repliedFiles"
+                :key="link.id"
+                type="primary"
+                :underline="false"
+                @click="downloadFile(link)"
+              >
+                {{ link.name }}</el-link
+              >
+            </div>
+          </el-form-item>
           <el-form-item
             label="备注:"
             prop="remark"
@@ -303,7 +322,7 @@
             width: 120,
             prop: 'totalPrice',
             label: '合计金额',
-            slot: 'totalPrice',
+            slot: 'totalPrice'
             // formatter: (_row, _column, cellValue) => {
             //   return _row.totalPrice + '元';
             // }
@@ -418,7 +437,7 @@
       margin-bottom: 10px;
     }
   }
-  .none{
+  .none {
     display: none;
   }
   .headbox {

+ 324 - 301
src/views/saleManage/saleOrder/accountstatement/index.vue

@@ -1,311 +1,335 @@
 <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:statementNo="{ row }">
-                  <el-link type="primary" :underline="false" @click="openorderDetail(row,'statementNo')"> {{ row.statementNo }}</el-link>
-                </template>
-                <template v-slot:orderNo="{ row }">
-                <el-link type="primary" :underline="false" @click="openorderDetail(row,'orderNo')"> {{ row.orderNo }}</el-link>
+  <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:statementNo="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="openorderDetail(row, 'statementNo')"
+            >
+              {{ row.statementNo }}</el-link
+            >
+          </template>
+          <template v-slot:orderNo="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="openorderDetail(row, 'orderNo')"
+            >
+              {{ row.orderNo }}</el-link
+            >
+          </template>
+          <!-- 操作列 -->
+          <template v-slot:action="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="openEdit('edit', row)"
+              v-if="[0, 3].includes(row.reviewStatus)"
+
+            >
+              修改
+            </el-link>
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此信息吗?"
+              @confirm="remove([row.id])"
+              v-if="[0, 3].includes(row.reviewStatus)"
+            >
+              <template v-slot:reference>
+                <el-link type="danger" :underline="false" icon="el-icon-delete">
+                  删除
+                </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>
-  
-      <order-detail-dialog  ref="orderDetailDialogRef"></order-detail-dialog>
-      <add-account-dialog ref="accountDialogRef"  @done="reload"></add-account-dialog>
-      <detail-dialog ref="DetailDialogRef"></detail-dialog>
-      <add-return-goods-dialog ref="addReturnGoodsRef"  @done="reload"></add-return-goods-dialog>
-  <!-- 多选删除弹窗 -->
-      <pop-modal :visible.sync="delVisible" content="是否确定删除?" @done="commitBtn"/>
-    </div>
-  </template>
-  
-  <script>
+            </el-popconfirm>
+          </template>
+        </ele-pro-table>
+      </div>
+    </el-card>
+
+    <order-detail-dialog ref="orderDetailDialogRef"></order-detail-dialog>
+    <add-account-dialog
+      ref="accountDialogRef"
+      @done="reload"
+    ></add-account-dialog>
+    <detail-dialog ref="DetailDialogRef"></detail-dialog>
+    <add-return-goods-dialog
+      ref="addReturnGoodsRef"
+      @done="reload"
+    ></add-return-goods-dialog>
+    <!-- 多选删除弹窗 -->
+    <pop-modal
+      :visible.sync="delVisible"
+      content="是否确定删除?"
+      @done="commitBtn"
+    />
+  </div>
+</template>
+
+<script>
   import searchTable from './components/searchTable.vue';
   import addAccountDialog from './components/addAccountDialog.vue';
   import detailDialog from './components/detailDialog.vue';
   import popModal from '@/components/pop-modal';
-  import {reviewStatusEnum} from '@/enum/dict';
-  import orderDetailDialog from '@/views/saleManage/saleOrder/components/detailDialog.vue'
-  import {contactTypeTree} from '@/api/saleManage/contact';
+  import { reviewStatusEnum } from '@/enum/dict';
+  import orderDetailDialog from '@/views/saleManage/saleOrder/components/detailDialog.vue';
+  import { contactTypeTree } from '@/api/saleManage/contact';
   import addReturnGoodsDialog from '@/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog';
-  import {getTableList, getDetail, UpdateInformation, addInformation,deleteInformation} from '@/api/saleManage/saleorder';
-  import {getAccountstatementList, gettAccountstatementDetail, UpdatetAccountstatement, addtAccountstatement,deletetAccountstatement} from '@/api/saleManage/accountstatement';
+  import {
+    getTableList,
+    getDetail,
+    UpdateInformation,
+    addInformation,
+    deleteInformation
+  } from '@/api/saleManage/saleorder';
+  import {
+    getAccountstatementList,
+    gettAccountstatementDetail,
+    UpdatetAccountstatement,
+    addtAccountstatement,
+    deletetAccountstatement
+  } from '@/api/saleManage/accountstatement';
   import dictMixins from '@/mixins/dictMixins';
-  
-  
+
   export default {
-      mixins: [dictMixins],
-      components: {
-        searchTable,
-        popModal,
-        addReturnGoodsDialog,
-        orderDetailDialog,
-        addAccountDialog,
-        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: 'statementNo',
-              label: '对账单编码',
-              align: 'center',
-              slot: 'statementNo',
-              showOverflowTooltip: true,
-              minWidth: 200
-            },
-            {
-              prop: 'orderNo',
-              label: '销售订单编码',
-              align: 'center',
-              slot: 'orderNo',
-              showOverflowTooltip: true,
-              minWidth: 200
-            },
-            {
-              prop: 'contactName',
-              label: '客户名称',
-              align: 'center',
-              showOverflowTooltip: true,
-              minWidth: 180,
-            },
-            {
-              prop: 'projectName',
-              label: '项目名称',
-              align: 'center',
-              showOverflowTooltip: true,
-              minWidth: 200,
-            },
-            {
-              prop: 'accountPeriod',
-              label: '账期',
-              align: 'center',
-              slot: 'accountPeriod',
-              showOverflowTooltip: true,
-              minWidth: 200
-            },
-            {
-              prop: 'orderNum',
-              label: '订单量',
-              align: 'center',
-              showOverflowTooltip: true,
-              minWidth: 200,
-            },
-            {
-              prop: 'productNum',
-              label: '产品总数量',
-              align: 'center',
-              showOverflowTooltip: true,
-              minWidth: 200,
-            },
-            {
-              prop: 'totalPrice',
-              label: '产品总金额',
-              align: 'center',
-              showOverflowTooltip: true,
-              minWidth: 200,
-            },
-            {
-              prop: 'reviewStatus',
-              label: '状态',
-              align: 'center',
-              showOverflowTooltip: true,
-              minWidth: 200,
-              formatter: (_row, _column, cellValue) => {
+    mixins: [dictMixins],
+    components: {
+      searchTable,
+      popModal,
+      addReturnGoodsDialog,
+      orderDetailDialog,
+      addAccountDialog,
+      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: 'statementNo',
+            label: '对账单编码',
+            align: 'center',
+            slot: 'statementNo',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'orderNo',
+            label: '销售订单编码',
+            align: 'center',
+            slot: 'orderNo',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'contactName',
+            label: '客户名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180
+          },
+          {
+            prop: 'projectName',
+            label: '项目名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'accountPeriod',
+            label: '账期',
+            align: 'center',
+            slot: 'accountPeriod',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'orderNum',
+            label: '订单量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'productNum',
+            label: '产品总数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'totalPrice',
+            label: '产品总金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            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',
-            }
-          ]
-        };
+          },
+
+          {
+            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 getAccountstatementList({
+          pageNum: page,
+          size: limit,
+          type: 1,
+          ...where
+        });
       },
-      computed: {},
-   
-      methods: {
-      
-      
-        /* 表格数据源 */
-        datasource({ page, limit, where, order }) {
-          return getAccountstatementList({
-            pageNum: page,
-            size: limit,
-            type:1,
-            ...where
-          });
-        },
-      
-     
-    
-        /* 刷新表格 */
-        reload(where) {
-          this.$refs.table.reload({ page: 1, where });
-        },
-        
-        //新增编辑
-        openEdit(type,row) {
-          this.$refs.accountDialogRef.open( type,row);
-          this.$refs.accountDialogRef.$refs.form &&
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
+
+      //新增编辑
+      openEdit(type, row) {
+        this.$refs.accountDialogRef.open(type, row);
+        this.$refs.accountDialogRef.$refs.form &&
           this.$refs.accountDialogRef.$refs.form.clearValidate();
-        },
-       
-        //批量删除
-        allDelBtn(){
-          if(this.selection.length===0) return
-          this.delVisible=true
-        },
-        
-        //删除接口
-        remove(delData) {
-          deletetAccountstatement(delData).then((res) => {
-            this.$message.success('删除成功!');
-            this.reload();
-          });
-        },
-  
+      },
+
+      //批量删除
+      allDelBtn() {
+        if (this.selection.length === 0) return;
+        this.delVisible = true;
+      },
+
+      //删除接口
+      remove(delData) {
+        deletetAccountstatement(delData).then((res) => {
+          this.$message.success('删除成功!');
+          this.reload();
+        });
+      },
+
       //删除弹框确定
-        commitBtn(){
-          const dataId=this.selection.map(v=>v.id)
-          this.remove(dataId)
-        },
-  
+      commitBtn() {
+        const dataId = this.selection.map((v) => v.id);
+        this.remove(dataId);
+      },
+
       //查看详情
-      openorderDetail(row,type){
-        
-          if(type==='statementNo'){
-            this.$refs.DetailDialogRef.open(row);
-      }
-      if(type==='orderNo'){
-        this.$refs.orderDetailDialogRef.open({id:row.orderId});
+      openorderDetail(row, type) {
+        if (type === 'statementNo') {
+          this.$refs.DetailDialogRef.open(row);
+        }
+        if (type === 'orderNo') {
+          this.$refs.orderDetailDialogRef.open({ id: row.orderId });
+        }
       }
-        },
-  
-      }
-    };
-  </script>
-  
-  <style lang="scss" scoped>
-  .ele-body{
-    padding-top:0;
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .ele-body {
+    padding-top: 0;
     padding-bottom: 0;
   }
- :deep .el-card__body{
-  padding: 0;
-}
-  :deep(.el-link--inner){
+  :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;
@@ -319,21 +343,20 @@
       margin-left: 10px;
     }
   }
-  
-  .switch_left ul .active{
+
+  .switch_left ul .active {
     border-top: 4px solid var(--color-primary);
-      color: var(--color-primary-5);
+    color: var(--color-primary-5);
   }
-  .switch{
+  .switch {
     padding-bottom: 20px;
   }
-  
+
   .el-dropdown-link {
-      cursor: pointer;
-      color: var(--color-primary-5);
-    }
-    .el-icon-arrow-down {
-      font-size: 12px;
-    }
-  </style>
-  
+    cursor: pointer;
+    color: var(--color-primary-5);
+  }
+  .el-icon-arrow-down {
+    font-size: 12px;
+  }
+</style>

+ 26 - 11
src/views/saleManage/saleOrder/components/addDialog.vue

@@ -333,6 +333,8 @@
 
     <div slot="footer" class="footer">
       <el-button type="primary" @click="save">保存</el-button>
+      <el-button type="primary" @click="save('sub')">提交</el-button>
+
       <el-button @click="cancel">返回</el-button>
     </div>
 
@@ -346,21 +348,18 @@
 </template>
 
 <script>
-  import { emailReg, phoneReg, numberReg } from 'ele-admin';
+  import { emailReg, numberReg } from 'ele-admin';
   import { acceptUnpackoptions } from '@/enum/dict';
   import inventoryTable from './inventoryTable.vue';
   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
+    submit
   } from '@/api/saleManage/saleorder';
   import { getcontactlink } from '@/api/saleManage/businessFollow';
   import headList from '@/views/saleManage/businessOpportunity/components/headList.vue';
@@ -378,9 +377,7 @@
       contractListDialog,
       paymentList,
       inventoryTable,
-      deptSelect,
       parentList,
-      personSelect
     },
     data() {
       let formDef = {
@@ -488,7 +485,8 @@
         loading: false,
         // 是否是修改
         isUpdate: false,
-        enterprisePage: []
+        enterprisePage: [],
+        businessId:''
       };
     },
     computed: {
@@ -597,6 +595,7 @@
 
       //获取订单详情
       async getSaleOrderDetail(id) {
+        this.businessId=id
         this.loading = true;
         const data = await getSaleOrderDetail(id);
         this.loading = false;
@@ -763,8 +762,7 @@
           (item) => item.name == this.form.quoteName
         );
         this.form.partbName = data.name;
-        this.form.partbUnifiedSocialCreditCode =
-        data.unifiedSocialCreditCode;
+        this.form.partbUnifiedSocialCreditCode = data.unifiedSocialCreditCode;
         this.form.partbFax = data.fax;
         this.form.partbAddress = data.address;
       },
@@ -803,7 +801,7 @@
           })
         ]);
       },
-      async save() {
+      async save(type) {
         try {
           await this.getValidate();
           // 表单验证通过,执行保存操作
@@ -826,6 +824,10 @@
               .then((res) => {
                 this.loading = false;
                 this.$message.success('修改成功');
+                if (type === 'sub') {
+                  this.saleOrderSubmit(res);
+                  return;
+                }
                 this.cancel();
                 this.$emit('done');
               })
@@ -837,6 +839,10 @@
               .then((res) => {
                 this.loading = false;
                 this.$message.success('新增成功');
+                if (type === 'sub') {
+                  this.saleOrderSubmit(res);
+                  return;
+                }
                 this.cancel();
                 this.$emit('done');
               })
@@ -849,6 +855,15 @@
           // 表单验证未通过,不执行保存操作
         }
       },
+      saleOrderSubmit(res) {
+        submit({
+          businessId: this.businessId || res,
+          // productionSupervisorId
+        }).then((res) => {
+          this.cancel();
+          this.$emit('done');
+        });
+      },
       cancel() {
         this.$nextTick(() => {
           this.activeName = 'base';

+ 25 - 13
src/views/saleManage/saleOrder/components/inventoryTable.vue

@@ -147,9 +147,7 @@
           >
             <el-input
               v-model="scope.row.deliveryDays"
-              @change="
-                  setDeliveryDays(scope.row, scope.$index, 'deliveryDays')
-                "
+              @change="setDeliveryDays(scope.row, scope.$index, 'deliveryDays')"
               placeholder="请输入"
             ></el-input>
           </el-form-item>
@@ -169,8 +167,8 @@
                 <el-input
                   v-model="scope.row.guaranteePeriod"
                   @change="
-                  setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
-                "
+                    setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
+                  "
                   placeholder="请输入"
                 ></el-input>
               </el-form-item>
@@ -195,7 +193,8 @@
             :prop="'datasource.' + scope.$index + '.measuringUnit'"
           >
             <el-input
-              v-model="scope.row.measuringUnit" disabled
+              v-model="scope.row.measuringUnit"
+              disabled
               placeholder="请输入"
             ></el-input>
           </el-form-item>
@@ -295,6 +294,16 @@
             </el-date-picker>
           </el-form-item>
         </template>
+
+        <template v-slot:headerProductName="{ column }">
+          <span class="is-required">{{ column.label }}</span>
+        </template>
+        <template v-slot:headerTotalCount="{ column }">
+          <span class="is-required">{{ column.label }}</span>
+        </template>
+        <template v-slot:headerSinglePrice="{ column }">
+          <span class="is-required">{{ column.label }}</span>
+        </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <el-popconfirm
@@ -499,7 +508,9 @@
             width: 200,
             prop: 'productName',
             label: '名称',
-            slot: 'productName'
+            slot: 'productName',
+            headerSlot:'headerProductName'
+
           },
           {
             width: 120,
@@ -536,7 +547,9 @@
             width: 80,
             prop: 'totalCount',
             label: '数量',
-            slot: 'totalCount'
+            slot: 'totalCount',
+            headerSlot:'headerTotalCount'
+
           },
           {
             width: 80,
@@ -548,7 +561,9 @@
             width: 160,
             prop: 'singlePrice',
             label: '单价',
-            slot: 'singlePrice'
+            slot: 'singlePrice',
+            headerSlot:'headerSinglePrice'
+
           },
           {
             width: 120,
@@ -699,14 +714,11 @@
           : 'second';
       },
       setDay(addDay, dateType = 'day') {
-        return dayjs( new Date())
-          .add(addDay, dateType)
-          .format('YYYY-MM-DD');
+        return dayjs(new Date()).add(addDay, dateType).format('YYYY-MM-DD');
       },
 
       //修改回显
       putTableValue(data) {
-    
         if (data) {
           this.form.datasource = data;
         }

+ 143 - 107
src/views/saleManage/saleOrder/index.vue

@@ -17,7 +17,6 @@
       </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>
 
@@ -39,18 +38,18 @@
                   type="primary"
                   icon="el-icon-plus"
                   class="ele-btn-icon"
-                  @click="openEdit('add',{})"
+                  @click="openEdit('add', {})"
                 >
                   新建
                 </el-button>
-              
+
                 <el-button
                   size="small"
                   type="danger"
                   el-icon-delete
                   class="ele-btn-icon"
                   @click="allDelBtn"
-                  :disabled="selection?.length===0"
+                  :disabled="selection?.length === 0"
                 >
                   批量删除
                 </el-button>
@@ -58,19 +57,31 @@
 
               <!-- 查看详情列 -->
               <template v-slot:contractName="{ row }">
-                <el-link type="primary" :underline="false" @click="opencontractDetail(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>
+                <el-link
+                  type="primary"
+                  :underline="false"
+                  @click="openorderDetail(row)"
+                >
+                  {{ row.orderNo }}</el-link
+                >
               </template>
               <!-- 操作列 -->
               <template v-slot:action="{ row }">
-                
                 <el-link
                   type="primary"
                   :underline="false"
                   icon="el-icon-edit"
-                  @click="openEdit('edit',row)"
+                  @click="openEdit('edit', row)"
+                  v-if="[0, 3].includes(row.orderStatus)"
                 >
                   修改
                 </el-link>
@@ -78,6 +89,7 @@
                   class="ele-action"
                   title="确定要删除此信息吗?"
                   @confirm="remove([row.id])"
+                  v-if="[0, 3].includes(row.orderStatus)"
                 >
                   <template v-slot:reference>
                     <el-link
@@ -89,60 +101,74 @@
                     </el-link>
                   </template>
                 </el-popconfirm>
-                <el-dropdown @command="(command)=>handleCommand(command,row)">
+                <el-dropdown
+                  @command="(command) => handleCommand(command, row)"
+                  v-if="[2].includes(row.orderStatus)"
+                >
                   <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-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">
-        <return-goods></return-goods>
+          <return-goods></return-goods>
         </div>
         <div v-if="activeComp == 'accountstatement'">
-        <accountstatement></accountstatement>
+          <accountstatement></accountstatement>
         </div>
-         
       </div>
     </el-card>
 
-
-    <add-dialog ref="addDialogRef"  @done="reload"></add-dialog>
-    <add-invoice-dialog ref="invoiceDialogRef"  @done="reload"></add-invoice-dialog>
-    <add-return-goods-dialog ref="addReturnGoodsRef"  @done="reload"></add-return-goods-dialog>
+    <add-dialog ref="addDialogRef" @done="reload"></add-dialog>
+    <add-invoice-dialog
+      ref="invoiceDialogRef"
+      @done="reload"
+    ></add-invoice-dialog>
+    <add-return-goods-dialog
+      ref="addReturnGoodsRef"
+      @done="reload"
+    ></add-return-goods-dialog>
     <contractr-detail ref="contractDetailRef"></contractr-detail>
     <detail-dialog ref="contactDetailDialogRef"></detail-dialog>
-<!-- 多选删除弹窗 -->
-    <pop-modal :visible.sync="delVisible" content="是否确定删除?" @done="commitBtn"/>
+    <!-- 多选删除弹窗 -->
+    <pop-modal
+      :visible.sync="delVisible"
+      content="是否确定删除?"
+      @done="commitBtn"
+    />
   </div>
 </template>
 
 <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 addReturnGoodsDialog from '@/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog';
-import popModal from '@/components/pop-modal';
-import accountstatement from './accountstatement/index.vue'
-import returnGoods from './returnGoods/index.vue'
-import {getTableList,deleteInformation} from '@/api/saleManage/saleorder';
-import dictMixins from '@/mixins/dictMixins';
+  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 addReturnGoodsDialog from '@/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog';
+  import popModal from '@/components/pop-modal';
+  import accountstatement from './accountstatement/index.vue';
+  import returnGoods from './returnGoods/index.vue';
+  import { getTableList, deleteInformation } from '@/api/saleManage/saleorder';
+  import dictMixins from '@/mixins/dictMixins';
+  import { reviewStatus } from '@/enum/dict';
 
-
-export default {
+  export default {
     mixins: [dictMixins],
     components: {
       searchTable,
@@ -154,7 +180,7 @@ export default {
       addInvoiceDialog,
       invoice,
       addDialog,
-      detailDialog,
+      detailDialog
     },
     data() {
       return {
@@ -165,15 +191,15 @@ export default {
           { key: 'returnorder', name: '退货单' },
           { key: 'accountstatement', name: '对账单' }
         ],
-        selection:[],   //单选中集合
-        delVisible:false,  //批量删除弹框状态
-        loading: false,  // 加载状态
+        selection: [], //单选中集合
+        delVisible: false, //批量删除弹框状态
+        loading: false, // 加载状态
         columns: [
           {
-             width: 45,
-             type: 'selection',
-             columnKey: 'selection',
-             align: 'center'
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
           },
           {
             columnKey: 'index',
@@ -191,7 +217,7 @@ export default {
             slot: 'orderNo',
             showOverflowTooltip: true,
             minWidth: 200
-          }, 
+          },
           {
             prop: 'contractName',
             label: '合同名称',
@@ -219,43 +245,43 @@ export default {
             label: '客户名称',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 180,
+            minWidth: 180
           },
           {
             prop: 'partaLinkName',
             label: '客户联系人',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 130,
+            minWidth: 130
           },
-         
+
           {
             prop: 'partaTel',
             label: '客户联系电话',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 130,
+            minWidth: 130
           },
           {
             prop: 'partbName',
             label: '售出方名称',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 130,
+            minWidth: 130
           },
           {
             prop: 'partbLinkName',
             label: '售出方联系人',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 130,
+            minWidth: 130
           },
           {
             prop: 'partbTel',
             label: '售出方联系电话',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 130,
+            minWidth: 130
           },
           {
             prop: 'payAmount',
@@ -264,6 +290,17 @@ export default {
             showOverflowTooltip: true,
             minWidth: 170
           },
+
+          {
+            prop: 'orderStatus',
+            label: '审核状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return reviewStatus[_row.orderStatus];
+            }
+          },
           {
             prop: 'createTime',
             label: '创建时间',
@@ -279,7 +316,7 @@ export default {
             resizable: false,
             slot: 'action',
             showOverflowTooltip: true,
-            fixed: 'right',
+            fixed: 'right'
           }
         ]
       };
@@ -290,18 +327,18 @@ export default {
     },
     methods: {
       //更多菜单
-      handleCommand(command,row) {
-        console.log(command,row)
-        if(command==='invoice'){
-         this.$refs.invoiceDialogRef.open( 'add',{}, row.id)
+      handleCommand(command, row) {
+        console.log(command, row);
+        if (command === 'invoice') {
+          this.$refs.invoiceDialogRef.open('add', {}, row.id);
         }
-        if(command==='returnOrder'){
-          this.$refs.addReturnGoodsRef.open( 'add',{})
+        if (command === 'returnOrder') {
+          this.$refs.addReturnGoodsRef.open('add', {});
         }
       },
       //点击左边分类
       handleNodeClick(data, node) {
-       // this.curNodeData = data;
+        // this.curNodeData = data;
         this.reload({ categoryId: data.id });
       },
       /* 表格数据源 */
@@ -312,26 +349,25 @@ export default {
           ...where
         });
       },
-    
-  
+
       /* 刷新表格 */
       reload(where) {
         this.$refs.table.reload({ page: 1, where });
       },
-      
+
       //新增编辑
-      openEdit(type,row) {
-        this.$refs.addDialogRef.open( type,row, row.id);
+      openEdit(type, row) {
+        this.$refs.addDialogRef.open(type, row, row.id);
         this.$refs.addDialogRef.$refs.form &&
-        this.$refs.addDialogRef.$refs.form.clearValidate();
+          this.$refs.addDialogRef.$refs.form.clearValidate();
       },
-     
+
       //批量删除
-      allDelBtn(){
-        if(this.selection.length===0) return
-        this.delVisible=true
+      allDelBtn() {
+        if (this.selection.length === 0) return;
+        this.delVisible = true;
       },
-      
+
       //删除接口
       remove(delData) {
         deleteInformation(delData).then((res) => {
@@ -340,59 +376,59 @@ export default {
         });
       },
 
-    //删除弹框确定
-      commitBtn(){
-        const dataId=this.selection.map(v=>v.id)
-        this.remove(dataId)
+      //删除弹框确定
+      commitBtn() {
+        const dataId = this.selection.map((v) => v.id);
+        this.remove(dataId);
       },
 
-    //查看详情
-    openorderDetail(row){
+      //查看详情
+      openorderDetail(row) {
         this.$refs.contactDetailDialogRef.open(row);
       },
 
       //查看合同详情
-      opencontractDetail(row){
-        let data={
-          id:row.contractId
-        }
-        this.$refs.contractDetailRef.open(data)
+      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;
-}
+  :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;
+  .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;
-}
+  .switch_left ul .active {
+    border-top: 4px solid var(--color-primary);
+    color: var(--color-primary-5);
+  }
+  .switch {
+    padding-bottom: 20px;
+  }
 
-.el-dropdown-link {
+  .el-dropdown-link {
     cursor: pointer;
     color: var(--color-primary-5);
   }

+ 296 - 287
src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <ele-modal
-  custom-class="ele-dialog-form long-dialog-form"
+    custom-class="ele-dialog-form long-dialog-form"
     :centered="true"
     v-if="visible"
     :visible.sync="visible"
@@ -9,75 +9,53 @@
     width="80%"
     @close="cancel"
   >
-  
-  <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-   
+    <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-row>
+        <el-col :span="12">
+          <el-form-item
+            label="选择订单"
+            prop="orderNo"
+            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>
+              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-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
+          <!-- <el-form-item
               label="订单编码"
               prop="orderNo"
               style="margin-bottom: 22px"
@@ -86,96 +64,102 @@
               
             </el-form-item> -->
 
-           
-              <el-form-item
-              label="客户电话"
-              prop="linkPhone"
-              style="margin-bottom: 22px"
-            >
+          <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.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>
-
+              clearable
+              v-model="form.receiveAddress"
+              placeholder="请输入"
+            />
+          </el-form-item>
+          <el-form-item prop="repliedFiles" label="回执附件">
+            <fileUpload
+              v-model="form.repliedFiles"
+              module="main"
+              :showLib="false"
+              :limit="10"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
 
-      </el-form>
-
-      
-    
-      <headerTitle title="产品清单" style="margin-top:30px;"></headerTitle>
-     <inventoryTable  ref="inventoryTableref" :orderId="form.orderId"></inventoryTable>
+    <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 type="primary" @click="save('sub')">提交</el-button>
+
       <el-button @click="cancel">返回</el-button>
     </div>
-    <orderListDialog ref="orderListDialogRef" @changeParent="changeOrder"></orderListDialog>
+    <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';
+  import { acceptUnpackoptions } from '@/enum/dict';
+  import fileUpload from '@/components/upload/fileUpload';
+  import dictMixins from '@/mixins/dictMixins';
+  import parentList from '@/views/saleManage/contact/components/parentList.vue';
+  import { getSaleOrderDetail } from '@/api/saleManage/saleorder';
+  import {
+    addSendInformation,
+    UpdateSendInformation,
+    getSendSaleOrderrecordDetail,
+    submit
+  } from '@/api/saleManage/saleordersendrecord';
+  import { getcontactlink } from '@/api/saleManage/businessFollow';
+  import inventoryTable from './inventoryTable.vue';
+  import orderListDialog from './orderListDialog.vue';
+  import { copyObj } from '@/utils/util';
 
-
-export default {
+  export default {
     mixins: [dictMixins],
     components: {
       fileUpload,
-      deptSelect,
       inventoryTable,
       orderListDialog,
-      parentList,
-      personSelect
+      parentList
     },
     data() {
       let formDef = {
-          id:'',
-          contractId: '',
-          sendFiles:[],
-          contractName: '',
-          receiveAddress:'',
-          carNo:'',
-          carId:'',
-          linkName:'',
-          linkPhone:'',
-          orderNo:'',
-          orderId:''
-        };
-   
+        id: '',
+        contractId: '',
+        sendFiles: [],
+        repliedFiles: [],
+        contractName: '',
+        receiveAddress: '',
+        carNo: '',
+        carId: '',
+        linkName: '',
+        linkPhone: '',
+        orderNo: '',
+        orderId: '',
+        replied: 0
+      };
+
       return {
-        detailData:{},   
-        payWayOptions:[],
-        delDetailIds:[],
-        linkNameOptions:[],
+        detailData: {},
+        payWayOptions: [],
+        delDetailIds: [],
+        linkNameOptions: [],
         acceptUnpackoptions,
         visible: false,
         title: '',
@@ -185,157 +169,167 @@ export default {
         form: copyObj(formDef),
         tableBankData: [],
         tableLinkData: [],
-     // 组织机构树形结构数据
-       groupTreeData: [],
-       groupData:[],
-        rules: {        
+        // 组织机构树形结构数据
+        groupTreeData: [],
+        groupData: [],
+        rules: {
           partaName: [
             { required: true, message: '请选择客户名称', trigger: 'change' }
-          ],
+          ]
         },
-     
+
         // 提交状态
         loading: false,
         // 是否是修改
         isUpdate: false,
+        businessId: ''
       };
     },
     computed: {
-     
-      allcountAmount(){
-        return this.$store.state.order.allcountAmount
+      allcountAmount() {
+        return this.$store.state.order.allcountAmount;
       }
     },
-   
-    methods: {
 
-  
-       //选择订单回调
-       changeOrder(obj){
-        this.form = Object.assign({},this.form,{
+    methods: {
+      //选择订单回调
+      changeOrder(obj) {
+        this.form = Object.assign({}, this.form, {
           orderId: obj.id,
-          orderNo: obj.orderNo,
-        })
-        this.getSaleOrderDetail(obj.id)
-        
+          orderNo: obj.orderNo
+        });
+        this.getSaleOrderDetail(obj.id);
       },
       //获取订单详情
-      async getSaleOrderDetail(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.$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)
-          })
-          
-          
+            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){
+      async getSendSaleOrderDetail(id) {
+        this.businessId = id;
+
         this.loading = true;
         const data = await getSendSaleOrderrecordDetail(id);
         this.loading = false;
         if (data) {
-          this.$nextTick(()=>{
+          this.$nextTick(() => {
             this.form = data;
-            this.$refs.inventoryTableref&&this.$refs.inventoryTableref.putTableValue(data.productList)
-          })          
+            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
+      //更新联系人数据
+      async getLinkInfo(contactId) {
+        const data = await getcontactlink({ contactId });
+        if (data && data?.length) {
+          this.linkNameOptions = data;
         }
-        this.$refs.headRef.open(item)
-     },
-
-
+      },
+      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)
-    },
+      handleOrderBtn() {
+        let item = {
+          id: this.form.orderId
+        };
+        this.$refs.orderListDialogRef.open(item);
+      },
 
-    
       //打开新增编辑弹框
-      async open(type, row,orderId) {
-        this.title = type==='add'?'新增发货单':'修改';
+      async open(type, row, orderId) {
+        this.title = type === 'add' ? '新增发货单' : '修改';
         this.row = row;
         this.visible = true;
-        if(orderId){
-          this.getSaleOrderDetail(orderId)
+        if (orderId) {
+          this.getSaleOrderDetail(orderId);
         }
-        if(row&&row?.id){
-          this.getSendSaleOrderDetail(row?.id)
+        if (row && row?.id) {
+          this.getSendSaleOrderDetail(row?.id);
         }
-        
+
         if (type == 'add') {
           this.isUpdate = false;
         } else {
           this.isUpdate = true;
-         
         }
       },
 
-      salesmanChange(val, info){
+      salesmanChange(val, info) {
         this.otherForm.salesmanName = info.name;
       },
-      settlementModeChange(info){
+      settlementModeChange(info) {
         this.form.settlementModeName = info.dictValue;
       },
-      ifChiefChange(value, idx){
-        if(value === 1){
-          this.tableLinkData.forEach(e => e.ifChief = 0);
+      ifChiefChange(value, idx) {
+        if (value === 1) {
+          this.tableLinkData.forEach((e) => (e.ifChief = 0));
           this.tableLinkData[idx].ifChief = 1;
         }
       },
- 
-    
-     getValidate() {
+
+      getValidate() {
         return Promise.all([
-            new Promise((resolve, reject) => {
-              this.$refs.form.validate((valid) => {
-                if (!valid) {
-                  reject(false);
-                } else {
-                  resolve(true);
-                }
-              });
-            }),  new Promise((resolve, reject) => {
+          new Promise((resolve, reject) => {
+            this.$refs.form.validate((valid) => {
+              if (!valid) {
+                reject(false);
+              } else {
+                resolve(true);
+              }
+            });
+          }),
+          new Promise((resolve, reject) => {
             this.$refs.inventoryTableref.validateForm((valid) => {
               if (!valid) {
                 reject(false);
@@ -344,82 +338,97 @@ export default {
               }
             });
           })
-          
-          ]);
-     },
-      async save() {
+        ]);
+      },
+      async save(type) {
         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()
-        })
+          await this.getValidate();
+          // 表单验证通过,执行保存操作
+          this.loading = true;
 
-        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;
-            });
+          if (!this.isUpdate) {
+            delete this.form.id;
+          }
+          this.form.repliedFiles = this.form.repliedFiles || [];
+
+          this.form.replied = this.form.repliedFiles.length > 0 ? 1 : 0;
+          let commitData = Object.assign({}, this.form, {
+            productList: this.$refs.inventoryTableref.getTableValue()
+          });
+
+          if (this.isUpdate) {
+            UpdateSendInformation(commitData)
+              .then((res) => {
+                this.loading = false;
+                this.$message.success('修改成功');
+                if (type === 'sub') {
+                  this.sendSubmit(res);
+                  return;
+                }
+                this.cancel();
+                this.$emit('done');
+              })
+              .catch((e) => {
+                //this.loading = false;
+              });
+          } else {
+            addSendInformation(commitData)
+              .then((res) => {
+                this.loading = false;
+                this.$message.success('新增成功');
+                if (type === 'sub') {
+                  this.sendSubmit(res);
+                  return;
+                }
+                this.cancel();
+                this.$emit('done');
+              })
+              .catch((e) => {
+                //this.loading = false;
+              });
           }
         } catch (error) {
-          console.log(error)
+          console.log(error);
           // 表单验证未通过,不执行保存操作
         }
-       
+      },
+      sendSubmit(res) {
+        submit({
+          businessId: this.businessId || res
+          // productionSupervisorId
+        }).then((res) => {
+          this.cancel();
+          this.$emit('done');
+        });
       },
       cancel() {
         this.$nextTick(() => {
           this.activeName = 'base';
           // 关闭后,销毁所有的表单数据
-          this.$refs['otherForm'] &&  this.$refs['otherForm'].resetFields();
-          this.$refs['formRef'] &&  this.$refs['formRef'].resetFields();
+          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.form = copyObj(this.formDef);
           this.visible = false;
-        })
-      },
- 
-    
-
+        });
+      }
     }
   };
 </script>
 <style scoped lang="scss">
-.TotalAmount{
-  font-size: 16px;
-  padding-right: 30px;
-}
+  .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;
+  .headbox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      margin-right: 20px;
+    }
   }
-}
-</style>
+</style>

+ 374 - 357
src/views/saleManage/saleOrder/invoice/components/detailDialog.vue

@@ -1,389 +1,406 @@
 <template>
-    <ele-modal
+  <ele-modal
     custom-class="ele-dialog-form long-dialog-form"
-      :centered="true"
-      v-if="visible"
-      :visible.sync="visible"
-      :title="title"
-      :append-to-body="true"
-      :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>
+    :centered="true"
+    v-if="visible"
+    :visible.sync="visible"
+    :title="title"
+    :append-to-body="true"
+    :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="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="reviewStatus"
-              style="margin-bottom: 16px"
-            >
-            {{reviewStatusEnum[form.reviewStatus]?.label}}
-            </el-form-item>
-
-           
-          </el-col>
-       </el-row>
+          <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-form-item
+            label="回执附件:"
+            prop="sendFiles"
+            style="margin-bottom: 16px"
+          >
+            <div v-if="detailData.repliedFiles && detailData.repliedFiles?.length">
+              <el-link
+                v-for="link in detailData.repliedFiles"
+                :key="link.id"
+                type="primary"
+                :underline="false"
+                @click="downloadFile(link)"
+              >
+                {{ link.name }}</el-link
+              >
+            </div>
+          </el-form-item>
+        </el-col>
 
-   </el-form>
+        <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>
+    <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';
+      <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';
-  import { getSendSaleOrderrecordDetail} from '@/api/saleManage/saleordersendrecord';
-  
+  import { download } from '@/utils/file';
+  import { reviewStatusEnum } from '@/enum/dict';
+  import { copyObj } from '@/utils/util';
+  import { getSendSaleOrderrecordDetail } from '@/api/saleManage/saleordersendrecord';
+
   export default {
-      mixins: [dictMixins],
-      data() {
-      
-        return {
-          reviewStatusEnum,
-          visible: false,
-          detailId:'',
-          title: '详情',
-          row: {},
-          activeName: 'base',
-          form:{
-            orderFiles:[{name:'222'}]
+    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'
           },
-          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: 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: 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: 200,
-          prop: 'warehouseName',
-          label: '仓库名称',
-          slot: 'warehouseName'
-        },
-       
-        {
-          width: 120,
-          prop: 'totalCount',
-          label: '数量',
-          slot: 'totalCount'
-        },
-        {
-          width: 120,
-          prop: 'measuringUnit',
-          label: '计量单位',
-          slot: 'measuringUnit'
-        },
-        {
-          width: 160,
-          prop: 'singlePrice',
-          label: '单价',
-          slot: 'singlePrice'
-        },
-        {
-          width: 120,
-          prop: 'totalPrice',
-          label: '销售总金额',
-          slot: 'totalPrice',
-          formatter: (_row, _column, cellValue) => {
-              return _row.totalPrice+'元'
+            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: 200,
+            prop: 'warehouseName',
+            label: '仓库名称',
+            slot: 'warehouseName'
+          },
+
+          {
+            width: 120,
+            prop: 'totalCount',
+            label: '数量',
+            slot: 'totalCount'
+          },
+          {
+            width: 120,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            slot: 'measuringUnit'
+          },
+          {
+            width: 160,
+            prop: 'singlePrice',
+            label: '单价',
+            slot: 'singlePrice'
+          },
+          {
+            width: 120,
+            prop: 'totalPrice',
+            label: '销售总金额',
+            slot: 'totalPrice',
+            formatter: (_row, _column, cellValue) => {
+              return _row.totalPrice + '元';
             }
-        },
-       
-        {
-          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: '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: 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;
+      },
 
-        },
-        {
-          width: 220,
-          prop: 'remark',
-          label: '备注',
-          slot: 'remark'
-        }
-           ],
-        };
+      cancel() {
+        this.$nextTick(() => {
+          // 关闭后,销毁所有的表单数据
+          (this.form = copyObj(this.formDef)),
+            (this.otherForm = copyObj(this.otherFormDef)),
+            (this.tableBankData = []);
+          this.tableLinkData = [];
+          this.visible = false;
+        });
       },
-      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){
+      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.form = data;
-            this.detailData = data;
-            
-          }
-        },
-  
+      async getDetailData(id) {
+        this.loading = true;
+        const data = await getSendSaleOrderrecordDetail(id);
+        this.loading = false;
+        if (data) {
+          this.form = data;
+          this.detailData = data;
+        }
       }
-    };
-  </script>
-  
-  <style scoped lang="scss">
-  .ele-dialog-form{
-    .el-form-item{
+    }
+  };
+</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;
+  .headbox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      margin-right: 20px;
+    }
   }
-}
-  </style>
-  
+</style>

+ 17 - 129
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -95,7 +95,12 @@
           {{ scope.row.warehouseNum }}
         </el-form-item>
       </template>
-
+      <template v-slot:headerTotalCount="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerWarehouseId="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
       <!-- 操作列 -->
       <template v-slot:action="scope">
         <el-popconfirm
@@ -159,127 +164,7 @@
           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,
@@ -328,7 +213,8 @@
             width: 200,
             prop: 'warehouseId',
             label: '仓库名称',
-            slot: 'warehouseId'
+            slot: 'warehouseId',
+            headerSlot: 'headerWarehouseId'
           },
           {
             width: 100,
@@ -340,7 +226,8 @@
             width: 120,
             prop: 'totalCount',
             label: '发货数量',
-            slot: 'totalCount'
+            slot: 'totalCount',
+            headerSlot: 'headerTotalCount'
           },
           {
             width: 120,
@@ -375,7 +262,7 @@
           {
             width: 160,
             prop: 'deliveryDeadline',
-            label: '交期截止日期',
+            label: '交期截止日期'
           },
           {
             width: 200,
@@ -386,7 +273,7 @@
           {
             width: 160,
             prop: 'guaranteePeriodDeadline',
-            label: '质保截止日期',
+            label: '质保截止日期'
           },
           {
             width: 130,
@@ -442,7 +329,9 @@
       async warehouseChange(index, row) {
         let warehouseIds =
           this.form.datasource
-            .filter((item, i) => row.productCode == item.productCode && index != i)
+            .filter(
+              (item, i) => row.productCode == item.productCode && index != i
+            )
             .map((item) => item.warehouseId) || [];
         const data = this.warehouseList.find(
           (item) => item.id == row.warehouseId
@@ -451,7 +340,7 @@
           row.warehouseId = '';
           return this.$message.error('同一个产品不能选择相同的仓库');
         }
-  
+
         this.$set(this.form.datasource[index], 'warehouseName', data.name);
         this.$set(this.form.datasource[index], 'warehouseCode', data.code);
         const warehouseOutStock = await getWarehouseOutStock({
@@ -463,7 +352,6 @@
           'warehouseNum',
           warehouseOutStock
         );
-
       },
 
       //修改数量更新合计
@@ -477,7 +365,7 @@
       //选择产品回调
       changeParent(obj, idx) {
         obj.orderTotalCount = obj.totalCount;
-        obj.id = ''
+        obj.id = '';
         this.$set(
           this.form.datasource,
           this.form.datasource.length,

+ 307 - 281
src/views/saleManage/saleOrder/invoice/index.vue

@@ -1,292 +1,319 @@
 <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,'docNo')"> {{ row.docNo }}</el-link>
-                </template>
-                <template v-slot:orderNo="{ row }">
-                <el-link type="primary" :underline="false" @click="openorderDetail(row,'orderNo')"> {{ row.orderNo }}</el-link>
+  <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, 'docNo')"
+            >
+              {{ row.docNo }}</el-link
+            >
+          </template>
+          <template v-slot:orderNo="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="openorderDetail(row, 'orderNo')"
+            >
+              {{ row.orderNo }}</el-link
+            >
+          </template>
+          <!-- 操作列 -->
+          <template v-slot:action="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="openEdit('edit', row)"
+              v-if="[0, 3].includes(row.reviewStatus)"
+            >
+              修改
+            </el-link>
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此信息吗?"
+              @confirm="remove([row.id])"
+              v-if="[0, 3].includes(row.reviewStatus)"
+            >
+              <template v-slot:reference>
+                <el-link type="danger" :underline="false" icon="el-icon-delete">
+                  删除
+                </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>
-                  <el-link
-                    type="primary"
-                    :underline="false"
-                    icon="el-icon-edit"
-                    @click="creatReturnGoods('add',row)"
-                  >
-                    创建退货单
-                  </el-link>
-                </template>
-              </ele-pro-table>
-            </div>
-      </el-card>
-  
-      <order-detail-dialog  ref="orderDetailDialogRef"></order-detail-dialog>
-      <add-invoice-dialog ref="invoiceDialogRef"  @done="reload"></add-invoice-dialog>
-      <detail-dialog ref="DetailDialogRef"></detail-dialog>
-      <add-return-goods-dialog ref="addReturnGoodsRef"  @done="reload"></add-return-goods-dialog>
-  <!-- 多选删除弹窗 -->
-      <pop-modal :visible.sync="delVisible" content="是否确定删除?" @done="commitBtn"/>
-    </div>
-  </template>
-  
-  <script>
+            </el-popconfirm>
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="creatReturnGoods('add', row)"
+              v-if="[2].includes(row.reviewStatus)"
+            >
+              创建退货单
+            </el-link>
+          </template>
+        </ele-pro-table>
+      </div>
+    </el-card>
+
+    <order-detail-dialog ref="orderDetailDialogRef"></order-detail-dialog>
+    <add-invoice-dialog
+      ref="invoiceDialogRef"
+      @done="reload"
+    ></add-invoice-dialog>
+    <detail-dialog ref="DetailDialogRef"></detail-dialog>
+    <add-return-goods-dialog
+      ref="addReturnGoodsRef"
+      @done="reload"
+    ></add-return-goods-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 orderDetailDialog from '@/views/saleManage/saleOrder/components/detailDialog.vue'
-  import {contactTypeTree} from '@/api/saleManage/contact';
+  import { reviewStatusEnum } from '@/enum/dict';
+  import orderDetailDialog from '@/views/saleManage/saleOrder/components/detailDialog.vue';
+  import { contactTypeTree } from '@/api/saleManage/contact';
   import addReturnGoodsDialog from '@/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog';
-  import {getTableList, getDetail, UpdateInformation, addInformation,deleteInformation} from '@/api/saleManage/saleorder';
-  import {getSendTableList, getSendSaleOrderrecordDetail, UpdateSendInformation, addSendInformation,deleteSendInformation} from '@/api/saleManage/saleordersendrecord';
+  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,
-        addReturnGoodsDialog,
-        orderDetailDialog,
-        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',
-              slot: 'orderNo',
-              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?'是':'否';
+    mixins: [dictMixins],
+    components: {
+      searchTable,
+      popModal,
+      addReturnGoodsDialog,
+      orderDetailDialog,
+      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',
+            slot: 'orderNo',
+            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) => {
+          },
+          {
+            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',
-            }
-          ]
-        };
+          },
+          {
+            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
+        });
+      },
+
+      //创建退货单
+      creatReturnGoods(type, row) {
+        this.$refs.addReturnGoodsRef.open(type, {}, row.id);
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
       },
-      computed: {},
-   
-      methods: {
-      
-      
-        /* 表格数据源 */
-        datasource({ page, limit, where, order }) {
-          return getSendTableList({
-            pageNum: page,
-            size: limit,
-            ...where
-          });
-        },
-      
-        //创建退货单
-        creatReturnGoods(type,row){
-          this.$refs.addReturnGoodsRef.open(type,{},row.id)
-        },
-    
-        /* 刷新表格 */
-        reload(where) {
-          this.$refs.table.reload({ page: 1, where });
-        },
-        
-        //新增编辑
-        openEdit(type,row) {
-          this.$refs.invoiceDialogRef.open( type,row);
-          this.$refs.invoiceDialogRef.$refs.form &&
+
+      //新增编辑
+      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();
-          });
-        },
-  
+      },
+
+      //批量删除
+      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)
-        },
-  
+      commitBtn() {
+        const dataId = this.selection.map((v) => v.id);
+        this.remove(dataId);
+      },
+
       //查看详情
-      openorderDetail(row,type){
-        
-          if(type==='docNo'){
-            this.$refs.DetailDialogRef.open(row);
+      openorderDetail(row, type) {
+        if (type === 'docNo') {
+          this.$refs.DetailDialogRef.open(row);
+        }
+        if (type === 'orderNo') {
+          this.$refs.orderDetailDialogRef.open({ id: row.orderId });
+        }
       }
-      if(type==='orderNo'){
-        this.$refs.orderDetailDialogRef.open({id:row.orderId});
-      }
-        },
-  
-      }
-    };
-  </script>
-  
-  <style lang="scss" scoped>
-  .ele-body{
-    padding-top:0;
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .ele-body {
+    padding-top: 0;
     padding-bottom: 0;
   }
- :deep .el-card__body{
-  padding: 0;
-}
-  :deep(.el-link--inner){
+  :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;
@@ -300,21 +327,20 @@
       margin-left: 10px;
     }
   }
-  
-  .switch_left ul .active{
+
+  .switch_left ul .active {
     border-top: 4px solid var(--color-primary);
-      color: var(--color-primary-5);
+    color: var(--color-primary-5);
   }
-  .switch{
+  .switch {
     padding-bottom: 20px;
   }
-  
+
   .el-dropdown-link {
-      cursor: pointer;
-      color: var(--color-primary-5);
-    }
-    .el-icon-arrow-down {
-      font-size: 12px;
-    }
-  </style>
-  
+    cursor: pointer;
+    color: var(--color-primary-5);
+  }
+  .el-icon-arrow-down {
+    font-size: 12px;
+  }
+</style>

+ 410 - 393
src/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <ele-modal
-  custom-class="ele-dialog-form long-dialog-form"
+    custom-class="ele-dialog-form long-dialog-form"
     :centered="true"
     v-if="visible"
     :visible.sync="visible"
@@ -9,122 +9,124 @@
     width="80%"
     @close="cancel"
   >
-  
-  <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-   
+    <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="sendNo"
-              style="margin-bottom: 22px"
-            >
+      <el-row>
+        <el-col :span="12">
+          <el-form-item
+            label="发货单"
+            prop="sendNo"
+            style="margin-bottom: 22px"
+          >
             <el-input
-                clearable
-                v-model="form.sendNo"
-                @click.native="handleOrderBtn"
-                placeholder="请输入"
-              />
-            </el-form-item>
-         
-            <el-form-item
-              label="退货备注"
-              prop="remark"
-              style="margin-bottom: 22px"
-            >
-            <el-input
-                clearable
-                v-model="form.remark"
-                type="textarea"
-                placeholder="请输入"
-              />
-            </el-form-item>
-          </el-col>
-
-
-
-
-          <el-col :span="12">
+              clearable
+              v-model="form.sendNo"
+              @click.native="handleOrderBtn"
+              placeholder="请输入"
+            />
+          </el-form-item>
 
-            <el-form-item
-              label="客户名称"
-              prop="contactName"
-              style="margin-bottom: 22px"
-            >
-            {{form.contactName}}
-            </el-form-item>
-
-            <el-form-item prop="returnFiles" label="退货附件">
-                <fileUpload
-                  v-model="form.returnFiles"
-                  module="main"
-                  :showLib="false"
-                  :limit="10"
-                />
-              </el-form-item>
-            
-          </el-col>
-        </el-row>
+          <el-form-item
+            label="退货备注"
+            prop="remark"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              clearable
+              v-model="form.remark"
+              type="textarea"
+              placeholder="请输入"
+            />
+          </el-form-item>
+          <el-form-item prop="repliedFiles" label="回执附件">
+            <fileUpload
+              v-model="form.repliedFiles"
+              module="main"
+              :showLib="false"
+              :limit="10"
+            />
+          </el-form-item>
+        </el-col>
 
+        <el-col :span="12">
+          <el-form-item
+            label="客户名称"
+            prop="contactName"
+            style="margin-bottom: 22px"
+          >
+            {{ form.contactName }}
+          </el-form-item>
 
+          <el-form-item prop="returnFiles" label="退货附件">
+            <fileUpload
+              v-model="form.returnFiles"
+              module="main"
+              :showLib="false"
+              :limit="10"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
 
-      
-    
-      <headerTitle title="产品清单" style="margin-top:30px;"></headerTitle>
-      <inventoryTable  ref="inventoryTableref" :sendId="form.sendId"></inventoryTable>
-      <el-row style="margin-top:20px">
-         <el-col :span="12">
-           <el-form-item
-             label="总金额"
-             prop="totalPrice"
-             style="margin-bottom: 22px"
-           >
-          {{ totalAmount}}元
-           </el-form-item>
-           </el-col>
-           <el-col :span="12">
-           <el-form-item
-             label="金额"
-             prop="payAmount"
-             style="margin-bottom: 22px"
-           >
-           <el-input
-               clearable
-               v-model="form.payAmount"
-               placeholder="请输入"
-             />
-           </el-form-item>
-           </el-col>
+      <headerTitle title="产品清单" style="margin-top: 30px"></headerTitle>
+      <inventoryTable
+        ref="inventoryTableref"
+        :sendId="form.sendId"
+      ></inventoryTable>
+      <el-row style="margin-top: 20px">
+        <el-col :span="12">
+          <el-form-item
+            label="总金额"
+            prop="totalPrice"
+            style="margin-bottom: 22px"
+          >
+            {{ totalAmount }}元
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item
+            label="金额"
+            prop="payAmount"
+            style="margin-bottom: 22px"
+          >
+            <el-input clearable v-model="form.payAmount" placeholder="请输入" />
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
 
     <div slot="footer" class="footer">
       <el-button type="primary" @click="save">保存</el-button>
+      <el-button type="primary" @click="save('sub')">提交</el-button>
       <el-button @click="cancel">返回</el-button>
     </div>
-    <sendListDialog ref="sendListDialogRef" @changeParent="changeOrder"></sendListDialog>
-
+    <sendListDialog
+      ref="sendListDialogRef"
+      @changeParent="changeOrder"
+    ></sendListDialog>
   </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 {getReturnTableList, getReturnSaleOrderrecordDetail, UpdateReturnInformation, addReturnInformation,deleteReturnInformation} from '@/api/saleManage/returnGoods';
-import {getSendSaleOrderrecordDetail } from '@/api/saleManage/saleordersendrecord';
-import inventoryTable from './inventoryTable.vue';
-import sendListDialog from './sendListDialog.vue';
-import {copyObj} from '@/utils/util';
+  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 {
+    getReturnSaleOrderrecordDetail,
+    UpdateReturnInformation,
+    addReturnInformation,
+    submit
+  } from '@/api/saleManage/returnGoods';
+  import { getSendSaleOrderrecordDetail } from '@/api/saleManage/saleordersendrecord';
+  import inventoryTable from './inventoryTable.vue';
+  import sendListDialog from './sendListDialog.vue';
+  import { copyObj } from '@/utils/util';
 
-
-export default {
+  export default {
     mixins: [dictMixins],
     components: {
       fileUpload,
@@ -136,21 +138,21 @@ export default {
     },
     data() {
       let formDef = {
-          id:'',
-          payAmount: '',
-          returnFiles:[],
-          remark:'',
-          sendId:'',
-          sendNo:'',
-          totalAmount:''
-        };
-   
+        id: '',
+        payAmount: '',
+        returnFiles: [],
+        repliedFiles: [],
+        remark: '',
+        sendId: '',
+        sendNo: '',
+        totalAmount: ''
+      };
+
       return {
-        
-        detailData:{},   
-        payWayOptions:[],
-        delDetailIds:[],
-        linkNameOptions:[],
+        detailData: {},
+        payWayOptions: [],
+        delDetailIds: [],
+        linkNameOptions: [],
         acceptUnpackoptions,
         visible: false,
         title: '',
@@ -160,371 +162,386 @@ export default {
         form: copyObj(formDef),
         tableBankData: [],
         tableLinkData: [],
-     // 组织机构树形结构数据
-       groupTreeData: [],
-       groupData:[],
-        rules: {        
+        // 组织机构树形结构数据
+        groupTreeData: [],
+        groupData: [],
+        rules: {
           partaName: [
             { required: true, message: '请选择客户名称', trigger: 'change' }
           ],
-          payAmount:[
-          {required: true, pattern: numberReg, message: '请输入数字', trigger: 'blur' }
+          payAmount: [
+            {
+              required: true,
+              pattern: numberReg,
+              message: '请输入数字',
+              trigger: 'blur'
+            }
           ]
-         
         },
         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: 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: 220,
-        prop: 'remark',
-        label: '备注',
-        slot: 'remark'
-      },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 120,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          fixed:'right',
-          showOverflowTooltip: true
-        }
-         ],
+          {
+            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,
+        businessId: ''
       };
     },
     computed: {
-    
-      totalAmount(){
-        let allcountAmount=this.$store.state.returnGoods.allcountAmount
-        if(!this.$store.state.isDefaultPayableAmount){
-          this.form.payAmount=allcountAmount
+      totalAmount() {
+        let allcountAmount = this.$store.state.returnGoods.allcountAmount;
+        if (!this.$store.state.isDefaultPayableAmount) {
+          this.form.payAmount = allcountAmount;
         }
-       
-        return allcountAmount
+
+        return 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){
+        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.orderId,
         //   sendNo: obj.docNo,
         //   sendId:obj.id
         // })
-        this.getSendSaleOrderDetail(obj.id)
-        
+        this.getSendSaleOrderDetail(obj.id);
       },
-   
 
       //发货单详情
-      async getSendSaleOrderDetail(id){
+      async getSendSaleOrderDetail(id) {
         this.loading = true;
         const data = await getSendSaleOrderrecordDetail(id);
         this.loading = false;
         if (data) {
-          this.$nextTick(()=>{
-            this.form = Object.assign({},this.form,{
-             orderId: data.orderId,
-             sendNo: data.docNo,
-             sendId:data.id,
-             contactName:data.contactName
-           })
-            this.$refs.inventoryTableref&&this.$refs.inventoryTableref.putTableValue(data.productList)
-          })          
+          this.$nextTick(() => {
+            this.form = Object.assign({}, this.form, {
+              orderId: data.orderId,
+              sendNo: data.docNo,
+              sendId: data.id,
+              contactName: data.contactName
+            });
+            this.$refs.inventoryTableref &&
+              this.$refs.inventoryTableref.putTableValue(data.productList);
+          });
         }
       },
 
-
       //获取退货单详情
-      async getReturnSaleOrderrecordDetail(id){
+      async getReturnSaleOrderrecordDetail(id) {
+        this.businessId = id;
+
         this.loading = true;
         const data = await getReturnSaleOrderrecordDetail(id);
         this.loading = false;
         if (data) {
-          this.$nextTick(()=>{
-            this.form =data
-            this.$refs.inventoryTableref&&this.$refs.inventoryTableref.putTableValue(data.productList)
-          })          
+          this.$nextTick(() => {
+            this.form = data;
+            this.$refs.inventoryTableref &&
+              this.$refs.inventoryTableref.putTableValue(data.productList);
+          });
         }
       },
 
-
-    
       //选择订单弹框
-       handleOrderBtn(){
-         let item = {
-           id: this.form.sendId
-      }
-        this.$refs.sendListDialogRef.open(item)
-    },
+      handleOrderBtn() {
+        let item = {
+          id: this.form.sendId
+        };
+        this.$refs.sendListDialogRef.open(item);
+      },
 
-    
       //打开新增编辑弹框
-      async open(type, row,sendId) {
-        this.title = type==='add'?'新增':'修改';
+      async open(type, row, sendId) {
+        this.title = type === 'add' ? '新增' : '修改';
         this.row = row;
         this.visible = true;
         this.$store.commit('returnGoods/clearUserData');
-        if(type==='add'){
-          this.$store.commit('returnGoods/setIsDefaultPayableAmount', false);  // 设置标志变量为 false,应付金额将跟随订单金额同步
+        if (type === 'add') {
+          this.$store.commit('returnGoods/setIsDefaultPayableAmount', false); // 设置标志变量为 false,应付金额将跟随订单金额同步
         }
-        if(row&&row?.id){
-          this.getReturnSaleOrderrecordDetail(row?.id)
+        if (row && row?.id) {
+          this.getReturnSaleOrderrecordDetail(row?.id);
         }
-        if(sendId){
-          this.getSendSaleOrderDetail(sendId)
+        if (sendId) {
+          this.getSendSaleOrderDetail(sendId);
         }
         if (type == 'add') {
           this.isUpdate = false;
         } else {
           this.isUpdate = true;
-         
         }
       },
 
-      salesmanChange(val, info){
+      salesmanChange(val, info) {
         this.otherForm.salesmanName = info.name;
       },
-      settlementModeChange(info){
+      settlementModeChange(info) {
         this.form.settlementModeName = info.dictValue;
       },
-      ifChiefChange(value, idx){
-        if(value === 1){
-          this.tableLinkData.forEach(e => e.ifChief = 0);
+      ifChiefChange(value, idx) {
+        if (value === 1) {
+          this.tableLinkData.forEach((e) => (e.ifChief = 0));
           this.tableLinkData[idx].ifChief = 1;
         }
       },
- 
-    
-     getValidate() {
+
+      getValidate() {
         return Promise.all([
-            new Promise((resolve, reject) => {
-              this.$refs.form.validate((valid) => {
-                if (!valid) {
-                  reject(false);
-                } else {
-                  resolve(true);
+          new Promise((resolve, reject) => {
+            this.$refs.form.validate((valid) => {
+              if (!valid) {
+                reject(false);
+              } else {
+                resolve(true);
+              }
+            });
+          }),
+          new Promise((resolve, reject) => {
+            this.$refs.inventoryTableref.validateForm((valid) => {
+              if (!valid) {
+                reject(false);
+              } else {
+                resolve(true);
+              }
+            });
+          })
+        ]);
+      },
+      async save(type) {
+        try {
+          await this.getValidate();
+          // 表单验证通过,执行保存操作
+          this.loading = true;
+
+          if (!this.isUpdate) {
+            delete this.form.id;
+          }
+          let productList = this.$refs.inventoryTableref.getTableValue();
+          if (productList.length === 0) {
+            return this.$message.error('至少选择一个退货产品');
+          }
+          this.form.repliedFiles = this.form.repliedFiles || [];
+          this.form.replied = this.form.repliedFiles.length > 0 ? 1 : 0;
+          let commitData = Object.assign({}, this.form, {
+            totalAmount: Number(this.totalAmount),
+            productList
+          });
+
+          if (this.isUpdate) {
+            UpdateReturnInformation(commitData)
+              .then((res) => {
+                this.loading = false;
+
+                this.$message.success('修改成功');
+                if (type === 'sub') {
+                  this.returnSubmit(res);
+                  return;
                 }
+                this.cancel();
+                this.$emit('done');
+              })
+              .catch((e) => {
+                //this.loading = false;
               });
-            }),  new Promise((resolve, reject) => {
-              this.$refs.inventoryTableref.validateForm((valid) => {
-                if (!valid) {
-                  reject(false);
-                } else {
-                  resolve(true);
+          } else {
+            addReturnInformation(commitData)
+              .then((res) => {
+                this.loading = false;
+                this.$message.success('新增成功');
+                if (type === 'sub') {
+                  this.returnSubmit(res);
+                  return;
                 }
+                this.cancel();
+                this.$emit('done');
+              })
+              .catch((e) => {
+                //this.loading = false;
               });
-            })
-          
-          ]);
-     },
-      async save() {
-        try {
-           await this.getValidate();
-           // 表单验证通过,执行保存操作
-           this.loading = true;
-      
-        if (!this.isUpdate) {
-          delete this.form.id;
-        } 
-       let productList=this.$refs.inventoryTableref.getTableValue()
-       if(productList.length===0) {
-        return this.$message.error('至少选择一个退货产品')
-       }
-        let commitData=Object.assign({},this.form,{
-          totalAmount:Number(this.totalAmount),
-          productList
-        })
-
-        if (this.isUpdate) {
-          UpdateReturnInformation(commitData)
-            .then((res) => {
-              this.loading = false;
-              this.$message.success("修改成功");
-              this.cancel();
-              this.$emit('done');
-            })
-            .catch((e) => {
-              //this.loading = false;
-            });
-        } else {
-          addReturnInformation(commitData)
-            .then((res) => {
-              this.loading = false;
-              this.$message.success("新增成功");
-              this.cancel();
-              this.$emit('done');
-            })
-            .catch((e) => {
-              //this.loading = false;
-            });
           }
         } catch (error) {
-          console.log(error)
+          console.log(error);
           // 表单验证未通过,不执行保存操作
         }
-       
+      },
+      returnSubmit(res) {
+        submit({
+          businessId: this.businessId || res
+          // productionSupervisorId
+        }).then((res) => {
+          this.cancel();
+          this.$emit('done');
+        });
       },
       cancel() {
         this.$nextTick(() => {
           this.activeName = 'base';
           // 关闭后,销毁所有的表单数据
-          this.$refs['otherForm'] &&  this.$refs['otherForm'].resetFields();
-          this.$refs['formRef'] &&  this.$refs['formRef'].resetFields();
+          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.form = copyObj(this.formDef);
           this.visible = false;
-        })
-      },
- 
-    
-
+        });
+      }
     }
   };
 </script>
 <style scoped lang="scss">
-.TotalAmount{
-  font-size: 16px;
-  padding-right: 30px;
-}
+  .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;
+  .headbox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      margin-right: 20px;
+    }
   }
-}
-</style>
+</style>

+ 393 - 373
src/views/saleManage/saleOrder/returnGoods/components/detailDialog.vue

@@ -1,404 +1,424 @@
 <template>
-    <ele-modal
+  <ele-modal
     custom-class="ele-dialog-form long-dialog-form"
-      :centered="true"
-      v-if="visible"
-      :visible.sync="visible"
-      :title="title"
-      :append-to-body="true"
-      :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>
+    :centered="true"
+    v-if="visible"
+    :visible.sync="visible"
+    :title="title"
+    :append-to-body="true"
+    :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="payAmount"
-              style="margin-bottom: 16px"
-            >
-            {{form.payAmount}}元
-            </el-form-item>
-            <el-form-item
-              label="总金额:"
-              prop="totalAmount"
-              style="margin-bottom: 16px"
-            >
-            {{form.totalAmount}}元
-            </el-form-item>
-            <el-form-item
-              label="备注:"
-              prop="remark"
-              style="margin-bottom: 16px"
-            >
-            {{form.remark}}
-            </el-form-item>
-            <el-form-item
-              label="创建时间:"
-              prop="createTime"
-              style="margin-bottom: 16px"
-            >
-            {{form.createTime}}
-            </el-form-item>
-            <el-form-item
-              label="制单人:"
-              prop="makerName"
-              style="margin-bottom: 16px"
-            >
-            {{form.makerName}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item
-              label="退货编码:"
-              prop="returnNo"
-              style="margin-bottom: 16px"
-            >
-            {{form.returnNo}}
-            </el-form-item>
-            <el-form-item
-              label="发货编码:"
-              prop="sendNo"
-              style="margin-bottom: 16px"
-            >
-            {{form.sendNo}}
-            </el-form-item>
-            <el-form-item prop="orderNo" label="订单编码:" >
-              {{form.orderNo}}
-              </el-form-item>
-           
-           
-             
-              <el-form-item
-              label="审核状态:"
-              prop="reviewStatus"
-              style="margin-bottom: 16px"
-            >
-            {{reviewStatusEnum[form.reviewStatus].label}}
-            </el-form-item>
-            <el-form-item
-              label="发货附件:"
-              prop="returnFiles"
-              style="margin-bottom: 16px"
-            >
-            <div v-if="detailData.returnFiles && detailData.returnFiles?.length">
-               <el-link v-for="link in detailData.returnFiles" :key="link.id"
-                         type="primary" :underline="false"
-                         @click="downloadFile(link)"> {{ link.name }}</el-link> 
-                        </div>
-            </el-form-item>
-           
-          </el-col>
-       </el-row>
+          <el-form-item
+            label="客户名称:"
+            prop="contactName"
+            style="margin-bottom: 16px"
+          >
+            {{ form.contactName }}
+          </el-form-item>
 
-   </el-form>
+          <el-form-item
+            label="金额:"
+            prop="payAmount"
+            style="margin-bottom: 16px"
+          >
+            {{ form.payAmount }}元
+          </el-form-item>
+          <el-form-item
+            label="总金额:"
+            prop="totalAmount"
+            style="margin-bottom: 16px"
+          >
+            {{ form.totalAmount }}元
+          </el-form-item>
+          <el-form-item
+            label="备注:"
+            prop="remark"
+            style="margin-bottom: 16px"
+          >
+            {{ form.remark }}
+          </el-form-item>
+          <el-form-item
+            label="创建时间:"
+            prop="createTime"
+            style="margin-bottom: 16px"
+          >
+            {{ form.createTime }}
+          </el-form-item>
+          <el-form-item
+            label="制单人:"
+            prop="makerName"
+            style="margin-bottom: 16px"
+          >
+            {{ form.makerName }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item
+            label="退货编码:"
+            prop="returnNo"
+            style="margin-bottom: 16px"
+          >
+            {{ form.returnNo }}
+          </el-form-item>
+          <el-form-item
+            label="发货编码:"
+            prop="sendNo"
+            style="margin-bottom: 16px"
+          >
+            {{ form.sendNo }}
+          </el-form-item>
+          <el-form-item prop="orderNo" label="订单编码:">
+            {{ form.orderNo }}
+          </el-form-item>
 
+          <el-form-item
+            label="审核状态:"
+            prop="reviewStatus"
+            style="margin-bottom: 16px"
+          >
+            {{ reviewStatusEnum[form.reviewStatus].label }}
+          </el-form-item>
+          <el-form-item
+            label="发货附件:"
+            prop="returnFiles"
+            style="margin-bottom: 16px"
+          >
+            <div
+              v-if="detailData.returnFiles && detailData.returnFiles?.length"
+            >
+              <el-link
+                v-for="link in detailData.returnFiles"
+                :key="link.id"
+                type="primary"
+                :underline="false"
+                @click="downloadFile(link)"
+              >
+                {{ link.name }}</el-link
+              >
+            </div>
+          </el-form-item>
+          <el-form-item
+            label="回执附件:"
+            prop="sendFiles"
+            style="margin-bottom: 16px"
+          >
+            <div
+              v-if="detailData.repliedFiles && detailData.repliedFiles?.length"
+            >
+              <el-link
+                v-for="link in detailData.repliedFiles"
+                :key="link.id"
+                type="primary"
+                :underline="false"
+                @click="downloadFile(link)"
+              >
+                {{ link.name }}</el-link
+              >
+            </div>
+          </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>
+    <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>
+      <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 { getReturnSaleOrderrecordDetail} from '@/api/saleManage/returnGoods';
+    <div slot="footer" class="footer">
+      <el-button @click="cancel">返回</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { getReturnSaleOrderrecordDetail } from '@/api/saleManage/returnGoods';
   import { getByCode } from '@/api/system/dictionary-data';
-  import {getFile} from '@/api/system/file';
+  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';
-  
-  
+  import { download } from '@/utils/file';
+  import { reviewStatusEnum } from '@/enum/dict';
+  import { copyObj } from '@/utils/util';
+
   export default {
-      mixins: [dictMixins],
-      data() {
-      
-        return {
-          codeData:[],
-          reviewStatusEnum,
-          visible: false,
-          detailId:'',
-          title: '详情',
-          row: {},
-          activeName: 'base',
-          form:{
-            orderFiles:[{name:'222'}]
+    mixins: [dictMixins],
+    data() {
+      return {
+        codeData: [],
+        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'
           },
-          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: 200,
+            prop: 'moneyName',
+            label: '款项名称',
+            slot: 'moneyName'
+          },
+          {
+            width: 100,
+            prop: 'price',
+            label: '金额',
+            slot: 'price',
+            formatter: (_row, _column, cellValue) => {
+              return _row.price + '元';
             }
-        },
-        {
-          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: 120,
-          prop: 'sendTotalCount',
-          label: '发货数量',
-          slot: 'sendTotalCount'
-        },
-        
-       
-        {
-          width: 120,
-          prop: 'totalCount',
-          label: '退货数量',
-          slot: 'totalCount'
-        },
-        {
-          width: 80,
-          prop: 'measuringUnit',
-          label: '计量单位',
-          slot: 'measuringUnit'
-        },
-        {
-          width: 160,
-          prop: 'singlePrice',
-          label: '单价',
-          slot: 'singlePrice'
-        },
-        {
-          width: 120,
-          prop: 'totalPrice',
-          label: '合计',
-          slot: 'totalPrice'
-        },
-               
-         {
-          width: 200,
-          prop: 'returnReason',
-          label: '退货原因',
-          slot: 'returnReason'
-        },
-        {
-          width: 140,
-          prop: 'returnTypeName',
-          label: '退货类型',
-          slot: 'returnTypeName'
-        },
-        {
-          width: 120,
-          prop: 'deliveryDays',
-          label: '交期(天)',
-          slot: 'deliveryDays'
-        },
-         {
-          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: 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: 220,
-          prop: 'remark',
-          label: '备注',
-          slot: 'remark'
-        }
-           ],
-        };
+          {
+            width: 120,
+            prop: 'sendTotalCount',
+            label: '发货数量',
+            slot: 'sendTotalCount'
+          },
+
+          {
+            width: 120,
+            prop: 'totalCount',
+            label: '退货数量',
+            slot: 'totalCount'
+          },
+          {
+            width: 80,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            slot: 'measuringUnit'
+          },
+          {
+            width: 160,
+            prop: 'singlePrice',
+            label: '单价',
+            slot: 'singlePrice'
+          },
+          {
+            width: 120,
+            prop: 'totalPrice',
+            label: '合计',
+            slot: 'totalPrice'
+          },
+
+          {
+            width: 200,
+            prop: 'returnReason',
+            label: '退货原因',
+            slot: 'returnReason'
+          },
+          {
+            width: 140,
+            prop: 'returnTypeName',
+            label: '退货类型',
+            slot: 'returnTypeName'
+          },
+          {
+            width: 120,
+            prop: 'deliveryDays',
+            label: '交期(天)',
+            slot: 'deliveryDays'
+          },
+          {
+            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'
+          }
+        ]
+      };
+    },
+    created() {},
+    methods: {
+      async getcode(code) {
+        const res = await getByCode(code);
+        this.codeData = res.data;
       },
-      created(){
-       
+      async open(row) {
+        this.form = row;
+        this.visible = true;
+        this.getDetailData(row.id);
+        this.detailId = row.id;
       },
-      methods: {
-      async getcode(code){
-        const res = await getByCode(code);
-        this.codeData=res.data
-       },
-        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){
+
+      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;
-          await this.getcode('sale_return_type')
-          const data = await getReturnSaleOrderrecordDetail(id);
-          this.loading = false;
-          if (data) {
-            let productList=data.productList;
-            productList.forEach(r=>{
-              let foundObject=this.codeData.find(obj=>obj[r.returnType]!=undefined)
-              if(foundObject){
-                r.returnTypeName=foundObject[r.returnType]
-              }
-            })
-            this.detailData = data;
-            
-          }
-        },
-  
+      async getDetailData(id) {
+        this.loading = true;
+        await this.getcode('sale_return_type');
+        const data = await getReturnSaleOrderrecordDetail(id);
+        this.loading = false;
+        if (data) {
+          let productList = data.productList;
+          productList.forEach((r) => {
+            let foundObject = this.codeData.find(
+              (obj) => obj[r.returnType] != undefined
+            );
+            if (foundObject) {
+              r.returnTypeName = foundObject[r.returnType];
+            }
+          });
+          this.detailData = data;
+        }
       }
-    };
-  </script>
-  
-  <style scoped lang="scss">
-  .ele-dialog-form{
-    .el-form-item{
+    }
+  };
+</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;
+  .headbox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      margin-right: 20px;
+    }
   }
-}
-  </style>
-  
+</style>

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

@@ -81,7 +81,9 @@
           ></el-input>
         </el-form-item>
       </template>
-
+      <template v-slot:headerTotalCount="{ column }">
+          <span class="is-required">{{ column.label }}</span>
+        </template>
       <!-- 操作列 -->
       <template v-slot:action="{ row }">
         <el-popconfirm
@@ -208,7 +210,8 @@
             width: 120,
             prop: 'totalCount',
             label: '退货数量',
-            slot: 'totalCount'
+            slot: 'totalCount',
+            headerSlot: 'headerTotalCount',
           },
           {
             width: 80,

+ 185 - 164
src/views/saleManage/saleOrder/returnGoods/index.vue

@@ -1,110 +1,136 @@
 <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>
+      <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"
+        <!-- 数据表格 -->
+        <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', {})"
             >
-              <!-- 表头工具栏 -->
-              <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>
+              新建
+            </el-button>
 
-              <!-- 查看详情列 -->
-           
-              <template v-slot:returnNo="{ row }">
-                <el-link type="primary" :underline="false" @click="openorderDetail(row,'returnNo')"> {{ row.returnNo }}</el-link>
-              </template>
-              <template v-slot:sendNo="{ row }">
-                <el-link type="primary" :underline="false" @click="openorderDetail(row,'sendNo')"> {{ row.sendNo }}</el-link>
-              </template>
-              <template v-slot:orderNo="{ row }">
-                <el-link type="primary" :underline="false" @click="openorderDetail(row,'orderNo')"> {{ row.orderNo }}</el-link>
-              </template>
-              <!-- 操作列 -->
-              <template v-slot:action="{ row }">
-                
-                <el-link
-                  type="primary"
-                  :underline="false"
-                  icon="el-icon-edit"
-                  @click="openEdit('edit',row)"
-                >
-                  修改
+            <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:returnNo="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="openorderDetail(row, 'returnNo')"
+            >
+              {{ row.returnNo }}</el-link
+            >
+          </template>
+          <template v-slot:sendNo="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="openorderDetail(row, 'sendNo')"
+            >
+              {{ row.sendNo }}</el-link
+            >
+          </template>
+          <template v-slot:orderNo="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="openorderDetail(row, 'orderNo')"
+            >
+              {{ row.orderNo }}</el-link
+            >
+          </template>
+          <!-- 操作列 -->
+          <template v-slot:action="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="openEdit('edit', row)"
+              v-if="[0, 3].includes(row.reviewStatus)"
+            >
+              修改
+            </el-link>
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此信息吗?"
+              v-if="[0, 3].includes(row.reviewStatus)"
+              @confirm="remove([row.id])"
+            >
+              <template v-slot:reference>
+                <el-link type="danger" :underline="false" icon="el-icon-delete">
+                  删除
                 </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-popconfirm>
+          </template>
+        </ele-pro-table>
+      </div>
     </el-card>
 
-
-    <add-return-goods-dialog ref="invoiceDialogRef"  @done="reload"></add-return-goods-dialog>
-    <send-detail-dialog  ref="sendDetailDialogRef"></send-detail-dialog>
-    <order-detail-dialog  ref="orderDetailDialogRef"></order-detail-dialog>
+    <add-return-goods-dialog
+      ref="invoiceDialogRef"
+      @done="reload"
+    ></add-return-goods-dialog>
+    <send-detail-dialog ref="sendDetailDialogRef"></send-detail-dialog>
+    <order-detail-dialog ref="orderDetailDialogRef"></order-detail-dialog>
     <detail-dialog ref="DetailDialogRef"></detail-dialog>
-<!-- 多选删除弹窗 -->
-    <pop-modal :visible.sync="delVisible" content="是否确定删除?" @done="commitBtn"/>
+    <!-- 多选删除弹窗 -->
+    <pop-modal
+      :visible.sync="delVisible"
+      content="是否确定删除?"
+      @done="commitBtn"
+    />
   </div>
 </template>
 
 <script>
-import searchTable from './components/searchTable.vue';
-import addReturnGoodsDialog from './components/addReturnGoodsDialog.vue';
-import detailDialog from './components/detailDialog.vue';
-import sendDetailDialog from '@/views/saleManage/saleOrder/invoice/components/detailDialog.vue'
-import orderDetailDialog from '@/views/saleManage/saleOrder/components/detailDialog.vue'
-import popModal from '@/components/pop-modal';
-import {reviewStatusEnum} from '@/enum/dict';
-import {contactTypeTree} from '@/api/saleManage/contact';
-import {getReturnTableList, getReturnSaleOrderrecordDetail, UpdateReturnInformation, addReturnInformation,deleteReturnInformation} from '@/api/saleManage/returnGoods';
-import dictMixins from '@/mixins/dictMixins';
+  import searchTable from './components/searchTable.vue';
+  import addReturnGoodsDialog from './components/addReturnGoodsDialog.vue';
+  import detailDialog from './components/detailDialog.vue';
+  import sendDetailDialog from '@/views/saleManage/saleOrder/invoice/components/detailDialog.vue';
+  import orderDetailDialog from '@/views/saleManage/saleOrder/components/detailDialog.vue';
+  import popModal from '@/components/pop-modal';
+  import { reviewStatusEnum } from '@/enum/dict';
+  import { contactTypeTree } from '@/api/saleManage/contact';
+  import {
+    getReturnTableList,
+    getReturnSaleOrderrecordDetail,
+    UpdateReturnInformation,
+    addReturnInformation,
+    deleteReturnInformation
+  } from '@/api/saleManage/returnGoods';
+  import dictMixins from '@/mixins/dictMixins';
 
-
-export default {
+  export default {
     mixins: [dictMixins],
     components: {
       searchTable,
@@ -112,7 +138,7 @@ export default {
       orderDetailDialog,
       popModal,
       addReturnGoodsDialog,
-      detailDialog,
+      detailDialog
     },
     data() {
       return {
@@ -122,15 +148,15 @@ export default {
           { key: 'invoice', name: '发货单' },
           { key: 'returnorder', name: '退货单' }
         ],
-        selection:[],   //单选中集合
-        delVisible:false,  //批量删除弹框状态
-        loading: false,  // 加载状态
+        selection: [], //单选中集合
+        delVisible: false, //批量删除弹框状态
+        loading: false, // 加载状态
         columns: [
           {
-             width: 45,
-             type: 'selection',
-             columnKey: 'selection',
-             align: 'center'
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
           },
           {
             columnKey: 'index',
@@ -164,13 +190,13 @@ export default {
             slot: 'orderNo',
             showOverflowTooltip: true,
             minWidth: 200
-          }, 
+          },
           {
             prop: 'contactName',
             label: '客户名称',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 180,
+            minWidth: 180
           },
           {
             prop: 'payAmount',
@@ -187,8 +213,8 @@ export default {
             showOverflowTooltip: true,
             minWidth: 200,
             formatter: (_row, _column, cellValue) => {
-            return reviewStatusEnum[_row.reviewStatus].label;
-          }
+              return reviewStatusEnum[_row.reviewStatus].label;
+            }
           },
           {
             prop: 'createTime',
@@ -205,16 +231,14 @@ export default {
             resizable: false,
             slot: 'action',
             showOverflowTooltip: true,
-            fixed: 'right',
+            fixed: 'right'
           }
         ]
       };
     },
     computed: {},
- 
+
     methods: {
-    
-    
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
         return getReturnTableList({
@@ -223,26 +247,25 @@ export default {
           ...where
         });
       },
-    
-  
+
       /* 刷新表格 */
       reload(where) {
         this.$refs.table.reload({ page: 1, where });
       },
-      
+
       //新增编辑
-      openEdit(type,row) {
-        this.$refs.invoiceDialogRef.open( type,row);
+      openEdit(type, row) {
+        this.$refs.invoiceDialogRef.open(type, row);
         this.$refs.invoiceDialogRef.$refs.form &&
-        this.$refs.invoiceDialogRef.$refs.form.clearValidate();
+          this.$refs.invoiceDialogRef.$refs.form.clearValidate();
       },
-     
+
       //批量删除
-      allDelBtn(){
-        if(this.selection.length===0) return
-        this.delVisible=true
+      allDelBtn() {
+        if (this.selection.length === 0) return;
+        this.delVisible = true;
       },
-      
+
       //删除接口
       remove(delData) {
         deleteReturnInformation(delData).then((res) => {
@@ -251,65 +274,63 @@ export default {
         });
       },
 
-    //删除弹框确定
-      commitBtn(){
-        const dataId=this.selection.map(v=>v.id)
-        this.remove(dataId)
+      //删除弹框确定
+      commitBtn() {
+        const dataId = this.selection.map((v) => v.id);
+        this.remove(dataId);
       },
 
-    //查看详情
-    openorderDetail(row,type){
-      if(type==='returnNo'){
-        this.$refs.DetailDialogRef.open(row);
-      }
-      if(type==='sendNo'){
-        this.$refs.sendDetailDialogRef.open({id:row.sendId});
+      //查看详情
+      openorderDetail(row, type) {
+        if (type === 'returnNo') {
+          this.$refs.DetailDialogRef.open(row);
+        }
+        if (type === 'sendNo') {
+          this.$refs.sendDetailDialogRef.open({ id: row.sendId });
+        }
+        if (type === 'orderNo') {
+          this.$refs.orderDetailDialogRef.open({ id: row.orderId });
+        }
       }
-      if(type==='orderNo'){
-        this.$refs.orderDetailDialogRef.open({id:row.orderId});
-      }
-       
-      },
-
     }
   };
 </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;
-}
+  .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;
+  .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);
+  .switch_left ul .active {
+    border-top: 4px solid var(--color-primary);
     color: var(--color-primary-5);
-}
-.switch{
-  padding-bottom: 20px;
-}
+  }
+  .switch {
+    padding-bottom: 20px;
+  }
 
-.el-dropdown-link {
+  .el-dropdown-link {
     cursor: pointer;
     color: var(--color-primary-5);
   }