fix: 预售商品改造

This commit is contained in:
lzhizhao 2025-04-29 00:32:04 +08:00
parent 8ee49aab47
commit 653ee3355e
2 changed files with 101 additions and 44 deletions

View File

@ -202,6 +202,7 @@ export default {
specType: 0, specType: 0,
minCostPrice: "", minCostPrice: "",
status: "UP", status: "UP",
isAdvanceSell: '0',
}; };
this.modalData.merchantId = JSON.parse( this.modalData.merchantId = JSON.parse(
sessionStorage.getItem("userInfo") sessionStorage.getItem("userInfo")
@ -519,37 +520,37 @@ export default {
); );
}, },
}, },
{ // {
label: "是否为预售产品", // label: "",
prop: "isAdvanceSell", // prop: "isAdvanceSell",
required: true, // required: true,
rules: { // rules: {
required: true, // required: true,
message: "是否为预售产品", // message: "",
trigger: "blur", // trigger: "blur",
}, // },
type: "jsx", // type: "jsx",
render: () => { // render: () => {
return ( // return (
<el-select // <el-select
v-model={this.modalData.isAdvanceSell} // v-model={this.modalData.isAdvanceSell}
placeholder="请选择销售单位" // placeholder=""
> // >
{[ // {[
{ label: "是", value: "1" }, // { label: "", value: "1" },
{ label: "否", value: "0" }, // { label: "", value: "0" },
].map((item) => { // ].map((item) => {
return ( // return (
<el-option // <el-option
label={item.label} // label={item.label}
value={item.value} // value={item.value}
></el-option> // ></el-option>
); // );
})} // })}
</el-select> // </el-select>
); // );
}, // },
}, // },
]; ];
break; break;
case "销售信息": case "销售信息":
@ -941,4 +942,4 @@ export default {
padding: 0 30px; padding: 0 30px;
} }
} }
</style> </style>

View File

@ -29,6 +29,7 @@
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:editable="false" :editable="false"
:picker-options="pickerOptions"
> >
</el-date-picker> </el-form-item </el-date-picker> </el-form-item
></el-col> ></el-col>
@ -47,7 +48,7 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:picker-options="pickerOptions" :picker-options="pickerOptions2"
> >
</el-date-picker> </el-form-item </el-date-picker> </el-form-item
></el-col> ></el-col>
@ -152,7 +153,14 @@
v-if="scope.row.isAdvanceSell" v-if="scope.row.isAdvanceSell"
@change=" @change="
scope.row.balancePayment = scope.row.balancePayment =
scope.row.presalePrice - scope.row.earnestMoney Number(scope.row.presalePrice) && Number(scope.row.earnestMoney)
? parseFloat(
String(
scope.row.presalePrice -
scope.row.earnestMoney
)
).toFixed(2)
: 0
" "
v-model="scope.row.presalePrice" v-model="scope.row.presalePrice"
:min="0" :min="0"
@ -169,7 +177,14 @@
<el-input-number <el-input-number
@change=" @change="
scope.row.balancePayment = scope.row.balancePayment =
scope.row.presalePrice - scope.row.earnestMoney Number(scope.row.presalePrice) && Number(scope.row.earnestMoney)
? parseFloat(
String(
scope.row.presalePrice -
scope.row.earnestMoney
)
).toFixed(2)
: 0
" "
v-if="scope.row.isAdvanceSell" v-if="scope.row.isAdvanceSell"
v-model="scope.row.earnestMoney" v-model="scope.row.earnestMoney"
@ -182,8 +197,12 @@
<el-table-column align="center" label="尾款" width="200"> <el-table-column align="center" label="尾款" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.isAdvanceSell">{{ <span v-if="scope.row.isAdvanceSell">{{
scope.row.presalePrice Number(scope.row.presalePrice) && Number(scope.row.earnestMoney)
? scope.row.presalePrice - scope.row.earnestMoney ? parseFloat(
String(
scope.row.presalePrice - scope.row.earnestMoney
)
).toFixed(2)
: '' : ''
}}</span> }}</span>
</template> </template>
@ -270,7 +289,14 @@
v-if="scope.row.isAdvanceSell" v-if="scope.row.isAdvanceSell"
@change=" @change="
scope.row.balancePayment = scope.row.balancePayment =
scope.row.presalePrice - scope.row.earnestMoney Number(scope.row.presalePrice) && Number(scope.row.earnestMoney)
? parseFloat(
String(
scope.row.presalePrice -
scope.row.earnestMoney
)
).toFixed(2)
: 0
" "
v-model="scope.row.presalePrice" v-model="scope.row.presalePrice"
:min="0" :min="0"
@ -287,7 +313,14 @@
<el-input-number <el-input-number
@change=" @change="
scope.row.balancePayment = scope.row.balancePayment =
scope.row.presalePrice - scope.row.earnestMoney Number(scope.row.presalePrice) && Number(scope.row.earnestMoney)
? parseFloat(
String(
scope.row.presalePrice -
scope.row.earnestMoney
)
).toFixed(2)
: 0
" "
v-if="scope.row.isAdvanceSell" v-if="scope.row.isAdvanceSell"
v-model="scope.row.earnestMoney" v-model="scope.row.earnestMoney"
@ -300,9 +333,15 @@
<el-table-column align="center" label="尾款" width="200"> <el-table-column align="center" label="尾款" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.isAdvanceSell">{{ <span v-if="scope.row.isAdvanceSell">{{
scope.row.presalePrice scope.row.presalePrice &&
? scope.row.presalePrice - scope.row.earnestMoney scope.row.earnestMoney &&
: '' scope.row.presalePrice > scope.row.earnestMoney
? parseFloat(
String(
scope.row.presalePrice - scope.row.earnestMoney
)
).toFixed(2)
: 0
}}</span> }}</span>
</template> </template>
</el-table-column> </el-table-column>
@ -352,6 +391,7 @@ export default {
} }
}, },
data() { data() {
var that = this
return { return {
isAdd: true, isAdd: true,
// //
@ -373,6 +413,16 @@ export default {
}, },
orderTime: [], // orderTime: [], //
arrears: [], // arrears: [], //
pickerOptions2: {
disabledDate(time) {
let date = Date.now()
if (that.ruleForm && that.ruleForm.startTime) {
console.log(that.ruleForm.startTime)
date = new Date(that.ruleForm.startTime).getTime()
}
return time.getTime() < date
}
},
delivery: [], // delivery: [], //
tableData: [], tableData: [],
rules: { rules: {
@ -594,7 +644,11 @@ export default {
product.productSpecificationList && product.productSpecificationList &&
product.productSpecificationList.length product.productSpecificationList.length
) { ) {
count = count + product.productSpecificationList.filter((spec) => spec.isAdvanceSell).length count =
count +
product.productSpecificationList.filter(
spec => spec.isAdvanceSell
).length
product.productSpecificationList.forEach(spec => { product.productSpecificationList.forEach(spec => {
if (spec.isAdvanceSell) { if (spec.isAdvanceSell) {
if (!spec.presalePrice) { if (!spec.presalePrice) {
@ -638,7 +692,9 @@ export default {
return return
} }
let pass = true let pass = true
let count = this.ruleForm.productSpecificationList.filter((spec) => spec.isAdvanceSell).length let count = this.ruleForm.productSpecificationList.filter(
spec => spec.isAdvanceSell
).length
this.ruleForm.productSpecificationList.forEach(spec => { this.ruleForm.productSpecificationList.forEach(spec => {
if (spec.isAdvanceSell) { if (spec.isAdvanceSell) {
if (!spec.presalePrice) { if (!spec.presalePrice) {