页面修改

This commit is contained in:
THK3121 2023-07-21 11:26:28 +08:00
parent 82c01a1475
commit ca6b419f4c
10 changed files with 1588 additions and 1862 deletions

1
.gitignore vendored
View File

@ -8,6 +8,7 @@ pnpm-debug.log*
lerna-debug.log* lerna-debug.log*
node_modules node_modules
.vscode
.DS_Store .DS_Store
dist dist
dist-ssr dist-ssr

View File

@ -0,0 +1,83 @@
<template>
<div>
<el-card class="!border-none" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="管理员名称" prop="name">
<el-input
class="w-[280px]"
v-model="queryParams.name"
clearable
placeholder="请输入管理员名称"
/>
</el-form-item>
<el-form-item label="请选择管理员角色" prop="role_id">
<el-select class="w-[280px]" v-model="queryParams.role_id">
<el-option label="全部" value />
<el-option
v-for="(item, index) in optionsData.role"
:key="index"
:label="item.name"
:value="item.id"
/>
</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">
<div class="mt-4">
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
<el-table-column label="账号" prop="account" min-width="120" />
<el-table-column label="名称" prop="name" min-width="100" />
<el-table-column label="角色" prop="role_name" min-width="100" show-tooltip-when-overflow />
<el-table-column label="部门" prop="dept_name" min-width="100" show-tooltip-when-overflow />
<el-table-column label="创建时间" prop="create_time" min-width="180" />
<el-table-column label="最近登录时间" prop="login_time" min-width="180" />
<el-table-column label="最近登录IP" prop="login_ip" min-width="120" />
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
</div>
</template>
<script lang="ts" setup name="companyLists">
import { usePaging } from '@/hooks/usePaging'
import { roleAll } from "@/api/perms/role";
import { useDictData,useDictOptions } from '@/hooks/useDictOptions'
import { adminLists} from "@/api/perms/admin";
import { defineEmits } from 'vue'
const { optionsData } = useDictOptions<{
role: any[];
}>({
role: {
api: roleAll,
},
});
//
const queryParams = reactive({
name: "",
role_id: "",
})
//
const emits = defineEmits(['customEvent'])
//
const handleCurrentChange = (value: any) => {
emits('customEvent', value)
}
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: adminLists,
params: queryParams
})
getLists()
</script>

File diff suppressed because it is too large Load Diff

View File

@ -1,307 +1,275 @@
<template> <template>
<div> <div>
<el-card class="!border-none mb-4" shadow="never"> <el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline> <el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="公司名称" prop="company_name"> <el-form-item label="公司名称" prop="company_name">
<el-input <el-input
class="w-[280px]" class="w-[280px]"
v-model="queryParams.company_name" v-model="queryParams.company_name"
clearable clearable
placeholder="请输入公司名称" placeholder="请输入公司名称"
/> />
</el-form-item> </el-form-item>
<el-form-item label="区" prop="area" v-show="company_type_show"> <el-form-item label="区" prop="area" v-show="company_type_show">
<el-input <el-input class="w-[280px]" v-model="queryParams.area" clearable placeholder="请输入区" />
class="w-[280px]" </el-form-item>
v-model="queryParams.area" <el-form-item label="镇" prop="street" v-show="company_type_show">
clearable <el-input class="w-[280px]" v-model="queryParams.street" clearable placeholder="请输入镇" />
placeholder="请输入区" </el-form-item>
/> <el-form-item label="公司类型" prop="company_type" v-show="company_type_show">
</el-form-item> <el-select
<el-form-item label="镇" prop="street" v-show="company_type_show"> v-model="queryParams.company_type"
<el-input placeholder="请选择公司类型"
class="w-[280px]" clearable
v-model="queryParams.street" :style="{ width: '100%' }"
clearable >
placeholder="请输入镇" <el-option
/> v-for="(item, index) in datas.dictTypeLists"
</el-form-item> :key="index"
<el-form-item label="公司类型" prop="company_type" v-show="company_type_show"> :label="item.name"
<el-select :value="item.id"
v-model="queryParams.company_type" ></el-option>
placeholder="请选择公司类型" </el-select>
clearable </el-form-item>
:style="{ width: '100%' }" <el-form-item label="片区经理" prop="area_manager">
> <el-input
<el-option class="w-[280px]"
v-for="(item, index) in datas.dictTypeLists" v-model="queryParams.area_manager"
:key="index" clearable
:label="item.name" placeholder="请输入片区经理"
:value="item.id" />
></el-option> </el-form-item>
</el-select> <el-form-item label="是否签约" prop="is_contract">
</el-form-item> <el-select
<el-form-item label="片区经理" prop="area_manager"> v-model="queryParams.is_contract"
<el-input placeholder="是否签约"
class="w-[280px]" clearable
v-model="queryParams.area_manager" :style="{ width: '100%' }"
clearable >
placeholder="请输入片区经理" <el-option label="已签约" value="1"></el-option>
/> <el-option label="未签约" value="0"></el-option>
</el-form-item> </el-select>
<el-form-item label="是否签约" prop="is_contract"> </el-form-item>
<el-select <el-form-item>
v-model="queryParams.is_contract" <el-button type="primary" @click="resetPage">查询</el-button>
placeholder="是否签约" <el-button @click="resetParams">重置</el-button>
clearable </el-form-item>
:style="{ width: '100%' }" </el-form>
> </el-card>
<el-option label="已签约" value="1"></el-option> <el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-option label="未签约" value="0"></el-option> <!-- <el-button v-perms="['company/add']" type="primary" @click="handleAdd">
</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="['company/add']" type="primary" @click="handleAdd">
<template #icon> <template #icon>
<icon name="el-icon-Plus" /> <icon name="el-icon-Plus" />
</template> </template>
新增 新增
</el-button> --> </el-button>-->
<router-link <router-link
v-perms="['company/add', 'company/edit']" v-perms="['company/add', 'company/edit']"
:to="{ :to="{
path: getRoutePath('company/add:edit') path: getRoutePath('company/add:edit')
}" }"
> >
<el-button type="primary" class="mb-4"> <el-button type="primary" class="mb-4">
<template #icon> <template #icon>
<icon name="el-icon-Plus" /> <icon name="el-icon-Plus" />
</template> </template>
创建 创建
</el-button> </el-button>
</router-link> </router-link>
<div class="mt-4"> <div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange"> <el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column label="id" prop="id" show-overflow-tooltip /> <el-table-column label="id" prop="id" show-overflow-tooltip />
<el-table-column label="查看成员" prop="company_name" show-overflow-tooltip /> <el-table-column label="查看成员" prop="company_name" show-overflow-tooltip />
<el-table-column label="签约公司" prop="company_name" show-overflow-tooltip /> <el-table-column label="签约公司" prop="company_name" show-overflow-tooltip />
<el-table-column label="公司类型" prop="company_type" show-overflow-tooltip /> <el-table-column label="公司类型" prop="company_type" show-overflow-tooltip />
<el-table-column label="区县" prop="area" show-overflow-tooltip /> <el-table-column label="区县" prop="area" show-overflow-tooltip />
<el-table-column label="乡镇" prop="street" show-overflow-tooltip /> <el-table-column label="乡镇" prop="street" show-overflow-tooltip />
<el-table-column label="主联系人" prop="master_name" show-overflow-tooltip /> <el-table-column label="主联系人" prop="master_name" show-overflow-tooltip />
<el-table-column label="联系方式" prop="master_phone" show-overflow-tooltip /> <el-table-column label="联系方式" prop="master_phone" show-overflow-tooltip />
<el-table-column label="片区经理" prop="area_manager" show-overflow-tooltip /> <el-table-column label="片区经理" prop="area_manager" show-overflow-tooltip />
<el-table-column label="是否签约" prop="is_contract" show-overflow-tooltip /> <el-table-column label="是否签约" prop="is_contract" show-overflow-tooltip />
<el-table-column label="操作" align="center" width="300" fixed="right"> <el-table-column label="操作" align="center" width="330" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
<div style="display: flex"> <div style="display: flex">
<el-button v-perms="['company/edit', 'company/add']" type="primary" link>
<el-button <router-link
v-perms="['company/edit', 'company/add']" :to="{
type="primary"
link
>
<router-link
:to="{
path: getRoutePath('company/add:edit'), path: getRoutePath('company/add:edit'),
query: { query: {
id: row.id, id: row.id,
read: true read: true
} }
}" }"
> >查看</router-link>
查看</router-link </el-button>
> <el-button v-perms="['company/edit', 'company/add']" type="primary" link>
</el-button> <router-link
<el-button :to="{
v-perms="['company/edit', 'company/add']"
type="primary"
link
>
<router-link
:to="{
path: getRoutePath('company/add:edit'), path: getRoutePath('company/add:edit'),
query: { query: {
id: row.id, id: row.id,
edit: true edit: true
} }
}" }"
> >编辑</router-link>
编辑 </el-button>
</router-link> <el-button
</el-button> v-perms="['company/delete']"
<el-button type="danger"
v-perms="['company/delete']" link
type="danger" @click="handleDelete(row.id)"
link >删除</el-button>
@click="handleDelete(row.id)" <el-button
> v-perms="['company/edit', 'company/add']"
删除 type="primary"
</el-button> link
<el-button @click="showCreateConctPop(row) "
v-perms="['company/edit', 'company/add']" >生成个人合同</el-button>
type="primary" <el-button
link v-perms="['company/edit', 'company/add']"
@click="showCreateConctPop(row) " type="primary"
> link
创建合同 @click=" showPop=true,contractId=row.id "
</el-button> >发送短信</el-button>
<el-button </div>
v-perms="['company/edit', 'company/add']" </template>
type="primary" </el-table-column>
link </el-table>
@click=" showPop=true,contractId=row.id " </div>
> <div class="flex mt-4 justify-end">
重新发送 <pagination v-model="pager" @change="getLists" />
</el-button> </div>
</div> </el-card>
</template> <el-dialog v-model="showPop" @close="offPop">
</el-table-column> <h1>重要提醒</h1>
</el-table> <div class="content" v-if="showConctactPop">请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.</div>
</div> <div class="content" v-else>确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约</div>
<div class="flex mt-4 justify-end"> <p class="btn_menu">
<pagination v-model="pager" @change="getLists" /> <el-button type="primary" size="large" v-if="showConctactPop" @click="creContct">确认创建</el-button>
</div> <el-button type="primary" size="large" v-else @click="sendMsg">确认</el-button>
</el-card> <el-button type="info" size="large" @click="offPop">返回</el-button>
<el-dialog v-model="showPop" @close="offPop"> </p>
<h1>重要提醒</h1> </el-dialog>
<div class="content" v-if="showConctactPop"> </div>
请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.
</div>
<div class="content" v-else>
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
</div>
<p class="btn_menu">
<el-button type="primary" size="large" v-if="showConctactPop" @click="creContct">确认创建</el-button>
<el-button type="primary" size="large" v-else @click="sendMsg">确认</el-button>
<el-button type="info" size="large" @click="offPop">返回</el-button>
</p>
</el-dialog>
</div>
</template> </template>
<script lang="ts" setup name="companyLists"> <script lang="ts" setup name="companyLists">
import { usePaging } from '@/hooks/usePaging' import { usePaging } from "@/hooks/usePaging";
import { useDictData } from '@/hooks/useDictOptions' import { useDictData } from "@/hooks/useDictOptions";
import { apiCompanyLists, apiCompanyDelete } from '@/api/company' import { apiCompanyLists, apiCompanyDelete } from "@/api/company";
import { generateGontract,sendMsgApi } from '@/api/perms/admin' import { generateGontract, sendMsgApi } from "@/api/perms/admin";
import { timeFormat } from '@/utils/util' import { timeFormat } from "@/utils/util";
import feedback from '@/utils/feedback' import feedback from "@/utils/feedback";
import { dictDataLists } from '@/api/setting/dict' import { dictDataLists } from "@/api/setting/dict";
// import EditPopup from './edit.vue' // import EditPopup from './edit.vue'
import { getRoutePath } from '@/router' import { getRoutePath } from "@/router";
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
const editRef = shallowRef<InstanceType<typeof EditPopup>>() const route = useRoute();
const route = useRoute() const company_type_show = ref(true);
const company_type_show = ref(true)
// //
// //
const showPop = ref(false) const showPop = ref(false);
const showConctactPop=ref(false) const showConctactPop = ref(false);
const offPop=()=>{ const offPop = () => {
showPop.value=false showPop.value = false;
showConctactPop.value=false showConctactPop.value = false;
} };
// id // id
const contractId=ref('') const contractId = ref("");
const showCreateConctPop=(row)=>{ const showCreateConctPop = (row) => {
showPop.value=true, (showPop.value = true),
showConctactPop.value=true, (showConctactPop.value = true),
contractId.value=row.id (contractId.value = row.id);
} };
const creContct=()=>{ const creContct = async () => {
generateGontract({id:contractId.value}) let res = await generateGontract({ id: contractId.value });
offPop() feedback.msgSuccess("发送成功");
} offPop();
const sendMsg=()=>{ };
sendMsgApi({id:contractId.value}) const sendMsg = async () => {
offPop() let res = await sendMsgApi({ id: contractId.value });
} feedback.msgSuccess("发送成功");
offPop();
};
// //
// //
const queryParams = reactive({ const queryParams = reactive({
company_name: '', company_name: "",
area: '', area: "",
street: '', street: "",
company_type: '', company_type: "",
area_manager: '', area_manager: "",
// //
is_contract: '' is_contract: "",
}) });
if (route.query.company_type) { if (route.query.company_type) {
company_type_show.value = false company_type_show.value = false;
queryParams['company_type'] = route.query.company_type?.toString() || '' queryParams["company_type"] = route.query.company_type?.toString() || "";
} }
const datas = reactive({ const datas = reactive({
dictTypeLists: [] dictTypeLists: [],
}) });
const getdictTypeLists = async () => { const getdictTypeLists = async () => {
const data = await dictDataLists({ type_id: 6 }) const data = await dictDataLists({ type_id: 6 });
datas['dictTypeLists'] = data['lists'] datas["dictTypeLists"] = data["lists"];
} };
getdictTypeLists() getdictTypeLists();
// //
const selectData = ref<any[]>([]) const selectData = ref<any[]>([]);
// //
const handleSelectionChange = (val: any[]) => { const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id) selectData.value = val.map(({ id }) => id);
} };
// //
const { dictData } = useDictData('') const { dictData } = useDictData("");
// //
const { pager, getLists, resetParams, resetPage } = usePaging({ const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiCompanyLists, fetchFun: apiCompanyLists,
params: queryParams params: queryParams,
}) });
// //
const handleDelete = async (id: number | any[]) => { const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?') await feedback.confirm("确定要删除?");
await apiCompanyDelete({ id }) await apiCompanyDelete({ id });
getLists() getLists();
} };
getLists() getLists();
</script> </script>
<style lang="scss"> <style lang="scss">
.btn { .btn {
position: absolute; position: absolute;
} }
h1 { h1 {
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
font-size: 30px; font-size: 30px;
color: red; color: red;
margin-bottom: 10px; margin-bottom: 10px;
} }
.content { .content {
font-size: 20px; font-size: 20px;
} }
.info { .info {
color: red; color: red;
font-weight: bold; font-weight: bold;
font-size: 18px; font-size: 18px;
display: inline-block; display: inline-block;
margin: 0 5px; margin: 0 5px;
} }
.btn_menu { .btn_menu {
margin-top: 10vh; margin-top: 10vh;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
} }
</style> </style>

View File

@ -0,0 +1,76 @@
<template>
<el-dialog @confirm="handleSubmit" title="合同详情" v-model="show">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-form-item label="公司" prop="company_id">
<el-input v-model="formData.company_id" :disabled="true" clearable placeholder="请输入公司" />
</el-form-item>
<el-form-item label="合同类型" prop="contract_type">
<el-input v-model="formData.contract_type" :disabled="true" clearable placeholder="请输入合同类型" />
</el-form-item>
<el-form-item label="合同编号" prop="contract_no">
<el-input v-model="formData.contract_no" :disabled="true" clearable placeholder="暂无合同编号" />
</el-form-item>
<el-form-item label="文件" prop="file">
<el-input v-model="formData.file" :disabled="true" clearable placeholder="暂无文件" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-input v-model="formData.status" :disabled="true" clearable placeholder="暂无状态" />
</el-form-item>
<el-form-item label="甲方" prop="party_a">
<el-input v-model="formData.party_a" :disabled="true" clearable placeholder="暂无甲方" />
</el-form-item>
<el-form-item label="乙方" prop="party_b">
<el-input v-model="formData.party_b" :disabled="true" clearable placeholder="暂无乙方" />
</el-form-item>
<el-form-item label="片区经理" prop="area_manager">
<el-input v-model="formData.area_manager" :disabled="true" clearable placeholder="暂无经理" />
</el-form-item>
<el-form-item label="状态" prop="type">
<el-input v-model="formData.type" :disabled="true" clearable placeholder="暂无状态" />
</el-form-item>
</el-form>
<div class="btn_men">
<el-button @click="show=false">取消</el-button>
<el-button type="primary" @click="show=false" >确定</el-button>
</div>
</el-dialog>
</template>
<script setup>
import { ref, reactive, defineExpose } from "vue";
const formData = reactive({
id: "",
company_id: "",
contract_type: "",
contract_no: "",
file: "",
status: "",
party_a: "",
party_b: "",
area_manager: "",
});
const show = ref(false);
const shoeEditFn = (flag) => {
show.value = flag;
};
//
const setFormData = async (data) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key];
}
}
};
defineExpose({
shoeEditFn,
setFormData,
});
</script>
<style lang="scss" scoped>
.btn_men {
text-align: right;
}
</style>

View File

@ -1,6 +1,9 @@
<template> <template>
<div class="edit-popup"> <div class="edit-popup">
<popup <popup
v-if="true"
ref="popupRef" ref="popupRef"
:title="popupTitle" :title="popupTitle"
:async="true" :async="true"
@ -55,7 +58,6 @@ const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>() const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add') const mode = ref('add')
// //
const popupTitle = computed(() => { const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑合同' : '新增合同' return mode.value == 'edit' ? '编辑合同' : '新增合同'

View File

@ -2,46 +2,21 @@
<div> <div>
<el-card class="!border-none mb-4" shadow="never"> <el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline> <el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="公司" prop="company_id"> <el-form-item label="公司名称" prop="company_id">
<el-input <el-input class="w-[280px]" v-model="queryParams.company_id" clearable placeholder="请输入公司" />
class="w-[280px]"
v-model="queryParams.company_id"
clearable
placeholder="请输入公司"
/>
</el-form-item> </el-form-item>
<el-form-item label="合同类型" prop="contract_type"> <el-form-item label="合同类型" prop="contract_type">
<el-input <el-input class="w-[280px]" v-model="queryParams.contract_type" clearable placeholder="请输入合同类型" />
class="w-[280px]"
v-model="queryParams.contract_type"
clearable
placeholder="请输入合同类型"
/>
</el-form-item> </el-form-item>
<el-form-item label="合同编号" prop="contract_no"> <el-form-item label="合同编号" prop="contract_no">
<el-input <el-input class="w-[280px]" v-model="queryParams.contract_no" clearable placeholder="请输入合同编号" />
class="w-[280px]"
v-model="queryParams.contract_no"
clearable
placeholder="请输入合同编号"
/>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-input <el-input class="w-[280px]" v-model="queryParams.status" clearable placeholder="请输入状态" />
class="w-[280px]"
v-model="queryParams.status"
clearable
placeholder="请输入状态"
/>
</el-form-item> </el-form-item>
<el-form-item label="片区经理" prop="area_manager"> <el-form-item label="片区经理" prop="area_manager">
<el-input <el-input class="w-[280px]" v-model="queryParams.area_manager" clearable placeholder="请输入片区经理" />
class="w-[280px]"
v-model="queryParams.area_manager"
clearable
placeholder="请输入片区经理"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button> <el-button type="primary" @click="resetPage">查询</el-button>
@ -55,29 +30,28 @@
<icon name="el-icon-Plus" /> <icon name="el-icon-Plus" />
</template> </template>
新增 新增
</el-button> --> </el-button>-->
<el-button <el-button v-perms="['contract.contract/delete']" :disabled="!selectData.length"
v-perms="['contract.contract/delete']" @click="handleDelete(selectData)">删除</el-button>
:disabled="!selectData.length"
@click="handleDelete(selectData)"
>
删除
</el-button>
<div class="mt-4"> <div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange"> <el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column label="id" prop="id" show-overflow-tooltip /> <el-table-column label="id" prop="id" show-overflow-tooltip />
<el-table-column label="公司" prop="company_name" show-overflow-tooltip /> <el-table-column label="公司" prop="company_name" show-overflow-tooltip />
<el-table-column <el-table-column label="合同类型" prop="contract_type_name" show-overflow-tooltip />
label="合同类型"
prop="contract_type_name"
show-overflow-tooltip
/>
<el-table-column label="合同编号" prop="contract_no" show-overflow-tooltip /> <el-table-column label="合同编号" prop="contract_no" show-overflow-tooltip />
<el-table-column label="状态" prop="status" show-overflow-tooltip /> <el-table-column label="状态" prop="status" show-overflow-tooltip />
<el-table-column label="甲方" prop="party_a_name" show-overflow-tooltip /> <el-table-column label="甲方" prop="party_a_name" show-overflow-tooltip />
<el-table-column label="乙方" prop="party_b_name" show-overflow-tooltip />
<el-table-column label="类型" prop="type" show-overflow-tooltip>
<template #default="scope">
<span>{{ scope.row.type == 1 ? '公司' : scope.row.type == 0 ? "" : '个人' }}</span>
</template>
</el-table-column>
<el-table-column label="片区经理" prop="area_manager" show-overflow-tooltip /> <el-table-column label="片区经理" prop="area_manager" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right"> <el-table-column label="操作" width="180" fixed="right" align="center">
<template #default="{ row }"> <template #default="{ row }">
<!-- <el-button <!-- <el-button
v-perms="['contract.contract/edit']" v-perms="['contract.contract/edit']"
@ -86,25 +60,20 @@
@click="handleEdit(row)" @click="handleEdit(row)"
> >
编辑 编辑
</el-button> --> </el-button>-->
<el-button <el-button v-perms="['contract.contract/delete']" type="primary" link
v-perms="['contract.contract/delete']" @click="checkContcat(row.id)">
type="primary" <!-- <a href="https://www.zhihu.com/signin?next=%2F">查看</a> -->
link 查看
@click="checkContcat(row.id)" </el-button>
> <el-button v-perms="['contract.contract/delete']" type="primary" link
<!-- <a href="https://www.zhihu.com/signin?next=%2F">查看</a> --> @click="showDetil(row.id)">
查看 <!-- <a href="https://www.zhihu.com/signin?next=%2F">查看</a> -->
详情
</el-button> </el-button>
<el-button <el-button v-perms="['contract.contract/delete']" type="danger" link
v-perms="['contract.contract/delete']" @click="handleDelete(row.id)">删除</el-button>
type="danger"
link
@click="handleDelete(row.id)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -113,90 +82,94 @@
<pagination v-model="pager" @change="getLists" /> <pagination v-model="pager" @change="getLists" />
</div> </div>
</el-card> </el-card>
<edit-popup <contractDetil ref="childDetil"></contractDetil>
v-if="showEdit"
ref="editRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
</div> </div>
</template> </template>
<script lang="ts" setup name="contractLists"> <script lang="ts" setup name="contractLists">
import { usePaging } from '@/hooks/usePaging' import contractDetil from "./contractDetil.vue";
import { useDictData } from '@/hooks/useDictOptions' import { usePaging } from "@/hooks/usePaging";
import { apiContractLists, apiContractDelete,apiContractDetail } from '@/api/contract' import { useDictData } from "@/hooks/useDictOptions";
import { timeFormat } from '@/utils/util' import {
import feedback from '@/utils/feedback' apiContractLists,
import EditPopup from './edit.vue' apiContractDelete,
import { ElMessage } from 'element-plus' apiContractDetail,
} from "@/api/contract";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
// //
const showEdit = ref(false) const showEdit = ref(false);
// //
const queryParams = reactive({ const queryParams = reactive({
company_id: '', company_id: "",
contract_type: '', contract_type: "",
contract_no: '', contract_no: "",
status: '', status: "",
party_a: '', party_a: "",
party_b: '', party_b: "",
area_manager: '' area_manager: "",
}) });
// //
const selectData = ref<any[]>([]) const selectData = ref<any[]>([]);
// //
const handleSelectionChange = (val: any[]) => { const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id) selectData.value = val.map(({ id }) => id);
} };
// //
const { dictData } = useDictData('') const { dictData } = useDictData("");
// //
const { pager, getLists, resetParams, resetPage } = usePaging({ const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiContractLists, fetchFun: apiContractLists,
params: queryParams params: queryParams,
}) });
//
let childDetil = ref();
const showDetil = async (id) => {
let res = await apiContractDetail({ id });
childDetil.value.setFormData(res);
childDetil.value.shoeEditFn(true);
};
// //
const checkContcat=(id)=>{ const checkContcat = (id: Number) => {
// console.log(pager) apiContractDetail({ id }).then((res) => {
apiContractDetail({id}).then(res=>{ res.file ? window.open(res.file) : feedback.msgError("暂无合同可以查看");
res.file? window.open(res.file): ElMessage.error ("暂无合同可以查看") });
// console.log(res)
// if(res.file)
})
// window.open('https://www.zhihu.com/signin?next=%2F') // window.open('https://www.zhihu.com/signin?next=%2F')
} };
// //
const handleAdd = async () => { // const handleAdd = async () => {
showEdit.value = true // showEdit.value = true;
await nextTick() // await nextTick();
editRef.value?.open('add') // editRef.value?.open("add");
} // };
// // //
const handleEdit = async (data: any) => { // const handleEdit = async (data: any) => {
showEdit.value = true // showEdit.value = true;
await nextTick() // await nextTick();
editRef.value?.open('edit') // editRef.value?.open("edit");
editRef.value?.setFormData(data) // editRef.value?.setFormData(data);
} // };
// //
const handleDelete = async (id: number | any[]) => { const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?') await feedback.confirm("确定要删除?");
await apiContractDelete({ id }) await apiContractDelete({ id });
getLists() getLists();
} };
getLists() getLists();
// pager.lists.forEach((item) => {
// console.log(item.type);
// });
</script> </script>

File diff suppressed because it is too large Load Diff

View File

@ -3,33 +3,19 @@
<el-card class="!border-none" shadow="never"> <el-card class="!border-none" shadow="never">
<el-form class="mb-[-16px]" :model="formData" inline> <el-form class="mb-[-16px]" :model="formData" inline>
<el-form-item label="管理员名称"> <el-form-item label="管理员名称">
<el-input <el-input v-model="formData.name" class="w-[280px]" clearable @keyup.enter="resetPage" />
v-model="formData.name"
class="w-[280px]"
clearable
@keyup.enter="resetPage"
/>
</el-form-item> </el-form-item>
<el-form-item label="管理员角色"> <el-form-item label="管理员角色">
<el-select class="w-[280px]" v-model="formData.role_id"> <el-select class="w-[280px]" v-model="formData.role_id">
<el-option label="全部" value="" /> <el-option label="全部" value />
<el-option <el-option v-for="(item, index) in optionsData.role" :key="index" :label="item.name"
v-for="(item, index) in optionsData.role" :value="item.id" />
:key="index"
:label="item.name"
:value="item.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button> <el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button> <el-button @click="resetParams">重置</el-button>
<export-data <export-data class="ml-2.5" :fetch-fun="adminLists" :params="formData" :page-size="pager.size" />
class="ml-2.5"
:fetch-fun="adminLists"
:params="formData"
:page-size="pager.size"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
@ -48,79 +34,33 @@
<el-avatar :size="50" :src="row.avatar"></el-avatar> <el-avatar :size="50" :src="row.avatar"></el-avatar>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="账号" prop="account" min-width="100" /> <el-table-column label="账号" prop="account" min-width="120" />
<el-table-column label="名称" prop="name" min-width="100" /> <el-table-column label="名称" prop="name" min-width="100" />
<el-table-column <el-table-column label="角色" prop="role_name" min-width="100" show-tooltip-when-overflow />
label="角色" <el-table-column label="部门" prop="dept_name" min-width="100" show-tooltip-when-overflow />
prop="role_name"
min-width="100"
show-tooltip-when-overflow
/>
<el-table-column
label="部门"
prop="dept_name"
min-width="100"
show-tooltip-when-overflow
/>
<el-table-column label="创建时间" prop="create_time" min-width="180" /> <el-table-column label="创建时间" prop="create_time" min-width="180" />
<el-table-column label="最近登录时间" prop="login_time" min-width="180" /> <el-table-column label="最近登录时间" prop="login_time" min-width="180" />
<el-table-column label="最近登录IP" prop="login_ip" min-width="120" /> <el-table-column label="最近登录IP" prop="login_ip" min-width="120" />
<el-table-column label="状态" min-width="100" v-perms="['auth.admin/edit']"> <el-table-column label="状态" min-width="100" v-perms="['auth.admin/edit']">
<template #default="{ row }"> <template #default="{ row }">
<el-switch <el-switch v-if="row.root != 1" v-model="row.disable" :active-value="0" :inactive-value="1"
v-if="row.root != 1" @change="changeStatus(row)" />
v-model="row.disable"
:active-value="0"
:inactive-value="1"
@change="changeStatus(row)"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="300" align="center" fixed="right"> <el-table-column label="操作" width="330" align="center" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
<div style="display: flex"> <div style="display: flex">
<el-button <el-button v-perms="['auth.admin/edit']" type="primary" link
v-perms="['auth.admin/edit']" @click="handleCheck(row)">查看</el-button>
type="primary" <el-button v-perms="['auth.admin/edit']" type="primary" link
link @click="handleEdit(row)">编辑</el-button>
@click="handleCheck(row)" <el-button v-if="row.root != 1" v-perms="['auth.admin/delete']" type="danger" link
> @click="handleDelete(row.id)">删除</el-button>
查看 <el-button v-perms="['company/edit', 'company/add']" type="primary" link
</el-button> @click="showPop = true, showConctactPop = true, contractId = row.id">生成个人合同</el-button>
<el-button <el-button v-perms="['company/edit', 'company/add']" type="primary" link
v-perms="['auth.admin/edit']" @click=" showPop = true, contractId = row.id">发送短信</el-button>
type="primary" </div>
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="row.root != 1"
v-perms="['auth.admin/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
删除
</el-button>
<el-button
v-perms="['company/edit', 'company/add']"
type="primary"
link
@click="showPop=true,showConctactPop=true,contractId=row.id "
>
创建合同
</el-button>
<el-button
v-perms="['company/edit', 'company/add']"
type="primary"
link
@click=" showPop=true,contractId=row.id "
>
重新发送
</el-button>
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -129,17 +69,13 @@
<pagination v-model="pager" @change="getLists" /> <pagination v-model="pager" @change="getLists" />
</div> </div>
</el-card> </el-card>
<edit-popup v-if="showEdit" ref="editRef" :isCheck="isCheck" @success="getLists" @close="showEdit = false" /> <edit-popup v-if="showEdit" ref="editRef" :isCheck="isCheck" @success="getLists" @close="showEdit = false" />
<el-dialog v-model="showPop" @close="offPop"> <el-dialog v-model="showPop" @close="offPop">
<h1>重要提醒</h1> <h1>重要提醒</h1>
<div class="content" v-if="showConctactPop"> <div class="content" v-if="showConctactPop">请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.</div>
请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送. <div class="content" v-else>确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约</div>
</div>
<div class="content" v-else>
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
</div>
<p class="btn_menu"> <p class="btn_menu">
<el-button type="primary" size="large" v-if="showConctactPop" @click="creContct">确认创建</el-button> <el-button type="primary" size="large" v-if="showConctactPop" @click="creContct">确认创建</el-button>
<el-button type="primary" size="large" v-else @click="sendMsg">确认</el-button> <el-button type="primary" size="large" v-else @click="sendMsg">确认</el-button>
<el-button type="info" size="large" @click="offPop">返回</el-button> <el-button type="info" size="large" @click="offPop">返回</el-button>
</p> </p>
@ -148,43 +84,51 @@
</template> </template>
<script lang="ts" setup name="admin"> <script lang="ts" setup name="admin">
import { adminEdit, adminLists, adminDelete,generateGontract,sendMsgApi } from '@/api/perms/admin' import {
import { roleAll } from '@/api/perms/role' adminEdit,
import { useDictOptions } from '@/hooks/useDictOptions' adminLists,
import { usePaging } from '@/hooks/usePaging' adminDelete,
import feedback from '@/utils/feedback' generateGontract,
import EditPopup from './edit.vue' sendMsgApi,
const editRef = shallowRef<InstanceType<typeof EditPopup>>() } from "@/api/perms/admin";
import { roleAll } from "@/api/perms/role";
import { useDictOptions } from "@/hooks/useDictOptions";
import { usePaging } from "@/hooks/usePaging";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
// //
const formData = reactive({ const formData = reactive({
name: '', name: "",
role_id: '' role_id: "",
}) });
const contractId=ref('') const contractId = ref("");
// //
const showPop=ref(false) const showPop = ref(false);
const showConctactPop=ref(false) const showConctactPop = ref(false);
const offPop=()=>{ const offPop = () => {
showPop.value=false showPop.value = false;
showConctactPop.value=false showConctactPop.value = false;
} };
const creContct=()=>{ const creContct = () => {
generateGontract({id:contractId.value}) // feedback.msgSuccess("");
offPop() generateGontract({ id: contractId.value }).then(() => {
} feedback.msgSuccess("发送成功");
const sendMsg=()=>{ });
sendMsgApi({id:contractId.value}).then(res=>{ offPop();
console.log(res) };
}) const sendMsg = () => {
sendMsgApi({ id: contractId.value }).then((res) => {
offPop() feedback.msgSuccess("发送成功");
} });
offPop();
};
// //
const showEdit = ref(false) const showEdit = ref(false);
const { pager, getLists, resetParams, resetPage } = usePaging({ const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: adminLists, fetchFun: adminLists,
params: formData params: formData,
}) });
const changeStatus = (data: any) => { const changeStatus = (data: any) => {
adminEdit({ adminEdit({
@ -193,53 +137,52 @@ const changeStatus = (data: any) => {
name: data.name, name: data.name,
role_id: data.role_id, role_id: data.role_id,
disable: data.disable, disable: data.disable,
multipoint_login: data.multipoint_login multipoint_login: data.multipoint_login,
}).finally(() => { }).finally(() => {
getLists() getLists();
}) });
} };
// //
const isCheck=ref(false) const isCheck = ref(false);
const handleCheck = async (data: any) => { const handleCheck = async (data: any) => {
isCheck.value=true isCheck.value = true;
showEdit.value = true showEdit.value = true;
await nextTick() await nextTick();
editRef.value?.open('edit') editRef.value?.open("edit");
editRef.value?.setFormData(data) editRef.value?.setFormData(data);
} };
const handleAdd = async () => { const handleAdd = async () => {
isCheck.value=false isCheck.value = false;
showEdit.value = true showEdit.value = true;
await nextTick() await nextTick();
editRef.value?.open('add') editRef.value?.open("add");
} };
const handleEdit = async (data: any) => { const handleEdit = async (data: any) => {
isCheck.value=false isCheck.value = false;
showEdit.value = true showEdit.value = true;
await nextTick() await nextTick();
editRef.value?.open('edit') editRef.value?.open("edit");
editRef.value?.setFormData(data) editRef.value?.setFormData(data);
} };
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
await feedback.confirm('确定要删除?') await feedback.confirm("确定要删除?");
await adminDelete({ id }) await adminDelete({ id });
getLists() getLists();
} };
const { optionsData } = useDictOptions<{ const { optionsData } = useDictOptions<{
role: any[] role: any[];
}>({ }>({
role: { role: {
api: roleAll api: roleAll,
} },
}) });
onMounted(() => { onMounted(() => {
getLists() getLists();
}) });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
h1 { h1 {