Commit ac2ef11b by wangzhihui

积分分润

1 parent 6b1849a3
...@@ -11,10 +11,15 @@ ...@@ -11,10 +11,15 @@
<p class="title">业务信息</p> <p class="title">业务信息</p>
<el-form class="edit-sub-block" label-width="150px" :inline="true"> <el-form class="edit-sub-block" label-width="150px" :inline="true">
<template v-for="item in orderInfoList"> <template v-for="item in orderInfoList">
<el-form-item :label="orderType == 2 ? '交易参考号:' : '订单编码:'"> <el-form-item
:label="orderType == 2 ? '交易参考号:' : '订单编码:'"
:key="item.orderCode"
>
{{ item.orderCode }} {{ item.orderCode }}
</el-form-item> </el-form-item>
<el-form-item label="订单金额:"> {{ item.price }}元 </el-form-item> <el-form-item label="订单金额:" :key="item.orderCode">
{{ item.price }}元
</el-form-item>
</template> </template>
</el-form> </el-form>
<glsx-combi-form <glsx-combi-form
...@@ -35,7 +40,6 @@ ...@@ -35,7 +40,6 @@
:style="{ width: formDefaultObj.defaultWidth }" :style="{ width: formDefaultObj.defaultWidth }"
clearable clearable
:disabled="scope.scope.isDisabled" :disabled="scope.scope.isDisabled"
@input="handleUpgradeNum"
> >
</el-input> </el-input>
<div class="tips"> <div class="tips">
...@@ -46,6 +50,23 @@ ...@@ -46,6 +50,23 @@
}} }}
</div> </div>
</template> </template>
<template slot="refundPoints2" slot-scope="scope">
<el-input
placeholder="请输入退款金额"
v-model="infoForm.refundPoints2"
:style="{ width: formDefaultObj.defaultWidth }"
clearable
:disabled="scope.scope.isDisabled"
>
</el-input>
<div class="tips">
剩余积分:{{
infoForm.remnantPoints2 === 0
? infoForm.remnantPoints2
: infoForm.remnantPoints2 || "-"
}}
</div>
</template>
</glsx-combi-form> </glsx-combi-form>
<p class="title">退款信息</p> <p class="title">退款信息</p>
<glsx-combi-form <glsx-combi-form
...@@ -191,6 +212,7 @@ export default { ...@@ -191,6 +212,7 @@ export default {
orderType: null, // 订单类型(1.订单,2.待补录订单) orderType: null, // 订单类型(1.订单,2.待补录订单)
title: "", title: "",
refundPoints: "", refundPoints: "",
refundPoints2: "",
platformMerchantId: "", platformMerchantId: "",
payAmount: "", payAmount: "",
payReason: "", payReason: "",
...@@ -280,6 +302,16 @@ export default { ...@@ -280,6 +302,16 @@ export default {
isDisabled: true, isDisabled: true,
addHtml: "refundPoints" addHtml: "refundPoints"
} }
],
refund2: [
{
label: "退还积分",
name: "refundPoints2",
type: "input",
isClear: true,
isDisabled: true,
addHtml: "refundPoints2"
}
] ]
}, },
// 业务信息 // 业务信息
...@@ -332,6 +364,13 @@ export default { ...@@ -332,6 +364,13 @@ export default {
trigger: "blur" trigger: "blur"
} }
], ],
refundPoints2: [
{
required: true,
message: "请输入退还积分",
trigger: "blur"
}
],
yqMerchantId: [ yqMerchantId: [
{ {
required: true, required: true,
...@@ -549,7 +588,12 @@ export default { ...@@ -549,7 +588,12 @@ export default {
watch: { watch: {
"infoForm.refundType"(newValue) { "infoForm.refundType"(newValue) {
// immediate: true // immediate: true
this.judgeRefundPoints(newValue) //开启分润
if (this.infoForm.deliveryUserId) {
this.judgeRefundPoints(newValue, "refundPoints2")
}
this.judgeRefundPoints(newValue, "refundPoints")
this.judgeRefundPointsValue()
}, },
"infoForm.attachmentList": { "infoForm.attachmentList": {
handler(newVal) { handler(newVal) {
...@@ -664,16 +708,19 @@ export default { ...@@ -664,16 +708,19 @@ export default {
methods: { methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]), ...mapActions("d2admin/user", ["actionSetDownloadList"]),
judgeRefundPoints(newValue) {
if (this.infoEditFormData[this.findAttrIdx("refundPoints")]) { judgeRefundPointsValue() {
if (this.infoForm.deliveryUserId) {
this.infoForm.refundPoints2 = this.infoForm.remnantPoints2
}
this.infoForm.refundPoints = this.infoForm.remnantPoints
},
judgeRefundPoints(newValue, key) {
if (this.infoEditFormData[this.findAttrIdx(key)]) {
if (newValue == 2) { if (newValue == 2) {
this.infoEditFormData[ this.infoEditFormData[this.findAttrIdx(key)].isDisabled = false
this.findAttrIdx("refundPoints")
].isDisabled = false
} else { } else {
this.infoEditFormData[ this.infoEditFormData[this.findAttrIdx(key)].isDisabled = true
this.findAttrIdx("refundPoints")
].isDisabled = true
} }
this.infoEditFormData = deepClone(this.infoEditFormData) this.infoEditFormData = deepClone(this.infoEditFormData)
} }
...@@ -728,10 +775,39 @@ export default { ...@@ -728,10 +775,39 @@ export default {
this.infoForm.shopMerchantName = res.shopMerchantName this.infoForm.shopMerchantName = res.shopMerchantName
this.infoForm.remnantPoints = res.remnantPoints this.infoForm.remnantPoints = res.remnantPoints
this.infoForm.refundPoints = res.remnantPoints this.infoForm.refundPoints = res.remnantPoints
this.infoForm.remnantPoints2 = res.remnantPoints2
this.infoForm.refundPoints2 = res.remnantPoints2
this.infoForm.employeeUserId = res.userId
this.infoForm.employeeName = res.employeeName
this.infoForm.deliveryUserId = res.deliveryUserId
? res.deliveryUserId
: ""
this.infoForm.deliveryEmployeeName = res.deliveryEmployeeName
if (!this.infoForm.deliveryUserId) {
//没用开启分润保持之前逻辑
if (this.infoForm.refundPoints === 0 || this.infoForm.refundPoints) { if (this.infoForm.refundPoints === 0 || this.infoForm.refundPoints) {
this.infoEditFormData.push(...deepClone(this.attrObj.refund)) this.infoEditFormData.push(...deepClone(this.attrObj.refund))
} }
this.judgeRefundPoints(this.detail.refundType) this.judgeRefundPoints(this.detail.refundType, "refundPoints")
} else {
//开启分润
this.infoEditFormData.push(...deepClone(this.attrObj.refund))
this.infoEditFormData[
this.findAttrIdx("refundPoints")
].label = `退还积分(${this.infoForm.employeeName})`
this.infoEditFormData.push(...deepClone(this.attrObj.refund2))
this.infoEditFormData[
this.findAttrIdx("refundPoints2")
].label = `退还积分(${this.infoForm.deliveryEmployeeName})`
this.judgeRefundPoints(this.detail.refundType, "refundPoints")
this.judgeRefundPoints(this.detail.refundType, "refundPoints2")
}
// if (this.infoForm.refundPoints2 === 0 || this.infoForm.refundPoints2) {
// }/
/** refundType:1-全额退款,2-部分退款 /** refundType:1-全额退款,2-部分退款
* 部分退款时,除了“所属服务对接”和“所属流量方”,其他不写入 * 部分退款时,除了“所属服务对接”和“所属流量方”,其他不写入
* */ * */
...@@ -978,11 +1054,28 @@ export default { ...@@ -978,11 +1054,28 @@ export default {
this.okParams.hasOwnProperty(item) && delete this.okParams[item] this.okParams.hasOwnProperty(item) && delete this.okParams[item]
}) })
}, },
clearValid(key) {
this.$refs.infoEditFormRef.$refs[this.editChildRef].clearValidate(key)
},
isValid(key) {
return (
this.infoForm.deliveryUserId &&
!this.infoForm[key] &&
this.infoForm[key] !== 0
)
},
handleAddConfirm() { handleAddConfirm() {
this.$refs.infoEditFormRef.$refs[this.editChildRef].validate( this.$refs.infoEditFormRef.$refs[this.editChildRef].validate(
(infoValid) => { (infoValid) => {
//开启分润
if (this.isValid("remnantPoints")) {
this.clearValid("refundPoints")
}
if (this.isValid("remnantPoints2")) {
this.clearValid("refundPoints2")
}
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => { this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
if (this.ref)
if (infoValid && valid) { if (infoValid && valid) {
this.okParams = deepClone(this.infoForm) this.okParams = deepClone(this.infoForm)
const attachmentList = this.okParams.attachmentList const attachmentList = this.okParams.attachmentList
...@@ -992,10 +1085,8 @@ export default { ...@@ -992,10 +1085,8 @@ export default {
i-- // 需要将i减1,因为数组长度已经减少了1 i-- // 需要将i减1,因为数组长度已经减少了1
} }
} }
this.okParams.bankAccountNo = this.okParams.bankAccountNo.replace( this.okParams.bankAccountNo =
/\s*/g, this.okParams.bankAccountNo.replace(/\s*/g, "")
""
)
this.okParams.yqMerchantName = this.okParams.yqMerchantName =
this.baseData.yqMerchantList.find( this.baseData.yqMerchantList.find(
(item) => item.yqMerchantId == this.okParams.yqMerchantId (item) => item.yqMerchantId == this.okParams.yqMerchantId
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!