| | |
| | | <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" |
| | | placeholder="请选择" :disabled="true" /> |
| | | </uni-forms-item> |
| | | |
| | | <uni-forms-item name="installationPosition_dictText" :label-width="80" label="安装位置:"> |
| | | <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="maintenanceDate" :label-width="80" label="保养日期:"> |
| | | <uni-easyinput v-model="formData.maintenanceDate" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="outNum" :label-width="80" label="保养人:"> |
| | | <uni-forms-item name="operator_dictText" :label-width="80" label="保养人:"> |
| | | <uni-easyinput v-model="formData.operator_dictText" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="outNum" :label-width="80" label="备注"> |
| | | <uni-forms-item name="operatorPhone_dictText" :label-width="80" label="保养人电话:"> |
| | | <uni-easyinput v-model="formData.operatorPhone_dictText" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="remark" :label-width="80" label="备注"> |
| | | <uni-easyinput type="textarea" v-model="formData.remark" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="outNum" :label-width="80" 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" /> |
| | | @fail="fail" @delete="deletea" :readonly="true" /> |
| | | </uni-forms-item> |
| | | </uni-group> |
| | | </uni-forms> |
| | |
| | | <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> |
| | | {{item.subItemName}} |
| | | </view> |
| | | <!-- <view class="flex-sub bg-white padding-xs margin-xs radius text-right" |
| | | v-if="item.subItemName!=null && item.subItemName.length>10"> |
| | | {{(item.subItemName).toString().substr(0,10)+'...'}} |
| | | </view> |
| | | |
| | | <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> |
| | | {{item.subItemName}} |
| | | </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 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> |
| | | {{item.itemDemand}} |
| | | </view> --> |
| | | <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> |
| | | {{item.itemDemand}} |
| | | </view> |
| | |
| | | height: 90, |
| | | }, |
| | | sourceType: ['album', 'camera'], |
| | | ipAndPort:configService.staticURL, |
| | | ipAndPort: configService.staticURL, |
| | | scrollLeft: 0, |
| | | searchValue: '', |
| | | imgList: [], |
| | |
| | | uploadUrl: "/sys/common/upload", |
| | | formData: { |
| | | num: '', |
| | | avatar:[], |
| | | avatar: [], |
| | | remark: '', |
| | | inspectionDate: '', |
| | | }, |
| | |
| | | url: { |
| | | upload: "/eam/sysFiles/batch_upload", |
| | | stallList: "/eam/weekMaintenanceOrder/queryById", |
| | | getEquipmentList:'eam/equipment/list', |
| | | getEquipmentList: 'eam/equipment/list', |
| | | // getEquipmentList: "eam/equipment/asyncLoadEquipment", |
| | | BaoList: '/eam/weekMaintenanceOrderDetail/queryList' |
| | | }, |
| | |
| | | handleCode(e) { |
| | | this.inspectionResult = e; |
| | | }, |
| | | getEquipment() { |
| | | this.$http.get(this.url.getEquipmentList, { |
| | | params: { |
| | | pageNo: 1, |
| | | pageSize: 9999, |
| | | order: 'desc', |
| | | column: 'createTime' |
| | | }, |
| | | |
| | | }).then(res => { |
| | | //设置列表数据 |
| | | if (res.data.success) { |
| | | this.equipmentList = res.data.result.records |
| | | } else { |
| | | uni.showToast({ |
| | | icon: "error", |
| | | title: res.data.message, |
| | | duration: 2000 |
| | | }); |
| | | |
| | | } |
| | | }).catch(() => { |
| | | this.$tip.error("联网失败") |
| | | }) |
| | | }, |
| | | getEquipment() { |
| | | this.$http.get(this.url.getEquipmentList, { |
| | | params: { |
| | | pageNo: 1, |
| | | pageSize: 9999, |
| | | order: 'desc', |
| | | column: 'createTime' |
| | | }, |
| | | |
| | | }).then(res => { |
| | | //设置列表数据 |
| | | if (res.data.success) { |
| | | this.equipmentList = res.data.result.records |
| | | } else { |
| | | uni.showToast({ |
| | | icon: "error", |
| | | title: res.data.message, |
| | | duration: 2000 |
| | | }); |
| | | |
| | | } |
| | | }).catch(() => { |
| | | this.$tip.error("联网失败") |
| | | }) |
| | | }, |
| | | getList() { |
| | | this.$http.get(this.url.BaoList, { |
| | | params: { |
| | |
| | | //联网失败, 结束加载 |
| | | }) |
| | | }, |
| | | |
| | | |
| | | |
| | | // 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.equipmentCode) |
| | | // this.formData.num = this.announcement1.equipmentId |
| | | // this.formData.orderNum = this.announcement1.orderNum |
| | | // this.formData.operatorPhone_dictText=this.announcement1.operatorPhone_dictText |
| | | // this.formData.installationPosition_dictText=this.announcement1.installationPosition_dictText |
| | | // this.formData.maintenanceDate = this.announcement1.maintenanceDate |
| | | // this.formData.operator = this.announcement1.operator_dictText |
| | | // this.formData.remark = this.announcement1.remark |
| | | // this.formData.avatar = this.announcement1.imageFiles |
| | | // const imageObjects = JSON.parse(this.formData.avatar); |
| | | // // 提取 filePath 并拼接 IP 和端口 |
| | | // 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(() => { |
| | | // //联网失败, 结束加载 |
| | | // }) |
| | | // }, |
| | | |
| | | 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.equipmentCode) |
| | | this.formData.num = this.announcement1.equipmentId, |
| | | this.formData.orderNum = this.announcement1.orderNum, |
| | | this.formData.maintenanceDate = this.announcement1.maintenanceDate, |
| | | this.formData.operator = this.announcement1.operator, |
| | | this.formData.remark = this.announcement1.remark, |
| | | this.formData.avatar = this.announcement1.imageFiles |
| | | const imageObjects = JSON.parse(this.formData.avatar); |
| | | // 提取 filePath 并拼接 IP 和端口 |
| | | 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.announcement1 = res.data?.result || {}; |
| | | console.log("url", res); |
| | | |
| | | // 判断是否成功获取数据 |
| | | if (res.data.success && this.announcement1) { |
| | | console.log("res", this.announcement1.equipmentCode); |
| | | |
| | | // 定义字段映射关系 |
| | | const fieldMapping = { |
| | | num: 'equipmentId', |
| | | orderNum: 'orderNum', |
| | | operatorPhone_dictText: 'operatorPhone_dictText', |
| | | installationPosition_dictText: 'installationPosition_dictText', |
| | | maintenanceDate: 'maintenanceDate', |
| | | operator_dictText: 'operator_dictText', |
| | | remark: 'remark', |
| | | avatar: 'imageFiles' |
| | | }; |
| | | Object.keys(fieldMapping).forEach(key => { |
| | | const sourceKey = fieldMapping[key]; |
| | | this.formData[key] = this.announcement1[sourceKey] ?? ''; |
| | | }); |
| | | |
| | | // 处理图片列表 |
| | | this.handleImageFiles(this.formData.avatar); |
| | | } |
| | | }).catch(() => { |
| | | //联网失败, 结束加载 |
| | | }) |
| | | // 联网失败, 结束加载 |
| | | console.error('请求失败'); |
| | | }); |
| | | }, |
| | | // 单独处理图片文件的方法 |
| | | handleImageFiles(imageFiles) { |
| | | try { |
| | | const imageObjects = JSON.parse(imageFiles || '[]'); |
| | | this.imgList = imageObjects.map(imageObj => { |
| | | return `${this.ipAndPort}${imageObj.filePath}`; |
| | | }); |
| | | |
| | | |
| | | // 构造 fileLists |
| | | this.fileLists = this.imgList.map(url => ({ |
| | | url: url, |
| | | extname: 'png', |
| | | name: 'eam' |
| | | })); |
| | | } catch (e) { |
| | | console.error('解析 imageFiles 出错:', e); |
| | | this.imgList = []; |
| | | this.fileLists = []; |
| | | } |
| | | }, |
| | | |
| | | /* 检索 */ |
| | | getSera(res) { |