|
@@ -17,6 +17,7 @@
|
|
|
hc-btn
|
|
|
color="#e54d42"
|
|
|
style="color: white;"
|
|
|
+ @click="clearInfo"
|
|
|
>
|
|
|
<HcIcon name="delete-bin-3" />
|
|
|
<span>清空数据</span>
|
|
@@ -26,6 +27,8 @@
|
|
|
hc-btn
|
|
|
color="#12C060"
|
|
|
style="color: white;"
|
|
|
+ :loading="saveLoading"
|
|
|
+ @click="saveInfo"
|
|
|
>
|
|
|
<HcIcon name="save" />
|
|
|
<span>保存数据</span>
|
|
@@ -35,6 +38,8 @@
|
|
|
hc-btn
|
|
|
color="#12C060"
|
|
|
style="color: white;"
|
|
|
+ :loading="changeRowLoaing"
|
|
|
+ @click="changeRowInfo"
|
|
|
>
|
|
|
<HcIcon name="save" />
|
|
|
<span>提交整改记录</span>
|
|
@@ -44,6 +49,8 @@
|
|
|
hc-btn
|
|
|
color="#12C060"
|
|
|
style="color: white;"
|
|
|
+ :loading="updateLoaing"
|
|
|
+ @click="updateInfo"
|
|
|
>
|
|
|
<HcIcon name="save" />
|
|
|
<span>确认修改</span>
|
|
@@ -53,7 +60,8 @@
|
|
|
hc-btn
|
|
|
color="#12C060"
|
|
|
style="color: white;"
|
|
|
- @click="goList"
|
|
|
+ :loading="reviewInspectLoaing"
|
|
|
+ @click="reviewInspect(2)"
|
|
|
>
|
|
|
<HcIcon name="save" />
|
|
|
<span>复核检查通过</span>
|
|
@@ -63,7 +71,8 @@
|
|
|
hc-btn
|
|
|
color="rgb(189, 49, 36)"
|
|
|
style="color: white;"
|
|
|
- @click="goList"
|
|
|
+ :loading="reviewInspectLoaing1"
|
|
|
+ @click="reviewInspect(1)"
|
|
|
>
|
|
|
<HcIcon name="save" />
|
|
|
<span>复核检查未通过</span>
|
|
@@ -88,8 +97,8 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="是否需要整改" prop="isRectify">
|
|
|
<el-radio-group v-model="addForm.isRectify" class="ml-4" :disabled="type === 'view'">
|
|
|
- <el-radio label="1" size="large">需要整改</el-radio>
|
|
|
- <el-radio label="2" size="large">不要整改</el-radio>
|
|
|
+ <el-radio :label="1" size="large">需要整改</el-radio>
|
|
|
+ <el-radio :label="2" size="large">不要整改</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -100,7 +109,7 @@
|
|
|
<el-date-picker
|
|
|
v-model="addForm.rectifyDate"
|
|
|
type="date"
|
|
|
-
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
placeholder="请选择整改日期"
|
|
|
:disabled="type === 'changeRow' || type === 'review' || type === 'view'"
|
|
|
/>
|
|
@@ -121,7 +130,7 @@
|
|
|
<el-divider border-style="dashed" style="border: 1px dashed #cdd4e3;" />
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="4">
|
|
|
- <el-form-item label="检查部位" prop="inspectLocation">
|
|
|
+ <el-form-item label="检查部位" prop="list">
|
|
|
<el-button
|
|
|
hc-btn
|
|
|
type="primary"
|
|
@@ -133,20 +142,8 @@
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <!-- <el-col :span="24">
|
|
|
- <div class="hc-process-box">
|
|
|
- <el-scrollbar style="max-height: 200px;overflow-y: auto;">
|
|
|
- <div v-for="(item, index) in processDataList" class="process-item-box">
|
|
|
- <div class="process-item">
|
|
|
- {{ item.path }}
|
|
|
- </div>
|
|
|
- <HcIcon class="process-icon" fill name="close-circle" @click="deleProcess(index)" />
|
|
|
- </div>
|
|
|
- </el-scrollbar>
|
|
|
- </div>
|
|
|
- </el-col> -->
|
|
|
</el-row>
|
|
|
- <div style="position: relative; height: 400px">
|
|
|
+ <div style="position: relative; height: 400px;margin-top: 20px;">
|
|
|
<HcTable :column="tableColumn" :datas="processDataList">
|
|
|
<template #inspectProject="{ row }">
|
|
|
<hc-table-input v-model="row.inspectProject" type="textarea" :disabled="type === 'changeRow' || type === 'review' || type === 'view'" />
|
|
@@ -160,25 +157,25 @@
|
|
|
<template #rectifyFeedback="{ row }">
|
|
|
<hc-table-input v-model="row.rectifyFeedback" type="textarea" :disabled="type === 'review' || type === 'view'" />
|
|
|
</template>
|
|
|
- <template #rectifyAttachment="{ row }">
|
|
|
- <el-link v-if="row.rectifyAttachment" type="primary" :disabled="type === 'review' || type === 'view'">{{ row.key12 }}</el-link>
|
|
|
- <el-link v-else type="primary" @click="clickUpload">上传</el-link>
|
|
|
+ <template #rectifyAttachment="{ row, index }">
|
|
|
+ <el-link v-if="row?.rectifyAttachmentName" type="primary" :disabled="type === 'review' || type === 'view'" @click="openAttachment(row)">{{ row.rectifyAttachmentName }}</el-link>
|
|
|
+ <el-link v-else type="primary" @click="clickAttachment(row, index)">上传</el-link>
|
|
|
</template>
|
|
|
<template #inspectUserName="{ row }">
|
|
|
<hc-table-input v-model="row.inspectUserName" type="textarea" :disabled="type === 'review' || type === 'view'" />
|
|
|
</template>
|
|
|
- <template #inspectPdfUrl="{ row }">
|
|
|
- <el-link v-if="!row?.ishowImage" type="primary" :disabled="type === 'review' || type === 'view'" @click="clickUpload(row)">上传</el-link>
|
|
|
+ <template #inspectPdfUrl="{ row, index }">
|
|
|
+ <el-link v-if="row?.isShowImage == 0" type="primary" :disabled="type === 'review' || type === 'view'" @click="clickUploadInspect(row, index)">上传</el-link>
|
|
|
|
|
|
- <el-image v-else style="width: 100px; height: 100px" src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" />
|
|
|
+ <el-image v-else style="width: 100px; height: 100px" :src="row?.inspectPdfUrl" />
|
|
|
</template>
|
|
|
- <template #rectifyPdfUrl="{ row }">
|
|
|
- <el-link v-if="!row?.ishowImage" type="primary" :disabled="type === 'review' || type === 'view'" @click="clickUpload(row)">上传</el-link>
|
|
|
+ <template #rectifyPdfUrl="{ row, index }">
|
|
|
+ <el-link v-if="!row.rectifyPdfUrl" type="primary" :disabled="type === 'review' || type === 'view'" @click="clickRectifyPdfUrl(row, index)">上传</el-link>
|
|
|
|
|
|
- <el-image v-else style="width: 100px; height: 100px" src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" />
|
|
|
+ <el-image v-else style="width: 100px; height: 100px" :src="row.rectifyPdfUrl" />
|
|
|
</template>
|
|
|
- <template #action="{ row }">
|
|
|
- <el-link type="danger">删除</el-link>
|
|
|
+ <template #action="{ row, index }">
|
|
|
+ <el-link type="danger" @click="deleProcess(row, index)">删除</el-link>
|
|
|
</template>
|
|
|
</HcTable>
|
|
|
</div>
|
|
@@ -202,6 +199,7 @@
|
|
|
default-expand-all
|
|
|
:default-checked-keys="defaultChecked"
|
|
|
:auto-expand-keys="TreeAutoExpandKeys"
|
|
|
+ check-strictly
|
|
|
@nodeTap="wbsElTreeClick"
|
|
|
@check="divisionTreeCheck"
|
|
|
>
|
|
@@ -218,6 +216,7 @@
|
|
|
show-checkbox
|
|
|
:default-checked-keys="defaultChecked"
|
|
|
:auto-expand-keys="TreeAutoExpandKeys"
|
|
|
+ check-strictly
|
|
|
@check="divisionTreeCheck"
|
|
|
@load="treeLoadNode"
|
|
|
@nodeTap="wbsElTreeClick"
|
|
@@ -248,9 +247,10 @@
|
|
|
import { nextTick, onActivated, ref, watch } from 'vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
import queryApi from '~api/data-fill/query'
|
|
|
-import { getArrValue, getObjValue } from 'js-fast-way'
|
|
|
+import { arrToKey, formValidate, getArrValue, getObjValue } from 'js-fast-way'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import { getTokenHeader } from '~src/api/request/header'
|
|
|
+import patrolApi from '~api/patrol/patrol'
|
|
|
|
|
|
//初始变量
|
|
|
const router = useRouter()
|
|
@@ -258,6 +258,7 @@ const useAppState = useAppStore()
|
|
|
const useRoutes = useRoute()
|
|
|
const routerQuery = useRoutes?.query
|
|
|
const type = ref(routerQuery?.type || '')
|
|
|
+const id = ref(routerQuery?.id || '')
|
|
|
const projectId = ref(useAppState.getProjectId)
|
|
|
const contractId = ref(useAppState.getContractId)
|
|
|
const addFormRef = ref(null)
|
|
@@ -283,7 +284,7 @@ const addRules = {
|
|
|
trigger: 'blur',
|
|
|
message: '请选择整改人',
|
|
|
},
|
|
|
- inspectLocation: {
|
|
|
+ list: {
|
|
|
required: true,
|
|
|
trigger: 'blur',
|
|
|
message: '请选择检查部位',
|
|
@@ -307,43 +308,42 @@ const tableColumn = ref([
|
|
|
{ key: 'inspectProject', name: '检查项目' },
|
|
|
{ key: 'inspectContent', name: '检查内容' },
|
|
|
{ key: 'rectifyFeedback', name: '整改反馈' },
|
|
|
- { key: 'rectifyAttachment', name: '整改附件' },
|
|
|
+ { key: 'rectifyAttachment', name: '整改附件', width:150 },
|
|
|
{ key: 'inspectPdfUrl', name: '图片', width:150 },
|
|
|
{ key: 'action', name: '操作', width:100 },
|
|
|
])
|
|
|
//整改显示列
|
|
|
|
|
|
-const tableData = ref([
|
|
|
- { id: 1, name: '名称1', text: '文本1', color: 'red', key12:'xxxxx.pdf' },
|
|
|
- { id: 2, name: '名称2', text: '文本2', color: 'blue', key12:'xxxxx.pdf' },
|
|
|
- { id: 3, name: '名称3', text: '文本3', color: '无', key12:'' },
|
|
|
-
|
|
|
|
|
|
-])
|
|
|
|
|
|
|
|
|
onActivated(()=>{
|
|
|
const routerQuery = useRoutes?.query
|
|
|
type.value = routerQuery?.type || ''
|
|
|
- console.log( type.value, ' type.value')
|
|
|
+ id.value = routerQuery?.id || ''
|
|
|
+ if (id.value.length > 0) {
|
|
|
+ getDetail( id.value)
|
|
|
+ }
|
|
|
if (type.value === 'changeRow') {
|
|
|
+
|
|
|
tableColumn.value = [
|
|
|
{ key: 'inspectProject', name: '检查项目' },
|
|
|
{ key: 'inspectContent', name: '检查内容' },
|
|
|
{ key: 'rectifyFeedback', name: '整改反馈' },
|
|
|
- { key: 'rectifyAttachment', name: '整改附件' },
|
|
|
- { key: 'inspectPdfUrl', name: '图片', width:150 },
|
|
|
+ { key: 'rectifyAttachment', name: '整改附件', width:150 },
|
|
|
+ { key: 'rectifyPdfUrl', name: '图片', width:150 },
|
|
|
{ key: 'action', name: '操作', width:100 },
|
|
|
]
|
|
|
} else if (type.value === 'review') {
|
|
|
+
|
|
|
tableColumn.value = [
|
|
|
{ key: 'inspectProject', name: '检查项目' },
|
|
|
{ key: 'inspectContent', name: '检查内容' },
|
|
|
{ key: 'deductionStandard', name: '扣分标准' },
|
|
|
{ key: 'inspectUserName', name: '检查人名称' },
|
|
|
- { key: 'key5', name: '图片', width:150 },
|
|
|
+ { key: 'inspectPdfUrl', name: '图片', width:150 },
|
|
|
{ key: 'rectifyFeedback', name: '整改反馈' },
|
|
|
- { key: 'rectifyAttachment', name: '整改附件' },
|
|
|
+ { key: 'rectifyAttachment', name: '整改附件', width:150 },
|
|
|
{ key: 'rectifyPdfUrl', name: '整改后图片', width:150 },
|
|
|
|
|
|
]
|
|
@@ -358,15 +358,74 @@ onActivated(()=>{
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+//获取巡检详情
|
|
|
+const getDetail = async (id)=>{
|
|
|
+ const { error, code, data } = await patrolApi.detail({
|
|
|
+ id:id,
|
|
|
+
|
|
|
+ })
|
|
|
+ //判断状态
|
|
|
+
|
|
|
+ if (!error && code === 200) {
|
|
|
+ console.log(data, 'data')
|
|
|
+ addForm.value = getObjValue(data)
|
|
|
+ processDataList.value = addForm.value.list
|
|
|
+ peoples.value = addForm.value.rectifyUser
|
|
|
+ } else {
|
|
|
+ addForm.value = {}
|
|
|
+ processDataList.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
const HcUploadFileRef = ref(null)
|
|
|
-const clickUpload = ()=>{
|
|
|
+//上传配置
|
|
|
+const UploadFileOptions = ref({})
|
|
|
+//上传检查图片
|
|
|
+const clickUploadInspect = (row, index)=>{
|
|
|
+ UploadFileOptions.value = {
|
|
|
+ url: '/api/blade-resource/oss/endpoint/put-file',
|
|
|
+ accept: 'image/png,image/jpg,image/jpeg',
|
|
|
+ accept_tip: 'png、jpg、jpeg',
|
|
|
+ headers: getTokenHeader(),
|
|
|
+ multiple: false,
|
|
|
+ }
|
|
|
+ HcUploadFileRef.value?.cancelUpload()
|
|
|
HcUploadFileRef.value?.selectFile()
|
|
|
- uploadFileEchoParams.value = { type:'image' }
|
|
|
+ uploadFileEchoParams.value = { type:'image', index:index }
|
|
|
}
|
|
|
-//上传配置
|
|
|
-const UploadFileOptions = {
|
|
|
- //此处设置header
|
|
|
- headers: getTokenHeader(),
|
|
|
+//上传整改图片
|
|
|
+const clickRectifyPdfUrl = (row, index)=>{
|
|
|
+ UploadFileOptions.value = {
|
|
|
+ url: '/api/blade-resource/oss/endpoint/put-file',
|
|
|
+ accept: 'image/png,image/jpg,image/jpeg',
|
|
|
+ accept_tip: 'png、jpg、jpeg',
|
|
|
+ headers: getTokenHeader(),
|
|
|
+ multiple: false,
|
|
|
+ }
|
|
|
+ HcUploadFileRef.value?.cancelUpload()
|
|
|
+ HcUploadFileRef.value?.selectFile()
|
|
|
+ uploadFileEchoParams.value = { type:'rectify', index:index }
|
|
|
+}
|
|
|
+//上传整改附件
|
|
|
+const clickAttachment = (row, index)=>{
|
|
|
+ UploadFileOptions.value = {
|
|
|
+ url: '/api/blade-resource/oss/endpoint/put-file',
|
|
|
+ accept: 'image/png,image/jpg,image/jpeg,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,application/pdf,.doc,.docx,application/msword',
|
|
|
+ accept_tip: '图片(png、jpg、jpeg)<br/>Excel(xls、xlsx)<br/>PDF<br/>Word(doc、docx)',
|
|
|
+ headers: getTokenHeader(),
|
|
|
+ multiple: false,
|
|
|
+ }
|
|
|
+ HcUploadFileRef.value?.cancelUpload()
|
|
|
+ HcUploadFileRef.value?.selectFile()
|
|
|
+ uploadFileEchoParams.value = { type:'attachment', index:index }
|
|
|
+}
|
|
|
+
|
|
|
+const openAttachment = (row)=>{
|
|
|
+ if (row?.rectifyAttachment) {
|
|
|
+ window.open(row?.rectifyAttachment, '_blank')
|
|
|
+ } else {
|
|
|
+ window.$message?.warning('获取PDF失败')
|
|
|
+ }
|
|
|
}
|
|
|
const uploadFileParams = ref({})
|
|
|
const uploadFileEchoParams = ref({})
|
|
@@ -377,8 +436,29 @@ const HcUploadFileProgress = (res) => {
|
|
|
// 文件上传成功的回调
|
|
|
const HcUploadFileSuccess = ({ echoParams, resData }) => {
|
|
|
|
|
|
- console.log(echoParams, 'echoParams')
|
|
|
- console.log(resData, 'resData')
|
|
|
+ if (echoParams['type'] === 'image' && resData?.link) {
|
|
|
+ setUploadImage(echoParams, resData)
|
|
|
+ } else if (echoParams['type'] === 'attachment' && resData?.link) {
|
|
|
+ setAttchment(echoParams, resData)
|
|
|
+ } else if (echoParams['type'] === 'rectify' && resData?.link) {
|
|
|
+ setRectify(echoParams, resData)
|
|
|
+ }
|
|
|
+}
|
|
|
+//设置上传图片
|
|
|
+const setUploadImage = (echoParams, resData)=>{
|
|
|
+ processDataList.value[echoParams['index']].isShowImage = 1
|
|
|
+ processDataList.value[echoParams['index']].inspectPdfUrl = resData?.link
|
|
|
+}
|
|
|
+//这种上传整改图片
|
|
|
+const setRectify = (echoParams, resData)=>{
|
|
|
+ console.log(resData, 'resData11111')
|
|
|
+ processDataList.value[echoParams['index']].rectifyPdfUrl = resData?.link
|
|
|
+}
|
|
|
+//设置上传附件
|
|
|
+const setAttchment = (echoParams, resData)=>{
|
|
|
+ console.log(resData, 'resData11111')
|
|
|
+ processDataList.value[echoParams['index']].rectifyAttachmentName = resData?.originalName
|
|
|
+ processDataList.value[echoParams['index']].rectifyAttachment = resData?.link
|
|
|
}
|
|
|
|
|
|
// 文件全部上传成功
|
|
@@ -389,26 +469,30 @@ const HcUploadFileChange = () => {
|
|
|
const HcUploadFileFinish = ()=>{
|
|
|
HcUploadFileRef.value?.setModalShow(false)
|
|
|
}
|
|
|
-const ishowPeople = ref(false)
|
|
|
+
|
|
|
//选择整改人
|
|
|
const peoples = ref('')
|
|
|
//任务人选择改变
|
|
|
const tasksUserChange = (a, b, users) => {
|
|
|
- addForm.value.key4 = users
|
|
|
+ addForm.value.rectifyUser = users
|
|
|
}
|
|
|
//关联工程用途及部位
|
|
|
const linksRelateModal = ref(false)
|
|
|
const linksRelateModalClick = ()=>{
|
|
|
+ TreeAutoExpandKeys.value = processDataList.value[processDataList.value.length - 1].autoExpandKeys
|
|
|
+ console.log( TreeAutoExpandKeys.value, ' TreeAutoExpandKeys.value')
|
|
|
linksRelateModal.value = true
|
|
|
+
|
|
|
+ defaultChecked.value = arrToKey(processDataList.value, 'primaryKeyId', ',').split(',')
|
|
|
}
|
|
|
const linksRelateModalClose = ()=>{
|
|
|
linksRelateModal.value = false
|
|
|
}
|
|
|
const processDataList = ref([])
|
|
|
const linksRelateModalSave = ()=>{
|
|
|
- console.log('baocun')
|
|
|
+ console.log('baocun', processDataList.value )
|
|
|
const keys = processElTree.value.treeRef.getCheckedKeys()
|
|
|
- let linkTabIds = []
|
|
|
+ let linkTabIds = processDataList.value
|
|
|
if (keys.length === 0) {
|
|
|
linkTabIds = []
|
|
|
}
|
|
@@ -421,19 +505,37 @@ const linksRelateModalSave = ()=>{
|
|
|
})
|
|
|
}
|
|
|
for (let index = 0; index < keys.length; index++) {
|
|
|
- let pathArr = []
|
|
|
let node = processElTree.value.treeRef.getNode(keys[index])
|
|
|
- getPathName(node, pathArr)
|
|
|
+ console.log(node, 'NODE')
|
|
|
linkTabIds.push({
|
|
|
- inspectProject: pathArr.join('/'),
|
|
|
+ inspectProject: node.data.title,
|
|
|
primaryKeyId: keys[index],
|
|
|
autoExpandKeys:TreeAutoExpandKeys.value,
|
|
|
+ isShowImage:0,
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
//去除掉重复的
|
|
|
getNorepeatArr(linkTabIds)
|
|
|
console.log(linkTabIds, 'linkTabIds')
|
|
|
+ console.log(processDataList.value, 'processDataList.value')
|
|
|
+ linkTabIds.forEach((ele)=>{
|
|
|
+ processDataList.value.forEach((ele1)=>{
|
|
|
+ if (ele.primaryKeyId === ele1.primaryKeyId) {
|
|
|
+ ele.isShowImage = ele1.isShowImage
|
|
|
+ ele.inspectContent = ele1.inspectContent
|
|
|
+ ele.deductionStandard = ele1.deductionStandard
|
|
|
+ ele.inspectUserName = ele1.inspectUserName
|
|
|
+ ele.inspectPdfUrl = ele1.inspectPdfUrl
|
|
|
+ ele.autoExpandKeys = ele1.autoExpandKeys
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ console.log(linkTabIds, 'linkTabIds1111')
|
|
|
processDataList.value = linkTabIds
|
|
|
+ linksRelateModal.value = false
|
|
|
+ addForm.value.list = linkTabIds
|
|
|
|
|
|
|
|
|
}
|
|
@@ -450,17 +552,9 @@ const getNorepeatArr = (tempArr)=> {
|
|
|
return tempArr
|
|
|
|
|
|
}
|
|
|
-//获取节点的路径名字
|
|
|
-const getPathName = (node, pathArr) => {
|
|
|
- if (node.parent?.parent) {
|
|
|
- pathArr.unshift(node.data?.title.replace(/(^\s*)|(\s*$)/g, '')) //去掉头尾空格
|
|
|
- getPathName(node.parent, pathArr)
|
|
|
- } else {
|
|
|
- return //根节点结束
|
|
|
- }
|
|
|
-}
|
|
|
+
|
|
|
//移除工序
|
|
|
-const deleProcess = (index) => {
|
|
|
+const deleProcess = (row, index) => {
|
|
|
const linkTabIds = processDataList.value
|
|
|
linkTabIds.splice(index, 1)
|
|
|
|
|
@@ -514,7 +608,6 @@ const wbsElTreeClick = ({ node, data, keys })=>{
|
|
|
console.log(data, 'data')
|
|
|
TreeAutoExpandKeys.value = keys || []
|
|
|
}
|
|
|
-const wbstree = ref(null)
|
|
|
//懒加载的数据
|
|
|
const treeLoadNode = async ({ node, item, level }, resolve) => {
|
|
|
let contractIdRelation = '', parentId = '', primaryKeyId = ''
|
|
@@ -540,6 +633,9 @@ const treeLoadNode = async ({ node, item, level }, resolve) => {
|
|
|
const divisionTreeItemInfo = ref({})
|
|
|
const divisionTreeCheck = ({ data }) => {
|
|
|
divisionTreeItemInfo.value = data
|
|
|
+ console.log(data, 'data')
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
const defaultChecked = ref([]) //默认选中
|
|
|
const TreeAutoExpandKeys = ref([])//默认展开
|
|
@@ -553,6 +649,90 @@ const goList = ()=>{
|
|
|
const goBack = ()=>{
|
|
|
router.back()
|
|
|
}
|
|
|
+
|
|
|
+//保存数据
|
|
|
+const saveLoading = ref(false)
|
|
|
+const saveInfo = async ()=>{
|
|
|
+ const validate = await formValidate(addFormRef.value)
|
|
|
+ if (validate) {
|
|
|
+ console.log(addForm.value, '数据')
|
|
|
+ addForm.value.projectId = projectId.value
|
|
|
+ addForm.value.list = processDataList.value
|
|
|
+ saveLoading.value = true
|
|
|
+ const { error, code } = await patrolApi.add(
|
|
|
+ addForm.value,
|
|
|
+ )
|
|
|
+ saveLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window?.$message?.success('操作成功')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+//修改数据
|
|
|
+const updateLoaing = ref(false)
|
|
|
+const updateInfo = async ()=>{
|
|
|
+ const validate = await formValidate(addFormRef.value)
|
|
|
+ if (validate) {
|
|
|
+ console.log(addForm.value, '数据')
|
|
|
+ addForm.value.projectId = projectId.value
|
|
|
+ addForm.value.list = processDataList.value
|
|
|
+ updateLoaing.value = true
|
|
|
+ const { error, code } = await patrolApi.update(
|
|
|
+ addForm.value,
|
|
|
+ )
|
|
|
+ updateLoaing.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window?.$message?.success('操作成功')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+//清除数据
|
|
|
+const clearInfo = ()=>{
|
|
|
+ processDataList.value = []
|
|
|
+ addForm.value = {}
|
|
|
+ peoples.value = ''
|
|
|
+ addForm.value.id = id.value
|
|
|
+}
|
|
|
+//提交整改记录
|
|
|
+const changeRowLoaing = ref(false)
|
|
|
+const changeRowInfo = async ()=>{
|
|
|
+ const validate = await formValidate(addFormRef.value)
|
|
|
+ if (validate) {
|
|
|
+ console.log(addForm.value, '数据')
|
|
|
+ addForm.value.projectId = projectId.value
|
|
|
+ addForm.value.list = processDataList.value
|
|
|
+ changeRowLoaing.value = true
|
|
|
+ const { error, code } = await patrolApi.submitRectify(
|
|
|
+ addForm.value,
|
|
|
+ )
|
|
|
+ changeRowLoaing.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window?.$message?.success('操作成功')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+//复核检测
|
|
|
+const reviewInspectLoaing = ref(false)
|
|
|
+const reviewInspectLoaing1 = ref(false)
|
|
|
+const reviewInspect = async (type)=>{
|
|
|
+ if (type === 2) {
|
|
|
+ reviewInspectLoaing.value = true
|
|
|
+ } else if (type === 1) {
|
|
|
+ reviewInspectLoaing1.value = false
|
|
|
+ }
|
|
|
+
|
|
|
+ const { error, code } = await patrolApi.reviewInspect(
|
|
|
+ { id:id.value,
|
|
|
+ status:type },
|
|
|
+ )
|
|
|
+ reviewInspectLoaing.value = false
|
|
|
+ reviewInspectLoaing1.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window?.$message?.success('操作成功')
|
|
|
+ goList()
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang='scss' scoped>
|