diff --git a/src/pages/materialsStation/toolsLease/ocrScan/ocrOutScan.vue b/src/pages/materialsStation/toolsLease/ocrScan/ocrOutScan.vue index ed8449e..c8d2899 100644 --- a/src/pages/materialsStation/toolsLease/ocrScan/ocrOutScan.vue +++ b/src/pages/materialsStation/toolsLease/ocrScan/ocrOutScan.vue @@ -740,21 +740,16 @@ export default { title: '加载中...', mask: true, }) - let res = null - if (this.queryParams?.jiJuType == 2) { - res = await getDeviceListAPINew(this.queryCodeParams.maCode) - } else { - res = await getDeviceListAPI(this.queryCodeParams.maCode) - } + const res = await getDeviceListAPINew({ maCode: this.queryCodeParams.maCode }) console.log('🚀 ~ getCode ~ res:', res) if (res.code === 200 && res.data && res.data.length > 0) { - this.optionList = response.data.map((option) => ({ + this.optionList = res.data.map((option) => ({ value: option.maId, text: option.maCode, })) - if (response.data.length === 1) { - this.codeData = response.data[0] + if (res.data.length === 1) { + this.codeData = res.data[0] } } else { uni.showToast({ @@ -774,12 +769,7 @@ export default { async changeTag() { if (!this.queryCodeParams.maId) return try { - let res = null - if (this.queryParams?.jiJuType == 2) { - res = await getDeviceListAPINew({ maId: this.queryCodeParams.maId }) - } else { - res = await getDeviceListAPI({ maId: this.queryCodeParams.maId }) - } + const res = await getDeviceListAPINew({ maId: this.queryCodeParams.maId }) if (res.data && res.data.length !== 0) { this.codeData = res.data[0] } diff --git a/src/pages/picking/outbound/codeOutScan.vue b/src/pages/picking/outbound/codeOutScan.vue index ed8449e..c8d2899 100644 --- a/src/pages/picking/outbound/codeOutScan.vue +++ b/src/pages/picking/outbound/codeOutScan.vue @@ -740,21 +740,16 @@ export default { title: '加载中...', mask: true, }) - let res = null - if (this.queryParams?.jiJuType == 2) { - res = await getDeviceListAPINew(this.queryCodeParams.maCode) - } else { - res = await getDeviceListAPI(this.queryCodeParams.maCode) - } + const res = await getDeviceListAPINew({ maCode: this.queryCodeParams.maCode }) console.log('🚀 ~ getCode ~ res:', res) if (res.code === 200 && res.data && res.data.length > 0) { - this.optionList = response.data.map((option) => ({ + this.optionList = res.data.map((option) => ({ value: option.maId, text: option.maCode, })) - if (response.data.length === 1) { - this.codeData = response.data[0] + if (res.data.length === 1) { + this.codeData = res.data[0] } } else { uni.showToast({ @@ -774,12 +769,7 @@ export default { async changeTag() { if (!this.queryCodeParams.maId) return try { - let res = null - if (this.queryParams?.jiJuType == 2) { - res = await getDeviceListAPINew({ maId: this.queryCodeParams.maId }) - } else { - res = await getDeviceListAPI({ maId: this.queryCodeParams.maId }) - } + const res = await getDeviceListAPINew({ maId: this.queryCodeParams.maId }) if (res.data && res.data.length !== 0) { this.codeData = res.data[0] }