| | |
| | | </view> |
| | | <view class="device_item_value"> |
| | | <span class="label">设备名称:</span> |
| | | <span>混凝土搅拌机</span> |
| | | <span>{{deviceData.bigDeviceName}}</span> |
| | | </view> |
| | | <view class="device_item_value"> |
| | | <span class="label">型号规格:</span> |
| | | <span>混凝土搅拌机</span> |
| | | <span>{{deviceData.bigDeviceModel}}</span> |
| | | </view> |
| | | <view class="device_item_value"> |
| | | <span class="label">设备类型:</span> |
| | | <span>混凝土搅拌机</span> |
| | | <span>{{deviceData.bigType === 1 ? '特种设备' : '一般设备'}}</span> |
| | | </view> |
| | | </view> |
| | | <view class="device_form"> |
| | |
| | | :columns="checkTypeData" |
| | | keyName="dictName" |
| | | closeOnClickOverlay |
| | | @cancel="cancelCheckType()" |
| | | @confirm="confirmCheckType()" |
| | | @cancel="cancelCheckType" |
| | | @confirm="confirmCheckType" |
| | | @close="showCheckType = false" |
| | | ></u-picker> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import baseUrl from '../../api/http.js'; |
| | | import { changeTime, throttle } from '../../plugins/public.js'; |
| | | import { baseUrl } from '../../api/http.js'; |
| | | import { changeTime, throttle } from '../../plugins/public.js'; |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | colorStyle: 'linear-gradient(to right, rgb(79, 142, 244), rgb(85, 109, 254))', |
| | | showTime: false, |
| | | defaultTime: Number(new Date()), |
| | | deviceId: '' |
| | | deviceId: '', |
| | | deviceData: {}, |
| | | showCheckType: false, |
| | | checkTypeData: [], |
| | | } |
| | | }, |
| | | onReady() { |
| | |
| | | }, |
| | | onLoad(option) { |
| | | this.deviceId = option.deviceId; |
| | | console.log(option,'option') |
| | | this.getChackAllTypes(); |
| | | this.$api.spot.getDeviceDetails({ |
| | | bigDeviceId: option.deviceId |
| | | }).then((res) => { |
| | | this.deviceData = res.data; |
| | | }) |
| | | }, |
| | | methods: { |
| | | // 获取点检类型 |
| | |
| | | pageSize: 100000000, |
| | | dictType: 'check_type' |
| | | }); |
| | | this.checkTypeData = data.list; |
| | | this.checkTypeData.push(data.list); |
| | | }, |
| | | // 读取图片后 |
| | | afterRead(event) { |
| | | console.log(event); |
| | | console.log(event,'event', `${baseUrl}/file/file/upload`); |
| | | this.fileList.push({ |
| | | status: 'loading', |
| | | message: '上传中', |
| | |
| | | name: 'file', |
| | | success: (res) => { |
| | | const data = JSON.parse(res.data); |
| | | console.log(data,'?????'); |
| | | this.$set(this.fileList, this.fileList.length - 1, { |
| | | id: this.fileList.length + 1, |
| | | status: 'success', |
| | | message: '', |
| | | data: data.data, |
| | | url: `http://filemanage.thhy-tj.com:8888/${data.data}` |
| | | url: `http://filemanage.thhy-tj.com:8888/suapi/${data.data}` |
| | | }) |
| | | }, |
| | | fail: (error) => { |
| | | console.log(error,'error'); |
| | | uni.$u.toast('上传失败!'); |
| | | } |
| | | }) |
| | |
| | | }, |
| | | // 点击选择点检类型 |
| | | confirmCheckType({ value }) { |
| | | this.$set(this.formSpot, 'checkTypeName', value[0].dictName); |
| | | this.$set(this.formSpot, 'checkType', value[0].dictId); |
| | | this.showCheckType = false; |
| | | this.$set(this.formSpot, 'checkTypeName', value[0].checkTypeName); |
| | | this.$set(this.formSpot, 'checkType', value[0].checkType); |
| | | }, |
| | | // 提交点检信息 |
| | | submitForm: throttle(function() { |
| | | this.$refs.form.validate().then((valid) => { |
| | | if(valid) { |
| | | console.log(valid,'valid'); |
| | | const params = Object.assign({}, this.formSpot); |
| | | delete params.checkTypeName; |
| | | params.deviceId = this.deviceId; |
| | |
| | | file: item.data |
| | | } |
| | | }) |
| | | } else { |
| | | params.fileList = []; |
| | | } |
| | | console.log(params,'params'); |
| | | this.$api.spot.insertSpotCheckInfo(params).then(res => { |
| | | if(res.success) { |
| | | uni.$u.toast('添加成功!'); |