|
|
|
@ -2,9 +2,9 @@
|
|
|
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
|
|
|
|
<head>
|
|
|
|
|
<th:block th:include="include :: header('新增检查报告管理')" />
|
|
|
|
|
<!-- <th:block th:include="include :: datetimepicker-css" />-->
|
|
|
|
|
<!-- <th:block th:include="include :: datetimepicker-css" />-->
|
|
|
|
|
<th:block th:include="include :: element-css" />
|
|
|
|
|
<!-- <th:block th:include="include :: select2-css" />-->
|
|
|
|
|
<!-- <th:block th:include="include :: select2-css" />-->
|
|
|
|
|
</head>
|
|
|
|
|
<style>
|
|
|
|
|
.layui-layer-btn{
|
|
|
|
@ -18,470 +18,490 @@
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<body class="white-bg">
|
|
|
|
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="app">
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<el-form ref="postForm" :model="postForm" :rules="rules" label-position="right" label-width="150px">
|
|
|
|
|
<el-card style="height: 300px;">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="检查人员:" prop="adduser">
|
|
|
|
|
<el-input disabled v-model="postForm.adduser" type="text"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="检查单位:" prop="depart">
|
|
|
|
|
<el-input disabled v-model="postForm.depart" :precision="1" :max="999999" type="text"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="检查开始日期:" prop="checkStartTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
type="date"
|
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
v-model="postForm.checkStartTime"
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="app">
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<el-form ref="postForm" :model="postForm" :rules="rules" label-position="right" label-width="150px">
|
|
|
|
|
<el-card style="height: 300px;">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="检查人员:" prop="adduser">
|
|
|
|
|
<el-input disabled v-model="postForm.adduser" type="text"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="检查单位:" prop="depart">
|
|
|
|
|
<el-input disabled v-model="postForm.depart" :precision="1" :max="999999" type="text"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="检查开始日期:" prop="checkStartTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
type="date"
|
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
v-model="postForm.checkStartTime"
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="所属地市:" prop="framework">
|
|
|
|
|
<el-select @change="getAreaList()" v-model="postForm.framework" class="filter-item">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in CityList"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="所属区县:" prop="area">
|
|
|
|
|
<el-select v-model="postForm.area" class="filter-item">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in AreaList"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="检查结束日期:" prop="checkEndTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
type="date"
|
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
v-model="postForm.checkEndTime"
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
:picker-options="pickerOptionsEnd"
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="实有项目总分:" prop="totalScore">
|
|
|
|
|
<el-input disabled v-model="postForm.totalScore" placeholder="请选择自查项" type="text"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="实有项目得分:" prop="realScore">
|
|
|
|
|
<el-input disabled v-model="postForm.realScore" placeholder="请选择自查项" type="text"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="得分占比:" prop="percentageScore">
|
|
|
|
|
<el-input disabled v-model="postForm.percentageScore" placeholder="请选择自查项" type="text"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="备注:" prop="remark">
|
|
|
|
|
<el-input v-model="postForm.remark" placeholder="请输入备注" type="textarea"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-card>
|
|
|
|
|
<div class="filter-container" style="margin-top: 25px;height: 399px">
|
|
|
|
|
<el-table
|
|
|
|
|
:data="postForm.checkTypeDTOS"
|
|
|
|
|
style="width: 100%;height: 100%;overflow:auto;"
|
|
|
|
|
@expand-change="handleChange"
|
|
|
|
|
height="399"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="expand">
|
|
|
|
|
<template slot-scope="props">
|
|
|
|
|
<el-table border :data="props.row.children" v-loading="loading" style="width: 100%">
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="自查项"
|
|
|
|
|
prop="checkItems"
|
|
|
|
|
width="150"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="自查内容"
|
|
|
|
|
prop="typeContent"
|
|
|
|
|
width="400"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="分值"
|
|
|
|
|
prop="score"
|
|
|
|
|
align="center"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="实有内容"
|
|
|
|
|
prop="starts"
|
|
|
|
|
align="center"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot="scope">
|
|
|
|
|
<el-checkbox
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="所属市州:" prop="framework">
|
|
|
|
|
<el-select @change="getAreaList()" v-model="postForm.framework" class="filter-item">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in CityList"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="所属区县:" prop="area">
|
|
|
|
|
<el-select v-model="postForm.area" class="filter-item">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in AreaList"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="检查结束日期:" prop="checkEndTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
type="date"
|
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
v-model="postForm.checkEndTime"
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
:picker-options="pickerOptionsEnd"
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="实有项目总分:" prop="totalScore">
|
|
|
|
|
<el-input disabled v-model="postForm.totalScore" placeholder="请选择自查项" type="text"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="实有项目得分:" prop="realScore">
|
|
|
|
|
<el-input disabled v-model="postForm.realScore" placeholder="请选择自查项" type="text"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="得分占比:" prop="percentageScore">
|
|
|
|
|
<el-input disabled v-model="postForm.percentageScore" placeholder="请选择自查项" type="text"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="备注:" prop="remark">
|
|
|
|
|
<el-input v-model="postForm.remark" placeholder="请输入备注" type="textarea"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-card>
|
|
|
|
|
<div class="filter-container" style="margin-top: 25px;height: 399px">
|
|
|
|
|
<el-table
|
|
|
|
|
:data="postForm.checkTypeDTOS"
|
|
|
|
|
style="width: 100%;height: 100%;overflow:auto;"
|
|
|
|
|
@expand-change="handleChange"
|
|
|
|
|
height="399"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="expand">
|
|
|
|
|
<template slot-scope="props">
|
|
|
|
|
<el-table border :data="props.row.children" v-loading="loading" style="width: 100%">
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="自查项"
|
|
|
|
|
prop="checkItems"
|
|
|
|
|
width="150"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="自查内容"
|
|
|
|
|
prop="typeContent"
|
|
|
|
|
width="400"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="分值"
|
|
|
|
|
prop="score"
|
|
|
|
|
align="center"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="实有内容"
|
|
|
|
|
prop="starts"
|
|
|
|
|
align="center"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot="scope">
|
|
|
|
|
<el-checkbox
|
|
|
|
|
@change="handleCheckChange(scope.row)"
|
|
|
|
|
true-label="1"
|
|
|
|
|
v-model="scope.row.starts"
|
|
|
|
|
false-label=""
|
|
|
|
|
>
|
|
|
|
|
</el-checkbox>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="得分"
|
|
|
|
|
prop="realScore">
|
|
|
|
|
<template v-slot="scope">
|
|
|
|
|
<el-input
|
|
|
|
|
>
|
|
|
|
|
</el-checkbox>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="得分"
|
|
|
|
|
prop="realScore">
|
|
|
|
|
<template v-slot="scope">
|
|
|
|
|
<el-input
|
|
|
|
|
:disabled="scope.row.ifstarts"
|
|
|
|
|
v-model="scope.row.realScore"
|
|
|
|
|
@blur="handleBlur(scope.row,props.row)"
|
|
|
|
|
@input="handleInput(scope.row)"
|
|
|
|
|
>
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="材料上传"
|
|
|
|
|
width="300">
|
|
|
|
|
<template v-slot="scope">
|
|
|
|
|
<el-upload
|
|
|
|
|
:disabled="scope.row.ifstarts"
|
|
|
|
|
class="upload-demo"
|
|
|
|
|
action="/common/upload"
|
|
|
|
|
:multiple="false"
|
|
|
|
|
:limit="1"
|
|
|
|
|
:on-success="handleUploadSuccess(scope.row)"
|
|
|
|
|
:on-error="handleUploadError"
|
|
|
|
|
:on-exceed="handleExceed"
|
|
|
|
|
>
|
|
|
|
|
<el-button slot="trigger" :disabled="scope.row.ifstarts" size="small" type="primary">上传文件</el-button>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="扣分标准"
|
|
|
|
|
prop="deductionCriteria"
|
|
|
|
|
width="350">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="自查类"
|
|
|
|
|
prop="typeName">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div style="position: fixed;bottom: -31px;right: 21px;">
|
|
|
|
|
<el-button type="primary" icon="el-icon-check" @click="submitForm">保存</el-button>
|
|
|
|
|
<el-button type="info" icon="el-icon-back" @click="closeItem()">返回</el-button>
|
|
|
|
|
>
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="材料上传"
|
|
|
|
|
width="300">
|
|
|
|
|
<template v-slot="scope">
|
|
|
|
|
<el-upload
|
|
|
|
|
:disabled="scope.row.ifstarts"
|
|
|
|
|
class="upload-demo"
|
|
|
|
|
action="/common/upload"
|
|
|
|
|
:multiple="false"
|
|
|
|
|
:limit="1"
|
|
|
|
|
:on-success="handleUploadSuccess(scope.row)"
|
|
|
|
|
:on-error="handleUploadError"
|
|
|
|
|
:on-exceed="handleExceed"
|
|
|
|
|
>
|
|
|
|
|
<el-button slot="trigger" :disabled="scope.row.ifstarts" size="small" type="primary">上传文件</el-button>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="扣分标准"
|
|
|
|
|
prop="deductionCriteria"
|
|
|
|
|
width="350">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="自查类"
|
|
|
|
|
prop="typeName">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div style="position: fixed;bottom: -31px;right: 21px;">
|
|
|
|
|
<el-button type="primary" icon="el-icon-check" @click="submitForm">保存</el-button>
|
|
|
|
|
<el-button type="info" icon="el-icon-back" @click="closeItem()">返回</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<th:block th:include="include :: footer" />
|
|
|
|
|
</div>
|
|
|
|
|
<th:block th:include="include :: footer" />
|
|
|
|
|
<!-- <th:block th:include="include :: datetimepicker-js" />-->
|
|
|
|
|
<th:block th:include="include :: element-js" />
|
|
|
|
|
<th:block th:include="include :: element-js" />
|
|
|
|
|
<!-- <th:block th:include="include :: select2-js" />-->
|
|
|
|
|
<script th:inline="javascript">
|
|
|
|
|
var prefix = ctx + "system/checkReport"
|
|
|
|
|
$("#form-check-add").validate({
|
|
|
|
|
focusCleanup: true
|
|
|
|
|
});
|
|
|
|
|
var app = new Vue({
|
|
|
|
|
el: '#app',
|
|
|
|
|
data: {
|
|
|
|
|
loading:'false',
|
|
|
|
|
CityList: [],
|
|
|
|
|
AreaList:[],
|
|
|
|
|
params:{
|
|
|
|
|
parentId:'',
|
|
|
|
|
},
|
|
|
|
|
quTypeDisabled: false,
|
|
|
|
|
itemImage: true,
|
|
|
|
|
postForm: {
|
|
|
|
|
checkTypeDTOS:[],
|
|
|
|
|
framework:'',
|
|
|
|
|
area:'',
|
|
|
|
|
adduser: [[${user.userName}]],
|
|
|
|
|
depart: [[${user.dept.deptName}]],
|
|
|
|
|
checkStartTime: '',
|
|
|
|
|
checkEndTime:'',
|
|
|
|
|
percentageScore:'',
|
|
|
|
|
realScore:'',
|
|
|
|
|
totalScore:'',
|
|
|
|
|
remark:'',
|
|
|
|
|
},
|
|
|
|
|
cachedData: [], // 新增缓存变量
|
|
|
|
|
checkTypeSave: [],
|
|
|
|
|
selectedItemIds: [],
|
|
|
|
|
checkedStates: {},
|
|
|
|
|
tempData:{},
|
|
|
|
|
startsArry:[],
|
|
|
|
|
rules: {
|
|
|
|
|
adduser: [
|
|
|
|
|
{ required: true, message: '报告人员不能为空!' }
|
|
|
|
|
],
|
|
|
|
|
<script th:inline="javascript">
|
|
|
|
|
var prefix = ctx + "system/checkReport"
|
|
|
|
|
$("#form-check-add").validate({
|
|
|
|
|
focusCleanup: true
|
|
|
|
|
});
|
|
|
|
|
var app = new Vue({
|
|
|
|
|
el: '#app',
|
|
|
|
|
data: {
|
|
|
|
|
loading:'false',
|
|
|
|
|
CityList: [],
|
|
|
|
|
AreaList:[],
|
|
|
|
|
params:{
|
|
|
|
|
parentId:'',
|
|
|
|
|
},
|
|
|
|
|
quTypeDisabled: false,
|
|
|
|
|
itemImage: true,
|
|
|
|
|
postForm: {
|
|
|
|
|
checkTypeDTOS:[],
|
|
|
|
|
framework:'36625',
|
|
|
|
|
area:'',
|
|
|
|
|
adduser: [[${user.userName}]],
|
|
|
|
|
depart: [[${user.dept.deptName}]],
|
|
|
|
|
checkStartTime: '',
|
|
|
|
|
checkEndTime:'',
|
|
|
|
|
percentageScore:'',
|
|
|
|
|
realScore:'',
|
|
|
|
|
totalScore:'',
|
|
|
|
|
remark:'',
|
|
|
|
|
},
|
|
|
|
|
cachedData: [], // 新增缓存变量
|
|
|
|
|
checkTypeSave: [],
|
|
|
|
|
selectedItemIds: [],
|
|
|
|
|
checkedStates: {},
|
|
|
|
|
tempData:{},
|
|
|
|
|
startsArry:[],
|
|
|
|
|
rules: {
|
|
|
|
|
adduser: [
|
|
|
|
|
{ required: true, message: '报告人员不能为空!' }
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
depart: [
|
|
|
|
|
{ required: true, message: '报告人单位不能为空!' }
|
|
|
|
|
],
|
|
|
|
|
framework: [
|
|
|
|
|
{ required: true, message: '所属地市不能为空!' }
|
|
|
|
|
],
|
|
|
|
|
depart: [
|
|
|
|
|
{ required: true, message: '报告人单位不能为空!' }
|
|
|
|
|
],
|
|
|
|
|
framework: [
|
|
|
|
|
{ required: true, message: '所属地市不能为空!' }
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
area: [
|
|
|
|
|
{ required: true, message: '所属区县不能为空!' }
|
|
|
|
|
],
|
|
|
|
|
checkStartTime: [
|
|
|
|
|
{ required: true, message: '请选择检查开始日期', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
checkEndTime: [
|
|
|
|
|
{ required: true, message: '请选择检查结束日期', trigger: 'change' },
|
|
|
|
|
// { validator: this.validateEndTime, trigger: 'change' }
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
area: [
|
|
|
|
|
{ required: true, message: '所属区县不能为空!' }
|
|
|
|
|
],
|
|
|
|
|
checkStartTime: [
|
|
|
|
|
{ required: true, message: '请选择检查开始日期', trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
checkEndTime: [
|
|
|
|
|
{ required: true, message: '请选择检查结束日期', trigger: 'change' },
|
|
|
|
|
// { validator: this.validateEndTime, trigger: 'change' }
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
pickerOptionsEnd() {
|
|
|
|
|
return {
|
|
|
|
|
disabledDate: (time) => {
|
|
|
|
|
return time.getTime() < new Date(this.postForm.checkStartTime).getTime();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
pickerOptionsEnd() {
|
|
|
|
|
var _this = this
|
|
|
|
|
return {
|
|
|
|
|
disabledDate: function(time) {
|
|
|
|
|
return time.getTime() < new Date(_this.postForm.checkStartTime).getTime();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted(){
|
|
|
|
|
// 初始化地市列表
|
|
|
|
|
this.getCityList();
|
|
|
|
|
if (this.postForm.framework){
|
|
|
|
|
this.getAreaList()
|
|
|
|
|
}
|
|
|
|
|
this.getCheckView()
|
|
|
|
|
},
|
|
|
|
|
methods:{
|
|
|
|
|
validateEndTime(rule, value, callback) {
|
|
|
|
|
// if (value && this.postForm.checkStartTime && new Date(value).getTime() < new Date(this.postForm.checkStartTime).getTime()) {
|
|
|
|
|
// callback(new Error('结束日期不能早于开始日期'));
|
|
|
|
|
// } else {
|
|
|
|
|
// callback();
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
mounted(){
|
|
|
|
|
// 初始化地市列表
|
|
|
|
|
this.getCityList();
|
|
|
|
|
if (this.postForm.framework){
|
|
|
|
|
this.getAreaList()
|
|
|
|
|
}
|
|
|
|
|
this.getCheckView()
|
|
|
|
|
handleUploadSuccess(row) {
|
|
|
|
|
return function(response, file, fileList) {
|
|
|
|
|
if (response.code == web_status.SUCCESS) {
|
|
|
|
|
row.fileName = response.originalFilename;
|
|
|
|
|
row.fileUrl = response.url;
|
|
|
|
|
row.fileList = fileList;
|
|
|
|
|
$.modal.msgSuccess("文件上传成功");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
handleUploadError(){
|
|
|
|
|
$.modal.msgError('上传失败');
|
|
|
|
|
},
|
|
|
|
|
handleExceed(){
|
|
|
|
|
$.modal.msgWarning('超出个数限制,最多只能上传一个文件!');
|
|
|
|
|
},
|
|
|
|
|
methods:{
|
|
|
|
|
validateEndTime(rule, value, callback) {
|
|
|
|
|
// if (value && this.postForm.checkStartTime && new Date(value).getTime() < new Date(this.postForm.checkStartTime).getTime()) {
|
|
|
|
|
// callback(new Error('结束日期不能早于开始日期'));
|
|
|
|
|
// } else {
|
|
|
|
|
// callback();
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
handleUploadSuccess(row) {
|
|
|
|
|
return (response, file,fileList) => {
|
|
|
|
|
if (response.code == web_status.SUCCESS) {
|
|
|
|
|
row.fileName = response.originalFilename;
|
|
|
|
|
row.fileUrl = response.url;
|
|
|
|
|
row.fileList = fileList
|
|
|
|
|
$.modal.msgSuccess("文件上传成功");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
handleUploadError(){
|
|
|
|
|
$.modal.msgError('上传失败');
|
|
|
|
|
},
|
|
|
|
|
handleExceed(){
|
|
|
|
|
$.modal.msgWarning('超出个数限制,最多只能上传一个文件!');
|
|
|
|
|
},
|
|
|
|
|
handleChange(row, expandedRows){
|
|
|
|
|
this.loading = true;
|
|
|
|
|
if (expandedRows.length > 0) {
|
|
|
|
|
// 检查缓存中是否已经存在对应的数据
|
|
|
|
|
const cachedRow = this.cachedData.find((item) => item.checkType === row.checkType);
|
|
|
|
|
if (cachedRow) {
|
|
|
|
|
row.children = cachedRow.children;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
} else {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '/system/checkReport/checkView/' + row.checkType + '/' + row.typeName,
|
|
|
|
|
type: 'GET',
|
|
|
|
|
success: ((res) => {
|
|
|
|
|
if (res.code === web_status.SUCCESS) {
|
|
|
|
|
res.data.forEach((item) => {
|
|
|
|
|
Object.assign(item, { ifstarts: true });
|
|
|
|
|
});
|
|
|
|
|
// 将请求到的数据缓存起来
|
|
|
|
|
this.updateCachedData(this.cachedData, {...row, children: res.data });
|
|
|
|
|
row.children = res.data;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
handleChange(row, expandedRows) {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
|
|
if (expandedRows.length > 0) {
|
|
|
|
|
// 检查缓存中是否已经存在对应的数据
|
|
|
|
|
var cachedRow = this.cachedData.find(function (item) {
|
|
|
|
|
return item.checkType === row.checkType;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (cachedRow) {
|
|
|
|
|
row.children = cachedRow.children;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
} else {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '/system/checkReport/checkView/' + row.checkType + '/' + row.typeName,
|
|
|
|
|
type: 'GET',
|
|
|
|
|
success: (function (res) {
|
|
|
|
|
if (res.code === web_status.SUCCESS) {
|
|
|
|
|
res.data.forEach(function (item) {
|
|
|
|
|
Object.assign(item, { ifstarts: true });
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 将请求到的数据缓存起来
|
|
|
|
|
this.updateCachedData(this.cachedData, {
|
|
|
|
|
// 使用ES5的方式扩展对象
|
|
|
|
|
children: res.data,
|
|
|
|
|
checkType: row.checkType,
|
|
|
|
|
typeName: row.typeName
|
|
|
|
|
});
|
|
|
|
|
row.children = res.data;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
}
|
|
|
|
|
}).bind(this)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleCheckChange(row, expandedRows){
|
|
|
|
|
// this.$refs.realScoreMax.$refs.input.max = parseFloat(row.score)
|
|
|
|
|
// console.log(this.$refs.realScoreMax.$refs.input.max)
|
|
|
|
|
if (!this.startsArry){
|
|
|
|
|
this.startsArry = []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleCheckChange(row, expandedRows){
|
|
|
|
|
// this.$refs.realScoreMax.$refs.input.max = parseFloat(row.score)
|
|
|
|
|
// console.log(this.$refs.realScoreMax.$refs.input.max)
|
|
|
|
|
if (!this.startsArry){
|
|
|
|
|
this.startsArry = []
|
|
|
|
|
}
|
|
|
|
|
if (row.starts){
|
|
|
|
|
row.ifstarts = false
|
|
|
|
|
if (!this.startsArry.includes(row)) {
|
|
|
|
|
this.startsArry.push(row);
|
|
|
|
|
}
|
|
|
|
|
if (row.starts){
|
|
|
|
|
row.ifstarts = false
|
|
|
|
|
if (!this.startsArry.includes(row)) {
|
|
|
|
|
this.startsArry.push(row);
|
|
|
|
|
}
|
|
|
|
|
this.calculateTotalScore('totalScore')
|
|
|
|
|
}else{
|
|
|
|
|
row.ifstarts = true
|
|
|
|
|
let index = this.startsArry.indexOf(row);
|
|
|
|
|
if (index > -1) {
|
|
|
|
|
this.startsArry.splice(index, 1);
|
|
|
|
|
}
|
|
|
|
|
this.calculateTotalScore('totalScore')
|
|
|
|
|
row.realScore = ''
|
|
|
|
|
this.calculateTotalScore('totalScore')
|
|
|
|
|
}else{
|
|
|
|
|
row.ifstarts = true
|
|
|
|
|
let index = this.startsArry.indexOf(row);
|
|
|
|
|
if (index > -1) {
|
|
|
|
|
this.startsArry.splice(index, 1);
|
|
|
|
|
}
|
|
|
|
|
this.calculateTotalScore('totalScore')
|
|
|
|
|
row.realScore = ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
calculateTotalScore(value) {
|
|
|
|
|
if (value == 'totalScore'){
|
|
|
|
|
this.postForm.totalScore = this.startsArry.reduce((sum, row) => {
|
|
|
|
|
return sum + parseFloat(row.score)
|
|
|
|
|
}, 0);
|
|
|
|
|
}
|
|
|
|
|
if (value == 'realScore'){
|
|
|
|
|
this.postForm.realScore = this.startsArry.reduce((sum, row) => {
|
|
|
|
|
return sum + parseFloat(row.realScore)
|
|
|
|
|
}, 0);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleBlur(row,rows){
|
|
|
|
|
this.updateCachedData(this.cachedData, rows);
|
|
|
|
|
const min =0;
|
|
|
|
|
const max = parseFloat(row.score);
|
|
|
|
|
if (parseFloat(row.realScore) < min) {
|
|
|
|
|
row.realScore = min;
|
|
|
|
|
},
|
|
|
|
|
calculateTotalScore(value) {
|
|
|
|
|
if (value === 'totalScore') {
|
|
|
|
|
this.postForm.totalScore = this.startsArry.reduce(function (sum, row) {
|
|
|
|
|
return sum + parseFloat(row.score);
|
|
|
|
|
}, 0);
|
|
|
|
|
}
|
|
|
|
|
if (value === 'realScore') {
|
|
|
|
|
this.postForm.realScore = this.startsArry.reduce(function (sum, row) {
|
|
|
|
|
return sum + parseFloat(row.realScore);
|
|
|
|
|
}, 0);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleBlur(row,rows){
|
|
|
|
|
this.updateCachedData(this.cachedData, rows);
|
|
|
|
|
const min =0;
|
|
|
|
|
const max = parseFloat(row.score);
|
|
|
|
|
if (parseFloat(row.realScore) < min) {
|
|
|
|
|
row.realScore = min;
|
|
|
|
|
}
|
|
|
|
|
if (parseFloat(row.realScore) > max) {
|
|
|
|
|
row.realScore = max;
|
|
|
|
|
}
|
|
|
|
|
if (row.realScore){
|
|
|
|
|
this.calculateTotalScore('realScore')
|
|
|
|
|
this.postForm.percentageScore = (this.postForm.realScore / this.postForm.totalScore * 100).toFixed(2);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleInput(row, props) {
|
|
|
|
|
row.realScore = row.realScore.replace(/[^0-9.]/g, '');
|
|
|
|
|
},
|
|
|
|
|
updateCachedData(cachedData, rows) {
|
|
|
|
|
for (let i = 0; i < cachedData.length; i++) {
|
|
|
|
|
if (cachedData[i].checkType === rows.checkType) {
|
|
|
|
|
cachedData[i] = rows;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (parseFloat(row.realScore) > max) {
|
|
|
|
|
row.realScore = max;
|
|
|
|
|
}
|
|
|
|
|
cachedData.push(rows);
|
|
|
|
|
},
|
|
|
|
|
//获取外层数据
|
|
|
|
|
getCheckView() {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '/system/checkReport/checkViewParent/sys_check_type_report',
|
|
|
|
|
type: 'GET',
|
|
|
|
|
success: function (res) {
|
|
|
|
|
res.data.forEach(function (item) {
|
|
|
|
|
// 在ES5中使用Object.assign的替代方式来添加属性
|
|
|
|
|
item.children = [];
|
|
|
|
|
});
|
|
|
|
|
this.postForm.checkTypeDTOS = res.data;
|
|
|
|
|
}.bind(this)
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
formatDateToCustomString(date) {
|
|
|
|
|
var year = date.getFullYear();
|
|
|
|
|
var month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以加1
|
|
|
|
|
var day = String(date.getDate()).padStart(2, '0');
|
|
|
|
|
var hours = String(date.getHours()).padStart(2, '0');
|
|
|
|
|
var minutes = String(date.getMinutes()).padStart(2, '0');
|
|
|
|
|
var seconds = String(date.getSeconds()).padStart(2, '0');
|
|
|
|
|
|
|
|
|
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
|
|
},
|
|
|
|
|
getCityList() {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: ctx + "system/area/getSysAreaList",
|
|
|
|
|
type: 'GET',
|
|
|
|
|
data: this.params,
|
|
|
|
|
success: function (res) {
|
|
|
|
|
this.CityList = res.data.filter(function (obj) {
|
|
|
|
|
return obj.id === '36625';
|
|
|
|
|
});
|
|
|
|
|
}.bind(this)
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getAreaList() {
|
|
|
|
|
this.params.parentId = this.postForm.framework;
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: ctx + "system/area/getSysAreaList",
|
|
|
|
|
type: 'GET',
|
|
|
|
|
data: this.params,
|
|
|
|
|
success: function (res) {
|
|
|
|
|
this.AreaList = res.data;
|
|
|
|
|
this.postForm.area = '';
|
|
|
|
|
}.bind(this)
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs.postForm.validate(function (valid) {
|
|
|
|
|
var hasEmptyRealScore = this.cachedData.some(function (item) {
|
|
|
|
|
return item.children.some(function (child) {
|
|
|
|
|
return child.starts &&!child.realScore;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (hasEmptyRealScore) {
|
|
|
|
|
$.modal.alertWarning("所选自查项内有未评分项,请检查");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (row.realScore){
|
|
|
|
|
this.calculateTotalScore('realScore')
|
|
|
|
|
this.postForm.percentageScore = (this.postForm.realScore / this.postForm.totalScore * 100).toFixed(2);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleInput(row, props) {
|
|
|
|
|
row.realScore = row.realScore.replace(/[^0-9.]/g, '');
|
|
|
|
|
},
|
|
|
|
|
updateCachedData(cachedData, rows) {
|
|
|
|
|
for (let i = 0; i < cachedData.length; i++) {
|
|
|
|
|
if (cachedData[i].checkType === rows.checkType) {
|
|
|
|
|
cachedData[i] = rows;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// console.log(hasEmptyRealScore);
|
|
|
|
|
// console.log(this.cachedData)
|
|
|
|
|
|
|
|
|
|
if (!valid) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
cachedData.push(rows);
|
|
|
|
|
},
|
|
|
|
|
//获取外层数据
|
|
|
|
|
getCheckView() {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '/system/checkReport/checkViewParent/sys_check_type_report',
|
|
|
|
|
type: 'GET',
|
|
|
|
|
success: ((res) => {
|
|
|
|
|
res.data.forEach(item => {
|
|
|
|
|
Object.assign(item, { children: [] });
|
|
|
|
|
});
|
|
|
|
|
this.postForm.checkTypeDTOS = res.data;
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
formatDateToCustomString(date) {
|
|
|
|
|
var year = date.getFullYear();
|
|
|
|
|
var month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以加1
|
|
|
|
|
var day = String(date.getDate()).padStart(2, '0');
|
|
|
|
|
var hours = String(date.getHours()).padStart(2, '0');
|
|
|
|
|
var minutes = String(date.getMinutes()).padStart(2, '0');
|
|
|
|
|
var seconds = String(date.getSeconds()).padStart(2, '0');
|
|
|
|
|
|
|
|
|
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
|
|
},
|
|
|
|
|
getCityList(){
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: ctx + "system/area/getSysAreaList",
|
|
|
|
|
type: 'GET',
|
|
|
|
|
data:this.params ,
|
|
|
|
|
success:((res)=>{
|
|
|
|
|
this.CityList = res.data
|
|
|
|
|
}) ,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getAreaList(){
|
|
|
|
|
this.params.parentId = this.postForm.framework
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: ctx + "system/area/getSysAreaList",
|
|
|
|
|
type: 'GET',
|
|
|
|
|
data:this.params,
|
|
|
|
|
success:((res)=>{
|
|
|
|
|
this.AreaList = res.data
|
|
|
|
|
this.postForm.area = ''
|
|
|
|
|
}) ,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs.postForm.validate((valid) => {
|
|
|
|
|
const hasEmptyRealScore = this.cachedData.some(item => {
|
|
|
|
|
return item.children.some(child => {
|
|
|
|
|
return child.starts && !child.realScore;
|
|
|
|
|
});
|
|
|
|
|
// this.postForm.checkTypeDTOS = []
|
|
|
|
|
this.postForm.checkTypeDTOS = this.cachedData.reduce(function (acc, item) {
|
|
|
|
|
return acc.concat(item.children);
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
this.postForm.checkStartTime = this.formatDateToCustomString(new Date(this.postForm.checkStartTime));
|
|
|
|
|
this.postForm.checkEndTime = this.formatDateToCustomString(new Date(this.postForm.checkEndTime));
|
|
|
|
|
|
|
|
|
|
axios.post(prefix + '/add', this.postForm)
|
|
|
|
|
.then(function (response) {
|
|
|
|
|
if (response.data.code === 0) {
|
|
|
|
|
$.operate.successTabCallback(response.data);
|
|
|
|
|
} else {
|
|
|
|
|
$.modal.alertError(response.data.msg);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
if (hasEmptyRealScore){
|
|
|
|
|
$.modal.alertWarning("所选自查项内有未评分项,请检查");
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
// console.log(hasEmptyRealScore);
|
|
|
|
|
// console.log(this.cachedData)
|
|
|
|
|
if (!valid) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
// this.postForm.checkTypeDTOS = []
|
|
|
|
|
this.postForm.checkTypeDTOS = this.cachedData.reduce((acc, item) => {
|
|
|
|
|
return acc.concat(item.children);
|
|
|
|
|
}, []);
|
|
|
|
|
this.postForm.checkStartTime = this.formatDateToCustomString(new Date(this.postForm.checkStartTime))
|
|
|
|
|
this.postForm.checkEndTime = this.formatDateToCustomString(new Date(this.postForm.checkEndTime))
|
|
|
|
|
axios.post(prefix + '/add', this.postForm)
|
|
|
|
|
.then(function (response) {
|
|
|
|
|
if (response.data.code === 0) {
|
|
|
|
|
$.operate.successTabCallback(response.data);
|
|
|
|
|
}else{
|
|
|
|
|
$.modal.alertError(response.data.msg)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
closeItem(){
|
|
|
|
|
$.modal.closeTab()
|
|
|
|
|
}
|
|
|
|
|
}.bind(this));
|
|
|
|
|
},
|
|
|
|
|
closeItem(){
|
|
|
|
|
$.modal.closeTab()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|