From ee5102cc92b919623139e88819a945e02e611182 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期六, 06 九月 2025 19:15:32 +0800
Subject: [PATCH] 解锁增加解锁原因和展示
---
src/views/wel/shemi.vue | 330 +++++++++++++++++++++++++++++-------------------------
1 files changed, 178 insertions(+), 152 deletions(-)
diff --git a/src/views/wel/shemi.vue b/src/views/wel/shemi.vue
index c16667e..1a3f0b2 100644
--- a/src/views/wel/shemi.vue
+++ b/src/views/wel/shemi.vue
@@ -1,7 +1,7 @@
<template>
<basic-container>
<div class="norightmenu" v-if="!isSearch">
- <avue-crud :addBtn="false" :option="option" :table-loading="loading" :data="treeData" ref="crud"
+ <avue-crud :addBtn="false" :option="option" :row-style="{height:'20px'}" :cell-style="{padding:'0px'}" :table-loading="loading" :data="treeData" ref="crud"
v-model:search="search" v-model:page="mypage" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad" @row-click="rowClick">
<template #search>
@@ -14,9 +14,9 @@
<el-checkbox value="3" label="鍋忕" />
</el-checkbox-group>
</el-col>
- <el-col :span="4" class="search-data-flex">
+ <el-col :span="6" class="search-data-flex">
<span class="search-data-title">闆剁粍浠跺彿:</span>
- <el-select v-model="searchTreeData.drawingNo" filterable remote reserve-keyword placeholder="闆剁粍浠跺彿"
+ <el-select v-model="searchTreeData.drawingNo" filterable remote reserve-keyword placeholder="杈撳叆鑷冲皯3涓瓧绗﹁繃婊ゆ暟鎹�"
:remote-method="remoteMethod" :loading="searchLoading">
<el-option v-for="item in drawingNoList" :key="item.value" :label="item.label"
:value="item.value" /></el-select>
@@ -27,7 +27,7 @@
end-placeholder="缁撴潫鏃堕棿" :size="size" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="createTimeChange" /><!--:disabled-date="disabledDate" 涓嶉渶瑕佺鐢ㄦ棩鏈�-->
</el-col>
- <el-col :span="6" class="search-data-flex">
+ <el-col :span="4" class="search-data-flex">
<el-button type="primary" @click="searchTree" :loading="treeSearchLoad"><el-icon class="el-icon--right"
style="margin-right: 6px;">
<Search />
@@ -39,34 +39,24 @@
</el-col>
</el-row>
</template>
- <!-- <template #menu-left>
- <el-button :size="size" type="primary" @click="showAdd()">鏂板鏍硅妭鐐�</el-button>
- </template> -->
+
<template #name="{ row }">
<span>{{ row.name }}</span>
- <!-- <el-button :size="size" text v-if="row.nodeType != 70" icon="el-icon-setting" type="primary" placeholder="淇敼" @click="showEdit(row)" title="淇敼"></el-button>
- <el-button :size="size" text v-if="row.nodeType != 10" icon="el-icon-delete" type="primary" @click="showDel(row)" placeholder="鍒犻櫎" title="鍒犻櫎"></el-button>
- <el-button :size="size" text v-if="row.nodeType != 60 && row.nodeType != 70" icon="el-icon-document-add" type="primary" @click="showAdd(row)" placeholder="鏂板瀛愮骇" title="鏂板瀛愮骇"></el-button>
- <el-button :size="size" text v-if="row.nodeType == 60 || row.nodeType == 50" icon="el-icon-upload" type="primary" @click="showUpload(row)" placeholder="鏂囦欢涓婁紶" title="鏂囦欢涓婁紶"></el-button> -->
- <!-- 娑夊瘑缃戞墠鏈� -->
- <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-pie-chart" type="primary" @click="upgrade(row)" placeholder="鍗囩増" title="鍗囩増"></el-button> -->
- <!-- 宸ユ帶缃戞墠鏈� -->
- <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-position" type="primary" @click="downsend(row)" placeholder="涓嬪彂" title="涓嬪彂"></el-button> -->
-
+
<!-- 鏇挎崲 v-if="permission.auto_dispatch"-->
<el-button :size="size" text v-if="row.nodeType == 60 && row.parentIds.indexOf('0,1,') > -1"
icon="el-icon-switch" type="primary" @click="replacement(row)" placeholder="鏇挎崲" title="鏇挎崲"></el-button>
<el-button :size="size" text
v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked != 1"
- icon="el-icon-lock" type="primary" @click="locked(row, true)" placeholder="閿佸畾" title="閿佸畾"></el-button>
+ icon="el-icon-lock" type="primary" @click="showLockDlg(row)" placeholder="閿佸畾" title="閿佸畾"></el-button>
<el-button :size="size" text
v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked == 1"
- icon="el-icon-unlock" type="primary" @click="locked(row, false)" placeholder="瑙i攣" title="瑙i攣"></el-button>
+ icon="el-icon-unlock" type="primary" @click="showUnLockDlg(row)" placeholder="瑙i攣" title="瑙i攣"></el-button>
</template>
</avue-crud>
</div>
<div class="norightmenu" v-else>
- <avue-crud :addBtn="false" :option="option" :table-loading="loading" :data="treeData" ref="crud"
+ <avue-crud :addBtn="false" :option="option" :row-style="{height:'20px'}" :cell-style="{padding:'0px'}" :table-loading="loading" :data="treeData" ref="crud"
v-model:search="search" v-model:page="mypage" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad" @row-click="rowClick">
<template #search>
@@ -81,7 +71,7 @@
</el-col>
<el-col :span="4" class="search-data-flex">
<span class="search-data-title">闆剁粍浠跺彿:</span>
- <el-select v-model="searchTreeData.drawingNo" filterable remote reserve-keyword placeholder="闆剁粍浠跺彿"
+ <el-select v-model="searchTreeData.drawingNo" filterable remote reserve-keyword placeholder="杈撳叆鑷冲皯3涓瓧绗﹁繃婊ゆ暟鎹�"
:remote-method="remoteMethod" :loading="searchLoading">
<el-option v-for="item in drawingNoList" :key="item.value" :label="item.label"
:value="item.value" /></el-select>
@@ -109,24 +99,16 @@
</template> -->
<template #name="{ row }">
<span>{{ row.name }}</span>
- <!-- <el-button :size="size" text v-if="row.nodeType != 70" icon="el-icon-setting" type="primary" placeholder="淇敼" @click="showEdit(row)" title="淇敼"></el-button>
- <el-button :size="size" text v-if="row.nodeType != 10" icon="el-icon-delete" type="primary" @click="showDel(row)" placeholder="鍒犻櫎" title="鍒犻櫎"></el-button>
- <el-button :size="size" text v-if="row.nodeType != 60 && row.nodeType != 70" icon="el-icon-document-add" type="primary" @click="showAdd(row)" placeholder="鏂板瀛愮骇" title="鏂板瀛愮骇"></el-button>
- <el-button :size="size" text v-if="row.nodeType == 60 || row.nodeType == 50" icon="el-icon-upload" type="primary" @click="showUpload(row)" placeholder="鏂囦欢涓婁紶" title="鏂囦欢涓婁紶"></el-button> -->
- <!-- 娑夊瘑缃戞墠鏈� -->
- <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-pie-chart" type="primary" @click="upgrade(row)" placeholder="鍗囩増" title="鍗囩増"></el-button> -->
- <!-- 宸ユ帶缃戞墠鏈� -->
- <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-position" type="primary" @click="downsend(row)" placeholder="涓嬪彂" title="涓嬪彂"></el-button> -->
-
+
<!-- 鏇挎崲 v-if="permission.auto_dispatch"-->
<el-button :size="size" text v-if="row.nodeType == 60 && row.parentIds.indexOf('0,1,') > -1"
icon="el-icon-switch" type="primary" @click="replacement(row)" placeholder="鏇挎崲" title="鏇挎崲"></el-button>
<el-button :size="size" text
v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked != 1"
- icon="el-icon-lock" type="primary" @click="locked(row, true)" placeholder="閿佸畾" title="閿佸畾"></el-button>
+ icon="el-icon-lock" type="primary" @click="showLockDlg(row)" placeholder="閿佸畾" title="閿佸畾"></el-button>
<el-button :size="size" text
v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked == 1"
- icon="el-icon-unlock" type="primary" @click="locked(row, false)" placeholder="瑙i攣" title="瑙i攣"></el-button>
+ icon="el-icon-unlock" type="primary" @click="showUnLockDlg(row)" placeholder="瑙i攣" title="瑙i攣"></el-button>
</template>
</avue-crud>
</div>
@@ -144,6 +126,14 @@
<div v-else>娌℃湁涓婁紶鏂囦欢</div>
</template>
</avue-form>
+ </el-dialog>
+
+ <!-- 閿佸畾瀵硅瘽妗� -->
+ <el-dialog title="绋嬪簭閿佸畾" append-to-body v-model="lockBox">
+ <avue-form :option="lockOption" v-model="lockForm" @submit="lockSubmit" @reset-change="lockCancel" />
+ </el-dialog>
+ <el-dialog title="绋嬪簭瑙i攣" append-to-body v-model="unlockBox">
+ <avue-form :option="unlockOption" v-model="unlockForm" @submit="unlockSubmit" @reset-change="unlockCancel" />
</el-dialog>
<avue-tabs :option="tabsOption" @change="tabsHandleChange" style="margin-top: 30px;" v-if="isShowTabs"></avue-tabs>
<avue-form v-if="tabsType == 'tab1'" :option="tabsFormOption" v-model="tabsForm"></avue-form>
@@ -189,9 +179,11 @@
</template>
<script>
+import debounce from 'lodash/debounce';
import { ElMessage } from 'element-plus';
import TodolistLeft from './components/TodolistLeft.vue';
import TodolistRightTop from './components/TodolistRightTop.vue';
+import qs from 'qs';
export default {
components: {
TodolistLeft,
@@ -308,22 +300,16 @@
icon: 'el-icon-info',
label: '鑺傜偣淇℃伅',
prop: 'tab1',
- }/*, {
- icon: 'el-icon-warning',
- label: '鐗堟湰淇℃伅',
- prop: 'tab2',
- }*/]
+ }
+ ]
},
tabsOption2: {
column: [{
icon: 'el-icon-info',
label: '鑺傜偣淇℃伅',
prop: 'tab1',
- },/* {
- icon: 'el-icon-warning',
- label: '鐗堟湰淇℃伅',
- prop: 'tab2',
- }, */{
+ },
+ {
icon: 'el-icon-warning',
label: '鏂囦欢鍐呭',
prop: 'tab3'
@@ -439,6 +425,63 @@
},
modalBox: false,
modalTitle: "",
+
+ lockOption: {
+ submitText: "閿佸畾",
+ emptyText: "鍙栨秷",
+ menuPosition: "right",
+ column: [
+ {
+ label: '绋嬪簭鍖呭悕',
+ prop: 'name',
+ disabled:true,
+ labelWidth: "120",
+ },
+
+ {
+ label: '閿佸畾鍘熷洜',
+ prop: 'remark',
+ type: "textarea",
+ labelWidth: "120",
+ span: 24,
+ rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
+ }
+ ]
+ },
+ lockForm: {},
+ lockBox: false,
+
+ unlockOption: {
+ submitText: "鍚姩瑙i攣娴佺▼",
+ emptyText: "鍙栨秷",
+ menuPosition: "right",
+ column: [
+ {
+ label: '绋嬪簭鍖呭悕',
+ prop: 'name',
+ disabled:true,
+ labelWidth: "120",
+ },
+ {
+ label: '閿佸畾鍘熷洜',
+ prop: 'remark',
+ type: "textarea",
+ disabled:true,
+ labelWidth: "120",
+ span: 24,
+ },
+ {
+ label: '瑙i攣鍘熷洜',
+ prop: 'unlockReason',
+ type: "textarea",
+ labelWidth: "120",
+ span: 24,
+ }
+ ]
+ },
+ unlockForm: {},
+ unlockBox: false,
+
id: "",
parentId: 1,
loading: true,
@@ -496,7 +539,7 @@
width: '360'
},
{
- label: '鐗堟湰',
+ label: '绋嬪簭鐗堟湰',
prop: 'versionNumber',
formatter: (val, value, label) => {
if (val.nodeType == '60') {
@@ -509,22 +552,7 @@
return '';
}
}
- },/*
- {
- label: '鐗堟',
- prop: 'processEdition',
- formatter: (val, value, label) => {
- if(val.nodeType == '60'){
- return value;
- }else{
- return '';
- }
- }
},
- {
- label: '鎻忚堪',
- prop: 'abc'
- },*/
{
label: '绫诲瀷',
prop: 'nodeTypeName'
@@ -567,11 +595,7 @@
}
}
},
- },/*
- {
- label: '娴嬭瘯绋嬪簭',
- prop: 'abc'
- },*/
+ },
{
label: '鍒涘缓浜�',
prop: 'createUserName',
@@ -747,9 +771,20 @@
this.searchTreeData.createTimeEnd = value[1];
},
remoteMethod(query) {
- if (query) {
+ if (query && query.length>2) {
this.searchLoading = true;
- axios({
+ this.getRemote(query);
+ } else {
+ this.drawingNoList = [];
+ }
+ },
+ getRemote: debounce(function(query){
+ //闃叉姈锛岃繖閲岃缃�600姣璇锋眰涓�娆″悗鍙�
+ this.getList(query)
+ },600),
+ async getList(query){
+ this.searchLoading = false;
+ axios({
url: '/blade-mdm/program/node/drawing-no-pick',
method: 'get',
params: { drawingNo: query }
@@ -761,34 +796,79 @@
})
this.drawingNoList = drawingNoList;
});
- } else {
- this.drawingNoList = [];
- }
},
- locked(row, isLockP) {
- //row.isLocked == isLock
- var isLock = row.isLocked == 1;
- console.log('isLock', isLock)
- this.$confirm(`鏄惁${isLock ? '瑙i攣' : '閿佸畾'}`, {
+ showLockDlg(row){
+ //this.lockForm = row;
+ this.lockForm.id = row.id;
+ this.lockForm.name = row.name
+ this.lockForm.parentId = row.parentId;
+ this.lockForm.remark = '';
+ this.lockBox = true;
+ },
+ lockCancel() {
+ this.lockBox = false;
+ this.lockForm = {};
+ },
+ showUnLockDlg(row){
+ this.unlockForm.id = row.id;
+ this.unlockForm.name = row.name
+ this.unlockForm.remark = row.remark;
+ this.unlockForm.unlockReason='';
+ this.unlockForm.parentId = row.parentId;
+ this.unlockBox = true;
+ },
+ lockSubmit(row,done) {
+ //console.log(row,done)
+ //閿佸畾鎻愪氦
+ this.$confirm('鏄惁閿佸畾', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ }).then(() => {
+ axios.post('/blade-mdm/program/node/lock',qs.stringify(this.lockForm)).then(res=>{
+ console.log('res',res.data)
+ if (res.data.code == 200) {
+ this.$message({ type: 'success', message: '鎿嶄綔鎴愬姛!' });
+ this.addLocalTreeNode(this.lockForm.parentId);
+ this.unlockBox = false;
+ } else {
+ this.$message({ type: 'error', message: res.data.msg });
+ }
+ this.lockBox = false;
+ }).catch(error => {
+ this.$message({ type: 'error', message: res.data.msg });
+ });
+ done();
+ }).catch(action => {
+ console.log('cancel')
+ });
+ },
+ unlockSubmit(row,done) {
+ //鍚姩瑙i攣娴佺▼
+ this.$confirm(`纭瑙i攣`, {
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
type: 'warning',
}).then(() => {
axios({
- url: isLock ? '/blade-mdm/flow/lock/start-unlock' : '/blade-mdm/program/node/lock',
+ url: '/blade-mdm/flow/lock/start-unlock',
method: 'post',
- params: { id: row.id, nodeId: row.id }
+ params: {nodeId: row.id,unlockReason:row.unlockReason }
}).then(res => {
if (res.data.code == 200) {
- this.$message({ type: 'success', message: '鎿嶄綔鎴愬姛!' });
+ this.$message({ type: 'success', message: '瑙i攣娴佺▼宸插惎鍔�!' });
this.addLocalTreeNode(row.parentId);
} else {
- this.$message({ type: 'success', message: res.data.msg });
+ this.$message({ type: 'error', message: res.data.msg });
}
});
+ done();
}).catch(action => {
console.log('cancel')
});
+ },
+ unlockCancel() {
+ this.unlockBox = false;
},
handleSubmit(form, done) {
//鍙戣捣绋嬪簭鏇挎崲娴佺▼
@@ -814,34 +894,22 @@
window.console.log('haha', error);
done();
});
- // if(this.row.taskDefinitionKey === 'programmingTask') {
- // // if(this.applist.length !== 1) {
- // // done();
- // // return this.$message.success('璇烽�夋嫨1涓▼搴�');
- // // }
- // }
- // approve({
- // ...this.formApprove,
- // taskId: this.row.taskId,
- // processInstanceId: this.row.processInstanceId,
- // // programIds: this.row.taskDefinitionKey === 'programmingTask' ? this.applist.map(v => v.id).join(',') : '',
- // }).then(res => {
- // if(res.data.code !== 200) {
- // this.$message.error(res.data.msg);
- // done();
- // return;
- // }
- // this.$message.success('瀹℃壒鎴愬姛');
- // this.approveBox = false;
- // this.onLoad(this.page, this.query);
- // done();
- // }).catch(err => {
- // done();
- // console.error(err);
- // });
+
},
todoSelectionChange(applist) {
this.applist = applist;
+ },
+ showReplaceDlg(row) { //鏇挎崲瀵硅瘽妗�
+
+ if (row.nodeType == 60) { //绋嬪簭鍖�
+ return;
+ }
+ //111
+ this.modalTitle = "鏂板瀛愯妭鐐�";
+ this.selectedColumn.parentId = row.id;
+ this.modalForm = this.selectedColumn;
+
+ this.modalBox = true;
},
replacement(row) { //鏇挎崲
this.id = row.id;
@@ -919,12 +987,16 @@
});
},
searchTree() {
- if (this.searchTreeData.programStatus.length == 0) return;
- if (this.searchTreeData.drawingNo == "") return;
+ if (this.searchTreeData.programStatus.length == 0 || this.searchTreeData.drawingNo == ""){
+ this.$message.warning('璇疯緭鍏ョ▼搴忕姸鎬佸拰闆剁粍浠跺彿杩涜鎼滅储');
+ return;
+ }
+
this.treeSearchLoad = true;
this.isSearch = !this.isSearch
this.searchTreeData.status = this.searchTreeData.programStatus.join();
this.treeData = []
+ this.defaultExpandedKeys = []
axios({
url: '/blade-mdm/program/node/search-list2',
method: 'get',
@@ -956,7 +1028,7 @@
if (this.treeData.length == 0) {
return;
}
- }, 1000);
+ }, 100);
});
@@ -1178,50 +1250,7 @@
this.modalBox = true;
this.modalForm = row;
},
- showDel(row) {
- this.$confirm('灏嗕細鍒犻櫎璇ヨ妭鐐瑰強鍏跺瓙鑺傜偣锛屾槸鍚︾‘璁ゅ垹闄�?', {
- confirmButtonText: '鏄�',
- cancelButtonText: '鍚�',
- type: 'warning',
- }).then(() => {
- //璋冪敤鎺ュ彛
- this.loading = true;
- axios({
- url: '/blade-mdm/program/node/remove',
- method: 'post',
- params: { id: row.id },
- }).then(
- res => {
- this.loading = false;
- this.addLocalTreeNode(row.parentId);
- }
- );
- })
- },
- showAdd(row) { //鏂板瀛愯妭鐐�
- if (!row) {
- this.modalTitle = "鏂板鏍硅妭鐐�";
- this.modalForm.nodeType = this.nodeTypeList[0].dictKey;
- this.modalForm.parentId = 0;
- } else {
- if (row.nodeType == 60) { //绋嬪簭鍖�
- return;
- }
- var defalutNodeType = ""; //涓嬩竴绾ц妭鐐圭被鍨�
- for (var i = 0; i < this.nodeTypeList.length; i++) {
- if (row.nodeType == this.nodeTypeList[i].dictKey) {
- defalutNodeType = this.nodeTypeList[i + 1].dictKey;
- }
- }
- this.modalTitle = "鏂板瀛愯妭鐐�";
- this.selectedColumn.nodeType = defalutNodeType;
- this.selectedColumn.parentId = row.id;
- this.selectedColumn.name = "";
- this.selectedColumn.id = "";
- this.modalForm = this.selectedColumn;
- }
- this.modalBox = true;
- },
+
modalSubmit(row, done) { //鏂板瀛愯妭鐐逛繚瀛�/淇敼
if (this.modalTitle == "淇敼") {
var url = "/blade-mdm/program/node/update";
@@ -1284,9 +1313,6 @@
},
treeLoad(tree, treeNode, resolve) {
console.log('tree', tree, treeNode, this.option)
- if(this.isSearch !== null){
- return
- }
this.loading = true;
var obj = { parentId: tree.id }
@@ -1433,7 +1459,7 @@
}
.search-data-title {
- font-size: 12px;
+ font-size: 14px;
margin-right: 8px;
display: inline-block;
width: 95px;
--
Gitblit v1.9.3