用户新消息

szh-new
lijingjia 4 months ago
parent 56523ff8c9
commit 93eaa67fbe

@ -8,7 +8,7 @@ enum Api {
GetOrgInfo = '/mainApi/Org/GetOrgInfo',
GetOrgTree = '/mainApi/Org/GetOrgTree',
GetOrgList = '/mainApi/Common/GetOrgList',
BatchDelOrg = '/mainApi/Org/BatchDelOrg',
GetBankList = '/mainApi/Bank/GetBankList',
EditBank = '/mainApi/Bank/EditBank',
GetBankInfo = '/mainApi/Bank/GetBankInfo',
@ -70,4 +70,13 @@ export function getBankInfo(query: { id: string }) {
method: 'get',
params: query,
})
}
}
// 组织机构删除
export function BatchDelOrg(data: any) {
return request<DataResult>({
url: Api.BatchDelOrg,
method: 'post',
data
})
}

@ -6,6 +6,7 @@ enum Api {
list = '/mainApi/User/GetUserList',
editUser = '/mainApi/User/EditUser',
getUser = '/mainApi/User/GetUserInfo',
BatchDelUser = '/mainApi/User/BatchDelUser'
}
export function getUserList(data: PageRequest) {
return request<DataResult>({
@ -26,6 +27,14 @@ export function getUser(query: { id: string }) {
return request<DataResult>({
url: Api.getUser,
method: 'get',
params: query,
params: query
})
}
export function BatchDelUser(data: any) {
return request<DataResult>({
url: Api.BatchDelUser,
method: 'post',
data
})
}

@ -74,6 +74,7 @@
border-left: 0.7px solid #ABCDFF;
color: #257AFA;
padding-left: 3px;
margin-left: 4px;
}
}
}

@ -36,7 +36,7 @@
.ant-modal-footer {
border-top: none!important;
padding: 5px 30px 20px!important;
padding: 15px 30px 20px!important;
.ant-btn {
height: 26px;
width: 100px;

@ -22,7 +22,8 @@ import {
GetTruckClientList,
GetDispatcherList,
GetFactorySelectList,
GetCodeCountryList
GetCodeCountryList,
GetClientGoodsList
} from '/@/views/operation/seaexport/api/BookingLedger'
import { getList } from '/@/views/flowcenter/flowInstances/api'
import { GetFeeCurrencySelectList, GetClientListByCode, GetCtnSelectList, GetTenantParamSelectList } from '/@/api/common/index'
@ -177,5 +178,11 @@ export default {
return GetTenantParamSelectList().then((res) => {
return res.data
})
}
},
// 商品
GetClientGoodsList: () => {
return GetClientGoodsList().then((res) => {
return res.data
})
},
}

@ -59,7 +59,9 @@ export const useOptionsStore = defineStore({
// 箱型
GetCtnSelectList: null,
// 客户参数类别
GetTenantParamSelectList: null
GetTenantParamSelectList: null,
// 商品
GetClientGoodsList: null,
}),
getters: {
// 通过code获取下拉字典code)就是接口尾部单词

@ -51,7 +51,7 @@
const loading = ref(false)
const rowId = ref('')
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, getFieldList }] = useForm({
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
labelWidth: 100,
schemas: formSchema,
showActionButtonGroup: false,
@ -64,7 +64,7 @@
// setModalProps({ confirmLoading: true });
rowId.value = data.record.id
const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
getFieldList()
// getFieldList()
if (res.succeeded) {
setFieldsValue({
...res.data,

@ -2045,3 +2045,22 @@ export function SeaExportTaskAudit(data) {
data
})
}
// 获取商品下拉列表 (Auth)
export function GetClientGoodsList(params) {
return request({
url: '/mainApi/ClientCommon/GetClientGoodsList',
method: 'get',
params
})
}
// 删除联系人
export function BatchDelBusinessOrderContact(data) {
return request({
url: '/opApi/BusinessOrderContact/BatchDelBusinessOrderContact',
method: 'post',
data
})
}

@ -11,21 +11,6 @@
>
<!-- 包装表单 -->
<BasicForm @register="registerForm">
<template #customerContactId="data">
<a-select
v-model:value="data.values.customerContactId"
:default-active-first-option="false"
:show-arrow="false"
allowClear
:filter-option="false"
:not-found-content="null"
@change="personChange"
>
<a-select-option v-for="item in personList" :label="item.shortName" :key="item.id" :value="item.id">
{{ item.shortName }}
</a-select-option>
</a-select>
</template>
</BasicForm>
<!--右下角按钮-->
<template #footer>
@ -55,7 +40,7 @@
//
import { personFormSchema } from './baseInfo'
//
import { EditBusinessOrderContact, GetBusinessOrderContactInfo, GetOrderContactListByClientId } from '/@/views/operation/seaexport/api/BookingLedger'
import { EditBusinessOrderContact, GetBusinessOrderContactInfo } from '/@/views/operation/seaexport/api/BookingLedger'
//
import { useMessage } from '/@/hooks/web/useMessage'
// Emits
@ -64,8 +49,6 @@
// loading
const loading = ref(false)
const rowId = ref('')
//
const personList = ref([])
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] =
useForm({
@ -75,10 +58,6 @@
})
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => {
//
GetOrderContactListByClientId({ businessId: data.id }).then(res => {
personList.value = res.data
})
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate

@ -5,13 +5,14 @@ import { ref } from 'vue'
import { BasicColumn, FormSchema } from '/@/components/Table'
import { getDictOption } from '/@/utils/dictUtil'
import { getOptions } from '/@/hooks/dict'
// 下拉框数据接口
import { GetClientListByCode } from '/@/api/common'
import {
GetClientSourceDetailSelectList,
GetDeptList,
GetPackageSelectList,
GetOrderContactListByClientId
} from '/@/views/operation/seaexport/api/BookingLedger'
// 兄弟传参,订舱代理变化使用
import emitter from '/@/utils/Bus'
import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore()
const LockType = [
@ -166,7 +167,6 @@ export const basicInfoFormSchema: FormSchema[] = [
api: () => {
return new Promise((resolve) => {
const arr = getOptions('shippercn')
console.log(arr)
resolve(arr)
})
},
@ -372,7 +372,7 @@ export const basicInfoFormSchema: FormSchema[] = [
label: '结算日期',
component: 'DatePicker',
required: false,
dynamicDisabled: true,
dynamicDisabled: false,
// defaultValue: '',
colProps: { span: 4 },
componentProps: {
@ -1257,7 +1257,6 @@ export const mailingInfoFormSchemaR: FormSchema[] = [
data.forEach((item) => {
item.portName = `${item.portName}(${item.ediCode})`
})
console.log(data)
resolve({ data })
})
},
@ -1388,7 +1387,6 @@ export const mailingInfoFormSchemaR: FormSchema[] = [
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e, obj) => {
console.log(e, obj)
if (obj) {
formModel.transPort = obj.ediCode
formModel.transPortId = obj.value
@ -2187,23 +2185,39 @@ export const cargoInfoFormSchema2: FormSchema[] = [
]
export const cargoInfoFormSchema3: FormSchema[] = [
{
label: '',
field: 'goodsName',
component: 'Input',
show: false
},
{
field: 'goodsId',
label: '品名',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
// defaultValue: '',
colProps: { span: 8 },
componentProps: () => {
componentProps: ({ formModel }) => {
return {
option: optionsStore.getOptionsByCode('GetPackageSelectList'),
option: optionsStore.getOptionsByCode('GetClientGoodsList'),
allowClear: true,
showSearch: true,
labelField: 'packageName',
labelField: 'goodName',
valueField: 'id',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (v, obj) => {
if (obj) {
formModel.goodsName = obj.label
if (obj.hsCode) {
formModel.hsCode = obj.hsCode
}
} else {
formModel.goodsName = ''
}
},
}
},
},
@ -2714,6 +2728,13 @@ export const otherInfoFormSchema: FormSchema[] = [
}
]
// 客户类别下拉框数据
const customTypeDict = ref([])
const companyDict = ref([])
const personList = ref([])
getDictOption('djy_cust_prop').then((data) => {
customTypeDict.value = data
})
// 关系人表单
export const personFormSchema: FormSchema[] = [
{
@ -2722,14 +2743,101 @@ export const personFormSchema: FormSchema[] = [
component: 'Input',
show: false
},
{
field: 'customerType',
label: '客户类型',
component: 'Select',
colProps: { span: 12 },
componentProps: ({ formModel }) => {
return {
options: customTypeDict.value,
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (v: string, obj) => {
GetClientListByCode({ code: v }).then((res) => {
const { data } = res
data.forEach((item) => {
item['label'] = item.shortName
item['value'] = item.id
})
companyDict.value = data
})
if (obj) {
formModel.customerTypeName = obj.label
} else {
// 情况联系人和
formModel.customerTypeName = ''
}
formModel.customerId = ''
formModel.customerName = ''
formModel.customerContactId = ''
formModel.name = ''
},
}
},
},
{
field: 'customerId',
label: '客户名称',
defaultValue: '',
component: 'Select',
colProps: { span: 12 },
componentProps: ({ formModel }) => {
return {
options: companyDict.value,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (v, obj) => {
formModel.customerName = obj.label
formModel.customerContactId = null
if (obj) {
formModel.name = null
// 设置关系人下拉
GetOrderContactListByClientId({ id: v }).then(res => {
personList.value = res.data.map(item => {
return {
label: item.shortName,
value: item.id
}
})
})
}
}
}
}
},
{
field: 'customerName',
label: '',
component: 'Input',
show: false
},
{
field: 'customerContactId',
label: '联系人',
component: 'ApiSelect',
component: 'Select',
required: false,
dynamicDisabled: false,
slot: 'customerContactId',
colProps: { span: 12 },
componentProps: ({ formModel }) => {
return {
options: personList.value,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (v, obj) => {
if (obj) {
formModel.name = obj.label
} else {
formModel.name = null
}
}
}
}
},
{
field: 'name',
@ -2749,33 +2857,6 @@ export const personFormSchema: FormSchema[] = [
component: 'Input',
colProps: { span: 12 },
},
{
field: 'customerType',
label: '客户类别',
defaultValue: '',
component: 'ApiSelect',
colProps: { span: 12 },
componentProps: ({ formModel }) => {
return {
api: () => {
return new Promise((resolve) => {
getDictOption('djy_cust_prop').then((res) => {
resolve(res)
})
})
},
labelField: 'label',
valueField: 'value',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (v, obj) => {
if (obj) formModel.customerTypeName = obj.label
}
}
}
},
{
field: 'customerTypeName',
label: '',

@ -31,7 +31,7 @@
<span v-show="item.values.hblno" class="iconfont icon-fuzhi11" @click="copyTxt(item, 'hblno')"></span>
</template>
<!-- label插槽 -->
<template #customerId="item">
<!-- <template #customerId="item">
<span class="iconfont icon-tuandui" @click="openPersonModal(item, '委托单位', 'customerId')"></span>
</template>
<template #truckerId="item">
@ -51,7 +51,7 @@
</template>
<template #customserId="item">
<span class="iconfont icon-tuandui" @click="openPersonModal(item, '报关行', 'customserId')"></span>
</template>
</template> -->
<template #isBusinessLocking="item">
<span class="lock-box" style="margin-right: 15px;">
业务锁定
@ -73,7 +73,7 @@
<span v-if="item.isFeeLocking" class="iconfont icon-chenggong"></span>
</template> -->
</BasicForm>
<a-modal
<!-- <a-modal
v-model:visible="visible"
title="关系人"
width="80%"
@ -107,26 +107,26 @@
</template>
</BasicTable>
<template #footer></template>
</a-modal>
<PersonModal @register="registerModal" @success="handleSuccess" />
</a-modal> -->
<!-- <PersonModal @register="registerModal" @success="handleSuccess" /> -->
</div>
</template>
<script lang="ts" setup>
import { BasicForm, useForm } from '/@/components/Form/index'
import { basicInfoFormSchema, personColumns } from './baseInfo.tsx'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
// import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { ref, watch, onMounted } from 'vue'
import { GetBusinessOrderContactList } from '/@/views/operation/seaexport/api/BookingLedger'
import { useMessage } from '/@/hooks/web/useMessage'
import { formatParams } from '/@/hooks/web/common'
import PersonModal from './PersonModal.vue'
// import PersonModal from './PersonModal.vue'
const { createMessage } = useMessage()
import { useModal } from '/@/components/Modal'
import { useRoute } from 'vue-router'
const route = useRoute()
//
const source = ref(route.query.source || 'edit')
const [registerModal, { openModal }] = useModal()
// const [registerModal, { openModal }] = useModal()
const props = defineProps({
details: { type: Object, default: {} },
})
@ -139,52 +139,52 @@
showActionButtonGroup: false,
size: 'small',
})
const visible = ref(false)
// const visible = ref(false)
// id
let companyId = ''
//
const [registerTable, { reload, getForm, getPaginationRef }] = useTable({
api: async (p) => {
const res: API.DataResult = await GetBusinessOrderContactList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
},
beforeFetch: (p) => {
p['businessId'] = props.details.id
return formatParams(p)
},
columns: personColumns,
isTreeTable: false,
pagination: true,
striped: true,
formConfig: {
labelWidth: 120,
schemas: [
{
label: '联系人',
field: 'name',
component: 'Input',
colProps: { span: 4 }
}
]
},
useSearchForm: true,
showTableSetting: false,
bordered: true,
showIndexColumn: true,
rowSelection: {
type: 'checkbox'
},
canResize: false,
actionColumn: {
width: 50,
title: '操作',
dataIndex: 'action',
fixed: 'right'
}
})
//
// const [registerTable, { reload, getForm, getPaginationRef }] = useTable({
// api: async (p) => {
// const res: API.DataResult = await GetBusinessOrderContactList(p)
// return new Promise((resolve) => {
// resolve({ data: [...res.data], total: res.count })
// })
// },
// beforeFetch: (p) => {
// p['businessId'] = props.details.id
// return formatParams(p)
// },
// columns: personColumns,
// isTreeTable: false,
// pagination: true,
// striped: true,
// formConfig: {
// labelWidth: 120,
// schemas: [
// {
// label: '',
// field: 'name',
// component: 'Input',
// colProps: { span: 4 }
// }
// ]
// },
// useSearchForm: true,
// showTableSetting: false,
// bordered: true,
// showIndexColumn: true,
// rowSelection: {
// type: 'checkbox'
// },
// canResize: false,
// actionColumn: {
// width: 50,
// title: '',
// dataIndex: 'action',
// fixed: 'right'
// }
// })
// //
const RefChilrenRef = ref('')
function TransferData() {
let Arr: any = []
@ -208,28 +208,28 @@
return createMessage.warning(`请选择${type}`)
}
companyType = type
visible.value = true
// visible.value = true
}
//
const create = () => {
openModal(true, {
isUpdate: false,
companyType,
companyId
})
}
function handleSuccess() {
reload()
}
// const create = () => {
// openModal(true, {
// isUpdate: false,
// companyType,
// companyId
// })
// }
// function handleSuccess() {
// reload()
// }
//
function handleEdit(record) {
openModal(true, {
record,
isUpdate: true,
companyType,
companyId
})
}
// function handleEdit(record) {
// openModal(true, {
// record,
// isUpdate: true,
// companyType,
// companyId
// })
// }
//
const copyTxt = (v, key) => {
navigator.clipboard.writeText(v.values[key])
@ -250,6 +250,12 @@
basicInfoFormSchema.forEach(item => {
item.dynamicDisabled = true
})
} else {
basicInfoFormSchema.forEach(item => {
if (item.field != 'customerNo') {
item.dynamicDisabled = false
}
})
}
})
defineExpose({

@ -1,5 +1,5 @@
<template>
<div>
<a-spin :spinning="loading">
<BasicTable
class="ds-table-detail"
@register="registerTable"
@ -10,10 +10,17 @@
<span class="iconfont icon-new_document"></span>
新增
</a-button>
<a-button type="link" @click="del">
<span class="iconfont icon-shanchu2"></span>
删除
</a-button>
<a-popconfirm
title="确定删除当前选中数据?"
ok-text="是"
cancel-text="否"
@confirm="del"
>
<a-button type="link">
<span class="iconfont icon-shanchu21"></span>
删除
</a-button>
</a-popconfirm>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
@ -30,26 +37,27 @@
</template>
</BasicTable>
<PersonModal @register="registerModal" @success="handleSuccess" />
</div>
</a-spin>
</template>
<script lang="ts" setup>
import { BasicForm, useForm } from '/@/components/Form/index'
import { ref } from 'vue'
import { personColumns } from './baseInfo.tsx'
import { BasicTable, useTable } from '/@/components/Table'
import { ref, watch, onMounted } from 'vue'
import { GetBusinessOrderContactList } from '/@/views/operation/seaexport/api/BookingLedger'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { GetBusinessOrderContactList, BatchDelBusinessOrderContact } from '/@/views/operation/seaexport/api/BookingLedger'
import { useMessage } from '/@/hooks/web/useMessage'
import { useModal } from '/@/components/Modal'
import { formatParams } from '/@/hooks/web/common'
import PersonModal from './PersonModal.vue'
const [registerModal, { openModal }] = useModal()
const { createMessage } = useMessage()
// loading
const loading = ref(false)
const props = defineProps({
id: { type: String },
})
//
const [registerTable, { reload, getForm, getPaginationRef }] = useTable({
const [registerTable, { reload, getForm, getSelectRows }] = useTable({
api: async (p) => {
const res: API.DataResult = await GetBusinessOrderContactList(p)
return new Promise((resolve) => {
@ -97,4 +105,24 @@
id: props.id
})
}
//
const del = () => {
const select = getSelectRows()
console.log(select)
if (select.length === 0) {
createMessage.warning('请选择要删除的联系人!')
return false
}
const removeArr = select.map((item) => {
return item.id
})
loading.value = true
BatchDelBusinessOrderContact({ ids: removeArr }).then(res => {
loading.value = false
reload()
createMessage.success('删除成功!')
}).catch(() => {
loading.value = false
})
}
</script>

@ -8,33 +8,27 @@
@ok="handleSave"
>
<BasicForm @register="registerForm">
<template #isDefault="item">
<a-switch @change="changeIsDefault" v-model:checked="item.values.isDefault" /> <span class="s-txt" :class="{ 's-active': item.values.isDefault }">{{ item.values.isDefault ? '是' : '否'}}</span>
</template>
<template #status="item">
<a-switch @change="changeStatus" v-model:checked="item.values.status" /> <span class="s-txt" :class="{ 's-active': item.values.status }">{{ item.values.status ? '启用' : '禁用'}}</span>
</template>
</BasicForm>
<!--右下角按钮-->
<template #footer>
<a-button
pre-icon="ant-design:close-outlined"
type="warning"
type="default"
:loading="loading"
ghost
style="margin-right: 0.8rem"
@click="closeModal"
>取消</a-button
>
<a-button
type="success"
:loading="loading"
pre-icon="ant-design:check-outlined"
style="margin-right: 0.8rem"
@click="handleSave(false)"
>仅保存</a-button
>
<a-button
pre-icon="ant-design:check-circle-outlined"
type="primary"
:loading="loading"
@click="handleSave(true)"
>保存并关闭</a-button
>保存</a-button
>
</template>
</BasicModal>
@ -62,15 +56,17 @@
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields()
console.log(data, 1111111111)
// initData().then(async () => {
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
linkId.value = data.linkId ? data.linkId : ''
if (unref(isUpdate)) {
rowId.value = data.record.id ? data.record.id : data.record.value
const res: API.DataResult = await getBankInfo({ id: unref(rowId) })
if (res.data.status == 1) {
res.data.status = true
} else {
res.data.status = false
}
if (res.succeeded) {
setFieldsValue({
...res.data,
@ -78,32 +74,35 @@
}
} else {
setFieldsValue({ permissionIdentity: unref(2) })
console.log(data.orgFullName)
if (data.orgFullName) setFieldsValue({ accountName: data.orgFullName })
}
setModalProps({ loading: false })
// })
})
const getTitle = computed(() => (!unref(isUpdate) ? '新增账户信息' : '编辑账户信息'))
// Switch
const changeIsDefault = (v) => {
setFieldsValue({ isDefault: v })
}
const changeStatus = (v) => {
setFieldsValue({ status: v })
}
async function handleSave(exit) {
try {
const values = await validate()
setModalProps({ confirmLoading: true, loading: true })
values.linkId = values.linkId ? values.linkId : linkId.value
if (values.status) {
values.status == 1
} else {
values.status == 0
}
const res: API.DataResult = await editBank(values)
if (res.succeeded) {
createMessage.success(res.message)
emit('success')
//
if (!exit) {
if (unref(isUpdate)) {
await refresh()
} else {
rowId.value = res.data
isUpdate.value = true
await refresh()
}
}
} else {
createMessage.error(res.message)
}
@ -123,3 +122,16 @@
}
}
</script>
<style lang="less" scoped>
.s-txt {
font-size: 12px;
margin-left: 10px;
color: #7A8798;
position: relative;
top: 1px;
}
.s-active {
color: #257AFA;
}
</style>

@ -10,17 +10,21 @@
<a-tab-pane key="0" tab="机构信息">
<BasicForm @register="registerForm">
<template #isDepartment="item">
<a-switch v-model:checked="item.isDepartment" /> <span class="mt10">{{ item.isDepartment ? '是' : '否'}}</span>
<a-switch @change="changeIsDepartment" v-model:checked="item.values.isDepartment" /> <span class="s-txt" :class="{ 's-active': item.values.isDepartment }">{{ item.values.isDepartment ? '是' : '否'}}</span>
</template>
<template #status="item">
<a-switch v-model:checked="item.status" /> <span class="mt10">{{ item.status ? '启用' : '禁用'}}</span>
<a-switch @change="changeStatus" v-model:checked="item.values.status" /> <span class="s-txt" :class="{ 's-active': item.values.status }">{{ item.values.status ? '启用' : '禁用'}}</span>
</template>
</BasicForm>
</a-tab-pane>
<a-tab-pane key="1" tab="账户信息" force-render>
<BasicTable @register="registerBankTable">
<template #toolbar>
<a-button type="primary" @click="AddBank"> </a-button>
<template #tableTitle>
<h4 class="mr15" style="margin-bottom: 0;">账户信息</h4>
<a-button type="link" @click="AddBank">
<span class="iconfont icon-new_document"></span>
新增
</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
@ -30,7 +34,7 @@
icon: 'clarity:note-edit-line',
tooltip: '编辑',
onClick: EditBank.bind(null, record),
},
}
]"
/>
</template>
@ -42,28 +46,15 @@
<!--右下角按钮-->
<template #footer>
<a-button
pre-icon="ant-design:close-outlined"
type="warning"
:loading="loading"
ghost
style="margin-right: 0.8rem"
@click="closeModal"
>取消</a-button
>
<a-button
type="success"
:loading="loading"
pre-icon="ant-design:check-outlined"
style="margin-right: 0.8rem"
@click="handleSave(false)"
>仅保存</a-button
>
<a-button
pre-icon="ant-design:check-circle-outlined"
type="primary"
:loading="loading"
@click="handleSave(true)"
>保存并关闭</a-button
>保存</a-button
>
</template>
</BasicModal>
@ -91,7 +82,7 @@
const activeKey = ref('0')
const linkId = ref()
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] = useForm({
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] = useForm({
labelWidth: 100,
schemas: formSchema,
showActionButtonGroup: false,
@ -109,6 +100,11 @@
if (unref(isUpdate)) {
rowId.value = data.record.id ? data.record.id : data.record.value
const res: API.DataResult = await getOrgInfo({ id: unref(rowId) })
if (res.data.status == 1) {
res.data.status = true
} else {
res.data.status = false
}
if (res.succeeded) {
linkId.value = res.data.id
setFieldsValue({
@ -121,11 +117,11 @@
}
setModalProps({ loading: false })
if (!props.ParentId) {
updateSchema({ field: 'isDepartment', componentProps: { disabled: true } })
} else {
updateSchema({ field: 'isDepartment', componentProps: { disabled: false } })
}
// if (!props.ParentId) {
// updateSchema({ field: 'isDepartment', componentProps: { disabled: true } })
// } else {
// updateSchema({ field: 'isDepartment', componentProps: { disabled: false } })
// }
})
})
async function initData() {
@ -173,16 +169,6 @@
if (res.succeeded) {
createMessage.success(res.message)
emit('success')
//
if (!exit) {
if (unref(isUpdate)) {
await refresh()
} else {
rowId.value = res.data
isUpdate.value = true
await refresh()
}
}
} else {
createMessage.error(res.message)
}
@ -195,6 +181,11 @@
}
async function refresh() {
const res: API.DataResult = await getOrgInfo({ id: unref(rowId) })
if (res.data.status == 1) {
res.data.status = true
} else {
res.data.status = false
}
if (res.succeeded) {
await setFieldsValue({
...res.data,
@ -202,7 +193,6 @@
}
}
const [registerBankTable, { reload, getPaginationRef }] = useTable({
title: '账户信息',
immediate: false,
api: async (p) => {
const res: API.DataResult = await getBankList(p)
@ -232,12 +222,11 @@
},
pagination: true,
canResize: true,
resizeHeightOffset: 330,
actionColumn: {
width: 80,
width: 60,
title: '操作',
dataIndex: 'action',
fixed: 'right',
fixed: 'right'
},
columns: BankColumns,
})
@ -246,6 +235,7 @@
openModal(true, {
isParent: false,
isUpdate: false,
orgFullName: getFieldsValue().orgFullName,
linkId: linkId.value,
})
}
@ -260,6 +250,13 @@
initData()
reload()
}
// Switch
const changeIsDepartment = (v) => {
setFieldsValue({ IsDepartment: v })
}
const changeStatus = (v) => {
setFieldsValue({ status: v })
}
function tabChange(e) {
if (e == 1 && !rowId.value) {
createMessage.warning('请先保存基础信息')
@ -267,3 +264,16 @@
}
}
</script>
<style lang="less" scoped>
.s-txt {
font-size: 12px;
margin-left: 10px;
color: #7A8798;
position: relative;
top: 1px;
}
.s-active {
color: #257AFA;
}
</style>

@ -64,7 +64,7 @@ export const columns: BasicColumn[] = [
width: 150,
},
{
title: '工商登记号',
title: '社会信用代码',
dataIndex: 'licenseCode',
width: 150,
},
@ -79,7 +79,7 @@ export const columns: BasicColumn[] = [
width: 150,
},
{
title: '本地货币',
title: '本币',
dataIndex: 'localCurrency',
width: 150,
},
@ -397,7 +397,7 @@ export const formSchema: FormSchema[] = [
{
field: 'isDepartment',
slot: 'isDepartment',
component: 'RadioButtonGroup',
component: 'Switch',
label: '是否部门标识',
required: true,
componentProps: {
@ -413,14 +413,14 @@ export const formSchema: FormSchema[] = [
},
{
field: 'status',
component: 'RadioButtonGroup',
component: 'Switch',
slot: 'status',
label: '状态',
required: true,
componentProps: {
options: [
{ label: '启用', value: 0 },
{ label: '禁用', value: 1 },
{ label: '启用', value: 1 },
{ label: '禁用', value: 0 },
],
},
defaultValue: 0,
@ -517,14 +517,6 @@ export const BankColumns: BasicColumn[] = [
},
]
export const BankformSchema: FormSchema[] = [
{
field: 'divider-selects',
component: 'Divider',
label: '账户信息',
colProps: {
span: 24,
},
},
{
label: '',
field: 'id',
@ -552,7 +544,7 @@ export const BankformSchema: FormSchema[] = [
field: 'currency',
label: '币别',
component: 'ApiSelect',
defaultValue: '',
defaultValue: 'CNY',
colProps: { span: 12 },
componentProps: () => {
return {
@ -576,15 +568,6 @@ export const BankformSchema: FormSchema[] = [
span: 12,
},
},
{
label: '银行名称2',
field: 'bankName2',
component: 'Input',
defaultValue: '',
colProps: {
span: 12,
},
},
{
label: '银行账户',
field: 'bankAccountNo',
@ -632,13 +615,12 @@ export const BankformSchema: FormSchema[] = [
},
{
field: 'isDefault',
component: 'RadioButtonGroup',
component: 'Switch',
slot: 'isDefault',
label: '是否默认',
required: true,
componentProps: {
options: [
// { label: '是', value: 1 },
// { label: '否', value: 0 },
{ label: '是', value: true },
{ label: '否', value: false },
],
@ -650,16 +632,17 @@ export const BankformSchema: FormSchema[] = [
},
{
field: 'status',
component: 'RadioButtonGroup',
component: 'Switch',
slot: 'status',
label: '状态',
required: true,
componentProps: {
options: [
{ label: '启用', value: 0 },
{ label: '禁用', value: 1 },
],
{ label: '启用', value: 1 },
{ label: '禁用', value: 0 },
]
},
defaultValue: 0,
defaultValue: true,
colProps: {
span: 6,
},

@ -45,6 +45,17 @@
tooltip: '编辑',
onClick: handleEdit.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
tooltip: '删除',
color: 'error',
popConfirm: {
title: '是否要删除此条数据?',
okText: '是',
cancelText: '否',
confirm: handleDelete.bind(null, record)
}
}
]"
/>
</template>
@ -56,13 +67,14 @@
<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { getOrgList, getOrgTree } from '/@/api/system/org'
import { getOrgList, getOrgTree, BatchDelOrg } from '/@/api/system/org'
import { useModal } from '/@/components/Modal'
import OrgModal from './OrgModal.vue'
import { BasicTree } from '/@/components/Tree/index'
import { formatParams } from '/@/hooks/web/common'
import { columns, searchFormSchema } from './columns'
const dictOptions = ref<any[]>([])
import { useMessage } from '/@/hooks/web/useMessage'
const { createMessage } = useMessage()
const treeData = ref([])
const ParentId = ref('')
const [registerModal, { openModal }] = useModal()
@ -104,7 +116,20 @@
fixed: 'right',
},
})
//
async function handleDelete(record: Recordable) {
const res: API.DataResult = await BatchDelOrg({
id: '',
ids: [record.id],
})
if (res.succeeded) {
createMessage.success(res.message)
initData()
reload()
} else {
createMessage.warning(res.message)
}
}
function handleCreate() {
openModal(true, {
isParent: false,
@ -117,11 +142,9 @@
} else {
ParentId.value = ''
}
reload()
}
function handleEdit(record: Recordable) {
// ParentId.value = record.parentId == 0 ? '' : record.parentId
openModal(true, {
record,
isUpdate: true,

@ -2,37 +2,115 @@
<BasicModal
v-bind="$attrs"
:use-wrapper="true"
:title="getTitle"
width="60%"
@register="registerModal"
@ok="handleSave"
>
<BasicForm @register="registerForm" />
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="0" tab="用户基本信息">
<BasicForm @register="registerForm">
<template #sex="{ model }">
<a-switch
v-model:checked="model.sex"
:class="{'woman': model.sex == 2}"
:checkedValue="1"
:unCheckedValue="2"
/>
<span class="s-txt" :class="{ 's-active': model.sex == 1, 'w-active': model.sex == 2 }">{{ model.sex == 1 ? '男' : '女'}}</span>
</template>
<template #userType="{ model }">
<a-switch
v-model:checked="model.userType"
:class="{'p-normal': model.userType == 2}"
:checkedValue="1"
:unCheckedValue="2"
/>
<span class="s-txt" :class="{ 's-active': model.userType == 1, 'p-active': model.userType == 2 }">{{ model.userType == 1 ? '管理员' : '普通用户'}}</span>
</template>
<template #isOperator="{ model }">
<a-switch
v-model:checked="model.isOperator"
/>
<span class="s-txt" :class="{ 's-active': model.isOperator }">{{ model.isOperator ? '是' : '否'}}</span>
</template>
<template #isVouchingClerk="{ model }">
<a-switch
v-model:checked="model.isVouchingClerk"
/>
<span class="s-txt" :class="{ 's-active': model.isVouchingClerk }">{{ model.isVouchingClerk ? '是' : '否'}}</span>
</template>
<template #isSale="{ model }">
<a-switch
v-model:checked="model.isSale"
/>
<span class="s-txt" :class="{ 's-active': model.isSale }">{{ model.isSale ? '是' : '否'}}</span>
</template>
<template #isCustom="{ model }">
<a-switch
v-model:checked="model.isCustom"
/>
<span class="s-txt" :class="{ 's-active': model.isCustom }">{{ model.isCustom ? '是' : '否'}}</span>
</template>
<template #isFinancialStaff="{ model }">
<a-switch
v-model:checked="model.isFinancialStaff"
/>
<span class="s-txt" :class="{ 's-active': model.isFinancialStaff }">{{ model.isFinancialStaff ? '是' : '否'}}</span>
</template>
<template #isCustomerService="{ model }">
<a-switch
v-model:checked="model.isDispatcher"
/>
<span class="s-txt" :class="{ 's-active': model.isCustomerService }">{{ model.isCustomerService ? '是' : '否'}}</span>
</template>
<template #isDriver="{ model }">
<a-switch
v-model:checked="model.isDriver"
/>
<span class="s-txt" :class="{ 's-active': model.isDriver }">{{ model.isDriver ? '是' : '否'}}</span>
</template>
<template #isDispatcher="{ model }">
<a-switch
v-model:checked="model.isDispatcher"
/>
<span class="s-txt" :class="{ 's-active': model.isDispatcher }">{{ model.isDispatcher ? '是' : '否'}}</span>
</template>
</BasicForm>
</a-tab-pane>
<a-tab-pane key="1" tab="个人开户信息">
<BasicTable @register="registerTable" @row-dbClick="EditRow">
<template #tableTitle>
<a-button type="link" @click="addboxLine">
<span class="iconfont icon-new_document"></span>
添加
</a-button>
<a-popconfirm
title="确定删除当前选中数据?"
ok-text="是"
cancel-text="否"
@confirm="handleDel"
>
<a-button type="link">
<span class="iconfont icon-shanchu21"></span>
删除
</a-button>
</a-popconfirm>
</template>
</BasicTable>
</a-tab-pane>
</a-tabs>
<!--右下角按钮-->
<template #footer>
<a-button
pre-icon="ant-design:close-outlined"
type="warning"
:loading="loading"
ghost
style="margin-right: 0.8rem"
@click="closeModal"
>取消</a-button
>
<a-button
type="success"
:loading="loading"
pre-icon="ant-design:check-outlined"
style="margin-right: 0.8rem"
@click="handleSave(false)"
>仅保存</a-button
>
<a-button
pre-icon="ant-design:check-circle-outlined"
type="primary"
:loading="loading"
@click="handleSave(true)"
>保存并关闭</a-button
>保存</a-button
>
</template>
</BasicModal>
@ -42,9 +120,10 @@
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
import { formSchema } from './columns'
import { Tablecolumns } from '/@/views/baseinfo/infoclient/columns'
import { editUser, getUser } from '/@/api/system/user'
import { useUserStore } from '/@/store/modules/user'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { useMessage } from '/@/hooks/web/useMessage'
// Emits
const emit = defineEmits(['success', 'register'])
@ -52,66 +131,71 @@
const loading = ref(false)
const rowId = ref('')
const { createMessage } = useMessage()
const activeKey = ref('0')
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] =
useForm({
labelWidth: 100,
schemas: formSchema,
showActionButtonGroup: false,
})
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
// setModalProps({ confirmLoading: true });
setModalProps({ confirmLoading: true });
rowId.value = data.record.id
const res: API.DataResult = await getUser({ id: unref(rowId) })
if (res.succeeded) {
setFieldsValue({
...res.data,
})
// console.log('Form', getFieldsValue());
// setFieldsValue({ trainId: unref(res.data.trainId) });
}
// setModalProps({ confirmLoading: false });
setModalProps({ confirmLoading: false });
} else {
setFieldsValue({ permissionIdentity: unref(2) })
}
setModalProps({ loading: false })
})
const getTitle = computed(() => (!unref(isUpdate) ? '新增用户' : '编辑用户'))
async function handleSave(exit) {
try {
const values = await validate()
console.log(values)
setModalProps({ confirmLoading: true, loading: true })
// TODO custom api
// values.roleIds = values.roleIds.join(',')
// values.orgIds = values.orgIds.join(',')
const res: API.DataResult = await editUser(values)
if (res.succeeded) {
createMessage.success(res.message)
emit('success')
//
if (!exit) {
if (unref(isUpdate)) {
await refresh()
} else {
rowId.value = res.data
isUpdate.value = true
await refresh()
}
}
}
exit && closeModal()
} finally {
// loading.value = false;
setModalProps({ confirmLoading: false, loading: false })
}
}
//
function addboxLine() {
const data = {
rowKey: dataSource.value.length
? dataSource.value[dataSource.value.length - 1].rowKey + 1
: 1,
}
setTableData([...getDataSource(), data])
}
const dataSource = ref<any>([])
//
const [registerTable, { getDataSource, setTableData }] = useTable({
pagination: false,
columns: Tablecolumns,
dataSource: dataSource.value,
// showTableSetting: true,
// tableSetting: { fullScreen: false, redo: false, size: false },
rowKey: 'rowKey',
bordered: true,
autoCreateKey: false,
showIndexColumn: true,
})
async function refresh() {
const res: API.DataResult = await getUser({ id: unref(rowId) })
if (res.succeeded) {
@ -121,3 +205,39 @@
}
}
</script>
<style lang="less" scoped>
.s-txt {
font-size: 12px;
margin-left: 10px;
color: #7A8798;
position: relative;
top: 1px;
}
.woman {
background: #BA3849;
}
.s-active {
color: #257AFA;
}
.w-active {
color: #BA3849;
}
.p-normal {
background: #17A6A3;
}
.p-active {
color: #17A6A3;
}
/deep/ .ant-divider {
font-size: 12px;
font-weight: 600;
margin: 16px 0 8px -19px;
}
/deep/ .ant-divider-horizontal.ant-divider-with-text-left::before {
width: 0;
}
/deep/ .ant-divider-horizontal.ant-divider-with-text-left::after {
width: 0;
}
</style>

@ -2,21 +2,18 @@ import { ref } from 'vue'
import { BasicColumn, FormSchema } from '/@/components/Table'
import { getRoleList, getOrgList, getDeptList } from '/@/api/common'
import { Tag } from 'ant-design-vue'
import { style } from '@logicflow/extension/es/bpmn-elements/presets/icons'
import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore()
import { t } from '/@/hooks/web/useI18n'
const selectOrgList = ref<any>([])
const selectDeptList = ref([])
let ListData: any = await {}
const FnsourceId: any = await getOrgList()
if (FnsourceId.succeeded) {
ListData.orgIds = []
FnsourceId.data.forEach((e) => {
ListData.orgIds.push(e)
})
}
const orgIds = ref([])
getOrgList().then(res => {
orgIds.value = res.data
})
export const columns: BasicColumn[] = [
{
title: '用户唯一码',
title: '用户编码',
dataIndex: 'userCode',
width: 100,
},
@ -49,9 +46,9 @@ export const columns: BasicColumn[] = [
width: 200,
customRender: ({ text }) => {
if (text === 1) {
return <Tag color="success"></Tag>
return <Tag color="blue"></Tag>
} else if (text === 2) {
return <Tag color="blue"></Tag>
return <Tag color="error"></Tag>
}
return text
},
@ -98,24 +95,16 @@ export const searchFormSchema: FormSchema[] = [
field: 'UserName',
label: '用户名称',
component: 'Input',
colProps: { span: 6 },
colProps: { span: 4 },
},
{
field: 'UserCode',
label: '用户唯一编码',
label: '用户编码',
component: 'Input',
colProps: { span: 6 },
colProps: { span: 4 },
},
]
export const formSchema: FormSchema[] = [
{
field: 'divider-selects',
component: 'Divider',
label: '基本用户信息',
colProps: {
span: 24,
},
},
{
label: '',
field: 'id',
@ -132,7 +121,7 @@ export const formSchema: FormSchema[] = [
},
{
field: 'userCode',
label: '用户唯一码',
label: '用户码',
component: 'Input',
required: true,
colProps: { span: 6 },
@ -142,22 +131,17 @@ export const formSchema: FormSchema[] = [
},
{
field: 'userName',
label: '用户名称',
label: '中文名称',
component: 'Input',
required: true,
colProps: { span: 6 },
},
{
field: 'sex',
component: 'RadioButtonGroup',
component: 'Switch',
slot: 'sex',
label: '性别',
required: true,
componentProps: {
options: [
{ label: '男', value: 1 },
{ label: '女', value: 2 },
],
},
defaultValue: 1,
colProps: {
span: 6,
@ -166,19 +150,13 @@ export const formSchema: FormSchema[] = [
{
field: 'userType',
label: '用户类型',
component: 'RadioButtonGroup',
slot: 'userType',
component: 'Switch',
required: true,
colProps: {
span: 6,
},
defaultValue: 2,
componentProps: {
options: [
// { label: '超级管理员', value: 0, disabled: true },
{ label: '管理员', value: 1 },
{ label: '普通用户', value: 2 },
],
},
defaultValue: 2
},
{
field: 'pinYinCode',
@ -192,33 +170,24 @@ export const formSchema: FormSchema[] = [
{
field: 'password',
label: '密码',
component: 'Input',
component: 'InputPassword',
colProps: { span: 6 },
defaultValue: '',
show: false,
// dynamicDisabled: () => {
// return true
// },
itemProps: {
extra: '请设置复杂密码!',
},
},
{
field: 'birthday',
label: '出生日期',
component: 'DatePicker',
colProps: {
span: 6,
},
componentProps: {
style: {
width: '100%',
},
},
required: true,
rules: [
{
pattern: /^(?=.*[A-Za-z])(?=.*\d)[^]{6,30}$/,
message: '密码不得少于6位至少包括数组和字母',
trigger: 'blur'
}
],
dynamicDisabled: ({ values }) => {
return values.id ? true : false
}
},
{
field: 'nickName',
label: '用户昵称',
field: 'userEnName',
label: '英文名称',
component: 'Input',
required: true,
colProps: { span: 6 },
@ -227,6 +196,13 @@ export const formSchema: FormSchema[] = [
field: 'phone',
label: '手机号',
component: 'Input',
rules: [
{
pattern: /^1\d{10}$/,
message: '请输入正确格式的手机号',
trigger: 'blur'
}
],
colProps: { span: 6 },
},
{
@ -236,24 +212,12 @@ export const formSchema: FormSchema[] = [
rules: [{ type: 'email', message: t('请填写正确的邮箱地址') }],
colProps: { span: 6 },
},
{
field: 'tel',
label: '电话',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'officePhone',
label: '办公电话',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'fax',
label: '传真',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'financeSoftCode',
label: '财务软件代码',
@ -277,58 +241,83 @@ export const formSchema: FormSchema[] = [
component: 'Divider',
label: '用户属性',
componentProps: {},
colProps: {
span: 24,
},
colProps: { span: 24 }
},
{
field: 'isOperator',
slot: 'isOperator',
label: '是否操作',
component: 'Switch',
colProps: { span: 6 },
},
{
field: 'isVouchingClerk',
slot: 'isVouchingClerk',
label: '是否单证',
component: 'Switch',
colProps: { span: 6 },
},
{
field: 'isSale',
slot: 'isSale',
label: '是否销售',
component: 'Switch',
colProps: { span: 6 },
},
{
field: 'isCustom',
slot: 'isCustom',
label: '是否报关员',
component: 'Switch',
colProps: { span: 6 },
},
{
field: 'isFinancialStaff',
slot: 'isFinancialStaff',
label: '是否财务',
component: 'Switch',
colProps: { span: 6 },
},
{
field: 'isCustomerService',
slot: 'isCustomerService',
label: '是否客服',
component: 'Switch',
colProps: { span: 6 },
},
{
field: 'isDriver',
slot: 'isDriver',
label: '是否司机',
component: 'Switch',
colProps: { span: 6 },
},
{
field: 'isDispatcher',
slot: 'isDispatcher',
label: '是否派车调度人员',
component: 'Switch',
colProps: { span: 6 },
},
{
label: '航线',
field: 'laneIds',
component: 'ApiSelect',
dynamicDisabled: false,
// defaultValue: '',
colProps: { span: 24 },
componentProps: ({ formModel }) => {
return {
option: optionsStore.getOptionsByCode('GetClientLanesSelectList'),
labelField: 'laneName',
mode: 'multiple',
valueField: 'id',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
}
}
},
{
field: 'divider-selects',
component: 'Divider',
@ -344,15 +333,15 @@ export const formSchema: FormSchema[] = [
component: 'Select',
required: true,
defaultValue: [],
colProps: { span: 6 },
colProps: { span: 24 },
componentProps: ({ formActionType }) => {
return {
mode: 'multiple',
options: ListData.orgIds,
options: orgIds.value,
resultField: 'data',
onChange: async (e, list) => {
selectOrgList.value = []
ListData.orgIds.forEach((item) => {
orgIds.value.forEach((item) => {
e.forEach((item2) => {
if (item.value == item2) {
selectOrgList.value.push(item)
@ -375,10 +364,10 @@ export const formSchema: FormSchema[] = [
required: true,
component: 'Select',
defaultValue: '',
colProps: { span: 6 },
colProps: { span: 12 },
componentProps: ({ formActionType }) => {
return {
options: selectOrgList,
options: selectOrgList.value || [],
resultField: 'data',
onChange: async (e: ChangeEvent) => {
console.log(e)
@ -404,7 +393,7 @@ export const formSchema: FormSchema[] = [
label: '默认部门',
component: 'Select',
defaultValue: '',
colProps: { span: 6 },
colProps: { span: 12 },
componentProps: {
options: selectDeptList,
allowClear: true,
@ -419,11 +408,11 @@ export const formSchema: FormSchema[] = [
component: 'ApiSelect',
// required: true,
defaultValue: [],
colProps: { span: 6 },
colProps: { span: 24 },
componentProps: {
mode: 'multiple',
api: getRoleList,
resultField: 'data',
},
resultField: 'data'
}
},
]

@ -1,8 +1,16 @@
<!--
* @Desc:
* @Author: lijj
* @Date: 2024-07-17 08:39:51
-->
<template>
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button>
<BasicTable class="ds-table" @register="registerTable">
<template #tableTitle>
<a-button type="link" @click="handleCreate">
<span class="iconfont icon-new_document"></span>
新增
</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'userName'">
@ -16,6 +24,17 @@
tooltip: '编辑',
onClick: handleEdit.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
tooltip: '删除',
color: 'error',
popConfirm: {
title: '是否要删除此条数据?',
okText: '是',
cancelText: '否',
confirm: handleDelete.bind(null, record)
}
}
]"
/>
</template>
@ -25,18 +44,19 @@
</div>
</template>
<script lang="ts" setup>
import { defineComponent, onMounted, ref } from 'vue'
import { onMounted, ref } from 'vue'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { getUserList } from '/@/api/system/user'
import { getUserList, BatchDelUser } from '/@/api/system/user'
import { formatParams } from '/@/hooks/web/common'
import { useModal } from '/@/components/Modal'
import UserModal from './UserModal.vue'
import { columns, searchFormSchema } from './columns'
const dictOptions = ref<any[]>([])
const [registerModal, { openModal }] = useModal()
const [registerPermissionModal, { openModal: openPermissionModal }] = useModal()
import { useMessage } from '/@/hooks/web/useMessage'
const { createMessage } = useMessage()
const [registerTable, { reload, getForm, getPaginationRef }] = useTable({
title: '用户列表',
// api: getSysDictTypeList,
api: async (p) => {
const res: API.DataResult = await getUserList(p)
// console.log(items);
@ -44,35 +64,8 @@
resolve({ data: [...res.data], total: res.count })
})
},
beforeFetch: () => {
var currentPageInfo: any = getPaginationRef()
var data = getForm().getFieldsValue()
const postParam: API.PageRequest = {
queryCondition: '',
pageCondition: {
pageIndex: currentPageInfo.current,
pageSize: currentPageInfo.pageSize,
sortConditions: [],
},
}
let condition: API.ConditionItem[] = []
if (!!data.UserName) {
condition.push({
FieldName: 'UserName',
FieldValue: data.UserName,
ConditionalType: 1,
})
}
if (!!data.UserCode) {
condition.push({
FieldName: 'UserCode',
FieldValue: data.UserCode,
ConditionalType: 1,
})
}
postParam.queryCondition = JSON.stringify(condition)
// console.log(postParam);
return postParam
beforeFetch: (p) => {
return formatParams(p)
},
columns,
formConfig: {
@ -108,10 +101,19 @@
isUpdate: true,
})
}
function handleDelete(record: Recordable) {
console.log(record)
//
async function handleDelete(record) {
const res = await BatchDelUser({
id: '',
ids: [record.id],
})
if (res.succeeded) {
createMessage.success(res.message)
reload()
} else {
createMessage.warning(res.message)
}
}
onMounted(() => {
//
})
@ -120,7 +122,4 @@
}
</script>
<style scoped lang="scss">
:deep(.ant-picker) {
width: 100% !important;
}
</style>

Loading…
Cancel
Save