|
@@ -30,10 +30,17 @@
|
|
|
<v-select code="ENABLE_FLAG" id="productInfoList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="4" :sm="24" style="margin-top:6px;">
|
|
|
- <a-checkbox @change="handleHasQty" :checked="queryParam.stockEmptyFlag == 0">
|
|
|
- 只查看有库存
|
|
|
- </a-checkbox>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="查看库存">
|
|
|
+ <a-select @change="handleHasQty" :value="queryParam.stockEmptyFlag" placeholder="请选择查看库存类型">
|
|
|
+ <a-select-option value="0">
|
|
|
+ 有库存
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option value="1">
|
|
|
+ 无库存
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
</a-col>
|
|
|
</template>
|
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
@@ -63,10 +70,13 @@
|
|
|
<a-menu-item key="1"> 批量启用</a-menu-item>
|
|
|
<a-menu-item key="2"> 批量禁用</a-menu-item>
|
|
|
</a-menu>
|
|
|
- <a-button type="danger" ghost style="margin-left: 5px"> 批量操作 <a-icon type="down" /> </a-button>
|
|
|
+ <a-button type="danger" ghost style="margin-left: 5px">批量操作 <a-icon type="down" /> </a-button>
|
|
|
</a-dropdown>
|
|
|
<span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys">已选 {{ rowSelectionInfo.selectedRowKeys.length }} 项</span>
|
|
|
</div>
|
|
|
+ <a-alert type="info" style="margin-bottom:10px">
|
|
|
+ <div class="ftext" slot="message">注意:产品被禁用后,不能再销售。</div>
|
|
|
+ </a-alert>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
|
class="sTable fixPagination"
|
|
@@ -270,9 +280,6 @@ 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) {
|
|
@@ -331,9 +338,9 @@ export default {
|
|
|
this.rowSelectionInfo = null
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
- // 只查看有库存
|
|
|
- handleHasQty (e) {
|
|
|
- this.queryParam.stockEmptyFlag = e.target.checked ? 0:1
|
|
|
+ // 查看库存
|
|
|
+ handleHasQty (val) {
|
|
|
+ this.queryParam.stockEmptyFlag = val
|
|
|
},
|
|
|
// 新增/编辑
|
|
|
handleEdit (row) {
|
|
@@ -368,7 +375,7 @@ export default {
|
|
|
},
|
|
|
// 启用 禁用
|
|
|
changeStatus (record) {
|
|
|
- if(record.currentStockQty!=0){
|
|
|
+ if (record.currentStockQty != 0) {
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
|
content: record.enabledFlag == '1' ? '当前产品存在可用库存,产品被禁用后,不能再销售,确定禁用吗?' : '确定启用吗?',
|
|
@@ -377,10 +384,10 @@ export default {
|
|
|
this.setEnable(record.enabledFlag == 1 ? '0' : '1', [record.productSn])
|
|
|
}
|
|
|
})
|
|
|
- }else{
|
|
|
- if(record.enabledFlag==1){
|
|
|
+ } else {
|
|
|
+ if (record.enabledFlag == 1) {
|
|
|
this.setEnable('0', [record.productSn])
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
|
content: '确定启用吗?',
|
|
@@ -391,7 +398,6 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
// 启用 禁用
|
|
|
setEnable (enabledFlag, snList) {
|
|
@@ -423,11 +429,11 @@ export default {
|
|
|
this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
|
return
|
|
|
}
|
|
|
- //判断所选产品是否都是库存为0的产品
|
|
|
- let isZero =this.rowSelectionInfo.selectedRows.every(item=>{return item.currentStockQty==0})
|
|
|
+ // 判断所选产品是否都是库存为0的产品
|
|
|
+ const isZero = this.rowSelectionInfo.selectedRows.every(item => { return item.currentStockQty == 0 })
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
|
- content: type == '2' ? (isZero ? '产品被禁用后,不能再销售,确定批量禁用吗?':'当前产品存在可用库存,产品被禁用后,不能再销售,确定禁用吗?') : '确定批量启用吗?',
|
|
|
+ content: type == '2' ? (isZero ? '产品被禁用后,不能再销售,确定批量禁用吗?' : '当前产品存在可用库存,产品被禁用后,不能再销售,确定禁用吗?') : '确定批量启用吗?',
|
|
|
centered: true,
|
|
|
onOk: () => {
|
|
|
this.setEnable(type == '2' ? '0' : '1', this.rowSelectionInfo.selectedRowKeys)
|