| | |
| | | |
| | | <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> |
| | | <uni-group top="1"> |
| | | <!-- <uni-forms-item name="num" :label-width="100" label="工单号:"> |
| | | <!-- <uni-forms-item name="num" :label-width="100" label="工单编号:"> |
| | | <uni-easyinput v-model="formData.repairCode" :disabled="true" /> |
| | | </uni-forms-item> --> |
| | | <uni-forms-item required name="num" :label-width="100" label="设备编号:"> |
| | | <uni-forms-item name="num" :label-width="100" label="设备编号:"> |
| | | <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" |
| | | placeholder="请选择" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="faultStartTime" :label-width="100" label="故障开始时间:"> |
| | | <uni-easyinput v-model="formData.faultStartTime" :disabled="true" /> |
| | | <uni-forms-item name="equipmentName" :label-width="100" label="设备名称:"> |
| | | <uni-easyinput v-model="formData.equipmentName" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="reportStatus" :label-width="100" label="报修状态:"> |
| | | <uni-forms-item name="installationPosition_dictText" :label-width="100" label="安装位置:"> |
| | | <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="reportStatus" :label-width="100" label="维修状态:"> |
| | | <uni-easyinput v-model="formData.reportStatus" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="faultName" :label-width="100" label="故障简称"> |
| | |
| | | <uni-forms-item name="outNum" :label-width="100" label="故障描述:"> |
| | | <uni-easyinput v-model="formData.faultDescription" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="faultStartTime" :label-width="100" label="故障开始时间:"> |
| | | <uni-easyinput v-model="formData.faultStartTime" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item :label-width="100" name="repairer_dictText" label="是否停机:"> |
| | | <uni-easyinput v-model="formData.breakdownFlag_dictText" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="remark" :label-width="100" label="备注:"> |
| | | <uni-easyinput v-model="formData.remark" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="outNum" :label-width="100" label="维修图片:"> |
| | | <uni-forms-item name="outNum" :label-width="100" label="报修图片:"> |
| | | <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" |
| | | :sourceType="sourceType" @select="select" @progress="progress" @success="success" |
| | | @fail="fail" @delete="deletea" :readonly="true" /> |
| | |
| | | uploadUrl: "/sys/common/upload", |
| | | formData: { |
| | | num: '', |
| | | avatar: [] |
| | | avatar: [], |
| | | equipmentName: '', |
| | | installationPosition: '', |
| | | breakdownFlag_dictText: '', |
| | | |
| | | reporter_dictText: '', |
| | | |
| | | faultStartTime: '', |
| | | reportStatus: '', |
| | | faultName: '', |
| | | faultDescription: '', |
| | | remark: '' |
| | | }, |
| | | NavBarColor: this.NavBarColor, |
| | | url: { |
| | |
| | | |
| | | onLoad(options) { |
| | | const annItem = JSON.parse(decodeURIComponent(options.item)); |
| | | this.id = annItem.id |
| | | |
| | | |
| | | this.formData.installationPosition_dictText = annItem.installationPosition |
| | | this.formData.num = annItem.equipmentId |
| | | this.formData.equipmentName = annItem.equipmentName |
| | | this.formData.breakdownFlag_dictText = annItem.breakdownFlag_dictText |
| | | this.formData.faultStartTime = annItem.faultStartTime |
| | | this.formData.reportStatus = annItem.reportStatus_dictText |
| | | this.formData.faultName = annItem.faultName |
| | | this.formData.faultDescription = annItem.faultDescription |
| | | this.formData.remark = annItem.remark |
| | | this.formData.avatar = annItem.imageFiles || '[]'; // 默认空数组字符串 |
| | | try { |
| | | const imageObjects = JSON.parse(this.formData.avatar); |
| | | |
| | | // 确保 imageObjects 是数组类型 |
| | | if (Array.isArray(imageObjects)) { |
| | | this.imgList = imageObjects.map(imageObj => { |
| | | return `${this.ipAndPort}${imageObj.filePath}`; |
| | | }); |
| | | |
| | | // 构造 fileLists |
| | | this.fileLists = this.imgList.map(url => ({ |
| | | url: url, |
| | | extname: 'png', |
| | | name: 'eam' |
| | | })); |
| | | } else { |
| | | console.warn('imageObjects is not an array:', imageObjects); |
| | | this.imgList = []; |
| | | this.fileLists = []; |
| | | } |
| | | } catch (e) { |
| | | console.error('Failed to parse avatar JSON:', e); |
| | | this.imgList = []; |
| | | this.fileLists = []; |
| | | } |
| | | }, |
| | | created() { |
| | | this.getEquipment(); |
| | |
| | | changeEquipmentList(e) { |
| | | this.formData.num = e; |
| | | }, |
| | | upCallback() { |
| | | this.$http.get(this.url.stallList, { |
| | | params: { |
| | | id: this.id |
| | | }, |
| | | // upCallback() { |
| | | // this.$http.get(this.url.stallList, { |
| | | // params: { |
| | | // id: this.id |
| | | // }, |
| | | |
| | | }).then(res => { |
| | | this.announcement1 = res.data.result |
| | | console.log("url", res) |
| | | //设置列表数据 |
| | | if (res.data.success) { |
| | | console.log("res", res.data.result) |
| | | this.formData.repairCode = this.announcement1.repairCode |
| | | this.formData.num = this.announcement1.equipmentId |
| | | this.formData.faultStartTime = this.announcement1.faultStartTime |
| | | this.formData.reportStatus = this.announcement1.reportStatus_dictText |
| | | this.formData.faultName = this.announcement1.faultName |
| | | this.formData.faultDescription = this.announcement1.faultDescription |
| | | this.formData.remark = this.announcement1.remark |
| | | this.formData.avatar = this.announcement1.imageFiles |
| | | this.imgList = JSON.parse(this.formData.avatar) |
| | | const imageObjects = JSON.parse(this.formData.avatar); |
| | | // 假设 imgList 是已有的图片地址数组 |
| | | this.imgList = imageObjects.map(imageObj => { |
| | | return `${this.ipAndPort}${imageObj.filePath}`; |
| | | }); |
| | | // }).then(res => { |
| | | // this.announcement1 = res.data.result |
| | | // console.log("url", res) |
| | | // //设置列表数据 |
| | | // if (res.data.success) { |
| | | // console.log("res", res.data.result) |
| | | // this.formData.repairCode = this.announcement1.repairCode |
| | | // this.formData.installationPosition_dictText=this.announcement1.installationPosition_dictText |
| | | // this.formData.num = this.announcement1.equipmentId |
| | | // this.formData.repairer_dictText = this.announcement1.repairer_dictText |
| | | // this.formData.repairerPhone_dictText = this.announcement1.repairerPhone_dictText |
| | | // this.formData.reporter_dictText = this.announcement1.reporter_dictText |
| | | // this.formData.reporterPhone_dictText = this.announcement1.reporterPhone_dictText |
| | | // this.formData.faultStartTime = this.announcement1.faultStartTime |
| | | // this.formData.reportStatus = this.announcement1.reportStatus_dictText |
| | | // this.formData.faultName = this.announcement1.faultName |
| | | // this.formData.faultDescription = this.announcement1.faultDescription |
| | | // this.formData.remark = this.announcement1.remark |
| | | // this.formData.avatar = this.announcement1.imageFiles |
| | | // this.imgList = JSON.parse(this.formData.avatar) |
| | | // const imageObjects = JSON.parse(this.formData.avatar); |
| | | // // 假设 imgList 是已有的图片地址数组 |
| | | // this.imgList = imageObjects.map(imageObj => { |
| | | // return `${this.ipAndPort}${imageObj.filePath}`; |
| | | // }); |
| | | |
| | | // 根据 imgList 构造 fileLists |
| | | this.fileLists = this.imgList.map(url => ({ |
| | | url: url, |
| | | extname: 'png', |
| | | name: 'eam' |
| | | })); |
| | | } |
| | | }).catch(() => { |
| | | //联网失败, 结束加载 |
| | | }) |
| | | }, |
| | | // // 根据 imgList 构造 fileLists |
| | | // this.fileLists = this.imgList.map(url => ({ |
| | | // url: url, |
| | | // extname: 'png', |
| | | // name: 'eam' |
| | | // })); |
| | | // } |
| | | // }).catch(() => { |
| | | // //联网失败, 结束加载 |
| | | // }) |
| | | // }, |
| | | |
| | | getEquipment() { |
| | | this.$http.get(this.url.getEquipmentList, { |