| | |
| | | <script> |
| | | import uploadMixin from "@/mixin/uploadMixin"; |
| | | import { |
| | | saveBailReporting |
| | | saveBailReporting, |
| | | getBailReportingDetail, |
| | | updateBailReporting |
| | | } from "@/api/reporting/reporting"; |
| | | export default { |
| | | mixins: [uploadMixin], |
| | |
| | | } |
| | | }, |
| | | showSelectDate: false, |
| | | applyTime: Number(new Date()) |
| | | applyTime: Number(new Date()), |
| | | status: "", |
| | | isEdit: false |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | | |
| | | if (option.id) { |
| | | this.isEdit = true; |
| | | this.getDetail(option.id) |
| | | } |
| | | |
| | | let siteInfo = uni.getStorageSync("siteInfo"); |
| | | let userInfo = uni.getStorageSync("userInfo"); |
| | | this.$set(this.info, "houseCode", siteInfo.houseCode); |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | |
| | | getDetail(id) { |
| | | getBailReportingDetail({ |
| | | taskId: id |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | for (let i in this.info) { |
| | | this.info[i] = res.data[i] |
| | | } |
| | | this.info.reportType = 1; |
| | | this.status = data.confirmFlag; |
| | | if (res.data.applyTime) { |
| | | this.applyTime = Number(new Date(res.data.applyTime)) |
| | | } |
| | | this.form.images = this.$setImageUrl(data.locationImageUrls, 2); |
| | | this.info.locationImageUrls = data.locationImageUrls; |
| | | this.info.id = data.id; |
| | | this.info.taskId = data.taskId; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | |
| | | getLocation() { |
| | | uni.chooseLocation({ |
| | |
| | | sumitInfo() { |
| | | this.$refs.form.validate().then(valid => { |
| | | this.checkImages(); |
| | | saveBailReporting(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '提交成功', |
| | | success() { |
| | | setTimeout(() => { |
| | | // this.$u.func.globalNavigator("", "navBack") |
| | | uni.navigateBack() |
| | | }, 1000) |
| | | } |
| | | }) |
| | | }) |
| | | if (this.isEdit) { |
| | | this.info.status = 1; |
| | | this.updateRequest() |
| | | } else { |
| | | this.addRequest() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | |
| | | addRequest() { |
| | | saveBailReporting(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '提交成功' |
| | | }) |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 300) |
| | | }) |
| | | }, |
| | | |
| | | updateRequest() { |
| | | updateBailReporting(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '保存成功' |
| | | }) |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 300) |
| | | }) |
| | | }, |
| | | |
| | | navigatorPage() { |
| | | this.$u.func.globalNavigator('bailList', "navTo") |
| | | } |