From c1343ffa4bb95941a70ceb8bc64e72d8a982b873 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期五, 22 八月 2025 00:42:22 +0800
Subject: [PATCH] Merge branch 'master' of http://www.beijingsoft.cn:9090/r/mdmweb

---
 src/views/wel/shemi.vue |  144 ++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 116 insertions(+), 28 deletions(-)

diff --git a/src/views/wel/shemi.vue b/src/views/wel/shemi.vue
index 9f20201..52b8eb9 100644
--- a/src/views/wel/shemi.vue
+++ b/src/views/wel/shemi.vue
@@ -17,15 +17,24 @@
     >
       <template #search>
         <el-row :gutter="24">
-          <el-col :span="6">
-            <el-input v-model="search.name" placeholder="璇疯緭鍏ヨ妭鐐瑰悕绉�" clearable/>
+          <el-col :span="8" class="search-data-flex">
+            <span class="search-data-title">绋嬪簭鐘舵��:</span>
+            <el-checkbox-group v-model="searchTreeData.programStatus">
+              <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="8" 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-col :span="8" class="search-data-flex">
+            <span class="search-data-title">鏃堕棿鑼冨洿:</span>
+            <el-date-picker v-model="searchTreeData.createTime" type="daterange" range-separator="To" start-placeholder="寮�濮嬫椂闂�" end-placeholder="缁撴潫鏃堕棿" :size="size" format="YYYY-MM-DD" value-format="YYYY-MM-DD" @change="createTimeChange"/>
+          </el-col>
+          <el-col :span="8">
             <el-button type="primary" @click="searchTree"><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>
@@ -46,7 +55,8 @@
         <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-position" type="primary" @click="downsend(row)" placeholder="涓嬪彂" title="涓嬪彂"></el-button> -->
         <!-- 鏇挎崲 -->
         <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="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="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>
     <!-- 鏂板鑺傜偣 -->
@@ -113,9 +123,18 @@
   data() {
     let rejectText = '椹冲洖';//+this.row.categoryName;
     return {
+      drawingNoList: [],
+      searchLoading: false,
+      searchTreeData: {
+        programStatus: [],
+        drawingNo: "",
+        createTime: [],
+        createTimeBegin: "",
+        createTimeEnd: ""
+      },
       drawingNo: '',
       processNo: '',
-	  processEdition: '',
+	    processEdition: '',
       replaceDataId: "",
       formApprove: {
         title: '',
@@ -343,10 +362,6 @@
       modalTitle: "",
       id: "",
       parentId:1,
-      search: {
-        name: "",
-        nodeType: ""
-      },
       loading: true,
       mypage: {
         size: 10,
@@ -629,28 +644,74 @@
     
   },
   methods: {
+    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, isLock) {
+      row.isLocked == 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});
+          }
+        });
+      });
+    },
     handleSubmit(form, done) {
       //鍙戣捣绋嬪簭鏇挎崲娴佺▼
       var obj = {
         title: this.formApprove.title,
         nodeId: this.id,
         tempInstanceId: this.replaceDataId,
-		comment: this.formApprove.comment,
+		    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();
@@ -691,8 +752,7 @@
         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;
@@ -710,7 +770,11 @@
         params: {drawingNo: this.drawingNo}
       }).then(
       resp => {
-        //console.log(res,9988)
+        if(resp.data.code == 200) {
+          this.formApprove.assignee = resp.data.data.checkerId;
+        }else {
+          this.$message.success(resp.msg);
+        }
       });
     },
     convertToHtml(text) {
@@ -721,9 +785,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"锛�
@@ -747,11 +815,14 @@
       }
     },
     searchTree() {
+      if(this.searchTreeData.programStatus.length == 0) return;
+      if(this.searchTreeData.drawingNo == "") return;
       axios({
         url: '/blade-mdm/program/node/search-list',
         method: 'get',
-        params: this.search,
+        params: this.searchTreeData,
       }).then(res => {
+        if(res.data.data.length == 0) return;
         this.option.defaultExpandAll = true;
         this.treeData = this.removeHasChildren(res.data.data);
         this.$nextTick(() => {
@@ -770,6 +841,13 @@
     },
     setClearTree() {
       this.option.defaultExpandAll = false;
+      this.searchTreeData = {
+        programStatus: [],
+        drawingNo: "",
+        createTime: [],
+        createTimeBegin: "",
+        createTimeEnd: ""
+      };
       this.treeData = [];
       this.$nextTick(()=> {
         this.onLoad();
@@ -1189,4 +1267,14 @@
   .code-box .el-drawer__header {
     margin-bottom: 0;
   }
+  .search-data-title {
+    font-size: 12px;
+    margin-right: 8px;
+    display: inline-block;
+    width: 68px;
+  }
+  .search-data-flex {
+    display: flex!important;
+    align-items: center;
+  }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3