From 459a62207a0a8ee406c233f8edf9f7ee88a5bbe2 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周六, 31 8月 2024 16:10:42 +0800 Subject: [PATCH] 菜单优化 --- yiqi_pda/api/outBound/index.js | 17 yiqi_pda/pages/outBoundNew/index.vue | 384 ++++++++++ yiqi_pda/pages/home/index.vue | 4 yiqi_pda/api/api.js | 4 yiqi_pda/pages/unLine/modules/content.vue | 128 +++ yiqi_pda/pages/outBoundNew/modules/ScanInputFormItem_Car.vue | 224 ++++++ yiqi_pda/pages/outBoundNew/modules/modalPwd.vue | 114 +++ yiqi_pda/config/modules/ajax.js | 4 yiqi_pda/pages/unLine/modules/modalPwd.vue | 114 +++ yiqi_pda/config/index.js | 4 yiqi_pda/pages/unLine/modules/ScanInputFormItem.vue | 224 ++++++ yiqi_pda/pages/outBoundNew/modules/content.vue | 128 +++ yiqi_pda/pages/outBoundNew/modules/ScanInputFormItem.vue | 224 ++++++ yiqi_pda/pages.json | 6 yiqi_pda/pages/unLine/index.vue | 391 ++++++++++ yiqi_pda/pages/unLine/modules/ScanInputFormItem_Car.vue | 224 ++++++ 16 files changed, 2,188 insertions(+), 6 deletions(-) diff --git a/yiqi_pda/api/api.js b/yiqi_pda/api/api.js index d246566..bd42100 100644 --- a/yiqi_pda/api/api.js +++ b/yiqi_pda/api/api.js @@ -1,7 +1,7 @@ // 鍚屾椂鍙戦�佸紓姝ヨ姹傜殑娆℃暟锛岄槻姝竴娆$偣鍑绘湁澶氭璇锋眰 let ajaxTime = 0; -//export const baseUrl = 'http://localhost:7788' -export const baseUrl = 'http://10.135.75.70:7788' //鐢熶骇鐢� +export const baseUrl = 'http://localhost:7788' +//export const baseUrl = 'http://10.135.75.70:7788' //鐢熶骇鐢� //export const baseUrl = 'http://192.168.216.203:7788' //娴嬭瘯鐢� // 鍏叡鐨剅equest鏂规硶 diff --git a/yiqi_pda/api/outBound/index.js b/yiqi_pda/api/outBound/index.js index 3d531ef..3d36675 100644 --- a/yiqi_pda/api/outBound/index.js +++ b/yiqi_pda/api/outBound/index.js @@ -18,6 +18,23 @@ }) } +// 涓嬬嚎鎵ц /api/pdaservice/unLineWorkPiece +export function unLineWorkPiece(data) { + return request({ + url: `/api/pdaservice/unLineWorkPiece`, + method: 'post', + data + }) +} +// 鍑哄簱鎵ц /api/pdaservice/outStoreWorkPiece +export function outStoreWorkPiece(data) { + return request({ + url: `/api/pdaservice/outStoreWorkPiece`, + method: 'post', + data + }) +} + // 鍑哄簱缁熻 /api/pdaservice/getOutBoundWorkPieceInfoCount export function getOutBoundWorkPieceInfoCount(data) { diff --git a/yiqi_pda/config/index.js b/yiqi_pda/config/index.js index b05a336..69a994d 100644 --- a/yiqi_pda/config/index.js +++ b/yiqi_pda/config/index.js @@ -17,6 +17,8 @@ retrospect: "/pages/retrospect/index", shift:"/pages/shift/index", production:"/pages/production/index", - outBound:'/pages/outBound/index' + outBound:'/pages/outBound/index', + unLine:'/pages/unLine/index', + outBoundNew:'/pages/outBoundNew/index' } } \ No newline at end of file diff --git a/yiqi_pda/config/modules/ajax.js b/yiqi_pda/config/modules/ajax.js index fce2ee6..93463f7 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://10.135.75.70:7788',//鐢熶骇鐢� //'default':'http://192.168.216.203:7788', //鐢熶骇鐜鍦板潃 - //'default':'http://localhost:7788', + 'default':'http://localhost:7788', 'mock':'http://localhost:3012' }, block:{ diff --git a/yiqi_pda/pages.json b/yiqi_pda/pages.json index e79fd90..9ae0edf 100644 --- a/yiqi_pda/pages.json +++ b/yiqi_pda/pages.json @@ -80,6 +80,12 @@ }, { "path": "pages/outBound/index" + }, + { + "path": "pages/unLine/index" + }, + { + "path": "pages/outBoundNew/index" } ], "globalStyle": { diff --git a/yiqi_pda/pages/home/index.vue b/yiqi_pda/pages/home/index.vue index b139323..7f5ec8f 100644 --- a/yiqi_pda/pages/home/index.vue +++ b/yiqi_pda/pages/home/index.vue @@ -58,7 +58,9 @@ {name:'宸ヤ欢淇℃伅鍗曚釜淇敼',icon:'icon-worker',pathName:'unbind',color:'#1e90ff'}, {name:'宸ヤ欢璐ㄩ噺淇℃伅鎵归噺淇敼',icon:'icon-worker',pathName:'unbindAll',color:'#1e90ff'}, {name:'宸ヤ欢淇℃伅杩芥函',icon:'icon-notice',pathName:'retrospect',color:'#1e90ff'}, - {name:'宸ヤ欢鍑哄簱鎵ц',icon:'icon-notice',pathName:'outBound',color:'#1e90ff'} + {name:'宸ヤ欢鍑哄簱鎵ц',icon:'icon-notice',pathName:'outBound',color:'#1e90ff'}, + {name:'宸ヤ欢涓嬬嚎(鏂�)',icon:'icon-notice',pathName:'unLine',color:'#1e90ff'}, + {name:'宸ヤ欢鍑哄簱(鏂�)',icon:'icon-notice',pathName:'outBoundNew',color:'#1e90ff'} ] }, { diff --git a/yiqi_pda/pages/outBoundNew/index.vue b/yiqi_pda/pages/outBoundNew/index.vue new file mode 100644 index 0000000..164ecd6 --- /dev/null +++ b/yiqi_pda/pages/outBoundNew/index.vue @@ -0,0 +1,384 @@ +<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-car v-model="CarNo" class="forma-item" :label="baseTitile_Car" + :msg-type="msgType" /> + <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 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 ScanInputFormItemCar from './modules/ScanInputFormItem_Car.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, + ScanInputFormItemCar, + Content, + modalPwd + }, + data() { + return { + barHeight: '', + ckNumToday: "0", //浠婂ぉ鎬诲嚭搴撴暟 + baseTitile_Car: '鎵弿灏忚溅鐮�', + title: '', + CarNo:'', + 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) { + //debugger + if (OP80NewCode.length==0) { + this.initFocus(100); + // uni.showToast({ + // title: '宸ヤ欢鐮佹垨鎴愬搧鐮侀暱搴︿笉姝g‘', + // icon: 'error', + // duration: 2000, + // mask: true + // }); + return; + } + + this.inputFocus = false + const param = { + OP80NewCode: OP80NewCode + } + try { + 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) + } + //椤哄簭璋冭浆锛屾帓搴� + this.workPieceData.sort((a, b) => b.addTime - a.addTime); + + //console.log(this.workPieceData,'dsts'); + // setTimeout(()=>{ + // this.OP80NewCode = '' ;//姣忔鍒峰畬灏辨竻绌鸿緭鍏ユ 銆怑ditby shaocx,2024-06-12銆� + // this.inputFocus=true + // },100) + } catch (e) { + //debugger + //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 = [] + setTimeout(() => { + this._getOutBoundWorkPieceInfoCount(); + this.setMsg(); + }, 1000) + }, + outBoundConfirm() { + this.$refs.pwdRef.showModal(this.workPieceData,this.CarNo) + + /* + // 瀛樺湪闈炴垚鍝� + 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/outBoundNew/modules/ScanInputFormItem.vue b/yiqi_pda/pages/outBoundNew/modules/ScanInputFormItem.vue new file mode 100644 index 0000000..32a8326 --- /dev/null +++ b/yiqi_pda/pages/outBoundNew/modules/ScanInputFormItem.vue @@ -0,0 +1,224 @@ +<template> + <view class="scan-input-form-item-compontent"> + <view class="p-form-label" v-if="label">{{label}}锛�</view> + <view class="input-row"> + <view class="mask" @tap.stop="" v-if="disabled"></view> + <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 @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 class="msg-row" v-if="msg" :class="[msgType==='info'?'info-type':'']">{{msg}}</view> + </view> +</template> + +<script> + + export default { + name: 'ScanInputFormItemCompontent', + // emits: ['input', 'search', 'clear', 'blur', 'confirm'], + props: { + type: { + type: String, + default: 'text' + }, + label: { + type: String, + default: '' + }, + placeholder: { + type: String, + default: '璇疯緭鍏�...' + }, + msg: { + type: String, + default: '' + }, + msgType: { + type: String, + default: 'error' + }, + value: { + type: [String, Number, null], + default: '' + }, + hasSearch: { + type: Boolean, + default: true + }, + disabled: { + type: Boolean, + default: false + }, + clearable: { + type: Boolean, + default: true + }, + inputFocus: { + type: Boolean, + default: true + }, + // codeLength:{ + // type: Number, + // default: 1 + // } + }, + data() { + return { + innerValue: '', + confirmType:'handle' + } + }, + watch: { + value(newVal, oldVal) { + if (newVal !== this.innerValue) { + this.innerValue = newVal + } + }, + innerValue(newVal, oldVal) { + if (newVal !== this.value) { + this.$emit('input', newVal) + } + if(newVal&&this.confirmType=='auto') { + this.$emit('search', newVal) + this.confirmType='handle' + } + } + }, + + methods: { + + onScan() { + uni.scanCode({ + success: function(res) { + this.innerValue = res.result; + }, + fail: function() { + console.log('scanCode fail') + } + }) + }, + onSearch() { + this.$emit('search', this.innerValue) + }, + onClear() { + this.innerValue = null; + this.$emit('clear') + }, + 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' + } + + if(val) { + this.$emit('search', val) + } + //*/ + }, + }, + created() { + this.innerValue = this.value + }, + + } +</script> + +<style scoped lang="scss"> + .scan-input-form-item-compontent { + width: 100%; + + .p-form-label { + font-size: 32rpx; + color: $u-tips-color; + padding-bottom: 12rpx; + padding-left: 20rpx; + } + + .input-row { + width: 100%; + height: 90rpx; + overflow: hidden; + background-color: $uni-bg-color; + display: flex; + align-items: center; + position: relative; + + .scan-view, + .btn-view { + flex-shrink: 0; + } + + .scan-view { + display: flex; + align-items: center; + justify-content: center; + padding-right: 10rpx; + } + + .input-view { + flex-grow: 1; + padding-left: 20rpx; + } + + .btn-view { + width: 70rpx; + height: 100%; + padding: 20rpx; + padding-left: 0rpx; + box-sizing: border-box; + + .search-btn { + height: 100%; + width: 100%; + border-radius: 8rpx; + background: linear-gradient(157.342820970935deg, rgba(194, 128, 255, 1) -20%, rgba(194, 128, 255, 1) -19%, rgba(132, 0, 255, 1) 119%); + display: flex; + align-items: center; + justify-content: center; + color: $uni-bg-color; + font-size: 26rpx; + } + } + + &>.mask { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 100; + background-color: #000; + opacity: 0.25; + } + } + + .msg-row { + padding: 6rpx 20rpx 0 20rpx; + line-height: 1.3; + font-size: 24rpx; + color: $u-error; + + &.info-type { + color: $color-blue; + } + } + } +</style> \ No newline at end of file diff --git a/yiqi_pda/pages/outBoundNew/modules/ScanInputFormItem_Car.vue b/yiqi_pda/pages/outBoundNew/modules/ScanInputFormItem_Car.vue new file mode 100644 index 0000000..32a8326 --- /dev/null +++ b/yiqi_pda/pages/outBoundNew/modules/ScanInputFormItem_Car.vue @@ -0,0 +1,224 @@ +<template> + <view class="scan-input-form-item-compontent"> + <view class="p-form-label" v-if="label">{{label}}锛�</view> + <view class="input-row"> + <view class="mask" @tap.stop="" v-if="disabled"></view> + <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 @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 class="msg-row" v-if="msg" :class="[msgType==='info'?'info-type':'']">{{msg}}</view> + </view> +</template> + +<script> + + export default { + name: 'ScanInputFormItemCompontent', + // emits: ['input', 'search', 'clear', 'blur', 'confirm'], + props: { + type: { + type: String, + default: 'text' + }, + label: { + type: String, + default: '' + }, + placeholder: { + type: String, + default: '璇疯緭鍏�...' + }, + msg: { + type: String, + default: '' + }, + msgType: { + type: String, + default: 'error' + }, + value: { + type: [String, Number, null], + default: '' + }, + hasSearch: { + type: Boolean, + default: true + }, + disabled: { + type: Boolean, + default: false + }, + clearable: { + type: Boolean, + default: true + }, + inputFocus: { + type: Boolean, + default: true + }, + // codeLength:{ + // type: Number, + // default: 1 + // } + }, + data() { + return { + innerValue: '', + confirmType:'handle' + } + }, + watch: { + value(newVal, oldVal) { + if (newVal !== this.innerValue) { + this.innerValue = newVal + } + }, + innerValue(newVal, oldVal) { + if (newVal !== this.value) { + this.$emit('input', newVal) + } + if(newVal&&this.confirmType=='auto') { + this.$emit('search', newVal) + this.confirmType='handle' + } + } + }, + + methods: { + + onScan() { + uni.scanCode({ + success: function(res) { + this.innerValue = res.result; + }, + fail: function() { + console.log('scanCode fail') + } + }) + }, + onSearch() { + this.$emit('search', this.innerValue) + }, + onClear() { + this.innerValue = null; + this.$emit('clear') + }, + 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' + } + + if(val) { + this.$emit('search', val) + } + //*/ + }, + }, + created() { + this.innerValue = this.value + }, + + } +</script> + +<style scoped lang="scss"> + .scan-input-form-item-compontent { + width: 100%; + + .p-form-label { + font-size: 32rpx; + color: $u-tips-color; + padding-bottom: 12rpx; + padding-left: 20rpx; + } + + .input-row { + width: 100%; + height: 90rpx; + overflow: hidden; + background-color: $uni-bg-color; + display: flex; + align-items: center; + position: relative; + + .scan-view, + .btn-view { + flex-shrink: 0; + } + + .scan-view { + display: flex; + align-items: center; + justify-content: center; + padding-right: 10rpx; + } + + .input-view { + flex-grow: 1; + padding-left: 20rpx; + } + + .btn-view { + width: 70rpx; + height: 100%; + padding: 20rpx; + padding-left: 0rpx; + box-sizing: border-box; + + .search-btn { + height: 100%; + width: 100%; + border-radius: 8rpx; + background: linear-gradient(157.342820970935deg, rgba(194, 128, 255, 1) -20%, rgba(194, 128, 255, 1) -19%, rgba(132, 0, 255, 1) 119%); + display: flex; + align-items: center; + justify-content: center; + color: $uni-bg-color; + font-size: 26rpx; + } + } + + &>.mask { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 100; + background-color: #000; + opacity: 0.25; + } + } + + .msg-row { + padding: 6rpx 20rpx 0 20rpx; + line-height: 1.3; + font-size: 24rpx; + color: $u-error; + + &.info-type { + color: $color-blue; + } + } + } +</style> \ No newline at end of file diff --git a/yiqi_pda/pages/outBoundNew/modules/content.vue b/yiqi_pda/pages/outBoundNew/modules/content.vue new file mode 100644 index 0000000..bbb0ccf --- /dev/null +++ b/yiqi_pda/pages/outBoundNew/modules/content.vue @@ -0,0 +1,128 @@ +<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">鎴愬搧鐮�: {{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> + <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/outBoundNew/modules/modalPwd.vue b/yiqi_pda/pages/outBoundNew/modules/modalPwd.vue new file mode 100644 index 0000000..ff0dc45 --- /dev/null +++ b/yiqi_pda/pages/outBoundNew/modules/modalPwd.vue @@ -0,0 +1,114 @@ +<template> + <u-modal :show="show" title="鍑哄簱纭" :closeOnClickOverlay="true" :showCancelButton="true" @cancel="handlerCancel" + @confirm="handlerConfirm" @close="handlerCancel"> + <u-form labelPosition="left" labelWidth="100rpx" :model="form" :rules="rules" ref="uForm"> + <u-form-item required label="瀵嗙爜" prop="pwd"> + <u-input v-model="form.pwd" type="password" placeholder="璇疯緭鍏ュ瘑鐮�" style="width: 450rpx;"></u-input> + </u-form-item> + </u-form> + + <!-- <view class="status_flex"> + <u-input v-model="pwd" type="password" placeholder="璇疯緭鍏ュ瘑鐮�" style="width: 450rpx;"></u-input> + </view> --> + </u-modal> +</template> + +<script> + import { + $alert + } from '@/static/js/utils/index.js' + import { + outStoreWorkPiece + } from '@/api/outBound/index.js' + export default { + emits: ['update'], + data() { + return { + show: false, + CarNo:'', + workPieceData:[], + form: { + pwd: '' + }, + rules: { + pwd: { + type: 'string', + required: true, + message: '璇疯緭鍏ュ瘑鐮�', + trigger: ['blur', 'change'] + } + } + } + }, + onReady() { + this.$refs.uForm.setRules(this.rules) + }, + methods: { + showModal(workPieceData,CarNo){ + this.show=true + this.CarNo=CarNo + this.workPieceData=workPieceData + }, + handlerCancel() { + this.form = { + pwd: '', + } + this.show = false + }, + // 閫変腑鐨勭姸鎬佷紶閫掔粰鐖剁粍浠� + handlerConfirm() { + console.log(111); + this.$refs.uForm.validate().then(res => { + const params = { + password: this.form.pwd, + CarNo:this.CarNo, + workPieceInfoLst:this.workPieceData + } + console.log(params,'params'); + outStoreWorkPiece(params).then(res => { + uni.showToast({ + title: '鍑哄簱鎴愬姛' + }) + this.$emit('reflesh') + this.handlerCancel() + }) + }).catch(errors => { + console.log(errors,'22'); + }) + } + + } + } +</script> + +<style lang="scss" scoped> + .status_flex { + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + .flex_item { + width: 450rpx; + height: 70rpx; + text-align: center; + line-height: 70rpx; + border: 1px solid $color-common; + color: $color-common; + font-size: 32rpx; + font-weight: 550; + background: #fff; + margin-bottom: 30rpx; + } + + .active_item { + background: $color-common; + color: #fff; + } + } + + ::v-deep .u-transition { + z-index: 99 !important; + } +</style> \ No newline at end of file diff --git a/yiqi_pda/pages/unLine/index.vue b/yiqi_pda/pages/unLine/index.vue new file mode 100644 index 0000000..9666bfa --- /dev/null +++ b/yiqi_pda/pages/unLine/index.vue @@ -0,0 +1,391 @@ +<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-car v-model="CarNo" class="forma-item" :label="baseTitile_Car" + :msg-type="msgType" /> + <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 ScanInputFormItemCar from './modules/ScanInputFormItem_Car.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, + ScanInputFormItemCar, + Content, + modalPwd + }, + data() { + return { + barHeight: '', + ckNumToday: "0", //浠婂ぉ鎬诲嚭搴撴暟 + baseTitile: '鎵弿鎴愬搧鐮�', + baseTitile_Car: '鎵弿灏忚溅鐮�', + title: '', + pageBodyHeight: 0, + initInterVal: null, + myInterval: null, + msg: '', + msgType: 'error', + OP80NewCode: '', + CarNo:'', + 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) { + //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={}; + 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) + } + //椤哄簭璋冭浆锛屾帓搴� + 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(()=>{ + // 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 = [] + setTimeout(() => { + this._getOutBoundWorkPieceInfoCount(); + this.setMsg(); + }, 1000) + }, + outBoundConfirm() { + this.$refs.pwdRef.showModal(this.workPieceData,this.CarNo) + + /* + // 瀛樺湪闈炴垚鍝� + 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/unLine/modules/ScanInputFormItem.vue b/yiqi_pda/pages/unLine/modules/ScanInputFormItem.vue new file mode 100644 index 0000000..32a8326 --- /dev/null +++ b/yiqi_pda/pages/unLine/modules/ScanInputFormItem.vue @@ -0,0 +1,224 @@ +<template> + <view class="scan-input-form-item-compontent"> + <view class="p-form-label" v-if="label">{{label}}锛�</view> + <view class="input-row"> + <view class="mask" @tap.stop="" v-if="disabled"></view> + <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 @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 class="msg-row" v-if="msg" :class="[msgType==='info'?'info-type':'']">{{msg}}</view> + </view> +</template> + +<script> + + export default { + name: 'ScanInputFormItemCompontent', + // emits: ['input', 'search', 'clear', 'blur', 'confirm'], + props: { + type: { + type: String, + default: 'text' + }, + label: { + type: String, + default: '' + }, + placeholder: { + type: String, + default: '璇疯緭鍏�...' + }, + msg: { + type: String, + default: '' + }, + msgType: { + type: String, + default: 'error' + }, + value: { + type: [String, Number, null], + default: '' + }, + hasSearch: { + type: Boolean, + default: true + }, + disabled: { + type: Boolean, + default: false + }, + clearable: { + type: Boolean, + default: true + }, + inputFocus: { + type: Boolean, + default: true + }, + // codeLength:{ + // type: Number, + // default: 1 + // } + }, + data() { + return { + innerValue: '', + confirmType:'handle' + } + }, + watch: { + value(newVal, oldVal) { + if (newVal !== this.innerValue) { + this.innerValue = newVal + } + }, + innerValue(newVal, oldVal) { + if (newVal !== this.value) { + this.$emit('input', newVal) + } + if(newVal&&this.confirmType=='auto') { + this.$emit('search', newVal) + this.confirmType='handle' + } + } + }, + + methods: { + + onScan() { + uni.scanCode({ + success: function(res) { + this.innerValue = res.result; + }, + fail: function() { + console.log('scanCode fail') + } + }) + }, + onSearch() { + this.$emit('search', this.innerValue) + }, + onClear() { + this.innerValue = null; + this.$emit('clear') + }, + 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' + } + + if(val) { + this.$emit('search', val) + } + //*/ + }, + }, + created() { + this.innerValue = this.value + }, + + } +</script> + +<style scoped lang="scss"> + .scan-input-form-item-compontent { + width: 100%; + + .p-form-label { + font-size: 32rpx; + color: $u-tips-color; + padding-bottom: 12rpx; + padding-left: 20rpx; + } + + .input-row { + width: 100%; + height: 90rpx; + overflow: hidden; + background-color: $uni-bg-color; + display: flex; + align-items: center; + position: relative; + + .scan-view, + .btn-view { + flex-shrink: 0; + } + + .scan-view { + display: flex; + align-items: center; + justify-content: center; + padding-right: 10rpx; + } + + .input-view { + flex-grow: 1; + padding-left: 20rpx; + } + + .btn-view { + width: 70rpx; + height: 100%; + padding: 20rpx; + padding-left: 0rpx; + box-sizing: border-box; + + .search-btn { + height: 100%; + width: 100%; + border-radius: 8rpx; + background: linear-gradient(157.342820970935deg, rgba(194, 128, 255, 1) -20%, rgba(194, 128, 255, 1) -19%, rgba(132, 0, 255, 1) 119%); + display: flex; + align-items: center; + justify-content: center; + color: $uni-bg-color; + font-size: 26rpx; + } + } + + &>.mask { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 100; + background-color: #000; + opacity: 0.25; + } + } + + .msg-row { + padding: 6rpx 20rpx 0 20rpx; + line-height: 1.3; + font-size: 24rpx; + color: $u-error; + + &.info-type { + color: $color-blue; + } + } + } +</style> \ No newline at end of file diff --git a/yiqi_pda/pages/unLine/modules/ScanInputFormItem_Car.vue b/yiqi_pda/pages/unLine/modules/ScanInputFormItem_Car.vue new file mode 100644 index 0000000..32a8326 --- /dev/null +++ b/yiqi_pda/pages/unLine/modules/ScanInputFormItem_Car.vue @@ -0,0 +1,224 @@ +<template> + <view class="scan-input-form-item-compontent"> + <view class="p-form-label" v-if="label">{{label}}锛�</view> + <view class="input-row"> + <view class="mask" @tap.stop="" v-if="disabled"></view> + <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 @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 class="msg-row" v-if="msg" :class="[msgType==='info'?'info-type':'']">{{msg}}</view> + </view> +</template> + +<script> + + export default { + name: 'ScanInputFormItemCompontent', + // emits: ['input', 'search', 'clear', 'blur', 'confirm'], + props: { + type: { + type: String, + default: 'text' + }, + label: { + type: String, + default: '' + }, + placeholder: { + type: String, + default: '璇疯緭鍏�...' + }, + msg: { + type: String, + default: '' + }, + msgType: { + type: String, + default: 'error' + }, + value: { + type: [String, Number, null], + default: '' + }, + hasSearch: { + type: Boolean, + default: true + }, + disabled: { + type: Boolean, + default: false + }, + clearable: { + type: Boolean, + default: true + }, + inputFocus: { + type: Boolean, + default: true + }, + // codeLength:{ + // type: Number, + // default: 1 + // } + }, + data() { + return { + innerValue: '', + confirmType:'handle' + } + }, + watch: { + value(newVal, oldVal) { + if (newVal !== this.innerValue) { + this.innerValue = newVal + } + }, + innerValue(newVal, oldVal) { + if (newVal !== this.value) { + this.$emit('input', newVal) + } + if(newVal&&this.confirmType=='auto') { + this.$emit('search', newVal) + this.confirmType='handle' + } + } + }, + + methods: { + + onScan() { + uni.scanCode({ + success: function(res) { + this.innerValue = res.result; + }, + fail: function() { + console.log('scanCode fail') + } + }) + }, + onSearch() { + this.$emit('search', this.innerValue) + }, + onClear() { + this.innerValue = null; + this.$emit('clear') + }, + 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' + } + + if(val) { + this.$emit('search', val) + } + //*/ + }, + }, + created() { + this.innerValue = this.value + }, + + } +</script> + +<style scoped lang="scss"> + .scan-input-form-item-compontent { + width: 100%; + + .p-form-label { + font-size: 32rpx; + color: $u-tips-color; + padding-bottom: 12rpx; + padding-left: 20rpx; + } + + .input-row { + width: 100%; + height: 90rpx; + overflow: hidden; + background-color: $uni-bg-color; + display: flex; + align-items: center; + position: relative; + + .scan-view, + .btn-view { + flex-shrink: 0; + } + + .scan-view { + display: flex; + align-items: center; + justify-content: center; + padding-right: 10rpx; + } + + .input-view { + flex-grow: 1; + padding-left: 20rpx; + } + + .btn-view { + width: 70rpx; + height: 100%; + padding: 20rpx; + padding-left: 0rpx; + box-sizing: border-box; + + .search-btn { + height: 100%; + width: 100%; + border-radius: 8rpx; + background: linear-gradient(157.342820970935deg, rgba(194, 128, 255, 1) -20%, rgba(194, 128, 255, 1) -19%, rgba(132, 0, 255, 1) 119%); + display: flex; + align-items: center; + justify-content: center; + color: $uni-bg-color; + font-size: 26rpx; + } + } + + &>.mask { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 100; + background-color: #000; + opacity: 0.25; + } + } + + .msg-row { + padding: 6rpx 20rpx 0 20rpx; + line-height: 1.3; + font-size: 24rpx; + color: $u-error; + + &.info-type { + color: $color-blue; + } + } + } +</style> \ No newline at end of file diff --git a/yiqi_pda/pages/unLine/modules/content.vue b/yiqi_pda/pages/unLine/modules/content.vue new file mode 100644 index 0000000..bbb0ccf --- /dev/null +++ b/yiqi_pda/pages/unLine/modules/content.vue @@ -0,0 +1,128 @@ +<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">鎴愬搧鐮�: {{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> + <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/unLine/modules/modalPwd.vue b/yiqi_pda/pages/unLine/modules/modalPwd.vue new file mode 100644 index 0000000..ddd94b8 --- /dev/null +++ b/yiqi_pda/pages/unLine/modules/modalPwd.vue @@ -0,0 +1,114 @@ +<template> + <u-modal :show="show" title="鍑哄簱纭" :closeOnClickOverlay="true" :showCancelButton="true" @cancel="handlerCancel" + @confirm="handlerConfirm" @close="handlerCancel"> + <u-form labelPosition="left" labelWidth="100rpx" :model="form" :rules="rules" ref="uForm"> + <u-form-item required label="瀵嗙爜" prop="pwd"> + <u-input v-model="form.pwd" type="password" placeholder="璇疯緭鍏ュ瘑鐮�" style="width: 450rpx;"></u-input> + </u-form-item> + </u-form> + + <!-- <view class="status_flex"> + <u-input v-model="pwd" type="password" placeholder="璇疯緭鍏ュ瘑鐮�" style="width: 450rpx;"></u-input> + </view> --> + </u-modal> +</template> + +<script> + import { + $alert + } from '@/static/js/utils/index.js' + import { + unLineWorkPiece + } from '@/api/outBound/index.js' + export default { + emits: ['update'], + data() { + return { + show: false, + workPieceData:[], + CarNo:'', + form: { + pwd: '' + }, + rules: { + pwd: { + type: 'string', + required: true, + message: '璇疯緭鍏ュ瘑鐮�', + trigger: ['blur', 'change'] + } + } + } + }, + onReady() { + this.$refs.uForm.setRules(this.rules) + }, + methods: { + showModal(workPieceData,CarNo){ + this.show=true + this.workPieceData=workPieceData + this.CarNo=CarNo + }, + handlerCancel() { + this.form = { + pwd: '', + } + this.show = false + }, + // 閫変腑鐨勭姸鎬佷紶閫掔粰鐖剁粍浠� + handlerConfirm() { + console.log(111); + this.$refs.uForm.validate().then(res => { + const params = { + password: this.form.pwd, + CarNo:this.CarNo, + workPieceInfoLst:this.workPieceData + } + console.log(params,'params'); + unLineWorkPiece(params).then(res => { + uni.showToast({ + title: '涓嬬嚎鎴愬姛' + }) + this.$emit('reflesh') + this.handlerCancel() + }) + }).catch(errors => { + console.log(errors,'22'); + }) + } + + } + } +</script> + +<style lang="scss" scoped> + .status_flex { + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + .flex_item { + width: 450rpx; + height: 70rpx; + text-align: center; + line-height: 70rpx; + border: 1px solid $color-common; + color: $color-common; + font-size: 32rpx; + font-weight: 550; + background: #fff; + margin-bottom: 30rpx; + } + + .active_item { + background: $color-common; + color: #fff; + } + } + + ::v-deep .u-transition { + z-index: 99 !important; + } +</style> \ No newline at end of file -- Gitblit v1.9.3