From 3ded1213a0b156fb04f2ffff47e2dc32104e8bb9 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期五, 05 九月 2025 01:13:01 +0800
Subject: [PATCH] 任务提醒,增加导出提醒;
---
src/views/flowmgr/taskassigntemp.vue | 41 +++++++++
src/page/index/top/top-menu.vue | 113 +++++++++++++++++++++++----
src/views/flowmgr/programexport.vue | 4
src/views/flowmgr/taskassign.vue | 44 +++++++++-
src/views/flow/todolist.vue | 23 +++++
5 files changed, 192 insertions(+), 33 deletions(-)
diff --git a/src/page/index/top/top-menu.vue b/src/page/index/top/top-menu.vue
index d18cafa..0a06028 100644
--- a/src/page/index/top/top-menu.vue
+++ b/src/page/index/top/top-menu.vue
@@ -6,24 +6,45 @@
<span>{{ itemHome.name }}</span>
</template>
</el-menu-item>
+
<el-menu-item index="0" @click="openTodo(itemHome)">
<template #title>
- <el-badge :value="logsLen" :max="99" :offset="[10, 15]" class="todoItems">
- <el-tooltip
- class="box-item"
- effect="dark"
- :content="`鎮ㄦ湁${logsLen}鏉′换鍔¢渶瑕佸鐞哷"
- placement="top-start"
- >
- {{ itemTodo.name }}
- </el-tooltip>
- </el-badge>
- <!-- <span >{{ itemTodo.name }}</span>-->
-
-
-
+
+ <el-dropdown>
+ <span class="el-dropdown-link">
+ <el-badge ref="topbadge" :value="remindCount" :max="99" :offset="[10, 0]" :class="{'blink-badge':this.remindCount>0}">
+ <el-tooltip
+ class="box-item"
+ effect="dark"
+ :content="`鎮ㄦ湁${remindCount}鏉′换鍔¢渶瑕佸鐞哷"
+ placement="top-start"
+ >
+ {{ itemTodo.name }}
+ </el-tooltip>
+ </el-badge>
+ </span>
+ <template #dropdown>
+ <el-dropdown-menu>
+
+ <el-dropdown-item v-for="item in remindItems" @click.native="handleRemindClick(item)">{{item.text}}</el-dropdown-item>
+
+ </el-dropdown-menu>
+ </template>
+ </el-dropdown>
</template>
+ <!--
+ <el-dropdown>
+ <template #dropdown>
+ <el-dropdown-menu>
+ <el-dropdown-item>Action 1</el-dropdown-item>
+ <el-dropdown-item>Action 2</el-dropdown-item>
+ </el-dropdown-menu>
+ </template>
+ </el-dropdown>
+ -->
+
+
</el-menu-item>
<template v-for="(item, index) in items" :key="index">
@@ -44,7 +65,7 @@
</style>
<script>
import { mapGetters } from 'vuex';
-import { getList } from '@/api/flow/todolist'; //浠诲姟鎻愰啋
+//import { getList } from '@/api/flow/todolist'; //浠诲姟鎻愰啋
export default {
name: 'top-menu',
data() {
@@ -60,7 +81,10 @@
activeIndex: '0',
items: [],
- logsLen: 0,//浠诲姟鎻愰啋鏁伴噺
+ todoCount:0,
+ exportCount:0,
+ remindCount:0, //鎻愰啋鎬绘暟閲�
+ remindItems:[{text:'娴佺▼浠诲姟',id:"todo"},{text:'瀵煎嚭宸ユ帶缃�',id:"todo1"},],
intervalId : undefined
};
},
@@ -95,23 +119,74 @@
this.items = res;
});
},
+ handleRemindClick(item){
+ console.log(item)
+ if(item.id == 'todo'){
+ this.$router.push({ path: '/flow/todoindex' });
+ }else{
+ this.$router.push({ path: '/flowmgr/programexport' });
+ }
+ },
openTodo() {
this.$router.push({ path: '/flow/todoindex' });
//this.box = false;
},
+
getCount() {
+ axios({
+ url: '/blade-mdm/remind/task-count',
+ method: 'get',
+ params: {},
+ }).then(
+ res => {
+ if(res.data.code == 200){
+ this.todoCount = res.data.data.todoCount;
+ this.exportCount = res.data.data.exportCount;
+ this.remindCount = this.todoCount + this.exportCount;
+ this.setRemindItems();
+
+ }
+ },
+ error => {
+ console.log(error);
+ }
+ );
+ /*
try{
- getList(1,10).then((res) => {
- this.logsLen = res.data.data.total;
+ getList(1,1).then((res) => {
+ this.todoCount = res.data.data.total;
+ this.remindCount = this.todoCount + this.exportCount;
+ this.setRemindItems();
this.dataList = res.data.data.records;
+
}).catch(e=>{
- console.log('3333',this.intervalId)
+
clearInterval(this.intervalId);
});
}catch(e2){
console.log('e2',e2);
+ }*/
+ },
+
+ setRemindItems(){
+ this.remindItems=[];
+ if(this.todoCount>0){
+ this.remindItems.push({text:'娴佺▼浠诲姟('+this.todoCount+")",id:'todo'})
+ }
+ if(this.exportCount>0){
+ this.remindItems.push({text:'宸ユ帶缃戝鍑�('+this.exportCount+")",id:'export'})
}
}
},
};
</script>
+<style lang="css">
+@keyframes blink {
+ 0% { opacity: 1; }
+ 50% { opacity: 0.3; }
+ 100% { opacity: 1; }
+}
+.blink-badge .el-badge__content {
+ animation: blink 2s infinite;
+}
+</style>
diff --git a/src/views/flow/todolist.vue b/src/views/flow/todolist.vue
index eebc374..48105a5 100644
--- a/src/views/flow/todolist.vue
+++ b/src/views/flow/todolist.vue
@@ -16,7 +16,7 @@
</template>
<template #menu="scope">
<el-button type="primary" text size="default" @click.stop="handleAction(scope.row, scope.index)">
- {{scope.row.taskDefinitionKey === 'teamLeaderTask' ? '娲惧伐' : '瀹℃壒'}}
+ {{approveButtonText(scope.row.taskDefinitionKey)}}
</el-button>
</template>
</avue-crud>
@@ -428,7 +428,26 @@
});
},
methods: {
-
+ approveButtonText(taskDefinitionKey){
+ let lower = taskDefinitionKey.toLowerCase();
+ if(taskDefinitionKey === 'teamLeaderTask') {
+ return '娲惧伐'
+ }else if(taskDefinitionKey == 'unlockProgramConfirm') {
+ //瑙i攣锛岀紪鍒跺鏍�
+ return '澶嶆牳'
+ }else if(taskDefinitionKey == 'programMgrConfirm') {
+ //鍥哄寲锛岀▼搴忕鐞嗗憳纭
+ return '纭'
+ }else if(lower.indexOf('program')>-1) {
+ return '缂栧埗'
+ }else if(lower.indexOf('check')>-1) {
+ return '鏍″'
+ }else if(lower.indexOf('useable')>-1) {
+ return '妫�鏌�'
+ }else{
+ return '瀹℃壒'
+ }
+ },
setApproveBtn (row) { // 璁剧疆瀹℃壒缁撴灉鐨勭姸鎬�
// 1.瀹℃壒鐣岄潰radio鏂囨湰淇敼锛屾櫘閫氳妭鐐圭殑2涓猺adio鏂囨湰 閫氳繃锛坅pprove=Y),涓嶉�氳繃(鐜板湪鐨勯┏鍥�)(approve=N)
diff --git a/src/views/flowmgr/programexport.vue b/src/views/flowmgr/programexport.vue
index df6c95c..9925ff4 100644
--- a/src/views/flowmgr/programexport.vue
+++ b/src/views/flowmgr/programexport.vue
@@ -46,6 +46,7 @@
import NProgress from 'nprogress';
import { exportBlobPost } from '@/api/common';
import { getToken } from '@/utils/auth';
+ import {todoChangeNotify} from '@/api/flow/todolist';
import { downloadFile } from '@/utils/util';
export default {
name: 'programexport',
@@ -336,8 +337,6 @@
).then(res => {
console.log('status='+res.status)
if(res.status == 200){
- //console.log(res.data);
-
let name = res.headers['content-disposition'].split('filename=')[1]
name = decodeURI(name)
//console.log(res.headers['content-disposition'].split('filename=')[1]);
@@ -347,6 +346,7 @@
this.$message.error('瀵煎嚭閿欒');
console.log(res);
}
+ todoChangeNotify();
NProgress.done();
this.onLoad(this.page, this.query);
});
diff --git a/src/views/flowmgr/taskassign.vue b/src/views/flowmgr/taskassign.vue
index 5096daf..713fd57 100644
--- a/src/views/flowmgr/taskassign.vue
+++ b/src/views/flowmgr/taskassign.vue
@@ -15,6 +15,13 @@
:data="treeData" :props="defaultProps">
</el-tree-select>
</template>
+ <template #drawingNo="{}">
+ <el-autocomplete v-model="attachForm.drawingNo"
+ :fetch-suggestions="querySearchAsync"
+ :trigger-on-focus="false" @select="handleSelect"
+ >
+ </el-autocomplete>
+ </template>
</avue-form>
</basic-container>
</template>
@@ -45,10 +52,6 @@
},
},
data() {
-
- //var isTempFlow = getQueryString("isTempFlow");
- //isTempFlow = isTempFlow === 'Y'?'Y':'N';
-
var that = this;
return {
form: {},
@@ -60,7 +63,7 @@
disabled: (data) => data.nodeType!=='machine',//浠呮満搴婅妭鐐瑰彲閫�
isLeaf: (data) => !data.hasChildren
},
-
+ timeout:0, //闆朵欢鍙峰姞杞界殑timeout
attachOption: {
labelWidth: 160,
submitBtn: true,
@@ -177,7 +180,6 @@
prop: 'machineCode',
type: 'select',
rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
-
span: 12
},
{
@@ -268,7 +270,35 @@
// 濡傛灉鏃笉鏄痬achine鑺傜偣涔熸病鏈夊瓙鑺傜偣锛岀洿鎺ヨ繑鍥炲師鑺傜偣
return node;
},
-
+ querySearchAsync(query, cb) {//闆剁粍浠跺彿鎼滅储寤鸿
+ axios({
+ url: '/blade-mdm/producedivision/select-data',
+ method: 'get',
+ params: {drawingNo: query},
+ }).then(
+ res => {
+ if(res.data.code == 200){
+ let list = res.data.data;
+ for(let i of list){
+ i.value = i.ljh;
+ }
+
+ clearTimeout(this.timeout)
+ this.timeout = setTimeout(() => {
+ cb(list);
+ }, 1000)
+
+ }
+ },
+ error => {
+ console.log(error);
+ }
+ );
+
+ },
+ handleSelect(item) {
+ this.attachForm.productModel = item.cph;
+ },
handleTrim(col){
//console.log(col)
let value = this.attachForm[col.column.prop];
diff --git a/src/views/flowmgr/taskassigntemp.vue b/src/views/flowmgr/taskassigntemp.vue
index 996860e..febe607 100644
--- a/src/views/flowmgr/taskassigntemp.vue
+++ b/src/views/flowmgr/taskassigntemp.vue
@@ -15,14 +15,18 @@
:data="treeData" :props="defaultProps">
</el-tree-select>
</template>
+ <template #drawingNo="{}">
+ <el-autocomplete v-model="attachForm.drawingNo"
+ :fetch-suggestions="querySearchAsync"
+ :trigger-on-focus="false" @select="handleSelect"
+ >
+ </el-autocomplete>
+ </template>
</avue-form>
</basic-container>
</template>
<script>
-import {
- getQueryString,
-} from '@/utils/util';
export default {
watch: {
@@ -56,6 +60,7 @@
disabled: (data) => data.nodeType!=='machine',//浠呮満搴婅妭鐐瑰彲閫�
isLeaf: (data) => !data.hasChildren
},
+ timeout:0, //闆朵欢鍙峰姞杞界殑timeout
machineCodeList: [],
attachOption: {
labelWidth: 160,
@@ -246,6 +251,36 @@
// 濡傛灉鏃笉鏄痬achine鑺傜偣涔熸病鏈夊瓙鑺傜偣锛岀洿鎺ヨ繑鍥炲師鑺傜偣
return node;
},
+ querySearchAsync(query, cb) {//闆剁粍浠跺彿鎼滅储寤鸿
+
+ axios({
+ url: '/blade-mdm/producedivision/select-data',
+ method: 'get',
+ params: {drawingNo: query},
+ }).then(
+ res => {
+ if(res.data.code == 200){
+ let list = res.data.data;
+ for(let i of list){
+ i.value = i.ljh;
+ }
+
+ clearTimeout(this.timeout)
+ this.timeout = setTimeout(() => {
+ cb(list);
+ }, 1000)
+
+ }
+ },
+ error => {
+ console.log(error);
+ }
+ );
+
+ },
+ handleSelect(item) {
+ this.attachForm.productModel = item.cph;
+ },
handleTrim(col){
//console.log(col)
let value = this.attachForm[col.column.prop];
--
Gitblit v1.9.3