This commit is contained in:
zmj 2024-04-01 11:12:57 +08:00
parent a290a75ce5
commit 6a19cfd885
39 changed files with 461 additions and 1658 deletions
src
components/detailPage
views
cost_approved_projects
financial_budget_doc
financial_expense_reimbursement
financial_invoice
financial_refund
financial_settlement
financial_using_funds
quality_accident
quality_check
quality_event
quality_mbo
quality_modify
quality_specification
safety_evaluate
safety_hazard
safety_product_month

@ -117,7 +117,6 @@ const open = () => {
//
const handleClose = () => {
emit('close')
console.log("gianni1")
}

@ -352,14 +352,19 @@ const formData = reactive({
"annex": []
})
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 chekcDate = (rule: any, value: any, callback: any) => {
if (new Date(formData.end_date) < new Date(formData.start_date)) {
callback(new Error('合同计划结束日期不能早合同计划开始日期'))
} else {
callback()
}
}
//
const formRules = reactive<any>({
contract_name: [{
@ -386,7 +391,21 @@ const formRules = reactive<any>({
required: true,
message: '请输入签订金额(元)',
trigger: ['blur']
}]
}],
start_date: [{
required: true,
message: '请输入合同计划开始日期',
trigger: ['blur']
}],
end_date: [{
required: true,
message: '请输入合同计划结束日期',
trigger: ['blur']
},
{
validator: chekcDate,
trigger: ['blur']
}],
})

@ -103,7 +103,7 @@
</el-col>
<el-dialog v-model="showDialog" title="选择合同" width="70%">
<dialogTable :config="cost_approved_projects" @customEvent="customEvent">
<dialogTable :config="cost_approved_projects" @customEvent="customEvent" :query="{ status: 2 }">
</dialogTable>
</el-dialog>
</popup>

@ -78,7 +78,7 @@
</el-form>
<el-dialog v-model="showDialog" title="选择合同" width="70%">
<dialogTable :config="cost_approved_projects" @customEvent="customEvent">
<dialogTable :config="cost_approved_projects" @customEvent="customEvent" :query="{ status: 2 }">
</dialogTable>
</el-dialog>
<el-dialog v-model="showDialog1" title="选择费用申请单" width="70%">

@ -119,7 +119,7 @@
</el-row>
</el-form>
<el-dialog v-model="showDialog" title="选择合同" width="70%">
<dialogTable :config="cost_approved_projects" @customEvent="customEvent">
<dialogTable :config="cost_approved_projects" @customEvent="customEvent" :query="{ status: 2 }">
</dialogTable>
</el-dialog>
</popup>

@ -46,7 +46,7 @@
<createUserLable :formData="formData" />
</el-form>
<el-dialog v-model="showDialog" title="选择合同" width="70%">
<dialogTable :config="cost_approved_projects" @customEvent="customEvent">
<dialogTable :config="cost_approved_projects" @customEvent="customEvent" :query="{ status: 2 }">
</dialogTable>
</el-dialog>
<div v-if="showDialog1">

@ -40,7 +40,7 @@
</el-form-item>
</el-form>
<el-dialog v-model="showDialog" title="选择合同" width="70%">
<dialogTable :config="cost_approved_projects" @customEvent="customEvent">
<dialogTable :config="cost_approved_projects" @customEvent="customEvent" :query="{ status: 2 }">
</dialogTable>
</el-dialog>
</popup>

@ -123,7 +123,7 @@
</el-form>
<el-dialog v-model="showDialog" title="选择合同" width="70%">
<dialogTable :config="cost_approved_projects" @customEvent="customEvent">
<dialogTable :config="cost_approved_projects" @customEvent="customEvent" :query="{ status: 2 }">
</dialogTable>
</el-dialog>
</popup>

@ -0,0 +1,67 @@
const detailConfig = {
title: "质量事件表",
config: [
{
label: "组织名称",
value: "org_name"
},
{
label: "部门名称",
value: "dept_name"
},
{
label: "项目名称",
value: "project_name"
},
{
label: "项目编码",
value: "project_code"
},
{
label: "事故类型",
value: "type"
},
{
label: "发生日期",
value: "happen_date"
},
{
label: "设备事故",
value: "device_accident"
},
{
label: "承包商人员",
value: "contractor_user"
},
{
label: "非本企业人员",
value: "not_our_company_user"
},
{
label: "本企业人员",
value: "our_company_user"
},
{
label: "内容",
value: "content"
},
{
label: "承包商人员",
value: "contractor_user"
},
{
label: "备注",
value: "remark",
column: 1
},
{
label: "附件",
value: "file",
column: 1
},
],
}
export default detailConfig;

@ -1,168 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="安全规范详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="12">
<el-form-item label="组织名称">
{{ formData.org_name }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门名称">
{{ formData.dept_name
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范名称">
{{ formData.name
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范类别">
{{ formData.type
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发布部门">
{{ formData.publish_dep
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范附件">
<div>
<div v-for="( item, index ) in formDataannex "
style="margin-left: 5px;display: block;">
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start"
:href="item.uri" target="_blank">{{ item.name }}</a>
<span style="cursor: pointer;margin-left: 5px;"
@click="delFileFn(index)">x</span>
</div>
</div>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
const setFormData = async (data: Record<any, any>) => {
Object.assign(formData, data)
if (data.file && data.file.length > 0) {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

@ -1,8 +1,7 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
@close="handleClose">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
<el-row :gutter="10">
@ -61,12 +60,12 @@
</el-col>
<el-col :span="24">
<el-form-item label="非本企业人员" prop="our_company_user">
<el-input v-model="formData.our_company_user" clearable placeholder="请输入非本企业人员" />
<el-input v-model="formData.not_our_company_user" clearable placeholder="请输入非本企业人员" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="本企业人员" prop="not_our_company_user">
<el-input v-model="formData.not_our_company_user" clearable placeholder="请输入本企业人员" />
<el-input v-model="formData.our_company_user" clearable placeholder="请输入本企业人员" />
</el-form-item>
</el-col>
@ -87,25 +86,7 @@
<el-col :span="24">
<el-form-item label="附件">
<el-upload
accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv"
class="upload-demo" :show-file-list="false" aria-hidden="true"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/file'"
:on-success="handleAvatarSuccess_four" ref="upload">
<el-button type="primary">
上传
</el-button>
</el-upload>
<div>
<div v-for="( item, index ) in formDataannex "
style="margin-left: 5px;display: block;">
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start"
:href="item.uri" target="_blank">{{ item.name }}</a>
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
</div>
</div>
<uploadAnnex :formData="formData" value="file"></uploadAnnex>
</el-form-item>
</el-col>
</el-row>
@ -147,26 +128,7 @@ const project_code = ref('')
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const userInfo = userStore.userInfo
//
const handleAvatarSuccess_four = (
response,
uploadFile
) => {
if (response.code == 0) {
ElMessage.error(response.msg);
return;
}
formDataannex.push(
{ uri: response.data.uri, name: response.data.name }
);
};
//
const delFileFn = (index: number) => {
formDataannex.splice(index, 1)
}
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
@ -237,19 +199,6 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
@ -275,10 +224,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
formData.file = formDataannex.map((item) => item.uri)
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await qualityaccidentEdit(data)

@ -52,21 +52,7 @@
<el-table-column label="本企业人员" prop="our_company_user" show-overflow-tooltip />
<el-table-column label="内容" prop="content" show-overflow-tooltip />
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
<el-table-column label="附件" prop="file" show-overflow-tooltip>
<template #default="{ row }">
<div v-if="row.file && row.file.length > 0">
<div v-for="(item, i) in row.file " :key='i'>
<el-link :href="item" target="_blank">文件{{ i + 1 }}查看</el-link>
</div>
</div>
<div v-else>
暂无文件
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="150" fixed="right">
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button v-perms="['quality.quality_accident/edit']" type="primary" link
@ -78,7 +64,9 @@
删除
</el-button>
<el-button v-perms="['quality.quality_accident/detail']" link @click="handleDetail(row.id)">
详情
</el-button>
</template>
</el-table-column>
</el-table>
@ -88,7 +76,8 @@
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
<detailPage v-if="showDetail" ref="detailRef" @close="showEdit = false" :detailConfig="detailConfig" width="30vw"
:column="1" />
</div>
</template>
@ -101,12 +90,13 @@ import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
import detailConfig from './detail'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = ref('')
//
const showEdit = ref(false)
const showDtail = ref(false)
const showDetail = ref(false)
//
const queryParams = reactive({
@ -157,9 +147,10 @@ const handleDelete = async (id: number | any[]) => {
await qualityaccidentDelete({ id })
getLists()
}
const handledetail = async (data: any) => {
let res = await qualityaccidentDetail({ id: data.id })
showDtail.value = true
//
const handleDetail = async (id: any) => {
let res = await qualityaccidentDetail({ id })
showDetail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)

@ -0,0 +1,57 @@
const detailConfig = {
title: "质量检查表",
config: [
{
label: "组织名称",
value: "org_name"
},
{
label: "部门名称",
value: "dept_name"
},
{
label: "项目名称",
value: "project_name"
},
{
label: "项目编码",
value: "project_code"
},
{
label: "检查性质",
value: "check_nature"
},
{
label: "整改期限",
value: "modify_term"
},
{
label: "检查人",
value: "check_user"
},
{
label: "检查单位",
value: "check_unit"
},
{
label: "责任人",
value: "resp_user"
},
{
label: "检查项",
value: "check_item"
},
{
label: "质量隐患",
value: "quality_hazards"
},
{
label: "检查结果",
value: "check_result"
},
],
}
export default detailConfig;

@ -1,165 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="安全规范详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="12">
<el-form-item label="组织名称">
{{ formData.org_name }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门名称">
{{ formData.dept_name
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范名称">
{{ formData.name
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范类别">
{{ formData.type
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发布部门">
{{ formData.publish_dep
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范附件">
<div>
<div v-for="( item, index ) in formDataannex " style="margin-left: 5px;display: block;">
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri" target="_blank">{{ item.name }}</a>
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
</div>
</div>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
const setFormData = async (data: Record<any, any>) => {
Object.assign(formData, data)
if (data.file && data.file.length > 0) {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

@ -119,17 +119,10 @@ import porjectDialog from '@/components/project/index.vue'
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { qualitycheckAdd, qualitycheckEdit, qualitycheckDetail } from '@/api/quality_check'
import { toChinesNum } from "@/utils/util";
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const list1 = reactive([])
const list2 = reactive([])
@ -138,27 +131,7 @@ const project_name = ref('')
const project_code = ref('')
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const userInfo = userStore.userInfo
//
const handleAvatarSuccess_four = (
response,
uploadFile
) => {
if (response.code == 0) {
ElMessage.error(response.msg);
return;
}
formDataannex.push(
{ uri: response.data.uri, name: response.data.name }
);
};
//
const delFileFn = (index: number) => {
formDataannex.splice(index, 1)
}
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,

@ -51,7 +51,7 @@
<el-table-column label="质量隐患" prop="quality_hazards" show-overflow-tooltip />
<el-table-column label="检查结果" prop="check_result" show-overflow-tooltip />
<el-table-column label="操作" width="150" fixed="right">
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button v-perms="['quality.quality_check/edit']" type="primary" link
@ -62,9 +62,9 @@
@click="handleDelete(row.id)">
删除
</el-button>
<!-- <el-button v-perms="['quality.quality_check/detail']" link @click="handledetail(row)">
<el-button v-perms="['quality.quality_check/detail']" link @click="handleDetail(row.id)">
详情
</el-button> -->
</el-button>
</template>
</el-table-column>
@ -75,7 +75,8 @@
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
<detailPage v-if="showDetail" ref="detailRef" @close="showEdit = false" :detailConfig="detailConfig" width="30vw"
:column="1" />
</div>
</template>
@ -88,12 +89,13 @@ import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
import detailConfig from './detail'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = ref('')
//
const showEdit = ref(false)
const showDtail = ref(false)
const showDetail = ref(false)
//
const queryParams = reactive({
@ -146,9 +148,10 @@ const handleDelete = async (id: number | any[]) => {
await qualitycheckDelete({ id })
getLists()
}
const handledetail = async (data: any) => {
let res = await qualitycheckDetail({ id: data.id })
showDtail.value = true
//
const handleDetail = async (id: any) => {
let res = await qualitycheckDetail({ id })
showDetail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)

@ -0,0 +1,47 @@
const detailConfig = {
title: "质量事件表",
config: [
{
label: "组织名称",
value: "org_name"
},
{
label: "部门名称",
value: "dept_name"
},
{
label: "项目名称",
value: "project_name"
},
{
label: "事件名称",
value: "name"
},
{
label: "事件类型",
value: "type"
},
{
label: "发生时间",
value: "happen_date"
},
{
label: "内容",
value: "content"
},
{
label: "备注",
value: "remark",
column: 1
},
{
label: "附件",
value: "file",
column: 1
},
],
}
export default detailConfig;

@ -1,168 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="安全规范详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="12">
<el-form-item label="组织名称">
{{ formData.org_name }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门名称">
{{ formData.dept_name
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范名称">
{{ formData.name
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范类别">
{{ formData.type
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发布部门">
{{ formData.publish_dep
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范附件">
<div>
<div v-for="( item, index ) in formDataannex "
style="margin-left: 5px;display: block;">
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start"
:href="item.uri" target="_blank">{{ item.name }}</a>
<span style="cursor: pointer;margin-left: 5px;"
@click="delFileFn(index)">x</span>
</div>
</div>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
const setFormData = async (data: Record<any, any>) => {
Object.assign(formData, data)
if (data.file && data.file.length > 0) {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

@ -1,8 +1,7 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
@close="handleClose">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
<el-row :gutter="10">
@ -46,8 +45,8 @@
</el-col>
<el-col :span="24">
<el-form-item label="发生时间" prop="happen_date">
<el-date-picker v-model="formData.happen_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择发生时间" class="flex-1 !flex">
<el-date-picker v-model="formData.happen_date" clearable type="date" value-format="YYYY-MM-DD"
placeholder="选择发生时间" class="flex-1 !flex">
</el-date-picker>
</el-form-item>
</el-col>
@ -62,41 +61,15 @@
<el-input v-model="formData.remark" type="textarea" clearable placeholder="请输入备注" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="附件">
<el-upload
accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv"
class="upload-demo" :show-file-list="false" aria-hidden="true"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/file'"
:on-success="handleAvatarSuccess_four" ref="upload">
<el-button type="primary">
上传
</el-button>
</el-upload>
<div>
<div v-for="( item, index ) in formDataannex "
style="margin-left: 5px;display: block;">
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start"
:href="item.uri" target="_blank">{{ item.name }}</a>
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
</div>
</div>
<uploadAnnex :formData="formData" value="file"></uploadAnnex>
</el-form-item>
</el-col>
</el-row>
<el-dialog v-model="showDialog" title="选择项目" width="70%">
<porjectDialog @customEvent="customEvent"></porjectDialog>
</el-dialog>
</el-form>
</popup>
@ -108,45 +81,14 @@ import porjectDialog from '@/components/project/index.vue'
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { qualityeventAdd, qualityeventEdit, qualityeventDetail } from '@/api/quality_event'
import { toChinesNum } from "@/utils/util";
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const list1 = reactive([])
const list2 = reactive([])
const showDialog = ref(false)
const project_name = ref('')
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const userInfo = userStore.userInfo
//
const handleAvatarSuccess_four = (
response,
uploadFile
) => {
if (response.code == 0) {
ElMessage.error(response.msg);
return;
}
formDataannex.push(
{ uri: response.data.uri, name: response.data.name }
);
};
//
const delFileFn = (index: number) => {
formDataannex.splice(index, 1)
}
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
@ -214,19 +156,6 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
@ -252,10 +181,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
formData.file = formDataannex.map((item) => item.uri)
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await qualityeventEdit(data)

@ -38,27 +38,13 @@
<el-table-column label="序号" type="index" width="55" />
<el-table-column label="组织名称" prop="org_name" show-overflow-tooltip />
<el-table-column label="部门名称" prop="dept_name" show-overflow-tooltip />
<el-table-column label="事件名称" prop="name" show-overflow-tooltip />
<el-table-column label="事件类型" prop="type" show-overflow-tooltip />
<el-table-column label="发生日期" prop="happen_date" show-overflow-tooltip />
<el-table-column label="内容" prop="content" show-overflow-tooltip />
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
<el-table-column label="附件" prop="file" show-overflow-tooltip>
<template #default="{ row }">
<div v-if="row.file && row.file.length > 0">
<div v-for="(item, i) in row.file " :key='i'>
<el-link :href="item" target="_blank">文件{{ i + 1 }}查看</el-link>
</div>
</div>
<div v-else>
暂无文件
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="150" fixed="right">
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button v-perms="['quality.quality_event/edit']" type="primary" link
@ -69,9 +55,9 @@
@click="handleDelete(row.id)">
删除
</el-button>
<!-- <el-button v-perms="['quality.quality_event/detail']" link @click="handledetail(row)">
<el-button v-perms="['quality.quality_event/detail']" link @click="handleDetail(row.id)">
详情
</el-button> -->
</el-button>
</template>
</el-table-column>
@ -82,7 +68,8 @@
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
<detailPage v-if="showDetail" ref="detailRef" @close="showEdit = false" :detailConfig="detailConfig" width="30vw"
:column="1" />
</div>
</template>
@ -90,17 +77,16 @@
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { qualityeventLists, qualityeventDelete, qualityeventDetail } from '@/api/quality_event'
import { timeFormat } from '@/utils/util'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
import detailConfig from './detail'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = ref('')
//
const showEdit = ref(false)
const showDtail = ref(false)
const showDetail = ref(false)
//
const queryParams = reactive({
@ -151,14 +137,14 @@ const handleDelete = async (id: number | any[]) => {
await qualityeventDelete({ id })
getLists()
}
const handledetail = async (data: any) => {
let res = await qualityeventDetail({ id: data.id })
showDtail.value = true
//
const handleDetail = async (id: any) => {
let res = await qualityeventDetail({ id })
showDetail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
getLists()
</script>

@ -0,0 +1,45 @@
const detailConfig = {
title: "质量目标表",
config: [
{
label: "组织名称",
value: "org_name"
},
{
label: "部门名称",
value: "dept_name"
},
{
label: "项目名称",
value: "project_name"
},
{
label: "目标",
value: "target"
},
{
label: "基本要求",
value: "basic_requirements"
},
{
label: "目标规范",
value: "target_specification"
},
{
label: "合格率",
value: "pass_rate"
},
{
label: "允许偏差",
value: "allowable_deviation"
},
{
label: "附件",
value: "file",
column: 1
},
],
}
export default detailConfig;

@ -1,168 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="安全规范详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="12">
<el-form-item label="组织名称">
{{ formData.org_name }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门名称">
{{ formData.dept_name
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范名称">
{{ formData.name
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范类别">
{{ formData.type
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发布部门">
{{ formData.publish_dep
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范附件">
<div>
<div v-for="( item, index ) in formDataannex "
style="margin-left: 5px;display: block;">
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start"
:href="item.uri" target="_blank">{{ item.name }}</a>
<span style="cursor: pointer;margin-left: 5px;"
@click="delFileFn(index)">x</span>
</div>
</div>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
const setFormData = async (data: Record<any, any>) => {
Object.assign(formData, data)
if (data.file && data.file.length > 0) {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

@ -1,8 +1,7 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
@close="handleClose">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
<el-row :gutter="10">
@ -61,30 +60,9 @@
placeholder="请输入允许偏差" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="附件">
<el-upload
accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv"
class="upload-demo" :show-file-list="false" aria-hidden="true"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/file'"
:on-success="handleAvatarSuccess_four" ref="upload">
<el-button type="primary">
上传
</el-button>
</el-upload>
<div>
<div v-for="( item, index ) in formDataannex "
style="margin-left: 5px;display: block;">
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start"
:href="item.uri" target="_blank">{{ item.name }}</a>
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
</div>
</div>
<uploadAnnex :formData="formData" value="file"></uploadAnnex>
</el-form-item>
</el-col>
@ -107,10 +85,7 @@ import porjectDialog from '@/components/project/index.vue'
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { qualitymboAdd, qualitymboEdit, qualitymboDetail } from '@/api/quality_mbo'
import { toChinesNum } from "@/utils/util";
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
@ -125,27 +100,7 @@ const showDialog = ref(false)
const project_name = ref('')
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const userInfo = userStore.userInfo
//
const handleAvatarSuccess_four = (
response,
uploadFile
) => {
if (response.code == 0) {
ElMessage.error(response.msg);
return;
}
formDataannex.push(
{ uri: response.data.uri, name: response.data.name }
);
};
//
const delFileFn = (index: number) => {
formDataannex.splice(index, 1)
}
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
@ -213,19 +168,6 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
@ -248,13 +190,7 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
formData.file = formDataannex.map((item) => item.uri)
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'
? await qualitymboEdit(data)

@ -36,21 +36,7 @@
<el-table-column label="目标规范" prop="target_specification" show-overflow-tooltip />
<el-table-column label="基本要求" prop="basic_requirements" show-overflow-tooltip />
<el-table-column label="允许偏差" prop="allowable_deviation" show-overflow-tooltip />
<el-table-column label="附件" prop="file" show-overflow-tooltip>
<template #default="{ row }">
<div v-if="row.file && row.file.length > 0">
<div v-for="(item, i) in row.file " :key='i'>
<el-link :href="item" target="_blank">文件{{ i + 1 }}查看</el-link>
</div>
</div>
<div v-else>
暂无文件
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="150" fixed="right">
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button v-perms="['quality.quality_mbo/edit']" type="primary" link @click="handleEdit(row)">
@ -60,9 +46,9 @@
@click="handleDelete(row.id)">
删除
</el-button>
<!-- <el-button v-perms="['quality.quality_mbo/detail']" link @click="handledetail(row)">
<el-button v-perms="['quality.quality_mbo/detail']" link @click="handleDetail(row.id)">
详情
</el-button> -->
</el-button>
</template>
</el-table-column>
@ -73,7 +59,8 @@
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
<detailPage v-if="showDetail" ref="detailRef" @close="showEdit = false" :detailConfig="detailConfig" width="30vw"
:column="1" />
</div>
</template>
@ -81,17 +68,17 @@
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { qualitymboLists, qualitymboDelete, qualitymboDetail } from '@/api/quality_mbo'
import { timeFormat } from '@/utils/util'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
import detailConfig from './detail'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = ref('')
//
const showEdit = ref(false)
const showDtail = ref(false)
const showDetail = ref(false)
//
const queryParams = reactive({
@ -139,14 +126,14 @@ const handleDelete = async (id: number | any[]) => {
await qualitymboDelete({ id })
getLists()
}
const handledetail = async (data: any) => {
let res = await qualitymboDetail({ id: data.id })
showDtail.value = true
//
const handleDetail = async (id: any) => {
let res = await qualitymboDetail({ id })
showDetail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
getLists()
</script>

@ -0,0 +1,65 @@
const detailConfig = {
title: "质量整改表",
config: [
{
label: "组织名称",
value: "org_name"
},
{
label: "部门名称",
value: "dept_name"
},
{
label: "项目名称",
value: "project_name"
},
{
label: "项目编码",
value: "project_code"
},
{
label: "检查性质",
value: "check_nature"
},
{
label: "整改期限",
value: "modify_term"
},
{
label: "检查人",
value: "check_user"
},
{
label: "检查单位",
value: "check_unit"
},
{
label: "整改单位",
value: "modify_unit"
},
{
label: "责任人",
value: "resp_user"
},
{
label: "抄送人",
value: "copy_user"
},
{
label: "检查项",
value: "check_item"
},
{
label: "质量隐患",
value: "quality_hazards"
},
{
label: "检查结果",
value: "check_result"
},
],
}
export default detailConfig;

@ -1,168 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="安全规范详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="12">
<el-form-item label="组织名称">
{{ formData.org_name }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门名称">
{{ formData.dept_name
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范名称">
{{ formData.name
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范类别">
{{ formData.type
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发布部门">
{{ formData.publish_dep
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范附件">
<div>
<div v-for="( item, index ) in formDataannex "
style="margin-left: 5px;display: block;">
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start"
:href="item.uri" target="_blank">{{ item.name }}</a>
<span style="cursor: pointer;margin-left: 5px;"
@click="delFileFn(index)">x</span>
</div>
</div>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
const setFormData = async (data: Record<any, any>) => {
Object.assign(formData, data)
if (data.file && data.file.length > 0) {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

@ -123,18 +123,11 @@ import porjectDialog from '@/components/project/index.vue'
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { qualitymodifyAdd, qualitymodifyEdit, qualitymodifyDetail } from '@/api/quality_modify'
import { toChinesNum } from "@/utils/util";
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const list1 = reactive([])
const list2 = reactive([])
const showDialog = ref(false)
@ -142,27 +135,7 @@ const project_name = ref('')
const project_code = ref('')
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const userInfo = userStore.userInfo
//
const handleAvatarSuccess_four = (
response,
uploadFile
) => {
if (response.code == 0) {
ElMessage.error(response.msg);
return;
}
formDataannex.push(
{ uri: response.data.uri, name: response.data.name }
);
};
//
const delFileFn = (index: number) => {
formDataannex.splice(index, 1)
}
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,

@ -55,7 +55,7 @@
<el-table-column label="质量隐患" prop="quality_hazards" show-overflow-tooltip />
<el-table-column label="检查结果" prop="check_result" show-overflow-tooltip />
<el-table-column label="操作" width="150" fixed="right">
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button v-perms="['quality.quality_modify/edit']" type="primary" link
@ -66,9 +66,9 @@
@click="handleDelete(row.id)">
删除
</el-button>
<!-- <el-button v-perms="['quality.quality_modify/detail']" link @click="handledetail(row)">
<el-button v-perms="['quality.quality_modify/detail']" link @click="handleDetail(row.id)">
详情
</el-button> -->
</el-button>
</template>
</el-table-column>
@ -79,7 +79,8 @@
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
<detailPage v-if="showDetail" ref="detailRef" @close="showEdit = false" :detailConfig="detailConfig" width="30vw"
:column="1" />
</div>
</template>
@ -87,18 +88,15 @@
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { qualitymodifyLists, qualitymodifyDelete, qualitymodifyDetail } from '@/api/quality_modify'
import { timeFormat } from '@/utils/util'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
import detailConfig from './detail'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = ref('')
//
const showEdit = ref(false)
const showDtail = ref(false)
const showDetail = ref(false)
//
const queryParams = reactive({
check_nature: '',
@ -150,14 +148,14 @@ const handleDelete = async (id: number | any[]) => {
await qualitymodifyDelete({ id })
getLists()
}
const handledetail = async (data: any) => {
let res = await qualitymodifyDetail({ id: data.id })
showDtail.value = true
//
const handleDetail = async (id: any) => {
let res = await qualitymodifyDetail({ id })
showDetail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
getLists()
</script>

@ -0,0 +1,38 @@
const detailConfig = {
title: "质量规范表",
config: [
{
label: "组织名称",
value: "org_name"
},
{
label: "部门名称",
value: "dept_name"
},
{
label: "规范名称",
value: "name"
},
{
label: "规范类别",
value: "type"
},
{
label: "发布时间",
value: "release_date"
},
{
label: "内容",
value: "content"
},
{
label: "附件",
value: "file",
column: 1
},
],
}
export default detailConfig;

@ -1,168 +0,0 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" title="安全规范详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="160px">
<el-card class="mb-2">
<el-row>
<el-col :span="12">
<el-form-item label="组织名称">
{{ formData.org_name }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门名称">
{{ formData.dept_name
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范名称">
{{ formData.name
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范类别">
{{ formData.type
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发布部门">
{{ formData.publish_dep
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="内容">
{{ formData.content }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规范附件">
<div>
<div v-for="( item, index ) in formDataannex "
style="margin-left: 5px;display: block;">
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start"
:href="item.uri" target="_blank">{{ item.name }}</a>
<span style="cursor: pointer;margin-left: 5px;"
@click="delFileFn(index)">x</span>
</div>
</div>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
const formData = reactive({
})
//
const setFormData = async (data: Record<any, any>) => {
Object.assign(formData, data)
if (data.file && data.file.length > 0) {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCustomDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>
<style lang="scss" scoped>
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
:deep(.my-label) {
width: 150px;
}
</style>

@ -1,8 +1,7 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
@close="handleClose">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
<el-row :gutter="10">
@ -26,9 +25,6 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="规范名称" prop="name">
<el-input v-model="formData.name" clearable placeholder="请输入规范名称" />
@ -47,8 +43,8 @@
</el-col>
<el-col :span="24">
<el-form-item label="发布时间" prop="release_date">
<el-date-picker v-model="formData.release_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择发布时间" class="flex-1 !flex">
<el-date-picker v-model="formData.release_date" clearable type="date" value-format="YYYY-MM-DD"
placeholder="选择发布时间" class="flex-1 !flex">
</el-date-picker>
</el-form-item>
</el-col>
@ -58,35 +54,11 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="附件">
<el-upload
accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv"
class="upload-demo" :show-file-list="false" aria-hidden="true"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/file'"
:on-success="handleAvatarSuccess_four" ref="upload">
<el-button type="primary">
上传
</el-button>
</el-upload>
<div>
<div v-for="( item, index ) in formDataannex "
style="margin-left: 5px;display: block;">
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start"
:href="item.uri" target="_blank">{{ item.name }}</a>
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
</div>
</div>
<upload-annex :form-data="formData" value="file"></upload-annex>
</el-form-item>
</el-col>
</el-row>
</el-form>
</popup>
@ -98,43 +70,16 @@
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { qualityspecificationAdd, qualityspecificationEdit, qualityspecificationDetail } from '@/api/quality_specification'
import { toChinesNum } from "@/utils/util";
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const list1 = reactive([])
const list2 = reactive([])
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const userInfo = userStore.userInfo
//
const handleAvatarSuccess_four = (
response,
uploadFile
) => {
if (response.code == 0) {
ElMessage.error(response.msg);
return;
}
formDataannex.push(
{ uri: response.data.uri, name: response.data.name }
);
};
//
const delFileFn = (index: number) => {
formDataannex.splice(index, 1)
}
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
@ -195,19 +140,6 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
@ -232,7 +164,6 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
formData.file = formDataannex.map((item) => item.uri)
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'

@ -41,21 +41,7 @@
<el-table-column label="发布部门" prop="release_dept" show-overflow-tooltip />
<el-table-column label="发布时间" prop="release_date" show-overflow-tooltip />
<el-table-column label="内容" prop="content" show-overflow-tooltip />
<el-table-column label="规范附件" prop="file" show-overflow-tooltip>
<template #default="{ row }">
<div v-if="row.file && row.file.length > 0">
<div v-for="(item, i) in row.file " :key='i'>
<el-link :href="item" target="_blank">文件{{ i + 1 }}查看</el-link>
</div>
</div>
<div v-else>
暂无文件
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="150" fixed="right">
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button v-perms="['quality.quality_specification/edit']" type="primary" link
@ -66,9 +52,10 @@
@click="handleDelete(row.id)">
删除
</el-button>
<!-- <el-button v-perms="['quality.quality_specification/detail']" link @click="handledetail(row)">
<el-button v-perms="['quality.quality_specification/detail']" link
@click="handleDetail(row.id)">
详情
</el-button> -->
</el-button>
</template>
</el-table-column>
@ -79,7 +66,8 @@
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
<detailPage v-if="showDetail" ref="detailRef" @close="showEdit = false" :detailConfig="detailConfig" width="30vw"
:column="1" />
</div>
</template>
@ -87,17 +75,16 @@
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { qualityspecificationLists, qualityspecificationDelete, qualityspecificationDetail } from '@/api/quality_specification'
import { timeFormat } from '@/utils/util'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
import detailConfig from './detail'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = ref('')
//
const showEdit = ref(false)
const showDtail = ref(false)
const showDetail = ref(false)
//
const queryParams = reactive({
@ -148,14 +135,14 @@ const handleDelete = async (id: number | any[]) => {
await qualityspecificationDelete({ id })
getLists()
}
const handledetail = async (data: any) => {
let res = await qualityspecificationDetail({ id: data.id })
showDtail.value = true
//
const handleDetail = async (id: any) => {
let res = await qualityspecificationDetail({ id })
showDetail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
getLists()
</script>

@ -74,18 +74,7 @@ import porjectDialog from '@/components/project/index.vue'
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { safetyevaluateAdd, safetyevaluateEdit, safetyevaluateDetail } from '@/api/safety_evaluate'
import { toChinesNum } from "@/utils/util";
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const list1 = reactive([])
const list2 = reactive([])
const showDialog = ref(false)
@ -93,27 +82,7 @@ const project_name = ref('')
const project_code = ref('')
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const userInfo = userStore.userInfo
//
const handleAvatarSuccess_four = (
response,
uploadFile
) => {
if (response.code == 0) {
ElMessage.error(response.msg);
return;
}
formDataannex.push(
{ uri: response.data.uri, name: response.data.name }
);
};
//
const delFileFn = (index: number) => {
formDataannex.splice(index, 1)
}
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
@ -180,13 +149,6 @@ const formRules = reactive<any>({
//
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]
}
}
project_name.value = data.project_name
project_code.value = data.project_code
getlist1(formData.org_id)

@ -51,12 +51,13 @@
<el-descriptions-item label="应急措施" label-align="left" align="left" label-class-name="my-label">
{{ formData.emergency_measure }}
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="1" border>
<el-descriptions-item label="备注" label-align="left" align="left" label-class-name="my-label">
{{ formData.remark }}
</el-descriptions-item>
<el-descriptions-item label="附件" label-align="left" align="left" label-class-name="my-label">
<el-link type="primary" v-for="(item, index) in formData.file" :key="index" :href="item"
target="_blank"> 文件{{ index + 1 }}</el-link>
<annexLink :annex="formData.file"></annexLink>
</el-descriptions-item>
</el-descriptions>
</popup>

@ -113,24 +113,7 @@
<el-col :span="24">
<el-form-item label="附件">
<el-upload
accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv"
class="upload-demo" :show-file-list="false" aria-hidden="true"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/file'"
:on-success="handleAvatarSuccess_four" ref="upload">
<el-button type="primary">
上传
</el-button>
</el-upload>
<div>
<div v-for="( item, index ) in formDataannex " style="margin-left: 5px;display: block;">
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri"
target="_blank">{{ item.name }}</a>
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
</div>
</div>
<upload-annex :form-data="formData" value="file"></upload-annex>
</el-form-item>
</el-col>
</el-row>
@ -152,17 +135,10 @@ import porjectDialog from '@/components/project/index.vue'
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { safetyhazardAdd, safetyhazardEdit, safetyhazardDetail } from '@/api/safety_hazard'
import { toChinesNum } from "@/utils/util";
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const list1 = reactive([])
const list2 = reactive([])
@ -171,27 +147,7 @@ const project_name = ref('')
const project_code = ref('')
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const userInfo = userStore.userInfo
//
const handleAvatarSuccess_four = (
response,
uploadFile
) => {
if (response.code == 0) {
ElMessage.error(response.msg);
return;
}
formDataannex.push(
{ uri: response.data.uri, name: response.data.name }
);
};
//
const delFileFn = (index: number) => {
formDataannex.splice(index, 1)
}
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
@ -249,12 +205,9 @@ const formData = reactive({
control_level: '',
risk_level: '',
accident: '',
source: '',
build_company_user: '',
supervision_company_user: '',
construction_company_user: '',
fill_company: '',
project_id: '',
@ -272,19 +225,6 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
@ -307,7 +247,6 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
formData.file = formDataannex.map((item) => item.uri)
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'

@ -65,7 +65,7 @@
<el-table-column label="技术措施" prop="technical_measure" show-overflow-tooltip />
<el-table-column label="管理措施" prop="manage_measure" show-overflow-tooltip />
<el-table-column label="应急措施" prop="emergency_measure" show-overflow-tooltip />
<el-table-column label="操作" width="150" fixed="right">
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button v-perms="['safety.safety_hazard/edit']" type="primary" link @click="handleEdit(row)">

@ -37,8 +37,7 @@
{{ formData.item }}
</el-descriptions-item>
<el-descriptions-item label="附件" label-align="left" align="left" label-class-name="my-label">
<el-link type="primary" v-for="(item, index) in formData.file" :key="index" :href="item"
target="_blank"> 文件{{ index + 1 }}</el-link>
<annexLink :annex="formData.file"></annexLink>
</el-descriptions-item>
</el-descriptions>
</popup>

@ -76,36 +76,14 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="附件">
<el-upload
accept="doc, docx, xls, xlsx, ppt, pptx, pdf, txt, zip, rar, tar, jpg, png, gif, jpeg, webp, wmv, avi, mpg, mpeg, 3gp, mov, mp4, flv, f4v, rmvb, mkv"
class="upload-demo" :show-file-list="false" aria-hidden="true"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/file'"
:on-success="handleAvatarSuccess_four" ref="upload">
<el-button type="primary">
上传
</el-button>
</el-upload>
<div>
<div v-for="( item, index ) in formDataannex " style="margin-left: 5px;display: block;">
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri"
target="_blank">{{ item.name }}</a>
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
</div>
</div>
<upload-annex :form-data="formData" value="file"></upload-annex>
</el-form-item>
</el-col>
</el-row>
<el-dialog v-model="showDialog" title="选择项目" width="70%">
<porjectDialog @customEvent="customEvent"></porjectDialog>
</el-dialog>
</el-form>
</popup>
@ -117,18 +95,7 @@ import porjectDialog from '@/components/project/index.vue'
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { safetyproductmonthAdd, safetyproductmonthEdit, safetyproductmonthDetail } from '@/api/safety_product_month'
import { toChinesNum } from "@/utils/util";
import { getAllProjectTypes } from '@/api/projecttype'
import { timeFormat } from '@/utils/util'
import { isEmail, isIdCard, isPhone } from '@/utils/validate'
import type { PropType } from 'vue'
import configs from "@/config"
import useUserStore from "@/stores/modules/user";
const protype = reactive([])
const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
const active = ref(0)
const formDataannex = reactive([])
const list1 = reactive([])
const list2 = reactive([])
const showDialog = ref(false)
@ -136,27 +103,7 @@ const project_name = ref('')
const project_code = ref('')
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
const userInfo = userStore.userInfo
//
const handleAvatarSuccess_four = (
response,
uploadFile
) => {
if (response.code == 0) {
ElMessage.error(response.msg);
return;
}
formDataannex.push(
{ uri: response.data.uri, name: response.data.name }
);
};
//
const delFileFn = (index: number) => {
formDataannex.splice(index, 1)
}
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
@ -228,19 +175,6 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
if (data.file && data.file.length > 0) {
const arry1 = data.file.map((item: any, index: any) => {
return {
name: `文件${index + 1}`,
uri: item
};
});
Object.assign(formDataannex, arry1)
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
@ -265,7 +199,6 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
formData.file = formDataannex.map((item) => item.uri)
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit'

@ -42,7 +42,7 @@
<el-table-column label="本月重点工作" width="155" prop="current_important_work" show-overflow-tooltip />
<el-table-column label="下一阶段重点工作计划" width="165" prop="next_important_work" show-overflow-tooltip />
<el-table-column label="需报告说明或协调的事项" width="185" prop="item" show-overflow-tooltip />
<el-table-column label="操作" width="150" fixed="right">
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button v-perms="['safety.safety_product_month/edit']" type="primary" link
@click="handleEdit(row)">