...
|
...
|
@@ -5,46 +5,32 @@ |
|
|
<Input v-model.trim.number="filters.sknCode.model"
|
|
|
:placeholder="filters.sknCode.holder" :maxlength="9"></Input>
|
|
|
</FilterItem>
|
|
|
<FilterItem :label="filters.prodCode.label">
|
|
|
<Input v-model.trim="filters.prodCode.model"
|
|
|
:placeholder="filters.prodCode.holder"></Input>
|
|
|
<FilterItem :label="filters.skuCode.label">
|
|
|
<Input v-model.trim.number="filters.skuCode.model"
|
|
|
:placeholder="filters.skuCode.holder" :maxlength="9"></Input>
|
|
|
</FilterItem>
|
|
|
<FilterItem :label="filters.prodBarCode.label">
|
|
|
<Input v-model.trim="filters.prodBarCode.model"
|
|
|
:placeholder="filters.prodBarCode.holder"></Input>
|
|
|
<Input v-model.trim.number="filters.prodBarCode.model"
|
|
|
:placeholder="filters.prodBarCode.holder" :maxlength="9"></Input>
|
|
|
</FilterItem>
|
|
|
<FilterItem :label="filters.priceStatus.label">
|
|
|
<Select v-model.trim="filters.priceStatus.model">
|
|
|
<Option v-for="option in filters.priceStatus.options"
|
|
|
:value="option.value"
|
|
|
:key="option.value">{{option.label}}</Option>
|
|
|
</Select>
|
|
|
<FilterItem :label="filters.reqNum.label">
|
|
|
<Input v-model.trim.number="filters.reqNum.model"
|
|
|
:placeholder="filters.reqNum.holder" :maxlength="9"></Input>
|
|
|
</FilterItem>
|
|
|
<FilterItem :label="filters.saleStatus.label">
|
|
|
<Select v-model.trim="filters.saleStatus.model">
|
|
|
<Option v-for="option in filters.saleStatus.options"
|
|
|
:value="option.value"
|
|
|
:key="option.value">{{option.label}}</Option>
|
|
|
</Select>
|
|
|
<FilterItem :label="filters.reqTime.label">
|
|
|
<Input v-model.trim.number="filters.reqTime.model"
|
|
|
:placeholder="filters.reqTime.holder" :maxlength="9"></Input>
|
|
|
</FilterItem>
|
|
|
<FilterItem :label="filters.stockStatus.label">
|
|
|
<Select v-model.trim="filters.stockStatus.model">
|
|
|
<Option v-for="option in filters.stockStatus.options"
|
|
|
:value="option.value"
|
|
|
:key="option.value">{{option.label}}</Option>
|
|
|
</Select>
|
|
|
</FilterItem>
|
|
|
<FilterItem label="选择类目">
|
|
|
<SelectCategory :value="categoryValue"
|
|
|
@select-change="sortChange"></SelectCategory>
|
|
|
<FilterItem :label="filters.resTime.label">
|
|
|
<Input v-model.trim.number="filters.resTime.model"
|
|
|
:placeholder="filters.resTime.holder" :maxlength="9"></Input>
|
|
|
</FilterItem>
|
|
|
<FilterItem>
|
|
|
<Button type="primary" @click="filterSearch">筛选</Button>
|
|
|
<Button type="primary">导出</Button>
|
|
|
<Button @click="clearFilter">清空条件</Button>
|
|
|
<Button>导出</Button>
|
|
|
</FilterItem>
|
|
|
</LayoutFilter>
|
|
|
|
|
|
<LayoutList>
|
|
|
<Table border :columns="columns"
|
|
|
@on-selection-change="selectChange" :data="dataList"></Table>
|
...
|
...
|
@@ -56,33 +42,15 @@ |
|
|
|
|
|
<script>
|
|
|
import _ from 'lodash';
|
|
|
import service from 'product-service';
|
|
|
import {SelectBrand, SelectCategory} from 'components/select';
|
|
|
import {CellImage, CellInfo, CellPrice} from 'components/cell';
|
|
|
import vipStore from './store';
|
|
|
import rs from 'return-service';
|
|
|
import listStore from './store/list';
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
columns: [],
|
|
|
dataList: {},
|
|
|
page: {},
|
|
|
filters: {},
|
|
|
batchRows: [],
|
|
|
submitting: false,
|
|
|
enableFilter: false,
|
|
|
categoryValue: []
|
|
|
};
|
|
|
return listStore.apply(this);
|
|
|
},
|
|
|
created() {
|
|
|
const vip = vipStore.apply(this);
|
|
|
const params = this.filterValues();
|
|
|
|
|
|
this.productList(params);
|
|
|
this.filters = vip.filterFields;
|
|
|
this.columns = vip.tableCols;
|
|
|
this.dataList = vip.tableData;
|
|
|
this.page = vip.pageData;
|
|
|
this.returnList();
|
|
|
},
|
|
|
methods: {
|
|
|
filterValues() {
|
...
|
...
|
@@ -124,21 +92,12 @@ |
|
|
|
|
|
this.enableFilter = true;
|
|
|
params = this.filterValues();
|
|
|
this.productList(params);
|
|
|
this.returnList(params);
|
|
|
this.page.current = 1;
|
|
|
},
|
|
|
clearFilter() {
|
|
|
let params = {};
|
|
|
const store = vipStore.apply(this);
|
|
|
|
|
|
this.filters = store.filterFields;
|
|
|
this.enableFilter = false;
|
|
|
params = this.filterValues();
|
|
|
this.productList(params);
|
|
|
this.page.current = 1;
|
|
|
this.categoryValue = [];
|
|
|
},
|
|
|
productList(params) {
|
|
|
returnList(params) {
|
|
|
if (_.isObject(params) &&
|
|
|
typeof params.productSkn !== 'undefined' &&
|
|
|
!_.isFinite(+params.productSkn)) {
|
...
|
...
|
@@ -147,7 +106,7 @@ |
|
|
}
|
|
|
|
|
|
this.$Loading.start();
|
|
|
service.vipProductList(params)
|
|
|
rs.list()
|
|
|
.then(res => {
|
|
|
this.$Loading.finish();
|
|
|
if (res.code === 200) {
|
...
|
...
|
@@ -155,126 +114,44 @@ |
|
|
}
|
|
|
});
|
|
|
},
|
|
|
reloadList() {
|
|
|
let params = {};
|
|
|
|
|
|
if (this.enableFilter) {
|
|
|
params = this.filterValues();
|
|
|
}
|
|
|
|
|
|
_.merge(params, {
|
|
|
page: 1,
|
|
|
size: 20
|
|
|
});
|
|
|
|
|
|
this.productList(params);
|
|
|
this.page.current = 1;
|
|
|
},
|
|
|
resolveData(data) {
|
|
|
this.dataList = data.list;
|
|
|
this.dataList = data.records;
|
|
|
this.page.total = data.total;
|
|
|
},
|
|
|
enableVipPrice(row) {
|
|
|
const skn = row.productSKN;
|
|
|
const canOpen = row.canOpenFlag;
|
|
|
|
|
|
if (canOpen) {
|
|
|
this.setPriceStatus([{
|
|
|
skn
|
|
|
}], 1);
|
|
|
} else {
|
|
|
this.$Message
|
|
|
.error('与平台签订vip会员价格相关合同后,才能开启', 3);
|
|
|
}
|
|
|
},
|
|
|
disableVipPrice(row) {
|
|
|
const skn = row.productSKN;
|
|
|
|
|
|
this.setPriceStatus([{
|
|
|
skn
|
|
|
}], 2);
|
|
|
},
|
|
|
batchSetVip(status) {
|
|
|
let list = [];
|
|
|
const vsMap = {
|
|
|
1: '启用',
|
|
|
2: '禁用'
|
|
|
};
|
|
|
const len = this.batchRows.length;
|
|
|
|
|
|
if (len) {
|
|
|
_.each(this.batchRows, item => {
|
|
|
list.push({
|
|
|
skn: item.productSKN,
|
|
|
status: item.productVipStatus
|
|
|
});
|
|
|
});
|
|
|
this.setPriceStatus(list, status);
|
|
|
} else {
|
|
|
this.$Message.error(`请先勾选要${vsMap[status]}的商品`, 3);
|
|
|
}
|
|
|
},
|
|
|
setPriceStatus(list, status) {
|
|
|
let sknList = [];
|
|
|
let params = {};
|
|
|
const vsMap = {
|
|
|
1: '启用',
|
|
|
2: '禁用'
|
|
|
};
|
|
|
|
|
|
list = _.filter(list, item => {
|
|
|
return item.status !== status;
|
|
|
});
|
|
|
|
|
|
if (!list.length) {
|
|
|
this.$Message.error(`当前选中的商品中,不包含要${vsMap[status]}的商品`, 3);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
_.each(list, item => {
|
|
|
sknList.push(item.skn);
|
|
|
});
|
|
|
params.productSknList = sknList;
|
|
|
params.productVipStatus = status;
|
|
|
if (sknList.length) {
|
|
|
if (this.submitting) {
|
|
|
return;
|
|
|
}
|
|
|
this.submitting = true;
|
|
|
service.setVipPriceStatus(params)
|
|
|
.then(() => {
|
|
|
this.reloadList();
|
|
|
this.submitting = false;
|
|
|
this.$Message.success('VIP价格状态变更成功');
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
sortChange({max, mid, min}) {
|
|
|
this.filters.maxSort.model = max || null;
|
|
|
this.filters.midSort.model = mid || null;
|
|
|
this.filters.minSort.model = min || null;
|
|
|
},
|
|
|
pageChange(page) {
|
|
|
let params = this.filterValues();
|
|
|
|
|
|
params.page = page;
|
|
|
this.page.current = page;
|
|
|
this.productList(params);
|
|
|
this.returnList(params);
|
|
|
},
|
|
|
selectChange(rows) {
|
|
|
this.batchRows = rows;
|
|
|
},
|
|
|
goDetail(row) {
|
|
|
const returnId = row.returnedSupplierId;
|
|
|
const supplierId = row.supplierId;
|
|
|
const supplierName = row.supplierName;
|
|
|
|
|
|
this.$router.push({
|
|
|
name: 'repository.prodReturn.detail',
|
|
|
params: {
|
|
|
returnId,
|
|
|
supplierId,
|
|
|
supplierName
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
SelectBrand,
|
|
|
SelectCategory,
|
|
|
CellImage,
|
|
|
CellInfo,
|
|
|
CellPrice
|
|
|
}
|
|
|
components: {}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
.action-column {
|
|
|
.action-btn {
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
}
|
|
|
</style> |
...
|
...
|
|