提交批量发货没有跳转的Bug

master
lemon橪 2021-06-21 14:15:52 +08:00
parent 85bfb48c0c
commit c3be931218
4 changed files with 154 additions and 57 deletions

View File

@ -395,6 +395,49 @@ export const result = [
} }
] ]
}, },
{
name: "lives",
showAlways: true,
level: 1,
type: 0,
title: "直播活动",
path: "/promotion",
component: "Main",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: [
{
name: "live",
showAlways: true,
level: 2,
type: 0,
title: "直播管理",
path: "live",
component: "promotion/live/live",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
},
{
name: "liveGoods",
showAlways: true,
level: 2,
type: 0,
title: "直播商品",
path: "liveGoods",
component: "promotion/live/liveGoods",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
}
]
},
{ {
name: "storePromotion", name: "storePromotion",
showAlways: true, showAlways: true,
@ -436,34 +479,7 @@ export const result = [
permTypes: [], permTypes: [],
children: null children: null
}, },
{
name: "live",
showAlways: true,
level: 2,
type: 0,
title: "直播管理",
path: "live",
component: "promotion/live/live",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
},
{
name: "liveGoods",
showAlways: true,
level: 2,
type: 0,
title: "直播商品",
path: "liveGoods",
component: "promotion/live/liveGoods",
icon: "md-person",
isMenu: true,
url: "",
permTypes: [],
children: null
}
] ]
}, },
{ {

View File

@ -17,8 +17,8 @@
</div> </div>
<!-- 上传 --> <!-- 上传 -->
<div v-if="item.checked && index ==1" class="tpl"> <div v-if="item.checked && index ==1" class="tpl">
<Upload :before-upload="handleUpload" name="files" style="width:50%; height:400px;" <Upload :before-upload="handleUpload" name="files" style="width:50%; height:400px;" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" multiple type="drag" :action="action" :headers="accessToken"> multiple type="drag" :action="action" :headers="accessToken">
<div style="padding: 50px 0"> <div style="padding: 50px 0">
<Icon type="ios-cloud-upload" size="102" style="color: #3399ff"></Icon> <Icon type="ios-cloud-upload" size="102" style="color: #3399ff"></Icon>
<h2>选择或拖拽文件上传</h2> <h2>选择或拖拽文件上传</h2>
@ -26,11 +26,13 @@
</Upload> </Upload>
</div> </div>
<!-- 上传 --> <!-- 上传 -->
<div v-if="item.checked && index ==2" class="tpl"> <div v-if="item.checked && index ==2" class="tpl success">
<h1>发货完成</h1> <h1>发货完成</h1>
<div> <div>
<Button>关闭页面</Button> <Button class="btn" @click="close"></Button>
<Button class="btn" type="primary" @click="navigationToGoodsOrder"></Button>
</div> </div>
</div> </div>
@ -44,7 +46,7 @@ import JsonExcel from "vue-json-excel";
import { downLoadDeliverExcel, uploadDeliverExcel } from "@/api/order.js"; import { downLoadDeliverExcel, uploadDeliverExcel } from "@/api/order.js";
import { baseUrl } from "@/libs/axios.js"; import { baseUrl } from "@/libs/axios.js";
export default { export default {
components: { components: {
"download-excel": JsonExcel, "download-excel": JsonExcel,
}, },
data() { data() {
@ -79,32 +81,50 @@ export default {
methods: { methods: {
// //
handleCheckStep(val) { handleCheckStep(val) {
if(val.title.search('3') == -1){ if (val.title.search("3") == -1) {
console.warn(val) console.warn(val);
this.stepList.map((item) => { this.stepList.map((item) => {
item.checked = false; item.checked = false;
}); });
val.checked = true; val.checked = true;
} }
}, },
handleUpload(file) { handleUpload(file) {
this.file = file; this.file = file;
this.upload(); this.upload();
return false; return false;
}, },
navigationToGoodsOrder() {
this.$router.push({
path: "/order/orderList",
});
},
close() {
this.$store.commit("removeTag", "export-order-deliver");
localStorage.storeOpenedList = JSON.stringify(
this.$store.state.app.storeOpenedList
);
this.$router.go(-1);
},
/** /**
* 上传文件 * 上传文件
*/ */
async upload() { async upload() {
let fd = new FormData(); let fd = new FormData();
fd.append("files", this.file); fd.append("files", this.file);
await uploadDeliverExcel(fd); let res = await uploadDeliverExcel(fd);
}, if (res.success) {
this.stepList.map((item) => {
item.checked = false;
});
this.stepList[2].checked = true;
}
},
/** /**
* 下载excel * 下载excel
@ -176,4 +196,15 @@ img {
width: 100px; width: 100px;
height: 100px; height: 100px;
} }
.success {
align-items: center;
flex-direction: column;
> h1 {
font-size: 28px;
margin: 10px;
}
/deep/ .btn {
margin: 10px;
}
}
</style> </style>

View File

@ -60,7 +60,7 @@ export default {
orderSn: "", orderSn: "",
buyerName: "", buyerName: "",
orderStatus: "", orderStatus: "",
orderType:"NORMAL" orderType: "NORMAL",
}, },
selectDate: null, selectDate: null,
form: { form: {
@ -191,8 +191,6 @@ export default {
let result = await verificationCode(this.orderCode); let result = await verificationCode(this.orderCode);
if (result.success) { if (result.success) {
this.$router.push({ this.$router.push({
name: "order-detail", name: "order-detail",
query: { sn: result.result.sn || this.orderCode }, query: { sn: result.result.sn || this.orderCode },
@ -271,6 +269,9 @@ export default {
}); });
}, },
}, },
mounted() {
this.init();
},
activated() { activated() {
this.init(); this.init();
}, },

View File

@ -172,6 +172,7 @@ export default {
// //
optionsTime: { optionsTime: {
disabledDate(date) { disabledDate(date) {
// console.log(data)
return date && date.valueOf() < Date.now() - 86400000; return date && date.valueOf() < Date.now() - 86400000;
}, },
}, },
@ -191,7 +192,7 @@ export default {
startTime: [ startTime: [
{ {
required: true, required: true,
message: "请输入开始时间以及结束时间", message: "请正确输入开始时间以及结束时间",
}, },
], ],
feedsImg: [ feedsImg: [
@ -331,8 +332,9 @@ export default {
* dialog点击确定时判断 * dialog点击确定时判断
*/ */
addGoods() { addGoods() {
this.liveData.forEach((item) => { this.liveData.forEach((item, index) => {
this.commodityList.forEach((oldVal) => { this.commodityList.forEach((oldVal, i) => {
//
if (oldVal.liveGoodsId != item.liveGoodsId) { if (oldVal.liveGoodsId != item.liveGoodsId) {
addLiveGoods({ addLiveGoods({
roomId: this.$route.query.roomId, roomId: this.$route.query.roomId,
@ -389,21 +391,66 @@ export default {
this.liveForm.coverImg = res.result; this.liveForm.coverImg = res.result;
}, },
tipsDateError() {
this.$Message.error({
content:
"直播开播时间需要在当前时间的10分钟后并且,开始时间不能在6个月后,直播计划结束时间开播时间和结束时间间隔不得短于30分钟不得超过24小时",
duration: 5,
});
},
/** /**
* 选择时间后的回调 * 选择时间后的回调
*/ */
handleChangeTime(daterange) { handleChangeTime(daterange) {
this.times = daterange; /**
this.$set( * 直播开播时间需要在当前时间的10分钟后
this.liveForm, * 此处设置默认为15分钟方便调整
"startTime", */
new Date(daterange[0]).getTime() / 1000 let siteTime = new Date().getTime() / 1000;
); let selectTime = new Date(daterange[0]).getTime() / 1000;
this.$set( let currentTime = this.$options.filters.unixToDate(siteTime);
this.liveForm, /**
"endTime", * 开播时间和结束时间间隔不得短于30分钟不得超过24小时
new Date(daterange[1]).getTime() / 1000 * 判断用户设置的结束时间
); */
let endTime = new Date(daterange[1]).getTime() / 1000;
if (selectTime <= siteTime + 15 * 60) {
this.tipsDateError();
return false;
} else if (selectTime + 30 * 60 >= endTime) {
// 30
this.tipsDateError();
return false;
} else if (selectTime + 24 * 60 * 60 <= endTime) {
// 24
this.tipsDateError();
return false;
} else if (
// 6
siteTime >=
new Date().getTime() + 6 * 31 * 24 * 3600 * 1000 + 86400000
) {
this.tipsDateError();
return false;
} else {
this.$set(this.times, [0], currentTime);
this.times[1] = daterange[1];
// this.times = daterange;
this.$set(
this.liveForm,
"startTime",
new Date(daterange[0]).getTime() / 1000
);
this.$set(
this.liveForm,
"endTime",
new Date(daterange[1]).getTime() / 1000
);
}
}, },
/** /**
@ -448,7 +495,9 @@ export default {
// //
if (this.$route.query.id && this.liveData.length != 0) { if (this.$route.query.id && this.liveData.length != 0) {
this.spinShow = true; this.spinShow = true;
this.liveForm.commodityList = JSON.stringify(this.liveForm.commodityList); this.liveForm.commodityList = JSON.stringify(
this.liveForm.commodityList
);
// //
editLive(this.liveForm).then((res) => { editLive(this.liveForm).then((res) => {
if (res.success) { if (res.success) {