Authored by lzhy

一件代发

... ... @@ -10,24 +10,25 @@ import moment from 'moment';
* timeFormat({time: 1495787643})
* timeFormat({time: 1495787643, format: moment支持的format格式'})
*/
export default (value) => {
export default value => {
if (+value <= 0) {
return '';
}
let format;
let unixStamp;
const isNum = _.isFinite(value);
const isObj = _.isPlainObject(value);
const defaultFmt = 'YYYY-MM-DD HH:mm:ss';
let format;
let unixStamp;
const isNum = _.isFinite(value);
const isObj = _.isPlainObject(value);
const defaultFmt = 'YYYY-MM-DD HH:mm:ss';
if (isNum) {
unixStamp = value;
format = defaultFmt;
} else if (isObj) {
unixStamp = value.time;
format = value.format || defaultFmt;
} else {
unixStamp = 'Invalid value.';
}
if (isNum) {
unixStamp = value;
format = defaultFmt;
} else if (isObj) {
unixStamp = value.time;
format = value.format || defaultFmt;
} else {
unixStamp = 'Invalid value.';
}
return moment.unix(unixStamp).format(format);
return moment.unix(unixStamp).format(format);
};
... ...
... ... @@ -17,6 +17,7 @@
<script>
import { orderGoodsInfo } from '../../components';
import OrderService from 'services/order/order-service';
import { OrderConfig } from '../../configs';
import _ from 'lodash';
export default {
components: { orderGoodsInfo },
... ... @@ -27,6 +28,7 @@ export default {
tableData: [],
goodsPromos: [],
orderPromos: [],
feeSharingType: OrderConfig.feeSharingType,
};
},
created() {
... ...
... ... @@ -35,7 +35,7 @@
>
确认发货
</Button>
<Button type="default" @click="cancel">取消</Button>
<Button type="default" @click="cancel">返回</Button>
</filter-item>
</layout-filter>
</Tab-pane>
... ... @@ -63,6 +63,7 @@ export default {
this.OrderService = new OrderService();
this.$emit('nextStep', 2);
this.getLogisticsList();
this.orderInfo.expressNumber = this.orderInfo.expressNumber || '';
},
methods: {
... ...
... ... @@ -26,7 +26,6 @@
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button @click="reset">全部</Button>
<Button type="success" @click="exportData">导出</Button>
</filter-item>
</layout-filter>
<layout-list>
... ... @@ -44,7 +43,6 @@ import { ListTabs, DataTable } from './components';
import { OrderService } from 'services/order';
import _ from 'lodash';
import { OrderConfig } from '../configs';
import qs from 'querystringify';
export default {
components: { ListTabs, DataTable },
data() {
... ... @@ -103,11 +101,6 @@ export default {
this.query.pageNo = 1;
this.search();
},
exportData() {
const querystring = qs.stringify(this.query, true);
const href = `${OrderService.exportOrdersByStatus}${querystring}`;
window.open(href, '_blank');
},
},
};
</script>
... ...
... ... @@ -13,7 +13,7 @@
<td colspan="12" style="text-align: left">
<span>订单号:{{ item.orderCode }}</span>
<span>父订单号:{{ item.parentOrderCode }}</span>
<span>创建时间:{{ item.createTime }}</span>
<span>创建时间:{{ item.createTime | timeFormat }}</span>
</td>
</tr>
<template v-for="(goods, key) in item.returnedGoodsListBoArray">
... ...
... ... @@ -27,7 +27,6 @@
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button @click="reset">清空条件</Button>
<Button type="success" @click="exportData">导出</Button>
</filter-item>
</layout-filter>
<layout-list>
... ... @@ -43,7 +42,6 @@ import { ReturnedListTable } from '../components';
import { ReturnedService } from 'services/order';
import { OrderConfig } from 'pages/order/configs';
import _ from 'lodash';
import qs from 'querystringify';
export default {
components: { ReturnedListTable },
... ... @@ -101,11 +99,6 @@ export default {
this.query.orderStatusStr = '';
this.search();
},
exportData() {
const querystring = qs.stringify(this.query, true);
const href = `${ReturnedService.exportReturnedGoods}${querystring}`;
window.open(href, '_blank');
},
},
};
</script>
... ...
... ... @@ -143,12 +143,12 @@ export default {
title: '同意退货申请',
content: `你确定同意退货申请吗?`,
onOk() {
_this.returnedService.returnedGoodsAudit({ id: this.id }).then(ret => {
_this.returnedService.returnedGoodsAudit({ id: _this.id }).then(ret => {
if (ret.code === 200) {
this.$Message.info(ret.message);
this.$router.go(0);
_this.$Message.info(ret.message);
_this.$router.go(0);
} else {
this.$Message.error(ret.message);
_this.$Message.error(ret.message);
}
});
},
... ... @@ -175,10 +175,10 @@ export default {
onOk() {
_this.logisticsService.proxyReturnedGoodsInstorage({ requestId: +_this.id }).then(ret => {
if (ret.code === 200) {
this.$Message.info(ret.message);
this.$router.go(0);
_this.$Message.info(ret.message);
_this.$router.go(0);
} else {
this.$Message.error(ret.message);
_this.$Message.error(ret.message);
}
});
},
... ...