This commit is contained in:
zmj 2024-03-16 11:59:12 +08:00
parent 952136d33d
commit ac2f9cdc83
19 changed files with 654 additions and 1283 deletions

View File

@ -4,7 +4,7 @@
</div>
<div>
<el-table :data="formData">
<el-table-column label="操作">
<el-table-column label="操作" v-if="config?.deleteApi">
<template #default="{ row }">
<el-button @click="handleAdd">+</el-button>
<el-button @click="handleDelete(row)">-</el-button>
@ -14,9 +14,14 @@
:prop="item[value]">
<template #default="{ row }">
<el-select v-model="row[item.value]" v-if="item.select">
<el-option v-for="items in item.select" :label="items.label" :value="items.value"></el-option>
<el-option v-for="items in (Array.isArray(item.select) ? item.select : dictData[item.select])"
:label="items.name" :value="items.value"></el-option>
</el-select>
<el-date-picker class="flex-1 !flex" v-model="row[item.value]" clearable value-format="YYYY-MM-DD"
placeholder="请选择日期" v-else-if="item.date">
</el-date-picker>
<el-input v-model="row[item.value]" v-else />
</template>
</el-table-column>
@ -28,7 +33,20 @@
</template>
<script lang="ts" setup>
import { defineProps } from "vue"
import { useDictData } from '@/hooks/useDictOptions'
/** config
*
* title: 标题
* tableConfig: 表格的table-column的每一项
* [{
* label:表头名称
* value:
* select:是否为下拉选择框不填默认为文本框为String类型时表示为字典option为Array类型表示自定义option
* date:是否为日期选择框
* }]
* deleteApi:删除列表每行所需要的api,不填默认为禁止对列表的添加/除操作
*/
const props = defineProps({
formData: {
type: Object,
@ -40,6 +58,11 @@ const props = defineProps({
}
})
//
const dictValue = props.config.tableConfig.map(item => Array.isArray(item.select) ? null : item.select).filter(item => item).join(',')
const { dictData } = useDictData(dictValue)
// table
const list = props.config.tableConfig.map(item => item.value)
const getInitialData = () => {
@ -56,7 +79,7 @@ const handleAdd = () => {
const handleDelete = async (row: any) => {
if (row.id) {
if (row.id && props?.config?.deleteApi) {
await props.config.deleteApi({ id: row.id });
}
const index = props.formData.indexOf(row);

View File

@ -131,71 +131,8 @@
</el-col>
</el-row>
</el-form>
<div>
项目组工作开展情况
<el-button @click="handleAdd()" v-if="!formData.evolve.length">+</el-button>
</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.evolve">
<el-table-column label="序号" width="150px">
<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="scope">
<el-input v-model="scope.row.name" />
</template>
</el-table-column>
<el-table-column label="进展状态" prop="progress_status">
<template #default="{ row }">
<el-input v-model="row.progress_status" />
</template>
</el-table-column>
<el-table-column label="项目组跟踪责任人" prop="resp_user">
<template #default="{ row }">
<el-input v-model="row.resp_user" />
</template>
</el-table-column>
</el-table>
</div>
<div>
项目组后勤准备工作
<el-button @click="handleAdd1" v-if="!formData.preparation.length">+</el-button>
</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.preparation">
<el-table-column label="序号" width="150px">
<template #default="{ row }">
<el-button @click="handleAdd1">+</el-button>
<el-button @click="handleDelete1(row)">-</el-button>
</template>
</el-table-column>
<el-table-column label="名称" prop="name">
<template #default="scope">
<el-input v-model="scope.row.name" />
</template>
</el-table-column>
<el-table-column label="进展状态" prop="progress_status">
<template #default="{ row }">
<el-input v-model="row.progress_status" />
</template>
</el-table-column>
<el-table-column label="项目组跟踪责任人" prop="resp_user">
<template #default="{ row }">
<el-input v-model="row.resp_user" />
</template>
</el-table-column>
</el-table>
</div>
<formTable :formData="formData.evolve" :config="tableConfig"></formTable>
<formTable :formData="formData.preparation" :config="tableConfig1"></formTable>
<el-dialog v-model="showDialog" title="选择项目" width="70%">
<dialogTable @customEvent="customEvent" :config="consult_project" />
</el-dialog>
@ -209,16 +146,11 @@ import Popup from '@/components/popup/index.vue'
import { apiConsultNewStartProjectAdd, apiConsultNewStartProjectEdit, apiConsultNewStartProjectDetail, apiconsult_project_evolve, apiconsult_project_evolve_delete, apiconsult_project_preparation, apiconsult_project_preparation_delete } from '@/api/consult_new_start_project'
import type { PropType } from 'vue'
import { consult_project } from "@/components/dialogTable/dialogTableConfig"
import { timeFormat } from '@/utils/util'
import useUserStore from "@/stores/modules/user";
const userStore = useUserStore().userInfo;
const showDialog = ref(false)
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
@ -283,39 +215,52 @@ const formData = reactive({
})
const tableConfig = reactive(
{
title: "项目组工作开展情况",
tableConfig: [
{
label: "名称",
value: 'name',
const handleAdd = () => {
formData.evolve.push({
"name": "",
"progress_status": "",
"resp_user": ""
})
}
},
{
label: "进展状态",
value: 'progress_status'
},
{
label: "项目组跟踪责任人",
value: 'resp_user',
},
const handleDelete = async (row: any) => {
if (row.id) {
await apiconsult_project_evolve_delete({ id: row.id })
],
deleteApi: apiconsult_project_evolve_delete,
}
const index = formData.evolve.indexOf(row);
formData.evolve.splice(index, 1);
}
const handleAdd1 = () => {
formData.preparation.push({
"name": "",
"progress_status": "",
"resp_user": ""
})
}
)
const tableConfig1 = reactive(
{
title: "项目组后勤准备工作",
tableConfig: [
{
label: "名称",
value: 'name',
const handleDelete1 = async (row: any) => {
if (row.id) {
await apiconsult_project_preparation_delete({ id: row.id })
},
{
label: "进展状态",
value: 'progress_status'
},
{
label: "项目组跟踪责任人",
value: 'resp_user',
},
],
deleteApi: apiconsult_project_preparation_delete,
}
const index = formData.preparation.indexOf(row);
formData.preparation.splice(index, 1);
}
)
const customEvent = (e: any) => {
formData.project_id = e.id
@ -327,7 +272,7 @@ const customEvent = (e: any) => {
const formRules = reactive<any>({
project_id: [{
required: true,
message: '请输入项目id',
message: '请选择项目',
trigger: ['blur']
}],
address: [{

View File

@ -43,50 +43,8 @@
<el-dialog v-model="showDialog" title="选择项目" width="70%">
<dialogTable @customEvent="customEvent" :config="manage_project" />
</el-dialog>
<div style="margin-bottom: 30px;">联系人</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.contacts">
<el-table-column label="序号" width="150px">
<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>
<formTable :formData="formData.contacts" :config="tableConfig"></formTable>
<!-- manage_project -->
</popup>
</div>
</template>
@ -95,7 +53,6 @@
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiManageCompanyAdd, apiManageCompanyEdit, apiManageCompanyDetail, apimanage_company_contacts, apimanage_company_contacts_delete } from '@/api/manage_company'
import { timeFormat } from '@/utils/util'
import { manage_project } from "@/components/dialogTable/dialogTableConfig"
import type { PropType } from 'vue'
defineProps({
@ -126,39 +83,45 @@ const formData = reactive({
qualification_grade: '',
telephone: '',
duty: '',
contacts: [
{
"name": "",
"duties": "",
"telephone": "",
"mobile": "",
"email": "",
"fax": ""
}
]
contacts: []
})
const handleAdd = () => {
formData.contacts.push({
"name": "",
"duties": "",
"telephone": "",
"mobile": "",
"email": "",
"fax": ""
})
}
const handleDelete = async (row: any) => {
if (row.id) {
await apimanage_company_contacts_delete({ id: row.id })
const index = formData.contacts.indexOf(row);
formData.contacts.splice(index, 1);
} else {
const index = formData.contacts.indexOf(row);
formData.contacts.splice(index, 1);
const tableConfig = reactive(
{
title: "联系人",
tableConfig: [
{
label: "姓名",
value: 'name',
},
{
label: "职务",
value: 'duties'
},
{
label: "办公电话",
value: 'telephone',
},
{
label: "手机号码",
value: 'mobile',
},
{
label: "电子邮箱",
value: 'email',
},
{
label: "传真",
value: 'fax',
},
],
deleteApi: apimanage_company_contacts_delete,
}
}
)
const customEvent = (e: any) => {
formData.project_id = e.id

View File

@ -105,89 +105,9 @@
</el-dialog>
</div>
</el-form>
<formTable :formData="formData.accept_check_result" :config="tableConfig"></formTable>
<formTable :formData="formData.accept_check_problem" :config="tableConfig1"></formTable>
<div style="margin-bottom: 30px;">巡视结果</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.accept_check_result">
<el-table-column label="序号" width="150px">
<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="check_type">
<template #default="scope">
<el-input v-model="scope.row.check_type" />
</template>
</el-table-column>
<el-table-column label="问题" prop="check_problem">
<template #default="scope">
<el-input v-model="scope.row.check_problem" />
</template>
</el-table-column>
<el-table-column label="检查类容" prop="check_content">
<template #default="{ row }">
<el-input v-model="row.check_content" />
</template>
</el-table-column>
<el-table-column label="是否必检" prop="must_check">
<template #default="{ row }">
<el-select class="flex-1" v-model="row.must_check" clearable placeholder="请选择">
<el-option label="否" :value="parseInt(0)" />
<el-option label="是" :value="parseInt(1)" />
</el-select>
</template>
</el-table-column>
<el-table-column label="检查结果" prop="must_check">
<template #default="{ row }">
<el-select class="flex-1" v-model="row.check_result" clearable placeholder="请选择">
<el-option label="合格" :value="parseInt(0)" />
<el-option label="不合格" :value="parseInt(1)" />
</el-select>
</template>
</el-table-column>
</el-table>
</div>
<div style="margin-bottom: 30px;">巡视问题</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.accept_check_problem">
<el-table-column label="序号" width="150px">
<template #default="{ row }">
<el-button @click="handleAdd1()">+</el-button>
<el-button @click="handleDelete1(row)">-</el-button>
</template>
</el-table-column>
<el-table-column label="问题分类" prop="problem_cate">
<template #default="scope">
<el-select class="flex-1" v-model="scope.row.problem_cate" clearable placeholder="请输入问题分类">
<el-option v-for="( item, index ) in dictData.problem_cate " :key="index"
:label="item.name" :value="item.value" />
</el-select>
</template>
</el-table-column>
<el-table-column label="问题说明" prop="check_content">
<template #default="{ row }">
<el-input v-model="row.problem_description" />
</template>
</el-table-column>
<el-table-column label="问题名称" prop="must_check">
<template #default="{ row }">
<el-input v-model="row.problem_name" />
</template>
</el-table-column>
</el-table>
</div>
</popup>
</div>
</template>
@ -195,7 +115,7 @@
<script lang="ts" setup name="supervisionInspectionEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apisupervision_inspection_result_delete, apisupervision_problem_delete, apiSupervisionInspectionDetail, apisupervision_problem } from '@/api/supervision_inspection'
import { apisupervision_problem_delete, apiSupervisionInspectionDetail, apisupervision_problem } from '@/api/supervision_inspection'
import { apisupervision_check_item_detailLists } from '@/api/supervision_check_item'
import { apiSupervisionAcceptAdd, apiSupervisionAcceptEdit, apisupervision_accept_result, apisupervision_accept_result_delete } from '@/api/supervision_accept'
import type { PropType } from 'vue'
@ -214,7 +134,6 @@ const mode = ref('add')
const showDialog = ref(false)
const showDialog1 = ref(false)
const showDialog2 = ref(false)
const showDialog3 = ref(false)
const flag = ref(false)
@ -222,57 +141,6 @@ const flag = 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) }
const handleAdd = () => {
formData.accept_check_result.push({
"check_type": "",
"check_content": "",
"must_check": 0,
"check_result": 0
})
}
const handleDelete = async (row: any) => {
if (formData.accept_check_result.length == 1) return
if (row.id) {
await apisupervision_accept_result_delete({ id: row.id })
const index = formData.accept_check_result.indexOf(row);
formData.accept_check_result.splice(index, 1);
} else {
const index = formData.accept_check_result.indexOf(row);
formData.accept_check_result.splice(index, 1);
}
}
const handleAdd1 = () => {
formData.accept_check_result.push({
"problem_cate": "",
"problem_description": "",
"problem_name": ""
})
}
const handleDelete1 = async (row: any) => {
if (formData.accept_check_problem.length == 1) return
if (row.id) {
await apisupervision_problem_delete({ id: row.id })
const index = formData.accept_check_problem.indexOf(row);
formData.accept_check_problem.splice(index, 1);
} else {
const index = formData.accept_check_problem.indexOf(row);
formData.accept_check_problem.splice(index, 1);
}
}
//
@ -286,7 +154,7 @@ const formData = reactive({
accept_time: '',
company_id: '',
accept_result: '',
check_item_detail_ids: '',
check_item_detail_ids: [],
remark: '',
create_user: "",
create_time: "",
@ -296,19 +164,89 @@ const formData = reactive({
id: '',
project_name: '',
annex: [],
accept_check_result: [{
"check_type": "",
"check_content": "",
check_problem: "",
"must_check": 0,
"check_result": 0
},],
accept_check_problem: [{
"problem_cate": "",
"problem_description": "",
"problem_name": ""
}]
accept_check_result: [],
accept_check_problem: []
})
const tableConfig = reactive(
{
title: "巡视结果",
tableConfig: [
{
label: "检查类别",
value: 'check_type'
},
{
label: "问题",
value: 'check_problem'
},
{
label: "检查类容",
value: 'check_content'
},
{
label: "是否必检",
value: 'must_check',
select: [
{
name: "否",
value: 0
},
{
name: "是",
value: 1
}
]
},
{
label: "检查结果",
value: 'check_result',
select: [
{
name: "合格",
value: 0
},
{
name: "不合格",
value: 1
}
]
},
],
deleteApi: apisupervision_accept_result_delete,
}
)
const tableConfig1 = reactive(
{
title: "巡视问题",
tableConfig: [
{
label: "问题分类",
value: 'problem_cate',
select: 'problem_cate'
},
{
label: "问题说明",
value: 'problem_description'
},
{
label: "问题名称",
value: 'problem_name',
},
],
deleteApi: apisupervision_problem_delete,
}
)
const customEvent = (e) => {
formData.project_id = e.id
formData.project_name = e.project_name
@ -317,12 +255,7 @@ const customEvent = (e) => {
formData.company_id = ''
formData.check_item_detail_ids = []
formData.check_item_detail_name = ''
formData.accept_check_result = [{
"check_type": "",
"check_content": "",
"must_check": 0,
"check_result": 0
},]
formData.accept_check_result = []
}
const customEvents = (e) => {

View File

@ -136,11 +136,11 @@ const tableConfig = reactive(
value: 'must_check',
select: [
{
label: '否',
name: '否',
value: 0
},
{
label: '是',
name: '是',
value: 1
}
]

View File

@ -67,6 +67,10 @@
<div style="margin-bottom: 30px;">设备信息</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.entry_detail">
<template #empty>
<span class="cursor-pointer">暂无数据点击添加 <el-button @click="handleAdd">+</el-button></span>
</template>
<el-table-column label="序号" width="150px">
<template #default="{ row }">
<el-button @click="handleAdd()">+</el-button>
@ -132,41 +136,8 @@
</el-table-column>
</el-table>
</div>
<div style="margin-bottom: 30px;">问题</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.entry_problem">
<el-table-column label="序号" width="150px">
<formTable :formData="formData.entry_problem" :config="tableConfig"></formTable>
<template #default="{ row }">
<el-button @click="handleAdd1()">+</el-button>
<el-button @click="handleDelete1(row)">-</el-button>
</template>
</el-table-column>
<el-table-column label="问题分类" prop="problem_cate">
<template #default="scope">
{{ typeof (scope.row.problem_cate) }}
<el-select class="flex-1" v-model="scope.row.problem_cate" clearable placeholder="请输入问题分类">
<el-option v-for="( item, index ) in dictData.problem_cate" :key="index"
:label="item.name" :value="item.value" />
</el-select>
</template>
</el-table-column>
<el-table-column label="问题说明" prop="check_content">
<template #default="{ row }">
<el-input v-model="row.problem_description" />
</template>
</el-table-column>
<el-table-column label="问题名称" prop="problem_name">
<template #default="{ row }">
<el-input v-model="row.problem_name" />
</template>
</el-table-column>
</el-table>
</div>
</popup>
</div>
</template>
@ -215,23 +186,35 @@ const formData = reactive({
remark: '',
create_user: "",
create_time: "",
entry_detail: [{
"name": "",
"brand": "",
"model": "",
"unit": "",
"contract_brand": 0,
"entry_number": 0,
"documentation": 0,
"verify": 0
}],
entry_problem: [{
"problem_cate": '',
"problem_description": "",
"problem_name": ""
}]
entry_detail: [],
entry_problem: []
})
const tableConfig = reactive(
{
title: "问题",
tableConfig: [
{
label: "问题分类",
value: 'problem_cate',
select: 'problem_cate'
},
{
label: "问题说明",
value: 'problem_description'
},
{
label: "问题名称",
value: 'problem_name',
},
],
deleteApi: apisupervision_problem_delete,
}
)
const handleAdd = () => {
formData.entry_detail.push({
"name": "",
@ -255,23 +238,6 @@ const handleDelete = async (row: any) => {
}
}
const handleAdd1 = () => {
formData.entry_problem.push({
"problem_cate": '',
"problem_description": "",
"problem_name": ""
})
}
const handleDelete1 = async (row: any) => {
if (row.id) {
await apisupervision_problem_delete({ id: row.id })
const index = formData.entry_problem.indexOf(row);
formData.entry_problem.splice(index, 1);
} else {
const index = formData.entry_problem.indexOf(row);
formData.entry_problem.splice(index, 1);
}
}
const customEvent = (e) => {

View File

@ -1,7 +1,6 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit"
@close="handleClose">
<popup ref="popupRef" :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">
@ -77,40 +76,7 @@
:query="{ project_id: formData.project_id, node_type: 2 }"></dialogTable>
</el-dialog>
</div>
<div style="margin-bottom: 30px;">问题</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.problem">
<el-table-column label="序号" width="150px">
<template #default="{ row }">
<el-button @click="handleAdd1()">+</el-button>
<el-button @click="handleDelete1(row)">-</el-button>
</template>
</el-table-column>
<el-table-column label="问题分类" prop="problem_cate">
<template #default="scope">
<el-select class="flex-1" v-model="scope.row.problem_cate" clearable
placeholder="请输入问题分类">
<el-option v-for="( item, index ) in dictData.problem_cate" :key="index"
:label="item.name" :value="item.value" />
</el-select>
</template>
</el-table-column>
<el-table-column label="问题说明" prop="check_content">
<template #default="{ row }">
<el-input v-model="row.problem_description" />
</template>
</el-table-column>
<el-table-column label="问题名称" prop="problem_name">
<template #default="{ row }">
<el-input v-model="row.problem_name" />
</template>
</el-table-column>
</el-table>
</div>
<formTable :formData="formData.problem" :config="tableConfig"></formTable>
</el-form>
</popup>
</div>
@ -135,18 +101,7 @@ const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
const showDialog = ref(false)
const showDialog2 = ref(false)
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 popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑工程监理--实体平行检验' : '新增工程监理--实体平行检验'
})
//
const formData = reactive({
@ -165,12 +120,34 @@ const formData = reactive({
annex: [],
create_user: "",
create_time: "",
problem: [{
"problem_cate": '',
"problem_description": "",
"problem_name": ""
}]
problem: []
})
const tableConfig = reactive(
{
title: "问题",
tableConfig: [
{
label: "问题分类",
value: 'problem_cate',
select: 'problem_cate'
},
{
label: "问题说明",
value: 'problem_description'
},
{
label: "问题名称",
value: 'problem_name',
},
],
deleteApi: apisupervision_problem_delete,
}
)
const customEvent = (e) => {
formData.project_id = e.id
formData.project_name = e.project_name
@ -186,25 +163,6 @@ const customEvent1 = (e) => {
}
const handleAdd1 = () => {
formData.problem.push({
"problem_cate": '',
"problem_description": "",
"problem_name": ""
})
}
const handleDelete1 = async (row: any) => {
if (row.id) {
await apisupervision_problem_delete({ id: row.id })
const index = formData.problem.indexOf(row);
formData.problem.splice(index, 1);
} else {
const index = formData.problem.indexOf(row);
formData.problem.splice(index, 1);
}
}
//
const formRules = reactive<any>({
project_id: [{

View File

@ -130,43 +130,7 @@
</div>
</el-form>
<formTable :formData="formData.inspection_result" :config="tableConfig"></formTable>
<div>
巡视问题
<el-button @click="handleAdd1()" v-if="!formData.inspection_problem.length">+</el-button>
</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.inspection_problem">
<el-table-column label="序号" width="150px">
<template #default="{ row }">
<el-button @click="handleAdd1()">+</el-button>
<el-button @click="handleDelete1(row)">-</el-button>
</template>
</el-table-column>
<el-table-column label="问题分类" prop="problem_cate">
<template #default="scope">
<el-select class="flex-1" v-model="scope.row.problem_cate" clearable placeholder="请输入问题分类">
<el-option v-for="( item, index ) in dictData.problem_cate" :key="index"
:label="item.name" :value="item.value" />
</el-select>
</template>
</el-table-column>
<el-table-column label="问题说明" prop="check_content">
<template #default="{ row }">
<el-input v-model="row.problem_description" />
</template>
</el-table-column>
<el-table-column label="问题名称" prop="must_check">
<template #default="{ row }">
<el-input v-model="row.problem_name" />
</template>
</el-table-column>
</el-table>
</div>
<formTable :formData="formData.inspection_problem" :config="tableConfig1"></formTable>
</popup>
</div>
</template>
@ -220,11 +184,11 @@ const tableConfig = reactive(
value: 'must_check',
select: [
{
label: "否",
name: "否",
value: 0
},
{
label: "是",
name: "是",
value: 1
}
]
@ -234,11 +198,11 @@ const tableConfig = reactive(
value: 'check_result',
select: [
{
label: "合格",
name: "合格",
value: 0
},
{
label: "不合格",
name: "不合格",
value: 1
}
]
@ -249,26 +213,29 @@ const tableConfig = reactive(
}
)
const tableConfig1 = reactive(
{
title: "巡视问题",
tableConfig: [
{
label: "问题分类",
value: 'problem_cate',
select: 'problem_cate'
const handleAdd1 = () => {
formData.inspection_problem.push({
"problem_cate": "",
"problem_description": "",
"problem_name": ""
})
}
},
{
label: "问题说明",
value: 'problem_description'
},
{
label: "问题名称",
value: 'problem_name',
},
const handleDelete1 = async (row: any) => {
if (row.id) {
await apisupervision_problem_delete({ id: row.id })
const index = formData.inspection_problem.indexOf(row);
formData.inspection_problem.splice(index, 1);
} else {
const index = formData.inspection_problem.indexOf(row);
formData.inspection_problem.splice(index, 1);
],
deleteApi: apisupervision_problem_delete,
}
}
)
//
@ -296,17 +263,8 @@ const formData = reactive({
check_item_detail_name: '',
annex: [],
create_user: '',
inspection_result: [{
"check_type": "",
"check_content": "",
"must_check": 0,
"check_result": 0
},],
inspection_problem: [{
"problem_cate": "",
"problem_description": "",
"problem_name": ""
}]
inspection_result: [],
inspection_problem: []
})
const customEvent = (e) => {
formData.project_id = e.id

View File

@ -126,56 +126,7 @@
</dialogTable>
</el-dialog>
</div>
<div style="margin-bottom: 30px;">机械维修保养记录</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.maintenance_record">
<el-table-column label="序号" width="150px">
<template #default="{ row }">
<el-button @click="handleAdd1()">+</el-button>
<el-button @click="handleDelete1(row)">-</el-button>
</template>
</el-table-column>
<el-table-column label="登记日期" prop="reg_date">
<template #default="scope">
<el-date-picker class="flex-1 !flex" v-model="scope.row.reg_date" clearable
value-format="YYYY-MM-DD" placeholder="选择登记日期">
</el-date-picker>
</template>
</el-table-column>
<el-table-column label="机械每月维修保养附件" prop="month_warranty_file">
<template #default="{ row }">
<el-input v-model="row.month_warranty_file" />
</template>
</el-table-column>
<el-table-column label="设备维保有效期" prop="maintenance_period">
<template #default="scope">
<el-date-picker class="flex-1 !flex" v-model="scope.row.maintenance_period" clearable
value-format="YYYY-MM-DD" placeholder="选择设备维保有效期">
</el-date-picker>
</template>
</el-table-column>
<el-table-column label="附配件1有效期" prop="accessory_one_validity">
<template #default="scope">
<el-date-picker class="flex-1 !flex" v-model="scope.row.accessory_one_validity" clearable
value-format="YYYY-MM-DD" placeholder="选择附配件1有效期">
</el-date-picker>
</template>
</el-table-column>
<el-table-column label="附配件2有效期" prop="accessory_two_validity">
<template #default="scope">
<el-date-picker class="flex-1 !flex" v-model="scope.row.accessory_two_validity" clearable
value-format="YYYY-MM-DD" placeholder="选择附配件2有效期">
</el-date-picker>
</template>
</el-table-column>
</el-table>
</div>
<formTable :formData="formData.maintenance_record" :config="tableConfig"></formTable>
</popup>
</div>
</template>
@ -230,14 +181,46 @@ const formData = reactive({
final_audit_time: '',
remark: '',
annex: [],
maintenance_record: [{
"reg_date": "",
"month_warranty_file": "",
"maintenance_period": "",
"accessory_one_validity": "",
"accessory_two_validity": ""
}]
maintenance_record: []
})
const tableConfig = reactive(
{
title: "机械维修保养记录",
tableConfig: [
{
label: "登记日期",
value: 'reg_date',
date: true
},
{
label: "机械每月维修保养附件",
value: 'month_warranty_file'
},
{
label: "设备维保有效期",
value: 'maintenance_period',
date: true
},
{
label: "附配件1有效期",
value: 'accessory_one_validity',
date: true
},
{
label: "附配件2有效期",
value: 'accessory_two_validity',
date: true
},
],
deleteApi: apisupervision_large_mechanical_equipment_maintenance_record_delete,
}
)
const customEvent = (e) => {
formData.project_id = e.id
formData.project_name = e.project_name
@ -250,35 +233,6 @@ const customEvent1 = (e) => {
formData.company_name = e.unit_name
showDialog2.value = false
}
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 handleAdd1 = () => {
formData.maintenance_record.push({
"reg_date": "",
"month_warranty_file": "",
"maintenance_period": "",
"accessory_one_validity": "",
"accessory_two_validity": ""
})
}
const handleDelete1 = async (row: any) => {
if (row.id) {
await apisupervision_large_mechanical_equipment_maintenance_record_delete({ id: row.id })
const index = formData.maintenance_record.indexOf(row);
formData.maintenance_record.splice(index, 1);
} else {
const index = formData.maintenance_record.indexOf(row);
formData.maintenance_record.splice(index, 1);
}
}
//

View File

@ -76,59 +76,7 @@
</dialogTable>
</el-dialog>
</el-form>
<div style="margin-bottom: 30px;">材料信息 <el-button type="primary" @click="handleAdd"
v-if="formData.entry_detail.length == 0" style="float: right;">新增</el-button></div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.entry_detail">
<el-table-column label="序号" width="150px">
<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="scope">
<el-input v-model="scope.row.name" @click="showDialog3 = true, tableIndex = scope.$index" />
</template>
</el-table-column>
<el-table-column label="材料品牌" prop="brand">
<template #default="scope">
<el-input v-model="scope.row.brand" />
</template>
</el-table-column>
<el-table-column label="单位" prop="unit">
<template #default="{ row }">
<el-input v-model="row.unit" />
</template>
</el-table-column>
<el-table-column label="是否合同约定品牌" prop="contract_brand">
<template #default="{ row }">
<el-select class="flex-1" v-model="row.contract_brand" clearable placeholder="请选择">
<el-option label="否" :value="0" />
<el-option label="是" :value="1" />
</el-select>
</template>
</el-table-column>
<el-table-column label="型号" prop="model">
<template #default="{ row }">
<el-input v-model="row.model" />
</template>
</el-table-column>
<el-table-column label="进场数量" prop="entry_number">
<template #default="{ row }">
<el-input v-model="row.entry_number" />
</template>
</el-table-column>
</el-table>
</div>
<formTable :formData="formData.entry_detail" :config="tableConfig"></formTable>
</popup>
</div>
</template>
@ -136,7 +84,7 @@
<script lang="ts" setup name="supervisionMaterialEntryEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiSupervisionMaterialEntryAdd, apiSupervisionMaterialEntryEdit, apiSupervisionMaterialEntryDetail, apisupervision_material_entry_detail, apisupervision_material_entry_detail_delete } from '@/api/supervision_material_entry'
import { apiSupervisionMaterialEntryAdd, apiSupervisionMaterialEntryEdit, apisupervision_material_entry_detail, apisupervision_material_entry_detail_delete } from '@/api/supervision_material_entry'
import { supervision_project, supervision_participating_units, supervision_material_equipment_info } from "@/components/dialogTable/dialogTableConfig"
import type { PropType } from 'vue'
defineProps({
@ -177,41 +125,54 @@ const formData = reactive({
remark: '',
create_user: "",
create_time: "",
entry_detail: [{
"name": "",
"brand": "",
"model": "",
"unit": "",
"contract_brand": 0,
"entry_number": 0
}]
entry_detail: []
})
const tableConfig = reactive(
{
title: "材料信息",
tableConfig: [
{
label: "材料名称",
value: 'name'
const handleAdd = () => {
formData.entry_detail.push({
"name": "",
"brand": "",
"model": "",
"unit": "",
"contract_brand": 0,
"entry_number": 0
})
}
const handleDelete = async (row: any) => {
// if (formData.entry_detail.length == 1) return
if (row.id) {
await apisupervision_material_entry_detail_delete({ id: row.id })
const index = formData.entry_detail.indexOf(row);
formData.entry_detail.splice(index, 1);
} else {
const index = formData.entry_detail.indexOf(row);
formData.entry_detail.splice(index, 1);
},
{
label: "材料品牌",
value: 'brand'
},
{
label: "单位",
value: 'unit'
},
{
label: "是否合同约定品牌",
value: 'contract_brand',
select: [
{
name: "否",
value: 0
},
{
name: "是",
value: 1
}
]
},
{
label: "型号",
value: 'model',
},
{
label: "进场数量",
value: 'entry_number'
},
],
deleteApi: apisupervision_material_entry_detail_delete,
}
}
)
const customEvent = (e) => {
formData.project_id = e.id
@ -227,12 +188,6 @@ const customEvent1 = (e) => {
showDialog2.value = false
}
const customEvent2 = (e) => {
// if (formData.entry_detail[tableIndex.value]?.id) delete formData.entry_detail[tableIndex.value].id;
// for (let key in formData.entry_detail[tableIndex.value]) {
// (formData.entry_detail[tableIndex.value])[key] = e[key]
// }
// showDialog3.value = false
let { name, brand, model, unit, contract_brand, entry_number } = e
Object.assign(formData.entry_detail[tableIndex.value], { name, brand, model, unit, contract_brand, entry_number })
showDialog3.value = false
@ -273,12 +228,12 @@ const formRules = reactive<any>({
}],
enter_result: [{
required: true,
message: '请输入进场结果 0-进场 1-进场后复检 2-退检',
message: '请输入进场结果',
trigger: ['blur']
}],
parallel_test: [{
required: true,
message: '请输入是否平行检验 0-否 1-是',
message: '请输入是否平行检验',
trigger: ['blur']
}],
remark: [{
@ -306,12 +261,6 @@ const setFormData = async (data: Record<any, any>) => {
formData.entry_detail = res.lists
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiSupervisionMaterialEntryDetail({
id: row.id
})
setFormData(data)
}
//
@ -341,6 +290,5 @@ const handleClose = () => {
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -44,71 +44,11 @@
</el-form-item>
</el-col>
</el-row>
<el-dialog v-model="showDialog" title="选择项目" width="70%">
<dialogTable @customEvent="customEvent" :config="supervision_project" />
</el-dialog>
<el-dialog v-model="showDialog2" title="选择来源单据" width="70%">
<dialogTable :config="supervision_material_entry" @customEvent="customEvent1"></dialogTable>
</el-dialog>
</el-form>
<div style="margin-bottom: 30px;">材料信息</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.detail">
<!-- <el-table-column label="序号" width="150px">
<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="scope">
<el-input v-model="scope.row.name" />
</template>
</el-table-column>
<el-table-column label="材料品牌" prop="brand">
<template #default="scope">
<el-input v-model="scope.row.brand" />
</template>
</el-table-column>
<el-table-column label="单位" prop="unit">
<template #default="{ row }">
<el-input v-model="row.unit" />
</template>
</el-table-column>
<el-table-column label="是否合同约定品牌" prop="contract_brand">
<template #default="{ row }">
<el-select class="flex-1" v-model="row.contract_brand" clearable placeholder="请选择">
<el-option label="否" :value="0" />
<el-option label="是" :value="1" />
</el-select>
</template>
</el-table-column>
<el-table-column label="型号" prop="model">
<template #default="{ row }">
<el-input v-model="row.model" />
</template>
</el-table-column>
<el-table-column label="进场数量" prop="entry_number">
<template #default="{ row }">
<el-input v-model="row.entry_number" />
</template>
</el-table-column>
<el-table-column label="检验数量" prop="num">
<template #default="{ row }">
<el-input v-model="row.num" />
</template>
</el-table-column>
</el-table>
</div>
<formTable :formData="formData.detail" :config="tableConfig"></formTable>
</popup>
</div>
</template>
@ -116,10 +56,10 @@
<script lang="ts" setup name="supervisionWitnessSamplingEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiSupervisionMaterialParallelTestingAdd, apiSupervisionMaterialParallelTestingEdit, apiSupervisionMaterialParallelTestingDetail } from '@/api/supervision_material_parallel_testing'
import { apisupervision_material_entry_detail, apisupervision_material_entry_detail_delete } from '@/api/supervision_material_entry'
import { apiSupervisionMaterialParallelTestingAdd, apiSupervisionMaterialParallelTestingEdit } from '@/api/supervision_material_parallel_testing'
import { apisupervision_material_entry_detail } from '@/api/supervision_material_entry'
import type { PropType } from 'vue'
import { supervision_project, supervision_material_entry } from "@/components/dialogTable/dialogTableConfig"
import { supervision_material_entry } from "@/components/dialogTable/dialogTableConfig"
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
@ -133,14 +73,6 @@ const mode = ref('add')
const showDialog = ref(false)
const showDialog2 = ref(false)
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 popupTitle = computed(() => {
@ -149,6 +81,7 @@ const popupTitle = computed(() => {
//
const formData = reactive({
id: "",
project_name: "",
"project_id": 1,
"material_entry_id": 1,
@ -159,23 +92,57 @@ const formData = reactive({
"annex": [],
create_user: "",
create_time: "",
"detail": [
{
"name": "",
"brand": "",
"model": "",
"unit": "",
"contract_brand": 0,
"entry_number": 0,
num: ""
}
]
"detail": []
})
const customEvent = (e) => {
formData.project_id = e.id
formData.project_name = e.project_name
showDialog.value = false
}
const tableConfig = reactive(
{
title: "材料信息",
tableConfig: [
{
label: "材料名称",
value: 'name',
},
{
label: "材料品牌",
value: 'brand'
},
{
label: "单位",
value: 'unit',
},
{
label: "是否合同约定品牌",
value: 'contract_brand',
select: [
{
name: "否",
value: 0
},
{
name: "是",
value: 1
}
]
},
{
label: "型号",
value: 'model',
},
{
label: "进场数量",
value: 'entry_number',
},
{
label: "检验数量",
value: 'num',
},
],
}
)
const customEvent1 = async (e) => {
formData.project_name = e.project_name
formData.project_id = e.project_id
@ -230,12 +197,6 @@ const setFormData = async (data: Record<any, any>) => {
formData.detail = res.lists
}
const getDetail = async (row: Record<string, any>) => {
// const data = await apiSupervisionWitnessSamplingDetail({
// id: row.id
// })
// setFormData(data)
}
//
@ -266,6 +227,5 @@ const handleClose = () => {
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -8,13 +8,6 @@
<el-form-item label="送检人" prop="check_user">
<el-input class="w-[280px]" v-model="queryParams.inspector" clearable placeholder="请输入操作人" />
</el-form-item>
<!-- <el-form-item label="检验结果" prop="check_result">
<el-select v-model="queryParams.check_result">
<el-option label="未检验" value="0"></el-option>
<el-option label="符合标准" value="1"></el-option>
<el-option label="不符合标准" value="2"></el-option>
</el-select>
</el-form-item> -->
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
@ -76,8 +69,7 @@
<script lang="ts" setup name="supervisionMaterialParallelTestingLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiSupervisionMaterialParallelTestingLists, apiSupervisionMaterialParallelTestingDelete } from '@/api/supervision_material_parallel_testing'
import { timeFormat } from '@/utils/util'
import { apiSupervisionMaterialParallelTestingLists, apiSupervisionMaterialParallelTestingDelete, apiSupervisionMaterialParallelTestingDetail } from '@/api/supervision_material_parallel_testing'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
@ -118,10 +110,11 @@ const handleAdd = async () => {
//
const handleEdit = async (data: any) => {
let res = await apiSupervisionMaterialParallelTestingDetail({ id: data.id })
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
editRef.value?.setFormData(res)
}
//

View File

@ -85,11 +85,11 @@ const tableConfig = reactive(
value: 'is_show',
select: [
{
label: '是',
name: '是',
value: 0
},
{
label: '否',
name: '否',
value: 1
}
]

View File

@ -60,35 +60,7 @@
</el-dialog>
</div>
</el-form>
<div style="margin-bottom: 30px;">通知问题</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.problem">
<el-table-column label="序号" width="150px">
<template #default="{ row }">
<el-button @click="handleAdd1()">+</el-button>
<el-button @click="handleDelete1(row)">-</el-button>
</template>
</el-table-column>
<el-table-column label="事由描述" prop="problem_description">
<template #default="{ row }">
<el-input v-model="row.problem_description" />
</template>
</el-table-column>
<el-table-column label="内容描述" prop="content_description">
<template #default="{ row }">
<el-input v-model="row.content_description" />
</template>
</el-table-column>
<el-table-column label="要求描述" prop="demand_description">
<template #default="{ row }">
<el-input v-model="row.demand_description" />
</template>
</el-table-column>
</el-table>
</div>
<formTable :formData="formData.problem" :config="tableConfig"></formTable>
</popup>
</div>
</template>
@ -112,19 +84,11 @@ const mode = ref('add')
const showDialog = ref(false)
const showDialog2 = 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) }
//
const formData = reactive({
id: '',
@ -145,23 +109,30 @@ const formData = reactive({
"demand_description": ""
}]
})
const handleAdd1 = () => {
formData.problem.push({
"problem_description": "",
"content_description": "",
"demand_description": ""
})
}
const handleDelete1 = async (row: any) => {
if (row.id) {
await apisupervision_notice_problem_delete({ id: row.id })
const index = formData.problem.indexOf(row);
formData.problem.splice(index, 1);
} else {
const index = formData.problem.indexOf(row);
formData.problem.splice(index, 1);
const tableConfig = reactive(
{
title: "通知问题",
tableConfig: [
{
label: "事由描述",
value: 'problem_description',
},
{
label: "内容描述",
value: 'content_description'
},
{
label: "要求描述",
value: 'demand_description',
},
],
deleteApi: apisupervision_notice_problem_delete,
}
}
)
const customEvent = (e) => {
formData.project_id = e.id
@ -179,7 +150,7 @@ const customEvent1 = (e) => {
const formRules = reactive<any>({
project_id: [{
required: true,
message: '请输入项目id',
message: '请输入项目',
trigger: ['blur']
}],
code: [{

View File

@ -14,39 +14,7 @@
<el-input v-model="formData.remark" clearable placeholder="请输入备注" type="textarea" />
</el-form-item>
</el-form>
<div style="margin-bottom: 30px;">资料归档目录</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.detail">
<el-table-column label="序号" width="150px">
<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="data_catalog">
<template #default="{ row }">
<el-input v-model="row.data_catalog" />
</template>
</el-table-column>
<el-table-column label="项目部提交资料(份数)" prop="submit_by_project_dept">
<template #default="{ row }">
<el-input v-model="row.submit_by_project_dept" type="number" />
</template>
</el-table-column>
<el-table-column label="生产管理部核实情况(份数)" prop="submit_by_production_dept">
<template #default="{ row }">
<el-input v-model="row.submit_by_production_dept" type="number" />
</template>
</el-table-column>
</el-table>
</div>
<formTable :formData="formData.detail" :config="tableConfig"></formTable>
<el-dialog v-model="showDialog" title="选择项目" width="70%">
<dialogTable @customEvent="customEvent" :config="supervision_project" />
</el-dialog>
@ -85,32 +53,30 @@ const formData = reactive({
project_name: "",
opinion: '',
remark: '',
"detail": [
{
"data_catalog": "",
"submit_by_project_dept": "",
"submit_by_production_dept": ""
}
]
"detail": []
})
const handleAdd = () => {
formData.detail.push({
"data_catalog": "",
"submit_by_project_dept": "",
"submit_by_production_dept": ""
})
}
const tableConfig = reactive(
{
title: "资料归档目录",
tableConfig: [
{
label: "监理项目竣工资料归档目录",
value: 'data_catalog',
},
{
label: "项目部提交资料(份数)",
value: 'submit_by_project_dept'
},
{
label: "生产管理部核实情况(份数)",
value: 'submit_by_production_dept',
},
const handleDelete = async (row: any) => {
if (row.id) {
await apisupervision_project_data_archiving_detail_delete({ id: row.id })
],
deleteApi: apisupervision_project_data_archiving_detail_delete,
}
const index = formData.detail.indexOf(row);
formData.detail.splice(index, 1);
}
)
const customEvent = (e) => {

View File

@ -128,84 +128,8 @@
</el-dialog>
</div>
</el-form>
<div style="margin-bottom: 30px;">巡视结果</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.side_result">
<el-table-column label="序号" width="150px">
<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="check_type">
<template #default="scope">
<el-input v-model="scope.row.check_type" />
</template>
</el-table-column>
<el-table-column label="检查类容" prop="check_content">
<template #default="{ row }">
<el-input v-model="row.check_content" />
</template>
</el-table-column>
<el-table-column label="是否必检" prop="must_check">
<template #default="{ row }">
<el-select class="flex-1" v-model="row.must_check" clearable placeholder="请选择">
<el-option label="否" :value="parseInt(0)" />
<el-option label="是" :value="parseInt(1)" />
</el-select>
</template>
</el-table-column>
<el-table-column label="检查结果" prop="must_check">
<template #default="{ row }">
<el-select class="flex-1" v-model="row.check_result" clearable placeholder="请选择">
<el-option label="合格" :value="parseInt(0)" />
<el-option label="不合格" :value="parseInt(1)" />
</el-select>
</template>
</el-table-column>
</el-table>
</div>
<div style="margin-bottom: 30px;">巡视问题</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.side_problem">
<el-table-column label="序号" width="150px">
<template #default="{ row }">
<el-button @click="handleAdd1()">+</el-button>
<el-button @click="handleDelete1(row)">-</el-button>
</template>
</el-table-column>
<el-table-column label="问题分类" prop="problem_cate">
<template #default="scope">
<el-select class="flex-1" v-model="scope.row.problem_cate" clearable placeholder="请输入问题分类">
<el-option v-for="( item, index ) in dictData.problem_cate" :key="index"
:label="item.name" :value="item.value" />
</el-select>
</template>
</el-table-column>
<el-table-column label="问题说明" prop="check_content">
<template #default="{ row }">
<el-input v-model="row.problem_description" />
</template>
</el-table-column>
<el-table-column label="问题名称" prop="must_check">
<template #default="{ row }">
<el-input v-model="row.problem_name" />
</template>
</el-table-column>
</el-table>
</div>
<formTable :formData="formData.side_result" :config="tableConfig"></formTable>
<formTable :formData="formData.side_problem" :config="tableConfig1"></formTable>
</popup>
</div>
</template>
@ -239,60 +163,7 @@ const flag = 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) }
const handleAdd = () => {
formData.side_result.push({
"check_type": "",
"check_content": "",
"must_check": 0,
"check_result": 0
})
}
const handleDelete = async (row: any) => {
if (formData.side_result.length == 1) return
if (row.id) {
await apisupervision_side_station_resultDelete({ id: row.id })
const index = formData.side_result.indexOf(row);
formData.side_result.splice(index, 1);
} else {
const index = formData.side_result.indexOf(row);
formData.side_result.splice(index, 1);
}
}
const handleAdd1 = () => {
formData.side_problem.push({
"problem_cate": "",
"problem_description": "",
"problem_name": ""
})
}
const handleDelete1 = async (row: any) => {
if (formData.side_problem.length == 1) return
if (row.id) {
await apisupervision_problem_delete({ id: row.id })
const index = formData.side_problem.indexOf(row);
formData.side_problem.splice(index, 1);
}
else {
const index = formData.side_problem.indexOf(row);
formData.side_problem.splice(index, 1);
}
}
//
@ -326,33 +197,85 @@ const formData = reactive({
is_importent: '',
follow_user: '',
check_item_detail_name: '',
side_result: [
{
"check_type": "",
"check_content": "",
"must_check": 1,
"check_result": 1
}
],
side_problem: [
{
"problem_cate": "",
"problem_description": "",
"problem_name": ""
}
]
// inspection_result: [{
// "check_type": "",
// "check_content": "",
// "must_check": 0,
// "check_result": 0
// },],
// inspection_problem: [{
// "problem_cate": "",
// "problem_description": "",
// "problem_name": ""
// }]
side_result: [],
side_problem: []
})
const tableConfig = reactive(
{
title: "巡视结果",
tableConfig: [
{
label: "检查类别",
value: 'check_type'
},
{
label: "检查类容",
value: 'check_content'
},
{
label: "是否必检",
value: 'must_check',
select: [
{
name: "否",
value: 0
},
{
name: "是",
value: 1
}
]
},
{
label: "检查结果",
value: 'check_result',
select: [
{
name: "合格",
value: 0
},
{
name: "不合格",
value: 1
}
]
},
],
deleteApi: apisupervision_side_station_resultDelete,
}
)
const tableConfig1 = reactive(
{
title: "巡视问题",
tableConfig: [
{
label: "问题分类",
value: 'problem_cate',
select: 'problem_cate'
},
{
label: "问题说明",
value: 'problem_description'
},
{
label: "问题名称",
value: 'problem_name',
},
],
deleteApi: apisupervision_problem_delete,
}
)
const customEvent = (e) => {
formData.project_id = e.id
formData.project_name = e.project_name

View File

@ -67,7 +67,6 @@
<el-col :span="8">
<el-form-item label="附件" prop="annex">
<uploadAnnex :formData="formData"></uploadAnnex>
</el-form-item>
</el-col>
</el-row>
@ -83,39 +82,7 @@
</dialogTable>
</el-dialog>
</div>
<div style="margin-bottom: 30px;">问题</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.problem">
<el-table-column label="序号" width="150px">
<template #default="{ row }">
<el-button @click="handleAdd1()">+</el-button>
<el-button @click="handleDelete1(row)">-</el-button>
</template>
</el-table-column>
<el-table-column label="问题分类" prop="problem_cate">
<template #default="scope">
<el-select class="flex-1" v-model="scope.row.problem_cate" clearable placeholder="请输入问题分类">
<el-option v-for="( item, index ) in dictData.problem_cate" :key="index"
:label="item.name" :value="item.value" />
</el-select>
</template>
</el-table-column>
<el-table-column label="问题说明" prop="check_content">
<template #default="{ row }">
<el-input v-model="row.problem_description" />
</template>
</el-table-column>
<el-table-column label="问题名称" prop="problem_name">
<template #default="{ row }">
<el-input v-model="row.problem_name" />
</template>
</el-table-column>
</el-table>
</div>
<formTable :formData="formData.problem" :config="tableConfig"></formTable>
</popup>
</div>
</template>
@ -140,14 +107,7 @@ const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
const showDialog = ref(false)
const showDialog2 = ref(false)
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 popupTitle = computed(() => {
@ -172,31 +132,32 @@ const formData = reactive({
annex: [],
create_user: "",
create_time: "",
problem: [{
"problem_cate": '',
"problem_description": "",
"problem_name": ""
}]
problem: []
})
const handleAdd1 = () => {
formData.problem.push({
"problem_cate": '',
"problem_description": "",
"problem_name": ""
})
}
const handleDelete1 = async (row: any) => {
if (row.id) {
await apisupervision_problem_delete({ id: row.id })
const index = formData.problem.indexOf(row);
formData.problem.splice(index, 1);
} else {
const index = formData.problem.indexOf(row);
formData.problem.splice(index, 1);
}
}
const tableConfig = reactive(
{
title: "问题",
tableConfig: [
{
label: "问题分类",
value: 'problem_cate',
select: 'problem_cate'
},
{
label: "问题说明",
value: 'problem_description'
},
{
label: "问题名称",
value: 'problem_name',
},
],
deleteApi: apisupervision_problem_delete,
}
)
const customEvent = (e) => {
formData.project_id = e.id

View File

@ -56,62 +56,8 @@
</el-dialog>
</el-form>
<div style="margin-bottom: 30px;">材料信息</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.sampling_detail">
<!-- <el-table-column label="序号" width="150px">
<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">
<formTable :formData="formData.sampling_detail" :config="tableConfig"></formTable>
<template #default="scope">
<el-input v-model="scope.row.name" />
</template>
</el-table-column>
<el-table-column label="材料品牌" prop="brand">
<template #default="scope">
<el-input v-model="scope.row.brand" />
</template>
</el-table-column>
<el-table-column label="单位" prop="unit">
<template #default="{ row }">
<el-input v-model="row.unit" />
</template>
</el-table-column>
<el-table-column label="是否合同约定品牌" prop="contract_brand">
<template #default="{ row }">
<el-select class="flex-1" v-model="row.contract_brand" clearable placeholder="请选择">
<el-option label="否" :value="0" />
<el-option label="是" :value="1" />
</el-select>
</template>
</el-table-column>
<el-table-column label="型号" prop="model">
<template #default="{ row }">
<el-input v-model="row.model" />
</template>
</el-table-column>
<el-table-column label="进场数量" prop="entry_number">
<template #default="{ row }">
<el-input v-model="row.entry_number" />
</template>
</el-table-column>
<el-table-column label="取样数量" prop="num">
<template #default="{ row }">
<el-input v-model="row.num" />
</template>
</el-table-column>
</el-table>
</div>
</popup>
</div>
</template>
@ -137,14 +83,7 @@ const mode = ref('add')
const showDialog = ref(false)
const showDialog2 = ref(false)
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 popupTitle = computed(() => {
@ -165,20 +104,57 @@ const formData = reactive({
annex: '',
create_user: "",
create_time: "",
//
sampling_detail: [
{
"name": "",
"brand": "",
"model": "",
"unit": "",
"contract_brand": 0,
"entry_number": 0,
num: ""
}
]
sampling_detail: []
})
const tableConfig = reactive(
{
title: "材料信息",
tableConfig: [
{
label: "材料名称",
value: 'name',
},
{
label: "材料品牌",
value: 'brand'
},
{
label: "单位",
value: 'unit',
},
{
label: "是否合同约定品牌",
value: 'contract_brand',
select: [
{
name: "是",
value: 0
},
{
name: "否",
value: 1
}
]
},
{
label: "型号",
value: 'model',
},
{
label: "进场数量",
value: 'entry_number',
},
{
label: "取样数量",
value: 'num',
},
],
}
)
const customEvent = (e) => {
formData.project_id = e.id
formData.project_name = e.project_name
@ -249,7 +225,6 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
await formRef.value?.validate()
// formData.sampling_detail = formData.sampling_detail.map(item => ({ material_entry_detail_id: item.id, num: item.num }))
const data = { ...formData, }
data.sampling_detail = formData.sampling_detail.map(item => ({ material_entry_detail_id: item.id, num: item.num }))
mode.value == 'edit'

View File

@ -48,29 +48,7 @@
<dialogTable @customEvent="customEvent" :config="supervision_project" />
</el-dialog>
</el-form>
<div style="margin-bottom: 30px;">通知问题</div>
<div style="margin-bottom: 30px;">
<el-table :data="formData.problem">
<el-table-column label="序号" width="150px">
<template #default="{ row }">
<el-button @click="handleAdd1()">+</el-button>
<el-button @click="handleDelete1(row)">-</el-button>
</template>
</el-table-column>
<el-table-column label="问题名称" prop="problem_name">
<template #default="{ row }">
<el-input v-model="row.problem_name" />
</template>
</el-table-column>
<el-table-column label="问题说明" prop="problem_description">
<template #default="{ row }">
<el-input v-model="row.problem_description" />
</template>
</el-table-column>
</el-table>
</div>
<formTable :formData="formData.problem" :config="tableConfig"></formTable>
</popup>
</div>
</template>
@ -99,14 +77,6 @@ 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) }
//
const formData = reactive({
id: '',
@ -123,28 +93,32 @@ const formData = reactive({
"problem_description": "",
}]
})
const tableConfig = reactive(
{
title: "通知问题",
tableConfig: [
{
label: "问题名称",
value: 'problem_name',
},
{
label: "问题说明",
value: 'problem_description'
},
],
deleteApi: apisupervision_work_contact_problem_delete,
}
)
const customEvent = (e) => {
formData.project_id = e.id
formData.project_name = e.project_name
showDialog.value = false
}
const handleAdd1 = () => {
formData.problem.push({
"problem_name": "",
"problem_description": ""
})
}
const handleDelete1 = async (row: any) => {
if (row.id) {
await apisupervision_work_contact_problem_delete({ id: row.id })
const index = formData.problem.indexOf(row);
formData.problem.splice(index, 1);
} else {
const index = formData.problem.indexOf(row);
formData.problem.splice(index, 1);
}
}
//
const formRules = reactive<any>({