diff --git a/src/components/SearchBox.vue b/src/components/SearchBox.vue index fbf16ff..d37d62d 100644 --- a/src/components/SearchBox.vue +++ b/src/components/SearchBox.vue @@ -8,18 +8,19 @@ ref="scaninput" :placeholder="keyCode === '' ? placeholder : keyCode" :value="value" + :readOnly="readOnly" @focus="handleFocus($event)" @blur="handleBlur($event)" @input="handleChange($event)">
@@ -49,54 +50,47 @@ export default { return { placeholder: '', type: '', - cur: '' + cur: '', + readOnly: false } }, methods: { handleScan () { + this.type = '1' this.$refs.scaninput.focus() - this.placeholder = '请按扫码键输入' - this.type = true - this.$emit('input', '') }, handleKey () { + this.type = '2' this.$refs.scaninput.focus() this.placeholder = '请键盘输入' - this.type = false - // this.$emit('input', this.cur) }, handleFocus ($event) { - // this.cur = $event.target.value this.placeholder = '请按扫码键输入' - this.type = true + if (this.type !== '2') { + this.readOnly = true + setTimeout(() => { + this.readOnly = false + }, 200) + } $event.target.value = '' this.$emit('input', $event.target.value) }, handleBlur ($event) { this.type = '' this.placeholder = '' - // if ($event.target.value === '') { - // $event.target.value = this.cur - // } this.$emit('input', $event.target.value) }, handleChange ($event) { if ($event.target.value) { - if (this.type) { - this.cur = $event.target.value.split('##')[0] - let _this = this - setTimeout(() => { - _this.$emit('input', this.cur) - _this.$emit('handleChange', this.cur, true) - _this.$emit('getScanTxt', $event.target.value) - }, 20) - this.$refs.scaninput.blur() - } else if (!this.type) { - this.cur = $event.target.value + this.cur = $event.target.value + if (this.type === '2') { this.$emit('input', this.cur) this.$emit('handleChange', this.cur, false) } else { - this.cur = $event.target.value + setTimeout(() => { + this.$emit('input', this.cur) + this.$emit('handleChange', this.cur, true) + }, 20) } } }, diff --git a/src/config/getData1.js b/src/config/getData1.js index f8d4301..26c90a0 100644 --- a/src/config/getData1.js +++ b/src/config/getData1.js @@ -7,37 +7,18 @@ import {post} from '@config/http.js' export const RFReadTrayStatePick = (id) => post('RF_ReadTrayState_Pick', { js: JSON.stringify({TrayID: id}) }) -// export const RFReadTrayStatePick = (id) => { -// let res = {'ErrNO': '1', 'ErrMsg': '读取成功'} -// return res -// } // 托盘待拣货信息 export const RFReadTrayStoragePick = (id) => post('RF_ReadTrayStorage_Pick', { js: JSON.stringify({TrayID: id}) }) -// export const RFReadTrayStoragePick = (id) => { -// let res = {'ErrNO': '1', 'ErrMsg': '读取成功!', 'StorageList': [{'BillID': '000001', 'MatCode': '物料编码001', 'MatName': '物料名称001', 'BatchNumber': '批次001', 'MatNum': '100', 'FactNumOut': '50'}, {'BillID': '000002', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '100', 'FactNumOut': '50'}]} -// return res -// } - // 读取物料条码 export const RFReadMatBarCodeStatePick = (id, code) => post('RF_ReadMatBarCodeState_Pick', { js: JSON.stringify({TrayID: id, MatBarCode: code}) }) -// export const RFReadMatBarCodeStatePick = (id, code) => { -// let res = {'ErrNO': '1', 'ErrMsg': '读取成功'} -// return res -// } - // 拣货 export const RFStoragePick = (id, code, uid) => post('RF_Storage_Pick', { js: JSON.stringify({TrayID: id, MatBarCode: code, UserPID: uid}) }) -// export const RFStoragePick = (id, code, uid) => { -// let res = {'ErrNO': '1', 'ErrMsg': '拣货成功'} -// return res -// } - /** * 盘点 */ @@ -45,34 +26,15 @@ export const RFStoragePick = (id, code, uid) => post('RF_Storage_Pick', { export const RFReadTrayStateInventory = (id) => post('RF_ReadTrayState_Inventory', { js: JSON.stringify({TrayID: id}) }) -// export const RFReadTrayStateInventory = (id) => { -// let res = {'ErrNO': '1', 'ErrMsg': '读取成功'} -// return res -// } - // 托盘待盘点信息 export const RFReadTrayStorageInventory = (id) => post('RF_ReadTrayStorage_Inventory', { js: JSON.stringify({TrayID: id}) }) -// export const RFReadTrayStorageInventory = (id) => { -// let res = {'ErrNO': '1', 'ErrMsg': '读取成功!', 'StorageList': [{'BillID': '000001', 'MatCode': '物料编码001', 'MatName': '物料名称001', 'BatchNumber': '批次001', 'MatNum': '100', 'FactNumOut': '50'}, {'BillID': '000002', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '100', 'FactNumOut': '50'}]} -// return res -// } - // 读取物料条码 export const RFReadMatBarCodeStateInventory = (id, code) => post('RF_ReadMatBarCodeState_Inventory', { js: JSON.stringify({TrayID: id, MatBarCode: code}) }) -// export const RFReadMatBarCodeStateInventory = (id, code) => { -// let res = {'ErrNO': '1', 'ErrMsg': '读取成功'} -// return res -// } - // 盘点 export const RFStorageInventory = (id, code, uid) => post('RF_Storage_Inventory', { js: JSON.stringify({TrayID: id, MatBarCode: code, UserPID: uid}) }) -// export const RFStorageInventory = (id, code, uid) => { -// let res = {'ErrNO': '1', 'ErrMsg': '盘点成功'} -// return res -// } diff --git a/src/config/getData2.js b/src/config/getData2.js index 5308587..0916f5a 100644 --- a/src/config/getData2.js +++ b/src/config/getData2.js @@ -4,11 +4,6 @@ import {post} from '@config/http.js' export const rfLogin = (user, password) => post('RF_Login', { js: JSON.stringify({UserID: user, UserPassWord: password}) }) -// export const rfLogin = (user, password) => { -// let res = {'ErrNO': '1', 'ErrMsg': '登录成功', 'UserName': '张三', 'UserPID': '1001'} -// return res -// } - /** * 组盘 */ @@ -16,37 +11,18 @@ export const rfLogin = (user, password) => post('RF_Login', { export const rfReadTrayStatePackage = (id) => post('RF_ReadTrayState_Package', { js: JSON.stringify({TrayID: id}) }) -// export const rfReadTrayStatePackage = (id) => { -// let res = {'ErrNO': '1', 'ErrMsg': '读取成功'} -// return res -// } // 托盘库存信息 export const rfReadTrayStoragePackage = (id) => post('RF_ReadTrayStorage_Package', { js: JSON.stringify({TrayID: id}) }) -// export const rfReadTrayStoragePackage = (id) => { -// let res = {'ErrNO': '1', 'ErrMsg': '读取成功!', 'StorageList': [{'BillID': '000001', 'MatCode': '物料编码001', 'MatName': '物料名称001', 'BatchNumber': '批次001', 'MatNum': '1'}, {'BillID': '000002', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '1'}]} -// return res -// } - // 读取物料条码 export const rfReadMatBarCodeStatePackage = (id, code) => post('RF_ReadMatBarCodeState_Package', { js: JSON.stringify({TrayID: id, MatBarCode: code}) }) -// export const rfReadMatBarCodeStatePackage = (id, code) => { -// let res = {'ErrNO': '1', 'ErrMsg': '读取成功'} -// return res -// } - // 组盘 export const rfTrayPackage = (id, code, size, uid) => post('RF_Tray_Package', { js: JSON.stringify({TrayID: id, MatBarCode: code, MatSize: size, UserPID: uid}) }) -// export const rfTrayPackage = (id, code, size, uid) => { -// let res = {'ErrNO': '1', 'ErrMsg': '组盘成功'} -// return res -// } - /** *解盘 */ @@ -54,25 +30,11 @@ export const rfTrayPackage = (id, code, size, uid) => post('RF_Tray_Package', { export const rfReadTrayStateUnPackage = (id) => post('RF_ReadTrayState_UnPackage', { js: JSON.stringify({TrayID: id}) }) -// export const rfReadTrayStateUnPackage = (id) => { -// let res = {'ErrNO': '1', 'ErrMsg': '读取成功'} -// return res -// } - // 托盘库存信息 export const rfReadTrayStorageUnPackage = (id) => post('RF_ReadTrayStorage_UnPackage', { js: JSON.stringify({TrayID: id}) }) -// export const rfReadTrayStorageUnPackage = (id) => { -// let res = {'ErrNO': '1', 'ErrMsg': '读取成功!', 'StorageList': [{'BillID': '000001', 'MatCode': '物料编码001', 'MatName': '物料名称001', 'BatchNumber': '批次001', 'MatNum': '1'}, {'BillID': '000002', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '1'}, {'BillID': '000003', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '1'}]} -// return res -// } - // 解盘 export const rfTrayUnPackage = (id, uid) => post('RF_Tray_UnPackage', { js: JSON.stringify({TrayID: id, UserPID: uid}) }) -// export const rfTrayUnPackage = (id, uid) => { -// let res = {'ErrNO': '1', 'ErrMsg': '组盘成功'} -// return res -// } diff --git a/src/config/mUtils.js b/src/config/mUtils.js index 28d14ad..f74e409 100644 --- a/src/config/mUtils.js +++ b/src/config/mUtils.js @@ -19,7 +19,7 @@ export const toast = (str) => { store.dispatch('toastMsg', str) setTimeout(() => { store.dispatch('showToast', false) - }, 3000) + }, 5000) } /** diff --git a/src/config/mork1.js b/src/config/mork1.js new file mode 100644 index 0000000..ff33f69 --- /dev/null +++ b/src/config/mork1.js @@ -0,0 +1,32 @@ +export const RFReadTrayStatePick = (id) => { + let res = {'ErrNO': '1', 'ErrMsg': '读取成功'} + return res +} +export const RFReadTrayStoragePick = (id) => { + let res = {'ErrNO': '1', 'ErrMsg': '读取成功!', 'StorageList': [{'BillID': '000001', 'MatCode': '物料编码001', 'MatName': '物料名称001', 'BatchNumber': '批次001', 'MatNum': '100', 'FactNumOut': '50'}, {'BillID': '000002', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '100', 'FactNumOut': '50'}]} + return res +} +export const RFReadMatBarCodeStatePick = (id, code) => { + let res = {'ErrNO': '1', 'ErrMsg': '读取成功'} + return res +} +export const RFStoragePick = (id, code, uid) => { + let res = {'ErrNO': '1', 'ErrMsg': '拣货成功'} + return res +} +export const RFReadTrayStateInventory = (id) => { + let res = {'ErrNO': '1', 'ErrMsg': '读取成功'} + return res +} +export const RFReadTrayStorageInventory = (id) => { + let res = {'ErrNO': '1', 'ErrMsg': '读取成功!', 'StorageList': [{'BillID': '000001', 'MatCode': '物料编码001', 'MatName': '物料名称001', 'BatchNumber': '批次001', 'MatNum': '100', 'FactNumOut': '50'}, {'BillID': '000002', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '100', 'FactNumOut': '50'}]} + return res +} +export const RFReadMatBarCodeStateInventory = (id, code) => { + let res = {'ErrNO': '1', 'ErrMsg': '读取成功'} + return res +} +export const RFStorageInventory = (id, code, uid) => { + let res = {'ErrNO': '1', 'ErrMsg': '盘点成功'} + return res +} diff --git a/src/config/mork2.js b/src/config/mork2.js new file mode 100644 index 0000000..10e66cd --- /dev/null +++ b/src/config/mork2.js @@ -0,0 +1,32 @@ +export const rfLogin = (user, password) => { + let res = {'ErrNO': '1', 'ErrMsg': '登录成功', 'UserName': '张三', 'UserPID': '1001'} + return res +} +export const rfReadTrayStatePackage = (id) => { + let res = {'ErrNO': '1', 'ErrMsg': '读取成功'} + return res +} +export const rfReadTrayStoragePackage = (id) => { + let res = {'ErrNO': '1', 'ErrMsg': '读取成功!', 'StorageList': [{'BillID': '000001', 'MatCode': '物料编码001', 'MatName': '物料名称001', 'BatchNumber': '批次001', 'MatNum': '1'}, {'BillID': '000002', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '1'}]} + return res +} +export const rfReadMatBarCodeStatePackage = (id, code) => { + let res = {'ErrNO': '1', 'ErrMsg': '读取成功'} + return res +} +export const rfTrayPackage = (id, code, size, uid) => { + let res = {'ErrNO': '1', 'ErrMsg': '组盘成功'} + return res +} +export const rfReadTrayStateUnPackage = (id) => { + let res = {'ErrNO': '1', 'ErrMsg': '读取成功'} + return res +} +export const rfReadTrayStorageUnPackage = (id) => { + let res = {'ErrNO': '1', 'ErrMsg': '读取成功!', 'StorageList': [{'BillID': '000001', 'MatCode': '物料编码001', 'MatName': '物料名称001', 'BatchNumber': '批次001', 'MatNum': '1'}, {'BillID': '000002', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '1'}, {'BillID': '000003', 'MatCode': '物料编码002', 'MatName': '物料名称002', 'BatchNumber': '批次002', 'MatNum': '1'}]} + return res +} +export const rfTrayUnPackage = (id, uid) => { + let res = {'ErrNO': '1', 'ErrMsg': '组盘成功'} + return res +} diff --git a/src/pages/login/Login.vue b/src/pages/login/Login.vue index 2bbbf00..ddc04d3 100644 --- a/src/pages/login/Login.vue +++ b/src/pages/login/Login.vue @@ -13,7 +13,6 @@
记住用户名 -
@@ -22,7 +21,7 @@