123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830 |
- <!-- -->
- <template>
- <div class="hc-page-box">
- <HcNewCard ui="bgGray" style="overflow-y: auto;">
- <template #extra>
- <el-button
- hc-btn
- color="rgb(154, 154, 154)"
- style="color: white;"
- @click="goBack"
- >
- <HcIcon name="arrow-go-back" />
- <span>返回</span>
- </el-button>
- <el-button
- v-if="type !== 'view' && type !== 'review' && type !== 'changeRow'"
- hc-btn
- color="#e54d42"
- style="color: white;"
- @click="clearInfo"
- >
- <HcIcon name="delete-bin-3" />
- <span>清空数据</span>
- </el-button>
- <el-button
- v-if="type === 'add'"
- hc-btn
- color="#12C060"
- style="color: white;"
- :loading="saveLoading"
- @click="saveInfo"
- >
- <HcIcon name="save" />
- <span>保存数据</span>
- </el-button>
- <el-button
- v-if="type === 'changeRow'"
- hc-btn
- color="#12C060"
- style="color: white;"
- :loading="changeRowLoaing"
- @click="changeRowInfo"
- >
- <HcIcon name="save" />
- <span>提交整改记录</span>
- </el-button>
- <el-button
- v-if="type === 'confirmChange'"
- hc-btn
- color="#12C060"
- style="color: white;"
- :loading="updateLoaing"
- @click="updateInfo"
- >
- <HcIcon name="save" />
- <span>确认修改</span>
- </el-button>
- <el-button
- v-if="type === 'review'"
- hc-btn
- color="#12C060"
- style="color: white;"
- :loading="reviewInspectLoaing"
- @click="reviewInspect(2)"
- >
- <HcIcon name="save" />
- <span>复核检查通过</span>
- </el-button>
- <el-button
- v-if="type === 'review'"
- hc-btn
- color="rgb(189, 49, 36)"
- style="color: white;"
- :loading="reviewInspectLoaing1"
- @click="reviewInspect(1)"
- >
- <HcIcon name="save" />
- <span>复核检查未通过</span>
- </el-button>
- </template>
- <el-form ref="addFormRef" :model="addForm" :rules="addRules" label-width="auto" size="large" label-position="left">
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="检查名称" prop="inspectName">
- <el-input v-model="addForm.inspectName" placeholder="请输入" :disabled="type === 'changeRow' || type === 'review' || type === 'view'" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="检查类别" prop="inspectType">
- <el-select v-model="addForm.inspectType" placeholder="请选择" clearable style="width:100%" :disabled="type === 'changeRow' || type === 'review' || type === 'view'">
- <el-option v-for="item in typeOptions" :key="item.id" :label="item.dictValue" :value="item.dictKey" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="是否需要整改" prop="isRectify">
- <el-radio-group v-model="addForm.isRectify" class="ml-4" :disabled="type === 'view' || type === 'changeRow'">
- <el-radio :label="1" size="large">需要整改</el-radio>
- <el-radio :label="2" size="large">不要整改</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="整改日期" prop="rectifyDate">
- <el-date-picker
- v-model="addForm.rectifyDate"
- type="date"
- value-format="YYYY-MM-DD"
- placeholder="请选择整改日期"
- :disabled="type === 'changeRow' || type === 'review' || type === 'view'"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="整改人" prop="rectifyUser">
- <HcTasksUser
- :disabled="type === 'changeRow' || type === 'review' || type === 'view'" :is-change-popele="true"
- :contract-id="contractId" :project-id="projectId" :users="peoples"
- ui="w-full" @change="tasksUserChange"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-divider border-style="dashed" style="border: 1px dashed #cdd4e3;" />
- <el-row :gutter="20">
- <el-col :span="4">
- <el-form-item label="检查部位" prop="list">
- <el-button
- hc-btn
- type="primary"
- :disabled="type === 'changeRow' || type === 'review' || type === 'view'"
- @click="linksRelateModalClick"
- >
- <HcIcon name="add" />
- <span>点击选择</span>
- </el-button>
- </el-form-item>
- </el-col>
- </el-row>
- <div style="position: relative; 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'" />
- </template>
- <template #inspectContent="{ row }">
- <hc-table-input v-model="row.inspectContent" type="textarea" :disabled="type === 'changeRow' || type === 'review' || type === 'view'" />
- </template>
- <template #deductionStandard="{ row }">
- <hc-table-input v-model="row.deductionStandard" type="textarea" :disabled="type === 'review' || type === 'view'" />
- </template>
- <template #rectifyFeedback="{ row }">
- <hc-table-input v-model="row.rectifyFeedback" type="textarea" :disabled="type === 'review' || type === 'view'" />
- </template>
- <template #rectifyAttachment="{ row, index }">
- <template v-if="row?.rectifyAttachment">
- <el-link v-if=" type === 'changeRow' || type === 'add'" type="primary" @click="clickAttachment(row, index)">{{ row.rectifyAttachmentName }}</el-link>
- <el-link v-else @click="openAttachment(row)">{{ row.rectifyAttachmentName }}</el-link>
- </template>
-
- <el-link v-else type="primary" :disabled="type === 'review' || type === 'view'" @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, index }">
- <el-link v-if="row?.isShowImage == 0" type="primary" :disabled="type === 'review' || type === 'view'" @click="clickUploadInspect(row, index)">上传</el-link>
- <template v-else>
- <el-image v-if="type === 'confirmChange' || type === 'add'" style="width: 100px; height: 100px;cursor: pointer;" :src="row?.inspectPdfUrl" @click="clickUploadInspect(row, index)" />
- <el-image v-else style="width: 100px; height: 100px;cursor: pointer;" :src="row?.inspectPdfUrl" :preview-src-list="[row?.inspectPdfUrl]" :initial-index="0" hide-on-click-modal preview-teleported />
- </template>
- </template>
- <template #rectifyPdfUrl="{ row, index }">
- <el-link v-if="!row.rectifyPdfUrl" type="primary" :disabled="type === 'review' || type === 'view'" @click="clickRectifyPdfUrl(row, index)">上传</el-link>
- <template v-else>
- <el-image v-if="type === 'changeRow' || type === 'add' || type === 'confirmChange'" style="width: 100px; height: 100px;cursor: pointer;" :src="row.rectifyPdfUrl" @click="clickRectifyPdfUrl(row, index)" />
- <el-image v-else style="width: 100px; height: 100px;cursor: pointer;" :src="row?.rectifyPdfUrl" :preview-src-list="[row?.rectifyPdfUrl]" :initial-index="0" hide-on-click-modal preview-teleported />
- </template>
- </template>
- <template #action="{ row, index }">
- <el-link type="danger" :disabled="type === 'view' || type === 'changeRow'" @click="deleProcess(row, index)">删除</el-link>
- </template>
- </HcTable>
- </div>
- </el-form>
- </HcNewCard>
- <hc-new-dialog :show="linksRelateModal" is-table save-text="确认关联" title="关联工程用途及部位" widths="50rem" @close="linksRelateModalClose" @save="linksRelateModalSave">
- <div class="hc-tree-box">
- <div class="hc-search-tree-val">
- <el-input v-model="searchTreeVal" block clearable placeholder="请输入名称关键词检索" @keyup="searchTreeKeyUp">
- <template #suffix>
- <HcIcon name="search-2" ui="text-xl iscusor" @click="searchTreeClick" />
- </template>
- </el-input>
- </div>
- <div id="hc-tree-scrollbar" v-loading="treeLoading" class="hc-tree-scrollbar" element-loading-text="获取数据中...">
- <el-scrollbar v-show="isSearchTree" class="scroll-bar-right-16">
- <div class=" node-many-tree">
- <HcDataTree
- :datas="searchTreeData"
- show-checkbox
- default-expand-all
- :default-checked-keys="defaultChecked"
- :auto-expand-keys="TreeAutoExpandKeys"
- check-strictly
- @nodeTap="wbsElTreeClick"
- @check="divisionTreeCheck"
- @check-change="divisionTreeCheckChange"
- >
- <template #default="{ node, data }">
- <span style="font-size: 16px;">{{ data.title }}</span>
- </template>
- </HcDataTree>>
- </div>
- </el-scrollbar>
- <el-scrollbar v-show="!isSearchTree" class="scroll-bar-right-16">
- <div class=" node-many-tree">
- <HcLazyTree
- ref="processElTree"
- show-checkbox
- :default-checked-keys="defaultChecked"
- :auto-expand-keys="TreeAutoExpandKeys"
- check-strictly
- @check-change="divisionTreeCheckChange"
- @check="divisionTreeCheck"
- @load="treeLoadNode"
- @nodeTap="wbsElTreeClick"
- >
- <template #default="{ node, data }">
- <span style="font-size: 16px;">{{ data.title }}</span>
- </template>
- </HcLazyTree>
- </div>
- </el-scrollbar>
- </div>
- </div>
- </hc-new-dialog>
- <HcUploadFile
- ref="HcUploadFileRef"
- :options="UploadFileOptions"
- :params="uploadFileParams"
- :echo-params="uploadFileEchoParams"
- @progress="HcUploadFileProgress"
- @success="HcUploadFileSuccess"
- @change="HcUploadFileChange"
- @finish="HcUploadFileFinish"
- />
- </div>
- </template>
- <script setup>
- import { onActivated, ref } from 'vue'
- import { useAppStore } from '~src/store'
- import queryApi from '~api/data-fill/query'
- 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'
- import { getDictionary } from '~api/other'
- //初始变量
- const router = useRouter()
- const useAppState = useAppStore()
- const useRoutes = useRoute()
- const routerQuery = useRoutes?.query
- const type = ref(routerQuery?.type || 'add')
- const id = ref(routerQuery?.id || '')
- const projectId = ref(useAppState.getProjectId)
- const contractId = ref(useAppState.getContractId)
- const addFormRef = ref(null)
- const addForm = ref({})
- const addRules = {
- inspectName: {
- required: true,
- trigger: 'blur',
- message: '请输入名称',
- },
- inspectType: {
- required: true,
- trigger: 'blur',
- message: '请选择类别',
- },
- isRectify: {
- required: true,
- trigger: 'blur',
- message: '请选择是否需要整改',
- },
- rectifyUser: {
- required: true,
- trigger: 'blur',
- message: '请选择整改人',
- },
- list: {
- required: true,
- trigger: 'blur',
- message: '请选择检查部位',
- },
- rectifyDate:{
- required: true,
- trigger: 'blur',
- message: '请选择整改时间',
- },
- }
- //检查类别
- const typeOptions = ref([
- // { label:'安全巡检', value:1 },
- // { label:'质量巡检', value:2 },
- ])
- //获取检查类别Data = ref([])
- const getTypeOptions = async () => {
- const { data } = await getDictionary({
- code: 'inspect_type',
- })
- //处理数据
- typeOptions.value = getArrValue(data)
- typeOptions.value.forEach((ele)=>{
- ele.dictKey = Number(ele.dictKey)
- })
- }
- const tableColumn = ref([
- { key: 'inspectProject', name: '检查项目' },
- { key: 'inspectContent', name: '检查内容' },
- { key: 'rectifyFeedback', name: '整改反馈' },
- { key: 'rectifyAttachment', name: '整改附件', width:150 },
- { key: 'inspectPdfUrl', name: '图片', width:150 },
- { key: 'action', name: '操作', width:100 },
- ])
- //整改显示列
- onActivated(()=>{
- getTypeOptions()
- const routerQuery = useRoutes?.query
- type.value = routerQuery?.type || 'add'
- id.value = routerQuery?.id || ''
- if (id.value.length > 0) {
- getDetail( id.value)
- } else {
- addForm.value = {}
- processDataList.value = []
- peoples.value = ''
- }
- if (type.value === 'changeRow') {
- tableColumn.value = [
- { key: 'inspectProject', name: '检查项目' },
- { key: 'inspectContent', name: '检查内容' },
- { key: 'rectifyFeedback', name: '整改反馈' },
- { 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: 'inspectPdfUrl', name: '图片', width:150 },
- { key: 'rectifyFeedback', name: '整改反馈' },
- { key: 'rectifyAttachment', name: '整改附件', width:150 },
- { key: 'rectifyPdfUrl', name: '整改后图片', width:150 },
-
- ]
- } else {
- tableColumn.value = [
- { key: 'inspectProject', name: '检查项目' },
- { key: 'inspectContent', name: '检查内容' },
- { key: 'deductionStandard', name: '扣分标准' },
- { key: 'inspectUserName', name: '检查人名称' },
- { key: 'inspectPdfUrl', name: '图片', width:150 },
- { key: 'action', name: '操作', width:100 },
- ]
- }
- })
- //获取巡检详情
- 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 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', index:index }
- }
- //上传整改图片
- 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,
- }
- setTimeout(() => {
- HcUploadFileRef.value?.selectFile()
- }, 1000)
- 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: 'application/pdf,.doc,.docx,application/msword',
- accept_tip: 'PDF<br/>Word(doc、docx)',
- headers: getTokenHeader(),
- multiple: false,
- }
- HcUploadFileRef.value?.cancelUpload()
- setTimeout(() => {
- HcUploadFileRef.value?.selectFile()
- }, 500)
- 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({})
- // 文件上传进度
- const HcUploadFileProgress = (res) => {
- console.log('文件上传进度', res)
- }
- // 文件上传成功的回调
- const HcUploadFileSuccess = ({ echoParams, 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
- }
- // 文件全部上传成功
- const HcUploadFileChange = () => {
- console.log('文件全部上传成功')
- }
- const HcUploadFileFinish = ()=>{
- HcUploadFileRef.value?.setModalShow(false)
- }
- //选择整改人
- const peoples = ref('')
- //任务人选择改变
- const tasksUserChange = (a, b, users) => {
- addForm.value.rectifyUser = users
- }
- //关联工程用途及部位
- const linksRelateModal = ref(false)
- const linksRelateModalClick = ()=>{
- TreeAutoExpandKeys.value = processDataList.value[0]?.autoExpandKeys || []
- linksRelateModal.value = true
- isSearchTree.value = false
- newPushArr.value = []
-
- defaultChecked.value = arrToKey(processDataList.value, 'primaryKeyId', ',').split(',')
- }
- const linksRelateModalClose = ()=>{
- linksRelateModal.value = false
- }
- const processDataList = ref([])
- //获取展开节点
- const linksRelateModalSave = ()=>{
- let arr = []//当前选中的节点
- processDataList.value.forEach((ele)=>{
- defaultChecked.value.forEach((ele1)=>{
- if (ele.primaryKeyId === ele1) {
- arr.push(ele)
- }
- })
- })
- const keys = processElTree.value.treeRef.getCheckedKeys()
- for (let index = 0; index < keys.length; index++) {
- let node = processElTree.value.treeRef.getNode(keys[index])
- let pathArr = []
- getKeys(node, pathArr)
- TreeAutoExpandKeys.value = pathArr
-
- }
- newPushArr.value.forEach((ele)=>{
- arr.push({
- inspectProject:ele.title,
- primaryKeyId: ele.primaryKeyId,
- autoExpandKeys:TreeAutoExpandKeys.value,
- isShowImage:0,
- contractId:contractId.value,
-
- })
- })
- processDataList.value = arr
- addForm.value.list = arr
- linksRelateModal.value = false
-
- }
- const getKeys = (node, pathArr) => {
- if (node.parent) {
- pathArr.unshift(node.data?.primaryKeyId.replace(/(^\s*)|(\s*$)/g, '')) //去掉头尾空格
- getKeys(node.parent, pathArr)
- } else {
- return //根节点结束
- }
- }
- const getNorepeatArr = (tempArr)=> {
- let newArr = []
- for (let i = 0; i < tempArr.length; i++) {
- if (newArr.indexOf(tempArr[i].primaryKeyId) == -1) {
- newArr.push(tempArr[i].primaryKeyId)
- } else {
- tempArr.splice(i, 1)
- i--
- }
- }
- return tempArr
- }
- //移除工序
- const deleProcess = (row, index) => {
- const linkTabIds = processDataList.value
- linkTabIds.splice(index, 1)
- processDataList.value = linkTabIds
- }
- const searchTreeVal = ref('')
- const isSearchTree = ref(false)
- const searchTreeHeight = ref()
- //回车
- const searchTreeKeyUp = (e) => {
- if (e.key === 'Enter') {
- searchTreeClick()
- }
- }
- const searchTreeClick = async () => {
- if (searchTreeVal.value) {
- searchTreeHeight.value = document.getElementById('hc-tree-scrollbar').offsetHeight
- isSearchTree.value = true
- //treeLoading.value = true
- getSearchTreeData().then()
- } else {
- isSearchTree.value = false
- }
- }
- //回车
- const searchTreeData = ref([])
- const treeLoading = ref(false)
- const getSearchTreeData = async () => {
- treeLoading.value = true
- const { error, code, data } = await queryApi.getTreeNodeByQueryValueAndContractId({
- contractId: contractId.value,
- queryValue: searchTreeVal.value,
- tableOwner:1,
- })
- //判断状态
- if (!error && code === 200) {
- let treedata = getArrValue(data)
- searchTreeData.value = treedata
- treeLoading.value = false
- } else {
- treeLoading.value = false
- searchTreeData.value = []
- }
- }
- const wbsElTreeClick = ({ node, data, keys })=>{
- console.log(keys, 'keys')
- TreeAutoExpandKeys.value = keys || []
- }
- //懒加载的数据
- const treeLoadNode = async ({ node, item, level }, resolve) => {
- let contractIdRelation = '', parentId = '', primaryKeyId = ''
- if (level !== 0) {
- const nodeData = getObjValue(item)
- contractIdRelation = nodeData?.contractIdRelation || ''
- parentId = contractIdRelation ? nodeData?.primaryKeyId : nodeData?.id
- primaryKeyId = nodeData?.id || ''
- }
- //获取数据
- const { data } = await queryApi.queryWbsTreeData({
- contractId: contractId.value || '',
- contractIdRelation,
- primaryKeyId,
- parentId,
- // classifyType: contractTypeTabKey.value,
- classifyType:1,
- tableOwner:1,
- })
- resolve(getArrValue(data))
- }
- const divisionTreeCheck = (data, { checkedNodes, checkedKeys }) => {
- }
- const newPushArr = ref([])
- const divisionTreeCheckChange = (data, ischeck, data1)=>{
- if (!ischeck) {
- defaultChecked.value.forEach((ele, index)=>{
- if (ele === data.primaryKeyId) {
- defaultChecked.value.splice(index, 1)
- }
- })
- } else {
- defaultChecked.value.push(data.primaryKeyId)
- newPushArr.value.push(data)
- }
- }
- const defaultChecked = ref([]) //默认选中
- const TreeAutoExpandKeys = ref([])//默认展开
- const processElTree = ref(null)
- const goList = ()=>{
- router.push({
- path: '/patrol/safe',
-
- })
- }
- 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.contractId = contractId.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('操作成功')
-
- goList()
- }
- }
- }
- //修改数据
- 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('操作成功')
- goList()
- }
- }
- }
- //清除数据
- 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('操作成功')
- router.push({
- path: '/patrol/manage',
-
- })
- }
- }
- }
- //复核检测
- 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>
- .bgGray{
- background-color: rgba(32, 77, 161, 0.08);;
- }
- .hc-table-form-content .hc-content-box .hc-table-forem-box .hc-fixed-page {
- .el-button {
- display: block;
- margin: 20px;
- }
- }
- </style>
- <style lang='scss' scoped>
- .hc-process-box {
-
- position: relative;
- flex: 1;
- overflow: hidden;
- .hc-scrollbar-box {
- display: contents;
- }
- .process-item-box {
- position: relative;
- color: #838791;
- font-size: 14px;
- padding: 8px 0;
- display: flex;
- align-items: flex-start;
- .process-item {
- position: relative;
- flex: 1;
- }
- .process-icon {
- font-size: 20px;
- cursor: pointer;
- margin-left: 16px;
- transition: color 0.2s;
- &:hover {
- color: var(--el-color-primary-light-3);
- }
- }
- }
- .process-item-box + .process-item-box {
- border-top: 0.5px solid #e9e9e9;
- }
- }
- </style>
|