From 3758140a7e82805859bde0013fc398f90ed0c75a Mon Sep 17 00:00:00 2001
From: pengyb <726475269@qq.com>
Date: Mon, 29 Jul 2024 17:49:58 +0800
Subject: [PATCH] zxcxzc
---
hxy-web/html/wireManager/header.html | 2 +-
.../wireManager/viewResult/resultAdd.html | 28 --
.../wireManager/viewResult/resultImport.html | 46 ---
.../wireManager/viewResult/viewResult.html | 24 +-
.../js/wireManager/viewResult/viewResult.js | 338 ++++++------------
5 files changed, 110 insertions(+), 328 deletions(-)
delete mode 100644 hxy-web/html/wireManager/viewResult/resultAdd.html
delete mode 100644 hxy-web/html/wireManager/viewResult/resultImport.html
diff --git a/hxy-web/html/wireManager/header.html b/hxy-web/html/wireManager/header.html
index ae300a0..b1eb68c 100644
--- a/hxy-web/html/wireManager/header.html
+++ b/hxy-web/html/wireManager/header.html
@@ -90,7 +90,7 @@
-
diff --git a/hxy-web/html/wireManager/viewResult/resultAdd.html b/hxy-web/html/wireManager/viewResult/resultAdd.html
deleted file mode 100644
index cd2acee..0000000
--- a/hxy-web/html/wireManager/viewResult/resultAdd.html
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
- 护线员考勤
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/hxy-web/html/wireManager/viewResult/resultImport.html b/hxy-web/html/wireManager/viewResult/resultImport.html
deleted file mode 100644
index e51a8e9..0000000
--- a/hxy-web/html/wireManager/viewResult/resultImport.html
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
- 护线员考勤
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/hxy-web/html/wireManager/viewResult/viewResult.html b/hxy-web/html/wireManager/viewResult/viewResult.html
index 295b513..ceac6bf 100644
--- a/hxy-web/html/wireManager/viewResult/viewResult.html
+++ b/hxy-web/html/wireManager/viewResult/viewResult.html
@@ -29,10 +29,10 @@
-
+
diff --git a/hxy-web/js/wireManager/viewResult/viewResult.js b/hxy-web/js/wireManager/viewResult/viewResult.js
index 134e565..8be086f 100644
--- a/hxy-web/js/wireManager/viewResult/viewResult.js
+++ b/hxy-web/js/wireManager/viewResult/viewResult.js
@@ -17,24 +17,36 @@ layui.use(['form','layer','table'], function () {
})
return false; // 阻止表单跳转。如果需要表单跳转,去掉这段即可。
});
- form.on('submit(reset)', function () {
- console.log("重置")
- $('#search1').val('');
- $('#search2').val('');
- $('#search3').val('');
- let obj = {
- search1:'',
- search2:''
- }
- // 对表格进行重载。id 即 table表格的id
- table.reload('table', {
- // //设定异步数据接口的额外参数
- page:{curr : 1}
- ,where: obj
- })
- return false; // 阻止表单跳转。如果需要表单跳转,去掉这段即可。
- });
+ $("#reset").click(function(){
+ console.log("重置")
+ $('#search1').val('');
+ $('#search2').val('');
+ $('#search3').val('');
+ let obj = {
+ search1:'',
+ search2:'',
+ search3:''
+ }
+ // 对表格进行重载。id 即 table表格的id
+ table.reload('table', {
+ // //设定异步数据接口的额外参数
+ page:{curr : 1}
+ ,where: obj
+ })
+ })
+ table.on('tool(table)', function (obj) {
+ switch (obj.event) {
+ case 'details':
+ console.log('详情',obj)
+ detailsView(obj.id)
+ break;
+ case 'uploadResult':
+ console.log('上传结果',obj)
+ updateView()
+ break;
+ }
+ });
init();
});
@@ -79,11 +91,56 @@ function init(){
{field:'uName', title: '姓名',align: 'center',},
{field:'month', title: '月份',align: 'center',},
{field:'alls', title: '负责巡护区段',align: 'center',},
- {field:'first', title: '正常巡视结果(第一次)',align: 'center',width:170},
- {field:'second', title: '正常巡视结果(第二次)',align: 'center',width:170},
- {field:'other', title: '巡视段外巡视',align: 'center', },
- {field:'unStation', title: '未巡视',align: 'center', },
- {field:'days', title: '特巡天数结果',align: 'center',},
+ {
+ field: '',
+ title: '正常巡视结果(第一次)',
+ align: 'center',
+ templet: function(d){
+ var first = d.first
+ var html = `${first}`;
+ return html;
+ },
+ },
+ {
+ field: '',
+ title: '正常巡视结果(第二次)',
+ align: 'center',
+ templet: function(d){
+ var second = d.second
+ var html = `${second}`;
+ return html;
+ },
+ },
+ {
+ field: '',
+ title: '巡视段外巡视',
+ align: 'center',
+ templet: function(d){
+ var other = d.other
+ var html = `${other}`;
+ return html;
+ },
+ },
+ {
+ field: '',
+ title: '未巡视',
+ align: 'center',
+ templet: function(d){
+ var unStation = d.unStation
+ var html = `${unStation}`;
+ return html;
+ },
+ },
+ {
+ field: '',
+ title: '特巡天数结果',
+ align: 'center',
+ templet: function(d){
+ var days = d.days
+ var html = `${days}`;
+ return html;
+ },
+ },
{
title: '操作',
toolbar: '#opeator-bar',
@@ -96,59 +153,12 @@ function init(){
}
-/**
- * 新增页面
- * */
-function add() {
- var height = '90%';
- var width = '80%';
- var index = layer.open({
- title: ['新增月工作计划', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
- type: 2,
- content: 'resultAdd.html',
- area: [width, height],
- maxmin: false,
- success: function (layero, index) {
- // //打开页面成功时执行
- var myIframe = window[layero.find('iframe')[0]['name']];
- //getTaskSource()为子页面的方法
- // myIframe.getTaskSource("taskSourceId","");
- },
- yes: function (index, layero) {
- // //提交子页面时执行
- // // 获取弹出层中的form表单元素
- // var formSubmit = layer.getChildFrame('form', index);
- // var submited = formSubmit.find('button')[0];
- // // 触发点击事件,会对表单进行验证,验证成功则提交表单,失败则返回错误信息
- // // var myIframe = window[layero.find('iframe')[0]['name']];
- // // myIframe.selectCheck(); //aaa()为子页面的方法
- // submited.click();
- // example.ajax.reload(); // 刷新页面
- }
- });
-}
-
-/**
- * 查看按钮
- * */
-function buttonCheck(id, permission, pers) {
- if (permission != "") {
- if ($.inArray(permission, pers) < 0) {
- return "";
- }
- }
- var btn = $("");
- return btn.prop("outerHTML");
-}
-
-/**
- * 查看
- * */
-function checkView(id) {
- let height = '90%';
- let width = '80%';
- $.ajax({
+//详情
+function detailsView(id) {
+ let height = '98%';
+ let width = '99%';
+ /* $.ajax({
type: 'post',
contentType: "application/x-www-form-urlencoded",
url: oiPlanUrl + '/monthlyPlanSubmission/getDataById',
@@ -160,7 +170,7 @@ function checkView(id) {
var index = layer.open({
title: ['查看', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
type: 2,
- content: 'resultAdd.html',
+ content: './wagesReport/producePayrollDetails.html',
area: [width, height],
maxmin: false,
success: function (layero, index) {
@@ -172,166 +182,20 @@ function checkView(id) {
},
});
}
- })
-}
-
-/**
- * 修改按钮
- * */
-function buttonUpdate(id,planStartTime, permission, pers) {
- if (permission != "") {
- if ($.inArray(permission, pers) < 0) {
- return "";
- }
- }
- var btn = $("");
- return btn.prop("outerHTML");
-}
-
-/**
- * 修改
- * */
-function updateView(id, planStartTime) {
- let height = '90%';
- let width = '80%';
- $.ajax({
- type: 'post',
- contentType: "application/x-www-form-urlencoded",
- url: oiPlanUrl + '/monthlyPlanSubmission/getDataById',
- dataType: 'json',
- data: {
- id: id
- },
- success: function (data) {
- var index = layer.open({
- title: ['修改', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
- type: 2,
- content: 'resultAdd.html',
- area: [width, height],
- maxmin: false,
- success: function (layero, index) {
- //打开页面成功时执行
- var myIframe = window[layero.find('iframe')[0]['name']];
- // myIframe.setData(data.data); //aaa()为子页面的方法
- },
- yes: function (index, layero) {
- // //提交子页面时执行
- // // 获取弹出层中的form表单元素
- // var formSubmit = layer.getChildFrame('form', index);
- // var submited = formSubmit.find('button')[0];
- // // 触发点击事件,会对表单进行验证,验证成功则提交表单,失败则返回错误信息
- // submited.click();
- }
- });
- }
- })
-
-}
-
-/**
- * 删除按钮
- * */
-function buttonDelete(id, planStartTime, permission, pers) {
- if (permission != "") {
- if ($.inArray(permission, pers) < 0) {
- return "";
- }
- }
- var btn = $("");
- return btn.prop("outerHTML");
-}
-
-/**
- * 删除
- * */
-function delView(id, planStartTime) {
- //判断planStartTime是否为当前月或者下一月
- // 获取计划开始时间的年份和月份
- var startTimeYearMonth = planStartTime.substring(0, 7); // 提取年份和月份部分,例如 '2024-07'
- if (startTimeYearMonth === `${currentYear}-${currentMonth}` || startTimeYearMonth === `${currentYear}-${nextMonth}`) {
- let index = layer.confirm("是否确定删除数据?", function () {
- $.ajax({
- type: 'post',
- url: oiPlanUrl + '/monthlyPlanSubmission/del',
- dataType: 'json',
- data: {
- id: id
- },
- success: function (data) {
- layer.close(index);
- if (data.code == 200) {
- top.layer.alert('删除成功', {icon: 1});
- // example.ajax.reload(); // 刷新页面
- } else {
- layer.msg("删除失败", {icon: 2}, function () {
- // example.ajax.reload(); // 刷新页面
- });
- }
- }
- })
- })
- } else {
- layer.msg("只可删除本月及下月计划", {icon: 0})
- return "";
- }
-}
-
-function importData(){
- var height = '80%';
- var width = '50%';
- var index = layer.open({
- title: [`导入`, 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
- type: 2,
- // content: 'child/orgInformation.html',
- content: 'resultImport.html',
- area: [width, height],
- maxmin: false,
- success: function (layero, index) {
- /*var myIframe = parent.window[layero.find('iframe')[0]['name']];
- var json = {'proIds': proId}
- myIframe.setParams(json)*/
- },
- yes: function (index, layero) {
- },
- end: function () {
- }
- });
-}
-
-function importDataThread(formData, idx) {
- $.ajax({
- url: oiPlanUrl + "/basePerson/importData",
- type: 'POST',
- async: false,
- data: formData,
- timeout: 20000,
- // 告诉jQuery不要去处理发送的数据
- processData: false,
- // 告诉jQuery不要去设置Content-Type请求头
- contentType: false,
- success: function (data) {
- layer.close(idx);
- if (data.code == 200) {
- layer.alert(data.data, {icon: 1});
- // example.ajax.reload(); // 刷新页面
- } else{
- layer.alert(data.msg, {icon: 2});
- }
-
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- console.log(JSON.stringify(errorThrown));
- layer.close(idx);
- }
- });
- $("#basePersonFile").val("");
-}
-
-//导出
-function exportData() {
- // let search1 = $('#search1').val();
- // let search2 = $('#search2').val();
- window.location.href = oiPlanUrl + "/monthlyPlanSubmission/export?token=" + token;
-
-
+ }) */
+
+ //测试
+ var index = layer.open({
+ title: ['查看', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
+ type: 2,
+ content: './viewResultDetail.html',
+ area: [width, height],
+ maxmin: false,
+ success: function (layero, index) {
+ // var myIframe = window[layero.find('iframe')[0]['name']];
+ // myIframe.hideSubmit();
+ // var fnc = myIframe.setData(data.data); //aaa()为子页面的方法
+
+ },
+ });
}
\ No newline at end of file