|
@@ -122,6 +122,16 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="税点:" prop="tax_rate" :rules="rules.tax_rate">
|
|
|
+ <el-select v-model="OrderForm.tax_rate" clearable :disabled="type == 'pone'">
|
|
|
+ <el-option label="0" :value="0" />
|
|
|
+ <el-option label="1%" :value="1" />
|
|
|
+ <el-option label="6%" :value="6" />
|
|
|
+ <el-option label="13%" :value="13" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="24">
|
|
|
<div class="redClass">
|
|
|
<el-form-item label="备注:" prop="remark">
|
|
@@ -163,11 +173,11 @@
|
|
|
</el-popover>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="商品编号">
|
|
|
+ <!-- <el-table-column label="商品编号">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.goods_vo.sn }}
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column label="商品名称">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.goods_vo.name }}
|
|
@@ -202,9 +212,14 @@
|
|
|
<el-input v-model="scope.row.num" type="number" :min="0" :maxlength="20"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="库存数量">
|
|
|
+ <el-table-column label="日租金" v-if="OrderForm.type == 'TO_C'">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.usable_stock }}
|
|
|
+ {{ scope.row.product_vo.day_price }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="折扣">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.reduction" type="number" :min="0" :maxlength="20"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="租赁天数" v-if="OrderForm.type == 'TO_C'">
|
|
@@ -212,6 +227,11 @@
|
|
|
<el-input v-model="scope.row.day_num" type="number" :min="0" :maxlength="20"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="总价">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.item_money }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<!-- <el-table-column label="结束时间" width="200" v-if="OrderForm.type == 'TO_C'">
|
|
|
<template slot-scope="scope">
|
|
|
<el-date-picker style="width: 170px;" v-model="scope.row.end_time" type="datetime" placeholder="选择日期时间"
|
|
@@ -293,7 +313,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="折扣:" prop="">
|
|
|
- <el-input placeholder="请输入" v-model="discount" @blur="handleBlur" :disabled="type == 'pone'">
|
|
|
+ <el-input placeholder="请输入" v-model="discount" @blur="handleBlur" :disabled="true">
|
|
|
<template slot="append">折</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
@@ -438,7 +458,8 @@
|
|
|
<el-table-column prop="money" label="金额"> </el-table-column>
|
|
|
<el-table-column prop="file_url" label="图片">
|
|
|
<template slot-scope="scope">
|
|
|
- <img :src="scope.row.file_url" alt="" @click="showImage(scope.row.file_url)" style="width: 60px;height: 60px">
|
|
|
+ <img :src="scope.row.file_url" alt="" @click="showImage(scope.row.file_url)"
|
|
|
+ style="width: 60px;height: 60px">
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作">
|
|
@@ -585,6 +606,7 @@ export default {
|
|
|
payment_status: [this.MixinRequired("支付状态不能为空", "change")],
|
|
|
payment_time: [this.MixinRequired("支付时间不能为空", "change")],
|
|
|
real_price: [this.MixinRequired("请输入实付金额", "blur")],
|
|
|
+ tax_rate: [this.MixinRequired("请选择税点", "change")],
|
|
|
// delivery_type: [this.MixinRequired("请选择配送方式", "change")],
|
|
|
product_list: {
|
|
|
num: [
|
|
@@ -750,7 +772,7 @@ export default {
|
|
|
options: [],
|
|
|
},
|
|
|
//折扣
|
|
|
- discount: 0,
|
|
|
+ discount: 10,
|
|
|
pickerOptions: {
|
|
|
disabledDate(v) {
|
|
|
return v.getTime() < new Date().getTime() - 86400000;// - 86400000是否包括当天
|
|
@@ -1501,13 +1523,13 @@ export default {
|
|
|
if (!this.OrderForm.product_list) return
|
|
|
if (!this.id) {
|
|
|
if (this.OrderForm.type == "TO_C") {
|
|
|
- /* var start = new Date(this.OrderForm.start_time); // 将起始日期字符串转换为Date对象
|
|
|
- this.OrderForm.product_list.map((item) => {
|
|
|
- var end = new Date(item.end_time); // 将结束日期字符串转换为Date对象
|
|
|
- var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
|
|
|
- var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
|
|
|
- total += item.product_vo.day_price * item.num * monthDiff;
|
|
|
- }); */
|
|
|
+ // var start = new Date(this.OrderForm.start_time); // 将起始日期字符串转换为Date对象
|
|
|
+ // this.OrderForm.product_list.map((item) => {
|
|
|
+ // var end = new Date(item.end_time); // 将结束日期字符串转换为Date对象
|
|
|
+ // var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
|
|
|
+ // var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
|
|
|
+ // total += item.product_vo.day_price * item.num * monthDiff;
|
|
|
+ // });
|
|
|
var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
|
|
|
var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
|
|
|
var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
|
|
@@ -1542,42 +1564,6 @@ export default {
|
|
|
},
|
|
|
set(newValue) {
|
|
|
this.OrderForm.real_price = newValue;
|
|
|
- /* let total = 0;
|
|
|
- if (!this.OrderForm.product_list) return
|
|
|
- if (!this.id) {
|
|
|
- if (this.OrderForm.type == "TO_C") {
|
|
|
- var start = new Date(this.OrderForm.start_time); // 将起始日期字符串转换为Date对象
|
|
|
- this.OrderForm.product_list.map((item) => {
|
|
|
- var end = new Date(item.end_time); // 将结束日期字符串转换为Date对象
|
|
|
- var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
|
|
|
- var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
|
|
|
- total += item.product_vo.day_price * item.num * monthDiff;
|
|
|
- });
|
|
|
-
|
|
|
- return total;
|
|
|
- } else {
|
|
|
- this.OrderForm.product_list.map((item) => {
|
|
|
- total += item.product_vo.price * item.num;
|
|
|
- });
|
|
|
- return total;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (this.OrderForm.type == "TO_C") {
|
|
|
- var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
|
|
|
- var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
|
|
|
- var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
|
|
|
- var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
|
|
|
- this.OrderForm.product_list.map((item) => {
|
|
|
- total += item.product_vo.day_price * item.num * monthDiff;
|
|
|
- });
|
|
|
- return total;
|
|
|
- } else {
|
|
|
- this.OrderForm.product_list.map((item) => {
|
|
|
- total += item.product_vo.price * item.num;
|
|
|
- });
|
|
|
- return total;
|
|
|
- }
|
|
|
- } */
|
|
|
}
|
|
|
},
|
|
|
},
|
|
@@ -1605,24 +1591,16 @@ export default {
|
|
|
"OrderForm.product_list": {
|
|
|
deep: true,
|
|
|
handler(newVal) {
|
|
|
- newVal.forEach((item) => {
|
|
|
- /* item.sum=item.price*item.num
|
|
|
- return */
|
|
|
+ let totalItemMoney = 0;
|
|
|
+ newVal.forEach(item => {
|
|
|
+ if (this.OrderForm.type == "TO_C") {
|
|
|
+ item.item_money = item.product_vo.day_price * item.num * item.day_num * (item.reduction / 10);
|
|
|
+ } else {
|
|
|
+ item.item_money = item.product_vo.price * item.num * (item.reduction / 10);
|
|
|
+ }
|
|
|
+ totalItemMoney += item.item_money;
|
|
|
});
|
|
|
- /* this.OrderForm.total_price = newVal.reduce(
|
|
|
- (sum, item) => sum + item.total_price,
|
|
|
- 0
|
|
|
- ); // 税额(总)
|
|
|
- item.tax_price = item.total_price * item.tax_rate * 0.01;
|
|
|
- // 合计
|
|
|
- this.OrderForm.discount_price = newVal.reduce(
|
|
|
- (sum, item) => sum + item.discount_price * 1,
|
|
|
- 0
|
|
|
- );
|
|
|
- this.OrderForm.tax_price = newVal.reduce(
|
|
|
- (sum, item) => sum + item.tax_price,
|
|
|
- 0
|
|
|
- ); */
|
|
|
+ this.OrderForm.real_price = totalItemMoney;
|
|
|
},
|
|
|
},
|
|
|
/* "OrderForm.payment_list": {
|