From 688505dded0a49ee685abcb980bd0dc521df4241 Mon Sep 17 00:00:00 2001
From: xwt <2740516069@qq.com>
Date: 星期四, 18 九月 2025 22:57:36 +0800
Subject: [PATCH] SJ,XJ,RKJ
---
pages/QC/XJ/Add.vue | 724 ++++++++++++++++++++++++++++++++-----------------------
1 files changed, 424 insertions(+), 300 deletions(-)
diff --git a/pages/QC/XJ/Add.vue b/pages/QC/XJ/Add.vue
index 8819d00..91a2133 100644
--- a/pages/QC/XJ/Add.vue
+++ b/pages/QC/XJ/Add.vue
@@ -4,6 +4,11 @@
<view class="sheet-header">
<h1>宸℃鍗�</h1>
<view class="inspection-number">妫�楠屽崟鍙凤細{{formData.releaseNo}}</view>
+ <!-- 鍔犺浇鎸囩ず鍣� -->
+ <view v-if="isLoading" class="loading-indicator">
+ <view class="loading-spinner"></view>
+ <span>鍔犺浇涓�...</span>
+ </view>
</view>
<!-- 鍩烘湰淇℃伅鍖� -->
@@ -20,27 +25,15 @@
<view class="material-info">
<view class="info-block">
<view class="info-label">绾夸綋缂栧彿锛�</view>
- <view class="info-value" v-if="!isUpdate">{{formData.daa020}}</view>
- <picker v-if="isUpdate" class="picker info-value-input" name="selector" :range="DAA020List"
- @change="onDaa020Change">
- <view>{{ DAA020List[DAA020Index] }}</view>
- </picker>
+ <view class="info-value">{{formData.daa020}}</view>
</view>
<view class="info-block">
<view class="info-label">鐗╂枡缂栫爜锛�</view>
- <view class="info-value" v-if="!isUpdate">{{formData.itemNo}}</view>
- <picker v-if="isUpdate" class="picker info-value-input" name="selector" :range="ItemList"
- @change="onItemChange">
- <view>{{ ItemList[ItemIndex] }}</view>
- </picker>
+ <view class="info-value">{{formData.itemNo}}</view>
</view>
<view class="info-block">
<view class="info-label">璁″垝缂栧彿锛�</view>
- <view class="info-value" v-if="!isUpdate">{{formData.billNo}}</view>
- <picker v-if="isUpdate" class="picker info-value-input" name="selector" :range="DAA001List"
- @change="onDaa001Change">
- <view>{{ DAA001List[DAA001Index] }}</view>
- </picker>
+ <view class="info-value">{{formData.billNo}}</view>
</view>
<view class="info-block">
<view class="info-label">鐗╂枡鍚嶇О锛�</view>
@@ -60,23 +53,18 @@
</view>
</view>
- <!-- 鎿嶄綔鎸夐挳鍖� - 妫�楠岄」鐩幏鍙� -->
- <view class="action-buttons" v-if="isUpdate && !isShowTable">
- <button class="primary-btn" @click="getItem">鍒涘缓妫�楠屽崟</button>
- </view>
-
- <view class="action-buttons" v-if="isShowTable">
- <button class="secondary-btn" @click="getTable">鑾峰彇椤圭洰</button>
- <button v-if="isUpdate" class="primary-btn" @click="saveTable">鐢熸垚椤圭洰</button>
- </view>
+ <!-- 鎿嶄綔鎸夐挳鍖� - 宸茬Щ闄ら噸澶嶇殑鑾峰彇妫�楠岄」鐩寜閽� -->
<!-- 妫�楠岄」鐩〃鏍� -->
- <view class="inspection-table" v-if="tableData.length > 0">
+ <view class="inspection-table">
<!-- 琛ㄦ牸澶撮儴缁熻淇℃伅 -->
<view class="table-header-stats">
<view class="stats-left">
<view class="stats-title">妫�楠岄」鐩竻鍗�</view>
<view class="stats-subtitle">鍏� {{tableData.length}} 涓楠岄」鐩�</view>
+ <view class="submit-status" :class="{'can-submit': canSubmit, 'cannot-submit': !canSubmit}">
+ {{canSubmit ? '鉁� 鍙互鎻愪氦' : '鉁� 妫�楠屾湭瀹屾垚锛屾棤娉曟彁浜�'}}
+ </view>
</view>
<view class="stats-right">
<view class="stat-item passed">
@@ -93,7 +81,7 @@
</view>
</view>
</view>
- <table>
+ <table v-if="tableData.length > 0">
<thead>
<tr>
<th width="15%" style="text-align: center;">妫�楠岄」鐩�</th>
@@ -136,26 +124,38 @@
</tr>
</tbody>
</table>
+ <!-- 绌虹姸鎬佹樉绀� -->
+ <view v-else class="empty-state">
+ <view class="empty-icon">馃搵</view>
+ <view class="empty-text">鏆傛棤妫�楠岄」鐩�</view>
+ <view class="empty-desc">璇ユ楠屽崟杩樻病鏈夋楠岄」鐩�</view>
+ </view>
</view>
- <!-- 鎿嶄綔鎸夐挳鍖� - 搴曢儴鎿嶄綔 -->
- <view class="action-buttons" v-if="!isUpdate && !isShowTable">
- <button class="secondary-btn" @click="toImage">鍥剧墖绠$悊</button>
- <button class="secondary-btn" @click="saveRemarks">娣诲姞鎻忚堪</button>
- <button v-if="!formData.fcheckResu" class="primary-btn" style="background: linear-gradient(135deg, #e74c3c, #c0392b);" @click="removeXJ">鍒犻櫎鍗曟嵁</button>
+ <!-- 鎿嶄綔鎸夐挳鍖� -->
+ <view class="action-buttons">
+ <button class="secondary-btn" v-if="!isSubmitted" @click="genByProc">鑾峰彇妫�楠岄」鐩�</button>
+ <button class="secondary-btn" @click="toImage">涓婁紶/鏌ョ湅鍥剧墖</button>
+ <button class="secondary-btn" v-if="!isSubmitted" @click="saveRemarks">娣诲姞涓嶅悎鏍兼弿杩�</button>
+ <button class="primary-btn" v-if="!isSubmitted && canSubmit" @click="submit">鎻愪氦妫�楠�</button>
+ <button class="primary-btn disabled" v-if="!isSubmitted && !canSubmit" disabled>鎻愪氦妫�楠�</button>
</view>
- <!-- 涓嶅悎鏍兼弿杩板脊绐� -->
+ <!-- 寮圭獥 -->
<view v-if="remarksPopup" class="overlay">
<view class="popup">
- <h3>淇敼涓嶅悎鏍兼弿杩�</h3>
- <view class="form-group">
- <label class="form-label">涓嶅悎鏍兼弿杩�:</label>
- <input v-model="remarks" class="form-input" type="text" placeholder="璇疯緭鍏ヤ笉鍚堟牸鎻忚堪"/>
+ <view class="popup-header">
+ <h3>淇敼涓嶅悎鏍兼弿杩�</h3>
</view>
- <view class="popup-buttons">
- <button class="updateBut" @click="editRemarks">淇敼</button>
- <button class="secondary-btn" @click="remarksPopup = !remarksPopup">鍙栨秷</button>
+ <view class="popup-content">
+ <view class="info-block">
+ <view class="info-label">涓嶅悎鏍兼弿杩�:</view>
+ <input class="info-input" type="text" v-model="remarks" placeholder="璇疯緭鍏ヤ笉鍚堟牸鎻忚堪锛岀暀绌鸿〃绀烘竻闄ゆ弿杩�" />
+ </view>
+ </view>
+ <view class="popup-actions">
+ <button class="action-btn primary" @click="editRemarks">淇敼</button>
+ <button class="action-btn secondary" @click="remarksPopup = !remarksPopup">鍙栨秷</button>
</view>
</view>
</view>
@@ -184,32 +184,44 @@
boardStyle: ""
},
- DAA020List: [],
- DAA020Index: -1,
-
- DAA001List: [],
- DAA001Index: -1,
- schemeResult: [],
-
- isShowTable: false,
-
- ItemList: [],
- ItemIndex: -1,
- boardItems: [],
-
- lineList: [],
-
- lineNo: "",
-
tableData: [],
isSubmit: true,
- isUpdate: true,
-
remarks: "",
remarksPopup: false,
+
+ // 娣诲姞鍔犺浇鐘舵��
+ isLoading: false,
+ isInitialized: false,
};
+ },
+ computed: {
+ isSubmitted() {
+ const val = this.formData && (this.formData.Fsubmit ?? this.formData.fsubmit ?? this.formData.FSUBMIT ?? this.formData.fSubmit);
+ if (val === null || val === undefined || val === '') return false;
+ return String(val).trim() === '1' || Number(val) === 1;
+ },
+ canSubmit() {
+ // 妫�鏌ユ槸鍚︽湁妫�楠岄」鐩�
+ if (!Array.isArray(this.tableData) || this.tableData.length === 0) {
+ return false;
+ }
+
+ // 妫�鏌ユ槸鍚︽墍鏈夋楠岄」鐩兘宸插畬鎴�
+ const allCompleted = this.tableData.every(it => {
+ const checkedCount = Number(it?.isCheck ?? 0);
+ const requiredCount = Number(it?.levelNum ?? 0);
+ return checkedCount >= requiredCount;
+ });
+
+ // 妫�鏌ユ槸鍚︽墍鏈夋楠岄」鐩兘鏈夌粨鏋�
+ const allHaveResult = this.tableData.every(it =>
+ it.result && it.result !== '鏈畬鎴�' && it.result !== '鏈娴�'
+ );
+
+ return allCompleted && allHaveResult;
+ }
},
onLoad(options) {
//options涓寘鍚簡url闄勫甫鐨勫弬鏁�
@@ -217,28 +229,14 @@
let params = options;
if (params["id"]) {
- this.isUpdate = false;
this.formData.id = params["id"];
this.formData.releaseNo = params["releaseNo"];
//getQaItemXj02
this.init();
} else {
- //鍒濆鍖栨楠屽崟鍙�
- this.$post({
- url: "/XJ/getMaxReleaseNo"
- }).then(res => {
- this.formData.releaseNo = res.data.tbBillList;
- this.formData.createBy = this.$loginInfo.account;
- this.formData.createDate = this.$getDate("yyyy-mm-dd");
- });
-
- //杞﹂棿涓嬫媺妗嗙殑鍒濆鍖�
- this.$post({
- url: "/XJ/getLineAll"
- }).then(res => {
- this.lineList = res.data.tbBillList;
- this.DAA020List = res.data.tbBillList.map(item => item.lineName);
- })
+ // 鑷缓鍗曟嵁鍔熻兘宸茬Щ闄わ紝鍙厑璁告煡鐪嬬幇鏈夊崟鎹�
+ this.$showMessage("璇蜂粠鍒楄〃涓�夋嫨妫�楠屽崟杩涜鏌ョ湅");
+ uni.navigateBack();
}
},
methods: {
@@ -253,6 +251,29 @@
// 鑾峰彇寰呮楠岄」鐩暟閲�
getPendingCount() {
return this.tableData.filter(item => !item.result || item.result === '').length;
+ },
+ genByProc() {
+ this.$post({
+ url: "/XJ/GenUpdateXJ",
+ data: {
+ id: this.formData.id,
+ no: this.formData.billNo,
+ userNo: this.$loginInfo.account
+ }
+ }).then(res => {
+ if (res.status === 0) {
+ this.$showMessage("鐢熸垚/鑾峰彇妫�楠岄」鐩垚鍔�");
+ // 鎴愬姛鍚庡埛鏂版楠岄」鐩�
+ this.$post({
+ url: "/XJ/getJYItem",
+ data: { pid: this.formData.id }
+ }).then(r => {
+ this.tableData = r.data.tbBillList || [];
+ });
+ } else {
+ this.$showMessage(res.message || "鐢熸垚澶辫触");
+ }
+ });
},
removeXJ() {
if (this.formData.id) {
@@ -274,115 +295,15 @@
this.$showMessage("璇峰厛閫夋嫨妫�楠屽崟鍙�");
}
},
- getItem() {
-
- if (this.isSubmit) {
- this.$showMessage("姝ょ墿鏂欐棤鍚敤鐨勬楠岄」鐩紝璇风淮鎶�!");
- return;
- }
-
- if (!this.formData.billNo) {
- this.$showMessage("璇烽�夋嫨璁″垝缂栧彿");
- return;
- }
-
- this.$post({
- url: "/XJ/save",
- data: {
- from: this.formData,
- userNo: this.$loginInfo.account,
- items: this.tableData
- }
- }).then(res => {
- this.formData.id = res.data.tbBillList;
- this.$showMessage("鐢熸垚妫�楠岄」鐩垚鍔�");
- this.init();
- this.isUpdate = false;
- });
- },
- //鐢熶骇绾垮埆閫夋嫨骞跺垵濮嬭瘽宸ュ崟鍙�
- onDaa020Change(event) {
- //鑾峰彇鐢熶骇绾垮埆鐨勪笅鏍囧湴鍧�
- this.DAA020Index = event.mp.detail.value;
-
- this.lineNo = this.lineList[this.DAA020Index].lineNo;
-
- this.$post({
- url: "/XJ/getBoardItem",
- data: {
- lineNo: this.lineNo
- }
- }).then(res => {
- //濉厖宸ュ崟鍙风殑鏁版嵁婧�
- this.boardItems = res.data.tbBillList;
- this.ItemList = this.boardItems.map(item => item.itemName);
- //鍙樹负榛樿绌哄�肩殑鐘舵��
- this.ItemIndex = -1;
- })
-
- },
- onItemChange(event) {
- this.ItemIndex = event.mp.detail.value;
- this.formData.itemNo = this.boardItems[this.ItemIndex].itemNo;//涓昏鏄敼杩欓噷
- this.formData.itemId = this.boardItems[this.ItemIndex].id;//涓昏鏄敼杩欓噷
- this.formData.itemName = this.boardItems[this.ItemIndex].itemName;//涓昏鏄敼杩欓噷
- this.formData.itemModel = this.boardItems[this.ItemIndex].itemModel;//涓昏鏄敼杩欓噷
- this.$post({
- url: "/XJ/getDaa001",
- data: {
- daa020: this.lineNo,
- item: this.formData.itemNo
- }
- }).then(res => {
- //濉厖宸ュ崟鍙风殑鏁版嵁婧�
- this.schemeResult = res.data.tbBillList;
- this.DAA001List = this.schemeResult.map(s => s.daa001);
- //鍙樹负榛樿绌哄�肩殑鐘舵��
- this.DAA001Index = -1;
-
- this.formData.billNo = "";
- })
- },
- //閫夊彇宸ュ崟濉厖鐗╂枡鍙峰拰鍏朵粬淇℃伅
- onDaa001Change(event) {
- this.DAA001Index = event.mp.detail.value;
- this.formData.billNo = this.schemeResult[this.DAA001Index].daa001;
- this.formData.planQty = this.schemeResult[this.DAA001Index].daa008;
- //琛ㄥ崟涓殑閮ㄥ垎瀛楁璧嬪��
- this.$post({
- url: "/XJ/getItem",
- data: {
- daa001: this.formData.billNo
- }
- }).then(res => {
- let data = res.data.tbBillList[0];
- //褰撹繑鍥炵殑缁撴灉闆嗕负绌烘椂缃┖鍘熸湁鐨勫��
- if (!data) {
- this.formData.billNo = "";
- this.formData.itemNo = "";
- this.formData.planQty = "";
- this.tableData = [];
- return;
- }
-
- this.$post({
- url: "/XJ/setJYItem",
- data: {
- itemNo: this.formData.itemNo
- }
- }).then(res => {
- if (res.data.tbBillList.length > 0) {
- this.tableData = res.data.tbBillList; // 鍦ㄧ澶村嚱鏁颁腑锛宼his 鎸囧悜澶栧眰浣滅敤鍩熺殑 this
- this.isSubmit = false;
- } else {
- this.$showMessage("姝ょ墿鏂欐病鏈夊惎鐢ㄧ殑妫�楠岄」鐩紝璇风淮鎶�!");
- this.isSubmit = true;
- this.tableData = [];
- }
- });
- });
- },
init() {
+ // 闃叉閲嶅鍔犺浇
+ if (this.isLoading || !this.formData.id) {
+ return;
+ }
+
+ this.isLoading = true;
+ console.log('init: 寮�濮嬪姞杞芥暟鎹紝ID:', this.formData.id);
+
this.$post({
url: "/XJ/getPage",
data: {
@@ -413,47 +334,46 @@
}
});
this.tableData = tableData;
- if (this.tableData.length === 0) {
- this.isShowTable = true;
- }
- })
+ this.isInitialized = true;
+ this.isLoading = false;
+
+ }).catch(error => {
+ console.error('鑾峰彇妫�楠岄」鐩け璐�:', error);
+ this.isLoading = false;
+ });
+ } else {
+ this.isLoading = false;
}
+ }).catch(error => {
+ console.error('鑾峰彇椤甸潰鏁版嵁澶辫触:', error);
+ this.isLoading = false;
});
},
toDetail(item) {
- if (this.isUpdate) {
- uni.showToast({
- icon: "none",
- title: "璇峰厛鐢熸垚妫�楠岄」鐩�",
- duration: 2000,
- });
- } else {
- uni.navigateTo({
- url: 'detail?id=' + item.id + '&billNo=' + this.formData.billNo + '&gid=' + this.formData
- .id
- });
- }
+ uni.navigateTo({
+ url: 'detail?id=' + item.id + '&billNo=' + this.formData.billNo + '&gid=' + this.formData.id
+ });
}, saveRemarks() {
this.remarksPopup = !this.remarksPopup;
this.remarks = this.formData.remarks;
},
editRemarks() {
- if (this.remarks) {
- //saveRemarksGid
- this.$post({
- url: "/XJ/saveRemarksGid",
- data: {
- gid: this.formData.id,
- remarks: this.remarks
- }
- }).then(res => {
- if (res.data.tbBillList > 0) {
- this.formData.remarks = this.remarks;
- this.remarksPopup = !this.remarksPopup;
- this.$showMessage("淇濆瓨鎴愬姛");
- }
- })
- }
+ // 鍏佽鐣欑┖锛岀暀绌轰唬琛ㄦ竻闄ゆ弿杩�
+ this.$post({
+ url: "/XJ/saveRemarksGid",
+ data: {
+ gid: this.formData.id,
+ remarks: this.remarks || "" // 鐣欑┖鏃朵紶閫掔┖瀛楃涓�
+ }
+ }).then(res => {
+ if (res.data.tbBillList > 0) {
+ this.formData.remarks = this.remarks || ""; // 鏇存柊鏈湴鏁版嵁
+ this.remarksPopup = !this.remarksPopup;
+ this.$showMessage(this.remarks ? "淇濆瓨鎴愬姛" : "鎻忚堪宸叉竻闄�");
+ }
+ }).catch(error => {
+ this.$showMessage("淇濆瓨澶辫触锛岃閲嶈瘯");
+ });
},
toImage() {
uni.navigateTo({
@@ -461,47 +381,142 @@
});
},
getTable() {
+ // 璋冪敤瀛樺偍杩囩▼鐢熸垚妫�楠岄」鐩�
this.$post({
- url: "/XJ/setJYItem",
+ url: "/XJ/GenUpdateXJ",
data: {
- itemNo: this.formData.itemNo
- }
- }).then(res => {
- if (res.data.tbBillList.length > 0) {
- this.tableData = res.data.tbBillList; // 鍦ㄧ澶村嚱鏁颁腑锛宼his 鎸囧悜澶栧眰浣滅敤鍩熺殑 this
- this.isShowTable = true;
- this.isUpdate = true;
- } else {
- this.$showMessage("姝ょ墿鏂欐病鏈夊惎鐢ㄧ殑妫�楠岄」鐩紝璇风淮鎶�!");
- this.isShowTable = true;
- this.isUpdate = false;
- this.tableData = [];
- }
- });
- },
- saveTable() {
- if (this.tableData.length === 0) {
- return;
- }
- this.$post({
- url: "/XJ/saveItem",
- data: {
- gid: this.formData.id,
- items: this.tableData,
+ id: this.formData.id || 0,
+ no: this.formData.billNo,
userNo: this.$loginInfo.account
}
}).then(res => {
- this.formData.id = res.data.tbBillList;
- this.isShowTable = false;
- this.isUpdate = false;
- this.init();
- })
+ if (res.status === 0) {
+ this.$showMessage("鑾峰彇妫�楠岄」鐩垚鍔�");
+ this.init(); // 閲嶆柊鍔犺浇鏁版嵁
+ } else {
+ this.$showMessage(res.message || "鑾峰彇妫�楠岄」鐩け璐�");
+ }
+ }).catch(error => {
+ this.$showMessage("缃戠粶閿欒锛岃閲嶈瘯");
+ });
+ },
+ submit() {
+ // 鏍¢獙鏄惁鏈夋楠岄」鐩�
+ if (!Array.isArray(this.tableData) || this.tableData.length === 0) {
+ this.$showMessage("娌℃湁妫�楠岄」鐩紝鏃犳硶鎻愪氦");
+ return;
+ }
+
+ // 鏍¢獙妫�楠岄」鐩槸鍚﹀叏閮ㄥ畬鎴�
+ const unfinishedItems = [];
+ const hasUnfinished = this.tableData.some(it => {
+ const checkedCount = Number(it?.isCheck ?? 0);
+ const requiredCount = Number(it?.levelNum ?? 0);
+ if (checkedCount < requiredCount) {
+ unfinishedItems.push(it.projName);
+ return true;
+ }
+ return false;
+ });
+
+ if (hasUnfinished) {
+ const message = unfinishedItems.length > 0
+ ? `浠ヤ笅妫�楠岄」鐩湭瀹屾垚锛屼笉鑳芥彁浜わ細\n${unfinishedItems.join('銆�')}`
+ : "瀛樺湪鏈畬鎴愮殑妫�楠岄」鐩紝涓嶈兘鎻愪氦";
+ this.$showMessage(message);
+ return;
+ }
+
+ // 鏍¢獙鏄惁鎵�鏈夋楠岄」鐩兘鏈夌粨鏋�
+ const itemsWithoutResult = this.tableData.filter(it =>
+ !it.result || it.result === '鏈畬鎴�' || it.result === '鏈娴�'
+ );
+ if (itemsWithoutResult.length > 0) {
+ const itemNames = itemsWithoutResult.map(it => it.projName);
+ this.$showMessage(`浠ヤ笅妫�楠岄」鐩病鏈夋楠岀粨鏋滐紝涓嶈兘鎻愪氦锛歕n${itemNames.join('銆�')}`);
+ return;
+ }
+
+ // 鎻愪氦妫�楠岄�昏緫
+ this.$post({
+ url: "/XJ/XJQaSubmit",
+ data: {
+ gid: this.formData.id,
+ userNo: this.$loginInfo.account
+ }
+ }).then(res => {
+ if (res.status === 0) {
+ // 鏄剧ず鎴愬姛鎻愮ず妗�
+ uni.showModal({
+ title: '鎻愪氦鎴愬姛',
+ content: res.message || '妫�楠屾彁浜ゆ垚鍔燂紒',
+ showCancel: false,
+ confirmText: '纭畾',
+ confirmColor: '#27ae60',
+ success: (modalRes) => {
+ if (modalRes.confirm) {
+ // 鎻愪氦鎴愬姛鍚庡埛鏂板綋鍓嶅崟鎹紝纭繚FSUBMIT鏈�鏂帮紝浠庤�岄殣钘忔寜閽�
+ this.init();
+ }
+ }
+ });
+ } else {
+ // 鏄剧ず澶辫触鎻愮ず妗�
+ uni.showModal({
+ title: '鎻愪氦澶辫触',
+ content: res.message || '妫�楠屾彁浜ゅけ璐ワ紝璇烽噸璇曪紒',
+ showCancel: false,
+ confirmText: '纭畾'
+ });
+ }
+ }).catch(error => {
+ uni.showModal({
+ title: '鎻愪氦澶辫触',
+ content: '缃戠粶閿欒锛岃妫�鏌ョ綉缁滆繛鎺ュ悗閲嶈瘯锛�',
+ showCancel: false,
+ confirmText: '纭畾'
+ });
+ });
+ },
+ // 鍒锋柊妫�楠岄」鐩暟鎹�
+ refreshTableData() {
+ if (!this.formData.id || this.isLoading) {
+ return;
+ }
+
+ this.isLoading = true;
+ this.$post({
+ url: "/XJ/getJYItem",
+ data: {
+ pid: this.formData.id
+ }
+ }).then(res => {
+ let tableData = res.data.tbBillList;
+ // 褰撳凡妫�楠屼釜鏁伴兘涓嶄负绌烘椂鎸夌収妫�娴嬬粨鏋勬帓搴�
+ tableData.sort((a, b) => {
+ if (a.result === '鏈畬鎴�' && b.result === '鍚堟牸') {
+ return -1;
+ } else if (a.result === '鍚堟牸' && b.result === '鏈畬鎴�') {
+ return 1;
+ } else {
+ return 0;
+ }
+ });
+ this.tableData = tableData;
+ this.isLoading = false;
+ console.log('妫�楠岄」鐩暟鎹凡鍒锋柊');
+ }).catch(error => {
+ console.error('鍒锋柊妫�楠岄」鐩け璐�:', error);
+ this.isLoading = false;
+ });
}
},
onShow() {
- //姣忔杩涘叆椤甸潰閮戒細鎵ц鐨勬柟娉�
- if (this.formData.id) {
- this.init();
+ // 鍙湁鍦ㄦ湁ID涓斿凡缁忓垵濮嬪寲杩囩殑鎯呭喌涓嬫墠鍒锋柊鏁版嵁
+ if (this.formData.id && this.formData.id !== '' && this.isInitialized) {
+ console.log('onShow: 椤甸潰鏄剧ず锛屽埛鏂版楠岄」鐩暟鎹紝ID:', this.formData.id);
+ // 鍙埛鏂版楠岄」鐩暟鎹紝涓嶉噸鏂板姞杞藉熀鏈俊鎭�
+ this.refreshTableData();
}
}
};
@@ -536,6 +551,34 @@
font-size: 16px;
font-weight: bold;
color: #3498db;
+}
+
+/* 鍔犺浇鎸囩ず鍣ㄦ牱寮� */
+.loading-indicator {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 8px;
+ margin-top: 10px;
+ padding: 8px 16px;
+ background: rgba(52, 152, 219, 0.1);
+ border-radius: 20px;
+ font-size: 14px;
+ color: #3498db;
+}
+
+.loading-spinner {
+ width: 16px;
+ height: 16px;
+ border: 2px solid #e3f2fd;
+ border-top: 2px solid #3498db;
+ border-radius: 50%;
+ animation: spin 1s linear infinite;
+}
+
+@keyframes spin {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(360deg); }
}
/* 鍩烘湰淇℃伅鍖烘牱寮� */
@@ -630,6 +673,27 @@
.stats-left .stats-subtitle {
font-size: 14px;
color: #7f8c8d;
+}
+
+.submit-status {
+ font-size: 13px;
+ font-weight: 500;
+ margin-top: 4px;
+ padding: 4px 8px;
+ border-radius: 4px;
+ display: inline-block;
+}
+
+.submit-status.can-submit {
+ background-color: rgba(39, 174, 96, 0.1);
+ color: #27ae60;
+ border: 1px solid rgba(39, 174, 96, 0.3);
+}
+
+.submit-status.cannot-submit {
+ background-color: rgba(231, 76, 60, 0.1);
+ color: #e74c3c;
+ border: 1px solid rgba(231, 76, 60, 0.3);
}
.stats-right {
@@ -805,7 +869,7 @@
.inspection-table td:nth-child(2) {
position: relative;
min-height: 80px;
- vertical-align: top;
+ vertical-align: middle;
padding: 16px 20px;
}
@@ -836,6 +900,20 @@
background-color: #2980b9;
}
+.primary-btn.disabled {
+ background: #bdc3c7;
+ color: #7f8c8d;
+ border-color: #bdc3c7;
+ cursor: not-allowed;
+ box-shadow: none;
+}
+
+.primary-btn.disabled:hover {
+ background: #bdc3c7;
+ transform: none;
+ box-shadow: none;
+}
+
.secondary-btn {
background-color: #ecf0f1;
color: #7f8c8d;
@@ -843,6 +921,22 @@
.secondary-btn:hover {
background-color: #d5dbdb;
+}
+
+.info-btn {
+ background: linear-gradient(135deg, #17a2b8, #138496);
+ color: white;
+}
+
+.info-btn:hover {
+ background: linear-gradient(135deg, #138496, #117a8b);
+ transform: translateY(-2px);
+ box-shadow: 0 4px 16px rgba(23, 162, 184, 0.4);
+}
+
+.info-btn:active {
+ transform: translateY(0);
+ box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}
.record-btn {
@@ -893,15 +987,15 @@
/* 姘村嵃鏍峰紡 */
.watermark {
position: absolute;
- font-size: 32px;
+ font-size: 28px;
font-weight: bold;
- opacity: 0.4;
+ opacity: 0.3;
z-index: 3;
pointer-events: none;
- bottom: 8px;
- right: 8px;
- transform: rotate(-15deg);
- transform-origin: bottom right;
+ top: 50%;
+ right: 12px;
+ transform: translateY(-50%) rotate(-15deg);
+ transform-origin: center;
text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
min-width: 60px;
text-align: center;
@@ -938,7 +1032,7 @@
display: block;
}
-/* 寮瑰嚭灞傛牱寮� */
+/* 寮瑰嚭妗嗘牱寮� */
.overlay {
position: fixed;
top: 0;
@@ -949,72 +1043,102 @@
display: flex;
justify-content: center;
align-items: center;
- z-index: 10;
+ z-index: 1000;
}
.popup {
- background-color: #fff;
- padding: 20px;
- border: 1px solid #ccc;
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
- width: 68vw;
- height: 25vh;
+ background-color: white;
border-radius: 8px;
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
+ width: 90%;
+ max-width: 400px;
+ max-height: 80vh;
+ overflow-y: auto;
}
-.popup h3 {
- margin-top: 0;
- color: #2c3e50;
+.popup-header {
+ padding: 20px;
border-bottom: 1px solid #eee;
- padding-bottom: 10px;
- margin-bottom: 15px;
- font-size: 16px;
- text-align: center;
}
-.popup .form-group {
- margin-bottom: 15px;
+.popup-header h3 {
+ font-size: 18px;
+ font-weight: 600;
+ color: #2c3e50;
+ margin: 0;
+}
+
+.popup-content {
+ padding: 20px;
+}
+
+.popup-actions {
+ padding: 20px;
+ border-top: 1px solid #eee;
display: flex;
- flex-direction: column;
-}
-
-.popup .form-label {
- margin-bottom: 5px;
- font-weight: bold;
- font-size: 14px;
-}
-
-.popup .form-input {
- width: 100%;
- padding: 8px;
- border: 1px solid #ddd;
- border-radius: 4px;
- font-size: 14px;
- box-sizing: border-box;
-}
-
-.popup-buttons {
- display: flex;
- justify-content: flex-end;
gap: 10px;
- margin-top: 20px;
+ justify-content: flex-end;
}
-.updateBut {
- background-color: #3498db;
- color: white;
+.action-btn {
+ padding: 10px 20px;
border: none;
- padding: 8px 15px;
border-radius: 4px;
- margin-right: 10px;
+ font-size: 14px;
cursor: pointer;
transition: all 0.3s;
}
-.updateBut:hover {
+.action-btn.primary {
+ background-color: #3498db;
+ color: white;
+}
+
+.action-btn.primary:hover {
background-color: #2980b9;
}
+.action-btn.secondary {
+ background-color: #ecf0f1;
+ color: #7f8c8d;
+}
+
+.action-btn.secondary:hover {
+ background-color: #d5dbdb;
+}
+
+/* 绌虹姸鎬佹牱寮� */
+.empty-state {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 60px 20px;
+ text-align: center;
+ background-color: #fafafa;
+ border-radius: 8px;
+ margin: 20px 0;
+}
+
+.empty-icon {
+ font-size: 48px;
+ margin-bottom: 16px;
+ opacity: 0.6;
+}
+
+.empty-text {
+ font-size: 18px;
+ font-weight: 600;
+ color: #666;
+ margin-bottom: 8px;
+}
+
+.empty-desc {
+ font-size: 14px;
+ color: #999;
+ line-height: 1.5;
+}
+
/* 鍝嶅簲寮忚璁� */
@media (max-width: 500px) {
.info-row,
--
Gitblit v1.9.3