ソースを参照

财务收款对接

lilei 2 年 前
コミット
6b6d0f8f5e

+ 103 - 0
src/api/financeBook.js

@@ -0,0 +1,103 @@
+import { axios } from '@/utils/request'
+
+// 财务收款分页列表
+export const financeBookQueryPage = (params) => {
+  const url = `/financeBook/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 详情
+export const financeBookFindBySn = (params) => {
+  const url = `/financeBook/queryBySn/${params.bookSn}`
+  return axios({
+    url: url,
+    method: 'get'
+  })
+}
+// 关联备货单接口
+export const queryDispatchBillListBySn = (params) => {
+  const url = `/financeBook/queryDispatchBillListBySn/${params.bookSn}`
+  return axios({
+    url: url,
+    method: 'get'
+  })
+}
+// 删除
+export const financeBookDeleteBySn = (params) => {
+  const url = `/financeBook/deleteBySn/${params.bookSn}`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 再次编辑
+export const financeBookDgainEditBySn = (params) => {
+  const url = `/financeBook/againEdit/${params.bookSn}`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 保存
+export const financeBookSave = (params) => {
+  const url = `/financeBook/save`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 提交
+export const financeBookSubmit = (params) => {
+  const url = `/financeBook/submit`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 明细-列表
+export const financeBookDetailQueryList = (params) => {
+  const url = `/financeBook/detail/queryList/${params.bookSn}`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 明细-保存
+export const financeBookDetailSave = (params) => {
+  const url = `/financeBook/detail/save`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 明细-详情
+export const financeBookDetailQueryBySn = (params) => {
+  const url = `/financeBook/detail/queryBySn/${params.bookDetailSn}`
+  return axios({
+    url: url,
+    method: 'get'
+  })
+}
+// 明细-删除
+export const financeBookDetailDelete = (params) => {
+  const url = `/financeBook/detail/deleteBySn/${params.bookDetailSn}`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 4 - 4
src/config/router.config.js

@@ -775,11 +775,11 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'add',
-                name: 'financialCollectionAdd',
-                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/financialCollection/edit.vue'),
+                path: 'detail/:sn',
+                name: 'financialCollectionDetail',
+                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/financialCollection/detail.vue'),
                 meta: {
-                  title: '新增财务收款',
+                  title: '财务收款详情',
                   icon: 'monitor',
                   hidden: true
                 }

+ 9 - 0
src/views/common/dealerSubareaScopeList.vue

@@ -58,6 +58,7 @@ export default {
       if (value && value.key) {
         const obj = this.data.find(item => item.dealerSn == value.key)
         value.name = obj.dealerName
+        value.row = obj
       }
       Object.assign(this, {
         dealerName: value,
@@ -72,6 +73,14 @@ export default {
     // 查询详细
     getDetail (sn) {
       dealerDetailBySn({ sn: sn }).then(res => {
+        const val = { key: sn }
+        val.row = res.data
+        Object.assign(this, {
+          dealerName: val,
+          data: [res.data],
+          fetching: false
+        })
+        this.$emit('change', val)
         this.$emit('dealerDetail', res.data || null)
       })
     }

+ 86 - 19
src/views/financialManagement/financialCollection/baseModal.vue

@@ -4,7 +4,6 @@
     :title="title"
     centered
     :maskClosable="false"
-    :confirmLoading="confirmLoading"
     :width="800"
     :footer="null"
     @cancel="cancel"
@@ -17,16 +16,19 @@
         :rules="rules"
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol">
-        <a-form-model-item label="收款事由" prop="buyerSn">
-          <a-input maxLength="100" placeholder="请输入收款事由(最多100个字符)"></a-input>
+        <a-form-model-item label="申请人" prop="applyPersonSn">
+          <employee style="width: 100%;" @change="employeeChange" id="fc-Employee" v-model="form.applyPersonSn"></employee>
+        </a-form-model-item>
+        <a-form-model-item label="收款事由" prop="bookReason">
+          <a-input :maxLength="100" placeholder="请输入收款事由(最多100个字符)" v-model="form.bookReason"></a-input>
         </a-form-model-item>
         <a-form-model-item label="备注">
-          <a-textarea :rows="4" maxLength="500" placeholder="请输入备注(最多500个字符)"></a-textarea>
+          <a-textarea :rows="4" :maxLength="500" placeholder="请输入备注(最多500个字符)" v-model="form.remarks"></a-textarea>
         </a-form-model-item>
         <a-form-model-item label="附件" help="(支持图片、word、excel、PDF等格式,最多10个附件)">
           <Upload
             style="height: 100%;"
-            v-model="form.attachList"
+            v-model="form.attachmentList"
             ref="attachList"
             :fileSize="10"
             :maxNums="10"
@@ -48,35 +50,59 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { VSelect, Upload } from '@/components'
-import { salesSave } from '@/api/sales'
+import employee from '../../expenseManagement/expenseReimbursement/employee.js'
+import { financeBookSave, financeBookFindBySn } from '@/api/financeBook.js'
 export default {
-  name: 'SalesChooseCustomModal',
+  name: 'FcBaseModal',
   mixins: [commonMixin],
-  components: { VSelect, Upload },
+  components: { VSelect, Upload, employee },
   props: {
-    show: [Boolean]
+    show: [Boolean],
+    itemSn: {
+      type: String,
+      default: ''
+    }
   },
   data () {
     return {
       opened: this.show,
       spinning: false,
+      disabled: false,
       title: '新增财务收款单',
       confirmLoading: false,
+      bookSn: this.itemSn,
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 18 }
       },
+      attachList: [],
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
       form: {
-        buyerSn: undefined, // 客户sn
-        buyerName: '',
-        settleStyleSn: undefined
+        applyPersonSn: undefined,
+        bookReason: '',
+        remarks: '',
+        attachmentList: ''
       },
       rules: {
-        buyerSn: [ { required: true, message: '请选择客户', trigger: ['change', 'blur'] } ]
+        applyPersonSn: [ { required: true, message: '请选择申请人', trigger: ['change', 'blur'] } ],
+        bookReason: [ { required: true, message: '请输入收款事由', trigger: ['change', 'blur'] } ]
       }
     }
   },
   methods: {
+    // 申请人员
+    employeeChange (v, r) {
+      this.$nextTick(() => {
+        this.$refs.ruleForm.validateField(['applyPersonSn'])
+      })
+    },
+    //  附件上传
+    changeAttach (file) {
+      this.attachList = JSON.parse(file)
+      this.attachList.map(item => {
+        item.fileType = item.extName
+      })
+    },
     //  保存
     handleSubmit (e) {
       e.preventDefault()
@@ -92,14 +118,16 @@ export default {
     // 新建或编辑销售单
     salesSaveFun () {
       const _this = this
-      const form = this.form
+      const form = JSON.parse(JSON.stringify(_this.form))
+      form.attachmentList = this.attachList
       _this.spinning = true
-      salesSave(form).then(res => {
+      financeBookSave(form).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
-          _this.$emit('ok', res.data)
-          if (_this.form.id) {
-            _this.$emit('updateData')
+          if (this.bookSn) {
+            _this.$emit('refashData')
+          } else {
+            _this.$router.push({ name: 'financialCollectionEdit', params: { sn: res.data.bookSn } })
           }
           _this.cancel()
           _this.spinning = false
@@ -108,18 +136,57 @@ export default {
         }
       })
     },
+    //  详情
+    getDetail () {
+      this.spinning = true
+      this.confirmLoading = true
+      financeBookFindBySn({ bookSn: this.bookSn }).then(res => {
+        if (res.status == 200) {
+          const data = res.data
+          this.form = Object.assign(this.form, data)
+          // 获取附件列表
+          this.form.attachmentList = ''
+          this.attachList = res.data.attachmentList
+          this.$refs.attachList.setFileList(this.attachList)
+        } else {
+          this.$refs.ruleForm.resetFields()
+        }
+        this.spinning = false
+        this.confirmLoading = false
+      })
+    },
     cancel () {
       this.opened = false
       this.$emit('cancel')
       this.$refs.ruleForm.resetFields()
+    },
+    pageInit () {
+      this.$nextTick(() => {
+        this.attachList = []
+        this.$refs.attachList.setFileList('')
+        this.$refs.ruleForm.resetFields()
+        this.form = {
+          applyPersonSn: undefined,
+          bookReason: '',
+          remarks: '',
+          attachmentList: ''
+        }
+        if (this.bookSn) { //  编辑页
+          this.getDetail()
+          this.title = '编辑财务收款单'
+        }
+      })
     }
   },
   watch: {
     show (newValue, oldValue) {
       this.opened = newValue
       if (!newValue) {
-        this.$refs.ruleForm.resetFields()
+        this.pageInit()
       }
+    },
+    itemSn (a, b) {
+      this.bookSn = a
     }
   }
 }

+ 8 - 0
src/views/financialManagement/financialCollection/detail.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 107 - 80
src/views/financialManagement/financialCollection/edit.vue

@@ -1,13 +1,13 @@
 <template>
-  <div class="expenseReimbursementAddwrap">
+  <div class="financialCollectionAddwrap">
     <a-spin :spinning="spinning" tip="Loading...">
-      <a-page-header :ghost="false" :backIcon="false" class="expenseReimbursementAddcont" >
+      <a-page-header :ghost="false" :backIcon="false" class="financialCollectionAddcont" >
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
           <a id="purchaseOrderEdit-back-btn" href="javascript:;" @click="handleBack(0)"><a-icon type="left" /> 返回列表</a>
         </template>
       </a-page-header>
-      <a-collapse :activeKey="['1']" class="expenseReimbursementAddcont" v-if="detailData">
+      <a-collapse :activeKey="['1']" class="financialCollectionAddcont" v-if="detailData">
         <a-collapse-panel key="1" header="基础信息">
           <div slot="extra" style="padding: 0 20px; color: #00aaff;" @click.stop="handleEditBase" >
             <a-icon type="edit" /> 编辑基础信息
@@ -15,12 +15,12 @@
           <a-descriptions :column="{ xs: 2, sm: 3, md: 3}">
             <a-descriptions-item label="创建时间">{{ detailData&&detailData.createDate || '--' }}</a-descriptions-item>
             <a-descriptions-item label="申请人">{{ detailData&&detailData.applyPersonName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="审核时间">{{ detailData&&detailData.finishDate || '--' }}</a-descriptions-item>
-            <a-descriptions-item span="2" label="收款事由">{{ detailData&&detailData.expenseAccountNo || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="状态">{{ detailData&&detailData.stateDictValue || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="备注" :span="3">{{ detailData&&detailData.content.join(',')||'' }}</a-descriptions-item>
+            <a-descriptions-item label="审核时间">{{ detailData&&detailData.auditDate || '--' }}</a-descriptions-item>
+            <a-descriptions-item span="2" label="收款事由">{{ detailData&&detailData.bookReason || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="状态">{{ detailData&&detailData.statusDictValue || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="备注" :span="3">{{ detailData&&detailData.remarks||'--' }}</a-descriptions-item>
             <a-descriptions-item label="附件" :span="3">
-              <a target="_blank" style="color: #00aaff;text-decoration: underline;margin-right: 15px;" :href="item.filePath" v-for="item in detailData.expenseAccountFilesList" :key="item.id">
+              <a target="_blank" style="color: #00aaff;text-decoration: underline;margin-right: 15px;" :href="item.filePath" v-for="item in detailData.attachmentList" :key="item.id">
                 {{ item.fileName }}
               </a>
             </a-descriptions-item>
@@ -28,18 +28,23 @@
         </a-collapse-panel>
       </a-collapse>
       <!-- 财务明细 -->
-      <a-card :bordered="false" size="small" class="expenseReimbursementAddcont" v-if="$route.params.sn">
+      <a-card :bordered="false" size="small" class="financialCollectionAddcont" v-if="$route.params.sn">
         <div slot="title">
           <div style="display: flex;justify-content: space-between;align-items: center;">
             <div>财务明细</div>
             <div>
-              <a-button size="small" class="button-error" type="primary" @click="newExpenseDetail">新增收款明细</a-button>
+              <a-button size="small" class="button-error" type="primary" @click="handleEdit">新增收款明细</a-button>
             </div>
           </div>
         </div>
-        <a-alert type="info" style="margin-bottom:10px">
+        <a-alert type="info" style="margin-bottom:10px" v-if="detailData">
           <div slot="message">
-            共 2 条,订单金额合计¥56253.60,收款金额合计 ¥56253.60,使用授信合计¥0.00,授信还款合计¥0.00,余款抵扣合计¥0.00
+            共 {{ total }} 条,
+            订单金额合计¥{{ detailData.orderTotalAmount }},
+            收款金额合计¥{{ detailData.receiptTotalAmount }},
+            使用授信合计¥{{ detailData.useTotalAmount }},
+            授信还款合计¥{{ detailData.payTotalAmount }},
+            余款抵扣合计¥{{ detailData.balanceTotalAmount }}
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -53,6 +58,24 @@
           :defaultLoadData="false"
           :showPagination="false"
           bordered>
+          <template slot="expandedRowRender" slot-scope="record" v-if="record.detailItemUseList.length || record.detailItemPayList.length">
+            <div style="display:flex;justify-content: space-around;padding:10px;">
+              <a-table
+                style="width:45%;background:#fff;"
+                :bordered="false"
+                :pagination="false"
+                :columns="useCol"
+                :data-source="record.detailItemUseList">
+              </a-table>
+              <a-table
+                :bordered="false"
+                style="width:45%;background:#fff;"
+                :pagination="false"
+                :columns="payCol"
+                :data-source="record.detailItemPayList">
+              </a-table>
+            </div>
+          </template>
           <template slot="action" slot-scope="text,record">
             <a-button
               size="small"
@@ -75,13 +98,28 @@
         type="primary"
         class="button-primary"
         :disabled="spinning"
-        id="expenseReimbursementAddsubmit-btn"
+        id="financialCollectionAddsubmit-btn"
         size="large"
         @click="beforeSubmit"
         style="padding: 0 60px;">提交</a-button>
     </div>
     <!-- 基础信息 -->
-    <baseModal :show="openBaseModal" @cancel="openBaseModal=false"></baseModal>
+    <baseModal
+      ref="baseModal"
+      @refashData="refashData"
+      :show="openBaseModal"
+      :itemSn="$route.params.sn"
+      @cancel="openBaseModal=false"></baseModal>
+    <!-- 明细弹框 -->
+    <fcDetailModal
+      ref="fcDetailModal"
+      @refashData="fcDetailOk"
+      :show="openFcDetailModal"
+      :bookSn="$route.params.sn"
+      :bookNo="detailData?detailData.bookNo:''"
+      @cancel="openFcDetailModal=false"></fcDetailModal>
+    <!-- 选择审核人员 -->
+    <chooseDepartUserModal :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
   </div>
 </template>
 
@@ -89,31 +127,33 @@
 import { commonMixin } from '@/utils/mixin'
 import { VSelect, STable } from '@/components'
 import baseModal from './baseModal.vue'
-import { expenseAccountDetail, expenseAcctDetailDelete, expenseAcctDetailFindList, expenseAccountSubmit, expenseInsertImport } from '@/api/expenseManagement.js'
+import fcDetailModal from './fcDetailModal.vue'
+import chooseDepartUserModal from '../../expenseManagement/expenseReimbursement/chooseDepartUserModal.vue'
+import { financeBookFindBySn, financeBookDetailDelete, financeBookDetailQueryList, financeBookSubmit } from '@/api/financeBook.js'
 export default {
   name: 'FinancialCollectionEdit',
   mixins: [commonMixin],
-  components: { VSelect, STable, baseModal },
+  components: { VSelect, STable, baseModal, fcDetailModal, chooseDepartUserModal },
   data () {
     return {
       spinning: false,
       detailData: null,
       openBaseModal: false,
-      openGuideModal: false,
       openDepartUserModal: false,
-      openEpenseDetailModal: false, // 财务明细弹框
-      expenseAccountDetailSn: '',
-      openProductInfoModal: false, // 产品信息弹框
+      openFcDetailModal: false, // 财务明细弹框
       total: 0,
       loadData: parameter => {
-        const params = Object.assign(parameter, { expenseAccountSn: this.$route.params.sn })
-        return expenseAcctDetailFindList(params).then(res => {
+        const params = Object.assign(parameter, { bookSn: this.$route.params.sn })
+        return financeBookDetailQueryList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
             const no = 0
             for (var i = 0; i < data.length; i++) {
               data[i].no = no + i + 1
+              // 计算使用授信和授信还款的合计
+              data[i].useTotalAmount = this.getTotal(data[i].detailItemUseList)
+              data[i].payTotalAmount = this.getTotal(data[i].detailItemPayList)
             }
             this.total = data.length
             this.disabled = false
@@ -124,27 +164,43 @@ export default {
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '日期', dataIndex: 'accountTypeDictValue', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'accountName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '客户编码', dataIndex: 'subareaNames', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '营业执照名称', dataIndex: 'provinceName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '订单金额', dataIndex: 'cityName', align: 'center', width: '8%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
-        { title: '收款金额', dataIndex: 'expense', align: 'center', width: '8%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
-        { title: '使用授信', dataIndex: 'expense', align: 'center', width: '8%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
-        { title: '授信还款', dataIndex: 'expense', align: 'center', width: '8%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
-        { title: '跨月打款', dataIndex: 'expense', align: 'center', width: '8%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
-        { title: '户名', dataIndex: 'subareaNames', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '汇入银行', dataIndex: 'provinceName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '足额打款', dataIndex: 'expense', align: 'center', width: '8%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
-        { title: '备注', dataIndex: 'remarks', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '100px', align: 'center' }
+        { title: '收款日期', dataIndex: 'receiptDate', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '客户编码', dataIndex: 'dealerEntity.dealerCode', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '营业执照名称', dataIndex: 'dealerEntity.licenseName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '订单金额', dataIndex: 'orderAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
+        { title: '收款金额', dataIndex: 'receiptAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
+        { title: '使用授信', dataIndex: 'useTotalAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
+        { title: '授信还款', dataIndex: 'payTotalAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
+        { title: '跨月打款', dataIndex: 'nextMonthAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
+        { title: '户名', dataIndex: 'bankAccount', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
+        { title: '汇入银行', dataIndex: 'bankName', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
+        { title: '足额打款', dataIndex: 'fullPaymentFlagDictValue', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
+        { title: '备注', dataIndex: 'remarks', align: 'center', width: '13%', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ],
+      useCol: [
+        { title: '使用授信项目', dataIndex: 'itemName', width: '50%', align: 'center' },
+        { title: '使用授信金额', dataIndex: 'itemAmount', width: '50%', align: 'center' }
+      ],
+      payCol: [
+        { title: '授信还款项目', dataIndex: 'itemName', width: '50%', align: 'center' },
+        { title: '授信还款金额', dataIndex: 'itemAmount', width: '50%', align: 'center' }
       ]
     }
   },
   methods: {
+    getTotal (data) {
+      let ret = 0
+      data.map(item => {
+        ret = ret + item.itemAmount
+      })
+      return ret.toFixed(2)
+    },
     // 编辑基础信息
     handleEditBase (event) {
       this.openBaseModal = true
+      this.$refs.baseModal.getDetail()
     },
     refashData () {
       this.getDetail(1)
@@ -153,13 +209,12 @@ export default {
     getDetail (type) {
       this.spinning = true
       this.disabled = true
-      expenseAccountDetail({ expenseAccountSn: this.$route.params.sn }).then(res => {
+      financeBookFindBySn({ bookSn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.detailData = res.data
-          this.detailData.content = res.data.content.replace(/\n+/, '\n').split('\n')
           if (!type) {
-            // 获取财务明细列表
-            this.getExpenseDetailList()
+            // 刷新明细列表
+            this.$refs.table.refresh()
           } else {
             this.spinning = false
             this.disabled = false
@@ -167,45 +222,17 @@ export default {
         }
       })
     },
-    getExpenseDetailList () {
-      this.$refs.table.refresh()
-    },
-    // 确认导入明细
-    hanldeImprotOk (obj) {
-      console.log(obj)
-      expenseInsertImport(obj).then(res => {
-        if (res.status == 200) {
-          this.getDetail(false)
-        }
-      })
-    },
-    // 新增明细
-    newExpenseDetail () {
-      this.expenseAccountDetailSn = ''
-      this.openEpenseDetailModal = true
-    },
     // 新增明细成功
-    epenseDetailOk () {
-      // 刷新列表
-      this.openEpenseDetailModal = false
+    fcDetailOk () {
+      this.openFcDetailModal = false
       this.getDetail(false)
     },
-    // 设置产品
-    setProduct (row) {
-      this.openProductInfoModal = true
-      this.expenseAccountDetailSn = row.expenseAccountDetailSn
-      this.$refs.productInfo.setBaseData(row)
-    },
-    // 新增产品成功
-    productInfoOk () {
-      // 刷新列表
-      this.openProductInfoModal = false
-      this.getDetail(false)
-    },
-    // 编辑明细
+    // 新增、编辑明细
     handleEdit (row) {
-      this.openEpenseDetailModal = true
-      this.expenseAccountDetailSn = row.expenseAccountDetailSn
+      this.openFcDetailModal = true
+      if (row && row.bookDetailSn) {
+        this.$refs.fcDetailModal.getDetail(row.bookDetailSn)
+      }
     },
     // 删除明细
     handleDel (row) {
@@ -217,7 +244,7 @@ export default {
         closable: true,
         onOk () {
           _this.spinning = true
-          expenseAcctDetailDelete({ detailSn: row.expenseAccountDetailSn }).then(res => {
+          financeBookDetailDelete({ bookDetailSn: row.bookDetailSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.getDetail(false)
@@ -239,7 +266,7 @@ export default {
     // 提交信息
     handleSubmit (data) {
       this.spinning = true
-      expenseAccountSubmit({ expenseAccountSn: this.$route.params.sn, ...data }).then(res => {
+      financeBookSubmit({ bookSn: this.$route.params.sn, ...data }).then(res => {
         if (res.status == '200') {
           this.$message.success(res.message)
           this.handleBack()
@@ -249,7 +276,7 @@ export default {
     },
     // 返回
     handleBack (data) {
-      this.$router.push({ name: 'expenseReimbursementList' })
+      this.$router.push({ name: 'financialCollectionList' })
     },
     pageInit () {
       if (this.$route.params.sn) { //  编辑页
@@ -275,7 +302,7 @@ export default {
 </script>
 
 <style lang="less">
-  .expenseReimbursementAddwrap{
+  .financialCollectionAddwrap{
     position: relative;
     height: 100%;
     padding-bottom: 51px;
@@ -284,7 +311,7 @@ export default {
       overflow-y: scroll;
       height: 100%;
     }
-    .expenseReimbursementAddcont{
+    .financialCollectionAddcont{
       margin-bottom: 10px;
     }
     .affix{

+ 362 - 0
src/views/financialManagement/financialCollection/fcDetailModal.vue

@@ -0,0 +1,362 @@
+<template>
+  <a-modal
+    v-model="opened"
+    :title="title"
+    centered
+    :maskClosable="false"
+    width="60%"
+    :footer="null"
+    @cancel="cancel"
+  >
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol">
+        <a-row>
+          <a-col :span="12">
+            <a-form-model-item label="收款日期" prop="receiptDate">
+              <a-date-picker inputReadOnly style="width:100%" format="YYYY-MM-DD" v-model="form.receiptDate" placeholder="请选择收款日期" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item label="客户名称" prop="dealerSn">
+              <dealerSubareaScopeList ref="settleClientName" @change="custChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom:5px;" label="客户编码">
+              <a-input :maxLength="100" placeholder="请输入客户编码" v-model="form.dealerCode"></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom:5px;" label="营业执照名称">
+              <a-input :maxLength="100" placeholder="请输入营业执照名称" v-model="form.licenseName"></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom:5px;" label="订单金额">
+              <a-input-number
+                style="width:100%"
+                :min="0"
+                :max="999999"
+                :precision="2"
+                placeholder="请输入订单金额"
+                v-model="form.orderAmount"></a-input-number>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom:5px;" label="收款金额">
+              <a-input-number
+                style="width:100%"
+                :min="0"
+                :max="999999"
+                :precision="2"
+                placeholder="请输入收款金额"
+                v-model="form.receiptAmount"></a-input-number>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom:5px;" label="使用授信">
+              <a-checkbox v-model="form.useCreditFlag">是</a-checkbox>
+              <span v-if="form.useCreditFlag">合计: {{ useTotalAmount||'--' }}</span>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom:5px;" label="授信还款">
+              <a-checkbox v-model="form.payCreditFlag">是</a-checkbox>
+              <span v-if="form.payCreditFlag">合计:  {{ payTotalAmount||'--' }}</span>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom:5px;" label="余款抵扣">
+              <a-input-number
+                style="width:100%"
+                :min="0"
+                :max="999999"
+                :precision="2"
+                placeholder="请输入余款抵扣"
+                v-model="form.balanceAmount"></a-input-number>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom:5px;" label="跨月打款">
+              <a-input-number
+                style="width:100%"
+                :min="0"
+                :max="999999"
+                :precision="2"
+                placeholder="请输入跨月打款金额"
+                v-model="form.nextMonthAmount"></a-input-number>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom:5px;" label="户名">
+              <a-select placeholder="请选择户名" v-model="form.bankAccount" style="width: 100%" @change="handleChange">
+                <a-select-option v-for="item in bankList" :value="item.bankAccount">
+                  {{ item.bankAccount }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom:5px;" label="汇入银行">
+              <a-select placeholder="请选择汇入银行" v-model="form.bankName" style="width: 100%">
+                <a-select-option v-for="item in bankNameList" :value="item">
+                  {{ item }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom:5px;" label="足额打款">
+              <v-select
+                v-model="form.fullPaymentFlag"
+                code="FLAG"
+                placeholder="请选择是否足额打款"
+                allowClear></v-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item style="margin-bottom:5px;" label="备注" :labelCol="{span:3}" :wrapper-col="{ span: 20 }">
+              <a-textarea :rows="2" :maxLength="500" placeholder="请输入备注(最多500个字符)" v-model="form.remarks"></a-textarea>
+            </a-form-model-item>
+          </a-col>
+          <!-- 使用授信列表 -->
+          <a-col :span="22" :offset="1" v-if="form.useCreditFlag">
+            <div style="padding:10px 0">使用授信项目:</div>
+            <fcDetailSxItem title="使用授信" @updateItemAmount="updateUseAmount" :list="form.detailItemUseList" ref="useCreditItem"></fcDetailSxItem>
+          </a-col>
+          <!-- 授信还款列表 -->
+          <a-col :span="22" :offset="1" v-if="form.payCreditFlag">
+            <div style="padding:10px 0">授信还款项目:</div>
+            <fcDetailSxItem title="授信还款" @updateItemAmount="updatePayAmount" :list="form.detailItemPayList" ref="payCreditItem"></fcDetailSxItem>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 50px;">
+              <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+              <a-button @click="cancel" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import moment from 'moment'
+import { commonMixin } from '@/utils/mixin'
+import { VSelect, Upload } from '@/components'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import fcDetailSxItem from './fcDetailSxItem.vue'
+import { financeBookDetailSave, financeBookDetailQueryBySn } from '@/api/financeBook.js'
+export default {
+  name: 'FcDetailModal',
+  mixins: [commonMixin],
+  components: { VSelect, Upload, dealerSubareaScopeList, fcDetailSxItem },
+  props: {
+    show: {
+      type: [Boolean],
+      default: false
+    },
+    bookSn: {
+      type: String,
+      default: ''
+    },
+    bookNo: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      opened: this.show,
+      spinning: false,
+      disabled: false,
+      title: '新增收款明细',
+      confirmLoading: false,
+      bookDetailSn: '',
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        dealerSn: undefined,
+        dealerName: '',
+        receiptDate: '',
+        dealerCode: '',
+        licenseName: '',
+        orderAmount: '',
+        receiptAmount: '',
+        useCreditFlag: false,
+        detailItemUseList: [],
+        payCreditFlag: false,
+        detailItemPayList: [],
+        balanceAmount: '',
+        nextMonthAmount: '',
+        bankAccount: undefined,
+        bankName: undefined,
+        fullPaymentFlag: undefined,
+        remarks: ''
+      },
+      rules: {
+        receiptDate: [ { required: true, message: '请选择收款日期', trigger: ['change', 'blur'] } ],
+        dealerSn: [ { required: true, message: '请选择客户', trigger: ['change', 'blur'] } ]
+      },
+      useTotalAmount: '',
+      payTotalAmount: '',
+      bankList: [
+        {
+          bankAccount: '张丽友',
+          bankName: ['建设银行', '微信收款']
+        },
+        {
+          bankAccount: '张丽添',
+          bankName: ['农业银行']
+        },
+        {
+          bankAccount: '东莞箭冠',
+          bankName: ['东莞银行']
+        },
+        {
+          bankAccount: '江西箭冠',
+          bankName: ['九江银行']
+        }
+      ],
+      bankNameList: []
+    }
+  },
+  methods: {
+    handleChange (v) {
+      console.log(v)
+      const row = this.bankList.find(item => item.bankAccount == v)
+      this.bankNameList = row.bankName
+    },
+    // 客户
+    custChange (v) {
+      this.form.dealerSn = v.key
+      this.form.dealerName = v.name
+      this.form.licenseName = v.row ? v.row.licenseName : ''
+      this.form.dealerCode = v.row ? v.row.dealerCode : ''
+    },
+    updateUseAmount (v) {
+      this.useTotalAmount = v
+    },
+    updatePayAmount (v) {
+      this.payTotalAmount = v
+    },
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.salesSaveFun()
+        } else {
+          return false
+        }
+      })
+    },
+    validItem (data) {
+      return data.find(item => !item.itemName || !item.itemAmount)
+    },
+    // 新建或编辑销售单
+    salesSaveFun () {
+      const _this = this
+      const form = JSON.parse(JSON.stringify(_this.form))
+      form.receiptDate = moment(form.receiptDate).format('YYYY-MM-DD')
+      form.payCreditFlag = form.payCreditFlag ? 1 : 0
+      form.useCreditFlag = form.useCreditFlag ? 1 : 0
+      form.bookSn = this.bookSn
+      form.bookNo = this.bookNo
+      delete form.dealerName
+      delete form.licenseName
+      delete form.dealerCode
+      console.log(form)
+      if ((form.useCreditFlag && form.detailItemUseList.length == 0) || this.validItem(form.detailItemUseList)) {
+        this.$message.info('使用授信项目不能为空')
+        return
+      }
+      if ((form.payCreditFlag && form.detailItemPayList.length == 0) || this.validItem(form.detailItemPayList)) {
+        this.$message.info('授信还款项目不能为空')
+        return
+      }
+      _this.spinning = true
+      financeBookDetailSave(form).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$emit('refashData')
+          _this.cancel()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    //  详情
+    getDetail (bookDetailSn) {
+      this.spinning = true
+      this.confirmLoading = true
+      this.title = '编辑收款明细'
+      this.bookDetailSn = bookDetailSn
+      financeBookDetailQueryBySn({ bookDetailSn: this.bookDetailSn }).then(res => {
+        if (res.status == 200) {
+          const data = res.data
+          this.form = Object.assign(this.form, data)
+          this.form.receiptDate = moment(this.form.receiptDate).format('YYYY-MM-DD')
+          this.form.payCreditFlag = this.form.payCreditFlag == 1
+          this.form.useCreditFlag = this.form.useCreditFlag == 1
+          // 回显客户
+          if (this.form.dealerSn) {
+            this.$refs.settleClientName.getDetail(this.form.dealerSn)
+          }
+        }
+        this.spinning = false
+        this.confirmLoading = false
+      })
+    },
+    cancel () {
+      this.opened = false
+      this.$emit('cancel')
+      this.pageInit()
+    },
+    pageInit () {
+      this.$nextTick(() => {
+        this.title = '新增收款明细'
+        this.$refs.ruleForm.resetFields()
+        this.$refs.settleClientName.resetForm()
+        this.form = {
+          dealerSn: undefined,
+          dealerName: '',
+          receiptDate: '',
+          dealerCode: '',
+          licenseName: '',
+          orderAmount: '',
+          receiptAmount: '',
+          useCreditFlag: false,
+          detailItemUseList: [],
+          payCreditFlag: false,
+          detailItemPayList: [],
+          balanceAmount: '',
+          nextMonthAmount: '',
+          bankAccount: undefined,
+          bankName: undefined,
+          fullPaymentFlag: undefined,
+          remarks: ''
+        }
+      })
+    }
+  },
+  watch: {
+    show (newValue, oldValue) {
+      this.opened = newValue
+      if (!newValue) {
+        this.pageInit()
+      }
+    }
+  }
+}
+</script>

+ 81 - 0
src/views/financialManagement/financialCollection/fcDetailSxItem.vue

@@ -0,0 +1,81 @@
+<template>
+  <div>
+    <a-table bordered :pagination="false" :columns="columns" :data-source="detailItemList">
+      <template slot="itemName" slot-scope="text, record">
+        <a-input v-model="record.itemName" :maxLength="20" :placeholder="'请输入'+title+'项目'"></a-input>
+      </template>
+      <template slot="itemAmount" slot-scope="text, record">
+        <a-input-number
+          style="width:100%"
+          :min="0"
+          :max="999999"
+          :precision="2"
+          :placeholder="'请输入'+title+'金额'"
+          @change="getTotal"
+          v-model="record.itemAmount"></a-input-number>
+      </template>
+      <template slot="action" slot-scope="text, record,index">
+        <a-button
+          size="small"
+          type="link"
+          class="button-error"
+          @click="delItem(record,index)"
+        >删除</a-button>
+      </template>
+    </a-table>
+    <div style="border:1px solid #eee;border-top:0;"><a-button @click="addItem" type="link" ghost class="button-info" block>+ 新增{{ title }}明细</a-button></div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'SxItemList',
+  props: {
+    title: {
+      type: String,
+      default: ''
+    },
+    list: [Array]
+  },
+  data () {
+    return {
+      // 使用授信合集
+      columns: [
+        { title: this.title + '项目', scopedSlots: { customRender: 'itemName' }, width: '45%', align: 'center' },
+        { title: this.title + '金额', scopedSlots: { customRender: 'itemAmount' }, width: '45%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ],
+      detailItemList: this.list
+    }
+  },
+  mounted () {
+    if (this.detailItemList.length == 0) {
+      this.addItem()
+    }
+    this.getTotal()
+  },
+  methods: {
+    getTotal () {
+      let ret = 0
+      this.detailItemList.map(item => {
+        ret = ret + item.itemAmount
+        delete item.id
+      })
+      this.$emit('updateItemAmount', ret)
+    },
+    addItem () {
+      this.detailItemList.push({
+        itemName: '',
+        itemAmount: ''
+      })
+    },
+    delItem (row, index) {
+      this.detailItemList.splice(index, 1)
+      this.getTotal()
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 152 - 84
src/views/financialManagement/financialCollection/list.vue

@@ -7,12 +7,12 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeAuditDate" :value="auditDate" @change="dateAuditChange" />
+                <rangeDate ref="rangeDate" :value="creatDate" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="收款单号">
-                <a-input id="financialCollectionList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入收款单号"/>
+                <a-input id="financialCollectionList-bookNo" v-model.trim="queryParam.bookNo" allowClear placeholder="请输入收款单号"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -23,12 +23,12 @@
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-item label="申请人">
-                  <a-input id="financialCollectionList-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入申请人"/>
+                  <employee style="width: 100%;" id="financialCollectionList-Employee" placeholder="请选择申请人" v-model="queryParam.applyPersonSn"></employee>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="收款事由">
-                  <a-input id="financialCollectionList-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入收款事由"/>
+                  <a-input id="financialCollectionList-bookReason" v-model.trim="queryParam.bookReason" allowClear placeholder="请输入收款事由"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -39,10 +39,10 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="状态">
                   <v-select
-                    v-model="queryParam.voidFlag"
-                    ref="voidFlag"
-                    id="financialCollectionList-voidFlag"
-                    code="VOID_FLAG"
+                    v-model="queryParam.status"
+                    ref="status"
+                    id="financialCollectionList-status"
+                    code="FINANCE_BOOK_STATE"
                     placeholder="请选择状态"
                     allowClear></v-select>
                 </a-form-item>
@@ -76,76 +76,103 @@
         :defaultLoadData="false"
         bordered>
         <!-- 单号 -->
-        <template slot="bizNo" slot-scope="text, record">
-          <span v-if="$hasPermissions('B_salesDetail')" class="link-bule" @click="handleDetail(record)">{{ record.bizNo }}</span>
-          <span v-else>{{ record.bizNo }}</span>
+        <template slot="bookNo" slot-scope="text, record">
+          <span v-if="$hasPermissions('B_salesDetail')" class="link-bule" @click="handleDetail(record)">{{ record.bookNo }}</span>
+          <span v-else>{{ record.bookNo }}</span>
         </template>
-        <!-- 下推单号 -->
-        <template slot="dispatchBillNo" slot-scope="text, record">
-          <span v-if="$hasPermissions('B_dispatchDetail')" class="link-bule" @click="handleBhDetail(record)">{{ record.dispatchBillNo }}</span>
-          <span v-else>{{ record.dispatchBillNo || '--' }}</span>
+        <!-- 关联备货单 -->
+        <template slot="dispatchNum" slot-scope="text, record">
+          <span v-if="$hasPermissions('B_dispatchDetail')&&record.dispatchNum" class="link-bule" @click="handleBhDetail(record)">{{ record.dispatchNum }}</span>
+          <span v-else>{{ record.dispatchNum || '--' }}</span>
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
+            v-if="record.status=='WAIT_SUBMIT'&&$hasPermissions('B_ERtEdit')"
             size="small"
             type="link"
-            class="button-warning"
+            class="button-info"
             @click="handleEdit(record)"
-            id="financialCollectionList-audit-btn">编辑</a-button>
+          >
+            编辑
+          </a-button>
+          <a-button
+            v-if="record.status=='WAIT_SUBMIT'&&$hasPermissions('B_ERDel')"
+            size="small"
+            type="link"
+            class="button-error"
+            @click="handleDel(record)"
+          >
+            删除
+          </a-button>
+          <a-button
+            v-if="record.status!='WAIT_SUBMIT'&&$hasPermissions('B_ERAudit')"
+            size="small"
+            type="link"
+            class="button-info"
+            @click="handleSH(record)"
+          >
+            审核进度
+          </a-button>
+          <a-button
+            v-if="record.status=='AUDIT_REJECT'"
+            size="small"
+            type="link"
+            class="button-info"
+            @click="againEdit(record)"
+          >
+            再次编辑
+          </a-button>
         </template>
       </s-table>
     </a-spin>
+    <!-- 审核进度 -->
+    <verifyModal :openModal="openModal" :itemSn="itemSn" @close="openModal=false"></verifyModal>
     <!-- 基础信息 -->
-    <baseModal :show="openModal" @cancel="openModal=false"></baseModal>
+    <baseModal :show="baseModal" @cancel="baseModal=false"></baseModal>
   </a-card>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
-import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import baseModal from './baseModal.vue'
-import { settleReceiptList, settleReceipt } from '@/api/settleReceipt'
+import employee from '../../expenseManagement/expenseReimbursement/employee.js'
+import verifyModal from './verifyModal.vue'
+import { financeBookQueryPage, financeBookDeleteBySn, financeBookDgainEditBySn } from '@/api/financeBook.js'
 export default {
   name: 'FinancialCollectionList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, baseModal },
+  components: { STable, VSelect, rangeDate, baseModal, employee, verifyModal },
   data () {
     return {
       spinning: false,
       openModal: false,
+      baseModal: false,
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: getDate.getThreeMonthDays().starttime + ' 00:00:00',
-        endDate: getDate.getCurrMonthDays().endtime + ' 23:59:59',
-        bizNo: '',
+        beginDate: '',
+        endDate: '',
+        bookNo: '',
         dispatchBillNo: '',
-        beginDateSettle: '',
-        endDateSettle: '',
-        settleClientName: '',
-        dealerLevel: undefined,
-        settleStyle: undefined,
-        billStatus: undefined,
-        settleState: undefined,
-        voidFlag: undefined,
-        dealerProvinceSn: undefined,
-        dealerCitySn: undefined,
-        dealerCountySn: undefined
+        auditBeginDate: '',
+        auditEndDate: '',
+        applyPersonSn: undefined,
+        bookReason: '',
+        status: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
-      auditDate: [
-        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
-        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
-      ], //  审核时间
+      creatDate: [], //  创建时间
+      auditDate: [], // 审核时间
       advanced: false,
+      itemSn: null,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return settleReceiptList(Object.assign(parameter, this.queryParam)).then(res => {
+        return financeBookQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -160,10 +187,7 @@ export default {
           return data
         })
       },
-      total: 0, // 合计
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+      total: 0 // 合计
     }
   },
   // 根据权限显示列表字段
@@ -171,69 +195,113 @@ export default {
     columns () {
       const arr = [
         { title: '创建时间', dataIndex: 'createDate', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '收款单号', scopedSlots: { customRender: 'bizNo' }, width: '10%', align: 'center' },
-        { title: '关联备货单', scopedSlots: { customRender: 'dispatchBillNo' }, width: '10%', align: 'center' },
-        { title: '申请人', dataIndex: 'settleClientName', align: 'left', width: '9%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收款事由', dataIndex: 'dealerLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '订单总金额', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '收款总金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '授信总金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '余款抵扣总金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'settleTime', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', dataIndex: 'voidFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收款单号', scopedSlots: { customRender: 'bookNo' }, width: '10%', align: 'center' },
+        { title: '关联备货单', scopedSlots: { customRender: 'dispatchNum' }, width: '10%', align: 'center' },
+        { title: '申请人', dataIndex: 'applyPersonName', align: 'left', width: '9%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收款事由', dataIndex: 'bookReason', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '订单总金额', dataIndex: 'orderTotalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收款总金额', dataIndex: 'receiptTotalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '使用授信总金额', dataIndex: 'useTotalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '授信还款总金额', dataIndex: 'payTotalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '余款抵扣总金额', dataIndex: 'balanceTotalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditDate', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'statusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '4%', align: 'center' }
       ]
       return arr
     }
   },
   methods: {
-    //  审核时间  change
-    dateAuditChange (date) {
+    //  创建时间  change
+    dateChange (date) {
       this.queryParam.beginDate = date[0] ? date[0] + ' 00:00:00' : ''
       this.queryParam.endDate = date[1] ? date[1] + ' 23:59:59' : ''
     },
-    //  收款时间  change
-    dateSettleChange (date) {
-      this.queryParam.beginDateSettle = date[0] ? date[0] + ' 00:00:00' : ''
-      this.queryParam.endDateSettle = date[1] ? date[1] + ' 23:59:59' : ''
+    //  审核时间  change
+    dateAuditChange (date) {
+      this.queryParam.auditBeginDate = date[0] ? date[0] + ' 00:00:00' : ''
+      this.queryParam.auditEndDate = date[1] ? date[1] + ' 23:59:59' : ''
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeAuditDate.resetDate(this.auditDate)
-      if (this.advanced) { //  查询条件未展开时,该组件未渲染
-        this.$refs.rangeSettleDate.resetDate()
+      this.creatDate = []
+      this.$refs.rangeDate.resetDate(this.creatDate)
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.auditDate = []
+      if (this.advanced) {
+        this.$refs.rangeAuditDate.resetDate(this.auditDate)
       }
-      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime + ' 00:00:00'
-      this.queryParam.endDate = getDate.getCurrMonthDays().endtime + ' 23:59:59'
-      this.queryParam.bizNo = ''
+      this.queryParam.auditBeginDate = ''
+      this.queryParam.auditEndDate = ''
+      this.queryParam.bookNo = ''
       this.queryParam.dispatchBillNo = ''
-      this.queryParam.beginDateSettle = ''
-      this.queryParam.endDateSettle = ''
-      this.queryParam.settleClientName = ''
-      this.queryParam.dealerLevel = undefined
-      this.queryParam.settleStyle = undefined
-      this.queryParam.billStatus = undefined
-      this.queryParam.settleState = undefined
-      this.queryParam.voidFlag = undefined
-      this.queryParam.dealerProvinceSn = undefined
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
+      this.queryParam.applyPersonSn = ''
+      this.queryParam.bookReason = ''
+      this.queryParam.status = undefined
       this.$refs.table.refresh(true)
     },
     // 新增
     handleAdd () {
-      this.openModal = true
+      this.baseModal = true
+    },
+    // 查看关联备货单
+    handleBhDetail (row) {
     },
     // 详情
     handleDetail (row) {
-      this.$router.push({ name: 'salesDetail', params: { sn: row.bizSn, type: 'financialCollection' } })
-    },
-    handleBhDetail (row) {
-      this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'financialCollection' } })
+      this.$router.push({ name: 'financialCollectionDetail', params: { sn: row.bookSn } })
     },
     // 编辑
     handleEdit (row) {
-      this.$router.push({ name: 'financialCollectionEdit', params: { sn: row.bizSn } })
+      this.$router.push({ name: 'financialCollectionEdit', params: { sn: row.bookSn } })
+    },
+    // 删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.spinning = true
+          financeBookDeleteBySn({ bookSn: row.bookSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    // 审核进度
+    handleSH (row) {
+      this.openModal = true
+      this.itemSn = row.bookSn
+    },
+    // 再次编辑
+    againEdit (row) {
+      const _this = this
+      this.$confirm({
+        title: '操作提示',
+        content: '系统将自动生成一个新的费用报销单,与原审核不通过的单据内容相同。您可以对新单据进行编辑、提交等操作,原单据保持不变,确认操作吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.spinning = true
+          financeBookDgainEditBySn({ bookSn: row.bookSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.resetSearchForm()
+            }
+            _this.spinning = false
+          })
+        }
+      })
     },
     pageInit () {
       const _this = this
@@ -243,7 +311,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 195
+      this.tableHeight = window.innerHeight - tableSearchH - 235
     }
   },
   watch: {

+ 98 - 0
src/views/financialManagement/financialCollection/verifyModal.vue

@@ -0,0 +1,98 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    title="财务收款单审核进度"
+    v-model="isShow"
+    @cancle="isShow=false"
+    width="50%">
+    <p>说明:以下信息来自钉钉</p>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: 500 }"
+        :showPagination="false"
+        :defaultLoadData="true"
+        bordered>
+      </s-table>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { getProcessInstance } from '@/api/expenseManagement'
+export default {
+  name: 'VerifyModal',
+  components: { STable },
+  props: {
+    openModal: {
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal,
+      columns: [{ title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '人员姓名', width: '12%', dataIndex: 'userName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '人员类型', dataIndex: 'userType', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'state', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审批意见', dataIndex: 'remark', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '附件', dataIndex: 'hasAttachments', width: '20%', align: 'center', customRender: function (text) { return text != '0' ? '请在钉钉中查看附件内容' : '--' } },
+        { title: '操作时间', dataIndex: 'date', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        delete parameter.tableId
+        delete parameter.index
+        return getProcessInstance({ businessType: 'FINANCE_BOOK', businessSn: this.itemSn }).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  watch: {
+    openModal (nVal, oVal) {
+      this.isShow = nVal
+    },
+    isShow (nVal, oVal) {
+      if (!nVal) {
+        this.$emit('close')
+        this.$refs.table.clearTable()
+      } else {
+        this.$nextTick(() => {
+          this.$refs.table.refresh()
+        })
+      }
+    },
+    itemSn (nVal, oVal) {
+
+    }
+  }
+}
+</script>
+
+<style>
+</style>