Commit 2d175e1e by wangql
2 parents 42648b49 a2e738aa
...@@ -4,6 +4,9 @@ const sign = params => { ...@@ -4,6 +4,9 @@ const sign = params => {
const secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b' const secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const keys = Object.keys(params).sort() const keys = Object.keys(params).sort()
var str = [] var str = []
for (const key in params) {
if (typeof params[key] === 'object') params[key] = JSON.stringify(params[key])
}
keys.forEach(e => { keys.forEach(e => {
str.push(e + params[e]) str.push(e + params[e])
}) })
......
...@@ -54,13 +54,13 @@ ...@@ -54,13 +54,13 @@
label='员工信息' label='员工信息'
name='second' name='second'
> >
<gl-table :table="staffTableData"></gl-table> <gl-table v-loading="staffLoading" :table="staffTableData"></gl-table>
</gl-tab-pane> </gl-tab-pane>
<gl-tab-pane <gl-tab-pane
label='分组信息' label='分组信息'
name='third' name='third'
> >
<gl-table :table="groupTableData"> <gl-table v-loading="groupLoading" :table="groupTableData">
<gl-table-column align="center" v-for="(i, index) in groupTableData.column" :key="index" :label='i.label' :prop='i.prop' > <gl-table-column align="center" v-for="(i, index) in groupTableData.column" :key="index" :label='i.label' :prop='i.prop' >
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if='i.prop === "groupName"'> <template v-if='i.prop === "groupName"'>
...@@ -135,8 +135,8 @@ export default { ...@@ -135,8 +135,8 @@ export default {
// loading标记 // loading标记
// loading: [0, 0, 0], // loading: [0, 0, 0],
// basicLoading: false, // basicLoading: false,
// staffLoading: false, staffLoading: false,
// groupLoading: false, groupLoading: false,
// 标记merchantId是否改变 // 标记merchantId是否改变
IdChange: [0, 0, 0], IdChange: [0, 0, 0],
activeName: 'first', activeName: 'first',
...@@ -331,9 +331,11 @@ export default { ...@@ -331,9 +331,11 @@ export default {
this.IdChange[0] && this.getBasicInfo() this.IdChange[0] && this.getBasicInfo()
break break
case 'second': case 'second':
this.staffLoading = this.IdChange[1]
this.IdChange[1] && this.getStaffInfo() this.IdChange[1] && this.getStaffInfo()
break break
case 'third': case 'third':
this.groupLoading = this.IdChange[2]
this.IdChange[2] && this.getGroupInfo() this.IdChange[2] && this.getGroupInfo()
break break
} }
...@@ -375,10 +377,12 @@ export default { ...@@ -375,10 +377,12 @@ export default {
request.req(params).then(res => { request.req(params).then(res => {
this.staffTableData.data = res.merchantPersonals this.staffTableData.data = res.merchantPersonals
this.IdChange[1] = 0 this.IdChange[1] = 0
console.log(this.IdChange[1]) this.staffLoading = false
notice.okTips() // console.log(this.IdChange[1])
// notice.okTips()
}).catch(err => { }).catch(err => {
this.IdChange[1] = 0 this.IdChange[1] = 0
this.staffLoading = false
notice.errorTips(err) notice.errorTips(err)
}) })
}, },
...@@ -389,10 +393,12 @@ export default { ...@@ -389,10 +393,12 @@ export default {
request.req(params).then(res => { request.req(params).then(res => {
this.groupTableData.data = res.merchantGroups this.groupTableData.data = res.merchantGroups
this.IdChange[2] = 0 this.IdChange[2] = 0
console.log(this.IdChange[2]) this.groupLoading = false
notice.okTips() // console.log(this.IdChange[2])
// notice.okTips()
}).catch(err => { }).catch(err => {
this.IdChange[2] = 0 this.IdChange[2] = 0
this.groupLoading = false
notice.errorTips(err) notice.errorTips(err)
}) })
}, },
...@@ -404,8 +410,8 @@ export default { ...@@ -404,8 +410,8 @@ export default {
this.detailVisible() this.detailVisible()
request.req(params).then(res => { request.req(params).then(res => {
// console.log([res.parentMerchantLevel]) // console.log([res.parentMerchantLevel])
this.parentLevelTableData.data = [res.parentMerchantLevel] res.parentMerchantLevel && (this.parentLevelTableData.data = [res.parentMerchantLevel])
this.childLevelTableData.data = res.childMerchantLevels res.childMerchantLevels && (this.childLevelTableData.data = res.childMerchantLevels)
}).catch(err => { }).catch(err => {
// console.log(err) // console.log(err)
notice.errorTips(err) notice.errorTips(err)
......
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
ref="addForm" :model="addForm" ref="addForm" :model="addForm"
label-width="100px" label-width="100px"
:rules="rules"> :rules="rules">
<gl-form-item label="商户:" prop="merchant"> <gl-form-item label="商户:" prop="merchantId">
<gl-select <gl-select
v-model="addForm.merchant" v-model="addForm.merchantId"
filterable filterable
remote remote
clearable clearable
name="merchant" name="merchantId"
placeholder="请输入商户名称/商户号" placeholder="请输入商户名称/商户号"
data-vv-as="商户名称/商户号" data-vv-as="商户名称/商户号"
v-validate="'required'" v-validate="'required'"
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
:value="item.merchantId"> :value="item.merchantId">
</gl-option> </gl-option>
</gl-select> </gl-select>
<span v-show="errorBags.has('merchant')" class="error">{{ errorBags.first('merchant') }}</span> <span v-show="errorBags.has('merchantId')" class="error">{{ errorBags.first('merchantId') }}</span>
</gl-form-item> </gl-form-item>
<gl-form-item label="商户类型:" prop="merchantType"> <gl-form-item label="商户类型:" prop="merchantType">
<gl-select v-model="addForm.merchantType" <gl-select v-model="addForm.merchantType"
...@@ -49,11 +49,11 @@ ...@@ -49,11 +49,11 @@
<div v-for="(item, idx) in addList" :key="idx"> <div v-for="(item, idx) in addList" :key="idx">
<gl-form-item :label="item.label + ':'"> <gl-form-item :label="item.label + ':'">
<gl-select <gl-select
v-model="item.merchant" v-model="item.merchantId"
filterable filterable
remote remote
:name="`item.merchant${idx+1}`" :name="`item.merchantId${idx+1}`"
v-validate="item.merchant || item.merchantType ? 'required' : ''" v-validate="item.merchantId || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户`" :data-vv-as="`子商户`"
clearable clearable
placeholder="请输入商户名称/商户号" placeholder="请输入商户名称/商户号"
...@@ -67,13 +67,13 @@ ...@@ -67,13 +67,13 @@
</gl-option> </gl-option>
</gl-select> </gl-select>
<i v-show="item.show" class="el-icon-delete delete" @click="deleteBusiness(idx)"></i> <i v-show="item.show" class="el-icon-delete delete" @click="deleteBusiness(idx)"></i>
<span v-show="errorBags.has(`item.merchant${idx+1}`)" class="error">{{ errorBags.first(`item.merchant${idx+1}`) }}</span> <span v-show="errorBags.has(`item.merchantId${idx+1}`)" class="error">{{ errorBags.first(`item.merchantId${idx+1}`) }}</span>
<!-- <span v-show="item.merchant? !item.merchant : !!item.merchantType" class="error">{{ `请填写子商户${idx+1}的商户名称/商户号` }}</span> --> <!-- <span v-show="item.merchant? !item.merchant : !!item.merchantType" class="error">{{ `请填写子商户${idx+1}的商户名称/商户号` }}</span> -->
</gl-form-item> </gl-form-item>
<gl-form-item label="商户类型:"> <gl-form-item label="商户类型:">
<gl-select v-model="item.merchantType" <gl-select v-model="item.merchantType"
:name="`item.merchantType${idx+1}`" :name="`item.merchantType${idx+1}`"
v-validate="item.merchant || item.merchantType ? 'required' : ''" v-validate="item.merchantId || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户类型`" :data-vv-as="`子商户类型`"
clearable clearable
placeholder="请选择"> placeholder="请选择">
...@@ -115,12 +115,12 @@ export default { ...@@ -115,12 +115,12 @@ export default {
tip: false, // 添加下一个子商户的提示 tip: false, // 添加下一个子商户的提示
isAdd: false, // 添加子商户,需填写商户提示 isAdd: false, // 添加子商户,需填写商户提示
addForm: { addForm: {
merchant: '', merchantId: '',
merchantType: '' merchantType: ''
}, },
merchantTypeList: [], merchantTypeList: [],
rules: { rules: {
merchant: [{ required: true }], merchantId: [{ required: true }],
merchantType: [{ required: true }] merchantType: [{ required: true }]
}, },
// 远程搜索 // 远程搜索
...@@ -135,11 +135,11 @@ export default { ...@@ -135,11 +135,11 @@ export default {
addDialogVisible(val) { addDialogVisible(val) {
this.$validator.errors.clear() this.$validator.errors.clear()
}, },
'addForm.merchant'(val) { 'addForm.merchantId'(val) {
if (this.addList.length !== 0) { if (this.addList.length !== 0) {
this.addList.forEach(item => { this.addList.forEach(item => {
for(var j in item) { for(var j in item) {
if (j == 'merchant' || j == 'merchantType') { if (j == 'merchantId' || j == 'merchantType') {
item[j] = '' item[j] = ''
} }
} }
...@@ -157,17 +157,23 @@ export default { ...@@ -157,17 +157,23 @@ export default {
this.isAdd = false this.isAdd = false
this.$validator.validateAll().then((result) => { this.$validator.validateAll().then((result) => {
if (result) { if (result) {
if (this.addList.length !== 0) {
console.log(this.addList)
if (this.addList[0].merchantId) {
this.addList.forEach(item => { this.addList.forEach(item => {
delete item.label delete item.label
delete item.show
}) })
if (this.addList[0].merchantId) {
this.addForm.merchantRelationAdds = this.addList this.addForm.merchantRelationAdds = this.addList
} }
}
const params = this.$deep_clone(this.addForm) const params = this.$deep_clone(this.addForm)
params.groupId = this.groupId
console.log(params)
params.method = groupDetailMethods.Create params.method = groupDetailMethods.Create
request.req(params).then(res => { request.req(params).then(res => {
notice.okTips() notice.okTips()
this.showAddDialog() this.showAddDialog(true)
}).catch(err => { }).catch(err => {
notice.errorTips(err) notice.errorTips(err)
}) })
...@@ -175,34 +181,34 @@ export default { ...@@ -175,34 +181,34 @@ export default {
}) })
}, },
// 显示隐藏添加商户按钮 // 显示隐藏添加商户按钮
showAddDialog() { showAddDialog(t) {
this.$emit('addData') this.$emit('addData', t)
setTimeout(() => { setTimeout(() => {
this.addList = [] this.addList = []
this.addForm = { merchant: '', merchantType: '' } this.addForm = { merchantId: '', merchantType: '' }
}, 400) }, 400)
}, },
// 添加更多按钮 // 添加更多按钮
addMore() { addMore() {
console.log(this.addForm.merchant) console.log(this.addForm.merchantId)
if (this.addForm.merchant) { if (this.addForm.merchantId) {
this.isAdd = false this.isAdd = false
if (this.addList.length === 0) { if (this.addList.length === 0) {
this.addList.push({ this.addList.push({
label: '子商户' + (this.addList.length + 1), label: '子商户' + (this.addList.length + 1),
merchant: '', merchantId: '',
merchantType: '', merchantType: '',
show: true show: true
}) })
} else { } else {
const len = this.addList.length - 1 const len = this.addList.length - 1
if (this.addList[len].merchant == '' || this.addList[len].merchantType == '') { if (this.addList[len].merchantId == '' || this.addList[len].merchantType == '') {
this.tip = true this.tip = true
} else { } else {
this.tip = false this.tip = false
this.addList.push({ this.addList.push({
label: '子商户' + (this.addList.length + 1), label: '子商户' + (this.addList.length + 1),
merchant: '', merchantId: '',
merchantType: '', merchantType: '',
show: true show: true
}) })
...@@ -239,7 +245,7 @@ export default { ...@@ -239,7 +245,7 @@ export default {
this.childLoading = true this.childLoading = true
const params = {} const params = {}
params.groupId = this.groupId params.groupId = this.groupId
params.merchantId = this.addForm.merchant params.merchantId = this.addForm.merchantId
params.searchWrod = query params.searchWrod = query
params.method = groupDetailMethods.SearchChildList params.method = groupDetailMethods.SearchChildList
request.req(params).then(res => { request.req(params).then(res => {
......
...@@ -295,7 +295,10 @@ export default { ...@@ -295,7 +295,10 @@ export default {
addDialog() { addDialog() {
this.addDialogVisible = !this.addDialogVisible this.addDialogVisible = !this.addDialogVisible
}, },
handleAddData() { handleAddData(t) {
if (t) {
this.loadingGetList()
}
this.addDialogVisible = !this.addDialogVisible this.addDialogVisible = !this.addDialogVisible
}, },
getCityArea(params) { getCityArea(params) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!