|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import { reactive } from "vue"; |
|
|
import { reactive } from "vue"; |
|
|
import { onLoad,onShow } from "@dcloudio/uni-app"; |
|
|
|
|
|
|
|
|
import { onLoad } from "@dcloudio/uni-app"; |
|
|
import { |
|
|
import { |
|
|
navTo |
|
|
navTo |
|
|
} from "@/utils/utils" |
|
|
} from "@/utils/utils" |
|
|
|
|
|
|
|
|
// 31发票 32月结单查询 |
|
|
// 31发票 32月结单查询 |
|
|
|
|
|
|
|
|
onLoad((options) => { |
|
|
onLoad((options) => { |
|
|
console.log("options",options) |
|
|
|
|
|
if(options.params){ |
|
|
if(options.params){ |
|
|
let params=JSON.parse(decodeURIComponent(options.params)) |
|
|
|
|
|
// 登录回来 |
|
|
|
|
|
console.log("options",params) |
|
|
|
|
|
state.type = params.type |
|
|
|
|
|
state.name = params.name |
|
|
|
|
|
state.vehicleId = params.vehicleId |
|
|
|
|
|
state.deptShortName = params.deptShortName |
|
|
|
|
|
state.userType = params.userType |
|
|
|
|
|
state.userIdNum = params.userIdNum |
|
|
|
|
|
state.mobile = params.mobile |
|
|
|
|
|
|
|
|
let params=JSON.parse(decodeURIComponent(options.params)) |
|
|
|
|
|
// 登录回来 |
|
|
|
|
|
console.log("options",params) |
|
|
|
|
|
state.type = params.type |
|
|
|
|
|
state.name = params.name |
|
|
|
|
|
state.vehicleId = params.vehicleId |
|
|
|
|
|
state.deptShortName = params.deptShortName |
|
|
|
|
|
state.userType = params.userType |
|
|
|
|
|
state.userIdNum = params.userIdNum |
|
|
|
|
|
state.mobile = params.mobile |
|
|
|
|
|
judge() |
|
|
|
|
|
}else{ |
|
|
|
|
|
// 不需要登录 |
|
|
|
|
|
state.type = options.type |
|
|
|
|
|
state.name = options.name |
|
|
|
|
|
state.vehicleId = options.vehicleId |
|
|
|
|
|
state.deptShortName = options.deptShortName |
|
|
|
|
|
state.userType = options.userType |
|
|
|
|
|
state.userIdNum = options.userIdNum |
|
|
|
|
|
state.mobile = options.mobile |
|
|
|
|
|
console.log("options", options) |
|
|
|
|
|
if((options.userType && state.userIdNum) || (options.userType && state.mobile)){ |
|
|
|
|
|
// 登录情况 |
|
|
|
|
|
silentLogin().then(() => { |
|
|
|
|
|
judge() |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
let obj={ |
|
|
|
|
|
type:state.type, |
|
|
|
|
|
name:state.name, |
|
|
|
|
|
vehicleId:state.vehicleId, |
|
|
|
|
|
deptShortName:state.deptShortName, |
|
|
|
|
|
userType:state.userType, |
|
|
|
|
|
userIdNum:state.userIdNum, |
|
|
|
|
|
mobile:state.mobile, |
|
|
|
|
|
} |
|
|
|
|
|
const params = encodeURIComponent(JSON.stringify(obj)) |
|
|
|
|
|
// 没登录情况 |
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
url: `/login/login?back=2¶ms=${params}`, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
// 判断哪些需要跳转 |
|
|
|
|
|
const judge=()=>{ |
|
|
|
|
|
if(state.type == "9" || state.type == "20" || state.type == "23" || state.type == "25" || state.type == "28" || state.type == "31"){ |
|
|
|
|
|
jump() |
|
|
|
|
|
}else{ |
|
|
quanCheckActionTrue().then((item : any) => { |
|
|
quanCheckActionTrue().then((item : any) => { |
|
|
console.log("item====", item, item.data.length) |
|
|
console.log("item====", item, item.data.length) |
|
|
if (item.data.length == 1) { |
|
|
if (item.data.length == 1) { |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}, 1500) |
|
|
}, 1500) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}else{ |
|
|
|
|
|
// 不需要登录 |
|
|
|
|
|
state.type = options.type |
|
|
|
|
|
state.name = options.name |
|
|
|
|
|
state.vehicleId = options.vehicleId |
|
|
|
|
|
state.deptShortName = options.deptShortName |
|
|
|
|
|
state.userType = options.userType |
|
|
|
|
|
state.userIdNum = options.userIdNum |
|
|
|
|
|
state.mobile = options.mobile |
|
|
|
|
|
console.log("options", options) |
|
|
|
|
|
if((options.userType && state.userIdNum) || options.userType && state.mobile){ |
|
|
|
|
|
// 登录情况 |
|
|
|
|
|
silentLogin().then(() => { |
|
|
|
|
|
quanCheckActionTrue().then((item : any) => { |
|
|
|
|
|
console.log("item====", item, item.data.length) |
|
|
|
|
|
if (item.data.length == 1) { |
|
|
|
|
|
state.id = item.data[0]['id'] |
|
|
|
|
|
state.orderId = item.data[0]['orderId'] |
|
|
|
|
|
console.log(item) |
|
|
|
|
|
jump() |
|
|
|
|
|
} else { |
|
|
|
|
|
msg('暂无车辆') |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
uni.switchTab({ |
|
|
|
|
|
url: "/pages/index/index" |
|
|
|
|
|
}) |
|
|
|
|
|
}, 1500) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
let obj={ |
|
|
|
|
|
type:state.type, |
|
|
|
|
|
name:state.name, |
|
|
|
|
|
vehicleId:state.vehicleId, |
|
|
|
|
|
deptShortName:state.deptShortName, |
|
|
|
|
|
userType:state.userType, |
|
|
|
|
|
userIdNum:state.userIdNum, |
|
|
|
|
|
mobile:state.mobile, |
|
|
|
|
|
} |
|
|
|
|
|
const params = encodeURIComponent(JSON.stringify(obj)) |
|
|
|
|
|
// 没登录情况 |
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
url: `/login/login?back=2¶ms=${params}`, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
const silentLogin = () => { |
|
|
const silentLogin = () => { |
|
|
if (state.userType == "1") { |
|
|
if (state.userType == "1") { |
|
|
var data = { |
|
|
var data = { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
<style scoped> |
|
|
|
|
|
|
|
|
</style> |
|
|
|
|
|
|
|
|
</style> |