fix: 修改新增预售的内容

This commit is contained in:
lzhizhao 2025-05-15 21:26:10 +08:00
parent 7a9f8ca0d4
commit 5ab6d86bd9
1 changed files with 97 additions and 18 deletions

View File

@ -22,6 +22,7 @@
@change="getOrderTime"
format="yyyy-MM-dd HH:mm"
data-format="yyyy-MM-dd HH:mm"
popper-class="show-time-hint"
value-format="yyyy-MM-dd HH:mm:ss"
v-model="orderTime"
type="datetimerange"
@ -44,6 +45,7 @@
data-format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm:ss"
v-model="arrears"
popper-class="show-time-hint"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
@ -63,6 +65,7 @@
value-format="yyyy-MM-dd HH:mm:ss"
@change="deliveryTime"
v-model="delivery"
popper-class="show-time-hint"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
@ -70,7 +73,9 @@
:picker-options="pickerOptions3"
>
</el-date-picker>
<div style="color: red;">顾客支付定金时可对此区间的日期进行预约卖家须在顾客已选预约日进行发货</div>
<div style="color: red;">
顾客支付定金时可对此区间的日期进行预约卖家须在顾客已选预约日进行发货
</div>
</el-form-item>
<el-form-item label="定金可退:" prop="isRefundEarnestMoney">
<el-radio v-model="ruleForm.isRefundEarnestMoney" :label="1"
@ -154,7 +159,8 @@
v-if="scope.row.isAdvanceSell"
@change="
scope.row.balancePayment =
Number(scope.row.presalePrice) && Number(scope.row.earnestMoney)
Number(scope.row.presalePrice) &&
Number(scope.row.earnestMoney)
? parseFloat(
String(
scope.row.presalePrice -
@ -165,7 +171,6 @@
"
v-model="scope.row.presalePrice"
:min="0"
:max="scope.row.marketPrice"
label="请输入销售价"
></el-input-number>
</template>
@ -178,7 +183,8 @@
<el-input-number
@change="
scope.row.balancePayment =
Number(scope.row.presalePrice) && Number(scope.row.earnestMoney)
Number(scope.row.presalePrice) &&
Number(scope.row.earnestMoney)
? parseFloat(
String(
scope.row.presalePrice -
@ -198,7 +204,8 @@
<el-table-column align="center" label="尾款" width="200">
<template slot-scope="scope">
<span v-if="scope.row.isAdvanceSell">{{
Number(scope.row.presalePrice) && Number(scope.row.earnestMoney)
Number(scope.row.presalePrice) &&
Number(scope.row.earnestMoney)
? parseFloat(
String(
scope.row.presalePrice - scope.row.earnestMoney
@ -290,7 +297,8 @@
v-if="scope.row.isAdvanceSell"
@change="
scope.row.balancePayment =
Number(scope.row.presalePrice) && Number(scope.row.earnestMoney)
Number(scope.row.presalePrice) &&
Number(scope.row.earnestMoney)
? parseFloat(
String(
scope.row.presalePrice -
@ -314,7 +322,8 @@
<el-input-number
@change="
scope.row.balancePayment =
Number(scope.row.presalePrice) && Number(scope.row.earnestMoney)
Number(scope.row.presalePrice) &&
Number(scope.row.earnestMoney)
? parseFloat(
String(
scope.row.presalePrice -
@ -410,7 +419,12 @@ export default {
},
pickerOptions: {
disabledDate(time) {
return time.getTime() <= dayjs().subtract(1, 'day').valueOf()
return (
time.getTime() <=
dayjs()
.subtract(1, 'day')
.valueOf()
)
}
},
orderTime: [], //
@ -422,7 +436,12 @@ export default {
console.log(that.ruleForm.startTime)
date = new Date(that.ruleForm.startTime).getTime()
}
return time.getTime() <= dayjs(date).subtract(1, 'day').valueOf()
return (
time.getTime() <=
dayjs(date)
.subtract(1, 'day')
.valueOf()
)
}
},
pickerOptions3: {
@ -643,12 +662,24 @@ export default {
this.$refs.ruleForm.validate(valid => {
if (valid) {
console.log(valid)
if (dayjs(this.ruleForm.startTime).isAfter(dayjs(this.ruleForm.balancePaymentStartTime))) {
this.$message.error('付尾款开始时间必须大于等于定金开始时间')
if (
dayjs(this.ruleForm.startTime).isAfter(
dayjs(this.ruleForm.balancePaymentStartTime)
)
) {
this.$message.error(
'付尾款开始时间必须大于等于定金开始时间'
)
return
}
if (dayjs(this.ruleForm.endTime).isAfter(dayjs(this.ruleForm.balancePaymentEndTime))) {
this.$message.error('付尾款结束时间必须大于等于定金结束时间')
if (
dayjs(this.ruleForm.endTime).isAfter(
dayjs(this.ruleForm.balancePaymentEndTime)
)
) {
this.$message.error(
'付尾款结束时间必须大于等于定金结束时间'
)
return
}
if (
@ -712,12 +743,24 @@ export default {
} else {
this.$refs.ruleForm.validate(valid => {
if (valid) {
if (dayjs(this.ruleForm.startTime).isAfter(dayjs(this.ruleForm.balancePaymentStartTime))) {
this.$message.error('付尾款开始时间必须大于等于定金开始时间')
if (
dayjs(this.ruleForm.startTime).isAfter(
dayjs(this.ruleForm.balancePaymentStartTime)
)
) {
this.$message.error(
'付尾款开始时间必须大于等于定金开始时间'
)
return
}
if (dayjs(this.ruleForm.endTime).isAfter(dayjs(this.ruleForm.balancePaymentEndTime))) {
this.$message.error('付尾款结束时间必须大于等于定金结束时间')
if (
dayjs(this.ruleForm.endTime).isAfter(
dayjs(this.ruleForm.balancePaymentEndTime)
)
) {
this.$message.error(
'付尾款结束时间必须大于等于定金结束时间'
)
return
}
console.log(valid)
@ -778,4 +821,40 @@ export default {
asyncComputed: {}
}
</script>
<style lang="scss" scoped></style>
<style lang="scss">
.show-time-hint {
.el-time-spinner {
position: relative;
&::before {
content: '小时';
display: block;
color: black;
position: absolute;
top: 0;
left: 0;
text-align: center;
width: 50%;
height: 40px;
line-height:40px;
font-size: 14px;
background: white;
z-index: 100;
}
&::after {
content: '分钟';
display: block;
color: black;
position: absolute;
text-align: center;
top: 0;
height: 40px;
line-height:40px;
right: 0;
width: 50%;
font-size: 14px;
background: white;
z-index: 100;
}
}
}
</style>