|
@@ -88,7 +88,16 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+<!-- 拍照上传部分 -->
|
|
|
+ <view class="title unfit-title uni-row">
|
|
|
+ <text>拍照上传</text>
|
|
|
+ </view>
|
|
|
+ <view class=" uni-row" style="padding: 24rpx;
|
|
|
+ margin: 0 16rpx;
|
|
|
+ background-color: #ffffff;
|
|
|
+ border-radius: 12rpx;">
|
|
|
+ <uni-file-picker v-model="photoList" :readonly="!editable()" return-type="array" :image-styles="imageStyles" @select="select" file-mediatype="image" class="my-files" @delete="handleDeletedPhoto" ></uni-file-picker>
|
|
|
+ </view>
|
|
|
<!-- 咨询部分 -->
|
|
|
<view class="title unfit-title uni-row">
|
|
|
<text>咨询</text>
|
|
@@ -171,6 +180,7 @@
|
|
|
import {
|
|
|
getInspectionStandardsList
|
|
|
} from '@/api/business/inspectionStandards.js'
|
|
|
+ import {getURL} from '@/api/sys/user.js'
|
|
|
const lot = ref({})
|
|
|
const isEventTriggered = ref(false); // 创建一个标志位
|
|
|
const unfitInfos = ref([]) //废品信息
|
|
@@ -186,6 +196,15 @@
|
|
|
examiningNum: 0,
|
|
|
status: 0,
|
|
|
})
|
|
|
+ const urlList = JSON.parse(uni.getStorageSync('baseUrl'))
|
|
|
+ const webHost = ref(urlList.baseUrl)
|
|
|
+ const photoList = ref([])
|
|
|
+ const selected = ref([]);
|
|
|
+ const selectedPhotos = ref([])
|
|
|
+ const imageStyles = {
|
|
|
+ width:60,
|
|
|
+ height:60
|
|
|
+ }
|
|
|
const initStatus = ref(0)
|
|
|
const editable = () => {
|
|
|
// if (store.userInfo.permissions.some(item => item === 'business:outsourcedInspection:edit')) {
|
|
@@ -245,7 +264,7 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
- onShow(() => {
|
|
|
+ onLoad(() => {
|
|
|
uni.$off('addWasteInfoEvent');
|
|
|
console.log(store.processInspection)
|
|
|
console.log(flag.value)
|
|
@@ -263,6 +282,10 @@
|
|
|
unfitInfos.value = res.data.processInspectionDetails;
|
|
|
initStatus.value = res.data.status
|
|
|
consultations.value = res.data.dayworkItemConsults;
|
|
|
+ selectedPhotos.value = res.data.processInspectionPictureList
|
|
|
+ photoList.value = res.data.processInspectionPictureList.map(item => {
|
|
|
+ return { ...item, url: webHost.value + item.url };
|
|
|
+ });
|
|
|
console.log("res", res);
|
|
|
console.log(processInspecion.value)
|
|
|
//是否已经移交仪器室
|
|
@@ -310,6 +333,32 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ function upLoadImageHandler(arg) {
|
|
|
+ console.log(arg)
|
|
|
+ getURL(arg).then(res =>{
|
|
|
+ let data = JSON.parse(res)
|
|
|
+ selectedPhotos.value.push({
|
|
|
+ url:data.fileName,
|
|
|
+ pictureName:data.originalFilename
|
|
|
+ })
|
|
|
+ console.log(selectedPhotos.value)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ function select (e) {
|
|
|
+ console.log(e)
|
|
|
+ const {
|
|
|
+ tempFilePaths,
|
|
|
+ tempFiles
|
|
|
+ } = e
|
|
|
+ tempFiles.forEach((item,index)=>{
|
|
|
+ upLoadImageHandler({ filePath: tempFilePaths[index],name:item.name})
|
|
|
+ })
|
|
|
+ }
|
|
|
+ function handleDeletedPhoto(e) {
|
|
|
+ let fileName = selectedPhotos.value.map(info => info.name)
|
|
|
+ let index = fileName.findIndex(name => name === e.tempFile.name);
|
|
|
+ selectedPhotos.value.splice(index,1)
|
|
|
+ }
|
|
|
function handleDrawingMenu(){
|
|
|
// 对 technologicalProcessDetailId 进行URL编码
|
|
|
var encodedId = encodeURIComponent(processInspecion.value.lot.productId);
|
|
@@ -432,6 +481,7 @@
|
|
|
processInspecion.value.user = store.userInfo;
|
|
|
processInspecion.value.inspectionCarrierId = processInspecion.value.lot.inspectionCarrierId
|
|
|
processInspecion.value.inspectionCarrierCode = processInspecion.value.lot.inspectionCarrierCode
|
|
|
+ processInspecion.value.processInspectionPictureList = selectedPhotos.value
|
|
|
console.log(processInspecion.value)
|
|
|
if(processInspecion.value.flag) {
|
|
|
//打开选择仪器室的弹窗
|
|
@@ -836,5 +886,14 @@ input:disabled {
|
|
|
background-color: #aaaaff !important;
|
|
|
color: #ccc !important; /* 假设您想要设置文本颜色 */
|
|
|
}
|
|
|
+ .my-files {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+
|
|
|
+ :deep(.uni-file-picker__container) {
|
|
|
+ flex-direction: row;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
</style>
|