|
@ -1,18 +1,19 @@ |
|
|
import { mockData } from './mock'; |
|
|
import { mockData } from './mock'; |
|
|
import { cloneDeep } from 'lodash-es'; |
|
|
import { cloneDeep } from 'lodash-es'; |
|
|
import { Modal } from 'ant-design-vue'; |
|
|
import { Modal, message } from 'ant-design-vue'; |
|
|
import { createVNode, ref } from 'vue'; |
|
|
import { createVNode, ref } from 'vue'; |
|
|
import { NsMessage } from '/nerv-lib/component'; |
|
|
import { NsMessage } from '/nerv-lib/component'; |
|
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; |
|
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; |
|
|
import { enterPrise } from '/@/api/origanizemanage'; |
|
|
import { enterPrise } from '/@/api/origanizemanage'; |
|
|
|
|
|
|
|
|
|
|
|
type status = 'NORMAL' | 'FREEZE'; |
|
|
export const formConfig = [ |
|
|
export const formConfig = [ |
|
|
{ |
|
|
{ |
|
|
field: 'zuzhi', |
|
|
field: 'projectId', |
|
|
label: '组织ID', |
|
|
label: '组织ID', |
|
|
component: 'NsInput', |
|
|
component: 'NsInput', |
|
|
componentProps: { |
|
|
componentProps: { |
|
|
placeholder: '请输入组织ID', |
|
|
disabled: true, |
|
|
}, |
|
|
}, |
|
|
rules: [ |
|
|
rules: [ |
|
|
{ |
|
|
{ |
|
@ -50,19 +51,17 @@ export const formConfig = [ |
|
|
{ |
|
|
{ |
|
|
field: 'cityName', |
|
|
field: 'cityName', |
|
|
label: '省市区', |
|
|
label: '省市区', |
|
|
component: 'NsInputCity', |
|
|
component: 'NsCascader', |
|
|
defaultValue: '', |
|
|
|
|
|
fieldMap: ['provinceName', 'cityName', 'areaName', 'province', 'city', 'area'], |
|
|
|
|
|
componentProps: { |
|
|
componentProps: { |
|
|
placeholder: '请选择', |
|
|
placeholder: '请选择', |
|
|
api: '/api/parking_merchant/objs/BaseArea', |
|
|
api: enterPrise.getArea, |
|
|
isSeparate: true, |
|
|
fieldNames: { label: 'regionName', value: 'regionCode' }, |
|
|
|
|
|
showSearch: true, |
|
|
}, |
|
|
}, |
|
|
rules: [ |
|
|
rules: [ |
|
|
{ |
|
|
{ |
|
|
required: true, |
|
|
required: true, |
|
|
message: '请选择区域', |
|
|
message: '请选择省市区', |
|
|
trigger: 'blur', |
|
|
|
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
@ -76,7 +75,7 @@ export const formConfig = [ |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
field: 'person', |
|
|
field: 'contacts', |
|
|
label: '联系人', |
|
|
label: '联系人', |
|
|
component: 'NsInput', |
|
|
component: 'NsInput', |
|
|
componentProps: { |
|
|
componentProps: { |
|
@ -92,7 +91,7 @@ export const formConfig = [ |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
field: 'phone', |
|
|
field: 'phoneNumber', |
|
|
label: '联系电话', |
|
|
label: '联系电话', |
|
|
component: 'NsInput', |
|
|
component: 'NsInput', |
|
|
componentProps: { |
|
|
componentProps: { |
|
@ -119,14 +118,6 @@ export const tableConfig = (visible) => { |
|
|
name: 'RoleTypeAdd', |
|
|
name: 'RoleTypeAdd', |
|
|
type: 'primary', |
|
|
type: 'primary', |
|
|
handle: () => { |
|
|
handle: () => { |
|
|
opMap.type = 'add'; |
|
|
|
|
|
opMap.fuc = (formData: any) => { |
|
|
|
|
|
console.log(formData, 'formData'); |
|
|
|
|
|
mockData.value.push({ |
|
|
|
|
|
id: Math.random().toString().slice(2, 6), |
|
|
|
|
|
...cloneDeep(formData), |
|
|
|
|
|
}); |
|
|
|
|
|
}; |
|
|
|
|
|
visible.value = true; |
|
|
visible.value = true; |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
@ -144,11 +135,11 @@ export const tableConfig = (visible) => { |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '组织ID', |
|
|
title: '组织ID', |
|
|
dataIndex: 'orgCode', |
|
|
dataIndex: 'projectId', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '集团名称', |
|
|
title: '集团名称', |
|
|
dataIndex: 'intro', |
|
|
dataIndex: 'cliqueName', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '组织名称', |
|
|
title: '组织名称', |
|
@ -157,6 +148,9 @@ export const tableConfig = (visible) => { |
|
|
{ |
|
|
{ |
|
|
title: '状态', |
|
|
title: '状态', |
|
|
dataIndex: 'status', |
|
|
dataIndex: 'status', |
|
|
|
|
|
customRender: ({ value }) => { |
|
|
|
|
|
return { NORMAL: '正常', FREEZE: '冻结' }[value as status]; |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '省市区', |
|
|
title: '省市区', |
|
@ -172,15 +166,16 @@ export const tableConfig = (visible) => { |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '联系人', |
|
|
title: '联系人', |
|
|
dataIndex: 'person', |
|
|
dataIndex: 'contacts', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '联系电话', |
|
|
title: '联系电话', |
|
|
dataIndex: 'phone', |
|
|
dataIndex: 'phoneNumber', |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
columnActions: { |
|
|
columnActions: { |
|
|
title: '操作', |
|
|
title: '操作', |
|
|
|
|
|
autoMergeAction: false, |
|
|
actions: [ |
|
|
actions: [ |
|
|
{ |
|
|
{ |
|
|
label: '编辑', |
|
|
label: '编辑', |
|
@ -211,18 +206,26 @@ export const tableConfig = (visible) => { |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '冻结', |
|
|
label: '冻结', |
|
|
name: 'RoleTypeEdit', |
|
|
name: 'enterPriseFreeze', |
|
|
handle: (record: any) => { |
|
|
confirm: true, |
|
|
console.log(record, 'record'); |
|
|
isReload: true, |
|
|
Modal.confirm({ |
|
|
ifShow: ({ status }) => status === 'NORMAL', |
|
|
title: '是否冻结该账户', |
|
|
api: enterPrise.freeze, |
|
|
icon: createVNode(ExclamationCircleOutlined), |
|
|
dynamicParams: 'orgId', |
|
|
content: createVNode('div', { style: 'color:red;' }, ''), |
|
|
defaultParams: { |
|
|
onOk() { |
|
|
isFreeze: true, |
|
|
NsMessage.success('冻结成功'); |
|
|
|
|
|
}, |
|
|
}, |
|
|
class: 'test', |
|
|
}, |
|
|
}); |
|
|
{ |
|
|
|
|
|
label: '解冻', |
|
|
|
|
|
name: 'enterPriseUnFreeze', |
|
|
|
|
|
confirm: true, |
|
|
|
|
|
isReload: true, |
|
|
|
|
|
ifShow: ({ status }) => status === 'FREEZE', |
|
|
|
|
|
dynamicParams: 'orgId', |
|
|
|
|
|
api: enterPrise.freeze, |
|
|
|
|
|
defaultParams: { |
|
|
|
|
|
isFreeze: false, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|