From ab826d12b52265bc4f25044d43a042df2104f972 Mon Sep 17 00:00:00 2001 From: kyy <3283105747@qq.com> Date: 星期一, 14 七月 2025 21:34:10 +0800 Subject: [PATCH] 最新代码 --- pages/QC/SJ/Add.vue | 575 +++++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 394 insertions(+), 181 deletions(-) diff --git a/pages/QC/SJ/Add.vue b/pages/QC/SJ/Add.vue index b120ace..8b3bc8a 100644 --- a/pages/QC/SJ/Add.vue +++ b/pages/QC/SJ/Add.vue @@ -1,119 +1,158 @@ <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.billNo" /> - </view> - <view class="form-group"> - <label class="form-label">鍒涘缓鏃堕棿:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.createTime" /> - </view> - <view class="uni-form-item uni-column form-item edit"> - <text class="form-label">鐢熶骇绾垮埆:</text> - <superwei-combox v-if="isUpdate" :candidates="DAA020List" placeholder="璇烽�夋嫨鎴栬緭鍏�" - v-model="formData.line" @select="onDaa020Change" class="picker form-input" - style="border: none;"></superwei-combox> - <input v-else class="form-input" disabled="true" type="text" v-model="formData.line" /> - </view> - <view class="uni-form-item uni-column form-item edit"> - <text class="form-label">鐗╂枡缂栫爜:</text> - <superwei-combox v-if="isUpdate" :candidates="Daa002" placeholder="璇烽�夋嫨鎴栬緭鍏�" v-model="formData.itemNo" - :isJSON="true" keyName="itemName" @select="onItemChange" class="picker form-input" - style="border: none;"></superwei-combox> - <input v-else class="form-input" disabled="true" type="text" v-model="formData.itemNo" /> - </view> - <view class="uni-form-item uni-column form-item edit"> - <text class="form-label">璁″垝缂栧彿:</text> - <picker v-if="isUpdate" class="picker form-input" name="selector" :range="DAA001List" - @change="onDaa001Change"> - <text>{{ DAA001List[DAA001Index] }}</text> - </picker> - <input v-else class="form-input" disabled="true" type="text" v-model="formData.daa001" /> - </view> - <view class="form-group"> - <label class="form-label">浜у搧鍚嶇О:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.daa003" /> - </view> - <view class="form-group"> - <label class="form-label">瑙勬牸鍨嬪彿:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.daa004" /> - </view> - <view class="form-group"> - <label class="form-label">宸ュ崟鏁伴噺:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.daa008" /> - </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="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-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.projName" /> - </uni-td> - <uni-td align="center"> - <input class="form-input" disabled="true" type="text" v-model="item.result" /> - </uni-td> - <uni-td> - <view class="uni-group"> - <button v-if="item.isCheck >=item.levelNum" type="default" @click="toDetail(item)"> - {{ item.levelNum + '/' + item.isCheck }} - </button> - <button v-else type="warn" @click="toDetail(item)"> - {{ item.levelNum + '/' + item.isCheck }}</button> - </view> - </uni-td> - </uni-tr> - </uni-table> - </view> - <view class="plus-button"> - - <view class="plus-button"> - <button type="warn" v-if="!isUpdate && !isShowTable" @click="submit">瀹℃牳鍗曟嵁</button> + <view class="page-container"> + <view class="form-container card"> + <view class="card-header"> + <text class="card-title">棣栨鍗曚俊鎭�</text> </view> - <button type="warn" v-if="isUpdate && !isShowTable" @click="save">鍒涘缓妫�楠屽崟骞剁敓鎴愰儴鍒嗛粯璁ゅ��</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.result == '鏈畬鎴�' && !isShowTable" @click="removeXJ">鍒犻櫎鍗曟嵁 - </button> - </view>--> - <view class="plus-button"> - <button type="warn" v-if="!isUpdate && !isShowTable" @click="saveRemarks">娣诲姞涓嶅悎鏍兼弿杩�</button> - </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="card-body"> + <form :modelValue="formData"> + <view class="form-group"> + <label class="form-label">棣栨鍗曞彿:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.billNo" /> + </view> + <view class="form-group"> + <label class="form-label">鍒涘缓鏃堕棿:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.createTime" /> + </view> + <view class="uni-form-item uni-column form-item edit"> + <text class="form-label">鐢熶骇绾垮埆:</text> + <superwei-combox v-if="isUpdate" :candidates="DAA020List" placeholder="璇烽�夋嫨鎴栬緭鍏�" + v-model="formData.line" @select="onDaa020Change" class="picker form-input" + style="border: none;"></superwei-combox> + <input v-else class="form-input" disabled="true" type="text" v-model="formData.line" /> + </view> + <view class="uni-form-item uni-column form-item edit"> + <text class="form-label">鐗╂枡缂栫爜:</text> + <superwei-combox v-if="isUpdate" :candidates="Daa002" placeholder="璇烽�夋嫨鎴栬緭鍏�" v-model="formData.itemNo" + :isJSON="true" keyName="itemName" @select="onItemChange" class="picker form-input" + style="border: none;"></superwei-combox> + <input v-else class="form-input" disabled="true" type="text" v-model="formData.itemNo" /> + </view> + <view class="uni-form-item uni-column form-item edit"> + <text class="form-label">璁″垝缂栧彿:</text> + <picker v-if="isUpdate" class="picker form-input" name="selector" :range="DAA001List" + @change="onDaa001Change"> + <text>{{ DAA001List[DAA001Index] }}</text> + </picker> + <input v-else class="form-input" disabled="true" type="text" v-model="formData.daa001" /> + </view> + <view class="form-group"> + <label class="form-label">浜у搧鍚嶇О:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.daa003" /> + </view> + <view class="form-group"> + <label class="form-label">瑙勬牸鍨嬪彿:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.daa004" /> + </view> + <view class="form-group"> + <label class="form-label">宸ュ崟鏁伴噺:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.daa008" /> + </view> <view class="form-group"> <label class="form-label">涓嶅悎鏍兼弿杩�:</label> - <input class="form-input" type="text" v-model="remarks" /> + <input class="form-input" disabled="true" type="text" v-model="formData.remarks" /> </view> - <button type="warn" @click="editRemarks">淇敼</button> - <button @click="remarksPopup = !remarksPopup">鍙栨秷</button> </form> + </view> + </view> + + <view class="list-container card"> + <view class="card-header"> + <text class="card-title">妫�楠岄」鐩垪琛�</text> + </view> + <view class="card-body"> + <uni-table ref="table" border emptyText="鏆傛棤鏇村鏁版嵁"> + <uni-tr class="table-header"> + <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="{'table-row-alt': index % 2 === 1}"> + <uni-td align="center"> + <input class="form-input" disabled="true" type="text" v-model="item.projName" /> + </uni-td> + <uni-td align="center"> + <span :class="getResultClass(item.result)">{{ item.result }}</span> + </uni-td> + <uni-td> + <view class="action-buttons"> + <button v-if="item.isCheck >= item.levelNum" type="default" @click="toDetail(item)" class="btn btn-success"> + {{ item.levelNum + '/' + item.isCheck }} + </button> + <button v-else type="warn" @click="toDetail(item)" class="btn btn-warning"> + {{ item.levelNum + '/' + item.isCheck }} + </button> + </view> + </uni-td> + </uni-tr> + </uni-table> + </view> + </view> + + <view class="action-buttons-container"> + <view class="button-row"> + <button type="warn" v-if="!isUpdate && !isShowTable" @click="submit" class="btn btn-primary"> + 瀹℃牳鍗曟嵁 + </button> + </view> + <view class="button-row"> + <button type="warn" v-if="isUpdate && !isShowTable" @click="save" class="btn btn-primary"> + 鍒涘缓妫�楠屽崟骞剁敓鎴愰儴鍒嗛粯璁ゅ�� + </button> + </view> + <view class="button-row"> + <button type="warn" v-if="!isUpdate && !isShowTable" @click="toImage" class="btn btn-primary"> + 涓婁紶/鏌ョ湅鍥剧墖 + </button> + </view> + <view class="button-row"> + <!--<button type="warn" v-if="!isUpdate && formData.result == '鏈畬鎴�' && !isShowTable" @click="removeXJ" class="btn btn-danger"> + 鍒犻櫎鍗曟嵁 + </button>--> + </view> + <view class="button-row"> + <button type="warn" v-if="!isUpdate && !isShowTable" @click="saveRemarks" class="btn btn-primary"> + 娣诲姞涓嶅悎鏍兼弿杩� + </button> + </view> + <view class="button-row"> + <button type="warn" v-if="isShowTable" @click="getTable" class="btn btn-primary"> + 鑾峰彇妫�楠岄」鐩� + </button> + </view> + <view class="button-row"> + <button type="warn" v-if="isShowTable && isUpdate" @click="saveTable" class="btn btn-primary"> + 鐢熸垚妫�楠岄」鐩� + </button> + </view> + </view> + + <view v-if="remarksPopup" class="overlay"> + <view class="popup card"> + <view class="popup-header"> + <h3 class="popup-title">淇敼涓嶅悎鏍兼弿杩�</h3> + </view> + <view class="popup-body"> + <form> + <view class="form-group"> + <label class="form-label">涓嶅悎鏍兼弿杩�:</label> + <input class="form-input" type="text" v-model="remarks" /> + </view> + <view class="popup-actions"> + <button type="warn" @click="editRemarks" class="btn btn-primary"> + 淇敼 + </button> + <button @click="remarksPopup = !remarksPopup" class="btn btn-secondary"> + 鍙栨秷 + </button> + </view> + </form> + </view> </view> </view> </view> </template> + <script> export default { data() { @@ -214,29 +253,34 @@ } }, - submit() { - this.$post({ - url: "/SJ/SJQaSubmit", - data: { - userNo: this.$loginInfo.account, - gid: this.formData.id - } - }).then(res => { - - //2024-11-28 kyy 鏍¢獙鍚堟牸鎻愪氦澧炲姞鎻愮ず - console.log("Status Code鐨勫��:", res.statusCode); - if (res.statusCode === 200) { - - this.$showMessage("鎴愬姛鎻愪氦妫�楠�"); - // 浣跨敤setTimeout鍦�7绉掑悗闅愯棌娑堟伅 - setTimeout(() => { - this.hideCustomMessage(); - }, 7000); // 7000姣绛変簬7绉� - } else { - this.$showMessage(res.data.message); - } - }) - }, + submit() { + this.$post({ + url: "/SJ/SJQaSubmit", + data: { + userNo: this.$loginInfo.account, + gid: this.formData.id + } + }).then(res => { + console.log("鍚庣杩斿洖缁撴灉:", res); + + // 鏍规嵁鍚庣瀹為檯杩斿洖鐨剆tatus瀛楁鍒ゆ柇 + if (res.status === 0) { // 鍚庣status=0琛ㄧず鎴愬姛 + this.$showMessage("鎴愬姛鎻愪氦妫�楠�"); + + // 7绉掑悗闅愯棌娑堟伅 + setTimeout(() => { + this.hideCustomMessage(); + }, 7000); + } else { + // 澶辫触鏃舵樉绀哄悗绔繑鍥炵殑閿欒淇℃伅 + this.$showMessage(res.message || "鎻愪氦澶辫触锛岃閲嶈瘯"); + } + }).catch(error => { + // 澶勭悊缃戠粶閿欒鎴栧紓甯� + console.error("鎻愪氦璇锋眰澶辫触:", error); + this.$showMessage("缃戠粶璇锋眰澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�"); + }); + }, init() { if (this.formData.id) { @@ -468,6 +512,12 @@ uni.navigateTo({ url: 'ImageItem?id=' + this.formData.id }); + }, + // 娣诲姞鐢ㄤ簬鑾峰彇缁撴灉鐘舵�佹牱寮忕殑鏂规硶 + getResultClass(result) { + if (result === '鍚堟牸') return 'result-success'; + if (result === '涓嶅悎鏍�') return 'result-fail'; + return 'result-pending'; } }, onShow() { @@ -478,78 +528,194 @@ </script> <style> + /* 鍏ㄥ眬鏍峰紡 */ + :root { + --primary-color: #165DFF; + --success-color: #00B42A; + --warning-color: #FF7D00; + --danger-color: #F53F3F; + --bg-color: #F2F3F5; + --card-bg: #FFFFFF; + --text-color: #333333; + --text-secondary: #666666; + --border-color: #E5E6EB; + --border-radius: 8px; + --shadow: 0 2px 8px rgba(0, 0, 0, 0.08); + } + + /* 椤甸潰瀹瑰櫒 */ + .page-container { + padding: 16px; + background-color: var(--bg-color); + min-height: 100vh; + } + + /* 鍗$墖缁勪欢 */ + .card { + background-color: var(--card-bg); + border-radius: var(--border-radius); + box-shadow: var(--shadow); + margin-bottom: 16px; + overflow: hidden; + } + + .card-header { + padding: 16px; + background-color: #F7F8FA; + border-bottom: 1px solid var(--border-color); + } + + .card-title { + font-size: 18px; + font-weight: 600; + color: var(--text-color); + } + + .card-body { + padding: 16px; + } + + /* 琛ㄥ崟鏍峰紡 */ .form-group { display: flex; align-items: center; - border-bottom: 1px solid #c9c9c9; + padding: 12px 0; + border-bottom: 1px solid #F2F3F5; + } + + .form-group:last-child { + border-bottom: none; } .form-label { - margin-bottom: 0; - padding: 5px; + width: 100px; + font-size: 14px; + color: var(--text-secondary); + margin-right: 12px; } .form-input { flex: 1; - margin-bottom: 0; - padding: 5px; + height: 36px; + padding: 0 12px; + border: 1px solid var(--border-color); + border-radius: 4px; + font-size: 14px; + color: var(--text-color); } + .form-input:disabled { + background-color: #F7F8FA; + color: #999999; + } .picker { flex: 1; - margin-bottom: 0; - padding: 5px; - font-size: 12px; + height: 36px; + padding: 0 12px; + border: 1px solid var(--border-color); + border-radius: 4px; + font-size: 14px; + color: var(--text-color); } - .uni-form-item { - display: flex; - border-bottom: 1px solid #c9c9c9; + /* 琛ㄦ牸鏍峰紡 */ + .uni-table { + width: 100%; + border-collapse: collapse; } - .edit { - background-color: white; - } - - /* 榛樿鏍峰紡 */ - .list-container { - height: 60vh; - /* 璁剧疆鍒楄〃瀹瑰櫒鐨勯珮搴︿负鍓╀綑绌洪棿锛屽苟鍑忓幓琛ㄥ崟瀹瑰櫒鐨勯珮搴� */ - overflow-y: auto; - /* 鍏佽鍒楄〃瀹瑰櫒鍨傜洿婊氬姩 */ - padding: 10px; - /* 鍙�夛細娣诲姞涓�浜涘唴杈硅窛锛屼娇鍒楄〃鍐呭鏇寸編瑙� */ - } - - /* 鍦ㄥ皬灞忓箷璁惧涓婏紝閲嶇疆楂樺害涓洪�傚簲灞忓箷 */ - @media (max-width: 768px) { - .list-container { - height: calc(100vh - 376px); - /* 閫傚綋璋冩暣楂樺害 */ - } - } - - - .form-container { - padding: 10px; - /* 鍙�夛細娣诲姞涓�浜涘唴杈硅窛锛屼娇琛ㄥ崟鍐呭鏇寸編瑙� */ + .table-header { + background-color: var(--primary-color); } .th { - background-color: lightskyblue; + padding: 12px; color: #FFFFFF; + font-weight: 500; + text-align: center; } + .table-row { + border-bottom: 1px solid var(--border-color); + } - .plus-button { - line-height: 59px; - font-size: 24px; + .table-row-alt { + background-color: #F9FAFC; + } + + .uni-td { + padding: 12px; + text-align: center; + } + + .result-success { + color: var(--success-color); + font-weight: bold; + } + + .result-fail { + color: var(--danger-color); + font-weight: bold; + } + + .result-pending { + color: var(--warning-color); + font-weight: bold; + } + + /* 鎸夐挳鏍峰紡 */ + .btn { + width: 100%; + height: 44px; + border-radius: 4px; + font-size: 16px; + font-weight: 500; cursor: pointer; - z-index: 1000; - margin-bottom: 10px; + transition: background-color 0.2s; } + .btn-primary { + background-color: var(--primary-color); + color: #FFFFFF; + border: none; + } + + .btn-primary:hover { + background-color: #0E42D2; + } + + .btn-success { + background-color: var(--success-color); + color: #FFFFFF; + border: none; + } + + .btn-warning { + background-color: var(--warning-color); + color: #FFFFFF; + border: none; + } + + .btn-secondary { + background-color: #F2F3F5; + color: var(--text-color); + border: 1px solid var(--border-color); + } + + .btn-secondary:hover { + background-color: #E5E6EB; + } + + .action-buttons-container { + padding: 16px; + } + + .button-row { + margin-bottom: 12px; + } + + /* 寮圭獥鏍峰紡 */ .overlay { position: fixed; top: 0; @@ -560,16 +726,63 @@ display: flex; justify-content: center; align-items: center; + 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; - /* 璁剧疆瀹藉害涓鸿鍙e搴︾殑80% */ - height: 25vh; - /* 璁剧疆楂樺害涓鸿鍙i珮搴︾殑80% */ + width: 90%; + max-width: 500px; + max-height: 80vh; + overflow-y: auto; } -</style> \ No newline at end of file + + .popup-header { + padding: 16px; + border-bottom: 1px solid var(--border-color); + } + + .popup-title { + font-size: 18px; + font-weight: 600; + text-align: center; + } + + .popup-body { + padding: 16px; + } + + .popup-actions { + display: flex; + justify-content: space-between; + margin-top: 20px; + } + + /* 鍝嶅簲寮忚璁� */ + @media (max-width: 768px) { + .page-container { + padding: 8px; + } + + .card { + margin-bottom: 8px; + } + + .card-header, .card-body, .popup-header, .popup-body { + padding: 12px; + } + + .form-label { + width: 80px; + font-size: 13px; + } + + .form-input, .picker, .btn { + height: 40px; + font-size: 14px; + } + + .popup { + width: 96%; + } + } +</style> -- Gitblit v1.9.3