|
@@ -4,6 +4,15 @@
|
|
<HcNewCard ui="bgGray">
|
|
<HcNewCard ui="bgGray">
|
|
<template #extra>
|
|
<template #extra>
|
|
<el-button
|
|
<el-button
|
|
|
|
+ hc-btn
|
|
|
|
+ color="rgb(154, 154, 154)"
|
|
|
|
+ style="color: white;"
|
|
|
|
+ >
|
|
|
|
+ <HcIcon name="arrow-go-back" />
|
|
|
|
+ <span>返回</span>
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="type !== 'view' && type !== 'review'"
|
|
hc-btn
|
|
hc-btn
|
|
color="#e54d42"
|
|
color="#e54d42"
|
|
style="color: white;"
|
|
style="color: white;"
|
|
@@ -12,6 +21,7 @@
|
|
<span>清空数据</span>
|
|
<span>清空数据</span>
|
|
</el-button>
|
|
</el-button>
|
|
<el-button
|
|
<el-button
|
|
|
|
+ v-if="type === ''"
|
|
hc-btn
|
|
hc-btn
|
|
color="#12C060"
|
|
color="#12C060"
|
|
style="color: white;"
|
|
style="color: white;"
|
|
@@ -19,17 +29,55 @@
|
|
<HcIcon name="save" />
|
|
<HcIcon name="save" />
|
|
<span>保存数据</span>
|
|
<span>保存数据</span>
|
|
</el-button>
|
|
</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="type === 'changeRow'"
|
|
|
|
+ hc-btn
|
|
|
|
+ color="#12C060"
|
|
|
|
+ style="color: white;"
|
|
|
|
+ >
|
|
|
|
+ <HcIcon name="save" />
|
|
|
|
+ <span>提交整改记录</span>
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="type === 'confirmChange'"
|
|
|
|
+ hc-btn
|
|
|
|
+ color="#12C060"
|
|
|
|
+ style="color: white;"
|
|
|
|
+ >
|
|
|
|
+ <HcIcon name="save" />
|
|
|
|
+ <span>确认修改</span>
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="type === 'review'"
|
|
|
|
+ hc-btn
|
|
|
|
+ color="#12C060"
|
|
|
|
+ style="color: white;"
|
|
|
|
+ @click="goList"
|
|
|
|
+ >
|
|
|
|
+ <HcIcon name="save" />
|
|
|
|
+ <span>复核检查通过</span>
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="type === 'review'"
|
|
|
|
+ hc-btn
|
|
|
|
+ color="rgb(189, 49, 36)"
|
|
|
|
+ style="color: white;"
|
|
|
|
+ @click="goList"
|
|
|
|
+ >
|
|
|
|
+ <HcIcon name="save" />
|
|
|
|
+ <span>复核检查未通过</span>
|
|
|
|
+ </el-button>
|
|
</template>
|
|
</template>
|
|
<el-form ref="addFormRef" :model="addForm" :rules="addRules" label-width="auto" size="large" label-position="left">
|
|
<el-form ref="addFormRef" :model="addForm" :rules="addRules" label-width="auto" size="large" label-position="left">
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="检查名称" prop="name">
|
|
<el-form-item label="检查名称" prop="name">
|
|
- <el-input v-model="addForm.name" placeholder="请输入" />
|
|
|
|
|
|
+ <el-input v-model="addForm.name" placeholder="请输入" :disabled="type === 'changeRow'" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="检查类别" prop="type">
|
|
<el-form-item label="检查类别" prop="type">
|
|
- <el-select v-model="addForm.type" placeholder="请选择" clearable style="width:100%">
|
|
|
|
|
|
+ <el-select v-model="addForm.type" placeholder="请选择" clearable style="width:100%" :disabled="type === 'changeRow'">
|
|
<el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
<el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -45,19 +93,23 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="整改日期" prop="time">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="addForm.time"
|
|
|
|
+ type="date"
|
|
|
|
+ :disabled="type === 'changeRow'"
|
|
|
|
+ placeholder="请选择整改日期"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="整改人" prop="key4">
|
|
<el-form-item label="整改人" prop="key4">
|
|
- <!-- <el-button
|
|
|
|
- hc-btn
|
|
|
|
- type="primary"
|
|
|
|
- @click="checkPeople"
|
|
|
|
- >
|
|
|
|
- <HcIcon name="add" />
|
|
|
|
- <span>点击选择</span>
|
|
|
|
- </el-button> -->
|
|
|
|
<HcTasksUser
|
|
<HcTasksUser
|
|
-
|
|
|
|
|
|
+ :disabled="type === 'changeRow'"
|
|
:contract-id="contractId" :project-id="projectId" :users="peoples"
|
|
:contract-id="contractId" :project-id="projectId" :users="peoples"
|
|
ui="w-full" @change="tasksUserChange"
|
|
ui="w-full" @change="tasksUserChange"
|
|
/>
|
|
/>
|
|
@@ -71,6 +123,7 @@
|
|
<el-button
|
|
<el-button
|
|
hc-btn
|
|
hc-btn
|
|
type="primary"
|
|
type="primary"
|
|
|
|
+ :disabled="type === 'changeRow'"
|
|
@click="linksRelateModalClick"
|
|
@click="linksRelateModalClick"
|
|
>
|
|
>
|
|
<HcIcon name="add" />
|
|
<HcIcon name="add" />
|
|
@@ -82,27 +135,27 @@
|
|
<div style="position: relative; height: 400px">
|
|
<div style="position: relative; height: 400px">
|
|
<HcTable :column="tableColumn" :datas="tableData">
|
|
<HcTable :column="tableColumn" :datas="tableData">
|
|
<template #key1="{ row }">
|
|
<template #key1="{ row }">
|
|
- <hc-table-input v-model="row.key1" type="textarea" />
|
|
|
|
|
|
+ <hc-table-input v-model="row.key1" type="textarea" :disabled="type === 'changeRow'" />
|
|
</template>
|
|
</template>
|
|
<template #key2="{ row }">
|
|
<template #key2="{ row }">
|
|
- <hc-table-input v-model="row.key2" type="textarea" />
|
|
|
|
|
|
+ <hc-table-input v-model="row.key2" type="textarea" :disabled="type === 'changeRow'" />
|
|
</template>
|
|
</template>
|
|
<template #key3="{ row }">
|
|
<template #key3="{ row }">
|
|
<hc-table-input v-model="row.key3" type="textarea" />
|
|
<hc-table-input v-model="row.key3" type="textarea" />
|
|
</template>
|
|
</template>
|
|
|
|
+ <template #key11="{ row }">
|
|
|
|
+ <hc-table-input v-model="row.key11" type="textarea" />
|
|
|
|
+ </template>
|
|
|
|
+ <template #key12="{ row }">
|
|
|
|
+ <el-link v-if="row.key12" type="primary">{{ row.key12 }}</el-link>
|
|
|
|
+ <el-link v-else type="primary" @click="clickUpload">上传</el-link>
|
|
|
|
+ </template>
|
|
<template #key4="{ row }">
|
|
<template #key4="{ row }">
|
|
<hc-table-input v-model="row.key4" type="textarea" />
|
|
<hc-table-input v-model="row.key4" type="textarea" />
|
|
</template>
|
|
</template>
|
|
<template #key5="{ row }">
|
|
<template #key5="{ row }">
|
|
- <HcUploadFile
|
|
|
|
- v-if="true"
|
|
|
|
- :options="UploadFileOptions"
|
|
|
|
- @progress="HcUploadFileProgress"
|
|
|
|
- @success="HcUploadFileSuccess"
|
|
|
|
- @change="HcUploadFileChange"
|
|
|
|
- >
|
|
|
|
- <el-link type="primary">上传</el-link>
|
|
|
|
- </HcUploadFile>
|
|
|
|
|
|
+ <el-link v-if="true" type="primary" @click="clickUpload">上传</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="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" />
|
|
</template>
|
|
</template>
|
|
<template #action="{ row }">
|
|
<template #action="{ row }">
|
|
@@ -151,17 +204,30 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</hc-new-dialog>
|
|
</hc-new-dialog>
|
|
|
|
+ <HcUploadFile
|
|
|
|
+ ref="HcUploadFileRef"
|
|
|
|
+ :options="UploadFileOptions"
|
|
|
|
+ @progress="HcUploadFileProgress"
|
|
|
|
+ @success="HcUploadFileSuccess"
|
|
|
|
+ @change="HcUploadFileChange"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { nextTick, ref, watch } from 'vue'
|
|
|
|
|
|
+import { nextTick, onActivated, ref, watch } from 'vue'
|
|
import { useAppStore } from '~src/store'
|
|
import { useAppStore } from '~src/store'
|
|
import queryApi from '~api/data-fill/query'
|
|
import queryApi from '~api/data-fill/query'
|
|
import { getArrValue, getObjValue } from 'js-fast-way'
|
|
import { getArrValue, getObjValue } from 'js-fast-way'
|
|
-
|
|
|
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
import { getTokenHeader } from '~src/api/request/header'
|
|
import { getTokenHeader } from '~src/api/request/header'
|
|
|
|
+
|
|
|
|
+//初始变量
|
|
|
|
+const router = useRouter()
|
|
const useAppState = useAppStore()
|
|
const useAppState = useAppStore()
|
|
|
|
+const useRoutes = useRoute()
|
|
|
|
+const routerQuery = useRoutes?.query
|
|
|
|
+const type = ref(routerQuery?.type || '')
|
|
const projectId = ref(useAppState.getProjectId)
|
|
const projectId = ref(useAppState.getProjectId)
|
|
const contractId = ref(useAppState.getContractId)
|
|
const contractId = ref(useAppState.getContractId)
|
|
const addFormRef = ref(null)
|
|
const addFormRef = ref(null)
|
|
@@ -192,30 +258,59 @@ const addRules = {
|
|
trigger: 'blur',
|
|
trigger: 'blur',
|
|
message: '请选择检查部位',
|
|
message: '请选择检查部位',
|
|
},
|
|
},
|
|
|
|
+ time:{
|
|
|
|
+ required: true,
|
|
|
|
+ trigger: 'blur',
|
|
|
|
+ message: '请选择整改时间',
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
//检查类别
|
|
//检查类别
|
|
const typeOptions = ref([
|
|
const typeOptions = ref([
|
|
{ label:'安全巡检', value:1 },
|
|
{ label:'安全巡检', value:1 },
|
|
{ label:'质量巡检', value:2 },
|
|
{ label:'质量巡检', value:2 },
|
|
])
|
|
])
|
|
|
|
|
|
-const tableColumn = [
|
|
|
|
- { key: 'key1', name: '检查项目' },
|
|
|
|
- { key: 'key2', name: '检查内容' },
|
|
|
|
- { key: 'key3', name: '扣分标准' },
|
|
|
|
- { key: 'key4', name: '检查人名称' },
|
|
|
|
- { key: 'key5', name: '图片', width:150 },
|
|
|
|
- { key: 'action', name: '操作', width:100 },
|
|
|
|
-]
|
|
|
|
|
|
+const tableColumn = ref([])
|
|
|
|
+//整改显示列
|
|
|
|
+
|
|
const tableData = ref([
|
|
const tableData = ref([
|
|
- { id: 1, name: '名称1', text: '文本1', color: 'red' },
|
|
|
|
- { id: 2, name: '名称2', text: '文本2', color: 'blue' },
|
|
|
|
- { id: 3, name: '名称3', text: '文本3', color: '无' },
|
|
|
|
|
|
+ { 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')
|
|
|
|
+ if (type.value === 'changeRow') {
|
|
|
|
+ tableColumn.value = [
|
|
|
|
+ { key: 'key1', name: '检查项目' },
|
|
|
|
+ { key: 'key2', name: '检查内容' },
|
|
|
|
+ { key: 'key11', name: '整改反馈' },
|
|
|
|
+ { key: 'key12', name: '整改附件' },
|
|
|
|
+ { key: 'key5', name: '图片', width:150 },
|
|
|
|
+ { key: 'action', name: '操作', width:100 },
|
|
|
|
+ ]
|
|
|
|
+ } else {
|
|
|
|
+ tableColumn.value = [
|
|
|
|
+ { key: 'key1', name: '检查项目' },
|
|
|
|
+ { key: 'key2', name: '检查内容' },
|
|
|
|
+ { key: 'key3', name: '扣分标准' },
|
|
|
|
+ { key: 'key4', name: '检查人名称' },
|
|
|
|
+ { key: 'key5', name: '图片', width:150 },
|
|
|
|
+ { key: 'action', name: '操作', width:100 },
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
+const HcUploadFileRef = ref(null)
|
|
|
|
+const clickUpload = ()=>{
|
|
|
|
+ HcUploadFileRef.value?.selectFile()
|
|
|
|
+}
|
|
//上传配置
|
|
//上传配置
|
|
const UploadFileOptions = {
|
|
const UploadFileOptions = {
|
|
//此处设置header
|
|
//此处设置header
|
|
@@ -326,6 +421,12 @@ const divisionTreeItemInfo = ref({})
|
|
const divisionTreeCheck = ({ data }) => {
|
|
const divisionTreeCheck = ({ data }) => {
|
|
divisionTreeItemInfo.value = data
|
|
divisionTreeItemInfo.value = data
|
|
}
|
|
}
|
|
|
|
+const goList = ()=>{
|
|
|
|
+ router.push({
|
|
|
|
+ path: '/patrol/safe',
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang='scss' scoped>
|
|
<style lang='scss' scoped>
|