| | |
| | | <template> |
| | | <view class="container"> |
| | | <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> |
| | | <cu-custom :bgColor="NavBarColor" :isBack="true"> |
| | | <block slot="backText">返回</block> |
| | | <block slot="content">{{title}}</block> |
| | | </cu-custom> |
| | | <view class="container"> |
| | | <template> |
| | | <!-- 浮窗遮罩层 --> |
| | | <view v-if="showPreview" class="overlay" @tap.stop="closePreview"> |
| | | <view class="modal"> |
| | | <!-- 关闭按钮 --> |
| | | <text class="close-btn" @tap.stop="showPreview = false">×</text> |
| | | <!-- 图片展示 --> |
| | | <image :src="previewImageSrc" mode="aspectFit" class="preview-image" @error="handleImageError" |
| | | :show-menu-by-longpress="false" /> |
| | | </view> |
| | | </view> |
| | | |
| | | </template> |
| | | |
| | | <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> |
| | | <uni-group top="1"> |
| | | <view class="text-gray margin-bottom-lg">—————————— 基本信息 ——————————</view> |
| | | <view class="divider"><text>基本信息</text></view> |
| | | <!-- <view class="text-gray margin-bottom-lg">—————————— 基本信息 ——————————</view> --> |
| | | <uni-forms-item :label-width="80" name="num" label="工单号:"> |
| | | <uni-easyinput v-model="formData.orderNum" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item :label-width="80" required name="num" label="设备编号:"> |
| | | <uni-forms-item :label-width="80" name="inspectionStatus_dictText" label="工单状态:"> |
| | | <uni-easyinput v-model="formData.inspectionStatus_dictText" :disabled="true" /> |
| | | </uni-forms-item> |
| | | |
| | | <uni-forms-item :label-width="80" name="num" label="设备编号:"> |
| | | <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" |
| | | placeholder="请选择" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item :label-width="80" name="installationPosition_dictText" label="安装位置:"> |
| | | <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> |
| | | </uni-forms-item> |
| | | |
| | | <uni-forms-item :label-width="80" name="remark" label="点检日期:"> |
| | |
| | | <uni-forms-item :label-width="80" name="outNum" label="点检人:"> |
| | | <uni-easyinput v-model="formData.operator" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item :label-width="80" name="operatorPhone_dictText" label="点检人电话:"> |
| | | <uni-easyinput v-model="formData.operatorPhone_dictText" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item :label-width="80" name="formData.remark" label="备注:"> |
| | | <uni-easyinput v-model="formData.remark" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item :label-width="80" name="outNum" label="点检图片:"> |
| | | <view class="grid col-4 grid-square flex-sub"> |
| | | <view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" |
| | | :data-url="imgList[index]"> |
| | | <image :src="imgList[index]" mode="aspectFill"></image> |
| | | <view class="cu-tag bg-red radius" @tap.stop="DelImg" :data-index="index"> |
| | | <text class='cuIcon-close'></text> |
| | | </view> |
| | | </view> |
| | | <view class="solids" v-if="imgList.length<1"> |
| | | <text class='cuIcon-cameraadd'></text> |
| | | </view> |
| | | </view> |
| | | |
| | | <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" |
| | | :sourceType="sourceType" @select="select" @progress="progress" @success="success" |
| | | @fail="fail" @delete="deletea" :readonly="readonly" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="outNum" :label-width="80" label="作业指导:"> |
| | | <button class="cu-btn bg-blue" @tap="showPreview = true">查看</button> |
| | | </uni-forms-item> |
| | | </uni-group> |
| | | </uni-forms> |
| | | <view class="text-gray margin-bottom-lg">—————————— 保养项信息 ——————————</view> |
| | | |
| | | <!-- <view class="text-gray margin-bottom-lg">—————————— 保养项信息 ——————————</view> --> |
| | | <view class="divider"><text>保养项信息</text></view> |
| | | <uni-collapse> |
| | | <uni-collapse-item :show-animation="true" :accordion="true" title="查看保养项" :border="false" |
| | | title-border="none"> |
| | |
| | | |
| | | <view class="flex"> |
| | | <view class="flex-sub text-light bg-white padding-xs margin-xs radius">保养要求:</view> |
| | | <view class="flex-sub bg-white padding-xs margin-xs radius text-right" |
| | | v-if="item.itemDemand!=null && item.itemDemand.length>10"> |
| | | {{(item.itemDemand).toString().substr(0,10)+'...'}} |
| | | </view> |
| | | |
| | | <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> |
| | | <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> |
| | | {{item.itemDemand}} |
| | | </view> |
| | | </view> |
| | | <view class="flex"> |
| | | <view class="flex-sub text-light bg-white padding-xs margin-xs radius">异常是否报修:</view> |
| | | <view class="flex-sub bg-white padding-xs text-right margin-xs radius"> |
| | | <uni-data-select :localdata="item.type" v-model="item.reportFlag" |
| | | :disabled="item.istrue" /> |
| | | </view> |
| | | </view> |
| | | <view class="flex"> |
| | |
| | | @change="handleCode($event, index)" :disabled="item.istrue" /> |
| | | </view> |
| | | </view> |
| | | <view class="flex"> |
| | | <view class="flex-sub text-light bg-white padding-xs margin-xs radius">异常是否报修:</view> |
| | | <view class="flex-sub bg-white padding-xs text-right margin-xs radius"> |
| | | <uni-data-select :localdata="item.type" v-model="item.reportFlag" |
| | | :disabled="item.istrue" /> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <view class="flex"> |
| | | <view class="flex-sub text-light bg-white padding-xs margin-xs radius">异常描述:</view> |
| | |
| | | </uni-collapse> |
| | | |
| | | |
| | | <uni-forms v-show="isShowTeam" ref="form" :modelValue="ScanData" validate-trigger="bind" err-show-type="undertext"> |
| | | <uni-forms v-show="isShowTeam" ref="form" :modelValue="ScanData" validate-trigger="bind" |
| | | err-show-type="undertext"> |
| | | <uni-group top="1"> |
| | | <view class="text-gray margin-bottom-lg">—————————— 班组长确认信息 ——————————</view> |
| | | <view class="divider"><text>班组长确认信息</text></view> |
| | | <!-- <view class="text-gray margin-bottom-lg">————————班组长确认信息——————————</view> --> |
| | | <uni-forms-item :label-width="80" required name="typeName" label="处理类型:"> |
| | | <uni-data-select v-model="ScanData.typeName" :localdata="ScanData.handlingType" |
| | | @change="changehandlingType" placeholder="请选择" :disabled="isTouch" /> |
| | |
| | | mixins: [MescrollMixin], // 使用mixin |
| | | data() { |
| | | return { |
| | | isShowTeam:false, |
| | | showPreview: false, |
| | | readonly: false, |
| | | // 图片回显 |
| | | fileLists: [], |
| | | // 上传图片的样式 |
| | | imageStyles: { |
| | | width: 90, |
| | | height: 90, |
| | | }, |
| | | sourceType: ['album', 'camera'], |
| | | isShowTeam: false, |
| | | isShowBtn: true, |
| | | title: '班组长确认', |
| | | title: '', |
| | | isTouch: false, |
| | | scrollLeft: 0, |
| | | searchValue: '', |
| | |
| | | url: { |
| | | upload: "/eam/sysFiles/batch_upload", |
| | | stallList: "/eam/eamInspectionOrder/queryById", |
| | | // getEquipmentList: "eam/equipment/asyncLoadEquipment", |
| | | getStandardFile: "eam/maintenanceStandard/queryById", |
| | | getEquipmentList: 'eam/equipment/list', |
| | | BaoList: 'eam/eamInspectionOrderDetail/queryList', |
| | | approval: 'eam/eamInspectionOrder/approval' |
| | |
| | | msg2Count: 0, |
| | | msg1Title: "", |
| | | procInstId: '', |
| | | values: '' |
| | | values: '', |
| | | flag: '', |
| | | from: '', |
| | | standardId: '', |
| | | previewImageSrc: '', |
| | | todoName: '' |
| | | |
| | | |
| | | } |
| | |
| | | }, |
| | | onLoad(options) { |
| | | const annItem = JSON.parse(decodeURIComponent(options.item)); |
| | | this.id = annItem.dataId, |
| | | this.taskId = annItem.id, |
| | | this.procInstId = annItem.procInstId, |
| | | this.values = annItem.values, |
| | | this.assignee = annItem.assignee |
| | | this.flag = options.flag |
| | | if (this.flag == 'task') { |
| | | this.todoName = annItem.taskName |
| | | } else { |
| | | this.todoName = annItem.name |
| | | } |
| | | this.from = options.from |
| | | if (this.from === 'detils') { |
| | | this.id = annItem.id; |
| | | console.log(annItem.id); |
| | | } else { |
| | | this.id = annItem.dataId; |
| | | } |
| | | this.taskId = annItem.id |
| | | this.procInstId = annItem.procInstId |
| | | this.values = annItem.values |
| | | this.assignee = annItem.assignee |
| | | |
| | | }, |
| | | created() { |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | handleImageError(e) { |
| | | const icon_prefix = "/static/"; |
| | | this.previewImageSrc = icon_prefix + "icn_erro.png" |
| | | }, |
| | | changehandlingType(e) { |
| | | this.ScanData.typeName = e; |
| | | }, |
| | | closePreview() { |
| | | this.showPreview = false; |
| | | }, |
| | | ProductionTask() { |
| | | if (this.hasInspectionDateArrived()) { |
| | | if (this.ScanData.typeName == undefined || this.ScanData.typeName == null || this.ScanData.typeName == |
| | | '') { |
| | | if (this.formData.inspectionStatus == 'WAIT_CONFIRM' && this.flag != 'task') { |
| | | if (this.ScanData.typeName == undefined || this.ScanData.typeName == null || this.ScanData |
| | | .typeName == |
| | | '') { |
| | | |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: '处理类型不能为空' |
| | | }); |
| | | return false; |
| | | } |
| | | if (this.ScanData.handlingSuggestion == undefined || this.ScanData.handlingSuggestion == null || this |
| | | .ScanData.handlingSuggestion == |
| | | '') { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: '处理类型不能为空' |
| | | }); |
| | | return false; |
| | | } |
| | | if (this.ScanData.handlingSuggestion == undefined || this.ScanData.handlingSuggestion == |
| | | null || |
| | | this |
| | | .ScanData.handlingSuggestion == |
| | | '') { |
| | | |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: '处理意见不能为空' |
| | | }); |
| | | return false; |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: '处理意见不能为空' |
| | | }); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | uni.showLoading({ |
| | | mask: true, |
| | | title: "加载中....", |
| | | }) |
| | | this.$http.post(this.url.approval, { |
| | | /** |
| | | * 确认意见 |
| | |
| | | userId: this.assignee, |
| | | values: this.values |
| | | }).then(res => { |
| | | console.log(res) |
| | | this.$tip.loaded(); |
| | | uni.hideLoading(); |
| | | if (res.data.success) { |
| | | uni.showToast({ |
| | | icon: "success", |
| | |
| | | // }) |
| | | this.$Router.replaceAll({ |
| | | name: 'ToDoList' |
| | | }) |
| | | } else { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: res.data.message, |
| | | confirmText: '确定', |
| | | showCancel: false, |
| | | }) |
| | | } |
| | | }).catch(() => { |
| | |
| | | this.$tip.error("联网失败") |
| | | }) |
| | | }, |
| | | // getEquipment() { |
| | | // this.$http.get(this.url.getEquipmentList).then(res => { |
| | | // //设置列表数据 |
| | | // if (res.data.success) { |
| | | // this.equipmentList = res.data.result |
| | | // } else { |
| | | // uni.showToast({ |
| | | // icon: "error", |
| | | // title: res.data.message, |
| | | // duration: 2000 |
| | | // }); |
| | | |
| | | // } |
| | | // }).catch(() => { |
| | | // this.$tip.error("联网失败") |
| | | // }) |
| | | // }, |
| | | getList() { |
| | | this.$http.get(this.url.BaoList, { |
| | | params: { |
| | |
| | | //联网失败, 结束加载 |
| | | }) |
| | | }, |
| | | ChooseImage() { |
| | | var that = this; |
| | | uni.chooseImage({ |
| | | count: 4, |
| | | sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 |
| | | sourceType: ['album'], // 从相册选择 |
| | | success: (res) => { |
| | | // 存储选择的图片路径 |
| | | that.imgList = res.tempFilePaths; |
| | | |
| | | // 初始化 formData.avatar 为空字符串 |
| | | |
| | | |
| | | // 初始化 formData.avatar 为空字符串 |
| | | that.formData.avatar = []; |
| | | |
| | | |
| | | // 创建上传任务的 Promise 数组 |
| | | const uploadPromises = res.tempFilePaths.map((filePath, index) => { |
| | | return new Promise((resolve, reject) => { |
| | | that.$http.upload(that.url.upload, { |
| | | filePath: filePath, |
| | | name: 'file' |
| | | }) |
| | | .then(uploadRes => { |
| | | // 假设服务器返回的结果中包含文件路径 |
| | | const filePath = uploadRes.data.result[0]; |
| | | this.formData.avatar.push(filePath); |
| | | console.log(this.formData.avatar) |
| | | resolve(filePath); |
| | | }) |
| | | .catch(err => { |
| | | console.error('图片' + index + '上传失败:', err); |
| | | reject(err); |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | // 并发执行所有上传任务 |
| | | Promise.all(uploadPromises) |
| | | .then((uploadedFilePaths) => { |
| | | console.log('所有图片上传成功:', that.formData.avatar); |
| | | }) |
| | | .catch((err) => { |
| | | console.error('图片上传失败:', err); |
| | | that.$tip.error('图片上传失败'); |
| | | }); |
| | | getStandardFile() { |
| | | this.$http.get(this.url.getStandardFile, { |
| | | params: { |
| | | id: this.standardId |
| | | } |
| | | }); |
| | | }, |
| | | ViewImage(e) { |
| | | uni.previewImage({ |
| | | urls: this.imgList, |
| | | current: e.currentTarget.dataset.url |
| | | }); |
| | | }, |
| | | DelImg(e) { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '确定要删除这段回忆吗?', |
| | | cancelText: '再看看', |
| | | confirmText: '再见', |
| | | success: res => { |
| | | if (res.confirm) { |
| | | this.imgList.splice(e.currentTarget.dataset.index, 1) |
| | | }).then(res => { |
| | | if (res.data.success) { |
| | | console.log("res", res.data.result); |
| | | const referenceFileStr = res.data.result.referenceFile; |
| | | |
| | | // 判断是否存在 referenceFile 并进行解析 |
| | | if (referenceFileStr) { |
| | | try { |
| | | const referenceFileObj = JSON.parse(referenceFileStr); |
| | | const filePath = `${this.ipAndPort}${referenceFileObj.filePath}`; |
| | | this.previewImageSrc = filePath; |
| | | console.log('previewImageSrc:', this.previewImageSrc); |
| | | } catch (e) { |
| | | console.error("referenceFile 解析失败", e); |
| | | this.previewImageSrc = ''; |
| | | } |
| | | } else { |
| | | console.warn("referenceFile 不存在"); |
| | | this.previewImageSrc = ''; |
| | | } |
| | | } |
| | | }) |
| | | }).catch(err => { |
| | | console.error("网络请求失败", err); |
| | | // 联网失败, 结束加载 |
| | | }); |
| | | }, |
| | | |
| | | upCallback() { |
| | | this.$http.get(this.url.stallList, { |
| | | params: { |
| | |
| | | console.log(this.announcement1.operator_dictText) |
| | | this.formData.operator = this.announcement1.operator_dictText |
| | | this.formData.num = this.announcement1.equipmentId |
| | | this.formData.remark = this.announcement1.remark |
| | | this.formData.installationPosition_dictText = this.announcement1 |
| | | .installationPosition_dictText |
| | | this.formData.inspectionStatus_dictText = this.announcement1.inspectionStatus_dictText |
| | | this.formData.operatorPhone_dictText = this.announcement1.operatorPhone_dictText |
| | | this.formData.orderNum = this.announcement1.orderNum |
| | | this.formData.inspectionDate = this.announcement1.inspectionDate |
| | | this.formData.inspectionStatus = this.announcement1.inspectionStatus |
| | | this.ScanData.typeName = this.announcement1.confirmDealType |
| | | this.formData.confirmComment = this.announcement1.confirmDealType_dictText |
| | | this.ScanData.handlingSuggestion = this.announcement1.confirmComment |
| | | |
| | | this.title = this.todoName ?? '详情'; |
| | | if (this.announcement1.standardId !== null) { |
| | | this.standardId = this.announcement1.standardId |
| | | this.getStandardFile() |
| | | } |
| | | if (this.formData.inspectionStatus == 'WAIT_INSPECTION') { |
| | | if (this.flag == 'task') { |
| | | // this.title = '班组长确认' |
| | | this.readonly = true |
| | | this.isShowBtn = false |
| | | } |
| | | } |
| | | if (this.formData.inspectionStatus == 'COMPLETE') { |
| | | this.title = '详情' |
| | | this.isTouch = true |
| | | this.isShowTeam=true |
| | | this.isShowBtn = false |
| | | if (this.flag == 'task') { |
| | | // this.title = '班组长确认' |
| | | this.isTouch = true |
| | | this.readonly = true |
| | | this.isShowTeam = true |
| | | this.isShowBtn = false |
| | | } |
| | | } else if (this.formData.inspectionStatus == 'WAIT_CONFIRM') { |
| | | this.title = '点检开始'; |
| | | this.isShowTeam=true |
| | | this.isTouch=true |
| | | this.isShowBtn=false |
| | | if (this.flag == 'task') { |
| | | // this.title = '班组长确认'; |
| | | this.readonly = true |
| | | this.isShowTeam = true |
| | | this.isTouch = true |
| | | this.isShowBtn = false |
| | | } else { |
| | | // this.title = '点检开始'; |
| | | this.isShowTeam = true |
| | | this.isTouch = false |
| | | this.readonly = true |
| | | this.isShowBtn = true |
| | | } |
| | | |
| | | } else if (this.formData.inspectionStatus == 'UNDER_INSPECTION') { |
| | | if (this.flag == 'task') { |
| | | // this.title = '点检开始'; |
| | | this.isShowBtn = false; |
| | | |
| | | } |
| | | } |
| | | this.formData.avatar = this.announcement1.imageFiles |
| | | this.imageFilesList = JSON.parse(this.formData.avatar) |
| | |
| | | this.imgList = imageObjects.map(imageObj => { |
| | | return `${this.ipAndPort}${imageObj.filePath}`; |
| | | }); |
| | | |
| | | // 根据 imgList 构造 fileLists |
| | | this.fileLists = this.imgList.map(url => ({ |
| | | url: url, |
| | | extname: 'png', |
| | | name: 'eam' |
| | | })); |
| | | this.hasInspectionDateArrived(); |
| | | } |
| | | }).catch(() => { |
| | |
| | | margin-top: 85px; |
| | | height: auto; |
| | | } |
| | | |
| | | .divider { |
| | | display: flex; |
| | | align-items: center; |
| | | text-align: center; |
| | | color: gray; |
| | | /* 文字颜色 */ |
| | | margin: 20px 0; |
| | | /* 上下间距 */ |
| | | } |
| | | |
| | | .divider::before, |
| | | .divider::after { |
| | | content: ''; |
| | | flex: 1; |
| | | border-bottom: 1px solid gray; |
| | | /* 横线颜色 */ |
| | | margin: 0 16px; |
| | | /* 横线与文字之间的间距 */ |
| | | } |
| | | |
| | | .divider text { |
| | | white-space: nowrap; |
| | | /* 防止文字换行 */ |
| | | } |
| | | |
| | | .overlay { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: rgba(0, 0, 0, 0.7); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | z-index: 999; |
| | | } |
| | | |
| | | .modal { |
| | | position: relative; |
| | | width: 90%; |
| | | max-width: 600px; |
| | | background: #fff; |
| | | border-radius: 12rpx; |
| | | padding: 20rpx; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .preview-image { |
| | | width: 100%; |
| | | max-height: 80vh; |
| | | object-fit: contain; |
| | | } |
| | | |
| | | .close-btn { |
| | | position: absolute; |
| | | top: 10rpx; |
| | | right: 20rpx; |
| | | font-size: 40rpx; |
| | | color: #333; |
| | | } |
| | | </style> |