From 1b8ed4768feeb6433cef55ea8e7c4ad7070c151c Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期三, 16 七月 2025 13:42:13 +0800 Subject: [PATCH] OQC检验 --- pages/QC/RKJ/Add.vue | 1406 ++++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 884 insertions(+), 522 deletions(-) diff --git a/pages/QC/RKJ/Add.vue b/pages/QC/RKJ/Add.vue index 0755cd9..5f99fe0 100644 --- a/pages/QC/RKJ/Add.vue +++ b/pages/QC/RKJ/Add.vue @@ -1,566 +1,928 @@ <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.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="uni-form-item uni-column form-item edit"> - <text class="form-label">鐢熶骇绾垮埆:</text> - <superwei-combox v-if="isUpdate" :candidates="DAA020List" placeholder="璇烽�夋嫨鎴栬緭鍏�" - v-model="formData.lineNo" @select="onDaa020Change" class="picker form-input" - style="border: none;"></superwei-combox> - <input v-else class="form-input" disabled="true" type="text" v-model="formData.lineNo" /> - </view> + <view class="container"> + <!-- 椤甸潰鏍囬 --> + <view class="page-header"> + <text class="page-title">妫�楠屽崟绠$悊</text> + <!-- <text v-if="isUpdate" class="page-status status-editable">缂栬緫涓�</text> + <text v-else class="page-status status-viewonly">宸叉彁浜�</text> + --> </view> - <view class="uni-form-item uni-column form-item edit"> - <text class="form-label">閫佹鎵规鍙�:</text> - <superwei-combox v-if="isUpdate" :candidates="DAA001List" placeholder="璇烽�夋嫨鎴栬緭鍏�" - v-model="formData.billNo" @select="onDaa001Change" class="picker form-input" - style="border: none;"></superwei-combox> - <input v-else 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.itemNo" /> - </view> - <!-- <view class="form-group">--> - <!-- <label class="form-label">鐢熶骇璁㈠崟:</label>--> - <!-- <input class="form-input" disabled="true" type="text" v-model="formData.mocode"/>--> - <!-- </view>--> - <view class="form-group"> - <label class="form-label">浠诲姟鍗曞彿:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.taskNo" /> - </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="uni-title-sub uni-ellipsis-2"> - <view class="form-group"> - <label class="form-label">浜у搧鍚嶇О:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.itemName" /> - </view> - </view> - - <view class="form-group"> - <label class="form-label">閫佹鏁伴噺:</label> - <input class="form-input" disabled="true" type="text" v-model="formData.quantity" /> - </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="form-container card"> + <form :modelValue="formData"> + <view class="form-grid"> + <view class="form-group col-2"> + <label class="form-label">妫�楠屽崟鍙�:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.releaseNo" /> + </view> + <view class="form-group col-2"> + <label class="form-label">鍒涘缓浜�:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.createBy" /> + </view> + <view class="form-group col-2"> + <label class="form-label">鍒涘缓鏃堕棿:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.createDate" /> + </view> + <view class="form-group col-2"> + <label class="form-label">鐢熶骇绾垮埆:</label> + <superwei-combox v-if="isUpdate" :candidates="DAA020List" placeholder="璇烽�夋嫨鎴栬緭鍏�" + v-model="formData.lineNo" @select="onDaa020Change" class="picker form-input" + style="border: none;"></superwei-combox> + <input v-else class="form-input" disabled="true" type="text" v-model="formData.lineNo" /> + </view> + <view class="form-group col-2"> + <label class="form-label">閫佹鎵规鍙�:</label> + <superwei-combox v-if="isUpdate" :candidates="DAA001List" placeholder="璇烽�夋嫨鎴栬緭鍏�" + v-model="formData.billNo" @select="onDaa001Change" class="picker form-input" + style="border: none;"></superwei-combox> + <input v-else class="form-input" disabled="true" type="text" v-model="formData.billNo" /> + </view> + <view class="form-group col-2"> + <label class="form-label">鐗╂枡缂栫爜:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.itemNo" /> + </view> + <view class="form-group col-2"> + <label class="form-label">浠诲姟鍗曞彿:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.taskNo" /> + </view> + <view class="form-group col-2"> + <label class="form-label">浜у搧鍨嬪彿:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.itemModel" /> + </view> + <view class="form-group col-2"> + <label class="form-label">浜у搧鍚嶇О:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.itemName" /> + </view> + <view class="form-group col-2"> + <label class="form-label">閫佹鏁伴噺:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.quantity" /> + </view> + <view class="form-group col-4"> + <label class="form-label">涓嶅悎鏍兼弿杩�:</label> + <input class="form-input" disabled="true" type="text" v-model="formData.remarks" /> + </view> + </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="table-container card"> + <view class="table-header"> + <text class="section-title">妫�楠岄」鐩垪琛�</text> + </view> + <uni-table ref="table" border emptyText="鏆傛棤鏇村鏁版嵁" class="custom-table"> + <uni-tr class="table-header-row"> + <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="{ 'row-success': item.result === '鍚堟牸', 'row-warning': item.result === '涓嶅悎鏍�', 'row-pending': item.result === '鏈畬鎴�' }"> + <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 align="center"> + <view class="record-button-container"> + <button + :class="['record-button', item.isCheck >= item.levelNum ? 'complete' : 'incomplete', {'button-loading': item.isLoading}]" + @click="toDetail(item)" + :disabled="isUpdate"> + <view class="record-status"> + <text class="check-count">{{ item.isCheck }}/{{ item.levelNum }}</text> + <text class="status-text" v-if="item.isCheck >= item.levelNum">宸插畬鎴�</text> + <text class="status-text" v-else>寰呭畬鎴�</text> + </view> + <view class="record-icon"> + <i class="fa fa-arrow-right"></i> + </view> + </button> + </view> + </uni-td> + </uni-tr> + </uni-table> + </view> - <view class="plus-button"> - <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 && !isShowTable" @click="saveRemarks">娣诲姞涓嶅悎鏍兼弿杩�</button> - </view> - <view class="plus-button"> - <button type="warn" v-if="!isUpdate && !formData.fcheckResu && !isShowTable" @click="removeXJ">鍒犻櫎鍗曟嵁</button> - </view> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <view class="action-buttons-container button-group"> + <view class="plus-button"> + <view :class="['button button-warning', { 'button-loading': isLoading }]" + v-if="!isUpdate && !isShowTable" @click="submit"> + <text>瀹℃牳鍗曟嵁</text> + </view> + </view> + <view class="plus-button"> + <view :class="['button button-warning', { 'button-loading': isLoading }]" + v-if="isUpdate && !isShowTable" @click="getItem"> + <text>鐢熸垚妫�楠屽崟</text> + </view> + </view> + <view class="plus-button"> + <view :class="['button button-warning', { 'button-loading': isLoading }]" + v-if="!isUpdate && !isShowTable" @click="toImage"> + <text>涓婁紶/鏌ョ湅鍥剧墖</text> + </view> + </view> + <view class="plus-button"> + <view :class="['button button-warning', { 'button-loading': isLoading }]" + v-if="!isUpdate && !isShowTable" @click="saveRemarks"> + <text>娣诲姞涓嶅悎鏍兼弿杩�</text> + </view> + </view> + <view class="plus-button"> + <view :class="['button button-warning', { 'button-loading': isLoading }]" + v-if="isShowTable" @click="getTable"> + <text>鑾峰彇妫�楠岄」鐩�</text> + </view> + </view> + <view class="plus-button"> + <view :class="['button button-warning', { 'button-loading': isLoading }]" + v-if="isShowTable && isUpdate" @click="saveTable"> + <text>鐢熸垚妫�楠岄」鐩�</text> + </view> + </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="showPopup" 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="edit">淇敼</button> - <button @click="showPopup = !showPopup">鍙栨秷</button> - </form> - </view> - </view> - - </view> + <!-- 寮瑰嚭灞� --> + <view v-if="showPopup" class="overlay"> + <view class="popup card"> + <h3>淇敼涓嶅悎鏍兼弿杩�</h3> + <form> + <view class="form-group"> + <label class="form-label">涓嶅悎鏍兼弿杩�:</label> + <input class="form-input" type="text" v-model="remarks" /> + </view> + <view class="button-group"> + <view class="button button-success" @click="edit"> + <text>淇敼</text> + </view> + <view class="button button-default" @click="showPopup = !showPopup"> + <text>鍙栨秷</text> + </view> + </view> + </form> + </view> + </view> + </view> </template> <script> - export default { - data() { - return { - formData: { - id: "", - releaseNo: "", - createBy: "", - createDate: "", - daa020: "", - itemNo: "", - billNo: "", - catQty: "", - detailMem: "", - taskNo: "", - fcheckResu: "", - remarks: "", - itemId:"", - itemName:"", - itemModel:"", - }, + export default { + data() { + return { + formData: { + id: "", + releaseNo: "", + createBy: "", + createDate: "", + daa020: "", + itemNo: "", + billNo: "", + catQty: "", + detailMem: "", + taskNo: "", + fcheckResu: "", + remarks: "", + itemId:"", + itemName:"", + itemModel:"", + }, - DAA020List: [], + DAA020List: [], - DAA001List: [], + DAA001List: [], - BillNoList: [], + BillNoList: [], - lineList: [], + lineList: [], - lineNo: "", + lineNo: "", - tableData: [], + tableData: [], - isSubmit: true, + isSubmit: true, - isUpdate: true, + isUpdate: true, - isShowTable: false, + isShowTable: false, - remarks: "", + remarks: "", - showPopup: false, - }; - }, - onLoad(options) { - //options涓寘鍚簡url闄勫甫鐨勫弬鏁� + showPopup: false, + + // 鏂板锛氬姞杞界姸鎬佹帶鍒� + isLoading: false, + }; + }, + onLoad(options) { + let params = options; - let params = options; + if (params["id"]) { + this.isUpdate = false; + this.formData.id = params["id"]; + this.formData.releaseNo = params["releaseNo"]; + this.init(); + } else { + this.$post({ + url: "/RKJ/getMaxReleaseNo" + }).then(res => { + this.formData.releaseNo = res.data.tbBillList; + this.formData.createBy = this.$loginInfo.account; + this.formData.createDate = this.$getDate("yyyy-mm-dd"); + }); - if (params["id"]) { - this.isUpdate = false; - this.formData.id = params["id"]; - this.formData.releaseNo = params["releaseNo"]; - //getQaItemXj02 - this.init(); - } else { - //鍒濆鍖栨楠屽崟鍙� - this.$post({ - url: "/RKJ/getMaxReleaseNo" - }).then(res => { - this.formData.releaseNo = res.data.tbBillList; - this.formData.createBy = this.$loginInfo.account; - this.formData.createDate = this.$getDate("yyyy-mm-dd"); - }); + this.$post({ + url: "/XJ/getLineAll" + }).then(res => { + this.lineList = res.data.tbBillList; + this.DAA020List = res.data.tbBillList.map(item => item.lineName); + }) + } + }, + methods: { + removeXJ() { + if (this.formData.id) { + this.$post({ + url: "/RKJ/removeXJ", + data: { + id: this.formData.id + } + }).then(res => { + if (res.data.tbBillList > 0) { + this.$showMessage("鍒犻櫎鎴愬姛"); + uni.navigateBack(); + } else { + this.$showMessage("鍒犻櫎澶辫触"); + } + }); + } else { + this.$showMessage("璇峰厛閫夋嫨妫�楠屽崟鍙�"); + } + }, + getItem() { + if (!this.formData.billNo) { + this.$showMessage("璇烽�夋嫨閫佹鎵规鍙�"); + return; + } - //杞﹂棿涓嬫媺妗嗙殑鍒濆鍖� - this.$post({ - url: "/XJ/getLineAll" - }).then(res => { - this.lineList = res.data.tbBillList; - this.DAA020List = res.data.tbBillList.map(item => item.lineName); - }) - } - }, - methods: { - removeXJ() { - if (this.formData.id) { - this.$post({ - url: "/RKJ/removeXJ", - data: { - id: this.formData.id - } - }).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 (!this.formData.billNo) { - this.$showMessage("璇烽�夋嫨閫佹鎵规鍙�"); - return; - } + // 鏄剧ず鍔犺浇鐘舵�� + this.isLoading = true; + + this.$post({ + url: "/RKJ/save", + data: { + from: this.formData, + userNo: this.$loginInfo.account, + items: this.tableData + } + }).then(res => { + // 闅愯棌鍔犺浇鐘舵�� + this.isLoading = false; + + this.formData.id = res.data.tbBillList; + this.$showMessage("鐢熸垚妫�楠岄」鐩垚鍔�"); + this.init(); + this.isUpdate = false; + }); + }, + onDaa020Change(event) { + this.formData.lineName = event; + this.lineNo = this.lineList[this.DAA020List.indexOf(event)].lineNo; + this.formData.line = this.lineNo; - if (this.isSubmit) { - this.$showMessage("姝ょ墿鏂欐棤鍚敤鐨勬楠岄」鐩紝璇风淮鎶�!"); - return; - } + this.$post({ + url: "/RKJ/getDaa001", + data: { + lineNo: this.lineNo + } + }).then(res => { + this.BillNoList = res.data.tbBillList; + this.DAA001List = res.data.tbBillList.map(s => s.billNo); - this.$post({ - url: "/RKJ/save", - data: { - from: this.formData, - userNo: this.$loginInfo.account, - //moidNum: this.formData.moidNum - items: this.tableData - } - }).then(res => { - this.formData.id = res.data.tbBillList; - this.$showMessage("鐢熸垚妫�楠岄」鐩垚鍔�"); - this.init(); - this.isUpdate = false; - }); - }, - //鐢熶骇绾垮埆閫夋嫨骞跺垵濮嬭瘽宸ュ崟鍙� - onDaa020Change(event) { - //鑾峰彇鐢熶骇绾垮埆鐨勪笅鏍囧湴鍧� - this.formData.lineName = event; + this.formData.billNo = ""; + this.formData.mocode = ""; + this.formData.boardModel = ""; + this.formData.taskNo = ""; + this.formData.itemNo = ""; + this.formData.boardName = ""; + this.formData.quantity = ""; + this.tableData = []; + }) + }, + onDaa001Change(e) { + this.formData.billNo = e; + let data = this.BillNoList[this.DAA001List.indexOf(e)]; - this.lineNo = this.lineList[this.DAA020List.indexOf(event)].lineNo; + if (!data) { + this.formData.billNo = ""; + this.formData.mocode = ""; + this.formData.boardModel = ""; + this.formData.taskNo = ""; + this.formData.itemNo = ""; + this.formData.boardName = ""; + this.formData.quantity = ""; + this.tableData = []; + return; + } + this.formData.billNo = data.billNo; + this.formData.mocode = data.mocode; + this.formData.boardModel = data.boardModel; + this.formData.taskNo = data.taskNo; + this.formData.itemNo = data.itemNo; + this.formData.boardName = data.boardName; + this.formData.quantity = data.quantity; - this.formData.line = this.lineNo; + this.$post({ + url: "/RKJ/setJYItem", + data: { + itemId: this.formData.itemId, + quantity: this.formData.quantity + } + }).then(res => { + this.tableData = res.data.tbBillList; + if (this.tableData.length === 0) { + this.$showMessage("璇ョ墿鏂欐病鏈夋楠岄」鐩�"); + this.isSubmit = true; + this.tableData = []; + } else { + this.isSubmit = false; + } + }); + }, + submit() { + // 鏄剧ず鍔犺浇鐘舵�� + this.isLoading = true; + + this.$post({ + url: "/RKJ/RKJQaSubmit", + data: { + userNo: this.$loginInfo.account, + gid: this.formData.id + } + }).then(res => { + // 闅愯棌鍔犺浇鐘舵�� + this.isLoading = false; + + if (res.statusCode === 200) { + this.$showMessage("鎴愬姛鎻愪氦妫�楠�"); + setTimeout(() => { + this.hideCustomMessage(); + }, 7000); + } else { + this.$showMessage(res.data.message); + } + }) + }, + init() { + this.$post({ + url: "/RKJ/getPage", + data: { + id: this.formData.id, + pageIndex: 1, + limit: 1, + } + }).then(res => { + let data = res.data.tbBillList[0]; + if (data) { + this.formData = data; - this.$post({ - url: "/RKJ/getDaa001", - data: { - lineNo: this.lineNo - } - }).then(res => { - this.BillNoList = res.data.tbBillList; - this.DAA001List = res.data.tbBillList.map(s => s.billNo); - - this.formData.billNo = ""; - this.formData.mocode = ""; - this.formData.boardModel = ""; - this.formData.taskNo = ""; - this.formData.itemNo = ""; - this.formData.boardName = ""; - this.formData.quantity = ""; - this.tableData = []; - }) - }, - //閫夊彇宸ュ崟濉厖鐗╂枡鍙峰拰鍏朵粬淇℃伅 - onDaa001Change(e) { - - this.formData.billNo = e; - - let data = this.BillNoList[this.DAA001List.indexOf(e)]; - - //褰撹繑鍥炵殑缁撴灉闆嗕负绌烘椂缃┖鍘熸湁鐨勫�� - if (!data) { - this.formData.billNo = ""; - this.formData.mocode = ""; - this.formData.boardModel = ""; - this.formData.taskNo = ""; - this.formData.itemNo = ""; - this.formData.boardName = ""; - this.formData.quantity = ""; - this.tableData = []; - return; - } - //涓嶄负绌烘椂璧嬪�� - this.formData.billNo = data.billNo; - this.formData.mocode = data.mocode; - this.formData.boardModel = data.boardModel; - this.formData.taskNo = data.taskNo; - this.formData.itemNo = data.itemNo; - this.formData.boardName = data.boardName; - this.formData.quantity = data.quantity; - - - this.$post({ - url: "/RKJ/setJYItem", - data: { - itemId: this.formData.itemId, - quantity: this.formData.quantity - } - }).then(res => { - this.tableData = res.data.tbBillList; - if (this.tableData.length === 0) { - this.$showMessage("璇ョ墿鏂欐病鏈夋楠岄」鐩�"); - this.isSubmit = true; - this.tableData = []; - } else { - this.isSubmit = false; - } - }); - }, - init() { - this.$post({ - url: "/RKJ/getPage", - data: { - id: this.formData.id, - pageIndex: 1, - limit: 1, - } - }).then(res => { - let data = res.data.tbBillList[0]; - if (data) { - this.formData = data; - - this.$post({ - url: "/RKJ/getItems", - data: { - pid: this.formData.id - } - }).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?id=' + item.id + '&billNo=' + this.formData.billNo + '&gid=' + this.formData - .id - }); - } - }, - toImage() { - uni.navigateTo({ - url: 'ImageItem?id=' + this.formData.id - }); - }, - saveRemarks() { - this.showPopup = !this.showPopup; - this.remarks = this.formData.remarks; - }, - edit() { - if (this.remarks) { - //saveRemarksGid - this.$post({ - url: "/RKJ/saveRemarksGid", - data: { - gid: this.formData.id, - remarks: this.remarks - } - }).then(res => { - if (res.data.tbBillList > 0) { - this.formData.remarks = this.remarks; - this.showPopup = !this.showPopup; - this.$showMessage("淇濆瓨鎴愬姛"); - } - }) - } - }, - getTable() { - this.$post({ - url: "/RKJ/setJYItem", - data: { - itemId: this.formData.itemId, - quantity: this.formData.quantity - } - }).then(res => { - - this.tableData = res.data.tbBillList; - - if (this.tableData.length === 0) { - - - this.$showMessage("璇ョ墿鏂欐潯鐮佹病鏈夋楠岄」鐩�"); - this.isSubmit = true; - this.tableData = []; - this.isShowTable = true; - this.isUpdate = false; - - } else { - - this.isSubmit = false; - this.isShowTable = true; - this.isUpdate = true; - - } - - }); - }, - saveTable() { - if (this.tableData.length === 0) { - return; - } - this.$post({ - url: "/RKJ/saveItem", - data: { - gid: this.formData.id, - items: this.tableData, - userNo: this.$loginInfo.account - } - }).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: "/RKJ/getItems", + data: { + pid: this.formData.id + } + }).then(res1 => { + let tableData = res1.data.tbBillList; + tableData.sort((a, b) => { + if (a.result === '鏈畬鎴�' && b.result === '鍚堟牸') return -1; + if (a.result === '鍚堟牸' && b.result === '鏈畬鎴�') return 1; + 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, + }); + return; + } + + // 璁剧疆褰撳墠椤圭洰鐨勫姞杞界姸鎬� + item.isLoading = true; + + uni.navigateTo({ + url: 'detail?id=' + item.id + '&billNo=' + this.formData.billNo + '&gid=' + this.formData.id + '&releaseNo=' + this.formData.releaseNo, + complete: () => { + // 椤甸潰璺宠浆瀹屾垚鍚庯紝鍙栨秷鍔犺浇鐘舵�� + item.isLoading = false; + } + }); + }, + toImage() { + // 鏄剧ず鍔犺浇鐘舵�� + this.isLoading = true; + + uni.navigateTo({ + url: 'ImageItem?id=' + this.formData.id, + complete: () => { + // 椤甸潰璺宠浆瀹屾垚鍚庯紝鍙栨秷鍔犺浇鐘舵�� + this.isLoading = false; + } + }); + }, + saveRemarks() { + this.showPopup = !this.showPopup; + this.remarks = this.formData.remarks; + }, + edit() { + if (this.remarks) { + // 鏄剧ず鍔犺浇鐘舵�� + this.isLoading = true; + + this.$post({ + url: "/RKJ/saveRemarksGid", + data: { + gid: this.formData.id, + remarks: this.remarks + } + }).then(res => { + // 闅愯棌鍔犺浇鐘舵�� + this.isLoading = false; + + if (res.data.tbBillList > 0) { + this.formData.remarks = this.remarks; + this.showPopup = !this.showPopup; + this.$showMessage("淇濆瓨鎴愬姛"); + } + }) + } + }, + getTable() { + // 鏄剧ず鍔犺浇鐘舵�� + this.isLoading = true; + + this.$post({ + url: "/RKJ/setJYItem", + data: { + itemId: this.formData.itemId, + quantity: this.formData.quantity + } + }).then(res => { + // 闅愯棌鍔犺浇鐘舵�� + this.isLoading = false; + + this.tableData = res.data.tbBillList; + if (this.tableData.length === 0) { + this.$showMessage("璇ョ墿鏂欐潯鐮佹病鏈夋楠岄」鐩�"); + this.isSubmit = true; + this.tableData = []; + this.isShowTable = true; + this.isUpdate = false; + } else { + this.isSubmit = false; + this.isShowTable = true; + this.isUpdate = true; + } + }); + }, + saveTable() { + if (this.tableData.length === 0) { + return; + } + + // 鏄剧ず鍔犺浇鐘舵�� + this.isLoading = true; + + this.$post({ + url: "/RKJ/saveItem", + data: { + gid: this.formData.id, + items: this.tableData, + userNo: this.$loginInfo.account + } + }).then(res => { + // 闅愯棌鍔犺浇鐘舵�� + this.isLoading = false; + + this.formData.id = res.data.tbBillList; + this.isShowTable = false; + this.isUpdate = false; + this.init(); + }) + } + }, + onShow() { + if (this.formData.id) { + this.init(); + } + }, + }; </script> <style> - .form-group { - display: flex; - align-items: center; - border-bottom: 1px solid #c9c9c9; - } + .container { + padding: 15px; + background-color: #f9fafb; + } - .form-label { - margin-bottom: 0; - padding: 5px; - } + .page-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 20px; + padding-bottom: 10px; + border-bottom: 2px solid #e5edff; + } - .form-input { - flex: 1; - margin-bottom: 0; - padding: 5px; - } + .page-title { + font-size: 22px; + font-weight: 700; + color: #3498db; + } + + .page-status { + font-size: 13px; + padding: 4px 10px; + border-radius: 18px; + font-weight: 500; + } + + .status-editable { + background-color: #e6f2ff; + color: #3498db; + } + + .status-viewonly { + background-color: #e6ffed; + color: #27ae60; + } + + .card { + background-color: #fff; + border-radius: 12px; + box-shadow: 0 4px 12px rgba(52, 152, 219, 0.1); + padding: 20px; + margin-bottom: 15px; + transition: transform 0.3s; + } + + .card:hover { + transform: translateY(-3px); + } + + .form-grid { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 12px; + } + + .form-group { + display: flex; + flex-direction: column; + border-bottom: 1px solid #ebf2ff; + padding-bottom: 12px; + } + + .col-2 { + grid-column: span 2; + } + + .col-4 { + grid-column: span 4; + } + + .form-label { + font-size: 13px; + color: #7f8c8d; + margin-bottom: 6px; + font-weight: 500; + } + + .form-input { + padding: 8px 12px; + border: 1px solid #dfe6e9; + border-radius: 8px; + font-size: 13px; + color: #2c3e50; + background-color: #f9f9f9; + } + + .form-input:disabled { + background-color: #f1f2f6; + color: #95a5a6; + cursor: not-allowed; + } + + .picker { + flex: 1; + margin-bottom: 0; + padding: 8px 12px; + border: 1px solid #dfe6e9; + border-radius: 8px; + font-size: 13px; + color: #2c3e50; + background-color: #f9f9f9; + } + + .table-container { + margin-bottom: 15px; + } + + .table-header { + margin-bottom: 12px; + } + + .section-title { + font-size: 16px; + font-weight: 600; + color: #2c3e50; + } + + .custom-table { + width: 100%; + } + + .table-header-row { + background-color: #3498db; + color: #fff; + } + + .th { + padding: 10px 12px; + text-align: center; + font-weight: 500; + font-size: 13px; + } + + .table-row { + transition: background-color 0.3s; + } + + .table-row:hover { + background-color: #f8f9fa; + } + + .table-row td { + padding: 10px 12px; + border-bottom: 1px solid #ebf2ff; + font-size: 13px; + color: #34495e; + } + + .row-success td { + background-color: #e8f5e9; + } + + .row-warning td { + background-color: #fff3e0; + } + + .row-pending td { + background-color: #f5f5f5; + } + + .plus-button { + display: flex; + justify-content: center; + margin-bottom: 10px; + } + + /* 鍩虹鎸夐挳鏍峰紡 - 缁熶竴瑙勮寖 */ + .button { + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0 24px; + height: 40px; + font-size: 14px; + font-weight: 500; + border: none; + border-radius: 8px; + cursor: pointer; + transition: all 0.3s ease; + overflow: hidden; + box-shadow: 0 4px 12px rgba(231, 76, 60, 0.25); + } + + /* 涓绘搷浣滄寜閽� - 璀﹀憡绫诲瀷锛堝師绾㈣壊鎸夐挳锛� */ + .button-warning { + background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); + color: #ffffff; + } + + /* 娆¤鎿嶄綔鎸夐挳 - 榛樿绫诲瀷 */ + .button-default { + background-color: #f5f7fa; + color: #6c757d; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); + } + + /* 鎴愬姛鎿嶄綔鎸夐挳 - 缁胯壊绫诲瀷 */ + .button-success { + background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%); + color: #ffffff; + box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3); + } + + /* 鎸夐挳鎮仠鏁堟灉 */ + .button-warning:hover, + .button-default:hover, + .button-success:hover { + transform: translateY(-3px); + } + + /* 鎸夐挳鐐瑰嚮鏁堟灉 */ + .button-warning:active, + .button-default:active, + .button-success:active { + transform: translateY(1px); + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); + } + + /* 鎸夐挳鍔犺浇鐘舵�� */ + .button-loading { + cursor: progress; + } + + .button-loading::after { + content: ""; + position: absolute; + width: 16px; + height: 16px; + border: 2px solid rgba(255, 255, 255, 0.3); + border-top-color: #ffffff; + border-radius: 50%; + animation: spin 1s linear infinite; + } + + .button-default.button-loading::after { + border-top-color: #6c757d; + } + + .button-success.button-loading::after { + border-top-color: #ffffff; + } + + /* 绂佺敤鐘舵�佹寜閽� */ + .button:disabled { + opacity: 0.6; + cursor: not-allowed; + transform: none !important; + box-shadow: none !important; + } + + /* 鍔犺浇鍔ㄧ敾 */ + @keyframes spin { + to { + transform: rotate(360deg); + } + } + + /* 鎸夐挳鍥炬爣鏍峰紡 - 鏀寔宸︿晶鍥炬爣 */ + .button-icon { + margin-right: 8px; + font-size: 16px; + } + + /* 鎸夐挳缁勬牱寮� - 浼樺寲鎸夐挳闂磋窛 */ + .button-group { + display: flex; + flex-wrap: wrap; + gap: 12px; + justify-content: center; + margin: 15px 0; + } + + /* 璁板綍鎸夐挳鏍峰紡 */ + .record-button-container { + display: flex; + justify-content: center; + } + + .record-button { + display: flex; + align-items: center; + justify-content: space-between; + width: 120px; + height: 36px; + border-radius: 18px; + padding: 0 16px; + transition: all 0.3s ease; + cursor: pointer; + position: relative; + overflow: hidden; + } + + .record-button.complete { + background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%); + color: white; + box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3); + } + + .record-button.incomplete { + background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); + color: white; + box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3); + } + + .record-button:hover { + transform: translateY(-2px); + box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); + } + + .record-button:active { + transform: translateY(1px); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); + } + + .record-button:disabled { + opacity: 0.6; + cursor: not-allowed; + transform: none !important; + box-shadow: none !important; + } - .picker { - flex: 1; - margin-bottom: 0; - padding: 5px; - font-size: 12px; - } - .uni-form-item { - display: flex; - border-bottom: 1px solid #c9c9c9; - } + .check-count { + font-size: 12px; + font-weight: 600; + } - .edit { - background-color: white; - } + .status-text { + font-size: 10px; + opacity: 0.8; + } - /* 榛樿鏍峰紡 */ - .list-container { - height: 60vh; - /* 璁剧疆鍒楄〃瀹瑰櫒鐨勯珮搴︿负鍓╀綑绌洪棿锛屽苟鍑忓幓琛ㄥ崟瀹瑰櫒鐨勯珮搴� */ - overflow-y: auto; - /* 鍏佽鍒楄〃瀹瑰櫒鍨傜洿婊氬姩 */ - padding: 10px; - /* 鍙�夛細娣诲姞涓�浜涘唴杈硅窛锛屼娇鍒楄〃鍐呭鏇寸編瑙� */ - } + .record-icon { + width: 20px; + height: 20px; + border-radius: 50%; + background-color: rgba(255, 255, 255, 0.2); + display: flex; + align-items: center; + justify-content: center; + font-size: 10px; + } - /* 鍦ㄥ皬灞忓箷璁惧涓婏紝閲嶇疆楂樺害涓洪�傚簲灞忓箷 */ - @media (max-width: 768px) { - .list-container { - height: calc(100vh - 500px); - /* 閫傚綋璋冩暣楂樺害 */ - } - } + /* 璁板綍鎸夐挳鍔犺浇鐘舵�� */ + .record-button.button-loading::after { + content: ""; + position: absolute; + width: 16px; + height: 16px; + border: 2px solid rgba(255, 255, 255, 0.3); + border-top-color: #ffffff; + border-radius: 50%; + animation: spin 1s linear infinite; + right: 16px; + } + .record-button.button-loading .record-icon { + opacity: 0; + } - .form-container { - padding: 10px; - /* 鍙�夛細娣诲姞涓�浜涘唴杈硅窛锛屼娇琛ㄥ崟鍐呭鏇寸編瑙� */ - } + .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; + } - .th { - background-color: lightskyblue; - color: #FFFFFF; - } + .popup { + background-color: #fff; + padding: 20px; + border: 1px solid #ccc; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + width: 80vw; + border-radius: 10px; + } - - .plus-button { - line-height: 59px; - font-size: 24px; - cursor: pointer; - z-index: 1000; - margin-bottom: 10px; - } - - .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% */ - } + h3 { + font-size: 16px; + margin-bottom: 15px; + color: #2c3e50; + } </style> \ No newline at end of file -- Gitblit v1.9.3