Parcourir la source

新增整改管理页面

duy il y a 1 an
Parent
commit
a226c9d824

+ 12 - 3
src/global/components/hc-tasks-user/index.vue

@@ -1,6 +1,6 @@
 <template>
     <div :class="ui" class="hc-tasks-user">
-        <div class="tasks-user-box">
+        <div class="tasks-user-box" :class="disabled ? 'no-check' : ''">
             <div class="tag-user-list" @click="showModalClick">
                 <template v-for="(item, index) in UserDataList" :key="index">
                     <el-tag>{{ setCheckboxUserName(item) }}</el-tag>
@@ -188,6 +188,10 @@ const props = defineProps({
         type: [String, Number],
         default: '', //上报任务ID
     },
+    disabled:{
+        type:Boolean,
+        default:false,
+    },
 
 })
 
@@ -206,7 +210,7 @@ const classifyType = ref(props.classifyType)
 const tableOwner = ref(props.tableOwner)
 const nodeId = ref(props.nodeId)
 const infoIds = ref(props.infoIds)
-
+const disabled = ref(props.disabled)
 //树数据
 const ElTreeProps = { children: 'childRoleList', label: 'roleName' }
 const ElTreeData = ref([{
@@ -227,7 +231,8 @@ watch(() => [
     props.tableOwner,
     props.nodeId,
     props.infoIds,
-], ([users, pid, cid, type, data, cla, tab, noid, infoid]) => {
+    props.disabled,
+], ([users, pid, cid, type, data, cla, tab, noid, infoid, disa]) => {
     projectId.value = pid
     contractId.value = cid
     isTypes.value = type
@@ -237,6 +242,7 @@ watch(() => [
     tableOwner.value = tab
     nodeId.value = noid
     infoIds.value = infoid
+    disabled.value = disa
 })
 
 //渲染完成
@@ -430,6 +436,9 @@ const getCheckCustomFlowUserIsEVisaPermissionsquery = async (flowJson, newUser,
 </style>
 
 <style lang="scss">
+.no-check{
+    cursor: not-allowed !important;
+}
 .hc-tasks-user .tasks-user-box .tag-user-list {
     .el-tag {
         --el-icon-size: 14px;

+ 1 - 1
src/router/modules/base.js

@@ -410,7 +410,7 @@ export default [
             {
                 path: '/patrol/manage',
                 name: 'patrol-menu-manage',
-                meta: { title: '安全巡检' },
+                meta: { title: '整改管理' },
                 component: () => import('~src/views/patrol/manage.vue'),
             },
            

+ 137 - 36
src/views/patrol/add.vue

@@ -4,6 +4,15 @@
         <HcNewCard ui="bgGray">
             <template #extra>
                 <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
                     color="#e54d42"
                     style="color: white;"
@@ -12,6 +21,7 @@
                     <span>清空数据</span>
                 </el-button>
                 <el-button
+                    v-if="type === ''"
                     hc-btn
                     color="#12C060"
                     style="color: white;"
@@ -19,17 +29,55 @@
                     <HcIcon name="save" />
                     <span>保存数据</span>
                 </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>
             <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="name">
-                            <el-input v-model="addForm.name" placeholder="请输入" />
+                            <el-input v-model="addForm.name" placeholder="请输入" :disabled="type === 'changeRow'" />
                         </el-form-item>
                     </el-col>
                     <el-col :span="12">
                         <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-select>
                         </el-form-item>
@@ -45,19 +93,23 @@
                         </el-form-item>
                     </el-col>
                 </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-col :span="12">
                         <el-form-item label="整改人" prop="key4">
-                            <!-- <el-button
-                                hc-btn
-                                type="primary"
-                                @click="checkPeople"
-                            >
-                                <HcIcon name="add" />
-                                <span>点击选择</span>
-                            </el-button> -->
                             <HcTasksUser
-         
+                                :disabled="type === 'changeRow'"
                                 :contract-id="contractId" :project-id="projectId" :users="peoples"
                                 ui="w-full" @change="tasksUserChange"
                             />
@@ -71,6 +123,7 @@
                             <el-button
                                 hc-btn
                                 type="primary"
+                                :disabled="type === 'changeRow'"
                                 @click="linksRelateModalClick"
                             >
                                 <HcIcon name="add" />
@@ -82,27 +135,27 @@
                 <div style="position: relative; height: 400px">
                     <HcTable :column="tableColumn" :datas="tableData">
                         <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 #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 #key3="{ row }">
                             <hc-table-input v-model="row.key3" type="textarea" />
                         </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 }">
                             <hc-table-input v-model="row.key4" type="textarea" />
                         </template>
                         <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" />
                         </template>
                         <template #action="{ row }">
@@ -151,17 +204,30 @@
                 </div>
             </div>
         </hc-new-dialog>
+        <HcUploadFile
+            ref="HcUploadFileRef"
+            :options="UploadFileOptions"
+            @progress="HcUploadFileProgress"
+            @success="HcUploadFileSuccess"
+            @change="HcUploadFileChange"
+        />
     </div>
 </template>
 
 <script setup>
-import { nextTick, ref, watch } from 'vue'
+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 { useRoute, useRouter } from 'vue-router'
 import { getTokenHeader } from '~src/api/request/header'
+
+//初始变量
+const router = useRouter()
 const useAppState = useAppStore()
+const useRoutes = useRoute()
+const routerQuery = useRoutes?.query
+const type = ref(routerQuery?.type || '')
 const projectId = ref(useAppState.getProjectId)
 const contractId = ref(useAppState.getContractId)
 const addFormRef = ref(null)
@@ -192,30 +258,59 @@ const addRules = {
         trigger: 'blur',
         message: '请选择检查部位',
     },
+    time:{
+        required: true,
+        trigger: 'blur',
+        message: '请选择整改时间',
+    },
+
 
 }
+
 //检查类别
 const typeOptions = ref([
     { label:'安全巡检', value:1 },
     { 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([
-    { 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 = {
     //此处设置header
@@ -326,6 +421,12 @@ const divisionTreeItemInfo = ref({})
 const divisionTreeCheck = ({ data }) => {
     divisionTreeItemInfo.value = data
 }
+const goList = ()=>{
+    router.push({
+        path: '/patrol/safe',
+    
+    })
+}
 </script>
 
 <style lang='scss' scoped>

+ 56 - 1
src/views/patrol/manage.vue

@@ -1,10 +1,65 @@
 <!--  -->
 <template>
-    <div>整改管理</div>
+    <div class="hc-page-box">
+        <HcNewCard>
+            <HcTable is-new :column="tableColumn" :datas="tableData">
+                <template #key3="{ row }">
+                    <span class="text-link" @click="tableRowEdit(row)">{{ row?.key3 }}</span>
+                </template>
+                <template #action="{ row }">
+                    <el-link v-if="row.isType" type="primary" @click="changeRow(row)">整改</el-link>
+                    <el-link v-else type="primary">撤回提交</el-link>
+                </template>
+            </HcTable>
+            <template #action>
+                <HcPages :pages="searchForm" @change="pageChange" />
+            </template>
+        </HcNewCard>
+    </div>
 </template>
 
 <script setup>
 import { ref, watch } from 'vue'
+import { useRouter } from 'vue-router'
+//初始变量
+const router = useRouter()
+const tableColumn = [
+    { key: 'key1', name: '项目' },
+    { key: 'key2', name: '检查类别' },
+    { key: 'key3', name: '检查名称' },
+    { key: 'key4', name: '复核检查状态' },
+    { key: 'key5', name: '是否需要整改' },
+    { key: 'key6', name: '需求整改完成日期' },
+    { key: 'key7', name: '实际整改完成日期' },
+    { key: 'action', name: '操作' },
+]
+const tableData = ref([
+    { key1: 'xx至xx高速公路-演示项(本地测试)', key2: '安全巡检', key3: '原地面检查', key4:'检查状态', key5:'需要整改', key6:'2023-09-27', key7:'2023-09-27', isType:true },
+    { key1: 'xx至xx高速公路-演示项(本地测试)', key2: '安全巡检', key3: '原地面检查', key4:'检查状态', key5:'需要整改', key6:'2023-09-27', key7:'2023-09-27', isType:false },
+    { key1: 'xx至xx高速公路-演示项(本地测试)', key2: '安全巡检', key3: '原地面检查', key4:'检查状态', key5:'需要整改', key6:'2023-09-27', key7:'2023-09-27', isType:true },
+])
+//搜索表单
+const searchForm = ref({
+    current: 1, size: 20, total: 0,
+})
+//分页被点击
+const pageChange = ({ current, size }) => {
+    searchForm.value.current = current
+    searchForm.value.size = size
+    // getTableData()
+}
+const tableRowEdit = (row)=>{
+    changeRow(row)
+}
+//提交整改
+const changeRow = (row)=>{
+    router.push({
+        path: '/patrol/add',
+        query: {
+            type: 'changeRow',
+        },
+    })
+}
 </script>
 
 <style lang='scss' scoped>

+ 27 - 3
src/views/patrol/safe.vue

@@ -7,8 +7,8 @@
                     <span class="text-link" @click="tableRowEdit(row)">{{ row?.key3 }}</span>
                 </template>
                 <template #action="{ row }">
-                    <el-link type="primary">复核</el-link>
-                    <el-link type="primary">修改</el-link>
+                    <el-link type="primary" @click="reviewRow(row)">复核</el-link>
+                    <el-link type="primary" @click="updateRow(row)">修改</el-link>
                     <el-link type="primary">删除</el-link>
                 </template>
             </HcTable>
@@ -21,6 +21,9 @@
 
 <script setup>
 import { ref, watch } from 'vue'
+import { useRouter } from 'vue-router'
+//初始变量
+const router = useRouter()
 const tableColumn = [
     { key: 'key1', name: '项目' },
     { key: 'key2', name: '检查类别' },
@@ -47,7 +50,28 @@ const pageChange = ({ current, size }) => {
     // getTableData()
 }
 const tableRowEdit = ()=>{
-    
+    router.push({
+        path: '/patrol/add',
+        query: {
+            type: 'view',
+        },
+    })
+}
+const updateRow = (row)=>{
+    router.push({
+        path: '/patrol/add',
+        query: {
+            type: 'confirmChange',
+        },
+    })
+}
+const reviewRow = (row)=>{
+    router.push({
+        path: '/patrol/add',
+        query: {
+            type: 'review',
+        },
+    })
 }
 </script>