From dd4e133fbe3402cb62d657491c44628280bb4f56 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期二, 26 八月 2025 11:13:18 +0800
Subject: [PATCH] 注释toptodo
---
src/views/wel/shemi.vue | 271 +++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 219 insertions(+), 52 deletions(-)
diff --git a/src/views/wel/shemi.vue b/src/views/wel/shemi.vue
index a8194a9..c7aa7f2 100644
--- a/src/views/wel/shemi.vue
+++ b/src/views/wel/shemi.vue
@@ -1,5 +1,6 @@
-<template>
+<template >
<basic-container>
+ <div class="norightmenu">
<avue-crud
:addBtn="false"
:option="option"
@@ -17,16 +18,25 @@
>
<template #search>
<el-row :gutter="24">
- <el-col :span="6">
- <el-input v-model="search.name" placeholder="璇疯緭鍏ヨ妭鐐瑰悕绉�" clearable/>
+ <el-col :span="6" class="search-data-flex">
+ <span class="search-data-title w68">绋嬪簭鐘舵��:</span>
+ <el-checkbox-group v-model="searchTreeData.programStatus" class="marginR12">
+ <el-checkbox value="1" label="璇曞垏" />
+ <el-checkbox value="2" label="鍥哄寲" />
+ <el-checkbox value="3" label="鍋忕" />
+ </el-checkbox-group>
</el-col>
- <el-col :span="6">
- <el-select v-model="search.nodeType" placeholder="璇疯緭鍏ヨ妭鐐圭被鍨�" clearable>
- <el-option v-for="item in nodeTypeList" :key="item.dictValue" :label="item.dictValue" :value="item.dictKey"/>
- </el-select>
+ <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="闆剁粍浠跺彿" :remote-method="remoteMethod" :loading="searchLoading">
+ <el-option v-for="item in drawingNoList" :key="item.value" :label="item.label" :value="item.value"/></el-select>
</el-col>
- <el-col :span="6">
- <el-button type="primary" @click="searchTree"><el-icon class="el-icon--right" style="margin-right: 6px;"><Search /></el-icon>鎼滅储</el-button>
+ <el-col :span="8" class="search-data-flex">
+ <span class="search-data-title">鏃堕棿鑼冨洿:</span>
+ <el-date-picker v-model="searchTreeData.createTime" type="daterange" start-placeholder="寮�濮嬫椂闂�" 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-button type="primary" @click="searchTree" :loading="treeSearchLoad"><el-icon class="el-icon--right" style="margin-right: 6px;"><Search /></el-icon>鎼滅储</el-button>
<el-button :icon="Delete" @click="setClearTree"><el-icon class="el-icon--right" style="margin-right: 6px;"><Delete /></el-icon>娓呯┖</el-button>
</el-col>
</el-row>
@@ -44,11 +54,14 @@
<!-- <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-icon><Switch /></el-icon> -->
+ <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>
+ <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>
</template>
</avue-crud>
+ </div>
<!-- 鏂板鑺傜偣 -->
<el-dialog :title="modalTitle" append-to-body v-model="modalBox">
<avue-form :option="modalOption" v-model="modalForm" @submit="modalSubmit" @reset-change="modalCancel"/>
@@ -65,7 +78,7 @@
</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>
- <span v-else-if="tabsType == 'tab2'">鐗堟湰淇℃伅</span>
+ <!--<span v-else-if="tabsType == 'tab2'">鐗堟湰淇℃伅</span>-->
<template v-else-if="tabsType == 'tab3'">
<div v-html="convertToHtml(fileContent)" class="convertToHtml"></div>
</template>
@@ -91,10 +104,10 @@
<el-drawer title="鏇挎崲" append-to-body v-model="todolistModel" size="100%" class="code-box">
<div class="approve-box">
<div class="left">
- <TodolistLeft :row="row" :replaceDataId="replaceDataId" :drawingNo="drawingNo" :processNo="processNo" @selection-change="todoSelectionChange" />
+ <TodolistLeft :row="row" :replaceDataId="replaceDataId" :drawingNo="drawingNo" :processNo="processNo" :processEdition="processEdition" @selection-change="todoSelectionChange" />
</div>
<div class="right">
- <TodolistRightTop :row="row" />
+ <TodolistRightTop :row="row" :name="name" />
<avue-form ref="form" :option="optionApprove" v-model="formApprove" @submit="handleSubmit" />
</div>
</div>
@@ -113,8 +126,19 @@
data() {
let rejectText = '椹冲洖';//+this.row.categoryName;
return {
+ treeSearchLoad: false,
+ drawingNoList: [],
+ searchLoading: false,
+ searchTreeData: {
+ programStatus: [],
+ drawingNo: "",
+ createTime: [],
+ createTimeBegin: "",
+ createTimeEnd: ""
+ },
drawingNo: '',
processNo: '',
+ processEdition: '',
replaceDataId: "",
formApprove: {
title: '',
@@ -209,22 +233,22 @@
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'
@@ -261,25 +285,25 @@
prop: 'createTime',
disabled: true,
placeholder: " "
- },
+ },/*
{
label: '鑺傜偣鎻忚堪',
prop: 'description',
disabled: true,
placeholder: " "
- },
+ },*/
{
label: '淇敼鏃堕棿',
prop: 'updateTime',
disabled: true,
placeholder: " "
- },
+ }/*,
{
label: '澶囨敞',
prop: 'remark',
disabled: true,
placeholder: " "
- }
+ }*/
]
},
tabsForm: {},
@@ -342,10 +366,6 @@
modalTitle: "",
id: "",
parentId:1,
- search: {
- name: "",
- nodeType: ""
- },
loading: true,
mypage: {
size: 10,
@@ -411,7 +431,7 @@
return '';
}
}
- },
+ },/*
{
label: '鐗堟',
prop: 'processEdition',
@@ -426,16 +446,16 @@
{
label: '鎻忚堪',
prop: 'abc'
- },
+ },*/
{
label: '绫诲瀷',
prop: 'nodeTypeName'
- },
+ },/*
{
label: '璁惧',
prop: 'machineCode'
},
-
+ */
{
label: '閿佸畾鐘舵��',
prop: 'isLocked',
@@ -458,25 +478,30 @@
//闈炵▼搴忚妭鐐�
return '';
}else{
- if(value==0||value==null){
+ if(value==0||value==-1){
return '鏈惎鍔�';
}else if(value == 1){
return '瀹℃壒涓�';
}else if(value == 2){
return '宸查�氳繃';
}else{
- return '鏈畾涔�';
+ return '';
}
}
},
- },
+ },/*
{
label: '娴嬭瘯绋嬪簭',
prop: 'abc'
- },
+ },*/
{
label: '鍒涘缓浜�',
prop: 'createUserName',
+ width: '180'
+ },
+ {
+ label: '鍒涘缓鏃堕棿',
+ prop: 'createTime',
width: '180'
}
],
@@ -486,6 +511,7 @@
};
},
computed: {
+ ...mapGetters(['userInfo', 'permission']),
uploadmodalOption() {
return {
submitText: "淇濆瓨",
@@ -623,27 +649,93 @@
},
methods: {
+ disabledDate(time) {
+ //涓嶉渶瑕佺鐢ㄦ棩鏈�
+ // 鑾峰彇褰撳墠鏃ユ湡
+ const today = new Date();
+ today.setHours(0, 0, 0, 0); // 璁剧疆涓哄綋澶╁紑濮嬫椂闂�
+
+ // 鑾峰彇涓変釜鏈堝墠鐨勬棩鏈�
+ const threeMonthsAgo = new Date();
+ threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
+ threeMonthsAgo.setHours(0, 0, 0, 0);
+
+ // 绂佺敤浠婂ぉ涔嬪悗鐨勬棩鏈� 鍗冲彲
+ return time.getTime() > today.getTime() || time.getTime() < threeMonthsAgo.getTime();//
+ },
+ createTimeChange(value) {
+ console.log('createTimeChange',value)
+ this.searchTreeData.createTimeBegin = value[0];
+ this.searchTreeData.createTimeEnd = value[1];
+ },
+ remoteMethod(query) {
+ if (query) {
+ this.searchLoading = true;
+ axios({
+ url: '/blade-mdm/program/node/drawing-no-pick',
+ method: 'get',
+ params: {drawingNo: query}
+ }).then(resp => {
+ this.searchLoading = false;
+ var drawingNoList = [];
+ resp.data.data.forEach(item=> {
+ drawingNoList.push({label: item,value: item})
+ })
+ 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攣' : '閿佸畾'}`, {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ }).then(() => {
+ axios({
+ url: isLock ? '/blade-mdm/flow/lock/start-unlock' : '/blade-mdm/program/node/lock',
+ method: 'post',
+ params: {id: row.id,nodeId: row.id}
+ }).then(res => {
+ if(res.data.code == 200) {
+ this.$message({type: 'success',message: '鎿嶄綔鎴愬姛!'});
+ this.addLocalTreeNode(row.parentId);
+ }else {
+ this.$message({type: 'success',message: res.data.msg});
+ }
+ });
+ }).catch(action=>{
+ console.log('cancel')
+ });
+ },
handleSubmit(form, done) {
//鍙戣捣绋嬪簭鏇挎崲娴佺▼
var obj = {
title: this.formApprove.title,
nodeId: this.id,
tempInstanceId: this.replaceDataId,
+ comment: this.formApprove.comment,
assignee: this.formApprove.assignee
}
axios({
url: '/blade-mdm/flow/replace/start',
method: 'post',
data: obj
- }).then(
- resp => {
- this.$message({
- type: 'success',
- message: '鎿嶄綔鎴愬姛!',
+ }).then(resp => {
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!',
+ });
+ done();
+ this.todolistModel = false;
+ }).catch(error =>{
+ window.console.log('haha',error);
+ done();
});
- done();
- this.todolistModel = false;
- });
// if(this.row.taskDefinitionKey === 'programmingTask') {
// // if(this.applist.length !== 1) {
// // done();
@@ -684,13 +776,29 @@
url: '/blade-mdm/flow/replace/pre',
method: 'post',
params: {nodeId: row.id}
- }).then(
- resp => {
+ }).then(resp => {
this.row = row;
this.replaceDataId = resp.data.data.processInstanceId;
this.processNo = resp.data.data.processNo;
- this.drawingNo = resp.data.data.drawingNo;
+ this.processEdition = resp.data.data.processEdition;
+ this.drawingNo = resp.data.data.drawingNo;
+ this.formApprove.title = resp.data.data.name + "鏇挎崲";
+ this.getHandler(); //鑾峰彇澶勭悊浜�
this.todolistModel = true;
+ });
+ },
+ getHandler() { //鑾峰彇澶勭悊浜�
+ axios({
+ url: '/blade-mdm/flow/replace/default-assignees',
+ method: 'get',
+ params: {drawingNo: this.drawingNo}
+ }).then(
+ resp => {
+ if(resp.data.code == 200) {
+ this.formApprove.assignee = resp.data.data.checkerId;
+ }else {
+ this.$message.success(resp.msg);
+ }
});
},
convertToHtml(text) {
@@ -701,9 +809,13 @@
if (node.children && node.children.length > 0) {
node.children = this.removeHasChildren(node.children);
}
+ if(node.children.length > 0) {
+ const { hasChildren, ...rest } = node;
+ return rest;
+ } else {
+ return node;
+ }
// 鍒犻櫎褰撳墠鑺傜偣鐨� hasChildren 灞炴��
- const { hasChildren, ...rest } = node;
- return rest;
});
},
// 閫掑綊鏌ユ壘鐩爣琛岋紙name="鏈哄簥1"锛�
@@ -720,23 +832,30 @@
return null; // 鏈壘鍒�
},
highlightTargetRow() { // 楂樹寒鐩爣琛�
- const targetName = this.search.name;
+ const targetName = this.searchTreeData.drawingNo;
this.targetRow = this.findTargetRow(this.treeData, targetName);
if (this.targetRow && this.$refs.crud) {
this.$refs.crud.setCurrentRow(this.targetRow); // 楂樹寒鐩爣琛�
}
},
searchTree() {
+ if(this.searchTreeData.programStatus.length == 0) return;
+ if(this.searchTreeData.drawingNo == "") return;
+ this.treeSearchLoad = true;
+ this.searchTreeData.status = this.searchTreeData.programStatus.join();
axios({
- url: '/blade-mdm/program/node/search-list',
+ url: '/blade-mdm/program/node/search-list2',
method: 'get',
- params: this.search,
+ params: this.searchTreeData
}).then(res => {
- this.option.defaultExpandAll = true;
+ this.treeSearchLoad = false;
+ if(res.data.data.length == 0) return;
+ this.option.defaultExpandAll = true;聽
this.treeData = this.removeHasChildren(res.data.data);
this.$nextTick(() => {
this.highlightTargetRow(); // 璁剧疆褰撳墠琛岄珮浜�
this.tabsForm = this.targetRow; //tabs鑺傜偣淇℃伅
+ if(this.tabsForm == null) return;
this.nodeTypeList.forEach(item=> {
if(item.dictKey == this.tabsForm.nodeType) {
this.tabsForm.nodeTypeName = item.dictValue;
@@ -750,6 +869,14 @@
},
setClearTree() {
this.option.defaultExpandAll = false;
+ this.searchTreeData = {
+ programStatus: [],
+ status:'',
+ drawingNo: "",
+ createTime: [],
+ createTimeBegin: "",
+ createTimeEnd: ""
+ };
this.treeData = [];
this.$nextTick(()=> {
this.onLoad();
@@ -1109,9 +1236,30 @@
},
getPre() {
alert(1)
- }
+ },
+ subtractMonths(date, months) {
+ const newDate = new Date(date);
+ const currentMonth = newDate.getMonth();
+ newDate.setMonth(currentMonth - months);
+ return newDate;
+ },
+ getBeginDate() {
+ var beginDate = this.subtractMonths(new Date(),3);
+ return `${beginDate.getFullYear()}-${(beginDate.getMonth() + 1).toString().padStart(2, '0')}-${beginDate.getDate().toString().padStart(2, '0')}`;
+ },
+ getToday() {
+ let today = new Date();
+ return `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, '0')}-${today.getDate().toString().padStart(2, '0')}`;
+
+ },
},
mounted() {
+ let b = this.getBeginDate()
+ //this.defaultTimeRange = [b,this.getToday()];
+ let defTimeRange = [b,this.getToday()];
+ this.searchTreeData.createTime = defTimeRange
+ this.createTimeChange(defTimeRange)
+
this.tabsOption = this.tabsOption1;
//鑾峰彇nodetype
axios({url: '/blade-system/dict-biz/dictionary?code=nc_node_type',method: 'get'}).then(res => {
@@ -1123,6 +1271,9 @@
</script>
<style lang="scss">
+.norightmenu .avue-crud .avue-crud__header {
+ display: none !important;
+ }
.delFile {
color: red;
margin-left: 12px;
@@ -1169,4 +1320,20 @@
.code-box .el-drawer__header {
margin-bottom: 0;
}
+ .search-data-title {
+ font-size: 12px;
+ margin-right: 8px;
+ display: inline-block;
+ width: 95px;
+ }
+ .search-data-flex {
+ display: flex!important;
+ align-items: center;
+ }
+ .w68 {
+ width: 68px;
+ }
+ .marginR12 label {
+ margin-right: 12px;
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.3