From 6667b0cc7e221402fd50582151457fcf9ac38622 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周三, 28 8月 2024 14:14:10 +0800 Subject: [PATCH] 界面优化 --- yiqi_pda/config/modules/ajax.js | 6 yiqi_pda/pages/outBound/index - 修改前备份.vue | 369 ++++++++++++++++++++++++++++++++++++ yiqi_pda/manifest.json | 2 yiqi_pda/pages/outBound/index.vue | 43 ++- yiqi_pda/api/api.js | 4 yiqi_pda/pages/outBound/modules/content - 副本.vue | 129 ++++++++++++ yiqi_pda/pages/outBound/modules/content.vue | 9 yiqi_pda/pages/outBound/modules/ScanInputFormItem.vue | 13 + 8 files changed, 548 insertions(+), 27 deletions(-) diff --git a/yiqi_pda/api/api.js b/yiqi_pda/api/api.js index a767650..d246566 100644 --- a/yiqi_pda/api/api.js +++ b/yiqi_pda/api/api.js @@ -1,8 +1,8 @@ // 鍚屾椂鍙戦�佸紓姝ヨ姹傜殑娆℃暟锛岄槻姝竴娆$偣鍑绘湁澶氭璇锋眰 let ajaxTime = 0; //export const baseUrl = 'http://localhost:7788' -//export const baseUrl = 'http://10.135.75.70:7788' //鐢熶骇鐢� -export const baseUrl = 'http://192.168.216.203:7788' //娴嬭瘯鐢� +export const baseUrl = 'http://10.135.75.70:7788' //鐢熶骇鐢� +//export const baseUrl = 'http://192.168.216.203:7788' //娴嬭瘯鐢� // 鍏叡鐨剅equest鏂规硶 function request(option) { diff --git a/yiqi_pda/config/modules/ajax.js b/yiqi_pda/config/modules/ajax.js index 48c90d7..fce2ee6 100644 --- a/yiqi_pda/config/modules/ajax.js +++ b/yiqi_pda/config/modules/ajax.js @@ -1,9 +1,9 @@ export default { errMsg:'缃戠粶閿欒锛�', host:{ //鎺ュ彛璋冪敤鐨勫煙鍚嶈缃� - //'default':'http://10.135.75.70:7788',//鐢熶骇鐢� - 'default':'http://192.168.216.203:7788', //鐢熶骇鐜鍦板潃 - //'default':'http://localhost:7788', + 'default':'http://10.135.75.70:7788',//鐢熶骇鐢� + //'default':'http://192.168.216.203:7788', //鐢熶骇鐜鍦板潃 + //'default':'http://localhost:7788', 'mock':'http://localhost:3012' }, block:{ diff --git a/yiqi_pda/manifest.json b/yiqi_pda/manifest.json index 0ebf3cc..25defba 100644 --- a/yiqi_pda/manifest.json +++ b/yiqi_pda/manifest.json @@ -2,7 +2,7 @@ "name" : "杩炴潌绾挎暟閲�", "appid" : "__UNI__F24DEB0", "description" : "涓�姹借繛鏉�", - "versionName" : "2.0.14", + "versionName" : "2.0.16", "versionCode" : 6, "transformPx" : false, /* 5+App鐗规湁鐩稿叧 */ diff --git "a/yiqi_pda/pages/outBound/index - \344\277\256\346\224\271\345\211\215\345\244\207\344\273\275.vue" "b/yiqi_pda/pages/outBound/index - \344\277\256\346\224\271\345\211\215\345\244\207\344\273\275.vue" new file mode 100644 index 0000000..0601564 --- /dev/null +++ "b/yiqi_pda/pages/outBound/index - \344\277\256\346\224\271\345\211\215\345\244\207\344\273\275.vue" @@ -0,0 +1,369 @@ +<template> + <default-header-page-layout ref="page" title="鍑哄簱鎵ц"> + + <view class="page-frame with-action-user-row" :style="{height:pageBodyHeight+'px'}" v-if="pageBodyHeight"> + <action-user-row /> + <scan-input-form-item :inputFocus="inputFocus" v-model="OP80NewCode" class="forma-item" :label="baseTitile" + :msg="msg" :msg-type="msgType" @search="onSearchContainter" @clear="onClearContainter" /> + <view class="with-action-user-row-page-content"> + + + <Content @deleteData="deleteData" :workPieceData="workPieceData" /> + </view> + <modalPwd @reflesh="reflesh" ref="pwdRef" /> + </view> + <template v-slot:footer> + <view class="bottom-btns-row"> + <view class="btn-frame right-btn-frame"> + <u-button :disabled="workPieceData.length<1" type="primary" text="纭鍑哄簱" + @click="outBoundConfirm"></u-button> + </view> + </view> + </template> + </default-header-page-layout> +</template> + +<script> + import DefaultHeaderPageLayout from '@/components/DefaultHeaderPageLayout.vue' + import ActionUserRow from '@/components/ActionUserRow.vue' + import ScanInputFormItem from './modules/ScanInputFormItem.vue' + import Content from './modules/content.vue' + import modalPwd from './modules/modalPwd.vue' + import Vue from 'vue' + import { + parseDic, + $alert, + $successInfo + } from '@/static/js/utils/index.js' + import { + getWorkPieceByOP80NewCode, + outBoundWorkPiece, + getOutBoundWorkPieceInfoCount + } from '@/api/outBound/index.js' + import { + listbycode + } from '@/api/common/index.js' + export default { + name: 'baseInPage', + components: { + DefaultHeaderPageLayout, + ActionUserRow, + ScanInputFormItem, + Content, + modalPwd + }, + data() { + return { + barHeight: '', + ckNumToday: "0", //浠婂ぉ鎬诲嚭搴撴暟 + baseTitile: '鎵弿鎴愬搧鐮�/宸ヤ欢浜岀淮鐮�', //鎵弿鎴愬搧鐮�/宸ヤ欢浜岀淮鐮� + title: '', + pageBodyHeight: 0, + initInterVal: null, + myInterval: null, + msg: '', + msgType: 'error', + OP80NewCode: '', + workPieceData: [], + workPieceStatus: [], + inputFocus: true, + // codeLength:1 + } + }, + onLoad() { + var _this = this; + _this._getOutBoundWorkPieceInfoCount(); + this.myInterval = setInterval(function() { + _this._getOutBoundWorkPieceInfoCount(); + }, 1000 * 10); + //this.myInterval=setInterval(this.myFun(), 3000); + }, + methods: { + // 鑾峰彇宸ヤ欢淇℃伅 + async _getOutBoundWorkPieceInfoCount(OP80NewCode) { + try { + let { + data + } = await getOutBoundWorkPieceInfoCount(null) + this.ckNumToday = data; + } catch (e) {} + this.setMsg(); + }, + // 鑾峰彇宸ヤ欢淇℃伅 + async onSearchContainter(OP80NewCode) { + // if (OP80NewCode.length > 22) { + // this.initFocus(100); + + // uni.showToast({ + // title: '宸ヤ欢鐮佹垨鎴愬搧鐮侀暱搴︿笉姝g‘', + // icon: 'error', + // duration: 2000, + // mask: true + // }); + // return; + // } + this.inputFocus = false + const param = { + OP80NewCode: OP80NewCode + } + try { + let { + data + } = await getWorkPieceByOP80NewCode(param) + if (!this.workPieceData.some(item => item.workPieceID == data.workPieceID)) { + data.addTime = new Date(); + this.workPieceData.push(data) + } + //椤哄簭璋冭浆锛屾帓搴� + this.workPieceData.sort((a, b) => b.addTime - a.addTime); + + this.initFocus(100); + //console.log(this.workPieceData,'dsts'); + // setTimeout(()=>{ + // this.OP80NewCode = '' ;//姣忔鍒峰畬灏辨竻绌鸿緭鍏ユ 銆怑ditby shaocx,2024-06-12銆� + // this.inputFocus=true + // },100) + } catch (e) { + //debugger + this.initFocus(100); + //TODO handle the exception + console.log(e); + } + //this.msg = " 鎵爜鏁�:"+this.workPieceData.length+" 浠婃棩鍑哄簱鏁�:"; + this.setMsg(); + }, + setMsg() { + this.msg = " 鎵爜鏁�:" + this.workPieceData.length + " 浠婃棩鍑哄簱鏁�:" + this.ckNumToday; + }, + initFocus(num) { + setTimeout(() => { + this.OP80NewCode = ''; //姣忔鍒峰畬灏辨竻绌鸿緭鍏ユ 銆怑ditby shaocx,2024-06-12銆� + this.inputFocus = true + }, num) + }, + // 鑾峰彇鎵爜闀垮害 + // async listbycode(){ + // try{ + // let {data}=await listbycode({code:'outbound_code_length'}) + // this.codeLength=data.length>0?Number.parseInt(data[0].label):1 + // }catch(e){ + // //TODO handle the exception + // console.log(e); + // } + + // }, + onClearContainter() { + this.OP80NewCode = '' + }, + deleteData(opt) { + this.workPieceData = this.workPieceData.filter(item => item.workPieceID != opt.workPieceID) + this.setMsg(); + }, + reflesh() { + this.OP80NewCode = '' + this.workPieceData = [] + }, + outBoundConfirm() { + // 瀛樺湪闈炴垚鍝� + const flag = this.workPieceData.some(item => item.workPieceState != 10) + if (flag) { + uni.showModal({ + title: '鎻愮ず', + content: '褰撳墠宸ヤ欢瀛樺湪闈炴垚鍝侊紝纭畾寮哄埗鍑哄簱鍚楋紵', + success: (value) => { + const { + confirm, + cancel + } = value + if (confirm) { + this.$refs.pwdRef.showModal(this.workPieceData) + } + } + }) + } else { + this.$refs.pwdRef.showModal(this.workPieceData) + } + + }, + /* 椤甸潰鍒濆鍖栬幏鍙栭〉闈ody楂樺害鐨勫畾鏃跺櫒 */ + startInitInterval(callback) { + this.initInterVal = setInterval(() => { + //console.log('bbb') + if (this.pageBodyHeight) { + this.clearInitInterval() + callback && callback() + } else { + this.pageBodyHeight = this.$refs.page.getBodyHeight() + } + }, 200) + }, + /* 娓呴櫎瀹氭椂鍣� */ + clearInitInterval() { + try { + //alert('鎵ц'); + clearInterval(this.initInterVal) + this.initInterVal = null + } catch (e) { + //TODO handle the exception + } + }, + clearInitInterval2() { + try { + clearInterval(this.myInterval) + this.myInterval = null + } catch (e) { + //TODO handle the exception + } + }, + comfirmUpdate() { + this.$refs.pwdRef.showModal(this.barDetail); + }, + myFun() { + console.log('aaaa') + } + }, + onReady() { + this.setMsg(); + + this.startInitInterval(() => { + /* 椤甸潰鍒濆鍖栧悗闇�瑕佹墽琛岀殑浠g爜鍦ㄨ繖杈硅皟鐢� */ + // this.listbycode() + + }) + }, + mounted() { + // 璁剧疆fixed瀹氫綅 + //this.barHeight = Vue.prototype.CustomBar || 45 + this.barHeight = Vue.prototype.CustomBar + }, + onUnload() { + //alert(11); 椤甸潰绂诲紑鏃� + this.clearInitInterval() + this.clearInitInterval2(); + }, + //鐩戝惉鍘熺敓杩斿洖閿� + onBackPress(e) { + // 姝ゅ涓�瀹氳return涓簍rue锛屽惁鍒欓〉闈笉浼氳繑鍥炲埌鎸囧畾璺緞 + if (1 != 1) { + return false //鍙繑鍥� + } else { + uni.showModal({ + title: '鎻愮ず', + content: '鏄惁纭杩斿洖锛�', + showCancel: true, + cancelColor: '#333333', + success: (res => { + if (res.confirm) { + uni.redirectTo({ + url: '/pages/home/index' + }) + } else if (res.cancel) { + + } + }) + }); + return true + } + }, + } +</script> + +<style scoped lang="scss"> + .bottom-btns-row { + display: flex; + padding: 10rpx 0; + background-color: #fff; + + .btn-frame { + box-sizing: border-box; + } + + .left-btn-frame { + width: 30%; + padding-left: 20rpx; + padding-right: 8rpx; + } + + .right-btn-frame { + flex: 1; + padding-right: 20rpx; + padding-left: 8rpx; + } + + .u-button { + border: 2px solid #F08202; + } + } + + .forma-item { + margin-bottom: 24rpx; + } + + .material-item-group { + background-color: $uni-bg-color; + padding-top: 10rpx; + + .material-list-item { + border-bottom: 2rpx solid $uni-border-color; + padding-bottom: 10rpx; + padding-left: 60rpx; + margin-bottom: 10rpx; + position: relative; + + &:last-child { + border-bottom: 0; + } + + .item-row { + display: flex; + + &>.label { + flex-shrink: 0; + color: $u-tips-color; + width: 144rpx; + } + + &>.content { + flex-grow: 1; + color: $u-content-color; + + uni-input { + font: inherit; + color: $u-primary; + text-decoration: underline; + } + } + } + + .badge-box { + position: absolute; + top: 8rpx; + left: 8rpx; + z-index: 1; + } + + .close-btn { + $closeBtnSize: 70rpx; + width: $closeBtnSize; + height: $closeBtnSize; + z-index: 1; + position: absolute; + top: 0rpx; + right: 8rpx; + background-color: $u-error; + opacity: 0.6; + border-radius: 25rpx; + + .icon-layer { + position: absolute; + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + z-index: 2; + } + } + } + } +</style> \ No newline at end of file diff --git a/yiqi_pda/pages/outBound/index.vue b/yiqi_pda/pages/outBound/index.vue index 0601564..f9fa1dc 100644 --- a/yiqi_pda/pages/outBound/index.vue +++ b/yiqi_pda/pages/outBound/index.vue @@ -73,9 +73,12 @@ onLoad() { var _this = this; _this._getOutBoundWorkPieceInfoCount(); + //涓嶅啀寰幆璇� + /* this.myInterval = setInterval(function() { _this._getOutBoundWorkPieceInfoCount(); }, 1000 * 10); + //*/ //this.myInterval=setInterval(this.myFun(), 3000); }, methods: { @@ -91,25 +94,27 @@ }, // 鑾峰彇宸ヤ欢淇℃伅 async onSearchContainter(OP80NewCode) { - // if (OP80NewCode.length > 22) { - // this.initFocus(100); - - // uni.showToast({ - // title: '宸ヤ欢鐮佹垨鎴愬搧鐮侀暱搴︿笉姝g‘', - // icon: 'error', - // duration: 2000, - // mask: true - // }); - // return; - // } + //debugger + if (OP80NewCode.length != 21) { + this.initFocus(100); + // uni.showToast({ + // title: '宸ヤ欢鐮佹垨鎴愬搧鐮侀暱搴︿笉姝g‘', + // icon: 'error', + // duration: 2000, + // mask: true + // }); + return; + } + this.inputFocus = false const param = { OP80NewCode: OP80NewCode } try { - let { - data - } = await getWorkPieceByOP80NewCode(param) + let data={}; + data.addTime = new Date(); + data.workPieceID=OP80NewCode; + data.oP80NewCode=OP80NewCode; if (!this.workPieceData.some(item => item.workPieceID == data.workPieceID)) { data.addTime = new Date(); this.workPieceData.push(data) @@ -117,6 +122,7 @@ //椤哄簭璋冭浆锛屾帓搴� this.workPieceData.sort((a, b) => b.addTime - a.addTime); + this.OP80NewCode = ''; //姣忔鍒峰畬灏辨竻绌鸿緭鍏ユ 銆怑ditby shaocx,2024-06-12銆� this.initFocus(100); //console.log(this.workPieceData,'dsts'); // setTimeout(()=>{ @@ -162,8 +168,15 @@ reflesh() { this.OP80NewCode = '' this.workPieceData = [] + setTimeout(() => { + this._getOutBoundWorkPieceInfoCount(); + this.setMsg(); + }, 1000) }, outBoundConfirm() { + this.$refs.pwdRef.showModal(this.workPieceData) + + /* // 瀛樺湪闈炴垚鍝� const flag = this.workPieceData.some(item => item.workPieceState != 10) if (flag) { @@ -183,6 +196,8 @@ } else { this.$refs.pwdRef.showModal(this.workPieceData) } + + //*/ }, /* 椤甸潰鍒濆鍖栬幏鍙栭〉闈ody楂樺害鐨勫畾鏃跺櫒 */ diff --git a/yiqi_pda/pages/outBound/modules/ScanInputFormItem.vue b/yiqi_pda/pages/outBound/modules/ScanInputFormItem.vue index ab6d5a1..32a8326 100644 --- a/yiqi_pda/pages/outBound/modules/ScanInputFormItem.vue +++ b/yiqi_pda/pages/outBound/modules/ScanInputFormItem.vue @@ -6,14 +6,15 @@ <view class="input-view"> <u-input ref="uinput" :focus="inputFocus" :clearable="clearable" border="none" :type="type" :placeholder="placeholder" v-model.trim="innerValue" @clear="onClear" @blur="onBlur" + @change="onChange" @confirm="onConfirm" /> </view> - <view class="scan-view"> + <!-- <view class="scan-view"> <view @tap.stop="onScan"><u-icon name="scan" color="#F18201" :size="32"></u-icon></view> </view> <view class="btn-view" v-if="hasSearch"> <view class="search-btn" @tap.stop="onSearch">鎼�</view> - </view> + </view> --> </view> <view class="msg-row" v-if="msg" :class="[msgType==='info'?'info-type':'']">{{msg}}</view> </view> @@ -115,7 +116,14 @@ onBlur() { this.$emit('blur', this.innerValue) }, + onChange(val) { + //debugger + //alert(val); + this.$emit('search', val) + }, onConfirm(val) { + //debugger + /* if(val!=this.innerValue) { this.confirmType='auto' } @@ -123,6 +131,7 @@ if(val) { this.$emit('search', val) } + //*/ }, }, created() { diff --git "a/yiqi_pda/pages/outBound/modules/content - \345\211\257\346\234\254.vue" "b/yiqi_pda/pages/outBound/modules/content - \345\211\257\346\234\254.vue" new file mode 100644 index 0000000..d44726d --- /dev/null +++ "b/yiqi_pda/pages/outBound/modules/content - \345\211\257\346\234\254.vue" @@ -0,0 +1,129 @@ +<template> + <u-swipe-action> + <u-swipe-action-item v-for="(item,index) in workPieceData" :key="index" :options="options" + :name="index" @click="actionClick" style="margin-bottom: 10rpx;background-color: #fff;"> + <view class="content" > + <view class="content_flex"> + <view class="flex_index">{{workPieceData.length-index}}</view> + <view class="flex_code">OP80鎴愬搧鐮�: {{item.oP80NewCode}}</view> + <view class="flex_status">{{item.qualityStateName}}</view> + </view> + <view class="content_flex"> + <view class="flex_color" style="width: 100%;">宸ヤ欢鍙�: {{item.workPieceID}}</view> + <!-- <view class="flex_color" style="text-align: right;">褰撳墠宸ュ簭: {{item.workingProcedureCurrent}}</view> --> + </view> + <view class="content_flex"> + <view class="flex_color" style="width: 100%;">宸ヤ欢鐘舵��: {{item.workPieceStateName}}</view> + </view> + <view class="content_flex"> + <view class="flex_color" style="width: 100%;">褰撳墠宸ュ簭: {{item.workingProcedureCurrent}}</view> + </view> + <view class="content_flex"> + <view class="flex_color" style="width: 100%;">璁惧缂栧彿: {{item.equipmentID}}</view> + </view> + </view> + </u-swipe-action-item> + </u-swipe-action> +</template> + +<script> + export default { + props: { + workPieceData: { + type: Array, + default: () => [] + } + }, + data() { + return { + options: [{ + text: "绉婚櫎", + style: { + background: '#F08202' + } + }], + } + }, + methods:{ + actionClick(opt){ + uni.showModal({ + title: '鎻愮ず', + content: '鏄惁纭绉婚櫎宸ヤ欢鍙�"'+this.workPieceData[opt.name].workPieceID+'"锛�', + showCancel: true, + cancelColor: '#333333', + success: (res => { + if (res.confirm) { + console.log('绉婚櫎',opt); + this.$emit('deleteData',this.workPieceData[opt.name]) + } else if (res.cancel) { + + } + }) + }); + + } + } + } +</script> + +<style lang="scss" scoped> + .content { + background-color: #fff; + width: 100%; + box-sizing: border-box; + border: 1px solid #fff; + padding: 15rpx; + margin-bottom: 10rpx; + + .content_flex { + display: flex; + justify-content: flex-start; + align-items: center; + margin-bottom: 5rpx; + + .flex_index { + width: 50rpx; + height: 50rpx; + background: $color-common; + color: #fff; + font-size: 30rpx; + line-height: 50rpx; + text-align: center; + border-radius: 50%; + margin-right: 15rpx; + } + + .flex_code { + font-size: 32rpx; + color: $color-common; + width: 75%; + } + + .flex_status { + width: 90rpx; + text-align: center; + padding: 10rpx; + background: $color-common; + color: #fff; + font-weight: 550; + align-self: flex-end; + + } + + .flex_color { + font-size: 32rpx; + color: #000; + width: 75%; + + } + + .card-action { + width: 100%; + display: flex; + justify-content: flex-end; + align-items: center; + } + + } + } +</style> \ No newline at end of file diff --git a/yiqi_pda/pages/outBound/modules/content.vue b/yiqi_pda/pages/outBound/modules/content.vue index d44726d..bbb0ccf 100644 --- a/yiqi_pda/pages/outBound/modules/content.vue +++ b/yiqi_pda/pages/outBound/modules/content.vue @@ -5,12 +5,11 @@ <view class="content" > <view class="content_flex"> <view class="flex_index">{{workPieceData.length-index}}</view> - <view class="flex_code">OP80鎴愬搧鐮�: {{item.oP80NewCode}}</view> - <view class="flex_status">{{item.qualityStateName}}</view> + <view class="flex_code">鎴愬搧鐮�: {{item.oP80NewCode}}</view> + <!-- <view class="flex_status">{{item.qualityStateName}}</view> --> </view> - <view class="content_flex"> + <!-- <view class="content_flex"> <view class="flex_color" style="width: 100%;">宸ヤ欢鍙�: {{item.workPieceID}}</view> - <!-- <view class="flex_color" style="text-align: right;">褰撳墠宸ュ簭: {{item.workingProcedureCurrent}}</view> --> </view> <view class="content_flex"> <view class="flex_color" style="width: 100%;">宸ヤ欢鐘舵��: {{item.workPieceStateName}}</view> @@ -20,7 +19,7 @@ </view> <view class="content_flex"> <view class="flex_color" style="width: 100%;">璁惧缂栧彿: {{item.equipmentID}}</view> - </view> + </view> --> </view> </u-swipe-action-item> </u-swipe-action> -- Gitblit v1.9.3