Merge branch 'zth' into dev
commit
ef080711a2
@ -0,0 +1,24 @@
|
||||
// @ts-ignore
|
||||
import { request } from '/@/utils/request'
|
||||
import { DataResult, PageRequest } from '/@/api/model/baseModel'
|
||||
enum Api {
|
||||
list = '/mainApi/ClientStakeholder/GetList',
|
||||
Audit = '/mainApi/ClientStakeholder/Audit',
|
||||
}
|
||||
|
||||
// 列表 (Auth)
|
||||
export function ApiList(data: PageRequest) {
|
||||
return request<DataResult>({
|
||||
url: Api.list,
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
// 执行审核 (Auth)
|
||||
export function ApiAudit(data: PageRequest) {
|
||||
return request<DataResult>({
|
||||
url: Api.Audit,
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table'
|
||||
import {
|
||||
getClientFrtSelectList,
|
||||
getClientSourceSelectList,
|
||||
getClientCountrySelectList,
|
||||
} from '/@/views/baseinfo/infoclient/api'
|
||||
|
||||
import {
|
||||
getOperatorUserList,
|
||||
getVouchingClerkList,
|
||||
getSaleUserList,
|
||||
getCustomerServiceList,
|
||||
getDeptList,
|
||||
} from '/@/api/common'
|
||||
let DeptList: any = []
|
||||
const res10: API.DataResult = await getDeptList()
|
||||
if (res10.succeeded) {
|
||||
DeptList = []
|
||||
res10.data.forEach((e) => {
|
||||
DeptList.push({ label: e.orgName, value: e.id })
|
||||
})
|
||||
}
|
||||
let ClientCountryList: any = []
|
||||
const res4: API.DataResult = await getClientCountrySelectList()
|
||||
if (res4.succeeded) {
|
||||
ClientCountryList = []
|
||||
res4.data.forEach((e) => {
|
||||
ClientCountryList.push({ label: e.countryName, value: e.id })
|
||||
})
|
||||
}
|
||||
let ClientSourceList: any = []
|
||||
const res3: API.DataResult = await getClientSourceSelectList()
|
||||
if (res3.succeeded) {
|
||||
ClientSourceList = []
|
||||
res3.data.forEach((e) => {
|
||||
ClientSourceList.push({ label: e.sourceName, value: e.id })
|
||||
})
|
||||
}
|
||||
let SaleUserList: any = []
|
||||
const res8: API.DataResult = await getSaleUserList()
|
||||
if (res8.succeeded) {
|
||||
SaleUserList = []
|
||||
res8.data.forEach((e) => {
|
||||
SaleUserList.push({ label: e.userName, value: e.id })
|
||||
})
|
||||
}
|
||||
let OperatorUserList: any = []
|
||||
const res6: API.DataResult = await getOperatorUserList()
|
||||
if (res6.succeeded) {
|
||||
OperatorUserList = []
|
||||
res6.data.forEach((e) => {
|
||||
OperatorUserList.push({ label: e.userName, value: e.id })
|
||||
})
|
||||
}
|
||||
let VouchingClerkList: any = []
|
||||
const res7: API.DataResult = await getVouchingClerkList()
|
||||
if (res7.succeeded) {
|
||||
VouchingClerkList = []
|
||||
res7.data.forEach((e) => {
|
||||
VouchingClerkList.push({ label: e.userName, value: e.id })
|
||||
})
|
||||
}
|
||||
let CustomerServiceList: any = []
|
||||
const res9: API.DataResult = await getCustomerServiceList()
|
||||
if (res9.succeeded) {
|
||||
CustomerServiceList = []
|
||||
res9.data.forEach((e) => {
|
||||
CustomerServiceList.push({ label: e.userName, value: e.id })
|
||||
})
|
||||
}
|
||||
let ClientFrtList: any = []
|
||||
const res: API.DataResult = await getClientFrtSelectList()
|
||||
if (res.succeeded) {
|
||||
ClientFrtList = []
|
||||
res.data.forEach((e) => {
|
||||
ClientFrtList.push({ label: e.cnName, value: e.id })
|
||||
})
|
||||
}
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '干系人姓名',
|
||||
dataIndex: 'createByName',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '生效日期',
|
||||
dataIndex: 'startDate',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '失效日期',
|
||||
dataIndex: 'endDate',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'remark',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
},
|
||||
]
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'createByName',
|
||||
label: '干系人姓名',
|
||||
component: 'Input',
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
]
|
@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable class="ds-table" @register="registerTable">
|
||||
<template #tableTitle>
|
||||
<a-button type="link" @click="FnAudit(1)">
|
||||
<span class="iconfont icon-new_document"></span>
|
||||
审核
|
||||
</a-button>
|
||||
<a-button type="link" @click="FnAudit(2)">
|
||||
<span class="iconfont icon-new_document"></span>
|
||||
驳回
|
||||
</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<a-modal
|
||||
:visible="visible"
|
||||
title="审批备注"
|
||||
width="30%"
|
||||
@ok="FnAudit(2)"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<a-textarea v-model:value="remark" :auto-size="{ minRows: 5, maxRows: 7 }" />
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table'
|
||||
import { ApiList, ApiAudit } from './api'
|
||||
import { columns, searchFormSchema } from './columns'
|
||||
import { formatParams } from '/@/hooks/web/common'
|
||||
import { useMessage } from '/@/hooks/web/useMessage'
|
||||
const { notification } = useMessage()
|
||||
const visible = ref(false)
|
||||
const remark = ref('')
|
||||
const [registerTable, { reload, getForm, getSelectRows }] = useTable({
|
||||
title: '',
|
||||
api: async (p) => {
|
||||
const res: API.DataResult = await ApiList(p)
|
||||
return new Promise((resolve) => {
|
||||
resolve({ data: [...res.data], total: res.count })
|
||||
})
|
||||
},
|
||||
beforeFetch: (p) => {
|
||||
p['status'] = 1
|
||||
return formatParams(p)
|
||||
},
|
||||
rowSelection: { type: 'checkbox' },
|
||||
columns,
|
||||
formConfig: {
|
||||
labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
},
|
||||
isTreeTable: false,
|
||||
pagination: true,
|
||||
striped: true,
|
||||
useSearchForm: true,
|
||||
showTableSetting: false,
|
||||
bordered: true,
|
||||
showIndexColumn: true,
|
||||
indexColumnProps: {
|
||||
width: 60,
|
||||
},
|
||||
canResize: true,
|
||||
resizeHeightOffset: 35,
|
||||
immediate: true,
|
||||
})
|
||||
function FnAudit(result) {
|
||||
let Audit = () => {
|
||||
const select = getSelectRows()
|
||||
let ApiData: any = {
|
||||
ids: [],
|
||||
result,
|
||||
remark: remark.value,
|
||||
}
|
||||
if (select.length === 0) {
|
||||
notification.warning({ message: '请至少选择一条数据', duration: 3 })
|
||||
return false
|
||||
} else {
|
||||
ApiData.ids = select.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
}
|
||||
|
||||
ApiAudit(ApiData).then((res) => {
|
||||
handleCancel()
|
||||
notification.success({ message: res.message, duration: 3 })
|
||||
reload()
|
||||
})
|
||||
}
|
||||
if (result == 1) {
|
||||
Audit()
|
||||
} else {
|
||||
if (remark.value != '') {
|
||||
Audit()
|
||||
handleCancel()
|
||||
} else {
|
||||
visible.value = true
|
||||
}
|
||||
}
|
||||
}
|
||||
function handleCancel() {
|
||||
remark.value = ''
|
||||
visible.value = false
|
||||
}
|
||||
</script>
|
@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<BasicModal
|
||||
v-bind="$attrs"
|
||||
:use-wrapper="true"
|
||||
:title="getTitle"
|
||||
width="60%"
|
||||
@register="registerModal"
|
||||
@ok="handleSave"
|
||||
>
|
||||
<BasicForm @register="registerForm" />
|
||||
<!--右下角按钮-->
|
||||
<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
|
||||
>
|
||||
</template>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, unref } from 'vue'
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal'
|
||||
import { BasicForm, useForm } from '/@/components/Form/index'
|
||||
import { formSchema } from './columns'
|
||||
import { ApiEdit, ApiInfo } from './api'
|
||||
import { useMessage } from '/@/hooks/web/useMessage'
|
||||
// 声明Emits
|
||||
const emit = defineEmits(['success', 'register'])
|
||||
const isUpdate = ref(true)
|
||||
const loading = ref(false)
|
||||
const rowId = ref('')
|
||||
const { createMessage } = useMessage()
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = 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 });
|
||||
rowId.value = data.record.id
|
||||
const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
|
||||
if (res.succeeded) {
|
||||
setFieldsValue({
|
||||
...res.data,
|
||||
})
|
||||
// console.log('返回数据Form', getFieldsValue());
|
||||
// setFieldsValue({ trainId: unref(res.data.trainId) });
|
||||
}
|
||||
// setModalProps({ confirmLoading: false });
|
||||
} else {
|
||||
setFieldsValue({ permissionIdentity: unref(2) })
|
||||
}
|
||||
setModalProps({ loading: false })
|
||||
})
|
||||
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? '新增EDI设置' : '编辑EDI设置'))
|
||||
|
||||
async function handleSave(exit) {
|
||||
try {
|
||||
const values = await validate()
|
||||
setModalProps({ confirmLoading: true, loading: true })
|
||||
// TODO custom api
|
||||
console.log(values)
|
||||
// loading.value = true;
|
||||
const res: API.DataResult = await ApiEdit(values)
|
||||
console.log(res)
|
||||
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)
|
||||
}
|
||||
|
||||
exit && closeModal()
|
||||
} finally {
|
||||
// loading.value = false;
|
||||
setModalProps({ confirmLoading: false, loading: false })
|
||||
}
|
||||
}
|
||||
async function refresh() {
|
||||
const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
|
||||
if (res.succeeded) {
|
||||
await setFieldsValue({
|
||||
...res.data,
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,51 @@
|
||||
// @ts-ignore
|
||||
import { request } from '/@/utils/request'
|
||||
import { DataResult, PageRequest } from '/@/api/model/baseModel'
|
||||
enum Api {
|
||||
list = '/mainApi/ClientStakeholder/GetList',
|
||||
Audit = '/mainApi/ClientStakeholder/Audit',
|
||||
Get = '/mainApi/ClientStakeholder/Get',
|
||||
edit = '/mainApi/ClientStakeholder/Edit',
|
||||
info = '/mainApi/ClientStakeholder/Info',
|
||||
}
|
||||
|
||||
// 列表 (Auth)
|
||||
export function ApiList(data: PageRequest) {
|
||||
return request<DataResult>({
|
||||
url: Api.list,
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
// 执行审核 (Auth)
|
||||
export function ApiClientStakeholderAudit(data: PageRequest) {
|
||||
return request<DataResult>({
|
||||
url: Api.Audit,
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
// 获取客户干系人 (Auth)
|
||||
export function ApiGet(query) {
|
||||
return request<DataResult>({
|
||||
url: Api.Get,
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
// 获取客户干系人 (Auth)
|
||||
export function ApiEdit(query) {
|
||||
return request<DataResult>({
|
||||
url: Api.edit,
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
// 详情 (Auth)
|
||||
export function ApiInfo(query) {
|
||||
return request<DataResult>({
|
||||
url: Api.info,
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table'
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '干系人姓名',
|
||||
dataIndex: 'createByName',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '生效日期',
|
||||
dataIndex: 'startDate',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '失效日期',
|
||||
dataIndex: 'endDate',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'remark',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
},
|
||||
]
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'createByName',
|
||||
label: '干系人姓名',
|
||||
component: 'Input',
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
]
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
defaultValue: '',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
field: 'carrierId',
|
||||
label: '',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
field: 'startDate',
|
||||
label: '生效日期',
|
||||
component: 'DatePicker',
|
||||
required: true,
|
||||
colProps: { span: 20 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
style: 'width:100%',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'endDate',
|
||||
label: '失效日期',
|
||||
component: 'DatePicker',
|
||||
required: true,
|
||||
colProps: { span: 20 },
|
||||
defaultValue: '',
|
||||
componentProps: {
|
||||
style: 'width:100%',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'note',
|
||||
label: '备注',
|
||||
component: 'InputTextArea',
|
||||
colProps: { span: 24 },
|
||||
componentProps: {
|
||||
rows: 2,
|
||||
},
|
||||
},
|
||||
]
|
@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable class="ds-table-detail" @register="registerTable">
|
||||
<!-- <template #tableTitle>
|
||||
<a-button type="link" @click="handleCreate">
|
||||
<span class="iconfont icon-new_document"></span>
|
||||
添加
|
||||
</a-button>
|
||||
<a-button type="link" @click="handleDel">
|
||||
<span class="iconfont icon-shanchu2"></span>
|
||||
删除
|
||||
</a-button>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
icon: 'clarity:note-edit-line',
|
||||
tooltip: '编辑',
|
||||
onClick: handleAudit.bind(null, record),
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</template> -->
|
||||
</BasicTable>
|
||||
<TenantAuditStepModal @register="registerModal" @success="handleSuccess" />
|
||||
<a-modal
|
||||
:visible="visible"
|
||||
title="审批备注"
|
||||
width="30%"
|
||||
@ok="FnAudit(2)"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<a-textarea v-model:value="remark" :auto-size="{ minRows: 5, maxRows: 7 }" />
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table'
|
||||
import { ApiList, ApiClientStakeholderAudit } from './api'
|
||||
import { columns, searchFormSchema } from './columns'
|
||||
import { formatParams } from '/@/hooks/web/common'
|
||||
import { useMessage } from '/@/hooks/web/useMessage'
|
||||
const { notification } = useMessage()
|
||||
import { useModal } from '/@/components/Modal'
|
||||
import TenantAuditStepModal from './TenantAuditStepModal.vue'
|
||||
const props = defineProps({
|
||||
clientId: { type: String },
|
||||
})
|
||||
const visible = ref(false)
|
||||
const remark = ref('')
|
||||
const [registerTable, { reload, getForm, getSelectRows }] = useTable({
|
||||
title: '',
|
||||
api: async (p) => {
|
||||
const res: API.DataResult = await ApiList(p)
|
||||
return new Promise((resolve) => {
|
||||
resolve({ data: [...res.data], total: res.count })
|
||||
})
|
||||
},
|
||||
beforeFetch: (p) => {
|
||||
p['clientId'] = props.clientId
|
||||
p['status'] = 2
|
||||
return formatParams(p)
|
||||
},
|
||||
rowSelection: { type: 'checkbox' },
|
||||
columns,
|
||||
// formConfig: {
|
||||
// labelWidth: 120,
|
||||
// schemas: searchFormSchema,
|
||||
// },
|
||||
isTreeTable: false,
|
||||
pagination: true,
|
||||
striped: true,
|
||||
useSearchForm: false,
|
||||
showTableSetting: false,
|
||||
bordered: true,
|
||||
showIndexColumn: true,
|
||||
indexColumnProps: {
|
||||
width: 60,
|
||||
},
|
||||
canResize: true,
|
||||
resizeHeightOffset: 35,
|
||||
immediate: true,
|
||||
actionColumn: {
|
||||
width: 80,
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
fixed: 'right',
|
||||
},
|
||||
})
|
||||
function FnAudit(result) {
|
||||
let Audit = () => {
|
||||
const select = getSelectRows()
|
||||
let ApiData: any = {
|
||||
ids: [],
|
||||
result,
|
||||
remark: remark.value,
|
||||
}
|
||||
if (select.length === 0) {
|
||||
notification.warning({ message: '请至少选择一条数据', duration: 3 })
|
||||
return false
|
||||
} else {
|
||||
ApiData.ids = select.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
}
|
||||
|
||||
ApiClientStakeholderAudit(ApiData).then((res) => {
|
||||
handleCancel()
|
||||
notification.success({ message: res.message, duration: 3 })
|
||||
reload()
|
||||
})
|
||||
}
|
||||
if (result == 1) {
|
||||
Audit()
|
||||
} else {
|
||||
if (remark.value != '') {
|
||||
Audit()
|
||||
handleCancel()
|
||||
} else {
|
||||
visible.value = true
|
||||
}
|
||||
}
|
||||
}
|
||||
function handleCancel() {
|
||||
remark.value = ''
|
||||
visible.value = false
|
||||
}
|
||||
const [registerModal, { openModal }] = useModal()
|
||||
function handleAudit(record: Recordable) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
})
|
||||
}
|
||||
function handleCreate() {
|
||||
openModal(true, {
|
||||
isParent: false,
|
||||
isUpdate: false,
|
||||
})
|
||||
}
|
||||
function handleDel() {
|
||||
const select = getSelectRows()
|
||||
if (select.length === 0) {
|
||||
notification.error({ message: '请选择一条数据', duration: 3 })
|
||||
return false
|
||||
}
|
||||
const removeArr = select.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
// ApiDel({ ids: removeArr }).then((res) => {
|
||||
// notification.success({ message: res.message, duration: 3 })
|
||||
// reload()
|
||||
// })
|
||||
}
|
||||
function handleSuccess() {
|
||||
reload()
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue