Commit ac2ef11b by wangzhihui

积分分润

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