瀏覽代碼

应付结算记录接口对接

zhangdan 4 年之前
父節點
當前提交
374c2688cd

+ 44 - 0
src/api/FinancialManagement.js

@@ -0,0 +1,44 @@
+import { axios } from '@/utils/request'
+
+// 应收结算记录列表
+export const settlementRecordsList = params => {
+  const url = `/salesChannelSettlement/queryLike/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 合计
+export const settlementRecordsListTotal = params => {
+  const url = `/salesChannelSettlement/total`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 合作商
+export const salesChannelList = params => {
+  const url = `/salesChannel/query`
+  return axios.request({
+    url: url,
+    method: 'post'
+  })
+}
+
+// 按核销套餐单号查询详情列表
+export const SettlementRecordsDetailsList = params => {
+  const url = `/SettlementGoodsChannel/detail/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 95 - 44
src/views/FinancialManagement/PaySettlementRecords.vue

@@ -6,25 +6,30 @@
         <a-row :gutter="48">
           <a-col :lg="6" :sm="12">
             <a-form-item label="结算时间:">
-              <a-range-picker style="width:100%" v-model="queryOrderDate" format="YYYY-MM-DD" :placeholder="['开始时间', '结束时间']" />
+              <a-range-picker
+                style="width:100%"
+                :disabledDate="disabledDate"
+                v-model="queryOrderDate"
+                format="YYYY-MM-DD"
+                :placeholder="['开始时间', '结束时间']" />
             </a-form-item>
           </a-col>
           <a-col :lg="6" :sm="12">
             <a-form-item label="结算单号">
-              <a-input class="full-width" v-model="queryParam.number" :maxLength="11" placeholder="请输入" allowClear />
+              <a-input class="full-width" v-model="queryParam.settleNo" placeholder="请输入" allowClear />
             </a-form-item>
           </a-col>
           <a-col :lg="6" :sm="12">
-            <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button type="primary" @click="refresh">查询</a-button>
             <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
           </a-col>
         </a-row>
       </a-form>
     </div>
-    <a-divider style="margin-top: 0;"/>
+    <a-divider />
     <!-- 合计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">总计:<span>{{ 3 }}</span> 单,实收<span>¥{{ 2900 }}</span> 元</div>
+      <div class="ftext" slot="message">共<span>{{ orderTotal }}</span>单,实收<span>¥{{ amountTotal }}</span>元</div>
     </a-alert>
     <!-- 列表 -->
     <div>
@@ -37,7 +42,7 @@
         :data="loadData">
         <template slot="action" slot-scope="text, record">
           <!-- <a-icon type="eye" title="查看" :style="{ fontSize: '20px', color: '#e29e14', padding: '0 10px' }" @click="handleDetail(record)" /> -->
-          <a-button type="primary" @click="handleDetail(record)">查看</a-button>
+          <a-button type="primary" @click="handleDetail(record)">详情</a-button>
         </template>
       </s-table>
     </div>
@@ -52,12 +57,13 @@ import {
   STable,
   VSelect
 } from '@/components'
-// import {
-//   listCustomerBundle
-// } from '@/api/customerBundle'
+import {
+  settlementRecordsList,
+  settlementRecordsListTotal
+} from '@/api/FinancialManagement'
 import PaySettlementRecordsDetailsModal from './PaySettlementRecordsDetailsModal.vue'
 export default {
-  name: 'PaySettlementRecordsList',
+  name: 'SettlementRecordsList',
   components: {
     VSelect,
     STable,
@@ -66,32 +72,33 @@ export default {
   data () {
     return {
       loadData: parameter => {
-        // const searchData = Object.assign(parameter, this.queryParam)
-        // console.log(this.queryOrderDate, 'this.queryOrderDate')
-        // if (this.queryOrderDate && this.queryOrderDate.length) {
-        //   searchData.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
-        //   searchData.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
-        // } else {
-        //   searchData.beginDate = ''
-        //   searchData.endDate = ''
-        // }
-        // return listCustomerBundle(searchData).then(res => {
-        //   const no = (res.pageNo - 1) * res.pageSize
-        //   for (let i = 0; i < res.list.length; i++) {
-        //     const _item = res.list[i]
-        //     _item.no = no + i + 1
-        //   }
-        //   return res
-        // })
+        const searchData = Object.assign(parameter, this.queryParam)
+        console.log(this.queryOrderDate, 'this.queryOrderDate')
+        if (this.queryOrderDate && this.queryOrderDate.length) {
+          searchData.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
+          searchData.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
+        } else {
+          searchData.beginDate = ''
+          searchData.endDate = ''
+        }
+        return settlementRecordsList(searchData).then(res => {
+          const no = (res.data.pageNo - 1) * res.data.pageSize
+          for (let i = 0; i < res.data.list.length; i++) {
+            const _item = res.data.list[i]
+            _item.no = no + i + 1
+          }
+          return res.data
+        })
       },
       queryOrderDate: undefined,
       queryParam: {
-        number: '',
+        settleNo: '',
         beginDate: '',
-        endDate: '',
-        orderFlag: ''
+        endDate: ''
       },
-      itemId: null, // 每条数据id
+      orderTotal: 0, // 订单数量
+      amountTotal: 0, // 实收总金额
+      itemId: '', // 每条数据id
       openModalDetails: false, // 默认关闭详情弹窗
       columns: [{
         title: '序号',
@@ -101,19 +108,19 @@ export default {
       },
       {
         title: '结算单号',
-        dataIndex: 'aaa',
+        dataIndex: 'settleNo',
         width: '150px',
         align: 'center'
       },
       {
         title: '结算时间',
-        dataIndex: 'orderDate',
+        dataIndex: 'settleDate',
         width: '150px',
         align: 'center'
       },
       {
         title: '结算订单数',
-        dataIndex: 'custMobile',
+        dataIndex: 'orderNum',
         width: '150px',
         align: 'center',
         scopedSlots: {
@@ -121,8 +128,8 @@ export default {
         }
       },
       {
-        title: '结算订单总金额(¥)',
-        dataIndex: 'bundleName',
+        title: '结算金额',
+        dataIndex: 'realAmount',
         align: 'center',
         width: '150px'
       },
@@ -139,29 +146,73 @@ export default {
     }
   },
   methods: {
+    // 禁止不可选日期
+    disabledDate (current) {
+      return current && current > moment().endOf('day')
+    },
     // 查看详情
     handleDetail (record) {
-      this.itemId = record.id
+      this.itemId = record.settleNo
       console.log(this.itemId)
       this.openModalDetails = true
     },
+    // 查询
+    refresh () {
+      this.$refs.table.refresh(true)
+      this.getListTotal()
+    },
     // 重置
     resetSearchForm () {
       this.queryOrderDate = undefined
       this.queryParam = {
-        number: '',
+        settleNo: '',
         beginDate: '',
-        endDate: '',
-        orderFlag: '',
-        custMobile: '',
-        bundleName: '',
-        vehicleNumber: ''
+        endDate: ''
       }
       this.$refs.table.refresh(true)
+      this.getListTotal()
+    },
+    // 合计
+    getListTotal () {
+      const params = {
+        settleNo: this.queryParam.settleNo,
+        beginDate: this.queryParam.beginDate,
+        endDate: this.queryParam.endDate
+      }
+      if (this.queryOrderDate && this.queryOrderDate.length) {
+        params.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
+        params.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
+      } else {
+        params.beginDate = ''
+        params.endDate = ''
+      }
+      //    params.beginDate == null ? params.beginDate = getDate.getToday().starttime : null
+      //    params.endDate == null ? params.endDate = getDate.getToday().endtime : null
+      settlementRecordsListTotal(params).then(res => {
+        if (res.status == 200) {
+          if (res.data) {
+            this.orderTotal = res.data.orderNum || 0
+            this.amountTotal = res.data.amount || 0
+          } else {
+            this.orderTotal = 0
+            this.amountTotal = 0
+          }
+        }
+      })
     }
+
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.resetSearchForm()
+    })
   }
 }
 </script>
 
-<style>
+<style scoped>
+	.ftext span {
+		color: #fa8c16;
+		font-weight: bold;
+	}
 </style>

+ 67 - 52
src/views/FinancialManagement/PaySettlementRecordsDetailsModal.vue

@@ -8,21 +8,21 @@
       :footer="null"
       width="60%"
       :centered="true">
-      <s-table
+      <a-table
         ref="table"
         size="default"
-        rowKey="id"
+        :rowKey="(record) => record.id"
         bordered
         :columns="columns"
-        :data="loadData">
+        :data-source="loadData">
         <template slot="action" slot-scope="text, record">
           <!-- <a-icon type="eye" title="查看" :style="{ fontSize: '20px', color: '#e29e14', padding: '0 10px' }" @click="handleDetail(record)" /> -->
           <a-button type="primary" @click="handleDetail(record)">查看</a-button>
         </template>
-      </s-table>
+      </a-table>
     </a-modal>
     <!-- 核销详情弹窗 -->
-    <WriteOffDetailsModal :number="number" :openWriteOffModal="openWriteOffModal" @close="openWriteOffModal=false"></WriteOffDetailsModal>
+    <WriteOffDetailsModal :settleId="settleId" :openWriteOffModal="openWriteOffModal" @close="openWriteOffModal=false"></WriteOffDetailsModal>
   </div>
 </template>
 
@@ -31,9 +31,9 @@ import {
   STable
 } from '@/components'
 import WriteOffDetailsModal from './WriteOffDetailsModal.vue'
-// import {
-//   listCustomerBundle
-// } from '@/api/customerBundle'
+import {
+  SettlementRecordsDetailsList
+} from '@/api/FinancialManagement'
 export default {
   name: 'SettlementRecordsDetailsModal',
   components: {
@@ -46,34 +46,35 @@ export default {
       default: false
     },
     itemId: {
-      type: Number,
-      default: null
+      type: String,
+      default: ''
     }
   },
   data () {
     return {
-      loadData: parameter => {
-        // const searchData = Object.assign(parameter, this.queryParam)
-        // console.log(this.queryOrderDate, 'this.queryOrderDate')
-        // if (this.queryOrderDate && this.queryOrderDate.length) {
-        //   searchData.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
-        //   searchData.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
-        // } else {
-        //   searchData.beginDate = ''
-        //   searchData.endDate = ''
-        // }
-        // return listCustomerBundle(searchData).then(res => {
-        //   const no = (res.pageNo - 1) * res.pageSize
-        //   for (let i = 0; i < res.list.length; i++) {
-        //     const _item = res.list[i]
-        //     _item.no = no + i + 1
-        //   }
-        //   return res
-        // })
-      },
-	  isshow: this.openModalDetails,
-	  number: '',	// 套餐名称
-	  openWriteOffModal: false, // 核销小青弹窗默认关闭
+      // loadData: parameter => {
+      //   // const searchData = Object.assign(parameter, this.queryParam)
+      //   // console.log(this.queryOrderDate, 'this.queryOrderDate')
+      //   // if (this.queryOrderDate && this.queryOrderDate.length) {
+      //   //   searchData.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
+      //   //   searchData.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
+      //   // } else {
+      //   //   searchData.beginDate = ''
+      //   //   searchData.endDate = ''
+      //   // }
+      //   // return listCustomerBundle(searchData).then(res => {
+      //   //   const no = (res.pageNo - 1) * res.pageSize
+      //   //   for (let i = 0; i < res.list.length; i++) {
+      //   //     const _item = res.list[i]
+      //   //     _item.no = no + i + 1
+      //   //   }
+      //   //   return res
+      //   // })
+      // },
+	 loadData: [],
+	 isshow: this.openModalDetails,
+	 settleId: '',	// 套餐名称
+	 openWriteOffModal: false, // 核销弹窗默认关闭
       columns: [{
         title: '序号',
         dataIndex: 'no',
@@ -82,34 +83,25 @@ export default {
       },
       {
         title: '订单号',
-        dataIndex: 'number',
+        dataIndex: 'orderBundleNo',
         width: '150px',
         align: 'center'
       },
       {
         title: '下单时间',
-        dataIndex: 'aaa',
-        width: '150px',
-        align: 'center'
-      },
-      {
-        title: '客户信息',
         dataIndex: 'orderDate',
         width: '150px',
         align: 'center'
       },
       {
         title: '套餐名称',
-        dataIndex: 'custMobile',
+        dataIndex: 'bundleName',
         width: '150px',
-        align: 'center',
-        scopedSlots: {
-          customRender: 'userInfo'
-        }
+        align: 'center'
       },
       {
-        title: '结算金额(¥)',
-        dataIndex: 'bundleName',
+        title: '结算金额',
+        dataIndex: 'settleAmount',
         align: 'center',
         width: '150px'
       },
@@ -128,23 +120,46 @@ export default {
   methods: {
     // 关闭弹窗
     cancel (e) {
-      this.clear()
       this.$emit('close')
     },
+    // 获取列表数据
+    getListData (itemId) {
+      SettlementRecordsDetailsList({
+        settleNo: this.itemId,
+        pageNo: 1,
+        pageSize: 10
+      }).then(res => {
+        if (res.status == 200) {
+          res.data.list.map((item, index) => {
+            item.no = index + 1
+          })
+          this.loadData = res.data.list
+   	  console.log(this.loadData, '----列表')
+        }
+      })
+    },
     // 查看核销详情
     handleDetail (record) {
-      console.log(44444444444444)
-      this.number = record.number
+      this.settleId = record.settleNo
       this.openWriteOffModal = true
+      console.log('查看详情', this.settleId, this.openWriteOffModal)
     }
   },
   watch: {
     openModalDetails (newValue, oldValue) {
       this.isshow = newValue
-	  console.log(this.isshow)
+      console.log(this.isshow)
     },
-    isshow (newValue, oldValue) {
-
+    isshow (val) {
+      if (!val) {
+        this.$emit('close')
+      }
+    },
+    itemId (newValue, oldValue) {
+      console.log(newValue)
+      if (newValue && this.isshow) {
+        this.getListData(newValue)
+      }
     }
   }
 }

+ 66 - 40
src/views/FinancialManagement/WriteOffDetailsModal.vue

@@ -2,63 +2,66 @@
   <div>
     <a-modal
       class="modalBox"
-      :title="title"
+      title="详情"
       v-model="isshow"
       @cancle="cancel"
       :footer="null"
       width="60%"
       :centered="true">
-      <s-table
+      <a-table
         ref="table"
         size="default"
-        rowKey="id"
+        :rowKey="(record) => record.id"
         bordered
         :columns="columns"
-        :data="loadData">
-      </s-table>
+        :data-source="loadData">
+      </a-table>
     </a-modal>
   </div>
 </template>
 
 <script>
 import { STable } from '@/components'
+import {
+  SettlementRecordsDetailsList
+} from '@/api/FinancialManagement'
 export default {
   components: {
     STable
   },
   props: {
-    packageName: {
-      type: String,
-      default: ''
-    },
     openWriteOffModal: {
       type: Boolean,
       default: false
+    },
+    settleId: {
+      type: String,
+      default: ''
     }
-
   },
   data () {
     return {
-      loadData: parameter => {
-		  // const searchData = Object.assign(parameter, this.queryParam)
-		  // console.log(this.queryOrderDate, 'this.queryOrderDate')
-		  // if (this.queryOrderDate && this.queryOrderDate.length) {
-		  //   searchData.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
-		  //   searchData.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
-		  // } else {
-		  //   searchData.beginDate = ''
-		  //   searchData.endDate = ''
-		  // }
-		  // return listCustomerBundle(searchData).then(res => {
-		  //   const no = (res.pageNo - 1) * res.pageSize
-		  //   for (let i = 0; i < res.list.length; i++) {
-		  //     const _item = res.list[i]
-		  //     _item.no = no + i + 1
-		  //   }
-		  //   return res
-		  // })
-      },
-      title: this.PackageName + '--' + '核销详情',
+    //   loadData: parameter => {
+		  // // const searchData = Object.assign(parameter, this.queryParam)
+		  // // console.log(this.queryOrderDate, 'this.queryOrderDate')
+		  // // if (this.queryOrderDate && this.queryOrderDate.length) {
+		  // //   searchData.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
+		  // //   searchData.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
+		  // // } else {
+		  // //   searchData.beginDate = ''
+		  // //   searchData.endDate = ''
+		  // // }
+		  // // return listCustomerBundle(searchData).then(res => {
+		  // //   const no = (res.pageNo - 1) * res.pageSize
+		  // //   for (let i = 0; i < res.list.length; i++) {
+		  // //     const _item = res.list[i]
+		  // //     _item.no = no + i + 1
+		  // //   }
+		  // //   return res
+		  // // })
+    //   },
+      // title: this.PackageName + '--' + '核销详情',
+      loadData: [],
       isshow: this.openWriteOffModal,
 	  columns: [{
 	    title: '序号',
@@ -68,25 +71,25 @@ export default {
 	  },
 	  {
 	    title: '核销单号',
-	    dataIndex: 'number',
+	    dataIndex: 'verificationNo',
 	    width: '150px',
 	    align: 'center'
 	  },
 	  {
 	    title: '核销时间',
-	    dataIndex: 'aaa',
+	    dataIndex: 'usedTime',
 	    width: '150px',
 	    align: 'center'
 	  },
 	  {
-	    title: '客户信息',
-	    dataIndex: 'orderDate',
+	    title: '套餐名称',
+	    dataIndex: 'bundleName',
 	    width: '150px',
 	    align: 'center'
 	  },
 	  {
 	    title: '服务名称',
-	    dataIndex: 'custMobile',
+	    dataIndex: 'bundleItemName',
 	    width: '150px',
 	    align: 'center',
 	    scopedSlots: {
@@ -95,13 +98,13 @@ export default {
 	  },
 	  {
 	    title: '结算金额',
-	    dataIndex: 'bundleName',
+	    dataIndex: 'settleAmount',
 	    align: 'center',
 	    width: '150px'
 	  },
 	  {
 	    title: '核销门店',
-	    dataIndex: 'action',
+	    dataIndex: 'usedStoreName',
 	    width: '100px',
 	    align: 'center'
 	  }
@@ -113,14 +116,37 @@ export default {
 	  cancel (e) {
 	    this.clear()
 	    this.$emit('close')
+	  },
+	  // 获取列表数据
+	  getListData () {
+	    SettlementRecordsDetailsList({
+	      settleNo: this.settleId,
+	      pageNo: 1,
+	      pageSize: 10
+	    }).then(res => {
+	      if (res.status == 200) {
+	        res.data.list.map((item, index) => {
+	          item.no = index + 1
+	        })
+	        this.loadData = res.data.list
+	      }
+	    })
 	  }
   },
   watch: {
 	  openWriteOffModal (newValue, oldValue) {
-		  this.isshow = newValue
+	  		  this.isshow = newValue
 	  },
-	  isshow (newValue, oldValue) {
-
+	  isshow (val) {
+	    if (!val) {
+	      this.$emit('close')
+	    }
+	  },
+	  settleId (newValue, oldValue) {
+	    console.log(newValue)
+	    if (newValue && this.isshow) {
+	      this.getListData(newValue)
+	    }
 	  }
   }
 }