|
@@ -293,7 +293,8 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="16" v-if="OrderForm.type == 'TO_C' && id">
|
|
|
- <el-form-item label="交通费明细:" prop="real_price">
|
|
|
+ <el-form-item label="交通费汇总:" prop="real_price">
|
|
|
+ <span>{{ '¥' + TO_Cmoney }} </span>
|
|
|
<el-button @click="reimList">查看明细</el-button>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -766,6 +767,7 @@ export default {
|
|
|
money: "",
|
|
|
file_url: ''
|
|
|
},
|
|
|
+ TO_Cmoney: 0//交通费汇总
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -789,6 +791,7 @@ export default {
|
|
|
API_Order.editOrderCustomerFee(this.reimburForm, this.reimburForm.id).then(res => {
|
|
|
this.$message.success('修改成功!')
|
|
|
this.reimburVisible = false
|
|
|
+ this.GET_OrderDetail();
|
|
|
})
|
|
|
},
|
|
|
handleAvatarSuccess(res, file) {
|
|
@@ -796,16 +799,14 @@ export default {
|
|
|
// this.reimburForm.file_url = URL.createObjectURL(file.raw);
|
|
|
},
|
|
|
beforeAvatarUpload(file) {
|
|
|
- const isJPG = file.type === 'image/jpeg';
|
|
|
const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
-
|
|
|
- if (!isJPG) {
|
|
|
- this.$message.error('上传头像图片只能是 JPG 格式!');
|
|
|
- }
|
|
|
+ /* if (!isJPG) {isJPG && const isJPG = file.type === 'image/jpeg';
|
|
|
+ this.$message.error('上传头像图片只能是 JPG 格式!');
|
|
|
+ } */
|
|
|
if (!isLt2M) {
|
|
|
this.$message.error('上传头像图片大小不能超过 2MB!');
|
|
|
}
|
|
|
- return isJPG && isLt2M;
|
|
|
+ return isLt2M;
|
|
|
},
|
|
|
/* 修改 */
|
|
|
editReim(row) {
|
|
@@ -836,10 +837,11 @@ export default {
|
|
|
},
|
|
|
// 租赁时间
|
|
|
timeChange(val) {
|
|
|
+
|
|
|
let start = new Date(val[1]); // 将起始日期字符串转换为Date对象
|
|
|
let end = new Date(val[0]); // 将结束日期字符串转换为Date对象
|
|
|
let timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
|
|
|
- this.monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000));
|
|
|
+ this.monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000))+1;
|
|
|
this.OrderForm.product_list.map(el => {
|
|
|
el.day_num = this.monthDiff
|
|
|
})
|
|
@@ -993,11 +995,11 @@ export default {
|
|
|
this.customer.dialogVisible = true;
|
|
|
},
|
|
|
handleChange(value) {
|
|
|
- /* const city = value[value.length - 2]; // 获取当前市的代码
|
|
|
- const cityName = codeToText[city]; // 根据代码获取市的名称
|
|
|
- const loc = value.map((code) => codeToText[code]).join(","); // 拼接地址字符串
|
|
|
- this.OrderForm.province_city_area_address = loc.replace("市辖区", cityName); // 更新地址字段,替换市辖区为市名称*/
|
|
|
- this.OrderForm.province_city_area = value.join(",");
|
|
|
+ /* const city = value[value.length - 2]; // 获取当前市的代码
|
|
|
+ const cityName = codeToText[city]; // 根据代码获取市的名称
|
|
|
+ const loc = value.map((code) => codeToText[code]).join(","); // 拼接地址字符串
|
|
|
+ this.OrderForm.province_city_area_address = loc.replace("市辖区", cityName); // 更新地址字段,替换市辖区为市名称*/
|
|
|
+ this.OrderForm.province_city_area = value.join(",");
|
|
|
//打印区域码所对应的属性值即中文地址
|
|
|
},
|
|
|
/** 初始化 */
|
|
@@ -1316,7 +1318,7 @@ export default {
|
|
|
}
|
|
|
const { id } = this.OrderForm;
|
|
|
//设置时间
|
|
|
- /* */ delete this.OrderForm.start_time;
|
|
|
+ delete this.OrderForm.start_time;
|
|
|
delete this.OrderForm.end_time;
|
|
|
if (this.time) {
|
|
|
this.OrderForm.start_time = this.time[0];
|
|
@@ -1329,7 +1331,7 @@ export default {
|
|
|
}
|
|
|
this.OrderForm.province_city_area_address = loc + this.OrderForm.address;
|
|
|
const params = this.MixinClone(this.OrderForm);
|
|
|
-
|
|
|
+ params.reduction = this.discount
|
|
|
params.pay_price = this.price;
|
|
|
params.real_price = Number(params.real_price);
|
|
|
params.item_list = params.product_list;
|
|
@@ -1437,15 +1439,19 @@ export default {
|
|
|
GET_OrderDetail() {
|
|
|
API_Order.getOrderDetail(this.id).then((response) => {
|
|
|
/**/ this.price = response.pay_price;
|
|
|
+ this.discount = response.reduction
|
|
|
this.barcodeValue = response.sn
|
|
|
response.product_list = response.item_list.map(el => {
|
|
|
el.good_vo = el.goods_vo
|
|
|
return el
|
|
|
});
|
|
|
if (response.type == "TO_C") {
|
|
|
+ let moneyToc = 0
|
|
|
response.order_customer_fees.map(el => {
|
|
|
- this.totalAmount += el.money + response.real_price
|
|
|
+ moneyToc += el.money
|
|
|
})
|
|
|
+ this.TO_Cmoney = moneyToc
|
|
|
+ this.totalAmount = moneyToc + response.real_price
|
|
|
}
|
|
|
|
|
|
this.selectedOptions = response.province_city_area.split(",");
|
|
@@ -1459,7 +1465,6 @@ export default {
|
|
|
if (response.type == "TO_C") {
|
|
|
this.time.push(response.start_time);
|
|
|
this.time.push(response.end_time);
|
|
|
-
|
|
|
}
|
|
|
/* if (this.OrderForm.payment_time) {
|
|
|
this.OrderForm.payment_time = Math.floor(
|
|
@@ -1563,6 +1568,13 @@ export default {
|
|
|
this.OrderForm.real_price = this.price * newVal / 10;
|
|
|
},
|
|
|
},
|
|
|
+ price: {
|
|
|
+ deep: true,
|
|
|
+ handler(newVal) {
|
|
|
+ this.OrderForm.real_price = newVal * this.discount / 10;
|
|
|
+ this.totalAmount = this.TO_Cmoney + this.OrderForm.real_price
|
|
|
+ },
|
|
|
+ },
|
|
|
"OrderForm.product_list": {
|
|
|
deep: true,
|
|
|
handler(newVal) {
|