Browse Source

对账单

lilei 1 month ago
parent
commit
9b04cf9640

+ 16 - 3
src/api/verifyAccount.js

@@ -51,6 +51,19 @@ export const verifyAccountBillModify = params => {
     }
   })
 }
+
+// 查找最后一次单据  备注
+export const findLastBillRemarks = params => {
+  return axios({
+    url: `/verifyAccountBill/findLastBill/${params.sn}`,
+    data: {},
+    method: 'get',
+    headers: {
+      'module': encodeURIComponent('查找经销商最后一次对账单据备注')
+    }
+  })
+}
+
 // 对账单管理  删除
 export const verifyAcountBillDel = params => {
   return axios({
@@ -87,9 +100,9 @@ export const verifyAcountBillSubmitCheck = params => {
 // 对账单管理  提交
 export const verifyAcountBillSubmit = params => {
   return axios({
-    url: `/verifyAccountBill/submit/${params.sn}`,
-    data: {},
-    method: 'get',
+    url: `/verifyAccountBill/submit`,
+    data: params,
+    method: 'post',
     headers: {
       'module': encodeURIComponent('对账单提交')
     }

+ 2 - 2
src/components/index.js

@@ -16,7 +16,7 @@ import AvatarList from '@/components/AvatarList'
 import CountDown from '@/components/CountDown'
 import Ellipsis from '@/components/Ellipsis'
 import FooterToolbar from '@/components/FooterToolbar'
-import NumberInfo from '@/components/NumberInfo'
+// import NumberInfo from '@/components/NumberInfo'
 import DescriptionList from '@/components/DescriptionList'
 import Tree from '@/components/Tree/Tree'
 import Trend from '@/components/Trend'
@@ -48,7 +48,7 @@ export {
   CountDown,
   Ellipsis,
   FooterToolbar,
-  NumberInfo,
+  // NumberInfo,
   DescriptionList,
   // 兼容写法,请勿继续使用
   DescriptionList as DetailList,

+ 7 - 1
src/views/financialManagement/accountStatement/baseModal.vue

@@ -35,7 +35,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { VSelect } from '@/components'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
-import { verifyAccountBillCreate, verifyAccountBillModify, verifyAcountBillDetail } from '@/api/verifyAccount.js'
+import { verifyAccountBillCreate, verifyAccountBillModify, verifyAcountBillDetail, findLastBillRemarks } from '@/api/verifyAccount.js'
 export default {
   name: 'ASBaseModal',
   mixins: [commonMixin],
@@ -75,11 +75,17 @@ export default {
       if (v && v.key) {
         this.form.dealerSn = v.key
         this.form.dealerName = v.row ? v.row.dealerName : ''
+        this.getDefRemarks()
       } else {
         this.form.dealerSn = ''
         this.form.dealerName = ''
       }
     },
+    // 获取上次备注
+    async getDefRemarks () {
+      const data = await findLastBillRemarks({ sn: this.form.dealerSn }).then(res => res.data)
+      this.form.remarks = data ? data.remarks || '' : ''
+    },
     //  保存
     handleSubmit (e) {
       e.preventDefault()

+ 72 - 27
src/views/financialManagement/accountStatement/edit.vue

@@ -1,10 +1,10 @@
 <template>
-  <div class="salesReturnEdit-wrap">
+  <div class="accountState-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
-      <a-page-header :ghost="false" :backIcon="false" class="salesReturnEdit-back">
+      <a-page-header :ghost="false" :backIcon="false" class="accountState-back">
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
-          <a id="salesReturnEdit-back-btn" href="javascript:;" @click="handleBack">
+          <a id="accountState-back-btn" href="javascript:;" @click="handleBack">
             <a-icon type="left" />
             返回列表
           </a>
@@ -15,7 +15,7 @@
           </a-button>
         </template>
       </a-page-header>
-      <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
+      <a-card size="small" :bordered="false" class="accountState-cont">
         <queryPart
           ref="partQuery"
           :newLoading="isInster"
@@ -25,7 +25,7 @@
           @add="saveProduct"
           @bachAdd="saveMoreProduct"></queryPart>
       </a-card>
-      <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
+      <a-card size="small" :bordered="false" class="accountState-cont">
         <a-alert style="margin-bottom: 10px;" type="info" v-if="countData">
           <div slot="message" class="total-bar">
             <div>
@@ -125,7 +125,7 @@
         :disabled="spinning"
         type="primary"
         class="button-primary"
-        @click="handleSubmit"
+        @click="handlePreSubmit"
         id="salesReturn-handleSubmit">提交</a-button>
     </div>
     <!-- 编辑基础信息弹窗 -->
@@ -138,13 +138,35 @@
       :itemSn="verifyAccountBillSn"
       :dealerSn="dealerSn"
       @cancel="baseModal=false"
-      @ok="hanldAudit"></baseTzModal>
+      @ok="hanldOk"></baseTzModal>
+    <!-- 提交前弹框 -->
+    <commonModal
+      modalTit="提示"
+      width="500px"
+      okText="提交"
+      :openModal="showTipModal"
+      @cancel="canselModal"
+      @ok="handleSubmit">
+      <div class="tip-list" v-if="detailData">
+        <div><span>经销商:</span>{{ detailData.dealerName }}</div>
+        <div><span>时间区间:</span>{{ detailData.bizFirstDate }}~{{ detailData.bizLastDate }}</div>
+        <div><span>期初余额:</span>{{ toThousands(detailData.beginBalance) }}</div>
+        <div><span>借方合计:</span>{{ toThousands(detailData.debitAmount) }}</div>
+        <div><span>贷方合计:</span>{{ toThousands(detailData.creditAmount) }}</div>
+        <div><span>余额:</span>{{ toThousands(detailData.totalAmount) }}</div>
+        <div>
+          <span style="width:70px;">备注:</span>
+          <a-textarea :rows="6" :maxLength="300" placeholder="请输入备注(最多300个字符)" v-model="detailData.remarks"></a-textarea>
+        </div>
+      </div>
+    </commonModal>
   </div>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
+import commonModal from '@/views/common/commonModal.vue'
 import queryPart from './queryPart.vue'
 import baseModal from './baseModal.vue'
 import baseTzModal from '../manualEntryForm/baseModal.vue'
@@ -168,7 +190,8 @@ export default {
     queryPart,
     baseModal,
     rangeDate,
-    baseTzModal
+    baseTzModal,
+    commonModal
   },
   data () {
     return {
@@ -226,7 +249,8 @@ export default {
       detailData: null, // 基础信息数据
       addMoreLoading: false, // 批量添加动画
       verifyAccountBillSn: undefined, // 单据sn
-      itemSn: null
+      itemSn: null,
+      showTipModal: false
     }
   },
   computed: {
@@ -263,6 +287,9 @@ export default {
     handleBack () {
       this.$router.push({ name: `accountStatementList` })
     },
+    canselModal () {
+      this.showTipModal = false
+    },
     //  创建时间  change
     dateChange (date) {
       this.productForm.beginDate = date[0] ? date[0] : ''
@@ -273,9 +300,8 @@ export default {
       this.itemSn = null
       this.baseModal = true
     },
-    // 打开审核提交弹框
-    hanldAudit (data) {
-      this.$message.success('提交成功')
+    // 调账成功
+    hanldOk (data) {
       this.resetTable(false)
     },
     // 删除所选产品
@@ -329,10 +355,12 @@ export default {
     },
     // 修改备注
     changeRemarks (record) {
-      this.spinning = true
-      verifyAcountBillDetailModify({ id: record.id, remarks: record.remarks }).then(res => {
-        this.spinning = false
-      })
+      if (record.remarks && record.remarks.length > 0) {
+        this.spinning = true
+        verifyAcountBillDetailModify({ id: record.id, remarks: record.remarks }).then(res => {
+          this.spinning = false
+        })
+      }
     },
     // 单个添加单据
     saveProduct (row) {
@@ -384,7 +412,7 @@ export default {
         })
     },
     // 提交
-    async handleSubmit () {
+    async handlePreSubmit () {
       this.spinning = true
       const ret = await verifyAcountBillSubmitCheck({ sn: this.verifyAccountBillSn })
       this.spinning = false
@@ -392,14 +420,7 @@ export default {
       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
-        })
+        this.showTipModal = true
       } else {
         // 提示不能参与的单子
         const _this = this
@@ -414,6 +435,17 @@ export default {
         })
       }
     },
+    // 提交单据
+    handleSubmit () {
+      this.spinning = true
+      verifyAcountBillSubmit({ verifyAccountBillSn: this.verifyAccountBillSn, remarks: this.detailData.remarks }).then(res => {
+        if (res.status == 200) {
+          this.handleBack()
+          this.$message.success(res.message)
+        }
+        this.spinning = false
+      })
+    },
     getChooseList () {
       this.$refs.partQuery.pageInit()
     },
@@ -460,7 +492,20 @@ export default {
 </script>
 
 <style lang="less">
-.salesReturnEdit-wrap {
+.tip-list{
+    padding: 10px;
+    > div{
+      display: flex;
+      margin-bottom: 10px;
+      > span{
+        margin-right: 6px;
+        text-align: right;
+        display: block;
+        width: 60px;
+      }
+    }
+  }
+.accountState-wrap {
   position: relative;
   height: 100%;
   padding-bottom: 51px;
@@ -469,7 +514,7 @@ export default {
     overflow-y: scroll;
     height: 100%;
   }
-  .salesReturnEdit-cont {
+  .accountState-cont {
     margin-top: 6px;
     .ant-divider-horizontal {
       margin: 10px 0 24px;

+ 6 - 1
src/views/financialManagement/accountStatementBill/baseModal.vue

@@ -34,7 +34,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { VSelect } from '@/components'
-import { verifyAccountBillCreate } from '@/api/verifyAccount.js'
+import { verifyAccountBillCreate, findLastBillRemarks } from '@/api/verifyAccount.js'
 export default {
   name: 'ASBaseModal',
   mixins: [commonMixin],
@@ -108,6 +108,11 @@ export default {
         dealerName: data.dealer.dealerName,
         remarks: ''
       }
+      // 获取默认备注
+      const res = await findLastBillRemarks({ sn: data.dealer.dealerSn })
+      if (res.status == 200) {
+        this.form.remarks = res.data.remarks
+      }
     }
   },
   watch: {