From 52c82b4f021814fc1cbe49b70871757a9001458a Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期三, 16 七月 2025 21:26:46 +0800
Subject: [PATCH] 添加实验室检测模块功能
---
pages/QC/LLJ/Add.vue | 1411 +++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 958 insertions(+), 453 deletions(-)
diff --git a/pages/QC/LLJ/Add.vue b/pages/QC/LLJ/Add.vue
index e18fbc9..c1c52b0 100644
--- a/pages/QC/LLJ/Add.vue
+++ b/pages/QC/LLJ/Add.vue
@@ -1,482 +1,987 @@
<template>
- <view>
- <view class="form-container">
- <form :modelValue="formData">
- <view class="form-group">
- <label class="form-label">妫�楠屽崟鍙�:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.releaseNo" />
- </view>
- <view class="form-group">
- <label class="form-label">鍒拌揣鍗曞彿:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.lotNo" />
- </view>
- <!-- <view class="form-group">
- <label class="form-label">鍒涘缓浜�:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.createBy"/>
- </view>-->
- <view class="form-group">
- <label class="form-label">鍒涘缓鏃堕棿:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.createDate" />
- </view>
- <view class="form-group">
- <label class="form-label">鐗╂枡缂栫爜:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.itemNo" />
- </view>
- <view class="form-group">
- <label class="form-label">鐗╂枡鍚嶇О:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.itemName" />
- </view>
- <view class="form-group">
- <label class="form-label">瑙勬牸鍨嬪彿:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.itemModel" />
- </view>
- <view class="form-group">
- <label class="form-label">鏁伴噺:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.fcovertQty" />
- </view>
- <view class="form-group">
- <label class="form-label">涓嶅悎鏍兼弿杩�:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.remarks" />
- </view>
- </form>
- </view>
+ <view class="page-container">
+ <!-- 琛ㄥ崟鍗$墖 -->
+ <view class="form-card">
+ <view class="form-title">
+ <view class="title-icon">馃搵</view>
+ <span>妫�楠屽崟淇℃伅</span>
+ </view>
+ <view class="form-container">
+ <form :modelValue="formData">
+ <view class="form-grid">
+ <view class="form-group">
+ <label class="form-label">妫�楠屽崟鍙�:</label>
+ <input class="form-input" disabled="true" type="text" v-model="formData.releaseNo" />
+ </view>
+ <view class="form-group">
+ <label class="form-label">鍒拌揣鍗曞彿:</label>
+ <input class="form-input" disabled="true" type="text" v-model="formData.lotNo" />
+ </view>
+ <view class="form-group">
+ <label class="form-label">鍒涘缓鏃堕棿:</label>
+ <input class="form-input" disabled="true" type="text" v-model="formData.createDate" />
+ </view>
+ <view class="form-group">
+ <label class="form-label">鐗╂枡缂栫爜:</label>
+ <input class="form-input" disabled="true" type="text" v-model="formData.itemNo" />
+ </view>
+ <view class="form-group">
+ <label class="form-label">鐗╂枡鍚嶇О:</label>
+ <input class="form-input" disabled="true" type="text" v-model="formData.itemName" />
+ </view>
+ <view class="form-group">
+ <label class="form-label">鐗╂枡瑙勬牸:</label>
+ <input class="form-input" disabled="true" type="text" v-model="formData.itemModel" />
+ </view>
+ <view class="form-group">
+ <label class="form-label">鏁伴噺:</label>
+ <input class="form-input" disabled="true" type="text" v-model="formData.fcovertQty" />
+ </view>
+ <view class="form-group">
+ <label class="form-label">涓嶅悎鏍兼弿杩�:</label>
+ <input class="form-input" disabled="true" type="text" v-model="formData.remarks" />
+ </view>
+ </view>
+ </form>
+ </view>
+ </view>
- <view class="list-container">
- <uni-table ref="table" border emptyText="鏆傛棤鏇村鏁版嵁">
- <uni-tr>
- <uni-th align="center" class="th" style="color: #FFFFFF;">妫�楠岄」鐩�</uni-th>
- <uni-th align="center" class="th" style="color: #FFFFFF">妫�楠屾弿杩�</uni-th>
- <uni-th align="center" class="th" style="color: #FFFFFF">鏄惁鍚堟牸</uni-th>
- <uni-th align="center" class="th" style="color: #FFFFFF">璁板綍(鐐瑰嚮)</uni-th>
- </uni-tr>
- <uni-tr v-for="(item, index) in tableData" :key="index">
- <uni-td align="center">
- <input class="form-input" disabled="true" type="text" v-model="item.fcheckItem" />
- </uni-td>
- <uni-td align="center">
- <input class="form-input" disabled="true" type="text" v-model="item.fcheckItemDesc" />
- </uni-td>
- <uni-td align="center">
- <input class="form-input" disabled="true" type="text" v-model="item.fcheckResu" />
- </uni-td>
- <uni-td>
- <view class="uni-group">
- <button v-if="item.fenterQty >=item.checkQyt" type="default" @click="toDetail(item)">
- {{ item.checkQyt + '/' + item.fenterQty }}
- </button>
- <button v-else type="warn" @click="toDetail(item)">
- {{ item.checkQyt + '/' + item.fenterQty }}
- </button>
- </view>
- </uni-td>
- </uni-tr>
- </uni-table>
- </view>
+ <!-- 妫�楠岄」鐩崱鐗� -->
+ <view class="table-card">
+ <view class="table-title">
+ <view class="title-icon">馃攳</view>
+ <span>妫�楠岄」鐩�</span>
+ </view>
+ <view class="list-container">
+ <uni-table ref="table" border emptyText="鏆傛棤鏇村鏁版嵁">
+ <uni-tr>
+ <uni-th align="center" class="th">妫�楠岄」鐩�</uni-th>
+ <uni-th align="center" class="th">妫�楠屾弿杩�</uni-th>
+ <uni-th align="center" class="th">鏄惁鍚堟牸</uni-th>
+ <uni-th align="center" class="th">璁板綍(鐐瑰嚮)</uni-th>
+ </uni-tr>
+ <uni-tr v-for="(item, index) in tableData" :key="index" class="table-row" :class="{ 'hover-effect': isHoveringRow === index }" @mouseenter="isHoveringRow = index" @mouseleave="isHoveringRow = -1">
+ <uni-td align="center">
+ <input class="form-input" disabled="true" type="text" v-model="item.fcheckItem" />
+ </uni-td>
+ <uni-td align="center">
+ <view class="value-with-tooltip cursor-pointer"
+ @click.stop="showTooltip(item.fcheckItemDesc, $event, item.fcheckItem)">
+ <input class="form-input" disabled="true" type="text" v-model="item.fcheckItemDesc" />
+ </view>
+ </uni-td>
+ <uni-td align="center">
+ <span class="result-badge" :class="{ 'pass': item.fcheckResu === '鍚堟牸', 'fail': item.fcheckResu === '涓嶅悎鏍�', 'pending': item.fcheckResu === '鏈楠�' }">
+ {{ item.fcheckResu }}
+ </span>
+ </uni-td>
+ <uni-td>
+ <view class="uni-group">
+ <button :class="item.fenterQty >= item.checkQyt ? 'btn-normal' : 'btn-warn'" @click="toDetail(item)">
+ {{ item.checkQyt + '/' + item.fenterQty }}
+ </button>
+ </view>
+ </uni-td>
+ </uni-tr>
+ </uni-table>
+ </view>
+ </view>
- <view class="plus-button">
- <view class="plus-button">
- <button type="warn" v-if="!isUpdate && !isShowTable" @click="submit">妫�楠屾彁浜�</button>
- </view>
+ <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
+ <view class="action-buttons">
+ <view class="button-group">
+ <button :class="['action-btn', { 'btn-primary': !isUpdate && !isShowTable, 'btn-disabled': !canSubmit }]" v-if="!isUpdate && !isShowTable" @click="submit" :disabled="!canSubmit">
+ 妫�楠屾彁浜�
+ </button>
+ </view>
+ <view class="button-group">
+ <button :class="['action-btn', { 'btn-secondary': isUpdate && !isShowTable, 'btn-disabled': !canGenerate }]" v-if="isUpdate && !isShowTable" @click="getItem" :disabled="!canGenerate">
+ 鍒涘缓妫�楠屽崟骞剁敓鎴愰儴鍒嗛粯璁ゅ��
+ </button>
+ </view>
+ <view class="button-group">
+ <button :class="['action-btn', { 'btn-tertiary': !isUpdate && !isShowTable, 'btn-disabled': !canUpload }]" v-if="!isUpdate && !isShowTable" @click="toImage" :disabled="!canUpload">
+ 涓婁紶/鏌ョ湅鍥剧墖
+ </button>
+ </view>
+ <view class="button-group">
+ <button :class="['action-btn', { 'btn-quaternary': !isUpdate && !isShowTable, 'btn-disabled': !canEdit }]" v-if="!isUpdate && !isShowTable" @click="saveRemarks" :disabled="!canEdit">
+ 娣诲姞涓嶅悎鏍兼弿杩�
+ </button>
+ </view>
+ <view class="button-group">
+ <button :class="['action-btn', { 'btn-accent': isShowTable, 'btn-disabled': !canGetTable }]" v-if="isShowTable" @click="getTable" :disabled="!canGetTable">
+ 鑾峰彇妫�楠岄」鐩�
+ </button>
+ </view>
+ <view class="button-group">
+ <button :class="['action-btn', { 'btn-success': isShowTable && isUpdate, 'btn-disabled': !canSaveTable }]" v-if="isShowTable && isUpdate" @click="saveTable" :disabled="!canSaveTable">
+ 鐢熸垚妫�楠岄」鐩�
+ </button>
+ </view>
+ </view>
- <button type="warn" v-if="isUpdate && !isShowTable" @click="getItem">鍒涘缓妫�楠屽崟骞剁敓鎴愰儴鍒嗛粯璁ゅ��</button>
- </view>
- <view class="plus-button">
- <button type="warn" v-if="!isUpdate && !isShowTable" @click="toImage">涓婁紶/鏌ョ湅鍥剧墖</button>
- </view>
- <view class="plus-button">
- <button type="warn" v-if="!isUpdate && !formData.fcheckResu && !isShowTable" @click="removeXJ">鍒犻櫎鍗曟嵁</button>
- </view>
- <view class="plus-button">
- <button type="warn" v-if="!isUpdate && !isShowTable" @click="saveRemarks">娣诲姞涓嶅悎鏍兼弿杩�</button>
- </view>
+ <!-- 涓嶅悎鏍兼弿杩板脊鍑哄眰 -->
+ <view v-if="remarksPopup" class="overlay active">
+ <view class="popup" :class="{ 'popup-scale': isPopupAnimated }" @animationend="isPopupAnimated = false">
+ <view class="popup-header">
+ <h3 class="popup-title">淇敼涓嶅悎鏍兼弿杩�</h3>
+ <view class="close-btn" @click="remarksPopup = !remarksPopup">脳</view>
+ </view>
+ <form>
+ <view class="form-group">
+ <label class="form-label">涓嶅悎鏍兼弿杩�:</label>
+ <input class="form-input" type="text" v-model="remarks" />
+ </view>
+ <view class="button-group popup-buttons">
+ <button :class="['action-btn', 'btn-danger']" @click="editRemarks">
+ 淇敼
+ </button>
+ <button :class="['action-btn', 'btn-light']" @click="remarksPopup = !remarksPopup">
+ 鍙栨秷
+ </button>
+ </view>
+ </form>
+ </view>
+ </view>
- <view class="plus-button">
- <button type="warn" v-if="isShowTable" @click="getTable">鑾峰彇妫�楠岄」鐩�</button>
- </view>
- <view class="plus-button">
- <button type="warn" v-if="isShowTable && isUpdate" @click="saveTable">鐢熸垚妫�楠岄」鐩�</button>
- </view>
- <view v-if="remarksPopup" class="overlay">
- <view class="popup">
- <h3>淇敼涓嶅悎鏍兼弿杩�</h3>
- <form>
- <view class="form-group">
- <label class="form-label">涓嶅悎鏍兼弿杩�:</label>
- <input class="form-input" type="text" v-model="remarks" />
- </view>
- <button type="warn" @click="editRemarks">淇敼</button>
- <button @click="remarksPopup = !remarksPopup">鍙栨秷</button>
- </form>
- </view>
- </view>
-
- </view>
+ <!-- 鎻愮ず妗嗗叏灞�缁勪欢 -->
+ <view v-if="showTooltipBox" class="tooltip-container">
+ <view class="tooltip"
+ :style="{top: tooltipY + 'px', left: tooltipX + 'px'}"
+ :class="{ 'active': tooltipBoxAnimated }">
+ <view class="tooltip-content">
+ <view class="tooltip-title">{{ tooltipTitle }}</view>
+ <view class="tooltip-body">{{ tooltipValue }}</view>
+ </view>
+ <view class="tooltip-arrow" :style="{ transform: tooltipArrowTransform }"></view>
+ </view>
+ </view>
+ </view>
</template>
<script>
- export default {
- data() {
- return {
- formData: {
- id: "",
- releaseNo: "",
- createBy: "",
- createDate: "",
- lotNo: "",
- itemNo: "",
- billNo: "",
- fcovertQty: "",
- detailMem: "",
- taskNo: "",
- fcheckResu: "",
- boardModel: "",
- planQty: "",
- mocode: "",
- boardStyle: "",
- userCode: "",
- itemId: ""
- },
+export default {
+ data() {
+ return {
+ formData: {
+ id: "",
+ releaseNo: "",
+ createBy: "",
+ createDate: "",
+ lotNo: "",
+ itemNo: "",
+ billNo: "",
+ fcovertQty: "",
+ detailMem: "",
+ taskNo: "",
+ fcheckResu: "",
+ boardModel: "",
+ planQty: "",
+ mocode: "",
+ boardStyle: "",
+ userCode: "",
+ itemId: ""
+ },
- DAA020List: [],
- DAA020Index: -1,
- DAA001List: [],
- DAA001Index: -1,
- schemeResult: [],
- isShowTable: false,
- ItemList: [],
- ItemIndex: -1,
- boardItems: [],
- lineList: [],
- lineNo: "",
- tableData: [],
- isSubmit: true,
- isUpdate: true,
- remarks: "",
- remarksPopup: false,
- };
- },
- onLoad(options) {
- //options涓寘鍚簡url闄勫甫鐨勫弬鏁�
+ DAA020List: [],
+ DAA020Index: -1,
+ DAA001List: [],
+ DAA001Index: -1,
+ schemeResult: [],
+ isShowTable: false,
+ ItemList: [],
+ ItemIndex: -1,
+ boardItems: [],
+ lineList: [],
+ lineNo: "",
+ tableData: [],
+ isSubmit: true,
+ isUpdate: true,
+ remarks: "",
+ remarksPopup: false,
+ isHoveringRow: -1,
+ isPopupAnimated: false,
+ // 鎸夐挳鐘舵�佹帶鍒�
+ canSubmit: true,
+ canGenerate: true,
+ canUpload: true,
+ canEdit: true,
+ canGetTable: true,
+ canSaveTable: true,
+ // 鎻愮ず妗嗙浉鍏�
+ showTooltipBox: false,
+ tooltipTitle: '',
+ tooltipValue: '',
+ tooltipX: 0,
+ tooltipY: 0,
+ tooltipBoxAnimated: false,
+ tooltipArrowTransform: 'translateX(-50%) rotate(180deg)'
+ };
+ },
+ onLoad(options) {
+ //options涓寘鍚簡url闄勫甫鐨勫弬鏁�
+ let params = options;
- let params = options;
+ if (params["id"]) {
+ this.isUpdate = false;
+ this.formData.id = params["id"];
+ this.formData.releaseNo = params["releaseNo"];
+ this.formData.lotNo = params["lotNo"];
+ console.log(this.formData.lotNo);
+ //getQaItemXj02
+ this.init();
+ } else {
+ //鍒濆鍖栨楠屽崟鍙�
+ this.$post({
+ url: "/LLJ/getMaxReleaseNo"
+ }).then(res => {
+ this.formData.releaseNo = res.data.tbBillList;
+ this.formData.createBy = this.$loginInfo.account;
+ this.formData.createDate = this.$getDate("yyyy-mm-dd");
+ });
+ }
+ },
+ methods: {
+ removeXJ() {
+ if (this.formData.id) {
+ this.$post({
+ url: "/LLJ/removeXJ",
+ data: {
+ releaseNo: this.formData.releaseNo
+ }
+ }).then(res => {
+ if (res.data.tbBillList > 0) {
+ this.$showMessage("鍒犻櫎鎴愬姛");
+ //鍏抽棴褰撳墠椤甸潰锛岃繑鍥炰笂涓�椤甸潰鎴栧绾ч〉闈�
+ uni.navigateBack();
+ } else {
+ this.$showMessage("鍒犻櫎澶辫触");
+ }
+ });
+ } else {
+ this.$showMessage("璇峰厛閫夋嫨妫�楠屽崟鍙�");
+ }
+ },
+ getItem() {
+ if (this.isSubmit) {
+ this.$showMessage("姝ょ墿鏂欐棤鍚敤鐨勬楠岄」鐩紝璇风淮鎶�!");
+ return;
+ }
- if (params["id"]) {
- this.isUpdate = false;
- this.formData.id = params["id"];
- this.formData.releaseNo = params["releaseNo"];
- this.formData.lotNo = params["lotNo"];
- console.log(this.formData.lotNo);
- //getQaItemXj02
- this.init();
- } else {
- //鍒濆鍖栨楠屽崟鍙�
- this.$post({
- url: "/LLJ/getMaxReleaseNo"
- }).then(res => {
- this.formData.releaseNo = res.data.tbBillList;
- this.formData.createBy = this.$loginInfo.account;
- this.formData.createDate = this.$getDate("yyyy-mm-dd");
- });
+ if (!this.formData.billNo) {
+ this.$showMessage("璇烽�夋嫨璁″垝缂栧彿");
+ return;
+ }
- }
- },
- methods: {
- removeXJ() {
- if (this.formData.id) {
- this.$post({
- url: "/LLJ/removeXJ",
- data: {
- releaseNo: this.formData.releaseNo
- }
- }).then(res => {
- if (res.data.tbBillList > 0) {
- this.$showMessage("鍒犻櫎鎴愬姛");
- //鍏抽棴褰撳墠椤甸潰锛岃繑鍥炰笂涓�椤甸潰鎴栧绾ч〉闈�
- uni.navigateBack();
- } else {
- this.$showMessage("鍒犻櫎澶辫触");
- }
- });
- } else {
- this.$showMessage("璇峰厛閫夋嫨妫�楠屽崟鍙�");
- }
- },
- getItem() {
+ 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;
+ });
+ },
+ submit() {
+ this.$post({
+ url: "/LLJ/IqcQaSubmit",
+ data: {
+ userNo: this.$loginInfo.account,
+ releaseNo: this.formData.releaseNo
+ }
+ }).then(res => {
+ if (res.statusCode === 200) {
+ this.$showMessage("鎴愬姛鎻愪氦妫�楠�");
+ setTimeout(() => {
+ this.hideCustomMessage();
+ }, 7000);
+ } else {
+ this.$showMessage(res.data.message);
+ }
+ })
+ },
- if (this.isSubmit) {
- this.$showMessage("姝ょ墿鏂欐棤鍚敤鐨勬楠岄」鐩紝璇风淮鎶�!");
- return;
- }
+ init() {
+ //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴�
+ let userName = this.$loginInfo.account;
+ this.$post({
+ url: "/LLJ/getPage",
+ data: {
+ id: this.formData.id,
+ createUser: userName,
+ pageIndex: 1,
+ limit: 1,
+ }
+ }).then(res => {
+ let data = res.data.tbBillList[0];
+ if (data) {
+ this.formData = data;
- 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;
- });
- },
- submit() {
- this.$post({
- url: "/LLJ/IqcQaSubmit",
- data: {
- userNo: this.$loginInfo.account,
- releaseNo: this.formData.releaseNo
- }
- }).then(res => {
- //console.log(res);
- //2024-11-28 kyy 鏍¢獙鍚堟牸鎻愪氦澧炲姞鎻愮ず
- if (res.statusCode === 200) {
- this.$showMessage("鎴愬姛鎻愪氦妫�楠�");
- // 浣跨敤setTimeout鍦�7绉掑悗闅愯棌娑堟伅
- setTimeout(() => {
- this.hideCustomMessage();
- }, 7000); // 7000姣绛変簬7绉�
- } else {
- this.$showMessage(res.data.message);
- }
- })
- },
-
- init() {
-
- //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴�
- let userName = this.$loginInfo.account;
- this.$post({
- url: "/LLJ/getPage",
- data: {
- id: this.formData.id,
- // createUser :this.formData.createUser,
- createUser: userName,
- pageIndex: 1,
- limit: 1,
- }
- }).then(res => {
- let data = res.data.tbBillList[0];
- if (data) {
- this.formData = data;
-
- this.$post({
- url: "/LLJ/getJYItem",
- data: {
- id: this.formData.id,
- releaseNo: this.formData.releaseNo
- }
- }).then(res1 => {
- let tableData = res1.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;
- if (this.tableData.length === 0) {
- this.isShowTable = true;
- }
-
-
- })
- }
- });
- },
- toDetail(item) {
- if (this.isUpdate) {
- uni.showToast({
- icon: "none",
- title: "璇峰厛鐢熸垚妫�楠岄」鐩�",
- duration: 2000,
- });
- } else {
- uni.navigateTo({
- url: 'detail?mainId=' + item.id
- });
- }
- },
- saveRemarks() {
- this.remarksPopup = !this.remarksPopup;
- this.remarks = this.formData.remarks;
- },
- editRemarks() {
- if (this.remarks) {
- //saveRemarksGid
- this.$post({
- url: "/LLJ/saveRemarksGid",
- data: {
- gid: this.formData.id,
- remarks: this.remarks,
- releaseNo: this.formData.releaseNo,
- }
- }).then(res => {
- if (res.data.tbBillList > 0) {
- this.formData.remarks = this.remarks;
- this.remarksPopup = !this.remarksPopup;
- this.$showMessage("淇濆瓨鎴愬姛");
- }
- })
- }
- },
- toImage() {
- uni.navigateTo({
- url: 'ImageItem?id=' + this.formData.id
- });
- },
- getTable() {
- this.$post({
- url: "/LLJ/setJYItem",
- data: {
- itemId: this.formData.itemId,
- quantity: this.formData.fcovertQty,
- releaseNo: this.formData.releaseNo
- }
- }).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: "/LLJ/saveItem",
- data: {
- releaseNo: this.formData.releaseNo,
- items: this.tableData,
- userNo: this.$loginInfo.account,
- gid: this.formData.id
- }
- }).then(res => {
- this.formData.id = res.data.tbBillList;
- this.isShowTable = false;
- this.isUpdate = false;
- this.init();
-
- })
- }
- },
- onShow() {
- //姣忔杩涘叆椤甸潰閮戒細鎵ц鐨勬柟娉�
- if (this.formData.id) {
- this.init();
- }
- }
- };
+ this.$post({
+ url: "/LLJ/getJYItem",
+ data: {
+ id: this.formData.id,
+ releaseNo: this.formData.releaseNo
+ }
+ }).then(res1 => {
+ let tableData = res1.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;
+ if (this.tableData.length === 0) {
+ this.isShowTable = true;
+ }
+ })
+ }
+ });
+ },
+ toDetail(item) {
+ if (this.isUpdate) {
+ uni.showToast({
+ icon: "none",
+ title: "璇峰厛鐢熸垚妫�楠岄」鐩�",
+ duration: 2000,
+ });
+ } else {
+ uni.navigateTo({
+ url: 'detail?mainId=' + item.id
+ });
+ }
+ },
+ saveRemarks() {
+ // 纭繚琛ㄥ崟鏁版嵁瀛樺湪
+ if (!this.formData) return;
+
+ this.remarksPopup = !this.remarksPopup;
+ this.remarks = this.formData.remarks || '';
+ this.isPopupAnimated = true;
+ },
+ editRemarks() {
+ if (this.remarks && this.formData.id) {
+ this.$post({
+ url: "/LLJ/saveRemarksGid",
+ data: {
+ gid: this.formData.id,
+ remarks: this.remarks,
+ releaseNo: this.formData.releaseNo,
+ }
+ }).then(res => {
+ if (res.data.tbBillList > 0) {
+ this.formData.remarks = this.remarks;
+ this.remarksPopup = false;
+ this.$showMessage("淇濆瓨鎴愬姛");
+ } else {
+ this.$showMessage("淇濆瓨澶辫触");
+ }
+ }).catch(() => {
+ this.$showMessage("淇濆瓨澶辫触锛岃閲嶈瘯");
+ });
+ } else if (!this.formData.id) {
+ this.$showMessage("璇峰厛鐢熸垚妫�楠屽崟");
+ } else {
+ this.$showMessage("璇疯緭鍏ヤ笉鍚堟牸鎻忚堪");
+ }
+ },
+ toImage() {
+ uni.navigateTo({
+ url: 'ImageItem?id=' + this.formData.id
+ });
+ },
+ getTable() {
+ this.$post({
+ url: "/LLJ/setJYItem",
+ data: {
+ itemId: this.formData.itemId,
+ quantity: this.formData.fcovertQty,
+ releaseNo: this.formData.releaseNo
+ }
+ }).then(res => {
+ if (res.data.tbBillList.length > 0) {
+ this.tableData = res.data.tbBillList;
+ 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: "/LLJ/saveItem",
+ data: {
+ releaseNo: this.formData.releaseNo,
+ items: this.tableData,
+ userNo: this.$loginInfo.account,
+ gid: this.formData.id
+ }
+ }).then(res => {
+ this.formData.id = res.data.tbBillList;
+ this.isShowTable = false;
+ this.isUpdate = false;
+ this.init();
+ })
+ },
+ // 鎻愮ず妗嗙浉鍏虫柟娉�
+ showTooltip(value, event, title = '') {
+ if (!value) return;
+
+ // 闃叉浜嬩欢鍐掓场
+ event.stopPropagation();
+
+ // 鑾峰彇鐐瑰嚮浣嶇疆锛屾敮鎸佽Е鎽镐簨浠�
+ const clientX = event.clientX || (event.touches && event.touches[0].clientX) || 0;
+ const clientY = event.clientY || (event.touches && event.touches[0].clientY) || 0;
+
+ // 璁剧疆鎻愮ず妗嗗唴瀹瑰拰浣嶇疆
+ this.tooltipTitle = title;
+ this.tooltipValue = value;
+
+ // 璁$畻鎻愮ず妗嗕綅缃紝閬垮厤瓒呭嚭灞忓箷
+ const screenWidth = uni.getSystemInfoSync().windowWidth;
+ const screenHeight = uni.getSystemInfoSync().windowHeight;
+ const tooltipWidth = 240; // 鎻愮ず妗嗗搴�
+ const tooltipHeight = 120; // 鎻愮ず妗嗛珮搴�
+
+ // 璁$畻X鍧愭爣锛岄槻姝㈣秴鍑哄睆骞曞彸渚�
+ let x = clientX + 20;
+ if (x + tooltipWidth > screenWidth) {
+ x = Math.max(10, clientX - tooltipWidth - 20);
+ this.tooltipArrowTransform = 'translateX(-50%) rotate(0deg)';
+ } else {
+ this.tooltipArrowTransform = 'translateX(-50%) rotate(180deg)';
+ }
+
+ // 璁$畻Y鍧愭爣锛岄槻姝㈣秴鍑哄睆骞曢《閮ㄥ拰搴曢儴
+ let y = clientY - tooltipHeight - 20;
+ if (y < 0) {
+ y = clientY + 20;
+ this.tooltipArrowTransform = 'translateX(-50%) rotate(180deg) translateY(-100%)';
+ } else if (y + tooltipHeight > screenHeight) {
+ y = screenHeight - tooltipHeight - 10;
+ }
+
+ this.tooltipX = x;
+ this.tooltipY = y;
+
+ // 鏄剧ず鎻愮ず妗嗗苟娣诲姞鍔ㄧ敾
+ this.showTooltipBox = true;
+ setTimeout(() => {
+ this.tooltipBoxAnimated = true;
+ }, 10);
+ },
+ hideTooltip() {
+ this.tooltipBoxAnimated = false;
+ setTimeout(() => {
+ this.showTooltipBox = false;
+ }, 200);
+ },
+ getStatusDescription(status) {
+ const descriptions = {
+ '鍚堟牸': '璇ユ楠岄」鐩凡瀹屾垚锛岀粨鏋滅鍚堣川閲忔爣鍑嗐��',
+ '涓嶅悎鏍�': '璇ユ楠岄」鐩湭閫氳繃锛岀粨鏋滀笉绗﹀悎璐ㄩ噺鏍囧噯銆俓n璇锋煡鐪嬩笉鍚堟牸鎻忚堪浜嗚В璇︽儏銆�',
+ '鏈楠�': '璇ユ楠岄」鐩皻鏈繘琛屾娴嬶紝璇峰強鏃跺畨鎺掓楠屻��'
+ };
+ return descriptions[status] || status;
+ }
+ },
+ onShow() {
+ //姣忔杩涘叆椤甸潰閮戒細鎵ц鐨勬柟娉�
+ if (this.formData.id) {
+ this.init();
+ }
+ },
+ onUnload() {
+ // 椤甸潰鍗歌浇鏃堕殣钘忔彁绀烘
+ this.showTooltipBox = false;
+ }
+};
</script>
+
<style>
- .form-group {
- display: flex;
- align-items: center;
- border-bottom: 1px solid #c9c9c9;
- }
+/* 鍩虹閰嶈壊鏂规 */
+:root {
+ --primary-color: #3b82f6; /* 涓昏摑鑹� - 涓撲笟鎰� */
+ --primary-dark: #2563eb; /* 娣辫摑 - 寮鸿皟 */
+ --primary-light: #bfdbfe; /* 娴呰摑 - 鑳屾櫙 */
+ --secondary-color: #64748b; /* 娆¤壊璋� - 鐏拌壊钃� */
+ --success-color: #10b981; /* 鎴愬姛 - 缁胯壊 */
+ --warning-color: #f59e0b; /* 璀﹀憡 - 姗欒壊 */
+ --danger-color: #ef4444; /* 鍗遍櫓 - 绾㈣壊 */
+ --info-color: #06b6d4; /* 淇℃伅 - 闈掕壊 */
+ --text-primary: #1e293b; /* 涓绘枃鏈� - 娣辩伆 */
+ --text-secondary: #64748b; /* 娆℃枃鏈� - 涓伆 */
+ --text-tertiary: #94a3b8; /* 杈呭姪鏂囨湰 - 娴呯伆 */
+ --bg-primary: #f8fafc; /* 涓昏儗鏅� - 鏋佹祬鐏� */
+ --bg-secondary: #e2e8f0; /* 娆¤儗鏅� - 娴呯伆 */
+ --card-bg: #ffffff; /* 鍗$墖鑳屾櫙 - 鐧借壊 */
+ --border-color: #e2e8f0; /* 杈规 - 娴呯伆 */
+ --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
+ --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
+ --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
+}
- .form-label {
- margin-bottom: 0;
- padding: 5px;
- }
+/* 椤甸潰鏁翠綋鏍峰紡 */
+.page-container {
+ padding: 16px;
+ background-color: var(--bg-primary);
+ min-height: 100vh;
+ display: flex;
+ flex-direction: column;
+}
- .form-input {
- flex: 1;
- margin-bottom: 0;
- padding: 5px;
- }
+/* 鍗$墖鏍峰紡 */
+.form-card, .table-card {
+ background-color: var(--card-bg);
+ border-radius: 16px;
+ box-shadow: var(--shadow-md);
+ margin-bottom: 20px;
+ overflow: hidden;
+ transition: transform 0.3s, box-shadow 0.3s;
+}
- .picker {
- flex: 1;
- margin-bottom: 0;
- padding: 5px;
- font-size: 12px;
- }
+.form-card:hover, .table-card:hover {
+ transform: translateY(-2px);
+ box-shadow: var(--shadow-lg);
+}
- .uni-form-item {
- display: flex;
- border-bottom: 1px solid #c9c9c9;
- }
+.form-title, .table-title {
+ background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
+ padding: 20px 30px;
+ font-size: 20px;
+ font-weight: 600;
+ color: white;
+ display: flex;
+ align-items: center;
+}
- .edit {
- background-color: white;
- }
+.title-icon {
+ margin-right: 12px;
+ font-size: 24px;
+}
- /* 榛樿鏍峰紡 */
- .list-container {
- height: 60vh;
- /* 璁剧疆鍒楄〃瀹瑰櫒鐨勯珮搴︿负鍓╀綑绌洪棿锛屽苟鍑忓幓琛ㄥ崟瀹瑰櫒鐨勯珮搴� */
- overflow-y: auto;
- /* 鍏佽鍒楄〃瀹瑰櫒鍨傜洿婊氬姩 */
- padding: 10px;
- /* 鍙�夛細娣诲姞涓�浜涘唴杈硅窛锛屼娇鍒楄〃鍐呭鏇寸編瑙� */
- }
+/* 琛ㄥ崟鏍峰紡 */
+.form-container {
+ padding: 24px 30px;
+}
- /* 鍦ㄥ皬灞忓箷璁惧涓婏紝閲嶇疆楂樺害涓洪�傚簲灞忓箷 */
- @media (max-width: 768px) {
- .list-container {
- height: calc(100vh - 376px);
- /* 閫傚綋璋冩暣楂樺害 */
- }
- }
+.form-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
+ gap: 20px;
+}
- .form-container {
- padding: 10px;
- /* 鍙�夛細娣诲姞涓�浜涘唴杈硅窛锛屼娇琛ㄥ崟鍐呭鏇寸編瑙� */
- }
+.form-group {
+ display: flex;
+ align-items: flex-start;
+ border-bottom: 1px solid var(--border-color);
+ padding: 12px 0;
+ transition: all 0.2s;
+}
- .th {
- background-color: lightskyblue;
- color: #FFFFFF;
- }
+.form-group:hover {
+ border-bottom-color: var(--primary-color);
+}
- .plus-button {
- line-height: 59px;
- font-size: 24px;
- cursor: pointer;
- z-index: 1000;
- margin-bottom: 10px;
- }
+.form-label {
+ width: 100px;
+ color: var(--text-secondary);
+ font-size: 14px;
+ font-weight: 500;
+ margin-top: 4px;
+}
- .overlay {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: rgba(0, 0, 0, 0.5);
- display: flex;
- justify-content: center;
- align-items: center;
- }
+.form-input {
+ flex: 1;
+ font-size: 14px;
+ color: var(--text-primary);
+ border: none;
+ outline: none;
+ background-color: transparent;
+ padding: 8px 0;
+}
- .popup {
- background-color: #fff;
- padding: 20px;
- border: 1px solid #ccc;
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
- width: 68vw;
- /* 璁剧疆瀹藉害涓鸿鍙e搴︾殑80% */
- height: 25vh;
- /* 璁剧疆楂樺害涓鸿鍙i珮搴︾殑80% */
- }
+.form-input:focus {
+ color: var(--primary-color);
+}
+
+/* 琛ㄦ牸鏍峰紡 */
+.list-container {
+ padding: 24px 30px;
+}
+
+.th {
+ background-color: var(--primary-color);
+ color: white;
+ font-weight: 600;
+ font-size: 14px;
+ padding: 16px 12px;
+}
+
+.table-row {
+ transition: background-color 0.2s;
+}
+
+.hover-effect {
+ background-color: var(--primary-light) !important;
+}
+
+.result-badge {
+ padding: 6px 12px;
+ border-radius: 20px;
+ font-size: 12px;
+ font-weight: 500;
+ display: inline-block;
+}
+
+.pass {
+ background-color: rgba(16, 185, 129, 0.1);
+ color: var(--success-color);
+}
+
+.fail {
+ background-color: rgba(239, 68, 68, 0.1);
+ color: var(--danger-color);
+}
+
+.pending {
+ background-color: rgba(245, 158, 11, 0.1);
+ color: var(--warning-color);
+}
+
+/* 鎸夐挳鏍峰紡 */
+.action-buttons {
+ display: flex;
+ flex-direction: column; /* 鍨傜洿鎺掑垪鎸夐挳 */
+ gap: 12px; /* 鎸夐挳闂磋窛 */
+ padding: 0 16px 20px;
+}
+
+.button-group {
+ width: 100%; /* 姣忎釜鎸夐挳缁勫崰婊″搴� */
+}
+
+.action-btn {
+ width: 100%;
+ height: 48px;
+ line-height: 48px;
+ border-radius: 8px;
+ font-size: 14px;
+ font-weight: 500;
+ transition: all 0.2s;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: none;
+ cursor: pointer;
+}
+
+.btn-primary {
+ background-color: var(--primary-color);
+ color: white;
+ box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2), 0 2px 4px -1px rgba(59, 130, 246, 0.1);
+}
+
+.btn-primary:hover {
+ background-color: var(--primary-dark);
+ box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3), 0 4px 6px -2px rgba(59, 130, 246, 0.1);
+ transform: translateY(-1px);
+}
+
+.btn-primary:active {
+ transform: translateY(0);
+ box-shadow: 0 2px 4px -1px rgba(59, 130, 246, 0.2);
+}
+
+.btn-secondary {
+ background-color: var(--secondary-color);
+ color: white;
+}
+
+.btn-secondary:hover {
+ background-color: #475569;
+}
+
+.btn-tertiary {
+ background-color: var(--info-color);
+ color: white;
+}
+
+.btn-tertiary:hover {
+ background-color: #0891b2;
+}
+
+.btn-quaternary {
+ background-color: var(--warning-color);
+ color: white;
+}
+
+.btn-quaternary:hover {
+ background-color: #d97706;
+}
+
+.btn-accent {
+ background-color: var(--success-color);
+ color: white;
+}
+
+.btn-accent:hover {
+ background-color: #059669;
+}
+
+.btn-success {
+ background-color: #16a34a;
+ color: white;
+}
+
+.btn-success:hover {
+ background-color: #15803d;
+}
+
+.btn-danger {
+ background-color: var(--danger-color);
+ color: white;
+}
+
+.btn-danger:hover {
+ background-color: #dc2626;
+}
+
+.btn-light {
+ background-color: var(--bg-secondary);
+ color: var(--text-primary);
+}
+
+.btn-light:hover {
+ background-color: #cbd5e1;
+}
+
+.btn-warn {
+ background-color: var(--warning-color);
+ color: white;
+}
+
+.btn-normal {
+ background-color: var(--bg-secondary);
+ color: var(--text-primary);
+}
+
+.btn-disabled {
+ background-color: #e2e8f0 !important;
+ color: #94a3b8 !important;
+ cursor: not-allowed !important;
+ box-shadow: none !important;
+ transform: none !important;
+}
+
+/* 寮瑰嚭灞傛牱寮� */
+.overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0, 0, 0, 0.5);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ z-index: 1000;
+ opacity: 0;
+ visibility: hidden;
+ transition: opacity 0.3s, visibility 0.3s;
+}
+
+.overlay.active {
+ opacity: 1;
+ visibility: visible;
+}
+
+.popup {
+ background-color: var(--card-bg);
+ border-radius: 16px;
+ padding: 30px;
+ box-shadow: var(--shadow-lg);
+ width: 90%;
+ max-width: 500px;
+ transform: scale(0.95);
+ transition: transform 0.3s, opacity 0.3s;
+ opacity: 0;
+}
+
+.overlay.active .popup {
+ transform: scale(1);
+ opacity: 1;
+}
+
+.popup-scale {
+ animation: scaleIn 0.3s ease-out;
+}
+
+@keyframes scaleIn {
+ 0% { transform: scale(0.9); opacity: 0; }
+ 100% { transform: scale(1); opacity: 1; }
+}
+
+.popup-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 20px;
+ position: relative;
+}
+
+.popup-title {
+ font-size: 18px;
+ font-weight: 600;
+ color: var(--text-primary);
+}
+
+.close-btn {
+ font-size: 24px;
+ color: var(--text-tertiary);
+ cursor: pointer;
+ transition: color 0.2s;
+}
+
+.close-btn:hover {
+ color: var(--text-primary);
+}
+
+.popup-buttons {
+ display: flex;
+ gap: 12px;
+ margin-top: 20px;
+}
+
+/* 鎻愮ず妗嗘牱寮� */
+.tooltip-container {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ pointer-events: none;
+ z-index: 2000;
+}
+
+.tooltip {
+ position: absolute;
+ background: white;
+ color: var(--text-primary);
+ border-radius: 12px;
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.06);
+ max-width: 240px;
+ min-width: 180px;
+ word-break: break-word;
+ opacity: 0;
+ transform: scale(0.95);
+ transition: opacity 0.2s, transform 0.2s;
+ pointer-events: none;
+ z-index: 2001;
+ overflow: hidden;
+ border: 1px solid #e2e8f0;
+}
+
+.tooltip.active {
+ opacity: 1;
+ transform: scale(1);
+}
+
+.tooltip-content {
+ padding: 14px 18px;
+}
+
+.tooltip-title {
+ font-size: 14px;
+ font-weight: 600;
+ margin-bottom: 8px;
+ color: var(--primary-color);
+ border-bottom: 1px solid #e2e8f0;
+ padding-bottom: 6px;
+}
+
+.tooltip-body {
+ font-size: 13px;
+ line-height: 1.6;
+ color: var(--text-secondary);
+}
+
+.tooltip-arrow {
+ position: absolute;
+ width: 16px;
+ height: 16px;
+ background: white;
+ transform: translateX(-50%) rotate(45deg);
+ z-index: -1;
+ border: 1px solid #e2e8f0;
+}
+
+.cursor-pointer {
+ cursor: pointer;
+}
+
+/* 鍝嶅簲寮忚璁¤皟鏁� */
+@media (max-width: 576px) {
+ .form-grid {
+ grid-template-columns: 1fr;
+ }
+
+ .form-label {
+ width: 80px;
+ font-size: 13px;
+ }
+
+ .form-input {
+ font-size: 13px;
+ }
+
+ .action-btn {
+ height: 44px;
+ line-height: 44px;
+ font-size: 13px;
+ }
+
+ .popup {
+ padding: 24px;
+ }
+
+ .tooltip {
+ max-width: 200px;
+ min-width: 160px;
+ border-radius: 8px;
+ }
+
+ .tooltip-content {
+ padding: 10px 14px;
+ }
+
+ .tooltip-title {
+ font-size: 13px;
+ margin-bottom: 6px;
+ padding-bottom: 4px;
+ }
+
+ .tooltip-body {
+ font-size: 12px;
+ }
+}
</style>
\ No newline at end of file
--
Gitblit v1.9.3