Commit 4aace73c by wangzhihui

Merge branch 'SAAS+V5.2.0-1030' of http://192.168.3.233:8090/saas/scrm-micro-poi…

…nts into SAAS+V5.2.0-1030
2 parents 77df31f6 623ecf2c
...@@ -364,29 +364,33 @@ export default { ...@@ -364,29 +364,33 @@ export default {
} }
} }
}, },
async created() { created() {
/** loginpath:标识系统 /** loginpath:标识系统
* 门店版:/login * 门店版:/login
* 1、默认带出商户,“选择商户”按钮置灰 * 1、默认带出商户,“选择商户”按钮置灰
* 2、导入充值人群,去掉“管理层” * 2、导入充值人群,去掉“管理层”
* 运营版:/oss * 运营版:/oss
*/ */
if(this.$globalState.session.loginpath == '/login') { if (this.$globalState.session.loginpath == '/login') {
this.baseData.personTypeList.splice(1, 1) this.baseData.personTypeList.splice(1, 1)
this.configForm.merchantId = this.$globalState.session.merchantId this.configForm.merchantId = this.$globalState.session.merchantId
this.configForm.merchantName = this.$globalState.session.merchantName this.configForm.merchantName = this.$globalState.session.merchantName
const res = await this.$apis.points.getMerchantCharge({ merchantId: this.configForm.merchantId }) this.loading = true
if (res) { this.$apis.points.getMerchantCharge({ merchantId: this.configForm.merchantId }).then(res => {
this.totalFormData.map(e => { if (res) {
if (['gasCardServiceCharge', 'passageServiceCharge'].includes(e.name)) { this.totalFormData.map(e => {
const val = res[e.name] || 0 if (['gasCardServiceCharge', 'passageServiceCharge'].includes(e.name)) {
e.label = e.label.replace(/\d+/g, val) const val = res[e.name] || 0
this.chargeObject[e.name] = val e.label = e.label.replace(/\d+/g, val)
} this.chargeObject[e.name] = val
}) }
} })
} }
}, }).finally(() => {
this.loading = false
})
}
},
mounted() { mounted() {
const { id, type } = this.$route.query const { id, type } = this.$route.query
if (id) this.getDetail(id, type) if (id) this.getDetail(id, type)
...@@ -436,9 +440,9 @@ export default { ...@@ -436,9 +440,9 @@ export default {
handleConfirm() { handleConfirm() {
const { disabled, id } = this.pageObject const { disabled, id } = this.pageObject
if (disabled) return this.$router.go(-1) if (disabled) return this.$router.go(-1)
if(this.loading) { if (this.loading) {
return true return true
} }
this.$refs.fromRef.$refs.formRef.validate(async valid => { this.$refs.fromRef.$refs.formRef.validate(async valid => {
if (valid) { if (valid) {
try { try {
...@@ -486,7 +490,7 @@ export default { ...@@ -486,7 +490,7 @@ export default {
} }
if (id) params.id = id if (id) params.id = id
const res = await this.$apis.points.updateCustomerIntegral(params) const res = await this.$apis.points.updateCustomerIntegral(params)
console.log(res) console.log(res)
if (res.code == 0) { if (res.code == 0) {
this.$message({ this.$message({
message: id ? '编辑成功' : '创建成功', message: id ? '编辑成功' : '创建成功',
...@@ -494,8 +498,8 @@ export default { ...@@ -494,8 +498,8 @@ export default {
}) })
setTimeout(() => this.$router.go(-1), 1e3) setTimeout(() => this.$router.go(-1), 1e3)
} else { } else {
this.loading = false this.loading = false
} }
} catch (error) { } catch (error) {
this.loading = false this.loading = false
this.$message.error(error || '操作失败') this.$message.error(error || '操作失败')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!