add
This commit is contained in:
parent
98df33755d
commit
b9edbebab9
@ -1,5 +1,5 @@
|
||||
NODE_ENV = 'development'
|
||||
|
||||
# VITE_APP_BASE_URL = 'https://ceshi-engineering.lihaink.cn/'
|
||||
VITE_APP_BASE_URL = 'http://www.eng.local/'
|
||||
VITE_APP_BASE_URL = 'https://ceshi-engineering.lihaink.cn/'
|
||||
# VITE_APP_BASE_URL = 'http://www.eng.local/'
|
||||
# VITE_APP_BASE_URL = 'http://192.168.1.5:9090/'
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
|
||||
.env.development
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
@ -14,6 +16,7 @@ dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
|
||||
# unplugin-auto-import
|
||||
auto-imports.d.ts
|
||||
components.d.ts
|
||||
@ -30,4 +33,3 @@ components.d.ts
|
||||
*.sln
|
||||
*.sw?
|
||||
.zip
|
||||
.env.development
|
||||
|
18
.vscode/settings.json
vendored
18
.vscode/settings.json
vendored
@ -1,12 +1,10 @@
|
||||
{
|
||||
"editor.formatOnSave": true,
|
||||
"[vue]": {
|
||||
"editor.defaultFormatter": "Vue.volar"
|
||||
},
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||
},
|
||||
|
||||
|
||||
"editor.formatOnSave": true,
|
||||
"[vue]": {
|
||||
"editor.defaultFormatter": "Vue.volar"
|
||||
},
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 客户售后列表
|
||||
export function apiCustomServiceLists(params: any) {
|
||||
return request.get({ url: '/custom.custom_service/lists', params })
|
||||
return request.get({ url: "/custom.custom_service/lists", params });
|
||||
}
|
||||
|
||||
// 添加客户售后
|
||||
export function apiCustomServiceAdd(params: any) {
|
||||
return request.post({ url: '/custom.custom_service/add', params })
|
||||
return request.post({ url: "/custom.custom_service/add", params });
|
||||
}
|
||||
|
||||
// 处理客户售后
|
||||
export function apiCustomServiceSolve(params: any) {
|
||||
return request.post({ url: '/custom.custom_service/solve', params })
|
||||
return request.post({ url: "/custom.custom_service/solve", params });
|
||||
}
|
||||
|
||||
|
||||
// 客户售后详情
|
||||
export function apiCustomServiceDetail(params: any) {
|
||||
return request.get({ url: '/custom.custom_service/detail', params })
|
||||
}
|
||||
return request.get({ url: "/custom.custom_service/detail", params });
|
||||
}
|
||||
|
||||
// 客户售后删除
|
||||
export function apiCustomServiceDelete(params: any) {
|
||||
return request.post({ url: "/custom.custom_service/delete", params });
|
||||
}
|
||||
|
@ -42,12 +42,8 @@
|
||||
formData.description }}</el-descriptions-item>
|
||||
<el-descriptions-item label="处理过程" label-align="left" align="left" label-class-name="my-label"> {{
|
||||
formData.processing_process }}</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="回访确认" label-align="left" align="left" label-class-name="my-label"> {{ formData.notes }}</el-descriptions-item> -->
|
||||
|
||||
<el-descriptions-item label="备注" label-align="left" align="left" label-class-name="my-label"> {{
|
||||
formData.notes }}</el-descriptions-item>
|
||||
|
||||
|
||||
<el-descriptions-item label="附件" label-align="left" align="left" label-class-name="my-label">
|
||||
<div v-if="formData.annex && formData.annex.length > 0">
|
||||
<div v-for="(item, index) in formData.annex" style="margin-left: 5px;display: block;">
|
||||
@ -84,15 +80,8 @@ defineProps({
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
@ -2,16 +2,16 @@
|
||||
<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="auto" :rules="formRules">
|
||||
<el-form ref="formRef" :model="formData" label-width="auto" >
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称" prop="project_id" @click="showDialog = true">
|
||||
<el-input v-model="project_name" readonly clearable placeholder="请选择项目" />
|
||||
<el-input v-model="formData.project_name" readonly clearable placeholder="请选择项目" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码" prop="project_id">
|
||||
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
|
||||
<el-input v-model="formData.project_code" clearable disabled placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@ -33,8 +33,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
||||
<el-form-item label="联系电话" prop="custom_master_phone"
|
||||
:rules="[{ validator: checkPhone, trigger: 'blur' }]">
|
||||
<el-form-item label="联系电话" prop="custom_master_phone">
|
||||
<el-input v-model="formData.custom_master_phone" disabled clearable placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -75,7 +74,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="指定处理人" prop="processed_user" @click="userclick"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="processed_admin_name" clearable readonly placeholder="请输入指定处理人" />
|
||||
<el-input v-model="formData.processed_user_name" clearable readonly placeholder="请输入指定处理人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -98,12 +97,10 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="附件">
|
||||
<uploadAnnex :formData="formData"></uploadAnnex>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- <reviewprocess :list="list" /> -->
|
||||
</popup>
|
||||
|
||||
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||
@ -120,8 +117,8 @@
|
||||
</salescontractDialog>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<personnelselector ref="personnel" @confirm="submituser" type="1"></personnelselector>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -132,43 +129,21 @@ import customDialog from '@/components/custom-dialog/index.vue'
|
||||
import salescontractDialog from '@/components/salescontract/index.vue'
|
||||
import { apiCustomServiceAdd, apiCustomServiceDetail } from '@/api/custom_service'
|
||||
import personnelselector from '@/components/personnelselector/index.vue'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
const list1 = reactive([])
|
||||
const list2 = reactive([])
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { getAll } from '@/api/org/organization'
|
||||
import peojectDialog from '@/components/project/index.vue'
|
||||
|
||||
// 上传文件
|
||||
const handleAvatarSuccess_four = (response: any) => {
|
||||
formData.annex ||= []
|
||||
// @ts-ignore
|
||||
response.code != 0 ? formData.annex.push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg);
|
||||
};
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => { formData.annex.splice(index, 1) }
|
||||
|
||||
|
||||
const list = reactive([])
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
const showDialog2 = ref(false)
|
||||
const custom_name = ref('')
|
||||
const project_name = ref('')
|
||||
const project_code = ref('')
|
||||
const contract_id = ref('')
|
||||
const processed_admin_name = ref('')
|
||||
const personnel = ref<any>()
|
||||
const formDataannex = reactive([])
|
||||
|
||||
const customEvent = (e: any) => {
|
||||
formData.project_id = e.id
|
||||
formData.project_name = e.name
|
||||
formData.project_code = e.project_code
|
||||
formData.custom_name = e.custom_name
|
||||
formData.custom_master_phone = e.custom_master_phone
|
||||
formData.custom_master_name = e.custom_master_name
|
||||
project_name.value = e.name
|
||||
project_code.value = e.project_code
|
||||
showDialog.value = false;
|
||||
};
|
||||
|
||||
@ -204,54 +179,22 @@ const userclick = () => {
|
||||
//确认
|
||||
const submituser = (e: any) => {
|
||||
formData.processed_user = e.id;
|
||||
processed_admin_name.value = e.name;
|
||||
formData.processed_user_name=e.name
|
||||
}
|
||||
//验证
|
||||
const checkPhone = (rule: any, value: any, callback: (arg0: Error) => any) => {
|
||||
|
||||
if (value && !/^1\d{10}$/.test(value)) {
|
||||
callback(new Error('请输入正确的手机号码'));
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
|
||||
}
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
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: any) => {
|
||||
formData.dept_id = ''
|
||||
getlist1(e)
|
||||
|
||||
}
|
||||
//获取所有部门
|
||||
const getlist1 = (id: any) => {
|
||||
deptAll({ 'org_id': id }).then((res) => {
|
||||
list2.splice(0, list2.length, ...res)
|
||||
})
|
||||
}
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
project_id: '',
|
||||
project_name:"",
|
||||
project_code:"",
|
||||
contacts: '',
|
||||
custom_master_name: "",
|
||||
custom_master_phone: "",
|
||||
@ -261,6 +204,7 @@ const formData = reactive({
|
||||
urgency: '',
|
||||
receiver: '',
|
||||
processed_user: '',
|
||||
processed_user_name: '',
|
||||
name: '',
|
||||
description: '',
|
||||
notes: '',
|
||||
@ -273,37 +217,14 @@ const formData = reactive({
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
custom_name.value = data.custom.name
|
||||
project_name.value = data.project.name
|
||||
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)
|
||||
}
|
||||
if (data.dept_id) {
|
||||
getlist1(data.org_id)
|
||||
}
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
formData.date = timeFormat(formData.date, 'YYYY-MM-DD ')
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
@ -316,9 +237,6 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
if (formDataannex.length > 0) {
|
||||
formData.annex = formDataannex.map((item) => item.uri)
|
||||
}
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
data.date = data.date.substring(0, 10)
|
||||
@ -331,7 +249,6 @@ const handleSubmit = async () => {
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
getlist()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
|
@ -1,298 +1,212 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" title="售后工单处理" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
|
||||
|
||||
<el-descriptions :column="3" title="基本信息" border>
|
||||
<el-descriptions-item label="项目名称" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.project_name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="项目编码" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.project_code }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="客户名称" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.custom_name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="合同号" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.contract_code }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系人" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.custom_master_phone }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.custom_master_phone }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="日期" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.date }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="分类" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.classification_text }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="紧急程度" label-align="left" align="left" label-class-name="my-label">
|
||||
<el-radio-group v-model="formData.urgency" readonly placeholder="请选择紧急程度">
|
||||
<el-radio v-for="(item, index) in dictData.urgency" :key="index" :label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="接待人" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.receiver }}
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="指定处理人" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.processed_user_name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="问题描述" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.description }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="处理过程" label-align="left" v-if="formData.processing_process" align="left"
|
||||
label-class-name="my-label">
|
||||
{{ formData.processing_process }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="完成日期" v-if="formData.done_date" label-align="left" align="left"
|
||||
label-class-name="my-label">
|
||||
{{ formData.done_date }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="花费工时" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.processing_hours }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" label-align="left" align="left" label-class-name="my-label">
|
||||
{{ formData.notes }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件" label-align="left" align="left" label-class-name="my-label">
|
||||
<div v-if="formData.annex && formData.annex.length > 0">
|
||||
<div v-for="(item, index) in formData.annex" style="margin-left: 5px; display: block">
|
||||
<el-link style="
|
||||
margin-left: 10px;
|
||||
color: #4a5dff;
|
||||
align-self: flex-start;
|
||||
" :href="item" target="_blank">文件{{ index + 1 }}查看</el-link>
|
||||
</div>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="组织" prop="project_id">
|
||||
<el-input v-model="formData.project_name" disabled clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="部门" prop="project_id">
|
||||
<el-input v-model="formData.org_name" disabled clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="project_id">
|
||||
<el-input v-model="formData.project_name" disabled clearable placeholder="请选择项目" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目编码" prop="project_id">
|
||||
<el-input v-model="formData.project_code" clearable disabled placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称" prop="project_id"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.custom_name" disabled clearable placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同号" prop="project_id" @click="showDialog2 = true">
|
||||
<el-input v-model="project_code" clearable disabled placeholder="系统自动填写" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系人" prop="contacts">
|
||||
<el-input v-model="formData.contacts" disabled clearable placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系电话" prop="phone" :rules="[{ validator: checkPhone, trigger: 'blur' }]">
|
||||
<el-input v-model="formData.phone" disabled clearable placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="日期" prop="date"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-date-picker class="flex-1 !flex" disabled v-model="formData.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="classification"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-select class="flex-1" v-model="formData.classification" disabled clearable
|
||||
placeholder="请选择分类">
|
||||
<el-option v-for="(item, index) in dictData.classification" :key="index"
|
||||
:label="item.name" :value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="紧急程度" prop="urgency"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-radio-group v-model="formData.urgency" disabled placeholder="请选择紧急程度">
|
||||
<el-radio v-for="(item, index) in dictData.urgency" :key="index"
|
||||
:label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="接待人" prop="receiver"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.receiver" disabled clearable placeholder="请输入接待人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="指定处理人" prop="processed_admin_id" @click="userclick"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.processed_user_name" disabled clearable readonly
|
||||
placeholder="请输入指定处理人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="投诉主题" prop="name"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.name" clearable disabled placeholder="请输入投诉主题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="问题描述" prop="description">
|
||||
<el-input v-model="formData.description" disabled clearable placeholder="请输入问题描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="formData.processing_process">
|
||||
<el-form-item label="处理过程" prop="processing_process">
|
||||
<el-input v-model="formData.processing_process" disabled clearable placeholder="请输入处理过程" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="formData.done_date">
|
||||
<el-form-item label="完成日期" prop="done_date">
|
||||
<el-input v-model="formData.done_date" disabled clearable placeholder="请输入完成日期" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="formData.processing_result_text">
|
||||
<el-form-item label="处理结果" prop="processing_result_text">
|
||||
<el-input v-model="formData.processing_result_text" disabled clearable
|
||||
placeholder="请输入处理结果" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="formData.processing_hours">
|
||||
<el-form-item label="花费工时" prop="processing_hours">
|
||||
<el-input v-model="formData.processing_hours" disabled clearable placeholder="请输入处理结果" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="notes">
|
||||
<el-input v-model="formData.notes" disabled type="textarea" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="附件">
|
||||
<div v-if="formData.annex && formData.annex.length > 0">
|
||||
<div v-for="(item, index) in formData.annex" style="margin-left: 5px;display: block;">
|
||||
<el-link style="margin-left: 10px; color: #4a5dff; align-self: flex-start"
|
||||
:href="item" target="_blank">文件{{ index + 1 }}查看</el-link>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
|
||||
|
||||
<el-form ref="formRef1" :model="formData1" label-width="auto" :rules="formRules">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="8" v-if="!formData.processing_result_text">
|
||||
<el-form-item label="处理结果" prop="processing_result">
|
||||
<el-radio-group v-model="formData1.processing_result" placeholder="请选择处理结果">
|
||||
<el-radio v-for="(item, index) in dictData.custom_service_solv_result" :key="index"
|
||||
:label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="!formData.processing_process">
|
||||
<el-form-item label="处理过程" prop="processing_process">
|
||||
<el-input v-model="formData1.processing_process" clearable placeholder="请输入处理过程" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="!formData.processing_hours">
|
||||
<el-form-item label="花费工时" prop="processing_hours">
|
||||
<el-input v-model="formData1.processing_hours" type="number" clearable
|
||||
placeholder="请输入花费工时" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="!formData.done_date">
|
||||
<el-form-item label="完成日期" prop="done_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData1.done_date" clearable type="date"
|
||||
value-format="YYYY-MM-DD" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div style="margin-bottom: 30px;">客户评价</div>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="整体评价" prop="score">
|
||||
<el-rate v-model="formData1.score" size="large" style="margin-top: 5px ;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" style="margin-top: -15px ;">
|
||||
<el-form-item label="问题是否解决" prop="is_solve">
|
||||
|
||||
<el-radio-group v-model="formData1.is_solve" placeholder="问题是否解决">
|
||||
<el-radio v-for="(item, index) in dictData.is_solve" :key="index"
|
||||
:label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="反馈意见" prop="feedback">
|
||||
<el-input v-model="formData1.feedback" type="textarea" clearable placeholder="请输入反馈意见" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- <reviewprocess :list="list" /> -->
|
||||
<el-card class="mt-1">
|
||||
<el-form ref="formRef1" :model="formData1" label-width="auto" :rules="formRules">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="8" v-if="!formData.processing_result_text">
|
||||
<el-form-item label="处理结果" prop="processing_result">
|
||||
<el-radio-group v-model="formData1.processing_result" placeholder="请选择处理结果">
|
||||
<el-radio v-for="(item, index) in dictData.custom_service_solv_result" :key="index"
|
||||
:label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="处理结果" prop="processing_result_text">
|
||||
<el-select v-model="formData1.processing_result" clearable placeholder="请选择处理结果"
|
||||
class="flex-1">
|
||||
<el-option v-for="(item, index) in dictData.custom_service_solve_result"
|
||||
:key="index" :label="item.name" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="处理过程" prop="processing_process">
|
||||
<el-input v-model="formData1.processing_process" clearable placeholder="请输入处理过程" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="花费工时" prop="processing_hours">
|
||||
<el-input v-model="formData1.processing_hours" type="number" clearable
|
||||
placeholder="请输入花费工时" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="完成日期" prop="done_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData1.done_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="score">
|
||||
<el-rate v-model="formData1.score" size="large" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否解决" prop="is_solve">
|
||||
<el-radio-group v-model="formData1.is_solve" placeholder="问题是否解决">
|
||||
<el-radio v-for="(item, index) in dictData.is_solve" :key="index"
|
||||
:label="parseInt(item.value)">
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="反馈意见" prop="feedback">
|
||||
<el-input v-model="formData1.feedback" type="textarea" clearable
|
||||
placeholder="请输入反馈意见" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</popup>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customServiceEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomServiceSolve } from '@/api/custom_service'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import type { FormInstance } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import { apiCustomServiceSolve } from "@/api/custom_service";
|
||||
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 formRef1 = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const formRef1 = shallowRef<FormInstance>();
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
const formData = reactive({});
|
||||
|
||||
const formData1 = reactive({
|
||||
id: '',
|
||||
processing_result: '',
|
||||
processing_process: '',
|
||||
processing_hours: '',
|
||||
done_date: '',
|
||||
id: "",
|
||||
processing_result: "",
|
||||
processing_process: "",
|
||||
processing_hours: "",
|
||||
done_date: "",
|
||||
score: 0,
|
||||
is_solve: '',
|
||||
feedback: '',
|
||||
})
|
||||
|
||||
is_solve: "",
|
||||
feedback: "",
|
||||
});
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
const formRules = reactive<any>({});
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
|
||||
|
||||
for (const key in formData1) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData1[key] = data[key]
|
||||
formData1[key] = data[key];
|
||||
}
|
||||
|
||||
}
|
||||
Object.assign(formData, data)
|
||||
}
|
||||
|
||||
|
||||
Object.assign(formData, data);
|
||||
|
||||
formData1.processing_result = String(formData1.processing_result)
|
||||
};
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef1.value?.validate();
|
||||
const data = { ...formData1 };
|
||||
|
||||
await formRef1.value?.validate()
|
||||
const data = { ...formData1, }
|
||||
|
||||
await apiCustomServiceSolve(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
await apiCustomServiceSolve(data);
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
popupRef.value?.open()
|
||||
}
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData
|
||||
|
||||
})
|
||||
setFormData,
|
||||
});
|
||||
</script>
|
||||
|
@ -76,13 +76,17 @@
|
||||
<el-table-column label="评分" prop="score" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="110" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['custom_service.custom_service/edit']" type="primary" link
|
||||
@click="handleEdit(row)" v-if="row.is_solve != 1">
|
||||
<el-button v-perms="['custom_service.custom_service/solve']" type="primary" link
|
||||
@click="handleResolve(row)" v-if="row.is_solve != 1">
|
||||
处理
|
||||
</el-button>
|
||||
<!-- <el-button v-perms="['custom_service.custom_service/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
<el-button v-perms="['custom_service.custom_service/edit']" type="primary" link
|
||||
@click="handleEdit(row)" >
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['custom_service.custom_service/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button> -->
|
||||
</el-button>
|
||||
<el-button v-perms="['custom_service.custom_service/detail']" link
|
||||
@click="handledetail(row)">
|
||||
详情
|
||||
@ -105,12 +109,15 @@
|
||||
<script lang="ts" setup name="customServiceLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiCustomServiceLists, apiCustomServiceDetail } from '@/api/custom_service'
|
||||
import { apiCustomServiceLists, apiCustomServiceDetail ,apiCustomServiceDelete} from '@/api/custom_service'
|
||||
import { apiProjectSearch } from '@/api/project'
|
||||
import { apiContractSearch } from '@/api/contract'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import HandlePopup from './handle.vue'
|
||||
import DetailPopup from './detail.vue'
|
||||
|
||||
|
||||
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const handleRef = shallowRef<InstanceType<typeof HandlePopup>>()
|
||||
@ -157,32 +164,32 @@ const handleAdd = async () => {
|
||||
}
|
||||
|
||||
// 编辑
|
||||
// const handleEdit = async (data: any) => {
|
||||
// let res = await apiCustomServiceDetail({ id: data.id })
|
||||
// showEdit.value = true
|
||||
// await nextTick()
|
||||
// editRef.value?.open('edit')
|
||||
// editRef.value?.setFormData(res)
|
||||
// }
|
||||
const handleEdit = async (data: any) => {
|
||||
let res=await apiCustomServiceDetail({id:data.id})
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
//处理
|
||||
const handleEdit = async (data: any) => {
|
||||
const handleResolve = async (data: any) => {
|
||||
let res = await apiCustomServiceDetail({ id: data.id })
|
||||
showHandle.value = true
|
||||
await nextTick()
|
||||
handleRef.value?.open('edit')
|
||||
handleRef.value?.open()
|
||||
handleRef.value?.setFormData(res)
|
||||
}
|
||||
// 删除
|
||||
// const handleDelete = async (id: number | any[]) => {
|
||||
// await feedback.confirm('确定要删除?')
|
||||
// await apiCustomServiceDelete({ id })
|
||||
// getLists()
|
||||
// }
|
||||
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiCustomServiceDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
//详情
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apiCustomServiceDetail({ id: data.id })
|
||||
|
||||
showDtail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
|
@ -1,377 +1,508 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="60vw" @confirm="handleSubmit"
|
||||
@close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="所属单位" prop="unit_qualification_id">
|
||||
<el-input v-model="formData.company_name" clearable placeholder="请输入所属单位"
|
||||
@click="showDialog1 = true" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="formData.name" clearable placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="身份证">
|
||||
<el-input v-model="formData.id_card" clearable placeholder="请输入身份证" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="创建人">
|
||||
<el-input v-model="formData.create_user_name" clearable placeholder="请输入创建人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="60vw"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="90px"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="所属单位" prop="unit_qualification_id">
|
||||
<el-input
|
||||
v-model="formData.company_name"
|
||||
clearable
|
||||
placeholder="请输入所属单位"
|
||||
@click="showDialog1 = true"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input
|
||||
v-model="formData.name"
|
||||
clearable
|
||||
placeholder="请输入姓名"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="身份证">
|
||||
<el-input
|
||||
v-model="formData.id_card"
|
||||
clearable
|
||||
placeholder="请输入身份证"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="创建人">
|
||||
<el-input
|
||||
v-model="formData.create_user_name"
|
||||
clearable
|
||||
placeholder="请输入创建人"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="技术职称" prop="technical_title">
|
||||
<el-input v-model="formData.technical_title" clearable placeholder="请输入技术职称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="岗位">
|
||||
<el-input v-model="formData.job" clearable placeholder="请输入岗位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质名称1">
|
||||
<el-input v-model="formData.qualification_name_one" clearable placeholder="请输入资质名称1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="认证机构1">
|
||||
<el-input v-model="formData.certification_body_one" clearable placeholder="请输入认证机构1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质编号1">
|
||||
<el-input v-model="formData.qualification_number_one" clearable placeholder="请输入资质编号1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发证日期1">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.get_date_one" clearable
|
||||
value-format="YYYY-MM-DD " placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="有效日期1">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.effective_date_one" clearable
|
||||
value-format="YYYY-MM-DD " placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质1状态">
|
||||
<el-select class="flex-1" v-model="formData.qualification_one_status" clearable
|
||||
placeholder="请选择">
|
||||
<el-option label="有效" :value="0" />
|
||||
<el-option label="无效" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质名称2">
|
||||
<el-input v-model="formData.qualification_name_two" clearable placeholder="请输入资质名称2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="认证机构2">
|
||||
<el-input v-model="formData.certification_body_two" clearable placeholder="请输入认证机构2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质编号2">
|
||||
<el-input v-model="formData.qualification_number_two" clearable placeholder="请输入资质编号2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发证日期2">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.get_date_two" clearable
|
||||
value-format="YYYY-MM-DD " placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="有效日期2">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.effective_date_two" clearable
|
||||
value-format="YYYY-MM-DD " placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质2状态">
|
||||
<el-select class="flex-1" v-model="formData.qualification_two_status" clearable
|
||||
placeholder="请选择">
|
||||
<el-option label="有效" :value="0" />
|
||||
<el-option label="无效" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="技术职称" prop="technical_title">
|
||||
<el-input
|
||||
v-model="formData.technical_title"
|
||||
clearable
|
||||
placeholder="请输入技术职称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="岗位">
|
||||
<el-input
|
||||
v-model="formData.job"
|
||||
clearable
|
||||
placeholder="请输入岗位"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质名称1">
|
||||
<el-input
|
||||
v-model="formData.qualification_name_one"
|
||||
clearable
|
||||
placeholder="请输入资质名称1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="认证机构1">
|
||||
<el-input
|
||||
v-model="formData.certification_body_one"
|
||||
clearable
|
||||
placeholder="请输入认证机构1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质编号1">
|
||||
<el-input
|
||||
v-model="formData.qualification_number_one"
|
||||
clearable
|
||||
placeholder="请输入资质编号1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发证日期1">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.get_date_one"
|
||||
clearable
|
||||
value-format="YYYY-MM-DD "
|
||||
placeholder="选择日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="有效日期1">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.effective_date_one"
|
||||
clearable
|
||||
value-format="YYYY-MM-DD "
|
||||
placeholder="选择日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质1状态">
|
||||
<el-select
|
||||
class="flex-1"
|
||||
v-model="formData.qualification_one_status"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option label="有效" :value="0" />
|
||||
<el-option label="无效" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质名称2">
|
||||
<el-input
|
||||
v-model="formData.qualification_name_two"
|
||||
clearable
|
||||
placeholder="请输入资质名称2"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="认证机构2">
|
||||
<el-input
|
||||
v-model="formData.certification_body_two"
|
||||
clearable
|
||||
placeholder="请输入认证机构2"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质编号2">
|
||||
<el-input
|
||||
v-model="formData.qualification_number_two"
|
||||
clearable
|
||||
placeholder="请输入资质编号2"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发证日期2">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.get_date_two"
|
||||
clearable
|
||||
value-format="YYYY-MM-DD "
|
||||
placeholder="选择日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="有效日期2">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.effective_date_two"
|
||||
clearable
|
||||
value-format="YYYY-MM-DD "
|
||||
placeholder="选择日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质2状态">
|
||||
<el-select
|
||||
class="flex-1"
|
||||
v-model="formData.qualification_two_status"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option label="有效" :value="0" />
|
||||
<el-option label="无效" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
clearable
|
||||
placeholder="请输入备注"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<createUserLable :formData="formData" flag></createUserLable>
|
||||
</el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入备注" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="附件" prop="annex">
|
||||
<uploadAnnex :formData="formData"></uploadAnnex>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-if="showDialog1">
|
||||
<el-dialog v-model="showDialog1" title="选择单位" width="70%">
|
||||
<dialogTable :config="supervision_participating_units_qualifications"
|
||||
@customEvent="customEvent1">
|
||||
</dialogTable>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
<div v-if="showDialog1">
|
||||
<el-dialog v-model="showDialog1" title="选择单位" width="70%">
|
||||
<dialogTable
|
||||
:config="supervision_participating_units_qualifications"
|
||||
@customEvent="customEvent1"
|
||||
>
|
||||
</dialogTable>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="supervisionConstructionManagementPersonnelEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiSupervisionConstructionManagementPersonnelAdd, apiSupervisionConstructionManagementPersonnelEdit, } from '@/api/supervision_construction_management_personnel'
|
||||
import type { PropType } from 'vue'
|
||||
import { supervision_participating_units_qualifications } from "@/components/dialogTable/dialogTableConfig"
|
||||
|
||||
import type { FormInstance } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import {
|
||||
apiSupervisionConstructionManagementPersonnelAdd,
|
||||
apiSupervisionConstructionManagementPersonnelEdit,
|
||||
} from "@/api/supervision_construction_management_personnel";
|
||||
import type { PropType } from "vue";
|
||||
import { supervision_participating_units_qualifications } from "@/components/dialogTable/dialogTableConfig";
|
||||
|
||||
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)
|
||||
|
||||
|
||||
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 handleAvatarSuccess_four = (response: any) => {
|
||||
if (!Array.isArray(formData.annex)) formData.annex = []
|
||||
// @ts-ignore
|
||||
response.code != 0 ? formData.annex.push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg);
|
||||
if (!Array.isArray(formData.annex)) formData.annex = [];
|
||||
// @ts-ignore
|
||||
response.code != 0
|
||||
? formData.annex.push({ uri: response.data.uri, name: response.data.name })
|
||||
: ElMessage.error(response.msg);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => { formData.annex.splice(index, 1) }
|
||||
const delFileFn = (index: number) => {
|
||||
formData.annex.splice(index, 1);
|
||||
};
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑工程监理--施工管理人员' : '新增工程监理--施工管理人员'
|
||||
})
|
||||
return mode.value == "edit"
|
||||
? "编辑工程监理--施工管理人员"
|
||||
: "新增工程监理--施工管理人员";
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
project_id: '',
|
||||
project_name: "",
|
||||
name: '',
|
||||
unit_qualification_id: '',
|
||||
company_name: '',
|
||||
id_card: '',
|
||||
technical_title: '',
|
||||
job: '',
|
||||
qualification_name_one: '',
|
||||
certification_body_one: '',
|
||||
qualification_number_one: '',
|
||||
get_date_one: '',
|
||||
effective_date_one: '',
|
||||
qualification_one_status: '',
|
||||
qualification_name_two: '',
|
||||
certification_body_two: '',
|
||||
qualification_number_two: '',
|
||||
get_date_two: '',
|
||||
effective_date_two: '',
|
||||
qualification_two_status: '',
|
||||
remark: '',
|
||||
annex: [],
|
||||
create_user_name: '',
|
||||
})
|
||||
id: "",
|
||||
project_id: "",
|
||||
project_name: "",
|
||||
name: "",
|
||||
unit_qualification_id: "",
|
||||
company_name: "",
|
||||
id_card: "",
|
||||
technical_title: "",
|
||||
job: "",
|
||||
qualification_name_one: "",
|
||||
certification_body_one: "",
|
||||
qualification_number_one: "",
|
||||
get_date_one: "",
|
||||
effective_date_one: "",
|
||||
qualification_one_status: "",
|
||||
qualification_name_two: "",
|
||||
certification_body_two: "",
|
||||
qualification_number_two: "",
|
||||
get_date_two: "",
|
||||
effective_date_two: "",
|
||||
qualification_two_status: "",
|
||||
remark: "",
|
||||
annex: [],
|
||||
create_user: "",
|
||||
create_time: "",
|
||||
});
|
||||
|
||||
const customEvent1 = (e) => {
|
||||
formData.unit_qualification_id = e.id
|
||||
formData.company_name = e.company_name
|
||||
showDialog1.value = false
|
||||
}
|
||||
formData.unit_qualification_id = e.id;
|
||||
formData.company_name = e.company_name;
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
project_id: [{
|
||||
required: true,
|
||||
message: '请选择项目',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
name: [{
|
||||
required: true,
|
||||
message: '请输入姓名',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
unit_qualification_id: [{
|
||||
required: true,
|
||||
message: '请输入所属单位',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
id_card: [{
|
||||
required: true,
|
||||
message: '请输入身份证',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
technical_title: [{
|
||||
required: true,
|
||||
message: '请输入技术职称',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
job: [{
|
||||
required: true,
|
||||
message: '请输入岗位',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
qualification_name_one: [{
|
||||
required: true,
|
||||
message: '请输入资质名称1',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
certification_body_one: [{
|
||||
required: true,
|
||||
message: '请输入认证机构1',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
qualification_number_one: [{
|
||||
required: true,
|
||||
message: '请输入资质编号1',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
get_date_one: [{
|
||||
required: true,
|
||||
message: '请输入发证日期1',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
effective_date_one: [{
|
||||
required: true,
|
||||
message: '请输入有效日期1',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
qualification_one_status: [{
|
||||
required: true,
|
||||
message: '请输入资质1状态 0-有效 1-无效',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
qualification_name_two: [{
|
||||
required: true,
|
||||
message: '请输入资质名称2',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
certification_body_two: [{
|
||||
required: true,
|
||||
message: '请输入认证机构2',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
qualification_number_two: [{
|
||||
required: true,
|
||||
message: '请输入资质编号2',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
get_date_two: [{
|
||||
required: true,
|
||||
message: '请输入发证日期2',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
effective_date_two: [{
|
||||
required: true,
|
||||
message: '请输入有效日期2',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
qualification_two_status: [{
|
||||
required: true,
|
||||
message: '请输入资质2状态 0-有效 1-无效',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
remark: [{
|
||||
required: true,
|
||||
message: '请输入备注',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
create_user: [{
|
||||
required: true,
|
||||
message: '请输入创建人',
|
||||
trigger: ['blur']
|
||||
}]
|
||||
})
|
||||
|
||||
project_id: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择项目",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入姓名",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
unit_qualification_id: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入所属单位",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
id_card: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入身份证",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
technical_title: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入技术职称",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
job: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入岗位",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
qualification_name_one: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入资质名称1",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
certification_body_one: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入认证机构1",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
qualification_number_one: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入资质编号1",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
get_date_one: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入发证日期1",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
effective_date_one: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入有效日期1",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
qualification_one_status: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入资质1状态 0-有效 1-无效",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
qualification_name_two: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入资质名称2",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
certification_body_two: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入认证机构2",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
qualification_number_two: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入资质编号2",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
get_date_two: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入发证日期2",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
effective_date_two: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入有效日期2",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
qualification_two_status: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入资质2状态 0-有效 1-无效",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
remark: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入备注",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
create_user: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入创建人",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiSupervisionConstructionManagementPersonnelDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
const data = await apiSupervisionConstructionManagementPersonnelDetail({
|
||||
id: row.id,
|
||||
});
|
||||
setFormData(data);
|
||||
};
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiSupervisionConstructionManagementPersonnelEdit(data)
|
||||
: await apiSupervisionConstructionManagementPersonnelAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
mode.value == "edit"
|
||||
? await apiSupervisionConstructionManagementPersonnelEdit(data)
|
||||
: await apiSupervisionConstructionManagementPersonnelAdd(data);
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
});
|
||||
</script>
|
||||
|
@ -13,9 +13,11 @@
|
||||
<el-form-item label="文档简介" prop="doc_desc">
|
||||
<el-input v-model="formData.doc_desc" clearable placeholder="请输入文档简介" />
|
||||
</el-form-item>
|
||||
|
||||
<createUserLable :formData="formData"></createUserLable>
|
||||
|
||||
<el-form-item label="附件" prop="annex">
|
||||
<uploadAnnex :formData="formData"></uploadAnnex>
|
||||
|
||||
</el-form-item>
|
||||
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||
<dialogTable @customEvent="customEvent" :config="supervision_project" />
|
||||
@ -45,13 +47,6 @@ const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const showDialog = ref(false)
|
||||
|
||||
const handleAvatarSuccess_four = (response: any) => {
|
||||
// @ts-ignore
|
||||
response.code != 0 ? formData.annex.push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => { formData.annex.splice(index, 1) }
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑工程监理--监理合同交底' : '新增工程监理--监理合同交底'
|
||||
@ -65,6 +60,8 @@ const formData = reactive({
|
||||
doc_name: '',
|
||||
doc_desc: '',
|
||||
annex: [],
|
||||
create_user: '',
|
||||
create_time: '',
|
||||
})
|
||||
const customEvent = (e) => {
|
||||
formData.project_id = e.id
|
||||
|
@ -1,170 +1,208 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
|
||||
@close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
|
||||
<el-form-item label="危大工程监控" prop="dangerous_engineering_monitoring_title">
|
||||
<el-input v-model="formData.dangerous_engineering_monitoring_title" clearable readonly
|
||||
@click="showDialog = true" placeholder="请选择危大工程监控" />
|
||||
</el-form-item>
|
||||
<el-form-item label="方案名称" prop="case_name">
|
||||
<el-input v-model="formData.case_name" clearable placeholder="请输入方案名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="评审人员" prop="assessor">
|
||||
<el-input v-model="formData.assessor" clearable placeholder="请输入评审人员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="评审内容" prop="review_content">
|
||||
<el-input v-model="formData.review_content" clearable placeholder="请输入评审内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入备注" type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="annex">
|
||||
<uploadAnnex :formData="formData"></uploadAnnex>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="120px"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-form-item
|
||||
label="危大工程监控"
|
||||
prop="dangerous_engineering_monitoring_title"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.dangerous_engineering_monitoring_title"
|
||||
clearable
|
||||
readonly
|
||||
@click="showDialog = true"
|
||||
placeholder="请选择危大工程监控"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="方案名称" prop="case_name">
|
||||
<el-input
|
||||
v-model="formData.case_name"
|
||||
clearable
|
||||
placeholder="请输入方案名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="评审人员" prop="assessor">
|
||||
<el-input
|
||||
v-model="formData.assessor"
|
||||
clearable
|
||||
placeholder="请输入评审人员"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="评审内容" prop="review_content">
|
||||
<el-input
|
||||
v-model="formData.review_content"
|
||||
clearable
|
||||
placeholder="请输入评审内容"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
clearable
|
||||
placeholder="请输入备注"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
<createUserLable :formData="formData"></createUserLable>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<el-dialog v-model="showDialog" title="选择危大工程监控" width="70%">
|
||||
<dialogTable :config="supervision_dangerous_engineering_monitoring" @customEvent="customEvent">
|
||||
</dialogTable>
|
||||
</el-dialog>
|
||||
|
||||
</popup>
|
||||
</div>
|
||||
<el-form-item label="附件" prop="annex">
|
||||
<uploadAnnex :formData="formData"></uploadAnnex>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-dialog v-model="showDialog" title="选择危大工程监控" width="70%">
|
||||
<dialogTable
|
||||
:config="supervision_dangerous_engineering_monitoring"
|
||||
@customEvent="customEvent"
|
||||
>
|
||||
</dialogTable>
|
||||
</el-dialog>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="supervisionDangerousEngineeringCaseEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiSupervisionDangerousEngineeringCaseAdd, apiSupervisionDangerousEngineeringCaseEdit, apiSupervisionDangerousEngineeringCaseDetail } from '@/api/supervision_dangerous_engineering_case'
|
||||
import { supervision_dangerous_engineering_monitoring } from "@/components/dialogTable/dialogTableConfig"
|
||||
import type { PropType } from 'vue'
|
||||
import type { FormInstance } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import {
|
||||
apiSupervisionDangerousEngineeringCaseAdd,
|
||||
apiSupervisionDangerousEngineeringCaseEdit,
|
||||
apiSupervisionDangerousEngineeringCaseDetail,
|
||||
} from "@/api/supervision_dangerous_engineering_case";
|
||||
import { supervision_dangerous_engineering_monitoring } from "@/components/dialogTable/dialogTableConfig";
|
||||
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)
|
||||
|
||||
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 popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑工程监理--危大方案提交列表' : '新增工程监理--危大方案提交列表'
|
||||
})
|
||||
|
||||
const handleAvatarSuccess_four = (response: any) => {
|
||||
Array.isArray(formData.annex) ? '' : formData.annex = []
|
||||
// @ts-ignore
|
||||
response.code != 0 ? formData.annex.push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => { formData.annex.splice(index, 1) }
|
||||
return mode.value == "edit"
|
||||
? "编辑工程监理--危大方案提交列表"
|
||||
: "新增工程监理--危大方案提交列表";
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
dangerous_engineering_monitoring_id: '',
|
||||
dangerous_engineering_monitoring_title: "",
|
||||
case_name: '',
|
||||
assessor: '',
|
||||
review_content: '',
|
||||
remark: '',
|
||||
annex: [],
|
||||
create_user: '',
|
||||
})
|
||||
id: "",
|
||||
dangerous_engineering_monitoring_id: "",
|
||||
dangerous_engineering_monitoring_title: "",
|
||||
case_name: "",
|
||||
assessor: "",
|
||||
review_content: "",
|
||||
remark: "",
|
||||
annex: [],
|
||||
create_user: "",
|
||||
create_time: "",
|
||||
});
|
||||
|
||||
const customEvent = (e: any) => {
|
||||
formData.dangerous_engineering_monitoring_id = e.id
|
||||
formData.dangerous_engineering_monitoring_title = e.project_name
|
||||
showDialog.value = false
|
||||
|
||||
}
|
||||
formData.dangerous_engineering_monitoring_id = e.id;
|
||||
formData.dangerous_engineering_monitoring_title = e.project_name;
|
||||
showDialog.value = false;
|
||||
};
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
dangerous_engineering_monitoring_id: [{
|
||||
required: true,
|
||||
message: '请输入危大工程监控',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
case_name: [{
|
||||
required: true,
|
||||
message: '请输入方案名称',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
assessor: [{
|
||||
required: true,
|
||||
message: '请输入评审人员',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
review_content: [{
|
||||
required: true,
|
||||
message: '请输入评审内容',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
remark: [{
|
||||
required: true,
|
||||
message: '请输入备注',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
})
|
||||
|
||||
dangerous_engineering_monitoring_id: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入危大工程监控",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
case_name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入方案名称",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
assessor: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入评审人员",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
review_content: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入评审内容",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
remark: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入备注",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiSupervisionDangerousEngineeringCaseDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
const data = await apiSupervisionDangerousEngineeringCaseDetail({
|
||||
id: row.id,
|
||||
});
|
||||
setFormData(data);
|
||||
};
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiSupervisionDangerousEngineeringCaseEdit(data)
|
||||
: await apiSupervisionDangerousEngineeringCaseAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
mode.value == "edit"
|
||||
? await apiSupervisionDangerousEngineeringCaseEdit(data)
|
||||
: await apiSupervisionDangerousEngineeringCaseAdd(data);
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
customEvent
|
||||
})
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
customEvent,
|
||||
});
|
||||
</script>
|
||||
|
@ -17,9 +17,8 @@
|
||||
<uploadAnnex :formData="formData"></uploadAnnex>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="操作人">
|
||||
<el-input v-model="formData.create_user_name" clearable placeholder="请输入操作人" />
|
||||
</el-form-item>
|
||||
|
||||
<createUserLable :formData="formData"></createUserLable>
|
||||
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||
<dialogTable @customEvent="customEvent" :config="supervision_project" />
|
||||
|
||||
@ -35,8 +34,7 @@ import Popup from '@/components/popup/index.vue'
|
||||
import { apiSupervisionDesignDisclosureEdit, apiSupervisionDesignDisclosureAdd } from '@/api/supervision_design_disclosure'
|
||||
import { supervision_project } from "@/components/dialogTable/dialogTableConfig"
|
||||
import type { PropType } from 'vue'
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const userStore = useUserStore().userInfo;
|
||||
|
||||
|
||||
defineProps({
|
||||
dictData: {
|
||||
@ -64,7 +62,9 @@ const formData = reactive({
|
||||
doc_name: '',
|
||||
doc_desc: '',
|
||||
annex: [],
|
||||
create_user_name: userStore.account,
|
||||
create_user: '',
|
||||
create_time: '',
|
||||
|
||||
|
||||
})
|
||||
const customEvent = (e) => {
|
||||
@ -102,14 +102,7 @@ const formRules = reactive<any>({
|
||||
}]
|
||||
})
|
||||
|
||||
const handleAvatarSuccess_four = (response: any) => {
|
||||
if (!Array.isArray(formData.annex)) formData.annex = []
|
||||
// @ts-ignore
|
||||
response.code != 0 ? formData.annex.push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => { formData.annex.splice(index, 1) }
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
@ -118,8 +111,6 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,328 +1,423 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="60vw" @confirm="handleSubmit"
|
||||
@close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="所属单位" prop="unit_qualification_id">
|
||||
<el-input v-model="formData.company_name" clearable placeholder="请输入所属单位"
|
||||
@click="showDialog1 = true" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称" prop="name">
|
||||
<el-input v-model="formData.name" clearable placeholder="请输入设备名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质名称1" prop="qualification_name_one">
|
||||
<el-input v-model="formData.qualification_name_one" clearable placeholder="请输入资质名称1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="认证机构1" prop="certification_body_one">
|
||||
<el-input v-model="formData.certification_body_one" clearable placeholder="请输入认证机构1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质编号1" prop="qualification_number_one">
|
||||
<el-input v-model="formData.qualification_number_one" clearable placeholder="请输入资质编号1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发证日期1" prop="get_date_one">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.get_date_one" clearable
|
||||
value-format="YYYY-MM-DD " placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="有效日期1" prop="effective_date_one">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.effective_date_one" clearable
|
||||
value-format="YYYY-MM-DD " placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质1状态 " prop="qualification_one_status">
|
||||
<el-select class="flex-1" v-model="formData.qualification_one_status" clearable
|
||||
placeholder="请选择">
|
||||
<el-option label="有效" :value="0" />
|
||||
<el-option label="无效" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质名称2" prop="qualification_name_two">
|
||||
<el-input v-model="formData.qualification_name_two" clearable placeholder="请输入资质名称2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="认证机构2" prop="certification_body_two">
|
||||
<el-input v-model="formData.certification_body_two" clearable placeholder="请输入认证机构2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质编号2" prop="qualification_number_two">
|
||||
<el-input v-model="formData.qualification_number_two" clearable placeholder="请输入资质编号2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发证日期2" prop="get_date_two">
|
||||
<!-- <el-input v-model="formData.get_date_two" clearable placeholder="请输入发证日期2" /> -->
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.get_date_two" clearable
|
||||
value-format="YYYY-MM-DD " placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="有效日期2" prop="effective_date_two">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.effective_date_two" clearable
|
||||
value-format="YYYY-MM-DD " placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质2状态" prop="qualification_two_status">
|
||||
<el-select class="flex-1" v-model="formData.qualification_two_status" clearable
|
||||
placeholder="请选择">
|
||||
<el-option label="有效" :value="0" />
|
||||
<el-option label="无效" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="创建人" prop="create_user">
|
||||
<el-input v-model="formData.create_user_name" clearable placeholder="请输入创建人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入备注" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="附件" prop="annex">
|
||||
<uploadAnnex :formData="formData"></uploadAnnex>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-dialog v-model="showDialog1" title="选择单位" width="70%">
|
||||
<dialogTable :config="supervision_participating_units_qualifications" @customEvent="customEvent1">
|
||||
</dialogTable>
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="60vw"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="90px"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="所属单位" prop="unit_qualification_id">
|
||||
<el-input
|
||||
v-model="formData.company_name"
|
||||
clearable
|
||||
placeholder="请输入所属单位"
|
||||
@click="showDialog1 = true"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称" prop="name">
|
||||
<el-input
|
||||
v-model="formData.name"
|
||||
clearable
|
||||
placeholder="请输入设备名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质名称1" prop="qualification_name_one">
|
||||
<el-input
|
||||
v-model="formData.qualification_name_one"
|
||||
clearable
|
||||
placeholder="请输入资质名称1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="认证机构1" prop="certification_body_one">
|
||||
<el-input
|
||||
v-model="formData.certification_body_one"
|
||||
clearable
|
||||
placeholder="请输入认证机构1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质编号1" prop="qualification_number_one">
|
||||
<el-input
|
||||
v-model="formData.qualification_number_one"
|
||||
clearable
|
||||
placeholder="请输入资质编号1"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发证日期1" prop="get_date_one">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.get_date_one"
|
||||
clearable
|
||||
value-format="YYYY-MM-DD "
|
||||
placeholder="选择日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="有效日期1" prop="effective_date_one">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.effective_date_one"
|
||||
clearable
|
||||
value-format="YYYY-MM-DD "
|
||||
placeholder="选择日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质1状态 " prop="qualification_one_status">
|
||||
<el-select
|
||||
class="flex-1"
|
||||
v-model="formData.qualification_one_status"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option label="有效" :value="0" />
|
||||
<el-option label="无效" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质名称2" prop="qualification_name_two">
|
||||
<el-input
|
||||
v-model="formData.qualification_name_two"
|
||||
clearable
|
||||
placeholder="请输入资质名称2"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="认证机构2" prop="certification_body_two">
|
||||
<el-input
|
||||
v-model="formData.certification_body_two"
|
||||
clearable
|
||||
placeholder="请输入认证机构2"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质编号2" prop="qualification_number_two">
|
||||
<el-input
|
||||
v-model="formData.qualification_number_two"
|
||||
clearable
|
||||
placeholder="请输入资质编号2"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发证日期2" prop="get_date_two">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.get_date_two"
|
||||
clearable
|
||||
value-format="YYYY-MM-DD "
|
||||
placeholder="选择日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="有效日期2" prop="effective_date_two">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.effective_date_two"
|
||||
clearable
|
||||
value-format="YYYY-MM-DD "
|
||||
placeholder="选择日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质2状态" prop="qualification_two_status">
|
||||
<el-select
|
||||
class="flex-1"
|
||||
v-model="formData.qualification_two_status"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option label="有效" :value="0" />
|
||||
<el-option label="无效" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<createUserLable :formData="formData" flag></createUserLable>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
clearable
|
||||
placeholder="请输入备注"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="附件" prop="annex">
|
||||
<uploadAnnex :formData="formData"></uploadAnnex>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-dialog v-model="showDialog1" title="选择单位" width="70%">
|
||||
<dialogTable
|
||||
:config="supervision_participating_units_qualifications"
|
||||
@customEvent="customEvent1"
|
||||
>
|
||||
</dialogTable>
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="supervisionLargeEquipmentEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiSupervisionLargeEquipmentAdd, apiSupervisionLargeEquipmentEdit } from '@/api/supervision_large_equipment'
|
||||
import { supervision_participating_units_qualifications } from "@/components/dialogTable/dialogTableConfig"
|
||||
import type { PropType } from 'vue'
|
||||
import type { FormInstance } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import {
|
||||
apiSupervisionLargeEquipmentAdd,
|
||||
apiSupervisionLargeEquipmentEdit,
|
||||
} from "@/api/supervision_large_equipment";
|
||||
import { supervision_participating_units_qualifications } from "@/components/dialogTable/dialogTableConfig";
|
||||
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 showDialog1 = ref(false)
|
||||
|
||||
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 showDialog1 = ref(false);
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑工程监理--大型设备及仪器具' : '新增工程监理--大型设备及仪器具'
|
||||
})
|
||||
return mode.value == "edit"
|
||||
? "编辑工程监理--大型设备及仪器具"
|
||||
: "新增工程监理--大型设备及仪器具";
|
||||
});
|
||||
|
||||
const handleAvatarSuccess_four = (response: any) => {
|
||||
if (!Array.isArray(formData.annex)) formData.annex = []
|
||||
// @ts-ignore
|
||||
response.code != 0 ? formData.annex.push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => { formData.annex.splice(index, 1) }
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
unit_qualification_id: '',
|
||||
company_name: "",
|
||||
name: '',
|
||||
qualification_name_one: '',
|
||||
certification_body_one: '',
|
||||
qualification_number_one: '',
|
||||
get_date_one: '',
|
||||
effective_date_one: '',
|
||||
qualification_one_status: '',
|
||||
qualification_name_two: '',
|
||||
certification_body_two: '',
|
||||
qualification_number_two: '',
|
||||
get_date_two: '',
|
||||
effective_date_two: '',
|
||||
qualification_two_status: '',
|
||||
remark: '',
|
||||
annex: [],
|
||||
create_user_name: '',
|
||||
})
|
||||
id: "",
|
||||
unit_qualification_id: "",
|
||||
company_name: "",
|
||||
name: "",
|
||||
qualification_name_one: "",
|
||||
certification_body_one: "",
|
||||
qualification_number_one: "",
|
||||
get_date_one: "",
|
||||
effective_date_one: "",
|
||||
qualification_one_status: "",
|
||||
qualification_name_two: "",
|
||||
certification_body_two: "",
|
||||
qualification_number_two: "",
|
||||
get_date_two: "",
|
||||
effective_date_two: "",
|
||||
qualification_two_status: "",
|
||||
remark: "",
|
||||
annex: [],
|
||||
create_user: "",
|
||||
create_time: "",
|
||||
});
|
||||
const customEvent1 = (e) => {
|
||||
formData.unit_qualification_id = e.id
|
||||
formData.company_name = e.company_name
|
||||
showDialog1.value = false
|
||||
}
|
||||
formData.unit_qualification_id = e.id;
|
||||
formData.company_name = e.company_name;
|
||||
showDialog1.value = false;
|
||||
};
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
unit_qualification_id: [{
|
||||
required: true,
|
||||
message: '请选择项目',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
name: [{
|
||||
required: true,
|
||||
message: '请输入设备名称',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
qualification_name_one: [{
|
||||
required: true,
|
||||
message: '请输入资质名称1',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
certification_body_one: [{
|
||||
required: true,
|
||||
message: '请输入认证机构1',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
qualification_number_one: [{
|
||||
required: true,
|
||||
message: '请输入资质编号1',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
get_date_one: [{
|
||||
required: true,
|
||||
message: '请输入发证日期1',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
effective_date_one: [{
|
||||
required: true,
|
||||
message: '请输入有效日期1',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
qualification_one_status: [{
|
||||
required: true,
|
||||
message: '请输入资质1状态 0-有效 1-无效',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
qualification_name_two: [{
|
||||
required: true,
|
||||
message: '请输入资质名称2',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
certification_body_two: [{
|
||||
required: true,
|
||||
message: '请输入认证机构2',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
qualification_number_two: [{
|
||||
required: true,
|
||||
message: '请输入资质编号2',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
get_date_two: [{
|
||||
required: true,
|
||||
message: '请输入发证日期2',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
effective_date_two: [{
|
||||
required: true,
|
||||
message: '请输入有效日期2',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
qualification_two_status: [{
|
||||
required: true,
|
||||
message: '请输入资质2状态 0-有效 1-无效',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
remark: [{
|
||||
required: true,
|
||||
message: '请输入备注',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
create_user: [{
|
||||
required: true,
|
||||
message: '请输入创建人',
|
||||
trigger: ['blur']
|
||||
}]
|
||||
})
|
||||
|
||||
unit_qualification_id: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择项目",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入设备名称",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
qualification_name_one: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入资质名称1",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
certification_body_one: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入认证机构1",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
qualification_number_one: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入资质编号1",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
get_date_one: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入发证日期1",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
effective_date_one: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入有效日期1",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
qualification_one_status: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入资质1状态 0-有效 1-无效",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
qualification_name_two: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入资质名称2",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
certification_body_two: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入认证机构2",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
qualification_number_two: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入资质编号2",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
get_date_two: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入发证日期2",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
effective_date_two: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入有效日期2",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
qualification_two_status: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入资质2状态 0-有效 1-无效",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
remark: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入备注",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
create_user: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入创建人",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiSupervisionLargeEquipmentDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
const data = await apiSupervisionLargeEquipmentDetail({
|
||||
id: row.id,
|
||||
});
|
||||
setFormData(data);
|
||||
};
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiSupervisionLargeEquipmentEdit(data)
|
||||
: await apiSupervisionLargeEquipmentAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
mode.value == "edit"
|
||||
? await apiSupervisionLargeEquipmentEdit(data)
|
||||
: await apiSupervisionLargeEquipmentAdd(data);
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
});
|
||||
</script>
|
||||
|
@ -1,254 +1,306 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit"
|
||||
@close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="project_id">
|
||||
<el-input v-model="formData.project_name" clearable placeholder="点击选择项目" readonly
|
||||
@click="showDialog = true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位名称" prop="unit_name">
|
||||
<el-input v-model="formData.unit_name" clearable placeholder="请输入单位名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位类别" prop="unit_type">
|
||||
<el-select class="flex-1" v-model="formData.unit_type" clearable placeholder="请选择单位类别">
|
||||
<el-option v-for="(item, index) in dictData.unit_type" :key="index" :label="item.name"
|
||||
:value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质等级" prop="qualification_grade">
|
||||
<el-input v-model="formData.qualification_grade" clearable placeholder="请输入资质等级" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系电话" prop="telephone">
|
||||
<el-input v-model="formData.telephone" clearable placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="责任范围" prop="duty">
|
||||
<el-input v-model="formData.duty" clearable placeholder="请输入责任范围" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||
<dialogTable @customEvent="customEvent" :config="supervision_project" />
|
||||
</el-dialog>
|
||||
<div style="margin-bottom: 30px;">联系人</div>
|
||||
<div style="margin-bottom: 30px;">
|
||||
<el-table :data="formData.contacts">
|
||||
<el-table-column label="序号" v-if="mode == 'add'">
|
||||
<template #default="{ row }">
|
||||
<el-button @click="handleAdd(row)">+</el-button>
|
||||
<el-button @click="handleDelete(row)">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" prop="name">
|
||||
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.name" :readonly="mode == 'edit'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="职务" prop="duties">
|
||||
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.duties" :readonly="mode == 'edit'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="办公电话" prop="telephone">
|
||||
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.telephone" :readonly="mode == 'edit'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号码" prop="mobile">
|
||||
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.mobile" :readonly="mode == 'edit'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="电子邮箱" prop="email">
|
||||
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.email" :readonly="mode == 'edit'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="传真" prop="fax">
|
||||
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.fax" :readonly="mode == 'edit'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="80vw"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="90px"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="project_id">
|
||||
<el-input
|
||||
v-model="formData.project_name"
|
||||
clearable
|
||||
placeholder="点击选择项目"
|
||||
readonly
|
||||
@click="showDialog = true"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位名称" prop="unit_name">
|
||||
<el-input
|
||||
v-model="formData.unit_name"
|
||||
clearable
|
||||
placeholder="请输入单位名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位类别" prop="unit_type">
|
||||
<el-select
|
||||
class="flex-1"
|
||||
v-model="formData.unit_type"
|
||||
clearable
|
||||
placeholder="请选择单位类别"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in dictData.unit_type"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="parseInt(item.value)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质等级" prop="qualification_grade">
|
||||
<el-input
|
||||
v-model="formData.qualification_grade"
|
||||
clearable
|
||||
placeholder="请输入资质等级"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系电话" prop="telephone">
|
||||
<el-input
|
||||
v-model="formData.telephone"
|
||||
clearable
|
||||
placeholder="请输入联系电话"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="责任范围" prop="duty">
|
||||
<el-input
|
||||
v-model="formData.duty"
|
||||
clearable
|
||||
placeholder="请输入责任范围"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||
<dialogTable
|
||||
@customEvent="customEvent"
|
||||
:config="supervision_project"
|
||||
/>
|
||||
</el-dialog>
|
||||
<div style="margin-bottom: 30px">
|
||||
联系人
|
||||
<el-button @click="handleAdd" v-if="!formData.contacts.length"
|
||||
>+</el-button
|
||||
>
|
||||
</div>
|
||||
<div style="margin-bottom: 30px">
|
||||
<el-table :data="formData.contacts">
|
||||
<el-table-column label="序号">
|
||||
<template #default="{ row }">
|
||||
<el-button @click="handleAdd">+</el-button>
|
||||
<el-button @click="handleDelete(row)">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" prop="name">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.name" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="职务" prop="duties">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.duties" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="办公电话" prop="telephone">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.telephone" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号码" prop="mobile">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.mobile" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="电子邮箱" prop="email">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.email" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="传真" prop="fax">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.fax" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="supervisionParticipatingUnitsEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiSupervisionParticipatingUnitsAdd, apiSupervisionParticipatingUnitsEdit, apiSupervisionParticipatingUnitsDetail } from '@/api/supervision_participating_units'
|
||||
import { apiSupervisionParticipatingUnitsContactsLists } from '@/api/supervision_participating_units_contacts'
|
||||
import { supervision_project } from "@/components/dialogTable/dialogTableConfig"
|
||||
import type { PropType } from 'vue'
|
||||
import type { FormInstance } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import {
|
||||
apiSupervisionParticipatingUnitsAdd,
|
||||
apiSupervisionParticipatingUnitsEdit,
|
||||
apiSupervisionParticipatingUnitsDetail,
|
||||
} from "@/api/supervision_participating_units";
|
||||
import {
|
||||
apiSupervisionParticipatingUnitsContactsLists,
|
||||
apiSupervisionParticipatingUnitsContactsDelete,
|
||||
} from "@/api/supervision_participating_units_contacts";
|
||||
import { supervision_project } from "@/components/dialogTable/dialogTableConfig";
|
||||
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')
|
||||
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 showDialog = ref(false);
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑工程监理--参建单位' : '新增工程监理--参建单位'
|
||||
})
|
||||
return mode.value == "edit"
|
||||
? "编辑工程监理--参建单位"
|
||||
: "新增工程监理--参建单位";
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
project_id: '',
|
||||
project_name: "",
|
||||
unit_name: '',
|
||||
unit_type: '',
|
||||
qualification_grade: '',
|
||||
telephone: '',
|
||||
duty: '',
|
||||
contacts: [
|
||||
{
|
||||
"name": "",
|
||||
"duties": "",
|
||||
"telephone": "",
|
||||
"mobile": "",
|
||||
"email": "",
|
||||
"fax": ""
|
||||
}
|
||||
]
|
||||
})
|
||||
id: "",
|
||||
project_id: "",
|
||||
project_name: "",
|
||||
unit_name: "",
|
||||
unit_type: "",
|
||||
qualification_grade: "",
|
||||
telephone: "",
|
||||
duty: "",
|
||||
contacts: [],
|
||||
});
|
||||
|
||||
const customEvent = (e) => {
|
||||
formData.project_id = e.id
|
||||
formData.project_name = e.project_name
|
||||
showDialog.value = false
|
||||
}
|
||||
formData.project_id = e.id;
|
||||
formData.project_name = e.project_name;
|
||||
showDialog.value = false;
|
||||
};
|
||||
|
||||
const handleAdd = () => {
|
||||
formData.contacts.push({
|
||||
"name": "",
|
||||
"duties": "",
|
||||
"telephone": "",
|
||||
"mobile": "",
|
||||
"email": "",
|
||||
"fax": ""
|
||||
})
|
||||
|
||||
}
|
||||
const handleDelete = (row: any) => {
|
||||
const index = formData.contacts.indexOf(row);
|
||||
formData.contacts.splice(index, 1);
|
||||
}
|
||||
formData.contacts.push({
|
||||
name: "",
|
||||
duties: "",
|
||||
telephone: "",
|
||||
mobile: "",
|
||||
email: "",
|
||||
fax: "",
|
||||
});
|
||||
};
|
||||
const handleDelete = async (row: any) => {
|
||||
if (row.id) {
|
||||
await apiSupervisionParticipatingUnitsContactsDelete({ id: row.id });
|
||||
}
|
||||
const index = formData.contacts.indexOf(row);
|
||||
formData.contacts.splice(index, 1);
|
||||
};
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
project_id: [{
|
||||
required: true,
|
||||
message: '请选择项目',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
unit_name: [{
|
||||
required: true,
|
||||
message: '请输入单位名称',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
unit_type: [{
|
||||
required: true,
|
||||
message: '请输入单位类别',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
qualification_grade: [{
|
||||
required: true,
|
||||
message: '请输入资质等级',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
telephone: [{
|
||||
required: true,
|
||||
message: '请输入联系电话',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
duty: [{
|
||||
required: true,
|
||||
message: '请输入责任范围',
|
||||
trigger: ['blur']
|
||||
}]
|
||||
})
|
||||
|
||||
project_id: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择项目",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
unit_name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入单位名称",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
unit_type: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入单位类别",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
qualification_grade: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入资质等级",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
telephone: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入联系电话",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
duty: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入责任范围",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
}
|
||||
let res = await apiSupervisionParticipatingUnitsContactsLists({ unit_id: data.id })
|
||||
formData.contacts = res.lists
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
let res = await apiSupervisionParticipatingUnitsContactsLists({
|
||||
unit_id: data.id,
|
||||
});
|
||||
formData.contacts = res.lists;
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiSupervisionParticipatingUnitsDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
const data = await apiSupervisionParticipatingUnitsDetail({
|
||||
id: row.id,
|
||||
});
|
||||
setFormData(data);
|
||||
};
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiSupervisionParticipatingUnitsEdit(data)
|
||||
: await apiSupervisionParticipatingUnitsAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
mode.value == "edit"
|
||||
? await apiSupervisionParticipatingUnitsEdit(data)
|
||||
: await apiSupervisionParticipatingUnitsAdd(data);
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
});
|
||||
</script>
|
||||
|
@ -1,129 +1,206 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="问题分类" prop="problem_cate">
|
||||
<el-input class="w-[280px]" v-model="queryParams.problem_cate" clearable placeholder="请输入问题分类" />
|
||||
</el-form-item>
|
||||
<el-form-item label="问题说明" prop="problem_description">
|
||||
<el-input class="w-[280px]" v-model="queryParams.problem_description" clearable
|
||||
placeholder="请输入问题说明" />
|
||||
</el-form-item>
|
||||
<el-form-item label="问题名称" prop="problem_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.problem_name" 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="['supervision_work.supervision_problem/add']" type="primary" @click="handleAdd">
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="问题分类" prop="problem_cate">
|
||||
|
||||
<el-select
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.problem_cate"
|
||||
clearable
|
||||
placeholder="请选择问题分类"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in dictData.problem_cate"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="问题说明" prop="problem_description">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.problem_description"
|
||||
clearable
|
||||
placeholder="请输入问题说明"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="问题名称" prop="problem_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.problem_name"
|
||||
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="['supervision_work.supervision_problem/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button> -->
|
||||
<el-button v-perms="['supervision_work.supervision_problem/delete']" :disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)">
|
||||
<el-button
|
||||
v-perms="['supervision_work.supervision_problem/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
<!-- 1-巡视 2-旁站 3-验收 4-设备进场 5-见证取样 6-材料平行检验 7-实体平行检验 -->
|
||||
</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="problem_cate_text"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="问题说明"
|
||||
prop="problem_description"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="问题名称"
|
||||
prop="problem_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="整改时间"
|
||||
prop="rectification_time"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="整改人"
|
||||
prop="rectification_user"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="整改结果"
|
||||
prop="rectification_result_text"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="整改意见"
|
||||
prop="rectification_opinion"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="是否整改"
|
||||
prop="is_rectification_text"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="200"
|
||||
fixed="right"
|
||||
align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['supervision_work.supervision_problem/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
v-if="row.is_rectification == 0"
|
||||
>
|
||||
检查验收
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['supervision_work.supervision_problem/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
<!-- 1-巡视 2-旁站 3-验收 4-设备进场 5-见证取样 6-材料平行检验 7-实体平行检验 -->
|
||||
</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="problem_cate_text" show-overflow-tooltip />
|
||||
<el-table-column label="问题说明" prop="problem_description" show-overflow-tooltip />
|
||||
<el-table-column label="问题名称" prop="problem_name" show-overflow-tooltip />
|
||||
<el-table-column label="整改时间" prop="rectification_time" show-overflow-tooltip />
|
||||
<el-table-column label="整改人" prop="rectification_user" show-overflow-tooltip />
|
||||
<el-table-column label="整改结果" prop="rectification_result_text" show-overflow-tooltip />
|
||||
<el-table-column label="整改意见" prop="rectification_opinion" show-overflow-tooltip />
|
||||
<el-table-column label="是否整改" prop="is_rectification_text" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="200" fixed="right" align="center">
|
||||
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['supervision_work.supervision_problem/edit']" type="primary" link
|
||||
@click="handleEdit(row)" v-if="row.is_rectification == 0">
|
||||
检查验收
|
||||
</el-button>
|
||||
<el-button v-perms="['supervision_work.supervision_problem/delete']" type="danger" link
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
</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" />
|
||||
</div>
|
||||
</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"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="supervisionProblemLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiSupervisionProblemLists, apiSupervisionProblemDelete } from '@/api/supervision_problem'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import {
|
||||
apiSupervisionProblemLists,
|
||||
apiSupervisionProblemDelete,
|
||||
} from "@/api/supervision_problem";
|
||||
import feedback from "@/utils/feedback";
|
||||
import EditPopup from "./edit.vue";
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
const showEdit = ref(false);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
data_id: '',
|
||||
data_type: '',
|
||||
problem_cate: '',
|
||||
problem_description: '',
|
||||
problem_name: ''
|
||||
})
|
||||
data_id: "",
|
||||
data_type: "",
|
||||
problem_cate: "",
|
||||
problem_description: "",
|
||||
problem_name: "",
|
||||
});
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
const { dictData } = useDictData("problem_cate");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiSupervisionProblemLists,
|
||||
params: queryParams
|
||||
})
|
||||
fetchFun: apiSupervisionProblemLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("add");
|
||||
};
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("edit");
|
||||
editRef.value?.setFormData(data);
|
||||
};
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiSupervisionProblemDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
await feedback.confirm("确定要删除?");
|
||||
await apiSupervisionProblemDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
|
||||
getLists()
|
||||
getLists();
|
||||
</script>
|
||||
|
@ -1,203 +1,262 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
|
||||
@close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="110px" :rules="formRules">
|
||||
<el-form-item label="项目名称" prop="project_name">
|
||||
<el-input v-model="formData.project_name" clearable placeholder="点击选择项目" readonly
|
||||
@click="showDialog = true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="信息摘要" prop="abstract">
|
||||
<el-input v-model="formData.abstract" clearable placeholder="请输入信息摘要" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发生日期" prop="happen_date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.happen_date" clearable
|
||||
value-format="YYYY-MM-DD" placeholder="选择发生日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="严重程度" prop="severity">
|
||||
<el-select class="flex-1" v-model="formData.severity" clearable placeholder="请选择严重程度">
|
||||
<el-option v-for="(item, index) in dictData.severity" :key="index" :label="item.name"
|
||||
:value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="信息类别">
|
||||
<el-checkbox-group v-model="formData.info_cate" placeholder="请选择信息类别">
|
||||
<el-checkbox v-for="(item, index) in dictData.info_cate" :key="index" :label="(item.value)">
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="信息内容">
|
||||
<el-input v-model="formData.info_content" clearable placeholder="请输入信息内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目部意见">
|
||||
<el-input v-model="formData.opinions" clearable placeholder="请输入项目部意见" />
|
||||
</el-form-item>
|
||||
<el-form-item label="主送人">
|
||||
<el-input v-model="formData.giver" clearable placeholder="请输入主送人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件">
|
||||
<uploadAnnex :formData="formData"></uploadAnnex>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="110px"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-form-item label="项目名称" prop="project_name">
|
||||
<el-input
|
||||
v-model="formData.project_name"
|
||||
clearable
|
||||
placeholder="点击选择项目"
|
||||
readonly
|
||||
@click="showDialog = true"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="信息摘要" prop="abstract">
|
||||
<el-input
|
||||
v-model="formData.abstract"
|
||||
clearable
|
||||
placeholder="请输入信息摘要"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="发生日期" prop="happen_date">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.happen_date"
|
||||
clearable
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择发生日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="严重程度" prop="severity">
|
||||
<el-select
|
||||
class="flex-1"
|
||||
v-model="formData.severity"
|
||||
clearable
|
||||
placeholder="请选择严重程度"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in dictData.severity"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="parseInt(item.value)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="信息类别">
|
||||
<el-checkbox-group
|
||||
v-model="formData.info_cate"
|
||||
placeholder="请选择信息类别"
|
||||
>
|
||||
<el-checkbox
|
||||
v-for="(item, index) in dictData.info_cate"
|
||||
:key="index"
|
||||
:label="item.value"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="信息内容">
|
||||
<el-input
|
||||
v-model="formData.info_content"
|
||||
clearable
|
||||
placeholder="请输入信息内容"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目部意见">
|
||||
<el-input
|
||||
v-model="formData.opinions"
|
||||
clearable
|
||||
placeholder="请输入项目部意见"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="主送人">
|
||||
<el-input
|
||||
v-model="formData.giver"
|
||||
clearable
|
||||
placeholder="请输入主送人"
|
||||
/>
|
||||
</el-form-item>
|
||||
<createUserLable :formData="formData"></createUserLable>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||
<dialogTable @customEvent="customEvent" :config="supervision_project" />
|
||||
|
||||
</el-dialog>
|
||||
</popup>
|
||||
</div>
|
||||
<el-form-item label="附件">
|
||||
<uploadAnnex :formData="formData"></uploadAnnex>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||
<dialogTable @customEvent="customEvent" :config="supervision_project" />
|
||||
</el-dialog>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="supervisionProjectInfoReportEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiSupervisionProjectInfoReportAdd, apiSupervisionProjectInfoReportEdit, apiSupervisionProjectInfoReportDetail } from '@/api/supervision_project_info_report'
|
||||
import { supervision_project } from "@/components/dialogTable/dialogTableConfig"
|
||||
import type { PropType } from 'vue'
|
||||
import type { FormInstance } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import {
|
||||
apiSupervisionProjectInfoReportAdd,
|
||||
apiSupervisionProjectInfoReportEdit,
|
||||
apiSupervisionProjectInfoReportDetail,
|
||||
} from "@/api/supervision_project_info_report";
|
||||
import { supervision_project } from "@/components/dialogTable/dialogTableConfig";
|
||||
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)
|
||||
|
||||
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 popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑工程监理--项目重大信息上报' : '新增工程监理--项目重大信息上报'
|
||||
})
|
||||
return mode.value == "edit"
|
||||
? "编辑工程监理--项目重大信息上报"
|
||||
: "新增工程监理--项目重大信息上报";
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
project_id: '',
|
||||
project_name: "",
|
||||
abstract: '',
|
||||
happen_date: '',
|
||||
severity: '',
|
||||
info_cate: [],
|
||||
info_content: '',
|
||||
opinions: '',
|
||||
giver: '',
|
||||
annex: [],
|
||||
create_user: '',
|
||||
})
|
||||
const checkList = ref([])
|
||||
id: "",
|
||||
project_id: "",
|
||||
project_name: "",
|
||||
abstract: "",
|
||||
happen_date: "",
|
||||
severity: "",
|
||||
info_cate: [],
|
||||
info_content: "",
|
||||
opinions: "",
|
||||
giver: "",
|
||||
annex: [],
|
||||
create_user: "",
|
||||
create_time: "",
|
||||
});
|
||||
|
||||
const handleAvatarSuccess_four = (response: any) => {
|
||||
Array.isArray(formData.annex) ? '' : formData.annex = []
|
||||
// @ts-ignore
|
||||
response.code != 0 ? formData.annex.push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg);
|
||||
};
|
||||
|
||||
// 删除上传的文件
|
||||
const delFileFn = (index: number) => { formData.annex.splice(index, 1) }
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
project_id: [{
|
||||
required: true,
|
||||
message: '请输入项目id',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
abstract: [{
|
||||
required: true,
|
||||
message: '请输入信息摘要',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
happen_date: [{
|
||||
required: true,
|
||||
message: '请输入发生日期',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
severity: [{
|
||||
required: true,
|
||||
message: '请输入严重程度',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
info_content: [{
|
||||
required: true,
|
||||
message: '请输入信息内容',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
opinions: [{
|
||||
required: true,
|
||||
message: '请输入项目部意见',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
giver: [{
|
||||
required: true,
|
||||
message: '请输入主送人',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
create_user: [{
|
||||
required: true,
|
||||
message: '请输入创建人',
|
||||
trigger: ['blur']
|
||||
}]
|
||||
})
|
||||
|
||||
project_id: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入项目id",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
abstract: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入信息摘要",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
happen_date: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入发生日期",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
severity: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入严重程度",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
info_content: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入信息内容",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
opinions: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入项目部意见",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
giver: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入主送人",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
create_user: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入创建人",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const customEvent = (e) => {
|
||||
formData.project_id = e.id
|
||||
formData.project_name = e.project_name
|
||||
showDialog.value = false
|
||||
}
|
||||
|
||||
formData.project_id = e.id;
|
||||
formData.project_name = e.project_name;
|
||||
showDialog.value = false;
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiSupervisionProjectInfoReportDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
const data = await apiSupervisionProjectInfoReportDetail({
|
||||
id: row.id,
|
||||
});
|
||||
setFormData(data);
|
||||
};
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiSupervisionProjectInfoReportEdit(data)
|
||||
: await apiSupervisionProjectInfoReportAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
mode.value == "edit"
|
||||
? await apiSupervisionProjectInfoReportEdit(data)
|
||||
: await apiSupervisionProjectInfoReportAdd(data);
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
});
|
||||
</script>
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user