+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
- 上传文件
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 保存
- 返回
+ >
+
+
+
+
+
+
+ 上传文件
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+ 返回
-
+
+
-
+
-
+ }
+ })
+
diff --git a/ruoyi-admin/src/main/resources/templates/system/checkReport/detail.html b/ruoyi-admin/src/main/resources/templates/system/checkReport/detail.html
index 7c1fe5e9..fc07be21 100644
--- a/ruoyi-admin/src/main/resources/templates/system/checkReport/detail.html
+++ b/ruoyi-admin/src/main/resources/templates/system/checkReport/detail.html
@@ -50,7 +50,7 @@
-
+
-
+
返回
@@ -326,7 +326,7 @@
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
handleUploadSuccess(row) {
- return (response, file) => {
+ return function (response, file) {
if (response.code == web_status.SUCCESS) {
row.fileName = response.originalFilename;
row.fileUrl = response.url;
@@ -335,7 +335,7 @@
};
},
handleRemove(row){
- return () => {
+ return function () {
row.fileName = '';
row.fileUrl = '';
$.modal.msgSuccess("删除成功");
@@ -348,7 +348,34 @@
$.modal.msgWarning('超出个数限制,最多只能上传一个文件!');
},
handlePreview(file){
- window.location.href = ctx + "common/download/resource?resource=" + encodeURI(file.url) ;
+ $.ajax({
+ url: '/common/download/resource?resource=' + file.url,
+ type: 'GET',
+ xhrFields: {
+ responseType: 'blob'
+ },
+ success: function (data, status, xhr) {
+ let contentType = xhr.getResponseHeader('Content-Type');
+ let filename = file.name;
+ if (navigator.msSaveBlob) {
+ // 兼容 IE
+ navigator.msSaveBlob(data, filename);
+ } else {
+ let blob = new Blob([data], { type: contentType });
+ let url = URL.createObjectURL(blob);
+ let a = document.createElement('a');
+ a.href = url;
+ a.download = filename;
+ document.body.appendChild(a);
+ a.click();
+ document.body.removeChild(a);
+ URL.revokeObjectURL(url);
+ }
+ },
+ error: function (xhr, status, error) {
+ console.error('下载文件失败:', error);
+ }
+ });
},
validateEndTime(rule, value, callback) {
// if (value && this.postForm.checkStartTime && new Date(value).getTime() < new Date(this.postForm.checkStartTime).getTime()) {
@@ -359,12 +386,20 @@
},
handleChange(row, expandedRows){
this.loading = true;
+ var _this = this;
if (expandedRows.length > 0) {
// 检查缓存中是否已经存在对应的数据
- const cachedRow = this.cachedData.find((item) => item.checkType === row.checkType);
+ var cachedRow;
+ for (var i = 0; i < _this.cachedData.length; i++) {
+ var item = _this.cachedData[i];
+ if (item.checkType === row.checkType) {
+ cachedRow = item;
+ break;
+ }
+ }
if (cachedRow) {
row.children = cachedRow.children;
- this.loading = false;
+ _this.loading = false;
} else {
// $.ajax({
// url: '/system/checkReport/checkView/' + row.checkType + '/' + row.typeName,
@@ -382,12 +417,22 @@
// }),
// });
row.children = []
- this.editcheckTypeDTOS.forEach(item => {
+ _this.editcheckTypeDTOS.forEach(function (item) {
if (item.checkType === row.checkType) {
row.children.push(item);
}
+
+ // 在ES5中没有Object.assign方法,这里通过遍历属性来模拟其功能
+ for (var key in { ifstarts: true }) {
+ item[key] = { ifstarts: true }[key];
+ }
+ });
+
+ _this.updateCachedData(_this.cachedData, {
+ // 在ES5中没有扩展运算符,这里手动合并对象属性
+ row: row,
+ children: row.children
});
- this.updateCachedData(this.cachedData, {...row, children: row.children });
this.loading = false
}
}
@@ -395,7 +440,14 @@
handleCheckChange(row, expandedRows){
// console.log(this.editcheckTypeDTOS)
// console.log(row)
- let existingData = this.editcheckTypeDTOS.find(item => row.itemsType === item.itemsType);
+ var existingData;
+ for (var i = 0; i < this.editcheckTypeDTOS.length; i++) {
+ var item = this.editcheckTypeDTOS[i];
+ if (row.itemsType === item.itemsType) {
+ existingData = item;
+ break;
+ }
+ }
if (!this.startsArry){
this.startsArry = []
}
@@ -414,7 +466,7 @@
let score = parseFloat(row.score)
let realScore = parseFloat(this.postForm.realScore)
this.postForm.totalScore = totalScore - score
- this.postForm.realScore = realScore - parseFloat(row.realScore)
+ this.postForm.realScore = realScore - parseFloat(row.realScore == null ? 0 : row.realScore)
// let index = this.startsArry.indexOf(row);
// if (index > -1) {
// this.startsArry.splice(index, 1);
@@ -435,7 +487,7 @@
}
let realScore = parseFloat(this.postForm.realScore)
this.postForm.realScore = realScore + parseFloat(row.realScore)
- this.postForm.percentageScore = this.postForm.realScore / this.postForm.totalScore * 100;
+ this.postForm.percentageScore = (this.postForm.realScore / this.postForm.totalScore * 100).toFixed(2);
},
handleInput(row, props) {
row.realScore = row.realScore.replace(/[^0-9.]/g, '');
@@ -451,48 +503,75 @@
},
//获取外层数据
getCheckView() {
+ var _this = this;
$.ajax({
url: '/system/checkReport/checkViewParent/sys_check_type_report',
type: 'GET',
- success: ((res) => {
- res.data.forEach(item => {
- Object.assign(item, { children: [] });
+ success: function(res) {
+ res.data.forEach(function(item) {
+ // 在ES5中没有Object.assign方法,通过遍历属性来模拟其功能
+ var assignObj = { children: [] };
+ for (var key in assignObj) {
+ item[key] = assignObj[key];
+ }
});
- this.postForm.checkTypeDTOS = res.data;
- })
+ _this.postForm.checkTypeDTOS = res.data;
+ }
});
},
getCityList(){
+ var _this = this;
$.ajax({
url: ctx + "system/area/getSysAreaList",
type: 'GET',
- data:this.params ,
- success:((res)=>{
- this.CityList = res.data
- }) ,
+ data: this.params,
+ success: function(res) {
+ _this.CityList = res.data.filter(function(obj) {
+ return obj.id === '36625';
+ });
+ }
});
},
- 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
- }) ,
- });
+ getAreaList(type){
+ if (type === 'mounted'){
+ this.params.parentId = this.postForm.framework
+ // this.postForm.area = ''
+ var _this = this;
+ $.ajax({
+ url: ctx + "system/area/getSysAreaList",
+ type: 'GET',
+ data: this.params,
+ success: function(res) {
+ _this.AreaList = res.data;
+ }
+ });
+ }else{
+ this.params.parentId = this.postForm.framework
+ this.postForm.area = ''
+ $.ajax({
+ url: ctx + "system/area/getSysAreaList",
+ type: 'GET',
+ data: this.params,
+ success: function(res) {
+ _this.AreaList = res.data;
+ }
+ });
+ }
+
},
submitForm() {
this.$refs.postForm.validate((valid) => {
- const hasEmptyRealScore = this.cachedData.some(item => {
- return item.children.some(child => {
- return child.starts && !child.realScore;
+ var hasEmptyRealScore;
+ var _this = this;
+
+ hasEmptyRealScore = _this.cachedData.some(function (item) {
+ return item.children.some(function (child) {
+ return child.starts &&!child.realScore;
});
});
if (hasEmptyRealScore){
$.modal.alertWarning("所选自查项内有未评分项,请检查");
+ return false
}
// console.log(hasEmptyRealScore);
// console.log(this.cachedData)
@@ -502,13 +581,31 @@
// this.postForm.checkTypeDTOS = this.cachedData.reduce((acc, item) => {
// return acc.concat(item.children);
// }, []);
- this.postForm.checkTypeDTOS = this.editcheckTypeDTOS.map(editItem => {
- let cachedItem = this.cachedData.find(cachedItem => cachedItem.itemsType === editItem.itemsType);
+ _this.postForm.checkTypeDTOS = _this.editcheckTypeDTOS.map(function (editItem) {
+ var cachedItem;
+ for (var i = 0; i < _this.cachedData.length; i++) {
+ cachedItem = _this.cachedData[i];
+ if (cachedItem.itemsType === editItem.itemsType) {
+ break;
+ } else {
+ cachedItem = null;
+ }
+ }
+
if (cachedItem) {
- return {...editItem, ...cachedItem};
+ // 在ES5中没有扩展运算符,这里手动合并对象属性
+ var mergedItem = {};
+ for (var key in editItem) {
+ mergedItem[key] = editItem[key];
+ }
+ for (var key in cachedItem) {
+ mergedItem[key] = cachedItem[key];
+ }
+ return mergedItem;
}
+
return editItem;
- })
+ });
this.postForm.checkStartTime = this.formatISO8601ToDateTime(this.postForm.checkStartTime)
this.postForm.checkEndTime = this.formatISO8601ToDateTime(this.postForm.checkEndTime)
this.postForm.createTime = this.formatISO8601ToDateTime(this.postForm.createTime)
@@ -516,8 +613,8 @@
.then(function (response) {
if (response.data.code === 0) {
$.operate.successTabCallback(response.data);
- }else{
- $.modal.alertError(response.data.msg)
+ } else {
+ $.modal.alertError(response.data.msg);
}
})
.catch(function (error) {
diff --git a/ruoyi-admin/src/main/resources/templates/system/checkReport/edit.html b/ruoyi-admin/src/main/resources/templates/system/checkReport/edit.html
index 106756d5..df5517e2 100644
--- a/ruoyi-admin/src/main/resources/templates/system/checkReport/edit.html
+++ b/ruoyi-admin/src/main/resources/templates/system/checkReport/edit.html
@@ -2,9 +2,9 @@
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.dictLabel}}
-
-
-
-
-
-
-
-
-
- 保存
- 返回
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ruoyi-admin/src/main/resources/templates/system/checkresult/checkresultprint.html b/ruoyi-admin/src/main/resources/templates/system/checkresult/checkresultprint.html
index bb732ceb..b304b4aa 100644
--- a/ruoyi-admin/src/main/resources/templates/system/checkresult/checkresultprint.html
+++ b/ruoyi-admin/src/main/resources/templates/system/checkresult/checkresultprint.html
@@ -1508,7 +1508,7 @@
检查开始日期:[[${tdCheckReportDTO.checkEndTime}]] |
- 所属地市 |
+ 所属市州 |
[[${tdCheckReportDTO.framework}]] |
所属区县 |
[[${tdCheckReportDTO.area}]] |
diff --git a/ruoyi-admin/src/main/resources/templates/system/checkresult/docheck.html b/ruoyi-admin/src/main/resources/templates/system/checkresult/docheck.html
index cc7b587f..159cd89e 100644
--- a/ruoyi-admin/src/main/resources/templates/system/checkresult/docheck.html
+++ b/ruoyi-admin/src/main/resources/templates/system/checkresult/docheck.html
@@ -22,7 +22,7 @@
-
+