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 | 136 ++++++++++++++++++++++++++++++++++++++------
1 files changed, 116 insertions(+), 20 deletions(-)
diff --git a/src/views/flowmgr/taskassigntemp.vue b/src/views/flowmgr/taskassigntemp.vue
index ccbf89b..febe607 100644
--- a/src/views/flowmgr/taskassigntemp.vue
+++ b/src/views/flowmgr/taskassigntemp.vue
@@ -8,14 +8,25 @@
-->
<template>
<basic-container>
- <avue-form ref="form" :option="attachOption" v-model="attachForm" @submit="formSubmit"></avue-form>
+ <avue-form ref="form" :option="attachOption" v-model="attachForm" @submit="formSubmit">
+ <template #machineCode="{}">
+ <el-tree-select ref="tree" filterable v-model="attachForm.machineCode"
+ node-key="machineCode"
+ :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: {
@@ -42,6 +53,14 @@
var that = this;
return {
form: {},
+ treeData: [],
+ defaultProps: {
+ children: 'children',
+ label: 'name',
+ disabled: (data) => data.nodeType!=='machine',//浠呮満搴婅妭鐐瑰彲閫�
+ isLeaf: (data) => !data.hasChildren
+ },
+ timeout:0, //闆朵欢鍙峰姞杞界殑timeout
machineCodeList: [],
attachOption: {
labelWidth: 160,
@@ -146,17 +165,8 @@
label: '鍔犲伐鏈哄簥',
prop: 'machineCode',
type: 'select',
- filterable: true,
- dicUrl: `/blade-mdm/machine/page?size=10000`,
- dicFormatter: function (res) {
- that.machineCodeList = res.data.records;
- return res.data.records;
- },
rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
- props: {
- label: 'code',
- value: 'code',
- },
+
span: 12
},
{
@@ -190,10 +200,87 @@
}
],
},
- attachForm: {planLockDays:7},//榛樿7澶�
+ attachForm: {planLockDays:7,planStartTime: this.$dayjs().format('YYYY-MM-DD')},//榛樿7澶�
+ defaultForm: {planLockDays:7,planStartTime: this.$dayjs().format('YYYY-MM-DD')},
};
},
methods: {
+ treeLoad () {
+ axios({
+ url: '/blade-mdm/gkw/node/load-tree',
+ method: 'get',
+ }).then(
+ res => {
+ this.treeData = this.filterTreeData(res.data.data);
+ var firstIndex = 0;
+ res.data.data.forEach((item,index)=> {
+ if(item.children.length != 0) {
+ firstIndex = index;
+ }
+ })
+ //defaultKeys.push(item.id);
+ this.defaultKeys = [res.data.data[firstIndex].id];
+ }
+ )
+ },
+ filterTreeData(oriTreeData){
+ var roots = [];
+ for(var i=0;i<oriTreeData.length;i++){
+ roots.push(this.filterTreeNodes(oriTreeData[i]));
+ }
+ return roots;
+ },
+ filterTreeNodes(node) {
+ // 濡傛灉褰撳墠鑺傜偣鐨刵odeType鏄�'machine'锛屽垯娓呴櫎鍏跺瓙鑺傜偣
+ if (node.nodeType === 'machine') {
+ // 鍒涘缓涓�涓柊瀵硅薄锛屽鍒跺綋鍓嶈妭鐐圭殑灞炴�э紝浣嗘竻闄hildren
+ return {
+ ...node,
+ children: []
+ };
+ }
+
+ // 濡傛灉褰撳墠鑺傜偣鏈夊瓙鑺傜偣锛岄�掑綊澶勭悊姣忎釜瀛愯妭鐐�
+ if (node.children && node.children.length > 0) {
+ return {
+ ...node,
+ children: node.children.map(child => this.filterTreeNodes(child))
+ };
+ }
+
+ // 濡傛灉鏃笉鏄痬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];
@@ -219,11 +306,17 @@
data: form,
}).then(
res => {
- this.$message({
- type: 'success',
- message: '鎿嶄綔鎴愬姛!',
- });
- this.$refs.form.resetForm();
+ if(res.data.code == 200){
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!',
+ });
+ this.$refs.form.resetForm();
+ this.attachForm = this.defaultForm;
+
+ }else{
+ this.$alert(res.data.msg, '鍙戣捣浠诲姟澶辫触',{type:'error',confirmButtonText:'鍏抽棴'});
+ }
done();
},
error => {
@@ -233,6 +326,9 @@
);
}
},
+ mounted() {
+ this.treeLoad();
+ },
};
</script>
--
Gitblit v1.9.3