This commit is contained in:
2024-03-21 17:46:38 +08:00
parent fc286d3809
commit 5e8b9adb6c
11 changed files with 169 additions and 144 deletions

View File

@@ -8,18 +8,19 @@
ref="scaninput"
:placeholder="keyCode === '' ? placeholder : keyCode"
:value="value"
:readOnly="readOnly"
@focus="handleFocus($event)"
@blur="handleBlur($event)"
@input="handleChange($event)">
<div class="button_box">
<button class="search_box_icon fxcol" @click="handleScan">
<span class="iconfont scan_icon" :class="{'scan_icon_checked': type === true}"></span>
<span class="iconfont scan_icon" :class="{'scan_icon_checked': type === '1'}"></span>
</button>
<button class="search_box_icon fxcol" @click="handleKey">
<span class="iconfont key_icon" :class="{'key_icon_checked': type === false}"></span>
<span class="iconfont key_icon" :class="{'key_icon_checked': type === '2'}"></span>
</button>
<button v-show="seaShow === true" class="search_box_icon fxcol" @click="handleSearch">
<span class="iconfont search_icon" :class="{'key_icon_checked': type === false}"></span>
<span class="iconfont search_icon" :class="{'key_icon_checked': type === '2'}"></span>
</button>
</div>
</div>
@@ -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)
}
}
},

View File

@@ -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
// }

View File

@@ -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
// }

View File

@@ -19,7 +19,7 @@ export const toast = (str) => {
store.dispatch('toastMsg', str)
setTimeout(() => {
store.dispatch('showToast', false)
}, 3000)
}, 5000)
}
/**

32
src/config/mork1.js Normal file
View File

@@ -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
}

32
src/config/mork2.js Normal file
View File

@@ -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
}

View File

@@ -13,7 +13,6 @@
<div class="fxrow check-box">
<i class="icon-name-check" :class="{'icon-name-checked': memberName}" @click="Remember"></i>
<span class="fxcol">记住用户名</span>
<!-- <router-link :to="{path: '/setup'}" class="fxcol" style="text-align:right;color:#6798ef">设置</router-link> -->
</div>
<button class="login-btn" :disabled="disabled" @click="_Login">确认登录</button>
</section>
@@ -22,7 +21,7 @@
<script>
import {rfLogin} from '@config/getData2'
// import {encrypt} from '../../main.js'
// import {rfLogin} from '@config/mork2'
export default {
name: 'Login',
data () {

View File

@@ -81,9 +81,6 @@ export default {
try {
let res = await RFReadTrayStateInventory(val)
if (res.ErrNO === '1') {
if (this.val2 === '') {
this.$refs.myInput2.handleScan()
}
this._RFReadTrayStorageInventory()
} else {
this.toast(res.ErrMsg)
@@ -100,8 +97,12 @@ export default {
let res = await RFReadTrayStorageInventory(this.val1)
if (res.ErrNO === '1') {
this.dataList = [...res.StorageList]
this.val2 = ''
this.$refs.myInput2.handleScan()
} else {
this.toast(res.ErrMsg)
this.val1 = ''
this.$refs.myInput1.handleScan()
}
},
/** 读取物料条码 */
@@ -109,10 +110,7 @@ export default {
try {
let res = await RFReadMatBarCodeStateInventory(this.val1, val)
if (res.ErrNO === '1') {
this.toast(res.ErrMsg)
if (this.val1 === '') {
this.$refs.myInput1.handleScan()
}
this._RFStorageInventory()
} else {
this.toast(res.ErrMsg)
this.val2 = ''
@@ -125,9 +123,10 @@ export default {
},
handleChange1 (e, type) {
if (type && e.substring(0, 2) !== 'ZD') {
this.val1 = ''
this.val2 = e
this._RFReadMatBarCodeStateInventory(this.val2)
this.$refs.myInput1.handleScan()
setTimeout(() => {
this.val1 = ''
}, 200)
return
}
if (type) {
@@ -137,11 +136,20 @@ export default {
handleChange2 (e, type) {
if (type && e.substring(0, 2) === 'ZD') {
this.val1 = e
this.val2 = ''
setTimeout(() => {
this.val2 = ''
}, 200)
this._RFReadTrayStateInventory(this.val1)
return
}
if (type) {
if (type && this.val1 === '' && e.substring(0, 2) !== 'ZD') {
this.$refs.myInput1.handleScan()
setTimeout(() => {
this.val2 = ''
}, 200)
return
}
if (type && this.val1 !== '') {
this._RFReadMatBarCodeStateInventory(e)
}
},
@@ -160,10 +168,14 @@ export default {
this._RFReadTrayStorageInventory()
} else {
this.Dialog(res.ErrMsg)
this.val2 = ''
this.$refs.myInput2.handleScan()
}
this.disabled = false
} catch (e) {
this.disabled = false
this.val2 = ''
this.$refs.myInput2.handleScan()
}
},
/** 取消 */

View File

@@ -70,6 +70,7 @@ import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue'
import DropdownMenu from '@components/DropdownMenu.vue'
import {rfReadTrayStatePackage, rfReadTrayStoragePackage, rfReadMatBarCodeStatePackage, rfTrayPackage} from '@config/getData2'
// import {rfReadTrayStatePackage, rfReadTrayStoragePackage, rfReadMatBarCodeStatePackage, rfTrayPackage} from '@config/mork2'
export default {
name: 'GroupDisk',
components: {
@@ -97,10 +98,6 @@ export default {
try {
let res = await rfReadTrayStatePackage(val)
if (res.ErrNO === '1') {
// this.toast(res.ErrMsg)
if (this.val2 === '') {
this.$refs.myInput2.handleScan()
}
this._rfReadTrayStoragePackage()
} else {
this.toast(res.ErrMsg)
@@ -117,8 +114,12 @@ export default {
let res = await rfReadTrayStoragePackage(this.val1)
if (res.ErrNO === '1') {
this.dataList = [...res.StorageList]
this.val2 = ''
this.$refs.myInput2.handleScan()
} else {
this.toast(res.ErrMsg)
this.val1 = ''
this.$refs.myInput1.handleScan()
}
},
/** 读取物料条码 */
@@ -126,10 +127,7 @@ export default {
try {
let res = await rfReadMatBarCodeStatePackage(this.val1, val)
if (res.ErrNO === '1') {
this.toast(res.ErrMsg)
if (this.val1 === '') {
this.$refs.myInput1.handleScan()
}
this.open = true
} else {
this.toast(res.ErrMsg)
this.val2 = ''
@@ -142,9 +140,10 @@ export default {
},
handleChange1 (e, type) {
if (type && e.substring(0, 2) !== 'ZD') {
this.val1 = ''
this.val2 = e
this._rfReadMatBarCodeStatePackage(this.val2)
this.$refs.myInput1.handleScan()
setTimeout(() => {
this.val1 = ''
}, 200)
return
}
if (type) {
@@ -154,11 +153,20 @@ export default {
handleChange2 (e, type) {
if (type && e.substring(0, 2) === 'ZD') {
this.val1 = e
this.val2 = ''
setTimeout(() => {
this.val2 = ''
}, 200)
this._rfReadTrayStatePackage(this.val1)
return
}
if (type) {
if (type && this.val1 === '' && e.substring(0, 2) !== 'ZD') {
this.$refs.myInput1.handleScan()
setTimeout(() => {
this.val2 = ''
}, 200)
return
}
if (type && this.val1 !== '') {
this._rfReadMatBarCodeStatePackage(e)
}
},
@@ -173,8 +181,11 @@ export default {
let uid = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).UserPID : ''
let res = await rfTrayPackage(this.val1, this.val2, this.option[this.active].value, uid)
if (res.ErrNO === '1') {
this.toast(res.ErrMsg)
this._rfReadTrayStoragePackage()
this.toast(res.ErrMsg)
this.val2 = ''
this.active = ''
this.$refs.myInput2.handleScan()
} else {
this.Dialog(res.ErrMsg)
}
@@ -202,6 +213,7 @@ export default {
dropdownMenu (i) {
this.active = i + ''
this.open = false
this._rfTrayPackage()
}
}
}

View File

@@ -90,12 +90,16 @@ export default {
this.dataList = [...res.StorageList]
} else {
this.toast(res.ErrMsg)
this.val1 = ''
this.$refs.myInput1.handleScan()
}
},
handleChange1 (e, type) {
if (type && e.substring(0, 2) !== 'ZD') {
this.val1 = ''
this.$refs.myInput1.handleScan()
setTimeout(() => {
this.val1 = ''
}, 200)
return
}
if (type) {
@@ -116,11 +120,14 @@ export default {
this.toast(res.ErrMsg)
this._rfReadTrayStorageUnPackage()
} else {
this.Dialog(res.ErrMsg)
this.toast(res.ErrMsg)
this.toCancle()
}
this.disabled = false
} catch (e) {
this.disabled = false
this.val1 = ''
this.$refs.myInput1.handleScan()
}
},
/** 取消 */

View File

@@ -81,9 +81,6 @@ export default {
try {
let res = await RFReadTrayStatePick(val)
if (res.ErrNO === '1') {
if (this.val2 === '') {
this.$refs.myInput2.handleScan()
}
this._RFReadTrayStoragePick()
} else {
this.toast(res.ErrMsg)
@@ -100,8 +97,12 @@ export default {
let res = await RFReadTrayStoragePick(this.val1)
if (res.ErrNO === '1') {
this.dataList = [...res.StorageList]
this.val2 = ''
this.$refs.myInput2.handleScan()
} else {
this.toast(res.ErrMsg)
this.val1 = ''
this.$refs.myInput1.handleScan()
}
},
/** 读取物料条码 */
@@ -110,9 +111,7 @@ export default {
let res = await RFReadMatBarCodeStatePick(this.val1, val)
if (res.ErrNO === '1') {
this.toast(res.ErrMsg)
if (this.val1 === '') {
this.$refs.myInput1.handleScan()
}
this._RFStoragePick()
} else {
this.toast(res.ErrMsg)
this.val2 = ''
@@ -125,9 +124,10 @@ export default {
},
handleChange1 (e, type) {
if (type && e.substring(0, 2) !== 'ZD') {
this.val1 = ''
this.val2 = e
this._RFReadMatBarCodeStatePick(this.val2)
this.$refs.myInput1.handleScan()
setTimeout(() => {
this.val1 = ''
}, 200)
return
}
if (type) {
@@ -137,11 +137,20 @@ export default {
handleChange2 (e, type) {
if (type && e.substring(0, 2) === 'ZD') {
this.val1 = e
this.val2 = ''
setTimeout(() => {
this.val2 = ''
}, 200)
this._RFReadTrayStatePick(this.val1)
return
}
if (type) {
if (type && this.val1 === '' && e.substring(0, 2) !== 'ZD') {
this.$refs.myInput1.handleScan()
setTimeout(() => {
this.val2 = ''
}, 200)
return
}
if (type && this.val1 !== '') {
this._RFReadMatBarCodeStatePick(e)
}
},
@@ -160,10 +169,14 @@ export default {
this._RFReadTrayStoragePick()
} else {
this.Dialog(res.ErrMsg)
this.val2 = ''
this.$refs.myInput2.handleScan()
}
this.disabled = false
} catch (e) {
this.disabled = false
this.val2 = ''
this.$refs.myInput2.handleScan()
}
},
/** 取消 */