Просмотр исходного кода

采购、销售对账单流程(重做版)

Z 2 лет назад
Родитель
Сommit
9d2e9b2119
16 измененных файлов с 2053 добавлено и 429 удалено
  1. 3 3
      src/api/bpm/components/saleManage/saleorder.js
  2. 74 0
      src/views/bpm/handleTask/components/purchaseOrder/accountstatement/addAccountDialog.vue
  3. 99 0
      src/views/bpm/handleTask/components/purchaseOrder/accountstatement/contactSearch.vue
  4. 517 0
      src/views/bpm/handleTask/components/purchaseOrder/accountstatement/inventoryTable.vue
  5. 248 0
      src/views/bpm/handleTask/components/purchaseOrder/accountstatement/orderListDialog.vue
  6. 192 0
      src/views/bpm/handleTask/components/purchaseOrder/accountstatement/page.vue
  7. 3 31
      src/views/bpm/handleTask/components/purchaseOrder/accountstatement/purchaseForm.vue
  8. 148 0
      src/views/bpm/handleTask/components/purchaseOrder/accountstatement/searchTable.vue
  9. 159 0
      src/views/bpm/handleTask/components/purchaseOrder/accountstatement/submit.vue
  10. 0 8
      src/views/bpm/handleTask/components/purchaseOrder/accountstatement/supplierList.vue
  11. 185 198
      src/views/bpm/handleTask/components/saleOrder/accountstatement/customerListDialog.vue
  12. 382 109
      src/views/bpm/handleTask/components/saleOrder/accountstatement/inventoryTable.vue
  13. 41 47
      src/views/bpm/handleTask/components/saleOrder/accountstatement/page.vue
  14. 2 30
      src/views/bpm/handleTask/components/saleOrder/accountstatement/saleForm.vue
  15. 0 1
      src/views/bpm/handleTask/components/saleOrder/accountstatement/submit.vue
  16. 0 2
      src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrder.vue

+ 3 - 3
src/api/bpm/components/saleManage/saleorder.js

@@ -253,8 +253,8 @@ export async function approveTaskWithVariablesAPI(data) {
 /**
  * 对账单 查询待导入的账单明细
  */
-export async function getSearchDetailListByTypeAPI(data) {
-  const res = await request.post(`/eom/accountstatement/searchDetailListByType`, data);
+export async function getSearchMergeListByTypeAPI(data) {
+  const res = await request.post(`/eom/accountstatement/searchMergeListByType`, data);
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -303,7 +303,7 @@ export async function updateAccountReceiptAPI(data) {
 }
 
 /**
- * 对账单 修改
+ * 对账单 详情
  */
 export async function infoAccountStatementAPI(id) {
   const res = await request.get(`/eom/accountstatement/getById/${id}`);

+ 74 - 0
src/views/bpm/handleTask/components/purchaseOrder/accountstatement/addAccountDialog.vue

@@ -0,0 +1,74 @@
+<template>
+  <div>
+    <component :is="componentsName"
+               ref="componentRef"
+               :taskDefinitionKey="taskDefinitionKey"
+               :businessId="businessId"
+               :permissionType="permissionType"/>
+  </div>
+
+</template>
+
+
+<script>
+
+
+export default {
+  name: "addAccountDialog",
+  props: {
+    taskDefinitionKey: {
+      type: String,
+      default: 'starter',
+    },
+    businessId: {
+      type: String,
+      default: ''
+    }
+  },
+  components: {
+    page: () => import('./page.vue')
+  },
+
+  data() {
+    return {
+      dialogType: 'add',
+      componentsName: 'page',
+      tabOptions: [
+        {key: 'starter', permissionType: 'update', name: '发起人申请'},
+        {key: 'deptLeader', permissionType: 'view', name: '销售主管审批'},
+        {key: 'financeLeader', permissionType: 'view', name: '财务主管审核'},
+        {key: 'leader', permissionType: 'view', name: '分管副总审批'},
+        {key: 'uploadReceipt', permissionType: 'view', name: '上传回执'},
+      ],
+      permissionType: '',
+    }
+  },
+  computed: {},
+  created() {
+    this.permissionType = this.tabOptions.find(item => item.key == this.taskDefinitionKey).permissionType
+
+  },
+  mounted() {
+
+  },
+  methods: {
+    getTableValue() {
+      return this.$refs.componentRef.getTableValue()
+    },
+  }
+}
+</script>
+<style scoped lang="scss">
+
+</style>
+
+
+
+
+
+
+
+
+
+
+

+ 99 - 0
src/views/bpm/handleTask/components/purchaseOrder/accountstatement/contactSearch.vue

@@ -0,0 +1,99 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="100px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="编码/代号:" prop="codeOrSerialNo">
+          <el-input
+            clearable
+            v-model="params.codeOrSerialNo"
+            placeholder="请输入"
+            maxlength="50"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="客户名称:" prop="name">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="params.name"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="是否启用:" prop="codeOrSerialNo">
+          <el-select v-model="params.status" placeholder="请选择" class="w100" clearable>
+            <el-option
+              v-for="item in statusList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset">重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+<script>
+  export default {
+    data () {
+      // 默认表单数据
+      const defaultParams = {
+        type: 1,
+        name: '',
+        codeOrSerialNo: '',
+        status: ''
+      };
+      return {
+        defaultParams,
+        // 表单数据
+        params: { ...defaultParams },
+        // 状态数据源
+        statusList: [
+          {value: 1, label: "启用"},
+          {value: 2, label: "禁用"}
+        ],
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive () {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search () {
+        console.log(this.current);
+        this.$emit('search', {
+          ...this.params
+        });
+      },
+      /*  重置 */
+      reset () {
+        this.params = { ...this.defaultParams };
+        this.search();
+      }
+    }
+  };
+</script>

+ 517 - 0
src/views/bpm/handleTask/components/purchaseOrder/accountstatement/inventoryTable.vue

@@ -0,0 +1,517 @@
+<template>
+  <el-form ref="form" :model="form" :rules="{}">
+    <ele-pro-table show-summary :summary-method="getSummaries" ref="table" row-key="id" :needPage="false"
+                   :columns="columns" max-height="500px" :toolkit="[]" :datasource="form.datasource"
+                   cache-key="systemRoleTable17-1111" 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:productCode="{ row,$index }">
+        <el-popover
+          placement="right"
+          width="80%"
+          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.productCode }}</el-button>
+        </el-popover>
+      </template>
+      <template v-if="taskDefinitionKey=='financeLeader'" v-slot:paidPrice="{row,$index}">
+        <el-form-item
+          :prop="'datasource.'+$index+'.paidPrice'"
+          :rules="{required:true,trigger:'change',message:'请选择'}">
+          <el-input-number :controls="false"
+                           style="width: 100%"
+                           v-model="row.paidPrice"
+                           :precision="2"
+                           @blur="(val)=>handleEditCost(row,'paidPrice','notPaidPrice')"
+                           :max="row.totalPrice"></el-input-number>
+        </el-form-item>
+
+      </template>
+      <template v-if="taskDefinitionKey=='financeLeader'" v-slot:paidDate="{row,$index}">
+        <el-form-item
+          :prop="'datasource.'+$index+'.paidDate'"
+          :rules="{required:true,trigger:'change',message:'请选择'}">
+          <el-date-picker
+            type="date"
+            style="width: 100%"
+            v-model="row.paidDate"
+            value-format="yyyy-MM-dd"
+            placeholder="选择日期">
+          </el-date-picker>
+        </el-form-item>
+
+
+      </template>
+      <template v-if="taskDefinitionKey=='financeLeader'" v-slot:invoicedPrice="{row,$index}">
+        <el-form-item
+          :prop="'datasource.'+$index+'.invoicedPrice'"
+          :rules="{required:true,trigger:'change',message:'请选择'}">
+          <el-input-number :controls="false"
+                           style="width: 100%"
+                           v-model="row.invoicedPrice"
+                           :precision="2"
+                           @blur="(val)=>handleEditCost(row,'invoicedPrice','notInvoicedPrice')"
+                           :max="row.totalPrice"></el-input-number>
+        </el-form-item>
+      </template>
+      <template v-slot:headerReceivedPrice="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerpaidDate="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerInvoicedPrice="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+    </ele-pro-table>
+
+    <el-row 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="未付款总金额" >{{ priceObj.amountNotPaidPrice }}</el-descriptions-item>
+          <el-descriptions-item label="未开票总金额">
+            <template>{{ priceObj.amountNotInvoicedPrice }}</template>
+          </el-descriptions-item>
+        </el-descriptions>
+      </el-col>
+    </el-row>
+
+  </el-form>
+
+</template>
+<script>
+
+export default {
+  components: {},
+  props: ['datasource', 'dialogType', 'taskDefinitionKey', 'priceObj'],
+  computed: {
+    columns() {
+      let basicFields = [
+        {
+          width: 60,
+          label: '序号',
+          type: 'index',
+          columnKey: 'index',
+          align: 'center',
+        },
+        {
+          minWidth: 130,
+          prop: 'contractNo',
+          label: '合同编号',
+          align: 'center',
+          slot: 'contractNo',
+
+        },
+        {
+          minWidth: 120,
+          prop: 'orderNo',
+          label: '采购订单编码',
+          slot: 'orderNo',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 140,
+          prop: 'productName',
+          label: '产品名称',
+          slot: 'productName',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 100,
+          prop: 'specification',
+          label: '规格',
+          align: 'center',
+          slot: 'specification',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 100,
+          prop: 'modelType',
+          label: '型号',
+          align: 'center',
+          slot: 'modelType',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 130,
+          prop: 'contractTotalCount',
+          label: '合同总数量',
+          align: 'center',
+          slot: 'contractTotalCount'
+        },
+        {
+          minWidth: 100,
+          prop: 'singlePrice',
+          label: '单价',
+          align: 'center',
+          slot: 'singlePrice'
+        },
+        {
+          minWidth: 130,
+          prop: 'contractTotalPrice',
+          label: '合同总金额',
+          align: 'center',
+          slot: 'contractTotalPrice'
+        },
+        {
+          minWidth: 140,
+          prop: 'receiveGoodsDate',
+          label: '收货日期',
+          align: 'center',
+          slot: 'receiveGoodsDate',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 120,
+          prop: 'totalCount',
+          label: '已收货数量',
+          align: 'center',
+          slot: 'totalCount'
+        },
+        {
+          minWidth: 130,
+          prop: 'totalPrice',
+          label: '已收货金额',
+          align: 'center',
+          slot: 'totalPrice'
+        },
+      ]
+      let permissionType = {
+        'financeLeader': [
+          {
+            minWidth: 140,
+            prop: 'paidDate',
+            label: '付款日期',
+            align: 'center',
+            slot: 'paidDate',
+            showOverflowTooltip: true,
+            headerSlot:'headerPaidDate'
+          },
+          {
+            minWidth: 130,
+            prop: 'paidPrice',
+            label: '已付款金额',
+            align: 'center',
+            slot: 'paidPrice'
+          },
+          {
+            minWidth: 130,
+            prop: 'notPaidPrice',
+            label: '应付款金额',
+            align: 'center',
+            slot: 'notPaidPrice'
+          },
+          {
+            minWidth: 130,
+            prop: 'invoicedPrice',
+            label: '已开票金额',
+            align: 'center',
+            slot: 'invoicedPrice'
+          },
+          {
+            minWidth: 130,
+            prop: 'notInvoicedPrice',
+            label: '未开票金额',
+            align: 'center',
+            slot: 'notInvoicedPrice'
+          },
+        ],
+        'leader': [
+          {
+            minWidth: 140,
+            prop: 'paidDate',
+            label: '付款日期',
+            align: 'center',
+            slot: 'paidDate',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 130,
+            prop: 'paidPrice',
+            label: '已付款金额',
+            align: 'center',
+            slot: 'paidPrice'
+          },
+          {
+            minWidth: 130,
+            prop: 'notPaidPrice',
+            label: '应付款金额',
+            align: 'center',
+            slot: 'notPaidPrice'
+          },
+          {
+            minWidth: 130,
+            prop: 'invoicedPrice',
+            label: '已开票金额',
+            align: 'center',
+            slot: 'invoicedPrice'
+          },
+          {
+            minWidth: 130,
+            prop: 'notInvoicedPrice',
+            label: '未开票金额',
+            align: 'center',
+            slot: 'notInvoicedPrice'
+          },
+        ],
+        'uploadReceipt': [
+          {
+            minWidth: 140,
+            prop: 'paidDate',
+            label: '付款日期',
+            align: 'center',
+            slot: 'paidDate',
+            showOverflowTooltip: true,
+          },
+          {
+            minWidth: 130,
+            prop: 'paidPrice',
+            label: '已付款金额',
+            align: 'center',
+            slot: 'paidPrice'
+          },
+          {
+            minWidth: 130,
+            prop: 'notPaidPrice',
+            label: '应付款金额',
+            align: 'center',
+            slot: 'notPaidPrice'
+          },
+          {
+            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
+    },
+  },
+  data() {
+    return {
+      rules: {},
+      form: {
+        datasource: []
+      },
+      childrenColumns: [
+        {
+          minWidth: 120,
+          prop: 'orderNo',
+          label: '单据编码',
+          align: 'center',
+          slot: 'orderNo'
+        },
+        {
+          minWidth: 120,
+          prop: 'orderType',
+          label: '单据类型',
+          slot: 'orderType',
+          align: 'center',
+          formatter: (_row, _column, cellValue) => {
+            return _row.orderType === 1 ? '销售发货' : _row.orderType === 2 ? '销售退货' : ""
+          }
+        },
+        {
+          minWidth: 140,
+          prop: 'productName',
+          label: '产品名称',
+          align: 'center',
+          slot: 'productName',
+        },
+        {
+          minWidth: 100,
+          prop: 'productCode',
+          label: '编码',
+          align: 'center',
+          slot: 'productCode'
+        },
+        {
+          minWidth: 100,
+          prop: 'productBrand',
+          label: '牌号',
+          align: 'center',
+          slot: 'productBrand'
+        },
+        {
+          minWidth: 100,
+          prop: 'modelType',
+          label: '型号',
+          align: 'center',
+          slot: 'modelType'
+        },
+        {
+          minWidth: 100,
+          prop: 'specification',
+          label: '规格',
+          align: 'center',
+          slot: 'specification'
+        },
+        {
+          minWidth: 100,
+          prop: 'totalCount',
+          label: '数量',
+          align: 'center',
+          slot: 'totalCount'
+        },
+        {
+          minWidth: 120,
+          prop: 'measuringUnit',
+          label: '计量单位',
+          align: 'center',
+          slot: 'measuringUnit'
+        },
+        {
+          minWidth: 100,
+          prop: 'singlePrice',
+          label: '单价',
+          align: 'center',
+          slot: 'singlePrice'
+        },
+        {
+          minWidth: 100,
+          prop: 'totalPrice',
+          label: '金额',
+          align: 'center',
+          slot: 'totalPrice'
+        }
+      ],
+    };
+  },
+  watch: {
+    datasource: {
+      handler(val) {
+        this.form.datasource = this.datasource
+      },
+      deep: true,
+      immediate: true
+    },
+    form: {
+      handler(val) {
+        this.$emit('update:datasource', this.form.datasource)
+      },
+      deep: true,
+      immediate: true
+    },
+  },
+  methods: {
+    handleEditCost(row, p1, p2) {
+      if (!row[p1]) return row[p2] = row.totalPrice.toFixed(2)
+      row[p2] = (row.totalPrice - row[p1]).toFixed(2)
+    },
+    remove(tableIndex, lineIndex, delType) {
+      let params = {
+        tableIndex,
+        lineIndex,
+        delType
+      }
+      this.$emit('handleRemove', params)
+    },
+    getSummaries(param) {
+      const {columns, data} = param;
+      const sums = [];
+      let fields = ['totalPrice', 'paidPrice', 'notPaidPrice', 'invoicedPrice', 'notInvoicedPrice']
+      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;
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.headbox {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
+    padding-right: 30px;
+  }
+}
+
+.time-form .el-form-item {
+  margin-bottom: 0 !important;
+}
+
+::v-deep .period {
+  display: flex;
+
+  .borderleftnone {
+    .el-input--medium .el-input__inner {
+      border-top-right-radius: 0;
+      border-bottom-right-radius: 0;
+    }
+  }
+
+  .borderrightnone {
+    .el-input--medium .el-input__inner {
+      border-top-left-radius: 0;
+      border-bottom-left-radius: 0;
+    }
+  }
+
+}
+
+::v-deep .time-form tbody > tr:hover > td {
+  background-color: transparent !important;
+}
+
+::v-deep .time-form .el-table tr {
+  background-color: #ffffff;
+}
+
+.pricebox {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  font-weight: bold;
+}
+
+
+</style>

+ 248 - 0
src/views/bpm/handleTask/components/purchaseOrder/accountstatement/orderListDialog.vue

@@ -0,0 +1,248 @@
+<template>
+  <el-dialog
+    title="选择订单"
+    custom-class="ele-dialog-form long-dialog-form"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    top="5vh"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80%"
+  >
+    <el-card shadow="never">
+      <searchTable @search="reload"></searchTable>
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        row-key="id"
+        height="calc(100vh - 500px)"
+        class="dict-table"
+        @cell-click="cellClick"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:action="{ row }">
+          <el-radio class="radio" v-model="radio" :label="row.id"
+            ><i></i
+          ></el-radio>
+        </template>
+      </ele-pro-table>
+    </el-card>
+
+    <div class="btns" slot="footer">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import searchTable from './searchTable.vue';
+  import {getTableList} from "@/api/bpm/components/purchasingManage/purchaseOrder";
+
+  export default {
+    components: {
+      searchTable
+    },
+
+    data() {
+      return {
+        visible: false,
+        currentIndex: null,
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            width: 60,
+            type: 'action',
+            slot: 'action',
+            label: '选择',
+
+            columnKey: 'action',
+            align: 'center'
+          },
+          {
+            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: 'purchaseTypeName',
+            label: '采购订单类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'partaName',
+            label: '采购方名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180
+          },
+          {
+            prop: 'partaLinkName',
+            label: '采购方联系人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+
+          {
+            prop: 'partaTel',
+            label: '采购方联系电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+          {
+            prop: 'partbName',
+            label: '供应商名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+          {
+            prop: 'partbLinkName',
+            label: '供应商联系人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+          {
+            prop: 'partbTel',
+            label: '供应商联系电话',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+          {
+            prop: 'payAmount',
+            label: '应付金额(元)',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          }
+        ],
+
+        radio: null
+      };
+    },
+
+    methods: {
+      open(item, currentIndex) {
+        this.currentIndex = currentIndex;
+        if (item && item.id) {
+          this.radio = item.id;
+        }
+
+        this.visible = true;
+      },
+
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getTableList({
+          pageNum: page,
+          size: limit,
+          ...where,
+          orderStatus:2
+        });
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        console.log(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>

+ 192 - 0
src/views/bpm/handleTask/components/purchaseOrder/accountstatement/page.vue

@@ -0,0 +1,192 @@
+<template>
+  <div>
+    <purchase-form @handleSearch="handleSearch"
+                   ref="saleFormRef"
+                   :taskDefinitionKey="taskDefinitionKey"
+                   :dataForm.sync="dataForm"
+                   :datasource.sync="datasource"
+                   :dialogType="permissionType"></purchase-form>
+    <headerTitle title="对账明细" style="margin-top: 30px"></headerTitle>
+    <inventoryTable ref="inventoryTableref" :priceObj="priceObj" :datasource.sync="datasource"
+                    :dialogType="permissionType"
+                    :taskDefinitionKey="taskDefinitionKey"></inventoryTable>
+  </div>
+</template>
+
+<script>
+
+
+import InventoryTable from "./inventoryTable.vue";
+import purchaseForm from "./purchaseForm.vue";
+import {getSearchMergeListByTypeAPI, infoAccountStatementAPI,} from "@/api/bpm/components/saleManage/saleorder";
+
+export default {
+  name: 'page',
+  props: ['permissionType', 'businessId', 'taskDefinitionKey'],
+  components: {
+    InventoryTable,
+    purchaseForm
+  },
+  data() {
+    return {
+      datasource: [],
+      dataForm: {
+        fromType: '',
+        dateType: '',
+        dateValue: '',
+        contactId: '',
+        contactName: '',
+        type: '',
+        year: '',
+        quarter: '',
+        month: '',
+        dateTimeRange: [],
+        orderNo: '',
+        orderId: '',
+        id: '',
+        startDate: '',
+        endDate: '',
+        repliedFiles: [],
+        BQYSKZE: undefined,
+      },
+      title: '',
+      quarterList: {
+        '一季度': ['-01-01 00:00:00', '-03-31 12:59:59'],
+        '二季度': ['-04-01 00:00:00', '-06-30 12:59:59'],
+        '三季度': ['-07-01 00:00:00', '-09-30 12:59:59'],
+        '四季度': ['-10-01 00:00:00', '-12-31 12:59:59'],
+      },
+      startTime: '-01-01 00:00:00',
+      endTime: '12:59:59',
+    }
+  },
+  computed: {
+    priceObj() {
+      return this.datasource.reduce((obj, row) => {
+        //已开票合计金额
+        obj.amountInvoicedPrice = ((obj.amountInvoicedPrice * 1) + (row.invoicedPrice * 1)).toFixed(2)
+        //未开票合计金额
+        obj.amountNotInvoicedPrice = ((obj.amountNotInvoicedPrice * 1) + (row.notInvoicedPrice * 1)).toFixed(2)
+        //应付款合计金额
+        obj.amountNotPaidPrice = ((obj.amountNotPaidPrice * 1) + (row.notPaidPrice * 1)).toFixed(2)
+        //已付款合计金额
+        obj.amountPaidPrice = ((obj.amountPaidPrice * 1) + (row.paidPrice * 1)).toFixed(2)
+        //已收货总金额
+        obj.amountTotalPrice = ((obj.amountTotalPrice * 1) + (row.totalPrice * 1)).toFixed(2)
+        return obj
+      }, {
+        amountInvoicedPrice: 0,
+        amountNotInvoicedPrice: 0,
+        amountNotPaidPrice: 0,
+        amountPaidPrice: 0,
+        amountTotalPrice: 0,
+      })
+    }
+  },
+  watch: {},
+  mounted() {
+    this.getInfo(this.businessId)
+  },
+  methods: {
+
+    //获取对账单详情
+    async getInfo(id) {
+      let data = await infoAccountStatementAPI(id)
+      this.datasource = data?.mergeList || []
+      this.dataForm = data
+      this.priceObj.amountNotInvoicedPrice = data.amountNotInvoicedPrice
+      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]
+      }
+    },
+    updateData() {
+      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 12: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 + ' 12:59:59'
+          break
+        default:
+          this.dataForm.dateValue = ''
+          this.dataForm.startDate = this.dataForm.dateTimeRange[0]
+          this.dataForm.endDate = this.dataForm.dateTimeRange[1]
+      }
+    },
+    //查询获取订单数据
+    async handleSearch(params) {
+      this.updateData()
+      if (!await this.getFormValidate()) return
+      this.datasource = await getSearchMergeListByTypeAPI(params)
+    },
+    getFormValidate() {
+      return new Promise((resolve) => {
+        this.$refs.saleFormRef.$refs.form.validate(validate => {
+          resolve(validate)
+        })
+      })
+
+    },
+    getTableValidate() {
+      return new Promise((resolve) => {
+        this.$refs.inventoryTableref.$refs.form.validate(validate => {
+          resolve(validate)
+        })
+      })
+
+    },
+    //
+    getTableValue() {
+      return new Promise(async (resolve) => {
+        if (!this.datasource.length) {
+          this.$message.warning('暂无订单信息')
+          resolve(false)
+        }
+        if (!await this.getFormValidate()) {
+          resolve(false)
+        }
+        if (!await this.getTableValidate()) {
+          resolve(false)
+        }
+
+        let params = {
+          ...this.dataForm,
+          mergeList: this.datasource,
+          ...this.priceObj,
+
+        }
+        resolve(params)
+
+      })
+    },
+  }
+};
+</script>
+<style scoped lang="scss">
+
+</style>

+ 3 - 31
src/views/bpm/handleTask/components/saleOrder/accountstatement/purchaseForm.vue → src/views/bpm/handleTask/components/purchaseOrder/accountstatement/purchaseForm.vue

@@ -6,7 +6,7 @@ import fileUpload from "@/components/upload/fileUpload.vue";
 export default {
   name: "saleForm",
   components: {fileUpload, OrderListDialog, parentList},
-  props: ['dataForm', 'datasource', 'dialogType', 'price', 'taskDefinitionKey'],
+  props: ['dataForm', 'datasource', 'dialogType', 'taskDefinitionKey'],
   data() {
     return {
       monthByDays: {},
@@ -28,13 +28,6 @@ export default {
         quarter: {required: true, message: '请选择', trigger: 'change'},
         month: {required: true, message: '请选择', trigger: 'change'},
         dateTimeRange: {required: true, message: '请选择', trigger: 'change'},
-        receivablePayableAmount: {
-          required: this.taskDefinitionKey == 'financeLeader',
-          message: '请输入',
-          trigger: 'blur'
-        },
-        receiveInvoiceAmount: {required: this.taskDefinitionKey == 'financeLeader', message: '请输入', trigger: 'blur'},
-        receivedPaidAmount: {required: this.taskDefinitionKey == 'financeLeader', message: '请输入', trigger: 'blur'},
         repliedFiles: {required: this.taskDefinitionKey == 'uploadReceipt', message: '请上传', trigger: 'change'},
       },
 
@@ -122,8 +115,8 @@ export default {
             @change="handleChange"
             placeholder="请选择">
             <el-option label="供应商" :value="1"/>
-            <el-option label="项目" :value="2"/>
-            <el-option label="销售订单" :value="3"/>
+<!--            <el-option label="项目" :value="2"/>-->
+            <el-option label="采购订单" :value="3"/>
           </el-select>
         </el-form-item>
       </el-col>
@@ -225,27 +218,6 @@ export default {
 
     </el-row>
     <el-row>
-      <el-col :span="12">
-        <el-form-item label="应付金额" prop="receivablePayableAmount">
-          <el-input-number :controls="false" style="width: 100%" :disabled="taskDefinitionKey!=='financeLeader'"
-                           :max="price.discountTotalPrice"
-                           v-model="dataForm.receivablePayableAmount"></el-input-number>
-        </el-form-item>
-      </el-col>
-      <el-col :span="12">
-        <el-form-item label="开票金额" prop="receiveInvoiceAmount">
-          <el-input-number :controls="false" style="width: 100%" :disabled="taskDefinitionKey!=='financeLeader'"
-                           :max="price.discountTotalPrice"
-                           v-model="dataForm.receiveInvoiceAmount"></el-input-number>
-        </el-form-item>
-      </el-col>
-      <el-col :span="12">
-        <el-form-item label="已付款金额" prop="receivedPaidAmount">
-          <el-input-number :controls="false" style="width: 100%" :disabled="taskDefinitionKey!=='financeLeader'"
-                           :max="price.discountTotalPrice"
-                           v-model="dataForm.receivedPaidAmount"></el-input-number>
-        </el-form-item>
-      </el-col>
       <el-col :span="12">
         <el-form-item
           v-if="taskDefinitionKey=='uploadReceipt'"

+ 148 - 0
src/views/bpm/handleTask/components/purchaseOrder/accountstatement/searchTable.vue

@@ -0,0 +1,148 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="100px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="订单编码:" prop="orderNo">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="params.orderNo"
+          ></el-input>
+     
+        </el-form-item>
+        
+        <el-form-item label="创建时间:" prop="createTimeStart">
+          <el-date-picker
+            v-model="createTime"
+            @change="changeDate"
+            type="datetimerange"
+            style="width:320px"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            start-placeholder="开始时间"
+            end-placeholder="结束时间"
+            :default-time="['00:00:00', '23:59:59']">
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+      <!-- <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
+        <el-form-item label="发货状态:" prop="deliveryStatus">
+          <el-select v-model="params.deliveryStatus" placeholder="请选择" class="w100" clearable>
+            <el-option
+              v-for="item in deliveryStatusOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="订单状态:" prop="orderStatus">
+          <el-select v-model="params.orderStatus" placeholder="请选择" class="w100" clearable>
+            <el-option
+              v-for="item in orderStatusOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>  -->
+      <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
+       
+        <el-form-item label="客户名称:" prop="partaName">
+          <el-input
+          placeholder="请输入"
+          style="max-width:320px"
+           v-model.trim="params.partaName" controls-position="right" >
+          </el-input>
+         
+        </el-form-item>
+        
+      </el-col> 
+      <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
+        <el-form-item label="合同名称:" prop="contractName">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="params.contractName"
+          ></el-input>
+        </el-form-item>
+      </el-col> 
+      <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:4 }">
+      
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset">重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+<script>
+import {deliveryStatusOptions,orderStatusOptions,payStatusOptions} from '@/enum/dict';
+  export default {
+    data () {
+      // 默认表单数据
+      const defaultParams = {
+        contractName: '',
+        contractId:'',
+        createTimeStart:'',
+        createTimeEnd:'',
+        deliveryStatus:'',
+        orderNo:'',
+        orderStatus: '',
+        partaId:'',
+        partaName:'',
+        projectName: '',
+        projectId:''
+      };
+      return {
+        deliveryStatusOptions,
+        orderStatusOptions,
+        payStatusOptions,
+        createTime:[],
+        defaultParams,
+        // 表单数据
+        params: { ...defaultParams }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive () {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      //选择时间
+      changeDate(e){
+       this.createTime=e
+      },
+      /* 搜索 */
+      search () {
+        const [createTimeStart,createTimeEnd]=this.createTime
+        this.params=Object.assign({},this.params,{createTimeStart,createTimeEnd})
+        this.$emit('search', {
+          ...this.params
+        });
+      },
+      /*  重置 */
+      reset () {
+        this.createTime=[]
+        this.params = Object.assign({},{ ...this.defaultParams });
+        this.search();
+      }
+    }
+  };
+</script>

+ 159 - 0
src/views/bpm/handleTask/components/purchaseOrder/accountstatement/submit.vue

@@ -0,0 +1,159 @@
+<template>
+  <el-col :span="16" :offset="6">
+    <el-form label-width="100px" ref="formRef" :model="form">
+      <el-form-item
+        label="审批建议"
+        prop="reason"
+        style="margin-bottom: 20px"
+        :rules="{
+          required: true,
+          message: '请选择',
+          trigger: 'change'
+        }"
+      >
+        <el-input
+          type="textarea"
+          v-model="form.reason"
+          placeholder="请输入审批建议"
+        />
+      </el-form-item>
+    </el-form>
+    <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        @click="handleAudit(1)"
+      >通过
+      </el-button>
+      <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="handleAudit(0)">驳回
+      </el-button>
+
+      <!-- <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="handleBackList"
+        >退回
+      </el-button> -->
+      <!-- <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="handleAudit(0)"
+        v-if="taskDefinitionKey != 'productionSupervisorApprove1'"
+        >不通过
+      </el-button>
+      <el-button
+        icon="el-icon-edit-outline"
+        type="primary"
+        size="mini"
+        v-if="taskDefinitionKey != 'productionSupervisorApprove1'"
+        @click="handleUpdateAssignee"
+        >转办
+      </el-button> -->
+    </div>
+  </el-col>
+</template>
+
+<script>
+import {
+  approveTaskWithVariablesAPI, updateAccountReceiptAPI,
+  updateAccountStatementAPI, updateReceiveAndPayInfoAPI,
+} from '@/api/bpm/components/saleManage/saleorder';
+import {approveTaskWithVariables} from '@/api/bpm/task';
+// import { listAllUserBind } from '@/api/system/organization';
+
+// 流程实例的详情页,可用于审批
+export default {
+  name: '',
+  components: {
+    //   Parser
+  },
+  props: {
+    businessId: {
+      default: ''
+    },
+    taskId: {
+      default: ''
+    },
+    id: {
+      default: ''
+    },
+    taskDefinitionKey: {
+      default: ''
+    }
+  },
+  data() {
+    return {
+      form: {
+        technicianId: '',
+        reason: ''
+      },
+      tabOptions: [
+        {key: 'starter', permissionType: 'update', name: '发起人申请'},
+        {key: 'deptLeader', permissionType: 'view', name: '销售主管审批'},
+        {key: 'financeLeader', permissionType: 'view', name: '财务主管审核'},
+        {key: 'leader', permissionType: 'view', name: '分管副总审批'},
+        {key: 'uploadReceipt', permissionType: 'view', name: '上传回执'},
+      ],
+      permissionType: '',
+    };
+  },
+  created() {
+
+  },
+  mounted() {
+    this.permissionType = this.tabOptions.find(item => item.key == this.taskDefinitionKey).permissionType
+  },
+  methods: {
+    //保存表格数据
+    async handleAudit(pass) {
+      let data = await this.getTableValue()
+      this.$refs.formRef.validate(async validate => {
+        if ((!validate || !data) && !!pass) return this.$message.warning('有必填项未填,请检查')
+        switch (this.taskDefinitionKey) {
+          case 'starter':
+            await updateAccountStatementAPI(data);
+            break;
+          case 'uploadReceipt':
+            await updateAccountReceiptAPI(data);
+            break;
+          case 'financeLeader':
+            await updateReceiveAndPayInfoAPI(data)
+            break;
+        }
+        let variables = {
+          pass: !!pass,
+        }
+        approveTaskWithVariablesAPI({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables
+        }).then((res) => {
+          if (res.code != '-1') {
+            this.$emit('handleAudit', {
+              status: pass,
+              title: !pass ? '驳回' : ''
+            });
+          }
+        });
+      })
+
+    },
+    getTableValue() {
+      return new Promise((resolve, reject) => {
+        this.$emit('getTableValue', async (data) => {
+          resolve(await data);
+        });
+      });
+    }
+  }
+};
+</script>
+
+<style lang="scss"></style>

+ 0 - 8
src/views/bpm/handleTask/components/saleOrder/accountstatement/supplierList.vue → src/views/bpm/handleTask/components/purchaseOrder/accountstatement/supplierList.vue

@@ -20,15 +20,7 @@
                     </ele-pro-table>
                 </template>
             </ele-split-layout>
-
-
-
-
-
-
-
         </el-card>
-
         <div class="btns">
             <el-button type="primary" size="small" @click="selected">选择</el-button>
             <el-button size="small" @click="handleClose">关闭</el-button>

+ 185 - 198
src/views/bpm/handleTask/components/saleOrder/accountstatement/customerListDialog.vue

@@ -1,244 +1,231 @@
 <template>
-    <el-dialog title="选择客户"  custom-class="ele-dialog-form long-dialog-form" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false" top="5vh"
-        :close-on-press-escape="false" append-to-body width="80%">
-        <el-card shadow="never">
+  <el-dialog title="选择客户" custom-class="ele-dialog-form long-dialog-form" :visible.sync="visible"
+             :before-close="handleClose" :close-on-click-modal="false" top="5vh"
+             :close-on-press-escape="false" append-to-body width="80%">
+    <el-card shadow="never">
 
-            <contact-search @search="reload"> </contact-search>
+      <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 - 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>
-                </template>
-            </ele-split-layout>
-
-
-
-
-
-
-
-        </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>
+      <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>
-
-    </el-dialog>
+        <!-- 表格 -->
+        <template v-slot:content>
+          <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>
+        </template>
+      </ele-split-layout>
+    </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 { contactPage } from '@/api/bpm/components/saleManage/contact.js';
+import {contactPage} from '@/api/bpm/components/saleManage/contact.js';
 import ContactSearch from './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 ? '启用' : '禁用';
-                    }
-                },
-
-
-            ],
-
-            radio: null,
-        }
-    },
 
-    watch: {
+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 ? '启用' : '禁用';
+          }
+        },
 
-    },
-    methods: {
-        open(item) {
-            if (item) {
 
-                this.radio = item.id
-            }
-            this.visible = true
-        },
+      ],
 
+      radio: null,
+    }
+  },
 
-        /* 表格数据源 */
-        datasource({ page, limit, where, order }) {
-            return contactPage({
-                pageNum: page,
-                size: limit,
-                type: this.classType,
-                ...where
-            });
-        },
+  watch: {},
+  methods: {
+    open(item) {
+      if (item) {
 
+        this.radio = item.id
+      }
+      this.visible = true
+    },
 
-        /* 刷新表格 */
-        reload(where) {
-            this.$refs.table.reload({ page: 1, where });
-        },
 
-        handleNodeClick(data, node) {
-            this.curNodeData = data;
-            this.reload({ categoryId: data.id });
-        },
+    /* 表格数据源 */
+    datasource({page, limit, where, order}) {
+      return contactPage({
+        pageNum: page,
+        size: limit,
+        type: this.classType,
+        ...where
+      });
+    },
 
 
-        // 单击获取id
-        cellClick(row) {
-            this.current = row
-            this.radio = row.id
-        },
-        handleClose() {
-            this.visible = false
-            this.current = null
-            this.radio = ''
-        },
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({page: 1, where});
+    },
 
-        selected() {
-            if (!this.current) {
-                return this.$message.warning('请选择上级客户')
-            }
-            this.$emit('changeParent', this.current)
-            this.handleClose()
-        },
+    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>
 .tree_col {
-    border: 1px solid #eee;
-    padding: 10px 0;
-    box-sizing: border-box;
-    height: 500px;
-    overflow: auto;
+  border: 1px solid #eee;
+  padding: 10px 0;
+  box-sizing: border-box;
+  height: 500px;
+  overflow: auto;
 }
 
 .table_col {
-    padding-left: 10px;
+  padding-left: 10px;
 
-    ::v-deep .el-table th.el-table__cell {
-        background: #f2f2f2;
-    }
+  ::v-deep .el-table th.el-table__cell {
+    background: #f2f2f2;
+  }
 }
 
 .pagination {
-    text-align: right;
-    padding: 10px 0;
+  text-align: right;
+  padding: 10px 0;
 }
 
 .btns {
-    text-align: center;
-    padding: 10px 0;
+  text-align: center;
+  padding: 10px 0;
 }
 
 .topsearch {
-    margin-bottom: 15px;
+  margin-bottom: 15px;
 }
 </style>

+ 382 - 109
src/views/bpm/handleTask/components/saleOrder/accountstatement/inventoryTable.vue

@@ -1,191 +1,464 @@
 <template>
-  <el-form ref="form" :model="form" :rules="rules">
-    <el-row>
-      <el-col :span="3">
+  <el-form ref="form" :model="form" :rules="{}">
+    <ele-pro-table show-summary :summary-method="getSummaries" ref="table" row-key="id" :needPage="false"
+                   :columns="columns" max-height="500px" :toolkit="[]" :datasource="form.datasource"
+                   cache-key="systemRoleTable17-1111" 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:productCode="{ row,$index }">
+        <el-popover
+          placement="right"
+          width="80%"
+          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.productCode }}</el-button>
+        </el-popover>
+      </template>
+      <template v-if="taskDefinitionKey=='financeLeader'" v-slot:receivedPrice="{row,$index}">
         <el-form-item
-          label="订单量:"
-          prop="orderNum"
-          style="margin-bottom: 22px"
-        >
-          {{ datasource.length }}
+          :prop="'datasource.'+$index+'.receivedPrice'"
+          :rules="{required:true,trigger:'change',message:'请选择'}">
+          <el-input-number :controls="false"
+                           style="width: 100%"
+                           v-model="row.receivedPrice"
+                           :precision="2"
+                           @blur="(val)=>handleEditCost(row,'receivedPrice','receivablePrice')"
+                           :max="row.totalPrice"></el-input-number>
         </el-form-item>
-      </el-col>
-      <el-col :span="4">
+
+      </template>
+      <template v-if="taskDefinitionKey=='financeLeader'" v-slot:receivableDate="{row,$index}">
         <el-form-item
-          label="产品总金额:"
-          prop="totalPrice"
-          style="margin-bottom: 22px">
-          {{ price.totalPrice }}元
+          :prop="'datasource.'+$index+'.receivableDate'"
+          :rules="{required:true,trigger:'change',message:'请选择'}">
+          <el-date-picker
+            type="date"
+            style="width: 100%"
+            v-model="row.receivableDate"
+            value-format="yyyy-MM-dd"
+            placeholder="选择日期">
+          </el-date-picker>
         </el-form-item>
-      </el-col>
-      <el-col :span="4">
+
+
+      </template>
+      <template v-if="taskDefinitionKey=='financeLeader'" v-slot:invoicedPrice="{row,$index}">
         <el-form-item
-          label="产品优惠总金额:"
-          prop="totalPrice"
-          style="margin-bottom: 22px">
-          {{ price.discountTotalPrice }}元
+          :prop="'datasource.'+$index+'.invoicedPrice'"
+          :rules="{required:true,trigger:'change',message:'请选择'}">
+          <el-input-number :controls="false"
+                           style="width: 100%"
+                           v-model="row.invoicedPrice"
+                           :precision="2"
+                           @blur="(val)=>handleEditCost(row,'invoicedPrice','notInvoicedPrice')"
+                           :max="row.totalPrice"></el-input-number>
         </el-form-item>
+      </template>
+      <template v-slot:headerReceivedPrice="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerReceivableDate="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerInvoicedPrice="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+    </ele-pro-table>
+
+    <el-row 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="本期应收款总额" >{{ priceObj.amountReceivablePrice }}</el-descriptions-item>
+          <el-descriptions-item label="截止上期欠款">
+            <el-input-number v-if="taskDefinitionKey=='financeLeader'" :controls="false"
+                             style="width: 100%"
+                             v-model="priceObj.previousPeriodEndDebt"
+                             :precision="2"></el-input-number>
+            <template v-else>{{ priceObj.previousPeriodEndDebt }}</template>
+          </el-descriptions-item>
+        </el-descriptions>
       </el-col>
     </el-row>
 
-    <template v-for="(item,index) in datasource">
-      <ele-pro-table ref="table" :needPage="false" :columns="columns" :toolkit="[]" :datasource="item.detailList"
-                     cache-key="systemRoleTable17" class="time-form">
-        <!-- 表头工具栏 -->
-        <template v-slot:toolbar>
-          <el-col :span="6">
-            <el-form-item
-              label="销售订单:"
-              prop="orderNum"
-              style="margin-bottom: 22px">
-              {{ item.orderNo }}
-            </el-form-item>
-          </el-col>
-          <el-col :span="4">
-            <el-form-item
-              label="总金额:"
-              prop="totalPrice"
-              style="margin-bottom: 22px">
-              {{ item.totalPrice }}元
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item
-              style="display: flex"
-              label="优惠总金额:"
-              class="is-required"
-              prop="discountTotalPrice">
-              <el-input :disabled="dialogType=='view'" v-model="item.discountTotalPrice"></el-input>
-            </el-form-item>
-          </el-col>
-        </template>
-        <template v-slot:action="{ row }">
-          <el-popconfirm class="ele-action"  title="确定要删除吗?" @confirm="remove(row)">
-            <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>
-
-    </template>
-
-
   </el-form>
 
 </template>
 <script>
+
 export default {
   components: {},
-  props: ['datasource','dialogType','price'],
-  data() {
-
-    return {
-      rules: {},
-      form: {},
-      columns: [
+  props: ['datasource', 'dialogType', 'taskDefinitionKey', 'priceObj'],
+  computed: {
+    columns() {
+      let basicFields = [
         {
-          width: 45,
+          width: 60,
+          label: '序号',
           type: 'index',
           columnKey: 'index',
           align: 'center',
-          fixed: 'left'
         },
         {
-          width: 160,
+          minWidth: 130,
+          prop: 'sendDate',
+          label: '发货日期',
+          align: 'center',
+          slot: 'sendDate',
+          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: 100,
+          prop: 'specification',
+          label: '规格',
+          align: 'center',
+          slot: 'specification',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 100,
+          prop: 'modelType',
+          label: '型号',
+          align: 'center',
+          slot: 'modelType',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 100,
+          prop: 'orderNo',
+          label: '销售订单编码',
+          align: 'center',
+          slot: 'orderNo',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 120,
+          prop: 'totalCount',
+          label: '验收数量',
+          align: 'center',
+          slot: 'totalCount',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 120,
+          prop: 'measuringUnit',
+          label: '计量单位',
+          align: 'center',
+          slot: 'measuringUnit',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 100,
+          prop: 'singlePrice',
+          label: '单价',
+          align: 'center',
+          slot: 'singlePrice',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 120,
+          prop: 'totalPrice',
+          label: '合计金额',
+          slot: 'totalPrice',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+      ]
+      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
+    },
+  },
+  data() {
+    return {
+      rules: {},
+      form: {
+        datasource: []
+      },
+      childrenColumns: [
+        {
+          minWidth: 120,
           prop: 'orderNo',
-          label: '主单据编码',
+          label: '单据编码',
+          align: 'center',
           slot: 'orderNo'
         },
         {
-          width: 140,
+          minWidth: 120,
           prop: 'orderType',
-          label: '主单据类型',
+          label: '单据类型',
           slot: 'orderType',
+          align: 'center',
           formatter: (_row, _column, cellValue) => {
             return _row.orderType === 1 ? '销售发货' : _row.orderType === 2 ? '销售退货' : ""
           }
         },
         {
-          width: 200,
+          minWidth: 140,
           prop: 'productName',
-          label: '名称',
-          slot: 'productName'
+          label: '产品名称',
+          align: 'center',
+          slot: 'productName',
         },
         {
-          width: 120,
+          minWidth: 100,
           prop: 'productCode',
           label: '编码',
+          align: 'center',
           slot: 'productCode'
         },
         {
-          width: 200,
-          prop: 'productCategoryName',
-          label: '类型',
-          slot: 'productCategoryName'
-        },
-        {
-          width: 160,
+          minWidth: 100,
           prop: 'productBrand',
           label: '牌号',
+          align: 'center',
           slot: 'productBrand'
         },
         {
-          width: 120,
+          minWidth: 100,
           prop: 'modelType',
           label: '型号',
+          align: 'center',
           slot: 'modelType'
         },
         {
-          width: 120,
+          minWidth: 100,
           prop: 'specification',
           label: '规格',
+          align: 'center',
           slot: 'specification'
         },
-
-
         {
-          width: 120,
+          minWidth: 100,
           prop: 'totalCount',
           label: '数量',
+          align: 'center',
           slot: 'totalCount'
         },
         {
-          width: 80,
+          minWidth: 120,
           prop: 'measuringUnit',
           label: '计量单位',
+          align: 'center',
           slot: 'measuringUnit'
         },
         {
-          width: 160,
+          minWidth: 100,
           prop: 'singlePrice',
           label: '单价',
+          align: 'center',
           slot: 'singlePrice'
         },
         {
-          width: 120,
+          minWidth: 100,
           prop: 'totalPrice',
           label: '金额',
-          slot: 'totalPrice'
-        },
-
-
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 120,
           align: 'center',
-          resizable: false,
-          slot: 'action',
-          fixed: 'right',
-          showOverflowTooltip: true
+          slot: 'totalPrice'
         }
       ],
     };
   },
+  watch: {
+    datasource: {
+      handler(val) {
+        this.form.datasource = this.datasource
+      },
+      deep: true,
+      immediate: true
+    },
+    form: {
+      handler(val) {
+        this.$emit('update:datasource', this.form.datasource)
+      },
+      deep: true,
+      immediate: true
+    },
+  },
   methods: {
+    handleEditCost(row, p1, p2) {
+      if (!row[p1]) return row[p2] = row.totalPrice.toFixed(2)
+      row[p2] = (row.totalPrice - row[p1]).toFixed(2)
+    },
+    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']
+      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;
+    }
   }
 };
 </script>

+ 41 - 47
src/views/bpm/handleTask/components/saleOrder/accountstatement/page.vue

@@ -1,24 +1,15 @@
 <template>
   <div>
     <sale-form @handleSearch="handleSearch"
-               v-if="dataForm.type==1"
                ref="saleFormRef"
                :taskDefinitionKey="taskDefinitionKey"
                :dataForm.sync="dataForm"
-               :price="price"
                :datasource.sync="datasource"
                :dialogType="permissionType"></sale-form>
-    <purchase-form @handleSearch="handleSearch"
-                   v-else
-                   ref="saleFormRef"
-                   :taskDefinitionKey="taskDefinitionKey"
-                   :dataForm.sync="dataForm"
-                   :price="price"
-                   :datasource.sync="datasource"
-                   :dialogType="permissionType"></purchase-form>
     <headerTitle title="对账明细" style="margin-top: 30px"></headerTitle>
-    <inventoryTable ref="inventoryTableref" :datasource.sync="datasource" :dialogType="permissionType"
-                    :price="price"></inventoryTable>
+    <inventoryTable ref="inventoryTableref" :priceObj="priceObj" :datasource.sync="datasource"
+                    :dialogType="permissionType"
+                    :taskDefinitionKey="taskDefinitionKey"></inventoryTable>
   </div>
 </template>
 
@@ -27,22 +18,14 @@
 
 import InventoryTable from "./inventoryTable.vue";
 import saleForm from "./saleForm.vue";
-import purchaseForm from "./purchaseForm.vue";
-import {
-  getSearchDetailListByTypeAPI,
-  infoAccountStatementAPI,
-  saveAccountStatementAPI,
-  submitAccountStatementApproveAPI,
-  updateAccountStatementAPI
-} from "@/api/bpm/components/saleManage/saleorder";
+import {getSearchMergeListByTypeAPI, infoAccountStatementAPI,} from "@/api/bpm/components/saleManage/saleorder";
 
 export default {
   name: 'page',
   props: ['permissionType', 'businessId', 'taskDefinitionKey'],
   components: {
     InventoryTable,
-    saleForm,
-    purchaseForm
+    saleForm
   },
   data() {
     return {
@@ -63,10 +46,8 @@ export default {
         id: '',
         startDate: '',
         endDate: '',
-        receivablePayableAmount: undefined,
-        receiveInvoiceAmount: undefined,
-        receivedPaidAmount: undefined,
-        repliedFiles: []
+        repliedFiles: [],
+        BQYSKZE: undefined,
       },
       title: '',
       quarterList: {
@@ -80,15 +61,26 @@ export default {
     }
   },
   computed: {
-    price() {
-      return this.datasource.reduce((acc, obj) => {
-        for (const key in acc) {
-          (acc[key]) += (obj[key] * 1)
-        }
-        return acc;
+    priceObj() {
+      return this.datasource.reduce((obj, row) => {
+        //已开票合计金额
+        obj.amountInvoicedPrice = ((obj.amountInvoicedPrice * 1) + (row.invoicedPrice * 1)).toFixed(2)
+        //未开票合计金额
+        obj.amountNotInvoicedPrice = ((obj.amountNotInvoicedPrice * 1) + (row.notInvoicedPrice * 1)).toFixed(2)
+        //应收款合计金额
+        obj.amountReceivablePrice = ((obj.amountReceivablePrice * 1) + (row.receivablePrice * 1)).toFixed(2)
+        //已收款合计金额
+        obj.amountReceivedPrice = ((obj.amountReceivedPrice * 1) + (row.receivedPrice * 1)).toFixed(2)
+        //合计总金额(单价*数量)
+        obj.amountTotalPrice = ((obj.amountTotalPrice * 1) + (row.totalPrice * 1)).toFixed(2)
+        return obj
       }, {
-        totalPrice: 0,
-        discountTotalPrice: 0
+        amountInvoicedPrice: 0,
+        amountNotInvoicedPrice: 0,
+        amountReceivablePrice: 0,
+        amountReceivedPrice: 0,
+        amountTotalPrice: 0,
+        previousPeriodEndDebt: 0,
       })
     }
   },
@@ -101,11 +93,9 @@ export default {
     //获取对账单详情
     async getInfo(id) {
       let data = await infoAccountStatementAPI(id)
-      this.datasource = data.orderList
+      this.datasource = data?.mergeList || []
       this.dataForm = data
-      this.dataForm.receivablePayableAmount = this.dataForm.receivablePayableAmount == 'null' ? 'undefined' : this.dataForm.receivablePayableAmount
-      this.dataForm.receivedPaidAmount = this.dataForm.receivedPaidAmount == 'null' ? 'undefined' : this.dataForm.receivedPaidAmount
-      this.dataForm.receivedPaidAmount = this.dataForm.receivedPaidAmount == 'null' ? 'undefined' : this.dataForm.receivedPaidAmount
+      this.priceObj.previousPeriodEndDebt = data.previousPeriodEndDebt
       switch (this.dataForm.dateType) {
         case 1:
           this.dataForm.year = this.dataForm.dateValue
@@ -153,7 +143,7 @@ export default {
     async handleSearch(params) {
       this.updateData()
       if (!await this.getFormValidate()) return
-      this.datasource = await getSearchDetailListByTypeAPI(params)
+      this.datasource = await getSearchMergeListByTypeAPI(params)
     },
     getFormValidate() {
       return new Promise((resolve) => {
@@ -162,6 +152,14 @@ export default {
         })
       })
 
+    },
+    getTableValidate() {
+      return new Promise((resolve) => {
+        this.$refs.inventoryTableref.$refs.form.validate(validate => {
+          resolve(validate)
+        })
+      })
+
     },
     //
     getTableValue() {
@@ -170,21 +168,17 @@ export default {
           this.$message.warning('暂无订单信息')
           resolve(false)
         }
-
-        if (this.datasource.some(item => !item.discountTotalPrice && item.discountTotalPrice !== 0)) {
-          this.$message.warning('优惠总金额不能为空')
+        if (!await this.getFormValidate()) {
           resolve(false)
         }
-        if (!await this.getFormValidate()) {
+        if (!await this.getTableValidate()) {
           resolve(false)
         }
 
         let params = {
           ...this.dataForm,
-          orderList: this.datasource,
-          orderNum: this.datasource.length,
-          totalPrice: this.price.totalPrice,
-          discountTotalPrice: this.price.discountTotalPrice,
+          mergeList: this.datasource,
+          ...this.priceObj,
 
         }
         resolve(params)

+ 2 - 30
src/views/bpm/handleTask/components/saleOrder/accountstatement/saleForm.vue

@@ -6,7 +6,7 @@ import fileUpload from "@/components/upload/fileUpload.vue";
 export default {
   name: "saleForm",
   components: {fileUpload, OrderListDialog, parentList},
-  props: ['dataForm', 'datasource', 'dialogType', 'price', 'taskDefinitionKey'],
+  props: ['dataForm', 'datasource', 'dialogType', 'taskDefinitionKey'],
   data() {
     return {
       monthByDays: {},
@@ -21,13 +21,6 @@ export default {
         quarter: {required: true, message: '请选择', trigger: 'change'},
         month: {required: true, message: '请选择', trigger: 'change'},
         dateTimeRange: {required: true, message: '请选择', trigger: 'change'},
-        receivablePayableAmount: {
-          required: this.taskDefinitionKey == 'financeLeader',
-          message: '请输入',
-          trigger: 'blur'
-        },
-        receiveInvoiceAmount: {required: this.taskDefinitionKey == 'financeLeader', message: '请输入', trigger: 'blur'},
-        receivedPaidAmount: {required: this.taskDefinitionKey == 'financeLeader', message: '请输入', trigger: 'blur'},
         repliedFiles: {required: this.taskDefinitionKey == 'uploadReceipt', message: '请上传', trigger: 'change'},
       },
 
@@ -115,7 +108,7 @@ export default {
             @change="handleChange"
             placeholder="请选择">
             <el-option label="客户" :value="1"/>
-            <el-option label="项目" :value="2"/>
+<!--            <el-option label="项目" :value="2"/>-->
             <el-option label="销售订单" :value="3"/>
           </el-select>
         </el-form-item>
@@ -218,27 +211,6 @@ export default {
 
     </el-row>
     <el-row>
-      <el-col :span="12">
-        <el-form-item label="应收金额" prop="receivablePayableAmount">
-          <el-input-number :controls="false" style="width: 100%" :disabled="taskDefinitionKey!=='financeLeader'"
-                           :max="price.discountTotalPrice"
-                           v-model="dataForm.receivablePayableAmount"></el-input-number>
-        </el-form-item>
-      </el-col>
-      <el-col :span="12">
-        <el-form-item label="收票金额" prop="receiveInvoiceAmount">
-          <el-input-number :controls="false" style="width: 100%" :disabled="taskDefinitionKey!=='financeLeader'"
-                           :max="price.discountTotalPrice"
-                           v-model="dataForm.receiveInvoiceAmount"></el-input-number>
-        </el-form-item>
-      </el-col>
-      <el-col :span="12">
-        <el-form-item label="已收款金额" prop="receivedPaidAmount">
-          <el-input-number :controls="false" style="width: 100%" :disabled="taskDefinitionKey!=='financeLeader'"
-                           :max="price.discountTotalPrice"
-                           v-model="dataForm.receivedPaidAmount"></el-input-number>
-        </el-form-item>
-      </el-col>
       <el-col :span="12">
         <el-form-item
           v-if="taskDefinitionKey=='uploadReceipt'"

+ 0 - 1
src/views/bpm/handleTask/components/saleOrder/accountstatement/submit.vue

@@ -127,7 +127,6 @@ export default {
             await updateReceiveAndPayInfoAPI(data)
             break;
         }
-
         let variables = {
           pass: !!pass,
         }

+ 0 - 2
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrder.vue

@@ -787,8 +787,6 @@ export default {
 
         })
       })
-
-
     },
   }
 }