多个模块组织功能模块修改
This commit is contained in:
parent
0e5e582b78
commit
29ad706716
@ -185,7 +185,7 @@ const delFileFn = (index: number) => {
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
@ -185,7 +185,7 @@ const popupTitle = computed(() => {
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
@ -214,7 +214,7 @@ const formRules = reactive<any>({
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
@ -442,7 +442,7 @@ const formRules = reactive<any>({
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
@ -251,7 +251,7 @@ const amountinput = (e) => {
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
@ -188,7 +188,7 @@ const formRules = reactive<any>({
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
@ -2,6 +2,15 @@
|
|||||||
<div class="edit-popup">
|
<div class="edit-popup">
|
||||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||||
|
<div style="display: flex; flex-direction: row-reverse; justify-content: flex-start;margin-bottom: 30px;">
|
||||||
|
|
||||||
|
<el-select class="w-[180px]" v-model="formData.dept_id" clearable placeholder="请选择部门">
|
||||||
|
<el-option v-for="(item, index) in list2" :key="index" :label="item.name" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
<el-select class="w-[180px]" v-model="formData.org_id" clearable placeholder="请选择组织" @change="deptrmt">
|
||||||
|
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
<el-card class="mb-2">
|
<el-card class="mb-2">
|
||||||
<div class="tit">客户基本资料</div>
|
<div class="tit">客户基本资料</div>
|
||||||
<el-row>
|
<el-row>
|
||||||
@ -217,7 +226,10 @@ const emit = defineEmits(['success', 'close'])
|
|||||||
const formRef = shallowRef<FormInstance>()
|
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 list1 = reactive([])
|
||||||
|
const list2 = reactive([])
|
||||||
|
import { deptAll } from '@/api/org/department'
|
||||||
|
import { getAll } from '@/api/org/organization'
|
||||||
const datas = reactive({
|
const datas = reactive({
|
||||||
provinceOptions: [],
|
provinceOptions: [],
|
||||||
cityOptions: [],
|
cityOptions: [],
|
||||||
@ -233,31 +245,70 @@ const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
|
|||||||
// if (!value) {
|
// if (!value) {
|
||||||
// return callback(new Error('电话号码不能为空'))
|
// return callback(new Error('电话号码不能为空'))
|
||||||
// }
|
// }
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
if (phoneReg.test(value)) {
|
// if (phoneReg.test(value)) {
|
||||||
callback()
|
// callback()
|
||||||
} else {
|
// } else {
|
||||||
callback(new Error('电话号码格式不正确'))
|
// callback(new Error('电话号码格式不正确'))
|
||||||
}
|
// }
|
||||||
|
|
||||||
}, 100)
|
// }, 100)
|
||||||
|
|
||||||
|
if (value && phoneReg.test(value)) {
|
||||||
|
return callback(new Error('电话号码格式不正确'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
|
const userEmail = (rule: any, value: string, callback: (arg0: Error | undefined) => void) => {
|
||||||
const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
|
const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
|
||||||
// if (!value) {
|
// if (!value) {
|
||||||
// return callback(new Error('邮箱不能为空'))
|
// return callback(new Error('邮箱不能为空'))
|
||||||
// }
|
// }
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
if (mailReg.test(value)) {
|
// if (mailReg.test(value)) {
|
||||||
callback()
|
// callback()
|
||||||
} else {
|
// } else {
|
||||||
callback(new Error('请输入正确的邮箱格式'))
|
// callback(new Error('请输入正确的邮箱格式'))
|
||||||
}
|
// }
|
||||||
}, 100)
|
// }, 100)
|
||||||
|
if (value && mailReg.test(value)) {
|
||||||
|
return callback(new Error('请输入正确的邮箱格式'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
//获取所有组织
|
||||||
|
const getlist = () => {
|
||||||
|
getAll().then((res) => {
|
||||||
|
Object.assign(list1, res)
|
||||||
|
if (res.length > 0 && !formData.org_id) {
|
||||||
|
formData.org_id = res[0].id
|
||||||
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
|
if (res.length > 0) {
|
||||||
|
Object.assign(list2, res)
|
||||||
|
formData.dept_id = res[0].id
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//获取部门
|
||||||
|
const deptrmt = (e) => {
|
||||||
|
getlist1(e)
|
||||||
|
}
|
||||||
|
//获取所有部门
|
||||||
|
const getlist1 = (id: any) => {
|
||||||
|
deptAll({ 'org_id': id }).then((res) => {
|
||||||
|
Object.assign(list2, res)
|
||||||
|
})
|
||||||
|
}
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
id: '',
|
id: '',
|
||||||
|
dept_id: '',
|
||||||
|
org_id: '',
|
||||||
name: '',
|
name: '',
|
||||||
custom_type: '',
|
custom_type: '',
|
||||||
parent_company: 5565665,
|
parent_company: 5565665,
|
||||||
@ -310,7 +361,10 @@ const setFormData = async (data: Record<any, any>) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
formData.other_contacts = JSON.parse(formData.other_contacts)
|
if (formData.dept_id) {
|
||||||
|
getlist1(formData.dept_id)
|
||||||
|
}
|
||||||
|
formData.other_contacts = JSON.parse(data.other_contacts)
|
||||||
|
|
||||||
console.log(formData, '2222222222')
|
console.log(formData, '2222222222')
|
||||||
|
|
||||||
@ -340,6 +394,7 @@ const handleSubmit = async () => {
|
|||||||
const open = (type = 'add') => {
|
const open = (type = 'add') => {
|
||||||
mode.value = type
|
mode.value = type
|
||||||
popupRef.value?.open()
|
popupRef.value?.open()
|
||||||
|
getlist()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 关闭回调
|
// 关闭回调
|
||||||
|
@ -2,6 +2,16 @@
|
|||||||
<div class="edit-popup">
|
<div class="edit-popup">
|
||||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||||
|
<div style="display: flex; flex-direction: row-reverse; justify-content: flex-start;margin-bottom: 30px;">
|
||||||
|
|
||||||
|
<el-select class="w-[180px]" v-model="formData.dept_id" clearable placeholder="请选择部门">
|
||||||
|
<el-option v-for="(item, index) in list2" :key="index" :label="item.name" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
<el-select class="w-[180px]" v-model="formData.org_id" clearable placeholder="请选择组织" @change="deptrmt">
|
||||||
|
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="项目名称" prop="project_id" @click="showDialog = true">
|
<el-form-item label="项目名称" prop="project_id" @click="showDialog = true">
|
||||||
@ -120,6 +130,10 @@ import { timeFormat } from '@/utils/util'
|
|||||||
import type { PropType } from 'vue'
|
import type { PropType } from 'vue'
|
||||||
import useUserStore from "@/stores/modules/user";
|
import useUserStore from "@/stores/modules/user";
|
||||||
import configs from "@/config"
|
import configs from "@/config"
|
||||||
|
const list1 = reactive([])
|
||||||
|
const list2 = reactive([])
|
||||||
|
import { deptAll } from '@/api/org/department'
|
||||||
|
import { getAll } from '@/api/org/organization'
|
||||||
import reviewprocess from '@/components/reviewprocess/index.vue'
|
import reviewprocess from '@/components/reviewprocess/index.vue'
|
||||||
import costDialog from '@/components/budget/index.vue'
|
import costDialog from '@/components/budget/index.vue'
|
||||||
import peojectDialog from '@/components/project/index.vue'
|
import peojectDialog from '@/components/project/index.vue'
|
||||||
@ -177,10 +191,37 @@ const mode = ref('add')
|
|||||||
const popupTitle = computed(() => {
|
const popupTitle = computed(() => {
|
||||||
return mode.value == 'edit' ? '编辑客户售后' : '新增客户售后'
|
return mode.value == 'edit' ? '编辑客户售后' : '新增客户售后'
|
||||||
})
|
})
|
||||||
|
//获取所有组织
|
||||||
|
const getlist = () => {
|
||||||
|
getAll().then((res) => {
|
||||||
|
Object.assign(list1, res)
|
||||||
|
if (res.length > 0 && !formData.org_id) {
|
||||||
|
formData.org_id = res[0].id
|
||||||
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
|
if (res.length > 0) {
|
||||||
|
Object.assign(list2, res)
|
||||||
|
formData.dept_id = res[0].id
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//获取部门
|
||||||
|
const deptrmt = (e) => {
|
||||||
|
getlist1(e)
|
||||||
|
}
|
||||||
|
//获取所有部门
|
||||||
|
const getlist1 = (id: any) => {
|
||||||
|
deptAll({ 'org_id': id }).then((res) => {
|
||||||
|
Object.assign(list2, res)
|
||||||
|
})
|
||||||
|
}
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
id: '',
|
id: '',
|
||||||
|
dept_id: '',
|
||||||
|
org_id: '',
|
||||||
project_id: '',
|
project_id: '',
|
||||||
custom_id: '',
|
custom_id: '',
|
||||||
approve_id: '',
|
approve_id: '',
|
||||||
@ -218,6 +259,9 @@ const setFormData = async (data: Record<any, any>) => {
|
|||||||
});
|
});
|
||||||
Object.assign(formDataannex, arry1)
|
Object.assign(formDataannex, arry1)
|
||||||
}
|
}
|
||||||
|
if (formData.dept_id) {
|
||||||
|
getlist1(formData.dept_id)
|
||||||
|
}
|
||||||
for (const key in formData) {
|
for (const key in formData) {
|
||||||
if (data[key] != null && data[key] != undefined) {
|
if (data[key] != null && data[key] != undefined) {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
@ -255,6 +299,7 @@ const handleSubmit = async () => {
|
|||||||
const open = (type = 'add') => {
|
const open = (type = 'add') => {
|
||||||
mode.value = type
|
mode.value = type
|
||||||
popupRef.value?.open()
|
popupRef.value?.open()
|
||||||
|
getlist()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 关闭回调
|
// 关闭回调
|
||||||
|
@ -223,7 +223,7 @@ const customEvent1 = (e: any) => {
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
@ -217,7 +217,7 @@ const customEvent1 = (e: any) => {
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
@ -403,7 +403,7 @@ const getDetail = async (row: Record<string, any>) => {
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
@ -408,7 +408,7 @@ const getDetail = async (row: Record<string, any>) => {
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
@ -363,7 +363,7 @@ const subjectmu = (a: any, b: number) => {
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
@ -29,7 +29,7 @@ const popupTitle = computed(() => {
|
|||||||
return mode.value == 'edit' ? '编辑组织' : '新增组织'
|
return mode.value == 'edit' ? '编辑组织' : '新增组织'
|
||||||
})
|
})
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
|
id: "",
|
||||||
name: '',
|
name: '',
|
||||||
master: '',
|
master: '',
|
||||||
status: 0
|
status: 0
|
||||||
|
@ -298,7 +298,7 @@ const popupTitle = computed(() => {
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
186
src/views/project_attendance_record/detail.vue
Normal file
186
src/views/project_attendance_record/detail.vue
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="detail-popup">
|
||||||
|
<popup ref="popupRef" title="保险管理详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||||
|
<el-form ref="formRef" :model="formData" label-width="120px">
|
||||||
|
<el-card class="mb-2">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="项目名称">
|
||||||
|
{{ formData.project_name }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="项目编号">
|
||||||
|
{{ formData.project_code }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="姓名">
|
||||||
|
{{ formData.person_name }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="身份证号">
|
||||||
|
{{ formData.person_idcard }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="投保日期">
|
||||||
|
{{ formData.insurance_date }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="到期日期">
|
||||||
|
{{ formData.due_date }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="保费(元)">
|
||||||
|
{{ formData.insurance }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="投保金额(万元)">
|
||||||
|
{{ formData.insured_amount }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="保险公司">
|
||||||
|
{{ formData.insurance_company }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="保单明细">
|
||||||
|
{{ formData.insurance_detail }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="发票编号">
|
||||||
|
{{ formData.invoice_no
|
||||||
|
}}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="经办人">
|
||||||
|
{{ formData.handler
|
||||||
|
}}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="合同附件">
|
||||||
|
<div v-if="formDataannex.length > 0">
|
||||||
|
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||||
|
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||||
|
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>暂无附件</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
</el-form>
|
||||||
|
</popup>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup name="customdetail">
|
||||||
|
|
||||||
|
import type { FormInstance } from 'element-plus'
|
||||||
|
import Popup from '@/components/popup/index.vue'
|
||||||
|
import { apiCustomDetail } from '@/api/custom'
|
||||||
|
import { timeFormat } from '@/utils/util'
|
||||||
|
import type { PropType } from 'vue'
|
||||||
|
defineProps({
|
||||||
|
dictData: {
|
||||||
|
type: Object as PropType<Record<string, any[]>>,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const emit = defineEmits(['success', 'close'])
|
||||||
|
const formRef = shallowRef<FormInstance>()
|
||||||
|
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||||
|
const formDataannex = reactive([])
|
||||||
|
|
||||||
|
|
||||||
|
const datas = reactive({
|
||||||
|
provinceOptions: [],
|
||||||
|
cityOptions: [],
|
||||||
|
areaOptions: [],
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const formData = reactive({
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 获取详情
|
||||||
|
const setFormData = async (data: Record<any, any>) => {
|
||||||
|
Object.assign(formData, data)
|
||||||
|
if (data.annex && data.annex.length > 0) {
|
||||||
|
|
||||||
|
const arry1 = data.annex.map((item: any, index: any) => {
|
||||||
|
return {
|
||||||
|
name: `文件${index + 1}`,
|
||||||
|
uri: item
|
||||||
|
};
|
||||||
|
});
|
||||||
|
Object.assign(formDataannex, arry1)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const getDetail = async (row: Record<string, any>) => {
|
||||||
|
const data = await apiCustomDetail({
|
||||||
|
id: row.id
|
||||||
|
})
|
||||||
|
setFormData(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 提交按钮
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
popupRef.value?.close()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//打开弹窗
|
||||||
|
const open = () => {
|
||||||
|
console.log('1111111')
|
||||||
|
popupRef.value?.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭回调
|
||||||
|
const handleClose = () => {
|
||||||
|
emit('close')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open,
|
||||||
|
setFormData,
|
||||||
|
getDetail
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.tit {
|
||||||
|
font-size: 1.2em;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
266
src/views/project_attendance_record/edit.vue
Normal file
266
src/views/project_attendance_record/edit.vue
Normal file
@ -0,0 +1,266 @@
|
|||||||
|
<template>
|
||||||
|
<div class="edit-popup">
|
||||||
|
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||||
|
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules" inline>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="项目编码" prop="project_id">
|
||||||
|
<el-input v-model="project_code" clearable placeholder="请输入项目编码" @click="showDialog = true" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="项目名称" prop="project_id">
|
||||||
|
<el-input v-model="project_name" clearable placeholder="请输入项目名称" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="姓名" prop="project_person_id" @click="showDialog1 = true" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
|
<el-input v-model="person_name" clearable placeholder="请选择项目人员" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="身份证号" prop="project_person_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
|
<el-input v-model="idcard" clearable placeholder="系统自动填写" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="投保日期" prop="insurance_date">
|
||||||
|
<el-date-picker class="flex-1 !flex" v-model="formData.insurance_date" clearable type="date" value-format="YYYY-MM-DD" placeholder="选择投保日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="到期日期" prop="due_date" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
|
<el-date-picker class="flex-1 !flex" v-model="formData.due_date" clearable type="date" value-format="YYYY-MM-DD" placeholder="选择到期日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="保险种类" prop="type">
|
||||||
|
<el-input v-model="formData.type" clearable placeholder="请输入保险种类" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="保单号" prop="insurance_no">
|
||||||
|
<el-input v-model="formData.insurance_no" clearable placeholder="请输入保单号" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="保费(元)" prop="insurance">
|
||||||
|
<el-input v-model="formData.insurance" clearable type="number" placeholder="请输入保费(元)" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="投保金额(万元)" prop="insured_amount">
|
||||||
|
<el-input v-model="formData.insured_amount" clearable type="number" placeholder="请输入投保金额(万元)" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="保险公司" prop="insurance_company">
|
||||||
|
<el-input v-model="formData.insurance_company" clearable placeholder="请输入保险公司" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
|
||||||
|
<el-form-item label="保单明细" prop="insurance_detail">
|
||||||
|
<el-input v-model="formData.insurance_detail" clearable placeholder="请输入保单明细" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="发票编号" prop="invoice_no">
|
||||||
|
<el-input v-model="formData.invoice_no" clearable placeholder="请输入发票编号" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="经办人" prop="handler">
|
||||||
|
<el-input v-model="formData.handler" clearable placeholder="请输入经办人" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="合同附件" prop="field127">
|
||||||
|
<el-upload accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||||
|
<el-button type="primary">
|
||||||
|
上传
|
||||||
|
</el-button>
|
||||||
|
</el-upload>
|
||||||
|
<div>
|
||||||
|
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||||
|
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||||
|
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</popup>
|
||||||
|
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||||
|
<projectDialog @customEvent="customEvent"></projectDialog>
|
||||||
|
</el-dialog>
|
||||||
|
<el-dialog v-model="showDialog1" title="选择项目人员" width="70%">
|
||||||
|
<customDialog @customEvent="customEvent1" :project_id="formData.project_id"></customDialog>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup name="procurementContractEdit">
|
||||||
|
import type { FormInstance } from 'element-plus'
|
||||||
|
import Popup from '@/components/popup/index.vue'
|
||||||
|
import projectDialog from '@/components/project/index.vue'
|
||||||
|
import { insurancemanagementAdd, insurancemanagementEdit, insurancemanagementDetail } from '@/api/project_insurance_management'
|
||||||
|
import customDialog from '@/components/project_personnel/index.vue'
|
||||||
|
import { timeFormat } from '@/utils/util'
|
||||||
|
import type { PropType } from 'vue'
|
||||||
|
defineProps({
|
||||||
|
dictData: {
|
||||||
|
type: Object as PropType<Record<string, any[]>>,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const emit = defineEmits(['success', 'close'])
|
||||||
|
const formRef = shallowRef<FormInstance>()
|
||||||
|
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||||
|
const mode = ref('add')
|
||||||
|
|
||||||
|
const showDialog = ref(false)
|
||||||
|
const showDialog1 = ref(false)
|
||||||
|
const project_name = ref('')
|
||||||
|
const project_code = ref('')
|
||||||
|
const person_name = ref('')
|
||||||
|
const idcard = ref('')
|
||||||
|
|
||||||
|
import configs from "@/config"
|
||||||
|
import useUserStore from "@/stores/modules/user";
|
||||||
|
const base_url = configs.baseUrl + configs.urlPrefix
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const formDataannex = reactive([])
|
||||||
|
import feedback from '@/utils/feedback'
|
||||||
|
const userInfo = userStore.userInfo
|
||||||
|
//获取值
|
||||||
|
const customEvent = (e) => {
|
||||||
|
formData.project_id = e.id
|
||||||
|
project_name.value = e.name
|
||||||
|
project_code.value = e.project_code
|
||||||
|
showDialog.value = false
|
||||||
|
|
||||||
|
}
|
||||||
|
const customEvent1 = (e) => {
|
||||||
|
formData.project_person_id = e.id
|
||||||
|
idcard.value = e.idcard
|
||||||
|
person_name.value = e.name
|
||||||
|
showDialog1.value = false
|
||||||
|
|
||||||
|
}
|
||||||
|
// 弹窗标题
|
||||||
|
const popupTitle = computed(() => {
|
||||||
|
return mode.value == 'edit' ? '编辑保险管理' : '新增保险管理'
|
||||||
|
})
|
||||||
|
// 上传文件
|
||||||
|
const handleAvatarSuccess_four = (
|
||||||
|
response,
|
||||||
|
uploadFile
|
||||||
|
) => {
|
||||||
|
if (response.code == 0) {
|
||||||
|
ElMessage.error(response.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formDataannex.push(
|
||||||
|
{ uri: response.data.uri, name: response.data.name }
|
||||||
|
|
||||||
|
|
||||||
|
);
|
||||||
|
};
|
||||||
|
// 删除上传的文件
|
||||||
|
const delFileFn = (index: number) => {
|
||||||
|
formDataannex.splice(index, 1)
|
||||||
|
}
|
||||||
|
// 表单数据
|
||||||
|
const formData = reactive({
|
||||||
|
id: '',
|
||||||
|
project_id: '',
|
||||||
|
project_person_id: '',
|
||||||
|
insurance_date: '',
|
||||||
|
due_date: '',
|
||||||
|
type: '',
|
||||||
|
insurance_no: '',
|
||||||
|
insurance: '',
|
||||||
|
insured_amount: '',
|
||||||
|
insurance_company: '',
|
||||||
|
insurance_detail: '',
|
||||||
|
invoice_no: '',
|
||||||
|
handler: '',
|
||||||
|
annex: '',
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// 表单验证
|
||||||
|
const formRules = reactive<any>({
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 获取详情
|
||||||
|
const setFormData = async (data: Record<any, any>) => {
|
||||||
|
if (data.annex && data.annex.length > 0) {
|
||||||
|
|
||||||
|
const arry1 = data.annex.map((item: any, index: any) => {
|
||||||
|
return {
|
||||||
|
name: `文件${index + 1}`,
|
||||||
|
uri: item
|
||||||
|
};
|
||||||
|
});
|
||||||
|
Object.assign(formDataannex, arry1)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
for (const key in formData) {
|
||||||
|
if (data[key] != null && data[key] != undefined) {
|
||||||
|
//@ts-ignore
|
||||||
|
formData[key] = data[key]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
project_name.value = data.project_name
|
||||||
|
project_code.value = data.project_code
|
||||||
|
idcard.value = data.person_idcard
|
||||||
|
person_name.value = data.person_name
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const getDetail = async (row: Record<string, any>) => {
|
||||||
|
const data = await insurancemanagementDetail({
|
||||||
|
id: row.id
|
||||||
|
})
|
||||||
|
setFormData(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 提交按钮
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
if (formDataannex.length > 0) {
|
||||||
|
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||||
|
}
|
||||||
|
await formRef.value?.validate()
|
||||||
|
const data = { ...formData, }
|
||||||
|
mode.value == 'edit'
|
||||||
|
? await insurancemanagementEdit(data)
|
||||||
|
: await insurancemanagementAdd(data)
|
||||||
|
popupRef.value?.close()
|
||||||
|
emit('success')
|
||||||
|
}
|
||||||
|
|
||||||
|
//打开弹窗
|
||||||
|
const open = (type = 'add') => {
|
||||||
|
mode.value = type
|
||||||
|
popupRef.value?.open()
|
||||||
|
formData.handler = userInfo.name
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭回调
|
||||||
|
const handleClose = () => {
|
||||||
|
emit('close')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open,
|
||||||
|
setFormData,
|
||||||
|
getDetail
|
||||||
|
})
|
||||||
|
</script>
|
177
src/views/project_attendance_record/index.vue
Normal file
177
src/views/project_attendance_record/index.vue
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card class="!border-none mb-4" shadow="never">
|
||||||
|
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||||
|
|
||||||
|
<el-form-item label="保单号" prop="insurance_no">
|
||||||
|
<el-input v-model="queryParams.insurance_no" clearable placeholder="请输入保单号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保险种类" prop="type">
|
||||||
|
<el-input v-model="queryParams.type" clearable placeholder="请输入保险种类" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保险公司" prop="insurance_company">
|
||||||
|
<el-input v-model="queryParams.insurance_company" clearable placeholder="请输入保险公司" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="发票编号" prop="invoice_no">
|
||||||
|
<el-input v-model="queryParams.invoice_no" clearable placeholder="请输入发票编号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="经办人" prop="handler">
|
||||||
|
<el-input v-model="queryParams.handler" clearable placeholder="请输入经办人" />
|
||||||
|
</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="['project.project_insurance_management/add']" type="primary" @click="handleAdd">
|
||||||
|
<template #icon>
|
||||||
|
<icon name="el-icon-Plus" />
|
||||||
|
</template>
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
|
<el-button v-perms="['project.project_insurance_management/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="项目编码" prop="project_code" show-overflow-tooltip />
|
||||||
|
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||||
|
<el-table-column label="姓名" prop="person_name" show-overflow-tooltip />
|
||||||
|
<el-table-column label="身份证号" prop="person_idcard" show-overflow-tooltip />
|
||||||
|
|
||||||
|
<el-table-column label="投保日期" prop="insurance_date" show-overflow-tooltip />
|
||||||
|
|
||||||
|
<el-table-column label="到期日期" prop="due_date" show-overflow-tooltip />
|
||||||
|
|
||||||
|
<el-table-column label="保险种类" prop="type" show-overflow-tooltip />
|
||||||
|
|
||||||
|
<el-table-column label="保单号" prop="insurance_no" show-overflow-tooltip />
|
||||||
|
<el-table-column label="保费(元)" prop="insurance" show-overflow-tooltip />
|
||||||
|
|
||||||
|
<el-table-column label="投保金额(万元)" prop="insured_amount" show-overflow-tooltip />
|
||||||
|
<el-table-column label="保险公司" prop="insurance_company" show-overflow-tooltip />
|
||||||
|
<el-table-column label="保单明细" prop="insurance_detail" show-overflow-tooltip />
|
||||||
|
<el-table-column label="发票编号" prop="invoice_no" show-overflow-tooltip />
|
||||||
|
<el-table-column label="经办人" prop="handler" show-overflow-tooltip />
|
||||||
|
<el-table-column label="附件" prop="annex" show-overflow-tooltip>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div v-if="row.annex && row.annex.length > 0">
|
||||||
|
<div v-for="(item, i) in row.annex " :key='i'>
|
||||||
|
<el-link :href="item" target="_blank">文件{{ i + 1 }}查看</el-link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
暂无文件
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="人员标识" prop="per_daily_living" show-overflow-tooltip /> -->
|
||||||
|
<el-table-column label="操作" width="160" fixed="right">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button v-perms="['project.project_insurance_management/edit']" type="primary" link @click="handleEdit(row)">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button v-perms="['project.project_insurance_management/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
<el-button v-perms="['project.project_insurance_management/detail']" link @click="handledetail(row)">
|
||||||
|
详情
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-end mt-4">
|
||||||
|
<pagination v-model="pager" @change="getLists" />
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||||
|
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup name="projectLists">
|
||||||
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
|
import { useDictData } from '@/hooks/useDictOptions'
|
||||||
|
import { insurancemanagementLists, insurancemanagementDelete, insurancemanagementDetail } from '@/api/project_insurance_management'
|
||||||
|
import { timeFormat } from '@/utils/util'
|
||||||
|
import { getAllProjectTypes } from '@/api/projecttype'
|
||||||
|
const protype = reactive([])
|
||||||
|
import feedback from '@/utils/feedback'
|
||||||
|
import EditPopup from './edit.vue'
|
||||||
|
import DetailPopup from './detail.vue'
|
||||||
|
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
|
||||||
|
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||||
|
// 是否显示编辑框
|
||||||
|
const showEdit = ref(false)
|
||||||
|
const showDtail = ref(false)
|
||||||
|
|
||||||
|
// 查询条件
|
||||||
|
const queryParams = reactive({
|
||||||
|
type: '',
|
||||||
|
insurance_no: '',
|
||||||
|
insurance_company: '',
|
||||||
|
invoice_no: '',
|
||||||
|
handler: '',
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 选中数据
|
||||||
|
const selectData = ref<any[]>([])
|
||||||
|
|
||||||
|
// 表格选择后回调事件
|
||||||
|
const handleSelectionChange = (val: any[]) => {
|
||||||
|
selectData.value = val.map(({ id }) => id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取字典数据
|
||||||
|
const { dictData } = useDictData('labor_contract_status,labor_contract_type,labor_contract_name')
|
||||||
|
// 分页相关
|
||||||
|
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||||
|
fetchFun: insurancemanagementLists,
|
||||||
|
params: queryParams
|
||||||
|
})
|
||||||
|
|
||||||
|
// 添加
|
||||||
|
const handleAdd = async () => {
|
||||||
|
showEdit.value = true
|
||||||
|
await nextTick()
|
||||||
|
editRef.value?.open('add')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 编辑
|
||||||
|
const handleEdit = async (data: any) => {
|
||||||
|
console.log(data.id)
|
||||||
|
let res = await insurancemanagementDetail({ id: data.id })
|
||||||
|
showEdit.value = true
|
||||||
|
await nextTick()
|
||||||
|
editRef.value?.open('edit')
|
||||||
|
editRef.value?.setFormData(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
const handleDelete = async (id: number | any[]) => {
|
||||||
|
await feedback.confirm('确定要删除?')
|
||||||
|
await insurancemanagementDelete({ id })
|
||||||
|
getLists()
|
||||||
|
}
|
||||||
|
const handledetail = async (data: any) => {
|
||||||
|
let res = await insurancemanagementDetail({ id: data.id })
|
||||||
|
showDtail.value = true
|
||||||
|
await nextTick()
|
||||||
|
detailRef.value?.open()
|
||||||
|
detailRef.value?.setFormData(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getLists()
|
||||||
|
</script>
|
||||||
|
|
@ -300,7 +300,7 @@ const formRules = reactive<any>({
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
@ -8,9 +8,10 @@
|
|||||||
<el-form-item label="姓名" prop="name">
|
<el-form-item label="姓名" prop="name">
|
||||||
<el-input class="w-[280px]" v-model="queryParams.name" clearable placeholder="请输入姓名" />
|
<el-input class="w-[280px]" v-model="queryParams.name" clearable placeholder="请输入姓名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-select v-model="queryParams.work_type" clearable placeholder="请选择工种">
|
<el-form-item label="工种" prop="work_type">
|
||||||
<el-option v-for="(item, index) in dictData.work_type" :key="index" :label="item.name" :value="parseInt(item.value)" />
|
<el-select v-model="queryParams.work_type" clearable placeholder="请选择工种">
|
||||||
</el-select>
|
<el-option v-for="(item, index) in dictData.work_type" :key="index" :label="item.name" :value="parseInt(item.value)" />
|
||||||
|
</el-select></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>
|
||||||
@ -89,7 +90,7 @@ const showDtail = ref(false)
|
|||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
mobile: '',
|
mobile: '',
|
||||||
name: '',
|
name: '',
|
||||||
|
work_type: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ const formRules = reactive<any>({
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
186
src/views/project_salary/detail.vue
Normal file
186
src/views/project_salary/detail.vue
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="detail-popup">
|
||||||
|
<popup ref="popupRef" title="保险管理详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||||
|
<el-form ref="formRef" :model="formData" label-width="120px">
|
||||||
|
<el-card class="mb-2">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="项目名称">
|
||||||
|
{{ formData.project_name }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="项目编号">
|
||||||
|
{{ formData.project_code }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="姓名">
|
||||||
|
{{ formData.person_name }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="身份证号">
|
||||||
|
{{ formData.person_idcard }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="投保日期">
|
||||||
|
{{ formData.insurance_date }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="到期日期">
|
||||||
|
{{ formData.due_date }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="保费(元)">
|
||||||
|
{{ formData.insurance }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="投保金额(万元)">
|
||||||
|
{{ formData.insured_amount }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="保险公司">
|
||||||
|
{{ formData.insurance_company }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="保单明细">
|
||||||
|
{{ formData.insurance_detail }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="发票编号">
|
||||||
|
{{ formData.invoice_no
|
||||||
|
}}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="经办人">
|
||||||
|
{{ formData.handler
|
||||||
|
}}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="合同附件">
|
||||||
|
<div v-if="formDataannex.length > 0">
|
||||||
|
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||||
|
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||||
|
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>暂无附件</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
</el-form>
|
||||||
|
</popup>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup name="customdetail">
|
||||||
|
|
||||||
|
import type { FormInstance } from 'element-plus'
|
||||||
|
import Popup from '@/components/popup/index.vue'
|
||||||
|
import { apiCustomDetail } from '@/api/custom'
|
||||||
|
import { timeFormat } from '@/utils/util'
|
||||||
|
import type { PropType } from 'vue'
|
||||||
|
defineProps({
|
||||||
|
dictData: {
|
||||||
|
type: Object as PropType<Record<string, any[]>>,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const emit = defineEmits(['success', 'close'])
|
||||||
|
const formRef = shallowRef<FormInstance>()
|
||||||
|
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||||
|
const formDataannex = reactive([])
|
||||||
|
|
||||||
|
|
||||||
|
const datas = reactive({
|
||||||
|
provinceOptions: [],
|
||||||
|
cityOptions: [],
|
||||||
|
areaOptions: [],
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const formData = reactive({
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 获取详情
|
||||||
|
const setFormData = async (data: Record<any, any>) => {
|
||||||
|
Object.assign(formData, data)
|
||||||
|
if (data.annex && data.annex.length > 0) {
|
||||||
|
|
||||||
|
const arry1 = data.annex.map((item: any, index: any) => {
|
||||||
|
return {
|
||||||
|
name: `文件${index + 1}`,
|
||||||
|
uri: item
|
||||||
|
};
|
||||||
|
});
|
||||||
|
Object.assign(formDataannex, arry1)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const getDetail = async (row: Record<string, any>) => {
|
||||||
|
const data = await apiCustomDetail({
|
||||||
|
id: row.id
|
||||||
|
})
|
||||||
|
setFormData(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 提交按钮
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
popupRef.value?.close()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//打开弹窗
|
||||||
|
const open = () => {
|
||||||
|
console.log('1111111')
|
||||||
|
popupRef.value?.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭回调
|
||||||
|
const handleClose = () => {
|
||||||
|
emit('close')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open,
|
||||||
|
setFormData,
|
||||||
|
getDetail
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.tit {
|
||||||
|
font-size: 1.2em;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
266
src/views/project_salary/edit.vue
Normal file
266
src/views/project_salary/edit.vue
Normal file
@ -0,0 +1,266 @@
|
|||||||
|
<template>
|
||||||
|
<div class="edit-popup">
|
||||||
|
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||||
|
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules" inline>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="项目编码" prop="project_id">
|
||||||
|
<el-input v-model="project_code" clearable placeholder="请输入项目编码" @click="showDialog = true" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="项目名称" prop="project_id">
|
||||||
|
<el-input v-model="project_name" clearable placeholder="请输入项目名称" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="姓名" prop="project_person_id" @click="showDialog1 = true" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
|
<el-input v-model="person_name" clearable placeholder="请选择项目人员" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="身份证号" prop="project_person_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
|
<el-input v-model="idcard" clearable placeholder="系统自动填写" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="投保日期" prop="insurance_date">
|
||||||
|
<el-date-picker class="flex-1 !flex" v-model="formData.insurance_date" clearable type="date" value-format="YYYY-MM-DD" placeholder="选择投保日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="到期日期" prop="due_date" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
|
<el-date-picker class="flex-1 !flex" v-model="formData.due_date" clearable type="date" value-format="YYYY-MM-DD" placeholder="选择到期日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="保险种类" prop="type">
|
||||||
|
<el-input v-model="formData.type" clearable placeholder="请输入保险种类" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="保单号" prop="insurance_no">
|
||||||
|
<el-input v-model="formData.insurance_no" clearable placeholder="请输入保单号" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="保费(元)" prop="insurance">
|
||||||
|
<el-input v-model="formData.insurance" clearable type="number" placeholder="请输入保费(元)" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="投保金额(万元)" prop="insured_amount">
|
||||||
|
<el-input v-model="formData.insured_amount" clearable type="number" placeholder="请输入投保金额(万元)" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="保险公司" prop="insurance_company">
|
||||||
|
<el-input v-model="formData.insurance_company" clearable placeholder="请输入保险公司" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
|
||||||
|
<el-form-item label="保单明细" prop="insurance_detail">
|
||||||
|
<el-input v-model="formData.insurance_detail" clearable placeholder="请输入保单明细" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="发票编号" prop="invoice_no">
|
||||||
|
<el-input v-model="formData.invoice_no" clearable placeholder="请输入发票编号" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="经办人" prop="handler">
|
||||||
|
<el-input v-model="formData.handler" clearable placeholder="请输入经办人" />
|
||||||
|
</el-form-item> </el-col>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="合同附件" prop="field127">
|
||||||
|
<el-upload accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv" class="upload-demo" :show-file-list="false" aria-hidden="true" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :on-success="handleAvatarSuccess_four" ref="upload">
|
||||||
|
<el-button type="primary">
|
||||||
|
上传
|
||||||
|
</el-button>
|
||||||
|
</el-upload>
|
||||||
|
<div>
|
||||||
|
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
|
||||||
|
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
|
||||||
|
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</popup>
|
||||||
|
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||||
|
<projectDialog @customEvent="customEvent"></projectDialog>
|
||||||
|
</el-dialog>
|
||||||
|
<el-dialog v-model="showDialog1" title="选择项目人员" width="70%">
|
||||||
|
<customDialog @customEvent="customEvent1" :project_id="formData.project_id"></customDialog>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup name="procurementContractEdit">
|
||||||
|
import type { FormInstance } from 'element-plus'
|
||||||
|
import Popup from '@/components/popup/index.vue'
|
||||||
|
import projectDialog from '@/components/project/index.vue'
|
||||||
|
import { insurancemanagementAdd, insurancemanagementEdit, insurancemanagementDetail } from '@/api/project_insurance_management'
|
||||||
|
import customDialog from '@/components/project_personnel/index.vue'
|
||||||
|
import { timeFormat } from '@/utils/util'
|
||||||
|
import type { PropType } from 'vue'
|
||||||
|
defineProps({
|
||||||
|
dictData: {
|
||||||
|
type: Object as PropType<Record<string, any[]>>,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const emit = defineEmits(['success', 'close'])
|
||||||
|
const formRef = shallowRef<FormInstance>()
|
||||||
|
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||||
|
const mode = ref('add')
|
||||||
|
|
||||||
|
const showDialog = ref(false)
|
||||||
|
const showDialog1 = ref(false)
|
||||||
|
const project_name = ref('')
|
||||||
|
const project_code = ref('')
|
||||||
|
const person_name = ref('')
|
||||||
|
const idcard = ref('')
|
||||||
|
|
||||||
|
import configs from "@/config"
|
||||||
|
import useUserStore from "@/stores/modules/user";
|
||||||
|
const base_url = configs.baseUrl + configs.urlPrefix
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const formDataannex = reactive([])
|
||||||
|
import feedback from '@/utils/feedback'
|
||||||
|
const userInfo = userStore.userInfo
|
||||||
|
//获取值
|
||||||
|
const customEvent = (e) => {
|
||||||
|
formData.project_id = e.id
|
||||||
|
project_name.value = e.name
|
||||||
|
project_code.value = e.project_code
|
||||||
|
showDialog.value = false
|
||||||
|
|
||||||
|
}
|
||||||
|
const customEvent1 = (e) => {
|
||||||
|
formData.project_person_id = e.id
|
||||||
|
idcard.value = e.idcard
|
||||||
|
person_name.value = e.name
|
||||||
|
showDialog1.value = false
|
||||||
|
|
||||||
|
}
|
||||||
|
// 弹窗标题
|
||||||
|
const popupTitle = computed(() => {
|
||||||
|
return mode.value == 'edit' ? '编辑保险管理' : '新增保险管理'
|
||||||
|
})
|
||||||
|
// 上传文件
|
||||||
|
const handleAvatarSuccess_four = (
|
||||||
|
response,
|
||||||
|
uploadFile
|
||||||
|
) => {
|
||||||
|
if (response.code == 0) {
|
||||||
|
ElMessage.error(response.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formDataannex.push(
|
||||||
|
{ uri: response.data.uri, name: response.data.name }
|
||||||
|
|
||||||
|
|
||||||
|
);
|
||||||
|
};
|
||||||
|
// 删除上传的文件
|
||||||
|
const delFileFn = (index: number) => {
|
||||||
|
formDataannex.splice(index, 1)
|
||||||
|
}
|
||||||
|
// 表单数据
|
||||||
|
const formData = reactive({
|
||||||
|
id: '',
|
||||||
|
project_id: '',
|
||||||
|
project_person_id: '',
|
||||||
|
insurance_date: '',
|
||||||
|
due_date: '',
|
||||||
|
type: '',
|
||||||
|
insurance_no: '',
|
||||||
|
insurance: '',
|
||||||
|
insured_amount: '',
|
||||||
|
insurance_company: '',
|
||||||
|
insurance_detail: '',
|
||||||
|
invoice_no: '',
|
||||||
|
handler: '',
|
||||||
|
annex: '',
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// 表单验证
|
||||||
|
const formRules = reactive<any>({
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 获取详情
|
||||||
|
const setFormData = async (data: Record<any, any>) => {
|
||||||
|
if (data.annex && data.annex.length > 0) {
|
||||||
|
|
||||||
|
const arry1 = data.annex.map((item: any, index: any) => {
|
||||||
|
return {
|
||||||
|
name: `文件${index + 1}`,
|
||||||
|
uri: item
|
||||||
|
};
|
||||||
|
});
|
||||||
|
Object.assign(formDataannex, arry1)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
for (const key in formData) {
|
||||||
|
if (data[key] != null && data[key] != undefined) {
|
||||||
|
//@ts-ignore
|
||||||
|
formData[key] = data[key]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
project_name.value = data.project_name
|
||||||
|
project_code.value = data.project_code
|
||||||
|
idcard.value = data.person_idcard
|
||||||
|
person_name.value = data.person_name
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const getDetail = async (row: Record<string, any>) => {
|
||||||
|
const data = await insurancemanagementDetail({
|
||||||
|
id: row.id
|
||||||
|
})
|
||||||
|
setFormData(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 提交按钮
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
if (formDataannex.length > 0) {
|
||||||
|
formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri))
|
||||||
|
}
|
||||||
|
await formRef.value?.validate()
|
||||||
|
const data = { ...formData, }
|
||||||
|
mode.value == 'edit'
|
||||||
|
? await insurancemanagementEdit(data)
|
||||||
|
: await insurancemanagementAdd(data)
|
||||||
|
popupRef.value?.close()
|
||||||
|
emit('success')
|
||||||
|
}
|
||||||
|
|
||||||
|
//打开弹窗
|
||||||
|
const open = (type = 'add') => {
|
||||||
|
mode.value = type
|
||||||
|
popupRef.value?.open()
|
||||||
|
formData.handler = userInfo.name
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭回调
|
||||||
|
const handleClose = () => {
|
||||||
|
emit('close')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open,
|
||||||
|
setFormData,
|
||||||
|
getDetail
|
||||||
|
})
|
||||||
|
</script>
|
177
src/views/project_salary/index.vue
Normal file
177
src/views/project_salary/index.vue
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card class="!border-none mb-4" shadow="never">
|
||||||
|
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||||
|
|
||||||
|
<el-form-item label="保单号" prop="insurance_no">
|
||||||
|
<el-input v-model="queryParams.insurance_no" clearable placeholder="请输入保单号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保险种类" prop="type">
|
||||||
|
<el-input v-model="queryParams.type" clearable placeholder="请输入保险种类" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保险公司" prop="insurance_company">
|
||||||
|
<el-input v-model="queryParams.insurance_company" clearable placeholder="请输入保险公司" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="发票编号" prop="invoice_no">
|
||||||
|
<el-input v-model="queryParams.invoice_no" clearable placeholder="请输入发票编号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="经办人" prop="handler">
|
||||||
|
<el-input v-model="queryParams.handler" clearable placeholder="请输入经办人" />
|
||||||
|
</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="['project.project_insurance_management/add']" type="primary" @click="handleAdd">
|
||||||
|
<template #icon>
|
||||||
|
<icon name="el-icon-Plus" />
|
||||||
|
</template>
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
|
<el-button v-perms="['project.project_insurance_management/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="项目编码" prop="project_code" show-overflow-tooltip />
|
||||||
|
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||||
|
<el-table-column label="姓名" prop="person_name" show-overflow-tooltip />
|
||||||
|
<el-table-column label="身份证号" prop="person_idcard" show-overflow-tooltip />
|
||||||
|
|
||||||
|
<el-table-column label="投保日期" prop="insurance_date" show-overflow-tooltip />
|
||||||
|
|
||||||
|
<el-table-column label="到期日期" prop="due_date" show-overflow-tooltip />
|
||||||
|
|
||||||
|
<el-table-column label="保险种类" prop="type" show-overflow-tooltip />
|
||||||
|
|
||||||
|
<el-table-column label="保单号" prop="insurance_no" show-overflow-tooltip />
|
||||||
|
<el-table-column label="保费(元)" prop="insurance" show-overflow-tooltip />
|
||||||
|
|
||||||
|
<el-table-column label="投保金额(万元)" prop="insured_amount" show-overflow-tooltip />
|
||||||
|
<el-table-column label="保险公司" prop="insurance_company" show-overflow-tooltip />
|
||||||
|
<el-table-column label="保单明细" prop="insurance_detail" show-overflow-tooltip />
|
||||||
|
<el-table-column label="发票编号" prop="invoice_no" show-overflow-tooltip />
|
||||||
|
<el-table-column label="经办人" prop="handler" show-overflow-tooltip />
|
||||||
|
<el-table-column label="附件" prop="annex" show-overflow-tooltip>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div v-if="row.annex && row.annex.length > 0">
|
||||||
|
<div v-for="(item, i) in row.annex " :key='i'>
|
||||||
|
<el-link :href="item" target="_blank">文件{{ i + 1 }}查看</el-link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
暂无文件
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="人员标识" prop="per_daily_living" show-overflow-tooltip /> -->
|
||||||
|
<el-table-column label="操作" width="160" fixed="right">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button v-perms="['project.project_insurance_management/edit']" type="primary" link @click="handleEdit(row)">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button v-perms="['project.project_insurance_management/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
<el-button v-perms="['project.project_insurance_management/detail']" link @click="handledetail(row)">
|
||||||
|
详情
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-end mt-4">
|
||||||
|
<pagination v-model="pager" @change="getLists" />
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||||
|
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup name="projectLists">
|
||||||
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
|
import { useDictData } from '@/hooks/useDictOptions'
|
||||||
|
import { insurancemanagementLists, insurancemanagementDelete, insurancemanagementDetail } from '@/api/project_insurance_management'
|
||||||
|
import { timeFormat } from '@/utils/util'
|
||||||
|
import { getAllProjectTypes } from '@/api/projecttype'
|
||||||
|
const protype = reactive([])
|
||||||
|
import feedback from '@/utils/feedback'
|
||||||
|
import EditPopup from './edit.vue'
|
||||||
|
import DetailPopup from './detail.vue'
|
||||||
|
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
|
||||||
|
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||||
|
// 是否显示编辑框
|
||||||
|
const showEdit = ref(false)
|
||||||
|
const showDtail = ref(false)
|
||||||
|
|
||||||
|
// 查询条件
|
||||||
|
const queryParams = reactive({
|
||||||
|
type: '',
|
||||||
|
insurance_no: '',
|
||||||
|
insurance_company: '',
|
||||||
|
invoice_no: '',
|
||||||
|
handler: '',
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 选中数据
|
||||||
|
const selectData = ref<any[]>([])
|
||||||
|
|
||||||
|
// 表格选择后回调事件
|
||||||
|
const handleSelectionChange = (val: any[]) => {
|
||||||
|
selectData.value = val.map(({ id }) => id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取字典数据
|
||||||
|
const { dictData } = useDictData('labor_contract_status,labor_contract_type,labor_contract_name')
|
||||||
|
// 分页相关
|
||||||
|
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||||
|
fetchFun: insurancemanagementLists,
|
||||||
|
params: queryParams
|
||||||
|
})
|
||||||
|
|
||||||
|
// 添加
|
||||||
|
const handleAdd = async () => {
|
||||||
|
showEdit.value = true
|
||||||
|
await nextTick()
|
||||||
|
editRef.value?.open('add')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 编辑
|
||||||
|
const handleEdit = async (data: any) => {
|
||||||
|
console.log(data.id)
|
||||||
|
let res = await insurancemanagementDetail({ id: data.id })
|
||||||
|
showEdit.value = true
|
||||||
|
await nextTick()
|
||||||
|
editRef.value?.open('edit')
|
||||||
|
editRef.value?.setFormData(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
const handleDelete = async (id: number | any[]) => {
|
||||||
|
await feedback.confirm('确定要删除?')
|
||||||
|
await insurancemanagementDelete({ id })
|
||||||
|
getLists()
|
||||||
|
}
|
||||||
|
const handledetail = async (data: any) => {
|
||||||
|
let res = await insurancemanagementDetail({ id: data.id })
|
||||||
|
showDtail.value = true
|
||||||
|
await nextTick()
|
||||||
|
detailRef.value?.open()
|
||||||
|
detailRef.value?.setFormData(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getLists()
|
||||||
|
</script>
|
||||||
|
|
@ -303,7 +303,7 @@ const popupTitle = computed(() => {
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
@ -2,7 +2,15 @@
|
|||||||
<div class="edit-popup">
|
<div class="edit-popup">
|
||||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules" inline>
|
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules" inline>
|
||||||
|
<div style="display: flex; flex-direction: row-reverse; justify-content: flex-start;margin-bottom: 30px;">
|
||||||
|
|
||||||
|
<el-select class="w-[180px]" v-model="formData.dept_id" clearable placeholder="请选择部门">
|
||||||
|
<el-option v-for="(item, index) in list2" :key="index" :label="item.name" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
<el-select class="w-[180px]" v-model="formData.org_id" clearable placeholder="请选择组织" @change="deptrmt">
|
||||||
|
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="客户" prop="customer_id" :rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
<el-form-item label="客户" prop="customer_id" :rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
||||||
@ -167,6 +175,10 @@ import { apiQuotationAdd, apiQuotationEdit, apiQuotationDetail } from '@/api/quo
|
|||||||
import { timeFormat } from '@/utils/util'
|
import { timeFormat } from '@/utils/util'
|
||||||
import customDialog1 from '@/components/product/index.vue'
|
import customDialog1 from '@/components/product/index.vue'
|
||||||
import reviewprocess from '@/components/reviewprocess/index.vue'
|
import reviewprocess from '@/components/reviewprocess/index.vue'
|
||||||
|
const list1 = reactive([])
|
||||||
|
const list2 = reactive([])
|
||||||
|
import { deptAll } from '@/api/org/department'
|
||||||
|
import { getAll } from '@/api/org/organization'
|
||||||
import type { PropType } from 'vue'
|
import type { PropType } from 'vue'
|
||||||
defineProps({
|
defineProps({
|
||||||
dictData: {
|
dictData: {
|
||||||
@ -210,10 +222,37 @@ const delFileFn = (index: number) => {
|
|||||||
const popupTitle = computed(() => {
|
const popupTitle = computed(() => {
|
||||||
return mode.value == 'edit' ? '编辑报价单' : '新增报价单'
|
return mode.value == 'edit' ? '编辑报价单' : '新增报价单'
|
||||||
})
|
})
|
||||||
|
//获取所有组织
|
||||||
|
const getlist = () => {
|
||||||
|
getAll().then((res) => {
|
||||||
|
Object.assign(list1, res)
|
||||||
|
if (res.length > 0 && !formData.org_id) {
|
||||||
|
formData.org_id = res[0].id
|
||||||
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
|
if (res.length > 0) {
|
||||||
|
Object.assign(list2, res)
|
||||||
|
formData.dept_id = res[0].id
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//获取部门
|
||||||
|
const deptrmt = (e) => {
|
||||||
|
getlist1(e)
|
||||||
|
}
|
||||||
|
//获取所有部门
|
||||||
|
const getlist1 = (id: any) => {
|
||||||
|
deptAll({ 'org_id': id }).then((res) => {
|
||||||
|
Object.assign(list2, res)
|
||||||
|
})
|
||||||
|
}
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
id: '',
|
id: '',
|
||||||
|
dept_id: '',
|
||||||
|
org_id: '',
|
||||||
customer_id: '',
|
customer_id: '',
|
||||||
quotation_date: '',
|
quotation_date: '',
|
||||||
contacts: '',
|
contacts: '',
|
||||||
@ -269,6 +308,9 @@ const setFormData = async (data: Record<any, any>) => {
|
|||||||
});
|
});
|
||||||
Object.assign(formDataannex, arry1)
|
Object.assign(formDataannex, arry1)
|
||||||
}
|
}
|
||||||
|
if (formData.dept_id) {
|
||||||
|
getlist1(formData.dept_id)
|
||||||
|
}
|
||||||
customer_name.value = data.custom.name
|
customer_name.value = data.custom.name
|
||||||
for (const key in formData) {
|
for (const key in formData) {
|
||||||
if (data[key] != null && data[key] != undefined) {
|
if (data[key] != null && data[key] != undefined) {
|
||||||
@ -329,6 +371,7 @@ const handleSubmit = async () => {
|
|||||||
const open = (type = 'add') => {
|
const open = (type = 'add') => {
|
||||||
mode.value = type
|
mode.value = type
|
||||||
popupRef.value?.open()
|
popupRef.value?.open()
|
||||||
|
getlist()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 关闭回调
|
// 关闭回调
|
||||||
|
@ -206,7 +206,7 @@ const popupTitle = computed(() => {
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
@ -350,7 +350,7 @@ const formRules = reactive<any>({
|
|||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
getAll().then((res) => {
|
getAll().then((res) => {
|
||||||
Object.assign(list1, res)
|
Object.assign(list1, res)
|
||||||
if (res.length > 0) {
|
if (res.length > 0 && !formData.org_id) {
|
||||||
formData.org_id = res[0].id
|
formData.org_id = res[0].id
|
||||||
deptAll({ 'org_id': res[0].id }).then((res) => {
|
deptAll({ 'org_id': res[0].id }).then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user