|
@@ -9,21 +9,30 @@
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :lg="6" :sm="12">
|
|
<a-col :lg="6" :sm="12">
|
|
- <a-form-item label="下单时间" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
|
|
|
+ <!-- <a-form-item label="下单时间" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
<a-range-picker style="width:100%" :disabledDate="disabledDate" v-model="queryOrderDate" format="YYYY-MM-DD"
|
|
<a-range-picker style="width:100%" :disabledDate="disabledDate" v-model="queryOrderDate" format="YYYY-MM-DD"
|
|
:placeholder="['开始时间', '结束时间']" id="SettlementRecordsList-queryOrderDate" />
|
|
:placeholder="['开始时间', '结束时间']" id="SettlementRecordsList-queryOrderDate" />
|
|
- </a-form-item>
|
|
|
|
|
|
+ </a-form-item> -->
|
|
|
|
+ <a-form-item label="下单时间:" :label-col="{ span: 7 }" :wrapper-col="{ span: 17}">
|
|
|
|
+ <a-range-picker
|
|
|
|
+ style="width:100%"
|
|
|
|
+ id="releaseRecordList-queryOrderDate"
|
|
|
|
+ :disabledDate="disabledDate"
|
|
|
|
+ v-model="queryOrderDate"
|
|
|
|
+ :format="dateFormat"
|
|
|
|
+ :placeholder="['开始时间', '结束时间']" />
|
|
|
|
+ </a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :lg="6" :sm="12">
|
|
<a-col :lg="6" :sm="12">
|
|
<a-form-item label="结算状态:" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
<a-form-item label="结算状态:" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
- <v-select ref="payStatus" code="PAY_STATUS" v-model="queryParam.orderFlag" allowClear></v-select>
|
|
|
|
|
|
+ <v-select ref="payStatus" code="SETTLE_STATUS_ALL" v-model="queryParam.orderFlag" allowClear></v-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :lg="6" :sm="12">
|
|
<a-col :lg="6" :sm="12">
|
|
<a-form-item label="销售合作商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
<a-form-item label="销售合作商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
<!-- <salesSearch ref="salesSearch" @salesChange="salesChange" placeholder="订单来源"></salesSearch> -->
|
|
<!-- <salesSearch ref="salesSearch" @salesChange="salesChange" placeholder="订单来源"></salesSearch> -->
|
|
- <a-select placeholder="请选择" allowClear v-model="queryParam.dataSourceNo" :showSearch="true" option-filter-prop="children"
|
|
|
|
- :filter-option="filterOption" @focus="handleFocus" @blur="handleBlur" @change="handleChange">
|
|
|
|
|
|
+ <a-select placeholder="请选择" allowClear v-model="queryParam.dataSourceNo" mode="multiple" :showSearch="true" option-filter-prop="children"
|
|
|
|
+ :filter-option="filterOption" @change="handleChange">
|
|
<a-select-option v-for="item in optionData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
|
|
<a-select-option v-for="item in optionData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -50,7 +59,7 @@
|
|
<a-col :lg="6" :sm="12">
|
|
<a-col :lg="6" :sm="12">
|
|
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
|
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
|
<a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
|
|
<a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
|
|
- <a-button style="margin-left: 8px" @click="handleExport">导出</a-button>
|
|
|
|
|
|
+ <a-button style="margin-left: 8px" class="export-btn" @click="handleExport">导出</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-form>
|
|
</a-form>
|
|
@@ -75,6 +84,8 @@
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
|
|
+import getDate from '@/libs/getDate.js'
|
|
|
|
+import { completeDate } from '@/libs/tools.js'
|
|
import {
|
|
import {
|
|
STable,
|
|
STable,
|
|
VSelect
|
|
VSelect
|
|
@@ -82,7 +93,9 @@ import {
|
|
import {
|
|
import {
|
|
listCustomerBundle,
|
|
listCustomerBundle,
|
|
queryBankPayStatus,
|
|
queryBankPayStatus,
|
|
- salesChannelList
|
|
|
|
|
|
+ salesChannelList,
|
|
|
|
+ countListBundle,
|
|
|
|
+ exportBundle
|
|
} from '@/api/customerBundle'
|
|
} from '@/api/customerBundle'
|
|
// import salesSearch from '@/components/salesQuery/salesSearch'
|
|
// import salesSearch from '@/components/salesQuery/salesSearch'
|
|
export default {
|
|
export default {
|
|
@@ -94,7 +107,7 @@ export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
- const searchData = Object.assign(parameter, this.queryParam)
|
|
|
|
|
|
+ const searchData = Object.assign(parameter, this.queryParam,{freeChoiceFlag:1})
|
|
console.log(this.queryOrderDate, 'this.queryOrderDate')
|
|
console.log(this.queryOrderDate, 'this.queryOrderDate')
|
|
if (this.queryOrderDate && this.queryOrderDate.length) {
|
|
if (this.queryOrderDate && this.queryOrderDate.length) {
|
|
searchData.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
|
|
searchData.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
|
|
@@ -115,11 +128,16 @@ export default {
|
|
form: this.$form.createForm(this, {
|
|
form: this.$form.createForm(this, {
|
|
name: 'CustomerBundleList'
|
|
name: 'CustomerBundleList'
|
|
}),
|
|
}),
|
|
- queryOrderDate: undefined,
|
|
|
|
|
|
+ // 将默认时间日期回显在时间选择框中
|
|
|
|
+ queryOrderDate: [
|
|
|
|
+ moment(getDate.getRecentday().starttime, this.dateFormat),
|
|
|
|
+ moment(getDate.getRecentday().endtime, this.dateFormat)
|
|
|
|
+ ],
|
|
|
|
+ dateFormat: 'YYYY-MM-DD',
|
|
queryParam: {
|
|
queryParam: {
|
|
number: '',
|
|
number: '',
|
|
- beginDate: '',
|
|
|
|
- endDate: '',
|
|
|
|
|
|
+ beginDate: null,
|
|
|
|
+ endDate: null,
|
|
orderFlag: '',
|
|
orderFlag: '',
|
|
custMobile: '',
|
|
custMobile: '',
|
|
bundleName: '',
|
|
bundleName: '',
|
|
@@ -227,36 +245,72 @@ export default {
|
|
disabledDate (current) {
|
|
disabledDate (current) {
|
|
return current && current > moment().endOf('day')
|
|
return current && current > moment().endOf('day')
|
|
},
|
|
},
|
|
|
|
+ // 创建时间change
|
|
|
|
+ onChange (dates, dateStrings) {
|
|
|
|
+ if ((dates, dateStrings)) {
|
|
|
|
+ this.queryParam.beginDate = dateStrings[0]
|
|
|
|
+ this.queryParam.endDate = dateStrings[1]
|
|
|
|
+ }
|
|
|
|
+ },
|
|
handleChange (value) {
|
|
handleChange (value) {
|
|
console.log(`selected ${value}`)
|
|
console.log(`selected ${value}`)
|
|
},
|
|
},
|
|
- handleBlur () {
|
|
|
|
- console.log('blur')
|
|
|
|
- },
|
|
|
|
- handleFocus () {
|
|
|
|
- console.log('focus')
|
|
|
|
- },
|
|
|
|
|
|
+ // handleBlur () {
|
|
|
|
+ // console.log('blur')
|
|
|
|
+ // },
|
|
|
|
+ // handleFocus () {
|
|
|
|
+ // console.log('focus')
|
|
|
|
+ // },
|
|
filterOption (input, option) {
|
|
filterOption (input, option) {
|
|
return (
|
|
return (
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
)
|
|
)
|
|
},
|
|
},
|
|
|
|
+ // 合计
|
|
|
|
+ getTotal () {
|
|
|
|
+ const params = {
|
|
|
|
+ beginDate: this.searchForm.beginDate,
|
|
|
|
+ endDate: this.searchForm.endDate,
|
|
|
|
+ bundleName: this.searchForm.bundleName,
|
|
|
|
+ number: this.searchForm.number,
|
|
|
|
+ custMobile: this.searchForm.custMobile,
|
|
|
|
+ orderFlag: this.searchForm.orderFlag,
|
|
|
|
+ salesChannelSettleStatus: this.searchForm.salesChannelSettleStatus,
|
|
|
|
+ partner: this.searchForm.partner
|
|
|
|
+ }
|
|
|
|
+ params.beginDate == null ? params.beginDate = getDate.getToday().starttime : null
|
|
|
|
+ params.endDate == null ? params.endDate = getDate.getToday().endtime : null
|
|
|
|
+ countListBundle(params).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ if (res.data) {
|
|
|
|
+ this.orderTotal = res.data.cnt || 0
|
|
|
|
+ this.totalAmounts = res.data.totalAmounts || 0
|
|
|
|
+ } else {
|
|
|
|
+ this.orderTotal = 0
|
|
|
|
+ this.totalAmounts = 0
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.orderTotal = 0
|
|
|
|
+ this.totalAmounts = 0
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 查看详情、
|
|
// 查看详情、
|
|
handleDetail(row){
|
|
handleDetail(row){
|
|
this.$router.push({
|
|
this.$router.push({
|
|
path: `/Service/PurchasedService/detail/${row.id}`
|
|
path: `/Service/PurchasedService/detail/${row.id}`
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- getSalesListData () {
|
|
|
|
- salesChannelList().then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.optionData = res.data || []
|
|
|
|
- const obj = { salesChannelName: '自有', salesChannelNo: 0 }
|
|
|
|
- const a = this.optionData.unshift(obj)
|
|
|
|
- console.log(this.optionData, '---------------添加自有')
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
|
|
+ // getSalesListData () {
|
|
|
|
+ // salesChannelList().then(res => {
|
|
|
|
+ // if (res.status == 200) {
|
|
|
|
+ // this.optionData = res.data || []
|
|
|
|
+ // const obj = { salesChannelName: '自有', salesChannelNo: 0 }
|
|
|
|
+ // const a = this.optionData.unshift(obj)
|
|
|
|
+ // console.log(this.optionData, '---------------添加自有')
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
reloadRow (row) {
|
|
reloadRow (row) {
|
|
queryBankPayStatus({
|
|
queryBankPayStatus({
|
|
tradeNo: row.tradeNo
|
|
tradeNo: row.tradeNo
|
|
@@ -267,8 +321,13 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
this.queryOrderDate = undefined
|
|
this.queryOrderDate = undefined
|
|
|
|
+ this.queryOrderDate = [
|
|
|
|
+ moment(getDate.getRecentday().starttime, this.dateFormat),
|
|
|
|
+ moment(getDate.getRecentday().endtime, this.dateFormat)
|
|
|
|
+ ]
|
|
this.queryParam = {
|
|
this.queryParam = {
|
|
number: '',
|
|
number: '',
|
|
beginDate: '',
|
|
beginDate: '',
|
|
@@ -288,66 +347,118 @@ export default {
|
|
},
|
|
},
|
|
// 导出
|
|
// 导出
|
|
handleExport () {
|
|
handleExport () {
|
|
- this.form.validateFields((err, values) => {
|
|
|
|
- if (!err) {
|
|
|
|
- this.queryParam = values.queryParam
|
|
|
|
- this.queryOrderDate = values.queryOrderDate
|
|
|
|
- this.queryParam.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
|
|
|
|
- this.queryParam.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
|
|
|
|
- // 获取距开始日期3个月后的时间戳
|
|
|
|
- const tVal = getThreeMonthsAfter(this.queryParam.beginDate)
|
|
|
|
- // 获取结束时间时间戳
|
|
|
|
- const endVal = new Date(this.queryParam.endDate.replace(/-/g, '/'))
|
|
|
|
- if (endVal.valueOf() > tVal - 86400000) {
|
|
|
|
- return this.$message.warning('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
|
|
|
|
- }
|
|
|
|
- const params = _.cloneDeep(this.queryParam)
|
|
|
|
- let requestObj = null
|
|
|
|
- // 按核销服务量进行结算
|
|
|
|
- if (this.settleType == 'ITEM_VERIFY') {
|
|
|
|
- params.bundName = params.bundleName
|
|
|
|
- params.bizNum = params.orderBundleNo
|
|
|
|
- delete params.bundleName
|
|
|
|
- delete params.orderBundleNo
|
|
|
|
- requestObj = exportByItem
|
|
|
|
- } else {
|
|
|
|
- requestObj = exportByBundle
|
|
|
|
- }
|
|
|
|
- this.exportLoading = true
|
|
|
|
- requestObj(params).then(res => {
|
|
|
|
- console.log(res, 'rrrrrrrrrrr')
|
|
|
|
- this.exportLoading = false
|
|
|
|
- this.download(res)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ const params = {
|
|
|
|
+ beginDate: this.queryParam.beginDate == null ? getDate.getToday().starttime : this.queryParam.beginDate,
|
|
|
|
+ endDate: this.queryParam.endDate == null ? getDate.getToday().endtime : this.queryParam.endDate,
|
|
|
|
+ bundleName: this.queryParam.bundleName,
|
|
|
|
+ number: this.queryParam.number,
|
|
|
|
+ custMobile: this.queryParam.custMobile,
|
|
|
|
+ orderFlag: this.queryParam.orderFlag,
|
|
|
|
+ vehicleNumber: this.queryParam.vehicleNumber,
|
|
|
|
+ dataSourceNo: this.queryParam.dataSourceNo
|
|
|
|
+ }
|
|
|
|
+ if (!params.beginDate && !params.endDate) {
|
|
|
|
+ this.$message.error('请先选择需要导出的下单时间区间再进行导出!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 判断两个时间段是否相差m个月
|
|
|
|
+ if (!completeDate(params.beginDate, params.endDate, 3)) {
|
|
|
|
+ this.$message.error('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.loading = true
|
|
|
|
+ exportBundle(params).then(res => {
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.download(res)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
download (data) {
|
|
download (data) {
|
|
- if (!data) {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ if (!data) { return }
|
|
const url = window.URL.createObjectURL(new Blob([data]))
|
|
const url = window.URL.createObjectURL(new Blob([data]))
|
|
const link = document.createElement('a')
|
|
const link = document.createElement('a')
|
|
-
|
|
|
|
link.style.display = 'none'
|
|
link.style.display = 'none'
|
|
link.href = url
|
|
link.href = url
|
|
const a = moment().format('YYYYMMDDhhmmss')
|
|
const a = moment().format('YYYYMMDDhhmmss')
|
|
- const fname = '应收结算-' + a
|
|
|
|
- console.log(fname, '111111')
|
|
|
|
|
|
+ const fname = '已购服务记录-' + a
|
|
link.setAttribute('download', fname + '.xlsx')
|
|
link.setAttribute('download', fname + '.xlsx')
|
|
document.body.appendChild(link)
|
|
document.body.appendChild(link)
|
|
link.click()
|
|
link.click()
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 导出
|
|
|
|
+ // handleExport () {
|
|
|
|
+ // this.form.validateFields((err, values) => {
|
|
|
|
+ // if (!err) {
|
|
|
|
+ // this.queryParam = values.queryParam
|
|
|
|
+ // this.queryOrderDate = values.queryOrderDate
|
|
|
|
+ // this.queryParam.beginDate = moment(this.queryOrderDate[0]).format('YYYY-MM-DD')
|
|
|
|
+ // this.queryParam.endDate = moment(this.queryOrderDate[1]).format('YYYY-MM-DD')
|
|
|
|
+ // // 获取距开始日期3个月后的时间戳
|
|
|
|
+ // const tVal = getThreeMonthsAfter(this.queryParam.beginDate)
|
|
|
|
+ // // 获取结束时间时间戳
|
|
|
|
+ // const endVal = new Date(this.queryParam.endDate.replace(/-/g, '/'))
|
|
|
|
+ // if (endVal.valueOf() > tVal - 86400000) {
|
|
|
|
+ // return this.$message.warning('单次最多只能导出3个月的数据,请缩小查询区间后再进行导出!')
|
|
|
|
+ // }
|
|
|
|
+ // const params = _.cloneDeep(this.queryParam)
|
|
|
|
+ // let requestObj = null
|
|
|
|
+ // // 按核销服务量进行结算
|
|
|
|
+ // if (this.settleType == 'ITEM_VERIFY') {
|
|
|
|
+ // params.bundName = params.bundleName
|
|
|
|
+ // params.bizNum = params.orderBundleNo
|
|
|
|
+ // delete params.bundleName
|
|
|
|
+ // delete params.orderBundleNo
|
|
|
|
+ // requestObj = exportByItem
|
|
|
|
+ // } else {
|
|
|
|
+ // requestObj = exportByBundle
|
|
|
|
+ // }
|
|
|
|
+ // this.exportLoading = true
|
|
|
|
+ // exportBundle(params).then(res => {
|
|
|
|
+ // console.log(res, 'rrrrrrrrrrr')
|
|
|
|
+ // this.exportLoading = false
|
|
|
|
+ // this.download(res)
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
|
|
+ // download (data) {
|
|
|
|
+ // if (!data) {
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // const url = window.URL.createObjectURL(new Blob([data]))
|
|
|
|
+ // const link = document.createElement('a')
|
|
|
|
+
|
|
|
|
+ // link.style.display = 'none'
|
|
|
|
+ // link.href = url
|
|
|
|
+ // const a = moment().format('YYYYMMDDhhmmss')
|
|
|
|
+ // const fname = '应收结算-' + a
|
|
|
|
+ // console.log(fname, '111111')
|
|
|
|
+ // link.setAttribute('download', fname + '.xlsx')
|
|
|
|
+ // document.body.appendChild(link)
|
|
|
|
+ // link.click()
|
|
|
|
+ // },
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
next(vm => {
|
|
next(vm => {
|
|
vm.resetSearchForm()
|
|
vm.resetSearchForm()
|
|
- vm.getSalesListData()
|
|
|
|
|
|
+ // vm.getSalesListData()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|
|
-
|
|
|
|
|
|
+ .table-page-search-wrapper{
|
|
|
|
+ .export-btn{
|
|
|
|
+ background-color: #ff9900;
|
|
|
|
+ border-color: #ff9900;
|
|
|
|
+ color: #fff;
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ }
|
|
|
|
+ .export-btn.ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger), .export-btn.ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger){
|
|
|
|
+ color: #fff;
|
|
|
|
+ border-color: #ff9900;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
</style>
|
|
</style>
|