123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421 |
- <!--巡查计划-->
- <template>
- <div class="app-container inspectionPlan">
- <div class="page-container" v-if="pageType == 1">
- <div class="page-form-title-box">
- <el-form :model="queryParams" class="form-box" ref="queryForm" :inline="true" label-width="80px">
- <div class="form-button-max-big-box">
- <div class="form-button-big-box">
- <p class="text-p" :class="queryParams.checkStatus=='0'?'checkDiv':''" @click="topLeftClickType('0')">全部</p>
- <p class="text-p" :class="queryParams.checkStatus=='1'?'checkDiv':''" @click="topLeftClickType('1')">未开始</p>
- <p class="text-p" :class="queryParams.checkStatus=='2'?'checkDiv':''" @click="topLeftClickType('2')">进行中</p>
- <p class="text-p" :class="queryParams.checkStatus=='3'?'checkDiv':''" @click="topLeftClickType('3')">已结束</p>
- </div>
- </div>
- <!--与我相关-->
- <div class="form-button-max-big-box-me">
- <div class="form-button-big-box-me">
- <div :class="queryParams.myRelated==1?'checkDiv-me':''" @click="topRightClickType">
- <p class="text-p-me">与我有关{{correlationNum}}</p>
- <p class="el-icon-check icon-p-me" v-if="queryParams.myRelated==1"></p>
- </div>
- </div>
- </div>
- <el-form-item label="" prop="searchValue" style="margin-left:10px;" label-width="70px">
- <el-input
- maxLength="30"
- v-model="queryParams.searchValue"
- placeholder="计划标题/创建人"
- clearable
- style="width: 200px"
- />
- </el-form-item>
- <el-form-item label="" prop="dateRange" label-width="70px">
- <el-date-picker
- :clearable="false"
- v-model="dateRange"
- size="small"
- style="width: 240px"
- value-format="yyyy-MM-dd"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- ></el-date-picker>
- </el-form-item>
- <p class="page-inquire-common-style-button" @click="handleQuery" style="margin-right:10px;">查询</p>
- <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
- <p class="page-add-common-style-button"
- style="width:130px;float: right;"
- @click="addDialogOpen(1)"
- >创建巡查计划</p>
- </el-form>
- </div>
- <div class="page-content-box">
- <el-table class="table-box" border :data="tableList" ref="multipleTable" @sort-change="sortChange">
- <el-table-column label="序号" align="center" type="index" width="60" />
- <el-table-column label="计划标题" align="center" prop="title" show-overflow-tooltip/>
- <el-table-column label="检查范围" align="center" prop="checkRange" show-overflow-tooltip width="120">
- <template slot-scope="scope">
- <p>{{scope.row.checkRange==1?'全校':(scope.row.checkRange==2?'学院':(scope.row.checkRange==3?'实验室':''))}}</p>
- </template>
- </el-table-column>
- <el-table-column label="检查类型" align="center" prop="checkRange" show-overflow-tooltip width="120">
- <template slot-scope="scope">
- <p>{{scope.row.checkCategory==1?'综合检查':(scope.row.checkCategory==2?'专项检查':'-')}}</p>
- </template>
- </el-table-column>
- <el-table-column label="计划周期" align="center" prop="cycleStartTime" show-overflow-tooltip width="260">
- <template slot-scope="scope">
- <p>{{scope.row.cycleStartTime}} 至 {{scope.row.cycleEndTime}}<span style="color:#EE0606;margin-left:15px;" v-if="scope.row.isOverdue==1">已逾期</span></p>
- </template>
- </el-table-column>
- <el-table-column label="状态" align="center" prop="checkStatus" show-overflow-tooltip width="80">
- <template slot-scope="scope">
- <p :class="scope.row.checkStatus==1?'checkStatus-color-1':(scope.row.checkStatus==2?'checkStatus-color-2':(scope.row.checkStatus==3?'checkStatus-color-3':''))">{{scope.row.checkStatus==1?'未开始':(scope.row.checkStatus==2?'进行中':(scope.row.checkStatus==3?'已结束':''))}}</p>
- </template>
- </el-table-column>
- <el-table-column label="检查进度" align="center" prop="checkSchedule" show-overflow-tooltip width="210"/>
- <el-table-column label="创建人" align="center" prop="createName" show-overflow-tooltip width="130"/>
- <el-table-column label="创建时间" sortable="custom" align="center" prop="createTime" show-overflow-tooltip width="157"/>
- <el-table-column label="操作" align="center" prop="deptName" width="280">
- <template slot-scope="scope">
- <div class="table-button-box">
- <p class="table-button-null"></p>
- <p class="table-button-p" v-hasPermiRouter="['security:checkPlan:query']"
- v-show="scope.row.checkStatus!=1" @click="addDialogOpen(3,scope.row)">详情</p>
- <p class="table-button-p" v-hasPermiRouter="['security:checkPlan:edit']"
- v-show="scope.row.checkStatus==1&&scope.row.isSelfData == 1" @click="addDialogOpen(2,scope.row)">编辑</p>
- <p class="table-button-p" v-hasPermiRouter="['security:checkManage_2:list']"
- @click="goPage(2,scope.row)">巡查管理</p>
- <p class="table-button-p" v-hasPermiRouter="['security:checkPlan:remove']"
- v-show="scope.row.checkStatus==1&&scope.row.isSelfData == 1" @click="deleteObj(scope.row)">删除</p>
- <p class="table-button-p" v-show="scope.row.isAttachment == 1" @click="lookDocumentListButton(1,scope.row)">查看附件</p>
- <p class="table-button-null"></p>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <pagination :page-sizes="[20, 30, 40, 50]"
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.page"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </div>
- </div>
- <list-page v-if="pageType == 2" :propsListPageData="propsListPageData"></list-page>
- <add-dialog v-if="addDialogType" :addDialogData="addDialogData"></add-dialog>
- <lookDocumentListDialog v-if="lookDocumentListType" :propsLookDocumentListData="propsLookDocumentListData"></lookDocumentListDialog>
- </div>
- </template>
- <script>
- import addDialog from './addDialog.vue'
- import listPage from './listPage.vue'
- import lookDocumentListDialog from '@/components/lookDocumentDialog/lookDocumentListDialog.vue'
- import { checkPlanList,checkPlanDelete,getFindByCheckPlanId } from '@/apiDemo/safetyCheck/index'
- export default {
- name: 'index',
- components: {
- addDialog,
- listPage,
- lookDocumentListDialog
- },
- data(){
- return{
- //子组件数据
- lookDocumentListType:false,
- propsLookDocumentListData:{},
- propsListPageData:{},
- addDialogType:false,
- addDialogData:{},
- pageType:1,
- queryParams:{
- page:1,
- pageSize:20,
- checkStatus:0,
- createTimeSort:0,
- searchValue:"",
- checkType:1,
- myRelated:1,
- },
- dateRange:[],
- tableList:[],
- total:0,
- correlationNum:'',
- }
- },
- created(){
- },
- mounted(){
- this.getList();
- },
- methods:{
- //获取相关数量
- getCorrelationNum(){
- checkPlanList({
- page:1,
- pageSize:20,
- createTimeSort:0,
- checkType:1,
- myRelated:1,
- checkStatus:this.queryParams.checkStatus,
- searchValue:this.queryParams.searchValue,
- cycleStartTime:this.dateRange[0]?this.dateRange[0]+'T00:00:00':'',
- cycleEndTime:this.dateRange[1]?this.dateRange[1]+'T23:59:59':'',
- }).then(response => {
- this.$set(this,'correlationNum',response.data.total>999?' 999+':(response.data.total<1?'':' '+response.data.total));
- });
- },
- //与我相关按钮
- topRightClickType(){
- this.$set(this.queryParams,'myRelated',this.queryParams.myRelated==1?0:1);
- this.handleQuery();
- },
- //切换页面
- goPage(type,data){
- if(this.pageType != type){
- if(type == 2){
- this.$set(this,'propsListPageData',data);
- this.$set(this,'pageType',type);
- }else if(type == 1){
- this.$set(this,'pageType',type);
- }else if(type == 3){
- this.$set(this,'pageType',1);
- this.getList();
- }
- }
- },
- //弹窗开启
- addDialogOpen(type,data){
- if(type==1){
- this.$set(this,'addDialogData',{
- title:"创建巡查计划",
- lookInfoType:false,
- addType:true,
- })
- this.$set(this,'addDialogType',true);
- }else if(type==2){
- this.$set(this,'addDialogData',{
- title:"编辑巡查计划",
- id:data.id,
- lookInfoType:false,
- addType:false,
- })
- this.$set(this,'addDialogType',true);
- }else if(type==3){
- this.$set(this,'addDialogData',{
- title:"巡查计划详情",
- id:data.id,
- lookInfoType:true,
- addType:false,
- })
- this.$set(this,'addDialogType',true);
- }else if(type==4){
- this.$set(this,'addDialogType',false);
- }else if(type == 5){
- this.$set(this,'addDialogType',false);
- this.getList();
- }
- },
- //范围选择
- topLeftClickType(type){
- if(this.queryParams.checkStatus != type){
- this.$set(this.queryParams,'checkStatus',type);
- this.handleQuery();
- }
- },
- //时间排序方法
- sortChange(val){
- if(val.prop == 'createTime'){
- this.$set(this.queryParams,'createTimeSort',val.order=='ascending'?'1':(val.order=='descending'?'2':'0'));
- this.handleQuery();
- }
- },
- //获取数据列表
- getList(){
- let obj = JSON.parse(JSON.stringify(this.queryParams))
- if(this.dateRange[0]){
- obj.cycleStartTime = this.dateRange[0]+'T00:00:00';
- obj.cycleEndTime = this.dateRange[1]+'T23:59:59';
- }else{
- obj.cycleStartTime = "";
- obj.cycleEndTime = "";
- }
- let self = this;
- setTimeout(function(){
- self.getCorrelationNum();
- },500);
- checkPlanList(obj).then(response => {
- this.total = response.data.total;
- this.tableList = response.data.records;
- });
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.$set(this.queryParams,'page',1);
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.$set(this,'dateRange',[]);
- this.$set(this,'queryParams',{
- page:1,
- pageSize:20,
- checkStatus:0,
- createTimeSort:0,
- searchValue:"",
- checkType:1,
- myRelated:1,
- });
- this.handleQuery();
- },
- //删除
- deleteObj(obj){
- let self = this;
- this.$confirm('是否确认删除?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- checkPlanDelete({id:obj.id,checkType:obj.checkType}).then(response => {
- self.msgSuccess(response.msg)
- self.getList();
- })
- }).then(() => {
- }).catch(() => {});
- },
- //查看多个文档
- lookDocumentListButton(type,row){
- if(type==1){
- getFindByCheckPlanId({checkPlanId:row.id}).then(response => {
- let list = [];
- for(let i=0;i<response.data.length;i++){
- let obj = {
- name:response.data[i].fileName,
- url:response.data[i].fileUrl,
- }
- list.push(obj);
- }
- this.$set(this,'propsLookDocumentListData',{
- title:"查看附件",
- list:list
- });
- this.$set(this,'lookDocumentListType',true);
- });
- }else{
- this.$set(this,'lookDocumentListType',false);
- }
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .inspectionPlan{
- flex: 1;
- display: flex !important;
- flex-direction: column;
- overflow: hidden;
- .page-container{
- .page-form-title-box{
- .form-button-max-big-box{
- display: inline-block;
- overflow: hidden;
- .form-button-big-box{
- display: flex;
- p:nth-child(1){
- border-top-left-radius: 4px;
- border-bottom-left-radius: 4px;
- border-top:1px solid #E0E0E0;
- border-bottom:1px solid #E0E0E0;
- }
- p:nth-child(2){
- border-top:1px solid #E0E0E0;
- border-bottom:1px solid #E0E0E0;
- }
- p:nth-child(3){
- border-top:1px solid #E0E0E0;
- border-bottom:1px solid #E0E0E0;
- }
- p:nth-child(4){
- border-top-right-radius: 4px;
- border-bottom-right-radius: 4px;
- border-top:1px solid #E0E0E0;
- border-bottom:1px solid #E0E0E0;
- border-right:1px solid #E0E0E0;
- }
- p{
- height:40px;
- width:80px;
- line-height: 40px;
- text-align: center;
- color:#666666;
- font-size:14px;
- font-weight:500;
- cursor: pointer;
- border-left:1px solid #E0E0E0;
- }
- .checkDiv{
- color:#fff!important;
- border:1px solid #0183FA!important;
- background-color: #0183FA;
- }
- }
- }
- .form-button-max-big-box-me{
- display: inline-block;
- overflow: hidden;
- .form-button-big-box-me{
- display: flex;
- div{
- position: relative;
- height:40px;
- width:130px;
- line-height: 40px;
- text-align: center;
- color:#999;
- font-size:14px;
- border:1px solid #999;
- border-radius:4px;
- margin-left:10px;
- font-weight:500;
- cursor: pointer;
- .icon-p-me{
- width:15px;
- height:15px;
- line-height:15px;
- text-align: center;
- position: absolute;
- right:0;
- bottom:0;
- color:#fff;
- background: #0183fa;
- border-top-left-radius:4px;
- }
- }
- .checkDiv-me{
- color:#0183FA!important;
- border:1px solid #0183FA!important;
- }
- }
- }
- }
- .page-content-box{
- .checkStatus-color-1{
- color:#0183FA;
- }
- .checkStatus-color-2{
- color:#EE0606;
- }
- .checkStatus-color-3{
- color:#23B303;
- }
- }
- }
- }
- </style>
|