修改无法发货的问题
This commit is contained in:
@ -309,13 +309,13 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/orderAdmin/AdminOrderList/index",
|
"path": "pages/orderAdmin/AdminOrderList/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "AdminOrderList"
|
"navigationBarTitleText": "订单"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/orderAdmin/GoodsDeliver/index",
|
"path": "pages/orderAdmin/GoodsDeliver/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "GoodsDeliver"
|
"navigationBarTitleText": "发货"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1,208 +1,230 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="deliver-goods">
|
<view class="deliver-goods">
|
||||||
<header>
|
<header>
|
||||||
<view class="order-num acea-row row-between-wrapper">
|
<view class="order-num acea-row row-between-wrapper">
|
||||||
<view class="num line1">订单号:{{ delivery.orderId }}</view>
|
<view class="num line1">订单号:{{ delivery.orderId }}</view>
|
||||||
<view class="name line1">{{ delivery.nickname }}</view>
|
<view class="name line1">{{ delivery.nickname }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="address">
|
<view class="address">
|
||||||
<view class="name">
|
<view class="name">
|
||||||
{{ delivery.realName }}
|
{{ delivery.realName }}
|
||||||
<text class="phone">{{ delivery.userPhone }}</text>
|
<text class="phone">{{ delivery.userPhone }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view>{{ delivery.userAddress }}</view>
|
<view>{{ delivery.userAddress }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"><image src="@/static/images/line.jpg" /></view>
|
<view class="line">
|
||||||
</header>
|
<image src="@/static/images/line.jpg" />
|
||||||
<view class="wrapper">
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper">
|
</header>
|
||||||
<view>发货方式</view>
|
<view class="wrapper">
|
||||||
<view class="mode acea-row row-middle row-right">
|
<view class="item acea-row row-between-wrapper">
|
||||||
<view class="goods" :class="active === typesIndex ? 'on' : ''" v-for="(item, typesIndex) in types" :key="typesIndex" @click="changeType(item, typesIndex)">
|
<view>发货方式</view>
|
||||||
{{ item.title }}
|
<view class="mode acea-row row-middle row-right">
|
||||||
<text class="iconfont icon-xuanzhong2"></text>
|
<view
|
||||||
</view>
|
class="goods"
|
||||||
</view>
|
:class="active === typesIndex ? 'on' : ''"
|
||||||
</view>
|
v-for="(item, typesIndex) in types"
|
||||||
<view class="list" v-show="active === 0">
|
:key="typesIndex"
|
||||||
<view class="item acea-row row-between-wrapper">
|
@click="changeType(item, typesIndex)"
|
||||||
<view>快递公司</view>
|
>
|
||||||
<picker mode="selector" :range="logistics" class="mode" range-key="name" @change="changeLog">
|
{{ item.title }}
|
||||||
<input type="text" placeholder="填写快递公司" disabled="disabled" v-model="deliveryNames" class="mode" />
|
<text class="iconfont icon-xuanzhong2"></text>
|
||||||
</picker>
|
</view>
|
||||||
<!-- <input type="text" placeholder="填写快递公司" v-model="deliveryName" class="mode" /> -->
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper">
|
<view class="list" v-show="active === 0">
|
||||||
<view>快递单号</view>
|
<picker
|
||||||
<input type="text" placeholder="填写快递单号" v-model="deliveryId" class="mode" />
|
mode="selector"
|
||||||
</view>
|
:range="logistics"
|
||||||
</view>
|
class="mode"
|
||||||
<view class="list" v-show="active === 1">
|
range-key="name"
|
||||||
<view class="item acea-row row-between-wrapper">
|
@change="changeLog"
|
||||||
<view>送货人</view>
|
>
|
||||||
<input type="text" placeholder="填写送货人" v-model="deliveryName" class="mode" />
|
<view class="item acea-row row-between-wrapper">
|
||||||
</view>
|
<view>快递公司</view>
|
||||||
<view class="item acea-row row-between-wrapper">
|
<input
|
||||||
<view>送货电话</view>
|
type="text"
|
||||||
<input type="text" placeholder="填写送货电话" v-model="deliveryId" class="mode" />
|
placeholder="填写快递公司"
|
||||||
</view>
|
disabled="disabled"
|
||||||
</view>
|
v-model="deliveryNames"
|
||||||
</view>
|
class="mode"
|
||||||
<view style="height:100rpx;"></view>
|
/>
|
||||||
<view class="confirm" @click="saveInfo">确认提交</view>
|
<!-- <input type="text" placeholder="填写快递公司" v-model="deliveryName" class="mode" /> -->
|
||||||
</view>
|
</view>
|
||||||
|
</picker>
|
||||||
|
<view class="item acea-row row-between-wrapper">
|
||||||
|
<view>快递单号</view>
|
||||||
|
<input type="text" placeholder="填写快递单号" v-model="deliveryId" class="mode" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="list" v-show="active === 1">
|
||||||
|
<view class="item acea-row row-between-wrapper">
|
||||||
|
<view>送货人</view>
|
||||||
|
<input type="text" placeholder="填写送货人" v-model="deliveryName" class="mode" />
|
||||||
|
</view>
|
||||||
|
<view class="item acea-row row-between-wrapper">
|
||||||
|
<view>送货电话</view>
|
||||||
|
<input type="text" placeholder="填写送货电话" v-model="deliveryId" class="mode" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view style="height:100rpx;"></view>
|
||||||
|
<view class="confirm" @click="saveInfo">确认提交</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getAdminOrderDelivery, setAdminOrderDelivery } from '@/api/admin';
|
import { getAdminOrderDelivery, setAdminOrderDelivery } from "@/api/admin";
|
||||||
import { getLogistics } from '@/api/public';
|
import { getLogistics } from "@/api/public";
|
||||||
import { required } from '@/utils/validate';
|
import { required } from "@/utils/validate";
|
||||||
import { validatorDefaultCatch } from '@/utils/dialog';
|
import { validatorDefaultCatch } from "@/utils/dialog";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'GoodsDeliver',
|
name: "GoodsDeliver",
|
||||||
components: {},
|
components: {},
|
||||||
props: {},
|
props: {},
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
types: [
|
types: [
|
||||||
{
|
{
|
||||||
type: 'express',
|
type: "express",
|
||||||
title: '发货'
|
title: "发货"
|
||||||
}
|
}
|
||||||
// {
|
// {
|
||||||
// type: "send",
|
// type: "send",
|
||||||
// title: "送货"
|
// title: "送货"
|
||||||
// },
|
// },
|
||||||
// {
|
// {
|
||||||
// type: "fictitious",
|
// type: "fictitious",
|
||||||
// title: "无需发货"
|
// title: "无需发货"
|
||||||
// }
|
// }
|
||||||
],
|
],
|
||||||
active: 0,
|
active: 0,
|
||||||
order_id: '',
|
order_id: "",
|
||||||
delivery: [],
|
delivery: [],
|
||||||
logistics: [],
|
logistics: [],
|
||||||
delivery_type: 'express',
|
delivery_type: "express",
|
||||||
deliveryName: '',
|
deliveryName: "",
|
||||||
deliveryId: '',
|
deliveryId: "",
|
||||||
deliveryNames: '请选择'
|
deliveryNames: "请选择"
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$yroute.query.oid': function(newVal) {
|
"$yroute.query.oid": function(newVal) {
|
||||||
let that = this;
|
let that = this;
|
||||||
if (newVal != undefined) {
|
if (newVal != undefined) {
|
||||||
that.order_id = newVal;
|
that.order_id = newVal;
|
||||||
that.getIndex();
|
that.getIndex();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
this.order_id = this.$yroute.query.oid;
|
this.order_id = this.$yroute.query.oid;
|
||||||
this.getIndex();
|
this.getIndex();
|
||||||
this.getLogistics();
|
this.getLogistics();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeLog: function(value) {
|
changeLog: function(value) {
|
||||||
this.deliveryNames = this.logistics[value.detail.value].name;
|
this.deliveryNames = this.logistics[value.detail.value].name;
|
||||||
this.deliveryName = this.logistics[value.detail.value].id;
|
this.deliveryName = this.logistics[value.detail.value].id;
|
||||||
},
|
},
|
||||||
changeType: function(item, index) {
|
changeType: function(item, index) {
|
||||||
this.active = index;
|
this.active = index;
|
||||||
this.delivery_type = item.type;
|
this.delivery_type = item.type;
|
||||||
this.deliveryName = '';
|
this.deliveryName = "";
|
||||||
this.deliveryId = '';
|
this.deliveryId = "";
|
||||||
},
|
},
|
||||||
getIndex: function() {
|
getIndex: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
getAdminOrderDelivery(that.order_id).then(
|
getAdminOrderDelivery(that.order_id).then(
|
||||||
res => {
|
res => {
|
||||||
that.delivery = res.data;
|
that.delivery = res.data;
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: error.msg,
|
title: error.msg,
|
||||||
icon: 'none',
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
getLogistics: function() {
|
getLogistics: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
getLogistics().then(
|
getLogistics().then(
|
||||||
res => {
|
res => {
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
that.logistics = res.data;
|
that.logistics = res.data;
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: error.msg,
|
title: error.msg,
|
||||||
icon: 'none',
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
async saveInfo() {
|
async saveInfo() {
|
||||||
let that = this,
|
let that = this,
|
||||||
delivery_type = that.delivery_type,
|
delivery_type = that.delivery_type,
|
||||||
deliveryName = that.deliveryName,
|
deliveryName = that.deliveryName.toString(),
|
||||||
deliveryId = that.deliveryId,
|
deliveryId = that.deliveryId,
|
||||||
save = {};
|
save = {};
|
||||||
save.orderId = that.order_id;
|
console.log(deliveryName);
|
||||||
save.deliveryType = that.delivery_type;
|
save.orderId = that.order_id;
|
||||||
switch (delivery_type) {
|
save.deliveryType = that.delivery_type;
|
||||||
case 'express':
|
switch (delivery_type) {
|
||||||
try {
|
case "express":
|
||||||
await this.$validator({
|
try {
|
||||||
deliveryName: [required(required.message('快递公司'))],
|
await this.$validator({
|
||||||
deliveryId: [required(required.message('快递单号'))]
|
deliveryName: [required(required.message("快递公司"))],
|
||||||
}).validate({ deliveryName, deliveryId });
|
deliveryId: [required(required.message("快递单号"))]
|
||||||
} catch (e) {
|
}).validate({ deliveryName, deliveryId });
|
||||||
return validatorDefaultCatch(e);
|
} catch (e) {
|
||||||
}
|
return validatorDefaultCatch(e);
|
||||||
save.deliveryName = deliveryName;
|
}
|
||||||
save.deliveryId = deliveryId;
|
save.deliveryName = deliveryName;
|
||||||
that.setInfo(save);
|
save.deliveryId = deliveryId;
|
||||||
break;
|
that.setInfo(save);
|
||||||
case 'send':
|
break;
|
||||||
try {
|
case "send":
|
||||||
await this.$validator({
|
try {
|
||||||
deliveryName: [required(required.message('发货人姓名'))],
|
await this.$validator({
|
||||||
deliveryId: [required(required.message('发货人电话'))]
|
deliveryName: [required(required.message("发货人姓名"))],
|
||||||
}).validate({ deliveryName, deliveryId });
|
deliveryId: [required(required.message("发货人电话"))]
|
||||||
} catch (e) {
|
}).validate({ deliveryName, deliveryId });
|
||||||
return validatorDefaultCatch(e);
|
} catch (e) {
|
||||||
}
|
return validatorDefaultCatch(e);
|
||||||
save.deliveryName = deliveryName;
|
}
|
||||||
save.deliveryId = deliveryId;
|
save.deliveryName = deliveryName;
|
||||||
that.setInfo(save);
|
save.deliveryId = deliveryId;
|
||||||
break;
|
that.setInfo(save);
|
||||||
}
|
break;
|
||||||
},
|
}
|
||||||
setInfo: function(item) {
|
},
|
||||||
let that = this;
|
setInfo: function(item) {
|
||||||
console.log(item);
|
let that = this;
|
||||||
setAdminOrderDelivery(item)
|
console.log(item);
|
||||||
.then(res => {
|
setAdminOrderDelivery(item)
|
||||||
console.log(res);
|
.then(res => {
|
||||||
uni.showToast({
|
console.log(res);
|
||||||
title: res.msg,
|
uni.showToast({
|
||||||
icon: 'none',
|
title: res.msg,
|
||||||
duration: 2000
|
icon: "none",
|
||||||
});
|
duration: 2000
|
||||||
that.$yrouter.go(-1);
|
});
|
||||||
})
|
that.$yrouter.go(-1);
|
||||||
.catch(err => {
|
})
|
||||||
console.log(err);
|
.catch(err => {
|
||||||
uni.showToast({
|
console.log(err);
|
||||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
uni.showToast({
|
||||||
icon: 'none',
|
title:
|
||||||
duration: 2000
|
err.msg || err.response.data.msg || err.response.data.message,
|
||||||
});
|
icon: "none",
|
||||||
});
|
duration: 2000
|
||||||
}
|
});
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user