Commit 828d5677 by wangql

修改代码

1 parent c22955f7
import { import {
GlAxios GlAxios
} from 'glsx-vue-common' } from 'glsx-vue-common'
const path = 'glsx.accounts.admin.merchant' const path = '/glsx.accounts.admin.merchant.group'
const __groupList = `${path}.group.dict` const __groupList = `${path}.dict`
const __create = `${path}.create`
const getMerchantGroupList = { const getMerchantGroupList = {
p: [__groupList], p: [__groupList],
req: params => GlAxios.get(__groupList, { params }) req: params => GlAxios.get(__groupList, { params })
} }
const createGroup = {
p: [__create],
req: params => GlAxios.get(__groupList, { params })
}
export { export {
getMerchantGroupList getMerchantGroupList,
createGroup
} }
...@@ -6,11 +6,13 @@ import { ...@@ -6,11 +6,13 @@ import {
saveMerchant saveMerchant
} from './bussinessListApi' } from './bussinessListApi'
import { import {
getMerchantGroupList getMerchantGroupList,
createGroup
} from './businessGroup' } from './businessGroup'
export { export {
getBusinessList, getBusinessList,
getList, getList,
saveMerchant, saveMerchant,
getMerchantGroupList getMerchantGroupList,
createGroup
} }
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<script> <script>
// import Edit from './Edit' // import Edit from './Edit'
// import { fn, treeCheckKeys, deleteEmptyAttribute } from '@/common/common' // import { fn, treeCheckKeys, deleteEmptyAttribute } from '@/common/common'
import { getMerchantGroupList } from '@/api' import { getMerchantGroupList, createGroup } from '@/api'
// import { NoticeMixin } from '@/mixins' // import { NoticeMixin } from '@/mixins'
// import Vue from 'vue' // import Vue from 'vue'
export default { export default {
...@@ -110,7 +110,9 @@ export default { ...@@ -110,7 +110,9 @@ export default {
}, },
watch: { watch: {
dialogVisible(val) { dialogVisible(val) {
this.$refs['addParams'].resetFields() if (!val) {
this.$refs['addParams'].resetFields()
}
} }
}, },
// mixins: [NoticeMixin], // mixins: [NoticeMixin],
...@@ -165,12 +167,12 @@ export default { ...@@ -165,12 +167,12 @@ export default {
}, },
{ {
label: '创建时间', label: '创建时间',
prop: 'createTime', prop: 'createTime'
formatter: cellValue => { // formatter: cellValue => {
if (cellValue.createTime) { // if (cellValue.createTime) {
return new Date(cellValue.createTime).format('yyyy-MM-dd') // return new Date(cellValue.createTime).format('yyyy-MM-dd')
} // }
} // }
} }
], ],
// number: { // number: {
...@@ -221,9 +223,8 @@ export default { ...@@ -221,9 +223,8 @@ export default {
getMerchantGroupList getMerchantGroupList
.req({}) .req({})
.then(res => { .then(res => {
console.log(res) this.total = res.pagination.totalCount
this.total = res.total this.tableData.data = res.groupDicts
this.tableData.data = res.list
this.tableLoading = false this.tableLoading = false
}) })
.catch(err => { .catch(err => {
...@@ -247,32 +248,27 @@ export default { ...@@ -247,32 +248,27 @@ export default {
handleSubmit(formName) { handleSubmit(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
alert('submit!') this.createGroup(this.addParams)
} else { } else {
console.log('error submit!!') console.log('error submit!!')
return false return false
} }
}) })
}, },
createGroup(params) {
createGroup
.req(params)
.then(res => {
console.log(res)
this.loadingGetList()
this.dialogVisible = !this.dialogVisible
})
.catch(err => console.log(err))
},
// 关闭新增分组弹出框 // 关闭新增分组弹出框
handleClose() { handleClose() {
this.dialogVisible = !this.dialogVisible this.dialogVisible = !this.dialogVisible
} }
// updateDialogClose() {
// console.log('关闭')
// this.updateVisible = !this.updateVisible
// this.loadingGetList()
// },
// deleteExp(objId) {
// if (objId) {
// mergeExp
// .req({ id: objId, deletedFlag: 'D' })
// .then(res => {
// this.loadingGetList()
// })
// .catch(err => console.log(err))
// }
// }
} }
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!