From 1f1cc2740ef598c8925edc0f66bf40113d2044a7 Mon Sep 17 00:00:00 2001
From: chenrui <1187576398@qq.com>
Date: 星期四, 27 二月 2025 14:54:11 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev
---
src/api/cnas/systemManagement/documentControl.js | 2
src/views/CNAS/resourceDemand/standardMaterialAccept/component/AddRecord.vue | 336 +++++++--
src/views/system/role/index.vue | 277 +++----
src/views/CNAS/process/sampleDisposal/index.vue | 609 ++++++++++++++++++
src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue | 4
src/views/CNAS/systemManagement/documentControl/components/FileList.vue | 25
src/views/CNAS/personnel/personnelOverview/index.vue | 201 ++++++
src/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept.js | 27
src/views/CNAS/systemManagement/documentControl/components/ControlledFileApplication.vue | 29
src/utils/file.js | 69 +
src/views/business/inspectionTask/index.vue | 12
src/components/UpPdfStamp/index.vue | 4
/dev/null | 198 ------
src/views/system/menu/index.vue | 8
src/api/cnas/personnel/personnelOverview.js | 9
src/assets/images/renyuan-title.svg | 11
src/views/CNAS/systemManagement/measuresDealRisks/components/listRiskAnalysisControlPlans.vue | 2
package.json | 1
src/api/cnas/process/sampleDisposal.js | 74 ++
src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue | 71 -
src/views/performance/class/index.vue | 2
src/views/CNAS/systemManagement/correctiveAction/index.vue | 4
22 files changed, 1,426 insertions(+), 549 deletions(-)
diff --git a/package.json b/package.json
index a4ff793..2b89237 100644
--- a/package.json
+++ b/package.json
@@ -55,6 +55,7 @@
"jspdf": "^3.0.0",
"mammoth": "^1.9.0",
"nprogress": "0.2.0",
+ "pako": "^2.1.0",
"print-js": "^1.6.0",
"quill": "2.0.2",
"screenfull": "5.0.2",
diff --git a/src/api/cnas/personnel/personnelOverview.js b/src/api/cnas/personnel/personnelOverview.js
new file mode 100644
index 0000000..6afa9a1
--- /dev/null
+++ b/src/api/cnas/personnel/personnelOverview.js
@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+export function selectPersonnelOverview(query) {
+ return request({
+ url: '/user/selectPersonnelOverview',
+ method: 'get',
+ params: query
+ })
+}
diff --git a/src/api/cnas/process/sampleDisposal.js b/src/api/cnas/process/sampleDisposal.js
new file mode 100644
index 0000000..a763edd
--- /dev/null
+++ b/src/api/cnas/process/sampleDisposal.js
@@ -0,0 +1,74 @@
+// 妫�娴嬫垨鏍″噯鐗╁搧鐨勫缃�
+import request from "@/utils/request";
+
+// 淇敼
+export function doProcessDeal(data) {
+ return request({
+ url: "/processDeal/doProcessDeal",
+ method: "post",
+ data: data,
+ });
+}
+
+// 鏂板
+export function addProcessDeal(data) {
+ return request({
+ url: "/processDeal/addProcessDeal",
+ method: "post",
+ data: data,
+ });
+}
+
+// 鎻愪氦鍘嗗彶 浼犲弬id
+export function submitProcessTotaldeal(data) {
+ return request({
+ url: "/processTotaldeal/submitProcessTotaldeal",
+ method: "post",
+ data: data,
+ });
+}
+
+//鏌ヨ璇︽儏 鍒嗛〉鏌ヨ閲岄潰totaldealId 浼犲弬鍘嗗彶鐨刬d
+export function pageProcessDeal(query) {
+ return request({
+ url: "/processDeal/pageProcessDeal",
+ method: "get",
+ params: query,
+ });
+}
+
+// 瀹℃牳 浼犲弬id鍜岄�氳繃涓嶉�氳繃state(涓枃)
+export function checkProcessTotaldeal(data) {
+ return request({
+ url: "/processTotaldeal/checkProcessTotaldeal",
+ method: "post",
+ data: data,
+ });
+}
+
+// 鎵瑰噯 浼犲弬id鍜岄�氳繃涓嶉�氳繃state(涓枃)
+export function ratifyProcessTotaldeal(data) {
+ return request({
+ url: "/processTotaldeal/ratifyProcessTotaldeal",
+ method: "post",
+ data: data,
+ });
+}
+
+//鍒犻櫎
+export function delProcessDeal(query) {
+ return request({
+ url: "/processDeal/delProcessDeal",
+ method: "delete",
+ params: query,
+ });
+}
+
+//鏌ョ湅鍘嗗彶
+export function pageProcessTotaldeal(query) {
+ return request({
+ url: "/processTotaldeal/pageProcessTotaldeal",
+ method: "get",
+ params: query,
+ });
+}
diff --git a/src/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept.js b/src/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept.js
index 010c461..e9a0a7a 100644
--- a/src/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept.js
+++ b/src/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept.js
@@ -15,10 +15,18 @@
data: query
})
}
-
+// 鏂板楠屾敹
export function addAcceptance(query) {
return request({
url: '/feStandardSubstanceAcceptance/addAcceptance',
+ method: 'post',
+ data: query
+ })
+}
+// 淇敼楠屾敹
+export function updateAcceptance(query) {
+ return request({
+ url: '/feStandardSubstanceAcceptance/updateAcceptance',
method: 'post',
data: query
})
@@ -34,6 +42,23 @@
params: query
})
}
+// 鏍囧噯鐗╄川楠屾敹鏌ョ湅璇︽儏
+export function getAcceptanceDetails(query) {
+ return request({
+ url: '/feStandardSubstanceAcceptance/getAcceptanceDetails',
+ method: 'get',
+ params: query
+ })
+}
+// 鏍囧噯鐗╄川楠屾敹瀵煎嚭
+export function exportFeStandardSubstanceAcceptance(query) {
+ return request({
+ url: '/feStandardSubstanceAcceptance/exportFeStandardSubstanceAcceptance',
+ method: 'get',
+ params: query,
+ responseType: "blob"
+ })
+}
diff --git a/src/api/cnas/systemManagement/documentControl.js b/src/api/cnas/systemManagement/documentControl.js
index 3fc97b7..9a322b4 100644
--- a/src/api/cnas/systemManagement/documentControl.js
+++ b/src/api/cnas/systemManagement/documentControl.js
@@ -120,7 +120,7 @@
return request({
url: "/manageDocumentIssueRecycle/addManageDocumentIssueRecycle",
method: "post",
- responseType: "blob",
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
data: data,
});
}
diff --git a/src/assets/images/renyuan-title.svg b/src/assets/images/renyuan-title.svg
new file mode 100644
index 0000000..c69691f
--- /dev/null
+++ b/src/assets/images/renyuan-title.svg
@@ -0,0 +1,11 @@
+<svg width="148" height="21" viewBox="0 0 148 21" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7.00437 5.75531V0.0625L0.772461 5.75531H7.00437Z" fill="#B26F00"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M141.709 5.75531V0.0625L147.941 5.75531H141.709Z" fill="#B26F00"/>
+<path d="M6.97192 2.0625C6.97192 0.957931 7.86735 0.0625 8.97192 0.0625H139.676C140.781 0.0625 141.676 0.957931 141.676 2.0625V12.0625C141.676 16.4808 138.095 20.0625 133.676 20.0625H14.9719C10.5537 20.0625 6.97192 16.4808 6.97192 12.0625V2.0625Z" fill="url(#paint0_linear_2026_4)"/>
+<defs>
+<linearGradient id="paint0_linear_2026_4" x1="6.97192" y1="0.0625" x2="6.97192" y2="20.0625" gradientUnits="userSpaceOnUse">
+<stop stop-color="#F9C76F"/>
+<stop offset="1" stop-color="#FEB42F"/>
+</linearGradient>
+</defs>
+</svg>
diff --git a/src/components/UpPdfStamp/index.vue b/src/components/UpPdfStamp/index.vue
index e348eab..9b8fe8c 100644
--- a/src/components/UpPdfStamp/index.vue
+++ b/src/components/UpPdfStamp/index.vue
@@ -12,6 +12,7 @@
<script>
import jsPDF from "jspdf";
+import file from '@/utils/file.js'
export default {
props: ['isUpFile'],
data() {
@@ -142,8 +143,7 @@
}
const pdf = new jsPDF("p", "mm", "a4");
for (let i = 0; i < this.contextList.length; i++) {
- console.log(2222, this.contextList.length, this.$refs.pdfCanvas[i])
- const imgData = this.$refs.pdfCanvas[i].toDataURL('image/jpeg', 1.0);
+ const imgData = this.$refs.pdfCanvas[i].toDataURL('image/jpeg', 0.7);
const pdfWidth = pdf.internal.pageSize.getWidth();
const pdfHeight = (this.$refs.pdfCanvas[i].height * pdfWidth) / this.$refs.pdfCanvas[i].width;
pdf.addImage(imgData, "JPEG", 0, 0, pdfWidth, pdfHeight); // 灏嗗浘鐗囨坊鍔犲埌 PDF
diff --git a/src/utils/file.js b/src/utils/file.js
index c3a3e7b..9c7e99e 100644
--- a/src/utils/file.js
+++ b/src/utils/file.js
@@ -1,48 +1,55 @@
-import { convertToHtml } from 'mammoth';
-import Vue from 'vue'
+import { convertToHtml } from "mammoth";
+import pako from "pako";
+import Vue from "vue";
export default {
async convertFileToHtml(url) {
var xhr = new XMLHttpRequest();
- xhr.open('GET', Vue.prototype.javaApi+url, true);//鑾峰彇鏂囦欢娴佺殑鎺ュ彛
+ xhr.open("GET", Vue.prototype.javaApi + url, true); //鑾峰彇鏂囦欢娴佺殑鎺ュ彛
xhr.send();
- xhr.responseType = "blob";//涓嶈兘婕�
+ xhr.responseType = "blob"; //涓嶈兘婕�
let xhrPromise = new Promise((resolve, reject) => {
xhr.onload = async function () {
if (this.status === 200) {
// 杩斿洖鐨勬枃浠舵祦锛岃浆鎹㈡垚blob瀵硅薄
- var blob = new Blob([this.response],{ type:'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
+ var blob = new Blob([this.response], {
+ type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
+ });
// 浣跨敤mammoth灏哤ord杞崲涓篐TML
let reader = new FileReader();
reader.readAsArrayBuffer(blob);
let htmlContentPromise = new Promise((resolve, reject) => {
reader.onload = async function () {
var arrayBuffer = xhr.response; //arrayBuffer
- const result = await convertToHtml({ arrayBuffer: arrayBuffer })
- let html = result.value.replace(/飪�/g, '')
- .replace('<h1>', '<h1 style="text-align: center;">')
- .replace(/<table>/g, '<table style="border-collapse: collapse;border: 1px solid #000;">')
- .replace(/<tr>/g, '<tr style="height: 30px;">')
- .replace(/<td>/g, '<td style="border: 1px solid #000;">')
- .replace(/<p>/g, '<p style="text-indent: 2em;">')
- .replace(/<a [^>]*>/g, "")
- .replace(/<\/a>/g, "")
+ const result = await convertToHtml({ arrayBuffer: arrayBuffer });
+ let html = result.value
+ .replace(/飪�/g, "")
+ .replace("<h1>", '<h1 style="text-align: center;">')
+ .replace(
+ /<table>/g,
+ '<table style="border-collapse: collapse;border: 1px solid #000;">'
+ )
+ .replace(/<tr>/g, '<tr style="height: 30px;">')
+ .replace(/<td>/g, '<td style="border: 1px solid #000;">')
+ .replace(/<p>/g, '<p style="text-indent: 2em;">')
+ .replace(/<a [^>]*>/g, "")
+ .replace(/<\/a>/g, "");
// .replace(/em/g, "cm");
- resolve(html)
+ resolve(html);
};
- })
- resolve(await htmlContentPromise)
+ });
+ resolve(await htmlContentPromise);
}
-
- }
- })
- return await xhrPromise
+ };
+ });
+ return await xhrPromise;
},
- downloadIamge(imgsrc, name) {//涓嬭浇鍥剧墖鍦板潃鍜屽浘鐗囧悕
+ downloadIamge(imgsrc, name) {
+ //涓嬭浇鍥剧墖鍦板潃鍜屽浘鐗囧悕
var image = new Image();
// 瑙e喅璺ㄥ煙 Canvas 姹℃煋闂
image.setAttribute("crossOrigin", "anonymous");
- image.onload = function() {
+ image.onload = function () {
var canvas = document.createElement("canvas");
canvas.width = image.width;
canvas.height = image.height;
@@ -57,5 +64,19 @@
a.dispatchEvent(event); // 瑙﹀彂a鐨勫崟鍑讳簨浠�
};
image.src = imgsrc;
- }
+ },
+ // 鍘嬬缉blob
+ compressBlob(blob) {
+ const reader = new FileReader();
+ reader.readAsArrayBuffer(blob);
+ return new Promise((resolve) => {
+ reader.onload = () => {
+ const arrayBuffer = reader.result;
+ const uint8Array = new Uint8Array(arrayBuffer);
+ const compressedData = pako.deflate(uint8Array);
+ const compressedBlob = new Blob([compressedData], { type: blob.type });
+ resolve(compressedBlob);
+ };
+ });
+ },
};
diff --git a/src/views/CNAS/personnel/personnelOverview/index.vue b/src/views/CNAS/personnel/personnelOverview/index.vue
new file mode 100644
index 0000000..c5c8da2
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelOverview/index.vue
@@ -0,0 +1,201 @@
+<template>
+ <div class="capacity-scope">
+ <div>
+ <el-form :model="entity" ref="entity" size="small" :inline="true">
+ <el-form-item label="浜哄憳鍚嶇О">
+ <el-input v-model="entity.name" clearable></el-input>
+ </el-form-item>
+ <el-form-item>
+ <el-button @click="refresh">閲� 缃�</el-button>
+ <el-button type="primary" @click="currentPage= 1,list=[],finishLoding = false,keyMap = {},refreshTable()">鏌� 璇�</el-button>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="table" v-loading="loading">
+ <scroll-pagination @load="refreshTable" :finishLoding="finishLoding" :list="list" v-if="list.length>0||loading">
+ <ul class="card">
+ <li v-for="(m,i) in list" :key="i">
+ <el-image style="width: 80px;height: 112px;" :src="javaApi+'/img/'+m.pictureUrl">
+ <div slot="error" class="image-error" style="width: 79px;
+ height: 110px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: 1px solid #EEEEEE;">
+ <i class="el-icon-picture-outline" style="font-size:30px;color:#666666;"></i>
+ </div>
+ </el-image>
+ <el-image style="width: 195px;
+ height: 112px;" :src="javaApi+'/img/'+m.signatureUrl">
+ <div slot="error" class="image-error" style="width: 194px;
+ height: 110px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: 1px solid #EEEEEE;">
+ <i class="el-icon-picture-outline" style="font-size:30px;color:#666666;"></i>
+ </div>
+ </el-image>
+ <div class="title">{{ m.name }}</div>
+ </li>
+ </ul>
+ </scroll-pagination>
+ <div v-if="list.length<1&&!loading" style="color:#909399;font-size:14px;text-align: center;margin-top:200px" >鏆傛棤鏁版嵁</div>
+ </div>
+ </div>
+</template>
+
+<script>
+import ScrollPagination from '@/components/index/scroll-paging.vue'
+import {selectUserCondition} from "@/api/business/inspectionTask";
+export default {
+ components: {
+ ScrollPagination
+ },
+ data() {
+ return {
+ entity:{
+ name: null,
+ status: 0,
+ },
+ list:[],
+ currentPage: 1, // 褰撳墠椤�
+ pageSize: 16, // 涓�椤�16鏉�
+ total: '',
+ loading: true, // 缁勪欢loading鐨勫睍绀�,榛樿涓簍rue
+ finishLoding: false, // 鍔犺浇瀹屾垚锛屾樉绀哄凡缁忔病鏈夋洿澶氫簡
+ keyMap: {}
+ }
+ },
+ created() {
+ this.keyMap = {};
+ this.currentPage = 1;
+ this.list = [];
+ this.refreshTable();
+ },
+ methods: {
+ refreshTable() {
+ const key = `_${this.currentPage}`
+ const value = this.keyMap[key]
+ // 濡傛灉value瀛樺湪锛岃〃绀虹紦瀛樻湁鍊硷紝閭d箞闃绘璇锋眰
+ if(value) {
+ return
+ }
+ // value涓嶅瓨鍦紝琛ㄧず绗竴娆¤姹�,璁剧疆鍗犱綅
+ this.keyMap[key] = 'temp'
+ if(this.currentPage==1){
+ this.loading = true
+ }
+ selectUserCondition({...this.entity}).then(res => {
+ this.total = res.data.length
+ let list = res.data
+ if(list.length==0){
+ this.finishLoding = true;
+ }else{
+ if(list.length<this.pageSize){
+ this.finishLoding = true;
+ }
+ this.list = this.list.concat(list)
+ if(this.total==this.list.length){
+ this.finishLoding = true;
+ }
+ this.currentPage++;
+ }
+ this.loading = false
+ }).catch(err => {
+ this.loading = false
+ })
+ },
+ refresh() {
+ this.keyMap = {};
+ this.currentPage= 1;
+ this.list=[];
+ this.finishLoding = false;
+ this.entity={
+ name: null,
+ state:1,
+ orderBy: {field: "id", order: "asc"}
+ };
+ this.refreshTable()
+ },
+ // 婊氬姩瑙﹀簳鍔犺浇
+ scrollFn() {
+ let clientHeight = document.documentElement.clientHeight - 18; //鍙鍖哄煙
+ let scrollHeight = document.body.scrollHeight; // 婊氬姩鏂囨。楂樺害
+ let scrollTop = parseInt(document.documentElement.scrollTop); // 宸叉粴鍔ㄧ殑楂樺害
+ let height = 300;
+ if (
+ scrollTop + clientHeight >= scrollHeight - height &&
+ scrollHeight != 0
+ ) {
+ if (!this.finishLoding&&this.currentPage*this.pageSize<this.total) {
+ this.currentPage = this.currentPage + 1;
+ this.refreshTable();
+ }
+ } else {
+ return false;
+ }
+ },
+ throttle(fn, wait) {
+ // 灏佽鍑芥暟杩涜鑺傛祦
+ var timer = null;
+ return function () {
+ var context = this;
+ var args = arguments;
+ if (!timer) {
+ timer = setTimeout(function () {
+ fn.apply(context, args);
+ timer = null;
+ }, wait);
+ }
+ };
+ },
+ },
+ destroyed() {
+ window.removeEventListener("scroll", this.throttle(), false);
+ },
+}
+</script>
+<style scoped>
+.table {
+ width: 100%;
+ height: calc(100% - 60px - 80px - 10px - 40px);
+ overflow-y: auto;
+}
+
+.card {
+ list-style-type: none;
+ display: grid;
+ grid-template-columns: repeat(auto-fit, 314px);
+ /* justify-content: center; */
+ grid-gap: 16px;
+ min-height: 200px;
+ padding-left: 0 !important;
+}
+.card li{
+ width: 320px;
+ border-radius: 8px 8px 8px 8px;
+ box-shadow: 4px 4px 8px 0px rgba(51,51,51,0.04);
+ border: 1px solid #EEEEEE;
+ margin: 0 !important;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ box-sizing: border-box;
+ padding: 26px 16px 16px;
+ font-size: 14px;
+ position: relative;
+}
+li .title{
+ width: 147px;
+ height: 20px;
+ background: url(~@/assets/images/renyuan-title.svg) no-repeat;
+ position: absolute;
+ top: -6px;
+ left: 50%;
+ transform: translateX(-50%);
+ text-align: center;
+ line-height: 20px;
+ color: #fff;
+}
+</style>
diff --git a/src/views/CNAS/process/sampleDisposal/index.vue b/src/views/CNAS/process/sampleDisposal/index.vue
new file mode 100644
index 0000000..0d12c66
--- /dev/null
+++ b/src/views/CNAS/process/sampleDisposal/index.vue
@@ -0,0 +1,609 @@
+<template>
+ <div class="sample-disposal">
+ <el-tabs type="border-card" v-model="activeName" style="height: 100%;" @tab-click="queryParams.totaldealId = ''">
+ <el-tab-pane label="濉啓" name="濉啓" style="height: 100%;" :key="1">
+ <el-button size="small" type="primary" @click="handleAdd0" style="margin-left: 20px;">鏂板</el-button>
+ <div class="table" style="height: calc(100% - 200px)" v-if="activeName == '濉啓'">
+ <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading"
+ :height="'calc(100vh - 290px)'" :page="page" @pagination="pagination"></lims-table>
+ </div>
+ </el-tab-pane>
+ <el-tab-pane label="鍘嗗彶璁板綍" name="鍘嗗彶璁板綍" style="height: 100%;" :key="2">
+ <div class="search">
+ <div class="search_thing">
+ <div class="search_label">骞存湀锛�</div>
+ <div class="search_input">
+ <el-date-picker v-model="queryParams0.month" type="month" placeholder="閫夋嫨鏈�" format="yyyy-MM"
+ value-format="yyyy-MM" size="small" @change="refreshTable()">
+ </el-date-picker>
+ </div>
+ </div>
+ <div class="search_thing" style="padding-left: 30px;">
+ <el-button size="small" @click="refresh()">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
+ </div>
+ </div>
+ <div class="table">
+ <lims-table :tableData="tableData0" :column="column0" :tableLoading="tableLoading"
+ :height="'calc(100vh - 300px)'" :page="page0" @pagination="pagination0"></lims-table>
+ </div>
+ </el-tab-pane>
+ </el-tabs>
+ <!-- 鏂板鏍峰搧 -->
+ <el-dialog :title="title" :visible.sync="addDialogVisible" width="400px">
+ <el-row>
+ <el-col :span="24" style="margin-bottom: 16px;">
+ <div class="search_thing">
+ <div class="search_label">鏍峰搧鍚嶇О锛�</div>
+ <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+ v-model="addInfo.sampleName"></el-input></div>
+ </div>
+ </el-col>
+ <el-col :span="24" style="margin-bottom: 16px;">
+ <div class="search_thing">
+ <div class="search_label">鏍峰搧缂栧彿锛�</div>
+ <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+ v-model="addInfo.sampleCode"></el-input></div>
+ </div>
+ </el-col>
+ <el-col :span="24" style="margin-bottom: 16px;">
+ <div class="search_thing">
+ <div class="search_label">渚涙牱鍗曚綅锛�</div>
+ <div class="search_input">
+ <el-select v-model="addInfo.sampleSupplier" size="small">
+ <el-option :label="item.company" :value="item.company" v-for="(item, index) in customPageList"
+ :key="item.id"></el-option>
+ </el-select>
+ </div>
+ </div>
+ </el-col>
+ <el-col :span="24" style="margin-bottom: 16px;">
+ <div class="search_thing">
+ <div class="search_label">鏁伴噺锛�</div>
+ <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+ v-model="addInfo.num"></el-input>
+ </div>
+ </div>
+ </el-col>
+ <el-col :span="24" style="margin-bottom: 16px;">
+ <div class="search_thing">
+ <div class="search_label">澶勭悊鏂瑰紡锛�</div>
+ <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+ v-model="addInfo.dealMethod"></el-input></div>
+ </div>
+ </el-col>
+ <el-col :span="24" style="margin-bottom: 16px;">
+ <div class="search_thing">
+ <div class="search_label">鏃堕棿锛�</div>
+ <div class="search_input">
+ <el-date-picker v-model="addInfo.dealTime" type="date" size="small" placeholder="閫夋嫨鏃ユ湡" format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd" style="width: 100%;">
+ </el-date-picker>
+ </div>
+ </div>
+ </el-col>
+ </el-row>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="addDialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitAdd" :loading="addLoading">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <!-- 璇︽儏/涓嬭浇/瀹℃牳/鎵瑰噯 -->
+ <el-dialog :title="title0" :visible.sync="lookDialogVisible" width="800px" :class="{ downPdf: title0 == '涓嬭浇' }"
+ :modal="title0 != '涓嬭浇'" top="5vh">
+ <filePreview v-if="lookDialogVisible" :fileUrl="javaApi + '/word/' + currentInfo.url" :currentFile="{}"
+ style="max-height: 70vh;overflow-y: auto;" />
+ <span slot="footer" class="dialog-footer" v-if="title0 == '瀹℃牳' || title0 == '鎵瑰噯'">
+ <el-button @click="submitCheck('涓嶉�氳繃')" :loading="noCheckLoading">涓嶉�氳繃</el-button>
+ <el-button type="primary" @click="submitCheck('閫氳繃')" :loading="checkLoading">閫� 杩�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import filePreview from "@/components/Preview/filePreview.vue";
+import { selectCustomPageList } from "@/api/system/customer";
+import {
+ doProcessDeal,
+ addProcessDeal,
+ submitProcessTotaldeal,
+ pageProcessDeal,
+ checkProcessTotaldeal,
+ ratifyProcessTotaldeal,
+ delProcessDeal,
+ pageProcessTotaldeal,
+} from "@/api/cnas/process/sampleDisposal";
+export default {
+ components: {
+ limsTable,
+ filePreview,
+ },
+ name: "SampleDisposal",
+ data() {
+ return {
+ activeName: '濉啓',
+ title: '鏂板',
+ addDialogVisible: false,
+ addLoading: false,
+ outLoading: false,
+ editDialogVisible: false,
+ lookDialogVisible: false,
+ title0: '鏌ョ湅',
+ noCheckLoading: false,
+ checkLoading: false,
+ // 鍘嗗彶鍒楄〃
+ addInfo: {},//鏂板鏍峰搧
+ customPageList: [],
+ currentInfo: {
+ arr: []
+ },//鏌ョ湅鐨勮鎯�
+ outPower: false,
+ addPower: false,
+ queryParams: {},
+ tableData: [],
+ column: [
+ { label: "鏍峰搧鍚嶇О", prop: "sampleName" },
+ { label: "鏍峰搧缂栧彿", prop: "sampleCode" },
+ { label: "渚涙牱鍗曚綅", prop: "sampleSupplier" },
+ { label: "鏁伴噺", prop: "num" },
+ { label: "澶勭悊鏂瑰紡", prop: "dealMethod" },
+ { label: "鏃堕棿", prop: "dealTime" },
+ {
+ dataType: "action",
+ fixed: "right",
+ label: "鎿嶄綔",
+ operation: [
+ {
+ name: "缂栬緫",
+ type: "text",
+ clickFun: (row) => {
+ this.handleAdd0(row);
+ },
+ },
+ {
+ name: "鍒犻櫎",
+ type: "text",
+ clickFun: (row) => {
+ this.handleDelete(row);
+ },
+ },
+ ],
+ },
+ ],
+ page: {
+ total: 0,
+ size: 10,
+ current: 0,
+ },
+ tableLoading: false,
+ queryParams0: {},
+ tableData0: [],
+ column0: [
+ { label: "鏈堜唤", prop: "month" },
+ { label: "鎬绘暟閲�", prop: "totalNum" },
+ { label: "鎻愪氦浜�", prop: "submitUserName" },
+ { label: "瀹℃牳浜�", prop: "examineUserName" },
+ { label: "鎵瑰噯浜�", prop: "ratifyUserName" },
+ {
+ dataType: "action",
+ fixed: "right",
+ label: "鎿嶄綔",
+ operation: [
+ {
+ name: "鏌ョ湅",
+ type: "text",
+ clickFun: (row) => {
+ this.handleLook(row);
+ },
+ },
+ {
+ name: "涓嬭浇",
+ type: "text",
+ clickFun: (row) => {
+ this.handleDown0(row);
+ },
+ disabled: (row) => {
+ return !row.url
+ }
+ },
+ {
+ name: "鎻愪氦",
+ type: "text",
+ clickFun: (row) => {
+ this.handleSubmit(row);
+ },
+ disabled: (row) => {
+ return !!row.submitState && row.submitState != '寰呮彁浜�'
+ }
+ },
+ {
+ name: "瀹℃牳",
+ type: "text",
+ clickFun: (row) => {
+ this.handleCheck(row);
+ },
+ disabled: (row) => {
+ return row.examineState == '閫氳繃' || row.submitState == '寰呮彁浜�'
+ }
+ },
+ {
+ name: "鎵瑰噯",
+ type: "text",
+ clickFun: (row) => {
+ this.handleApproval(row);
+ },
+ disabled: (row) => {
+ return row.ratifyState == '閫氳繃' || row.submitState == '寰呮彁浜�'
+ }
+ },
+ ],
+ },
+ ],
+ page0: {
+ total: 0,
+ size: 10,
+ current: 0,
+ },
+ };
+ },
+ mounted() {
+ // this.entityCopy = this.HaveJson(this.componentData.entity);
+ this.getCustomPageList()
+ this.getList()
+ this.getList0()
+ },
+ methods: {
+ getPower() {
+ let power = JSON.parse(sessionStorage.getItem('power'))
+ let add = false
+ let out = false
+ let submitProcessTotaldeal = false
+ let checkProcessTotaldeal = false
+ let ratifyProcessTotaldeal = false
+ for (var i = 0; i < power.length; i++) {
+ if (power[i].menuMethod == 'addProcessDeal') {
+ add = true
+ }
+ // if (power[i].menuMethod == 'exportProcessEvaluate') {
+ // out = true
+ // }
+ if (power[i].menuMethod == 'submitProcessTotaldeal') {
+ submitProcessTotaldeal = true
+ }
+ if (power[i].menuMethod == 'checkProcessTotaldeal') {
+ checkProcessTotaldeal = true
+ }
+ if (power[i].menuMethod == 'ratifyProcessTotaldeal') {
+ ratifyProcessTotaldeal = true
+ }
+ }
+ if (!ratifyProcessTotaldeal) {
+ this.componentData.do.splice(4, 1)
+ }
+ if (!checkProcessTotaldeal) {
+ this.componentData.do.splice(3, 1)
+ }
+ if (!submitProcessTotaldeal) {
+ this.componentData.do.splice(2, 1)
+ }
+ if (!add) {
+ this.componentData0.do.splice(1, 1)
+ this.componentData0.do.splice(0, 1)
+ }
+ this.addPower = add
+ },
+ // 鑾峰彇閫佹牱鍗曚綅鍒楄〃
+ getCustomPageList() {
+ selectCustomPageList({
+ current: -1,
+ size: -1
+ }).then(res => {
+ this.customPageList = res.data.body.records
+ }).catch(err => { });
+ },
+ handleDown() { },
+ getList() {
+ this.tableLoading = true;
+ let param = { ...this.queryParams, ...this.page };
+ delete param.total;
+ pageProcessDeal({ ...param })
+ .then((res) => {
+ this.tableLoading = false;
+ if (res.code === 200) {
+ this.tableData = res.data.records;
+ this.page.total = res.data.total;
+ }
+ })
+ .catch((err) => {
+ this.tableLoading = false;
+ });
+ },
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.size = limit;
+ this.getList();
+ },
+ refresh() {
+ this.queryParams0 = {};
+ this.page0.current = 1;
+ this.getList0();
+ },
+ refreshTable() {
+ this.page0.current = 1;
+ this.getList0();
+ },
+ getList0() {
+ this.tableLoading = true;
+ let param = { ...this.queryParams0, ...this.page };
+ delete param.total;
+ pageProcessTotaldeal({ ...param })
+ .then((res) => {
+ this.tableLoading = false;
+ if (res.code === 200) {
+ this.tableData0 = res.data.records;
+ this.page0.total = res.data.total;
+ }
+ })
+ .catch((err) => {
+ this.tableLoading = false;
+ });
+ },
+ pagination0({ page, limit }) {
+ this.page0.current = page;
+ this.page0.size = limit;
+ this.getList0();
+ },
+ // 濉啓
+ // handleAdd(row){
+ // this.componentData0.entity.totaldealId = row.id
+ // this.editDialogVisible = true
+ // },
+ // 鎵撳紑鏂板鐣岄潰
+ handleAdd0(row) {
+ if (row) {
+ this.addInfo = this.HaveJson(row)
+ this.title = '缂栬緫'
+ } else {
+ this.title = '鏂板'
+ this.addInfo = {}
+ }
+ this.addDialogVisible = true
+ },
+ // 鎻愪氦鏂板
+ submitAdd() {
+ if (this.addInfo.id) {
+ // 缂栬緫
+ this.addLoading = true
+ doProcessDeal({
+ totaldealId: this.queryParams.totaldealId,
+ ...this.addInfo
+ }).then(res => {
+ this.addLoading = false
+ if (res.code === 201) return
+ this.addDialogVisible = false
+ this.$message({
+ type: 'success',
+ message: '缂栬緫鎴愬姛!'
+ });
+ this.page.current = 0;
+ this.getList();
+ }).catch(err => { });
+ } else {
+ // 鏂板
+ this.addLoading = true
+ addProcessDeal({
+ totaldealId: this.queryParams.totaldealId,
+ ...this.addInfo
+ }).then(res => {
+ this.addLoading = false
+ if (res.code === 201) return
+ this.addDialogVisible = false
+ this.$message({
+ type: 'success',
+ message: '鏂板鎴愬姛!'
+ });
+ this.page.current = 0;
+ this.getList();
+ }).catch(err => { });
+ }
+ },
+ // 鎻愪氦
+ handleSubmit(row) {
+ this.$confirm('鏄惁鎻愪氦 ' + row.month + ' 鏈堜唤鐨勬暟鎹�', '鎻愪氦', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ submitProcessTotaldeal({
+ id: row.id
+ }).then(res => {
+ if (res.code === 201) return
+ this.$message({
+ type: 'success',
+ message: '鎻愪氦鎴愬姛!'
+ });
+ this.refreshTable()
+ }).catch(err => { });
+ })
+ },
+ // 鏌ョ湅
+ handleLook(row) {
+ // console.log(row)
+ // this.title0 = '鏌ョ湅'
+ // this.commonFun(row)
+ this.activeName = '濉啓'
+ this.queryParams.totaldealId = row.id
+ this.$nextTick(() => {
+ this.page.current = 0;
+ this.getList();
+ })
+ },
+ commonFun(row, callbanck) {
+ this.currentInfo = row
+ this.queryParams.totaldealId = row.id
+ pageProcessDeal({
+ current: -1,
+ size: -1, ...this.queryParams
+ }).then(res => {
+ this.lookDialogVisible = true
+ this.currentInfo.arr = res.data.records
+ if (callbanck) {
+ callbanck()
+ }
+ }).catch(err => { });
+ },
+ // 瀹℃牳
+ handleCheck(row) {
+ this.title0 = '瀹℃牳'
+ this.commonFun(row)
+ },
+ // 鎵瑰噯
+ handleApproval(row) {
+ this.title0 = '鎵瑰噯'
+ this.commonFun(row)
+ },
+ // 鎻愪氦瀹℃牳/鎵瑰噯
+ submitCheck(state) {
+ if (state == '閫氳繃') {
+ this.checkLoading = true
+ } else {
+ this.noCheckLoading = true
+ }
+ if (this.title0 == '瀹℃牳') {
+ checkProcessTotaldeal({
+ id: this.currentInfo.id,
+ state: state
+ }).then(res => {
+ this.checkLoading = false
+ this.noCheckLoading = false
+ if (res.code === 201) return
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!'
+ });
+ this.refreshTable()
+ this.lookDialogVisible = false
+ }).catch(err => { });
+ } else if (this.title0 == '鎵瑰噯') {
+ ratifyProcessTotaldeal({
+ id: this.currentInfo.id,
+ state: state
+ }).then(res => {
+ this.checkLoading = false
+ this.noCheckLoading = false
+ if (res.code === 201) return
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!'
+ });
+ this.refreshTable()
+ this.lookDialogVisible = false
+ }).catch(err => { });
+ }
+ },
+ // 瀵煎嚭璇︽儏
+ handleDown0(row) {
+ // 鍚庣涓嬭浇
+ let url = this.javaApi + '/word/' + row.url
+ this.$download.saveAs(url, row.month + ' 鏍峰搧澶勭悊鐢宠琛�');
+ },
+ handleDelete(row) {
+ this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ delProcessDeal({ id: row.id }).then((res) => {
+ if (res.code == 201) return;
+ this.$message.success("鍒犻櫎鎴愬姛");
+ this.refresh();
+ });
+ })
+ .catch(() => { });
+ },
+ },
+}
+</script>
+
+<style scoped>
+.title {
+ height: 60px;
+ line-height: 60px;
+}
+
+.search {
+ background-color: #fff;
+ height: 40px;
+ display: flex;
+ align-items: center;
+ position: relative;
+}
+
+.search_thing {
+ width: 350px;
+ display: flex;
+ align-items: center;
+}
+
+.search_label {
+ width: 110px;
+ font-size: 14px;
+ text-align: right;
+}
+
+.search_input {
+ width: calc(100% - 110px);
+}
+
+.table {
+ background-color: #fff;
+ height: calc(100% - 60px - 140px);
+ padding: 20px;
+}
+
+.downPdf {
+ opacity: 0 !important;
+}
+
+.tables {
+ table-layout: fixed;
+ width: 100%;
+}
+
+.tables td {
+ height: 40px;
+ width: 100px;
+ text-align: center;
+ font-size: 14px;
+ word-wrap: break-word;
+ white-space: normal;
+}
+
+.en {
+ font-size: 12px;
+ word-break: break-word;
+ /* 鑷姩鏂 */
+ overflow-wrap: break-word;
+ /* 闃叉婧㈠嚭 */
+ white-space: normal;
+ /* 榛樿鎹㈣ */
+}
+
+.user-info {
+ display: flex;
+ align-items: center;
+ justify-content: space-evenly;
+ margin-top: 20px;
+}
+
+.user-info .el-button {
+ margin: 0;
+}
+
+>>>.el-tabs__content {
+ height: 100%;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/standardMaterialAccept/component/AddRecord.vue b/src/views/CNAS/resourceDemand/standardMaterialAccept/component/AddRecord.vue
index bd776c7..dc48446 100644
--- a/src/views/CNAS/resourceDemand/standardMaterialAccept/component/AddRecord.vue
+++ b/src/views/CNAS/resourceDemand/standardMaterialAccept/component/AddRecord.vue
@@ -1,103 +1,261 @@
<template>
- <el-dialog :visible.sync="dialogVisible" title="鏍囧噯鐗╄川楠屾敹璁板綍" width="70%">
- <el-steps :active="currentStep" finish-status="success">
- <el-step class="cursor-pointer" v-for="(item, index) in steps" :key="index" :title="item">
- </el-step>
- </el-steps>
- <el-form :model="model" label-width="140px" size="small">
- <Step1 :model.sync="model"></Step1>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="submit">淇� 瀛�</el-button>
- </span>
- </el-dialog>
+ <el-dialog :visible.sync="dialogVisible" title="鏍囧噯鐗╄川楠屾敹璁板綍" width="72%" v-loading="loading">
+ <el-form :model="acceptance" ref="acceptance" label-width="140px" size="small">
+ <el-col :span="12">
+ <el-form-item label="鍘傚浠h〃" prop="producer">
+ <el-input v-model="acceptance.producer"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鐩稿叧闄勪欢" prop="file">
+ <div class="table-between">
+ <el-input v-model="acceptance.file" style="width: 80%;" disabled></el-input>
+ <el-upload
+ ref="upload"
+ style="float: right;"
+ :headers="uploadHeader"
+ :action="action"
+ :show-file-list="false"
+ :on-success="onSuccess"
+ >
+ <el-button type="primary">
+ 闄勪欢涓婁紶
+ </el-button>
+ </el-upload>
+ </div>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鎺ユ敹浜�" prop="recipient">
+ <el-input v-model="acceptance.recipient"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鎺ュ彈绛惧瓧" prop="signature">
+ <el-input v-model="acceptance.signature"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="楠屾敹鎯呭喌" prop="situation">
+ <el-input v-model="acceptance.situation"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="瀹夎璋冭瘯鎯呭喌" prop="installation">
+ <el-input v-model="acceptance.installation"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="娓呭崟" prop="substanceId"
+ :rule="[{ required: true, message: '璇烽�夋嫨娓呭崟', trigger: 'change' }]">
+ <el-select v-model="acceptance.substanceId" placeholder="璇烽�夋嫨" style="width: 100%">
+ <el-option
+ v-for="item in options"
+ :key="item.value"
+ :label="item.name"
+ :value="item.id">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍒拌揣鏃ユ湡" prop="arriveDate">
+ <el-date-picker
+ v-model="acceptance.arriveDate"
+ align="right"
+ type="date"
+ placeholder="閫夋嫨鏃ユ湡"
+ style="width: 100%"
+ value-format="yyyy-MM-dd"
+ >
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="缁翠慨鍗曚綅" prop="maintenanceUnit">
+ <el-input v-model="acceptance.maintenanceUnit"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="澶囦欢纭">
+ <el-button type="primary" style="float: right;" @click="addSpareTable">澧炲姞琛�</el-button>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <lims-table :tableData="list" :column="spareColumns" height="300">
+ <template slot="name" slot-scope="{ row, index }">
+ <el-input v-if="row.isEdit" size="small" v-model="row.name"></el-input>
+ <span v-else>{{ row.name }}</span>
+ </template>
+ <template slot="number" slot-scope="{ row, index }">
+ <el-input v-if="row.isEdit" size="small" v-model="row.number"></el-input>
+ <span v-else>{{ row.number }}</span>
+ </template>
+ <template slot="action" slot-scope="{ row, index }">
+ <div v-if="row.isEdit">
+ <el-button type="text" @click="save(index)">淇濆瓨</el-button>
+ <el-button type="text">鍙栨秷</el-button>
+ </div>
+ <div v-else>
+ <el-button type="text" @click="edit(index)">淇敼</el-button>
+ </div>
+ </template>
+ </lims-table>
+ </el-col>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="closeDialog">鍙� 娑�</el-button>
+ <el-button type="primary" :loading="submitLoading" @click="submit">淇� 瀛�</el-button>
+ </span>
+ </el-dialog>
</template>
<script>
-import Step1 from './Step1.vue'
+import limsTable from "@/components/Table/lims-table.vue";
+import {
+ addAcceptance, getAcceptanceDetails,
+ getStandardSubstanceAll,
+ updateAcceptance
+} from "@/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept";
export default {
- components: {
- Step1
- },
- data() {
- return {
- dialogVisible: false,
- currentStep: 0, // 姝ラ鏉℃樉绀虹鍑犳
- steps: ['鎻愪氦', '寮�绠遍獙鏀跺鏍�', '瀹夎楠屾敹妫�鏌�', '瀹夎楠屾敹澶嶆牳', '楠屾敹鏍告煡', '楠屾敹鏍告煡瀹℃牳'],
- model: {
- acceptance: {
- id: undefined,
- producer: undefined, // 鍘傚浠h〃
- file: undefined, // 鐩稿叧闄勪欢
- recipient: undefined, // 鎺ユ敹浜�
- signature: undefined, // 鎺ュ彈绛惧瓧
- situation: undefined, // 楠屾敹鎯呭喌
- installation: undefined, // 瀹夎璋冭瘯鎯呭喌
- substanceId: undefined, // 娓呭崟
- arriveDate: undefined, // 鍒拌揣鏃ユ湡
- maintenanceUnit: undefined, // 缁翠慨鍗曚綅
- },
- list: []
- }
+ components: {
+ limsTable,
+ },
+ data() {
+ return {
+ dialogVisible: false,
+ loading: false,
+ submitLoading: false,
+ acceptance: {
+ id: undefined,
+ producer: undefined, // 鍘傚浠h〃
+ file: undefined, // 鐩稿叧闄勪欢
+ recipient: undefined, // 鎺ユ敹浜�
+ signature: undefined, // 鎺ュ彈绛惧瓧
+ situation: undefined, // 楠屾敹鎯呭喌
+ installation: undefined, // 瀹夎璋冭瘯鎯呭喌
+ substanceId: undefined, // 娓呭崟
+ arriveDate: undefined, // 鍒拌揣鏃ユ湡
+ maintenanceUnit: undefined, // 缁翠慨鍗曚綅
+ list: [],
+ },
+ list: [],
+ spareColumns: [
+ {
+ label: "鍚嶇О",
+ prop: "name",
+ align: "center",
+ dataType: "slot",
+ slot: "name",
+ }, {
+ label: "鏁伴噺",
+ prop: "number",
+ align: "center",
+ dataType: "slot",
+ slot: "number",
+ }, {
+ label: "鎿嶄綔",
+ align: "center",
+ dataType: "slot",
+ slot: "action",
+ width: 150
}
- },
- watch: {
- model(newVal) {
- this.model = newVal
- }
- },
- methods: {
- clearForm() {
- this.model.acceptance.id = undefined
- this.model.acceptance.producer = undefined
- this.model.acceptance.file = undefined
- this.model.acceptance.recipient = undefined
- this.model.acceptance.signature = undefined
- this.model.acceptance.situation = undefined
- this.model.acceptance.installation = undefined
- this.model.acceptance.substanceId = undefined
- this.model.acceptance.arriveDate = undefined
- this.model.acceptance.maintenanceUnit = undefined
- this.model.list = []
- },
- openDialog(form) {
- console.log(form)
- if(form) {
- this.model.acceptance.id = form.acceptance.id
- this.model.acceptance.producer = form.acceptance.producer
- this.model.acceptance.file = form.acceptance.file
- this.model.acceptance.recipient = form.acceptance.recipient
- this.model.acceptance.signature = form.acceptance.signature
- this.model.acceptance.situation = form.acceptance.situation
- this.model.acceptance.installation = form.acceptance.installation
- this.model.acceptance.substanceId = form.acceptance.substanceId
- this.model.acceptance.arriveDate = form.acceptance.arriveDate
- this.model.acceptance.maintenanceUnit = form.acceptance.maintenanceUnit
- this.model.list = form.list
- } else {
- this.clearForm()
- }
- this.dialogVisible = true
- },
- closeDialog() {
- this.dialogVisible = false
- },
- submit() {
- if (!this.model.acceptance.substanceId) {
- this.$message.warning('璇烽�夋嫨娓呭崟')
- return
- }
- this.$emit('submit', this.model)
- this.closeDialog()
- }
+ ],
+ options: []
}
+ },
+ mounted() {
+ this.getStand()
+ },
+ methods: {
+ openDialog(id) {
+ if(id) {
+ this.getDetail(id)
+ } else {
+ this.clearForm()
+ }
+ this.dialogVisible = true
+ },
+ getDetail(id) {
+ this.loading = true
+ getAcceptanceDetails({id: id}).then(res => {
+ this.acceptance = res.data.acceptance
+ this.list = res.data.list
+ this.loading = false
+ }).catch(err => {
+ this.loading = false
+ })
+ },
+ getStand() {
+ getStandardSubstanceAll().then(res => {
+ this.options = res.data
+ })
+ },
+ addSpareTable() {
+ this.list.push({
+ acceptanceId: this.acceptance.id,
+ name: '',
+ number: '',
+ isEdit: true
+ })
+ },
+ onSuccess(response) {
+ this.acceptance.file = response.data
+ },
+ save(index) {
+ this.$set(this.list[index], 'isEdit', false)
+ },
+ edit(index) {
+ this.$set(this.list[index], 'isEdit', true)
+ },
+ clearForm() {
+ this.list = []
+ this.resetForm('acceptance')
+ },
+ closeDialog() {
+ this.clearForm()
+ this.resetForm('acceptance')
+ this.dialogVisible = false
+ },
+ submit() {
+ if (!this.acceptance.substanceId) {
+ this.$message.warning('璇烽�夋嫨娓呭崟')
+ return
+ }
+ this.acceptance.list = this.HaveJson(this.list)
+ this.submitLoading = true
+ if(this.acceptance.id) {
+ updateAcceptance({acceptance: this.acceptance, list: this.list}).then(res => {
+ this.$message.success('缂栬緫鎴愬姛')
+ this.submitLoading = false
+ this.closeDialog()
+ this.$emit('submit')
+ }).catch((e) => {
+ this.submitLoading = false
+ })
+ } else {
+ addAcceptance({acceptance: this.acceptance, list: this.list}).then(res => {
+ this.$message.success('鏂板鎴愬姛')
+ this.closeDialog()
+ this.$emit('submit')
+ }).catch((e) => {
+ this.submitLoading = false
+ })
+ }
+ },
+ },
+ computed: {
+ action() {
+ return this.javaApi + '/personBasicInfo/saveCNASFile'
+ }
+ },
}
</script>
<style scoped>
-.cursor-pointer {
- cursor: pointer;
+>>>.el-dialog__body {
+ height: 580px;
+ overflow-y: auto;
}
</style>
diff --git a/src/views/CNAS/resourceDemand/standardMaterialAccept/component/Step1.vue b/src/views/CNAS/resourceDemand/standardMaterialAccept/component/Step1.vue
deleted file mode 100644
index 967c41b..0000000
--- a/src/views/CNAS/resourceDemand/standardMaterialAccept/component/Step1.vue
+++ /dev/null
@@ -1,198 +0,0 @@
-<template>
- <el-card class="card">
- <el-col :span="12">
- <el-form-item label="鍘傚浠h〃">
- <el-input v-model="model.acceptance.producer"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鐩稿叧闄勪欢">
- <div class="table-between">
- <el-input v-model="model.acceptance.file" style="width: 82%;"></el-input>
- <el-upload
- ref="upload"
- style="float: left; margin: 0 12px 0 20px;"
- :action="action"
- :show-file-list="false"
- :on-success="onSuccess"
- >
- <el-button type="primary">
- 闄勪欢涓婁紶
- </el-button>
- </el-upload>
- </div>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鎺ユ敹浜�">
- <el-input v-model="model.acceptance.recipient"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鎺ュ彈绛惧瓧">
- <el-input v-model="model.acceptance.signature"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="楠屾敹鎯呭喌">
- <el-input v-model="model.acceptance.situation"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="瀹夎璋冭瘯鎯呭喌">
- <el-input v-model="model.acceptance.installation"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="娓呭崟" prop="substanceId" required>
- <el-select v-model="model.acceptance.substanceId" placeholder="璇烽�夋嫨" style="width: 100%">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鍒拌揣鏃ユ湡">
- <el-date-picker
- v-model="model.acceptance.arriveDate"
- align="right"
- type="date"
- placeholder="閫夋嫨鏃ユ湡"
- style="width: 100%"
- value-format="yyyy-MM-dd"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="缁翠慨鍗曚綅">
- <el-input v-model="model.acceptance.maintenanceUnit"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="澶囦欢纭">
- <el-button type="primary" style="float: right;" @click="addSpareTable">澧炲姞琛�</el-button>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item>
- <lims-table :tableData="model.list" :column="spareColumns" :height="'calc(100vh - 250px)'">
- <template slot="name" slot-scope="{ row, index }">
- <el-input v-if="row.isEdit" size="small" v-model="row.name"></el-input>
- <span v-else>{{ row.name }}</span>
- </template>
- <template slot="number" slot-scope="{ row, index }">
- <el-input v-if="row.isEdit" size="small" v-model="row.number"></el-input>
- <span v-else>{{ row.number }}</span>
- </template>
- <template slot="action" slot-scope="{ row, index }">
- <div v-if="row.isEdit">
- <el-button type="text" @click="save(index)">淇濆瓨</el-button>
- <el-button type="text">鍙栨秷</el-button>
- </div>
- <div v-else>
- <el-button type="text" @click="edit(index)">淇敼</el-button>
- </div>
- </template>
- </lims-table>
- </el-form-item>
- </el-col>
- </el-card>
-</template>
-
-<script>
-// import { getStandardSubstanceAll } from "@/assets/api/api";
-import axios from 'axios';
-import limsTable from '@/components/Table/lims-table.vue'
-import {
- getStandardSubstanceAll
-} from '@/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept'
-
-export default {
- components: {
- limsTable
- },
- props: {
- model: {
- type: Object,
- default: () => {}
- }
- },
- data() {
- return {
- spareColumns: [
- {
- label: "鍚嶇О",
- prop: "name",
- align: "center",
- dataType: "slot",
- slot: "name",
- }, {
- label: "鏁伴噺",
- prop: "number",
- align: "center",
- dataType: "slot",
- slot: "number",
- }, {
- label: "鎿嶄綔",
- align: "center",
- dataType: "slot",
- slot: "action",
- width: 150
- }
- ],
- options: []
- }
- },
- computed: {
- action() {
- return `${this.javaApi}/personBasicInfo/saveCNASFile`
- }
- },
- mounted() {
- this.getStand()
- },
- methods: {
- async getStand() {
- getStandardSubstanceAll().then(res => {
- this.options = res.data
- })
- },
- addSpareTable() {
- this.model.list.push({
- acceptanceId: this.model.acceptance.id,
- name: '',
- number: '',
- isEdit: true
- })
- },
- onSuccess(response) {
- this.model.acceptance.file = response.data
- this.$emit('update:model', this.model)
- },
- save(index) {
- this.model.list[index].isEdit = false
- this.$emit('update:model', this.model)
- },
- edit(index) {
- this.model.list[index].isEdit = true
- }
- }
-}
-</script>
-
-<style scoped>
-.card {
- margin-top: 1em;
- height: 56vh;
- overflow-y: scroll;
-}
-.table-between {
- display: flex;
- justify-content: space-between;
-}
-</style>
diff --git a/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue b/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue
index 241a3c0..fe9ee04 100644
--- a/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue
+++ b/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue
@@ -19,24 +19,21 @@
</div>
<div class="table">
<lims-table :tableData="tableData" :column="columns" :height="'calc(100vh - 250px)'" @pagination="pagination"
- :page="page" :tableLoading="tableLoading"></lims-table>
+ :page="page" :tableLoading="tableLoading">
+ <template slot="action" slot-scope="{ row }">
+ <el-button type="text" @click="edit(row)">缂栬緫</el-button>
+ </template>
+ </lims-table>
</div>
- <AddRecord ref="addRecordRef" @submit="submit"></AddRecord>
+ <AddRecord ref="addRecordRef" v-if="addRecordRef" @submit="submit"></AddRecord>
</div>
</template>
<script>
-// import axios from "axios";
-// import { getPageAcceptance, addAcceptance, updateAcceptance, getAcceptanceDetails, exportAcceptance } from "@/assets/api/api";
-// import ZTTable from '@/components/caorui/ZTTable/index.vue';
-// import AddRecord from './components/AddRecord.vue';
-
import limsTable from '@/components/Table/lims-table.vue'
import AddRecord from './component/AddRecord.vue';
import {
- getPageAcceptance,
- updateAcceptanc,
- addAcceptance
+ getPageAcceptance, getAcceptanceDetails, exportFeStandardSubstanceAcceptance, updateAcceptance, addAcceptance
} from '@/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept'
export default {
components: {
@@ -48,6 +45,7 @@
form: {
search: undefined
},
+ addRecordRef: false,
columns: [
{
label: "鍑哄満缂栧彿",
@@ -114,56 +112,39 @@
this.getTableData()
},
methods: {
- async getTableData() {
- const res = await getPageAcceptance(this.form);
- if (res.code === 200) {
+ getTableData() {
+ getPageAcceptance(this.form).then(res => {
this.tableData = res.data.records;
this.page.total = res.data.total;
- }
-
+ })
},
openDialog() {
- this.$refs.addRecordRef.openDialog()
- },
- async submit(form) {
-
- const { code } = await form.acceptance.id ? updateAcceptanc(this.form) : addAcceptance((this.form));
- if (code == 200) {
- this.$message.success(`${form.acceptance.id ? '缂栬緫' : '娣诲姞'}鎴愬姛`)
- this.getTableData()
- }
- },
- async edit(row) {
- const res = await this.getDetail(row.id)
- this.$refs.addRecordRef.openDialog({
- acceptance: res.acceptance,
- list: res.list
+ this.addRecordRef = true;
+ this.$nextTick(() => {
+ this.$refs.addRecordRef.openDialog()
})
},
- async getDetail(id) {
- const { code, data } = await axios({
- method: 'get',
- url: getAcceptanceDetails,
- params: { id }
+ submit() {
+ this.addRecordRef = false;
+ this.getTableData()
+ },
+ edit(row) {
+ this.addRecordRef = true;
+ this.$nextTick(() => {
+ this.$refs.addRecordRef.openDialog(row.id)
})
- if (code == 200) {
- return data;
- }
},
reset() {
this.form.search = undefined
this.getTableData()
},
async exportExcel() {
- const res = await axios({
- method: "get",
- url: `${exportAcceptance}`,
- responseType: "blob"
+ exportFeStandardSubstanceAcceptance().then(res => {
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, '鏍囧噯鐗╄川楠屾敹.xlsx');
+ this.$message.success('瀵煎嚭鎴愬姛')
})
- const blob = new Blob([res], { type: 'application/octet-stream' });
- this.$download.saveAs(blob, '鏍囧噯鐗╄川楠屾敹.xlsx');
},
-
// 鍒嗛〉鍒囨崲
pagination(page) {
this.page.size = page.limit
diff --git a/src/views/CNAS/systemManagement/correctiveAction/index.vue b/src/views/CNAS/systemManagement/correctiveAction/index.vue
index 6e92fbd..bb41fae 100644
--- a/src/views/CNAS/systemManagement/correctiveAction/index.vue
+++ b/src/views/CNAS/systemManagement/correctiveAction/index.vue
@@ -109,8 +109,8 @@
page: {
size: 20,
current: 1,
+ total: 0,
},
- total: 0,
correctiveInfo: false,
viewTestRecordDialog: false,
};
@@ -131,7 +131,7 @@
this.tableLoading = false
if (res.code === 201) return
this.tableData = res.data.records
- this.total = res.data.total
+ this.page.total = res.data.total
}).catch(err => {
console.log('err---', err);
this.tableLoading = false
diff --git a/src/views/CNAS/systemManagement/documentControl/components/ControlledFileApplication.vue b/src/views/CNAS/systemManagement/documentControl/components/ControlledFileApplication.vue
index 81b5f6a..1a25201 100644
--- a/src/views/CNAS/systemManagement/documentControl/components/ControlledFileApplication.vue
+++ b/src/views/CNAS/systemManagement/documentControl/components/ControlledFileApplication.vue
@@ -470,18 +470,25 @@
formData.append('state', this.type); // 鏂囦欢鍚嶅瓧娈�
formData.append('writer', this.currentInfo.writer); // 鏂囦欢鍚嶅瓧娈�
- let res = await checkManageDocumentControlled(formData)
- this.checkLoading = false
- this.noCheckLoading = false
- if (res.code == 200) {
- this.$message({ message: '鎿嶄綔鎴愬姛', type: 'success' });
- this.checkDialogVisible = false;
- this.refreshTable()
- return true
- } else {
- this.$message({ message: '鎿嶄綔澶辫触', type: 'error' });
- return false
+ try {
+ let res = await checkManageDocumentControlled(formData)
+ this.checkLoading = false
+ this.noCheckLoading = false
+ if (res.code == 200) {
+ this.$message({ message: '鎿嶄綔鎴愬姛', type: 'success' });
+ this.checkDialogVisible = false;
+ this.refreshTable()
+ return true
+ } else {
+ this.$message({ message: '鎿嶄綔澶辫触', type: 'error' });
+ return false
+ }
+ } catch (e) {
+ this.checkLoading = false
+ this.noCheckLoading = false
}
+
+
},
handleCheckSub(type) {
this.type = type
diff --git a/src/views/CNAS/systemManagement/documentControl/components/FileList.vue b/src/views/CNAS/systemManagement/documentControl/components/FileList.vue
index 7a88db6..765c0d3 100644
--- a/src/views/CNAS/systemManagement/documentControl/components/FileList.vue
+++ b/src/views/CNAS/systemManagement/documentControl/components/FileList.vue
@@ -334,17 +334,22 @@
formData.append('file', pdfBlob, fileName); // 鏂囦欢瀛楁
formData.append('id', this.currentInfo.id); // 鏂囦欢鍚嶅瓧娈�
- let res = await uploadFileManageDocumentList(formData)
- this.addLoading = false
- if (res.code == 200) {
- this.$message({ message: '涓婁紶鎴愬姛', type: 'success' });
- this.addDialogVisible = false;
- this.refreshTable()
- return true
- } else {
- this.$message({ message: '涓婁紶澶辫触', type: 'error' });
- return false
+ try {
+ let res = await uploadFileManageDocumentList(formData)
+ this.addLoading = false
+ if (res.code == 200) {
+ this.$message({ message: '涓婁紶鎴愬姛', type: 'success' });
+ this.addDialogVisible = false;
+ this.refreshTable()
+ return true
+ } else {
+ this.$message({ message: '涓婁紶澶辫触', type: 'error' });
+ return false
+ }
+ } catch (e) {
+ this.addLoading = false
}
+
},
handleDelete(row) {
this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
diff --git a/src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue b/src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue
index 07629ec..b0c63c5 100644
--- a/src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue
+++ b/src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue
@@ -13,7 +13,7 @@
<el-button size="small" @click="openDownloadDia">瀵煎嚭</el-button>
</div>
</div>
- <el-table :data="tableData" style="width: 100%" height="calc(100vh - 18em)">
+ <el-table :data="tableData" style="width: 100%" height="calc(100vh - 18em)" key="table1">
<el-table-column type="index" label="搴忓彿" width="120">
<template v-slot="scope">
<span>{{ (page.current - 1) * page.size + scope.$index + 1 }}</span>
@@ -142,7 +142,7 @@
page: {
total: 0,
size: 10,
- current: 0,
+ current: 1,
},
tableData: [],
loading: false
diff --git a/src/views/CNAS/systemManagement/measuresDealRisks/components/listRiskAnalysisControlPlans.vue b/src/views/CNAS/systemManagement/measuresDealRisks/components/listRiskAnalysisControlPlans.vue
index 33adb1f..ca6e916 100644
--- a/src/views/CNAS/systemManagement/measuresDealRisks/components/listRiskAnalysisControlPlans.vue
+++ b/src/views/CNAS/systemManagement/measuresDealRisks/components/listRiskAnalysisControlPlans.vue
@@ -13,7 +13,7 @@
<el-button size="small" @click="openDownloadDia">瀵煎嚭</el-button>
</div>
</div>
- <el-table :data="tableData" style="width: 100%" height="calc(100vh - 18em)">
+ <el-table :data="tableData" style="width: 100%" height="calc(100vh - 18em)" key="table0">
<el-table-column type="index" label="搴忓彿" width="120">
<template v-slot="scope">
<span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
diff --git a/src/views/business/inspectionTask/index.vue b/src/views/business/inspectionTask/index.vue
index 600e362..e10d812 100644
--- a/src/views/business/inspectionTask/index.vue
+++ b/src/views/business/inspectionTask/index.vue
@@ -518,10 +518,18 @@
prop: "insResult",
dataType: "tag",
formatData: (params) => {
- return this.insResultList.find((m) => m.value == params).label;
+ let obj = this.insResultList.find((m) => m.value == params)
+ if (obj) {
+ return this.insResultList.find((m) => m.value == params).label;
+ } else {
+ return ''
+ }
},
formatType: (params) => {
- return this.insResultList.find((m) => m.value == params).type;
+ let obj = this.insResultList.find((m) => m.value == params)
+ if (obj) {
+ return this.insResultList.find((m) => m.value == params).type;
+ }
},
},
{
diff --git a/src/views/performance/class/index.vue b/src/views/performance/class/index.vue
index d5a7a4a..31ac64c 100644
--- a/src/views/performance/class/index.vue
+++ b/src/views/performance/class/index.vue
@@ -808,7 +808,7 @@
}
},
getUsers() {
- selectUserCondition().then((res) => {
+ selectUserCondition({ type: 1 }).then((res) => {
if (res.code === 201) {
return;
}
diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue
index c9e5b75..108aa2a 100644
--- a/src/views/system/menu/index.vue
+++ b/src/views/system/menu/index.vue
@@ -223,8 +223,8 @@
</el-tooltip>
鍙湅鎴戞寜閽�
</span>
- <el-switch v-model="form.isRersonalButton" inactive-text="涓嶆樉绀�" active-text="鏄剧ず" inactive-value="0"
- active-value="1">
+ <el-switch v-model="form.isRersonalButton" inactive-text="涓嶆樉绀�" active-text="鏄剧ず" :inactive-value="0"
+ :active-value="1">
</el-switch>
</el-form-item>
</el-col>
@@ -340,7 +340,8 @@
isFrame: "1",
isCache: "0",
visible: "0",
- status: "0"
+ status: "0",
+ isRersonalButton: 0
};
this.resetForm("form");
},
@@ -379,6 +380,7 @@
this.getTreeselect();
getMenu(row.menuId).then(response => {
this.form = response.data;
+ this.form.isRersonalButton = Number(this.form.isRersonalButton)
this.open = true;
this.title = "淇敼鑿滃崟";
});
diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue
index 0f5f894..93de712 100644
--- a/src/views/system/role/index.vue
+++ b/src/views/system/role/index.vue
@@ -4,48 +4,22 @@
<div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="瑙掕壊鍚嶇О" prop="roleName">
- <el-input
- v-model="queryParams.roleName"
- placeholder="璇疯緭鍏ヨ鑹插悕绉�"
- clearable
- style="width: 200px"
- @keyup.enter.native="handleQuery"
- />
+ <el-input v-model="queryParams.roleName" placeholder="璇疯緭鍏ヨ鑹插悕绉�" clearable style="width: 200px"
+ @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="鏉冮檺瀛楃" prop="roleKey">
- <el-input
- v-model="queryParams.roleKey"
- placeholder="璇疯緭鍏ユ潈闄愬瓧绗�"
- clearable
- style="width: 200px"
- @keyup.enter.native="handleQuery"
- />
+ <el-input v-model="queryParams.roleKey" placeholder="璇疯緭鍏ユ潈闄愬瓧绗�" clearable style="width: 200px"
+ @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="鐘舵��" prop="status">
- <el-select
- v-model="queryParams.status"
- placeholder="瑙掕壊鐘舵��"
- clearable
- style="width: 200px"
- >
- <el-option
- v-for="dict in dict.type.sys_normal_disable"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
+ <el-select v-model="queryParams.status" placeholder="瑙掕壊鐘舵��" clearable style="width: 200px">
+ <el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label"
+ :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="鍒涘缓鏃堕棿">
- <el-date-picker
- v-model="dateRange"
- style="width: 200px"
- value-format="yyyy-MM-dd"
- type="daterange"
- range-separator="-"
- start-placeholder="寮�濮嬫棩鏈�"
- end-placeholder="缁撴潫鏃ユ湡"
- ></el-date-picker>
+ <el-date-picker v-model="dateRange" style="width: 200px" value-format="yyyy-MM-dd" type="daterange"
+ range-separator="-" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鏌� 璇�</el-button>
@@ -54,7 +28,8 @@
</el-form>
</div>
<div class="addButton mb8">
- <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:role:add']">鏂板</el-button>
+ <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"
+ v-hasPermi="['system:role:add']">鏂板</el-button>
</div>
</div>
@@ -66,12 +41,8 @@
<el-table-column label="鏄剧ず椤哄簭" prop="roleSort" width="100" />
<el-table-column label="鐘舵��" align="center" width="100">
<template slot-scope="scope">
- <el-switch
- v-model="scope.row.status"
- active-value="0"
- inactive-value="1"
- @change="handleStatusChange(scope.row)"
- ></el-switch>
+ <el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
+ @change="handleStatusChange(scope.row)"></el-switch>
</template>
</el-table-column>
<el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="180">
@@ -81,52 +52,32 @@
</el-table-column>
<el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['system:role:edit']"
- >淇敼</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['system:role:remove']"
- >鍒犻櫎</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handleView(scope.row)"
- >璇︾粏</el-button>
-<!-- <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:role:edit']">-->
-<!-- <el-button size="mini" type="text" icon="el-icon-d-arrow-right">鏇村</el-button>-->
-<!-- <el-dropdown-menu slot="dropdown">-->
-<!-- <el-dropdown-item command="handleDataScope" icon="el-icon-circle-check"-->
-<!-- v-hasPermi="['system:role:edit']">鏁版嵁鏉冮檺</el-dropdown-item>-->
-<!-- <el-dropdown-item command="handleAuthUser" icon="el-icon-user"-->
-<!-- v-hasPermi="['system:role:edit']">鍒嗛厤鐢ㄦ埛</el-dropdown-item>-->
-<!-- </el-dropdown-menu>-->
-<!-- </el-dropdown>-->
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
+ v-hasPermi="['system:role:edit']">淇敼</el-button>
+ <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
+ v-hasPermi="['system:role:remove']">鍒犻櫎</el-button>
+ <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">璇︾粏</el-button>
+ <!-- <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:role:edit']">-->
+ <!-- <el-button size="mini" type="text" icon="el-icon-d-arrow-right">鏇村</el-button>-->
+ <!-- <el-dropdown-menu slot="dropdown">-->
+ <!-- <el-dropdown-item command="handleDataScope" icon="el-icon-circle-check"-->
+ <!-- v-hasPermi="['system:role:edit']">鏁版嵁鏉冮檺</el-dropdown-item>-->
+ <!-- <el-dropdown-item command="handleAuthUser" icon="el-icon-user"-->
+ <!-- v-hasPermi="['system:role:edit']">鍒嗛厤鐢ㄦ埛</el-dropdown-item>-->
+ <!-- </el-dropdown-menu>-->
+ <!-- </el-dropdown>-->
</template>
</el-table-column>
</el-table>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
+ <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+ @pagination="getList" />
<!-- 娣诲姞鎴栦慨鏀硅鑹查厤缃璇濇 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="瑙掕壊鍚嶇О" prop="roleName">
- <el-input v-model="form.roleName" placeholder="璇疯緭鍏ヨ鑹插悕绉�" :disabled="title === '鏌ョ湅瑙掕壊'"/>
+ <el-input v-model="form.roleName" placeholder="璇疯緭鍏ヨ鑹插悕绉�" :disabled="title === '鏌ョ湅瑙掕壊'" />
</el-form-item>
<el-form-item prop="roleKey">
<span slot="label">
@@ -135,35 +86,35 @@
</el-tooltip>
鏉冮檺瀛楃
</span>
- <el-input v-model="form.roleKey" placeholder="璇疯緭鍏ユ潈闄愬瓧绗�" :disabled="title === '鏌ョ湅瑙掕壊'"/>
+ <el-input v-model="form.roleKey" placeholder="璇疯緭鍏ユ潈闄愬瓧绗�" :disabled="title === '鏌ョ湅瑙掕壊'" />
</el-form-item>
<el-form-item label="瑙掕壊椤哄簭" prop="roleSort">
- <el-input-number v-model="form.roleSort" controls-position="right" :min="0" :disabled="title === '鏌ョ湅瑙掕壊'"/>
+ <el-input-number v-model="form.roleSort" controls-position="right" :min="0" :disabled="title === '鏌ョ湅瑙掕壊'" />
</el-form-item>
<el-form-item label="鐘舵��">
<el-radio-group v-model="form.status" :disabled="title === '鏌ョ湅瑙掕壊'">
- <el-radio
- v-for="dict in dict.type.sys_normal_disable"
- :key="dict.value"
- :label="dict.value"
- >{{dict.label}}</el-radio>
+ <el-radio v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label
+ }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="鑿滃崟鏉冮檺">
- <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')" v-if="title !== '鏌ョ湅瑙掕壊'">灞曞紑/鎶樺彔</el-checkbox>
- <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')" v-if="title !== '鏌ョ湅瑙掕壊'">鍏ㄩ��/鍏ㄤ笉閫�</el-checkbox>
- <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')" v-if="title !== '鏌ョ湅瑙掕壊'">鐖跺瓙鑱斿姩</el-checkbox>
- <el-tree
- :disabled="title === '鏌ョ湅瑙掕壊'"
- class="tree-border"
- :data="menuOptions"
- show-checkbox
- ref="menu"
- node-key="id"
- :check-strictly="!form.menuCheckStrictly"
- empty-text="鍔犺浇涓紝璇风◢鍊�"
- :props="defaultProps"
- ></el-tree>
+ <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')"
+ v-if="title !== '鏌ョ湅瑙掕壊'">灞曞紑/鎶樺彔</el-checkbox>
+ <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')"
+ v-if="title !== '鏌ョ湅瑙掕壊'">鍏ㄩ��/鍏ㄤ笉閫�</el-checkbox>
+ <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')"
+ v-if="title !== '鏌ョ湅瑙掕壊'">鐖跺瓙鑱斿姩</el-checkbox>
+ <el-tree :disabled="title === '鏌ョ湅瑙掕壊'" class="tree-border" :data="menuOptions" show-checkbox ref="menu"
+ node-key="id" :check-strictly="!form.menuCheckStrictly" empty-text="鍔犺浇涓紝璇风◢鍊�" :props="defaultProps">
+ <span class="custom-tree-node" slot-scope="{ node, data }">
+ <span>{{ node.label }}</span>
+ <span>
+ <el-checkbox v-model="data.isRersonal" :true-label="1" :false-label="0"
+ v-if="data.isRersonalButton == 1" @change="m => chooseMe(m, data)"
+ :disabled="title === '鏌ョ湅瑙掕壊'">鍙湅鎴�</el-checkbox>
+ </span>
+ </span>
+ </el-tree>
</el-form-item>
<el-form-item label="澶囨敞">
<el-input v-model="form.remark" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" :disabled="title === '鏌ョ湅瑙掕壊'"></el-input>
@@ -179,36 +130,24 @@
<el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body>
<el-form :model="form" label-width="80px">
<el-form-item label="瑙掕壊鍚嶇О">
- <el-input v-model="form.roleName" :disabled="true"/>
+ <el-input v-model="form.roleName" :disabled="true" />
</el-form-item>
<el-form-item label="鏉冮檺瀛楃">
<el-input v-model="form.roleKey" :disabled="true" />
</el-form-item>
<el-form-item label="鏉冮檺鑼冨洿">
<el-select v-model="form.dataScope" @change="dataScopeSelectChange">
- <el-option
- v-for="item in dataScopeOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
+ <el-option v-for="item in dataScopeOptions" :key="item.value" :label="item.label"
+ :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="鏁版嵁鏉冮檺" v-show="form.dataScope == 2">
<el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">灞曞紑/鎶樺彔</el-checkbox>
<el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">鍏ㄩ��/鍏ㄤ笉閫�</el-checkbox>
- <el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">鐖跺瓙鑱斿姩</el-checkbox>
- <el-tree
- class="tree-border"
- :data="deptOptions"
- show-checkbox
- default-expand-all
- ref="dept"
- node-key="id"
- :check-strictly="!form.deptCheckStrictly"
- empty-text="鍔犺浇涓紝璇风◢鍊�"
- :props="defaultProps"
- ></el-tree>
+ <el-checkbox v-model="form.deptCheckStrictly"
+ @change="handleCheckedTreeConnect($event, 'dept')">鐖跺瓙鑱斿姩</el-checkbox>
+ <el-tree class="tree-border" :data="deptOptions" show-checkbox default-expand-all ref="dept" node-key="id"
+ :check-strictly="!form.deptCheckStrictly" empty-text="鍔犺浇涓紝璇风◢鍊�" :props="defaultProps"></el-tree>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -232,6 +171,8 @@
loading: true,
// 閫変腑鏁扮粍
ids: [],
+ // 鍙湅鎴戞暟缁�
+ isRersonalMenuIds: [],
// 闈炲崟涓鐢�
single: true,
// 闈炲涓鐢�
@@ -317,10 +258,10 @@
getList() {
this.loading = true;
listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
- this.roleList = response.rows;
- this.total = response.total;
- this.loading = false;
- }
+ this.roleList = response.rows;
+ this.total = response.total;
+ this.loading = false;
+ }
);
},
/** 鏌ヨ鑿滃崟鏍戠粨鏋� */
@@ -364,11 +305,11 @@
// 瑙掕壊鐘舵�佷慨鏀�
handleStatusChange(row) {
let text = row.status === "0" ? "鍚敤" : "鍋滅敤";
- this.$modal.confirm('纭瑕�"' + text + '""' + row.roleName + '"瑙掕壊鍚楋紵').then(function() {
+ this.$modal.confirm('纭瑕�"' + text + '""' + row.roleName + '"瑙掕壊鍚楋紵').then(function () {
return changeRoleStatus(row.roleId, row.status);
}).then(() => {
this.$modal.msgSuccess(text + "鎴愬姛");
- }).catch(function() {
+ }).catch(function () {
row.status = row.status === "0" ? "1" : "0";
});
},
@@ -388,21 +329,22 @@
this.$refs.menu.setCheckedKeys([]);
}
this.menuExpand = false,
- this.menuNodeAll = false,
- this.deptExpand = true,
- this.deptNodeAll = false,
- this.form = {
- roleId: undefined,
- roleName: undefined,
- roleKey: undefined,
- roleSort: 0,
- status: "0",
- menuIds: [],
- deptIds: [],
- menuCheckStrictly: true,
- deptCheckStrictly: true,
- remark: undefined
- };
+ this.menuNodeAll = false,
+ this.deptExpand = true,
+ this.deptNodeAll = false,
+ this.form = {
+ roleId: undefined,
+ roleName: undefined,
+ roleKey: undefined,
+ roleSort: 0,
+ status: "0",
+ menuIds: [],
+ deptIds: [],
+ isRersonalMenuIds: [],
+ menuCheckStrictly: true,
+ deptCheckStrictly: true,
+ remark: undefined
+ };
this.resetForm("form");
},
/** 鎼滅储鎸夐挳鎿嶄綔 */
@@ -419,7 +361,7 @@
// 澶氶�夋閫変腑鏁版嵁
handleSelectionChange(selection) {
this.ids = selection.map(item => item.roleId)
- this.single = selection.length!=1
+ this.single = selection.length != 1
this.multiple = !selection.length
},
// 鏇村鎿嶄綔瑙﹀彂
@@ -452,17 +394,17 @@
// 鏍戞潈闄愶紙鍏ㄩ��/鍏ㄤ笉閫夛級
handleCheckedTreeNodeAll(value, type) {
if (type == 'menu') {
- this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
+ this.$refs.menu.setCheckedNodes(value ? this.menuOptions : []);
} else if (type == 'dept') {
- this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
+ this.$refs.dept.setCheckedNodes(value ? this.deptOptions : []);
}
},
// 鏍戞潈闄愶紙鐖跺瓙鑱斿姩锛�
handleCheckedTreeConnect(value, type) {
if (type == 'menu') {
- this.form.menuCheckStrictly = value ? true: false;
+ this.form.menuCheckStrictly = value ? true : false;
} else if (type == 'dept') {
- this.form.deptCheckStrictly = value ? true: false;
+ this.form.deptCheckStrictly = value ? true : false;
}
},
/** 鏂板鎸夐挳鎿嶄綔 */
@@ -484,9 +426,9 @@
roleMenu.then(res => {
let checkedKeys = res.checkedKeys
checkedKeys.forEach((v) => {
- this.$nextTick(()=>{
- this.$refs.menu.setChecked(v, true ,false);
- })
+ this.$nextTick(() => {
+ this.$refs.menu.setChecked(v, true, false);
+ })
})
});
});
@@ -494,7 +436,7 @@
this.title = "淇敼瑙掕壊";
},
// 鏌ョ湅瑙掕壊璇︽儏
- handleView (row) {
+ handleView(row) {
this.title = "鏌ョ湅瑙掕壊";
this.reset();
const roleId = row.roleId || this.ids
@@ -506,8 +448,8 @@
roleMenu.then(res => {
let checkedKeys = res.checkedKeys
checkedKeys.forEach((v) => {
- this.$nextTick(()=>{
- this.$refs.menu.setChecked(v, true ,false);
+ this.$nextTick(() => {
+ this.$refs.menu.setChecked(v, true, false);
})
})
});
@@ -516,7 +458,7 @@
},
/** 閫夋嫨瑙掕壊鏉冮檺鑼冨洿瑙﹀彂 */
dataScopeSelectChange(value) {
- if(value !== '2') {
+ if (value !== '2') {
this.$refs.dept.setCheckedKeys([]);
}
},
@@ -536,16 +478,17 @@
this.title = "鍒嗛厤鏁版嵁鏉冮檺";
},
/** 鍒嗛厤鐢ㄦ埛鎿嶄綔 */
- handleAuthUser: function(row) {
+ handleAuthUser: function (row) {
const roleId = row.roleId;
this.$router.push("/system/role-auth/user/" + roleId);
},
/** 鎻愪氦鎸夐挳 */
- submitForm: function() {
+ submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.roleId != undefined) {
this.form.menuIds = this.getMenuAllCheckedKeys();
+ this.form.isRersonalMenuIds = this.isRersonalMenuIds;
updateRole(this.form).then(response => {
this.$modal.msgSuccess("淇敼鎴愬姛");
this.open = false;
@@ -553,6 +496,7 @@
});
} else {
this.form.menuIds = this.getMenuAllCheckedKeys();
+ this.form.isRersonalMenuIds = this.isRersonalMenuIds;
addRole(this.form).then(response => {
this.$modal.msgSuccess("鏂板鎴愬姛");
this.open = false;
@@ -563,7 +507,7 @@
});
},
/** 鎻愪氦鎸夐挳锛堟暟鎹潈闄愶級 */
- submitDataScope: function() {
+ submitDataScope: function () {
if (this.form.roleId != undefined) {
this.form.deptIds = this.getDeptAllCheckedKeys();
dataScope(this.form).then(response => {
@@ -576,18 +520,27 @@
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
handleDelete(row) {
const roleIds = row.roleId || this.ids;
- this.$modal.confirm('鏄惁纭鍒犻櫎瑙掕壊缂栧彿涓�"' + roleIds + '"鐨勬暟鎹」锛�').then(function() {
+ this.$modal.confirm('鏄惁纭鍒犻櫎瑙掕壊缂栧彿涓�"' + roleIds + '"鐨勬暟鎹」锛�').then(function () {
return delRole(roleIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- }).catch(() => {});
+ }).catch(() => { });
},
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
handleExport() {
this.download('system/role/export', {
...this.queryParams
}, `role_${new Date().getTime()}.xlsx`)
+ },
+ // 鍙湅鎴�
+ chooseMe(val, data) {
+ let index = this.isRersonalMenuIds.findIndex(m => m == data.id)
+ if (index < 0 && val == 1) {
+ this.isRersonalMenuIds.push(data.id)
+ } else if (val == 0 && index > -1) {
+ this.isRersonalMenuIds.splice(index, 1)
+ }
}
}
};
@@ -598,7 +551,17 @@
display: flex;
justify-content: space-between;
}
+
.addButton {
margin-top: 3px;
}
+
+.custom-tree-node {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 14px;
+ padding-right: 8px;
+}
</style>
--
Gitblit v1.9.3