From 4363abf39cad94b2ddb1e1ef5486c84a55e84683 Mon Sep 17 00:00:00 2001 From: shijing Date: Wed, 31 May 2023 17:20:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=B8=B8=E7=9B=91=E7=9D=A3=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/api/task.js | 371 ++++++ client/src/components/Pagination/index.vue | 2 +- client/src/main.js | 3 +- client/src/router/index.js | 50 +- client/src/utils/print.js | 172 +++ client/src/views/supervisionNew/basicGoal.vue | 372 ++++++ .../views/supervisionNew/basicGoalDept.vue | 136 ++ .../views/supervisionNew/complaint_form.vue | 148 +++ client/src/views/supervisionNew/mytask.vue | 1165 +++++++++++++++++ client/src/views/supervisionNew/mytaskDo.vue | 158 +++ .../views/supervisionNew/oinspect_form.vue | 149 +++ client/src/views/supervisionNew/pt_form.vue | 171 +++ client/src/views/supervisionNew/rc_form.vue | 198 +++ client/src/views/supervisionNew/risk_form.vue | 158 +++ .../src/views/supervisionNew/statistics.vue | 718 ++++++++++ client/src/views/supervisionNew/task.vue | 304 +++++ client/src/views/supervisionNew/taskdo.vue | 734 +++++++++++ 17 files changed, 5006 insertions(+), 3 deletions(-) create mode 100644 client/src/utils/print.js create mode 100644 client/src/views/supervisionNew/basicGoal.vue create mode 100644 client/src/views/supervisionNew/basicGoalDept.vue create mode 100644 client/src/views/supervisionNew/complaint_form.vue create mode 100644 client/src/views/supervisionNew/mytask.vue create mode 100644 client/src/views/supervisionNew/mytaskDo.vue create mode 100644 client/src/views/supervisionNew/oinspect_form.vue create mode 100644 client/src/views/supervisionNew/pt_form.vue create mode 100644 client/src/views/supervisionNew/rc_form.vue create mode 100644 client/src/views/supervisionNew/risk_form.vue create mode 100644 client/src/views/supervisionNew/statistics.vue create mode 100644 client/src/views/supervisionNew/task.vue create mode 100644 client/src/views/supervisionNew/taskdo.vue diff --git a/client/src/api/task.js b/client/src/api/task.js index 704d641..4ea07a7 100644 --- a/client/src/api/task.js +++ b/client/src/api/task.js @@ -118,3 +118,374 @@ export function deleteTaskdept(id) { method: 'delete' }) } + + +// 集团目标 +export function getPgoalList(query) { + return request({ + url: '/supervision/pgoal/', + method: 'get', + params: query + }) +} +export function createPgoal(data) { + return request({ + url: '/supervision/pgoal/', + method: 'post', + data + }) +} +export function getPgoal(id) { + return request({ + url: `/supervision/pgoal/${id}/`, + method: 'get' + }) +} +export function updatePgoal(id, data) { + return request({ + url: `/supervision/pgoal/${id}/`, + method: 'put', + data + }) +} +export function deletePgoal(id) { + return request({ + url: `/supervision/pgoal/${id}/`, + method: 'delete' + }) +} +//部门目标 +export function getPgoalDeptList(query) { + return request({ + url: '/supervision/pgoaldept/', + method: 'get', + params: query + }) +} +export function createPgoalDept(data) { + return request({ + url: '/supervision/pgoaldept/', + method: 'post', + data + }) +} +export function getPgoalDept(id) { + return request({ + url: `/supervision/pgoaldept/${id}/`, + method: 'get' + }) +} +export function updatePgoalDept(id, data) { + return request({ + url: `/supervision/pgoaldept/${id}/`, + method: 'put', + data + }) +} +export function deletePgoalDept(id) { + return request({ + url: `/supervision/pgoaldept/${id}/`, + method: 'delete' + }) +} +//任务 +export function getTask2List(query) { + return request({ + url: '/supervision/task2/', + method: 'get', + params: query + }) +} + +export function getTask2(id) { + return request({ + url: `/supervision/task2/${id}/`, + method: 'get' + }) +} + +export function createTask2(data) { + return request({ + url: '/supervision/task2/', + method: 'post', + data + }) +} +export function addDeptsTask2(id,data) { + return request({ + url: `/supervision/task2/${id}/add_depts/`, + method: 'post', + data + }) +} + +export function updateTask2(id, data) { + return request({ + url: `/supervision/task2/${id}/`, + method: 'put', + data + }) +} +export function startTask2(id) { + return request({ + url: `/supervision/task2/${id}/start/`, + method: 'put' + }) +} +export function closeTask2(id) { + return request({ + url: `/supervision/task2/${id}/close/`, + method: 'put' + }) +} +export function deleteTask2(id, data) { + return request({ + url: `/supervision/task2/${id}/`, + method: 'delete', + data + }) +} +//获取该任务下的执行组织 +export function getTask2Do(query) { + return request({ + url: '/supervision/task2do/', + method: 'get', + params: query + }) +} +//我的任务 +export function getMyTask2Do(query) { + return request({ + url: '/supervision/task2do/my/', + method: 'get', + params: query + }) +} + +//pt +export function getPtList(query) { + return request({ + url: '/supervision/pt/', + method: 'get', + params: query + }) +} +export function createPt(data) { + return request({ + url: '/supervision/pt/', + method: 'post', + data + }) +} +export function getPt(id) { + return request({ + url: `/supervision/pt/${id}/`, + method: 'get' + }) +} +export function updatePt(id, data) { + return request({ + url: `/supervision/pt/${id}/`, + method: 'put', + data + }) +} +export function deletePt(id) { + return request({ + url: `/supervision/pt/${id}/`, + method: 'delete' + }) +} +export function impPt(data) { + return request({ + url: '/supervision/pt/imp/', + method: 'post', + data + }) +} +//rc +export function getRcList(query) { + return request({ + url: '/supervision/rc/', + method: 'get', + params: query + }) +} +export function createRc(data) { + return request({ + url: '/supervision/rc/', + method: 'post', + data + }) +} +export function getRc(id) { + return request({ + url: `/supervision/rc/${id}/`, + method: 'get' + }) +} +export function updateRc(id, data) { + return request({ + url: `/supervision/rc/${id}/`, + method: 'put', + data + }) +} +export function deleteRc(id) { + return request({ + url: `/supervision/rc/${id}/`, + method: 'delete' + }) +} +export function impRc(data) { + return request({ + url: '/supervision/rc/imp_error/', + method: 'post', + data + }) +} +export function impOverdue(data) { + return request({ + url: '/supervision/rc/imp_overdue/', + method: 'post', + data + }) +} +///Risk +export function getRiskList(query) { + return request({ + url: '/supervision/risk/', + method: 'get', + params: query + }) +} +export function createRisk(data) { + return request({ + url: '/supervision/risk/', + method: 'post', + data + }) +} +export function getRisk(id) { + return request({ + url: `/supervision/risk/${id}/`, + method: 'get' + }) +} +export function updateRisk(id, data) { + return request({ + url: `/supervision/risk/${id}/`, + method: 'put', + data + }) +} +export function deleteRisk(id) { + return request({ + url: `/supervision/risk/${id}/`, + method: 'delete' + }) +} +export function impRisk(data) { + return request({ + url: '/supervision/risk/imp/', + method: 'post', + data + }) +} +///Complaint +export function getComplaintList(query) { + return request({ + url: '/supervision/complaint/', + method: 'get', + params: query + }) +} +export function createComplaint(data) { + return request({ + url: '/supervision/complaint/', + method: 'post', + data + }) +} +export function getComplaint(id) { + return request({ + url: `/supervision/complaint/${id}/`, + method: 'get' + }) +} +export function updateComplaint(id, data) { + return request({ + url: `/supervision/complaint/${id}/`, + method: 'put', + data + }) +} +export function deleteComplaint(id) { + return request({ + url: `/supervision/complaint/${id}/`, + method: 'delete' + }) +} +export function impComplaint(data) { + return request({ + url: '/supervision/complaint/imp/', + method: 'post', + data + }) +} +//Oinspect +export function getOinspectList(query) { + return request({ + url: '/supervision/oinspect/', + method: 'get', + params: query + }) +} +export function createOinspect(data) { + return request({ + url: '/supervision/oinspect/', + method: 'post', + data + }) +} +export function getOinspect(id) { + return request({ + url: `/supervision/oinspect/${id}/`, + method: 'get' + }) +} +export function updateOinspect(id, data) { + return request({ + url: `/supervision/oinspect/${id}/`, + method: 'put', + data + }) +} +export function deleteOinspect(id) { + return request({ + url: `/supervision/oinspect/${id}/`, + method: 'delete' + }) +} +export function impOinspect(data) { + return request({ + url: '/supervision/oinspect/imp/', + method: 'post', + data + }) +} +//supervision/task2do/save_num/ +export function saveNum(id,data) { + return request({ + url: `/supervision/task2do/${id}/save_num/`, + method: 'put', + data + }) +} +export function noNum(id,data) { + return request({ + url: `/supervision/task2do/${id}/no_record/`, + method: 'put', + data + }) +} diff --git a/client/src/components/Pagination/index.vue b/client/src/components/Pagination/index.vue index c5ace71..d4c7e8b 100644 --- a/client/src/components/Pagination/index.vue +++ b/client/src/components/Pagination/index.vue @@ -35,7 +35,7 @@ export default { pageSizes: { type: Array, default() { - return [10, 20, 30, 50] + return [10, 20, 30, 50,100,200] } }, layout: { diff --git a/client/src/main.js b/client/src/main.js index 34a81de..f68a19d 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -10,7 +10,8 @@ import '@/styles/index.scss' // global css import App from './App' import store from './store' import router from './router' - +import Print from '@/utils/print' +Vue.use(Print) import '@/icons' // icon import '@/permission' // permission control /** diff --git a/client/src/router/index.js b/client/src/router/index.js index c904e1c..c7ea09f 100644 --- a/client/src/router/index.js +++ b/client/src/router/index.js @@ -239,7 +239,55 @@ export const asyncRoutes = [ }, ] }, - + { + path: '/supervisionNew', + component: Layout, + redirect: '/supervisionNew/task', + name: 'supervisionNew', + meta: { title: '日常监督(新)', icon: 'table'}, + alwaysShow: true, + children: [ + { + path: 'basicGoal', + name: 'basicGoal', + component: () => import('@/views/supervisionNew/basicGoal.vue'), + meta: { title: '年度基础目标' , perms: ['task2']} + }, + { + path: 'task', + name: 'Task', + component: () => import('@/views/supervisionNew/task.vue'), + meta: { title: '报送任务' , perms: ['task2']} + }, + { + path: 'myTask', + name: 'mytask', + component: () => import('@/views/supervisionNew/mytask.vue'), + meta: { title: '我的任务'} + }, + { + path: 'statistics', + name: 'statistics', + component: () => import('@/views/supervisionNew/statistics.vue'), + meta: { title: '部门报告'}, + hidden: true + }, + { + path: 'mytaskDo', + name: 'mytaskDo', + component: () => import('@/views/supervisionNew/mytaskDo.vue'), + meta: { title: '我的任务执行'}, + hidden: true + }, + { + path: 'task2do/:id', + name: 'Task2do', + component: () => import('@/views/supervisionNew/taskdo.vue'), + meta: { title: '报送任务执行', perms: ['task2do'] }, + hidden: true + }, + ] + }, { path: '/qualityinspect', component: Layout, diff --git a/client/src/utils/print.js b/client/src/utils/print.js new file mode 100644 index 0000000..0bfa4a8 --- /dev/null +++ b/client/src/utils/print.js @@ -0,0 +1,172 @@ +// 打印类属性、方法定义 +/* eslint-disable */ +import Vue from 'vue' + +const Print = function (dom, options) { + if (!(this instanceof Print)) return new Print(dom, options); + + this.options = this.extend({ + 'noPrint': '.no-print' + }, options); + + if ((typeof dom) === "string") { + this.dom = document.querySelector(dom); + } else { + this.isDOM(dom) + this.dom = this.isDOM(dom) ? dom : dom.$el; + } + + this.init(); +}; +Print.prototype = { + init: function () { + var content = this.getStyle() + this.getHtml(); + this.writeIframe(content); + }, + extend: function (obj, obj2) { + for (var k in obj2) { + obj[k] = obj2[k]; + } + return obj; + }, + + getStyle: function () { + var str = "", + styles = document.querySelectorAll('style,link'); + for (var i = 0; i < styles.length; i++) { + str += styles[i].outerHTML; + } + str += ""; + // 去除height:100%样式,解决分页下,样式混乱问题 + str += ""; + + return str; + }, + + getHtml: function () { + var inputs = document.querySelectorAll('input'); + var textareas = document.querySelectorAll('textarea'); + var selects = document.querySelectorAll('select'); + var canvass = document.querySelectorAll('canvas'); + + for (var k = 0; k < inputs.length; k++) { + if (inputs[k].type == "checkbox" || inputs[k].type == "radio") { + if (inputs[k].checked == true) { + inputs[k].setAttribute('checked', "checked") + } else { + inputs[k].removeAttribute('checked') + } + } else if (inputs[k].type == "text") { + inputs[k].setAttribute('value', inputs[k].value) + } else { + inputs[k].setAttribute('value', inputs[k].value) + } + } + + for (var k2 = 0; k2 < textareas.length; k2++) { + if (textareas[k2].type == 'textarea') { + textareas[k2].innerHTML = textareas[k2].value + } + } + + for (var k3 = 0; k3 < selects.length; k3++) { + if (selects[k3].type == 'select-one') { + var child = selects[k3].children; + for (var i in child) { + if (child[i].tagName == 'OPTION') { + if (child[i].selected == true) { + child[i].setAttribute('selected', "selected") + } else { + child[i].removeAttribute('selected') + } + } + } + } + } + + //canvass echars图表转为图片 + for (var k4 = 0; k4 < canvass.length; k4++) { + var imageURL = canvass[k4].toDataURL("image/png"); + var img = document.createElement("img"); + img.src = imageURL; + img.setAttribute('style', 'max-width: 100%;'); + img.className = 'isNeedRemove' + // canvass[k4].style.display = 'none' + // canvass[k4].parentNode.style.width = '100%' + // canvass[k4].parentNode.style.textAlign = 'center' + canvass[k4].parentNode.insertBefore(img,canvass[k4].nextElementSibling); + } + + // 包裹要打印的元素 + // fix: https://github.com/xyl66/vuePlugs_printjs/issues/36 + // return this.wrapperRefDom(this.dom).outerHTML; + return this.dom.outerHTML; + }, + // 向父级元素循环,包裹当前需要打印的元素 + // 防止根级别开头的 css 选择器不生效 + wrapperRefDom: function (refDom) { + let prevDom = null + let currDom = refDom + while (currDom && currDom.tagName.toLowerCase() !== 'body') { + if (prevDom) { + let element = currDom.cloneNode(false) + element.appendChild(prevDom) + prevDom = element + } else { + prevDom = currDom.cloneNode(true) + } + + currDom = currDom.parentElement + } + + return currDom.tagName.toLowerCase() === 'body' ? currDom : prevDom + }, + + writeIframe: function (content) { + var w, doc, iframe = document.createElement('iframe'), + f = document.body.appendChild(iframe); + iframe.id = "myIframe"; + //iframe.style = "position:absolute;width:0;height:0;top:-10px;left:-10px;"; + iframe.setAttribute('style', 'position:absolute;width:0;height:0;top:-10px;left:-10px;'); + w = f.contentWindow || f.contentDocument; + doc = f.contentDocument || f.contentWindow.document; + doc.open(); + doc.write(content); + doc.close(); + var _this = this + iframe.onload = function(){ + _this.toPrint(w); + setTimeout(function () { + document.body.removeChild(iframe) + }, 100) + } + }, + + toPrint: function (frameWindow) { + try { + setTimeout(function () { + frameWindow.focus(); + try { + if (!frameWindow.document.execCommand('print', false, null)) { + frameWindow.print(); + } + } catch (e) { + frameWindow.print(); + } + frameWindow.close(); + }, 10); + } catch (err) { + console.log('err', err); + } + }, + isDOM: (typeof HTMLElement === 'object') ? + function (obj) { + return obj instanceof HTMLElement; + } : + function (obj) { + return obj && typeof obj === 'object' && obj.nodeType === 1 && typeof obj.nodeName === 'string'; + } +}; +export default (app) => { + Vue.prototype.$PRINT = Print; +} diff --git a/client/src/views/supervisionNew/basicGoal.vue b/client/src/views/supervisionNew/basicGoal.vue new file mode 100644 index 0000000..31755c6 --- /dev/null +++ b/client/src/views/supervisionNew/basicGoal.vue @@ -0,0 +1,372 @@ + + + + + \ No newline at end of file diff --git a/client/src/views/supervisionNew/basicGoalDept.vue b/client/src/views/supervisionNew/basicGoalDept.vue new file mode 100644 index 0000000..57e1f79 --- /dev/null +++ b/client/src/views/supervisionNew/basicGoalDept.vue @@ -0,0 +1,136 @@ + + + + + \ No newline at end of file diff --git a/client/src/views/supervisionNew/complaint_form.vue b/client/src/views/supervisionNew/complaint_form.vue new file mode 100644 index 0000000..e52e3ce --- /dev/null +++ b/client/src/views/supervisionNew/complaint_form.vue @@ -0,0 +1,148 @@ + + + + + + + \ No newline at end of file diff --git a/client/src/views/supervisionNew/mytask.vue b/client/src/views/supervisionNew/mytask.vue new file mode 100644 index 0000000..512ca2d --- /dev/null +++ b/client/src/views/supervisionNew/mytask.vue @@ -0,0 +1,1165 @@ + + + + \ No newline at end of file diff --git a/client/src/views/supervisionNew/mytaskDo.vue b/client/src/views/supervisionNew/mytaskDo.vue new file mode 100644 index 0000000..027cdb0 --- /dev/null +++ b/client/src/views/supervisionNew/mytaskDo.vue @@ -0,0 +1,158 @@ + + + diff --git a/client/src/views/supervisionNew/oinspect_form.vue b/client/src/views/supervisionNew/oinspect_form.vue new file mode 100644 index 0000000..712c2de --- /dev/null +++ b/client/src/views/supervisionNew/oinspect_form.vue @@ -0,0 +1,149 @@ + + + + + + + \ No newline at end of file diff --git a/client/src/views/supervisionNew/pt_form.vue b/client/src/views/supervisionNew/pt_form.vue new file mode 100644 index 0000000..5b31224 --- /dev/null +++ b/client/src/views/supervisionNew/pt_form.vue @@ -0,0 +1,171 @@ + + + + + + + \ No newline at end of file diff --git a/client/src/views/supervisionNew/rc_form.vue b/client/src/views/supervisionNew/rc_form.vue new file mode 100644 index 0000000..c21aaff --- /dev/null +++ b/client/src/views/supervisionNew/rc_form.vue @@ -0,0 +1,198 @@ + + + + + + + \ No newline at end of file diff --git a/client/src/views/supervisionNew/risk_form.vue b/client/src/views/supervisionNew/risk_form.vue new file mode 100644 index 0000000..e7deb33 --- /dev/null +++ b/client/src/views/supervisionNew/risk_form.vue @@ -0,0 +1,158 @@ + + + + + + + \ No newline at end of file diff --git a/client/src/views/supervisionNew/statistics.vue b/client/src/views/supervisionNew/statistics.vue new file mode 100644 index 0000000..a681a86 --- /dev/null +++ b/client/src/views/supervisionNew/statistics.vue @@ -0,0 +1,718 @@ + + + + \ No newline at end of file diff --git a/client/src/views/supervisionNew/task.vue b/client/src/views/supervisionNew/task.vue new file mode 100644 index 0000000..15aae01 --- /dev/null +++ b/client/src/views/supervisionNew/task.vue @@ -0,0 +1,304 @@ + + + + \ No newline at end of file diff --git a/client/src/views/supervisionNew/taskdo.vue b/client/src/views/supervisionNew/taskdo.vue new file mode 100644 index 0000000..9c87dfc --- /dev/null +++ b/client/src/views/supervisionNew/taskdo.vue @@ -0,0 +1,734 @@ + + + \ No newline at end of file