| | |
| | | <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> |
| | | <block slot="backText">返回</block> |
| | | <block slot="content">设备详情</block> |
| | | <block slot="right"> |
| | | <!-- <block slot="right"> |
| | | <view @click="goHome"> |
| | | <image class="search" src="/static/icon/icon_home.png" style="width: 25px; height: 25px;" alt="" /> |
| | | </view> |
| | | </block> |
| | | </block> --> |
| | | </cu-custom> |
| | | <view class="container"> |
| | | |
| | | |
| | | <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> |
| | | <uni-group top="1"> |
| | | |
| | | <uni-forms-item :label-width="100" required name="num" label="设备编号:"> |
| | | <uni-easyinput v-model="formData.equipmentCode" :disabled="true" /> |
| | | </uni-forms-item> |
| | |
| | | <uni-forms-item :label-width="100" name="remark" label="设备名称:"> |
| | | <uni-easyinput v-model="formData.equipmentName" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <!-- <uni-forms-item :label-width="100" name="outNum" label="关键设备标识:"> |
| | | <uni-easyinput v-model="formData.equipmentImportance" :disabled="true" /> |
| | | </uni-forms-item> --> |
| | | <view class="text-gray margin-bottom-lg">—————————— 基本信息 ——————————</view> |
| | | <uni-forms-item :label-width="100" name="taskCode" label="维修状态:"> |
| | | <uni-easyinput :disabled="true" v-model="formData.repairStatus_dictText" /> |
| | |
| | | <uni-forms-item :label-width="100" name="endLocation" label="出厂日期:"> |
| | | <uni-easyinput :disabled="true" v-model="formData.leaveFactoryDate" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item :label-width="100" name="outNum" label="设备文档:"> |
| | | <uni-file-picker v-model="fileLists" :extension="['.pdf']" @fail="uploadFail" |
| | | :list-styles="listStyles" :delIcon="del" :max-count="5" file-mediatype="all" |
| | | @downloadFile="downloadFile" @select="onFileSelect" @delete="onFileDelete"> |
| | | <button size="mini" type="primary">点击上传</button> |
| | | </uni-file-picker> |
| | | </uni-forms-item> |
| | | </uni-group> |
| | | </uni-forms> |
| | | <view class="file-list margin-sm"> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="flex margin-bottom-xs"> |
| | | <button v-if="authIncludes('eam:reportRepair:add')" class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" |
| | | @click="goReportRepair()">报修</button> |
| | | <button v-if="authIncludes('eam:reportRepair:add')" class="flex-sub cu-btn bg-blue margin-sm lg" |
| | | hover-class="is-hover" |
| | | @click="goReportRepair()">报修 |
| | | </button> |
| | | <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" |
| | | @click="goCheck()">点检</button> |
| | | @click="goCheck()">点检 |
| | | </button> |
| | | <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" |
| | | @click="goBaoZhou()">周保</button> |
| | | @click="goBaoZhou()">周保 |
| | | </button> |
| | | <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" |
| | | @click="goMaintenance()">维修</button> |
| | | @click="goMaintenance()">维修 |
| | | </button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | import { |
| | | stringify |
| | | } from "querystring"; |
| | | import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; |
| | | import { |
| | | saveAs |
| | | } from 'file-saver'; // 引入 file-saver 库 |
| | | export default { |
| | | mixins: [MescrollMixin], // 使用mixin |
| | | data() { |
| | | return { |
| | | |
| | | listStyles: { |
| | | "borderStyle": { |
| | | "width": "0", // 边框宽度 |
| | | }, |
| | | "border": false, // 是否显示边框 |
| | | "dividline": false |
| | | }, |
| | | formData: { |
| | | fileLists: [] |
| | | equipmentCode: '', |
| | | equipmentName: '', |
| | | repairStatus_dictText: '', |
| | | maintenanceStatus_dictText: '', |
| | | orgId_dictText: '', |
| | | installationPosition: '', |
| | | technologyStatus_dictText: '', |
| | | equipmentManager_dictText: '', |
| | | leaveFactoryDate: '' |
| | | }, |
| | | fileLists: [], |
| | | NavBarColor: this.NavBarColor, |
| | |
| | | downloadFile: 'eam/equipmentAttachment/downloadFile' |
| | | }, |
| | | id: '', |
| | | upOption: { |
| | | page: { |
| | | num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始 |
| | | size: 10 // 每页数据的数量 |
| | | }, |
| | | noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5 |
| | | empty: { |
| | | tip: '~ 暂无数据 ~', // 提示 |
| | | }, |
| | | loading: '', |
| | | text: '全部', |
| | | isShowNoMore: false, |
| | | textNoMore: '我是有底线的 >_<' |
| | | }, |
| | | styles: { |
| | | color: '#2979FF', |
| | | borderColor: '#2979FF' |
| | |
| | | return style |
| | | }, |
| | | }, |
| | | // onLoad(options) { |
| | | // const decodedEquipmentId = decodeURIComponent(options.equipmentId); |
| | | // this.id = decodedEquipmentId; |
| | | // console.log(this.id) |
| | | // if (!this.id) { |
| | | // uni.showModal({ |
| | | // title: '提示', |
| | | // content: "错误不存在", |
| | | // showCancel: false |
| | | // }); |
| | | // } |
| | | // |
| | | // }, |
| | | onUnload() { |
| | | this.id = null; |
| | | this.formData = {}; // 清空数据 |
| | | this.fileLists = []; |
| | | }, |
| | | onLoad(options) { |
| | | const decodedEquipmentId = decodeURIComponent(options.equipmentId); |
| | | this.id = decodedEquipmentId; |
| | |
| | | showCancel: false |
| | | }); |
| | | } else { |
| | | this.upCallback(); |
| | | this.getData(); // ✅ 只执行一次 |
| | | } |
| | | }, |
| | | |
| | | created() { |
| | | |
| | | this.getFileList(); |
| | | }, |
| | | onShow() { |
| | | // 从路由参数中获取equipmentId |
| | | const equipmentIdFromRoute = this.$router.query.equipmentId; |
| | | if (equipmentIdFromRoute) { |
| | | // 如果存在,更新this.id |
| | | this.id = equipmentIdFromRoute; |
| | | // 重新获取设备详情数据 |
| | | this.upCallback(); |
| | | } |
| | | }, |
| | | watch: { |
| | | // 监听$route变化 |
| | | $route(to, from) { |
| | | // 更新equipmentId参数 |
| | | this.id = to.query.equipmentId; |
| | | console.log('更新后的equipmentId:', this.equipmentId); |
| | | } |
| | | }, |
| | | created() {}, |
| | | methods: { |
| | | getData() { |
| | | this.$http.get(this.url.stallList, { |
| | | params: { |
| | | pageNo: 999, |
| | | pageSize: 1, |
| | | order: 'asc', |
| | | column: 'createTime', |
| | | id: this.id |
| | | }, |
| | | |
| | | }).then(res => { |
| | | this.announcement1 = res.data.result |
| | | console.log("url", res) |
| | | //设置列表数据 |
| | | if (res.data.success) { |
| | | console.log("res", res.data.result.equipmentCode) |
| | | this.formData = this.announcement1 |
| | | } |
| | | }).catch(() => { |
| | | //联网失败, 结束加载 |
| | | }) |
| | | }, |
| | | authIncludes(code) { |
| | | return this.authList.some(auth => auth.action === code) |
| | | }, |
| | |
| | | uploadFail(e) { |
| | | console.log('上传失败:', e) |
| | | }, |
| | | |
| | | |
| | | |
| | | onFileSelect(e) { |
| | |
| | | console.error('提交失败:', err); |
| | | }); |
| | | }, |
| | | goHome() { |
| | | uni.reLaunch({ |
| | | url: '/pages/index/index' |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 报修 |
| | | */ |
| | |
| | | url: `/pages/maintenanceReport/maintenanceReport?equipmentId=${encodeURIComponent(this.id)}` |
| | | }); |
| | | }, |
| | | upCallback() { |
| | | console.log("id", this.id) |
| | | this.$http.get(this.url.stallList, { |
| | | params: { |
| | | pageNo: 999, |
| | | pageSize: 1, |
| | | order: 'asc', |
| | | column: 'createTime', |
| | | id: this.id |
| | | }, |
| | | |
| | | }).then(res => { |
| | | this.announcement1 = res.data.result |
| | | console.log("url", res) |
| | | //设置列表数据 |
| | | if (res.data.success) { |
| | | console.log("res", res.data.result.equipmentCode) |
| | | this.formData = this.announcement1 |
| | | } |
| | | }).catch(() => { |
| | | //联网失败, 结束加载 |
| | | }) |
| | | }, |
| | | |
| | | mescrollInit(mescroll) { |
| | | console.log('mescrollInit') |
| | | this.mescroll = mescroll; |
| | | }, |
| | | }, |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | .content { |
| | | margin-top: 5px; |
| | | } |
| | |
| | | } |
| | | |
| | | .popupView { |
| | | margin-top: 85px; |
| | | margin-top: 45px; |
| | | height: auto; |
| | | } |
| | | </style> |