From 6ec5099ef65c0e0dc4b1fae5f69eb70dc54dd2b0 Mon Sep 17 00:00:00 2001
From: zjh <2207896513@qq.com>
Date: 星期一, 10 十一月 2025 21:46:33 +0800
Subject: [PATCH] 首检代码提交

---
 pages/QC/SJ/List.vue |  229 +++++++++++++++++++++++++++++++++------------------------
 1 files changed, 133 insertions(+), 96 deletions(-)

diff --git a/pages/QC/SJ/List.vue b/pages/QC/SJ/List.vue
index 6a25c8b..2032d68 100644
--- a/pages/QC/SJ/List.vue
+++ b/pages/QC/SJ/List.vue
@@ -57,31 +57,53 @@
 
           <view class="info-row">
             <view class="info-item">
+              <view class="info-label">椤圭洰</view>
+              <view class="info-content">{{ item.projecT_CODE }}</view>
+            </view>
+            <view class="info-item">
+              <view class="info-label">寮�宸ョ姸鎬�</view>
+              <view class="info-content">{{ item.daa018 }}</view>
+            </view>
+			<view class="info-item">
+			  <view class="info-label">榻愬鐘舵��</view>
+			  <view class="info-content">{{ item.daA019 }}</view>
+			</view>
+          </view>
+		<view class="info-row">
+            <view class="info-item">
               <view class="info-label">浜х嚎</view>
               <view class="info-content">{{ item.line }}</view>
             </view>
             <view class="info-item">
-              <view class="info-label">宸ュ崟鏁伴噺</view>
-              <view class="info-content highlight">{{ item.daa008 }}</view>
+              <view class="info-label">宸ュ崟鍙�</view>
+              <view class="info-content">{{ item.daa001 }}</view>
             </view>
+			<view class="info-item">
+			  <view class="info-label">宸ュ崟鏁�</view>
+			  <view class="info-content highlight">{{ item.daa008 }}</view>
+			</view>
           </view>
-
           <view class="info-row">
-            <view class="info-item">
-              <view class="info-label">鍒涘缓浜�</view>
+            <!-- <view class="info-item">
+              <view class="info-label">鍒涘缓浜�1</view>
               <view class="info-content">{{ item.fName }}</view>
-            </view>
-            <view v-if="item.statusUser" class="info-item">
+            </view> -->
+           <!-- <view v-if="item.statusUser" class="info-item">
               <view class="info-label">妫�楠屼汉</view>
               <view class="info-content">{{ item.statusUser }}</view>
-            </view>
+            </view> -->
           </view>
 
           <!-- 鍦ㄦ湭瀹屾垚鐘舵�佷笅鏄剧ず鍒涘缓鏃堕棿锛屽凡瀹屾垚鐘舵�佷笅鏄剧ず妫�娴嬬粨鏋� -->
           <view v-if="current === 0" class="meta-info">
-            <view class="meta-item">{{ item.statusDate }}</view>
+            
             <view class="meta-item">鍒涘缓浜�: {{ item.fName }}</view>
+			<view class="meta-item">妫�楠屼汉: {{ item.statusUser }}</view>
           </view>
+		  
+		  <view v-if="current === 0" class="meta-info">
+		  	<view class="meta-item">鍒涘缓鏃堕棿: {{ item.createTime }}</view>
+		  </view>
 
           <view v-if="current === 1" class="meta-info">
             <view class="meta-item">{{ item.statusDate }}</view>
@@ -90,7 +112,9 @@
         </view>
 
         <view class="card-actions">
-          <button class="primary">{{ current === 0 ? '缁х画妫�楠�' : '鏌ョ湅璇︽儏' }}</button>
+			<button v-if="current === 0 && IQCJL==1"
+				@click.stop="assignTask(item)">{{item.statusUser == null ? '鍒嗛厤' : '閲嶆柊鍒嗛厤'}}</button>
+          <button class="primary">{{ current === 0 ? '寮�濮嬫楠�' : '鏌ョ湅璇︽儏' }}</button>
         </view>
       </view>
     </view>
@@ -104,7 +128,6 @@
 
 <script>
 export default {
-  components: {},
   data() {
     return {
       items: ['鏈畬鎴�', '宸插畬鎴�'],
@@ -114,73 +137,96 @@
       limit: 20,
       totalPage: 0,
       totalCount: 0,
-      noData: false, // 娌℃湁鏇村鏁版嵁浜�
-      isLoading: false, // 鏄惁姝e湪鍔犺浇
-      tipShow: false, // 鏄惁鏄剧ず椤堕儴鎻愮ず妗�
+      noData: false,
+      isLoading: false,
+      tipShow: false,
       searchValue: '',
       uncheckedCount: 0,
-      checkedCount: '宸插畬鎴�'
+      checkedCount: '宸插畬鎴�',
+      IQCJL: 0, // IQC 妫�楠屽憳鏍囪瘑
+	  userId:""
     };
   },
-  onLoad() {
-    //椤甸潰鍔犺浇鏃惰皟鐢ㄧ殑浜嬩欢
-    this.init();
-  },
-  methods: {
-    init() {
-      let result = "鏈畬鎴�";
-      if (this.current === 1) {
-        result = "宸插畬鎴�";
-      }
 
-      if (this.isLoading) return; // 濡傛灉姝e湪鍔犺浇鍒欎笉缁х画鎵ц
+  // 椤甸潰鍔犺浇鏃跺彧鎵ц涓�娆�
+  async onLoad() {
+    // 鍒ゆ柇褰撳墠鐧诲綍浜烘槸鍚︿负IQC妫�楠屽憳鎴栫壒瀹氳处鍙�
+    const user = this.$loginInfo;
+	this.userId=user.account;
+    if (user.roleid && user.roleid.indexOf("90134") !== -1 || user.account === "PL017") {
+      this.IQCJL = 1;
+    } else {
+      this.IQCJL = 0;
+    }
+
+    console.log("IQC妫�楠屽憳鏍囪瘑 IQCJL =", this.IQCJL);
+
+    // 鍒濆鍖栧姞杞芥暟鎹�
+    await this.init();
+  },
+
+  // 姣忔椤甸潰閲嶆柊鏄剧ず鏃惰Е鍙戯紙杩斿洖椤甸潰涔熶細瑙﹀彂锛�
+  onShow() {
+    console.log("onShow 瑙﹀彂锛孖QCJL =", this.IQCJL);
+    // 閬垮厤閲嶅鍔犺浇锛氬彧鍦ㄧ涓�娆℃垨鏁版嵁涓虹┖鏃堕噸鏂板姞杞�
+    if (this.data.length === 0) {
+      this.pageIndex = 1;
+      this.init();
+    }
+  },
+
+  methods: {
+    async init() {
+      let result = this.current === 1 ? "宸插畬鎴�" : "鏈畬鎴�";
+      if (this.isLoading) return;
 
       this.isLoading = true;
+      const userName = this.$loginInfo.account;
 
-      //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴�
-      let userName = this.$loginInfo.account;
-
-      //椤甸潰鍔犺浇鏃惰皟鐢ㄧ殑浜嬩欢
-      this.$post({
-        url: "/SJ/GetPage",
-        data: {
-          pageIndex: this.pageIndex,
-          limit: this.limit,
-          statusUser: userName,
-          result: result,
-          searchValue: this.searchValue
-        }
-      }).then(res => {
-        if (this.pageIndex === 1) {
-          // 濡傛灉鏄涓�椤碉紝鐩存帴瑕嗙洊鍘熸暟鎹�
-          this.data = res.data.tbBillList;
-        } else {
-          if (res.data.tbBillList.length > 0) {
-            // 濡傛灉鏄笅涓�椤碉紝杩藉姞鏂版暟鎹�
-            this.data = [...this.data, ...res.data.tbBillList];
+      try {
+        const res = await this.$post({
+          url: "/SJ/GetPage",
+          data: {
+            pageIndex: this.pageIndex,
+            limit: this.limit,
+            statusUser: userName,
+            result: result,
+            searchValue: this.searchValue
           }
+        });
+
+        const list = res.data.tbBillList || [];
+        if (this.pageIndex === 1) {
+          this.data = list;
+        } else {
+          this.data.push(...list);
         }
+
         this.totalCount = res.totalCount;
         this.totalPage = Math.ceil(this.totalCount / this.limit);
-
         this.noData = this.pageIndex >= this.totalPage;
-        this.isLoading = false; // 缁撴潫鍔犺浇
 
-        // 鏇存柊璁℃暟
         if (this.current === 1) {
           this.checkedCount = '宸插畬鎴愶紙' + this.totalCount + '锛�';
         } else {
           this.uncheckedCount = this.totalCount;
         }
-      }).catch(() => {
-        this.isLoading = false; // 鍑虹幇閿欒鏃剁粨鏉熷姞杞�
-      });
+
+      } catch (e) {
+        console.error("鍔犺浇妫�楠屽崟鏁版嵁澶辫触:", e);
+      } finally {
+        this.isLoading = false;
+      }
     },
-    handleFabClick() {
-      uni.navigateTo({
-        url: 'Add?id'
-      });
+
+    // 鎼滅储
+    handleSearch() {
+      this.pageIndex = 1;
+      this.data = [];
+      this.init();
     },
+
+    // Tab 鍒囨崲
     onClickItem(index) {
       if (this.current !== index.currentIndex) {
         this.current = index.currentIndex;
@@ -189,59 +235,50 @@
         this.init();
       }
     },
-    handleSearch() {
-      this.pageIndex = 1;
-      this.data = [];
-      this.init();
-    },
+
+    // 璺宠浆璇︽儏
     navigateToDetail(item) {
-		if (this.current === 1) {
-		 uni.navigateTo({
-		   url: 'Add?id=' + item.id + '&billNo=' + item.billNo+
-							'&current=B'
-		 });
-		}else{
-			uni.navigateTo({
-			  url: 'Add?id=' + item.id + '&billNo=' + item.billNo+
-										'&current=A'
-			});
-		}
-    
+      const type = this.current === 1 ? "B" : "A";
+      uni.navigateTo({
+        url: `Add?id=${item.id}&billNo=${item.billNo}&current=${type}`
+      });
+    },
+	assignTask(item) {
+			console.log(item);
+				// 杩欓噷鍙互娣诲姞鍒嗛厤浠诲姟鐨勯�昏緫
+				uni.navigateTo({
+					url: 'UpdateCheckBy?releaseNo=' + item.billNo + '&userID=' + this.userId +
+						'&staffName=' + item.statusUser
+				});
+			},
+    // 娣诲姞鎸夐挳
+    handleFabClick() {
+      uni.navigateTo({
+        url: 'Add?id'
+      });
     }
   },
-  /**
-   * 涓嬫媺鍒锋柊鍥炶皟鍑芥暟
-   */
+
+  // 涓嬫媺鍒锋柊
   onPullDownRefresh() {
     this.pageIndex = 1;
-    //閲嶆柊鎵ц涓�閬嶆煡璇�
-    this.init();
-    this.tipShow = true;
-    //鍏抽棴鍔ㄧ敾
-    uni.stopPullDownRefresh();
-
-    setTimeout(() => {
-      this.tipShow = false;
-    }, 3000);
+    this.init().then(() => {
+      this.tipShow = true;
+      uni.stopPullDownRefresh();
+      setTimeout(() => (this.tipShow = false), 3000);
+    });
   },
-  /**
-   * 涓婃媺鍔犺浇鍥炶皟鍑芥暟
-   */
+
+  // 涓婃媺鍔犺浇鏇村
   onReachBottom() {
     if (this.noData || this.isLoading) return;
     this.pageIndex++;
-    this.init(); // 鍔犺浇鏇村鏁版嵁
-  },
-  onShow() {
-    //姣忔杩涘叆椤甸潰閮戒細鎵ц鐨勬柟娉�
-    this.pageIndex = 1;
-    this.data = [];
-    //this.current = 0
     this.init();
   }
 };
 </script>
 
+
 <style scoped>
 /* 鍩虹鏍峰紡閲嶇疆 */
 .inspection-app {

--
Gitblit v1.9.3