Commit 271b38e6 by cwq0219

财务设置,bug修复

1 parent d2277854
......@@ -9,6 +9,10 @@
:close-on-click-modal="false"
:width="width"
>
<span slot="title">
{{title}}
<slot name="sub-title"></slot>
</span>
<slot></slot>
<div slot="footer">
<slot name="btn-start"></slot>
......
......@@ -310,7 +310,7 @@ export default {
cursor: pointer;
}
.el-table .cell {
line-height: 14px;
line-height: 18px;
}
.d2-table p {
margin: 10px 0;
......
......@@ -51,6 +51,7 @@ export default {
idCardBack: '30',
bankCard: '35',
bankCardBack: '36',
handIdCard: '33',
clientAgreement: '31',
doorHead: '34',
businessPremiese: 'A007',
......
......@@ -266,7 +266,7 @@ export default {
},
// 手持身份证
handIdCard: {
attrName: 'A009',
attrName: '33',
url: ''
},
// 银行卡
......
......@@ -54,14 +54,9 @@
v-model="form.autoFlag"
active-value="Y"
inactive-value="N"
:disabled="isConfigAccount"
>
</el-switch>
</el-radio-group>
<span v-show="isConfigAccount">关联的服务商有生效的虚拟对公账户才能开启线上自动分账<a
href="#/accountList"
target="_blank"
>申请虚拟账户 ></a></span>
</el-form-item>
<el-form-item
label="结算时间方式"
......@@ -321,10 +316,13 @@
</div>
</div>
<div>
<div class="account-card-block">
<div
class="account-card-block"
v-if="form.parentMerchantName"
>
<p class="card-title">
<span>目标分账对象:</span>
<span class="title-target-obj">服务商 / 转化方 / 合作伙伴</span>
<span class="title-target-obj">{{form.parentMerchantName}}</span>
<block style="float: right; margin-top: -8px;">
<!-- <span style="margin-right: 30px;">类型:无</span> -->
<el-button
......@@ -472,14 +470,13 @@
<script>
import _ from 'lodash'
import { mapActions } from 'vuex'
import { updateRule, sendSms, getAdminInfo, getAccountRule, getShopDetail } from '@api/merchant'
import { updateRule, sendSms, getAdminInfo, getAccountRule } from '@api/merchant'
import { BaseData, userType, ghUserType, limitPrice } from '@/common/constants.js'
export default {
name: 'merchantDetail',
data() {
return {
sessionName: 'merchatDetailItem',
isConfigAccount: false,
// 结算周期
settleTimeObj: {
first: '1',
......@@ -583,24 +580,20 @@ export default {
this.adminInfo = res
})
if (this.$route.params.merchantId) {
Object.assign(this.form, this.$route.params)
// console.log(this.$route.params)
this.merchantItem = {
merchantId: this.$route.params.merchantId,
merchantName: this.$route.params.merchantName,
channelType: this.$route.params.channelType
channelType: this.$route.params.channelType,
parentMerchantName: this.$route.params.partnerMerchant ? this.$route.params.partnerMerchant.merchantName : ''
}
Object.assign(this.form, this.merchantItem)
sessionStorage.setItem(this.sessionName, JSON.stringify(this.merchantItem))
} else {
Object.assign(this.form, JSON.parse(sessionStorage.getItem(this.sessionName)))
}
getAccountRule({ 'merchantId': this.form.merchantId }).then(res => {
if (!res || (res.autoFlag === 'N')) {
getShopDetail({ 'merchantId': this.form.merchantId }).then(res => {
var parentStatus = res.partnerMerchant ? (res.partnerMerchant.accountStatus !== 3) : true
// var merchantStatus = res.merchant ? (res.merchant.accountStatus !== 3) : true
this.isConfigAccount = parentStatus
})
}
console.log(res)
if (res) {
this.form.autoFlag = res.autoFlag
this.form.settleTimeType = res.settleTimeType
......@@ -610,7 +603,7 @@ export default {
this.accountSetForm.list[0].merchantProfitValue = res.merchantProfitValue + ''
this.accountSetForm.incentiveType = res.incentiveType + ''
this.accountSetForm.incentiveValue = res.incentiveValue + ''
this.accountSecondSetForm.list[0].partnerProfitPer = res.partnerProfitPer + ''
this.form.parentMerchantName && (this.accountSecondSetForm.list[0].partnerProfitPer = res.partnerProfitPer + '')
res.goodsTypeSettleRuleList.forEach((item, index) => {
this.accountSetForm.list.push({
goodsType: item.goodsType,
......@@ -618,7 +611,7 @@ export default {
merchantSettleType: item.merchantSettleType + '',
merchantProfitValue: item.merchantProfitValue
})
this.accountSecondSetForm.list.push({
this.form.parentMerchantName && this.accountSecondSetForm.list.push({
goodsType: item.goodsType,
goodsTypeName: item.goodsTypeName,
partnerProfitPer: item.partnerProfitPer
......@@ -673,7 +666,8 @@ export default {
},
// 是否编辑;refs绑定的属性值;当前Form属性值;级联Form属性值;添加对象的属性
handleSetEdit(isEditAttr, refsAttr, formAttr, cascadeChangeAttr, addStructAttr) {
if (this[isEditAttr]) {
// 判断是否有服务商
if (this[isEditAttr] && this.form.parentMerchantName) {
this.$refs[refsAttr].validate(valid => {
if (valid) {
this[isEditAttr] = !this[isEditAttr]
......@@ -716,62 +710,69 @@ export default {
this[formAttr].list.splice(index, 1)
})
},
assignConfirm() {
// console.log(this.form)
console.log(this.accountSetForm)
console.log(this.accountSecondSetForm)
var params = {
merchantId: this.form.merchantId,
channelType: this.form.channelType,
smsCode: this.form.smsCode,
bizType: this.form.bizType,
autoFlag: this.form.autoFlag,
settleTimeType: this.form.settleTimeType,
settleTime: this.settleTimeObj[this.form.settleTimeType === 1 ? 'first' : 'second'],
settleAmountType: this.form.settleAmountType,
// 全部-分账设置
merchantSettleType: this.accountSetForm.list[0].merchantSettleType,
merchantProfitValue: this.accountSetForm.list[0].merchantProfitValue,
incentiveType: this.accountSetForm.incentiveType,
incentiveValue: this.accountSetForm.incentiveValue,
// partnerProfitPer: this.accountSecondSetForm.list[0].partnerProfitPer,
goodsTypeSettleRuleList: []
}
// 是否配置服务商
this.form.parentMerchantName && (params.partnerProfitPer = this.accountSecondSetForm.list[0].partnerProfitPer)
this.accountSetForm.list.forEach((item, index) => {
if (index !== 0) {
params.goodsTypeSettleRuleList.push({
goodsType: item.goodsType,
goodsTypeName: item.goodsTypeName,
merchantSettleType: item.merchantSettleType,
merchantProfitValue: item.merchantProfitValue
// partnerProfitPer: this.accountSecondSetForm.list[index].partnerProfitPer
})
// 是否配置服务商
this.form.parentMerchantName && (params.goodsTypeSettleRuleList[index - 1].partnerProfitPer = this.accountSecondSetForm.list[index].partnerProfitPer)
}
})
console.log(params)
updateRule(params).then((res) => {
this.$message({
message: '修改成功',
type: 'success'
})
this.deleteSession()
this.close({ tagName: '/merchantDetail' })
this.close({ tagName: '/merchantManage' })
this.$router.push({
name: 'merchantManage'
})
}).catch(() => { })
},
onSubmit() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.$refs['accountValiteForm'].validate((valid2) => {
if (valid2) {
this.$refs['accountSecondValiteForm'].validate((valid3) => {
if (valid3) {
// console.log(this.form)
// console.log(this.accountSetForm)
// console.log(this.accountSecondSetForm)
var params = {
merchantId: this.form.merchantId,
channelType: this.form.channelType,
smsCode: this.form.smsCode,
bizType: this.form.bizType,
autoFlag: this.form.autoFlag,
settleTimeType: this.form.settleTimeType,
settleTime: this.settleTimeObj[this.form.settleTimeType === 1 ? 'first' : 'second'],
settleAmountType: this.form.settleAmountType,
// 全部-分账设置
merchantSettleType: this.accountSetForm.list[0].merchantSettleType,
merchantProfitValue: this.accountSetForm.list[0].merchantProfitValue,
incentiveType: this.accountSetForm.incentiveType,
incentiveValue: this.accountSetForm.incentiveValue,
partnerProfitPer: this.accountSecondSetForm.list[0].partnerProfitPer,
goodsTypeSettleRuleList: []
}
this.accountSetForm.list.forEach((item, index) => {
if (index !== 0) {
params.goodsTypeSettleRuleList.push({
goodsType: item.goodsType,
goodsTypeName: item.goodsTypeName,
merchantSettleType: item.merchantSettleType,
merchantProfitValue: item.merchantProfitValue,
partnerProfitPer: this.accountSecondSetForm.list[index].partnerProfitPer
})
}
})
// console.log(params)
updateRule(params).then((res) => {
this.$message({
message: '修改成功',
type: 'success'
})
this.deleteSession()
this.close({ tagName: '/merchantManage' })
this.$router.push({
name: 'merchantManage'
})
}).catch(() => { })
} else {
this.handleSetEdit('isSecondSetEdit', 'accountSecondValiteForm', 'accountSecondSetForm', 'accountSetForm', 'accountSetStruct')
}
})
if (this.form.parentMerchantName) {
this.$refs['accountSecondValiteForm'].validate((valid3) => {
valid3 ? this.assignConfirm() : this.handleSetEdit('isSecondSetEdit', 'accountSecondValiteForm', 'accountSecondSetForm', 'accountSetForm', 'accountSetStruct')
})
} else {
this.assignConfirm()
}
} else {
this.handleSetEdit('isFirstSetEdit', 'accountValiteForm', 'accountSetForm', 'accountSecondSetForm', 'accountSecondSetStruct')
}
......
......@@ -49,9 +49,11 @@
:isVisible.sync="relateVisible"
btnOkLabel="确定关联"
width="60%"
class="relate-dialog"
@confirmDialog="handleRelateConfirm"
@closeDialog="handleRelateClose"
>
<span slot="sub-title" class="relate-sub-title">为园区店关联对应的服务商,一家园区店只能关联一个服务商</span>
<el-form
ref="relateDialog"
:model="relateForm"
......@@ -62,7 +64,7 @@
label="选择关联的园区店:"
prop="yqMerchantId"
>
<el-select v-model="relateForm.yqMerchantId">
<el-select v-model="relateForm.yqMerchantId" filterable>
<el-option
v-for="item in baseData.yqList.filter(i => i.merchantName !== '全部')"
:key="item.merchantId"
......@@ -76,7 +78,7 @@
label="选择关联的服务商:"
prop="merchantId"
>
<el-select v-model="relateForm.merchantId">
<el-select v-model="relateForm.merchantId" filterable>
<el-option
v-for="item in baseData.serviceList.filter(i => i.merchantName !== '全部')"
:key="item.merchantId"
......@@ -138,18 +140,19 @@ export default {
data() {
return {
searchForm: {
merchantName: ''
merchantNameKeyWord: '',
merchantIdKeyWord: ''
},
showFormData: [{
label: '商户名称',
name: 'merchantName',
name: 'merchantNameKeyWord',
type: 'input',
placeholder: '请输入服务商/园区店名称',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '商户号',
name: '',
name: 'merchantIdKeyWord',
type: 'input',
inputType: 'number',
placeholder: '请输入服务商/园区店编号',
......@@ -248,7 +251,8 @@ export default {
},
handleReset() {
this.searchForm = {
merchantName: ''
merchantNameKeyWord: '',
merchantIdKeyWord: ''
}
},
// 新增服务商
......@@ -353,4 +357,8 @@ export default {
.delete-dialog .delete-title {
font-size: 16px;
}
.relate-dialog .relate-sub-title {
font-size: 12px;
color: #666666;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!