From f26f29d84e0a68831a6af14dab3eec5500496d2e Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期三, 28 五月 2025 16:48:52 +0800 Subject: [PATCH] 初始化项目 --- pages/product/produce/reportWork.vue | 865 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 865 insertions(+), 0 deletions(-) diff --git a/pages/product/produce/reportWork.vue b/pages/product/produce/reportWork.vue new file mode 100644 index 0000000..3dfd6fd --- /dev/null +++ b/pages/product/produce/reportWork.vue @@ -0,0 +1,865 @@ +<template> + <view class="page"> + <view class="production-index-bg" /> + <u-navbar title="鎶ュ伐浜у嚭" :background="background" :border-bottom="false" :title-bold="true" title-color="#000" + back-icon-color="#000" /> + <view class="operation-task-tab"> + <scroll-view id="tab-bar" class="scroll-h" :scroll-x="true" :show-scrollbar="false" enable-flex> + <view v-for="(tab,index) in tabBars" :key="tab.id" class="uni-tab-item" :id="tab.id" + :data-current="index" @click="ontabtap"> + <text class="uni-tab-item-title" + :class="tabIndex==index ? 'uni-tab-item-title-active' : ''">{{tab.name}}</text> + </view> + </scroll-view> + </view> + <view class="line-h"></view> + <view class="wrap" :current="tabIndex" @change="ontabchange"> + <scroll-view class="operation-task-scroll-list" scroll-y="true" @scrolltolower="loadMore"> + <u-cell-group class="operation-task-scroll-list-group" :border="false"> + <div class="tip" style="text-align:center;" v-if="list.length==0">-鏆傛棤鎶ュ伐鍗�-</div> + <view class="content" v-for="(item, index) in list" :key="item.id" :index="index"> + <view class="content-header"> + <view class="content-header-left"> + <radio :checked="item.isChecked" style="transform:scale(0.6)" @click="choose(item)" /> + </view> + <viem class="content-header-right"> + <view style="display: flex; justify-content: center; align-items: center;" + v-if="item.state == '02submitted'"> + <image src="/static/custom/operationTask/submit-state-icon.png" + style="width: 30rpx; height: 30rpx; margin-right: 5rpx;"></image> + <text style="text-align: center; color: #007145;">宸叉彁浜�</text> + </view> + + <view style="display: flex; justify-content: center; align-items: center;" + v-if="item.state == '01draft'"> + <image src="/static/custom/operationTask/unsubmit-state-icon.png" + style="width: 30rpx; height: 30rpx; margin-right: 5rpx;"></image> + <text style="text-align: center; color: #F46F6C;">鑽夌</text> + </view> + + <view style="display: flex; justify-content: center; align-items: center;" + v-if="item.state == '04processing'"> + <image src="/static/custom/operationTask/in-progress-state-icon.png" + style="width: 30rpx; height: 30rpx; margin-right: 5rpx;"></image> + <text style="text-align: center; color: #c8af3c;">澶勭悊涓�</text> + </view> + </viem> + </view> + <view class="content-body" @click="choose(item)"> + <view class="row-list"> + <view class="_label"> + 鎶ュ伐鍗曞彿锛� + </view> + <view class="_content"> + {{ item.productNo }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 闆朵欢缂栧彿锛� + </view> + <view class="_content"> + {{ item.partNo }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 闆朵欢鍚嶇О锛� + </view> + <view class="_content"> + <text>{{ item.partName }}</text> + </view> + </view> + <view class="row-list"> + <view class="_label"> + SN鍙凤細 + </view> + <view class="_content"> + {{ item.outBatchNo }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 杞藉叿缂栧彿锛� + </view> + <view class="_content"> + {{ item.reelNumber }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 璧峰鏁伴噺锛� + </view> + <view class="_content"> + {{ item.startMeterMark }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 鎴鏁伴噺锛� + </view> + <view class="_content"> + {{ item.endMeterMark }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 鐢熶骇鏁伴噺锛� + </view> + <view class="_content"> + {{ item.productQty }} + </view> + </view> + <!-- <view class="content-body-collapse"> + <uni-collapse class="collapse" ref="collapse" v-model="value" @change="change"> + <uni-collapse-item title="灞曞紑" open="false" style="height: 10rpx;"> + <view class="content"> + <text + class="text">鎶樺彔鍐呭涓讳綋锛岃繖鏄竴娈垫瘮杈冮暱鍐呭銆傞粯璁ゆ姌鍙犱富瑕佸唴瀹癸紝鍙樉绀哄綋鍓嶉」鏍囬銆傜偣鍑绘爣棰樺睍寮�锛屾墠鑳界湅鍒拌繖娈垫枃瀛椼�傚啀娆$偣鍑绘爣棰橈紝鎶樺彔鍐呭銆�</text> + </view> + </uni-collapse-item> + </uni-collapse> + </view> --> + </view> + <view class="content-footer"> + <view class="footer-btn"> + <wu-button :custom-style="customStyleEight" size="small" @click="deleteTracking(item)"> + <image src="/static/custom/operationTask/red-delete-icon.png" + style="width: 30rpx; height: 30rpx; margin-right: 5rpx;"></image> + 鍒犻櫎 + </wu-button> + </view> + <view class="footer-btn"> + <wu-button :custom-style="customStyleThree" size="small" + @click="toEditProductOut(item)"> + <image src="/static/custom/operationTask/black-edit-icon.png" + style="width: 26rpx; height: 26rpx; margin-right: 5rpx;"></image> + 缂栬緫 + </wu-button> + </view> + <view class="footer-btn"> + <wu-button :custom-style="customStyleSix" size="small" @click="revokeTracking(item)"> + <image src="/static/custom/operationTask/black-revoke-icon.png" + style="width: 30rpx; height: 30rpx; margin-right: 5rpx;"></image> + 鎾ら攢 + </wu-button> + </view> + <view class="footer-btn"> + <wu-button :custom-style="customStyleFour" size="small" @click="submitTracking(item)"> + <image src="/static/custom/operationTask/blue-submit-icon.png" + style="width: 30rpx; height: 30rpx; margin-right: 5rpx;"></image> + 鎻愪氦 + </wu-button> + </view> + </view> + </view> + </u-cell-group> + <view class="loadmore" @click="loadMore"> + <u-loadmore :status="loadStatus"></u-loadmore> + </view> + </scroll-view> + <view class="suspend"> + <wu-button class="suspend-btn" :custom-style="customStyleFive" size="small" @click="toCreateReport"> + <image src="/static/custom/operationTask/book-icon.png" + style="width: 30rpx; height: 30rpx; margin-right: 5rpx;"></image> + 浜у嚭 + </wu-button> + </view> + <view class="bottom"> + <view class="bottom-left"> + <!-- <radio-group @change="chooseAll" v-model="chooseAllState"> --> + <label> + <radio :checked="chooseAllState" @click="chooseAll" style="transform:scale(0.6)" />鍏ㄩ�� + </label> + <!-- </radio-group> --> + </view> + <view class="bottom-right"> + <view class="bottom-btn"> + <wu-button :custom-style="customStyleOne" shape="circle" size="small" @click="deleteTracking"> + 鍒犻櫎 + </wu-button> + </view> + <view class="bottom-btn"> + <wu-button :custom-style="customStyleTwo" shape="circle" size="small" @click="revokeTracking"> + 鎾ら攢 + </wu-button> + </view> + + <view class="bottom-btn"> + <wu-button :custom-style="customStyleTwo" shape="circle" size="small" @click="submitTracking"> + 鎻愪氦 + </wu-button> + </view> + <view class="bottom-btn"> + <wu-button :custom-style="customStyleTwo" shape="circle" size="small"> + 浜ょ彮浜у嚭 + </wu-button> + </view> + </view> + </view> + </view> + </view> +</template> +<script> + import content_bg from '@/static/custom/product/productBg.png' + + export default { + components: {}, + computed: { + customStyleOne() { + return { + color: '#FFFFFF', + background: '#F46F6C', + width: '120rpx' + } + }, + customStyleTwo() { + return { + color: '#FFFFFF', + background: '#234EED', + width: '140rpx' + } + }, + customStyleThree() { + return { + color: '#333333', + background: '#FFFFFF', + width: '140rpx' + } + }, + customStyleFour() { + return { + color: '#234EED', + background: '##FFFFFF', + width: '140rpx', + } + }, + customStyleFive() { + return { + color: '#FFFFFF', + background: '#234EED', + width: '90rpx', + height: '120rpx', + borderRadius: '100%' + } + }, + customStyleSix() { + return { + color: '#333333', + background: '##FFFFFF', + width: '120rpx', + } + }, + customStyleSeven() { + return { + color: '#FFFFFF', + background: '#0e932e', + width: '120rpx' + } + }, + customStyleEight() { + return { + color: '#F46F6C', + background: '#FFFFFF', + width: '120rpx' + } + }, + }, + data() { + return { + background: { + backgroundImage: `url(${content_bg})`, + backgroundAttachment: 'fixed', + backgroundSize: '100% auto', + backgroundRepeat: 'no-repeat', + }, + newsList: [], + cacheTab: [], + tabIndex: 0, + tabBars: [{ + name: '鎸夌粍鎶ュ伐', + id: 'group' + }, { + name: '鎸変汉鍛樻姤宸�', + id: 'person' + }], + scrollInto: "group", + showTips: false, + navigateFlag: false, + pulling: false, + refreshIcon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAB5QTFRFcHBw3Nzct7e39vb2ycnJioqK7e3tpqam29vb////D8oK7wAAAAp0Uk5T////////////ALLMLM8AAABxSURBVHja7JVBDoAgDASrjqj//7CJBi90iyYeOHTPMwmFZrHjYyyFYYUy1bwUZqtJIYVxhf1a6u0R7iUvWsCcrEtwJHp8MwMdvh2amHduiZD3rpWId9+BgPd7Cc2LIkPyqvlQvKxKBJ//Qwq/CacAAwDUv0a0YuKhzgAAAABJRU5ErkJggg==", + list: [], + array: [], + chooseAllState: false, + query: { + current: 1, + size: 10, + workstationId: null, + operationTaskId: null + }, + workstationInfo: { + workstationId: null, + workstationNo: null, + workstationName: null, + workCenter: null + }, + staffs: [], + dutyRecordId: null, + operationTaskInfo: {}, + loadStatus: 'loadmore', + }; + }, + onLoad(option) { + if (option.params) { + const params = JSON.parse(decodeURIComponent(option.params)); + if (params.operationTaskId && params.workstationId) { + this.query.operationTaskId = params.operationTaskId; + this.query.workstationId = params.workstationId; + this.operationTaskInfo = params; + this.loadList(); + } + } + }, + onShow() {}, + methods: { + loadList() { + this.$u.api.outputRegister.getProductMainV1(this.query).then(res => { + if (!res.data.records || res.data.records.length == 0) { + this.loadStatus = "nomore"; + return; + } + this.list = this.list.concat(res.data.records); + this.list.forEach(el => { + this.$set(el, 'isChecked', false); + }) + this.query.current = res.data.current; + this.query.size = res.data.size; + this.loadStatus = "loadmore"; + }); + }, + goDetail(item) { + if (this.navigateFlag) { + return; + } + this.navigateFlag = true; + uni.navigateTo({ + url: './operationTaskInfo?item=' + encodeURIComponent(JSON.stringify(item)) + }); + setTimeout(() => { + this.navigateFlag = false; + }, 200) + }, + loadMore() { + if (this.loadStatus == "nomore") { + return + } + this.loadStatus = "loading"; + setTimeout(() => { + this.query.current += 1; + this.loadList(); + }, 100); + }, + ontabtap(e) { + let index = e.target.dataset.current || e.currentTarget.dataset.current; + this.switchTab(index); + }, + ontabchange(e) { + let index = e.target.current || e.detail.current; + this.switchTab(index); + }, + switchTab(index) { + if (this.tabIndex === index) { + return; + } + + // // 娓呯┖鏁版嵁 + // this.clearTabData(); + + // if (this.list.length === 0) { + // this.loadList(index); + // } + + this.tabIndex = index; + this.scrollInto = this.tabBars[index].id; + }, + clearTabData(e) { + this.list = []; + this.query.state = null; + }, + refreshData() {}, + onrefresh(e) { + var tab = this.list[this.tabIndex]; + if (!tab.refreshFlag) { + return; + } + tab.refreshing = true; + tab.refreshText = "姝e湪鍒锋柊..."; + + setTimeout(() => { + this.refreshData(); + this.pulling = true; + tab.refreshing = false; + tab.refreshFlag = false; + tab.refreshText = "宸插埛鏂�"; + setTimeout(() => { // TODO fix ios鍜孉ndroid 鍔ㄧ敾鏃堕棿鐩稿弽闂 + this.pulling = false; + }, 500); + }, 2000); + }, + onpullingdown(e) { + var tab = this.list[this.tabIndex]; + if (tab.refreshing || this.pulling) { + return; + } + if (Math.abs(e.pullingDistance) > Math.abs(e.viewHeight)) { + tab.refreshFlag = true; + tab.refreshText = "閲婃斁绔嬪嵆鍒锋柊"; + } else { + tab.refreshFlag = false; + tab.refreshText = "涓嬫媺鍙互鍒锋柊"; + } + }, + choose(item) { + if (item.isChecked) { + item.isChecked = false + } else { + item.isChecked = true + } + }, + + chooseAll() { + if (this.chooseAllState) { + this.chooseAllState = false; + this.list.forEach(el => { + el.isChecked = false; + }) + } else { + this.chooseAllState = true; + this.list.forEach(el => { + el.isChecked = true; + }) + } + }, + + //鎻愪氦 + submitTracking(item) { + let initList = []; + if (item) { + initList.push(item); + } else { + initList = this.list.filter(item => item.isChecked == true) + } + if (initList.length == 0) { + this.$u.toast('璇烽�夋嫨闇�瑕併�愭彁浜ゃ�戠殑鏁版嵁') + return + } + + const l_index = initList.findIndex((el) => el.state == '02submitted') + if (l_index > -1) { + this.$u.toast('鎮ㄩ�夋嫨鐨勫璞′腑瀛樺湪宸叉彁浜ょ殑鏁版嵁锛岃閲嶆柊閫夋嫨锛�') + return + } + + let outIds = initList.map((item) => { + return item.id + }) + + let queryParam = { + event: 'SUBMIT', + ids: outIds + } + this.batchChange(queryParam, "鎻愪氦") + }, + //鎾ら攢 + revokeTracking(item) { + let initList = []; + if (item) { + initList.push(item); + } else { + initList = this.list.filter(item => item.isChecked == true) + } + + if (initList.length == 0) { + this.$u.toast('璇烽�夋嫨闇�瑕併�愭挙閿�銆戠殑鏁版嵁') + return + } + + let l_index = initList.findIndex( + (el) => el.state == null || el.state == '01draft' + ) + if (l_index > -1) { + this.$u.toast('鎮ㄩ�夋嫨鐨勫璞′腑瀛樺湪鏈彁浜ょ殑鏁版嵁锛岃閲嶆柊閫夋嫨锛�') + return + } + + let outIds = initList.map((item) => { + return item.id + }) + + let queryParam = { + event: 'REVOKE', + ids: outIds + } + this.batchChange(queryParam, "鎾ら攢") + }, + // 鍒犻櫎 + deleteTracking(item) { + let initList = []; + if (item) { + initList.push(item); + } else { + initList = this.list.filter(item => item.isChecked == true) + } + + if (initList.length == 0) { + this.$u.toast('璇烽�夋嫨闇�瑕併�愬垹闄ゃ�戠殑鏁版嵁') + return + } + + const l_index = initList.findIndex((el) => el.state == '02submitted') + if (l_index > -1) { + this.$u.toast('鎮ㄩ�夋嫨鐨勫璞′腑瀛樺湪宸叉彁浜ょ殑鏁版嵁锛岃閲嶆柊閫夋嫨锛�') + return + } + + let outIds = initList.map((item) => { + return item.id + }) + + this.$u.api.outputRegister.batchCancelProductMain(outIds).then(res => { + let _code = res.code + let _data = res.data + let _msg = res.msg + if (_code === 0) { + this.$u.toast('鍒犻櫎鎴愬姛'); + this.clear(); + this.loadList(); + } else { + this.$u.toast('鍒犻櫎澶辫触'); + } + }); + }, + + //鎻愪氦銆佹挙閿�鎿嶄綔 + batchChange(queryParam, title) { + let that = this + that.$u.api.outputRegister.batchChange(queryParam).then(res => { + if (res.code == 0) { + uni.showModal({ + title: '鎻愮ず', + content: title + '鎴愬姛', + showCancel: false, + success: function() { + that.clear(); + that.loadList(); + } + }) + } else { + uni.showModal({ + title: '鎻愮ず', + content: title + '澶辫触', + showCancel: false, + success: function() {} + }) + } + }) + }, + + // 缂栬緫 + toEditProductOut(item) { + let initList = []; + if (item) { + initList.push(item); + } else { + this.list.filter(item => item.isChecked == true) + } + + if (initList.length == 0) { + this.$u.toast('璇烽�夋嫨闇�瑕併�愮紪杈戙�戠殑鏁版嵁') + return + } + + //TODO鏍¢獙鎶ュ伐鐘舵�� + let l_index = initList.findIndex((el) => el.state == '02submitted') + if (l_index > -1) { + this.$u.toast('鎮ㄩ�夋嫨鐨勫璞′腑瀛樺湪宸叉彁浜ょ殑鏁版嵁锛岃閲嶆柊閫夋嫨锛�') + return + } + + uni.navigateTo({ + url: './editReportWork?item=' + encodeURIComponent(JSON.stringify( + initList)) + }) + }, + + toCreateReport() { + this.$set(this.operationTaskInfo, 'type', this.scrollInto); + uni.navigateTo({ + url: './createReportWork?params=' + encodeURIComponent(JSON.stringify(this + .operationTaskInfo)) + }); + }, + + refreshTrackingRecord() { + this.clear(); + this.loadList(); + }, + + clear() { + this.query.current = 1; + this.list = []; + } + } + }; +</script> +<style lang="scss" scoped> + .operation-task-list-search { + padding: 10rpx 30rpx 20rpx 30rpx; + } + + .operation-task-tab { + .scroll-h { + width: 750rpx; + display: flex; + justify-content: space-between; + height: 80rpx; + white-space: nowrap; + + .uni-tab-item { + display: inline-block; + padding-left: 55rpx; + padding-right: 55rpx; + } + } + } + + .line-h { + height: 1rpx; + background-color: #cccccc; + } + + .uni-tab-item-title { + color: #555; + font-size: 30rpx; + height: 80rpx; + line-height: 80rpx; + flex-wrap: nowrap; + /* #ifndef APP-PLUS */ + white-space: nowrap; + /* #endif */ + font-weight: bold; + } + + .uni-tab-item-title-active { + color: #00aaff; + } + + .production-index-bg { + background-color: #F6F9FF; + background-image: url('~@/static/custom/product/productBg.png'); + // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0)); + padding: 0 20rpx; + background-attachment: fixed; + background-size: 100% auto; + background-repeat: no-repeat; + position: fixed; + top: 0; + bottom: 0; + width: 100%; + z-index: -1; + } + + .operation-task-param { + padding: 30rpx 30rpx 0rpx 30rpx; + + .operation-task-param-view { + height: 100rpx; + background: rgba(255, 255, 255, 0.61); + box-shadow: 0rpx 6rpx 8rpx 0rpx rgba(110, 120, 135, 0.09); + border-radius: 10rpx; + padding: 0rpx 23rpx; + margin-bottom: 30rpx; + + .operation-task-param-item { + height: 100rpx; + border: 1px solid #ADC8E4; + line-height: 100rpx; + display: flex; + justify-content: space-between; + border: none; + + .operation-task-param-item-left { + .item-one { + font-size: 30rpx; + color: #4F4F4F; + } + } + + .operation-task-param-item-right { + display: flex; + align-items: center; + + .item-one { + font-size: 30rpx; + color: #333333; + margin-right: 6rpx; + } + + .item-two { + font-size: 30rpx; + color: #A6B4CC; + margin-right: 6rpx; + } + + .item-three { + font-size: 30rpx; + color: #214DED; + margin-right: 6rpx; + } + + .scan { + background-image: url('~@/static/custom/materialReturn/scan.png'); + background-size: 100% auto; + background-repeat: no-repeat; + height: 32rpx; + width: 32rpx; + } + } + } + + .param-extra { + border-bottom: 1px solid #E8EBEE; + } + } + } + + .wrap .operation-task-scroll-list { + height: calc(100vh - var(--window-top) - var(--window-bottom) - 334rpx); + width: 100%; + } + + .operation-task-scroll-list-group { + ::v-deep .u-cell-item-box { + background-color: rgba(250, 252, 255, 0.36) !important; + padding: 0rpx 30rpx; + } + + .content { + font-size: 12px; + background-color: #FFFFFF; + box-sizing: border-box; + border-radius: 10rpx; + margin: 20rpx 0rpx; + height: 572rpx; + padding: 10rpx 20rpx; + box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(127, 127, 127, 0.1) !important; + position: relative; + + .content-header { + display: flex; + justify-content: space-between; + align-items: center; + + .content-header-left { + // align-items: center; + } + + .content-header-right { + // align-items: center; + } + } + + .content-body { + height: 420rpx; + background: #F5F9FF; + border-radius: 10rpx; + padding: 15rpx 13rpx; + + .row-list { + height: 50rpx; + display: flex; + flex-direction: row; + padding: 0px; + align-items: center; + // justify-content: space-between; + + ._label { + display: flex; + color: #666666; + font-size: 26rpx; + align-items: center; + width: 160rpx; + margin-right: 20rpx; + } + + ._content { + width: 500rpx; + display: flex; + // text-align: right; + color: #909399; + font-size: 24rpx; + // margin-top: 30rpx; + } + } + + .content-body-collapse { + .collapse { + height: 20rpx; + } + } + } + + .content-footer { + display: flex; + justify-content: space-between; + margin-top: 15rpx; + align-items: center; + + .footer-btn { + padding-right: 10rpx; + } + } + } + } + + .bottom { + bottom: 0; + height: 100rpx; + display: flex; + justify-content: space-between; + align-items: center; + + .bottom-left { + display: flex; + justify-content: center; + align-items: center; + margin-top: 30rpx; + padding-left: 20rpx; + } + + .bottom-right { + margin-top: 30rpx; + padding-right: 20rpx; + display: flex; + justify-content: flex-end; + + .bottom-btn { + margin-right: 10rpx; + } + } + } + + .suspend { + position: fixed; + right: 10px; + bottom: 150rpx; + z-index: 1; + } + + .scan { + width: 60rpx; + height: 60rpx; + font-size: 60rpx; + color: #3281ff; + } +</style> \ No newline at end of file -- Gitblit v1.9.3