|
@@ -73,7 +73,8 @@ import ProductType from '@/views/common/productType.js'
|
|
import subarea from '@/views/common/subarea.js'
|
|
import subarea from '@/views/common/subarea.js'
|
|
import AreaList from '@/views/common/areaList.js'
|
|
import AreaList from '@/views/common/areaList.js'
|
|
import { hdExportExcel } from '@/libs/exportExcel'
|
|
import { hdExportExcel } from '@/libs/exportExcel'
|
|
-import { checkWarehouseDetailList, checkWarehouseDetail, checkWarehouseDetailCount, checkWarehouseDetailExport, checkWarehouseDetailPrint, checkWarehouseWarehouse } from '@/api/checkWarehouse'
|
|
|
|
|
|
+import { dealerExport } from '@/api/promoTerminal'
|
|
|
|
+import { dealerQueryList } from '@/api/dealer'
|
|
export default {
|
|
export default {
|
|
name: 'LookUpCustomersModal',
|
|
name: 'LookUpCustomersModal',
|
|
components: { STable, ProductType, subarea, AreaList },
|
|
components: { STable, ProductType, subarea, AreaList },
|
|
@@ -82,10 +83,6 @@ export default {
|
|
openModal: { // 弹框显示状态
|
|
openModal: { // 弹框显示状态
|
|
type: Boolean,
|
|
type: Boolean,
|
|
default: false
|
|
default: false
|
|
- },
|
|
|
|
- itemSn: {
|
|
|
|
- type: String || Number,
|
|
|
|
- default: ''
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
@@ -95,44 +92,28 @@ export default {
|
|
disabled: false,
|
|
disabled: false,
|
|
advanced: false,
|
|
advanced: false,
|
|
exportShow: false,
|
|
exportShow: false,
|
|
|
|
+ exportLoading: false,
|
|
queryParam: {
|
|
queryParam: {
|
|
- productName: '',
|
|
|
|
- productCode: '',
|
|
|
|
- productTypeSn1: undefined,
|
|
|
|
- productTypeSn2: undefined,
|
|
|
|
- productTypeSn3: undefined,
|
|
|
|
- warehouseSn: undefined,
|
|
|
|
- subareaArea: {
|
|
|
|
- subareaSn: undefined,
|
|
|
|
- subareaAreaSn: undefined
|
|
|
|
- },
|
|
|
|
- exportLoading: false,
|
|
|
|
- dealer: {
|
|
|
|
- dealerSn: undefined,
|
|
|
|
- provinceSn: undefined,
|
|
|
|
- citySn: undefined,
|
|
|
|
- districtSn: undefined,
|
|
|
|
- dealerLevel: undefined
|
|
|
|
- }
|
|
|
|
|
|
+ subareaSn: undefined,
|
|
|
|
+ subareaAreaSn: undefined,
|
|
|
|
+ provinceSn: undefined,
|
|
|
|
+ citySn: undefined,
|
|
|
|
+ districtSn: undefined,
|
|
|
|
+ dealerSn: undefined
|
|
},
|
|
},
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- const params = Object.assign(parameter, this.queryParam, { checkWarehouseSn: this.itemSn })
|
|
|
|
- if (this.isPrice) {
|
|
|
|
- params.profitLossFlag = 1
|
|
|
|
- }
|
|
|
|
- return checkWarehouseDetailList(params).then(res => {
|
|
|
|
|
|
+ const params = Object.assign(parameter, this.queryParam)
|
|
|
|
+ return dealerQueryList(params).then(res => {
|
|
let data
|
|
let data
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
data = res.data
|
|
data = res.data
|
|
- this.getDetailCount(params)
|
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
}
|
|
}
|
|
- this.localDataSource = data.list || []
|
|
|
|
this.disabled = false
|
|
this.disabled = false
|
|
}
|
|
}
|
|
this.spinning = false
|
|
this.spinning = false
|
|
@@ -150,131 +131,52 @@ export default {
|
|
printerType: 'NEEDLE', // 打印机类型
|
|
printerType: 'NEEDLE', // 打印机类型
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
- { title: '地区', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '区域', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '分区', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '经销商名称', dataIndex: 'productUnit', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '商户类型', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '商户级别', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
|
|
|
+ { title: '地区', dataIndex: 'address', width: '20%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '区域', dataIndex: 'subareaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '分区', dataIndex: 'subareaAreaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '经销商名称', dataIndex: 'dealerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '商户类型', dataIndex: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '商户级别', dataIndex: 'dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
]
|
|
]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
areaChange (val) {
|
|
areaChange (val) {
|
|
- this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
|
|
|
|
- this.queryParam.dealer.citySn = val[1] ? val[1] : ''
|
|
|
|
- this.queryParam.dealer.districtSn = val[2] ? val[2] : ''
|
|
|
|
|
|
+ this.queryParam.provinceSn = val[0] ? val[0] : ''
|
|
|
|
+ this.queryParam.citySn = val[1] ? val[1] : ''
|
|
|
|
+ this.queryParam.districtSn = val[2] ? val[2] : ''
|
|
},
|
|
},
|
|
subareaChange (val) {
|
|
subareaChange (val) {
|
|
- this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
|
|
|
|
- this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
|
|
|
|
|
|
+ this.queryParam.subareaSn = val[0] ? val[0] : undefined
|
|
|
|
+ this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
|
|
},
|
|
},
|
|
- // 详情
|
|
|
|
- getDetail () {
|
|
|
|
- checkWarehouseDetail({ sn: this.itemSn }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.basicInfoData = res.data || null
|
|
|
|
- } else {
|
|
|
|
- this.basicInfoData = null
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 合计
|
|
|
|
- getDetailCount (params) {
|
|
|
|
- checkWarehouseDetailCount(params).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.productTotal = res.data
|
|
|
|
- if (res.data && res.data.checkLossQty) {
|
|
|
|
- this.productTotal.checkLossQty = Math.abs(this.productTotal.checkLossQty || 0)
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- this.productTotal = null
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ pageInit (data) {
|
|
|
|
+ this.queryParam = Object.assign(this.queryParam, data)
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
- this.queryParam.productName = ''
|
|
|
|
- this.queryParam.productCode = ''
|
|
|
|
- this.queryParam.warehouseSn = undefined
|
|
|
|
- this.queryParam.productTypeSn1 = undefined
|
|
|
|
- this.queryParam.productTypeSn2 = undefined
|
|
|
|
- this.queryParam.productTypeSn3 = undefined
|
|
|
|
- this.productType = []
|
|
|
|
- this.queryParam.dealer = {
|
|
|
|
- dealerSn: undefined,
|
|
|
|
|
|
+ this.queryParam = {
|
|
provinceSn: undefined,
|
|
provinceSn: undefined,
|
|
citySn: undefined,
|
|
citySn: undefined,
|
|
districtSn: undefined,
|
|
districtSn: undefined,
|
|
- dealerLevel: undefined
|
|
|
|
- }
|
|
|
|
- this.queryParam.subareaArea = {
|
|
|
|
subareaSn: undefined,
|
|
subareaSn: undefined,
|
|
- subareaAreaSn: undefined,
|
|
|
|
- bizUserSn: undefined
|
|
|
|
|
|
+ subareaAreaSn: undefined
|
|
}
|
|
}
|
|
|
|
+ this.queryParam.dealerSn = undefined
|
|
this.$refs.areaList.clearData()
|
|
this.$refs.areaList.clearData()
|
|
this.$refs.subarea.clearData()
|
|
this.$refs.subarea.clearData()
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
- // 产品分类 change
|
|
|
|
- changeProductType (val, opt) {
|
|
|
|
- this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
|
|
|
|
- this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
|
- this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
|
- },
|
|
|
|
- // 仓库下拉数据
|
|
|
|
- getWarehouseList () {
|
|
|
|
- checkWarehouseWarehouse({}).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.warehouseList = res.data
|
|
|
|
- } else {
|
|
|
|
- this.warehouseList = []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
// 导出
|
|
// 导出
|
|
handleExport () {
|
|
handleExport () {
|
|
const _this = this
|
|
const _this = this
|
|
- _this.$store.state.app.curActionPermission = 'B_sales_export'
|
|
|
|
_this.exportLoading = true
|
|
_this.exportLoading = true
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
- hdExportExcel(checkWarehouseDetailExport, _this.queryParam, '销售明细', function () {
|
|
|
|
|
|
+ hdExportExcel(dealerExport, _this.queryParam, '促销经销商列表导出', function () {
|
|
_this.exportLoading = false
|
|
_this.exportLoading = false
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
_this.showExport = true
|
|
_this.showExport = true
|
|
- _this.$store.state.app.curActionPermission = ''
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 打印导出
|
|
|
|
- handlePrint (type, data) {
|
|
|
|
- if (type == 'export') {
|
|
|
|
- this.exportShow = false
|
|
|
|
- this.nowType = type
|
|
|
|
- this.handleOk(data)
|
|
|
|
- } else {
|
|
|
|
- this.nowType = type
|
|
|
|
- this.openPrintModal = true
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- handleOk (objs) {
|
|
|
|
- const _this = this
|
|
|
|
- let params, type
|
|
|
|
- let url = checkWarehouseDetailPrint // 打印
|
|
|
|
- if (this.nowType == 'export') { // 导出
|
|
|
|
- url = checkWarehouseDetailExport
|
|
|
|
- params = { checkWarehouseSn: this.itemSn, ...objs }
|
|
|
|
- type = 'export'
|
|
|
|
- } else { // 打印
|
|
|
|
- params = JSON.parse(JSON.stringify(objs))
|
|
|
|
- params.printType = this.printerType
|
|
|
|
- type = params.type
|
|
|
|
- delete params.type
|
|
|
|
- }
|
|
|
|
- _this.spinning = true
|
|
|
|
- // 打印或导出
|
|
|
|
- hdPrint(this.printerType, type, url, params, '库存盘点', function () {
|
|
|
|
- _this.spinning = false
|
|
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -287,25 +189,8 @@ export default {
|
|
isShow (newValue, oldValue) {
|
|
isShow (newValue, oldValue) {
|
|
if (!newValue) {
|
|
if (!newValue) {
|
|
this.$emit('close')
|
|
this.$emit('close')
|
|
- this.printerType = 'NEEDLE'
|
|
|
|
- this.$refs.table.clearTable()
|
|
|
|
- this.basicInfoData = null
|
|
|
|
- } else {
|
|
|
|
- const _this = this
|
|
|
|
- setTimeout(() => (
|
|
|
|
- _this.resetSearchForm()
|
|
|
|
- ), 300)
|
|
|
|
|
|
+ this.resetSearchForm()
|
|
}
|
|
}
|
|
- },
|
|
|
|
- itemSn (newValue, oldValue) {
|
|
|
|
- if (this.isShow && newValue) {
|
|
|
|
- this.isPrice = false
|
|
|
|
- this.getDetail()
|
|
|
|
- this.getWarehouseList()
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- isPrice (newValue, oldValue) {
|
|
|
|
- this.$refs.table.refresh(true)
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|