|
|
@@ -28,7 +28,7 @@
|
|
|
<span class="fontSize14 bold">部门:</span>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <!-- <span class="fontSize14">{{ details?.deptName }}</span> -->
|
|
|
+ <span class="fontSize14">{{ details?.deptName }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="flex mb20">
|
|
|
@@ -125,6 +125,8 @@ const myAppointApi = useMyAppointApi()
|
|
|
import instAppointApi from '/@/api/instr/instAppoint'
|
|
|
import { useInstrApi } from '/@/api/instr'
|
|
|
const instApi = useInstrApi()
|
|
|
+import { useUserApi } from '/@/api/system/user'
|
|
|
+const userApi = useUserApi()
|
|
|
import to from 'await-to-js'
|
|
|
import moment from 'moment'
|
|
|
import { showConfirmDialog, showNotify } from 'vant'
|
|
|
@@ -166,7 +168,17 @@ export default {
|
|
|
const [err, res] = await to(myAppointApi.appointDetails({ ...params }))
|
|
|
if (err) return
|
|
|
if (res.code == 200 && res.data) {
|
|
|
- this.details = res.data
|
|
|
+ let detailsData = res.data
|
|
|
+ if (detailsData.userId) {
|
|
|
+ const [userErr, userRes] = await to(userApi.getUserInfo({ id: detailsData.userId }))
|
|
|
+ if (!userErr && userRes?.code === 200 && userRes.data) {
|
|
|
+ detailsData = {
|
|
|
+ ...detailsData,
|
|
|
+ deptName: userRes.data.userInfo.deptName || '-'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.details = detailsData
|
|
|
}
|
|
|
console.log(this.details)
|
|
|
},
|
|
|
@@ -184,7 +196,7 @@ export default {
|
|
|
if (res?.data?.config.shortWarningEnable) {
|
|
|
const shortWraningTime = this.getShortWraningTime(res?.data?.config.shortWarning, res?.data?.config.shortWarningUnit)
|
|
|
if (useTime > shortWraningTime) {
|
|
|
- if (this.details.controlMode === '30') {
|
|
|
+ if (this.details.controlMode === '30' || this.details.controlMode === '60') {
|
|
|
this.handleBluetoothOffLine()
|
|
|
} else {
|
|
|
this.curAppointInfo = this.details
|
|
|
@@ -201,7 +213,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
- if (this.details.controlMode === '30') {
|
|
|
+ if (this.details.controlMode === '30' || this.details.controlMode === '60') {
|
|
|
this.handleBluetoothOffLine()
|
|
|
} else {
|
|
|
this.curAppointInfo = this.details
|
|
|
@@ -219,7 +231,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- if (this.details.controlMode === '30') {
|
|
|
+ if (this.details.controlMode === '30' || this.details.controlMode === '60') {
|
|
|
this.handleBluetoothOffLine()
|
|
|
} else {
|
|
|
this.curAppointInfo = this.details
|
|
|
@@ -265,13 +277,27 @@ export default {
|
|
|
},
|
|
|
//蓝牙 重新解码函数,获取解码内容之后 执行跳转操作
|
|
|
async handleBluetoothDeCode(content) {
|
|
|
+ let terminal = ''
|
|
|
if (content.includes('id')) {
|
|
|
- const terminal = JSON.parse(content)?.terminal
|
|
|
+ terminal = JSON.parse(content)?.terminal
|
|
|
+ } else {
|
|
|
+ terminal = content
|
|
|
+ }
|
|
|
+
|
|
|
+ this.loading = true
|
|
|
+ const [codeErr, codeRes] = await to(instApi.getBlueToothCode({ terminal }))
|
|
|
+ if (codeErr) {
|
|
|
+ this.loading = false
|
|
|
+ showNotify({ type: 'danger', message: '获取蓝牙码失败,请重试' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (codeRes?.code == 200 && codeRes.data?.code) {
|
|
|
+ this.loading = false
|
|
|
const url = scanCodeWxUrl(terminal, 'EndRun')
|
|
|
window.location.href = url
|
|
|
} else {
|
|
|
- const url = scanCodeWxUrl(content, 'EndRun')
|
|
|
- window.location.href = url
|
|
|
+ this.loading = false
|
|
|
+ showNotify({ type: 'warning', message: '未获取到该设备的蓝牙配置,请联系管理员' })
|
|
|
}
|
|
|
},
|
|
|
// 计算时间转分钟
|