提交 e087cd4b 编写于 作者: yi.li's avatar yi.li

订单详情和订单管理联调1

上级 9a52da0f
......@@ -8,11 +8,11 @@
center
class="send-set-body">
<el-form ref="changeInfoForm" :model="changeInfoForm" :rules="rules" label-width="90px" label-suffix=":">
<el-form-item label="收货人" prop="name">
<el-input type="text" v-model="changeInfoForm.name" placeholder="请输入快递公司"></el-input>
<el-form-item label="收货人" prop="receiver">
<el-input type="text" v-model="changeInfoForm.receiver" placeholder="请输入收货人姓名"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input type="text" v-model="changeInfoForm.phone" placeholder="请输入快递单号"></el-input>
<el-form-item label="手机号" prop="receiverMobile">
<el-input type="text" v-model="changeInfoForm.receiverMobile" maxlength="11" placeholder="请输入收货人手机号"></el-input>
</el-form-item>
<el-form-item label="所在地区" prop="area">
<el-cascader
......@@ -31,7 +31,7 @@
<el-input type="textarea"
v-model="changeInfoForm.address"
rows="5"
placeholder="请输入备注内容"
placeholder="请输入收货人详细地址"
style="width: 100%;">
</el-input>
</el-form-item>
......@@ -45,16 +45,17 @@
<script>
import { openLoading, closeLoading } from "@/utils/utils";
import * as operationData from "@/utils/operation";
import { checkMobile } from '@/utils/patients/checkValid'
let vm = null;
export default {
components: {
},
props: {
// sendSetFormData: {
// type: Object,
// required: true,
// default: () => {}
// },
receiveInfo: {
type: Object,
required: true,
default: () => {}
},
},
data(){
return{
......@@ -62,11 +63,23 @@
optionsRegion: [],
administrativeValue: '',
changeInfoForm: {
name: '',
phone: '',
receiver: '',
receiverMobile: '',
area: '',
address: '',
provinceName: '',
cityName: '',
countyName: '',
townName: '',
provinceId: null,
cityId: null,
countyId: null,
townId: null,
},
provinceList: [],
cityList: [],
countyList: [],
townList: [],
props: {
lazy: true,
lazyLoad(node, resolve) {
......@@ -74,26 +87,35 @@
const { level } = node;
console.log("当前点击的节点node", node);
if (node.level == 1) {
vm.changeInfoForm.provinceName = node.data.label;
vm.changeInfoForm.provinceId = node.data.value;
let req = {
provinceId: node.data.value
};
vm.GET("basic-data/position/cities", req).then(res => {
vm.cityList = res.data.cityList;
let newData = vm.setMoreOption(res.data.cityList, "cities");
resolve(newData);
});
} else if (node.level == 2) {
vm.changeInfoForm.cityName = node.data.label;
vm.changeInfoForm.cityId = node.data.value;
let req = {
cityId: node.data.value
};
vm.GET("basic-data/position/counties", req).then(res => {
vm.countyList = res.data.countyList;
let newData = vm.setMoreOption(res.data.countyList, "counties");
resolve(newData);
});
} else if (node.level == 3) {
vm.changeInfoForm.countyName = node.data.label;
vm.changeInfoForm.countyId = node.data.value;
let req = {
countyId: node.data.value
};
vm.GET("basic-data/position/towns", req).then(res => {
vm.townList = res.data.townList;
let newData = vm.setMoreOption(res.data.townList, "towns");
resolve(newData);
});
......@@ -101,11 +123,12 @@
}
},
rules: {
name: [
receiver: [
{ required: true, message: '请输入收货人姓名', trigger: "blur"},
],
phone: [
receiverMobile: [
{ required: true, message: '请输入收货人手机号', trigger: "blur"},
{validator: checkMobile, trigger: ['change','blur']}
],
area: [
{ required: true, message: '请选择所在地区', trigger: "blur"},
......@@ -118,9 +141,28 @@
},
created() {
vm = this;
this.initData();
this.getRegionOption();
},
methods: {
initData() {
console.log('父级传入的值',this.receiveInfo);
const { receiver, receiverMobile, provinceId, provinceName, cityId, cityName, countyId, countyName, townId, townName, address } = this.receiveInfo;
this.changeInfoForm.receiver = receiver;
this.changeInfoForm.receiverMobile = receiverMobile;
this.changeInfoForm.address = address;
let arrayLike = {
0: provinceId,
1: cityId,
2: countyId,
3: townId,
'length': 4
}
let arr = Array.from(arrayLike)
console.log('初始化后的值',arr);
this.changeInfoForm.area = arr;
},
handleChange(value) {
let areaId = "000";
for (let i = 0; i < value.length; i++) {
......@@ -128,6 +170,7 @@
}
this.administrativeValue = areaId;
console.log('修改后的值',value, this.administrativeValue);
// 000_110_110100000000_110101000000_110101001000
},
//获取地区
getRegionOption() {
......@@ -136,9 +179,11 @@
vm.GET("basic-data/position/provinces", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
this.provinceList = res.data.provinceList;
vm.optionsRegion = operationData.setRegionOption3(
res.data.provinceList
);
console.log('region',vm.optionsRegion)
}
});
},
......@@ -166,7 +211,25 @@
this.$emit('closeChangeInfo',{type: 1})
},
submitChange() {
this.$emit('closeChangeInfo',{type: 2})
this.$refs.changeInfoForm.validate((valid) => {
if (valid) {
// this.submit();
this.changeInfoForm.townId = null;
this.changeInfoForm.townName = '';
if (this.changeInfoForm.area.length == 4) {
this.changeInfoForm.townId = this.changeInfoForm.area[3];
this.townList.map((item) => {
if (this.changeInfoForm.townId == item.townId) {
this.changeInfoForm.townName = item.townName;
}
})
}
console.log('确定值',this.changeInfoForm)
this.$emit('closeChangeInfo',{type: 2, data: this.changeInfoForm})
} else {
return false;
}
})
},
},
}
......
......@@ -2,7 +2,7 @@
<div class="order-manage-wrapper" v-if="sendGoodsDialog">
<el-dialog
:title="dialogTitle"
:visible="sendGoodsDialog"
:visible="sendGoodsDialogIn"
@close="cancelSendSet"
width="600px"
center
......@@ -13,45 +13,46 @@
<el-button type="text" size="small" @click="changeInfo">修改</el-button>
</div>
<div class="address-info">
<p>上海市浦东新区花木路世纪大厦22楼</p>
<p>张三 15829738940</p>
<!--<p>{{receiveInfo.receiverAddr}}</p>-->
<p>{{receiveInfo.provinceName}}{{receiveInfo.cityName}}{{receiveInfo.countyName}}{{receiveInfo.townName}}{{receiveInfo.address}}</p>
<p>{{receiveInfo.receiver}} {{receiveInfo.receiverMobile}}</p>
</div>
</div>
<div v-if="dialogTitle == '发货设置'">
<p class="form-title">填写物流信息</p>
<el-form ref="sendSetForm" :model="sendSetForm" :rules="rules" label-width="75px" label-suffix=":">
<el-form-item label="快递公司" prop="name">
<el-input type="text" v-model="sendSetForm.name" placeholder="请输入快递公司"></el-input>
<el-form-item label="快递公司" prop="expressName">
<el-input type="text" v-model="sendSetForm.expressName" placeholder="请输入快递公司"></el-input>
</el-form-item>
<el-form-item label="快递单号" prop="orderNum">
<el-input type="text" v-model="sendSetForm.orderNum" placeholder="请输入快递单号"></el-input>
<el-form-item label="快递单号" prop="expressNo">
<el-input type="text" v-model="sendSetForm.expressNo" placeholder="请输入快递单号"></el-input>
</el-form-item>
<el-form-item label="备注">
<el-input type="textarea"
v-model="sendSetForm.content"
v-model="sendSetForm.remark"
rows="5"
placeholder="请输入备注内容"
style="width: 100%;"></el-input>
<span class="word-num" style="float: right">{{(sendSetForm.content).replace(/\s+/g,"").length}}/400</span>
<span class="word-num" style="float: right">{{(sendSetForm.remark).replace(/\s+/g,"").length}}/400</span>
</el-form-item>
</el-form>
</div>
<div v-if="dialogTitle == '配送设置'">
<p class="form-title">填写配送员信息</p>
<el-form ref="sendSetForm" :model="sendSetForm" :rules="rules" label-width="75px" label-suffix=":">
<el-form-item label="姓名" prop="sendName">
<el-input type="text" v-model="sendSetForm.sendName" placeholder="请输入配送员姓名"></el-input>
<el-form-item label="姓名" prop="sender">
<el-input type="text" v-model="sendSetForm.sender" placeholder="请输入配送员姓名"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="sendPhone">
<el-input type="text" maxlength="11" v-model="sendSetForm.sendPhone" placeholder="请输入配送员手机号"></el-input>
<el-form-item label="手机号" prop="senderMobile">
<el-input type="text" maxlength="11" v-model="sendSetForm.senderMobile" placeholder="请输入配送员手机号"></el-input>
</el-form-item>
<el-form-item label="备注">
<el-input type="textarea"
v-model="sendSetForm.sendContent"
v-model="sendSetForm.remark"
rows="5"
placeholder="请输入备注内容"
style="width: 100%;"></el-input>
<span class="word-num" style="float: right">{{(sendSetForm.sendContent).replace(/\s+/g,"").length}}/400</span>
<span class="word-num" style="float: right">{{(sendSetForm.remark).replace(/\s+/g,"").length}}/400</span>
</el-form-item>
</el-form>
</div>
......@@ -60,13 +61,14 @@
<el-button size="small" type="primary" @click="submitSendSet">完成</el-button>
</span>
</el-dialog>
<change-info v-if="showChangeInfo" @closeChangeInfo="closeChangeInfo"></change-info>
<change-info v-if="showChangeInfo" @closeChangeInfo="closeChangeInfo" :receiveInfo="receiveInfo"></change-info>
</div>
</template>
<script>
// import { openLoading, closeLoading } from "../../utils/utils";
import ChangeInfo from "./change-info";
import { checkMobile } from '@/utils/patients/checkValid'
import { checkMobile } from '@/utils/patients/checkValid';
import { updateExpress } from "@/utils/shop";
export default {
components: {
......@@ -89,27 +91,28 @@
},
data(){
return{
sendGoodsDialogIn: true,
sendSetForm: {
name: '',
orderNum: '',
content: '',
sendName: '',
sendPhone: '',
sendContent: '',
expressName: '',
expressNo: '',
remark: '',
sender: '',
senderMobile: '',
},
receiveInfo: {},
showContent: 0,
showChangeInfo: false,
rules: {
name: [
expressName: [
{ required: true, message: '请输入快递公司', trigger: "blur"},
],
orderNum: [
expressNo: [
{ required: true, message: '请输入快递单号', trigger: "blur"},
],
sendName: [
sender: [
{ required: true, message: '请输入配送员姓名', trigger: "blur"},
],
sendPhone: [
senderMobile: [
{ required: true, message: '请输入配送员手机号', trigger: "blur"},
{validator: checkMobile, trigger: ['change','blur']}
],
......@@ -122,7 +125,14 @@
mounted() {
},
watch: {},
watch: {
sendGoodsDialog(val) {
if (val) {
this.receiveInfo = this.sendSetFormData;
console.log('所传的row',this.receiveInfo)
}
},
},
methods: {
//发货
cancelSendSet() {
......@@ -131,11 +141,15 @@
submitSendSet() {
this.$refs.sendSetForm.validate((valid) => {
if (valid) {
// this.submit();
this.$message.success('操作成功')
this.$emit('closeSendSet',{type: 2})
let para = {...this.receiveInfo,...this.sendSetForm}
updateExpress(para).then(res => {
console.log('保存结果',res)
if (res.code == '000000') {
this.$message.success('操作成功')
this.$emit('closeSendSet',{type: 2})
}
});
} else {
console.log('error submit!!');
return false;
}
})
......@@ -146,6 +160,20 @@
this.showChangeInfo = true;
},
closeChangeInfo(val) {
if (val.type == 2) {//保存
let receiveData = val.data;
this.receiveInfo.provinceName = receiveData.provinceName;
this.receiveInfo.provinceId = receiveData.provinceId;
this.receiveInfo.cityName = receiveData.cityName;
this.receiveInfo.cityId = receiveData.cityId;
this.receiveInfo.countyName = receiveData.countyName;
this.receiveInfo.countyId = receiveData.countyId;
this.receiveInfo.townName = receiveData.townName;
this.receiveInfo.townId = receiveData.townId;
this.receiveInfo.address = receiveData.address;
this.receiveInfo.receiver = receiveData.receiver;
this.receiveInfo.receiverMobile = receiveData.receiverMobile;
}
this.showChangeInfo = false;
},
},
......
......@@ -35,6 +35,7 @@ export const queryOrderDetail = (orderId) => {
})
};
///trade/order/admin/query/list
//store/orders/111/express
export const queryOrderList = (params) => {
return fetch({
......@@ -44,4 +45,14 @@ export const queryOrderList = (params) => {
params: params,
description: '查询订单列表',
})
};
export const updateExpress = (params) => {
return fetch({
headers,
url: getBaseUrl(`store/orders/admin/${params.id}/express`),
method: 'post',
data: params,
description: '更新物流信息',
})
};
\ No newline at end of file
......@@ -121,7 +121,7 @@
curmbSecond: '订单管理',
jumPathThird: '/order-manage',
curmbThird: '订单详情',
orderId: 111,
orderId: null,
showStatus: null,//订单展示状态,1已完成,2已发货,3待发货,4待支付,5交易关闭
storeType: null,//店铺类型,1供应商,2医生小店,3小药房
orderDetailData: {
......
......@@ -42,19 +42,19 @@
<el-table :data="tableData" border max-height="1000" class="item-table" style="width: 100%;margin-top: 10px;">
<el-table-column prop="id" label="订单号" min-width="100" align="center"></el-table-column>
<el-table-column prop="goodsName" label="商品名称" min-width="100" align="center"></el-table-column>
<el-table-column prop="status" label="交易状态" min-width="100" align="center">
<template slot-scope="scope">
<span>{{ scope.row.status | rangeStatus }}</span>
</template>
<el-table-column prop="showStatusStr" label="交易状态" min-width="100" align="center">
<!--<template slot-scope="scope">-->
<!--<span>{{ scope.row.status | rangeStatus }}</span>-->
<!--</template>-->
</el-table-column>
<el-table-column prop="name" label="实收款" min-width="100" align="center"></el-table-column>
<el-table-column prop="name" label="买家" min-width="100" align="center"></el-table-column>
<el-table-column prop="amount" label="实收款" min-width="100" align="center"></el-table-column>
<el-table-column prop="receiver" label="买家" min-width="100" align="center"></el-table-column>
<el-table-column prop="goodsQuantity" label="数量" min-width="100" align="center"></el-table-column>
<el-table-column prop="size" label="规格" min-width="100" align="center"></el-table-column>
<el-table-column prop="price" label="单价" min-width="100" align="center"></el-table-column>
<el-table-column prop="createdTime" label="下单时间" min-width="100" align="center">
<el-table-column prop="createTime" label="下单时间" min-width="100" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createdTime | liveDateFilter }}</span>
<span>{{ scope.row.createTime | liveDateFilter }}</span>
</template>
</el-table-column>
<el-table-column prop="comments" label="备注" min-width="100" align="center"></el-table-column>
......@@ -63,10 +63,10 @@
<div>
<!--<el-button @click="closeTrade(scope.row)" type="text" size="small">关闭交易</el-button>-->
<!--<el-button @click="changePrice(scope.row)" type="text" size="small">修改价格</el-button>-->
<el-button @click="sendGoods(scope.row)" type="text" size="small">发货</el-button>
<el-button @click="distribute(scope.row)" type="text" size="small">配送</el-button>
<el-button @click="viewLogistics(scope.row)" type="text" size="small">查看物流</el-button>
<el-button @click="distributeComplete(scope.row)" type="text" size="small">配送完成</el-button>
<el-button v-if="scope.row.storeType == 1 && scope.row.showStatus == 3" @click="sendGoods(scope.row)" type="text" size="small">发货</el-button>
<el-button v-if="scope.row.storeType == 3 && scope.row.showStatus == 3" @click="distribute(scope.row)" type="text" size="small">配送</el-button>
<el-button v-if="scope.row.storeType == 1 && (scope.row.showStatus == 1 || scope.row.showStatus == 2)" @click="viewLogistics(scope.row)" type="text" size="small">查看物流</el-button>
<el-button v-if="scope.row.storeType == 3 && scope.row.showStatus == 2" @click="distributeComplete(scope.row)" type="text" size="small">配送完成</el-button>
<el-button @click="goDetail(scope.row)" type="text" size="small">查看详情</el-button>
</div>
</template>
......@@ -240,11 +240,7 @@
},
sendGoodsDialog: false,
dialogTitle: '',
sendSetForm: {
name: '',
orderNum: '',
content: '',
},
sendSetForm: {},
viewLogisticsDialog: false,
logisticeInfo: '申通快递 1234567890',
disCompleteDialog: false,
......@@ -272,6 +268,7 @@
})
},
resetForm() {
this.activeName = 'all';
this.searchForm = {
showStatus: -1,
storeId: 0,
......@@ -325,17 +322,17 @@
},
handleClick(tab, event) {
//-1全部,1已完成,2已发货,3待发货,4待支付,5交易关闭
if (tab == 'all') {//全部
if (this.activeName == 'all') {//全部
this.searchForm.showStatus = -1;
}else if (tab == 'first') {//等待买家付款
}else if (this.activeName == 'first') {//等待买家付款
this.searchForm.showStatus = 4;
}else if (tab == 'second') {//待发货
}else if (this.activeName == 'second') {//待发货
this.searchForm.showStatus = 3;
}else if (tab == 'third') {//已发货
}else if (this.activeName == 'third') {//已发货
this.searchForm.showStatus = 2;
}else if (tab == 'fourth') {//交易成功
}else if (this.activeName == 'fourth') {//交易成功
this.searchForm.showStatus = 1;
}else if (tab == 'five') {//交易关闭
}else if (this.activeName == 'five') {//交易关闭
this.searchForm.showStatus = 5;
}
this.searchForm.pageNo = 1;
......@@ -365,12 +362,13 @@
sendGoods(row) {
this.sendGoodsDialog = true;
this.dialogTitle = '发货设置';
this.sendSetForm = row;
},
closeSendSet(val) {
console.log('关闭时传递参数',val)
//保存操作
if (val.type == 2) {
this.resetForm();//更新列表
}
this.sendGoodsDialog = false;
},
......
......@@ -43,8 +43,8 @@
<i class="el-icon-delete"></i>
</div>
<div class="limit-text">
<p>限制大小: 500kb</p>
<p>最小尺寸:160*160</p>
<p>限制大小: 200kb</p>
<p>最小尺寸:128*128</p>
<p>支持jpeg, png格式</p>
</div>
</el-upload>
......@@ -57,23 +57,24 @@
size="small"
v-model="formData.storeName"
placeholder="请输入店铺名称"
maxlength="16"
style="width:85%;"
></el-input>
<span class="word-num">{{(formData.storeName).replace(/\s+/g,"").length}}/14</span>
<span class="word-num">{{(formData.storeName).replace(/\s+/g,"").length}}/16</span>
</el-col>
</el-form-item>
<el-form-item label="店铺简介" prop="storeDescription">
<el-col :span="10">
<el-input
type="textarea"
rows="2"
maxlength="40"
rows="4"
maxlength="400"
size="small"
v-model="formData.storeDescription"
placeholder="请输入店铺简介"
style="width:85%;"
></el-input>
<span class="word-num">{{(formData.storeDescription).replace(/\s+/g,"").length}}/40</span>
<span class="word-num">{{(formData.storeDescription).replace(/\s+/g,"").length}}/400</span>
</el-col>
</el-form-item>
<el-form-item label="店铺类型" prop="storeType">
......@@ -82,6 +83,7 @@
placeholder="请选择店铺类型"
size="small"
clearable
:disabled="isDisabled"
>
<el-option
v-for="(item,index) in typeList"
......@@ -430,6 +432,7 @@
return{
curmbFirst: '云鹊店铺',
curmbSecond: '新建店铺',
isDisabled: false,
storeData: {},
typeList: [
{
......@@ -533,20 +536,14 @@
{ required: true, message: "请输入店铺名称", trigger: "blur" },
{
min: 2,
max: 14,
message: "输入长度为2-14的内容,可包含中英文、数字及特殊符号",
max: 16,
message: "输入长度为2-16的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
{ validator: checkProjectStr, trigger: "blur" }
],
storeDescription: [
{ required: false, message: "请输入店铺简介", trigger: "blur" },
{
min: 2,
max: 40,
message: "输入长度为2-40的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
{ validator: checkProjectStr, trigger: "blur" }
],
storeType: [
......@@ -597,15 +594,18 @@
vm = this;
this.formData.storeId = this.$route.query.storeId || null;
this.storeData = this.$route.query.storeData || {};
if (this.storeData) {
this.storeData = JSON.parse(this.storeData);
}
// if (this.formData.storeId) {
// this.storeData = JSON.parse(this.storeData);
// }
if (this.formData.storeId) {
this.curmbSecond = '编辑店铺';
this.storeData = JSON.parse(this.storeData);
this.isDisabled = true;
// this.initInfo();
this.getStoreInfo();
}else {
this.curmbSecond = '新建店铺';
this.isDisabled = false;
}
},
methods: {
......@@ -858,14 +858,14 @@
beforeUploadPic1(file) {
this.currentOption.aspectRatio = 1/1;
this.currentOption.cropBoxResizable = true;
this.currentOption.minCropBoxWidth = 160;
this.currentOption.minCropBoxHeight = 160;
this.currentOption.minCropBoxWidth = 128;
this.currentOption.minCropBoxHeight = 128;
this.currentOption.currentPic = 'storeLogo';
let fileLimit = {
width: 160,
height: 160,
size: 0.5,
sizeText: "500K",
width: 128,
height: 128,
size: 0.2,
sizeText: "200K",
key: "storeLogo",
more: "imgUrl1More",
show: "uploadImgMessage1"
......@@ -881,8 +881,8 @@
let fileLimit = {
width: 160,
height: 160,
size: 0.5,
sizeText: "500K",
size: 3,
sizeText: "3M",
key: type,
more: "imgUrlP1More",
};
......
......@@ -44,7 +44,7 @@
<span>{{ scope.row.tradeStore.id }}</span>
</template>
</el-table-column>
<el-table-column prop="storeName" label="店铺名称" min-width="100" align="center">
<el-table-column prop="storeName" label="店铺名称" min-width="100" align="center" show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.tradeStore.storeName }}</span>
</template>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册