|
@@ -191,7 +191,8 @@
|
|
|
<view class="item-info uni-row"> <text class="label">检查员:</text>
|
|
|
<text class="label right ">{{ item['reviewerName'] }}</text>
|
|
|
</view>
|
|
|
- <view v-if="item.processInspectionDetails && item.processInspectionDetails.length>0" v-for="(info, index) in item.processInspectionDetails" :key="index">
|
|
|
+ <view v-if="item.processInspectionDetails && item.processInspectionDetails.length>0"
|
|
|
+ v-for="(info, index) in item.processInspectionDetails" :key="index">
|
|
|
<view class="item-info uni-row">
|
|
|
<text class="label">检测项目:</text>
|
|
|
<text class="label right">{{ info['checkStandard']}}</text>
|
|
@@ -206,13 +207,16 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 拍照上传部分 -->
|
|
|
- <view v-if="item.processInspectionPictureList && item.processInspectionPictureList.length>0" class="item-info uni-row">
|
|
|
- <text class="label">拍照上传:</text>
|
|
|
- <text class=" label right" >
|
|
|
- <uni-file-picker v-model="item.processInspectionPictureList" :readonly="true" return-type="array" :image-styles="imageStyles" file-mediatype="image" class="my-files" ></uni-file-picker>
|
|
|
- </text>
|
|
|
- </view>
|
|
|
-
|
|
|
+ <view v-if="item.processInspectionPictureList && item.processInspectionPictureList.length>0"
|
|
|
+ class="item-info uni-row">
|
|
|
+ <text class="label">拍照上传:</text>
|
|
|
+ <text class=" label right">
|
|
|
+ <uni-file-picker v-model="item.processInspectionPictureList" :readonly="true"
|
|
|
+ return-type="array" :image-styles="imageStyles" file-mediatype="image"
|
|
|
+ class="my-files"></uni-file-picker>
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+
|
|
|
<view v-for="(data, index) in item.dayworkItemConsults" :key="index">
|
|
|
<view class="item-info uni-row">
|
|
|
<text class="label">咨询信息:</text>
|
|
@@ -306,16 +310,23 @@
|
|
|
</scroll-view>
|
|
|
</uni-drawer>
|
|
|
</scroll-view>
|
|
|
+ <!-- <view class="bottom-btn-container uni-row">
|
|
|
+ <button class="bottom-btn" @click="init()">扫码查询</button>
|
|
|
+ </view>
|
|
|
+ <dialog-selectLot ref="selectLotDialog" @submit="handleDoIt" /> -->
|
|
|
+
|
|
|
<view class="bottom-btn-container uni-row">
|
|
|
<button class="bottom-btn" @click="init()">扫码查询</button>
|
|
|
</view>
|
|
|
<dialog-selectLot ref="selectLotDialog" @submit="handleDoIt" />
|
|
|
+ <QrScanner v-if="showQrCodeReader" @decode="onDecodeHandler" @close="qrReaderClose" />
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import {
|
|
|
ref
|
|
|
} from 'vue'
|
|
|
+ import QrScanner from '../vueQrCode/index.vue'
|
|
|
import {
|
|
|
onLoad,
|
|
|
onReady,
|
|
@@ -342,6 +353,7 @@
|
|
|
const scrollTop = ref(0)
|
|
|
// scrollToId 默认值为空
|
|
|
const scrollToId = ref('')
|
|
|
+ const showQrCodeReader = ref(false);
|
|
|
const selectLotDialog = ref(null)
|
|
|
const selectedInfo = ref({})
|
|
|
const curProcessAfte = ref([])
|
|
@@ -356,9 +368,9 @@
|
|
|
const urlList = JSON.parse(uni.getStorageSync('baseUrl'))
|
|
|
const webHost = ref(urlList.baseUrl)
|
|
|
const imageStyles = {
|
|
|
- width:50,
|
|
|
- height:50
|
|
|
- }
|
|
|
+ width: 50,
|
|
|
+ height: 50
|
|
|
+ }
|
|
|
// 查询主对象
|
|
|
let query = null
|
|
|
// 定义tab2的【SelectorQuery】对象
|
|
@@ -375,7 +387,8 @@
|
|
|
})
|
|
|
|
|
|
function init() {
|
|
|
- handleScanCode()
|
|
|
+ showQrCodeReader.value = true;
|
|
|
+ // handleScanCode()
|
|
|
}
|
|
|
onReady(() => {
|
|
|
query = uni.createSelectorQuery().in(this)
|
|
@@ -397,76 +410,119 @@
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
- //扫码
|
|
|
- function handleScanCode() {
|
|
|
- //引入原生插件
|
|
|
- const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
|
|
|
- if (mpaasScanModule) {
|
|
|
- // 调用插件的 mpaasScan 方法
|
|
|
- mpaasScanModule.mpaasScan({
|
|
|
- // 扫码识别类型,参数可多选,qrCode、barCode,
|
|
|
- // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
|
|
|
- scanType: ["qrCode", "barCode"],
|
|
|
- // 是否隐藏相册,默认false不隐藏
|
|
|
- hideAlbum: false,
|
|
|
- },
|
|
|
- (ret) => {
|
|
|
- console.log(ret);
|
|
|
- let vehicleObj = {
|
|
|
- carrierCode: ret.resp_result
|
|
|
- };
|
|
|
- if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
|
|
|
- uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: "请扫载具码",
|
|
|
- duration: 1000
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- getDayworkCarrierByCarrierCode({
|
|
|
- carrierCode: vehicleObj.carrierCode,
|
|
|
- }).then(response => {
|
|
|
- if (response.code == 200) {
|
|
|
- if (response.data.length > 0) {
|
|
|
- if (response.data.length > 1) {
|
|
|
- selectLotDialog.value.open(response.data);
|
|
|
- } else {
|
|
|
- handleDoIt(response.data[0])
|
|
|
- }
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: "该箱未绑定批次,请重新扫码",
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- );
|
|
|
- } else {
|
|
|
- // 测试时用
|
|
|
- getDayworkCarrierByCarrierCode({
|
|
|
- carrierCode: '000762'
|
|
|
- }).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- if (res.data.length > 0) {
|
|
|
- if (res.data.length > 1) {
|
|
|
- selectLotDialog.value.open(res.data);
|
|
|
- } else {
|
|
|
- handleDoIt(res.data[0])
|
|
|
- }
|
|
|
+
|
|
|
+ //H5扫码器回调
|
|
|
+ function onDecodeHandler(data) {
|
|
|
+ showQrCodeReader.value = false;
|
|
|
+ console.log(data);
|
|
|
+ let vehicleObj = {
|
|
|
+
|
|
|
+ carrierCode: data
|
|
|
+ };
|
|
|
+ if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "请扫载具码",
|
|
|
+ duration: 1000
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ getDayworkCarrierByCarrierCode({
|
|
|
+ carrierCode: vehicleObj.carrierCode,
|
|
|
+ }).then(response => {
|
|
|
+ if (response.code == 200) {
|
|
|
+ if (response.data.length > 0) {
|
|
|
+ if (response.data.length > 1) {
|
|
|
+ selectLotDialog.value.open(response.data);
|
|
|
} else {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: "该箱未绑定批次,请重新扫码",
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
+ handleDoIt(response.data[0])
|
|
|
}
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: "该箱未绑定批次,请重新扫码",
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //H5扫码器关闭
|
|
|
+ function qrReaderClose() {
|
|
|
+ showQrCodeReader.value = false;
|
|
|
}
|
|
|
+ //扫码
|
|
|
+ // function handleScanCode() {
|
|
|
+ // //引入原生插件
|
|
|
+ // const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
|
|
|
+ // if (mpaasScanModule) {
|
|
|
+ // // 调用插件的 mpaasScan 方法
|
|
|
+ // mpaasScanModule.mpaasScan({
|
|
|
+ // // 扫码识别类型,参数可多选,qrCode、barCode,
|
|
|
+ // // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
|
|
|
+ // scanType: ["qrCode", "barCode"],
|
|
|
+ // // 是否隐藏相册,默认false不隐藏
|
|
|
+ // hideAlbum: false,
|
|
|
+ // },
|
|
|
+ // (ret) => {
|
|
|
+ // console.log(ret);
|
|
|
+ // let vehicleObj = {
|
|
|
+ // carrierCode: ret.resp_result
|
|
|
+ // };
|
|
|
+ // if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
|
|
|
+ // uni.showToast({
|
|
|
+ // icon: "none",
|
|
|
+ // title: "请扫载具码",
|
|
|
+ // duration: 1000
|
|
|
+ // })
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // getDayworkCarrierByCarrierCode({
|
|
|
+ // carrierCode: vehicleObj.carrierCode,
|
|
|
+ // }).then(response => {
|
|
|
+ // if (response.code == 200) {
|
|
|
+ // if (response.data.length > 0) {
|
|
|
+ // if (response.data.length > 1) {
|
|
|
+ // selectLotDialog.value.open(response.data);
|
|
|
+ // } else {
|
|
|
+ // handleDoIt(response.data[0])
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // uni.showToast({
|
|
|
+ // icon: 'none',
|
|
|
+ // title: "该箱未绑定批次,请重新扫码",
|
|
|
+ // duration: 2000
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // );
|
|
|
+ // } else {
|
|
|
+ // // 测试时用
|
|
|
+ // getDayworkCarrierByCarrierCode({
|
|
|
+ // carrierCode: '000762'
|
|
|
+ // }).then(res => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // if (res.data.length > 0) {
|
|
|
+ // if (res.data.length > 1) {
|
|
|
+ // selectLotDialog.value.open(res.data);
|
|
|
+ // } else {
|
|
|
+ // handleDoIt(res.data[0])
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // uni.showToast({
|
|
|
+ // icon: 'none',
|
|
|
+ // title: "该箱未绑定批次,请重新扫码",
|
|
|
+ // duration: 2000
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
function handleDoIt(data) {
|
|
|
dayworkId.value = data.value
|
|
@@ -512,9 +568,10 @@
|
|
|
dayworkId: dayworkId.value
|
|
|
}).then(response => {
|
|
|
if (response.code == 200) {
|
|
|
- response.data.forEach(item =>{
|
|
|
- if(item.processInspectionPictureList && item.processInspectionPictureList.length>0){
|
|
|
- item.processInspectionPictureList.forEach(i=>{
|
|
|
+ response.data.forEach(item => {
|
|
|
+ if (item.processInspectionPictureList && item.processInspectionPictureList.length >
|
|
|
+ 0) {
|
|
|
+ item.processInspectionPictureList.forEach(i => {
|
|
|
i.url = webHost.value + i.url
|
|
|
})
|
|
|
}
|
|
@@ -724,13 +781,14 @@
|
|
|
background-color: #1684fc;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.my-files {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
-
|
|
|
+
|
|
|
:deep(.uni-file-picker__container) {
|
|
|
- flex-direction: row;
|
|
|
-
|
|
|
+ flex-direction: row;
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</style>
|