|
@@ -31,7 +31,7 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="4" :sm="24" style="margin-top:6px;">
|
|
|
- <a-checkbox @change="handleHasQty" :checked="queryParam.hasQty">
|
|
|
+ <a-checkbox @change="handleHasQty" :checked="queryParam.stockEmptyFlag == 0">
|
|
|
只查看有库存
|
|
|
</a-checkbox>
|
|
|
</a-col>
|
|
@@ -165,7 +165,7 @@ export default {
|
|
|
productTypeSn2: '', // 产品二级分类
|
|
|
productTypeSn3: '', // 产品三级分类
|
|
|
enabledFlag: undefined, // 状态
|
|
|
- hasQty: false
|
|
|
+ stockEmptyFlag: undefined
|
|
|
},
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
exportLoading: false, // 导出loading
|
|
@@ -218,15 +218,15 @@ export default {
|
|
|
return text || text == 0 ? _this.toThousands(text, 2) : '--'
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
- title: '成本价',
|
|
|
- dataIndex: 'specialPrice',
|
|
|
- width: '7%',
|
|
|
- align: 'right',
|
|
|
- customRender: function (text) {
|
|
|
- return text || text == 0 ? _this.toThousands(text, 2) : '--'
|
|
|
- }
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // title: '成本价',
|
|
|
+ // dataIndex: 'specialPrice',
|
|
|
+ // width: '7%',
|
|
|
+ // align: 'right',
|
|
|
+ // customRender: function (text) {
|
|
|
+ // return text || text == 0 ? _this.toThousands(text, 2) : '--'
|
|
|
+ // }
|
|
|
+ // },
|
|
|
{
|
|
|
title: '终端价',
|
|
|
dataIndex: 'terminalPrice',
|
|
@@ -256,7 +256,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
title: '可用库存',
|
|
|
- dataIndex: 'createDate',
|
|
|
+ dataIndex: 'currentStockQty',
|
|
|
width: '7%',
|
|
|
align: 'center',
|
|
|
customRender: function (text) {
|
|
@@ -270,6 +270,9 @@ export default {
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
+ if(this.queryParam.stockEmptyFlag && this.queryParam.stockEmptyFlag==1){
|
|
|
+ this.queryParam.stockEmptyFlag = undefined
|
|
|
+ }
|
|
|
return dealerProductList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
@@ -322,7 +325,7 @@ export default {
|
|
|
this.queryParam.productTypeSn2 = ''
|
|
|
this.queryParam.productTypeSn3 = ''
|
|
|
this.queryParam.enabledFlag = undefined
|
|
|
- this.queryParam.hasQty = false
|
|
|
+ this.queryParam.stockEmptyFlag = undefined
|
|
|
this.productType = []
|
|
|
this.$refs.table.clearSelected()
|
|
|
this.rowSelectionInfo = null
|
|
@@ -330,7 +333,7 @@ export default {
|
|
|
},
|
|
|
// 只查看有库存
|
|
|
handleHasQty (e) {
|
|
|
- this.queryParam.hasQty = e.target.checked
|
|
|
+ this.queryParam.stockEmptyFlag = e.target.checked ? 0:1
|
|
|
},
|
|
|
// 新增/编辑
|
|
|
handleEdit (row) {
|
|
@@ -365,14 +368,30 @@ export default {
|
|
|
},
|
|
|
// 启用 禁用
|
|
|
changeStatus (record) {
|
|
|
- this.$confirm({
|
|
|
- title: '提示',
|
|
|
- content: record.enabledFlag == '1' ? '当前产品存在可用库存,产品被禁用后,不能再销售,确定禁用吗?' : '确定启用吗?',
|
|
|
- centered: true,
|
|
|
- onOk: () => {
|
|
|
- this.setEnable(record.enabledFlag == 1 ? '0' : '1', [record.productSn])
|
|
|
+ if(record.currentStockQty!=0){
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: record.enabledFlag == '1' ? '当前产品存在可用库存,产品被禁用后,不能再销售,确定禁用吗?' : '确定启用吗?',
|
|
|
+ centered: true,
|
|
|
+ onOk: () => {
|
|
|
+ this.setEnable(record.enabledFlag == 1 ? '0' : '1', [record.productSn])
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ if(record.enabledFlag==1){
|
|
|
+ this.setEnable('0', [record.productSn])
|
|
|
+ }else{
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '确定启用吗?',
|
|
|
+ centered: true,
|
|
|
+ onOk: () => {
|
|
|
+ this.setEnable('1', [record.productSn])
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
// 启用 禁用
|
|
|
setEnable (enabledFlag, snList) {
|
|
@@ -404,9 +423,11 @@ export default {
|
|
|
this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
|
return
|
|
|
}
|
|
|
+ //判断所选产品是否都是库存为0的产品
|
|
|
+ let isZero =this.rowSelectionInfo.selectedRows.every(item=>{return item.currentStockQty==0})
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
|
- content: type == '2' ? '产品被禁用后,不能再销售,确定批量禁用吗?' : '确定批量启用吗?',
|
|
|
+ content: type == '2' ? (isZero ? '产品被禁用后,不能再销售,确定批量禁用吗?':'当前产品存在可用库存,产品被禁用后,不能再销售,确定禁用吗?') : '确定批量启用吗?',
|
|
|
centered: true,
|
|
|
onOk: () => {
|
|
|
this.setEnable(type == '2' ? '0' : '1', this.rowSelectionInfo.selectedRowKeys)
|