|
@@ -212,19 +212,19 @@ export default {
|
|
default: false
|
|
default: false
|
|
},
|
|
},
|
|
newLoading: Boolean,
|
|
newLoading: Boolean,
|
|
- detailData: {
|
|
|
|
|
|
+ detailData: { // 销售单详情
|
|
type: Object,
|
|
type: Object,
|
|
default: function () { return null }
|
|
default: function () { return null }
|
|
},
|
|
},
|
|
- warehouseSn: {
|
|
|
|
|
|
+ warehouseSn: { // 仓库sn
|
|
type: String,
|
|
type: String,
|
|
default: ''
|
|
default: ''
|
|
},
|
|
},
|
|
- salesBillSn: {
|
|
|
|
|
|
+ salesBillSn: { // 销售单sn
|
|
type: String,
|
|
type: String,
|
|
default: ''
|
|
default: ''
|
|
},
|
|
},
|
|
- showTotal: {
|
|
|
|
|
|
+ showTotal: { // 是否显示总计
|
|
type: Boolean,
|
|
type: Boolean,
|
|
default: true
|
|
default: true
|
|
}
|
|
}
|
|
@@ -244,6 +244,7 @@ export default {
|
|
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
|
|
|
|
+ // 存储变更前的数量和仓库
|
|
data.list[i].qtyBackups = data.list[i].qty
|
|
data.list[i].qtyBackups = data.list[i].qty
|
|
data.list[i].warehouseBackups = data.list[i].warehouseSn
|
|
data.list[i].warehouseBackups = data.list[i].warehouseSn
|
|
}
|
|
}
|
|
@@ -253,50 +254,51 @@ export default {
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- showSearch: false,
|
|
|
|
|
|
+ showSearch: false, // 收起展开搜索
|
|
openWarehouseModal: false, // 打开仓库设置
|
|
openWarehouseModal: false, // 打开仓库设置
|
|
openGuideModal: false, // 导入产品引导
|
|
openGuideModal: false, // 导入产品引导
|
|
- delLoading: false,
|
|
|
|
- chooseDisabled: false,
|
|
|
|
|
|
+ delLoading: false, // 删除loading
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
queryParam: {
|
|
queryParam: {
|
|
- warehouseSn: undefined,
|
|
|
|
- productCode: '',
|
|
|
|
- productName: '',
|
|
|
|
- productBrandSn: undefined,
|
|
|
|
|
|
+ warehouseSn: undefined, // 仓库
|
|
|
|
+ productCode: '', // 产品编码
|
|
|
|
+ productName: '', // 产品名称
|
|
|
|
+ productBrandSn: undefined, // 产品品牌
|
|
productTypeSn1: '', // 产品一级分类
|
|
productTypeSn1: '', // 产品一级分类
|
|
productTypeSn2: '', // 产品二级分类
|
|
productTypeSn2: '', // 产品二级分类
|
|
productTypeSn3: '' // 产品三级分类
|
|
productTypeSn3: '' // 产品三级分类
|
|
},
|
|
},
|
|
- productType: [],
|
|
|
|
- rowSelectionInfo: null,
|
|
|
|
- warehouseDataList: [],
|
|
|
|
- countData: null,
|
|
|
|
- isInster: false,
|
|
|
|
- warehouseTit: ''
|
|
|
|
|
|
+ productType: [], // 产品分类
|
|
|
|
+ rowSelectionInfo: null, // 已选的产品数据
|
|
|
|
+ warehouseDataList: [], // 仓库列表
|
|
|
|
+ countData: null, // 统计数据
|
|
|
|
+ isInster: false, // 是否添加
|
|
|
|
+ warehouseTit: '' // 仓库设置弹框标题
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
+ // 已选产品数量
|
|
selectTotal () {
|
|
selectTotal () {
|
|
return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
},
|
|
},
|
|
|
|
+ // 表格高度
|
|
tableHeight () {
|
|
tableHeight () {
|
|
return window.innerHeight - 395
|
|
return window.innerHeight - 395
|
|
},
|
|
},
|
|
|
|
+ // 表格列定义
|
|
columns () {
|
|
columns () {
|
|
const arr = [
|
|
const arr = [
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
{ title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '13%', align: 'center' },
|
|
{ title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '13%', align: 'center' },
|
|
{ title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '20%', align: 'left' },
|
|
{ title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '20%', align: 'left' },
|
|
- // { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
{ title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '8%', align: 'center' },
|
|
{ title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '8%', align: 'center' },
|
|
{ title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '8%', align: 'center' },
|
|
{ title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '8%', align: 'center' },
|
|
{ title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '15%', align: 'center' },
|
|
{ title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '15%', align: 'center' },
|
|
{ title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
- // { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
]
|
|
]
|
|
- if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
|
|
|
|
|
|
+ // 售价权限
|
|
|
|
+ if (this.$hasPermissions('B_salesEdit_salesPrice')) {
|
|
arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
|
|
arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
|
|
arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
|
|
arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
|
|
arr.splice(8, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
|
|
arr.splice(8, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
|
|
@@ -305,11 +307,13 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 仓库下拉列表筛选
|
|
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
|
|
)
|
|
)
|
|
},
|
|
},
|
|
|
|
+ // 仓库下拉列表数据加载完成
|
|
warehouseLoad (sn, list) {
|
|
warehouseLoad (sn, list) {
|
|
this.warehouseDataList = list
|
|
this.warehouseDataList = list
|
|
},
|
|
},
|
|
@@ -317,10 +321,11 @@ export default {
|
|
rowSelectionFun (obj) {
|
|
rowSelectionFun (obj) {
|
|
this.rowSelectionInfo = obj || null
|
|
this.rowSelectionInfo = obj || null
|
|
},
|
|
},
|
|
|
|
+ // 打开产品列表弹框
|
|
openCpModal () {
|
|
openCpModal () {
|
|
this.$emit('openCpModal', 0, 'productNormalList')
|
|
this.$emit('openCpModal', 0, 'productNormalList')
|
|
},
|
|
},
|
|
- // 统计
|
|
|
|
|
|
+ // 获取统计
|
|
getCount () {
|
|
getCount () {
|
|
salesDetaiCount(Object.assign(this.queryParam, { showStock: true })).then(res => {
|
|
salesDetaiCount(Object.assign(this.queryParam, { showStock: true })).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
@@ -328,6 +333,7 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 删除全部已选产品
|
|
handleBatchDelAll () {
|
|
handleBatchDelAll () {
|
|
const _this = this
|
|
const _this = this
|
|
if (_this.dataSource.length == 0) {
|
|
if (_this.dataSource.length == 0) {
|
|
@@ -343,6 +349,7 @@ export default {
|
|
deleteAll({ salesBillSn: _this.salesBillSn }).then(res => {
|
|
deleteAll({ salesBillSn: _this.salesBillSn }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.$refs.table.refresh(false)
|
|
_this.$refs.table.refresh(false)
|
|
|
|
+ // 触发事件给父级组件
|
|
_this.$emit('insterOk', 'normal')
|
|
_this.$emit('insterOk', 'normal')
|
|
_this.$message.success(res.message)
|
|
_this.$message.success(res.message)
|
|
}
|
|
}
|
|
@@ -374,6 +381,7 @@ export default {
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.$refs.table.refresh(false)
|
|
_this.$refs.table.refresh(false)
|
|
|
|
+ // 触发事件给父级组件
|
|
_this.$emit('insterOk', 'normal')
|
|
_this.$emit('insterOk', 'normal')
|
|
_this.$message.success(res.message)
|
|
_this.$message.success(res.message)
|
|
}
|
|
}
|
|
@@ -382,7 +390,7 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 设置单个出库仓库
|
|
|
|
|
|
+ // 单个设置出库仓库
|
|
handleWarehouseBox (row) {
|
|
handleWarehouseBox (row) {
|
|
const snArr = [row.salesBillDetailSn]
|
|
const snArr = [row.salesBillDetailSn]
|
|
const ajax_data = {
|
|
const ajax_data = {
|
|
@@ -392,6 +400,7 @@ export default {
|
|
}
|
|
}
|
|
this.setWarehouseInfo(ajax_data)
|
|
this.setWarehouseInfo(ajax_data)
|
|
},
|
|
},
|
|
|
|
+ // 选择仓库确认
|
|
chooseWarehouseOk (sn) {
|
|
chooseWarehouseOk (sn) {
|
|
const _this = this
|
|
const _this = this
|
|
const snArr = []
|
|
const snArr = []
|
|
@@ -406,6 +415,7 @@ export default {
|
|
}
|
|
}
|
|
_this.setWarehouseInfo(ajax_data)
|
|
_this.setWarehouseInfo(ajax_data)
|
|
},
|
|
},
|
|
|
|
+ // 修改仓库
|
|
setWarehouseInfo (data) {
|
|
setWarehouseInfo (data) {
|
|
const _this = this
|
|
const _this = this
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
@@ -425,6 +435,7 @@ export default {
|
|
this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
},
|
|
},
|
|
|
|
+ // 操作下拉菜单
|
|
handleMenuClick (e) {
|
|
handleMenuClick (e) {
|
|
const _this = this
|
|
const _this = this
|
|
if (e.key == 0) { // 仓库设置
|
|
if (e.key == 0) { // 仓库设置
|
|
@@ -444,7 +455,7 @@ export default {
|
|
this.handleBatchDelAll()
|
|
this.handleBatchDelAll()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 已选产品 blur
|
|
|
|
|
|
+ // 已选产品 修改销售数量
|
|
onCellBlur (val, record) {
|
|
onCellBlur (val, record) {
|
|
const _this = this
|
|
const _this = this
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
@@ -466,7 +477,7 @@ export default {
|
|
record.qty = record.qtyBackups
|
|
record.qty = record.qtyBackups
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 重置
|
|
|
|
|
|
+ // 重置查询
|
|
resetSearchForm (flag) {
|
|
resetSearchForm (flag) {
|
|
this.queryParam.productCode = ''
|
|
this.queryParam.productCode = ''
|
|
this.queryParam.productName = ''
|
|
this.queryParam.productName = ''
|
|
@@ -504,7 +515,6 @@ export default {
|
|
},
|
|
},
|
|
// 添加产品
|
|
// 添加产品
|
|
insterProduct (row, promotionFlag) {
|
|
insterProduct (row, promotionFlag) {
|
|
- console.log(row, promotionFlag)
|
|
|
|
// 防止多次添加产品
|
|
// 防止多次添加产品
|
|
if (this.isInster) { return }
|
|
if (this.isInster) { return }
|
|
this.saveNewProduct(row, promotionFlag)
|
|
this.saveNewProduct(row, promotionFlag)
|
|
@@ -536,6 +546,7 @@ export default {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.$message.success('产品添加成功', 2.5)
|
|
this.$message.success('产品添加成功', 2.5)
|
|
this.resetSearchForm(true)
|
|
this.resetSearchForm(true)
|
|
|
|
+ // 触发事件给父级组件
|
|
this.$emit('insterOk', 'normal')
|
|
this.$emit('insterOk', 'normal')
|
|
}
|
|
}
|
|
this.spinning = false
|
|
this.spinning = false
|
|
@@ -545,20 +556,21 @@ export default {
|
|
this.isInster = false
|
|
this.isInster = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 导入产品弹框关闭
|
|
closeGuideModel () {
|
|
closeGuideModel () {
|
|
this.openGuideModal = false
|
|
this.openGuideModal = false
|
|
},
|
|
},
|
|
- // 批量导入产品
|
|
|
|
|
|
+ // 批量导入产品确认
|
|
hanldeOk (data, salesPromoSn) {
|
|
hanldeOk (data, salesPromoSn) {
|
|
const params = {
|
|
const params = {
|
|
salesBillSn: this.detailData.salesBillSn,
|
|
salesBillSn: this.detailData.salesBillSn,
|
|
salesBillDetailList: data
|
|
salesBillDetailList: data
|
|
}
|
|
}
|
|
-
|
|
|
|
salesBatchInsert(params).then(res => {
|
|
salesBatchInsert(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.$message.success('产品导入成功', 2.5)
|
|
this.$message.success('产品导入成功', 2.5)
|
|
this.resetSearchForm(true)
|
|
this.resetSearchForm(true)
|
|
|
|
+ // 触发事件给父级组件
|
|
this.$emit('insterOk', 'normal')
|
|
this.$emit('insterOk', 'normal')
|
|
}
|
|
}
|
|
})
|
|
})
|