电子合格证
This commit is contained in:
parent
1eeae6b949
commit
b9116e4010
|
|
@ -241,15 +241,19 @@ const props = defineProps({
|
|||
type: String,
|
||||
default: '',
|
||||
},
|
||||
maId: {
|
||||
type: [String, Number],
|
||||
default: '',
|
||||
},
|
||||
})
|
||||
|
||||
// 监听 props.maCode 值变化
|
||||
// 监听 props.maId 值变化
|
||||
watch(
|
||||
() => props.maCode,
|
||||
() => props.maId,
|
||||
(newValue) => {
|
||||
console.log('newValue', newValue)
|
||||
if (newValue) {
|
||||
maCodeTwo.value = newValue
|
||||
maCodeTwo.value = props.maCode
|
||||
changeTag()
|
||||
}
|
||||
},
|
||||
|
|
@ -265,7 +269,7 @@ const changeTag = async () => {
|
|||
if (!maCodeTwo.value) return
|
||||
|
||||
try {
|
||||
const response = await getListTag({ maCode: maCodeTwo.value })
|
||||
const response = await getListTag({ maCode: maCodeTwo.value, maId: props.maId })
|
||||
if (response.data && response.data.length !== 0) {
|
||||
tagInfo.value = response.data[0]
|
||||
isJj.value = tagInfo.value.isJj
|
||||
|
|
@ -282,6 +286,9 @@ const changeTag = async () => {
|
|||
|
||||
drawStamp(stampText, companyName, canvasId)
|
||||
})
|
||||
} else {
|
||||
console.log('未找到标签信息')
|
||||
isJj.value = null
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取标签信息失败', error)
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<ElectronicSeal :maCode="formData?.maCode" />
|
||||
<ElectronicSeal :maCode="formData?.maCode" :maId="formData?.maId" />
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@
|
|||
</uni-forms>
|
||||
</view>
|
||||
</view>
|
||||
<ElectronicSeal v-if="codeData?.maCode && !showCamera" :maCode="codeData?.maCode" />
|
||||
<ElectronicSeal v-if="codeData?.maCode && !showCamera" :maCode="codeData?.maCode" :maId="codeData?.maId" />
|
||||
|
||||
<!-- 相机预览页面 -->
|
||||
<view v-if="showCamera" class="camera-container">
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
|
||||
</view>
|
||||
|
||||
<ElectronicSeal :maCode="codeData?.maCode" />
|
||||
<ElectronicSeal :maCode="codeData?.maCode" :maId="codeData?.maId" />
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<div v-if="optionList.length > 0" class="select-container">
|
||||
<uni-data-select
|
||||
v-model="maCodeTwo"
|
||||
v-model="maId"
|
||||
:localdata="optionList"
|
||||
@change="changeTag"
|
||||
placeholder="请选择相关联编号"
|
||||
|
|
@ -245,6 +245,7 @@ import { getListTag, getSelectionList } from '@/services/stquery/stquery.js'
|
|||
// 状态管理
|
||||
const code = ref<string>('')
|
||||
const isJj = ref<number | null>(null)
|
||||
const maId = ref<string | number>('')
|
||||
const maCodeTwo = ref<string>('')
|
||||
const optionList = ref<Array<{ value: string; text: string }>>([])
|
||||
const tagInfo = ref({
|
||||
|
|
@ -279,7 +280,7 @@ const handQuery = () => {
|
|||
getSelectionList({ maCode: code.value }).then((response) => {
|
||||
if (response.data && response.data.length !== 0) {
|
||||
optionList.value = response.data.map((option) => ({
|
||||
value: option.maCode,
|
||||
value: option.maId,
|
||||
text: option.maCode,
|
||||
}))
|
||||
} else {
|
||||
|
|
@ -293,11 +294,17 @@ const handQuery = () => {
|
|||
}
|
||||
|
||||
// 标签变更处理
|
||||
const changeTag = async () => {
|
||||
const changeTag = async (e) => {
|
||||
console.log('🚀 ~ changeTag ~ e:', e)
|
||||
// 根据 maId 获取optionList.value maCode
|
||||
maCodeTwo.value = optionList.value.find(
|
||||
(item) => item.value === maId.value,
|
||||
)?.text || ''
|
||||
console.log('🚀 ~ changeTag ~ maCodeTwo:', maCodeTwo.value)
|
||||
if (!maCodeTwo.value) return
|
||||
|
||||
try {
|
||||
const response = await getListTag({ maCode: maCodeTwo.value })
|
||||
const response = await getListTag({ maCode: maCodeTwo.value, maId: maId.value })
|
||||
if (response.data && response.data.length !== 0) {
|
||||
tagInfo.value = response.data[0]
|
||||
isJj.value = tagInfo.value.isJj
|
||||
|
|
|
|||
Loading…
Reference in New Issue