|
|
@@ -778,7 +778,7 @@ import {getCitys} from "@/api/store/city";
|
|
|
},
|
|
|
handlePhone(){
|
|
|
const orderId = this.item.orderId;
|
|
|
- getOrderUserPhone(orderId).then(response =>{
|
|
|
+ return getOrderUserPhone(orderId).then(response =>{
|
|
|
this.item.userPhone = response.userPhone;
|
|
|
})
|
|
|
},
|
|
|
@@ -897,47 +897,49 @@ import {getCitys} from "@/api/store/city";
|
|
|
});
|
|
|
},
|
|
|
editOrder() {
|
|
|
- this.edit.open = true;
|
|
|
- this.editForm.orderId = this.item.orderId;
|
|
|
- this.editForm.remark = this.item.remark;
|
|
|
-
|
|
|
- // 先设置其他同步的字段
|
|
|
- this.editForm.userPhone = this.item.userPhone != null ? this.item.userPhone.toString() : "";
|
|
|
- this.editForm.status = this.item.status != null ? this.item.status.toString() : "";
|
|
|
- this.editForm.deliveryType = this.item.deliveryType;
|
|
|
- this.editForm.deliveryStatus = this.item.deliveryStatus;
|
|
|
- this.payMoney= this.item.payMoney;
|
|
|
- this.payRemain = this.item.payRemain;
|
|
|
- this.payPrice= this.item.payPrice;
|
|
|
- // 等城市数据加载后再解析地址
|
|
|
- const currentAddress = (this.item.userAddress || "").toString().trim();
|
|
|
- this.getCitys().then(() => {
|
|
|
- if (!currentAddress) {
|
|
|
- this.cityIds = [];
|
|
|
- this.editForm.userAddress = "";
|
|
|
- return;
|
|
|
- }
|
|
|
+ this.handlePhone().then((res)=>{
|
|
|
+ this.edit.open = true;
|
|
|
+ this.editForm.orderId = this.item.orderId;
|
|
|
+ this.editForm.remark = this.item.remark;
|
|
|
+
|
|
|
+ // 先设置其他同步的字段
|
|
|
+ this.editForm.userPhone = this.item.userPhone != null ? this.item.userPhone.toString() : "";
|
|
|
+ this.editForm.status = this.item.status != null ? this.item.status.toString() : "";
|
|
|
+ this.editForm.deliveryType = this.item.deliveryType;
|
|
|
+ this.editForm.deliveryStatus = this.item.deliveryStatus;
|
|
|
+ this.payMoney= this.item.payMoney;
|
|
|
+ this.payRemain = this.item.payRemain;
|
|
|
+ this.payPrice= this.item.payPrice;
|
|
|
+ // 等城市数据加载后再解析地址
|
|
|
+ const currentAddress = (this.item.userAddress || "").toString().trim();
|
|
|
+ this.getCitys().then(() => {
|
|
|
+ if (!currentAddress) {
|
|
|
+ this.cityIds = [];
|
|
|
+ this.editForm.userAddress = "";
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- // 假设格式为:省 市 区 详细地址(空格分隔)
|
|
|
- const parts = currentAddress.split(/\s+/);
|
|
|
- const detail = parts.pop() || ""; // 最后一段作为详细地址
|
|
|
- const provLabel = parts[0];
|
|
|
- const cityLabel = parts[1];
|
|
|
- const areaLabel = parts[2];
|
|
|
+ // 假设格式为:省 市 区 详细地址(空格分隔)
|
|
|
+ const parts = currentAddress.split(/\s+/);
|
|
|
+ const detail = parts.pop() || ""; // 最后一段作为详细地址
|
|
|
+ const provLabel = parts[0];
|
|
|
+ const cityLabel = parts[1];
|
|
|
+ const areaLabel = parts[2];
|
|
|
|
|
|
- const province = this.citys.find(p => p.label === provLabel);
|
|
|
- const city = province?.children?.find(c => c.label === cityLabel);
|
|
|
- const area = city?.children?.find(a => a.label === areaLabel);
|
|
|
+ const province = this.citys.find(p => p.label === provLabel);
|
|
|
+ const city = province?.children?.find(c => c.label === cityLabel);
|
|
|
+ const area = city?.children?.find(a => a.label === areaLabel);
|
|
|
|
|
|
- if (province && city && area) {
|
|
|
- this.cityIds = [province.value, city.value, area.value];
|
|
|
- } else {
|
|
|
- console.warn("未匹配到完整省市区:", { provLabel, cityLabel, areaLabel });
|
|
|
- this.cityIds = [];
|
|
|
- }
|
|
|
- // 把详细地址写回到输入框(只保留详细地址,不含省市区)
|
|
|
- this.editForm.userAddress = detail;
|
|
|
- });
|
|
|
+ if (province && city && area) {
|
|
|
+ this.cityIds = [province.value, city.value, area.value];
|
|
|
+ } else {
|
|
|
+ console.warn("未匹配到完整省市区:", { provLabel, cityLabel, areaLabel });
|
|
|
+ this.cityIds = [];
|
|
|
+ }
|
|
|
+ // 把详细地址写回到输入框(只保留详细地址,不含省市区)
|
|
|
+ this.editForm.userAddress = detail;
|
|
|
+ });
|
|
|
+ })
|
|
|
},
|
|
|
updateExpress(){
|
|
|
var that=this;
|