From a177ad6532fcdc1e9d2b3910276bd88d04791469 Mon Sep 17 00:00:00 2001
From: fcx <2246384483@qq.com>
Date: 星期二, 02 十二月 2025 20:19:13 +0800
Subject: [PATCH] 1.XJ新增照片查看,不良描述
---
pages/QC/SJ/detail.vue | 1385 +++++++++++++++++++++++++++++---------------------------
1 files changed, 719 insertions(+), 666 deletions(-)
diff --git a/pages/QC/SJ/detail.vue b/pages/QC/SJ/detail.vue
index 2cde35f..c0a3ad8 100644
--- a/pages/QC/SJ/detail.vue
+++ b/pages/QC/SJ/detail.vue
@@ -1,751 +1,804 @@
<template>
- <view class="container">
- <!-- 澶撮儴 -->
- <view class="header">
- <view class="title">棣栨妫�楠岄」鐩槑缁�</view>
- <view class="order-number">褰撳墠妫�楠屽崟鍙�: {{releaseNo}}</view>
- </view>
+ <view class="container">
+ <!-- 澶撮儴 -->
+ <view class="header">
+ <view class="title">棣栨椤圭洰鏄庣粏</view>
+ <view class="order-number">褰撳墠妫�楠屽崟鍙�: {{ formData.billNo }}</view>
+ </view>
- <!-- 鏍囩鏍� -->
- <view class="tabs">
- <view v-for="(tab, index) in tabs" :key="index" class="tab" :class="{active: currentTab === index}"
- @tap="switchTab(index,tab.id)">
- {{ tab.projName }}
- </view>
- </view>
- <view class="tab-content">
- <!-- 鍩烘湰淇℃伅 -->
- <view class="section">
- <view class="section-header">鍩烘湰淇℃伅</view>
- <view class="section-body">
- <view class="info-grid">
- <view class="info-item">
- <view class="info-label">椤圭洰鍚嶇О</view>
- <view class="info-value">{{ formData.projName }}</view>
- </view>
- <view class="info-item">
- <view class="info-label">浣跨敤浠〃</view>
- <view class="info-value">{{ formData.usingInstruments }}</view>
- </view>
- <view class="info-item">
- <view class="info-label">妫�楠屾暟閲�</view>
- <view class="info-value">{{ formData.levelNum }}</view>
- </view>
+ <!-- 鏍囩鏍� -->
+ <view class="tabs">
+ <view v-for="(tab, index) in tabs" :key="index" :class="{active: currentTab === index}" class="tab"
+ @tap="switchTab(index, tab.id)">
+ {{ tab.projName || tab.fcheckItem || '椤圭洰' + (index + 1) }}
+ </view>
+ </view>
- <view v-if="formData.minValue!=null" class="info-item">
- <view class="info-label">涓嬮檺</view>
- <view class="info-value">{{ formData.minValue }}</view>
- </view>
- <view v-if="formData.standardValue!=null" class="info-item">
- <view class="info-label">鏍囧噯鍊�</view>
- <view class="info-value">{{ formData.standardValue }}</view>
- </view>
- <view v-if="formData.maxValue!=null" class="info-item">
- <view class="info-label">涓婇檺</view>
- <view class="info-value">{{ formData.maxValue }}</view>
- </view>
- </view>
- </view>
- </view>
+ <view class="tab-content">
+ <!-- 鍩烘湰淇℃伅 -->
+ <view class="section">
+ <view class="section-header">鍩烘湰淇℃伅</view>
+ <view class="section-body">
+ <view class="info-grid">
+ <view class="info-item">
+ <view class="info-label">椤圭洰鍚嶇О</view>
+ <view class="info-value">{{ formData.projName }}</view>
+ </view>
+ <view class="info-item">
+ <view class="info-label">璐ㄩ噺瑕佹眰</view>
+ <view class="info-value">{{ formData.itemMod }}</view>
+ </view>
+ <view class="info-item">
+ <view class="info-label">妫�楠屾柟娉�</view>
+ <view class="info-value">{{ formData.inspectionMethod }}</view>
+ </view>
+ <view class="info-item">
+ <view class="info-label">浣跨敤浠〃</view>
+ <view class="info-value">{{ formData.usingInstruments }}</view>
+ </view>
+ <view class="info-item">
+ <view class="info-label">妫�楠屾暟</view>
+ <view class="info-value">{{ formData.levelNum }}</view>
+ </view>
+ <view v-if="formData.minValue" class="info-item">
+ <view class="info-label">涓嬮檺</view>
+ <view class="info-value">{{ formData.minValue }}</view>
+ </view>
+ <view v-if="formData.standardValue" class="info-item">
+ <view class="info-label">鏍囧噯鍊�</view>
+ <view class="info-value">{{ formData.standardValue }}</view>
+ </view>
+ <view v-if="formData.maxValue" class="info-item">
+ <view class="info-label">涓婇檺</view>
+ <view class="info-value">{{ formData.maxValue }}</view>
+ </view>
+ <view class="info-item">
+ <view class="info-label">鏇存柊浜�</view>
+ <view class="info-value">{{ formData.updater }}</view>
+ </view>
+ <view class="info-item">
+ <view class="info-label">鏇存柊鏃堕棿</view>
+ <view class="info-value">{{ formData.updateTime }}</view>
+ </view>
+ </view>
+ </view>
+ </view>
- <!-- 瑙勬牸瑕佹眰 -->
- <view class="section">
- <view class="section-header">璐ㄩ噺瑕佹眰</view>
- <view class="section-body">
- <text class="spec-text">{{ formData.itemMod }}</text>
- </view>
- </view>
- <!-- 瑙勬牸瑕佹眰 -->
- <view class="section">
- <view class="section-header">妫�楠屾弿杩�</view>
- <view class="section-body">
- <text class="spec-text">{{ formData.inspectionMethod }}</text>
- </view>
- </view>
- <!-- 妫�楠岀粨鏋� -->
- <view class="section">
- <view class="section-header">妫�楠岀粨鏋�</view>
- <view class="section-body">
- <view v-if="formData.result!=null" class="result-preview">
- <view class="info-label">棰勮缁撴灉</view>
- <view class="info-value"><b>{{formData.result}}</b></view>
- </view>
+ <!-- 妫�楠岀粨鏋� -->
+ <view class="section">
+ <view class="section-header">妫�楠岀粨鏋�</view>
+ <view class="section-body">
+ <view class="info-grid">
+ <view v-if="formData.result" class="info-item">
+ <view class="info-label">棰勮缁撴灉</view>
+ <view class="info-value">{{ formData.result }}</view>
+ </view>
+ <view v-if="formData.remarks" class="info-item">
+ <view class="info-label">澶囨敞</view>
+ <view class="info-value danger">{{ formData.remarks }}</view>
+ </view>
+ </view>
+ </view>
+ </view>
- <view v-if="formData.remarks!=null" class="result-ng">
- <view class="info-label">涓嶈壇鎻忚堪</view>
- <view class="info-value danger">{{formData.remarks}}</view>
- </view>
- </view>
- </view>
+ <!-- 缁撴灉褰曞叆 -->
+ <view class="section">
+ <view class="section-header">妫�楠岀粨鏋滃綍鍏�</view>
+ <view class="section-body">
+ <view v-if="!formData.maxValue && !formData.minValue" class="info-item edit">
+ <view class="info-label" style="color: #F56C6C">鎻愮ず</view>
+ <view class="info-value" style="color: #F56C6C">娌℃湁鏈�澶у�煎拰鏈�灏忓�兼椂濉啓0锛堟湭閫氳繃妫�楠岋級鎴�1锛堥�氳繃妫�楠岋級</view>
+ </view>
- <!-- 缁撴灉褰曞叆 -->
- <view class="section">
- <view class="section-header">妫�楠岀粨鏋滃綍鍏�</view>
- <view class="section-body">
- <view class="input-group input1">
- <view class="input-wrapper">
+ <view class="input-group input1">
+ <view class="input-wrapper">
+ <button class="btn upload-btn" @click="chooseImage">
+ <uni-icons type="upload" size="16" color="#fff"></uni-icons>
+ 涓婁紶/鏌ョ湅鍥剧墖
+ </button>
+ <button class="btn upload-btn" @click="saveRemarks">
+ <uni-icons type="compose" size="16" color="#fff"></uni-icons>
+ 澶囨敞
+ </button>
+ <input v-if="(tableData.length < formData.levelNum)" v-model="formData.fcheckResu" class="result-input"
+ placeholder="璇疯緭鍏ユ楠岀粨鏋�..." type="number"/>
+ <button v-if="(tableData.length < formData.levelNum)" class="btn primary-btn" @click="submit" style="margin: 0px;">淇濆瓨缁撴灉
+ </button>
+ </view>
+ </view>
- <button class="btn upload-btn" @tap="chooseImage">
- <uni-icons type="upload" size="16" color="#fff"></uni-icons>
- 涓婁紶/鏌ョ湅鍥剧墖
- </button>
- <button v-if="this.current" class="btn upload-btn" @tap="upRemarks">
- <uni-icons type="compose" size="16" color="#fff"></uni-icons>
- 涓嶈壇鎻忚堪
- </button>
- <input v-if="(tableData.length < formData.levelNum)" @input="search($event)"
- v-model="inputTxt" type="text" class="result-input" placeholder="璇疯緭鍏ユ楠岀粨鏋�..."
- placeholder-class="placeholder" />
- <button v-if="(tableData.length < formData.levelNum)"
- style="margin: 0px;background-color: #3498db;color:#ffffff ;" class="btn primary-btn"
- @tap="saveResult">淇濆瓨缁撴灉</button>
- </view>
- </view>
+ <!-- 鍝嶅簲寮忚璁$殑绗簩涓緭鍏ョ粍 -->
+ <view class="input-group input2">
+ <view class="input-wrapper">
+ <button class="btn upload-btn" @click="chooseImage ">
+ <uni-icons type="upload" size="16" color="#fff"></uni-icons>
+ 涓婁紶/鏌ョ湅鍥剧墖
+ </button>
+ <button v-if="current" class="btn upload-btn" @click="saveRemarks ">
+ <uni-icons type="compose" size="16" color="#fff"></uni-icons>
+ 澶囨敞
+ </button>
+ </view>
+ <view class="input-wrapper" style="margin-top: 15px;">
+ <input v-if="(tableData.length < formData.levelNum)" v-model="formData.fcheckResu" class="result-input"
+ placeholder="璇疯緭鍏ユ楠岀粨鏋�..." type="number"/>
+
+ <button v-if="tableData.length < formData.levelNum" class="btn primary-btn" @click="submit" style="margin: 0px;" >淇濆瓨缁撴灉
+ </button>
+ </view>
+ </view>
+ </view>
+ </view>
- <view class="input-group input2">
- <view class="input-wrapper">
+ <!-- 缁撴灉琛ㄦ牸 -->
+ <view v-if="tableData.length > 0" class="table-container">
+ <view class="table-header">
+ <view class="th">缂栧彿</view>
+ <view class="th">妫�楠岀粨鏋�</view>
+ <view class="th" v-if="current">鎿嶄綔</view>
+ </view>
- <button class="btn upload-btn" @tap="chooseImage">
- <uni-icons type="upload" size="16" color="#fff"></uni-icons>
- 涓婁紶/鏌ョ湅鍥剧墖
- </button>
- <button v-if="this.current" class="btn upload-btn" @tap="upRemarks">
- <uni-icons type="compose" size="16" color="#fff"></uni-icons>
- 涓嶈壇鎻忚堪
- </button>
- </view>
- <view class="input-wrapper" style="margin-top: 15px;">
+ <view v-for="(item, index) in tableData" :key="index" class="table-row">
+ <view class="td">{{ index + 1 }}</view>
+ <view class="td">
+ <view :class="['result-badge', item.fcheckResu]">
+ {{ item.fcheckResu }}
+ </view>
+ </view>
+ <view class="td" v-if="current" >
+ <button v-if="!isNumber" class="btn danger-btn" @click="numberEdit(item)">
+ {{ editResult(item.fcheckResu) }}
+ </button>
+ <button v-if="isNumber" class="btn danger-btn" @click="toDetail(item)">
+ 淇敼
+ </button>
+ </view>
+ </view>
+ </view>
- <input v-if="(tableData.length < formData.checkQyt)" @input="search($event)"
- v-model="inputTxt" type="text" class="result-input" placeholder="璇疯緭鍏ユ楠岀粨鏋�..."
- placeholder-class="placeholder" />
- <button v-if="(tableData.length < formData.checkQyt)"
- style="margin: 0px;background-color: #3498db;color:#ffffff ;" class="btn primary-btn"
- @tap="saveResult">淇濆瓨缁撴灉</button>
- </view>
- </view>
- </view>
- </view>
+ <!-- 寮瑰嚭灞� - 澶囨敞 -->
+ <view v-if="remarksPopup" class="overlay">
+ <view class="popup">
+ <h3>淇敼澶囨敞</h3>
+ <form>
+ <view class="form-group">
+ <label class="form-label">澶囨敞:</label>
+ <input v-model="remarks" class="form-input" type="text"/>
+ </view>
+ <view class="popup-buttons">
+ <button class="btn primary-btn" type="warn" @click="editRemarks">淇敼</button>
+ <button class="btn cancel-btn" @click="remarksPopup = !remarksPopup">鍙栨秷</button>
+ </view>
+ </form>
+ </view>
+ </view>
- <!-- 缁撴灉琛ㄦ牸 -->
- <view v-if="tableData.length>0" class="table-container">
- <view class="table-header">
- <view class="th">缂栧彿</view>
- <view class="th">妫�楠岀粨鏋�<i style="color: rgb(0 212 68);"
- v-if="!(tableData.length < formData.levelNum)">锛堣緭鍏ュ凡瀹屾垚锛�</i></view>
- <view class="th" v-if="current">鎿嶄綔</view>
- </view>
-
- <view v-for="(item, index) in tableData" :key="index" class="table-row">
- <view class="td">{{ index + 1 }}</view>
- <view v-if="!isNumber" class="td">
- <view :class="['result-badge', 'OK']" v-if="item.fcheckResu==1">
- OK
- </view>
- <view :class="['result-badge', 'NG']" v-if="item.fcheckResu==0">
- NG
- </view>
- </view>
- <view v-if="isNumber" class="td">
- <view :class="['result-badge', item.fcheckResu]">
- {{ item.fcheckResu }}
- </view>
- </view>
- <view class="td" v-if="current">
- <button v-if="!isNumber" class="btn danger-btn" @tap="toggleResult(item)">
- {{ editResult(item.fcheckResu) }}
- </button>
- <button v-if="isNumber" class="btn danger-btn" @tap="toDetail(item)">
- 淇敼
- </button>
- </view>
- </view>
- </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 class="updateBut" type="warn" @click="editRemarks">淇敼</button>
- <button @click="remarksPopup = !remarksPopup">鍙栨秷</button>
- </form>
- </view>
- </view>
- <view v-if="showPopup" class="overlay">
- <view class="popup">
- <h3>淇敼妫�楠岀粨鏋�</h3>
- <form :modelValue="editData">
- <view class="form-group">
- <label class="form-label">妫�楠岀粨鏋�:</label>
- <input class="form-input" type="text" v-model="editData.fcheckResu" />
- </view>
- <button type="warn" @click="eidt">淇敼</button>
- <button @click="showPopup = !showPopup">鍙栨秷</button>
- </form>
- </view>
- </view>
-
- </view>
- </view>
+ <!-- 寮瑰嚭灞� - 淇敼妫�楠岀粨鏋� -->
+ <view v-if="showPopup" class="overlay">
+ <view class="popup">
+ <h3>淇敼妫�楠岀粨鏋�</h3>
+ <form :modelValue="editData">
+ <view class="form-group">
+ <label class="form-label">妫�楠岀粨鏋�:</label>
+ <input v-model="editData.fcheckResu" class="form-input" type="text"/>
+ </view>
+ <view class="popup-buttons">
+ <button class="btn primary-btn" type="warn" @click="eidt">淇敼</button>
+ <button class="btn cancel-btn" @click="showPopup = !showPopup">鍙栨秷</button>
+ </view>
+ </form>
+ </view>
+ </view>
+ </view>
+ </view>
</template>
<script>
- import {
- compile
- } from "vue";
+export default {
+ data() {
+ return {
+ formData: {},
+ isNumber: false,
+ checkItem: "",
+ id: 0,
+ gid: 0,
+ billNo: "",
+ showPopup: false,
+ editData: {},
+ tableData: [],
+ base64Image: "",
+ isShowImg: false,
+ remarks: "",
+ remarksPopup: false,
+ currentTab: 0,
+ tabs: [],
+ current: true // 鎺у埗鏄惁鍙紪杈�
+ }
+ },
+ methods: {
+ // 鍒囨崲鏍囩椤�
+ switchTab(index, id) {
+ this.currentTab = index;
+ this.id = id;
+ this.refreshResult();
+ },
- export default {
- data() {
- return {
- formData: {},
- tableData: {},
- mainId: '',
- isNumber: false,
- currentTab: 0,
- tabs: [],
- inputResult: '',
- remarksPopup: false,
- showPopup: false,
- editData: {},
- inputTxt: '',
- formID: '',
- releaseNo: '',
- current: false
- }
- },
- methods: {
- switchTab(index, mainIds) {
- this.currentTab = index
- this.mainId = mainIds;
- this.refreshResult();
- },
- //妫�娴嬭緭鍏ユ鐨勮緭鍏ワ紝骞剁粰鍙橀噺璧嬪��
- search(event) {
- this.formData.fcheckResu = event.detail.value;
- },
- toggleResult(item) {
- let fstand = "鈭�";
- let fcheckResu = 1;
+ // 鍔犺浇鏍囩椤�
+ loadTabItems() {
+ this.$post({
+ url: "/SJ/getQSItems",
+ data: {
+ pid: this.gid,
+ }
+ }).then(res => {
+ if (res.data && res.data.tbBillList) {
+ this.tabs = res.data.tbBillList;
+ // 鎸夋娴嬬粨鏋滄帓搴忥紝鏈畬鎴愮殑鎺掑湪鍓嶉潰
+ this.tabs.sort((a, b) => {
+ if (a.result === '鏈畬鎴�' && b.result !== '鏈畬鎴�') {
+ return -1;
+ } else if (a.result !== '鏈畬鎴�' && b.result === '鏈畬鎴�') {
+ return 1;
+ } else {
+ return 0;
+ }
+ });
+ } else {
+ // 娌℃湁椤圭洰鏃惰嚦灏戞坊鍔犲綋鍓嶉」鐩埌鏍囩
+ this.tabs = [{id: this.id, projName: this.formData.projName || '褰撳墠椤圭洰'}];
+ }
+ });
+ },
- if (item.fcheckResu == '1') {
- fstand = "脳";
- fcheckResu = 0;
- }
+ previewImage() {
+ uni.previewImage({
+ urls: [this.base64Image],
+ });
+ },
+ editResult(fcheckResu) {
+ if (fcheckResu == '1') {
+ return "鏀逛负涓嶅悎鏍�";
+ } else {
+ return "鏀逛负鍚堟牸";
+ }
+ },
+ submit() {
- this.$post({
- url: "/SJ/UpdateQSItemDetail",
- data: {
- id: item.id,
- pid: item.pid,
- gid: item.gid,
- fstand: fstand,
- fcheckResu: fcheckResu,
- updateBy: this.$loginInfo.account,
- }
- }).then(res => {
- this.$showMessage("淇敼鎴愬姛");
- this.refreshResult(); //鍒锋柊椤甸潰
- })
- },
- chooseImage() {
- uni.navigateTo({
- url: 'ImageItem?id=' + this.formData.id
- });
- },
- upRemarks() {
- this.remarksPopup = true;
- },
- saveResult() {
- let count = this.formData.levelNum;
- let fstand = "鈭�";
+ let count = this.formData.levelNum;
+ let fstand = "鈭�";
- //鏈夋渶澶у�煎拰鏈�灏忓�煎氨鏍规嵁鏄惁绗﹀悎鏍囧噯鍊兼洿鏂板垽瀹氱粨鏋滐紝娌℃湁鏈�澶у�煎拰鏈�灏忓�煎氨鏍规嵁鏄惁閫氳繃妫�楠屽垽瀹氱粨鏋�
- if (this.formData.maxValue && this.formData.minValue) {
+ //鏈夋渶澶у�煎拰鏈�灏忓�煎氨鏍规嵁鏄惁绗﹀悎鏍囧噯鍊兼洿鏂板垽瀹氱粨鏋滐紝娌℃湁鏈�澶у�煎拰鏈�灏忓�煎氨鏍规嵁鏄惁閫氳繃妫�楠屽垽瀹氱粨鏋�
+ if (this.formData.maxValue && this.formData.minValue) {
- if (!this.formData.fcheckResu) {
- this.$showMessage("璇疯緭鍏ユ楠屽��");
- return;
- }
+ if (!this.formData.fcheckResu) {
+ this.$showMessage("璇疯緭鍏ユ楠屽��");
+ return;
+ }
- if (this.formData.fcheckResu >= this.formData.minValue && this.formData.fcheckResu <= this.formData
- .maxValue) {
- fstand = "鈭�"
- } else {
- fstand = "脳";
- }
- count = 1;
- } else {
+ let checkValue = Number(this.formData.fcheckResu);
+ let minValue = Number(this.formData.minValue);
+ let maxValue = Number(this.formData.maxValue);
- if (!this.formData.fcheckResu) {
- this.formData.fcheckResu = 1
- }
+ if (isNaN(checkValue) || isNaN(minValue) || isNaN(maxValue)) {
+ this.$showMessage("妫�楠屽�兼垨鑼冨洿鍊兼牸寮忎笉姝g‘锛岃妫�鏌ヨ緭鍏�");
+ return;
+ }
- if (this.formData.fcheckResu == 0 || this.formData.fcheckResu == 1) {
- this.formData.isPass = this.formData.fcheckResu
- } else {
- this.$showMessage("鏃犳爣鍑嗗�兼椂锛屾楠岀粨鏋滃彧鑳戒负0鎴�1!");
- return;
- }
- count = count - this.tableData.length;
- }
+ if (checkValue >= minValue && checkValue <= maxValue) {
+ fstand = "鈭�"
+ } else {
+ fstand = "脳";
+ }
+ count = 1;
+ } else {
- this.formData.updater = this.$loginInfo.account;
+ if (!this.formData.fcheckResu) {
+ this.formData.fcheckResu = 1
+ }
- this.$post({
- url: "/SJ/SetQSItemDetail",
- data: {
- pid: this.mainId,
- gid: this.formID,
- fstand: fstand,
- fcheckResu: this.formData.fcheckResu,
- updateBy: this.formData.updater,
- count: count
- }
- }).then(res => {
- this.formData.fcheckResu = null;
- this.$showMessage("淇濆瓨鎴愬姛");
- this.refreshResult();
- })
+ if (this.formData.fcheckResu == 0 || this.formData.fcheckResu == 1) {
+ this.formData.isPass = this.formData.fcheckResu
+ } else {
+ this.$showMessage("鏃犳爣鍑嗗�兼椂锛屾楠岀粨鏋滃彧鑳戒负0鎴�1!");
+ return;
+ }
+ count = count - this.tableData.length;
+ }
+ this.formData.updater = this.$loginInfo.account;
- },
- goBack() {
- uni.navigateBack()
- },
- //鑾峰彇妫�楠屽崟璇︽儏
- refreshResult() {
- this.$post({
- url: "/SJ/getQSItems",
- data: {
- id: this.mainId
- }
- }).then(res => {
+ this.$post({
+ url: "/SJ/SetQSItemDetail",
+ data: {
+ pid: this.id,
+ gid: this.gid,
+ fstand: fstand,
+ fcheckResu: this.formData.fcheckResu,
+ updateBy: this.formData.updater,
+ count: count
+ }
+ }).then(res => {
+ this.formData.fcheckResu = null;
+ this.$showMessage("淇濆瓨鎴愬姛");
+ this.refreshResult();
+ // 閲嶆柊鍔犺浇鏍囩椤逛互鏇存柊鐘舵��
+ this.loadTabItems();
+ })
- this.formData = res.data.tbBillList[0];
- this.$post({
- url: "/SJ/getQSItemDetail",
- data: {
- pid: this.mainId,
- gid: this.formID
- }
- }).then(res => {
- this.tableData = res.data.tbBillList;
- })
- // this.tableData = res.data.tbBillList.itemXj02s;
+ },
+ refreshResult() {
+ this.$post({
+ url: "/SJ/getQSItems",
+ data: {
+ id: this.id
+ }
+ }).then(res => {
+ this.formData = res.data.tbBillList[0];
+ this.formData.billNo = this.billNo;
+ if (this.formData.imageData) {
+ this.isShowImg = true;
+ this.base64Image = 'data:image/jpeg;base64,' + this.formData.imageData;
+ }
+ if (this.formData.maxValue && this.formData.minValue && this.formData.standardValue) {
+ this.isNumber = true;
+ }
+ })
- if (this.formData.imageData) {
- this.isShowImg = true;
- this.base64Image = 'data:image/jpeg;base64,' + this.formData.imageData;
- }
+ this.$post({
+ url: "/SJ/getQSItemDetail",
+ data: {
+ pid: this.id,
+ gid: this.gid
+ }
+ }).then(res => {
+ this.tableData = res.data.tbBillList;
+ })
+ },
+ toDetail(item) {
+ this.showPopup = !this.showPopup;
+ this.editData = item;
+ },
+ eidt() {
- //fupAllow fdownAllow standardValue
- if (this.formData.maxValue && this.formData.minValue && this.formData.standardValue) {
- this.isNumber = true;
- } else {
- this.isNumber = false;
- }
- })
- },
- editResult(fcheckResu) {
- if (fcheckResu == '1') {
- return "鏀逛负涓嶅悎鏍�";
- } else {
- return "鏀逛负鍚堟牸";
- }
- },
- toDetail(item) {
- this.showPopup = !this.showPopup;
- this.editData = item;
- },
- editRemarks() {
- if (this.remarks) {
- //saveRemarksGid
- this.$post({
- url: "/SJ/saveRemarksPid",
- data: {
- pid: this.formData.id,
- remarks: this.remarks
- }
- }).then(res => {
- if (res.data.tbBillList > 0) {
- this.formData.remarks = this.remarks;
- this.remarksPopup = !this.remarksPopup;
- this.$showMessage("淇濆瓨鎴愬姛");
- }
- })
- } else {
- this.$post({
- url: "/SJ/saveRemarksPid",
- data: {
- pid: this.formData.id,
- remarks: ''
- }
- }).then(res => {
- if (res.data.tbBillList > 0) {
- this.formData.remarks = this.remarks;
- this.remarksPopup = !this.remarksPopup;
- this.$showMessage("淇濆瓨鎴愬姛");
- }
- })
- }
- },
- eidt() {
+ if (!this.editData.fcheckResu) {
+ this.$showMessage("璇疯緭鍏ユ楠岀粨鏋�");
+ }
- if (!this.editData.fcheckResu) {
- this.$showMessage("璇疯緭鍏ユ楠岀粨鏋�");
- }
+ if (this.formData.fcheckResu == this.editData.fcheckResu) {
+ this.$showMessage("淇敼鎴愬姛");
+ return;
+ }
- if (this.formData.fcheckResu == this.editData.fcheckResu) {
- this.$showMessage("淇敼鎴愬姛");
- return;
- }
+ let fstand = "鈭�";
- let fstand = "鈭�";
+ if (this.formData.maxValue && this.formData.minValue) {
- if (this.formData.maxValue && this.formData.minValue) {
+ if (!this.editData.fcheckResu) {
+ this.$showMessage("璇疯緭鍏ユ楠屽��");
+ return;
+ }
- if (!this.editData.fcheckResu) {
- this.$showMessage("璇疯緭鍏ユ楠屽��");
- return;
- }
+ let checkValue = Number(this.editData.fcheckResu);
+ let minValue = Number(this.formData.minValue);
+ let maxValue = Number(this.formData.maxValue);
- if (parseFloat(this.editData.fcheckResu) >= parseFloat(this.formData.fdownAllow) && parseFloat(this
- .editData
- .fcheckResu) <= parseFloat(this.formData.fupAllow)) {
- this.editData.isPass = 1
- } else {
- this.editData.isPass = 0
- fstand = "脳";
- }
- } else {
+ if (isNaN(checkValue) || isNaN(minValue) || isNaN(maxValue)) {
+ this.$showMessage("妫�楠屽�兼垨鑼冨洿鍊兼牸寮忎笉姝g‘锛岃妫�鏌ヨ緭鍏�");
+ return;
+ }
- if (!this.editData.fcheckResu) {
- this.editData.fcheckResu = 1
- }
+ if (checkValue >= minValue && checkValue <= maxValue) {
+ this.editData.isPass = 1
+ } else {
+ this.editData.isPass = 0
+ fstand = "脳";
+ }
+ } else {
- if (this.editData.fcheckResu == 0 || this.editData.fcheckResu == 1) {
- if (this.editData.fcheckResu == 0) {
- fstand = "脳";
- }
- } else {
- this.$showMessage("鏃犳爣鍑嗗�兼椂锛屾楠岀粨鏋滃彧鑳戒负0鎴�1!");
- return;
- }
- }
+ if (!this.editData.fcheckResu) {
+ this.editData.fcheckResu = 1
+ }
- this.editData.updater = this.$loginInfo.account;
+ if (this.editData.fcheckResu == 0 || this.editData.fcheckResu == 1) {
+ if (this.editData.fcheckResu == 0) {
+ fstand = "脳";
+ }
+ } else {
+ this.$showMessage("鏃犳爣鍑嗗�兼椂锛屾楠岀粨鏋滃彧鑳戒负0鎴�1!");
+ return;
+ }
+ }
- this.$post({
- url: "/SJ/UpdateQSItemDetail",
- data: {
- id: this.editData.id,
- pid: this.mainId,
- gid: this.formID,
- fstand: fstand,
- fcheckResu: this.editData.fcheckResu,
- updateBy: this.editData.updater,
- }
- }).then(res => {
- this.showPopup = !this.showPopup;
- this.$showMessage("淇敼鎴愬姛");
- this.refreshResult(); //鍒锋柊椤甸潰
- })
- },
- },
- onLoad(options) {
- //options涓寘鍚簡url闄勫甫鐨勫弬鏁�
- let params = options;
- this.mainId = params["mainId"];
- this.refreshResult();
- this.formID = params["formID"];
- this.releaseNo = params["releaseNo"];
- this.currentTab = parseInt(params["index"]);
- this.current = params["current"] === 'true' ? true : false;
- this.$post({
- url: "/SJ/getQSItems",
- data: {
- pid: this.formID
- }
- }).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.tabs = tableData;
- // if (this.tableData.length === 0) {
- // this.isShowTable = true;
- // }
- this.tableData.forEach((item, index) => {
- this.set(item, 'current', this.current);
- });
- console.log(this.tableData);
- })
- }
- }
+ this.editData.updater = this.$loginInfo.account;
+
+ this.$post({
+ url: "/SJ/UpdateQSItemDetail",
+ data: {
+ id: this.editData.id,
+ pid: this.id,
+ gid: this.gid,
+ fstand: fstand,
+ fcheckResu: this.editData.fcheckResu,
+ updateBy: this.editData.updater,
+ }
+ }).then(res => {
+ this.showPopup = !this.showPopup;
+ this.$showMessage("淇敼鎴愬姛");
+ this.refreshResult();//鍒锋柊椤甸潰
+ // 閲嶆柊鍔犺浇鏍囩椤逛互鏇存柊鐘舵��
+ this.loadTabItems();
+ })
+ },
+ numberEdit(item) {
+
+ let fstand = "鈭�";
+ let fcheckResu = 1;
+
+ if (item.fcheckResu == '1') {
+ fstand = "脳";
+ fcheckResu = 0;
+ }
+
+ this.$post({
+ url: "/SJ/UpdateQSItemDetail",
+ data: {
+ id: item.id,
+ pid: item.pid,
+ gid: item.gid,
+ fstand: fstand,
+ fcheckResu: fcheckResu,
+ updateBy: this.$loginInfo.account,
+ }
+ }).then(res => {
+ this.$showMessage("淇敼鎴愬姛");
+ this.refreshResult(); //鍒锋柊椤甸潰
+ // 閲嶆柊鍔犺浇鏍囩椤逛互鏇存柊鐘舵��
+ this.loadTabItems();
+ })
+ },
+ // 涓婁紶鍥剧墖
+ chooseImage() {
+ uni.navigateTo({
+ url: 'ImageItem?id=777' + this.formData.id + '&gid=' + this.gid
+ });
+ },
+ saveRemarks() {
+ this.remarksPopup = !this.remarksPopup;
+ this.remarks = this.formData.remarks;
+ },
+ editRemarks() {
+ if (this.remarks) {
+ //saveRemarksGid
+ this.$post({
+ url: "/SJ/saveRemarksPid",
+ data: {
+ pid: 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.loadTabItems();
+ }
+ })
+ }
+ },
+ // 鍒ゆ柇鏁板瓧鏄惁鍦ㄨ寖鍥村唴
+ isInRange(value) {
+ if (!this.formData.maxValue || !this.formData.minValue) return true;
+ const numValue = parseFloat(value);
+ return numValue >= parseFloat(this.formData.minValue) &&
+ numValue <= parseFloat(this.formData.maxValue);
+ },
+ // 鑾峰彇鏁板瓧缁撴灉鐨勬牱寮忕被
+ getNumberResultClass(value) {
+ if (!this.formData.maxValue || !this.formData.minValue) return 'number-normal';
+ return this.isInRange(value) ? 'number-pass' : 'number-fail';
+ },
+ // 鑾峰彇鐘舵�佺粨鏋滅殑鏍峰紡绫�
+ getStatusClass(status) {
+ return status === '鈭�' ? 'status-pass' : 'status-fail';
+ }
+ },
+ onLoad(options) {
+ //options涓寘鍚簡url闄勫甫鐨勫弬鏁�
+ let params = options;
+
+ this.id = params["id"];
+ this.billNo = params["billNo"];
+ this.gid = params["gid"];
+ this.currentTab = parseInt(params["index"] || 0);
+ this.current = params["current"] !== 'B'; // B琛ㄧず宸插畬鎴愮姸鎬侊紝涓嶅彲缂栬緫
+
+ this.refreshResult();
+ this.loadTabItems();
+ }
+}
</script>
<style lang="scss">
- $primary-color: #409EFF;
- $success-color: #67C23A;
- $danger-color: #F56C6C;
- $border-color: #DCDFE6;
- $bg-color: #f5f7fa;
+$primary-color: #409EFF;
+$success-color: #67C23A;
+$danger-color: #F56C6C;
+$border-color: #DCDFE6;
+$bg-color: #f5f7fa;
- .container {
- padding: 20px;
- background-color: #fff;
- }
+.container {
+ padding: 20px;
+ background-color: #fff;
+}
- .header {
- padding: 20px;
- border-bottom: 1px solid $border-color;
- background: linear-gradient(90deg, #f0f7ff, #e1f0ff);
+.header {
+ padding: 20px;
+ border-bottom: 1px solid $border-color;
+ background: linear-gradient(90deg, #f0f7ff, #e1f0ff);
- .title {
- font-size: 24px;
- color: #333;
- margin-bottom: 10px;
- }
+ .title {
+ font-size: 24px;
+ color: #333;
+ margin-bottom: 10px;
+ }
- .order-number {
- color: #666;
- font-size: 14px;
- }
- }
+ .order-number {
+ color: #666;
+ font-size: 14px;
+ }
+}
- .tabs {
- display: flex;
- background-color: $bg-color;
- border-bottom: 1px solid $border-color;
+.tabs {
+ display: flex;
+ background-color: $bg-color;
+ border-bottom: 1px solid $border-color;
- .tab {
- flex: 1;
- text-align: center;
- padding: 12px 0;
- border-right: 1px solid $border-color;
- color: #666;
- transition: all 0.3s;
+ .tab {
+ flex: 1;
+ text-align: center;
+ padding: 12px 0;
+ border-right: 1px solid $border-color;
+ color: #666;
+ transition: all 0.3s;
- &:last-child {
- border-right: none;
- }
+ &:last-child {
+ border-right: none;
+ }
- &.active {
- background-color: #fff;
- color: $primary-color;
- font-weight: bold;
- position: relative;
+ &.active {
+ background-color: #fff;
+ color: $primary-color;
+ font-weight: bold;
+ position: relative;
- &::after {
- content: '';
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
- height: 2px;
- background-color: $primary-color;
- }
- }
- }
- }
+ &::after {
+ content: '';
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 2px;
+ background-color: $primary-color;
+ }
+ }
+ }
+}
- .section {
- margin: 20px 0;
- border: 1px solid $border-color;
- border-radius: 4px;
+.tab-content {
+ padding-top: 20px;
+}
- &-header {
- padding: 12px 16px;
- background-color: $bg-color;
- border-bottom: 1px solid $border-color;
- font-weight: bold;
- }
+.section {
+ margin: 20px 0;
+ border: 1px solid $border-color;
+ border-radius: 4px;
- &-body {
- padding: 16px;
- }
- }
+ &-header {
+ padding: 12px 16px;
+ background-color: $bg-color;
+ border-bottom: 1px solid $border-color;
+ font-weight: bold;
+ }
- .info-grid {
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- gap: 16px;
+ &-body {
+ padding: 16px;
+ }
+}
- .info-item {
- margin-bottom: 12px;
+.info-grid {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 16px;
- .info-label {
- color: #909399;
- font-size: 14px;
- margin-bottom: 4px;
- }
+ .info-item {
+ margin-bottom: 12px;
- .info-value {
- color: #333;
- font-weight: 500;
- }
- }
- }
+ .info-label {
+ color: #909399;
+ font-size: 14px;
+ margin-bottom: 4px;
+ }
- .input-group {
- margin: 16px 0;
+ .info-value {
+ color: #333;
+ font-weight: 500;
+ }
+ }
+}
- .input-wrapper {
- display: flex;
- gap: 12px;
+.input-group {
+ margin: 16px 0;
- .result-input {
- flex: 1;
- height: 45px;
- padding: 0 12px;
- border: 1px solid $border-color;
- border-radius: 4px;
- font-size: 14px;
- }
+ .input-wrapper {
+ display: flex;
+ gap: 12px;
- .upload-btn {
- background-color: #909399;
- color: #fff;
- padding: 0 10px;
- margin: 0;
- //height: 40rpx;
- }
- }
- }
+ .result-input {
+ flex: 1;
+ height: 45px;
+ padding: 0 12px;
+ border: 1px solid $border-color;
+ border-radius: 4px;
+ font-size: 14px;
+ }
- .table-container {
- border: 1px solid $border-color;
- border-radius: 4px;
- margin-top: 20px;
+ .upload-btn {
+ background-color: #909399;
+ color: #fff;
+ padding: 0 10px;
+ margin: 0;
+ height: 45px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: none;
+ border-radius: 4px;
+ }
+
+ .primary-btn {
+ height: 45px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: none;
+ border-radius: 4px;
+ }
+ }
+}
- .table-header {
- display: flex;
- background-color: $bg-color;
- border-bottom: 1px solid $border-color;
+.table-container {
+ border: 1px solid $border-color;
+ border-radius: 4px;
+ margin-top: 20px;
- .th {
- flex: 1;
- padding: 12px;
- font-weight: bold;
- }
- }
+ .table-header {
+ display: flex;
+ background-color: $bg-color;
+ border-bottom: 1px solid $border-color;
- .table-row {
- display: flex;
- border-bottom: 1px solid $border-color;
- padding: 12px;
+ .th {
+ flex: 1;
+ padding: 12px;
+ font-weight: bold;
+ }
+ }
- &:last-child {
- border-bottom: none;
- }
+ .table-row {
+ display: flex;
+ border-bottom: 1px solid $border-color;
+ padding: 12px;
- .td {
- flex: 1;
- display: flex;
- align-items: center;
- }
- }
- }
+ &:last-child {
+ border-bottom: none;
+ }
- .result-badge {
- display: inline-block;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 12px;
- font-weight: bold;
+ .td {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ }
+ }
+}
- &.OK {
- background-color: rgba($success-color, 0.1);
- color: $success-color;
- }
+.result-badge {
+ display: inline-block;
+ padding: 4px 8px;
+ border-radius: 4px;
+ font-size: 12px;
+ font-weight: bold;
- &.NG {
- background-color: rgba($danger-color, 0.1);
- color: $danger-color;
- }
- }
+ &.OK {
+ background-color: rgba($success-color, 0.1);
+ color: $success-color;
+ }
- .action-buttons {
- margin-top: 20px;
- display: flex;
- justify-content: flex-end;
- gap: 12px;
+ &.NG {
+ background-color: rgba($danger-color, 0.1);
+ color: $danger-color;
+ }
+}
- .btn {
- padding: 8px 20px;
- border-radius: 4px;
+.action-buttons {
+ margin-top: 20px;
+ display: flex;
+ justify-content: flex-end;
+ gap: 12px;
- &.primary-btn {
- background-color: $primary-color;
- color: #fff;
+ .btn {
+ padding: 8px 20px;
+ border-radius: 4px;
- }
+ &.primary-btn {
+ background-color: $primary-color;
+ color: #fff;
+ height: 45px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: none;
+ border-radius: 4px;
+ padding: 0 20px;
+ }
- &.cancel-btn {
- background-color: #909399;
- color: #fff;
- }
- }
- }
+ &.cancel-btn {
+ background-color: #909399;
+ color: #fff;
+ }
+ }
+}
- .danger {
- color: $danger-color;
- }
+.danger {
+ color: $danger-color;
+}
- .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;
- }
+.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;
+}
- .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% */
- }
+.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% */
+}
- .updateBut {
- background-color: #3498db;
- color: white;
- }
+.updateBut {
+ background-color: #3498db;
+ color: white;
+}
- .input1 {
- display: block;
- }
+.input1 {
+ display: block;
+}
- .input2 {
- display: none;
- }
+.input2 {
+ display: none;
+}
- /* 鍝嶅簲寮忚璁� */
- @media (max-width: 500px) {
- .input1 {
- display: none;
- }
+/* 鍝嶅簲寮忚璁� */
+@media (max-width: 500px) {
+ .input1 {
+ display: none;
+ }
- .input2 {
- display: block;
- }
- }
+ .input2 {
+ display: block;
+ }
+
+ .info-grid {
+ grid-template-columns: repeat(2, 1fr);
+ }
+}
</style>
\ No newline at end of file
--
Gitblit v1.9.3