退料接收问题修复
This commit is contained in:
parent
2612342576
commit
d9407e724c
|
|
@ -211,7 +211,7 @@ const getMaInfoScan = () => {
|
|||
id: taskInfo.value.id,
|
||||
}
|
||||
uni.request({
|
||||
url: '/material/back_apply_info/getMachine',
|
||||
url: '/material/back_apply_info/getMachineTwo',
|
||||
method: 'get',
|
||||
data: param,
|
||||
success: async (res) => {
|
||||
|
|
|
|||
|
|
@ -49,6 +49,16 @@
|
|||
</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<div v-if="optionList.length > 1" style="margin-top:10px">
|
||||
<uni-data-select
|
||||
v-model="maId"
|
||||
:localdata="optionList"
|
||||
@change="changeTag"
|
||||
placeholder="请选择相关设备"
|
||||
:searchable="false"
|
||||
filterable
|
||||
></uni-data-select>
|
||||
</div>
|
||||
</view>
|
||||
<view class="table-list-item">
|
||||
<scroll-view class="scroll-view" scroll-y="true" style="height: 500rpx">
|
||||
|
|
@ -107,6 +117,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getCodeTwoAPI,
|
||||
} from '../../services/back.js'
|
||||
import { decryptWithSM4, encryptWithSM4, hashWithSM3AndSalt } from '@/utils/sm'
|
||||
import PreviewImg from '@/components/PreviewImg/index.vue'
|
||||
export default {
|
||||
|
|
@ -127,6 +140,8 @@ export default {
|
|||
imgUrl: '',
|
||||
isRadioCheck: true, // 初始状态为完好
|
||||
imgList: [],
|
||||
optionList: [], // 下拉列表数据
|
||||
maId: null, // 选中的 maId
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
|
@ -227,7 +242,7 @@ export default {
|
|||
}
|
||||
console.log(param)
|
||||
uni.request({
|
||||
url: '/material/back_apply_info/getMachine',
|
||||
url: '/material/back_apply_info/getMachineTwo',
|
||||
method: 'get',
|
||||
data: param,
|
||||
success: (res) => {
|
||||
|
|
@ -237,15 +252,23 @@ export default {
|
|||
res = res.data
|
||||
}
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
if (res.data && res.data.length > 0) {
|
||||
if (res.code == 200 ) {
|
||||
if (res.data && res.data.length == 1) {
|
||||
this.optionList = null
|
||||
this.codeData = res.data[0]
|
||||
}else if(res.data && res.data.length > 1){
|
||||
this.optionList = res.data.map(item => ({
|
||||
text: item.materialType +' / '+ item.typeName +' / '+ item.materialName +' / '+ item.maCode,
|
||||
value: item.maId }))
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
uni.showModal({
|
||||
title: '错误提示',
|
||||
content: res.msg,
|
||||
showCancel: false, // 不显示取消按钮
|
||||
confirmText: '关闭',
|
||||
})
|
||||
|
||||
}
|
||||
// if(res.rows&&res.rows.length>0){
|
||||
// this.codeData=res.rows[0];
|
||||
|
|
@ -261,6 +284,33 @@ export default {
|
|||
},
|
||||
})
|
||||
},
|
||||
|
||||
// 标签变更处理
|
||||
async changeTag(){
|
||||
let param = {
|
||||
maId: this.maId,
|
||||
unitId: this.queryParams.unitId,
|
||||
proId: this.queryParams.proId,
|
||||
id: this.queryParams.id,
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await getCodeTwoAPI(param)
|
||||
if (response.data && response.data.length !== 0) {
|
||||
this.codeData = response.data[0]
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取编号信息失败", error)
|
||||
uni.showModal({
|
||||
title: '错误提示',
|
||||
content: response.msg,
|
||||
showCancel: false, // 不显示取消按钮
|
||||
confirmText: '关闭',
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
//上传
|
||||
uploadImg() {
|
||||
const count = 3 - this.imgList.length
|
||||
|
|
|
|||
|
|
@ -334,4 +334,13 @@ export const getMachineByIdListQrScanApi = (data) => {
|
|||
url: '/material/back_apply_info/selectMachineByIdListQrScan',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 编码退料下拉
|
||||
export const getCodeTwoAPI = (data) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material/back_apply_info/getMachineTwoList',
|
||||
data,
|
||||
})
|
||||
}
|
||||
Loading…
Reference in New Issue