Authored by 李奇

品牌组件修改和代码规范违背修改

... ... @@ -15,7 +15,7 @@
name: 'SelectBrand',
props: {
value: {
type: Number,
type: [Number, String],
default: 0
}
},
... ... @@ -25,6 +25,11 @@
optionList: []
};
},
watch: {
value(val){
this.brandId = val;
}
},
created() {
const err_msg = '获取品牌列表失败。';
... ...
... ... @@ -18,13 +18,7 @@
:placeholder="filters.prodBarCode.holder"></Input>
</FilterItem>
<FilterItem label="选择品牌">
<SelectBrand @on-change="brandChange"
:field-label="filters.brand.label"
:field-model="filters.brand.model"
:label-span="filters.brand.labelSpan"
:field-span="filters.brand.fieldSpan"
:option-list="filters.brand.options">
</SelectBrand>
<SelectBrand v-model="filters.brand.model"></SelectBrand>
</FilterItem>
<FilterItem label="选择类目">
<SelectCategory :value="categoryValue" @select-change="sortChange"></SelectCategory>
... ...
... ... @@ -18,8 +18,7 @@
:placeholder="filters.prodBarCode.holder"></Input>
</FilterItem>
<FilterItem label="选择品牌">
<SelectBrand v-model="filters.brand.model">
</SelectBrand>
<SelectBrand v-model="filters.brand.model"></SelectBrand>
</FilterItem>
<FilterItem label="选择类目">
<SelectCategory :value="categoryValue" @select-change="sortChange"></SelectCategory>
... ...
... ... @@ -164,7 +164,7 @@ export default () => {
label: '选择品牌',
labelSpan: 6,
fieldSpan: 18,
model: -1
model: ''
},
verifyStatus: {
label: '审核状态',
... ...
... ... @@ -10,13 +10,7 @@
</FilterItem>
<FilterItem label="选择品牌">
<SelectBrand @on-change="brandChange"
:field-label="filters.brand.label"
:field-model="filters.brand.model"
:label-span="filters.brand.labelSpan"
:field-span="filters.brand.fieldSpan"
:option-list="filters.brand.options">
</SelectBrand>
<SelectBrand v-model="filters.brand.model"></SelectBrand>
</FilterItem>
<FilterItem>
... ... @@ -60,8 +54,6 @@
},
brand: {
label: '选择品牌',
labelSpan: 6,
fieldSpan: 18,
model: -1
},
maxSortId: null,
... ... @@ -129,9 +121,6 @@
this.filters.maxSortId = sort.max;
this.filters.middleSortId = sort.mid;
this.filters.smallSortId = sort.min;
},
brandChange(brandId) {
this.filters.brand.mode = brandId;
}
},
components: {
... ...
... ... @@ -2,7 +2,7 @@
<div class="cell-deliver">
<p class="row">
发货<span class="num">
<Input v-if="rowDisabled || changeDisabled" v-model="deliver" placeholder="数量" disabled></Input>
<Input v-if="rowDisabled" v-model="deliver" placeholder="数量" disabled></Input>
<Input v-else v-model="deliver" placeholder="数量"></Input>
</span>
</p>
... ... @@ -14,9 +14,6 @@
export default {
name: 'CellDeliver',
props: {
changeDisabled: {
default: false
},
rowDisabled: {
type: Boolean
},
... ...
... ... @@ -110,7 +110,6 @@ export default () => {
render(row, column, i){
return `<cell-deliver
:row-index="${i}"
:change-disabled="${row._changeDisabled}"
:row-disabled="${row._disabled}"
:ship-num="row.shipmentsNums"
@deliver-change="deliverChange">
... ...
... ... @@ -89,7 +89,7 @@
statusList: [2,3]
};
if(!this.useFilterSign) {
if (!this.useFilterSign) {
return data;
}
... ... @@ -113,16 +113,16 @@
const date = data.startTime.trim();
const status = data.statusList;
if(date && moment(date).isValid()) {
if (date && moment(date).isValid()) {
data.startTime = +moment(date).format('X');
data.endTime = +moment(date).add(1, 'days').format('X');
} else {
data.startTime = '';
}
if(status === -1) {
if (status === -1) {
data.statusList = [2,3];
} else if(status === -2){
} else if (status === -2){
data.statusList = [2];
} else {
data.statusList = [+status];
... ... @@ -173,7 +173,7 @@
this.setModel('orderTime', date);
},
rowClassName(row) {
if(row.isOvertime === 'Y') {
if (row.isOvertime === 'Y') {
return 'over-time';
}
return '';
... ...
... ... @@ -93,12 +93,12 @@
this.productList(params);
},
methods: {
params(){
params() {
let data = {
pageNo: 1
};
if(!this.useFilterSign) {
if (!this.useFilterSign) {
return data;
}
... ... @@ -115,7 +115,7 @@
let modelVal;
_.each(mapKeys, (v, k) => {
modelVal = this.filters[v].model;
if((modelVal+'').length) {
if ((modelVal+'').length) {
data[k] = this.filters[v].model;
}
});
... ... @@ -123,7 +123,7 @@
const ot = data.isOvertime;
const date = data.startTime;
if(date && moment(date).isValid()) {
if (date && moment(date).isValid()) {
data.startTime = +moment(date).format('X');
data.endTime = +moment(date).add(1, 'days').format('X');
} else {
... ... @@ -138,7 +138,7 @@
return data;
},
productList(params){
productList(params) {
service.allotPurchaseList(
_.merge(params || {}, {
statusList: [1],
... ... @@ -152,23 +152,23 @@
const fmt = 'YYYY-MM-DD HH:mm:ss';
const list = data.records;
_.each(list, i => {
i.createTime = moment(i.createTime).format(fmt);
i._disabled = i.isOvertime === 'Y';
// 当前需发数
i._needDeliver = i.buyingNums - i.lackNum - i.shipmentsNums;
_.each(list, (v, i) => {
v._rowIndex = i; // 当前行index
v._disabled = v.isOvertime === 'Y';
v.createTime = moment(v.createTime).format(fmt);
v._needDeliver = v.buyingNums - v.lackNum - v.shipmentsNums; // 当前需发数
});
this.table.list = list;
this.page.total = data.totalCount;
},
filterSearch(){
filterSearch() {
this.useFilterSign = true;
const params = this.params();
this.productList(params);
this.page.current = 1;
},
clearFilter(){
clearFilter() {
this.filters = Store().filters;
this.useFilterSign = false;
this.productList(this.params());
... ... @@ -180,17 +180,22 @@
this.productList(params);
this.page.current = page;
},
selectChange(rows){
this.table.list[0]._changeDisabled = true;
selectChange(rows) {
this.deliverRows = rows;
},
deliverChange(data) {
const i = data.index;
const v = data.value;
this.table.list[i]._inputDeliverNum = +v;
const index = data.index;
const value = data.value;
this.table.list[index]._inputDeliverNum = +value;
_.each(this.deliverRows, item => {
if (item._rowIndex === index) {
item._inputDeliverNum = value;
}
});
},
deliver(){
if(this.checkDeliver()) {
deliver() {
if (this.checkDeliver()) {
this.$refs.deliverModal.show();
}
},
... ... @@ -198,33 +203,33 @@
const rows = this.deliverRows;
const len = rows.length;
if(!len) {
if (!len) {
this.$Message.error('请勾选要发货的订单');
return false;
}
// let invalidRows = [];
// _.each(rows, (v) => {
// if(!v._inputDeliverNum ||
// !_.isFinite(+v._inputDeliverNum) ||
// v._inputDeliverNum > v._needDeliver) {
// invalidRows.push(i.productSku);
// }
// });
//
// if(invalidRows.length) {
// let sku = '';
//
// _.each(invalidRows, (v) => {
// sku += v;
// });
// this.$Message.error(`请输入大于0且不大于当前需发数的发货数字${sku}`, 5)
// return false;
// }
let invalidRows = [];
_.each(rows, (v) => {
if (!v._inputDeliverNum ||
!_.isFinite(+v._inputDeliverNum) ||
v._inputDeliverNum > v._needDeliver) {
invalidRows.push(i.productSku);
}
});
if (invalidRows.length) {
let sku = '';
_.each(invalidRows, (v) => {
sku += v;
});
this.$Message.error(`请输入大于0且不大于当前需发数的发货数字`, 5)
return false;
}
return true;
},
deliverSuccess(){
deliverSuccess() {
this.$Message.success('发货成功');
this.productList(this.params());
this.page.current = 1;
... ... @@ -232,11 +237,11 @@
setModel(k, v) {
this.filters[k].model = v;
},
dateChange(date){
dateChange(date) {
this.setModel('orderTime', date);
},
rowClassName(row) {
if(row.isOvertime === 'Y') {
if (row.isOvertime === 'Y') {
return 'over-time';
}
return '';
... ... @@ -251,7 +256,7 @@
const inputLackNum = row.inputLackNum;
const needDeliver = row._needDeliver;
if(!inputLackNum || inputLackNum > needDeliver) {
if (!inputLackNum || inputLackNum > needDeliver) {
this.$Message.error('请输入缺货数量,且缺货数量不能大于当前需发数', 3);
return;
}
... ... @@ -262,7 +267,7 @@
this.productList(this.params());
this.page.current = 1;
},
exportList(){
exportList() {
const href = "/Api/erp/allotExportForUnSend"
window.open(href, '_blank');
... ...
... ... @@ -25,35 +25,36 @@
title: 'sku',
key: 'sku',
align: 'center'
},{
}, {
title: '条码',
key: 'skuFactoryCode',
align: 'center'
},{
}, {
title: '商品图片',
align: 'center',
render(row){
render(row) { // eslint-disable-line
return `<div>
<img v-prod-img.sku="row.sku">
</div>`
</div>`;
}
},{
}, {
title: '商品名称',
key: 'productName',
align: 'center'
},{
}, {
title: '规格',
align: 'center',
render(row) {
return `${row.colorNama || ''}/${row.size}`
return `${row.colorNama || ''}/${row.size}`;
}
},{
}, {
title: '订单号/已发数',
align: 'center',
render(row){
render(row) {
let $html = '';
_.each(row.boList, i => {
$html += `<p>${i.proRequisitionFormId}/${i.num}</p>`
$html += `<p>${i.proRequisitionFormId}/${i.num}</p>`;
});
return $html;
... ... @@ -64,7 +65,7 @@
},
expressNo: 0,
expressTime: ''
}
};
},
created() {
this.expressNo = this.$route.query.expressNo;
... ... @@ -105,3 +106,4 @@
}
}
</style>
... ...
... ... @@ -7,4 +7,4 @@ export default {
meta: {
pageName: '调拨订单'
}
}
};
... ...
/**
* done tab store
* @author: leo
* @date: 04/05/2017
*/
export default () => {
return {
filters: {
orderNo: {
label: '入库单号',
model: '',
holder: '入库单号',
},
expressNo: {
label: '物流单号',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
prodCode: {
label: '商品编码',
labelSpan: 6,
model: '',
holder: 'SKN/SKU',
fieldSpan: 18
},
expressStatus: {
label: '物流状态',
labelSpan: 6,
fieldSpan: 18,
model: -1,
options: [
{
value: -1,
label: '全部'
},
{
value: 1,
label: '待处理'
},
{
value: 2,
label: '待处理超时'
}
]
},
prodBarCode: {
label: '商品条码',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
}
},
page: {
total: 0,
current: 1
},
table: {
cols: [
{
title: '物流单号',
align: 'center',
render(row) {
return `${row.expressNumber}(${row.expressName})`
}
},
{
title: '发货时间',
key: 'createTime',
align: 'center'
},
{
title: '查看明细',
key: 'detail',
align: 'center',
render(row){
return `<i-button type="primary">查看明细</i-button>`
}
}
],
list: []
}
}
};
\ No newline at end of file
... ... @@ -25,28 +25,28 @@ const productService = {
getAllSort(params) {
return axios.get(apiUrl.getSellerAllSortInfo, {
params
})
.then(res => {
if(res.status === 200) {
return res.data;
}
params
})
.then(res => {
if (res.status === 200) {
return res.data;
}
return {};
});
return {};
});
},
productList(params) {
return axios.get(apiUrl.productList, {
params
})
.then(res => {
if(res.status === 200) {
return res.data;
}
params
})
.then(res => {
if (res.status === 200) {
return res.data;
}
return {};
});
return {};
});
},
setOffSale(params) {
... ...
... ... @@ -20,7 +20,7 @@ const tradeService = {
allotPurchaseList(params) {
return axios.post(apiUrl.allotPurchaseList, params)
.then(res => {
if(res.status === 200) {
if (res.status === 200) {
return res.data;
}
... ... @@ -30,7 +30,7 @@ const tradeService = {
allotDelivery(params) {
return axios.post(apiUrl.allotDelivery, params)
.then(res => {
if(res.status === 200) {
if (res.status === 200) {
return res.data;
}
... ... @@ -40,7 +40,7 @@ const tradeService = {
allotExpressList(params) {
return axios.post(apiUrl.allotExpressList, params)
.then(res => {
if(res.status === 200) {
if (res.status === 200) {
return res.data;
}
... ... @@ -49,20 +49,20 @@ const tradeService = {
},
allotExpressDetail(no) {
return axios.post(apiUrl.allotExpressDetail, {
expressNumber: no
})
.then(res => {
if(res.status === 200) {
return res.data;
}
expressNumber: no
})
.then(res => {
if (res.status === 200) {
return res.data;
}
return {};
});
return {};
});
},
allotWarehouseInfo() {
return axios.post(apiUrl.allotWarehouseInfo)
.then(res => {
if(res.status === 200) {
if (res.status === 200) {
return res.data;
}
... ... @@ -72,7 +72,7 @@ const tradeService = {
allotStockOut(params) {
return axios.post(apiUrl.allotStockOut, params)
.then(res => {
if(res.status === 200) {
if (res.status === 200) {
return res.data;
}
... ... @@ -82,7 +82,7 @@ const tradeService = {
allotExpressNumList(params) {
return axios.post(apiUrl.allotExpressNumList, params)
.then(res => {
if(res.status === 200) {
if (res.status === 200) {
return res.data;
}
... ... @@ -92,7 +92,7 @@ const tradeService = {
allotExpressCompList() {
return axios.get(apiUrl.allotExpressCompList)
.then(res => {
if(res.status === 200) {
if (res.status === 200) {
return res.data;
}
... ...