|
@@ -71,19 +71,19 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item label="所在区域">
|
|
|
+ <a-form-item label="所在区域">
|
|
|
<subarea ref="subarea" id="salesManagementList-subarea" @change="subareaChange"></subarea>
|
|
|
- </a-form-model-item>
|
|
|
+ </a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
|
|
|
+ <a-form-item label="地区" prop="shippingAddrProvinceSn">
|
|
|
<Area id="salesManagementList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
|
|
|
- </a-form-model-item>
|
|
|
+ </a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item label="出库仓库">
|
|
|
+ <a-form-item label="出库仓库">
|
|
|
<chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn"></chooseWarehouse>
|
|
|
- </a-form-model-item>
|
|
|
+ </a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="促销单">
|
|
@@ -195,12 +195,12 @@
|
|
|
</template>
|
|
|
<!-- 出库仓库 -->
|
|
|
<template slot="warehouseBox" slot-scope="text, record">
|
|
|
- <a-tooltip placement="right" v-if="record.newWarehouseNameSet && record.newWarehouseNameSet.length>0">
|
|
|
+ <a-tooltip placement="right" v-if="record.warehouseNameSet && record.warehouseNameSet.length>0">
|
|
|
<template slot="title">
|
|
|
- <span>{{ record.newWarehouseNameSet.toString() }}</span>
|
|
|
+ <span>{{ record.warehouseNameSet.toString() }}</span>
|
|
|
</template>
|
|
|
<div class="warehouse_box">
|
|
|
- <span>{{ record.newWarehouseNameSet.toString() }}</span>
|
|
|
+ <span>{{ record.warehouseNameSet.toString() }}</span>
|
|
|
</div>
|
|
|
</a-tooltip>
|
|
|
<div v-else>--</div>
|
|
@@ -309,9 +309,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { commonMixin } from '@/utils/mixin'
|
|
|
import moment from 'moment'
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
import getDate from '@/libs/getDate.js'
|
|
|
+import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
+// 组件
|
|
|
import subarea from '@/views/common/subarea.js'
|
|
|
import Area from '@/views/common/area.js'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
@@ -321,12 +323,13 @@ import chooseCustomModal from './chooseCustomModal.vue'
|
|
|
import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
|
|
|
import baseDataModal from '@/views/expenseManagement/expenseReimbursement/baseDataModal.vue'
|
|
|
import reportModal from '@/views/common/reportModal.vue'
|
|
|
-import { salesList, salesDel, salesCancle, salesCount, queryCreateBySalesBillSn, expenseAccountSave } from '@/api/salesNew'
|
|
|
-import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
import chooseWarehouse from '@/views/common/chooseWarehouse'
|
|
|
+import customerService from '@/views/common/customerService'
|
|
|
+// 接口
|
|
|
import { dispatchBatchPrintStatus, queryBySalesBillSn } from '@/api/dispatch'
|
|
|
+import { salesList, salesDel, salesCancle, salesCount, queryCreateBySalesBillSn, expenseAccountSave } from '@/api/salesNew'
|
|
|
import { salesDetailExport } from '@/api/salesBillReport'
|
|
|
-import customerService from '@/views/common/customerService'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'SalesQueryList',
|
|
|
mixins: [commonMixin],
|
|
@@ -339,48 +342,50 @@ export default {
|
|
|
openModal: false, // 选择客户弹框是否显示
|
|
|
openBaseModal: false, // 费用弹框
|
|
|
showTipModal: false, // 备货打印弹框
|
|
|
- showExport: false,
|
|
|
- exportLoading: false,
|
|
|
- expenseOption: false,
|
|
|
- tableHeight: 0,
|
|
|
+ showExport: false, // 导出提示框
|
|
|
+ exportLoading: false, // 导出按钮加载状态
|
|
|
+ expenseOption: false, // 已选转费用报销单状态
|
|
|
+ tableHeight: 0, // 表格高度
|
|
|
+ // 默认时间
|
|
|
time: [
|
|
|
moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
|
|
|
moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
|
|
|
],
|
|
|
// 查询参数
|
|
|
queryParam: {
|
|
|
- beginDate: getDate.getThreeMonthDays().starttime,
|
|
|
- endDate: getDate.getCurrMonthDays().endtime,
|
|
|
+ beginDate: getDate.getThreeMonthDays().starttime, // 开始时间
|
|
|
+ endDate: getDate.getCurrMonthDays().endtime, // 结束时间
|
|
|
buyerSn: undefined, // 客户名称
|
|
|
salesBillNo: '', // 销售单号
|
|
|
- purchaseBillNo: '',
|
|
|
- printStatus: undefined,
|
|
|
+ purchaseBillNo: '', // 采购单号
|
|
|
+ printStatus: undefined, // 打印状态
|
|
|
billStatus: undefined, // 业务状态
|
|
|
financialStatus: undefined, // 财务状态
|
|
|
- salesBillSource: undefined,
|
|
|
+ salesBillSource: undefined, // 单据来源
|
|
|
subareaArea: {
|
|
|
- subareaSn: undefined,
|
|
|
- subareaAreaSn: undefined
|
|
|
+ subareaSn: undefined, // 区域
|
|
|
+ subareaAreaSn: undefined // 分区
|
|
|
},
|
|
|
- shippingAddrProvinceSn: undefined,
|
|
|
- warehouseSn: undefined,
|
|
|
- promoFlag: undefined,
|
|
|
- expenseClainFlag: undefined,
|
|
|
- bizUserSn: undefined
|
|
|
+ shippingAddrProvinceSn: undefined, // 省
|
|
|
+ warehouseSn: undefined, // 仓库
|
|
|
+ promoFlag: undefined, // 是否促销单
|
|
|
+ expenseClainFlag: undefined, // 转费用报销单状态
|
|
|
+ bizUserSn: undefined // 客服
|
|
|
},
|
|
|
+ // 统计数据
|
|
|
totalData: {
|
|
|
- totalAmount: 0,
|
|
|
- totalCategory: 0,
|
|
|
- totalQty: 0,
|
|
|
- totalRecord: 0,
|
|
|
- totalPushedQty: 0,
|
|
|
- totalDispatchQty: 0,
|
|
|
- totalCancelQty: 0,
|
|
|
- totalUnpushedQty: 0,
|
|
|
- totalPushedAmount: 0,
|
|
|
- totalCancelAmount: 0,
|
|
|
- totalUnpushedAmount: 0,
|
|
|
- totalDispatchAmount: 0
|
|
|
+ totalCategory: 0, // 总款数
|
|
|
+ totalQty: 0, // 总数量
|
|
|
+ totalRecord: 0, // 总单数
|
|
|
+ totalPushedQty: 0, // 已下推数量
|
|
|
+ totalDispatchQty: 0, // 已发货数量
|
|
|
+ totalCancelQty: 0, // 已取消数量
|
|
|
+ totalUnpushedQty: 0, // 待下推数量
|
|
|
+ totalAmount: 0, // 总售价
|
|
|
+ totalPushedAmount: 0, // 已下推金额
|
|
|
+ totalCancelAmount: 0, // 已取消金额
|
|
|
+ totalUnpushedAmount: 0, // 待下推金额
|
|
|
+ totalDispatchAmount: 0 // 已发货金额
|
|
|
},
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
@@ -388,6 +393,8 @@ export default {
|
|
|
this.spinning = true
|
|
|
delete parameter.tableId
|
|
|
delete parameter.index
|
|
|
+
|
|
|
+ // 如果按业务状态排序
|
|
|
if (parameter.sortOrder) {
|
|
|
parameter['sortAlias'] = 'sales_bill'
|
|
|
} else {
|
|
@@ -397,22 +404,15 @@ export default {
|
|
|
salesCount(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
this.totalData = res.data || {}
|
|
|
})
|
|
|
+ // 查询列表
|
|
|
return salesList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
|
+ // 计算编号
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
data.list.forEach((con, i) => {
|
|
|
con.no = no + i + 1
|
|
|
- const newWarehouseName = []
|
|
|
- if (con.warehouseNameSet) {
|
|
|
- con.warehouseNameSet.forEach(item => {
|
|
|
- if (item) {
|
|
|
- newWarehouseName.push(item)
|
|
|
- }
|
|
|
- })
|
|
|
- con.newWarehouseNameSet = newWarehouseName
|
|
|
- }
|
|
|
})
|
|
|
this.disabled = false
|
|
|
}
|
|
@@ -420,10 +420,10 @@ export default {
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
|
+ // 允许备货打印弹框
|
|
|
tipData: null, // 备货单信息
|
|
|
- tempSalesBillSn: null,
|
|
|
- // 允许备货打印
|
|
|
- selectedRowKeys: [],
|
|
|
+ tempSalesBillSn: null, // 关联的下推单sn
|
|
|
+ selectedRowKeys: [], // 允许备货打印选项
|
|
|
bhColumns: [
|
|
|
{
|
|
|
title: '备货单号',
|
|
@@ -438,7 +438,8 @@ export default {
|
|
|
dataIndex: 'printStatusDictValue'
|
|
|
}
|
|
|
],
|
|
|
- showCols: [], // 列表显示列
|
|
|
+ // 列表列显示
|
|
|
+ showCols: [], // 已勾选的列
|
|
|
colsArr: [
|
|
|
{
|
|
|
title: '已取消数量',
|
|
@@ -500,7 +501,7 @@ export default {
|
|
|
{ title: '备货打印状态', dataIndex: 'printStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
|
|
|
]
|
|
|
-
|
|
|
+ // 根据权限及勾选按固定顺序动态显示列
|
|
|
arr.map(item => {
|
|
|
if (this.$hasPermissions('M_salesQueryList_salesPrice')) {
|
|
|
item.isShow = ['totalAmount', 'totalPushedAmount', 'totalUnpushedAmount', 'totalConvertPromoGiftsAmount'].includes(item.dataIndex)
|
|
@@ -509,7 +510,6 @@ export default {
|
|
|
item.isShow = this.showCols.includes(item.dataIndex)
|
|
|
}
|
|
|
})
|
|
|
- console.log(arr)
|
|
|
return arr.filter(item => !this.colsArr.find(k => k.value == item.dataIndex) || item.isShow)
|
|
|
}
|
|
|
},
|
|
@@ -527,22 +527,25 @@ export default {
|
|
|
_this.$store.state.app.curActionPermission = ''
|
|
|
})
|
|
|
},
|
|
|
- // 时间 change
|
|
|
+ // 选择时间 change
|
|
|
dateChange (date) {
|
|
|
this.queryParam.beginDate = date[0]
|
|
|
this.queryParam.endDate = date[1]
|
|
|
},
|
|
|
+ // 选择客户
|
|
|
custChange (val) {
|
|
|
this.queryParam.buyerSn = val.key
|
|
|
},
|
|
|
+ // 所在区域
|
|
|
subareaChange (val) {
|
|
|
this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
|
|
|
this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
|
|
|
},
|
|
|
+ // 打开批量转费用单页面
|
|
|
toWaitCostOrder () {
|
|
|
this.$router.push({ name: 'waitCostOrder' })
|
|
|
},
|
|
|
- // 新增
|
|
|
+ // 新增销售单先打开选择客户弹框
|
|
|
handleAdd () {
|
|
|
this.openModal = true
|
|
|
},
|
|
@@ -648,17 +651,18 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // 选择费用报销单类型
|
|
|
changeDaOpt (e) {
|
|
|
this.expenseOption = e.target.value
|
|
|
},
|
|
|
- // 转费用单
|
|
|
+ // 转费用单确定
|
|
|
expenseSave (data) {
|
|
|
- console.log(data)
|
|
|
if (data) {
|
|
|
this.openBaseModal = true
|
|
|
this.$refs.expenseModal.setDetail(data, 'sales')
|
|
|
}
|
|
|
},
|
|
|
+ // 转费用单成功
|
|
|
expenseSaveOk (params) {
|
|
|
expenseAccountSave(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
@@ -685,16 +689,18 @@ export default {
|
|
|
this.showTipModal = true
|
|
|
})
|
|
|
},
|
|
|
+ // 关闭允许备货打印弹框
|
|
|
canselModal () {
|
|
|
this.tipData = null
|
|
|
this.showTipModal = false
|
|
|
this.tempSalesBillSn = null
|
|
|
this.selectedRowKeys = []
|
|
|
},
|
|
|
+ // 选择要备货打印的
|
|
|
onSelectChange (selectedRowKeys) {
|
|
|
this.selectedRowKeys = selectedRowKeys
|
|
|
},
|
|
|
- // 允许备货打印状态
|
|
|
+ // 确定允许备货打印
|
|
|
updatePrintStatus () {
|
|
|
const isOne = this.tipData.length
|
|
|
if (isOne > 1 && this.selectedRowKeys.length == 0) {
|
|
@@ -705,7 +711,6 @@ export default {
|
|
|
this.tipData.map(item => {
|
|
|
dispatchBillSnList.push(item.dispatchBillSn)
|
|
|
})
|
|
|
-
|
|
|
const params = {
|
|
|
'salesBillSn': this.tempSalesBillSn,
|
|
|
'dispatchBillSnList': isOne > 1 ? this.selectedRowKeys : dispatchBillSnList,
|
|
@@ -719,7 +724,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 重置
|
|
|
+ // 重置列表
|
|
|
resetSearchForm () {
|
|
|
this.$refs.rangeDate.resetDate(this.time)
|
|
|
this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
|
|
@@ -744,23 +749,22 @@ export default {
|
|
|
}
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
+ // 初始化
|
|
|
pageInit () {
|
|
|
- const _this = this
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
- _this.setTableH()
|
|
|
+ this.setTableH()
|
|
|
})
|
|
|
},
|
|
|
+ // 计算表格高度
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
this.tableHeight = window.innerHeight - tableSearchH - 260
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
+ // 展开收起
|
|
|
advanced (newValue, oldValue) {
|
|
|
- const _this = this
|
|
|
- this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
- _this.setTableH()
|
|
|
- })
|
|
|
+ this.pageInit()
|
|
|
},
|
|
|
'$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
|
|
|
console.log(newValue)
|