lilei 3 settimane fa
parent
commit
bc6381fe1e

+ 56 - 11
src/api/verifyAccount.js

@@ -73,26 +73,60 @@ export const verifyAcountBillDetail = params => {
     }
   })
 }
-// 对账单管理  对账
-export const verifyAcountBillCheck = params => {
+// 对账单 提交前
+export const verifyAcountBillSubmitCheck = params => {
   return axios({
-    url: `/verifyAccountBill/check/${params.sn}/${params.state}`,
+    url: `/verifyAccountBill/submitCheck/${params.sn}`,
     data: {},
     method: 'get',
     headers: {
-      'module': encodeURIComponent('对账')
+      'module': encodeURIComponent('对账单提交前')
     }
   })
 }
- 
 // 对账单管理  提交
 export const verifyAcountBillSubmit = params => {
   return axios({
-    url: `/verifyAccountBill/submit`,
-    data: params,
-    method: 'post',
+    url: `/verifyAccountBill/submit/${params.sn}`,
+    data: {},
+    method: 'get',
+    headers: {
+      'module': encodeURIComponent('对账单提交')
+    }
+  })
+}
+
+// 对账单 对单前校验
+export const verifyAcountBillConfirmCheck = params => {
+  return axios({
+    url: `/verifyAccountBill/confirmCheck/${params.sn}`,
+    data: {},
+    method: 'get',
     headers: {
-      'module': encodeURIComponent('提交')
+      'module': encodeURIComponent('对单前校验')
+    }
+  })
+}
+// 对账单 对单
+export const verifyAcountBillConfirm = params => {
+  return axios({
+    url: `/verifyAccountBill/confirm/${params.sn}`,
+    data: {},
+    method: 'get',
+    headers: {
+      'module': encodeURIComponent('对单')
+    }
+  })
+}
+
+// 对账单管理  对账
+export const verifyAcountBillVerify = params => {
+  return axios({
+    url: `/verifyAccountBill/verify/${params.sn}`,
+    data: {},
+    method: 'get',
+    headers: {
+      'module': encodeURIComponent('对账')
     }
   })
 }
@@ -141,7 +175,7 @@ export const verifyAcountBillDetailDel = params => {
     data: params,
     method: 'post',
     headers: {
-      'module': encodeURIComponent('对账单单据详情批量删除')
+      'module': encodeURIComponent('对账单单据详情列表批量删除')
     }
   })
 } 
@@ -152,7 +186,18 @@ export const verifyAcountBillDetailSave = params => {
     data: params,
     method: 'post',
     headers: {
-      'module': encodeURIComponent('对账单单据详情批量添加')
+      'module': encodeURIComponent('对账单单据详情列表批量添加')
+    }
+  })
+} 
+// 对账单管理  详情 修改
+export const verifyAcountBillDetailModify = params => {
+  return axios({
+    url: '/verifyAccountBillDetail/modify',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('对账单单据详情列表备注修改')
     }
   })
 } 

+ 76 - 0
src/api/verifyAccountChange.js

@@ -0,0 +1,76 @@
+import { axios } from '@/utils/request'
+
+//  调账调账 列表  分页
+export const verifyAccountChangeList = (params) => {
+  const url = `/verifyAccountChange/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+// 经销商余额-分页列表
+export const verifyAccountChangeDealerBalanceList = (params) => {
+  const url = `/verifyAccountChange/queryDealerBalancePage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('经销商余额列表查询')
+    }
+  })
+}
+
+// 调账保存
+export const verifyAccountChangeSave = params => {
+  return axios({
+    url: '/verifyAccountChange/save',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('创建调账')
+    }
+  })
+}
+// 调账调账  删除
+export const verifyAccountChangeDel = params => {
+  return axios({
+    url: `/verifyAccountChange/deleteBySn/${params.sn}`,
+    data: {},
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('删除调账')
+    }
+  })
+}
+// 调账调账  详情
+export const verifyAccountChangeDetail = params => {
+  return axios({
+    url: `/verifyAccountChange/queryBySn/${params.sn}`,
+    data: {},
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('查看调账详情')
+    }
+  })
+}
+ 
+// 调账调账  提交
+export const verifyAcountBillSubmit = params => {
+  return axios({
+    url: `/verifyAccountChange/submit`,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('调账提交')
+    }
+  })
+}

+ 3 - 2
src/components/Select/index.js

@@ -44,6 +44,9 @@ export default {
   watch: {
     notIn (newVal, oldVal) {
       this.getDataList()
+    },
+    code (newVal, oldVal) {
+      this.getDataList()
     }
   },
   methods: {
@@ -56,7 +59,6 @@ export default {
     },
     getDataList () {
       const _this = this
-      // console.log(_this.code, '_this.code')
       getLookUpData({
         pageNo: 1,
         pageSize: 1000,
@@ -79,7 +81,6 @@ export default {
     },
     // 根据名称 获取code
     getCodeByName (dispName) {
-      console.log(this.dataList)
       return this.datalist.find(item => item.dispName == dispName)
     }
   },

+ 1 - 1
src/views/dealerManagement/merchantInfoManagement/detailModal.vue

@@ -14,7 +14,7 @@
         <a-card title="基础信息" size="small" style="margin-bottom: 15px;">
           <a-descriptions :column="2" bordered size="small">
             <a-descriptions-item label="经销商名称">{{ form&&form.dealerName ? form.dealerName : '--' }}</a-descriptions-item>
-            <a-descriptions-item label="经销商别名">{{ form&&form.dealerAlias ? form.dealerAlias : '--' }}</a-descriptions-item>
+            <a-descriptions-item label="商别名">{{ form&&form.dealerAlias ? form.dealerAlias : '--' }}</a-descriptions-item>
             <a-descriptions-item label="商户类型">{{ form&&form.dealerTypeName1 ? form.dealerTypeName1+'>'+form.dealerTypeName2 : '--' }}</a-descriptions-item>
             <a-descriptions-item label="联系人1">{{ form&&form.contact ? form.contact : '--' }}</a-descriptions-item>
             <a-descriptions-item label="联系手机1">{{ form&&form.contactMobile ? form.contactMobile : '--' }}</a-descriptions-item>

+ 3 - 3
src/views/dealerManagement/merchantInfoManagement/edit.vue

@@ -25,8 +25,8 @@
                   </a-form-model-item>
                 </a-col>
                 <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                  <a-form-model-item label="经销商别名" prop="dealerAlias">
-                    <a-input v-model.trim="form.dealerAlias" id="merchantInfoManagementEdit-dealerAlias" :maxLength="30" allowClear placeholder="请输入经销商别名(最多30个字符)" />
+                  <a-form-model-item label="商别名" prop="dealerAlias">
+                    <a-input v-model.trim="form.dealerAlias" id="merchantInfoManagementEdit-dealerAlias" :maxLength="30" allowClear placeholder="请输入商别名(最多30个字符)" />
                   </a-form-model-item>
                 </a-col>
                 <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
@@ -443,7 +443,7 @@ export default {
       dealerType: [], // 商户类型
       form: {
         dealerName: '', // 经销商名称
-        dealerAlias: '', // 经销商别名
+        dealerAlias: '', // 商别名
         dealerType1: undefined, // 商户类型1
         dealerType2: undefined, // 商户类型2
         contact: '', // 联系人1

+ 1 - 1
src/views/dealerManagement/merchantInfoManagement/list.vue

@@ -11,7 +11,7 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="商名称/别名">
+              <a-form-item label="经销商名称/商户别名">
                 <a-input id="merchantInfoManagementList-nameLike" v-model.trim="queryParam.nameLike" allowClear placeholder="请输入商户名称/别名"/>
               </a-form-item>
             </a-col>

+ 3 - 3
src/views/financialManagement/accountStatement/baseModal.vue

@@ -72,8 +72,8 @@ export default {
     // 客户
     custChange (v) {
       if (v && v.key) {
-        this.form.dealerSn = v.key
-        this.form.dealerName = v.row ? v.row.dealerName : ''
+        this.form.dealerSn = v.row ? v.row.dealerSn : ''
+        this.form.dealerName = v.key
       } else {
         this.form.dealerSn = ''
         this.form.dealerName = ''
@@ -119,7 +119,7 @@ export default {
       this.title = '编辑对账单'
       this.spinning = true
       this.confirmLoading = true
-      verifyAcountBillDetail({ verifyAccountBillSn: this.itemSn }).then(res => {
+      verifyAcountBillDetail({ sn: this.itemSn }).then(res => {
         if (res.status == 200) {
           const data = res.data
           this.form = Object.assign(this.form, data)

+ 152 - 50
src/views/financialManagement/accountStatement/confrontModal.vue

@@ -27,10 +27,10 @@
               <a-col :md="4" :sm="24">
                 <a-form-item label="借贷类型">
                   <v-select
-                    v-model="queryParam.status"
-                    ref="status"
-                    id="conFrontModal-status"
-                    code="FINANCE_BOOK_STATE"
+                    v-model="queryParam.changeType"
+                    ref="changeType"
+                    id="conFrontModal-changeType"
+                    code="VERIFY_ACCOUNT_CHANGE_TYPE"
                     placeholder="请选择状态"
                     allowClear></v-select>
                 </a-form-item>
@@ -41,7 +41,7 @@
                     v-model="queryParam.bizType"
                     ref="bizType"
                     id="conFrontModal-bizType"
-                    code="FINANCE_BOOK_STATE"
+                    code="VERIFY_ACCOUNT_BIZ_TYPE"
                     placeholder="请选择业务类型"
                     allowClear></v-select>
                 </a-form-item>
@@ -64,14 +64,6 @@
         </div>
       </a-card>
       <a-card size="small" :bordered="false" class="conFrontModal-wrap">
-        <div style="margin-bottom: 10px;">
-          <div class="conFrontModal-title">箭冠汽配 应收账款明细表</div>
-          <div class="conFrontModal-flex">
-            <div class="conFrontModal-subTitle"><span>营业执照名称:</span>{{ dealear.licenseName }}</div>
-            <div class="conFrontModal-subTitle"><span>系统名称:</span></div>
-            <div class="conFrontModal-subTitle"><span>财务编号:</span>{{ dealear.kdMidCustomerFnumber }}</div>
-          </div>
-        </div>
         <!-- 列表 -->
         <s-table
           class="sTable"
@@ -80,25 +72,29 @@
           :rowKey="(record) => record.id"
           :columns="columns"
           :data="loadData"
-          :pageSize="30"
+          :showPagination="false"
           :defaultLoadData="false"
           bordered>
         </s-table>
-        <div class="conFrontModal-info">
+        <div class="conFrontModal-info" v-if="detailData">
           备注:{{ detailData.remarks }}
         </div>
-        <div class="conFrontModal-flex">
+        <div class="conFrontModal-flex" v-if="detailData">
           <div class="conFrontModal-subTitle">
-            <div><span>公司名称:</span> 东莞市箭冠汽车配件制造有限公司</div>
+            <div><span>公司名称:</span> {{ detailData.signName }}</div>
             <div><span>签名:</span>{{ detailData.signName }}</div>
             <div><span>盖章</span></div>
           </div>
           <div class="conFrontModal-subTitle">
-            <div><span>公司名称:</span></div>
+            <div><span>公司名称:</span>{{ detailData.dealerName }}</div>
             <div><span>签名:</span></div>
             <div><span>盖章</span></div>
           </div>
         </div>
+        <div class="conFrontModal-footer-bar" v-if="detailData">
+          <a-button @click="cancel" style="margin-right: 15px" id="conFrontModal-btn-back">取消</a-button>
+          <a-button type="primary" v-if="orderType==1" :loading="confirmLoading" @click="handleSubmit" id="conFrontModal-btn-submit">对单</a-button>
+        </div>
       </a-card>
     </a-spin>
   </a-modal>
@@ -110,7 +106,9 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import {
   verifyAcountBillDetailQueryList,
-  verifyAcountBillDetail
+  verifyAcountBillDetail,
+  verifyAcountBillConfirmCheck,
+  verifyAcountBillConfirm
 } from '@/api/verifyAccount'
 
 export default {
@@ -118,17 +116,14 @@ export default {
   mixins: [commonMixin],
   components: { STable, VSelect, rangeDate },
   props: {
-    show: [Boolean],
-    bookSn: {
-      type: String,
-      default: ''
-    }
+    show: [Boolean]
   },
   data () {
     return {
       opened: this.show,
       spinning: false,
       disabled: false,
+      confirmLoading: false,
       title: '',
       exportLoading: false,
       queryParam: {
@@ -150,15 +145,24 @@ export default {
             data = res.data
             const no = 0
             for (var i = 0; i < data.length; i++) {
-              data.no = no + i + 1
+              data[i].no = no + i + 1
+              const dates = data[i].bizDate.split('-')
+              data[i].year = dates[0]
+              data[i].month = dates[1]
+              data[i].day = dates[2].split(' ')[0]
               // 正为借方, 负数为贷方
-              if (data.bizAmount > 0) {
-                data.debitAmount = data.bizAmount
+              if (data[i].bizAmount > 0) {
+                data[i].debitAmount = data[i].bizAmount
               } else {
-                data.creditorAmount = data.bizAmount
+                data[i].creditorAmount = data[i].bizAmount
               }
             }
-            this.total = data.count || 0
+            // data.push({ no: '备注:' + this.detailData.remarks })
+            // data.push({
+            //   no: '公司名称:东莞市箭冠汽车配件制造有限公司\n签名:' + (this.detailData.signName || '') + '\n盖章',
+            //   expenseAllocateType: '公司名称:' + this.dealear.dealerName + '\n签名:\n盖章'
+            // })
+            this.total = data.length || 0 + 1
             this.disabled = false
           }
           this.spinning = false
@@ -167,27 +171,91 @@ export default {
       },
       total: 0, // 合计
       detailData: null,
-      dealear: null
+      dealear: null,
+      verifyAccountBillSn: undefined,
+      orderType: 0
     }
   },
   computed: {
     columns () {
-      const arr = [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '年', dataIndex: 'year', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '月', dataIndex: 'month', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '日', dataIndex: 'day', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务单号', dataIndex: 'bizNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据类型', dataIndex: 'bizType', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '费用/调拨类型', dataIndex: 'expenseAllocateType', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '摘要', dataIndex: 'digestInfo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客诉索赔编码', dataIndex: 'productCode', width: '8%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
-        { title: '借方', dataIndex: 'debitAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? this.toThousands(text, 2) : '--') } },
-        { title: '贷方', dataIndex: 'creditorAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? this.toThousands(text, 2) : '--') } },
-        { title: '余额', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? this.toThousands(text, 2) : '--') } },
-        { title: '备注', dataIndex: 'remarks', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+      const _this = this
+      const renderContent = (value, row, index) => {
+        const obj = {
+          children: value || '--',
+          attrs: {}
+        }
+        return obj
+      }
+      return [
+        {
+          title: '箭冠汽配 应收账款明细表',
+          children: [
+            {
+              title: '营业执照名称',
+              children: [
+                {
+                  title: '财务编号',
+                  children: [
+                    { title: '序号',
+                      dataIndex: 'no',
+                      width: '4%',
+                      align: 'center',
+                      customRender: renderContent
+                    },
+                    { title: '年', dataIndex: 'year', width: '4%', align: 'center', customRender: renderContent },
+                    { title: '月', dataIndex: 'month', width: '4%', align: 'center', customRender: renderContent },
+                    { title: '日', dataIndex: 'day', width: '4%', align: 'center', customRender: renderContent },
+                    { title: '业务单号', dataIndex: 'bizNo', width: '8%', align: 'center', customRender: renderContent }
+                  ]
+                }
+              ]
+            },
+            {
+              title: this.dealear ? this.dealear.dealerName : '--',
+              children: [
+                {
+                  title: this.dealear ? this.dealear.kdMidCustomerFnumber : '--',
+                  children: [
+                    { title: '业务类型', dataIndex: 'bizTypeDictValue', width: '8%', align: 'center', customRender: renderContent },
+                    { title: '费用/调拨类型',
+                      dataIndex: 'expenseAllocateType',
+                      width: '8%',
+                      align: 'center',
+                      customRender: renderContent
+                    }
+                  ]
+                }
+              ]
+            },
+            {
+              title: '系统名称',
+              children: [
+                {
+                  title: '',
+                  children: [
+                    { title: '摘要', dataIndex: 'digestInfo', width: '10%', align: 'center', customRender: renderContent },
+                    { title: '客诉索赔编码', dataIndex: 'productCode', width: '8%', align: 'center', customRender: renderContent },
+                    { title: '借方', dataIndex: 'debitAmount', width: '6%', align: 'right', customRender: renderContent }
+                  ]
+                }
+              ]
+            },
+            {
+              title: this.dealear ? this.dealear.dealerAlias : '--',
+              children: [
+                {
+                  title: '',
+                  children: [
+                    { title: '贷方', dataIndex: 'creditorAmount', width: '6%', align: 'right', customRender: renderContent },
+                    { title: '余额', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: renderContent },
+                    { title: '备注', dataIndex: 'remarks', width: '15%', align: 'center', customRender: renderContent }
+                  ]
+                }
+              ]
+            }
+          ]
+        }
       ]
-      return arr
     }
   },
   methods: {
@@ -199,7 +267,9 @@ export default {
     //  重置
     resetSearchForm () {
       this.creatDate = []
-      this.$refs.rangeDate.resetDate(this.creatDate)
+      if (this.$refs.rangeDate) {
+        this.$refs.rangeDate.resetDate(this.creatDate)
+      }
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
       this.queryParam.bizNo = ''
@@ -210,9 +280,10 @@ export default {
     //  详情
     getDetail () {
       this.spinning = true
-      verifyAcountBillDetail({ verifyAccountBillSn: this.verifyAccountBillSn }).then(res => {
+      verifyAcountBillDetail({ sn: this.verifyAccountBillSn }).then(res => {
         this.detailData = res.data
         this.spinning = false
+        this.resetSearchForm()
       })
     },
     // 关闭弹框
@@ -223,9 +294,39 @@ export default {
     // 导出
     handleExport () {
 
+    },
+    // 对单
+    async handleSubmit () {
+      const _this = this
+      this.confirmLoading = true
+      const ret = await verifyAcountBillConfirmCheck({ sn: this.verifyAccountBillSn })
+      this.confirmLoading = false
+      console.log(ret)
+      const snList = ret.data.length ? ret.data.map(item => item.bizNo) : []
+      if (snList.length) {
+        this.$info({
+          title: '提示(' + _this.dealear.dealerName + ')',
+          content: <div style="font-size:14px;">{snList.toString()}不可对单</div>,
+          centered: true,
+          closable: true,
+          onOk () {
+          }
+        })
+      } else {
+        this.confirmLoading = true
+        verifyAcountBillConfirm({ sn: this.verifyAccountBillSn }).then(res => {
+          this.confirmLoading = false
+          this.$message.success('对单成功')
+          this.$emit('confirm')
+          this.cancel()
+        })
+      }
     },
     // 初始化
     async pageInit (row, dealear, type) {
+      // console.log(row, dealear, type)
+      this.orderType = type
+      this.verifyAccountBillSn = row.verifyAccountBillSn
       this.dealear = dealear
       this.title = type ? '对单' : '单据详情'
       this.getDetail()
@@ -234,9 +335,6 @@ export default {
   watch: {
     show (newValue, oldValue) {
       this.opened = newValue
-      if (newValue) {
-        this.pageInit()
-      }
     }
   }
 }
@@ -276,4 +374,8 @@ export default {
     line-height: 20px;
     color: #333;
   }
+  .conFrontModal-footer-bar{
+    text-align: center;
+    padding: 30px 0 20px;
+  }
 </style>

+ 94 - 47
src/views/financialManagement/accountStatement/edit.vue

@@ -20,13 +20,15 @@
           ref="partQuery"
           :newLoading="isInster"
           :addMoreLoading="addMoreLoading"
+          :itemSn="verifyAccountBillSn"
+          :dealerSn="dealerSn"
           @add="saveProduct"
           @bachAdd="saveMoreProduct"></queryPart>
       </a-card>
       <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
-        <a-alert style="margin-bottom: 10px;" type="info">
+        <a-alert style="margin-bottom: 10px;" type="info" v-if="countData">
           <div slot="message" class="total-bar">
-            <div v-if="countData">
+            <div>
               <span>余额:{{ countData && (countData.bizAmount || countData.bizAmount == 0) ? countData.bizAmount : '--' }};</span>
               <span>借方:{{ countData && (countData.borrowAmount || countData.borrowAmount == 0) ? countData.borrowAmount : '--' }};</span>
               <span>贷方:{{ countData && (countData.loanAmount || countData.loanAmount == 0) ? countData.loanAmount : '--' }};</span>
@@ -53,7 +55,7 @@
                       v-model="productForm.changeType"
                       ref="changeType"
                       id="accountStatement-changeType1"
-                      code="FINANCE_BOOK_STATE"
+                      code="VERIFY_ACCOUNT_CHANGE_TYPE"
                       placeholder="请选择借贷类型"
                       allowClear></v-select>
                   </a-form-item>
@@ -94,6 +96,7 @@
               <a-input
                 size="small"
                 v-model="record.remarks"
+                @blur="changeRemarks(record)"
                 style="width: 100%;"
                 placeholder="请输入备注"/>
             </div>
@@ -137,7 +140,9 @@ import {
   verifyAcountBillDetailQueryCount,
   verifyAcountBillDetailDel,
   verifyAcountBillDetailSave,
+  verifyAcountBillDetailModify,
   verifyAcountBillSubmit,
+  verifyAcountBillSubmitCheck,
   verifyAcountBillDetail
 } from '@/api/verifyAccount'
 export default {
@@ -166,13 +171,23 @@ export default {
       chooseList: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        return verifyAcountBillDetailList(Object.assign(parameter, this.productForm)).then(res => {
+        const params = {
+          ...parameter,
+          verifyAccountBillSn: this.verifyAccountBillSn,
+          verifyAccountBillNo: this.detailData.verifyAccountBillNo,
+          ...this.productForm
+        }
+        return verifyAcountBillDetailList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              const dates = data.list[i].bizDate.split('-')
+              data.list[i].year = dates[0]
+              data.list[i].month = dates[1]
+              data.list[i].day = dates[2].split(' ')[0]
               // 正为借方, 负数为贷方
               if (data.list[i].bizAmount > 0) {
                 data.list[i].debitAmount = data.list[i].bizAmount
@@ -181,6 +196,7 @@ export default {
               }
             }
           }
+          this.getStatisticsData(params)
           this.chooseList = data.list
           return data
         })
@@ -193,6 +209,9 @@ export default {
     }
   },
   computed: {
+    dealerSn () {
+      return this.detailData ? this.detailData.dealerSn : ''
+    },
     columns () {
       const _this = this
       const arr = [
@@ -201,8 +220,8 @@ export default {
         { title: '月', dataIndex: 'month', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '日', dataIndex: 'day', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务单号', dataIndex: 'bizNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据类型', dataIndex: 'bizType', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'bizStatus', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '业务类型', dataIndex: 'bizTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'bizStatusDictValue', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '费用/调拨类型', dataIndex: 'expenseAllocateType', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '摘要', dataIndex: 'digestInfo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客诉索赔编码', dataIndex: 'productCode', width: '8%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
@@ -225,8 +244,8 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0] ? date[0] : ''
-      this.queryParam.endDate = date[1] ? date[1] : ''
+      this.productForm.beginDate = date[0] ? date[0] : ''
+      this.productForm.endDate = date[1] ? date[1] : ''
     },
     // 删除所选产品
     handleDel (row) {
@@ -237,26 +256,29 @@ export default {
         centered: true,
         closable: true,
         onOk () {
-          _this.delLoading = true
-          _this.spinning = true
-          verifyAcountBillDetailDel({ verifyAccountBillSn: row.verifyAccountBillSn, detailSnList: [row.verifyAccountBillDetailSn] })
-            .then(res => {
-              if (res.status == 200) {
-                _this.resetTable(false)
-                _this.getStatisticsData()
-                _this.getChooseList()
-                _this.$refs.partQuery.clearSelected()
-              }
-              _this.$message.info(res.message)
-              _this.delLoading = false
-              _this.spinning = false
-            })
-            .catch(err => {
-              _this.delLoading = false
-            })
+          _this.delDetail([row.detailSn])
         }
       })
     },
+    delDetail (snList) {
+      const _this = this
+      _this.delLoading = true
+      _this.spinning = true
+      verifyAcountBillDetailDel({ verifyAccountBillSn: _this.verifyAccountBillSn, detailSnList: snList })
+        .then(res => {
+          if (res.status == 200) {
+            _this.resetTable(false)
+            _this.getChooseList()
+            _this.$refs.partQuery.clearSelected()
+          }
+          _this.$message.info(res.message)
+          _this.delLoading = false
+          _this.spinning = false
+        })
+        .catch(err => {
+          _this.delLoading = false
+        })
+    },
     // 刷新已选表格
     resetTable (flag) {
       this.$refs.table.refresh(flag)
@@ -273,6 +295,14 @@ export default {
       this.$refs.rangeDate.resetDate(this.creatDate)
       this.$refs.table.refresh(!!flag)
     },
+    // 修改备注
+    changeRemarks (record) {
+      if (!record.remarks) return
+      this.spinning = true
+      verifyAcountBillDetailModify({ id: record.id, remarks: record.remarks }).then(res => {
+        this.spinning = false
+      })
+    },
     // 单个添加单据
     saveProduct (row) {
       if (this.isInster) {
@@ -284,7 +314,7 @@ export default {
         verifyAccountBillSn: this.detailData.verifyAccountBillSn,
         verifyAccountBillNo: this.detailData.verifyAccountBillNo,
         verifyAccountBizSn: this.detailData.verifyAccountBizSn,
-        verifyAccountBillDetailList: [row]
+        detailList: [row]
       }
       this.saveMore(paramsData)
     },
@@ -299,7 +329,7 @@ export default {
         verifyAccountBillSn: this.detailData.verifyAccountBillSn,
         verifyAccountBillNo: this.detailData.verifyAccountBillNo,
         verifyAccountBizSn: this.detailData.verifyAccountBizSn,
-        verifyAccountBillDetailList: data
+        detailList: data
       })
     },
     // 添加
@@ -308,7 +338,6 @@ export default {
       verifyAcountBillDetailSave(params)
         .then(res => {
           if (res.status == 200) {
-            this.getStatisticsData()
             this.getChooseList()
             this.$refs.table.refresh(true)
             this.$refs.partQuery.clearSelected()
@@ -324,29 +353,42 @@ export default {
         })
     },
     // 提交
-    handleSubmit (data) {
+    async handleSubmit () {
       this.spinning = true
-      verifyAcountBillSubmit({ verifyAccountBillSn: this.verifyAccountBillSn, ...data }).then(res => {
-        if (res.status == 200) {
-          this.handleBack()
-          this.$message.success(res.message)
-        }
-        this.spinning = false
-      })
-    },
-    pageInit () {
-      this.verifyAccountBillSn = this.$route.query.sn
-      this.getStatisticsData()
-      this.getBasicsData()
-      this.resetSearchForm(true)
+      const ret = await verifyAcountBillSubmitCheck({ sn: this.verifyAccountBillSn })
+      this.spinning = false
+      const noList = ret.data.length ? ret.data.map(item => item.bizNo) : []
+      const snList = ret.data.length ? ret.data.map(item => item.detailSn) : []
+      // 通过校验提交
+      if (noList.length == 0) {
+        this.spinning = true
+        verifyAcountBillSubmit({ sn: this.verifyAccountBillSn }).then(res => {
+          if (res.status == 200) {
+            this.handleBack()
+            this.$message.success(res.message)
+          }
+          this.spinning = false
+        })
+      } else {
+        // 提示不能参与的单子
+        const _this = this
+        this.$confirm({
+          title: '提示(' + _this.detailData.dealerName + ')',
+          content: <div style="font-size:14px;"><div>{noList.toString()}不能参与对单,</div><div>点击【确定】后自动移除上述单据</div></div>,
+          centered: true,
+          closable: true,
+          onOk () {
+            _this.delDetail(snList)
+          }
+        })
+      }
     },
     getChooseList () {
       this.$refs.partQuery.pageInit()
     },
     // 获取页面统计数据
-    getStatisticsData () {
-      this.getBasicsData(true)
-      verifyAcountBillDetailQueryCount({ verifyAccountBillSn: this.verifyAccountBillSn }).then(res => {
+    getStatisticsData (params) {
+      verifyAcountBillDetailQueryCount(params).then(res => {
         this.countData = res.data
       })
     },
@@ -354,13 +396,18 @@ export default {
     getBasicsData (flag) {
       const _this = this
       verifyAcountBillDetail({ sn: this.verifyAccountBillSn }).then(res => {
-        this.detailData = res.data
+        _this.detailData = res.data
         if (!flag) {
-          this.$nextTick(() => {
+          _this.$nextTick(() => {
+            _this.resetSearchForm(true)
             _this.getChooseList()
           })
         }
       })
+    },
+    pageInit () {
+      this.verifyAccountBillSn = this.$route.params.sn
+      this.getBasicsData()
     }
   },
   mounted () {

+ 59 - 50
src/views/financialManagement/accountStatement/list.vue

@@ -26,7 +26,7 @@
                   v-model="queryParam.billStatus"
                   ref="status"
                   id="accountStatement-status"
-                  code="FINANCE_BOOK_STATE"
+                  code="VERIFY_ACCOUNT_STATUS"
                   placeholder="请选择业务状态"
                   allowClear></v-select>
               </a-form-item>
@@ -69,49 +69,51 @@
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
-            <a-button
-              size="small"
-              type="link"
-              v-if="record.billStatus=='WAIT_SUBMIT'||record.billStatus=='WAIT_CONFIRM'"
-              class="button-info"
-              @click="handleEdit(record)"
-            >
-              编辑
-            </a-button>
-            <a-button
-              v-if="record.billStatus=='WAIT_SUBMIT'||record.billStatus=='WAIT_CONFIRM'"
-              size="small"
-              type="link"
-              class="button-error"
-              @click="handleDel(record)"
-            >
-              删除
-            </a-button>
-            <a-button
-              v-if="record.billStatus=='WAIT_CONFIRM'"
-              size="small"
-              type="link"
-              class="button-info"
-              @click="handleDetail(record,1)"
-            >
-              对单
-            </a-button>
-            <a-button
-              v-if="record.billStatus=='WAIT_VERIFY'"
-              size="small"
-              type="link"
-              class="button-info"
-              @click="checkAcount(record)"
-            >
-              对账
-            </a-button>
+            <div>
+              <a-button
+                v-if="record.billStatus=='WAIT_CONFIRM'"
+                size="small"
+                type="link"
+                class="button-info"
+                @click="handleDetail(record,1)"
+              >
+                对单
+              </a-button>
+              <a-button
+                v-if="record.billStatus=='WAIT_VERIFY'"
+                size="small"
+                type="link"
+                class="button-info"
+                @click="checkAcount(record)"
+              >
+                对账
+              </a-button>
+              <a-button
+                size="small"
+                type="link"
+                v-if="record.billStatus=='WAIT_SUBMIT'||record.billStatus=='WAIT_CONFIRM'"
+                class="button-info"
+                @click="handleEdit(record)"
+              >
+                编辑
+              </a-button>
+              <a-button
+                v-if="record.billStatus=='WAIT_SUBMIT'||record.billStatus=='WAIT_CONFIRM'"
+                size="small"
+                type="link"
+                class="button-error"
+                @click="handleDel(record)"
+              >
+                删除
+              </a-button>
+            </div>
           </template>
         </s-table>
       </a-spin>
       <!-- 基础信息 -->
       <baseModal v-drag :show="baseModal" @cancel="baseModal=false"></baseModal>
       <!-- 对单 -->
-      <confrontModal v-drag :show="openModal" ref="detailModal" @cancel="openModal=false"></confrontModal>
+      <confrontModal v-drag :show="openModal" ref="detailModal" @cancel="openModal=false" @confirm="confirmOk"></confrontModal>
     </a-card>
   </div>
 </template>
@@ -123,7 +125,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import dealerByScope from '@/views/common/dealerByScope.vue'
 import baseModal from './baseModal.vue'
 import confrontModal from './confrontModal.vue'
-import { verifyAcountBillList, verifyAcountBillDel, verifyAcountBillCheck } from '@/api/verifyAccount.js'
+import { verifyAcountBillList, verifyAcountBillDel, verifyAcountBillVerify } from '@/api/verifyAccount.js'
 export default {
   name: 'AccountStatementList',
   mixins: [commonMixin],
@@ -175,13 +177,13 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '对账单号', scopedSlots: { customRender: 'verifyAccountBillNo' }, width: '8%', align: 'center' },
-        { title: '客户名称', dataIndex: 'dealerName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '余额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '对单时间', dataIndex: 'confirmDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '对账时间', dataIndex: 'verifyDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '对账单号', scopedSlots: { customRender: 'verifyAccountBillNo' }, width: '10%', align: 'center' },
+        { title: '客户名称', dataIndex: 'dealerName', width: '26%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '余额', dataIndex: 'totalAmount', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '对单时间', dataIndex: 'confirmDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '对账时间', dataIndex: 'verifyDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       return arr
@@ -231,12 +233,12 @@ export default {
       const _this = this
       this.$confirm({
         title: '提示(' + row.dealerName + ')',
-        content: <div style="font-size:14px;"><div>对账单号:{row.verifyAccountBillNo}</div><div>余额:{row.totalAmount},确定删除吗?</div></div>,
+        content: <div style="font-size:14px;"><div>对账单号:{row.verifyAccountBillNo}</div><div>余额:{Number(row.totalAmount).toFixed(2)},确定删除吗?</div></div>,
         centered: true,
         closable: true,
         onOk () {
           _this.spinning = true
-          verifyAcountBillDel({ verifyAccountBillSn: row.verifyAccountBillSn }).then(res => {
+          verifyAcountBillDel({ sn: row.verifyAccountBillSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
@@ -250,14 +252,21 @@ export default {
     },
     // 0详情,1对单
     handleDetail (row, type) {
-      this.$refs.dealer.getDetial(row.dealerSn)
+      this.spinning = true
+      this.$refs.dealer.getDetail(row.dealerSn)
       this.detailType = type
       this.editRow = row
     },
     getDealerDetail (data) {
+      this.spinning = false
       this.$refs.detailModal.pageInit(this.editRow, data, this.detailType)
       this.openModal = true
     },
+    // 对单成功
+    confirmOk () {
+      this.openModal = false
+      this.$refs.table.refresh()
+    },
     // 对账
     checkAcount (row) {
       const _this = this
@@ -268,7 +277,7 @@ export default {
         closable: true,
         onOk () {
           _this.spinning = true
-          verifyAcountBillCheck({ verifyAccountBillSn: row.verifyAccountBillSn }).then(res => {
+          verifyAcountBillVerify({ sn: row.verifyAccountBillSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()

+ 41 - 21
src/views/financialManagement/accountStatement/queryPart.vue

@@ -21,7 +21,7 @@
                   v-model="queryParam.changeType"
                   ref="jdType"
                   id="accountStatement-query-jdType"
-                  code="FINANCE_BOOK_STATE"
+                  code="VERIFY_ACCOUNT_CHANGE_TYPE"
                   placeholder="请选择借贷类型"
                   allowClear></v-select>
               </a-form-item>
@@ -32,8 +32,8 @@
                   v-model="queryParam.bizType"
                   ref="bizType"
                   id="accountStatement-query-bizType"
-                  code="FINANCE_BOOK_STATE"
-                  placeholder="请选择单据类型"
+                  code="VERIFY_ACCOUNT_BIZ_TYPE"
+                  placeholder="请选择业务类型"
                   allowClear></v-select>
               </a-form-item>
             </a-col>
@@ -44,7 +44,7 @@
                   v-model="queryParam.bizStatus"
                   ref="bizStatus"
                   id="accountStatement-query-bizStatus"
-                  :code="['DISPATCH_BILL_STATUS','SALES_RETURN_BILL_STATUS','ALLOCATE_STATUS','EXPENSE_STATE'][0]"
+                  :code="bizStatusCode"
                   placeholder="请选择业务状态"
                   allowClear></v-select>
               </a-form-item>
@@ -68,9 +68,9 @@
       class="sTable"
       ref="chooseTable"
       size="small"
-      :rowKey="(record) => record.no"
-      rowKeyName="no"
-      :row-selection="{ columnWidth: 40,getCheckboxProps: record => ({ props: { disabled: record.currentStockQty == 0 || record.isCheckedFlag} }) }"
+      :rowKey="(record) => record.bizSn"
+      rowKeyName="bizSn"
+      :row-selection="{ columnWidth: 40 }"
       @rowSelection="rowSelectionFun"
       :columns="columns"
       :data="loadData"
@@ -114,6 +114,14 @@ export default {
     addMoreLoading: {
       type: Boolean,
       default: false
+    },
+    itemSn: {
+      type: String,
+      default: ''
+    },
+    dealerSn: {
+      type: String,
+      default: ''
     }
   },
   data () {
@@ -134,13 +142,23 @@ export default {
       warehouseSn: null,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        return verifyAccountBillQueryWaitSelectList(Object.assign(parameter, this.queryParam)).then(res => {
+        const params = {
+          ...parameter,
+          dealerSn: this.dealerSn,
+          ...this.queryParam
+        }
+        return verifyAccountBillQueryWaitSelectList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              const dates = data.list[i].bizDate.split('-')
+              data.list[i].year = dates[0]
+              data.list[i].month = dates[1]
+              data.list[i].day = dates[2].split(' ')[0]
+
               // 正为借方, 负数为贷方
               if (data.list[i].bizAmount > 0) {
                 data.list[i].debitAmount = data.list[i].bizAmount
@@ -151,10 +169,22 @@ export default {
           }
           return data
         })
+      },
+      bizStatusText: [],
+      codeArr: {
+        'DISPATCH': 'DISPATCH_BILL_STATUS',
+        'SALES_RETURN': 'SALES_RETURN_BILL_STATUS',
+        'ALLOCATE': 'ALLOCATE_STATUS',
+        'EXPENSE': 'EXPENSE_STATE',
+        'FINANCE_BOOK': 'FINANCE_BOOK_STATE',
+        'CHANGE': 'VERIFY_ACCOUNT_CHANGE_STATUS'
       }
     }
   },
   computed: {
+    bizStatusCode () {
+      return this.codeArr[this.queryParam.bizType]
+    },
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -162,10 +192,10 @@ export default {
         { title: '月', dataIndex: 'month', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '日', dataIndex: 'day', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务单号', dataIndex: 'bizNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务类型', dataIndex: 'bizType', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'bizStatus', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '业务类型', dataIndex: 'bizTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'bizStatusDictValue', width: '8%', align: 'left', customRender: function (text, record) { return text || '--' } },
         { title: '费用/调拨类型', dataIndex: 'expenseAllocateType', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '摘要', dataIndex: 'digestInfo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '摘要', dataIndex: 'digestInfo', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客诉索赔编码', dataIndex: 'productCode', width: '8%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
         { title: '借方', dataIndex: 'debitAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? toThousands(text, 2) : '--') } },
         { title: '贷方', dataIndex: 'creditorAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? toThousands(text, 2) : '--') } },
@@ -203,16 +233,6 @@ export default {
     },
     // 添加
     handleAdd (row) {
-      const selectArr = this.rowSelectionInfo ? this.rowSelectionInfo.selectedRowKeys : null
-      if (selectArr && selectArr.length > 0) {
-        const pot = selectArr.findIndex(item => { return item == row.id })
-        selectArr.splice(pot, 1)
-        const index = this.rowSelectionInfo.selectedRows.findIndex(item => { return item.sparePartsDetailSn == row.sparePartsDetailSn })
-        this.rowSelectionInfo.selectedRows.splice(index, 1)
-        this.$nextTick(() => { // 页面渲染完成后的回调
-          this.$refs.chooseTable.setTableSelected(selectArr, this.rowSelectionInfo.selectedRows) // 设置表格选中项
-        })
-      }
       this.$emit('add', row)
     },
     // 清空选择

+ 23 - 15
src/views/financialManagement/accountStatementBill/list.vue

@@ -6,8 +6,8 @@
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="经销商名称/别名">
-                <a-input id="accountStatementBill-dealerName" v-model.trim="queryParam.nameLike" allowClear placeholder="请输入经销商名称/别名"/>
+              <a-form-item label="经销商名称/商户别名">
+                <a-input id="accountStatementBill-dealerName" v-model.trim="queryParam.nameLike" allowClear placeholder="请输入经销商名称/商户别名"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -67,9 +67,12 @@
           :pageSize="30"
           :defaultLoadData="false"
           bordered>
-          <template slot="orderTotalAmount" slot-scope="text, record">
-            <span v-if="$hasPermissions('B_fc_detail')" class="link-bule" @click="handleDetail(record)">{{ record.orderTotalAmount }}</span>
-            <span v-else>{{ record.orderTotalAmount }}</span>
+          <template slot="totalAmount" slot-scope="text, record">
+            <span v-if="$hasPermissions('B_fc_detail')&&record.totalAmount" class="link-bule" @click="handleDetail(record)">{{ record.totalAmount||'--' }}</span>
+            <span v-else>{{ record.totalAmount||'--' }}</span>
+          </template>
+          <template slot="dealerType" slot-scope="text, record">
+            {{ record.dealerTypeName1 }}>{{ record.dealerTypeName2 }}
           </template>
         </s-table>
       </a-spin>
@@ -80,10 +83,11 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
-import { financeBookQueryPage } from '@/api/financeBook.js'
 import subarea from '@/views/common/subarea.js'
 import dealerType from '@/views/common/dealerType.js'
 import customerService from '@/views/common/customerService.vue'
+
+import { verifyAccountChangeDealerBalanceList } from '@/api/verifyAccountChange.js'
 export default {
   name: 'AccountStatementBillList',
   mixins: [commonMixin],
@@ -111,7 +115,7 @@ export default {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
-        return financeBookQueryPage(params).then(res => {
+        return verifyAccountChangeDealerBalanceList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -134,15 +138,17 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '财务编码', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '经销商名称', dataIndex: 'payerName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '经销商别名', dataIndex: 'payerName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '余额', scopedSlots: { customRender: 'orderTotalAmount' }, width: '8%', align: 'center' },
+        { title: '财务编码', dataIndex: 'kdMidCustomerFnumber', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '经销商名称', dataIndex: 'dealerName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户别名', dataIndex: 'dealerAlias', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '总余额', scopedSlots: { customRender: 'totalAmount' }, width: '8%', align: 'center' },
+        { title: '待选余额', dataIndex: 'waitAmount', width: '8%', align: 'center', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '待选单数', dataIndex: 'waitCount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客服', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '区域', dataIndex: 'updateDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'updateDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户级别', dataIndex: 'statusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户类型', dataIndex: 'statusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '区域', dataIndex: 'subareaArea.subareaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户类型', scopedSlots: { customRender: 'dealerType' }, width: '15%', align: 'center' }
       ]
       return arr
     }
@@ -168,6 +174,8 @@ export default {
       this.queryParam.dealerLevel = undefined
       this.queryParam.subareaAreaSn = undefined
       this.queryParam.subareaSn = undefined
+      this.queryParam.bizUserSn = undefined
+      this.queryParam.kdMidCustomerFnumber = ''
       this.$refs.table.refresh(true)
     },
     // 导出

+ 24 - 22
src/views/financialManagement/manualEntryForm/baseModal.vue

@@ -17,15 +17,15 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol">
         <a-form-model-item label="客户名称" prop="dealerSn">
-          <dealerSubareaScopeList id="manualEntryForm-dealer" :disabled="!!bookSn" ref="settleClientName" @change="custChange" />
+          <dealerByScope id="manualEntryForm-dealer" :disabled="!!itemSn" ref="settleClientName" @change="custChange" />
         </a-form-model-item>
         <a-form-model-item label="借贷类型" prop="changeType">
           <v-select
             v-model="form.changeType"
             ref="changeType"
-            type="radio"
+            showType="radio"
             id="manualEntryForm-type"
-            code="FINANCE_BOOK_STATE"
+            code="VERIFY_ACCOUNT_CHANGE_TYPE"
             placeholder="请选择借贷类型"
             allowClear></v-select>
         </a-form-model-item>
@@ -48,8 +48,6 @@
           <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
         </a-form-model-item>
       </a-form-model>
-      <!-- 提交  选择审批人员 -->
-      <chooseDepartUserModal :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSave"></chooseDepartUserModal>
     </a-spin>
   </a-modal>
 </template>
@@ -58,16 +56,15 @@
 import { commonMixin } from '@/utils/mixin'
 import { VSelect } from '@/components'
 // 组件
-import chooseDepartUserModal from './chooseDepartUserModal.vue'
-import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
-import { financeBookSave, financeBookFindBySn } from '@/api/financeBook.js'
+import dealerByScope from '@/views/common/dealerByScope.vue'
+import { verifyAccountChangeSave, verifyAccountChangeDetail } from '@/api/verifyAccountChange.js'
 export default {
   name: 'ASBaseModal',
   mixins: [commonMixin],
-  components: { VSelect, dealerSubareaScopeList, chooseDepartUserModal },
+  components: { VSelect, dealerByScope },
   props: {
     show: [Boolean],
-    bookSn: {
+    itemSn: {
       type: String,
       default: ''
     }
@@ -76,7 +73,6 @@ export default {
     return {
       opened: this.show,
       spinning: false,
-      openDepartUserModal: false,
       disabled: false,
       title: '调账',
       confirmLoading: false,
@@ -92,7 +88,9 @@ export default {
         remarks: ''
       },
       rules: {
-        dealerSn: [ { required: true, message: '请选择客户', trigger: ['change', 'blur'] } ]
+        dealerSn: [ { required: true, message: '请选择客户', trigger: ['change', 'blur'] } ],
+        changeType: [ { required: true, message: '请选择借贷类型', trigger: ['change', 'blur'] } ],
+        changeAmount: [ { required: true, message: '请输入借贷金额', trigger: ['change', 'blur'] } ]
       }
     }
   },
@@ -124,23 +122,22 @@ export default {
       const _this = this
       const form = JSON.parse(JSON.stringify(_this.form))
       _this.spinning = true
-      financeBookSave(form).then(res => {
+      verifyAccountChangeSave(form).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
+          this.$emit('ok', res.data)
           // 选择审批人员
-          // _this.cancel()
-          _this.spinning = false
-        } else {
-          _this.spinning = false
+          _this.cancel()
         }
+        _this.spinning = false
       })
     },
     //  详情
     getDetail () {
-      this.title = '编辑对账单'
+      this.title = '编辑调账'
       this.spinning = true
       this.confirmLoading = true
-      financeBookFindBySn({ bookSn: this.bookSn }).then(res => {
+      verifyAccountChangeDetail({ sn: this.itemSn }).then(res => {
         if (res.status == 200) {
           const data = res.data
           this.form = Object.assign(this.form, data)
@@ -159,10 +156,13 @@ export default {
     },
     cancel () {
       this.opened = false
-      this.$emit('cancel')
+      if (this.$refs.settleClientName) {
+        this.$refs.settleClientName.resetForm()
+      }
       this.$refs.ruleForm.resetFields()
+      this.$emit('cancel')
     },
-    async pageInit () {
+    pageInit () {
       this.$nextTick(() => {
         this.$refs.ruleForm.resetFields()
         if (this.$refs.settleClientName) {
@@ -172,10 +172,12 @@ export default {
       this.form = {
         dealerSn: undefined,
         dealerName: undefined,
+        changeType: undefined,
+        changeAmount: undefined,
         remarks: ''
       }
       //  编辑页
-      if (this.bookSn) {
+      if (this.itemSn) {
         this.getDetail()
       }
     }

+ 2 - 4
src/views/financialManagement/manualEntryForm/chooseDepartUserModal.vue

@@ -47,7 +47,7 @@
           </a-form-model>
         </div>
         <div class="btn-cont">
-          <a-button type="primary" id="departUser-save" @click="handleSave">确定</a-button>
+          <a-button type="primary" id="departUser-save" @click="handleSave">提交审核</a-button>
           <a-button :loading="uploading" style="margin-left: 15px;" @click="updateUser">刷新人员</a-button>
           <a-button id="departUser-back" @click="cancel" style="margin-left: 15px;">取消</a-button>
         </div>
@@ -57,13 +57,11 @@
 </template>
 
 <script>
-import { VSelect, Upload } from '@/components'
 import dingDepartUser from '@/views/common/dingDepartUser.js'
 import employee from '@/views/expenseManagement/expenseReimbursement/employee.js'
-import { sign } from 'core-js/fn/number'
 export default {
   name: 'ChooseDepartUserModal',
-  components: { dingDepartUser, employee, VSelect, Upload },
+  components: { dingDepartUser, employee },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,

+ 120 - 31
src/views/financialManagement/manualEntryForm/list.vue

@@ -11,33 +11,33 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="业务单号">
-                <a-input id="manualEntryForm-dealerName" v-model.trim="queryParam.nameLike" allowClear placeholder="请输入业务单号"/>
+              <a-form-item label="调账单号">
+                <a-input id="manualEntryForm-dealerName" v-model.trim="queryParam.changeNo" allowClear placeholder="请输入调账单号"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="客户名称">
-                <a-input id="accountStatement-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入客户名称"/>
+                <dealerByScope id="accountStatement-dealerName" ref="dealer" @change="custChange"/>
               </a-form-item>
             </a-col>
-            <a-col :md="4" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-item label="借贷类型">
                 <v-select
-                  v-model="queryParam.status"
-                  ref="status"
-                  id="conFrontModal-status"
-                  code="FINANCE_BOOK_STATE"
+                  v-model="queryParam.changeType"
+                  ref="changeType"
+                  id="conFrontModal-changeType"
+                  code="VERIFY_ACCOUNT_CHANGE_TYPE"
                   placeholder="请选择借贷类型"
                   allowClear></v-select>
               </a-form-item>
             </a-col>
-            <a-col :md="4" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-item label="状态">
                 <v-select
                   v-model="queryParam.status"
                   ref="status"
                   id="conFrontModal-status"
-                  code="FINANCE_BOOK_STATE"
+                  code="VERIFY_ACCOUNT_CHANGE_STATUS"
                   placeholder="请选择状态"
                   allowClear></v-select>
               </a-form-item>
@@ -75,6 +75,25 @@
           bordered>
           <template slot="actions" slot-scope="text, record">
             <a-button
+              size="small"
+              type="link"
+              v-if="record.status=='WAIT_SUBMIT'"
+              class="button-info"
+              @click="handleEdit(record)"
+            >
+              编辑
+            </a-button>
+            <a-button
+              v-if="record.status=='WAIT_SUBMIT'"
+              size="small"
+              type="link"
+              class="button-error"
+              @click="handleDel(record)"
+            >
+              删除
+            </a-button>
+            <a-button
+              v-if="record.status!='WAIT_SUBMIT'"
               size="small"
               type="link"
               class="button-info"
@@ -86,20 +105,24 @@
       </a-spin>
     </a-card>
     <!-- 基础信息 -->
-    <baseModal v-drag :show="baseModal" @cancel="baseModal=false"></baseModal>
+    <baseModal v-drag :show="baseModal" :itemSn="itemSn" @cancel="baseModal=false" @ok="hanldAudit"></baseModal>
+    <!-- 提交  选择审批人员 -->
+    <chooseDepartUserModal :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSave"></chooseDepartUserModal>
   </div>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
-import { financeBookQueryPage } from '@/api/financeBook.js'
+import dealerByScope from '@/views/common/dealerByScope.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
 import baseModal from './baseModal.vue'
+import chooseDepartUserModal from './chooseDepartUserModal.vue'
+import { verifyAccountChangeList, verifyAcountBillSubmit, verifyAccountChangeDel } from '@/api/verifyAccountChange.js'
 export default {
-  name: 'AccountStatementBillList',
+  name: 'ManualEntryFormList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, baseModal },
+  components: { STable, VSelect, rangeDate, baseModal, chooseDepartUserModal, dealerByScope },
   data () {
     return {
       spinning: false,
@@ -108,26 +131,35 @@ export default {
       queryParam: { //  查询条件
         beginDate: '',
         endDate: '',
-        bookNo: '',
+        changeNo: '',
         dealerName: '',
+        changeType: undefined,
         status: undefined
       },
       creatDate: [], //  创建时间
       disabled: false, //  查询、重置按钮是否可操作
       advanced: true,
-      itemSn: null,
+      openDepartUserModal: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
-        return financeBookQueryPage(params).then(res => {
+        return verifyAccountChangeList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              // 借方
+              if (data.list[i].changeType == 'DEBIT') {
+                data.list[i].borrowAmount = this.toThousands(data.list[i].changeAmount, 2)
+              }
+              // 贷方
+              if (data.list[i].changeType == 'LENDER') {
+                data.list[i].loanAmount = this.toThousands(data.list[i].changeAmount * -1, 2)
+              }
             }
             this.total = data.count || 0
             this.disabled = false
@@ -136,7 +168,8 @@ export default {
           return data
         })
       },
-      total: 0 // 合计
+      total: 0, // 合计
+      itemSn: null
     }
   },
   // 根据权限显示列表字段
@@ -145,13 +178,13 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务单号', dataIndex: 'payerName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'payerName1', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '借方', dataIndex: 'productCost1', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? this.toThousands(text, 2) : '--') } },
-        { title: '贷方', dataIndex: 'productCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? this.toThousands(text, 2) : '--') } },
-        { title: '备注', dataIndex: 'remarks', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核时间', dataIndex: 'statusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', dataIndex: 'statusDictValue1', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调账单号', dataIndex: 'changeNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'dealerName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '借方', dataIndex: 'borrowAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '贷方', dataIndex: 'loanAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '备注', dataIndex: 'remarks', width: '30%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'statusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'actions' }, width: '8%', align: 'center' }
       ]
       return arr
@@ -163,22 +196,78 @@ export default {
       this.queryParam.beginDate = date[0] ? date[0] : ''
       this.queryParam.endDate = date[1] ? date[1] : ''
     },
+    // 客户
+    custChange (v) {
+      if (v && v.key) {
+        this.queryParam.dealerSn = v.key
+        this.queryParam.dealerName = v.row ? v.row.dealerName : ''
+      } else {
+        this.queryParam.dealerSn = ''
+        this.queryParam.dealerName = ''
+      }
+    },
     //  重置
     resetSearchForm () {
+      this.creatDate = []
+      this.$refs.rangeDate.resetDate(this.creatDate)
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.nameLike = ''
-      this.queryParam.dealerType1 = undefined
-      this.queryParam.dealerType2 = undefined
-      this.queryParam.dealerLevel = undefined
-      this.queryParam.subareaAreaSn = undefined
-      this.queryParam.subareaSn = undefined
+      this.queryParam.changeNo = ''
+      this.queryParam.dealerName = ''
+      this.queryParam.dealerSn = ''
+      if (this.$refs.dealer) {
+        this.$refs.dealer.resetForm()
+      }
+      this.queryParam.changeType = undefined
+      this.queryParam.status = undefined
       this.$refs.table.refresh(true)
     },
+    // 删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示(' + row.dealerName + ')',
+        content: <div style="font-size:14px;"><div>调账单号:{row.changeNo}</div><div>确定删除吗?</div></div>,
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.spinning = true
+          verifyAccountChangeDel({ sn: row.changeSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
     // 调账
     handleAdd () {
+      this.itemSn = null
       this.baseModal = true
     },
+    // 编辑
+    handleEdit (row) {
+      this.itemSn = row.changeSn
+      this.baseModal = true
+    },
+    // 审核提交弹框
+    hanldAudit (data) {
+      this.itemSn = data.changeSn
+      this.$refs.table.refresh()
+      this.openDepartUserModal = true
+    },
+    // 提交审核人员
+    handleSave (data) {
+      verifyAcountBillSubmit({ changeSn: this.itemSn, ...data }).then(res => {
+        if (res.status == 200) {
+          this.$message.success('提交成功')
+          this.openDepartUserModal = false
+          this.$refs.table.refresh()
+        }
+      })
+    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调