Authored by 李奇

物流状态修改

... ... @@ -7,13 +7,14 @@
</p>
<p class="row">缺货数:{{lackNum}}</p>
<p class="row">
<Button type="error" @click="upload">上传确认缺货</Button>
<Button type="error" @click="showModal">上传确认缺货</Button>
</p>
<UploadStockOut ref="stockOut"></UploadStockOut>
<UploadStockOut ref="stockOut" @ok-click="uploadSubmit"></UploadStockOut>
</div>
</template>
<script>
import service from 'trade-service';
import { UploadStockOut } from 'components/modal'
export default {
... ... @@ -28,9 +29,21 @@
}
},
methods: {
upload(){
showModal(){
this.$refs.stockOut.show();
},
uploadSubmit(){
const params = {
proReqFormId:195481,
productSku:1275164,
num:1
};
service.allotStockOut(params)
.then(res => {
console.log(res)
});
},
change(val){
this.$emit('num-change', val)
}
... ...
... ... @@ -60,6 +60,7 @@ export default {
this.showModal = true;
},
clickOk(){
this.$emit('ok-click');
},
clickCancel(){
}
... ...
... ... @@ -31,23 +31,31 @@ export default {
activate: ''
};
},
watch: {
'$route'() {
this.setActiveTab();
}
},
created() {
const path = this.$route.path;
const children = ['undone', 'done', 'express'];
_.each(children, v => {
const regx = new RegExp(`/${v}`);
if(regx.test(path)) {
this.activate = v;
return false;
}
});
this.setActiveTab();
},
methods: {
switchTab(name) {
this.$router.push({
name: `trade.allot.${name}`
});
},
setActiveTab() {
const path = this.$route.path;
const children = ['undone', 'done', 'express'];
_.each(children, v => {
const regx = new RegExp(`/${v}`);
if(regx.test(path)) {
this.activate = v;
return false;
}
});
}
},
components: {}
... ...
... ... @@ -53,93 +53,101 @@
filters: {},
page: {},
table: {},
useFilterSign: false
useFilter: false
};
},
created() {
const store = Store();
const params = {
pageNo: 1,
statusList: [3] // TODO
pageSize: 20,
statusList: [2,3]
};
this.page = store.page;
this.table = store.table;
this.filters = store.filters;
this.expressList(params);
this.getExpList(params);
},
methods: {
expressList(params){
service.allotExpressList(
_.merge(params || {}, {
pageSize: 20
}))
getExpList(params){
service.allotExpressList(params)
.then(res => {
const fmt = 'YYYY-MM-DD HH:mm:ss';
const list = res.data.records;
_.each(list, i => {
i.createTime = moment(i.createTime).format(fmt);
});
this.table.list = list;
this.page.total = res.data.totalCount;
this.handleData(res.data);
});
},
filterSearch(){
const params = this.params();
this.useFilterSign = true;
this.expressList(params);
this.useFilter = true;
this.getExpList(this.params());
this.page.current = 1;
},
clearFilter(){
this.filters = Store().filters;
this.expressList();
this.useFilterSign = false;
this.useFilter = false;
this.getExpList(this.params());
this.page.current = 1;
this.filters = Store().filters;
},
pageChange(page) {
let params = {};
let params = this.params();
params.pageNo = page;
this.page.current = page;
if(this.useFilterSign) {
params = this.params();
}
_.merge(params, {
page
});
this.expressList(params);
this.getExpList(params);
},
params(){
const data = {};
const data = {
pageNo: 1,
pageSize: 20,
statusList: [2,3]
};
const mapKeys = {
proRequisitionFormId: 'orderNo',
productSkn: 'prodCode',
sknFactoryCode: 'merChantCode',
expressNumber: 'expressNo',
sknFactoryCode: 'prodCode',
skuFactoryCode: 'prodBarCode',
startTime: 'orderTime',
endTime: 'orderTime',
isOvertime: 'prodStatus'
proRequisitionFormId: 'orderNo',
statusList: 'expressStatus'
};
_.each(mapKeys, (v, k) => {
data[k] = this.filters[v].model;
});
if(this.useFilter) {
let val;
_.each(mapKeys, (v, k) => {
val = '' + this.filters[v].model;
if(val.length) {
data[k] = this.filters[v].model;
}
// 物流状态
if(k === 'statusList') {
if (val === '0') {
data[k] = [2, 3];
} else {
data[k] = [this.filters[v].model];
}
}
});
}
return data;
},
expressDetail(expressNo) {
goExpDetail(expressNo) {
this.$router.push({
name: 'trade.expdetail',
query: {
expressNo
}
});
}
},
handleData(data) {
const fmt = 'YYYY-MM-DD HH:mm:ss';
const list = data.records;
_.each(list, i => {
i.createTime = moment(i.createTime).format(fmt);
});
this.table.list = list;
this.page.total = data.totalCount;
}
}
};
</script>
... ...
... ... @@ -10,7 +10,7 @@ export default () => {
orderNo: {
label: '入库单号',
model: '',
holder: '入库单号',
holder: '',
},
expressNo: {
label: '物流单号',
... ... @@ -30,19 +30,19 @@ export default () => {
label: '物流状态',
labelSpan: 6,
fieldSpan: 18,
model: -1,
model: 0,
options: [
{
value: -1,
value: 0,
label: '全部'
},
{
value: 1,
label: '待处理'
value: 2,
label: '已发出'
},
{
value: 2,
label: '待处理超时'
value: 3,
label: '入库完成'
}
]
},
... ... @@ -79,7 +79,7 @@ export default () => {
key: 'detail',
align: 'center',
render(row){
return `<i-button type="primary" @click="expressDetail(row.expressNumber)">查看明细</i-button>`
return `<i-button type="primary" @click="goExpDetail(row.expressNumber)">查看明细</i-button>`
}
}
],
... ...