This commit is contained in:
蔡玲
2024-11-15 16:31:22 +08:00
parent 7309f5e425
commit 83e8d42822
3 changed files with 197 additions and 10 deletions

View File

@@ -0,0 +1,150 @@
<template>
<view class="zd-row search_wraper" :class="{'input_focus': focusState}">
<input
type="text"
class="search_input"
confirm-type="go"
:value="value"
:focus="focusState"
@focus="handleFocus"
@blur="handleBlur"
@confirm="handleSend">
<view class="iconfont icon-del" @tap="toDel">&#xe6dc;</view>
<view class="iconfont icon_scan" @tap="toScan">&#xe6e2;</view>
</view>
</template>
<script>
import permision from "@/utils/permission.js"
export default {
data() {
return {
focusState: false
};
},
model: {
prop: 'value',
event: 'input'
},
props: {
value: String,
maindata: Object,
secdata: Object
},
methods: {
handleFocus (e) {
this.focusState = true
this.$emit('handleFocus', e.target.value, this.maindata, this.secdata)
},
handleBlur (e) {
this.$emit('input', e.target.value)
if (e.target.value.length) {
this.$emit('handleChange', e.target.value)
}
this.focusState = false
},
handleSend (e) {
this.$emit('input', e.target.value)
if (e.target.value.length) {
this.$emit('handleChange', e.target.value)
}
},
toDel () {
this.$emit('input', '')
},
async toScan() {
// #ifdef APP-PLUS
let status = await this.checkPermission();
if (status !== 1) {
return;
}
// #endif
uni.scanCode({
success: (res) => {
this.$emit('input', res.result)
this.$emit('handleChange', res.result)
},
fail: (err) => {
// uni.showToast({
// title: '出错',
// icon: 'none'
// })
}
});
}
// #ifdef APP-PLUS
,
async checkPermission(code) {
let status = permision.isIOS ? await permision.requestIOS('camera') :
await permision.requestAndroid('android.permission.CAMERA');
if (status === null || status === 1) {
status = 1;
} else {
uni.showModal({
content: "需要相机权限",
confirmText: "设置",
success: function(res) {
if (res.confirm) {
permision.gotoAppSetting();
}
}
})
}
return status;
}
// #endif
// #ifdef APP-PLUS
,
async checkMpaasScan () {
var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
mpaasScanModule.mpaasScan({
// 扫码识别类型参数可多选qrCode、barCode不设置默认识别所有
'scanType': ['qrCode','barCode'],
// 是否隐藏相册默认false不隐藏
'hideAlbum': false
},
(ret) => {
// uni.showModal({
// title: "弹窗标题",
// // 返回值中resp_code 表示返回结果值10用户取消11其他错误1000成功
// // 返回值中resp_message 表示返回结果信息
// // 返回值中resp_result 表示扫码结果,只有成功才会有返回
// content: JSON.stringify(ret),
// showCancel: false,
// confirmText: "确定"
// })
this.$emit('input', ret.resp_result)
})
}
// #endif
}
}
</script>
<style lang="stylus">
@import '../common/style/mixin.styl';
.search_wraper
_wh(100%, 28px)
padding 0 2px 0 10px
border 1px solid #4980BD
background-color rgba(45,88,184,0.1)
border-radius 6px
.search_input
width 100%
height: 28px;
line-height: 28px;
font-size: 12px;
color: #fff
.icon_scan
_wh(70px, 24px)
_font(20px,24px,#fff,,center)
background-color #137ABD
border-radius 6px
.icon-del
_wh(70px, 28px)
_font(20px,28px,#fff,,center)
.input_focus
border: 1px solid #889dc7;
box-shadow: 0 0 0 1px rgba(136, 157, 199,.2);
</style>

View File

@@ -80,10 +80,10 @@
<td>{{el.material_name}}</td>
<td>{{el.turnout_struct_code}}</td>
<td>{{el.turnout_struct_name}}</td>
<td><input class="td_input" type="number" v-model="el.qty" @blur="updateNumkw(e, el)" /></td>
<td><input class="td_input" type="number" confirm-type="go" v-model="el.qty" @focus="focusInput(e, el)" @blur="updateNum(e, el)" @confirm="updateNum(e, el)"/></td>
<td>
<view class="td_scan_wraper">
<scan-input v-model="el.turnin_struct_code" @handleChange="updateNumkw(e, el)" />
<scan-input v-model="el.turnin_struct_code" :maindata="e" :secdata="el" @handleFocus="handleFocus" @handleChange="handleChangekw" />
</view>
</td>
<td>{{el.turnin_struct_name}}</td>
@@ -108,7 +108,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import ScanInput from '@/components/ScanInput.vue'
import ScanInput from '@/components/ScanInput_new.vue'
import Pagination from '@/components/Pagination.vue'
import GridDetail from '@/components/GridDetail.vue'
// import {getWarehouseInfo, stIvtMoveinvMovePage, moveDtlByMoveId} from '@/utils/mork2.js'
@@ -236,16 +236,43 @@
e.subAllChecked = arr.length === e.subData.length
e.subOneChecked = arr.length > 0
},
// 副表格单行数量获取焦点
focusInput (e, el) {
this.raw = el.qty
},
// 修改副表格单行移动数量
updateNumkw (e, el) {
this._stIvtMoveinvUpdateDtl(e, el)
updateNum (e, el) {
this._stIvtMoveinvUpdateDtl(e, el, 'sl')
},
// 副表格单行库位编码获取焦点
handleFocus (val, e, el) {
this.raw = el.turnin_struct_code
this.popObj = e
this.rawObj = el
},
// 修改副表格单行库位
handleChangekw (e) {
this._stIvtMoveinvUpdateDtl(this.popObj, this.rawObj, 'kw')
},
// 二级表格单行收货数量和收货仓库接口
async _stIvtMoveinvUpdateDtl (e, el) {
async _stIvtMoveinvUpdateDtl (e, el, type) {
try {
let res = await stIvtMoveinvUpdateDtl(el)
if (res.code === 1) {
this._moveDtlByMoveId(e)
if (res.code !== 1) {
this.dataList.map(ele => {
if (e.id === ele.id) {
e.subData.map(elem => {
if (elem.id === el.id) {
if (type === 'sl') {
elem.qty = this.raw
}
if (type === 'kw') {
elem.turnin_struct_code = this.raw
}
}
})
}
})
}
uni.showToast({
title: res.desc,

View File

@@ -2307,12 +2307,14 @@ export const moveDtlByMoveId = () => {
{
"id": "0201",
"material_code": "btAAAAW8Wd5QCrde",
"qty": "1"
"qty": "1",
"turnin_struct_code": '0909'
},
{
"id": "0202",
"material_code": "btAAAAW8WdpQCrde",
"qty": "1"
"qty": "1",
"turnin_struct_code": '090910'
}
],
"code": 1,
@@ -2337,6 +2339,14 @@ export const allocationBillDetailUpdate = () => {
return res
}
export const stIvtMoveinvUpdateDtl = () => {
let res = {
code: 1,
desc: 'ok'
}
return res
}
export const allocationBillDetail = () => {
let res = {
"pageNum": 1,