add
This commit is contained in:
parent
c416e1e494
commit
21c6af4b00
@ -1,29 +1,37 @@
|
||||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 管理员列表
|
||||
export function adminLists(params: any) {
|
||||
return request.get({ url: '/auth.admin/lists', params }, { ignoreCancelToken: true })
|
||||
return request.get(
|
||||
{ url: "/auth.admin/lists", params },
|
||||
{ ignoreCancelToken: true }
|
||||
);
|
||||
}
|
||||
// 管理员列表全部
|
||||
export function adminAll(params: any) {
|
||||
return request.get({ url: '/auth.admin/all', params })
|
||||
return request.get({ url: "/auth.admin/all", params });
|
||||
}
|
||||
// 管理员添加
|
||||
export function adminAdd(params: any) {
|
||||
return request.post({ url: '/auth.admin/add', params })
|
||||
return request.post({ url: "/auth.admin/add", params });
|
||||
}
|
||||
|
||||
// 管理员编辑
|
||||
export function adminEdit(params: any) {
|
||||
return request.post({ url: '/auth.admin/edit', params })
|
||||
return request.post({ url: "/auth.admin/edit", params });
|
||||
}
|
||||
|
||||
// 管理员删除
|
||||
export function adminDelete(params: any) {
|
||||
return request.post({ url: '/auth.admin/delete', params })
|
||||
return request.post({ url: "/auth.admin/delete", params });
|
||||
}
|
||||
|
||||
// 管理员详情
|
||||
export function adminDetail(params: any) {
|
||||
return request.get({ url: '/auth.admin/detail', params })
|
||||
return request.get({ url: "/auth.admin/detail", params });
|
||||
}
|
||||
|
||||
// 修改密码
|
||||
export function adminPwd(params: any) {
|
||||
return request.post({ url: "/auth.admin/pwd", params });
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form ref="formRef" :model="formData" label-width="100px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8" v-for="(item, index) in config" :key="index">
|
||||
<el-form-item :label="item.label" v-if="item.type == 0">
|
||||
|
@ -1,53 +1,21 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="印章类型名称" prop="title">
|
||||
<el-input class="w-[280px]" v-model="queryParams.title" clearable placeholder="请输入印章类型名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!flex-1">
|
||||
<el-option label="禁用" :value="0" />
|
||||
<el-option label="启用" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['works/xzgl.oa_seal_cate/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['works/xzgl.oa_seal_cate/delete']" :disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="id" prop="title" show-overflow-tooltip />
|
||||
<el-table-column label="id" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="申请人" prop="user_name" show-overflow-tooltip />
|
||||
<el-table-column label="申请时间" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="审批类型" prop="type_name" show-overflow-tooltip />
|
||||
<el-table-column label="所属部门" prop="dept_name" show-overflow-tooltip />
|
||||
<el-table-column label="当前审批人" prop="check_admin_users" show-overflow-tooltip />
|
||||
<el-table-column label="审批状态" prop="check_status_text" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="status_text" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remarks" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['works/xzgl.oa_seal_cate/edit']" type="primary" link
|
||||
@click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['works/xzgl.oa_seal_cate/delete']" type="danger" link
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
<el-button type="primary" link @click="handDetail(row.id)">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -57,7 +25,8 @@
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- <edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" /> -->
|
||||
<detailPopup v-if="showDetail" ref="detailRef" @success="showDetail = false, getLists()"
|
||||
@close="showDetail = false, getLists()" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -67,12 +36,13 @@ import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiOaoaApproveCopy } from '@/api/oa_Initiate'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
// import EditPopup from './edit.vue'
|
||||
import detailPopup from '@/views/oa_Initiate/detail.vue'
|
||||
import { apiOaoaApproveDetail } from "@/api/oa_Initiate"
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
|
||||
const detailRef = ref(null)
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
const showDetail = ref(false)
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
@ -97,26 +67,12 @@ const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
const handDetail = async (id: any) => {
|
||||
let res = await apiOaoaApproveDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiOaSealCateDelete({ id })
|
||||
getLists()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
getLists()
|
||||
|
@ -2,13 +2,11 @@
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="印章类型名称" prop="title">
|
||||
<el-input class="w-[280px]" v-model="queryParams.title" clearable placeholder="请输入印章类型名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!flex-1">
|
||||
<el-option label="禁用" :value="0" />
|
||||
<el-option label="启用" :value="1" />
|
||||
<el-option label="全部" :value="0" />
|
||||
<el-option label="带我审批" :value="1" />
|
||||
<el-option label="我已审批" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
|
@ -1,86 +1,86 @@
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" :showFootBtn="false" title="审批详情" :async="true" width="60vw">
|
||||
<el-card>
|
||||
<template #header>审批内容</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="发票金额" label-align="left" align="left">
|
||||
{{ formData.amount }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="抬头类型" label-align="left" align="left">
|
||||
{{ formData.type_text }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="发票主体" label-align="left" align="left">
|
||||
{{ formData.invoice_subject }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="发票类型" label-align="left" align="left">
|
||||
{{ formData.invoice_type_text }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开票抬头" label-align="left" align="left">
|
||||
{{ formData.invoice_title }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="电话号码" label-align="left" align="left">
|
||||
{{ formData.invoice_phone }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="纳税人识别号" label-align="left" align="left">
|
||||
{{ formData.invoice_tax }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开户银行" label-align="left" align="left">
|
||||
{{ formData.invoice_bank }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="银行账号" label-align="left" align="left">
|
||||
{{ formData.invoice_account }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="银行营业网点" label-align="left" align="left">
|
||||
{{ formData.invoice_banking }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="地址" label-align="left" align="left">
|
||||
{{ formData.invoice_address }}
|
||||
</el-descriptions-item>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" :showFootBtn="false" title="审批详情" :async="true" width="60vw">
|
||||
<el-card>
|
||||
<template #header>审批内容</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="发票金额" label-align="left" align="left">
|
||||
{{ formData.amount }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="抬头类型" label-align="left" align="left">
|
||||
{{ formData.type_text }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="发票主体" label-align="left" align="left">
|
||||
{{ formData.invoice_subject }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="发票类型" label-align="left" align="left">
|
||||
{{ formData.invoice_type_text }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开票抬头" label-align="left" align="left">
|
||||
{{ formData.invoice_title }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="电话号码" label-align="left" align="left">
|
||||
{{ formData.invoice_phone }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="纳税人识别号" label-align="left" align="left">
|
||||
{{ formData.invoice_tax }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开户银行" label-align="left" align="left">
|
||||
{{ formData.invoice_bank }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="银行账号" label-align="left" align="left">
|
||||
{{ formData.invoice_account }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="银行营业网点" label-align="left" align="left">
|
||||
{{ formData.invoice_banking }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="地址" label-align="left" align="left">
|
||||
{{ formData.invoice_address }}
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="开票人" label-align="left" align="left">
|
||||
{{}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="未到账金额" label-align="left" align="left">
|
||||
{{}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="已到账金额" label-align="left" align="left">
|
||||
{{}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开票人" label-align="left" align="left">
|
||||
{{}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="未到账金额" label-align="left" align="left">
|
||||
{{}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="已到账金额" label-align="left" align="left">
|
||||
{{}}
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="备注" label-align="left" align="left">
|
||||
{{ formData.remark }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件" label-align="left" align="left">
|
||||
<annexLink :annex="formData.annex || []"></annexLink>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<template #header> 到账信息 </template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="到账状态" label-align="left" align="left">
|
||||
<!-- {{ formData.invoice_account }} -->
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="未到账金额(元)" label-align="left" align="left">
|
||||
<!-- {{ formData.invoice_banking }} -->
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="已到账金额(元)" label-align="left" align="left">
|
||||
<!-- {{ formData.invoice_address }} -->
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions-item label="备注" label-align="left" align="left">
|
||||
{{ formData.remark }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件" label-align="left" align="left">
|
||||
<annexLink :annex="formData.annex || []"></annexLink>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<template #header> 到账信息 </template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="到账状态" label-align="left" align="left">
|
||||
<!-- {{ formData.invoice_account }} -->
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="未到账金额(元)" label-align="left" align="left">
|
||||
<!-- {{ formData.invoice_banking }} -->
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="已到账金额(元)" label-align="left" align="left">
|
||||
<!-- {{ formData.invoice_address }} -->
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-table :data="detail">
|
||||
<el-table-column label="到账金额" show-overflow-tooltip prop="amount">
|
||||
</el-table-column>
|
||||
<el-table-column label="到账日期" show-overflow-tooltip prop="enter_time">
|
||||
</el-table-column>
|
||||
<el-table-column label="备注信息" show-overflow-tooltip prop="remarks">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</popup>
|
||||
</div>
|
||||
<el-table :data="detail">
|
||||
<el-table-column label="到账金额" show-overflow-tooltip prop="amount">
|
||||
</el-table-column>
|
||||
<el-table-column label="到账日期" show-overflow-tooltip prop="enter_time">
|
||||
</el-table-column>
|
||||
<el-table-column label="备注信息" show-overflow-tooltip prop="remarks">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
@ -93,47 +93,47 @@ const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: 0,
|
||||
extends: {},
|
||||
id: 0,
|
||||
extends: {},
|
||||
});
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in data) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
for (const key in data) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
getLists()
|
||||
getLists()
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
popupRef.value?.open();
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
|
||||
const detail = ref([])
|
||||
|
||||
const getLists = async () => {
|
||||
let res = await await apiInvliceLists({ id: formData.id })
|
||||
detail.value = res.lists
|
||||
let res = await await apiInvliceLists({ invoice_id: formData.id })
|
||||
detail.value = res
|
||||
}
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit("close");
|
||||
emit("close");
|
||||
};
|
||||
|
||||
// 显示
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
open,
|
||||
setFormData,
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-step__icon) {
|
||||
margin-top: 10px !important;
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
</style>
|
||||
|
@ -69,7 +69,7 @@
|
||||
<!-- {{ formData.invoice_address }} -->
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-table :data="detail">
|
||||
<el-table :data="detail" class="mt-4">
|
||||
<el-table-column label="到账金额">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.amount" clearable placeholder="请输入报销金额" />
|
||||
@ -95,8 +95,10 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submit">确定</el-button>
|
||||
<el-button @click="close">取消</el-button>
|
||||
<span style="float:right">
|
||||
<el-button type="primary" @click="submit">确定</el-button>
|
||||
<el-button @click="close">取消</el-button>
|
||||
</span>
|
||||
</el-form-item>
|
||||
</el-card>
|
||||
</popup>
|
||||
@ -106,11 +108,11 @@
|
||||
<script lang="ts" setup name="customdetail">
|
||||
import annexLink from "./../../components/annexLink/index.vue";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import { apiInvliceLists,apiInvlicevAdd } from '@/api/oa_financial'
|
||||
import {defineEmits}from "vue"
|
||||
import { apiInvliceLists, apiInvlicevAdd } from '@/api/oa_financial'
|
||||
import { defineEmits } from "vue"
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
@ -144,8 +146,8 @@ const detail = ref([
|
||||
])
|
||||
|
||||
const getLists = async () => {
|
||||
let res = await await apiInvliceLists({ id: formData.id })
|
||||
detail.value = res.lists
|
||||
let res = await await apiInvliceLists({ invoice_id: formData.id })
|
||||
detail.value = res || [{}]
|
||||
}
|
||||
// 关闭回调
|
||||
const handAdd = () => {
|
||||
@ -160,11 +162,11 @@ const handDel = (i) => {
|
||||
detail.value.splice(i, 1)
|
||||
}
|
||||
const submit = async () => {
|
||||
let res=await apiInvlicevAdd({invoice_id:formData.id,detail:detail.value})
|
||||
await apiInvlicevAdd({ invoice_id: formData.id, detail: detail.value })
|
||||
emit("success");
|
||||
|
||||
}
|
||||
const close=()=>{
|
||||
const close = () => {
|
||||
emit("success");
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" @success="getLists,showEdit = false" @close="showEdit = false" />
|
||||
<edit-popup v-if="showEdit" ref="editRef" @success="getLists, showEdit = false" @close="showEdit = false" />
|
||||
|
||||
<detailPopup v-if="showDetail" ref="detailRef" @success="showDetail = false, getLists()"
|
||||
@close="showDetail = false, getLists()" />
|
||||
@ -95,7 +95,7 @@ const handleSelectionChange = (val: any[]) => {
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiInvliceList2,
|
||||
fetchFun: apiInvliceIncomeIndex,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
|
@ -10,7 +10,8 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="应用模块" prop="type">
|
||||
<el-select v-model="formData.type" clearable placeholder="请选择应用模块" class="flex-1">
|
||||
<el-select v-model="formData.type" clearable placeholder="请选择应用模块" class="flex-1"
|
||||
@change="formData.flow_cate_name = '', formData.flow_cate = ''">
|
||||
<el-option v-for="item in dictData.oa_approve_cate" :key="item.value" :label="item.name"
|
||||
:value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
|
@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
|
||||
@close="handleClose">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="110px" :rules="formRules">
|
||||
<el-form-item label="离职员工" prop="uid_name">
|
||||
<el-input v-model="formData.uid_name" clearable placeholder="点击选择" @click="userclick('uid', 1)" />
|
||||
@ -29,9 +28,6 @@
|
||||
<el-form-item label="离职原因">
|
||||
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="状态">
|
||||
<el-switch v-model="formData.status" :active-value="1" :inactive-value="0" />
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<div v-if="showDialog">
|
||||
<personnelselector ref="personnel" @confirm="submituser" :type="personnelType">
|
||||
@ -94,7 +90,7 @@ const userclick = async (val, type) => {
|
||||
const submituser = (e: any) => {
|
||||
if (personnelType.value == '1') {
|
||||
formData[value + '_name'] = e.name
|
||||
formData[value + "_id"] = e.id
|
||||
formData[value + "_id"] = String(e.id)
|
||||
} else {
|
||||
formData.connect_uids = e.map((item: any) => {
|
||||
return item.id
|
||||
@ -106,6 +102,33 @@ const submituser = (e: any) => {
|
||||
showDialog.value = false
|
||||
}
|
||||
|
||||
const checkPersonalLead = (rule, value, callback) => {
|
||||
if (formData.lead_admin_id == (formData.uid)) {
|
||||
callback(new Error('部门负责人不能是离职员工'))
|
||||
}
|
||||
else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
|
||||
const checkPersonalConnect = (rule, value, callback) => {
|
||||
if (formData.connect_uids.includes(formData.uid)) {
|
||||
callback(new Error('参与交接人不能是离职员工'))
|
||||
}
|
||||
else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const checkPersonalConnectID = (rule, value, callback) => {
|
||||
if (formData.connect_id == (formData.uid)) {
|
||||
callback(new Error('资料交接人不能是离职员工'))
|
||||
}
|
||||
else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
uid_name: [{
|
||||
@ -118,21 +141,37 @@ const formRules = reactive<any>({
|
||||
message: '请输入创建人',
|
||||
trigger: ['change']
|
||||
}],
|
||||
lead_admin_id: [{
|
||||
required: true,
|
||||
message: '请输入部门负责人',
|
||||
trigger: ['change']
|
||||
}],
|
||||
lead_admin_id: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入部门负责人',
|
||||
trigger: ['change']
|
||||
},
|
||||
{
|
||||
validator: checkPersonalLead,
|
||||
trigger: ['change'],
|
||||
}
|
||||
],
|
||||
connect_uids: [{
|
||||
required: true,
|
||||
message: '请输入参与交接人,多',
|
||||
message: '请输入参与交接人',
|
||||
trigger: ['change']
|
||||
}],
|
||||
}
|
||||
, {
|
||||
validator: checkPersonalConnect,
|
||||
trigger: ['change'],
|
||||
}
|
||||
],
|
||||
connect_id: [{
|
||||
required: true,
|
||||
message: '请输入资料交接人',
|
||||
trigger: ['change']
|
||||
}],
|
||||
}, {
|
||||
validator: checkPersonalConnectID,
|
||||
trigger: ['change'],
|
||||
}
|
||||
|
||||
],
|
||||
connect_time: [{
|
||||
required: true,
|
||||
message: '请输入资料交接时间',
|
||||
@ -151,6 +190,8 @@ const formRules = reactive<any>({
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
@ -172,7 +213,6 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
formData.uid = formData.uid_id
|
||||
|
@ -53,9 +53,9 @@
|
||||
</el-form-item>
|
||||
|
||||
<!-- 确认密码输入框 -->
|
||||
<el-form-item label="确认密码" prop="password_confirm">
|
||||
<!-- <el-form-item label="确认密码" prop="password_confirm">
|
||||
<el-input v-model="formData.password_confirm" show-password clearable placeholder="请输入确认密码" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
|
||||
<!-- 管理员状态 -->
|
||||
<el-form-item label="管理员状态" v-if="formData.root != 1">
|
||||
@ -100,7 +100,7 @@ const formData = reactive({
|
||||
org_id: [],
|
||||
avatar: '',
|
||||
password: '',
|
||||
password_confirm: '',
|
||||
// password_confirm: '',
|
||||
disable: 0,
|
||||
multipoint_login: 1,
|
||||
root: 0
|
||||
@ -148,17 +148,17 @@ const formRules = reactive({
|
||||
trigger: ['blur']
|
||||
}
|
||||
] as any[],
|
||||
password_confirm: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入确认密码',
|
||||
trigger: ['blur']
|
||||
},
|
||||
{
|
||||
validator: passwordConfirmValidator,
|
||||
trigger: 'blur'
|
||||
}
|
||||
] as any[]
|
||||
// password_confirm: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: '请输入确认密码',
|
||||
// trigger: ['blur']
|
||||
// },
|
||||
// {
|
||||
// validator: passwordConfirmValidator,
|
||||
// trigger: 'blur'
|
||||
// }
|
||||
// ] as any[]
|
||||
})
|
||||
const { optionsData } = useDictOptions<{
|
||||
role: any[]
|
||||
@ -206,12 +206,12 @@ const getlista = () => {
|
||||
}
|
||||
const setFormData = async (row: any) => {
|
||||
formRules.password = []
|
||||
formRules.password_confirm = [
|
||||
{
|
||||
validator: passwordConfirmValidator,
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
// formRules.password_confirm = [
|
||||
// {
|
||||
// validator: passwordConfirmValidator,
|
||||
// trigger: 'blur'
|
||||
// }
|
||||
// ]
|
||||
const data = await adminDetail({
|
||||
id: row.id
|
||||
})
|
||||
|
@ -50,11 +50,15 @@
|
||||
@change="changeStatus(row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<el-table-column label="操作" width="200" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['auth.admin/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['auth.admin/edit']" type="primary" link
|
||||
@click="showDialog = true, form.id = row.id">
|
||||
修改密码
|
||||
</el-button>
|
||||
<el-button v-if="row.root != 1" v-perms="['auth.admin/delete']" type="danger" link
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
@ -68,11 +72,28 @@
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" />
|
||||
|
||||
<!-- 修改密码 -->
|
||||
<el-dialog v-model="showDialog" v-if="showDialog" width="550px" title="修改密码">
|
||||
<el-form class="mb-[-16px]" :model="form" label-width="100px">
|
||||
<el-form-item label="密码">
|
||||
<el-input v-model="form.password" class="w-[280px]" clearable type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item label="确认密码">
|
||||
<el-input v-model="form.password_confirm" class="w-[280px]" clearable type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handlePwd">修改</el-button>
|
||||
<el-button @click="showDialog = false, resetForm()">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="admin">
|
||||
import { adminEdit, adminLists, adminDelete } from '@/api/perms/admin'
|
||||
import { adminEdit, adminLists, adminDelete, adminPwd } from '@/api/perms/admin'
|
||||
import { roleAll } from '@/api/perms/role'
|
||||
import { useDictOptions } from '@/hooks/useDictOptions'
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
@ -125,6 +146,27 @@ const handleDelete = async (id: number) => {
|
||||
getLists()
|
||||
}
|
||||
|
||||
const showDialog = ref(false)
|
||||
const form = reactive({
|
||||
id: '',
|
||||
password: '',
|
||||
password_confirm: ''
|
||||
})
|
||||
|
||||
const resetForm = () => {
|
||||
form.id = ''
|
||||
form.password = ''
|
||||
form.password_confirm = ''
|
||||
}
|
||||
|
||||
|
||||
|
||||
const handlePwd = async () => {
|
||||
await adminPwd({ ...form })
|
||||
showDialog.value = false
|
||||
resetForm()
|
||||
}
|
||||
|
||||
const { optionsData } = useDictOptions<{
|
||||
role: any[]
|
||||
}>({
|
||||
|
Loading…
x
Reference in New Issue
Block a user