|
@@ -6,17 +6,17 @@
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="经销商名称">
|
|
|
- <a-input id="dealerAccountList-productBrandName" v-model.trim="queryParam.productBrandName" allowClear placeholder="请输入经销商名称"/>
|
|
|
+ <a-input id="dealerAccountList-name" v-model.trim="queryParam.org.name" allowClear placeholder="请输入经销商名称"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="管理员账号">
|
|
|
- <a-input id="dealerAccountList-productBrandName" v-model.trim="queryParam.productBrandName" allowClear placeholder="请输入管理员账号"/>
|
|
|
+ <a-input id="dealerAccountList-loginName" v-model.trim="queryParam.loginName" allowClear placeholder="请输入管理员账号"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="账号状态">
|
|
|
- <v-select code="ENABLE_FLAG" id="dealerAccountList-state" v-model="queryParam.state" allowClear placeholder="请选择账号状态"></v-select>
|
|
|
+ <v-select code="ENABLE_FLAG" id="dealerAccountList-loginFlag" v-model="queryParam.loginFlag" allowClear placeholder="请选择账号状态"></v-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
@@ -41,8 +41,13 @@
|
|
|
:scroll="{ x: 1310, y: tableHeight }"
|
|
|
bordered>
|
|
|
<!-- 账号状态 -->
|
|
|
- <template slot="enableAction" slot-scope="text, record">
|
|
|
- <a-switch checkedChildren="启用" unCheckedChildren="禁用" v-model="record.enabledFlag" @change="changeFlagHandle(text, record)"/>
|
|
|
+ <template slot="loginFlag" slot-scope="text, record">
|
|
|
+ <a-switch
|
|
|
+ id="dealerAccountList-enable"
|
|
|
+ checkedChildren="启用"
|
|
|
+ unCheckedChildren="禁用"
|
|
|
+ @change="changeStatus(record)"
|
|
|
+ :checked="record.loginFlag == 1 ? true : false" />
|
|
|
<!-- <span v-else>{{ record.loginFlag==1?'已启用':'已禁用' }}</span> -->
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
@@ -68,25 +73,28 @@
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import dealerAccountEditModal from './editModal.vue'
|
|
|
import dealerAccountDetailModal from './detailModal.vue'
|
|
|
-import { dealerUserList } from '@/api/dealer'
|
|
|
+import { dealerUserList, dealerUserEnable, dealerUserResetP } from '@/api/dealer'
|
|
|
export default {
|
|
|
components: { STable, VSelect, dealerAccountEditModal, dealerAccountDetailModal },
|
|
|
data () {
|
|
|
return {
|
|
|
tableHeight: 0,
|
|
|
queryParam: { // 查询条件
|
|
|
- // productBrandName: '', // 品牌名称
|
|
|
- // enabledFlag: undefined // 状态
|
|
|
+ org: {
|
|
|
+ name: ''
|
|
|
+ },
|
|
|
+ loginName: '',
|
|
|
+ loginFlag: undefined
|
|
|
},
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
{ title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
|
|
|
- { title: '经销商名称', dataIndex: 'productBrandName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '管理员姓名', dataIndex: 'creatseDate', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '管理员账号', dataIndex: 'producstBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '授权用户数', dataIndex: 'productssBrandName', width: 140, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '状态', scopedSlots: { customRender: 'enableAction' }, width: 150, align: 'center' },
|
|
|
+ { title: '经销商名称', dataIndex: 'org.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '管理员姓名', dataIndex: 'name', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '管理员账号', dataIndex: 'loginName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '授权用户数', dataIndex: 'org.childUserMaxNum', width: 140, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '状态', scopedSlots: { customRender: 'loginFlag' }, width: 150, align: 'center' },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
@@ -100,6 +108,7 @@ export default {
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
+ data.list[i].loginFlag = Number(data.list[i].loginFlag)
|
|
|
}
|
|
|
this.disabled = false
|
|
|
return data
|
|
@@ -115,8 +124,9 @@ export default {
|
|
|
methods: {
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
- this.queryParam.productBrandName = ''
|
|
|
- this.queryParam.enabledFlag = undefined
|
|
|
+ this.queryParam.org.name = ''
|
|
|
+ this.queryParam.loginName = ''
|
|
|
+ this.queryParam.loginFlag = undefined
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 新增/编辑
|
|
@@ -149,26 +159,27 @@ export default {
|
|
|
content: '重置密码后,新的密码会以短信形式发送到【管理员手机】,确定要重置吗?',
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
- // salesDel({ id: row.id }).then(res => {
|
|
|
- // if (res.status == 200) {
|
|
|
- // _this.$message.success(res.message)
|
|
|
- // _this.$refs.table.refresh()
|
|
|
- // }
|
|
|
- // })
|
|
|
+ dealerUserResetP({ id: row.id }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 修改状态
|
|
|
- changeFlagHandle (text, record) {
|
|
|
- const _data = {
|
|
|
+ // 启用 禁用
|
|
|
+ changeStatus (record) {
|
|
|
+ const params = {
|
|
|
id: record.id,
|
|
|
- flag: record.enabledFlag ? '1' : '0'
|
|
|
+ flag: record.loginFlag == 1 ? '0' : '1'
|
|
|
}
|
|
|
- updateEnableStatus(_data).then(res => {
|
|
|
+ dealerUserEnable(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.$message.success(res.message)
|
|
|
+ this.$refs.table.refresh()
|
|
|
} else {
|
|
|
- record.enabledFlag = !record.enabledFlag
|
|
|
+ this.$refs.table.refresh()
|
|
|
}
|
|
|
})
|
|
|
}
|