lilei 2 dias atrás
pai
commit
fb99405d01

+ 25 - 3
src/api/verifyAccount.js

@@ -110,15 +110,25 @@ export const verifyAcountBillConfirmCheck = params => {
 // 对账单 对单
 export const verifyAcountBillConfirm = params => {
   return axios({
-    url: `/verifyAccountBill/confirm/${params.sn}`,
+    url: `/verifyAccountBill/confirm`,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('对单')
+    }
+  })
+}
+// 对账单同步
+export const verifyAcountBillSyncBill = params => {
+  return axios({
+    url: `/verifyAccountBill/syncBill/${params.sn}`,
     data: {},
     method: 'get',
     headers: {
-      'module': encodeURIComponent('对单')
+      'module': encodeURIComponent('对同步')
     }
   })
 }
-
 // 对账单管理  对账
 export const verifyAcountBillVerify = params => {
   return axios({
@@ -130,6 +140,18 @@ export const verifyAcountBillVerify = params => {
     }
   })
 }
+
+// 调账插入对账单明细
+export const verifyAccountChangeInsert = params => {
+  return axios({
+    url: '/verifyAccountBillDetail/insertChange',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('调账插入对账单明细')
+    }
+  })
+}
  
 //  对账单管理  明细 列表  分页
 export const verifyAcountBillDetailList = (params) => {

+ 1 - 0
src/api/verifyAccountChange.js

@@ -25,6 +25,7 @@ export const verifyAccountChangeSave = params => {
     }
   })
 }
+
 // 调账调账  删除
 export const verifyAccountChangeDel = params => {
   return axios({

+ 5 - 10
src/views/financialManagement/accountStatement/confrontModal.vue

@@ -446,16 +446,11 @@ export default {
         })
       } else {
         this.confirmLoading = true
-        verifyAcountBillConfirm({ sn: this.verifyAccountBillSn }).then(res => {
-          // 对单成功
-          if (type == 0) {
-            this.confirmLoading = false
-            this.$message.success('对单成功')
-            this.$emit('confirm')
-            this.cancel()
-          } else {
-            // 对单成功且同步
-          }
+        verifyAcountBillConfirm({ verifyAccountBillSn: this.verifyAccountBillSn, syncFlag: type }).then(res => {
+          this.confirmLoading = false
+          this.$message.success(type == 0 ? '对单成功' : '对单同步成功')
+          this.$emit('confirm')
+          this.cancel()
         })
       }
     },

+ 15 - 22
src/views/financialManagement/accountStatement/edit.vue

@@ -131,9 +131,13 @@
     <!-- 编辑基础信息弹窗 -->
     <baseModal v-drag :show="openModal" @cancel="openModal=false" :itemSn="verifyAccountBillSn" @refashData="getBasicsData"></baseModal>
     <!-- 基础信息 -->
-    <baseTzModal v-drag :show="baseModal" :itemSn="itemSn" @cancel="baseModal=false" @ok="hanldAudit"></baseTzModal>
-    <!-- 提交  选择审批人员 -->
-    <chooseDepartUserModal :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSave"></chooseDepartUserModal>
+    <baseTzModal
+      v-drag
+      :show="baseModal"
+      type="1"
+      :itemSn="verifyAccountBillSn"
+      @cancel="baseModal=false"
+      @ok="hanldAudit"></baseTzModal>
   </div>
 </template>
 
@@ -143,7 +147,6 @@ import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import baseModal from './baseModal.vue'
 import baseTzModal from '../manualEntryForm/baseModal.vue'
-import chooseDepartUserModal from '../manualEntryForm/chooseDepartUserModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
 import {
   verifyAcountBillDetailList,
@@ -164,8 +167,7 @@ export default {
     queryPart,
     baseModal,
     rangeDate,
-    baseTzModal,
-    chooseDepartUserModal
+    baseTzModal
   },
   data () {
     return {
@@ -198,10 +200,12 @@ export default {
             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].bizDate) {
+                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
@@ -269,19 +273,8 @@ export default {
     },
     // 打开审核提交弹框
     hanldAudit (data) {
+      this.$message.success('提交成功')
       this.resetTable(false)
-      this.itemSn = data.changeSn
-      this.openDepartUserModal = true
-    },
-    // 提交审核人员
-    handleSave (data) {
-      verifyAcountBillSubmit({ changeSn: this.itemSn, ...data }).then(res => {
-        if (res.status == 200) {
-          this.$message.success('提交成功')
-          this.openDepartUserModal = false
-          this.resetTable(false)
-        }
-      })
     },
     // 删除所选产品
     handleDel (row) {

+ 42 - 6
src/views/financialManagement/accountStatement/list.vue

@@ -33,13 +33,16 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="同步状态">
-                <v-select
+                <a-select
                   v-model="queryParam.syncFlag"
                   ref="syncFlag"
                   id="accountStatement-syncFlag"
-                  code="VERIFY_ACCOUNT_STATUS"
                   placeholder="请选择同步状态"
-                  allowClear></v-select>
+                  allowClear
+                >
+                  <a-select-option value="1">已同步</a-select-option>
+                  <a-select-option value="0">未同步</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -85,6 +88,15 @@
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
             <div>
+              <a-button
+                v-if="record.syncFlag=='0'"
+                size="small"
+                type="link"
+                class="button-info"
+                @click="handleSync(record)"
+              >
+                同步
+              </a-button>
               <a-button
                 v-if="record.billStatus=='WAIT_CONFIRM'&&$hasPermissions('B_as_confirm')"
                 size="small"
@@ -140,7 +152,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import baseModal from './baseModal.vue'
 import confrontModal from './confrontModal.vue'
-import { verifyAcountBillList, verifyAcountBillDel, verifyAcountBillVerify } from '@/api/verifyAccount.js'
+import { verifyAcountBillList, verifyAcountBillDel, verifyAcountBillVerify, verifyAcountBillSyncBill } from '@/api/verifyAccount.js'
 export default {
   name: 'AccountStatementList',
   mixins: [commonMixin],
@@ -157,7 +169,8 @@ export default {
         verifyAccountBillNo: '',
         dealerName: undefined,
         dealerSn: undefined,
-        billStatus: undefined
+        billStatus: undefined,
+        syncFlag: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
       creatDate: [], //  创建时间
@@ -204,7 +217,7 @@ export default {
         { 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: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '同步状态', dataIndex: 'syncFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '同步状态', dataIndex: 'syncFlag', width: '6%', align: 'center', customRender: function (text) { return ['未同步', '已同步'][text] } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       return arr
@@ -236,6 +249,7 @@ export default {
       this.queryParam.dealerSn = undefined
       this.queryParam.verifyAccountBillNo = ''
       this.queryParam.billStatus = undefined
+      this.queryParam.syncFlag = undefined
       if (this.$refs.dealer) {
         this.$refs.dealer.resetForm()
       }
@@ -271,6 +285,28 @@ export default {
         }
       })
     },
+    // 同步
+    handleSync (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: <div style="font-size:14px;"><div>您要同步对账单【{row.verifyAccountBillNo}】给【{row.dealerName}】客户吗?</div></div>,
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.spinning = true
+          verifyAcountBillSyncBill({ sn: row.verifyAccountBillSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
     // 0详情,1对单
     handleDetail (row, type) {
       this.spinning = true

+ 12 - 4
src/views/financialManagement/manualEntryForm/baseModal.vue

@@ -17,7 +17,7 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol">
         <a-form-model-item label="客户名称" prop="dealerSn">
-          <dealerSubareaScopeList id="manualEntryForm-dealer" :disabled="!!itemSn" ref="settleClientName" @change="custChange" />
+          <dealerSubareaScopeList id="manualEntryForm-dealer" :disabled="!!itemSn&&type == 0" ref="settleClientName" @change="custChange" />
         </a-form-model-item>
         <a-form-model-item label="借贷类型" prop="changeType">
           <v-select
@@ -58,6 +58,7 @@ import { VSelect } from '@/components'
 // 组件
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import { verifyAccountChangeSave, verifyAccountChangeDetail } from '@/api/verifyAccountChange.js'
+import { verifyAccountChangeInsert } from '@/api/verifyAccount.js'
 export default {
   name: 'ASBaseModal',
   mixins: [commonMixin],
@@ -67,6 +68,10 @@ export default {
     itemSn: {
       type: String,
       default: ''
+    },
+    type: {
+      type: String,
+      default: '0'
     }
   },
   data () {
@@ -137,12 +142,15 @@ export default {
     salesSaveFun () {
       const _this = this
       const form = JSON.parse(JSON.stringify(_this.form))
+      const fun = this.type == 0 ? verifyAccountChangeSave : verifyAccountChangeInsert
+      if (this.type == 1) {
+        form.verifyAccountBillSn = this.itemSn
+      }
       _this.spinning = true
-      verifyAccountChangeSave(form).then(res => {
+      fun(form).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
           this.$emit('ok', res.data)
-          // 选择审批人员
           _this.cancel()
         }
         _this.spinning = false
@@ -194,7 +202,7 @@ export default {
         remarks: ''
       }
       //  编辑页
-      if (this.itemSn) {
+      if (this.itemSn && this.type == 0) {
         this.getDetail()
       }
     }