From efb6960d9a35857d8efa7e40a6e71504b87f5035 Mon Sep 17 00:00:00 2001 From: xwt <2740516069@qq.com> Date: 星期六, 02 八月 2025 14:51:55 +0800 Subject: [PATCH] 来料检布局修改,查看图片修改 --- pages/QC/XJ/Add.vue | 53 +++ pages/QC/LLJ/ImageItem.vue | 529 +++++++++++++++++++++++----------------- manifest.json | 2 pages/QC/LLJ/Add.vue | 112 +++++--- pages/QC/SJ/Add.vue | 77 ++++- 5 files changed, 484 insertions(+), 289 deletions(-) diff --git a/manifest.json b/manifest.json index 521158e..c8d4d3b 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name" : "GS-MES-AP", "appid" : "__UNI__F08FAE3", "description" : "", - "versionName" : "1.1.2.4", + "versionName" : "1.1.2.6", "versionCode" : 1, "transformPx" : false, /* 5+App鐗规湁鐩稿叧 */ diff --git a/pages/QC/LLJ/Add.vue b/pages/QC/LLJ/Add.vue index 38afc4e..eb106b4 100644 --- a/pages/QC/LLJ/Add.vue +++ b/pages/QC/LLJ/Add.vue @@ -104,12 +104,13 @@ <view class="info-label">鐮村潖瀹為獙鏁伴噺锛�</view> <view class="info-value highlight">{{formData.phsy}}</view> </view> - - - - - + <!-- 琛ㄥ崟涓婃柟鎿嶄綔鎸夐挳鍖� --> + <view class="top-action-buttons"> + <button class="action-btn" @click="getInspectionItems" v-if="this.current">鑾峰彇妫�楠岄」鐩�</button> + <button class="action-btn" @click="handleEmergencyRelease" v-if="this.current">绱ф�ユ斁琛�</button> + <button class="action-btn" @click="handleWithdraw" v-if="this.current">鎾ゅ洖</button> + </view> <!-- 妫�楠岄」鐩〃鏍� --> <view class="inspection-table"> @@ -146,22 +147,14 @@ </table> </view> - <!-- 椤甸潰鍐呭鍖哄煙 --> - <view class="content-wrapper"> - <!-- 涓哄簳閮ㄦ寜閽暀鍑虹┖闂� --> - </view> - - <!-- 鍥哄畾鍦ㄥ簳閮ㄧ殑鎿嶄綔鎸夐挳鍖� --> - <view class="fixed-action-buttons"> - <button class="action-btn" @click="handleEmergencyRelease" v-if="this.current">绱ф�ユ斁琛�</button> - <button class="action-btn" @click="handleWithdraw" v-if="this.current">鎾ゅ洖</button> - <button class="action-btn" @click="getInspectionItems" v-if="this.current">鑾峰彇妫�楠岄」鐩�</button> - <button class="action-btn" @click="addDestruction" v-if="this.current">鐮村潖瀹為獙</button> - <button class="action-btn" @click="uploadImages">涓婁紶/鏌ョ湅鍥剧墖</button> - <button class="action-btn" @click="fetchDrawingNumber">璋冨彇PLM鍥剧焊</button> - <button class="action-btn" @click="viewAttachmentInfo">鏌ョ湅闄勪欢淇℃伅</button> - <button class="action-btn" @click="addDefectDescription" v-if="this.current">娣诲姞涓嶈壇鎻忚堪</button> - <button class="action-btn primary" @click="submitInspection" v-if="this.current">妫�楠屾彁浜�</button> + <!-- 琛ㄥ崟涓嬫柟鎿嶄綔鎸夐挳鍖� --> + <view class="bottom-action-buttons"> + <button class="action-btn small" @click="addDestruction" v-if="this.current">鐮村潖瀹為獙</button> + <button class="action-btn small" @click="uploadImages">涓婁紶/鏌ョ湅鍥剧墖</button> + <button class="action-btn small" @click="fetchDrawingNumber">璋冨彇PLM鍥剧焊</button> + <button class="action-btn small" @click="viewAttachmentInfo">鏌ョ湅闄勪欢淇℃伅</button> + <button class="action-btn small" @click="addDefectDescription" v-if="this.current">娣诲姞涓嶈壇鎻忚堪</button> + <button class="action-btn small primary" @click="submitInspection" v-if="this.current">妫�楠屾彁浜�</button> </view> <view v-if="remarksPopup" class="overlay"> <view class="popup"> @@ -1889,7 +1882,7 @@ font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif; max-width: 1000px; margin: 0 auto; - padding: 20px 20px 160px 20px; /* 搴曢儴澧炲姞padding涓哄浐瀹氭寜閽暀绌洪棿 */ + padding: 20px; background-color: #fff; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); min-height: 100vh; @@ -2014,22 +2007,27 @@ background-color: #f1f5f9; } - /* 鍥哄畾搴曢儴鎸夐挳鏍峰紡 */ - .fixed-action-buttons { - position: fixed; - bottom: 0; - left: 0; - right: 0; - background-color: #fff; - box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); - padding: 10px 15px 20px 15px; - z-index: 100; + /* 琛ㄥ崟涓婃柟鎿嶄綔鎸夐挳鍖烘牱寮� */ + .top-action-buttons { display: flex; - flex-direction: column; - gap: 8px; - max-height: 150px; - overflow-y: auto; + justify-content: flex-end; + gap: 10px; + margin: 20px 0; + padding: 15px; + background-color: #f8f9fa; + border-radius: 8px; + border: 1px solid #e9ecef; } + + /* 琛ㄥ崟涓嬫柟鎿嶄綔鎸夐挳鍖烘牱寮� */ +.bottom-action-buttons { + display: flex; + justify-content: flex-end; + gap: 10px; + margin: 20px 0; + padding: 10px; + flex-wrap: wrap; +} .action-btn { background-color: #ecf0f1; @@ -2062,9 +2060,11 @@ background-color: #2980b9; } - /* 鍐呭鍖呰鍣紝涓哄簳閮ㄦ寜閽暀鍑虹┖闂� */ - .content-wrapper { - height: 20px; /* 棰濆鐨勭┖鐧藉尯鍩� */ + /* 灏忓昂瀵告寜閽牱寮� */ + .action-btn.small { + padding: 8px 12px; + font-size: 12px; + min-height: 36px; } /* 鍘熸湁鎸夐挳鏍峰紡淇濇寔鍏煎 */ @@ -2506,4 +2506,38 @@ .attachment-popup-close:hover { background: #bdbdbd; } + + /* 鍝嶅簲寮忚璁� */ + @media (max-width: 500px) { + + .info-row, + .info-block { + flex-direction: column; + align-items: flex-start; + } + + .doc-links { + margin-left: 0; + margin-top: 10px; + } + + .top-action-buttons { + flex-direction: column; + align-items: stretch; + } + + .bottom-action-buttons { + flex-direction: column; + align-items: stretch; + } + + .action-btn { + width: 100%; + } + + .inspection-table table { + display: block; + overflow-x: auto; + } + } </style> \ No newline at end of file diff --git a/pages/QC/LLJ/ImageItem.vue b/pages/QC/LLJ/ImageItem.vue index 48e6605..7554728 100644 --- a/pages/QC/LLJ/ImageItem.vue +++ b/pages/QC/LLJ/ImageItem.vue @@ -1,233 +1,306 @@ <template> - <!-- #ifdef APP --> - <scroll-view class="page-scroll-view"> - <!-- #endif --> - <view> - <view class="uni-common-mt"> - <view class="uni-list list-pd" style="padding: 15px;"> - <view class="uni-flex" style="margin-bottom: 10px;"> - <view class="uni-list-cell-left">鐐瑰嚮鍙瑙堥�夊ソ鐨勫浘鐗�</view> - <view style="margin-left: auto;"> - <text class="click-t">{{ qsImage.length }}/{{ countIndex + 1 }}</text> - </view> - </view> - <view class="uni-flex" style="flex-wrap: wrap;"> - <view v-for="(image,index) in qsImage" :key="index" class="uni-uploader__input-box" - style="position: relative; border: 0;"> - <image :src="image.img" :data-src="image.img" - @tap="previewImage(index)"></image> - <image src="/static/plus.png" class="image-remove" @click="removeImage(index,image.id)"></image> - </view> - <image class="uni-uploader__input-box" @tap="chooseImage" src="/static/plus.png"></image> - </view> - </view> - </view> - <view class="plus-button"> - <button type="primary" class="upImg" @click="save">涓婁紶鍥剧墖</button> - </view> - </view> - <!-- #ifdef APP --> - </scroll-view> - <!-- #endif --> -</template> + <!-- #ifdef APP --> + <scroll-view class="page-scroll-view"> + <!-- #endif --> + <view> + <view class="uni-common-mt"> + <view class="uni-list list-pd" style="padding: 15px;"> + <view class="uni-flex" style="margin-bottom: 10px;"> + <view class="uni-list-cell-left">鐐瑰嚮鍙瑙堥�夊ソ鐨勫浘鐗�</view> + <view style="margin-left: auto;"> + <text class="click-t">{{ qsImage.length }}/{{ countIndex + 1 }}</text> + </view> + </view> + <view class="uni-flex" style="flex-wrap: wrap;"> + <view v-for="(image,index) in qsImage" :key="index" class="uni-uploader__input-box" + style="position: relative; border: 0;"> + <image :src="image.img" :data-src="image.img" + @tap="previewImage(index)"></image> + <image src="/static/plus.png" class="image-remove" @click="removeImage(index,image.id)"></image> + </view> + <image class="uni-uploader__input-box" @tap="chooseImage" src="/static/plus.png"></image> + </view> + </view> + </view> + <view class="plus-button"> + <button type="primary" class="upImg" @click="save">涓婁紶鍥剧墖</button> + </view> + </view> + <!-- #ifdef APP --> + </scroll-view> + <!-- #endif --> + </template> + + <script> + + import {pathToBase64, base64ToPath} from '../../../js_sdk/mmmm-image-tools/index' + + var sourceTypeArray = [ + ['camera'], + ['album'], + ['camera', 'album'] + ] + var sizeTypeArray = [ + ['compressed'], + ['original'], + ['compressed', 'original'] + ] + export default { + data() { + return { + title: 'choose/previewImage', + sourceTypeIndex: 2, + sourceType: ['鎷嶇収', '鐩稿唽', '鎷嶇収鎴栫浉鍐�'], + sizeTypeIndex: 2, + sizeType: ['鍘嬬缉', '鍘熷浘', '鍘嬬缉鎴栧師鍥�'], + countIndex: 8, + count: [1, 2, 3, 4, 5, 6, 7, 8, 9], + isCrop: false, + cropPercent: 80, + cropWidth: 100, + cropHeight: 100, + cropResize: false, + qsImage: [], + fid: 0, + } + }, + onLoad(options) { + //options涓寘鍚簡url闄勫甫鐨勫弬鏁� + + let params = options; + + if (params["id"]) { + this.fid = params["id"]; + //getQaItemXj02 + this.init(); + } + }, + onUnload() { + this.qsImage = []; + this.sourceTypeIndex = 2 + this.sourceType = ['鎷嶇収', '鐩稿唽', '鎷嶇収鎴栫浉鍐�'] + this.sizeTypeIndex = 2 + this.sizeType = ['鍘嬬缉', '鍘熷浘', '鍘嬬缉鎴栧師鍥�'] + this.countIndex = 8 + }, + methods: { + removeImage(index, id) { + this.qsImage.splice(index, 1); + if (id) { + this.$post({ + url: "/Base/removeImage", + data: { + id: id + } + }).then(res => { + }); + } + }, + chooseImage() { + if (this.qsImage.length >= 9) { + uni.showToast({ + position: "bottom", + title: "宸茬粡鏈�9寮犲浘鐗囦簡锛岃鍒犻櫎閮ㄥ垎鍥剧墖涔嬪悗閲嶆柊閫夋嫨" + }); + return; + } + + uni.chooseImage({ + sourceType: sourceTypeArray[this.sourceTypeIndex], + sizeType: sizeTypeArray[this.sizeTypeIndex], + crop: this.isCrop ? { + "quality": this.cropPercent, + "width": this.cropWidth, + "height": this.cropHeight, + "resize": this.cropResize + } : null, + count: this.qsImage.length + this.count[this.countIndex] > 9 ? 9 - this.qsImage.length : this.count[this.countIndex], + success: (res) => { + let url = res.tempFilePaths[0]; + pathToBase64(url) + .then(base64 => { + // 鎵惧埌鏈�鍚庝竴涓枩鏉犵殑浣嶇疆 + let lastSlashIndex = url.lastIndexOf("/"); + // 鎻愬彇鏂囦欢鍚� + let fileName = url.substring(lastSlashIndex + 1); + let entity = {}; + entity.img = base64; + entity.Picturename = fileName; + entity.fid = this.fid; + entity.qsType = 4; + entity.base64Date = base64.split(',')[1]; + + this.qsImage.push(entity); + }) + .catch(error => { + console.error(error) + }) + }, + fail: (err) => { + console.log("err: ", JSON.stringify(err)); + } + }); + }, + previewImage(index) { + // 妫�鏌ュ綋鍓嶅浘鐗囨槸鍚﹀瓨鍦� + const currentImage = this.qsImage[index]; + if (!currentImage || !currentImage.img) { + uni.showToast({ + title: '鍥剧墖鏁版嵁寮傚父', + icon: 'none' + }); + return; + } -<script> + // 鏄剧ず鍔犺浇鎻愮ず + uni.showLoading({ + title: '鍔犺浇涓�...' + }); -import {pathToBase64, base64ToPath} from '../../../js_sdk/mmmm-image-tools/index' + // 濡傛灉鏄痓ase64鏍煎紡锛岄渶瑕佽浆鎹负涓存椂鏂囦欢璺緞 + if (currentImage.img.startsWith('data:')) { + // 杞崲鎵�鏈塨ase64鍥剧墖涓轰复鏃舵枃浠惰矾寰� + const convertPromises = this.qsImage.map(item => { + if (item.img.startsWith('data:')) { + return base64ToPath(item.img); + } + return Promise.resolve(item.img); + }); -var sourceTypeArray = [ - ['camera'], - ['album'], - ['camera', 'album'] -] -var sizeTypeArray = [ - ['compressed'], - ['original'], - ['compressed', 'original'] -] -export default { - data() { - return { - title: 'choose/previewImage', - sourceTypeIndex: 2, - sourceType: ['鎷嶇収', '鐩稿唽', '鎷嶇収鎴栫浉鍐�'], - sizeTypeIndex: 2, - sizeType: ['鍘嬬缉', '鍘熷浘', '鍘嬬缉鎴栧師鍥�'], - countIndex: 8, - count: [1, 2, 3, 4, 5, 6, 7, 8, 9], - isCrop: false, - cropPercent: 80, - cropWidth: 100, - cropHeight: 100, - cropResize: false, - qsImage: [], - fid: 0, - } - }, - onLoad(options) { - //options涓寘鍚簡url闄勫甫鐨勫弬鏁� - - let params = options; - - if (params["id"]) { - this.fid = params["id"]; - //getQaItemXj02 - this.init(); - } - }, - onUnload() { - this.qsImage = []; - this.sourceTypeIndex = 2 - this.sourceType = ['鎷嶇収', '鐩稿唽', '鎷嶇収鎴栫浉鍐�'] - this.sizeTypeIndex = 2 - this.sizeType = ['鍘嬬缉', '鍘熷浘', '鍘嬬缉鎴栧師鍥�'] - this.countIndex = 8 - }, - methods: { - removeImage(index, id) { - this.qsImage.splice(index, 1); - if (id) { - this.$post({ - url: "/Base/removeImage", - data: { - id: id - } - }).then(res => { - }); - } - }, - chooseImage() { - if (this.qsImage.length >= 9) { - uni.showToast({ - position: "bottom", - title: "宸茬粡鏈�9寮犲浘鐗囦簡锛岃鍒犻櫎閮ㄥ垎鍥剧墖涔嬪悗閲嶆柊閫夋嫨" - }); - return; - } - - uni.chooseImage({ - sourceType: sourceTypeArray[this.sourceTypeIndex], - sizeType: sizeTypeArray[this.sizeTypeIndex], - crop: this.isCrop ? { - "quality": this.cropPercent, - "width": this.cropWidth, - "height": this.cropHeight, - "resize": this.cropResize - } : null, - count: this.qsImage.length + this.count[this.countIndex] > 9 ? 9 - this.qsImage.length : this.count[this.countIndex], - success: (res) => { - let url = res.tempFilePaths[0]; - pathToBase64(url) - .then(base64 => { - // 鎵惧埌鏈�鍚庝竴涓枩鏉犵殑浣嶇疆 - let lastSlashIndex = url.lastIndexOf("/"); - // 鎻愬彇鏂囦欢鍚� - let fileName = url.substring(lastSlashIndex + 1); - let entity = {}; - entity.img = base64; - entity.Picturename = fileName; - entity.fid = this.fid; - entity.qsType = 4; - entity.base64Date = base64.split(',')[1]; - - this.qsImage.push(entity); - }) - .catch(error => { - console.error(error) - }) - }, - fail: (err) => { - console.log("err: ", JSON.stringify(err)); - } - }); - }, - previewImage(index) { - // uni.previewImage({ - // current: index, // 璁剧疆褰撳墠鏄剧ず鍥剧墖鐨勯摼鎺� - // urls: this.qsImage.map(s=>s.img), // 闇�瑕侀瑙堢殑鍥剧墖閾炬帴鍒楄〃 - // loop: false, // 鏄惁寮�鍚浘鐗囪疆鎾紝榛樿涓� false - // indicator: 'default',// 鍥剧墖鎸囩ず鍣ㄧ被鍨嬶紝鍙�夊�间负 "default"銆�"number"銆�"pointer"锛岄粯璁や负 "default" - // }); - }, - init() { - this.$post({ - url: "/Base/getByFid", - data: { - fid: this.fid, - qsType: 4 - } - }).then(res => { - let tableData = res.data.tbBillList; - this.qsImage = tableData; - this.qsImage.forEach(s => { - s.img = 'data:image/png;base64,' + s.base64Date; - }); - }); - }, - save() { - this.$post({ - url: "/Base/saveImage", - data: { - entity: this.qsImage - } - }).then(res => { - this.init(); - this.$showMessage("淇濆瓨鎴愬姛"); - }); - } + Promise.all(convertPromises) + .then(tempFilePaths => { + uni.hideLoading(); + uni.previewImage({ + current: tempFilePaths[index], + urls: tempFilePaths, + loop: false, + indicator: 'default', + fail: (err) => { + console.error('棰勮澶辫触:', err); + uni.showToast({ + title: '棰勮澶辫触', + icon: 'none' + }); + } + }); + }) + .catch(error => { + uni.hideLoading(); + console.error('杞崲澶辫触:', error); + uni.showToast({ + title: '鍥剧墖杞崲澶辫触', + icon: 'none' + }); + }); + } else { + // 濡傛灉涓嶆槸base64鏍煎紡锛岀洿鎺ラ瑙� + uni.hideLoading(); + uni.previewImage({ + current: index, + urls: this.qsImage.map(s => s.img), + loop: false, + indicator: 'default', + fail: (err) => { + console.error('棰勮澶辫触:', err); + uni.showToast({ + title: '棰勮澶辫触', + icon: 'none' + }); + } + }); + } + }, + init() { + this.$post({ + url: "/Base/getByFid", + data: { + fid: this.fid, + qsType: 4 + } + }).then(res => { + let tableData = res.data.tbBillList; + this.qsImage = tableData; + this.qsImage.forEach(s => { + // 鏍规嵁鏂囦欢鎵╁睍鍚嶅垽鏂浘鐗囩被鍨嬶紝榛樿涓簀peg + let imageType = 'jpeg'; + if (s.Picturename) { + const ext = s.Picturename.toLowerCase().split('.').pop(); + if (ext === 'png') { + imageType = 'png'; + } else if (ext === 'gif') { + imageType = 'gif'; + } else if (ext === 'webp') { + imageType = 'webp'; + } + } + s.img = `data:image/${imageType};base64,${s.base64Date}`; + }); + }); + }, + save() { + this.$post({ + url: "/Base/saveImage", + data: { + entity: this.qsImage + } + }).then(res => { + this.init(); + this.$showMessage("淇濆瓨鎴愬姛"); + }); + } + } } -} -</script> - -<style> -.click-t { - color: darkgray; -} - -.list-pd { - margin-top: 25px; -} - -.uni-uploader__input-box { - margin: 5px; - border: 1px solid #D9D9D9; -} - -.image-remove { - transform: rotate(45deg); - width: 25px; - height: 25px; - position: absolute; - top: 0; - right: 0; - border-radius: 13px; - background-color: #FF0000; -} - -.uni-common-mt { - background-color: #ffffff; - /* 绾㈣壊鑳屾櫙 */ -} - -.plus-button { - position: fixed; - left: 0; - bottom: 0; - width: 100%; - background-color: #ffffff; /* 鑳屾櫙棰滆壊 */ - /* padding: 10px; */ - box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1); /* 娣诲姞搴曢儴闃村奖鏁堟灉 */ - z-index: 999; /* 纭繚鎸夐挳浣嶄簬椤跺眰 */ -} - -.uni-flex { - max-height: calc(100vh - 240px); /* 灞忓箷楂樺害鍑忓幓涓婁紶鎸夐挳楂樺害 */ - overflow-y: auto; /* 褰撳唴瀹硅秴鍑洪珮搴︽椂鍑虹幇鍨傜洿婊氬姩鏉� */ -} -.upImg{ - - background-color: #3498db; - color: white; - -} -</style> \ No newline at end of file + </script> + + <style> + .click-t { + color: darkgray; + } + + .list-pd { + margin-top: 25px; + } + + .uni-uploader__input-box { + margin: 5px; + border: 1px solid #D9D9D9; + } + + .image-remove { + transform: rotate(45deg); + width: 25px; + height: 25px; + position: absolute; + top: 0; + right: 0; + border-radius: 13px; + background-color: #FF0000; + } + + .uni-common-mt { + background-color: #ffffff; + /* 绾㈣壊鑳屾櫙 */ + } + + .plus-button { + position: fixed; + left: 0; + bottom: 0; + width: 100%; + background-color: #ffffff; /* 鑳屾櫙棰滆壊 */ + /* padding: 10px; */ + box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1); /* 娣诲姞搴曢儴闃村奖鏁堟灉 */ + z-index: 999; /* 纭繚鎸夐挳浣嶄簬椤跺眰 */ + } + + .uni-flex { + max-height: calc(100vh - 240px); /* 灞忓箷楂樺害鍑忓幓涓婁紶鎸夐挳楂樺害 */ + overflow-y: auto; /* 褰撳唴瀹硅秴鍑洪珮搴︽椂鍑虹幇鍨傜洿婊氬姩鏉� */ + } + .upImg{ + + background-color: #3498db; + color: white; + + } + </style> \ No newline at end of file diff --git a/pages/QC/SJ/Add.vue b/pages/QC/SJ/Add.vue index 810f3b3..6a3c50f 100644 --- a/pages/QC/SJ/Add.vue +++ b/pages/QC/SJ/Add.vue @@ -12,7 +12,7 @@ <span class="info-label">鍒涘缓鏃堕棿锛�</span> <span class="info-value">{{formData.createTime}}</span> <span class="info-label">妫�楠岀被鍨嬶細</span> - <span class="info-value">{{formData.SJ_MJ}}</span> + <span class="info-value">{{formData.sJ_MJ}}</span> </view> <view class="info-row" v-if="isUpdate"> <span class="info-label">妫�楠岀被鍨嬶細</span> @@ -40,7 +40,7 @@ </view> <view class="info-block"> - <view class="info-label">璁″垝缂栧彿锛�</view> + <view class="info-label">宸ュ崟鍗曞彿锛�</view> <picker v-if="isUpdate" class="info-picker" name="selector" :range="DAA001List" @change="onDaa001Change"> <text>{{ DAA001List[DAA001Index] }}</text> @@ -48,15 +48,9 @@ <view v-else class="info-value">{{formData.daa001}}</view> </view> - <view class="info-block"> - <view class="info-label">閿�鍞鍗曞彿锛�</view> - <view class="info-value">{{formData.caa015}}</view> - </view> + - <view class="info-block"> - <view class="info-label">瀹㈡埛锛�</view> - <view class="info-value">{{formData.cust}}</view> - </view> + <view class="info-block"> <view class="info-label">浜у搧鍚嶇О锛�</view> @@ -137,6 +131,12 @@ <button class="action-btn primary" v-if="isShowTable && isUpdate" @click="saveTable"> 鐢熸垚妫�楠岄」鐩� </button> + <button class="action-btn success" v-if="!isUpdate && formData.fsubmit == 0 && !isShowTable" @click="getGenUpdate"> + 鑾峰彇妫�楠岄」鐩� + </button> + <button class="action-btn success" v-if="!isUpdate && formData.fsubmit ==0 && !isShowTable" @click="submitInspection"> + 鎻愪氦妫�楠� + </button> </view> <!-- 寮瑰嚭妗� --> <view v-if="remarksPopup" class="overlay"> @@ -175,6 +175,7 @@ comments: "", statusUser: "", SJ_MJ: '棣栨', + fsubmit:"", }, DAA020List: [], @@ -282,7 +283,7 @@ } }).then(res => { if (res.data.tbBillList) { - this.$showMessage("宸℃鐢熸垚鎴愬姛"); + this.$showMessage("棣栨鐢熸垚鎴愬姛"); this.init(); } }); @@ -473,10 +474,10 @@ }, save() { - if (this.tableData.length === 0) { - this.$showMessage(this.formData.itemNo + "鐗╂枡娌℃湁妫�楠岄」鐩�"); - return; - } + //if (this.tableData.length === 0) { + //this.$showMessage(this.formData.itemNo + "鐗╂枡娌℃湁妫�楠岄」鐩�"); + //return; + //} if (!this.formData.daa001) { this.$showMessage("璇烽�夋嫨璁″垝缂栧彿"); @@ -528,6 +529,43 @@ this.SJ_MJIndex = e.mp.detail.value; this.formData.SJ_MJ = this.SJ_MJList[this.SJ_MJIndex]; }, + submitInspection() { + if (this.formData.id) { + this.$post({ + url: "/SJ/SjSubmit", + data: { + id: this.formData.id, + userNo: this.$loginInfo.account + } + }).then(res => { + if (res.data.tbBillList) { + this.$showMessage("鎻愪氦鎴愬姛"); + this.init(); + } + }); + } + }, + getGenUpdate() { + if (!this.formData.id || !this.formData.billNo) { + this.$showMessage("璇峰厛淇濆瓨妫�楠屽崟锛�"); + return; + } + this.$post({ + url: "/SJ/GenUpdate", + data: { + id: this.formData.id, + no: this.formData.billNo, + user: this.$loginInfo.account + } + }).then(res => { + if (res.data.result === 0) { + this.$showMessage("鑾峰彇妫�楠岄」鐩垚鍔�"); + this.init(); + } else { + this.$showMessage(res.data.message || "鑾峰彇澶辫触"); + } + }); + } }, onShow() { //姣忔杩涘叆椤甸潰閮戒細鎵ц鐨勬柟娉� @@ -785,6 +823,15 @@ background-color: #c0392b; } +.action-btn.success { + background-color: #2ecc71; + color: white; +} + +.action-btn.success:hover { + background-color: #27ae60; +} + /* 寮瑰嚭妗嗘牱寮� */ .overlay { position: fixed; diff --git a/pages/QC/XJ/Add.vue b/pages/QC/XJ/Add.vue index da84f2f..f152e1e 100644 --- a/pages/QC/XJ/Add.vue +++ b/pages/QC/XJ/Add.vue @@ -40,7 +40,7 @@ <view v-else class="info-value">{{ formData.itemNo }}</view> </view> <view class="info-item"> - <view class="info-label">璁″垝缂栧彿</view> + <view class="info-label">宸ュ崟鍗曞彿</view> <picker v-if="isUpdate" class="picker-input" name="selector" :range="DAA001List" @change="onDaa001Change"> <view class="picker-value">{{ DAA001List[DAA001Index] || '璇烽�夋嫨' }}</view> @@ -114,6 +114,8 @@ <button class="action-btn warning" v-if="!isUpdate && !isShowTable" @click="saveRemarks">娣诲姞涓嶅悎鏍兼弿杩�</button> <button class="action-btn primary" v-if="isShowTable" @click="getTable">鑾峰彇妫�楠岄」鐩�</button> <button class="action-btn primary" v-if="isShowTable && isUpdate" @click="saveTable">鐢熸垚妫�楠岄」鐩�</button> + <button class="action-btn success" v-if="!isUpdate && !isShowTable" @click="getGenUpdate">鑾峰彇妫�楠岄」鐩�</button> + <button class="action-btn success" v-if="!isUpdate && !isShowTable" @click="submitInspection">鎻愪氦妫�楠�</button> </view> <!-- 淇敼涓嶅悎鏍兼弿杩板脊鍑烘 --> <view v-if="remarksPopup" class="overlay"> @@ -260,13 +262,10 @@ }, getItem() { - if (this.isSubmit) { - this.$showMessage("姝ょ墿鏂欐棤鍚敤鐨勬楠岄」鐩紝璇风淮鎶�!"); - return; - } + if (!this.formData.billNo) { - this.$showMessage("璇烽�夋嫨璁″垝缂栧彿"); + this.$showMessage("璇烽�夋嫨宸ュ崟鍗曞彿"); return; } @@ -480,6 +479,43 @@ this.isUpdate = false; this.init(); }) + }, + submitInspection() { + if (this.formData.id) { + this.$post({ + url: "/XJ/SjSubmit", + data: { + id: this.formData.id, + userNo: this.$loginInfo.account + } + }).then(res => { + if (res.data.tbBillList) { + this.$showMessage("鎻愪氦鎴愬姛"); + this.init(); + } + }); + } + }, + getGenUpdate() { + if (!this.formData.id || !this.formData.releaseNo) { + this.$showMessage("璇峰厛淇濆瓨妫�楠屽崟锛�"); + return; + } + this.$post({ + url: "/XJ/GenUpdate", + data: { + id: this.formData.id, + no: this.formData.releaseNo, + user: this.$loginInfo.account + } + }).then(res => { + if (res.data.result === 0) { + this.$showMessage("鑾峰彇妫�楠岄」鐩垚鍔�"); + this.init(); + } else { + this.$showMessage(res.data.message || "鑾峰彇澶辫触"); + } + }); } }, onShow() { @@ -725,6 +761,11 @@ color: white; } + .action-btn.success { + background-color: #2ecc71; + color: white; + } + /* 寮瑰嚭妗嗘牱寮� */ .overlay { position: fixed; -- Gitblit v1.9.3