Browse Source

销售收款

lilei 3 years ago
parent
commit
14436deb01

+ 14 - 4
src/api/settleReceipt.js

@@ -1,6 +1,6 @@
 import { axios } from '@/utils/request'
 import { axios } from '@/utils/request'
 
 
-//  财务收款  列表  分页
+//  销售收款  列表  分页
 export const settleReceiptList = (params) => {
 export const settleReceiptList = (params) => {
   const url = `/settleReceipt/queryPage/${params.pageNo}/${params.pageSize}`
   const url = `/settleReceipt/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageNo
@@ -11,12 +11,22 @@ export const settleReceiptList = (params) => {
     method: 'post'
     method: 'post'
   })
   })
 }
 }
-//  财务收款  收款
-export const settleReceipt = (params) => {
-  const url = `/settleReceipt/receipt/${params.sn}`
+//  仅标记收款
+export const settleReceiptBatch = (params) => {
+  const url = `/settleReceipt/receiptBatch`
   return axios({
   return axios({
     url: url,
     url: url,
     data: params,
     data: params,
     method: 'post'
     method: 'post'
   })
   })
 }
 }
+
+// 关联收款单
+export const settleReceiptBookBatch = (params) => {
+  const url = `/settleReceipt/receiptBookBatch`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 13 - 3
src/views/salesManagement/salesCollection/detailModal.vue

@@ -12,7 +12,7 @@
     <a-spin :spinning="spinning" tip="Loading...">
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="common-main">
       <div class="common-main">
         <div class="toolsBar">
         <div class="toolsBar">
-          <div v-if="detail.length">箭冠汽配西安大兴店,共 {{ detail && detail.length }} 个备货单,合计 1266.45 元,已选择 2 个收款单</div>
+          <div v-if="handlePlData.length">{{ handlePlData[0].settleClientName }},共 {{ handlePlData && handlePlData.length }} 个备货单,合计 {{ totalAmount }} 元,已选择 2 个收款单</div>
           <a-button type="primary" class="button-primary" @click="handleCommonOk">{{ okText }}</a-button>
           <a-button type="primary" class="button-primary" @click="handleCommonOk">{{ okText }}</a-button>
         </div>
         </div>
         <div>
         <div>
@@ -97,6 +97,7 @@
 <script>
 <script>
 import { salesList } from '@/api/sales'
 import { salesList } from '@/api/sales'
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
+import { settleReceiptBookBatch } from '@/api/settleReceipt.js'
 export default {
 export default {
   name: 'CommonModal',
   name: 'CommonModal',
   components: { STable, VSelect },
   components: { STable, VSelect },
@@ -127,7 +128,7 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       isShow: this.openModal, //  是否打开弹框
       disabled: false,
       disabled: false,
       spinning: false,
       spinning: false,
-      detail: [],
+      handlePlData: [],
       queryParam: {
       queryParam: {
 
 
       },
       },
@@ -179,9 +180,18 @@ export default {
       }
       }
     }
     }
   },
   },
+  computed: {
+    totalAmount () {
+      let ret = 0
+      this.handlePlData.map(item => {
+        ret = ret + item.totalAmount
+      })
+      return ret.toFixed(2)
+    }
+  },
   methods: {
   methods: {
     setData (data) {
     setData (data) {
-      this.detail = data
+      this.handlePlData = data
     },
     },
     // 删除
     // 删除
     handleDel (row) {
     handleDel (row) {

+ 43 - 23
src/views/salesManagement/salesCollection/list.vue

@@ -28,16 +28,16 @@
               </a-col>
               </a-col>
               <a-col :md="6" :sm="24">
               <a-col :md="6" :sm="24">
                 <a-form-item label="收货客户名称">
                 <a-form-item label="收货客户名称">
-                  <a-input id="salesCollectionList-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入收货客户名称"/>
+                  <a-input id="salesCollectionList-receiverName" v-model.trim="queryParam.receiverName" allowClear placeholder="请输入收货客户名称"/>
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
               <a-col :md="6" :sm="24">
               <a-col :md="6" :sm="24">
                 <a-form-item label="收款类型">
                 <a-form-item label="收款类型">
                   <v-select
                   <v-select
-                    v-model="queryParam.settleType"
-                    ref="settleType"
-                    id="salesCollectionList-settleType"
-                    code="SETTLE_STYLE"
+                    v-model="queryParam.keepType"
+                    ref="keepType"
+                    id="salesCollectionList-keepType"
+                    code="KEEP_TYPE"
                     placeholder="请选择收款类型"
                     placeholder="请选择收款类型"
                     allowClear></v-select>
                     allowClear></v-select>
                 </a-form-item>
                 </a-form-item>
@@ -132,7 +132,7 @@
         ref="table"
         ref="table"
         :style="{ height: tableHeight+84.5+'px' }"
         :style="{ height: tableHeight+84.5+'px' }"
         size="small"
         size="small"
-        :row-selection=" showSelect?{ columnWidth: 40 }:null"
+        :row-selection="showSelect?{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.settleState=='FINISH' } })}:null"
         @rowSelection="rowSelectionFun"
         @rowSelection="rowSelectionFun"
         :rowKey="(record) => record.id"
         :rowKey="(record) => record.id"
         :columns="columns"
         :columns="columns"
@@ -162,10 +162,11 @@
           <a-button
           <a-button
             size="small"
             size="small"
             type="link"
             type="link"
-            v-if="record.settleState=='WAIT' && record.voidFlag!=1 && $hasPermissions('B_financialCollection_receipt')"
+            v-if="record.settleState=='FINISH' && $hasPermissions('B_financialCollection_receipt')"
             class="button-warning"
             class="button-warning"
             @click="handleVoucher(record)"
             @click="handleVoucher(record)"
             id="financialCollectionList-voucher-btn">凭证</a-button>
             id="financialCollectionList-voucher-btn">凭证</a-button>
+          <span v-if="record.settleState=='WAIT' && record.voidFlag==1">--</span>
         </template>
         </template>
       </s-table>
       </s-table>
       <!-- 销售收款弹框 -->
       <!-- 销售收款弹框 -->
@@ -176,7 +177,7 @@
         @ok="handleSaveColle"
         @ok="handleSaveColle"
       >
       >
         <div style="text-align: center;line-height: 24px;">
         <div style="text-align: center;line-height: 24px;">
-          <div v-if="handlePlData.length">箭冠汽配西安大兴店,共 {{ handlePlData && handlePlData.length }} 个备货单,合计 1266.45 元</div>
+          <div v-if="handlePlData.length">{{ handlePlData[0].settleClientName }},共 {{ handlePlData && handlePlData.length }} 个备货单,合计 {{ totalAmount }} 元</div>
           <div style="padding: 15px 0;font-weight: bold;">请选择收款类型</div>
           <div style="padding: 15px 0;font-weight: bold;">请选择收款类型</div>
           <div>
           <div>
             <a-radio-group v-model="collectionType">
             <a-radio-group v-model="collectionType">
@@ -209,7 +210,7 @@ import Area from '@/views/common/area.js'
 import commonModal from '@/views/common/commonModal.vue'
 import commonModal from '@/views/common/commonModal.vue'
 import detailModal from './detailModal.vue'
 import detailModal from './detailModal.vue'
 import voucherModal from './voucherModal.vue'
 import voucherModal from './voucherModal.vue'
-import { settleReceiptList, settleReceipt } from '@/api/settleReceipt'
+import { settleReceiptList, settleReceiptBatch } from '@/api/settleReceipt'
 
 
 export default {
 export default {
   name: 'SalesCollectionList',
   name: 'SalesCollectionList',
@@ -230,8 +231,10 @@ export default {
         beginDateSettle: '',
         beginDateSettle: '',
         endDateSettle: '',
         endDateSettle: '',
         settleClientName: '',
         settleClientName: '',
+        receiverName: '',
         dealerLevel: undefined,
         dealerLevel: undefined,
         settleStyle: undefined,
         settleStyle: undefined,
+        keepType: undefined,
         subareaSn: undefined,
         subareaSn: undefined,
         billStatus: undefined,
         billStatus: undefined,
         settleState: undefined,
         settleState: undefined,
@@ -277,20 +280,27 @@ export default {
     showSelect () {
     showSelect () {
       return this.$hasPermissions('B_financialCollection_receipt')
       return this.$hasPermissions('B_financialCollection_receipt')
     },
     },
+    totalAmount () {
+      let ret = 0
+      this.handlePlData.map(item => {
+        ret = ret + item.totalAmount
+      })
+      return ret.toFixed(2)
+    },
     columns () {
     columns () {
       const arr = [
       const arr = [
         { title: '创建时间', dataIndex: 'createDate', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
         { 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: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '客户名称', dataIndex: 'settleClientName', align: 'left', width: '9%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收货客户名称', dataIndex: 'settleClientName1', 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: 'qty1', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售单号', scopedSlots: { customRender: 'bizNo' }, width: '9%', align: 'center' },
+        { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '9%', align: 'center' },
+        { title: '发货编号', dataIndex: 'sendNo', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客户名称', dataIndex: 'settleClientName', align: 'left', width: '10%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收货客户名称', dataIndex: 'receiverName', align: 'left', width: '10%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品款数', dataIndex: 'totalCategory', 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: 'settleStyleDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收款类型', dataIndex: 'keepTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收款时间', dataIndex: 'settleTime', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收款时间', dataIndex: 'settleTime', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '收款方式', dataIndex: 'settleStyleDictValue1', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收款方式', dataIndex: 'settleStyleDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '财务状态', dataIndex: 'settleStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '财务状态', dataIndex: 'settleStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据状态', dataIndex: 'voidFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据状态', dataIndex: 'voidFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -330,8 +340,10 @@ export default {
       this.queryParam.beginDateSettle = ''
       this.queryParam.beginDateSettle = ''
       this.queryParam.endDateSettle = ''
       this.queryParam.endDateSettle = ''
       this.queryParam.settleClientName = ''
       this.queryParam.settleClientName = ''
+      this.queryParam.receiverName = ''
       this.queryParam.dealerLevel = undefined
       this.queryParam.dealerLevel = undefined
       this.queryParam.settleStyle = undefined
       this.queryParam.settleStyle = undefined
+      this.queryParam.keepType = undefined
       this.queryParam.subareaSn = undefined
       this.queryParam.subareaSn = undefined
       this.queryParam.billStatus = undefined
       this.queryParam.billStatus = undefined
       this.queryParam.settleState = undefined
       this.queryParam.settleState = undefined
@@ -349,7 +361,7 @@ export default {
     handleBhDetail (row) {
     handleBhDetail (row) {
       this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'salesCollection' } })
       this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'salesCollection' } })
     },
     },
-    // 收款
+    // 点击批量收款
     handlePlColle () {
     handlePlColle () {
       const _this = this
       const _this = this
       const slen = _this.rowSelectionInfo.selectedRowKeys.length
       const slen = _this.rowSelectionInfo.selectedRowKeys.length
@@ -376,26 +388,34 @@ export default {
     handleVoucher (row) {
     handleVoucher (row) {
       this.showVoucher = true
       this.showVoucher = true
     },
     },
-    // 收款
+    // 点击收款
     handleColle (row) {
     handleColle (row) {
       this.handlePlData = [row]
       this.handlePlData = [row]
       this.showSkModal = true
       this.showSkModal = true
     },
     },
-    // 批量收款
+    // 批量/单个收款
     handleSaveColle (row) {
     handleSaveColle (row) {
       const _this = this
       const _this = this
+      const snList = []
+      this.handlePlData.map(item => {
+        snList.push(item.accountReceiptSn)
+      })
       // 关联收款
       // 关联收款
       if (this.collectionType == 1) {
       if (this.collectionType == 1) {
         this.showDetail = true
         this.showDetail = true
-        this.$refs.detailModal.setData(this.handlePlData)
+        this.$refs.detailModal.setData(this.handlePlData, snList)
         this.showSkModal = false
         this.showSkModal = false
+        _this.collectionType = 1
       } else {
       } else {
+        // 仅标记收款
         _this.spinning = true
         _this.spinning = true
-        settleReceipt({ sn: row.accountReceiptSn }).then(res => {
+        _this.showSkModal = false
+        settleReceiptBatch({ snList: snList }).then(res => {
           if (res.status == 200) {
           if (res.status == 200) {
             _this.$message.success(res.message)
             _this.$message.success(res.message)
             _this.$refs.table.refresh()
             _this.$refs.table.refresh()
             _this.spinning = false
             _this.spinning = false
+            _this.collectionType = 1
           } else {
           } else {
             _this.spinning = false
             _this.spinning = false
           }
           }

+ 2 - 2
vue.config.js

@@ -107,9 +107,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
     proxy: {
       '/api': {
       '/api': {
-        // target: 'http://192.168.16.102/ocs-admin',
+        target: 'http://192.168.0.215/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  Á·Ï°
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  Á·Ï°
-        target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
+        // target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
         ws: false,
         ws: false,
         changeOrigin: true,
         changeOrigin: true,
         pathRewrite: {
         pathRewrite: {