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

订单管理联调2

上级 e087cd4b
......@@ -9,10 +9,10 @@
class="send-set-body">
<el-form ref="changeInfoForm" :model="changeInfoForm" :rules="rules" label-width="90px" label-suffix=":">
<el-form-item label="收货人" prop="receiver">
<el-input type="text" v-model="changeInfoForm.receiver" placeholder="请输入收货人姓名"></el-input>
<el-input type="text" v-model="changeInfoForm.receiver" placeholder="请输入收货人姓名" style="width: 100%"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="receiverMobile">
<el-input type="text" v-model="changeInfoForm.receiverMobile" maxlength="11" placeholder="请输入收货人手机号"></el-input>
<el-input type="text" v-model="changeInfoForm.receiverMobile" maxlength="11" placeholder="请输入收货人手机号" style="width: 100%"></el-input>
</el-form-item>
<el-form-item label="所在地区" prop="area">
<el-cascader
......@@ -65,7 +65,7 @@
changeInfoForm: {
receiver: '',
receiverMobile: '',
area: '',
area: [],
address: '',
provinceName: '',
cityName: '',
......@@ -80,7 +80,70 @@
cityList: [],
countyList: [],
townList: [],
region: [],
props: {
value: "id",
label: "name",
children: "children",
lazy: true,
lazyLoad(node, resolve) {
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.id
};
vm.GET("basic-data/position/cities", req).then(res => {
let newData = res.data.cityList;
vm.cityList = res.data.cityList;
newData.map(item => {
vm.$set(item, "id", item.cityId);
vm.$set(item, "name", item.cityName);
vm.$set(item, "children", []);
});
// console.log("newData", newData);
resolve(newData);
});
} else if (node.level == 2) {
vm.changeInfoForm.cityName = node.data.label;
vm.changeInfoForm.cityId = node.data.value;
let req = {
cityId: node.data.id
};
vm.GET("basic-data/position/counties", req).then(res => {
let newData = res.data.countyList;
vm.countyList = res.data.countyList;
newData.map(item => {
vm.$set(item, "id", item.countyId);
vm.$set(item, "name", item.countyName);
vm.$set(item, "children", []);
});
// console.log("newData", newData);
resolve(newData);
});
} else if (node.level == 3) {
vm.changeInfoForm.countyName = node.data.label;
vm.changeInfoForm.countyId = node.data.value;
let req = {
countyId: node.data.id
};
vm.GET("basic-data/position/towns", req).then(res => {
let newData = res.data.townList;
vm.townList = res.data.townList;
newData.map(item => {
vm.$set(item, "id", item.townId);
vm.$set(item, "name", item.townName);
vm.$set(item, "leaf", true);
});
// console.log("newData", newData);
resolve(newData);
});
}
}
},
/*props: {
lazy: true,
lazyLoad(node, resolve) {
//第一个参数node为当前点击的节点,第二个resolve为数据加载完成的回调(必须调用)
......@@ -121,14 +184,14 @@
});
}
}
},
},*/
rules: {
receiver: [
{ required: true, message: '请输入收货人姓名', trigger: "blur"},
],
receiverMobile: [
{ required: true, message: '请输入收货人手机号', trigger: "blur"},
{validator: checkMobile, trigger: ['change','blur']}
{validator: checkMobile, trigger: 'blur'}
],
area: [
{ required: true, message: '请选择所在地区', trigger: "blur"},
......@@ -141,18 +204,44 @@
},
created() {
vm = this;
this.initData();
this.getRegionOption();
},
methods: {
initData() {
async initData() {
await this.getRegionOption()
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 = {
this.changeInfoForm.provinceId = provinceId;
this.changeInfoForm.provinceName = provinceName;
this.changeInfoForm.cityId = cityId;
this.changeInfoForm.cityName = cityName;
this.changeInfoForm.countyId = countyId;
this.changeInfoForm.countyName = countyName;
this.changeInfoForm.townId = townId;
this.changeInfoForm.townName = townName;
//对地区数据做回显处理
if(provinceId) {
this.changeInfoForm.area = [Number(provinceId), Number(cityId), Number(countyId), Number(townId)];
// if(provinceId) {
await this.getCity(provinceId);
// }
if(cityId) {
await this.getCounty(provinceId, cityId);
}
if(countyId) {
await this.getTown(provinceId, cityId, countyId);
}
this.$forceUpdate();
}else {
this.changeInfoForm.area = [];
}
console.log('传入值处理后',this.changeInfoForm)
/*let arrayLike = {
0: provinceId,
1: cityId,
2: countyId,
......@@ -160,8 +249,7 @@
'length': 4
}
let arr = Array.from(arrayLike)
console.log('初始化后的值',arr);
this.changeInfoForm.area = arr;
console.log('初始化后的值',arr);*/
},
handleChange(value) {
let areaId = "000";
......@@ -171,21 +259,103 @@
this.administrativeValue = areaId;
console.log('修改后的值',value, this.administrativeValue);
// 000_110_110100000000_110101000000_110101001000
setTimeout(function() {
let region = vm.$refs["cascaderRegion"].inputValue;
vm.region = region.split(" / ");
// console.log("vm.region",vm.region)
},20)
},
//获取地区
getRegionOption() {
async getRegionOption() {
let req = {};
openLoading(vm);
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)
// openLoading(vm);
// 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)
// }
// });
vm.GET("basic-data/position/provinces", req).then((data) => {
if(data.code == '000000') {
this.provinceList = data.data.provinceList;
this.provinceList.map(item => {
this.$set(item, "id", item.provinceId);
this.$set(item, "name", item.provinceName);
this.$set(item, "children", []);
});
this.optionsRegion = this.provinceList;
// this.$forceUpdate();
}
})
},
async getCity(provinceId) {
await vm.GET("basic-data/position/cities", {provinceId: provinceId}).then((data) => {
if(data.code == '000000') {
this.cityList = data.data.cityList;
this.cityList.map(item => {
this.$set(item, "id", item.cityId);
this.$set(item, "name", item.cityName);
this.$set(item, "children", []);
});
this.optionsRegion.map((item, index) => {
if(item.id == provinceId) {
item.children = this.cityList;
}
})
}
})
},
async getCounty(provinceId, cityId) {
await vm.GET("basic-data/position/counties", {cityId: cityId}).then((data) => {
if(data.code == '000000') {
this.countyList = data.data.countyList;
this.countyList.map(item => {
this.$set(item, "id", item.countyId);
this.$set(item, "name", item.countyName);
this.$set(item, "children", []);
});
this.optionsRegion.map((item, index) => {
if(item.id == provinceId) {
item.children.map((city, idx) => {
if(city.id == cityId) {
city.children = this.countyList;
}
})
}
})
}
})
},
async getTown(provinceId, cityId, countyId) {
await vm.GET("basic-data/position/towns", {countyId: countyId}).then((data) => {
if(data.code == '000000') {
this.townList = data.data.townList;
this.townList.map(item => {
this.$set(item, "id", item.townId);
this.$set(item, "name", item.townName);
this.$set(item, "leaf", true);
});
this.optionsRegion.map((item, index) => {
if(item.id == provinceId) {
item.children.map((city, index2) => {
if(city.id == cityId) {
city.children.map((county, index3) => {
if(county.id == countyId) {
county.children = this.townList;
}
})
}
})
}
})
}
})
},
setMoreOption(data, type) {
let option = [];
......@@ -210,20 +380,35 @@
cancelChangeInfo() {
this.$emit('closeChangeInfo',{type: 1})
},
setAreaData() {
if(this.changeInfoForm.area.length > 0) {
this.changeInfoForm.provinceId = this.changeInfoForm.area[0];
this.changeInfoForm.cityId = this.changeInfoForm.area[1];
this.changeInfoForm.countyId = this.changeInfoForm.area[2];
this.changeInfoForm.townId = this.changeInfoForm.area[3];
if (vm.region.length) {
this.changeInfoForm.provinceName = vm.region[0];
this.changeInfoForm.cityName = vm.region[1];
this.changeInfoForm.countyName = vm.region[2];
this.changeInfoForm.townName = vm.region[3];
}
}
},
submitChange() {
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;
}
})
}
this.setAreaData();
// 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 {
......
......@@ -14,8 +14,8 @@
</div>
<div class="address-info">
<!--<p>{{receiveInfo.receiverAddr}}</p>-->
<p>{{receiveInfo.provinceName}}{{receiveInfo.cityName}}{{receiveInfo.countyName}}{{receiveInfo.townName}}{{receiveInfo.address}}</p>
<p>{{receiveInfo.receiver}} {{receiveInfo.receiverMobile}}</p>
<p>{{setReceiveInfo.provinceName}}{{setReceiveInfo.cityName}}{{setReceiveInfo.countyName}}{{setReceiveInfo.townName}}{{setReceiveInfo.address}}</p>
<p>{{setReceiveInfo.receiver}} {{setReceiveInfo.receiverMobile}}</p>
</div>
</div>
<div v-if="dialogTitle == '发货设置'">
......@@ -61,7 +61,7 @@
<el-button size="small" type="primary" @click="submitSendSet">完成</el-button>
</span>
</el-dialog>
<change-info v-if="showChangeInfo" @closeChangeInfo="closeChangeInfo" :receiveInfo="receiveInfo"></change-info>
<change-info v-if="showChangeInfo" @closeChangeInfo="closeChangeInfo" :receiveInfo="setReceiveInfo"></change-info>
</div>
</template>
<script>
......@@ -99,7 +99,21 @@
sender: '',
senderMobile: '',
},
receiveInfo: {},
receiveInfo: {
receiver: '',
receiverMobile: '',
area: [],
address: '',
provinceName: '',
cityName: '',
countyName: '',
townName: '',
provinceId: null,
cityId: null,
countyId: null,
townId: null,
},
setReceiveInfo: {},
showContent: 0,
showChangeInfo: false,
rules: {
......@@ -129,24 +143,35 @@
sendGoodsDialog(val) {
if (val) {
this.receiveInfo = this.sendSetFormData;
console.log('所传的row',this.receiveInfo)
this.setReceiveInfo = Object.assign({}, this.sendSetFormData);
// console.log('当前订单详情数据',this.receiveInfo)
}
},
},
methods: {
//发货
cancelSendSet() {
this.$refs.sendSetForm.resetFields();
this.sendSetForm.remark = '';
this.$emit('closeSendSet',{type: 1})
},
submitSendSet() {
this.$refs.sendSetForm.validate((valid) => {
if (valid) {
let para = {...this.receiveInfo,...this.sendSetForm}
let para = {...this.setReceiveInfo,...this.sendSetForm};
if (this.dialogTitle == '发货设置') {//发货设置的type是1,配送设置的type是2,配送完成的type是3
para.type = 1;
}else if (this.dialogTitle == '配送设置') {
para.type = 2;
}
updateExpress(para).then(res => {
console.log('保存结果',res)
if (res.code == '000000') {
this.$message.success('操作成功')
this.$refs.sendSetForm.resetFields();
this.sendSetForm.remark = '';
this.$emit('closeSendSet',{type: 2})
}else {
this.$message.error('操作失败,请重试')
}
});
} else {
......@@ -162,17 +187,17 @@
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.setReceiveInfo.provinceName = receiveData.provinceName;
this.setReceiveInfo.provinceId = receiveData.provinceId;
this.setReceiveInfo.cityName = receiveData.cityName;
this.setReceiveInfo.cityId = receiveData.cityId;
this.setReceiveInfo.countyName = receiveData.countyName;
this.setReceiveInfo.countyId = receiveData.countyId;
this.setReceiveInfo.townName = receiveData.townName;
this.setReceiveInfo.townId = receiveData.townId;
this.setReceiveInfo.address = receiveData.address;
this.setReceiveInfo.receiver = receiveData.receiver;
this.setReceiveInfo.receiverMobile = receiveData.receiverMobile;
}
this.showChangeInfo = false;
},
......
......@@ -56,3 +56,14 @@ export const updateExpress = (params) => {
description: '更新物流信息',
})
};
export const queryShopAuth = (params) => {
return fetch({
headers,
url: getBaseUrl(`user/storeid`),
method: 'get',
params: params,
description: '查询超级管理员权限',
})
};
\ No newline at end of file
......@@ -66,12 +66,12 @@
</el-card>
</div>
<el-table :data="tableData" border class="item-table" style="width: 100%;margin-top: 30px;">
<el-table-column prop="goodsName" label="商品名称" min-width="100" align="center"></el-table-column>
<el-table-column prop="size" label="规格" min-width="100" align="center">
<!--<template slot-scope="scope">-->
<!--<span>{{ scope.row.type | dynamicFlagStatus }}</span>-->
<!--</template>-->
<el-table-column prop="goodsName" label="商品名称" min-width="100" align="center">
<template slot-scope="scope">
<div style="cursor: pointer;color: #449284" @click="goGoodsEdit(scope.row)">{{ scope.row.goodsQuantity }}</div>
</template>
</el-table-column>
<el-table-column prop="size" label="规格" min-width="100" align="center"></el-table-column>
<el-table-column prop="goodsQuantity" label="数量" min-width="100" align="center">
<template slot-scope="scope">
<span>×{{ scope.row.goodsQuantity }}</span>
......@@ -168,6 +168,7 @@
},
showSendDialog() {
this.sendGoodsDialog = true;
this.sendSetForm = this.orderDetailData;
if (this.storeType == 1) {
this.dialogTitle = '发货设置'
}else {
......@@ -175,13 +176,22 @@
}
},
closeSendSet(val) {
console.log('关闭时传递参数',val)
//保存操作
if (val.type == 2) {
this.init();
}
this.sendGoodsDialog = false;
},
//跳转至商品编辑页
goGoodsEdit(row) {
this.$store.dispatch('goodsManage/changeGoodsInfo', {...row});
this.$router.push({
path: '/create-good',
query: {
id: row.id
}
})
},
},
}
</script>
......
<template>
<div class="order-manage-wrapper">
<bread-crumb :curmbFirst="curmbFirst"></bread-crumb>
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="order-manage-content screenSet" id="screenSet">
<div class="header-title">订单管理</div>
<el-form ref="searchForm" :model="searchForm" label-width="80px" label-suffix=":" :inline="true">
......@@ -188,7 +188,7 @@
// import { openLoading, closeLoading } from "../../utils/utils";
import BreadCrumb from "@/components/breadcrumb.vue";
import SendSetDialog from "@/components/shop/send-set-dialog";
import { queryOrderList } from "@/utils/shop";
import { queryOrderList, updateExpress } from "@/utils/shop";
export default {
components: {
SendSetDialog,
......@@ -196,7 +196,8 @@
},
data(){
return{
curmbFirst: '订单管理',
curmbFirst: '店铺管理',
curmbSecond: '订单管理',
activeName: 'all',
showAllFlag: false,
showNewFlag: false,
......@@ -242,8 +243,9 @@
dialogTitle: '',
sendSetForm: {},
viewLogisticsDialog: false,
logisticeInfo: '申通快递 1234567890',
logisticeInfo: '',//复制物流信息
disCompleteDialog: false,
disCompleteData: {},
rules: {
name: [
{ required: true, message: '请输入快递公司', trigger: "blur"},
......@@ -260,7 +262,6 @@
methods: {
searchList(){
queryOrderList(this.searchForm).then(res => {
console.log('查询结果',res)
if (res.code == '000000') {
this.tableData = res.data.orderSingleDtoList;
this.totalRows = res.data.totalNum;
......@@ -281,36 +282,6 @@
};
this.searchList();
},
//上线
publishRange(row) {
this.$confirm(`确定上线“${row.name}”吗?`, '', {
confirmButtonText: '上线',
cancelButtonText: '取消',
type: 'warning',
customClass: 'range-make-box',
}).then(() => {
// confirm
this.updateStatus(row.id, "30");
}).catch(() => {
// cancel
// this.$message.error("上线失败");
});
},
//下线
unPublishRange(row) {
this.$confirm(`确定下线“${row.name}”吗?`, '', {
confirmButtonText: '下线',
cancelButtonText: '取消',
type: 'warning',
customClass: 'range-make-box',
}).then(() => {
this.updateStatus(row.id, "40");
// confirm
}).catch(() => {
// cancel
});
},
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.searchForm.pageNo = 1;
......@@ -365,7 +336,6 @@
this.sendSetForm = row;
},
closeSendSet(val) {
console.log('关闭时传递参数',val)
//保存操作
if (val.type == 2) {
this.resetForm();//更新列表
......@@ -376,10 +346,12 @@
distribute(row) {
this.sendGoodsDialog = true;
this.dialogTitle = '配送设置';
this.sendSetForm = row;
},
//查看物流
viewLogistics(row) {
this.viewLogisticsDialog = true;
this.logisticeInfo = `${row.expressName} ${row.expressNo}`;
},
cancelView() {
this.viewLogisticsDialog = false;
......@@ -416,12 +388,24 @@
//配送完成
distributeComplete(row) {
this.disCompleteDialog = true;
this.disCompleteData = row;
},
cancelDis() {
this.disCompleteDialog = false;
},
//确认配送完成
submitDisComplete() {
let para = this.disCompleteData;
para.type = 3;
updateExpress(para).then(res => {
if (res.code == '000000') {
this.$message.success('操作成功')
this.disCompleteDialog = false;
this.resetForm();//更新列表
}else {
this.$message.error('操作失败,请重试')
}
});
},
//查看详情
goDetail(row) {
......
......@@ -870,17 +870,17 @@
more: "imgUrl1More",
show: "uploadImgMessage1"
};
this.beforeUpload(file, fileLimit);
this.beforeUpload1(file, fileLimit);
},
setOption(type) {
this.currentOption.aspectRatio = 1/1;
this.currentOption.cropBoxResizable = true;
this.currentOption.minCropBoxWidth = 160;
this.currentOption.minCropBoxHeight = 160;
this.currentOption.currentPic = type;
// this.currentOption.aspectRatio = 1/1;
// this.currentOption.cropBoxResizable = true;
// this.currentOption.minCropBoxWidth = 160;
// this.currentOption.minCropBoxHeight = 160;
// this.currentOption.currentPic = type;
let fileLimit = {
width: 160,
height: 160,
width: '',
height: '',
size: 3,
sizeText: "3M",
key: type,
......@@ -912,8 +912,44 @@
let fileLimit = this.setOption('imgUrlC3');
this.beforeUpload(file, fileLimit);
},
//上传图片
beforeUpload(file, fileLimit) {
let vm = this;
const isJPG = file.type === "image/jpeg";
const isPNG = file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
if (!isJPG && !isPNG) {
vm.$message.error("图片格式不符合规范,请根据规范上传图片");
return;
}
if (!isLt2M) {
vm.$message.error("图片大小不符合规范,请根据规范上传图片 ");
return;
}
let _img = new FileReader();
_img.readAsDataURL(file);
_img.onload = function (theFile) {
let image = new Image()
image.src = theFile.target.result
vm.slide2.oriUrl = theFile.target.result;
image.onload = function () {
let _this = this;
openLoading(vm);
doUpload(vm, file, getFilePath(file, null), "preview4", "progress1", 1).then(function (path) {
closeLoading(vm);
vm.formData[fileLimit.key] = path.fullPath;
vm.formData[fileLimit.more] = {
attachmentName: path.storeName,
attachmentExt: path.ext,
attachmentSize: path.size
};
vm.$message.success("上传成功");
});
};
};
return isJPG && isLt2M;
},
//上传图片
beforeUpload1(file, fileLimit) {
let vm = this;
const isJPG = file.type === "image/jpeg";
const isPNG = file.type === "image/png";
......
......@@ -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" show-overflow-tooltip="true">
<el-table-column prop="storeName" label="店铺名称" min-width="100" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ scope.row.tradeStore.storeName }}</span>
</template>
......@@ -97,7 +97,7 @@
<script>
import { openLoading, closeLoading } from "../../utils/utils";
import BreadCrumb from "@/components/breadcrumb.vue";
import { queryStore } from '@/utils/shop';
import { queryStore, queryShopAuth } from '@/utils/shop';
export default {
components: {
BreadCrumb
......@@ -133,9 +133,15 @@
},
created() {
// this.initPrivilege();
this.getAddAuth();
this.searchList();
},
methods: {
getAddAuth() {
queryShopAuth().then(res => {
console.log('权限接口',res)
})
},
initPrivilege(){
let idType = localStorage.getItem('storageIdType');
this.searchForm.userType = idType;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册