|
@@ -90,18 +90,12 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
|
|
|
- <a-form-item label="客服">
|
|
|
+ <a-form-model-item label="客服">
|
|
|
<customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
|
|
|
- </a-form-item>
|
|
|
+ </a-form-model-item>
|
|
|
</a-col>
|
|
|
</template>
|
|
|
<a-col :md="isShowCustomerSearch?24:6" :sm="24" style="margin-bottom: 10px;" :style="{textAlign: isShowCustomerSearch?'center':''}">
|
|
|
- <!-- <a-button
|
|
|
- type="primary"
|
|
|
- class="button-info"
|
|
|
- size="small"
|
|
|
- @click="handleStock"
|
|
|
- id="salesOrderTotalList-stockDate">盘点区间日期</a-button> -->
|
|
|
<a-button
|
|
|
style="margin-left: 5px"
|
|
|
type="primary"
|
|
@@ -182,87 +176,67 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {
|
|
|
- commonMixin
|
|
|
-} from '@/utils/mixin'
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
import getDate from '@/libs/getDate.js'
|
|
|
-import {
|
|
|
- STable,
|
|
|
- VSelect
|
|
|
-} from '@/components'
|
|
|
+import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
+// 组件
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
import subarea from '@/views/common/subarea.js'
|
|
|
import custList from '@/views/common/custList.vue'
|
|
|
import reportModal from '@/views/common/reportModal.vue'
|
|
|
import customerService from '@/views/common/customerService.vue'
|
|
|
import Area from '@/views/common/area.js'
|
|
|
-import {
|
|
|
- hdExportExcel
|
|
|
-} from '@/libs/exportExcel'
|
|
|
-import {
|
|
|
- userQueryList
|
|
|
-} from '@/api/power-user'
|
|
|
-import {
|
|
|
- reportSalesBillList,
|
|
|
- reportSalesBillCount,
|
|
|
- reportSalesBillExport
|
|
|
-} from '@/api/reportData'
|
|
|
+// 接口
|
|
|
+import { userQueryList } from '@/api/power-user'
|
|
|
+import { reportSalesBillList, reportSalesBillCount, reportSalesBillExport } from '@/api/reportData'
|
|
|
export default {
|
|
|
name: 'SalesOrderTotalList',
|
|
|
mixins: [commonMixin],
|
|
|
- components: {
|
|
|
- STable,
|
|
|
- VSelect,
|
|
|
- rangeDate,
|
|
|
- custList,
|
|
|
- subarea,
|
|
|
- reportModal,
|
|
|
- Area,
|
|
|
- customerService
|
|
|
- },
|
|
|
+ components: { STable, VSelect, rangeDate, custList, subarea, reportModal, Area, customerService },
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
|
- tableHeight: 0,
|
|
|
- showExport: false,
|
|
|
- queryParam: { // 查询条件
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ tableHeight: 0, // 表格高度
|
|
|
+ exportLoading: false, // 导出按钮加载状态
|
|
|
+ showExport: false, // 导出到下载中心弹窗
|
|
|
+ // 查询参数
|
|
|
+ queryParam: {
|
|
|
+ // 默认时间
|
|
|
time: [
|
|
|
getDate.getCurrMonthDays().starttime,
|
|
|
getDate.getCurrMonthDays().endtime
|
|
|
],
|
|
|
- beginDate: getDate.getCurrMonthDays().starttime,
|
|
|
- endDate: getDate.getCurrMonthDays().endtime,
|
|
|
- salesBillNo: '',
|
|
|
- dealerName: '',
|
|
|
- dealerLevel: undefined,
|
|
|
- operatorSn: undefined,
|
|
|
+ beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
|
|
|
+ endDate: getDate.getCurrMonthDays().endtime, // 结束时间
|
|
|
+ salesBillNo: '', // 销售单号
|
|
|
+ dealerName: '', // 客户名称
|
|
|
+ dealerLevel: undefined, // 客户级别
|
|
|
+ operatorSn: undefined, // 操作员sn
|
|
|
subareaArea: {
|
|
|
- subareaSn: undefined,
|
|
|
- subareaAreaSn: undefined
|
|
|
+ subareaSn: undefined, // 区域
|
|
|
+ subareaAreaSn: undefined// 分区
|
|
|
},
|
|
|
- dealerProvinceSn: undefined,
|
|
|
- bizUserSn: undefined
|
|
|
- },
|
|
|
- rules: {
|
|
|
- 'time': [{
|
|
|
- required: true,
|
|
|
- message: '请选择下推时间',
|
|
|
- trigger: 'change'
|
|
|
- }]
|
|
|
+ dealerProvinceSn: undefined, // 省份
|
|
|
+ bizUserSn: undefined// 客服
|
|
|
},
|
|
|
- disabled: false, // 查询、重置按钮是否可操作
|
|
|
- exportLoading: false,
|
|
|
+ rules: { 'time': [{ required: true, message: '请选择下推时间', trigger: 'change' }] }, // 查询时间必选项
|
|
|
+
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
|
+ // 列表查询
|
|
|
return reportSalesBillList(params).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
|
+ // 统计查询
|
|
|
this.getCount(params)
|
|
|
+ // 计算序号
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
@@ -273,9 +247,9 @@ export default {
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
|
- totalData: null,
|
|
|
+ totalData: null, // 合计统计
|
|
|
operatorList: [], // 操作员下拉数据
|
|
|
- addrProvinceList: [], // 省下拉
|
|
|
+ // 列表列显示
|
|
|
colsArr: [
|
|
|
{
|
|
|
title: '直接差价金额(明细)',
|
|
@@ -290,7 +264,7 @@ export default {
|
|
|
disabled: !this.$hasPermissions('M_salesOrderTotalList_salesPrice')
|
|
|
}
|
|
|
],
|
|
|
- showCols: []// 需要显示列
|
|
|
+ showCols: []// 已勾选显示的列
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -318,8 +292,8 @@ export default {
|
|
|
// { title: '返利', dataIndex: 'rebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
// { title: '折扣金额', dataIndex: 'totalDiscountAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
// { title: '折后金额', dataIndex: 'totalDiscountedAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
-
|
|
|
]
|
|
|
+ // 根据权限及勾选按原型图固定顺序动态显示列
|
|
|
if (this.$hasPermissions('M_salesOrderTotalList_salesPrice')) {
|
|
|
arr.push({ title: '实售金额', dataIndex: 'totalRealAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
arr.push({ title: '开单金额', dataIndex: 'totalAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
@@ -328,15 +302,7 @@ export default {
|
|
|
arr.push({ title: '成本金额', dataIndex: 'totalCost', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
arr.push({ title: '成本金额(促)', dataIndex: 'totalGiftCost', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
if (this.$hasPermissions('M_salesOrderTotalList_salesPrice')) {
|
|
|
- arr.push({
|
|
|
- title: '毛利',
|
|
|
- dataIndex: 'grossProfit',
|
|
|
- width: 70,
|
|
|
- align: 'right',
|
|
|
- customRender: function (text) {
|
|
|
- return ((text || text == 0) ? _this.toThousands(text) : '--')
|
|
|
- }
|
|
|
- })
|
|
|
+ arr.push({ title: '毛利', dataIndex: 'grossProfit', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
}
|
|
|
}
|
|
|
if (this.$hasPermissions('M_salesOrderTotalList_provincePrice')) {
|
|
@@ -363,23 +329,13 @@ export default {
|
|
|
arr.push({ title: '间接差价金额', dataIndex: 'reportRebateAmountInfo.indirectRebateAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
arr.push({ title: '返利', dataIndex: 'reportRebateAmountInfo.rebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
arr.push({ title: '优惠金额', dataIndex: 'discountAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
- // arr.push({ title: '折扣金额', dataIndex: 'totalDiscountAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
- // arr.push({ title: '折后金额', dataIndex: 'totalDiscountedAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
}
|
|
|
- arr.push({
|
|
|
- title: '操作员',
|
|
|
- dataIndex: 'operatorName',
|
|
|
- width: 100,
|
|
|
- align: 'center',
|
|
|
- customRender: function (text) {
|
|
|
- return text || '--'
|
|
|
- },
|
|
|
- ellipsis: true
|
|
|
- })
|
|
|
+ arr.push({ title: '操作员', dataIndex: 'operatorName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
|
|
|
return arr
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
+ // 展开收起
|
|
|
advanced (newValue, oldValue) {
|
|
|
const _this = this
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
@@ -391,10 +347,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- // 盘点库存日期
|
|
|
- handleStock () {
|
|
|
- this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
|
|
|
- },
|
|
|
// 总计
|
|
|
getCount (params) {
|
|
|
reportSalesBillCount(params).then(res => {
|
|
@@ -405,6 +357,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 查询
|
|
|
handleSearch () {
|
|
|
const _this = this
|
|
|
this.$refs.ruleForm.validate(valid => {
|
|
@@ -416,7 +369,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 创建时间 change
|
|
|
+ // 下推时间 change
|
|
|
dateChange (date) {
|
|
|
if (date[0] && date[1]) {
|
|
|
this.queryParam.time = date
|
|
@@ -426,14 +379,12 @@ export default {
|
|
|
this.queryParam.beginDate = date[0] || ''
|
|
|
this.queryParam.endDate = date[1] || ''
|
|
|
},
|
|
|
- custChange (val) {
|
|
|
- this.queryParam.dealerSn = val.key
|
|
|
- },
|
|
|
+ // 所在区域查询
|
|
|
subareaChange (val) {
|
|
|
this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
|
|
|
this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
|
|
|
},
|
|
|
- // 重置
|
|
|
+ // 重置列表
|
|
|
resetSearchForm () {
|
|
|
this.queryParam.time = [
|
|
|
getDate.getCurrMonthDays().starttime,
|
|
@@ -477,12 +428,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- filterOption (input, option) {
|
|
|
- return (
|
|
|
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
- )
|
|
|
- },
|
|
|
- // 操作员
|
|
|
+ // 操作员列表获取 无分页
|
|
|
getUserList () {
|
|
|
userQueryList({}).then(res => {
|
|
|
if (res.status == 200) {
|
|
@@ -492,6 +438,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 操作员列名称筛选
|
|
|
+ filterOption (input, option) {
|
|
|
+ return (
|
|
|
+ option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
+ )
|
|
|
+ },
|
|
|
+ // 初始化
|
|
|
pageInit () {
|
|
|
const _this = this
|
|
|
_this.getUserList()
|
|
@@ -499,6 +452,7 @@ export default {
|
|
|
_this.setTableH()
|
|
|
})
|
|
|
},
|
|
|
+ // 计算页面高度
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
this.tableHeight = window.innerHeight - tableSearchH - 252
|