检查报告管理详情

pg_adapter
dshclm 8 months ago
parent 1beefbdede
commit 579fb9bb70

@ -0,0 +1,301 @@
<!DOCTYPE html>
<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 :: element-css" />
<th:block th:include="include :: select2-css" />
</head>
<style>
.layui-layer-btn{
display: none !important;
}
</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>
<el-row>
<el-col :span="12">
<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="12">
<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-row>
<el-form-item label="检查开始日期:" prop="checkStartTime">
<el-date-picker
type="date"
placeholder="选择日期"
v-model="postForm.checkStartTime"
style="width: 100%;"
disabled>
</el-date-picker>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="所属地市:" prop="framework">
<el-select disabled @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="12">
<el-form-item disabled label="所属区县:" prop="area">
<el-select disabled 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-row>
</el-card>
<div class="filter-container" style="margin-top: 25px;height: 310px">
<el-button disabled class="filter-item" type="primary" icon="el-icon-plus" size="small" plain @click="handleAdd">
添加
</el-button>
<el-table
:data="postForm.checkTypeDTOS"
:border="true"
style="width: 100%;margin-top: 25px;height: 90%;overflow: auto"
>
<el-table-column
label="报告类型"
width="300"
align="center"
>
<template v-slot="scope">
<el-select disabled v-model="scope.row.checkType" class="filter-item">
<el-option
v-for="item in reportCheckList"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
label="报告内容"
>
<template v-slot="scope">
<el-input disabled v-model="scope.row.typeContent" type="textarea" />
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="100px"
>
<template v-slot="scope">
<el-button disabled type="danger" icon="el-icon-delete" circle @click="removeItem(scope.$index)" />
</template>
</el-table-column>
</el-table>
</div>
<!-- <div style="position: fixed;bottom: -58px;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>-->
</el-form>
</div>
</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 :: select2-js" />
<script th:inline="javascript">
var prefix = ctx + "system/checkReport"
$("#form-check-add").validate({
focusCleanup: true
});
var app = new Vue({
el: '#app',
data: {
CityList: [],
AreaList:[],
params:{
parentId:'',
},
quTypeDisabled: false,
itemImage: true,
postForm: {
checkTypeDTOS: [],
framework:'',
area:'',
adduser: [[${tdCheckReportDTO.adduser}]],
depart: [[${tdCheckReportDTO.depart}]],
checkStartTime: '',
},
reportCheckList: [],
rules: {
adduser: [
{ required: true, message: '报告人员不能为空!' }
],
depart: [
{ required: true, message: '报告人单位不能为空!' }
],
checkStartTime: [
{ required: true, message: '检查开始时间不能为空!' }
],
framework: [
{ required: true, message: '所属地市不能为空!' }
],
area: [
{ required: true, message: '所属区县不能为空!' }
]
},
},
mounted(){
if([[${tdCheckReportDTO}]].checkTypeDTOS){
this.postForm = [[${tdCheckReportDTO}]]
}else{
this.postForm = [[${tdCheckReportDTO}]]
this.postForm.checkTypeDTOS = []
}
// 初始化地市列表
this.getCityList();
if (this.postForm.framework){
this.getAreaList()
}
$.ajax({
url:'/system/dict/data/list',
type:'POST',
data:{dictType: 'sys_check_type_report'},
success:((res)=>{
this.reportCheckList = res.rows
})
})
var date = new Date();
this.postForm.checkStartTime = this.formatDateToCustomString(date);
this.postForm.createTime = this.formatISO8601ToDateTime([[${tdCheckReportDTO}]].createTime);
if ([[${tdCheckReportDTO}]].checkEndTime){
this.postForm.checkEndTime = this.formatISO8601ToDateTime([[${tdCheckReportDTO}]].checkEndTime);
}
},
methods:{
formatISO8601ToDateTime(isoString) {
var date = new Date(isoString);
var year = date.getFullYear();
var month = (date.getMonth() + 1).toString().padStart(2, '0'); // 月份是从0开始的所以需要+1
var day = date.getDate().toString().padStart(2, '0');
var hours = date.getHours().toString().padStart(2, '0');
var minutes = date.getMinutes().toString().padStart(2, '0');
var seconds = date.getSeconds().toString().padStart(2, '0');
// 拼接成标准的日期时间格式
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
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
// this.postForm.area = ''
$.ajax({
url: ctx + "system/area/getSysAreaList",
type: 'GET',
data:this.params,
success:((res)=>{
this.AreaList = res.data
}) ,
});
},
// 添加子项
handleAdd() {
console.log(
this.postForm
)
this.postForm.checkTypeDTOS.push({checkType:'', typeContent: '',})
},
removeItem(index) {
this.postForm.checkTypeDTOS.splice(index, 1)
},
successTabCallback(result) {
if (result.data.code == web_status.SUCCESS) {
var parent = activeWindow();
if ($.common.isEmpty(parent.table)) {
$.modal.msgSuccessReload(result.data.msg);
} else if (parent.table.options.type == table_type.bootstrapTable) {
$.modal.close();
parent.$.modal.msgSuccess(result.data.msg);
parent.$.table.refresh();
} else if (parent.table.options.type == table_type.bootstrapTreeTable) {
$.modal.close();
parent.$.modal.msgSuccess(result.data.msg);
parent.$.treeTable.refresh();
}
} else if (result.data.code == web_status.WARNING) {
$.modal.alertWarning(result.data.msg)
} else {
$.modal.alertError(result.data.msg);
}
$.modal.closeLoading();
$.modal.enable();
},
submitForm() {
this.$refs.postForm.validate((valid) => {
console.log(this.postForm)
if (!valid) {
return
}
let that = this
axios.post(prefix + '/edit', this.postForm)
.then(function (response) {
if (response.data.code === 0) {
$.operate.successCallback(response.data);
}else{
$.modal.alertError(response.data.msg)
}
})
.catch(function (error) {
console.log(error);
});
})
},
closeItem(){
$.modal.close()
}
}
})
</script>
</body>
</html>
Loading…
Cancel
Save