From f9e41320d5d92af80ba91a070e01c646478fed5b Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期六, 23 八月 2025 10:27:09 +0800
Subject: [PATCH] 增加已固化加锁提示

---
 src/views/wel/shemi.vue |   32 ++++++++++++++++++++++++++------
 1 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/src/views/wel/shemi.vue b/src/views/wel/shemi.vue
index c6272e5..d2b44e9 100644
--- a/src/views/wel/shemi.vue
+++ b/src/views/wel/shemi.vue
@@ -32,7 +32,7 @@
           </el-col>
           <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-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" :disabled-date="disabledDate" @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>
@@ -53,10 +53,11 @@
         <!-- <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="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>
+        <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>
     <!-- 鏂板鑺傜偣 -->
@@ -507,6 +508,7 @@
     };
   },
   computed: {
+    ...mapGetters(['userInfo', 'permission']),
     uploadmodalOption() {
       return {
         submitText: "淇濆瓨",
@@ -644,6 +646,19 @@
     
   },
   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) {
       this.searchTreeData.createTimeBegin = value[0];
       this.searchTreeData.createTimeEnd = value[1];
@@ -667,8 +682,10 @@
         this.drawingNoList = [];
       }
     },
-    locked(row, isLock) {
-      row.isLocked == isLock
+    locked(row, isLockP) {
+      //row.isLocked == isLock
+      var isLock = row.isLocked == 1;
+       console.log('isLock',isLock)
       this.$confirm(`鏄惁${isLock ? '瑙i攣' : '閿佸畾'}`, {
         confirmButtonText: '纭畾',
         cancelButtonText: '鍙栨秷',
@@ -686,6 +703,8 @@
             this.$message({type: 'success',message: res.data.msg});
           }
         });
+      }).catch(action=>{
+        console.log('cancel')
       });
     },
     handleSubmit(form, done) {
@@ -829,6 +848,7 @@
         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;

--
Gitblit v1.9.3