退料修复
This commit is contained in:
		
							parent
							
								
									a9fbc971c9
								
							
						
					
					
						commit
						1a2dc09f34
					
				| 
						 | 
				
			
			@ -78,14 +78,13 @@
 | 
			
		|||
                <uni-col :span="6">设备编码:</uni-col>
 | 
			
		||||
                <uni-col :span="12">
 | 
			
		||||
                    <!-- <uni-easyinput placeholder="请输入内容" maxlength="30" v-model="maCode" /> -->
 | 
			
		||||
                    <eselect
 | 
			
		||||
                    <uni-data-select
 | 
			
		||||
                        style="width: 100%; height: 90rpx"
 | 
			
		||||
                        v-model="maCode"
 | 
			
		||||
                        ref="treeSelect2"
 | 
			
		||||
                        :options="codeList"
 | 
			
		||||
                        :localdata="codeList"
 | 
			
		||||
                        @change="changeMaCode"
 | 
			
		||||
                        @clear="clearMaCode"
 | 
			
		||||
                    ></eselect>
 | 
			
		||||
                    ></uni-data-select>
 | 
			
		||||
                </uni-col>
 | 
			
		||||
                <uni-col :span="6">
 | 
			
		||||
                    <view class="coding-btn search-btn" @click="getMaInfo">编码检索</view>
 | 
			
		||||
| 
						 | 
				
			
			@ -163,7 +162,7 @@ const bmFileInfos = ref([]) // 上传后的图片信息
 | 
			
		|||
const scanQrCodeRef = ref(null)
 | 
			
		||||
const codeList = ref([])
 | 
			
		||||
const isExpanded = ref(false)
 | 
			
		||||
 | 
			
		||||
const flag = ref(false)
 | 
			
		||||
const leftClick = () => { 
 | 
			
		||||
    // 返回
 | 
			
		||||
    uni.navigateBack({
 | 
			
		||||
| 
						 | 
				
			
			@ -188,9 +187,8 @@ const getMaCodeList = async () => {
 | 
			
		|||
        if (!res.data || res.data.length === 0) return
 | 
			
		||||
        codeList.value = res.data.map((item) => {
 | 
			
		||||
            return {
 | 
			
		||||
                id: item.maCode,
 | 
			
		||||
                name: item.maCode,
 | 
			
		||||
                parentId: 0,
 | 
			
		||||
                value: item.maCode,
 | 
			
		||||
                text: item.maCode
 | 
			
		||||
            }
 | 
			
		||||
        })
 | 
			
		||||
    } catch (error) {
 | 
			
		||||
| 
						 | 
				
			
			@ -200,7 +198,7 @@ const getMaCodeList = async () => {
 | 
			
		|||
 | 
			
		||||
const changeMaCode = (e) => {
 | 
			
		||||
    console.log('🚀 ~ changeMaCode ~ e:', e)
 | 
			
		||||
    maCode.value = e.id
 | 
			
		||||
    maCode.value = e
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const clearMaCode = () => {
 | 
			
		||||
| 
						 | 
				
			
			@ -219,6 +217,7 @@ const clearMaCode = () => {
 | 
			
		|||
}
 | 
			
		||||
//根据编码获取设备类型
 | 
			
		||||
const getMaInfo = () => {
 | 
			
		||||
    flag.value = false
 | 
			
		||||
    console.log(maCode.value)
 | 
			
		||||
    if (!maCode.value) {
 | 
			
		||||
        uni.showToast({ title: '请选择设备编码!', icon: 'none' })
 | 
			
		||||
| 
						 | 
				
			
			@ -240,6 +239,7 @@ const getMaInfo = () => {
 | 
			
		|||
                    maStatusName.value = res.data[0].maStatusName
 | 
			
		||||
                    maId.value = res.data[0].maId
 | 
			
		||||
                    typeId.value = res.data[0].typeId
 | 
			
		||||
                    
 | 
			
		||||
                } else {
 | 
			
		||||
                    uni.showToast({ title: '该编码非该单位工程领用,不可退料!', icon: 'none' })
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			@ -252,8 +252,8 @@ const getMaInfo = () => {
 | 
			
		|||
const qrCode = ref('') //图片展示
 | 
			
		||||
// 二维码扫码
 | 
			
		||||
const scanStart = async () => {
 | 
			
		||||
    qrCode.value = ''
 | 
			
		||||
    
 | 
			
		||||
    qrCode.value = ''
 | 
			
		||||
    if (scanQrCodeRef.value) {
 | 
			
		||||
        scanQrCodeRef.value.scanQrCode()
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -337,23 +337,28 @@ const getMaInfoScan = () => {
 | 
			
		|||
    url: '/material/back_apply_info/getMachine',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    data: param,
 | 
			
		||||
    success: (res) => {
 | 
			
		||||
    success: async (res) => {
 | 
			
		||||
        console.log(res)
 | 
			
		||||
        await getMaCodeList();
 | 
			
		||||
        if(!res.data.code){
 | 
			
		||||
            res = JSON.parse(decryptWithSM4(res.data))
 | 
			
		||||
        }else{
 | 
			
		||||
            res = JSON.parse(res.data)
 | 
			
		||||
            res = res.data
 | 
			
		||||
        }
 | 
			
		||||
        console.log("xxxxxxxxxxxxxxxx",res)
 | 
			
		||||
        if (res.code == 200) {
 | 
			
		||||
            
 | 
			
		||||
            console.log(res)
 | 
			
		||||
            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
 | 
			
		||||
            materialName.value = res.data[0].typeModelName
 | 
			
		||||
            maStatusName.value = res.data[0].maStatusName
 | 
			
		||||
            maId.value = res.data[0].maId
 | 
			
		||||
            typeId.value = res.data[0].typeId
 | 
			
		||||
            flag.value = true
 | 
			
		||||
        }else{
 | 
			
		||||
            uni.showModal({
 | 
			
		||||
                title: '错误提示',
 | 
			
		||||
| 
						 | 
				
			
			@ -480,7 +485,9 @@ const submitCode = () => {
 | 
			
		|||
                    // uni.navigateBack({
 | 
			
		||||
                    // 	delta: 1 // 返回到已存在的页面
 | 
			
		||||
                    // });
 | 
			
		||||
                    scanStart()
 | 
			
		||||
                    if(flag.value){
 | 
			
		||||
                        scanStart()
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                    uni.showToast({ title: res.msg, icon: 'none' })
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -173,7 +173,6 @@ const getCodeDeviceInfoData = async () => {
 | 
			
		|||
            })
 | 
			
		||||
        }
 | 
			
		||||
    })
 | 
			
		||||
    console.log(res)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 标签变更处理
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue