退料修复

This commit is contained in:
hongchao 2025-07-29 18:04:32 +08:00
parent a9fbc971c9
commit 1a2dc09f34
2 changed files with 21 additions and 15 deletions

View File

@ -78,14 +78,13 @@
<uni-col :span="6">设备编码</uni-col> <uni-col :span="6">设备编码</uni-col>
<uni-col :span="12"> <uni-col :span="12">
<!-- <uni-easyinput placeholder="请输入内容" maxlength="30" v-model="maCode" /> --> <!-- <uni-easyinput placeholder="请输入内容" maxlength="30" v-model="maCode" /> -->
<eselect <uni-data-select
style="width: 100%; height: 90rpx" style="width: 100%; height: 90rpx"
v-model="maCode" v-model="maCode"
ref="treeSelect2" :localdata="codeList"
:options="codeList"
@change="changeMaCode" @change="changeMaCode"
@clear="clearMaCode" @clear="clearMaCode"
></eselect> ></uni-data-select>
</uni-col> </uni-col>
<uni-col :span="6"> <uni-col :span="6">
<view class="coding-btn search-btn" @click="getMaInfo">编码检索</view> <view class="coding-btn search-btn" @click="getMaInfo">编码检索</view>
@ -163,7 +162,7 @@ const bmFileInfos = ref([]) // 上传后的图片信息
const scanQrCodeRef = ref(null) const scanQrCodeRef = ref(null)
const codeList = ref([]) const codeList = ref([])
const isExpanded = ref(false) const isExpanded = ref(false)
const flag = ref(false)
const leftClick = () => { const leftClick = () => {
// //
uni.navigateBack({ uni.navigateBack({
@ -188,9 +187,8 @@ const getMaCodeList = async () => {
if (!res.data || res.data.length === 0) return if (!res.data || res.data.length === 0) return
codeList.value = res.data.map((item) => { codeList.value = res.data.map((item) => {
return { return {
id: item.maCode, value: item.maCode,
name: item.maCode, text: item.maCode
parentId: 0,
} }
}) })
} catch (error) { } catch (error) {
@ -200,7 +198,7 @@ const getMaCodeList = async () => {
const changeMaCode = (e) => { const changeMaCode = (e) => {
console.log('🚀 ~ changeMaCode ~ e:', e) console.log('🚀 ~ changeMaCode ~ e:', e)
maCode.value = e.id maCode.value = e
} }
const clearMaCode = () => { const clearMaCode = () => {
@ -219,6 +217,7 @@ const clearMaCode = () => {
} }
// //
const getMaInfo = () => { const getMaInfo = () => {
flag.value = false
console.log(maCode.value) console.log(maCode.value)
if (!maCode.value) { if (!maCode.value) {
uni.showToast({ title: '请选择设备编码!', icon: 'none' }) uni.showToast({ title: '请选择设备编码!', icon: 'none' })
@ -240,6 +239,7 @@ const getMaInfo = () => {
maStatusName.value = res.data[0].maStatusName maStatusName.value = res.data[0].maStatusName
maId.value = res.data[0].maId maId.value = res.data[0].maId
typeId.value = res.data[0].typeId typeId.value = res.data[0].typeId
} else { } else {
uni.showToast({ title: '该编码非该单位工程领用,不可退料!', icon: 'none' }) uni.showToast({ title: '该编码非该单位工程领用,不可退料!', icon: 'none' })
} }
@ -252,8 +252,8 @@ const getMaInfo = () => {
const qrCode = ref('') // const qrCode = ref('') //
// //
const scanStart = async () => { const scanStart = async () => {
qrCode.value = '' qrCode.value = ''
if (scanQrCodeRef.value) { if (scanQrCodeRef.value) {
scanQrCodeRef.value.scanQrCode() scanQrCodeRef.value.scanQrCode()
} }
@ -337,23 +337,28 @@ const getMaInfoScan = () => {
url: '/material/back_apply_info/getMachine', url: '/material/back_apply_info/getMachine',
method: 'get', method: 'get',
data: param, data: param,
success: (res) => { success: async (res) => {
console.log(res) console.log(res)
await getMaCodeList();
if(!res.data.code){ if(!res.data.code){
res = JSON.parse(decryptWithSM4(res.data)) res = JSON.parse(decryptWithSM4(res.data))
}else{ }else{
res = JSON.parse(res.data) res = res.data
} }
console.log("xxxxxxxxxxxxxxxx",res) console.log("xxxxxxxxxxxxxxxx",res)
if (res.code == 200) { if (res.code == 200) {
console.log(res) console.log(res)
console.log(res.data[0]) console.log(res.data[0])
maCode.value = res.data[0].maCode maCode.value = res.data[0].maCode;
console.log("333333333333",maCode.value)
console.log('codeList:', JSON.stringify(codeList.value))
typeName.value = res.data[0].typeName typeName.value = res.data[0].typeName
materialName.value = res.data[0].typeModelName materialName.value = res.data[0].typeModelName
maStatusName.value = res.data[0].maStatusName maStatusName.value = res.data[0].maStatusName
maId.value = res.data[0].maId maId.value = res.data[0].maId
typeId.value = res.data[0].typeId typeId.value = res.data[0].typeId
flag.value = true
}else{ }else{
uni.showModal({ uni.showModal({
title: '错误提示', title: '错误提示',
@ -480,7 +485,9 @@ const submitCode = () => {
// uni.navigateBack({ // uni.navigateBack({
// delta: 1 // // delta: 1 //
// }); // });
scanStart() if(flag.value){
scanStart()
}
} else { } else {
uni.showToast({ title: res.msg, icon: 'none' }) uni.showToast({ title: res.msg, icon: 'none' })
} }

View File

@ -173,7 +173,6 @@ const getCodeDeviceInfoData = async () => {
}) })
} }
}) })
console.log(res)
} }
// //