From 9eb85404a96658d83fc0168f306adabb8c1c992e Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Tue, 14 Nov 2023 10:31:03 +0800 Subject: [PATCH] Merge branch 'feature_1.0' --- src/views/toCarryOutLegislativeReforms/components/queryForm.vue | 95 +--- .prettierrc | 22 .eslintrc.js | 70 -- .vscode/settings.json | 242 +++++----- src/views/toCarryOutLegislativeReforms/reform/index.vue | 414 ++++++++++++------- src/views/toCarryOutLegislativeReforms/components/newWorkOrder.vue | 154 +++---- src/views/toCarryOutLegislativeReforms/components/workOrderInformation.vue | 254 ++++++------ 7 files changed, 619 insertions(+), 632 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 7351902..d172433 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,68 +1,16 @@ module.exports = { - root: true, - parserOptions: { - parser: 'babel-eslint', - sourceType: 'module' - }, env: { browser: true, - node: true, - es6: true, + node: true }, - extends: [/* vue 2 ������ */ - "plugin:vue/recommended", - "plugin:vue/essential", - "plugin:vue/strongly-recommended", - /* vue 3 ������ */ - // "plugin:vue/vue3-recommended" - // "plugin:vue/vue3-essential" - // "plugin:vue/vue3-strongly-recommended" + extends: [ + 'plugin:vue/recommended', // ���������������������vue.js������ + 'eslint:recommended' //������Eslint������������������������������������ ], - - // add your custom rules here - //it is base on https://github.com/vuejs/eslint-config-vue - rules: { - 'vue/no-unused-vars': 'error', - 'eqeqeq': ['error', 'always'], // ��������������������������� - 'semi': 0, // ��������������������������������� - 'no-use-before-define': [1, 'nofunc'], // ������������������������ - 'max-lines': ['error', { 'max': 2000, 'skipBlankLines': true }], - 'no-mixed-spaces-and-tabs': 'warn', // ���������������������tab������������ - 'newline-per-chained-call': ['error', { ignoreChainWithDepth: 1 }], // promise ������ ��������������������������������������� - 'vue/attribute-hyphenation': ['error', 'always'], // prop������������������������������������������������������������������������������������prop��������������������������������������� - 'vue/html-indent': [ - 'warn', - 2, - { - attribute: 1, - baseIndent: 1, - closeBracket: 0, - alignAttributesVertically: true - } - ], - 'curly': 2, // ������������ if(){} ������{} - 'vue/prop-name-casing': ['warn', 'camelCase'], //������������������������ - 'vue/this-in-template': ['error', 'never'], //������������template������������this - 'no-trailing-spaces': 1, //��������������������������������� - 'vue/max-attributes-per-line': [ // template���������������������������prop������,������3������������3���������������������������prop��������������������� - 'warn', - { - singleline: 3, - multiline: { - max: 1, - allowFirstLine: false - } - } - ], - 'no-catch-shadow': 'error', //������catch������������������������������������������ - 'vue/v-bind-style': ['error', 'shorthand'], // ������������:��������� - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', // ���������������������������������debugger - 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'no-unused-vars': 0, // ��������������������������������� - 'spaced-comment': 0 // ������������������ // ��� /* ��������������������� + parserOptions: { + ecmaVersion: 13, + sourceType: 'module' }, - globals: { - 'AMap': false, - 'AMapUI': false - }, + plugins: ['vue'], + rules: {} } diff --git a/.prettierrc b/.prettierrc index 267f26c..769890c 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,11 +1,15 @@ { - "useTabs": true, - "arrowParens": "avoid", - "printWidth": 120, - "tabWidth": 2, - "semi": true, - "singleQuote": true, - "bracketSpacing": true, - "endOfLine": "auto", - "trailingComma": "none" + "printWidth": 80, + "tabWidth": 2, + "semi": false, + "singleQuote": true, + "endOfLine": "auto", + "arrowParens": "avoid", + "bracketSpacing": true, + "insertPragma": false, + "jsxBracketSameLine": false, + "rangeStart": 0, + "requirePragma": false, + "trailingComma": "none", + "useTabs": false } diff --git a/.vscode/settings.json b/.vscode/settings.json index 2d94aac..59d224c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,120 +1,126 @@ { - "workbench.iconTheme": "material-icon-theme", - "editor.fontSize": 16, - // -------------------- ������eslint -------------------- - //autoFixedOnSave ���������������������������������������������������(>1.41.0)������ - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true - }, - "eslint.format.enable": true, - //autoFix������������������������������������������������ - "eslint.validate": ["javascript", "vue", "html", "javascriptreact", "vue-html"], - // -------------------- ������eslint -------------------- - // ��������������������������������������� - "editor.defaultFormatter": "esbenp.prettier-vscode", - "[html]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[css]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[less]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[json]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - //������������������������������ - "javascript.format.insertSpaceBeforeFunctionParenthesis": false, - // -------------------- vetur ������ -------------------- - // vue������������������������������vetur - "[vue]": { - "editor.defaultFormatter": "octref.vetur" - }, - // ��������������������������������� - "vetur.format.defaultFormatter.html": "js-beautify-html", - // ���vue������js���������������������ts��������������������� - // "vetur.format.defaultFormatter.js": "vscode-typescript", - // ���vue������js���prettier��������������� ��������� - "vetur.format.defaultFormatter.js": "prettier", - "vetur.format.defaultFormatterOptions": { - "js": "prettier", - "js-beautify-html": { - "wrap_attributes": "aligned-multiple" //������������������������������������������������������ - }, - "prettyhtml": { - "tabWidth": 4, // ���������vetur���tabSize������ - "printWidth": 100, //������100������ - "singleQuote": true, //��������������������� - "semi": false, // ���������������; - "wrapAttributes": false, - "sortAttributes": false - }, - //vue������js������ - "prettier": { - "semi": false, // ���������������; - "singleQuote": true, //��������������������� - "trailingComma": "none" //������������������������ - } - }, - // -------------------- vetur ������ -------------------- - // -------------------- koro1FileHeader ������ -------------------- - // ������������ - "fileheader.customMade": { - "Author": "AuthorName", - "Date": "Do not edit", // ������������������(������) - "LastEditors": "AuthorName", // ��������������������� - "LastEditTime": "Do not edit", // ������������������������ - "Description": "" - // "FilePath": "only file name", // ��������������� - // "custom_string_obkoro1_copyright": "Copyright (C) ${now_year} AuthorName. All rights reserved.", - // "custom_string_obkoro1_date": "Do not edit" // ������Date��������������� - }, - // ������������ - "fileheader.cursorMode": { - "description": "", - //"custom_string_obkoro1": "", - "param": "params", - "return": "" - }, - // ��������������� - "fileheader.configObj": { - "createHeader": false, // ��������������������������������������������������� - "autoAdd": false, // ������������������������������������������������������������������������ - "openFunctionParamsCheck": true, //������������������������������������������������������ - "createFileTime": true, // ������������������������������������������false������������������������������������ - "dateFormat": "YYYY-MM-DD HH:mm:ss", // ��������������������������������������������������� - // ��������������������������������������� - "atSymbol": ["@", "@"], // ������������������������������������������������������ @ - "colon": [": ", ": "] // ������������������������������������������������������ : - // ���������������������������Date���LastEditTime���LastEditors���Description���FilePath - // "specialOptions": { - // "Date": "since", - // "LastEditTime": "lastTime", - // "LastEditors": "LastAuthor", - // "Description": "message", - // "FilePath": "������������������������������" - // } - // ������������������ - // "functionParamsShape": "normal", // ������ - // "functionParamsShape": "no bracket", // ��������������� - // "functionParamsShape": "no type", // ������������ - // "functionParamsShape": [ "{", "}"], // ��������������������������������������� {} - // "functionTypeSymbol": "*", // ��������������������������������� * - // ������������������������������������ {*} - // "functionParamsShape": "no type", // ������������ - // "functionTypeSymbol": "" // ��������������������������������� * - }, - // -------------------- koro1FileHeader ������ -------------------- - // -------------------- prettier ������(������������������������.js) -------------------- - "prettier.useEditorConfig": false, // ���������editorConfig��������������������������� - "prettier.semi": false, // ���������������; - "prettier.singleQuote": true, //��������������������� - "prettier.trailingComma": "none", //������������������������ - // -------------------- prettier ������ -------------------- - "git.confirmSync": false, - "security.workspace.trust.untrustedFiles": "open" + "workbench.iconTheme": "material-icon-theme", + "editor.fontSize": 16, + // -------------------- ������eslint -------------------- + //autoFixedOnSave ���������������������������������������������������(>1.41.0)������ + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + }, + "eslint.format.enable": true, + //autoFix������������������������������������������������ + "eslint.validate": [ + "javascript", + "vue", + "html", + "javascriptreact", + "vue-html" + ], + // -------------------- ������eslint -------------------- + // ��������������������������������������� + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[html]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[css]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[less]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + //������������������������������ + "javascript.format.insertSpaceBeforeFunctionParenthesis": false, + // -------------------- vetur ������ -------------------- + // vue������������������������������vetur + "[vue]": { + "editor.defaultFormatter": "octref.vetur" + }, + // ��������������������������������� + "vetur.format.defaultFormatter.html": "js-beautify-html", + // ���vue������js���������������������ts��������������������� + // "vetur.format.defaultFormatter.js": "vscode-typescript", + // ���vue������js���prettier��������������� ��������� + "vetur.format.defaultFormatter.js": "prettier", + "vetur.format.defaultFormatterOptions": { + "js": "prettier", + "js-beautify-html": { + "wrap_attributes": "aligned-multiple" //������������������������������������������������������ + }, + "prettyhtml": { + "tabWidth": 4, // ���������vetur���tabSize������ + "printWidth": 100, //������100������ + "singleQuote": true, //��������������������� + "semi": false, // ���������������; + "wrapAttributes": false, + "sortAttributes": false + }, + //vue������js������ + "prettier": { + "semi": false, // ���������������; + "singleQuote": true, //��������������������� + "trailingComma": "none" //������������������������ + } + }, + // -------------------- vetur ������ -------------------- + // -------------------- koro1FileHeader ������ -------------------- + // ������������ + "fileheader.customMade": { + "Author": "AuthorName", + "Date": "Do not edit", // ������������������(������) + "LastEditors": "AuthorName", // ��������������������� + "LastEditTime": "Do not edit", // ������������������������ + "Description": "" + // "FilePath": "only file name", // ��������������� + // "custom_string_obkoro1_copyright": "Copyright (C) ${now_year} AuthorName. All rights reserved.", + // "custom_string_obkoro1_date": "Do not edit" // ������Date��������������� + }, + // ������������ + "fileheader.cursorMode": { + "description": "", + //"custom_string_obkoro1": "", + "param": "params", + "return": "" + }, + // ��������������� + "fileheader.configObj": { + "createHeader": false, // ��������������������������������������������������� + "autoAdd": false, // ������������������������������������������������������������������������ + "openFunctionParamsCheck": true, //������������������������������������������������������ + "createFileTime": true, // ������������������������������������������false������������������������������������ + "dateFormat": "YYYY-MM-DD HH:mm:ss", // ��������������������������������������������������� + // ��������������������������������������� + "atSymbol": ["@", "@"], // ������������������������������������������������������ @ + "colon": [": ", ": "] // ������������������������������������������������������ : + // ���������������������������Date���LastEditTime���LastEditors���Description���FilePath + // "specialOptions": { + // "Date": "since", + // "LastEditTime": "lastTime", + // "LastEditors": "LastAuthor", + // "Description": "message", + // "FilePath": "������������������������������" + // } + // ������������������ + // "functionParamsShape": "normal", // ������ + // "functionParamsShape": "no bracket", // ��������������� + // "functionParamsShape": "no type", // ������������ + // "functionParamsShape": [ "{", "}"], // ��������������������������������������� {} + // "functionTypeSymbol": "*", // ��������������������������������� * + // ������������������������������������ {*} + // "functionParamsShape": "no type", // ������������ + // "functionTypeSymbol": "" // ��������������������������������� * + }, + // -------------------- koro1FileHeader ������ -------------------- + // -------------------- prettier ������(������������������������.js) -------------------- + "prettier.useEditorConfig": false, // ���������editorConfig��������������������������� + "prettier.semi": false, // ���������������; + "prettier.singleQuote": true, //��������������������� + "prettier.trailingComma": "none", //������������������������ + // -------------------- prettier ������ -------------------- + "git.confirmSync": false, + "security.workspace.trust.untrustedFiles": "open" } diff --git a/src/views/toCarryOutLegislativeReforms/components/newWorkOrder.vue b/src/views/toCarryOutLegislativeReforms/components/newWorkOrder.vue index 3a5489f..23a9650 100644 --- a/src/views/toCarryOutLegislativeReforms/components/newWorkOrder.vue +++ b/src/views/toCarryOutLegislativeReforms/components/newWorkOrder.vue @@ -10,13 +10,7 @@ <el-row> <el-col :span="12"> <el-form-item label="���������������" prop="escalationTime" class="span"> - <el-date-picker - v-model="formData.escalationTime" - value-format="yyyy-MM-dd" - size="small" - type="date" - placeholder="������������" - /> + <el-date-picker v-model="formData.escalationTime" value-format="yyyy-MM-dd" size="small" type="date" placeholder="������������" /> </el-form-item> </el-col> <el-col :span="12"> @@ -29,24 +23,14 @@ <el-col :span="12"> <el-form-item label="���������������" prop="unitId" class="span"> <el-select v-model="formData.unitId" placeholder="���������" size="small"> - <el-option - v-for="item in unitList" - :key="item.unitId" - :label="item.unitName" - :value="item.unitId" - /> + <el-option v-for="item in unitList" :key="item.unitId" :label="item.unitName" :value="item.unitId" /> </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="���������������" prop="polluteType" class="span"> <el-select v-model="formData.polluteType" placeholder="���������" size="small"> - <el-option - v-for="item in polluteList" - :key="item.dataKey" - :label="item.dataValue" - :value="item.dataKey" - /> + <el-option v-for="item in polluteList" :key="item.dataKey" :label="item.dataValue" :value="item.dataKey" /> </el-select> </el-form-item> </el-col> @@ -55,12 +39,7 @@ <el-col :span="12"> <el-form-item label="���������������" prop="changeType" class="span"> <el-select v-model="formData.changeType" placeholder="���������" size="small" @change="changeEnumList"> - <el-option - v-for="item in Dic.changeEnum" - :key="item.value" - :label="item.name" - :value="item.value" - /> + <el-option v-for="item in Dic.changeEnum" :key="item.value" :label="item.name" :value="item.value" /> </el-select> </el-form-item> </el-col> @@ -75,12 +54,7 @@ <el-col :span="12"> <el-form-item label="���������������" prop="escalationUnitId" class="span"> <el-select v-model="formData.escalationUnitId" placeholder="���������" size="small"> - <el-option - v-for="item in unitList" - :key="item.unitId" - :label="item.unitName" - :value="item.unitId" - /> + <el-option v-for="item in unitList" :key="item.unitId" :label="item.unitName" :value="item.unitId" /> </el-select> </el-form-item> </el-col> @@ -109,13 +83,7 @@ <div> <div v-if="pageState==='edit'"> <div v-for="(file,index) in fileBaseListCover" :key="file.fileId+index" class="block"> - <el-image - v-if="file.fileType ===1" - style="width: 100px; height: 100px" - :src="file.url" - :preview-src-list="getPreviewImages(file.fileId,fileBaseList)" - :initial-index="index" - /> + <el-image v-if="file.fileType ===1" style="width: 100px; height: 100px" :src="file.url" :preview-src-list="getPreviewImages(file.fileId,fileBaseList)" :initial-index="index" /> <video v-else :src="file.url" style="width: 100px; height: 100px" @click="openVideo(file)"> ������������������������ video ��������� </video> @@ -135,13 +103,7 @@ </el-dialog> <el-dialog :visible.sync="videoVisible" width="600px" :modal-append-to-body="false" :destroy-on-close="true" @close="handleCancel"> <div style="text-align: center;"> - <video - ref="video" - style="width: 300px;height: 500px" - :src="dialogImageUrl" - controls - autoplay - /> + <video ref="video" style="width: 300px;height: 500px" :src="dialogImageUrl" controls autoplay /> </div> </el-dialog> </div> @@ -164,6 +126,11 @@ return { videoVisible: false, formData: { + unitId: '', + escalationUnitId: '', + changeType: '', + polluteType: '', + escalationTime: new Date(), fileBaseList: [], escalationName: '', changeDay: 0, @@ -192,9 +159,7 @@ changeType: [ { required: true, message: '���������������������', trigger: 'change' } ], - changeDay: [ - { required: true, message: '���������������', trigger: 'blur' } - ], + changeDay: [{ required: true, message: '���������������', trigger: 'blur' }], escalationUnitId: [ { required: true, message: '���������������������', trigger: 'change' } ], @@ -216,18 +181,26 @@ } }, watch: { - 'pageState': { + pageState: { handler(newVal) { if (this.pageState === 'edit') { - if (this.parentFormData.fileBaseList && this.parentFormData.fileBaseList.length > 0) { + if ( + this.parentFormData.fileBaseList && + this.parentFormData.fileBaseList.length > 0 + ) { this.parentFormData.fileBaseList.forEach(item => { if (item.fileType === 1) { - this.fileBaseList.push(`${requestObj.baseUrl}file/preview/${item.fileId}`) // ������ + this.fileBaseList.push( + `${requestObj.baseUrl}file/preview/${item.fileId}` + ) // ������ } // const srcApi = item.fileType === 1 ? api + 'preview/' : api + 'preview/cover/' // this.fileBaseList.push(`${requestObj.baseUrl}file/preview/${item.fileId}`) // ������ this.fileBaseListCover.push({ - url: item.fileType === 1 ? `${requestObj.baseUrl}file/preview/cover/${item.fileId}` : `${requestObj.baseUrl}file/preview/${item.fileId}`, + url: + item.fileType === 1 + ? `${requestObj.baseUrl}file/preview/cover/${item.fileId}` + : `${requestObj.baseUrl}file/preview/${item.fileId}`, fileType: item.fileType, fileId: item.fileId, fileName: item.fileName @@ -241,22 +214,15 @@ immediate: true } }, - created() { - console.log('oldValue', this.parentFormData) - if (!(JSON.stringify(this.parentFormData) === '{}')) { - this.formData = this.parentFormData - this.formData.polluteType = String(this.parentFormData.polluteType) - } else { - const name = this.$store.state.user.name - this.formData.escalationName = name - } - + async created() { this.getUnitList() - this.getContaminateList() + + console.log('oldValue', this.parentFormData) + bus.$on('changeFileAfterList', (type, fileList) => { this.formData.fileBaseList = [] if (fileList.length > 0) { - fileList.map((item) => { + fileList.map(item => { if (item.response) { console.log('item.response.data', item.response.data) this.formData.fileBaseList.push(item.response.data) @@ -304,20 +270,32 @@ this.$request({ url: '/allocation/unit', method: 'get' - }).then((res) => { + }).then(res => { this.unitList = res.data + this.getContaminateList() }) }, getContaminateList() { this.$request({ url: '/allocation/contaminate', method: 'get' - }).then((res) => { + }).then(res => { this.polluteList = res.data + if (!(JSON.stringify(this.parentFormData) === '{}')) { + this.formData = this.parentFormData + this.formData.polluteType = String(this.parentFormData.polluteType) + } else { + const name = this.$store.state.user.name + this.formData.escalationName = name + this.formData.changeType = this.Dic.changeEnum[0].value + this.formData.unitId = this.unitList[0].unitId + this.formData.escalationUnitId = this.unitList[0].unitId + this.formData.polluteType = this.polluteList[0].dataKey + } }) }, close() { - this.$nextTick(function() { + this.$nextTick(function () { this.$refs.ruleForm.resetFields() }) this.$emit('update:visible', false) @@ -333,7 +311,7 @@ }) } this.formData.state = val - this.$refs.ruleForm.validate((valid) => { + this.$refs.ruleForm.validate(valid => { if (valid) { // this.formData.fileBaseList = [...this.parentFormData.fileBaseList, this.formData.fileBaseList] this.$emit('handleSubmit', this.formData) @@ -347,47 +325,45 @@ </script> <style lang="scss" scoped> -.titBox{ +.titBox { position: relative; font-size: 18px; - div:first-child{ + div:first-child { position: absolute; left: 10px; } - div{ + div { display: inline-block; } } .block { - display: inline-block !important; - margin-right: 10px; + display: inline-block !important; + margin-right: 10px; } .textBox { - display: flex; - justify-content: space-between; - margin-left: 15px; + display: flex; + justify-content: space-between; + margin-left: 15px; } -.el-dialog__body>div { - border-bottom: 1px dashed rgba(187, 187, 187, 1); +.el-dialog__body > div { + border-bottom: 1px dashed rgba(187, 187, 187, 1); } -.span{ +.span { /deep/.el-form-item__content { - - div { - width: 100%; - } + div { + width: 100%; + } } } .textare { - /deep/.el-form-item__content { - width: 800px; + /deep/.el-form-item__content { + width: 800px; - div { - width: 100%; - } + div { + width: 100%; } } - +} </style> diff --git a/src/views/toCarryOutLegislativeReforms/components/queryForm.vue b/src/views/toCarryOutLegislativeReforms/components/queryForm.vue index 5acefb7..509d71e 100644 --- a/src/views/toCarryOutLegislativeReforms/components/queryForm.vue +++ b/src/views/toCarryOutLegislativeReforms/components/queryForm.vue @@ -7,86 +7,42 @@ </el-form-item> <el-form-item label="���������������"> - <el-date-picker - v-model="formData.startTime" - style="width:92%" - size="small" - value-format="yyyy-MM-dd" - type="date" - placeholder="������������" - /> + <el-date-picker v-model="formData.startTime" style="width:92%" size="small" value-format="yyyy-MM-dd" type="date" placeholder="������������" /> </el-form-item> <el-form-item label="���������������"> - <el-date-picker - v-model="formData.endTime" - style="width:92%" - size="small" - value-format="yyyy-MM-dd" - type="date" - placeholder="������������" - /> + <el-date-picker v-model="formData.endTime" style="width:92%" size="small" value-format="yyyy-MM-dd" type="date" placeholder="������������" /> </el-form-item> <el-form-item label="���������������" class="rddd"> - <el-select v-model="formData.unitId" size="small" clearable placeholder="���������"> - <el-option - v-for="item in unitList" - :key="item.unitId" - :label="item.unitName" - :value="item.unitId" - /> + <el-select v-model="formData.unitId" size="small" clearable multiple collapse-tags placeholder="���������"> + <el-option v-for="item in unitList" :key="item.unitId" :label="item.unitName" :value="item.unitId" /> </el-select> </el-form-item> <el-form-item label="���������������"> - <el-select v-model="formData.polluteType" size="small" clearable placeholder="���������"> - <el-option - v-for="item in polluteList" - :key="item.dataKey" - :label="item.dataValue" - :value="item.dataKey" - /> + <el-select v-model="formData.polluteType" size="small" clearable multiple collapse-tags placeholder="���������"> + <el-option v-for="item in polluteList" :key="item.dataKey" :label="item.dataValue" :value="item.dataKey" /> </el-select> </el-form-item> <el-form-item label="���������������"> <el-select v-model="formData.investigationType" size="small" clearable placeholder="���������"> - <el-option - v-for="item in Dic.investigationEnum" - :key="item.value" - :label="item.name" - :value="item.value" - /> + <el-option v-for="item in Dic.investigationEnum" :key="item.value" :label="item.name" :value="item.value" /> </el-select> </el-form-item> <el-form-item label="���������������"> <el-select v-model="formData.changeType" placeholder="���������" clearable size="small"> - <el-option - v-for="item in Dic.changeEnum" - :key="item.value" - :label="item.name" - :value="item.value" - /> + <el-option v-for="item in Dic.changeEnum" :key="item.value" :label="item.name" :value="item.value" /> </el-select> </el-form-item> <el-form-item label="���������������"> - <el-select v-model="formData.state" size="small" clearable placeholder="���������"> - <el-option - v-for="item in Dic.allocationApproveEnum" - :key="item.value" - :label="item.name" - :value="item.value" - /> + <el-select v-model="formData.state" size="small" clearable multiple collapse-tags placeholder="���������"> + <el-option v-for="item in Dic.allocationApproveEnum" :key="item.value" :label="item.name" :value="item.value" /> </el-select> </el-form-item> <el-form-item label="���������������"> <el-select v-model="formData.isInvalid " placeholder="���������" clearable size="small"> - <el-option - v-for="item in Dic.yesOrNo" - :key="item.value" - :label="item.name" - :value="item.value" - /> + <el-option v-for="item in Dic.yesOrNo" :key="item.value" :label="item.name" :value="item.value" /> </el-select> </el-form-item> <el-form-item> @@ -106,7 +62,7 @@ data() { return { formData: { - isInvalid: 0 + isInvalid: null }, unitList: [], Dic: JSON.parse(localStorage.getItem('dict')), @@ -119,7 +75,6 @@ created() { this.getUnitList() this.getContaminateList() - console.log('searchType', this.searchType) }, methods: { // ������������������list @@ -127,19 +82,21 @@ this.$request({ url: '/allocation/unit', method: 'get' - }).then((res) => { + }).then(res => { this.unitList = res.data + this.formData.isInvalid = 0 }) }, getContaminateList() { this.$request({ url: '/allocation/contaminate', method: 'get' - }).then((res) => { + }).then(res => { this.polluteList = res.data }) }, onSubmit() { + console.log('formData', this.formData) this.$emit('handleSearch', this.formData) }, handleAdd() { @@ -151,19 +108,19 @@ <style scoped lang="scss"> .search-form { - margin: 20px; - margin-bottom: 0px; - /deep/ .el-input__suffix{ - right: 20; - } - /deep/ .el-form-item__content{ - width: auto; - } + margin: 20px; + margin-bottom: 0px; + /deep/ .el-input__suffix { + right: 20; + } + /deep/ .el-form-item__content { + width: auto; + } } -/deep/.el-form-item__label{ +/deep/.el-form-item__label { font-size: 16px; } -/deep/.el-form-item{ +/deep/.el-form-item { margin-bottom: 5px; } </style> diff --git a/src/views/toCarryOutLegislativeReforms/components/workOrderInformation.vue b/src/views/toCarryOutLegislativeReforms/components/workOrderInformation.vue index 575969e..f1c3aa0 100644 --- a/src/views/toCarryOutLegislativeReforms/components/workOrderInformation.vue +++ b/src/views/toCarryOutLegislativeReforms/components/workOrderInformation.vue @@ -8,37 +8,26 @@ <div> <div v-if="dialogData.pageType !=='delay'" class="stepsList"> <el-steps :space="200" :active="parentFormData.approveList.length+1" align-center> - <el-step - v-for="(item,index) in setepList" - :key="index" - :title="'' + item.createName + ' ' + item.stateName" - :description="item.createTime" - /> + <el-step v-for="(item,index) in setepList" :key="index" :title="'' + item.createName + ' ' + item.stateName" :description="item.createTime" /> </el-steps> </div> <div class="inforData"> - <el-descriptions title="������������" :column="parseInt('4')"> + <el-descriptions title="������������"> <el-descriptions-item label="������������" label-class-name="itemSpan">{{ parentFormData.escalationTime }}</el-descriptions-item> - <el-descriptions-item label="������������" label-class-name="itemSpan">{{ parentFormData.pollutePosition }}</el-descriptions-item> <el-descriptions-item label="������������" label-class-name="itemSpan">{{ unitIdFormatter }}</el-descriptions-item> <el-descriptions-item label="������������" label-class-name="itemSpan">{{ polluteTypeFormatter }}</el-descriptions-item> <el-descriptions-item label="������������" label-class-name="itemSpan">{{ dictObj.changeEnum[parentFormData.changeType] }}</el-descriptions-item> <el-descriptions-item label="������������" label-class-name="itemSpan">{{ parentFormData.changeDay }}</el-descriptions-item> <el-descriptions-item label="������������" label-class-name="itemSpan">{{ updataUnitIdFormatter }}</el-descriptions-item> <el-descriptions-item label="���������" label-class-name="itemSpan">{{ parentFormData.escalationName }}</el-descriptions-item> + <el-descriptions-item label="������������" label-class-name="itemSpan">{{ parentFormData.pollutePosition }}</el-descriptions-item> </el-descriptions> <el-descriptions :column="parseInt('1')"> <el-descriptions-item label="������������" label-class-name="itemSpan" :content-style="{'width': '80%'}">{{ parentFormData.problemDescribe }}</el-descriptions-item> <el-descriptions-item label="������" label-class-name="itemSpan" :content-style="{'width': '80%'}"> <div> <div v-for="(file,index) in fileBaseListCover" :key="file.id+index" class="block"> - <el-image - v-if="file.fileType ===1" - style="width: 100px; height: 100px" - :src="file.url" - :preview-src-list="getPreviewImages(file.id,fileBaseList)" - :initial-index="index" - /> + <el-image v-if="file.fileType ===1" style="width: 100px; height: 100px" :src="file.url" :preview-src-list="getPreviewImages(file.id,fileBaseList)" :initial-index="index" /> <video v-else :src="file.url" style="width: 100px; height: 100px" @click="openVideo(file)"> ������������������������ video ��������� </video> @@ -63,12 +52,7 @@ </el-form-item> </div> <el-form-item label="������������:"> - <el-input - v-model="workForme.changeDescribe" - type="textarea" - :autosize="{ minRows: 2, maxRows: 4}" - placeholder="���������������" - /> + <el-input v-model="workForme.changeDescribe" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="���������������" /> </el-form-item> <el-row> <el-form-item label="������:"> @@ -82,7 +66,8 @@ <!-- ������������ --> <div v-if="(dialogData.pageType ==='detail'||dialogData.pageType ==='approve' )&& parentFormData.state >=30"> <el-row class="rectificationContent"> - <el-col :span="12"><div class="grid-content bg-purple" /> + <el-col :span="12"> + <div class="grid-content bg-purple" /> <el-descriptions title="������������" :column="parseInt('2')"> <el-descriptions-item label="������������" label-class-name="itemSpan">{{ parentFormData.changeType }}</el-descriptions-item> <el-descriptions-item label="���������" label-class-name="itemSpan">{{ parentFormData.changeName }}</el-descriptions-item> @@ -91,19 +76,17 @@ <el-descriptions-item label="������������" label-class-name="itemSpan">{{ parentFormData.changeDescribe }}</el-descriptions-item> </el-descriptions> </el-col> - <el-col :span="12"><div class="grid-content bg-purple-light" /> + <el-col :span="12"> + <div class="grid-content bg-purple-light" /> <el-row> - <el-col :span="3" style="margin-top: 40px;font-size: 15px;color: #101010;"><div class="grid-content bg-purple" />���������</el-col> - <el-col :span="21"><div class="grid-content bg-purple-light" /> + <el-col :span="3" style="margin-top: 40px;font-size: 15px;color: #101010;"> + <div class="grid-content bg-purple" />��������� + </el-col> + <el-col :span="21"> + <div class="grid-content bg-purple-light" /> <div> <div v-for="(file,index) in fileChangeListCover" :key="file.id+index" class="block"> - <el-image - v-if="file.fileType ===1" - style="width: 100px; height: 100px" - :src="file.url" - :preview-src-list="getPreviewImages(file.id,fileChangeList)" - :initial-index="index" - /> + <el-image v-if="file.fileType ===1" style="width: 100px; height: 100px" :src="file.url" :preview-src-list="getPreviewImages(file.id,fileChangeList)" :initial-index="index" /> <video v-else :src="file.url" style="width: 100px; height: 100px" @click="openVideo(file)"> ������������������������ video ��������� </video> @@ -117,7 +100,8 @@ <!-- ������������ --> <div v-if="dialogData.pageType ==='detail'&& parentFormData.state>30"> <el-row class="rectificationContent"> - <el-col :span="12"><div class="grid-content bg-purple" /> + <el-col :span="12"> + <div class="grid-content bg-purple" /> <el-descriptions title="������������" :column="2"> <el-descriptions-item label="������������" label-class-name="itemSpan">{{ parentFormData.checkScore }}</el-descriptions-item> </el-descriptions> @@ -125,20 +109,18 @@ <el-descriptions-item label="������" label-class-name="itemSpan">{{ parentFormData.checkDescribe }}</el-descriptions-item> </el-descriptions> </el-col> - <el-col :span="12"><div class="grid-content bg-purple-light" /> + <el-col :span="12"> + <div class="grid-content bg-purple-light" /> <el-row> - <el-col :span="3" style="margin-top: 40px;font-size: 15px;color: #101010;"><div class="grid-content bg-purple" />���������</el-col> - <el-col :span="21"><div class="grid-content bg-purple-light" /> + <el-col :span="3" style="margin-top: 40px;font-size: 15px;color: #101010;"> + <div class="grid-content bg-purple" />��������� + </el-col> + <el-col :span="21"> + <div class="grid-content bg-purple-light" /> <div> <div> <div v-for="(file,index) in fileApproveListCover" :key="file.id+index" class="block"> - <el-image - v-if="file.fileType ===1" - style="width: 100px; height: 100px" - :src="file.url" - :preview-src-list="getPreviewImages(file.id,fileApproveList)" - :initial-index="index" - /> + <el-image v-if="file.fileType ===1" style="width: 100px; height: 100px" :src="file.url" :preview-src-list="getPreviewImages(file.id,fileApproveList)" :initial-index="index" /> <video v-else :src="file.url" style="width: 100px; height: 100px" @click="openVideo(file)"> ������������������������ video ��������� </video> @@ -153,30 +135,30 @@ <!-- ������������ --> <div v-if="(dialogData.pageType ==='delay' && (dialogData.pageState ==='view' ||dialogData.pageState ==='edit'))"> <el-row class="rectificationContent"> - <el-col :span="12"><div class="grid-content bg-purple" /> + <el-col :span="12"> + <div class="grid-content bg-purple" /> <el-descriptions title="������������" :column="1"> <el-descriptions-item label="������������" label-class-name="itemSpan">{{ parentFormData.extensionNum }}</el-descriptions-item> <el-descriptions-item label="������������" label-class-name="itemSpan">{{ parentFormData.remake }}</el-descriptions-item> </el-descriptions> </el-col> - <el-col :span="12"><div class="grid-content bg-purple-light" /> + <el-col :span="12"> + <div class="grid-content bg-purple-light" /> <el-row> - <el-col :span="3" style="margin-top: 40px;font-size: 15px;color: #101010;"><div class="grid-content bg-purple" />���������</el-col> - <el-col :span="21"><div class="grid-content bg-purple-light" /> + <el-col :span="3" style="margin-top: 40px;font-size: 15px;color: #101010;"> + <div class="grid-content bg-purple" />��������� + </el-col> + <el-col :span="21"> + <div class="grid-content bg-purple-light" /> <div> <div v-for="(file,index) in fileDelayListCover" :key="file.id+index" class="block"> - <el-image - v-if="file.fileType ===1" - style="width: 100px; height: 100px" - :src="file.url" - :preview-src-list="getPreviewImages(file.id,fileDelayList)" - :initial-index="index" - /> + <el-image v-if="file.fileType ===1" style="width: 100px; height: 100px" :src="file.url" :preview-src-list="getPreviewImages(file.id,fileDelayList)" :initial-index="index" /> <video v-else :src="file.url" style="width: 100px; height: 100px" @click="openVideo(file)"> ������������������������ video ��������� </video> </div> - </div></el-col> + </div> + </el-col> </el-row> </el-col> </el-row> @@ -188,12 +170,7 @@ <el-input v-model="approveForm.checkScore" style="width: 120px;" size="mini" /> </el-form-item> <el-form-item label="������:"> - <el-input - v-model="approveForm.checkDescribe" - type="textarea" - :autosize="{ minRows: 2, maxRows: 4}" - placeholder="���������������" - /> + <el-input v-model="approveForm.checkDescribe" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="���������������" /> </el-form-item> <el-form-item label="������:"> <uploadFile :upload-url="uploadTermExcelUrl" :sys-code="dialogData.sysCode" /> @@ -207,12 +184,7 @@ <el-input v-model="delayForm.extensionNum" style="width: 200px;" /> </el-form-item> <el-form-item label="������������:"> - <el-input - v-model="delayForm.remake" - type="textarea" - :autosize="{ minRows: 2, maxRows: 4}" - placeholder="���������������" - /> + <el-input v-model="delayForm.remake" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="���������������" /> </el-form-item> <el-form-item label="������:"> <uploadFile :upload-url="uploadTermExcelUrl" :sys-code="dialogData.sysCode" /> @@ -230,13 +202,7 @@ </el-dialog> <el-dialog :visible.sync="videoVisible" width="600px" :modal-append-to-body="false" :destroy-on-close="true" @close="handleCancel"> <div style="text-align: center;"> - <video - ref="video" - style="width: 300px;height: 500px" - :src="dialogImageUrl" - controls - autoplay - /> + <video ref="video" style="width: 300px;height: 500px" :src="dialogImageUrl" controls autoplay /> </div> </el-dialog> </div> @@ -272,9 +238,7 @@ remake: '', extensionNum: '' }, - rectificationFromData: { - - }, + rectificationFromData: {}, dialogVisibleMainGraph: false, hasFile: '', setepListAdd: { @@ -287,9 +251,7 @@ { createName: '', stateName: '������', createTime: '' }, { createName: '', stateName: '������', createTime: '' } ], - set3: [ - { createName: '', stateName: '������', createTime: '' } - ] + set3: [{ createName: '', stateName: '������', createTime: '' }] }, unitList: [], polluteList: [], @@ -316,16 +278,26 @@ console.log('parentFormData.approveList', this.dialogData.parentFormData) return this.dialogData.parentFormData }, - updataUnitIdFormatter: function() { - const data = this.unitList.find(item => item && item.unitId === this.dialogData.parentFormData.escalationUnitId) + updataUnitIdFormatter: function () { + const data = this.unitList.find( + item => + item && + item.unitId === this.dialogData.parentFormData.escalationUnitId + ) return data ? data.unitName : '' }, - unitIdFormatter: function() { - const data = this.unitList.find(item => item && item.unitId === this.dialogData.parentFormData.unitId) + unitIdFormatter: function () { + const data = this.unitList.find( + item => item && item.unitId === this.dialogData.parentFormData.unitId + ) return data ? data.unitName : '' }, - polluteTypeFormatter: function() { - const data = this.polluteList.find(item => item && parseInt(item.dataKey) === this.dialogData.parentFormData.polluteType) + polluteTypeFormatter: function () { + const data = this.polluteList.find( + item => + item && + parseInt(item.dataKey) === this.dialogData.parentFormData.polluteType + ) return data ? data.dataValue : '' }, setepList() { @@ -346,7 +318,7 @@ } }, watch: { - 'parentFormData': { + parentFormData: { handler(newVal) { this.searchthisFileList(newVal) }, @@ -363,7 +335,7 @@ console.log('fileList', fileList) this.fileList = [] if (fileList.length > 0) { - fileList.map((item) => { + fileList.map(item => { if (item.response) { this.fileList.push(item.response.data) } @@ -401,11 +373,16 @@ if (newVal.fileBaseList && newVal.fileBaseList.length > 0) { newVal.fileBaseList.forEach(item => { if (item.fileType === 1) { - this.fileBaseList.push(`${requestObj.baseUrl}/file/preview/${item.fileId}`) // ������ + this.fileBaseList.push( + `${requestObj.baseUrl}/file/preview/${item.fileId}` + ) // ������ } this.fileBaseListCover.push({ - url: item.fileType === 1 ? `${requestObj.baseUrl}/file/preview/cover/${item.fileId}` : `${requestObj.baseUrl}/file/preview/${item.fileId}`, + url: + item.fileType === 1 + ? `${requestObj.baseUrl}/file/preview/cover/${item.fileId}` + : `${requestObj.baseUrl}/file/preview/${item.fileId}`, fileType: item.fileType, id: item.fileId }) @@ -415,10 +392,15 @@ if (newVal.fileChangeList && newVal.fileChangeList.length > 0) { newVal.fileChangeList.forEach(item => { if (item.fileType === 1) { - this.fileChangeList.push(`${requestObj.baseUrl}/file/preview/${item.fileId}`) // ������ + this.fileChangeList.push( + `${requestObj.baseUrl}/file/preview/${item.fileId}` + ) // ������ } this.fileChangeListCover.push({ - url: item.fileType === 1 ? `${requestObj.baseUrl}/file/preview/cover/${item.fileId}` : `${requestObj.baseUrl}/file/preview/${item.fileId}`, + url: + item.fileType === 1 + ? `${requestObj.baseUrl}/file/preview/cover/${item.fileId}` + : `${requestObj.baseUrl}/file/preview/${item.fileId}`, fileType: item.fileType, id: item.fileId }) @@ -427,11 +409,18 @@ if (newVal.fileApproveList && newVal.fileApproveList.length > 0) { newVal.fileApproveList.forEach(item => { if (item.fileType === 1) { - this.fileApproveList.push(`${requestObj.baseUrl}/file/preview/${item.fileId}`) // ������ + this.fileApproveList.push( + `${requestObj.baseUrl}/file/preview/${item.fileId}` + ) // ������ } - this.fileApproveList.push(`${requestObj.baseUrl}/file/preview/${item.fileId}`) // ������ + this.fileApproveList.push( + `${requestObj.baseUrl}/file/preview/${item.fileId}` + ) // ������ this.fileApproveListCover.push({ - url: item.fileType === 1 ? `${requestObj.baseUrl}/file/preview/cover/${item.fileId}` : `${requestObj.baseUrl}/file/preview/${item.fileId}`, + url: + item.fileType === 1 + ? `${requestObj.baseUrl}/file/preview/cover/${item.fileId}` + : `${requestObj.baseUrl}/file/preview/${item.fileId}`, fileType: item.fileType, id: item.fileId }) @@ -440,11 +429,18 @@ if (newVal.fileList && newVal.fileList.length > 0) { newVal.fileList.forEach(item => { if (item.fileType === 1) { - this.fileDelayList.push(`${requestObj.baseUrl}/file/preview/${item.fileId}`) // ������ + this.fileDelayList.push( + `${requestObj.baseUrl}/file/preview/${item.fileId}` + ) // ������ } - this.fileDelayList.push(`${requestObj.baseUrl}/file/preview/${item.fileId}`) // ������ + this.fileDelayList.push( + `${requestObj.baseUrl}/file/preview/${item.fileId}` + ) // ������ this.fileDelayListCover.push({ - url: item.fileType === 1 ? `${requestObj.baseUrl}/file/preview/cover/${item.fileId}` : `${requestObj.baseUrl}/file/preview/${item.fileId}`, + url: + item.fileType === 1 + ? `${requestObj.baseUrl}/file/preview/cover/${item.fileId}` + : `${requestObj.baseUrl}/file/preview/${item.fileId}`, fileType: item.fileType, id: item.fileId }) @@ -459,7 +455,7 @@ this.$request({ url: '/allocation/unit', method: 'get' - }).then((res) => { + }).then(res => { this.unitList = res.data }) }, @@ -471,7 +467,7 @@ id: this.dialogData.parentFormData.id, state: state } - }).then((res) => { + }).then(res => { if (res.code === 0) { this.$emit('update:visible', false) this.$emit('handeleSumit') @@ -488,32 +484,32 @@ if (this.dialogData.pageType === 'work') { api = '/allocation/change' data = { - 'allocationId': this.dialogData.parentFormData.allocationId, + allocationId: this.dialogData.parentFormData.allocationId, ...this.workForme, - 'fileChangeList': this.fileList, + fileChangeList: this.fileList, state: 30 } } else if (this.dialogData.pageType === 'approve') { api = '/allocation/check' data = { - 'allocationId': this.dialogData.parentFormData.allocationId, + allocationId: this.dialogData.parentFormData.allocationId, ...this.approveForm, - 'fileApproveList': this.fileList, + fileApproveList: this.fileList, state: state } } else if (this.dialogData.pageType === 'delay') { api = '/allocation/applyfor' data = { - 'allocationId': this.dialogData.parentFormData.allocationId, + allocationId: this.dialogData.parentFormData.allocationId, ...this.delayForm, - 'fileList': this.fileList + fileList: this.fileList } } this.$request({ url: api, method: 'post', data: data - }).then((res) => { + }).then(res => { if (res.code === 0) { this.$emit('update:visible', false) this.$emit('handeleSumit') @@ -526,7 +522,7 @@ this.$request({ url: '/allocation/contaminate', method: 'get' - }).then((res) => { + }).then(res => { this.polluteList = res.data }) } @@ -535,14 +531,14 @@ </script> <style lang="scss" scoped> -.titBox{ +.titBox { position: relative; font-size: 18px; - div:first-child{ + div:first-child { position: absolute; left: 10px; } - div{ + div { display: inline-block; } } @@ -550,26 +546,28 @@ border-bottom: 1px dashed rgba(187, 187, 187, 1); padding-bottom: 10px; } -.inforData{ +.inforData { margin-top: 20px; border-bottom: 1px dashed rgba(187, 187, 187, 1); padding-bottom: 10px; - font-size: 15px!important; - color: rgba(16, 16, 16, 1)!important; + font-size: 15px !important; + color: rgba(16, 16, 16, 1) !important; } - /deep/.itemSpan{ - width: 70px; - text-align: right; - font-size: 15px; - color: rgba(16, 16, 16, 1); - } - .rectification ,.examineAndApprove,.rectificationContent{ - margin-top: 20px; - border-bottom: 1px dashed rgba(187, 187, 187, 1); - margin-bottom: 10px; - } - .block { - display: inline-block; - margin-right: 10px; +/deep/.itemSpan { + width: 70px; + text-align: right; + font-size: 15px; + color: rgba(16, 16, 16, 1); +} +.rectification, +.examineAndApprove, +.rectificationContent { + margin-top: 20px; + border-bottom: 1px dashed rgba(187, 187, 187, 1); + margin-bottom: 10px; +} +.block { + display: inline-block; + margin-right: 10px; } </style> diff --git a/src/views/toCarryOutLegislativeReforms/reform/index.vue b/src/views/toCarryOutLegislativeReforms/reform/index.vue index ea5f8c4..b443b7e 100644 --- a/src/views/toCarryOutLegislativeReforms/reform/index.vue +++ b/src/views/toCarryOutLegislativeReforms/reform/index.vue @@ -1,136 +1,76 @@ <template> <div class="main"> <div> - <searchBar v-if="searchType" :search-type="'reform'" @handleSearch="handleSearch" @handleAdd="handleOpenDialog(null,'add')" /> - <newWorkOrder - v-if="centerDialogVisible" - ref="newWorkOrder" - :parent-form-data="parentFormData" - :title="title" - :page-state="pageState" - :visible.sync="centerDialogVisible" - @handleSubmit="newHandleSubmit" - /> + <searchBar v-if="searchType" :search-type="'reform'" @handleSearch="handleSearchBut" @handleAdd="handleOpenDialog(null, 'add')" /> + <newWorkOrder v-if="centerDialogVisible" ref="newWorkOrder" :parent-form-data="parentFormData" :title="title" :page-state="pageState" :visible.sync="centerDialogVisible" @handleSubmit="newHandleSubmit" /> <div class="tab"> - <el-table - size="mini" - :data="tableData" - border - max-height="680" - style="width: 100%" - :header-cell-style="{ - color: '#101111', fontSize: '16px' - }" - > - <el-table-column - type="index" - label="������" - width="60px" - align="center" - /> - <el-table-column - align="center" - > + <el-table size="mini" :data="tableData" border max-height="680" style="width: 100%" :header-cell-style="{ + color: '#101111', + fontSize: '16px' + }"> + <el-table-column type="index" label="������" width="60px" align="center" /> + <el-table-column align="center"> <template slot="header"> <div>������</div> <div>������������</div> </template> <template slot-scope="scope"> - <div> {{ scope.row.allocationNum }}</div> - <div> {{ scope.row.escalationTime }}</div> - + <div>{{ scope.row.allocationNum }}</div> + <div>{{ scope.row.escalationTime }}</div> </template> </el-table-column> - <el-table-column - align="center" - prop="unitId" - label="������������" - :formatter="unitIdFormatter" - /> - <el-table-column - align="center" - prop="polluteType" - label="������������" - width="120px" - :formatter="polluteTypeFormatter" - /> - <el-table-column - align="center" - > + <el-table-column align="center" prop="unitId" label="������������" :formatter="unitIdFormatter" /> + <el-table-column align="center" prop="polluteType" label="������������" width="120px" :formatter="polluteTypeFormatter" /> + <el-table-column align="center"> <template slot="header"> <div>������������</div> <div>������������</div> </template> <template slot-scope="scope"> - <div> {{ dictObj.changeEnum[scope.row.changeType] }}</div> - <div v-show="scope.row.changeType && scope.row.changeType===2" :class="[Number(scope.row.residueDay) < 0 ? errorClass : '']"> + <div>{{ dictObj.changeEnum[scope.row.changeType] }}</div> + <div v-show="scope.row.changeType && scope.row.changeType === 2" :class="[Number(scope.row.residueDay) < 0 ? errorClass : '']"> <span v-if="Number(scope.row.residueDay) < 0"> ������ {{ Math.abs(scope.row.residueDay) }}��� </span> - <span v-else> - {{ scope.row.residueDay }}��� - </span> - + <span v-else> {{ scope.row.residueDay }}��� </span> </div> </template> </el-table-column> - <el-table-column - align="center" - prop="investigationType" - label="������������" - width="100px" - :formatter="investigationTypeFormatter" - /> - <el-table-column - align="center" - prop="state" - width="100px" - label="������������" - > + <el-table-column align="center" prop="investigationType" label="������������" width="100px" :formatter="investigationTypeFormatter" /> + <el-table-column align="center" prop="state" width="100px" label="������������"> <template slot-scope="scope"> - <el-tag v-if="scope.row.state===40" type="success"> + <el-tag v-if="scope.row.state === 40" type="success"> {{ stateFormatter(scope.row) }} </el-tag> - <el-tag v-if="scope.row.state===50" type="danger"> + <el-tag v-if="scope.row.state === 50" type="danger"> {{ stateFormatter(scope.row) }} </el-tag> - <el-tag v-if="scope.row.state===9" type="info"> + <el-tag v-if="scope.row.state === 9" type="info"> {{ stateFormatter(scope.row) }} </el-tag> - <el-tag v-if="scope.row.state===20" type="warning"> + <el-tag v-if="scope.row.state === 20" type="warning"> {{ stateFormatter(scope.row) }} </el-tag> - <el-tag v-if="scope.row.state===10" type="warning"> + <el-tag v-if="scope.row.state === 10" type="warning"> {{ stateFormatter(scope.row) }} </el-tag> - <el-tag v-if="scope.row.state===30" type="warning"> + <el-tag v-if="scope.row.state === 30" type="warning"> {{ stateFormatter(scope.row) }} </el-tag> </template> </el-table-column> - <el-table-column - align="center" - prop="isInvalid" - label="������������" - width="60px" - :formatter="isInvalidFormatter" - /> - <el-table-column - align="center" - > + <el-table-column align="center" prop="isInvalid" label="������������" width="60px" :formatter="isInvalidFormatter" /> + <el-table-column align="center"> <template slot="header"> <div>������������</div> <div>���������</div> </template> <template slot-scope="scope"> - <div> {{ scope.row.escalationName }}</div> - <div> {{ updatUnitIdFormatter(scope.row) }}</div> - + <div>{{ scope.row.escalationName }}</div> + <div>{{ updatUnitIdFormatter(scope.row) }}</div> </template> </el-table-column> - <el-table-column - align="center" - > + <el-table-column align="center"> <template slot="header"> <div>���������</div> <div>������������</div> @@ -140,59 +80,105 @@ <div>{{ scope.row.updateTime }}</div> </template> </el-table-column> - <el-table-column - align="center" - prop="createTime" - width="100px" - label="������" - > + <el-table-column align="center" prop="createTime" width="100px" label="������"> <template slot-scope="scope"> - <el-button type="text" size="medium" @click="openWorkOrdinDialog(scope.row,'detail')">������</el-button> - <el-button v-if="scope.row.state===9" type="text" size="medium" @click="handleOpenDialog(scope.row,'edit')">������</el-button> - <el-button v-if="scope.row.state>30&&scope.row.isInvalid===0" type="text" size="medium" @click="handleCancel(scope.row)">������</el-button> - <el-button v-if="scope.row.state===20" type="text" size="medium" @click="openWorkOrdinDialog(scope.row,'work')">������</el-button> - <el-button v-if="scope.row.state===30&&scope.row.isApprove===1" type="text" size="medium" @click="openWorkOrdinDialog(scope.row,'approve')">������</el-button> - <el-button v-if="scope.row.state===20&&scope.row.changeType===2&&scope.row.applyState===0" type="text" size="medium" @click="openWorkOrdinDialog(scope.row,'delay')">������������</el-button> + + <el-button type="text" size="medium" @click="openWorkOrdinDialog(scope.row, 'detail')"> + ������ + </el-button> + <el-button type="text" v-if="scope.row.isCode==='1'" size="medium" @click="openEditDialog(scope.row)"> + ������������ + </el-button> + <el-button v-if="scope.row.state === 9" type="text" size="medium" @click="handleOpenDialog(scope.row, 'edit')"> + ������ + </el-button> + <el-button v-if="scope.row.state > 30 && scope.row.isInvalid === 0" type="text" size="medium" @click="handleCancel(scope.row)"> + ������ + </el-button> + <el-button v-if="scope.row.state === 20" type="text" size="medium" @click="openWorkOrdinDialog(scope.row, 'work')"> + ������ + </el-button> + <el-button v-if="scope.row.state === 30 && scope.row.isApprove === 1" type="text" size="medium" @click="openWorkOrdinDialog(scope.row, 'approve')"> + ������ + </el-button> + <el-button v-if=" + scope.row.state === 20 && + scope.row.changeType === 2 && + scope.row.applyState === 0 + " type="text" size="medium" @click="openWorkOrdinDialog(scope.row, 'delay')"> + ������������ + </el-button> </template> </el-table-column> </el-table> </div> <div class="pagina"> - <el-pagination - background - :current-page="pagination.currentPage" - :page-sizes="pagination.pageSizes" - :page-size="pagination.pageSize" - :total="pagination.totalCount" - layout="total, sizes, prev, pager, next, jumper" - @size-change="handleSizeChange" - @current-change="handleCurrentChange" - /> + <el-pagination background :current-page="pagination.currentPage" :page-sizes="pagination.pageSizes" :page-size="pagination.pageSize" :total="pagination.totalCount" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" @current-change="handleCurrentChange" /> </div> </div> <workOrderInformation v-if="workOrdinDialogVisible" :dialog-data="dialogData" :visible.sync="workOrdinDialogVisible" @handeleSumit="handeleSumit" /> - <el-dialog - title="������" - :visible.sync="dialogVisible" - width="600px" - :before-close="handleClose" - center - > + <el-dialog title="������" :visible.sync="dialogVisible" width="600px" :before-close="handleClose" center> <div> <el-form label-width="100px"> - <el-form-item label="���������������" style="margin-right: 30px;"> - <el-input - v-model="invalidReason" - type="textarea" - :autosize="{ minRows: 2, maxRows: 10}" - placeholder="���������������" - /> + <el-form-item label="���������������" style="margin-right: 30px"> + <el-input v-model="invalidReason" type="textarea" :autosize="{ minRows: 2, maxRows: 10 }" placeholder="���������������" /> </el-form-item> </el-form> </div> <span slot="footer" class="dialog-footer"> <el-button @click="handleClose">��� ���</el-button> <el-button type="primary" @click="handleInvalid">��� ���</el-button> + </span> + </el-dialog> + <el-dialog title="������" v-if="dialogEditVisible" :visible.sync="dialogEditVisible" width="800px" top='5vh' :before-close="handleClose" center> + <el-descriptions title="������������"> + <template slot="extra"> + <div> + {{ editEscalationUnitData.allocationNum}} + </div> + </template> + <el-descriptions-item label="������������" label-class-name="itemSpan">{{ editEscalationUnitData.escalationTime }}</el-descriptions-item> + <el-descriptions-item label="������������" label-class-name="itemSpan">{{ updataUnitIdFormatter }}</el-descriptions-item> + <el-descriptions-item label="������������" label-class-name="itemSpan">{{ polluteTypeeDITFormatter }}</el-descriptions-item> + <el-descriptions-item label="������������" label-class-name="itemSpan">{{ dictObj.changeEnum[editEscalationUnitData.changeType] }}</el-descriptions-item> + <el-descriptions-item label="������������" label-class-name="itemSpan">{{ editEscalationUnitData.changeDay || 0}} ���</el-descriptions-item> + <el-descriptions-item label="������������" label-class-name="itemSpan">{{ updataEscalationUnitIdFormatter }}</el-descriptions-item> + <el-descriptions-item label="���������" label-class-name="itemSpan">{{ editEscalationUnitData.escalationName }}</el-descriptions-item> + <el-descriptions-item label="������������" label-class-name="itemSpan">{{ editEscalationUnitData.pollutePosition }}</el-descriptions-item> + </el-descriptions> + <el-divider></el-divider> + <div> + <p class="editTile">������������</p> + <el-form :inline="true" class="demo-form-inline"> + <el-form-item label="������������:"> + <el-select v-model="formInEdit.unitId" size="small" clearable placeholder="���������"> + <el-option v-for="item in unitList" :key="item.unitId" :label="item.unitName" :value="item.unitId" /> + </el-select> + </el-form-item> + <el-form-item label="������������:"> + <el-select v-model="formInEdit.polluteType" size="small" clearable placeholder="���������"> + <el-option v-for="item in polluteList" :key="item.dataKey" :label="item.dataValue" :value="item.dataKey" /> + </el-select> + </el-form-item> + </el-form> + </div> + <el-collapse> + <el-collapse-item title="������������" name="1"> + <div class="block"> + <el-timeline> + <el-timeline-item v-for="(activity, index) in operatingLog" :key="index" :color="'#0bbd87'" :timestamp="activity.createTime"> + <div v-if="activity.content"> ���������: {{activity.userName}}</div> + <div v-if="activity.content"> ������������: {{activity.content}}</div> + <div v-if="activity.polluteType"> ������������: {{activity.polluteType}}</div> + </el-timeline-item> + </el-timeline> + </div> + </el-collapse-item> + </el-collapse> + + <span slot="footer" class="dialog-footer"> + <el-button @click="handleClose">��� ���</el-button> + <el-button type="primary" @click="handleEditChange">��� ���</el-button> </span> </el-dialog> </div> @@ -222,8 +208,7 @@ pageSize: 10 }, formData: {}, - tableData: [ - ], + tableData: [], dialogData: { title: '������', parentFormData: {}, @@ -233,6 +218,7 @@ workOrdinDialogVisible: false, centerDialogVisible: false, dialogVisible: false, + dialogEditVisible: false, unitList: [], polluteList: [], Dic: JSON.parse(localStorage.getItem('dict')), @@ -244,22 +230,106 @@ title: '', searchData: { isInvalid: 0 - } + }, + editEscalationUnitData: {}, + formInEdit: { + polluteType: '', + unitId: '' + }, + operatingLog: [] } }, - + computed: { + updataEscalationUnitIdFormatter: function () { + const data = this.unitList.find( + item => + item && item.unitId === this.editEscalationUnitData.escalationUnitId + ) + return data ? data.unitName : '' + }, + updataUnitIdFormatter: function () { + const data = this.unitList.find( + item => item && item.unitId === this.editEscalationUnitData.unitId + ) + return data ? data.unitName : '' + }, + polluteTypeeDITFormatter: function () { + const data = this.polluteList.find( + item => + item && + parseInt(item.dataKey) === this.editEscalationUnitData.polluteType + ) + return data ? data.dataValue : '' + } + }, created() { this.handleSearch() this.getUnitList() this.getContaminateList() }, methods: { + openEditDialog(row) { + this.editEscalationUnitData = row + this.dialogEditVisible = true + this.$request({ + url: '/allocation/getLog', + method: 'get', + params: { + allocationNum: this.editEscalationUnitData.allocationNum + } + }) + .then(res => { + this.operatingLog = res.data + }) + .catch(err => { + this.$message.error(res.message) + console.log('������Region������') + console.log(err) + }) + }, handleCancel(row) { this.dialogVisible = true this.slectRow = row }, handleClose() { this.dialogVisible = false + this.dialogEditVisible = false + }, + handleEditChange() { + if (this.formInEdit.polluteType === '' && this.formInEdit.unitId === '') { + this.$message({ + message: '���������������������', + type: 'error' + }) + return + } + this.$request({ + url: '/allocation/updataUnit', + method: 'get', + params: { + id: this.editEscalationUnitData.allocationId, + ...this.formInEdit + } + }) + .then(res => { + if (res.code === 0) { + this.$message({ + message: '������������', + type: 'success' + }) + this.dialogEditVisible = false + this.formInEdit = { + polluteType: '', + unitId: '' + } + this.handleSearch() + } + }) + .catch(err => { + this.$message.error(res.message) + console.log('������Region������') + console.log(err) + }) }, handleInvalid() { this.$request({ @@ -269,7 +339,7 @@ id: this.slectRow.allocationId, invalidReason: this.invalidReason } - }).then((res) => { + }).then(res => { if (res.code === 0) { this.$message({ message: '������������', @@ -296,7 +366,7 @@ params: { id: row.allocationId } - }).then((res) => { + }).then(res => { this.parentFormData = res.data console.log(this.parentFormData) this.centerDialogVisible = true @@ -304,22 +374,27 @@ } }, updatUnitIdFormatter(val) { - const data = this.unitList.find(item => item && item.unitId === val.escalationUnitId) + const data = this.unitList.find( + item => item && item.unitId === val.escalationUnitId + ) return data ? data.unitName : '' }, unitIdFormatter(val) { - const data = this.unitList.find(item => item && item.unitId === val.unitId) + const data = this.unitList.find( + item => item && item.unitId === val.unitId + ) return data ? data.unitName : '' }, polluteTypeFormatter(val) { - const data = this.polluteList.find(item => item && parseInt(item.dataKey) === val.polluteType) + const data = this.polluteList.find( + item => item && parseInt(item.dataKey) === val.polluteType + ) return data ? data.dataValue : '' }, investigationTypeFormatter(val) { return this.dictObj.investigationEnum[val.investigationType] }, stateFormatter(val) { - console.log('valval', val) return this.dictObj.allocationApproveEnum[val.state] }, isInvalidFormatter(val) { @@ -330,7 +405,7 @@ this.$request({ url: '/allocation/unit', method: 'get' - }).then((res) => { + }).then(res => { if (res.code === 0) { this.unitList = res.data } else { @@ -342,7 +417,7 @@ this.$request({ url: '/allocation/contaminate', method: 'get' - }).then((res) => { + }).then(res => { if (res.code === 0) { this.polluteList = res.data } else { @@ -368,7 +443,7 @@ data: { ...obj } - }).then((res) => { + }).then(res => { if (res.code === 0) { this.centerDialogVisible = false @@ -377,6 +452,18 @@ this.$message.error(res.message) } }) + }, + handleSearchBut(obj) { + this.pagination = { + currentPage: 1, + // ������������������������������������������(���������������������������) + totalCount: 0, + // ������������������������������ + pageSizes: [10, 20, 30, 40], + // ������������������������������������������ + pageSize: 10 + } + this.handleSearch(obj) }, handleSearch(obj) { this.searchData.isInvalid = 0 @@ -388,9 +475,9 @@ method: 'post', data: { ...this.searchData, - 'page': this.pagination + page: this.pagination } - }).then((res) => { + }).then(res => { if (res.code === 0) { this.tableData = res.data.list this.pagination.totalCount = res.data.page.totalNum @@ -403,6 +490,7 @@ // ��������������������� handleSizeChange(val) { // ��������������������������� + console.log('345') this.pagination.pageSize = val // ��������������������������������������������������������������������������� this.pagination.currentPage = 1 @@ -411,6 +499,7 @@ // ��������������� handleCurrentChange(val) { // ��������������������� + console.log('123') this.pagination.currentPage = val this.handleSearch() // console.log(val) @@ -422,7 +511,7 @@ params: { id: row.allocationId } - }).then((res) => { + }).then(res => { this.parentFormData = res.data this.workOrdinDialogVisible = true if (type === 'work') { @@ -463,17 +552,17 @@ </script> <style scoped lang="scss"> -.main{ - padding: 20px; - padding-top: 0px; - height: 100%; - overflow: overlay; +.main { + padding: 20px; + padding-top: 0px; + height: 100%; + overflow: overlay; } .tab { - margin-top: 0px; - /deep/ .el-tag{ - font-size: 16px; - } + margin-top: 0px; + /deep/ .el-tag { + font-size: 16px; + } } // /deep/ .el-table__body-wrapper { // overflow: scroll; @@ -481,22 +570,31 @@ // overflow-x: hidden; // max-height: 400px; // } -.pagina{ - margin-top: 10px; +.pagina { + margin-top: 10px; } -/deep/ .el-table__row{ +/deep/ .el-table__row { font-size: 18px; } .el-pagination { padding: 0; - .el-select{ - /deep/.el-input{ - margin:0; + .el-select { + /deep/.el-input { + margin: 0; } } - } -.errorClass{ +.errorClass { color: red; } +.editTile { + color: #303133; + font-size: 16px; + font-weight: 700; +} +/deep/.el-collapse-item__header { + color: #303133; + font-size: 16px; + font-weight: 700; +} </style> -- Gitblit v1.8.0