Commit e1963598 by 前端

Merge branch 'SAAS+V4.52.0-0429' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.52.0-0429
2 parents ea6887ad ecd5eed0
......@@ -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,10 +1054,28 @@ 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")) {
infoValid = true
this.clearValid("refundPoints")
}
if (this.isValid("remnantPoints2")) {
infoValid = true
this.clearValid("refundPoints2")
}
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
if (infoValid && valid) {
this.okParams = deepClone(this.infoForm)
......
......@@ -147,7 +147,7 @@
<el-col
:span="8"
v-if="
detailInfo.status == '已审核' || detailInfo.failType == '退款'
detailInfo.status == '已审核' || detailInfo.failType == '退款'
"
>
<el-form-item label="订单总积分:" class="halfItem">
......@@ -239,7 +239,7 @@ export default {
id: {
type: Number,
default: ""
},
}
},
computed: {
dialogShow: {
......@@ -272,9 +272,8 @@ export default {
width: "1080px"
}
},
addScore:0,
detailInfo: {
},
addScore: 0,
detailInfo: {},
operationList: [],
loading: false,
imgVisible: false,
......@@ -310,7 +309,7 @@ export default {
if (
this.detailInfo.status == "已审核" ||
this.detailInfo.failType == '退款'
this.detailInfo.failType == "退款"
) {
this.getScore()
this.getOrderOperateData()
......@@ -322,18 +321,12 @@ export default {
getOrderByScore({
orderCode: this.detailInfo.orderCode
}).then((res) => {
this.addScore = res.addScore
// this.$set(this.detailInfo, "addScore", res.addScore)
})
},
getOrderOperateData() {
let params = { operationType: 1}
if(this.detailInfo.status=='已失效'){
params.id=this.id
}else{
params.orderCode=this.detailInfo.orderCode
}
let params = { operationType: 1, id: this.id }
getOperationRecord(params).then((res) => {
console.log(res)
this.operationList = res
......@@ -515,7 +508,7 @@ export default {
}
</style>
<style >
<style>
.detailDialog-tooltip-width {
max-width: 500px;
}
......
......@@ -165,11 +165,11 @@ export default {
if (isNaN(value) || value <= 0) {
callback(new Error("输入大于0的数字"))
} else {
callback()
}
callback()
}
}
return {
isRefund:true,
isRefund: true,
show: true,
handleFormRef: "handleFormRef",
refundVisible: false,
......@@ -346,7 +346,7 @@ export default {
refundType: "",
refundPoints: "",
firstInto: true,
refundAmount:''
refundAmount: ""
},
formRules: {
refundType: [
......@@ -652,6 +652,8 @@ export default {
//标记退款
handleRefund(data) {
this.refundVisible = true
this.refundForm.employeeUserId = data.staffUuid
this.refundForm.employeeName = data.staffName
this.refundForm.orderCode = data.orderCode
this.refundForm.tempPoints = data.integralIncome
this.refundForm.refundPoints = data.integralIncome //退还积分
......@@ -670,13 +672,17 @@ export default {
// this.refundForm.remainAmount = res.remainAmount //剩余金额
this.refundForm.firstInto = true
this.refundForm.refundType = 1 //退款类型(1:全退,2:部分退),
this.refundFormData[this.findAttrIdx("refundType")].optionList[0].isDisabled = false
this.refundFormData[
this.findAttrIdx("refundType")
].optionList[0].isDisabled = false
} else {
this.refundForm.remainingScore = res.remainingScore
// this.refundForm.remainAmount = res.remainAmount //剩余金额
this.refundForm.firstInto = false
this.refundForm.refundType = 2
this.refundFormData[this.findAttrIdx("refundType")].optionList[0].isDisabled = true
this.refundFormData[
this.findAttrIdx("refundType")
].optionList[0].isDisabled = true
}
this.updateDisable()
})
......@@ -686,8 +692,10 @@ export default {
if (this.refundForm.refundType == 1) {
this.refundForm.refundPoints = this.refundForm.tempPoints
}
this.refundFormData[this.findAttrIdx("refundPoints")].isDisabled = disabled
this.refundFormData[this.findAttrIdx("refundAmount")].isDisabled = disabled
this.refundFormData[this.findAttrIdx("refundPoints")].isDisabled =
disabled
this.refundFormData[this.findAttrIdx("refundAmount")].isDisabled =
disabled
this.refundFormData = deepClone(this.refundFormData)
},
findAttrIdx(attrName) {
......@@ -700,29 +708,32 @@ export default {
},
// 确定标记退款
handleRefundConfirm() {
if(this.isRefund){
if (this.isRefund) {
this.$refs.refundFormRef.$refs[this.handleFormRef].validate((valid) => {
if (valid) {
this.isRefund=false
markAsRefunded({
orderCode: this.refundForm.orderCode,
refundType: this.refundForm.refundType,
refundPoints: this.refundForm.refundPoints,
refundAmount:this.refundForm.refundAmount
}).then((res) => {
if (res) {
this.$message.success("退款成功!")
this.refundVisible = false
this.refundForm.id = ""
this.handleSearch()
}
}).finally(()=>{
this.isRefund=true
})
}
})
if (valid) {
this.isRefund = false
markAsRefunded({
orderCode: this.refundForm.orderCode,
refundType: this.refundForm.refundType,
refundPoints: this.refundForm.refundPoints,
refundAmount: this.refundForm.refundAmount,
employeeUserId: this.refundForm.employeeUserId,
employeeName: this.refundForm.employeeName
})
.then((res) => {
if (res) {
this.$message.success("退款成功!")
this.refundVisible = false
this.refundForm.id = ""
this.handleSearch()
}
})
.finally(() => {
this.isRefund = true
})
}
})
}
},
//刷新
handleRefresh() {
......@@ -829,4 +840,4 @@ export default {
border-top: 1px solid #e5e5e5;
}
}
</style>
\ No newline at end of file
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!