Преглед изворни кода

feat(库存调拨): 新增生成对账单功能

liujt пре 7 месеци
родитељ
комит
d8fb2fbcee
25 измењених фајлова са 5502 додато и 3 уклоњено
  1. 214 0
      src/BIZComponents/processSubmitDialog/api.js
  2. 503 0
      src/BIZComponents/processSubmitDialog/processSubmitDialog.vue
  3. 124 0
      src/api/contractManage/contractBook.js
  4. 183 0
      src/api/saleManage/accountstatement.js
  5. 361 0
      src/api/saleManage/contact.js
  6. 158 0
      src/api/saleManage/quotation.js
  7. 211 0
      src/api/saleManage/saleorder.js
  8. 14 0
      src/enum/dict.js
  9. 35 0
      src/mixins/tableColumnsMixin.js
  10. 75 0
      src/utils/dateUtils.js
  11. 288 0
      src/views/bpm/processInstance/detail.vue
  12. 315 0
      src/views/warehouseManagement/inventoryAllocation/accountstatement/addAccountDialog.vue
  13. 104 0
      src/views/warehouseManagement/inventoryAllocation/accountstatement/components/contactSearch.vue
  14. 133 0
      src/views/warehouseManagement/inventoryAllocation/accountstatement/components/searchContract.vue
  15. 159 0
      src/views/warehouseManagement/inventoryAllocation/accountstatement/components/searchTable.vue
  16. 397 0
      src/views/warehouseManagement/inventoryAllocation/accountstatement/contractListDialog.vue
  17. 170 0
      src/views/warehouseManagement/inventoryAllocation/accountstatement/detailDialog.vue
  18. 670 0
      src/views/warehouseManagement/inventoryAllocation/accountstatement/inventoryTable.vue
  19. 257 0
      src/views/warehouseManagement/inventoryAllocation/accountstatement/orderListDialog.vue
  20. 230 0
      src/views/warehouseManagement/inventoryAllocation/accountstatement/parentList.vue
  21. 218 0
      src/views/warehouseManagement/inventoryAllocation/accountstatement/product-list.vue
  22. 192 0
      src/views/warehouseManagement/inventoryAllocation/accountstatement/recorpayTableList.vue
  23. 464 0
      src/views/warehouseManagement/inventoryAllocation/accountstatement/saleForm.vue
  24. 20 1
      src/views/warehouseManagement/inventoryAllocation/index.vue
  25. 7 2
      src/views/warehouseManagement/stockManagement/add.vue

+ 214 - 0
src/BIZComponents/processSubmitDialog/api.js

@@ -0,0 +1,214 @@
+import request from '@/utils/request';
+
+export async function getProcessDefinitionBpmnXML(id) {
+  const res = await request({
+    url: '/bpm/process-definition/get-bpmn-xml?id=' + id,
+    method: 'get'
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function getTaskAssignRuleList(query) {
+  const res = await request({
+    url: '/bpm/task-assign-rule/list',
+    method: 'get',
+    params: query
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function processInstanceCreateAPI(data) {
+  const res = await request(
+    {
+      url: '/bpm/process-instance/create',
+      method: 'post',
+      data
+    },
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function getModelPage(query) {
+  const res = await request({
+    url: '/bpm/model/page',
+    method: 'get',
+    params: query
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function getProcessDefinitionInfo(params) {
+  const res = await request({
+    url: `/bpm/process-definition/get`,
+    method: 'get',
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function listAllUserBind() {
+  const res = await request.get('/main/user/listAllUserBind');
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 获取用户组精简信息列表
+export async function listSimpleUserGroups() {
+  const res = await request({
+    url: '/bpm/user-group/list-all-simple',
+    method: 'get'
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+//商机
+export async function businessOpportunityUpdateStatusAPI(data) {
+  const res = await request(
+    {
+      url: '/eom/businessopportunity/updateApprovalStatus',
+      method: 'put',
+      data
+    },
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//报价
+export async function quoteUpdateStatusAPI(data) {
+  const res = await request(
+    {
+      url: '/eom/quote/updateApprovalStatus',
+      method: 'put',
+      data
+    },
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//需求管理
+export async function purchaserequirementStatusAPI(data) {
+  const res = await request(
+    {
+      url: '/eom/purchaserequirement/updateApprovalStatus',
+      method: 'put',
+      data
+    },
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//计划管理
+export async function purchaseplanStatusAPI(data) {
+  const res = await request(
+    {
+      url: '/eom/purchaseplan/updateApprovalStatus',
+      method: 'put',
+      data
+    },
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//核价管理
+export async function purchaseinquiryStatusAPI(data) {
+  const res = await request(
+    {
+      url: '/eom/purchaseinquiry/updateApprovalStatus',
+      method: 'put',
+      data
+    },
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//合同
+export async function contractStatusAPI(data) {
+  const res = await request(
+    {
+      url: '/eom/contract/updateApprovalStatus',
+      method: 'put',
+      data
+    },
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//费用
+export async function finfeeapplyStatusAPI(data) {
+  const res = await request(
+    {
+      url: '/eom/finfeeapply/updateApprovalStatus',
+      method: 'put',
+      data
+    },
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//发票
+export async function fininvoiceapplyStatusAPI(data) {
+  const res = await request(
+    {
+      url: '/eom/fininvoiceapply/updateApprovalStatus',
+      method: 'put',
+      data
+    },
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//运输-计划
+export async function logistictrakplanStatusAPI(data) {
+  const res = await request(
+    {
+      url: '/eom/logistictrakplan/updateApprovalStatus',
+      method: 'put',
+      data
+    },
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 503 - 0
src/BIZComponents/processSubmitDialog/processSubmitDialog.vue

@@ -0,0 +1,503 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    :visible="processSubmitDialogFlag"
+    title="提交审核"
+    append-to-body
+    :close-on-click-modal="false"
+    width="50%"
+    :before-close="isCloseRefresh ? cancel : cancel1"
+    :maxable="true"
+    :resizable="true"
+  >
+    <el-form
+      ref="form"
+      :rules="rules"
+      class="el-form-box"
+      :model="form"
+      label-width="80px"
+    >
+      <el-row v-show="active == 0">
+        <el-col :span="12">
+          <el-form-item label="流程分类">
+            <ele-tree-select
+              @change="changeLCFL"
+              clearable
+              ref="processTypeRef"
+              filterable
+              :data="LCFLList"
+              v-model="form.LCFL"
+              childrenKey="children"
+              valueKey="id"
+              labelKey="name"
+              placeholder="请选择"
+              default-expand-all
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="发起流程">
+            <el-select
+              filterable
+              v-model="form.FQLC"
+              @change="changeFQLC"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in processList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row v-show="active == 0">
+        <el-col :span="12">
+          <el-form-item label="流程名称">
+            <el-input v-model="form.name" clearable></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="流程标识">
+            <el-input v-model="form.key" disabled></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <headerTitle
+        v-show="active == 0"
+        title="流程执行人/流程图"
+        style="margin-top: 30px"
+      ></headerTitle>
+      <el-table
+        v-show="active == 0"
+        :data="datasource"
+        border
+        style="margin-bottom: 10px"
+      >
+        <el-table-column
+          label="任务节点"
+          align="center"
+          prop="taskDefinitionName"
+          width="140"
+          fixed
+        />
+        <el-table-column
+          label="执行人"
+          align="center"
+          prop="options"
+          min-width="140px"
+        >
+          <template v-slot="scope">
+            <div
+              v-if="
+                scope.row.type !== 60 &&
+                scope.row.type !== 70 &&
+                scope.row.options.length > 0
+              "
+            >
+              <el-tag
+                size="medium"
+                :key="option"
+                v-for="option in scope.row.options"
+              >
+                {{ getAssignRuleOptionName(scope.row, option) }}
+              </el-tag>
+            </div>
+
+            <el-tag
+              size="medium"
+              v-if="scope.row.type === 60 || scope.row.type === 70"
+            >
+              {{ getAssignRuleOptionName(scope.row) }}
+            </el-tag>
+          </template>
+        </el-table-column>
+      </el-table>
+      <my-process-viewer
+        v-show="active == 0"
+        style="min-width: 100%; height: 200px"
+        key="designer"
+        v-model="bpmnXML"
+      />
+      <el-table v-show="active == 1" :data="form.noticeScope" border>
+        <el-table-column
+          label="类型"
+          align="center"
+          prop="taskDefinitionName"
+          width="140"
+          fixed
+        />
+        <el-table-column
+          label="结果"
+          align="center"
+          prop="options"
+          min-width="140px"
+        >
+        </el-table-column>
+      </el-table>
+    </el-form>
+
+    <div slot="footer">
+      <el-button type="primary" size="small" @click="submit" :loading="loading"
+        >提交</el-button
+      >
+      <el-button
+        v-if="isNotNeedProcess && $hasPermission('main:common:submitrelease')"
+        type="primary"
+        size="small"
+        @click="submit1"
+        v-click-once
+        >提交并发布</el-button
+      >
+      <el-button size="small" @click="isCloseRefresh ? cancel() : cancel1()">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+<script>
+  import {
+    getModelPage,
+    getProcessDefinitionBpmnXML,
+    getProcessDefinitionInfo,
+    getTaskAssignRuleList,
+    listAllUserBind,
+    listSimpleUserGroups,
+    processInstanceCreateAPI,
+    businessOpportunityUpdateStatusAPI,
+    quoteUpdateStatusAPI,
+    purchaserequirementStatusAPI,
+    purchaseplanStatusAPI,
+    purchaseinquiryStatusAPI,
+    contractStatusAPI,
+    finfeeapplyStatusAPI,
+    fininvoiceapplyStatusAPI,
+    logistictrakplanStatusAPI
+  } from './api';
+  import { treeClassifyCodeEnum } from '@/enum/dict';
+  import { listRoles } from '@/api/system/role';
+  import { listOrganizations } from '@/api/system/organization';
+  import dictMixins from '@/mixins/dictMixins';
+  import { getByCode } from '@/api/system/dictionary-data';
+  import { getProduceTreeByCode } from '@/api/saleManage/quotation';
+  import { topLevel1, topLevel2 } from '@/enum/dict';
+  export default {
+    name: 'processSubmitDialog',
+    mixins: [dictMixins],
+    props: {
+      processSubmitDialogFlag: {
+        type: Boolean,
+        default: false
+      },
+      isNotNeedProcess: {
+        type: Boolean,
+        default: false
+      },
+      approvalStatus: {
+        type: Number,
+        default: 2
+      },
+      apiFunName: {
+        type: String,
+        default: ''
+      },
+      callBack: {
+        type: Function,
+        default: null
+      },
+      // 关闭弹窗时是否刷新列表
+      isCloseRefresh: {
+        type: Boolean,
+        default: true
+      },
+    },
+    data() {
+      return {
+        form: {
+          LCFL: '',
+          FQLC: '',
+          processDefinitionId: '',
+          name: '',
+          businessId: '',
+          noticeScope: [],
+          businessKey: '',
+          formCreateUserId: '',
+          variables: {}
+        },
+        businessOpportunityUpdateStatusAPI,
+        quoteUpdateStatusAPI,
+        purchaserequirementStatusAPI,
+        purchaseplanStatusAPI,
+        purchaseinquiryStatusAPI,
+        contractStatusAPI,
+        finfeeapplyStatusAPI,
+        fininvoiceapplyStatusAPI,
+        logistictrakplanStatusAPI,
+        active: 0,
+        loading: false,
+        bpmnXML: null,
+        LCFLList: [],
+        processList: [],
+        datasource: [],
+        roleOptions: [],
+        deptOptions: [],
+        deptTreeOptions: [],
+        postOptions: [],
+        userOptions: [],
+        userGroupOptions: [],
+        dictList: {},
+        rules: {}
+      };
+    },
+    async created() {
+      let typeObj = await getProduceTreeByCode(
+        treeClassifyCodeEnum['PROCESSTYPE']
+      );
+      this.LCFLList = typeObj[0].children;
+
+      // 获得角色列表
+      this.roleOptions = [];
+      listRoles({
+        current: 1,
+        size: 9999
+      }).then((data) => {
+        this.roleOptions.push(...data.list);
+      });
+      // 获得部门列表
+      this.deptOptions = [];
+      this.deptTreeOptions = [];
+      listOrganizations().then((data) => {
+        this.deptOptions.push(...data);
+        this.deptTreeOptions.push(...this.handleTree(data, 'id'));
+      });
+      // 获得岗位列表 暂无岗位概念
+      this.postOptions = [];
+      /*listSimplePosts().then(response => {
+  this.postOptions.push(...response.data);
+});*/
+      // 获得用户列表
+      this.userOptions = [];
+      listAllUserBind().then((data) => {
+        this.userOptions.push(...data);
+      });
+      // 获得用户组列表
+      this.userGroupOptions = [];
+      listSimpleUserGroups().then((response) => {
+        this.userGroupOptions.push(...response);
+      });
+
+      //this.dictEnum['工作流任务分配自定义脚本']
+      await this.getDictList(this.dictEnum['工作流任务分配自定义脚本']);
+      await this.getDictList(this.dictEnum['工种类型']);
+    },
+    methods: {
+      init(row = {}) {
+        this.form = { ...this.form, ...row };
+        console.log(row)
+        // this.form.businessId = row.id;
+        // this.form.businessKey = row.businessKey;
+        // this.form.formCreateUserId = row.createUserId;
+        this.getDefaultInfo(row.businessKey);
+      },
+      async getDefaultInfo(businessKey) {
+        let info = await getProcessDefinitionInfo({ code: businessKey });
+        this.form.LCFL = info?.category;
+        this.form.FQLC = info?.modelId;
+        this.form.name = info?.name;
+        this.form.key = info?.key;
+        this.form.processDefinitionId = info?.id;
+        if (this.form.LCFL) await this.getProcessList(this.form.LCFL);
+        if (this.form.FQLC) {
+          await this.getProcessDefinitionBpmnXMLInfo(info.id);
+          await this.getTaskAssignRuleListInfo({
+            modelId: info.modelId,
+            processDefinitionId: info.id
+          });
+        }
+      },
+      async changeLCFL(val) {
+        this.bpmnXML = null;
+        this.form.processDefinitionId = null;
+        this.form.FQLC = null;
+        await this.getProcessList(val);
+      },
+      async getProcessList(val) {
+        let params = {
+          pageNo: 1,
+          pageSize: 999,
+          processTypeId: val
+        };
+        const { list } = await getModelPage(params);
+        this.processList = list.filter((item) => item.processDefinition);
+      },
+      async changeFQLC(val) {
+        if (!val) return;
+        let find = this.processList.find((item) => item.id === val) || {};
+        this.form.name = find.name;
+        this.form.key = find.key;
+        this.form.processDefinitionId = find.processDefinition.id;
+        await this.getProcessDefinitionBpmnXMLInfo(find.processDefinition.id);
+        await this.getTaskAssignRuleListInfo({
+          modelId: find.id,
+          processDefinitionId: find.processDefinition.id
+        });
+      },
+      async getProcessDefinitionBpmnXMLInfo(val) {
+        // 加载流程图
+        this.bpmnXML = await getProcessDefinitionBpmnXML(val);
+      },
+      async getTaskAssignRuleListInfo(find) {
+        this.datasource = await getTaskAssignRuleList({
+          modelId: find.modelId,
+          processDefinitionId: find.processDefinitionId
+        });
+      },
+      getAssignRuleOptionName(row, option) {
+        console.log(row, option);
+        if (row.type == 10) {
+          for (const roleOption of this.roleOptions) {
+            if (roleOption.id === option) {
+              return roleOption.name;
+            }
+          }
+        } else if (row.type === 20 || row.type === 21) {
+          for (const deptOption of this.deptOptions) {
+            if (deptOption.id === option) {
+              return deptOption.name;
+            }
+          }
+        } else if (row.type === 22) {
+          option = option + ''; // 转换成 string
+          return this.getDictV(this.dictEnum['工种类型'], option);
+        } else if (row.type === 30 || row.type === 31 || row.type === 32) {
+          for (const userOption of this.userOptions) {
+            if (userOption.id === option) {
+              return userOption.nickname || userOption.name;
+            }
+          }
+        } else if (row.type === 40) {
+          for (const userGroupOption of this.userGroupOptions) {
+            if (userGroupOption.id === option) {
+              return userGroupOption.name;
+            }
+          }
+        } else if (row.type === 50) {
+          option = option + ''; // 转换成 string
+          return this.getDictV(
+            this.dictEnum['工作流任务分配自定义脚本'],
+            option
+          );
+        } else if (row.type === 60) {
+          return row.variableName;
+        } else if (row.type === 70) {
+          let data = JSON.parse(row.variableName);
+          if (data.direction == 1) {
+            return topLevel2.find((item) => item.value == data.topLevel)
+              ?.label;
+          } else {
+            return topLevel1.find((item) => item.value == data.topLevel)
+              ?.label;
+          }
+        }
+        return '未知(' + option + ')';
+      },
+      /**
+       * 构造树型结构数据
+       * @param {*} data 数据源
+       * @param {*} id id字段 默认 'id'
+       * @param {*} parentId 父节点字段 默认 'parentId'
+       * @param {*} children 孩子节点字段 默认 'children'
+       * @param {*} rootId 根Id 默认 0
+       */
+      handleTree(data, id, parentId, children, rootId) {
+        id = id || 'id';
+        parentId = parentId || 'parentId';
+        children = children || 'children';
+        rootId =
+          rootId ||
+          Math.min.apply(
+            Math,
+            data.map((item) => {
+              return item[parentId];
+            })
+          ) ||
+          0;
+        //对源数据深度克隆
+        const cloneData = JSON.parse(JSON.stringify(data));
+        //循环所有项
+        const treeData = cloneData.filter((father) => {
+          let branchArr = cloneData.filter((child) => {
+            //返回每一项的子级数组
+            return father[id] == child[parentId];
+          });
+          branchArr.length > 0 ? (father.children = branchArr) : '';
+          //返回第一层
+          return father[parentId] == rootId;
+        });
+        return treeData !== '' ? treeData : data;
+      },
+      getDictV(code, val) {
+        if (!this.dictList[code]) return '';
+        return this.dictList[code].find((item) => item.value == val)?.label;
+      },
+      async getDictList(code) {
+        let { data: res } = await getByCode(code);
+        this.dictList[code] = res.map((item) => {
+          let values = Object.keys(item);
+          return {
+            value: values[0],
+            label: item[values[0]]
+          };
+        });
+      },
+      async submit() {
+        let code = 0;
+        if (this.callBack) {
+          code = await this.callBack();
+        }
+        if (code != 0) {
+          return;
+        }
+        this.loading = true;
+        try {
+          console.log(this.form)
+          
+          let params = {
+          ...this.form,
+            variables: {
+              // businessName: data.supplierName,
+              ...this.form.variables
+            }
+          };
+          await processInstanceCreateAPI(params);
+          this.loading = false;
+          this.$message('提交审核成功');
+          // this.$emit('reload');
+          this.cancel();
+        } catch (error) {}
+        this.loading = false;
+      },
+      async submit1() {
+        let params = {
+          id: this.form.businessId,
+          approvalStatus: this.approvalStatus,
+          ...this.form
+        };
+        await this[this.apiFunName](params);
+        //await processInstanceUpdateStatusAPI(params);
+        this.$message('提交发布成功');
+        // this.$emit('reload');
+        this.cancel();
+      },
+      cancel() {
+        this.$emit('reload');
+        this.$emit('update:processSubmitDialogFlag', false);
+      },
+      cancel1() {
+        this.$emit('update:processSubmitDialogFlag', false);
+      },
+    }
+  };
+</script>
+<style scoped lang="scss"></style>

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

@@ -0,0 +1,124 @@
+import request from '@/utils/request';
+import { download } from '@/utils/file';
+/**
+ * 获取信息列表
+ */
+export async function getTableList(params) {
+  const res = await request.get(`/eom/contract/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取信息详情
+ */
+export async function getDetail(id) {
+  const res = await request.get(`/eom/contract/getById/${id}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新信息
+ */
+export async function UpdateInformation(data) {
+  const res = await request.put(`/eom/contract/update`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 新增信息
+ */
+export async function addInformation(data) {
+  const res = await request.post(`/eom/contract/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 删除
+ */
+export async function deleteInformation(data) {
+  const res = await request.delete('/eom/contract/delete', { data });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+/**
+ * 提交审批
+ */
+
+export async function getContractCommit() {
+  const res = await request.get(
+    `/eom/contract/commit/${id}`
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 审批
+ */
+export async function getContractReview(params) {
+  const res = await request.get(`/eom/contract/review`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 企业信息
+ */
+export async function enterprisePage(params) {
+  const res = await request.get(`/main/enterprise/page`, { 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/contractApprove/submit`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 合同批量提交
+ */
+export async function batchSubmitAPI(data) {
+  const res = await request.post(`/bpm/contractApprove/batchSubmit`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新合同关联状态
+ */
+export async function updateContractStatus(data) {
+  const res = await request.post('/eom/contract/updateRelationStatus', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 183 - 0
src/api/saleManage/accountstatement.js

@@ -0,0 +1,183 @@
+import request from '@/utils/request';
+import {download} from '@/utils/file';
+
+/**
+ * 获取信息列表
+ */
+export async function getAccountstatementList(params) {
+  const res = await request.post(`/eom/accountstatement/page`, params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取信息详情
+ */
+export async function gettAccountstatementDetail(id) {
+  const res = await request.get(`/eom/accountstatement/getById/${id}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新信息
+ */
+export async function UpdatetAccountstatement(data) {
+  const res = await request.put(`/eom/accountstatement/update`, data);
+  if (res.data.code == 0) {
+    return res.data.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 addtAccountstatement(data) {
+  const res = await request.post(`/eom/accountstatement/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 删除
+ */
+export async function deletetAccountstatement(data) {
+  const res = await request.delete('/eom/accountstatement/delete', {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/accountStatementApprove/submit`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 对账单 查询待导入的账单明细
+ */
+export async function getSearchMergeListByTypeAPI(data) {
+  const res = await request.post(`/eom/accountstatement/searchOrderListByTypeForImport`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 对账单 查询待导入的账单明细 库存
+ */
+export async function getStatementRecordListAPI(data) {
+  const res = await request.post(`/eom/accountstatement/getStatementRecordList`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 对账单 保存
+ */
+export async function saveAccountStatementAPI(data) {
+  const res = await request.post(`/eom/accountstatement/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 对账单 保存新
+ */
+export async function createAccountStatementAPI(data) {
+  const res = await request.post(`/eom/accountstatement/create`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 对账单 修改
+ */
+export async function updateAccountStatementAPI(data) {
+  const res = await request.put(`/eom/accountstatement/update`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 对账单 信息详情
+ */
+export async function infoAccountStatementAPI(id) {
+  const res = await request.get(`/eom/accountstatement/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 对账单 信息详情 新
+ */
+export async function accountstatementInfoAPI(id) {
+  const res = await request.get(`/eom/accountstatement/v2/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 对账单 提交发起流程
+ */
+export async function submitAccountStatementApproveAPI(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));
+}
+
+/**
+ * 导出对账单
+ */
+export async function accountStatementExportAPI(id) {
+  const res = await request.get(`/eom/accountstatement/export/${id}`, {
+    responseType: 'blob'
+  })
+  if (res.data instanceof Blob) {
+    return res;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 361 - 0
src/api/saleManage/contact.js

@@ -0,0 +1,361 @@
+import request from '@/utils/request';
+
+/**
+ * 获取客户信息列表
+ */
+export async function contactPage(params) {
+  const res = await request.get(`/eom/contact/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 获取客户信息列表
+ */
+export async function contactPageUsages(params) {
+  const res = await request.get(`/eom/contact/page2Usages`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取客户信息详情
+ */
+export async function contactDetail(id) {
+  const res = await request.get(`/eom/contact/getById/${id}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新客户信息
+ */
+export async function contactUpdate(data) {
+  const res = await request.put(`/eom/contact/update`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 新增客户信息
+ */
+export async function contactSave(data) {
+  const res = await request.post(`/eom/contact/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 客户证书资质信息分页
+ */
+export async function contactQcPackPageAPI(params) {
+  const res = await request.get(
+    `/main/professionCertification/selectByRelationIdAndType`,
+    { params }
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 新增客户证书资质信息
+ */
+export async function contactQcPackSaveAPI(data) {
+  const res = await request.post(`/main/professionCertification/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 修改客户证书资质信息
+ */
+export async function contactQcPackUpdateAPI(data) {
+  const res = await request.put(`/main/professionCertification/update`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取客户证书资质信息详情
+ */
+export async function contactQcPackDetailAPI(id) {
+  const res = await request.get(
+    `/main/professionCertification/getById/${id}`,
+    {}
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 删除客户证书资质包
+ */
+export async function contactQcPackDeleteAPI(data) {
+  const res = await request.delete(`/main/professionCertification/delete`, {
+    data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 提交客户证书资质信息  开启流程
+ */
+export async function contactQcSubmit(data) {
+  const res = await request.post(`/bpm/ProfessionCertification/submit`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 删除事项
+ */
+export async function contactDelete(data) {
+  const res = await request.post('/eom/contact/delete', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取客户分类树
+ */
+export async function contactTypeTree(data) {
+  const res = await request.get(`/main/categoryLevel/getTreeByPid/${data.id}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新用户状态
+ */
+export async function updateStatus(id, status) {
+  const res = await request.get(
+    `/eom/contact/updateStatus?id=` + id + '&status=' + status
+  );
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 指派
+ */
+export async function assign(data) {
+  const res = await request.post('/eom/contact/assign', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 释放
+ */
+export async function free(data) {
+  const res = await request.post('/eom/contact/free', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 申请
+ */
+export async function applySave(data) {
+  const res = await request.post('/eom/contactlistapply/save', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 供应商维护供货产品
+ */
+export async function contactProductSaveAPI(data) {
+  const res = await request.post('/main/contactproduct/save', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 供应商维护供货产品
+ */
+export async function contactProductUpdateAPI(data) {
+  const res = await request.post('/main/contactproduct/update', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 通过产品查供应商
+ */
+export async function contactQueryByCategoryIdsAPI(data) {
+  const res = await request.post('/eom/contact/queryByCategoryIds', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 发布动态
+ */
+export async function updateContactDynamics(data) {
+  const res = await request.put('/eom/contact/updateContactDynamics', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 回复动态
+ */
+export async function updateContactComment(data) {
+  const res = await request.put('/eom/contact/updateContactComment', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 摘要卡片
+ */
+export async function queryContactIdCount(id) {
+  const res = await request.get(`eom/contact/queryContactIdCount/` + id);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新客户关联状态
+ */
+export async function updateRelationStatus(data) {
+  const res = await request.post('/eom/contact/updateRelationStatus', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取供应商最小订购数量
+ */
+export async function listByContactId(data) {
+  const res = await request.post('/eom/contactproduct/listByContactId',  data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 跟进记录统计
+ */
+export async function groupByContact(params) {
+  const res = await request.get(`/eom/businessopportunityfollowup/groupByContact`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+/**
+ * 客户资质证照
+ */
+export async function identityphotoList(data) {
+  const res = await request.post(`/main/identityphoto/list`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 保存or更新
+export async function saveOrEdit (data) {
+  const res = await request.post(`/main/identityphoto/saveOrUpdate`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+// 获取证照信息详情
+export async function getPhotoInfo (id) {
+  const res = await request.get(`/main/identityphoto/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 物品信息列表
+export async function getList(params) {
+  const res = await request.get('/main/category/getList', { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 删除
+ */
+export async function deleteIdentityphoto(data) {
+  const res = await request.delete('/main/identityphoto/delete', { data });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//工作流自定义权限过滤表单集合
+export async function getBpmCustomFormList(query) {
+  const res = await request({
+    url: '/flowable/bpmcustomform/list',
+    method: 'get',
+    params: query
+  });
+
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}  
+
+// 推送
+export async function customerAdd(data) {
+  const res = await request.post('/port/Jd/customerAdd', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 158 - 0
src/api/saleManage/quotation.js

@@ -0,0 +1,158 @@
+import request from '@/utils/request';
+import { download } from '@/utils/file';
+/**
+ * 获取信息列表
+ */
+export async function getTableList(params) {
+  const res = await request.get(`/eom/quote/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取信息详情
+ */
+export async function getDetail(id) {
+  const res = await request.get(`/eom/quote/getById/${id}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新信息
+ */
+export async function UpdateInformation(data) {
+  const res = await request.put(`/eom/quote/update`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 新增信息
+ */
+export async function addInformation(data) {
+  const res = await request.post(`/eom/quote/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 删除
+ */
+export async function deleteInformation(data) {
+  const res = await request.delete('/eom/quote/delete', { data });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 导出报价单
+ */
+export async function exportByPathId(id) {
+  const res = await request.post(
+    `/eom/quote/export/${id}`,
+    {},
+    { responseType: 'blob' }
+  );
+  download(res.data, '报价单.xlsx');
+}
+/**
+ * 产品分类
+ */
+
+export async function getProduceTreeByPid(type = 1) {
+  const res = await request.get(
+    //`/main/categoryLevel/getTreeByPid/9`,
+    `/main/categoryLevel/getProduceTreeByPid?type=` + type,
+    {}
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 产品分类指定code查询
+ */
+
+export async function getProduceTreeByCode(code) {
+  const res = await request.get(
+    `/main/categoryLevel/getProduceTreeByPid?code=${code}`,
+    {}
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 产品列表
+ */
+export async function getProductList(params) {
+  const res = await request.get(`/main/category/getList`, { 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/quoteApprove/submit`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 报价是否生成过合同
+ */
+export async function isHasGeneratedContractAPI(id) {
+  const res = await request.get(`/eom/quote/hasGeneratedContract/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.resolve(0);
+}
+/**
+ * 修改启用状态
+ */
+export async function quoteUpdateStatus(params) {
+  const res = await request.get(`/eom/quote/updateStatus`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.resolve(0);
+}
+
+//获取合同上一次销售的产品
+export async function queryLastContractProductList(type) {
+  const res = await request.get(
+    `/eom/contract/queryLastContractProductList/${type}`
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//批量更新未提交状态报价单产品清单价格
+export async function updateProductPrice(data) {
+  const res = await request.post(`/eom/quote/updateProductPrice`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 211 - 0
src/api/saleManage/saleorder.js

@@ -0,0 +1,211 @@
+import request from '@/utils/request';
+import { download } from '@/utils/file';
+/**
+ * 获取信息列表
+ */
+export async function getTableList(params) {
+  const res = await request.get(`/eom/saleorder/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 获取信息列表
+ */
+export async function getTableListHome(params) {
+  const res = await request.get(`/eom/saleorder/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 查询仓库列表
+ */
+export async function getWarehouseList() {
+  const res = await request.post(`/wms/warehouse/select/warehouseList`, {
+    params: { status: 1 }
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 查询库存仓库列表
+ */
+export async function getIdWarehouseList(params) {
+  const res = await request.get(`/wms/outindetailtwo/getBatchWarehouseList`, {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 查询库存可用数
+ */
+export async function getWarehouseOutStock(params) {
+  const res = await request.get(`/wms/stocktwo/getWarehouseOutStock`, {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取信息详情
+ */
+export async function getSaleOrderDetail(id) {
+  const res = await request.get(`/eom/saleorder/getById/${id}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取信息详情 多id
+ */
+export async function getSaleOrderDetails(data) {
+  const res = await request.post(`/eom/saleorder/getByIds`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新信息
+ */
+export async function UpdateInformation(data) {
+  const res = await request.put(`/eom/saleorder/update`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 新增信息
+ */
+export async function addInformation(data) {
+  const res = await request.post(`/eom/saleorder/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 删除
+ */
+export async function deleteInformation(data) {
+  const res = await request.delete('/eom/saleorder/delete', { data });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 导出报价单
+ */
+export async function getExport(id) {
+  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));
+}
+/**
+ * 提交
+ */
+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));
+}
+
+/**
+ * 摘要卡片
+ */
+export async function queryOrderNoCount(code) {
+  const res = await request.get(`/eom/saleorder/queryOrderNoCount/${code}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 催单
+ */
+export async function saleOrderReminder(id) {
+  const res = await request.get(`/eom/saleorder/saleOrderReminder/${id}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 获bom清单
+ */
+export async function getByRepeatBomAttribute(id) {
+  const res = await request.get(`/eom/saleorder/getByRepeatBomAttribute/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 保存bom清单
+ */
+export async function saveOrderBomList(data) {
+  const res = await request.post(`/eom/saleorder/saveOrderBomList`,data);
+  return res.data.code
+  // return Promise.reject(new Error(res.data.message));
+}
+//预销售编码修改
+export async function updateOrderInfo(data) {
+  const res = await request.post(`/eom/saleorder/updateOrderInfo`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+  
+}
+
+//选择物品获取价格
+export async function getProductPrice(id) {
+  const res = await request.get(`/eom/purchaseorder/queryNewPriceByCode/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 推送
+export async function saleOrderAdd(data) {
+  const res = await request.post('/port/Jd/saleOrderAdd', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 14 - 0
src/enum/dict.js

@@ -23,3 +23,17 @@ export default {
   物品颜色: 'product_color_key',
   流程实例的结果: 'bpm_process_instance_result',
 };
+
+//主数据分类关联对应常量
+export const treeClassifyCodeEnum = {
+  CHACHE: 'w10-2',
+  producerType: 'W10',
+  PROCESSTYPE: 'PROCESS001'
+};
+
+// 计价方式
+export const pricingWayList = [
+  { id: 1, name: '按数量计价' },
+  { id: 2, name: '按重量计价' },
+  { id: 3, name: '按增重计价' },
+];

+ 35 - 0
src/mixins/tableColumnsMixin.js

@@ -27,9 +27,44 @@ export default {
         console.error('处理列配置出错:', error);
       }
     },
+    getColumns() {
+      if (typeof this.columns == 'function') {
+        return this.columns();
+      } else {
+        return this.columns;
+      }
+    },
 
     // 列表变化回调
     handleColumnChange() {
+      const list = this.getStorage(this.cacheKeyUrl + 'Cols');
+
+      if (list) {
+        let requireList = [];
+        let currentList = this.getColumns()
+          .filter((item) => item.headerSlot)
+          .map((item) => item.prop);
+        list.forEach((item) => {
+          if (currentList.includes(item.prop) && !item.checked) {
+            requireList.push(item.label);
+            item.checked = true;
+          }
+        });
+        if (requireList.length) {
+          this.setStorage(this.cacheKeyUrl + 'Cols', list);
+          if ('columns' in this.$options.computed) {
+            this.columnsVersion++;
+          } else {
+            this.columns = [...this.columns];
+          }
+          // this.$message.warning(
+          //   `${requireList.toString()} 为必填项,无法隐藏!`
+          // );
+          // console.log('为必填项,无法隐藏!~~~', requireList);
+          return;
+        }
+      }
+      
       this.debouncedHandleColumnChange();
     },
 

+ 75 - 0
src/utils/dateUtils.js

@@ -0,0 +1,75 @@
+/**
+ * 将毫秒,转换成时间字符串。例如说,xx 分钟
+ *
+ * @param ms 毫秒
+ * @returns {string} 字符串
+ */
+export function getDate(ms) {
+  const day = Math.floor(ms / (24 * 60 * 60 * 1000));
+  const hour =  Math.floor((ms / (60 * 60 * 1000) - day * 24));
+  const minute =  Math.floor(((ms / (60 * 1000)) - day * 24 * 60 - hour * 60));
+  const second =  Math.floor((ms / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60));
+  if (day > 0) {
+    return day + "天" + hour + "小时" + minute + "分钟";
+  }
+  if (hour > 0) {
+    return hour + "小时" + minute + "分钟";
+  }
+  if (minute > 0) {
+    return minute + "分钟";
+  }
+  if (second > 0) {
+    return second + "秒";
+  } else {
+    return 0 + "秒";
+  }
+}
+
+export function beginOfDay(date) {
+  return new Date(date.getFullYear(), date.getMonth(), date.getDate());
+}
+
+export function endOfDay(date) {
+  return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999);
+}
+
+export function betweenDay(date1, date2) {
+  date1 = convertDate(date1);
+  date2 = convertDate(date2);
+  // 计算差值
+  return Math.floor((date2.getTime() - date1.getTime()) / (24 * 3600 * 1000));
+}
+
+export function formatDate(date, fmt) {
+  date = convertDate(date);
+  const o = {
+    "M+": date.getMonth() + 1, //月份
+    "d+": date.getDate(), //日
+    "H+": date.getHours(), //小时
+    "m+": date.getMinutes(), //分
+    "s+": date.getSeconds(), //秒
+    "q+": Math.floor((date.getMonth() + 3) / 3), //季度
+    "S": date.getMilliseconds() //毫秒
+  };
+  if (/(y+)/.test(fmt)) { // 年份
+    fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
+  }
+  for (const k in o) {
+    if (new RegExp("(" + k + ")").test(fmt)) {
+      fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+    }
+  }
+  return fmt;
+}
+
+export function addTime(date, time) {
+  date = convertDate(date);
+  return new Date(date.getTime() + time);
+}
+
+export function convertDate(date) {
+  if (typeof date === 'string') {
+    return new Date(date);
+  }
+  return date;
+}

+ 288 - 0
src/views/bpm/processInstance/detail.vue

@@ -0,0 +1,288 @@
+<template>
+
+    <div class="app-container" style="padding: 15px">
+      <!-- 审批记录 -->
+      <el-card class="box-card" v-loading="tasksLoad">
+        <div slot="header" class="clearfix">
+          <span class="el-icon-picture-outline">审批记录</span>
+        </div>
+        <el-col :span="16" :offset="4">
+          <div class="block">
+            <el-timeline>
+              <el-timeline-item
+                v-for="(item, index) in tasks"
+                :key="index"
+                :icon="getTimelineItemIcon(item)"
+                :type="getTimelineItemType(item)"
+              >
+                <p style="font-weight: 700">任务:{{ item.name }}</p>
+                <el-card :body-style="{ padding: '10px' }">
+                  <label
+                    v-if="item.assigneeUser"
+                    style="font-weight: normal; margin-right: 30px"
+                  >
+                    {{index==0?' 审批人':'发起人' }}:{{ item.assigneeUser.nickname }}
+                    <el-tag type="info" size="mini">{{
+                      item.assigneeUser.deptName
+                    }}</el-tag>
+                  </label>
+                  <label style="font-weight: normal" v-if="item.createTime"
+                    >创建时间:</label
+                  >
+                  <label style="color: #8a909c; font-weight: normal">{{
+                    item.createTime
+                  }}</label>
+                  <label
+                    v-if="item.endTime"
+                    style="margin-left: 30px; font-weight: normal"
+                    >审批时间:</label
+                  >
+                  <label
+                    v-if="item.endTime"
+                    style="color: #8a909c; font-weight: normal"
+                  >
+                    {{ item.endTime }}</label
+                  >
+                  <label
+                    v-if="item.durationInMillis"
+                    style="margin-left: 30px; font-weight: normal"
+                    >耗时:</label
+                  >
+                  <label
+                    v-if="item.durationInMillis"
+                    style="color: #8a909c; font-weight: normal"
+                  >
+                    {{ getDateStar(item.durationInMillis) }}
+                  </label>
+                  <label   v-if="item.result!=1"  style="margin-left: 30px;color: #8a909c; font-weight: normal">
+                    签名:
+                  </label>
+                  <label v-if="item.result!=1">
+                    <el-image
+                      style="width: 50px; height: 50px;position: absolute;transform: translate(0px, 0px);"
+                      :src="item?.assigneeUser?.signature[0]?.url">
+                      <div slot="error" class="image-slot">
+<!--                        <i class="el-icon-picture-outline"></i>-->
+                        <span></span>
+                      </div>
+                    </el-image>
+                  </label>
+
+                  <p v-if="item.reason&&item.result!=4">
+                    <el-tag :type="getTimelineItemType(item)">{{
+                      item.reason
+                    }}</el-tag>
+                  </p>
+                </el-card>
+              </el-timeline-item>
+            </el-timeline>
+          </div>
+        </el-col>
+      </el-card>
+
+      <!-- 高亮流程图 -->
+      <el-card class="box-card" v-loading="processInstanceLoading">
+        <div slot="header" class="clearfix">
+          <span class="el-icon-picture-outline">流程图</span>
+        </div>
+        <my-process-viewer
+
+          key="designer"
+          v-model="bpmnXML"
+          v-bind="bpmnControlForm"
+          :activityData="activityList"
+          :processInstanceData="processInstance"
+          :taskData="tasks"
+        />
+      </el-card>
+    </div>
+
+</template>
+
+<script>
+  import {
+    getProcessDefinitionBpmnXML,
+    getProcessInstance,
+    getTaskListByProcessInstanceId,
+    getActivityList
+  } from '@/api/bpm/index';
+  import store from '@/store';
+  import { getDate } from '@/utils/dateUtils';
+  import dictMixins from '@/mixins/dictMixins';
+  // import Vue from 'vue';
+
+  // 流程实例的详情页,可用于审批
+  export default {
+    name: 'ProcessInstanceDetail',
+    mixins: [dictMixins],
+    props: {
+      id: {
+        default: ''
+      }
+    },
+    components: {},
+    data() {
+      return {
+        // 遮罩层
+        processInstanceLoading: true,
+        dialogVisible: false,
+
+        // 流程实例
+        // id: undefined, // 流程实例的编号
+        processInstance: {},
+
+        // BPMN 数据
+        bpmnXML: null,
+        bpmnControlForm: {
+          prefix: 'flowable'
+        },
+        activityList: [],
+
+        // 审批记录
+        tasksLoad: true,
+        tasks: []
+      };
+    },
+    created() {
+
+      this.getDetail();
+    },
+    methods: {
+
+      /** 获得流程实例 */
+      getDetail() {
+        // 获得流程实例相关
+        this.processInstanceLoading = true;
+        getProcessInstance(this.id).then((response) => {
+          if (!response) {
+            this.$message.error('查询不到流程信息!');
+            return;
+          }
+          // 设置流程信息
+          this.processInstance = response;
+
+          // //将业务表单,注册为动态组件
+          // const path = this.processInstance.processDefinition.formCustomViewPath;
+          // Vue.component("async-biz-form-component", function (resolve) {
+          //   require([`@/views${path}`], resolve);
+          // });
+
+          // 加载流程图
+          getProcessDefinitionBpmnXML(
+            this.processInstance.processDefinition.id
+          ).then((response) => {
+            this.bpmnXML = response;
+          });
+          // 加载活动列表
+          getActivityList({
+            processInstanceId: this.processInstance.id
+          }).then((response) => {
+            this.activityList = response;
+          });
+
+          // 取消加载中
+          this.processInstanceLoading = false;
+        });
+
+        // 获得流程任务列表(审批记录)
+        this.tasksLoad = true;
+        getTaskListByProcessInstanceId(this.id).then((response) => {
+          // 审批记录
+          this.tasks = [];
+          // 移除已取消的审批
+          response.forEach((task) => {
+            // if (task.result !== 4) {
+              this.tasks.push(task);
+            // }
+          });
+          // 排序,将未完成的排在前面,已完成的排在后面;
+          this.tasks.sort((a, b) => {
+            // 有已完成的情况,按照完成时间倒序
+            if (a.endTime && b.endTime) {
+              return b.endTime - a.endTime;
+            } else if (a.endTime) {
+              return 1;
+            } else if (b.endTime) {
+              return -1;
+              // 都是未完成,按照创建时间倒序
+            } else {
+              return b.createTime - a.createTime;
+            }
+          });
+
+          // 需要审核的记录
+          const userId = store.getters.userId;
+          this.tasks.forEach((task) => {
+            if (task.result !== 1 && task.result !== 6) {
+              // 只有待处理才需要
+              return;
+            }
+            if (!task.assigneeUser || task.assigneeUser.id !== userId) {
+              // 自己不是处理人
+              return;
+            }
+          });
+
+          // 取消加载中
+          this.tasksLoad = false;
+        });
+      },
+      getDateStar(ms) {
+        return getDate(ms);
+      },
+      getTimelineItemIcon(item) {
+        if (item.result === 1) {
+          return 'el-icon-time';
+        }
+        if (item.result === 2) {
+          return 'el-icon-check';
+        }
+        if (item.result === 3) {
+          return 'el-icon-close';
+        }
+        if (item.result === 4) {
+          return 'el-icon-remove-outline';
+        }
+        if (item.result === 5) {
+          return 'el-icon-back';
+        }
+        return '';
+      },
+      getTimelineItemType(item) {
+        if (item.result === 1) {
+          return 'primary';
+        }
+        if (item.result === 2) {
+          return 'success';
+        }
+        if (item.result === 3) {
+          return 'danger';
+        }
+        if (item.result === 4) {
+          return 'info';
+        }
+        if (item.result === 5) {
+          return 'warning';
+        }
+        if (item.result === 6) {
+          return 'default';
+        }
+        return '';
+      },
+      handleClose() {
+        this.dialogVisible = false;
+      }
+    }
+  };
+</script>
+
+<style lang="scss">
+  .my-process-designer {
+    height: calc(100vh - 200px);
+  }
+
+  .box-card {
+    width: 100%;
+    margin-bottom: 20px;
+  }
+</style>

+ 315 - 0
src/views/warehouseManagement/inventoryAllocation/accountstatement/addAccountDialog.vue

@@ -0,0 +1,315 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    :visible.sync="addAccountDialogFlag"
+    :title="title"
+    :append-to-body="true"
+    :close-on-click-modal="false"
+    :maxable="true"
+    :resizable="true"
+    width="85%"
+    :before-close="cancel"
+  >
+    <div v-loading="loading">
+      <!--销售表单-->
+      <sale-form
+        @handleSearch="handleSearch"
+        :dataForm.sync="dataForm"
+        :datasource.sync="datasource"
+        :contactData="contactData"
+        :saleOrderData="saleOrderData"
+        :recorpayList.sync="recorpayList"
+        :dialogType="dialogType"
+        ref="saleFormRef"
+      ></sale-form>
+      <headerTitle title="对账明细" style="margin-top: 30px">
+        <template v-slot>
+          <el-row style="font-weight: 700; color: red">
+            <span>总金额:</span>
+            <span>{{ dataForm.amountTotalPrice || 0 }}</span>
+            <el-divider direction="vertical"></el-divider>
+            <span>已对账金额:</span>
+            <span>{{ dataForm.amountCompletePrice || 0 }}</span>
+            <el-divider direction="vertical"></el-divider>
+            <span>未对账金额:</span>
+            <span>{{ dataForm.amountUnCompletePrice || 0 }}</span>
+          </el-row>
+        </template>
+      </headerTitle>
+      <inventoryTable
+        ref="inventoryTableref"
+        :dataForm="dataForm"
+        :datasource.sync="datasource"
+        :dialogType="dialogType"
+      ></inventoryTable>
+    </div>
+    <div slot="footer" class="footer">
+      <el-button
+        v-if="dialogType !== 'view'"
+        type="primary"
+        @click="save"
+        v-loading="saveLoading"
+        >保存
+      </el-button>
+      <el-button
+        v-if="dialogType !== 'view'"
+        type="primary"
+        @click="save('sub')"
+        v-loading="saveLoading"
+        >提交
+      </el-button>
+      <el-button @click="cancel">返回</el-button>
+    </div>
+    <process-submit-dialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="reload"
+    ></process-submit-dialog>
+  </ele-modal>
+</template>
+
+<script>
+  import InventoryTable from './inventoryTable.vue';
+  import recorpayTableList from './recorpayTableList.vue';
+
+  import saleForm from './saleForm.vue';
+  import {
+    getStatementRecordListAPI,
+    infoAccountStatementAPI,
+    createAccountStatementAPI,
+    updateAccountStatementAPI,
+    accountstatementInfoAPI
+  } from '@/api/saleManage/accountstatement';
+  import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
+
+  export default {
+    name: 'addAccountDialog',
+    components: {
+      processSubmitDialog,
+      InventoryTable,
+      saleForm,
+      recorpayTableList
+    },
+    //客户管理数据
+    props: {
+      addAccountDialogFlag: {
+        type: Boolean,
+        default: false
+      },
+      contactData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      saleOrderData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      }
+    },
+    data() {
+      return {
+        fullscreen: false,
+        loading: false,
+        saveLoading: false,
+        datasource: [],
+        recorpayList: [],
+        dataForm: {
+          sourceType: 1,
+          dateType: 1,
+          queryDimension: 2,
+          dateValue: '',
+          contactId: '',
+          contactName: '',
+          sourceName: '',
+          sourceId: '',
+          type: '',
+          year: '',
+          quarter: '',
+          month: '',
+          dateTimeRange: [],
+          orderNo: '',
+          orderId: '',
+          id: '',
+          startDate: '',
+          endDate: '',
+          repliedFiles: []
+        },
+        title: '',
+        processSubmitDialogFlag: false,
+        dialogType: ''
+      };
+    },
+    computed: {},
+    methods: {
+      open(dialogType, row, type = '') {
+        this.dialogType = dialogType;
+        this.title =
+          dialogType == 'add'
+            ? '新增'
+            : dialogType == 'update'
+            ? '修改'
+            : '详情';
+        this.dataForm.type = type;
+        this.$nextTick(() => {
+          if (this.contactData.id) {
+            this.$refs.saleFormRef.getCusInfo(this.contactData);
+          }
+          if (this.saleOrderData.id) {
+            this.$refs.saleFormRef.getOrderInfo(this.saleOrderData);
+          }
+        });
+        if (this.dialogType !== 'add') {
+          this.getInfo(row);
+        }
+      },
+      //获取对账单详情
+      async getInfo(row) {
+        let data = await accountstatementInfoAPI(row.id);
+        // this.recorpayList = data.recorpayList || [];
+        data.amountTotalPrice = data.orderList.reduce((pre, cur) => pre + +cur.amountTotalPrice, 0),
+        data.amountCompletePrice = data.orderList.reduce((pre, cur) => pre + +cur.statementAmount, 0),
+        data.amountUnCompletePrice = data.orderList.reduce((pre, cur) => pre + +cur.unStatementAmount, 0)
+        this.datasource = data || [];
+        this.dataForm = data;
+        switch (this.dataForm.dateType) {
+          case 1:
+            // this.dataForm.year = this.dataForm.dateValue;
+            this.$set(this.dataForm, 'year', this.dataForm.dateValue);
+            break;
+          case 2:
+            //2023年-四季度
+            let data = this.dataForm.dateValue.split('年-');
+
+            this.$set(this.dataForm, 'year', data[0]);
+            this.$set(this.dataForm, 'quarter', data[1]);
+            break;
+          case 3:
+            this.$set(this.dataForm, 'month', this.dataForm.dateValue);
+
+            break;
+          default:
+            this.dataForm.dateValue = '';
+            this.$set(this.dataForm, 'dateTimeRange', [
+              this.dataForm.startDate,
+              this.dataForm.endDate
+            ]);
+        }
+        this.$forceUpdate();
+      },
+      //关闭弹窗
+      cancel() {
+        this.$emit('update:addAccountDialogFlag', false);
+      },
+      //查询获取订单数据
+      async handleSearch(params) {
+        let searchQuery = {
+          endDate: params.endDate,
+          sourceId: params.sourceId,
+          sourceType: params.sourceType,
+          startDate: params.startDate,
+          queryDimension: params.queryDimension,
+          type: 1
+        };
+        this.loading = true;
+
+        // const searchQuery = ["SALES20251225007","SALES20251225005","SALES20251225009"];
+        try {
+          let data = await getStatementRecordListAPI(searchQuery);
+          console.log(data, 'data');
+          this.loading = false;
+          this.datasource = data || [];
+          // this.recorpayList = data.recorpayList || [];
+          this.dataForm = {
+            ...this.dataForm,
+            // amountPayablePrice: data.amountPayablePrice,
+            amountTotalPrice: data.reduce((pre, cur) => pre + +cur.amountTotalPrice, 0),
+            amountCompletePrice: data.reduce((pre, cur) => pre + +cur.statementAmount, 0),
+            amountUnCompletePrice: data.reduce((pre, cur) => pre + +cur.unStatementAmount, 0)
+          };
+          this.$forceUpdate();
+        } catch (error) {
+          this.loading = false;
+        }
+          // amountReceivablePrice: data.amountReceivablePrice,
+          // amountTotalPrice: data.amountTotalPrice,
+          // amountPayablePass: data.amountPayablePass,
+          // amountReceivablePass: data.amountReceivablePass
+          
+        // if (!this.datasource.length) this.$message.warning('暂无订单信息');
+      },
+      //保存
+      async save(is) {
+        if (!this.datasource.length)
+          return this.$message.warning('暂无对账信息');
+        let api =
+          this.dialogType == 'add'
+            ? createAccountStatementAPI
+            : updateAccountStatementAPI;
+        let params = {
+          ...this.dataForm,
+          orderList: this.datasource,
+        };
+        console.log('params~~~', params);
+        this.saveLoading = true;
+        try {
+          let data = await api(params);
+          this.saveLoading = false;
+          if (is == 'sub') {
+            await this.submitApprove(data);
+            return;
+            // await submitAccountStatementApproveAPI({
+            //   businessId: data,
+            //   type: this.dataForm.type
+            // });
+          }
+          this.$message.success('操作成功');
+          this.reload();
+        } catch (error) {
+          this.saveLoading = false;
+        }
+        this.$message.success('操作成功');
+        this.reload();
+      },
+      async submitApprove(res) {
+        let data = await accountstatementInfoAPI(res);
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            businessId: res,
+            businessKey: 'sales_account_statement_approve',
+            formCreateUserId: data.createUserId,
+            variables: {
+              type: data.type,
+              businessCode: data.statementNo,
+              businessName: data.contactName,
+              businessType: '对账单'
+            }
+            // callBackMethodType : '1',
+            // callBackMethod : 'proTargetPlanApproveApiImpl.updatePlanApprovalStatus',
+            // pcHandle : '/bpm/handleTask/components/project-manage/plan-manage/submit.vue',
+            // pcView : '/bpm/handleTask/components/project-manage/plan-manage/detailDialog.vue',
+            // miniHandle : '',
+            // miniView : '',
+          };
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
+      reload() {
+        this.cancel();
+        //刷新主页面
+        this.$emit('done');
+      }
+    }
+  };
+</script>
+<style scoped lang="scss">
+  ::v-deep.el-divider {
+    margin: 10px;
+    font-weight: bold;
+  }
+</style>

+ 104 - 0
src/views/warehouseManagement/inventoryAllocation/accountstatement/components/contactSearch.vue

@@ -0,0 +1,104 @@
+<!-- 搜索表单 -->
+<template>
+  <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
+</template>
+<script>
+  import { reviewStatusSelect } from '@/enum/dict';
+  export default {
+    data() {
+      return {};
+    },
+    computed: {
+      // 表格列配置
+      seekList() {
+        return [
+        {
+            label: '关键字:',
+            value: 'searchName',
+            type: 'input',
+            placeholder: '编码/代号/客户名称/联系人电话'
+          },
+          {
+            label: '编码/代号:',
+            value: 'codeOrSerialNo',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '客户名称:',
+            value: 'name',
+            type: 'input',
+            placeholder: '请输入',
+          },
+          // {
+          //   label: '电话:',
+          //   value: 'phone',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入'
+          // },
+          // {
+          //   label: '注册地址:',
+          //   value: 'addressName',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入'
+          // },
+          // {
+          //   label: '联系地址:',
+          //   value: 'otherAddressName',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入'
+          // },
+          // {
+          //   label: '联系人:',
+          //   value: 'linkName',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入'
+          // },
+          // {
+          //   label: '状态',
+          //   value: 'targetTime',
+          //   width: 380,
+          //   type: 'select',
+          //   placeholder: '请选择状态',
+          //   planList:reviewStatusSelect
+          // },
+          // {
+          //   label: '部门:',
+          //   value: 'assessmentObject',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入',
+          // },
+          // {
+          //   label: '创建人:',
+          //   value: 'createUsername',
+          //   width: 380,
+          //   type: 'input',
+          //   placeholder: '请输入姓名'
+          // },
+          {
+            label: '创建时间:',
+            value: 'createTime',
+            type: 'date',
+            dateType: 'datetimerange',
+            placeholder: '',
+            width: 380,
+            valueAr: ['createTimeStart', 'createTimeEnd']
+          },
+        ];
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search(e) {
+        this.$emit('search', {
+          ...e
+        });
+      }
+    }
+  };
+</script>

+ 133 - 0
src/views/warehouseManagement/inventoryAllocation/accountstatement/components/searchContract.vue

@@ -0,0 +1,133 @@
+<!-- 搜索表单 -->
+<template>
+    <el-form
+      size="small"
+      label-width="90px"
+      class="ele-form-search"
+      @keyup.enter.native="search"
+      @submit.native.prevent
+    >
+      <el-row :gutter="10">
+
+
+        <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+          <el-form-item label="合同名称">
+            <el-input
+              clearable
+              size="small"
+              v-model="where.contractName"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
+
+        <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+          <el-form-item label="客户名称">
+            <el-input
+              clearable
+              size="small"
+              v-model="where.partaName"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+          <el-form-item label="签订人">
+            <el-input
+              clearable
+              size="small"
+              v-model="where.linkName"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { md: 6 } : { span: 4 }" >
+          <el-form-item>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-search"
+              class="ele-btn-icon"
+              @click="search"
+            >
+              查询
+            </el-button>
+
+            <el-button
+              @click="reset"
+              icon="el-icon-refresh"
+              class="ele-btn-icon"
+              size="medium"
+            >重置</el-button
+            >
+            <slot></slot>
+          </el-form-item>
+        </el-col>
+
+      </el-row>
+      <el-row :gutter="10">
+
+        <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+          <el-form-item label="合同编码">
+            <el-input
+              clearable
+              size="small"
+              v-model="where.contractNo"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
+
+        <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+          <el-form-item label="合同编号">
+            <el-input
+              clearable
+              size="small"
+              v-model="where.contractNumber"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
+
+      </el-row>
+    </el-form>
+  </template>
+
+  <script>
+    export default {
+      data() {
+        // 默认表单数据
+        const defaultWhere = {
+          contractName: '',
+          partaName: '',
+          linkName: '',
+          contractNumber: '',
+          contractNo: '',
+        };
+        return {
+          defaultWhere,
+          // 表单数据
+          where: { ...defaultWhere },
+          loading:false
+        };
+      },
+      computed: {
+        // 是否开启响应式布局
+        styleResponsive() {
+          return this.$store.state.theme.styleResponsive;
+        }
+      },
+      methods: {
+        /* 搜索 */
+        search() {
+          this.$emit('search', this.where);
+        },
+        /*  重置 */
+        reset() {
+          this.where = { ...this.defaultWhere };
+          this.search();
+        },
+
+      }
+    };
+  </script>

+ 159 - 0
src/views/warehouseManagement/inventoryAllocation/accountstatement/components/searchTable.vue

@@ -0,0 +1,159 @@
+<!-- 搜索表单 -->
+<template>
+  <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
+</template>
+<script>
+  import { reviewStatusSelect, saleOrderStatusEnum } from '@/enum/dict';
+  export default {
+    data() {
+      return {};
+    },
+    computed: {
+      // 表格列配置
+      seekList() {
+        return [
+          {
+            label: '关键字:',
+            value: 'searchName',
+            type: 'input',
+            placeholder: '订单编码/客户名称/合同编号/产品名称'
+          },
+          {
+            label: '订单编码:',
+            value: 'orderNo',
+            type: 'input',
+            placeholder: ''
+          },
+
+          {
+            label: '客户名称:',
+            value: 'partaName',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '销售类型',
+            value: 'saleType',
+            width: 380,
+            type: 'DictSelection',
+            dictName: '销售类型'
+          },
+          {
+            label: '库存状态',
+            value: 'hasStock',
+            width: 380,
+            type: 'select',
+            planList: [
+              {
+                label: '有库存',
+                value: 1
+              },
+              { label: '无库存', value: 0 }
+            ]
+          },
+
+          {
+            label: '合同编号:',
+            value: 'contractNumber',
+            width: 380,
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '项目名称:',
+            value: 'projectName',
+            width: 380,
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '产品名称:',
+            value: 'productName',
+            width: 380,
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '编码',
+            value: 'productCode',
+            width: 380,
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '生产编号',
+            value: 'productionCodes',
+            width: 380,
+            type: 'input',
+            placeholder: ''
+          },
+          // {
+          //   label: '项目名称:',
+          //   value: 'productCode',
+          //   width: 380,
+          //   type: 'input',
+          //   width: 380,
+          //   placeholder: ''
+          // },
+          {
+            label: '订单类型',
+            value: 'needProduce',
+            width: 380,
+            type: 'select',
+            planList: [
+              {
+                label: '生产性订单',
+                value: '1'
+              },
+              { label: '无客户生产性订单', value: '2' },
+              { label: '库存式订单', value: '0' },
+              { label: '不定向订单', value: '4' }
+            ],
+            width: 380,
+            placeholder: ''
+          },
+          {
+            label: '审核状态',
+            value: 'orderStatus',
+            type: 'select',
+            planList: reviewStatusSelect,
+            width: 380,
+            placeholder: ''
+          },
+          {
+            label: '订单进度',
+            value: 'progress',
+            type: 'select',
+            planList: saleOrderStatusEnum,
+            width: 380,
+            placeholder: ''
+          },
+          {
+            label: '创建人:',
+            value: 'createUserName',
+            width: 380,
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '创建时间:',
+            value: 'createTime',
+            type: 'date',
+            dateType: 'datetimerange',
+            placeholder: '',
+            width: 380,
+            valueAr: ['createTimeStart', 'createTimeEnd']
+          }
+        ];
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search(e) {
+        this.$emit('search', {
+          ...e
+        });
+      }
+    }
+  };
+</script>

+ 397 - 0
src/views/warehouseManagement/inventoryAllocation/accountstatement/contractListDialog.vue

@@ -0,0 +1,397 @@
+<template>
+  <el-dialog
+    title="选择合同"
+    custom-class="ele-dialog-form long-dialog-form"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    top="5vh"
+    v-if="visible"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+  >
+    <el-card shadow="never">
+      <searchContract @search="reload"></searchContract>
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div class="ele-border-lighter split-layout-right-content">
+          <AssetTree
+            @handleNodeClick="handleNodeClick"
+            id="20"
+            :isFirstRefreshTable="false"
+            ref="treeList"
+            :filterCode="this.type"
+          />
+        </div>
+        <!-- 表格 -->
+        <template v-slot:content>
+          <ele-pro-table
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            row-key="id"
+            height="calc(100vh - 500px)"
+            class="dict-table"
+            @cell-click="cellClick"
+            :rowClickChecked="true"
+          >
+            <!-- 表头工具栏 -->
+            <template v-slot:action="{ row }">
+              <el-radio
+                class="radio"
+                v-model="radio"
+                :label="row.id"
+                v-if="!isAcc"
+                ><i></i
+              ></el-radio>
+              <el-button
+                v-if="isAcc"
+                :disabled="row.hasInvoiceApply"
+                type="primary"
+                @click="selected1(row)"
+              >
+                选择
+              </el-button>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+
+    <div class="btns" slot="footer">
+      <el-button type="primary" size="small" v-if="!isAcc" @click="selected"
+        >选择</el-button
+      >
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import { contactTypeTree } from '@/api/saleManage/contact';
+  import searchContract from './components/searchContract.vue';
+  import { getTableList } from '@/api/contractManage/contractBook';
+  import AssetTree from '@/components/AssetTree';
+
+  export default {
+    components: {
+      AssetTree,
+      searchContract
+    },
+    props: {
+      type: {
+        default: 1,
+        type: Number
+      },
+      hasGeneratedOrder: {
+        default: 0,
+        type: [Number, String]
+      },
+      contactData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      isChange: {
+        default: false,
+        type: Boolean
+      },
+      isAdd: {
+        //对账单选择合同
+        default: false,
+        type: Boolean
+      },
+      sourceType: {
+        default: '',
+        type: String
+      },
+      isCreatedByOrder: {
+        default: 0
+      }
+    },
+    data() {
+      return {
+        visible: false,
+        currentIndex: null,
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            action: 'action',
+            slot: 'action',
+            align: 'center',
+            label: '选择',
+            minWidth: 100
+          },
+          {
+            prop: 'contractNo',
+            label: '合同编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+          {
+            prop: 'contractNumber',
+            label: '合同编号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'contractName',
+            label: '合同名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'typeName',
+            label: '合同类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'partaName',
+            label: '甲方名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          },
+          {
+            prop: 'partaLinkName',
+            label: '甲方联系人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+
+          {
+            prop: 'partaTel',
+            label: '甲方联系电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+          {
+            prop: 'partbName',
+            label: '乙方名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+          {
+            prop: 'partbLinkName',
+            label: '乙方联系人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+          {
+            prop: 'partbTel',
+            label: '乙方联系电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+
+          {
+            prop: 'enabled',
+            label: '是否可用',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140,
+            formatter: (_row, _column, cellValue) => {
+              return _row.enabled ? '是' : '否';
+            }
+          },
+          {
+            prop: 'contractStartDate',
+            label: '签订日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'contractEndDate',
+            label: '结束日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'receiptPaymentType',
+            label: '收付款类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+            formatter: (_row, _column, cellValue) => {
+              return _row.receiptPaymentType == 1 ? '固定' : '分期';
+            }
+          },
+          {
+            prop: 'totalPrice',
+            label: '合同总金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          }
+        ],
+        isAcc: false, //是否对账
+        radio: null
+      };
+    },
+
+    methods: {
+      open(item, currentIndex, isAcc = false) {
+        this.currentIndex = currentIndex;
+        this.isAcc = isAcc;
+        if (item && item.id) {
+          this.radio = item.id;
+        }
+
+        this.visible = true;
+      },
+
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        if (this.contactData.id) {
+          where['contactId'] = this.contactData.id;
+        }
+        if (this.type) {
+          where['type'] = this.type;
+        }
+        if (this.isChange) {
+          where['ifRelation'] = 0;
+        }
+        if (this.sourceType) {
+          where['requireSourceType'] = this.sourceType;
+        }
+        if (this.isCreatedByOrder) {
+          where['isCreatedByOrder'] = this.isCreatedByOrder;
+        }
+        let params = {
+          pageNum: page,
+          size: limit,
+
+          status: 2,
+          ...where
+        };
+        // console.log(this.hasGeneratedOrder);
+        // if(this.hasGeneratedOrder!=3) params.hasGeneratedOrder = this.hasGeneratedOrder
+        return getTableList(params);
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+
+      handleNodeClick(data, node) {
+        this.reload({ categoryId: data.id });
+      },
+
+      // 单击获取id
+      cellClick(row) {
+        this.current = row;
+        console.log(row);
+        this.radio = row.id;
+      },
+      handleClose() {
+        this.visible = false;
+        this.current = null;
+        this.radio = '';
+      },
+      async addConfirm() {
+        return await this.$confirm('该合同已经生成过订单, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            return true;
+          })
+          .catch(() => {
+            return false;
+          });
+      },
+      async selected() {
+        if (!this.current) {
+          return this.$message.warning('请至少选择一条数据');
+        }
+        if (this.isChange) {
+          this.$emit('changeParent', this.current, this.currentIndex);
+          this.handleClose();
+          return;
+        }
+        if (this.isAdd) {
+          this.$emit('changeParent', this.current, this.currentIndex);
+          this.handleClose();
+          return;
+        }
+        if (this.current.hasGeneratedOrder > 0 && !(await this.addConfirm())) {
+          return;
+        }
+
+        this.$emit('changeParent', this.current, this.currentIndex);
+        this.handleClose();
+      },
+      selected1(item) {
+        this.$emit('changeParent', item);
+        this.handleClose();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+  }
+
+  .table_col {
+    padding-left: 10px;
+
+    ::v-deep .el-table th.el-table__cell {
+      background: #f2f2f2;
+    }
+  }
+
+  .pagination {
+    text-align: right;
+    padding: 10px 0;
+  }
+
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
+
+  .topsearch {
+    margin-bottom: 15px;
+  }
+</style>

+ 170 - 0
src/views/warehouseManagement/inventoryAllocation/accountstatement/detailDialog.vue

@@ -0,0 +1,170 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    :visible.sync="detailDialogFlag"
+    :title="title"
+    :append-to-body="true"
+    :close-on-click-modal="false"
+    :maxable="true"
+    :resizable="true"
+    width="70%"
+    :before-close="cancel"
+  >
+
+    <el-card shadow="never">
+      <div class="switch">
+        <div class="switch_left">
+          <ul>
+            <li
+              v-for="item in tabOptions"
+              :key="item.key"
+              :class="{ active: activeComp == item.key }"
+              @click="activeComp = item.key"
+            >
+              {{ item.name }}
+            </li>
+          </ul>
+        </div>
+      </div>
+    </el-card>
+    <div v-if="activeComp==='main'">
+      <!--销售表单表单-->
+      <sale-form :dataForm.sync="dataForm" :datasource.sync="datasource"
+                 dialogType="view"></sale-form>
+      <headerTitle title="对账明细" style="margin-top: 30px">
+        <template v-slot>
+          <el-row style="font-weight: 700;color: red" >
+            <span>总金额:</span>
+            <span>{{ dataForm.amountTotalPrice || 0 }}</span>
+            <el-divider direction="vertical"></el-divider>
+            <span>应收金额:</span>
+            <span>{{ dataForm.amountReceivablePrice || 0 }}</span>
+            <el-divider direction="vertical"></el-divider>
+            <span>已收金额:</span>
+            <span>{{ dataForm.amountReceivablePass||0 }}</span>
+            <el-divider direction="vertical"></el-divider>
+            <span>应付金额:</span>
+            <span>{{ dataForm.amountPayablePrice || 0 }}</span>
+      
+            <el-divider direction="vertical"></el-divider>
+            <span>已付金额:</span>
+            <span>{{ dataForm.amountPayablePass||0 }}</span>
+
+          </el-row>
+        </template>
+      </headerTitle>
+      <recorpayTableList
+        ref="recorpayListRef"
+        :dataForm="dataForm"
+        :recorpayList.sync="recorpayList"
+        dialogType="view"
+      ></recorpayTableList>
+      <inventoryTable ref="inventoryTableref" :dataForm="dataForm" :datasource.sync="datasource" dialogType="view"></inventoryTable>
+    </div>
+    <bpmDetail v-if="activeComp==='bpm'&&form.processInstanceId" :id="form.processInstanceId"></bpmDetail>
+
+    <div slot="footer" class="footer">
+      <el-button @click="cancel">返回</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+
+import bpmDetail from '@/views/bpm/processInstance/detail.vue';
+import InventoryTable from "./inventoryTable.vue";
+import saleForm from "./saleForm.vue";
+import {infoAccountStatementAPI} from "@/api/saleManage/accountstatement";
+import recorpayTableList from './recorpayTableList.vue';
+
+export default {
+  props: ['detailDialogFlag'],
+  components: {
+    saleForm,
+    InventoryTable,
+    bpmDetail,recorpayTableList
+  },
+  data() {
+    return {
+      activeComp: 'main',
+      tabOptions: [
+        {key: 'main', name: '对账单详情'},
+        {key: 'bpm', name: '流程详情'}
+      ],
+      fullscreen:false,
+
+      visible: false,
+      form: {},
+      dataForm: {},
+      datasource: [],
+      recorpayList:[],
+      title: '详情',
+
+
+    };
+  },
+  methods: {
+    async open(dialogType, row, type = '') {
+      console.log(row)
+      this.form = row
+      this.dialogType = dialogType
+      this.dataForm.type = type
+      let data = await infoAccountStatementAPI(row.id)
+
+
+      this.datasource = data.orderList
+      this.recorpayList = data.recorpayList || [];
+      this.dataForm = data
+      switch (this.dataForm.dateType) {
+        case 1:
+          this.dataForm.year = this.dataForm.dateValue
+          break;
+        case 2:
+          //2023年-四季度
+          let data = this.dataForm.dateValue.split('年-')
+          this.dataForm.year = data[0]
+          this.dataForm.quarter = data[1]
+          break
+        case 3:
+          this.dataForm.month = this.dataForm.dateValue
+          break
+        default:
+          this.dataForm.dateValue = ''
+          this.dataForm.dateTimeRange = [this.dataForm.startDate, this.dataForm.endDate]
+      }
+    },
+    cancel() {
+      this.$emit('update:detailDialogFlag', false)
+    },
+  }
+};
+</script>
+
+<style scoped lang="scss">
+.ele-dialog-form {
+  .el-form-item {
+    margin-bottom: 10px;
+  }
+}
+
+.none {
+  display: none;
+}
+
+.headbox {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
+    margin-right: 20px;
+  }
+}
+::v-deep.el-divider {
+  margin: 10px;
+  font-weight: bold;
+}
+</style>

+ 670 - 0
src/views/warehouseManagement/inventoryAllocation/accountstatement/inventoryTable.vue

@@ -0,0 +1,670 @@
+<template>
+  <div>
+    <!-- <div v-for="(item) in datasource" style="margin-bottom: 10px">
+      <div>
+        <div style="margin-bottom: 10px;font-weight: bold;">
+          <div>
+            <el-divider direction="vertical"></el-divider>
+            <span><span>{{ index + 1 }}</span> 销售订单:</span>
+            <span>{{ item.orderNo }}</span>
+            <el-divider direction="vertical"></el-divider> -->
+            <!-- <span>计价方式:</span>
+            <span> {{ item.pricingWay == 1 ? '按数量计费' : '按重量计费' }}</span> -->
+            <!-- <el-divider direction="vertical"></el-divider> -->
+            <!-- <span>总金额:</span>
+            <span>{{item.amountTotalPrice}}</span>
+            <el-divider direction="vertical"></el-divider>
+            <span>应收金额:</span>
+            <span>{{item.amountReceivablePrice}}</span>
+            <el-divider direction="vertical"></el-divider>
+            <span>应付金额:</span>
+            <span>{{item.amountPayablePrice}}</span>
+          
+
+          </div>
+        </div>
+        <template v-if="item.orderType!=6">
+          <div  v-for="(j,i) in item.subList" :key="i">
+            <ele-pro-table :show-summary="true" :summary-method="getSummaries" ref="table" row-key="id" :needPage="false"
+                           :columns="getColumns(j)" max-height="500px" style="margin-bottom: 10px"
+                           :sub-title="getTitle(j)" :toolkit="[]" :datasource="j.detailList"
+                           cache-key="systemRoleTable17-11121" class="time-form">
+              <template v-slot:action="{ row,$index }">
+                <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(index,$index,'line')">
+                  <template v-slot:reference>
+                    <el-link type="danger" v-if="dialogType!=='view'" :underline="false" icon="el-icon-delete">
+                      删除
+                    </el-link>
+                  </template>
+                </el-popconfirm>
+              </template>
+            </ele-pro-table>
+          </div>
+        </template>
+        <div v-else>
+          <ele-pro-table :show-summary="true" :summary-method="getSummaries" ref="table" row-key="id" :needPage="false"
+                         :columns="getColumns({subType:10})" sub-title="赔付订单" max-height="500px" style="margin-bottom: 10px"
+                         :toolkit="[]" :datasource="item.detailList"
+                         cache-key="systemRoleTable17-11121" class="time-form">
+            <template v-slot:action="{ row,$index }">
+              <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(index,$index,'line')">
+                <template v-slot:reference>
+                  <el-link type="danger" v-if="dialogType!=='view'" :underline="false" icon="el-icon-delete">
+                    删除
+                  </el-link>
+                </template>
+              </el-popconfirm>
+            </template> -->
+            <!--            <template v-slot:productName="{ row,$index }">-->
+            <!--              <el-popover-->
+            <!--                placement="right"-->
+            <!--                width="60%"-->
+            <!--                trigger="hover">-->
+            <!--                <ele-pro-table ref="childrenTable"-->
+            <!--                               row-key="id"-->
+            <!--                               max-height="300px"-->
+            <!--                               :needPage="false" :columns="childrenColumns" :toolkit="[]"-->
+            <!--                               :datasource="row.productList"-->
+            <!--                               cache-key="systemRoleTable17-222" class="time-form">-->
+            <!--                </ele-pro-table>-->
+            <!--                <el-button type="text" slot="reference">{{ row.productName }}</el-button>-->
+            <!--              </el-popover>-->
+            <!--            </template>-->
+          <!-- </ele-pro-table>
+        </div>
+      </div>
+    </div> -->
+
+    <el-collapse  v-model="activeNames">
+      <el-collapse-item v-for="(item, index) in datasource" :key="index" :name="index">
+        <template slot="title">
+          <div class="collapse-title">
+            <div class="collapse-title-left"><span class="collapse-title-index">{{ index + 1 }}</span> 销售订单:{{ item.orderNo }}</div>
+            <div class="collapse-title-right">
+              <span>订单金额:{{ item.amountTotalPrice || 0 }}元</span>
+              <span>已对账金额:{{ item.statementAmount || 0 }}元</span>
+              <span>未对账金额:{{ item.unStatementAmount || 0 }}元</span>
+            </div>
+          </div>
+        </template>
+        <div>
+          <el-tabs type="border-card">
+            <el-tab-pane label="发货单">
+              <ele-pro-table :show-summary="false" :summary-method="getSummaries" ref="table" row-key="id" :needPage="false"
+                          :columns="getColumns(item, 'deliveryProducts')" max-height="500px" style="margin-bottom: 10px" :datasource="item.deliveryProducts || []"
+                          cache-key="systemRoleTable17-11121" class="time-form">
+                <template v-slot:toolbar>
+                  <div class="headbox">
+                    <div>
+                      <span class="amount">对账金额合计:{{ getSummariesA(item.deliveryProducts || []) }}元</span>
+                    </div>
+                  </div>
+                </template>
+                <template v-slot:action="{ row,$index }">
+                  <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(index,$index,'line')">
+                    <template v-slot:reference>
+                      <el-link type="danger" v-if="dialogType!=='view'" :underline="false" icon="el-icon-delete">
+                        删除
+                      </el-link>
+                    </template>
+                  </el-popconfirm>
+                </template>
+              </ele-pro-table>
+            </el-tab-pane>
+            <el-tab-pane label="退货单">
+              <ele-pro-table :show-summary="false" :summary-method="getSummaries" ref="table" row-key="id" :needPage="false"
+                          :columns="getColumns(item, 'returnProducts')" max-height="500px" style="margin-bottom: 10px" :datasource="item.returnProducts || []"
+                          cache-key="systemRoleTable17-11122" class="time-form">
+                <template v-slot:toolbar>
+                  <div class="headbox">
+                    <div>
+                      <span class="amount">对账金额合计:{{ getSummariesA(item.returnProducts || []) }}元</span>
+                    </div>
+                  </div>
+                </template>
+                <template v-slot:action="{ row,$index }">
+                  <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(index,$index,'line')">
+                    <template v-slot:reference>
+                      <el-link type="danger" v-if="dialogType!=='view'" :underline="false" icon="el-icon-delete">
+                        删除
+                      </el-link>
+                    </template>
+                  </el-popconfirm>
+                </template>
+              </ele-pro-table>
+            </el-tab-pane>
+          </el-tabs>
+          
+        </div>
+      </el-collapse-item>
+    </el-collapse>
+
+<!--    <el-row v-if="dialogType=='view'" style="margin-top: 10px">-->
+<!--      <el-col :span="6" style="float: right;">-->
+<!--        <el-descriptions class="margin-top" direction="vertical" :column="3" size="small" border>-->
+<!--          <el-descriptions-item label="本期应收款总额">{{ dataForm.amountReceivablePrice }}</el-descriptions-item>-->
+<!--          <el-descriptions-item label="截止上期欠款">-->
+<!--            <template>{{ dataForm.previousPeriodEndDebt }}</template>-->
+<!--          </el-descriptions-item>-->
+<!--        </el-descriptions>-->
+<!--      </el-col>-->
+<!--    </el-row>-->
+  </div>
+
+</template>
+<script>
+import dictMixins from '@/mixins/dictMixins';
+import { pricingWayList } from '@/enum/dict';
+
+export default {
+  mixins: [dictMixins],
+  components: {},
+  props: ['datasource', 'dialogType', 'dataForm'],
+  computed: {
+    getColumns() {
+      return (item, type)=>{
+        console.log(this.dataForm)
+        let basicFields = [
+          {
+            width: 60,
+            label: '序号',
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            minWidth: 130,
+            prop: 'statementSubOrderNo',
+            label: type == 'deliveryProducts'?'发货单编码':'退货单编码',
+            align: 'center',
+            slot: 'statementSubOrderNo',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 130,
+            prop: 'productOperateTime',
+            label: type == 'deliveryProducts'?'发货日期':'退货日期',
+            align: 'center',
+            slot: 'productOperateTime',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'productCode',
+            label: '产品编码',
+            slot: 'productCode',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 140,
+            prop: 'productName',
+            label: '产品名称',
+            slot: 'productName',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          // {
+          //   minWidth: 140,
+          //   prop: 'subType',
+          //   label: '退货产品类型',
+          //   slot: 'subType',
+          //   align: 'center',
+          //   show:j.subType==11,
+          //   showOverflowTooltip: true,formatter(_row, _column, cellValue){
+          //     return cellValue==12?'实物赔偿':'原货'
+          //   }
+          // },
+          
+          {
+            minWidth: 100,
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            slot: 'specification',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            slot: 'modelType',
+            showOverflowTooltip: true
+          },
+          // {
+          //   prop: 'provenance',
+          //   label: '产地',
+          //   slot: 'provenance',
+          //   align: 'center',
+          //   // show:this.contractBookType==2,
+          //   minWidth: 200,
+          //   showOverflowTooltip: true,
+          //   formatter: (row, column) => {
+       
+          //     return row.provenance && row.provenance.length
+          //       ? row.provenance
+          //           .map((item) => this.getDictValue('产地', item ))
+          //           .join(',')
+          //       : '';
+          //   }
+          // },
+          {
+            minWidth: 100,
+            prop: 'pricingWay',
+            label: '计价方式',
+            align: 'center',
+            slot: 'pricingWay',
+            showOverflowTooltip: true,
+            formatter: (_row, _column, cellValue) => {
+              let pricingWay = pricingWayList.find(item => item.id == cellValue)
+              return pricingWay ? pricingWay.name : ''
+            }
+          },
+          {
+            minWidth: 100,
+            prop: 'totalCount',
+            label: '数量',
+            align: 'center',
+            slot: 'totalCount'
+          },
+          {
+            minWidth: 120,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            align: 'center',
+            slot: 'measuringUnit'
+          },
+          {
+            width: 100,
+            prop: 'receiveTotalWeight',
+            label: '收货总重',
+            slot: 'receiveTotalWeight',
+            align: "center"
+          },
+          {
+            width: 100,
+            prop: 'sendTotalWeight',
+            label: '发货总重',
+            slot: 'sendTotalWeight',
+            align: "center",
+            headerSlot: 'headerTotalCount'
+          },
+
+          {
+            width: 100,
+            prop: 'increaseTotalWeight',
+            label: '增重重量',
+            slot: 'increaseTotalWeight',
+            align: "center"
+          },
+          {
+            width: 100,
+            prop: 'weightUnit',
+            label: '重量单位',
+            slot: 'weightUnit',
+            align: "center"
+          },
+          {
+            minWidth: 90,
+            prop: 'singlePrice',
+            label: '单价',
+            align: 'center',
+            slot: 'singlePrice',
+          },
+          {
+            minWidth: 100,
+            prop: 'taxRate',
+            label: '税率',
+            align: 'center',
+          },
+          {
+            width: 150,
+            prop: 'noTaxSinglePrice',
+            label: '不含税单价',
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'totalPrice',
+            label: '合计',
+            slot: 'totalPrice',
+            align: 'center',
+          },
+          {
+            minWidth: 100,
+            prop: 'discountRatio',
+            label: '折让比例',
+            align: 'center',
+          },
+          {
+            minWidth: 100,
+            prop: 'discountSinglePrice',
+            label: '折让单价',
+            align: 'center',
+          },
+          {
+            minWidth: 120,
+            prop: 'discountTotalPrice',
+            label: '折让合计',
+            slot: 'discountTotalPrice',
+            align: 'center',
+          },
+    
+
+        ]
+        let permissionType = {
+          // 'financeLeader': [
+          //   {
+          //     minWidth: 130,
+          //     prop: 'receivedPrice',
+          //     label: '已收款金额',
+          //     align: 'center',
+          //     slot: 'receivedPrice',
+          //     headerSlot: 'headerReceivedPrice'
+          //   },
+          //   {
+          //     minWidth: 130,
+          //     prop: 'receivablePrice',
+          //     label: '应收款金额',
+          //     align: 'center',
+          //     slot: 'receivablePrice',
+          //   },
+          //   {
+          //     minWidth: 140,
+          //     prop: 'receivableDate',
+          //     label: '应收款日期',
+          //     align: 'center',
+          //     slot: 'receivableDate',
+          //     headerSlot: 'headerReceivableDate'
+          //   },
+          //   {
+          //     minWidth: 130,
+          //     prop: 'invoicedPrice',
+          //     label: '已开票金额',
+          //     align: 'center',
+          //     slot: 'invoicedPrice',
+          //     headerSlot: 'headerInvoicedPrice'
+          //   },
+          //   {
+          //     minWidth: 130,
+          //     prop: 'notInvoicedPrice',
+          //     label: '未开票金额',
+          //     align: 'center',
+          //     slot: 'notInvoicedPrice'
+          //   },
+          // ],
+          // 'leader': [
+          //   {
+          //     minWidth: 130,
+          //     prop: 'receivedPrice',
+          //     label: '已收款金额',
+          //     align: 'center',
+          //     slot: 'receivedPrice'
+          //   },
+          //   {
+          //     minWidth: 130,
+          //     prop: 'receivablePrice',
+          //     label: '应收款金额',
+          //     align: 'center',
+          //     slot: 'receivablePrice'
+          //   },
+          //   {
+          //     minWidth: 140,
+          //     prop: 'receivableDate',
+          //     label: '应收款日期',
+          //     align: 'center',
+          //     slot: 'receivableDate'
+          //   },
+          //   {
+          //     minWidth: 130,
+          //     prop: 'invoicedPrice',
+          //     label: '已开票金额',
+          //     align: 'center',
+          //     slot: 'invoicedPrice'
+          //   },
+          //   {
+          //     minWidth: 130,
+          //     prop: 'notInvoicedPrice',
+          //     label: '未开票金额',
+          //     align: 'center',
+          //     slot: 'notInvoicedPrice'
+          //   },
+          // ],
+          // 'uploadReceipt': [
+          //   {
+          //     minWidth: 130,
+          //     prop: 'receivedPrice',
+          //     label: '已收款金额',
+          //     align: 'center',
+          //     slot: 'receivedPrice'
+          //   },
+          //   {
+          //     minWidth: 130,
+          //     prop: 'receivablePrice',
+          //     label: '应收款金额',
+          //     align: 'center',
+          //     slot: 'receivablePrice'
+          //   },
+          //   {
+          //     minWidth: 140,
+          //     prop: 'receivableDate',
+          //     label: '应收款日期',
+          //     align: 'center',
+          //     slot: 'receivableDate'
+          //   },
+          //   {
+          //     minWidth: 130,
+          //     prop: 'invoicedPrice',
+          //     label: '已开票金额',
+          //     align: 'center',
+          //     slot: 'invoicedPrice'
+          //   },
+          //   {
+          //     minWidth: 130,
+          //     prop: 'notInvoicedPrice',
+          //     label: '未开票金额',
+          //     align: 'center',
+          //     slot: 'notInvoicedPrice'
+          //   },
+          // ],
+        }
+        permissionType[this.taskDefinitionKey] && basicFields.push(...permissionType[this.taskDefinitionKey])
+        return basicFields
+      }
+    },
+    getTitle(){
+        return (item, type)=>{
+        //   let title=this.subTypeList[j.subType]+(j.statementSubOrderCode||'')+' '
+        //   if(j.subType==11&&j.subExecType){
+        //          if(j.subExecType=='10'){
+        //           title=title+' 退货方式:全部原货 '
+        //          }
+        //          if(j.subExecType=='20'){
+        //           title=title+' 退货方式:部分原货+实物赔偿'
+        //          }
+        //          if(j.subExecType=='30'){
+        //           title=title+' 退货方式:部分原货+现金赔偿 '+' 赔偿金额:'+j.amountPayablePrice
+        //          }
+        //          if(j.subExecType=='40'){
+        //           title=title+' 退货方式:全部实物赔偿'
+        //          }
+        //          if(j.subExecType=='50'){
+        //           title=title+' 退货方式:全部现金赔偿  '+' 赔偿金额:'+j.amountPayablePrice
+        //          }
+        //   }
+        console.log(item[type])
+          const total = item[type]?.reduce((prev, curr) => {
+            console.log(curr.discountTotalPrice)
+            return prev + Number(curr.discountTotalPrice || 0) + '元';
+          }, 0);
+          return `对账金额合计:${total}`
+        }
+      },
+  },
+  data() {
+    return {
+      activeNames: [],
+      rules: {},
+      form: {},
+      subTypeList:{
+        10:'发货单:',
+        11:'退货单:',
+        12:'实物赔偿清单:',
+        30:'调拨单:',
+      },
+      subColumnsTypeList:{
+        10: '发货',
+        11: '退货',
+        30: '调拨'
+      },
+    };
+  },
+  watch: {
+    datasource: {
+      handler(newVal, oldVal) {
+        if (newVal.length > 0) {
+          this.activeNames = newVal.map((item, index) => index);
+          console.log('this.activeNames~~~', this.activeNames)
+        }
+      },
+      deep: true
+    }
+  },
+  created(){
+    this.requestDict('产地');
+  },
+  mounted() {
+    // this.activeNames = this.datasource.map((item, index) => index);
+  },
+  methods: {
+    remove(tableIndex, lineIndex, delType) {
+      let params = {
+        tableIndex,
+        lineIndex,
+        delType
+      }
+      this.$emit('handleRemove', params)
+    },
+    getSummaries(param) {
+      const {columns, data} = param;
+      const sums = [];
+      let fields = ['totalPrice', 'notInvoicedPrice', 'invoicedPrice', 'receivablePrice', 'receivedPrice', 'discountTotalPrice']
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计';
+          return;
+        }
+        const values = fields.includes(column.property) ? data.map(item => Number(item[column.property])) : []
+        if (!values.every(value => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index] = (sums[index]).toFixed(2)
+        } else {
+          sums[index] = '';
+        }
+      });
+
+      return sums;
+    },
+    getSummariesA(table) {
+      return table.reduce((prev, curr) => {
+        return prev + Number(curr.discountTotalPrice || 0)
+      }, 0)
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.collapse-title {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  width: 96%;
+}
+.collapse-title-left {
+    display: flex;
+    /* justify-content: center; */
+    align-items: center;
+    font-size: 16px;
+}
+.collapse-title-index {
+    width: 24px;
+    height: 24px;
+    background: #63a103;
+    display: inline-block;
+    text-align: center;
+    line-height: 24px;
+    border-radius: 50%;
+    color: #fff;
+    margin-right: 10px;
+    font-size: 14px;
+}
+.collapse-title-right {
+  display:grid;
+  grid-auto-flow: column;
+  gap: 18px;
+}
+.headbox {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
+    padding-right: 30px;
+  }
+}
+
+.time-form .el-form-item {
+  margin-bottom: 0 !important;
+}
+
+::v-deep .period {
+  display: flex;
+
+  .borderleftnone {
+    .el-input--medium .el-input__inner {
+      border-top-right-radius: 0;
+      border-bottom-right-radius: 0;
+    }
+  }
+
+  .borderrightnone {
+    .el-input--medium .el-input__inner {
+      border-top-left-radius: 0;
+      border-bottom-left-radius: 0;
+    }
+  }
+
+}
+
+::v-deep .time-form tbody > tr:hover > td {
+  background-color: transparent !important;
+}
+
+::v-deep .time-form .el-table tr {
+  background-color: #ffffff;
+}
+
+.pricebox {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  font-weight: bold;
+}
+
+::v-deep.el-divider {
+  margin: 10px;
+  font-weight: bold;
+}
+
+</style>

+ 257 - 0
src/views/warehouseManagement/inventoryAllocation/accountstatement/orderListDialog.vue

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

+ 230 - 0
src/views/warehouseManagement/inventoryAllocation/accountstatement/parentList.vue

@@ -0,0 +1,230 @@
+<template>
+  <ele-modal
+    title="选择客户"
+    custom-class="ele-dialog-form long-dialog-form"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    top="5vh"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+    :maxable="true"
+  >
+    <el-card shadow="never">
+      <contact-search @search="reload"></contact-search>
+
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div class="ele-border-lighter split-layout-right-content">
+          <AssetTree
+            @handleNodeClick="handleNodeClick"
+            id="17"
+            :isFirstRefreshTable="false"
+            ref="treeList"
+          />
+        </div>
+        <!-- 表格 -->
+        <template v-slot:content>
+          <ele-pro-table
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            row-key="id"
+            height="calc(100vh - 460px)"
+            class="dict-table"
+            @cell-click="cellClick"
+          >
+            <!-- 表头工具栏 -->
+            <template v-slot:action="{ row }">
+              <el-radio class="radio" v-model="radio" :label="row.id"
+                ><i></i
+              ></el-radio>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+
+    <div slot="footer">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { contactPageUsages } from '@/api/saleManage/contact';
+  import ContactSearch from './components/contactSearch.vue';
+  import AssetTree from '@/components/AssetTree';
+
+  export default {
+    components: {
+      ContactSearch,
+      AssetTree
+    },
+    props: {
+      classType: {
+        type: Number | String,
+        default: 1
+      }
+    },
+    data() {
+      return {
+        visible: false,
+
+        columns: [
+          {
+            action: 'action',
+            slot: 'action',
+            align: 'center',
+            label: '选择'
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '客户编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'name',
+            label: '客户名称',
+            align: 'center',
+            slot: 'name',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'serialNo',
+            label: '客户代号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'phone',
+            label: '客户电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'addressName',
+            label: '单位地址',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: (_row, _column, cellValue) => {
+              let addr =
+                '' + _row.addressName
+                  ? _row.addressName.replaceAll(',', '')
+                  : '';
+              addr += _row.address ? _row.address : '';
+              return addr;
+            }
+          },
+          {
+            prop: 'linkName',
+            label: '联系人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'linkPhone',
+            label: '联系人电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return _row.status === 1 ? '启用' : '禁用';
+            }
+          },
+
+          {
+            prop: 'remark',
+            label: '备注',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          }
+        ],
+
+        radio: null
+      };
+    },
+
+    watch: {},
+    methods: {
+      open(item) {
+        if (item) {
+          this.radio = item.id;
+        }
+        this.visible = true;
+      },
+
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return contactPageUsages({
+          pageNum: page,
+          size: limit,
+          type: this.classType,
+          ...where,
+          status: '1',
+          assignStatus:0
+        });
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
+
+      handleNodeClick(data, node) {
+        this.curNodeData = data;
+        this.reload({ categoryId: data.id });
+      },
+
+      // 单击获取id
+      cellClick(row) {
+        this.current = row;
+        this.radio = row.id;
+      },
+      handleClose() {
+        this.visible = false;
+        this.current = null;
+        this.radio = '';
+      },
+
+      selected() {
+        if (!this.current) {
+          return this.$message.warning('请选择客户');
+        }
+        this.$emit('changeParent', this.current);
+        this.handleClose();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 218 - 0
src/views/warehouseManagement/inventoryAllocation/accountstatement/product-list.vue

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

+ 192 - 0
src/views/warehouseManagement/inventoryAllocation/accountstatement/recorpayTableList.vue

@@ -0,0 +1,192 @@
+<template>
+  <div>
+    <div v-for="item in recorpayList" style="margin-bottom: 10px">
+      <div>
+        <div style="margin-bottom: 10px; font-weight: bold">
+          <div>
+            <el-divider direction="vertical"></el-divider>
+            <span>{{ item.accType == 1 ? '已付' : '已收' }}:</span>
+            <span>{{ item.code }}</span>
+            <el-divider direction="vertical"></el-divider>
+            <!-- <span>计价方式:</span>
+            <span> {{ item.pricingWay == 1 ? '按数量计费' : '按重量计费' }}</span> -->
+            <!-- <el-divider direction="vertical"></el-divider> -->
+            <span>总金额:</span>
+            <span>{{ item.totalAmount }}</span>
+          </div>
+        </div>
+        <ele-pro-table
+          ref="table"
+          row-key="id"
+          :needPage="false"
+          :columns="getColumns()"
+          max-height="500px"
+          style="margin-bottom: 10px"
+          :toolkit="[]"
+          :datasource="getObj(item)"
+          cache-key="systemRoleTable17-11121"
+          class="time-form"
+        >
+        </ele-pro-table>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  export default {
+    components: {},
+    props: ['recorpayList', 'dialogType', 'dataForm'],
+    computed: {
+      getObj(){
+        return (j) => {
+          return this.recorpayList.filter(item=>item.code==j.code)
+        }
+      },
+      getColumns() {
+        return (j) => {
+          let basicFields = [
+            {
+              width: 60,
+              label: '序号',
+              type: 'index',
+              columnKey: 'index',
+              align: 'center'
+            },
+            {
+              minWidth: 130,
+              prop: 'contactName',
+              label:'单位名称',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              minWidth: 120,
+              prop: 'sourceType',
+              label: '来源类型',
+              formatter(_row, _column, cellValue) {
+                return cellValue == 2 ? '合同' : cellValue == 3? '订单' : '';
+      
+              },
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              minWidth: 140,
+              prop: 'sourceName',
+              label: '来源名称',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              minWidth: 140,
+              prop: 'sourceCode',
+              label: '来源编码',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              minWidth: 140,
+              prop: 'invoiceCode’',
+              label: '发票编码',
+              align: 'center',
+              showOverflowTooltip: true,
+
+            },
+
+            {
+              minWidth: 100,
+              prop: 'execDate',
+              label: '费用发生日期',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+
+            {
+              minWidth: 120,
+              prop: 'totalAmount',
+              label: '合计金额',
+              align: 'center',
+            },
+            {
+              minWidth: 120,
+              prop: 'remark',
+              label: '备注',
+              slot: 'totalPrice',
+              align: 'center',
+            },
+          ];
+      
+
+          return basicFields;
+        };
+      },
+
+    },
+    data() {
+      return {
+        rules: {},
+        form: {},
+
+      };
+    },
+    methods: {
+     
+
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .headbox {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      padding-right: 30px;
+    }
+  }
+
+  .time-form .el-form-item {
+    margin-bottom: 0 !important;
+  }
+
+  ::v-deep .period {
+    display: flex;
+
+    .borderleftnone {
+      .el-input--medium .el-input__inner {
+        border-top-right-radius: 0;
+        border-bottom-right-radius: 0;
+      }
+    }
+
+    .borderrightnone {
+      .el-input--medium .el-input__inner {
+        border-top-left-radius: 0;
+        border-bottom-left-radius: 0;
+      }
+    }
+  }
+
+  ::v-deep .time-form tbody > tr:hover > td {
+    background-color: transparent !important;
+  }
+
+  ::v-deep .time-form .el-table tr {
+    background-color: #ffffff;
+  }
+
+  .pricebox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    font-weight: bold;
+  }
+
+  ::v-deep.el-divider {
+    margin: 10px;
+    font-weight: bold;
+  }
+</style>

+ 464 - 0
src/views/warehouseManagement/inventoryAllocation/accountstatement/saleForm.vue

@@ -0,0 +1,464 @@
+<template>
+  <el-form ref="form" :model="dataForm" :rules="rules" label-width="120px">
+    <headerTitle title="对账单信息"></headerTitle>
+    <el-row>
+      <el-col :span="8">
+        <el-form-item label="来源类型" prop="sourceType">
+          <el-select
+            :disabled="dialogType == 'view' || !!saleOrderData?.id"
+            clearable
+            class="ele-block"
+            v-model="dataForm.sourceType"
+            @change="handleChange"
+            placeholder="请选择"
+          >
+            <el-option label="客户" :value="1" />
+            <!--            <el-option label="项目" :value="2"/>-->
+            <el-option label="合同" :value="4" />
+
+            <el-option label="销售订单" :value="3" />
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8">
+        <el-form-item
+          label="选择客户"
+          prop="contactId"
+          v-if="dataForm.sourceType == 1"
+        >
+          <el-input
+            :disabled="dialogType == 'view' || !!contactData?.id"
+            v-model="dataForm.contactName"
+            @click.native="handleGetCus"
+          ></el-input>
+        </el-form-item>
+        <!--        <el-form-item label="选择项目" prop="projectId" v-if="dataForm.sourceType ==2">-->
+        <!--          <el-input :disabled="dialogType=='view'" v-model="dataForm.projectId" @click.native="handleGetOrd"></el-input>-->
+        <!--        </el-form-item>-->
+        <el-form-item
+          label="选择订单"
+          prop="sourceId"
+          v-if="dataForm.sourceType == 3"
+        >
+          <el-input
+          :disabled="dialogType == 'view'"
+            v-model="dataForm.sourceName"
+            @click.native="handleGetOrd"
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          label="选择合同"
+          prop="contractId"
+          v-if="dataForm.sourceType == 4"
+        >
+          <el-input
+            :disabled="dialogType == 'view'"
+            v-model="dataForm.sourceName"
+            @click.native="handleGetContract"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8">
+        <el-form-item label="查询维度" prop="queryDimension">
+          <el-select
+            :disabled="dialogType == 'view' || !!saleOrderData?.id"
+            clearable
+            class="ele-block"
+            v-model="dataForm.queryDimension"
+            placeholder="请选择"
+          >
+            <el-option label="按发货单" :value="1" />
+            <el-option label="按调拨单" :value="2" />
+            <el-option label="按收货单" :value="3" />
+          </el-select>
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row>
+      <el-col :span="8">
+        <el-form-item label="查询方式" prop="dateType">
+          <el-select
+            disabled
+            clearable
+            class="ele-block"
+            v-model="dataForm.dateType"
+            @change="reloadTableData"
+            placeholder="请选择"
+          >
+            <el-option label="按年度" :value="1" />
+            <el-option label="按季度" :value="2" />
+            <el-option label="按月度" :value="3" />
+            <el-option label="按时间段" :value="4" />
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="![2].includes(dataForm.dateType)">
+        <el-form-item
+          label="选择年度"
+          prop="year"
+          v-if="[1].includes(dataForm.dateType)"
+        >
+          <el-date-picker
+            :disabled="dialogType == 'view'"
+            v-model="dataForm.year"
+            value-format="yyyy"
+            type="year"
+            style="width: 100%"
+            @change="reloadTableData"
+            placeholder="选择年"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item
+          label="选择月度"
+          prop="month"
+          v-if="[3].includes(dataForm.dateType)"
+        >
+          <el-date-picker
+            :disabled="dialogType == 'view'"
+            v-model="dataForm.month"
+            value-format="yyyy-MM"
+            type="month"
+            @change="reloadTableData"
+            style="width: 100%"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item
+          label="选择时间段"
+          prop="dateTimeRange"
+          v-if="[4].includes(dataForm.dateType)"
+        >
+          <el-date-picker
+            :key="dataForm.dateType"
+            :disabled="dialogType == 'view'"
+            v-model="dataForm.dateTimeRange"
+            value-format="yyyy-MM-dd"
+            type="daterange"
+            @change="reloadTableData"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            style="width: 100%"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="[2].includes(dataForm.dateType)">
+        <el-form-item
+          label="选择年度"
+          prop="year"
+          v-if="[1, 2].includes(dataForm.dateType)"
+        >
+          <el-date-picker
+            :disabled="dialogType == 'view'"
+            v-model="dataForm.year"
+            value-format="yyyy"
+            type="year"
+            @change="reloadTableData"
+            style="width: 100%"
+            placeholder="选择年"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="[2].includes(dataForm.dateType)">
+        <el-form-item
+          label="选择季度"
+          prop="quarter"
+          v-if="[2].includes(dataForm.dateType)"
+        >
+          <el-select
+            :disabled="dialogType == 'view'"
+            clearable
+            @change="reloadTableData"
+            class="ele-block"
+            v-model="dataForm.quarter"
+            placeholder="请选择"
+          >
+            <el-option label="一季度" value="一季度" />
+            <el-option label="二季度" value="二季度" />
+            <el-option label="三季度" value="三季度" />
+            <el-option label="四季度" value="四季度" />
+          </el-select>
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row>
+      <el-col :span="8">
+        <el-form-item prop="createUserName" label="对账金额">
+          <el-input disabled v-model="accountStatementPrice"></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8">
+        <el-form-item prop="createUserName" label="关联订单编码">
+          <el-input disabled v-model="relatedOrderNumber"></el-input>
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row>
+      <el-col :span="8" v-if="dialogType == 'view'">
+        <el-form-item prop="createUserName" label="对账人">
+          <el-input disabled v-model="dataForm.createUserName"></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="dialogType == 'view'">
+        <el-form-item prop="createTime" label="对账时间">
+          <el-input disabled v-model="dataForm.createTime"></el-input>
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row v-if="dialogType == 'view'">
+      <el-col :span="12">
+        <el-form-item prop="repliedFiles" label="回执附件">
+          <fileMain v-model="dataForm.repliedFiles" type="view"></fileMain>
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row v-if="dialogType !== 'view'">
+      <el-col :span="24">
+        <el-button style="float: right" @click="handleSearch" type="primary"
+          >查询</el-button
+        >
+      </el-col>
+    </el-row>
+
+    <parentList ref="parentRef" @changeParent="getCusInfo"></parentList>
+    <orderListDialog
+      ref="orderListDialogRef"
+      @changeParent="getOrderInfo"
+      :contactData="contactData"
+    ></orderListDialog>
+    <contractListDialog
+      ref="selectContractRef"
+      @changeParent="changeContract"
+      :type="1"
+      :isAdd="true"
+    ></contractListDialog>
+  </el-form>
+</template>
+<script xmlns:el-col="http://www.w3.org/1999/html">
+  import parentList from './parentList.vue';
+  import OrderListDialog from './orderListDialog.vue';
+  import { getFile } from '@/api/system/file';
+  // import fileMain from '@/components/addDoc/index.vue';
+  import contractListDialog from './contractListDialog.vue';
+import { accountStatementExportAPI } from '@/api/saleManage/accountstatement';
+
+  export default {
+    name: 'saleForm',
+    components: { OrderListDialog, parentList, 
+      // fileMain,
+       contractListDialog },
+    //客户管理数据
+    props: {
+      dataForm: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      datasource: {
+        type: Array,
+        default: () => {
+          return [];
+        }
+      },
+      dialogType: '',
+      contactData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      saleOrderData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      // recorpayList: {
+      //   type: Object,
+      //   default: () => {
+      //     return [];
+      //   }
+      // },
+      
+    },
+    data() {
+      return {
+        monthByDays: {},
+        quarterList: {
+          一季度: ['-01-01 00:00:00', '-03-31 23:59:59'],
+          二季度: ['-04-01 00:00:00', '-06-30 23:59:59'],
+          三季度: ['-07-01 00:00:00', '-09-30 23:59:59'],
+          四季度: ['-10-01 00:00:00', '-12-31 23:59:59']
+        },
+        startTime: '-01-01 00:00:00',
+        endTime: '23:59:59',
+        rules: {
+          sourceType: { required: true, message: '请选择', trigger: 'change' },
+          contactId: { required: true, message: '请选择', trigger: 'change' },
+          projectId: { required: true, message: '请选择', trigger: 'change' },
+          orderId: { required: true, message: '请选择', trigger: 'change' },
+          dateType: { required: true, message: '请选择', trigger: 'change' },
+          year: { required: true, message: '请选择', trigger: 'change' },
+          quarter: { required: true, message: '请选择', trigger: 'change' },
+          month: { required: true, message: '请选择', trigger: 'change' },
+          dateTimeRange: {
+            required: true,
+            message: '请选择',
+            trigger: 'change'
+          },
+          sourceId: { required: true, message: '请选择', trigger: 'change' },
+          contractId: { required: true, message: '请选择', trigger: 'change' },
+          queryDimension: { required: true, message: '请选择', trigger: 'change' },
+        }
+      };
+    },
+    computed: {
+      //计算未对账金额
+      accountStatementPrice() {
+        return this.datasource.reduce((pre, cur) => pre + +cur.amountTotalPrice, 0);
+      },
+      //计算相关订单号
+      relatedOrderNumber() {
+        return this.datasource.map((item) => item.orderNo).join(',');
+      }
+    },
+    methods: {
+      //查询
+      handleSearch() {
+        //
+        switch (this.dataForm.dateType) {
+          case 1:
+            this.dataForm.dateValue = this.dataForm.year;
+            this.dataForm.startDate = this.dataForm.year + this.startTime;
+            this.dataForm.endDate = this.dataForm.year + '-12-31 23:59:59';
+            break;
+          case 2:
+            this.dataForm.dateValue =
+              this.dataForm.year + '年-' + this.dataForm.quarter;
+            this.dataForm.startDate =
+              this.dataForm.year + this.quarterList[this.dataForm.quarter][0];
+            this.dataForm.endDate =
+              this.dataForm.year + this.quarterList[this.dataForm.quarter][1];
+            break;
+          case 3:
+            this.dataForm.dateValue = this.dataForm.month;
+            this.dataForm.startDate = this.dataForm.month + '-01 00:00:00';
+            let data = this.dataForm.month.split('-');
+            let days = new Date(data[0], data[1], 0).getDate();
+            this.dataForm.endDate =
+              this.dataForm.month + '-' + days + ' 23:59:59';
+            break;
+          default:
+            this.dataForm.dateValue = '';
+            this.dataForm.startDate =
+              this.dataForm.dateTimeRange[0] + ' 00:00:00';
+            this.dataForm.endDate =
+              this.dataForm.dateTimeRange[1] + ' 23:59:59';
+        }
+        this.$refs.form.validate((validate) => {
+          if (!validate) return;
+          this.$emit('handleSearch', this.dataForm);
+        });
+      },
+      //
+      getDays() {},
+      //获取客户信息
+      handleGetCus() {
+        let item = { id: this.dataForm.contactId };
+        this.$refs.parentRef.open(item);
+      },
+      //选择客户信息回调
+      getCusInfo(obj) {
+        let params = Object.assign({}, this.dataForm, {
+          contactId: obj.id,
+          contactName: obj.name,
+          sourceName: obj.name,
+          sourceId: obj.id
+        });
+        this.$emit('update:dataForm', params);
+        this.reloadTableData();
+      },
+      //获取合同信息
+      handleGetContract() {
+        this.$refs.selectContractRef.open();
+      },
+      changeContract(obj) {
+        let params = Object.assign({}, this.dataForm, {
+          contractId: obj.id,
+          contractName: obj.contractName,
+          sourceId: obj.id,
+          sourceName: obj.contractName,
+          contactId: obj.partaId,
+          contactName: obj.partaName
+        });
+        this.$emit('update:dataForm', params);
+        this.reloadTableData();
+      },
+      //获取订单信息
+      handleGetOrd() {
+        let item = { id: this.dataForm.orderId };
+        this.$refs.orderListDialogRef.open(item);
+      },
+      //选择订单信息回调
+      getOrderInfo(obj) {
+        this.dataForm.sourceType = 3;
+        let params = Object.assign({}, this.dataForm, {
+          orderId: obj.id,
+          orderNo: obj.orderNo,
+          contactId: obj.partaId,
+          contactName: obj.partaName,
+          sourceName: obj.orderNo,
+          sourceId: obj.id
+        });
+        this.$emit('update:dataForm', params);
+        this.reloadTableData();
+      },
+      //切换来源类型重置数据
+      handleChange(val) {
+        let params = Object.assign(
+          {},
+          {
+            ...this.dataForm,
+            orderNo: '',
+            orderId: '',
+            contactId: '',
+            contactName: '',
+            sourceName: '',
+            sourceId: '',
+            amountPayablePrice: '',
+            amountReceivablePrice: '',
+            amountTotalPrice: '',
+            amountPayablePass: '',
+            amountReceivablePass: ''
+          }
+        );
+
+        this.$emit('update:dataForm', params);
+        this.reloadTableData();
+        if (val == 1 && this.contactData.id) {
+          this.getCusInfo(this.contactData);
+        }
+      },
+      reloadTableData() {
+        this.$emit('update:datasource', []);
+        // this.$emit('update:recorpayList', []);
+      },
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      }
+    },
+    mounted() {
+      // const year = new Date().getFullYear(); // 获取当前年份
+      // for (let i = 0; i < 12; i++) {
+      //   // 获取指定月份的天数
+      //   this.monthByDays[i + 1] = new Date(year, i + 1, 0).getDate()
+      // }
+    }
+  };
+</script>
+
+<style scoped lang="scss"></style>

+ 20 - 1
src/views/warehouseManagement/inventoryAllocation/index.vue

@@ -22,6 +22,9 @@
           <el-button v-if="$hasPermission('wms:inventoryAllocation:print2')" :disabled="selection.length > 1" icon="el-icon-download" type="primary"  @click="printExl2"
             >打印送货单带车</el-button
           >
+          <el-button v-if="$hasPermission('wms:inventoryAllocation:statement')" type="primary"  @click="handleAddOrEditAccount('add')"
+            >生成对账单</el-button
+          >
         </template>
         <!-- 单号链接 -->
         <template v-slot:allotCode="{ row }">
@@ -71,6 +74,12 @@
     <!-- 打印弹窗 -->
     <printTemplateBs :groupName="groupName" ref="printTemplateBsRef"></printTemplateBs>
     <printTemplateBsCar :groupName="groupName" ref="printTemplateBsCarRef"></printTemplateBsCar>
+    <add-account-dialog
+      v-if="addAccountDialogFlag"
+      :addAccountDialogFlag.sync="addAccountDialogFlag"
+      ref="accountDialogRef"
+      @done="reload"
+    ></add-account-dialog>
   </div>
 </template>
 
@@ -82,15 +91,18 @@
   import printTemplateBsCar from './components/print-template-bs-car.vue';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import { pageRoles } from '@/api/system/role';
-import { enterprisePage } from '@/api/bpm/index.js';
+  import { enterprisePage } from '@/api/bpm/index.js';
+  import addAccountDialog from './accountstatement/addAccountDialog.vue';
   export default {
     components: {
+      addAccountDialog,
       InventorySearch,
       printTemplateBs,
       printTemplateBsCar 
     },
     data() {
       return {
+        addAccountDialogFlag: false,
         allocationType,
         groupName: '',
         stutusOptions: {
@@ -215,6 +227,13 @@ import { enterprisePage } from '@/api/bpm/index.js';
       this.getCompanyInfo();
     },
     methods: {
+      //新增编辑
+      handleAddOrEditAccount(type, row) {
+        this.addAccountDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.accountDialogRef.open(type, row, '1');
+        });
+      },
       getCompanyInfo() {
         enterprisePage({
           pageNum: 1,

+ 7 - 2
src/views/warehouseManagement/stockManagement/add.vue

@@ -181,6 +181,9 @@
                   >批量选择仓库</el-button
                 >
               </template>
+              <template v-slot:headerBatchNo="{ column }">
+                <span class="is-required">{{ column.label }}11</span>
+              </template>
               <template v-slot:batchNo="{ row, $index }">
                 <template v-if="row.isSave">
                   {{ row.batchNo }}
@@ -1115,7 +1118,8 @@
             prop: 'batchNo',
             width: 200,
             slot: 'batchNo',
-            align: 'center'
+            align: 'center',
+            headerSlot: 'headerBatchNo',
           },
           {
             label: '数量',
@@ -1123,7 +1127,8 @@
             prop: 'packingQuantity',
             slot: 'packingQuantity',
             width: 180,
-            align: 'center'
+            align: 'center',
+            headerSlot: 'headerPackingQuantity',
           },
           {
             label: '单位',