14 files modified
1 files added
| | |
| | | }) |
| | | } |
| | | |
| | | //修改校园安全报事 |
| | | export const setSchoolReporting = (data) => { |
| | | return http.request({ |
| | | url: '/blade-taskCampusReportingEvent/taskCampusReportingEvent/update', |
| | | method: 'POST', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | |
| | | //获取校园安全报事列表 |
| | | export const getSchoolReportingList = (params) => { |
| | |
| | | export const saveSchoolReporting = (data) => { |
| | | return http.request({ |
| | | url: '/blade-taskCampusReportingEvent/taskCampusReportingEvent/save', |
| | | method: 'POST', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | |
| | | //修改校园安全报事 |
| | | export const setSchoolReporting = (data) => { |
| | | return http.request({ |
| | | url: '/blade-taskCampusReportingEvent/taskCampusReportingEvent/update', |
| | | method: 'POST', |
| | | data: data |
| | | }) |
| | |
| | | ...params |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | export const getWorkLogDetail = (params) => { |
| | | return http.request({ |
| | | url: '/blade-gridWorkLog/gridWorkLog/detail', |
| | | method: 'GET', |
| | | params: { |
| | | ...params |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const updateWorkLog = (data) => { |
| | | return http.request({ |
| | | url: '/blade-gridWorkLog/gridWorkLog/update', |
| | | method: 'POST', |
| | | data |
| | | }) |
| | | } |
| | |
| | | return [] |
| | | } |
| | | } |
| | | |
| | | |
| | | export const showTips = (text, icon) => { |
| | | uni.showToast({ |
| | | title: text, |
| | | icon: icon ? icon : 'none' |
| | | }) |
| | | } |
| | | |
| | | |
| | | // 获取数据下标信息 (picker选择器数据回显) |
| | | export const getIndex = (arr, value, key, nameKey) => { |
| | | if (key) { |
| | | for (let i = 0, ii = arr.length; i < ii; i++) { |
| | | if (arr[i] == value) { |
| | | return i; |
| | | } |
| | | } |
| | | } else { |
| | | for (let i = 0, ii = arr.length; i < ii; i++) { |
| | | if (arr[i][key] == value) { |
| | | return { |
| | | index: i, |
| | | name: arr[i][nameKey] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | // import boxTitle from '@/components/boxTitle/index.vue'; |
| | | // Vue.component('box-title', boxTitle) // |
| | | import footerBtn from '@/components/btn/footerBtn.vue' |
| | | import { setImageUrl,showTips } from '@/common/common.js' |
| | | import { |
| | | setImageUrl, |
| | | showTips, |
| | | getIndex |
| | | } from '@/common/common.js' |
| | | Vue.config.productionTip = false; |
| | | |
| | | App.mpType = 'app'; |
| | |
| | | // 引入全局uView |
| | | import uView from "uview-ui"; |
| | | Vue.use(uView); |
| | | Vue.component('footer-btn', footerBtn) |
| | | Vue.component('footer-btn', footerBtn) |
| | | // 引入vuex |
| | | const vuexStore = require("@/store/$u.mixin.js"); |
| | | Vue.mixin(vuexStore); |
| | |
| | | Vue.prototype.$http = http |
| | | Vue.prototype.$showTips = showTips; |
| | | Vue.prototype.$setImageUrl = setImageUrl; |
| | | Vue.prototype.$getIndex = getIndex |
| | | // 公共函数 |
| | | import globalFunc from '@/utils/func.js' |
| | | Vue.use(globalFunc, app); |
| | |
| | | "navigationBarBackgroundColor": "#fff", |
| | | "navigationBarTextStyle": "black" |
| | | } |
| | | }, |
| | | { |
| | | "path": "workLogDetail", |
| | | "style": { |
| | | "navigationBarTitleText": "走访日志详情", |
| | | "enablePullDownRefresh": false, |
| | | "navigationBarBackgroundColor": "#fff", |
| | | "navigationBarTextStyle": "black" |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | |
| | |
|
| | | //场所任务跳转
|
| | | navToSiteList() {
|
| | | let {
|
| | | houseCode
|
| | | } = uni.getStorageSync("siteInfo")
|
| | | uni.navigateTo({
|
| | | url: `/subPackage/workbench/views/audit?code=${uni.getStorageSync("siteInfo").houseCode}`
|
| | | url: `/subPackage/workbench/views/audit?code=${houseCode}&from=index`
|
| | | })
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | name: '绿',
|
| | | disabled: false,
|
| | | color: '#30D17C'
|
| | | // color: '#30D17C'
|
| | | color: 'green'
|
| | | },
|
| | | {
|
| | | name: '黄',
|
| | | disabled: false,
|
| | | color: '#FFB42B'
|
| | | color: '#FFB42B',
|
| | | color: 'yellow'
|
| | | }, {
|
| | | name: '红',
|
| | | disabled: false,
|
| | | color: '#EA1F1F'
|
| | | color: '#EA1F1F',
|
| | | color: 'red'
|
| | | }
|
| | | ],
|
| | | currentLabelInfo: {},
|
| | |
| | | <u-form labelPosition="left" :model="info" :rules="rules" ref="form" labelWidth="100" |
| | | :labelStyle="{fontSize:'28rpx'}"> |
| | | <view class="content"> |
| | | <u-form-item label="场所名称" prop="districtName" borderBottom required> |
| | | <u-input v-model="info.districtName" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | inputAlign="right"></u-input> |
| | | </u-form-item> |
| | | <u-form-item label="对象电话" prop="transactionObjectTel" borderBottom required> |
| | | <u-input v-model="info.transactionObjectTel" type="number" border="none" placeholder="请输入" |
| | | placeholderClass="f-28 c-99" inputAlign="right"></u-input> |
| | |
| | | <script> |
| | | import uploadMixin from "@/mixin/uploadMixin"; |
| | | import { |
| | | saveLabelReporting |
| | | saveLabelReporting, |
| | | getLabelReportingDetail, |
| | | setLabelReporting |
| | | } from "@/api/reporting/reporting"; |
| | | export default { |
| | | mixins: [uploadMixin], |
| | |
| | | transactionProcess: "", |
| | | houseCode: "", |
| | | districtName: "", |
| | | userId: "" |
| | | userId: "", |
| | | reportType: "" |
| | | }, |
| | | rules: { |
| | | 'districtName': { |
| | | required: true, |
| | | message: '请输入场所名称', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | 'transactionObjectTel': [{ |
| | | type: 'number', |
| | | required: true, |
| | |
| | | }, |
| | | imageUrls: [], |
| | | goodsImageUrls: [], |
| | | eventType: 1 |
| | | eventType: 1, |
| | | isEdit: false, |
| | | id: "" |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | | console.log(option); |
| | | if (option.type != 1) { |
| | | this.eventType = option.type; |
| | | uni.setNavigationBarTitle({ |
| | | title: this.setTitle(option.type) |
| | | }) |
| | | } |
| | | this.$set(this.info, "eventType", option.type); |
| | | |
| | | |
| | | if (option.type == 1) { |
| | | this.$set(this.info, "reportType", 3); |
| | | } else if (option.type == 2) { |
| | | this.$set(this.info, "reportType", 4); |
| | | if (option.id) { |
| | | this.isEdit = true; |
| | | this.id = opton.id; |
| | | this.getDetail(option.id); |
| | | } else { |
| | | this.$set(this.info, "reportType", 5); |
| | | if (option.type != 1) { |
| | | this.eventType = option.type; |
| | | uni.setNavigationBarTitle({ |
| | | title: this.setTitle(option.type) |
| | | }) |
| | | } |
| | | this.$set(this.info, "eventType", option.type); |
| | | if (option.type == 1) { |
| | | this.$set(this.info, "reportType", 3); |
| | | } else if (option.type == 2) { |
| | | this.$set(this.info, "reportType", 4); |
| | | } else { |
| | | this.$set(this.info, "reportType", 5); |
| | | } |
| | | |
| | | let siteInfo = uni.getStorageSync("siteInfo"); |
| | | let userInfo = uni.getStorageSync("userInfo"); |
| | | this.$set(this.info, "houseCode", siteInfo.houseCode); |
| | | // this.$set(this.info, "districtName", siteInfo.name); |
| | | this.$set(this.info, "userId", userInfo.user_id); |
| | | } |
| | | |
| | | let siteInfo = uni.getStorageSync("siteInfo"); |
| | | let userInfo = uni.getStorageSync("userInfo"); |
| | | this.$set(this.info, "houseCode", siteInfo.houseCode); |
| | | this.$set(this.info, "districtName", siteInfo.name); |
| | | this.$set(this.info, "userId", userInfo.user_id); |
| | | }, |
| | | methods: { |
| | | |
| | | getDetail(id) { |
| | | getLabelReportingDetail({ |
| | | taskId: id |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | let data = res.data; |
| | | uni.setNavigationBarTitle({ |
| | | title: data.name |
| | | }) |
| | | for (let i in this.info) { |
| | | this.info[i] = data[i] |
| | | } |
| | | this.imageUrls = this.$setImageUrl(data.imageUrls, 2); |
| | | this.goodsImageUrls = this.$setImageUrl(data.goodsImageUrls, 2); |
| | | this.eventType = data.eventType; |
| | | this.info.eventType = data.eventType; |
| | | if (data.checkTime) { |
| | | this.checkTime = Number(new Date(data.checkTime)); |
| | | } |
| | | this.info.id = data.id; |
| | | this.info.taskId = data.taskId; |
| | | |
| | | if (data.eventType == 1) { |
| | | this.$set(this.info, "reportType", 3); |
| | | } else if (option.type == 2) { |
| | | this.$set(this.info, "reportType", 4); |
| | | } else { |
| | | this.$set(this.info, "reportType", 5); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | setTitle(type) { |
| | | if (type == 4) { |
| | | return "二手手机维修" |
| | |
| | | sumitInfo() { |
| | | this.$refs.form.validate().then(valid => { |
| | | this.checkImages() |
| | | saveLabelReporting(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '提交成功', |
| | | success() { |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | // this.$u.func.globalNavigator("", "navBack") |
| | | }, 1000) |
| | | } |
| | | }) |
| | | if (this.isEdit) { |
| | | this.info.status = 1; |
| | | this.setRequest() |
| | | } else { |
| | | this.addRequest() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | addRequest() { |
| | | saveLabelReporting(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '提交成功', |
| | | success() { |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 300) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | setRequest() { |
| | | setLabelReporting(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '保存成功' |
| | | }) |
| | | setTimeout(() => { |
| | | this.reLoadPrePage() |
| | | }, 300) |
| | | }) |
| | | }, |
| | | |
| | | //刷新上一页数据后返回 |
| | | reLoadPrePage() { |
| | | let pages = getCurrentPages(); |
| | | let prePage = pages[pages.length - 2]; |
| | | prePage.$vm.currentPage = 1; |
| | | prePage.$vm.list = []; |
| | | prePage.$vm.getList(); |
| | | uni.navigateBack(); |
| | | }, |
| | | |
| | | navigatorPage() { |
| | | this.$u.func.globalNavigator(`formList?type=${this.eventType}`, "navTo") |
| | | } |
| | |
| | | </u-form-item> |
| | | </view> |
| | | </u-form> |
| | | <button class="submit-btn" @click="sumitInfo">提交</button> |
| | | <button class="submit-btn" @click="sumitInfo">{{isEdit?"保存":"提交"}}</button> |
| | | <button class="list-btn" @click="navigatorPage">我上报的事件</button> |
| | | <u-datetime-picker ref="datetimePicker" :show="showSelectDate" v-model="checkTime" mode="datetime" |
| | | :formatter="formatter" @confirm="confirmDate" @cancel="showSelectDate = false"></u-datetime-picker> |
| | |
| | | <script> |
| | | import uploadMixin from "@/mixin/uploadMixin"; |
| | | import { |
| | | saveHotelReporting |
| | | saveHotelReporting, |
| | | setHotelReporting, |
| | | getHotelReportingDetail |
| | | } from "@/api/reporting/reporting"; |
| | | |
| | | export default { |
| | |
| | | data() { |
| | | return { |
| | | info: { |
| | | districtName: "", |
| | | hotelName: "", |
| | | checkUserName: "", |
| | | checkTelephone: "", |
| | |
| | | name: "以上皆未做到", |
| | | value: 6 |
| | | } |
| | | |
| | | ] |
| | | ], |
| | | isEdit: false, |
| | | id: "" |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | | let siteInfo = uni.getStorageSync("siteInfo"); |
| | | let userInfo = uni.getStorageSync("userInfo"); |
| | | this.$set(this.info, "houseCode", siteInfo.houseCode); |
| | | this.$set(this.info, "districtName", siteInfo.neiName || ""); |
| | | this.$set(this.info, "checkUserName", userInfo.real_name); |
| | | this.$set(this.info, "checkTelephone", userInfo.phone); |
| | | this.$set(this.info, "checkUserId", userInfo.user_id); |
| | | if (option.id) { |
| | | this.isEdit = true; |
| | | this.getDetail(option.id) |
| | | } else { |
| | | let siteInfo = uni.getStorageSync("siteInfo"); |
| | | let userInfo = uni.getStorageSync("userInfo"); |
| | | this.$set(this.info, "houseCode", siteInfo.houseCode); |
| | | // this.$set(this.info, "districtName", siteInfo.neiName || ""); |
| | | this.$set(this.info, "checkUserName", userInfo.real_name); |
| | | this.$set(this.info, "checkTelephone", userInfo.phone); |
| | | this.$set(this.info, "checkUserId", userInfo.user_id); |
| | | } |
| | | |
| | | }, |
| | | |
| | | onReady() { |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | getDetail(id) { |
| | | getHotelReportingDetail({ |
| | | taskId: id |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | let data = res.data; |
| | | for (let i in this.info) { |
| | | this.info[i] = data[i] |
| | | } |
| | | if (data.fireStatus) { |
| | | this.fireStatusIndex = [this.$getIndex(this.fireStatus[0], data.fireStatus)]; |
| | | } |
| | | |
| | | this.fireImageUrls = this.$setImageUrl(data.fireImageUrls, 2); |
| | | this.scImageUrls = this.$setImageUrl(data.scImageUrls, 2); |
| | | this.uanImageUrls = this.$setImageUrl(data.uanImageUrls, 2); |
| | | this.pfImageUrls = this.$setImageUrl(data.pfImageUrls, 2) |
| | | if (data.scStatus) { |
| | | this.scStatusIndex = [this.$getIndex(this.scStatus[0], data.scStatus)] |
| | | } |
| | | if (data.checkTime) { |
| | | this.checkTime = Number(new Date(data.checkTime)); |
| | | } |
| | | this.info.id = data.id; |
| | | this.info.taskId = data.taskId; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | |
| | | getLocation() { |
| | | uni.chooseLocation({ |
| | |
| | | sumitInfo() { |
| | | this.$refs.form.validate().then(valid => { |
| | | this.checkImages() |
| | | console.log("info=>", this.info); |
| | | saveHotelReporting(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '提交成功', |
| | | success() { |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | // that.$u.func.globalNavigator("", "navBack") |
| | | }, 1000) |
| | | } |
| | | }) |
| | | if (this.isEdit) { |
| | | this.info.id = this.id; |
| | | this.info.status = 1; |
| | | this.info.reportType = 2; |
| | | this.setHotelReportingRequest() |
| | | } else { |
| | | this.addHotelReportingRequest() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | addHotelReportingRequest() { |
| | | saveHotelReporting(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '提交成功', |
| | | success() { |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 300) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | setHotelReportingRequest() { |
| | | setHotelReporting(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '保存成功' |
| | | }) |
| | | setTimeout(() => { |
| | | this.reLoadPrePage() |
| | | }, 300) |
| | | }) |
| | | }, |
| | | |
| | | //刷新上一页数据后返回 |
| | | reLoadPrePage() { |
| | | let pages = getCurrentPages(); |
| | | let prePage = pages[pages.length - 2]; |
| | | prePage.$vm.currentPage = 1; |
| | | prePage.$vm.list = []; |
| | | prePage.$vm.getList(); |
| | | uni.navigateBack(); |
| | | }, |
| | | |
| | | navigatorPage() { |
| | | this.$u.func.globalNavigator('hotelList', "navTo") |
| | | } |
| | |
| | | <u-form labelPosition="left" :model="info" :rules="rules" ref="form" labelWidth="100" |
| | | :labelStyle="{fontSize:'28rpx'}"> |
| | | <view class="content"> |
| | | <u-form-item label="社区名称" prop="districtName" borderBottom required> |
| | | <!-- <u-form-item label="社区名称" prop="districtName" borderBottom required> |
| | | <view class="content-name f-28"> |
| | | {{info.districtName}} |
| | | </view> |
| | | </u-form-item> |
| | | </u-form-item> --> |
| | | <u-form-item label="校园名称" prop="campusName" borderBottom required> |
| | | <u-input v-model="info.campusName" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | inputAlign="right"></u-input> |
| | |
| | | </view> |
| | | |
| | | </u-form> |
| | | <button class="submit-btn" @click="sumitInfo">提交</button> |
| | | <button class="submit-btn" @click="sumitInfo">{{isEdit?"保存":"提交"}}</button> |
| | | <button class="list-btn" @click="navigatorPage">我上报的事件</button> |
| | | <u-datetime-picker ref="datetimePicker" :show="showSelectDate" v-model="checkTime" mode="datetime" |
| | | :formatter="formatter" @confirm="confirmDate" @cancel="showSelectDate = false"></u-datetime-picker> |
| | |
| | | <script> |
| | | import uploadMixin from "@/mixin/uploadMixin"; |
| | | import { |
| | | saveSchoolReporting |
| | | saveSchoolReporting, |
| | | getSchoolReportingDetail, |
| | | setSchoolReporting |
| | | } from "@/api/reporting/reporting"; |
| | | |
| | | export default { |
| | |
| | | data() { |
| | | return { |
| | | info: { |
| | | districtName: "", |
| | | campusName: "", |
| | | checkUserName: "", |
| | | checkTelephone: "", |
| | |
| | | name: "以上皆未配备", |
| | | value: 5 |
| | | } |
| | | ] |
| | | ], |
| | | isEdit: false, |
| | | id: "" |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | | let siteInfo = uni.getStorageSync("siteInfo"); |
| | | let userInfo = uni.getStorageSync("userInfo"); |
| | | this.$set(this.info, "houseCode", siteInfo.houseCode); |
| | | this.$set(this.info, "districtName", siteInfo.neiName || ""); |
| | | this.$set(this.info, "checkUserName", userInfo.real_name); |
| | | this.$set(this.info, "checkTelephone", userInfo.phone); |
| | | this.$set(this.info, "checkUserId", userInfo.user_id); |
| | | |
| | | if (option.id) { |
| | | this.isEdit = true; |
| | | this.id = option.id; |
| | | this.getDetail(option.id) |
| | | } else { |
| | | let siteInfo = uni.getStorageSync("siteInfo"); |
| | | let userInfo = uni.getStorageSync("userInfo"); |
| | | this.$set(this.info, "houseCode", siteInfo.houseCode); |
| | | // this.$set(this.info, "districtName", siteInfo.neiName || ""); |
| | | this.$set(this.info, "checkUserName", userInfo.real_name); |
| | | this.$set(this.info, "checkTelephone", userInfo.phone); |
| | | this.$set(this.info, "checkUserId", userInfo.user_id); |
| | | } |
| | | |
| | | |
| | | }, |
| | | |
| | | onReady() { |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | getDetail(id) { |
| | | getSchoolReportingDetail({ |
| | | taskId: id |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | let data = res.data; |
| | | for (let i in this.info) { |
| | | this.info[i] = data[i] |
| | | } |
| | | this.foImageUrls = this.$setImageUrl(data.foImageUrls, 2); |
| | | this.fireFacsImageUrls = this.$setImageUrl(data.fireFacsImageUrls, 2); |
| | | this.scImageUrls = this.$setImageUrl(data.scImageUrls, 2); |
| | | this.antiCollisionImageUrls = this.$setImageUrl(data.antiCollisionImageUrls, 2) |
| | | this.patrolImageUrls = this.$setImageUrl(data.patrolImageUrls, 2) |
| | | this.haImageUrls = this.$setImageUrl(data.haImageUrls, 2) |
| | | if (data.scStatus) { |
| | | this.scStatusIndex = [this.$getIndex(this.scStatus[0], data.scStatus)] |
| | | } |
| | | |
| | | if (data.checkTime) { |
| | | this.checkTime = Number(new Date(data.checkTime)); |
| | | } |
| | | this.info.id = data.id; |
| | | this.info.taskId = data.taskId; |
| | | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | |
| | | |
| | | getLocation() { |
| | | uni.chooseLocation({ |
| | |
| | | sumitInfo() { |
| | | this.$refs.form.validate().then(valid => { |
| | | this.checkImages() |
| | | saveSchoolReporting(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '提交成功', |
| | | success() { |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 1000) |
| | | } |
| | | }) |
| | | if (this.isEdit) { |
| | | this.setRequest() |
| | | } else { |
| | | this.addRequst() |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | |
| | | addRequst() { |
| | | saveSchoolReporting(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '提交成功', |
| | | success() { |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 300) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | setRequest() { |
| | | this.info.status = 1; |
| | | this.info.reportType = 6; |
| | | setSchoolReporting(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '修改成功', |
| | | }) |
| | | setTimeout(() => { |
| | | this.reLoadPrePage() |
| | | }, 300) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | navigatorPage() { |
| | | this.$u.func.globalNavigator('schoolList', "navTo") |
| | | } |
| | | }, |
| | | |
| | | //刷新上一页数据后返回 |
| | | reLoadPrePage() { |
| | | let pages = getCurrentPages(); |
| | | let prePage = pages[pages.length - 2]; |
| | | prePage.$vm.currentPage = 1; |
| | | prePage.$vm.list = []; |
| | | prePage.$vm.getList(); |
| | | uni.navigateBack(); |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| New file |
| | |
| | | <template> |
| | | <view class=""> |
| | | <view class="item-row flex j-c-s-b a-i-c"> |
| | | <text>走访类型</text> |
| | | <text>{{typeName}}</text> |
| | | </view> |
| | | <view class="item-row flex j-c-s-b a-i-c" v-if="info.type == 2"> |
| | | <text>重点人群类型</text> |
| | | <text>{{labelName}}</text> |
| | | </view> |
| | | <view class="item-row flex j-c-s-b a-i-c"> |
| | | <text>被访人姓名</text> |
| | | <text>{{houseHold.name}}</text> |
| | | </view> |
| | | <view class="item-row flex j-c-s-b a-i-c"> |
| | | <text>手机号</text> |
| | | <text>{{houseHold.phoneNumber}}</text> |
| | | </view> |
| | | <view class="item-row flex j-c-s-b a-i-c"> |
| | | <text>走访地址</text> |
| | | <text>{{houseHold.currentAddress}}</text> |
| | | </view> |
| | | <view class="item-row flex j-c-s-b a-i-c"> |
| | | <text>内容</text> |
| | | <text>{{info.context}}</text> |
| | | </view> |
| | | <view class="item-row flex j-c-s-b a-i-c"> |
| | | <text>内容</text> |
| | | <text>{{info.wordTime}}</text> |
| | | </view> |
| | | |
| | | <view class="image-wrap bgc-ff"> |
| | | <view class="image-item" v-for="(i,k) in images" @click="previewImage(i)"> |
| | | <u-image :src="i" width="80rpx" height="80rpx"></u-image> |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getWorkLogDetail |
| | | } from "@/api/workLog/workLog.js" |
| | | import { |
| | | getHouseholdDetail |
| | | } from '@/api/house/household.js' |
| | | export default { |
| | | data() { |
| | | return { |
| | | info: {}, |
| | | images: [], |
| | | typeName: "", |
| | | labelName: "", |
| | | houseHold: {}, |
| | | typeList: [], |
| | | labelList: [] |
| | | } |
| | | }, |
| | | async onLoad(option) { |
| | | await this.getTypeList(); |
| | | await this.getLabelLit(); |
| | | this.getDetail(option.id); |
| | | }, |
| | | methods: { |
| | | getDetail(id) { |
| | | getWorkLogDetail({ |
| | | id |
| | | }).then(res => { |
| | | this.info = res.data; |
| | | this.images = this.$setImageUrl(res.data.url); |
| | | this.getHousehold(res.data.houseHold); |
| | | this.typeName = this.getTypeValue(res.data.type); |
| | | this.labelName = this.getLabelValue(res.data.personType); |
| | | }) |
| | | }, |
| | | |
| | | |
| | | getTypeList() { |
| | | bizDictionary({ |
| | | code: "haveType" |
| | | }).then(res => { |
| | | console.log(res) |
| | | this.typeList = res.data; |
| | | }) |
| | | }, |
| | | |
| | | getLabelLit() { |
| | | getLabelListByParentId({ |
| | | parentId: 100 |
| | | }).then(res => { |
| | | this.labelList = res.data; |
| | | }) |
| | | }, |
| | | |
| | | getTypeValue(value) { |
| | | for (let i = 0, ii = this.typeList.length; i < ii; i++) { |
| | | if (value == this.typeList[i].dictKey) { |
| | | return this.typeList[i].dictValue |
| | | } |
| | | } |
| | | }, |
| | | |
| | | getLabelValue(value) { |
| | | for (let i = 0, ii = this.labelList.length; i < ii; i++) { |
| | | if (value == this.labelList[i].id) { |
| | | return this.labelList[i].name |
| | | } |
| | | } |
| | | }, |
| | | |
| | | getHousehold(id) { |
| | | getHouseholdDetail({ |
| | | id |
| | | }).then(res => { |
| | | console.log(res); |
| | | this.houseHold = res.data; |
| | | }) |
| | | }, |
| | | |
| | | previewImage(cur) { |
| | | uni.previewImage({ |
| | | urls: this.images, |
| | | current: cur |
| | | }) |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | page { |
| | | background-color: #f5f5f5; |
| | | } |
| | | |
| | | .item-row { |
| | | width: 100%; |
| | | padding: 30rpx; |
| | | box-sizing: border-box; |
| | | border-bottom: 1px solid #f5f5f5; |
| | | font-size: 28rpx; |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .image-wrap { |
| | | margin-top: 20rpx; |
| | | padding: 20rpx; |
| | | |
| | | .image-item { |
| | | margin-right: 20rpx; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | </u-sticky> |
| | | |
| | | <view class="list"> |
| | | <view class="list-item bgc-ff mb-20" v-for="(i,k) in list" :key="k"> |
| | | <view class="list-item bgc-ff mb-20" v-for="(i,k) in list" :key="k" @click="navTo(i.id,i.status)"> |
| | | <view class="item-title flex a-i-c j-c-s-b mb-20"> |
| | | <text class="f-32 fw">{{i.name}}</text> |
| | | <u-tag v-if="i.status == 1" text="待处理" type="warning" plain plainFill></u-tag> |
| | |
| | | this.loadingStatus = 'nomore' |
| | | }) |
| | | }, |
| | | navTo(name, id, type) { |
| | | |
| | | if (type == 1) { |
| | | this.$u.func.globalNavigator(`bailReportDetail?id=${id}`) |
| | | } else if (type == 2) { |
| | | this.$u.func.globalNavigator(`hotelReportDetail?id=${id}`) |
| | | } else if (type == 3 || type == 4 || type == 5) { |
| | | this.$u.func.globalNavigator(`labelReportDetail?id=${id}`) |
| | | } else if (type == 6) { |
| | | this.$u.func.globalNavigator(`schoolReportDetail?id=${id}`) |
| | | navTo(id, status) { |
| | | if (status == 1) { |
| | | this.$u.func.globalNavigator(`/subPackage/workbench/views/workLog?id=${id}`) |
| | | } else { |
| | | this.$u.func.globalNavigator(`workLogDetail?id=${id}`) |
| | | } |
| | | }, |
| | | |
| | |
| | | |
| | | <view class="list"> |
| | | <view class="list-item bgc-ff mb-20" v-for="(i,k) in list" :key="k" |
| | | @click="navTo(i.name,i.id,i.reportType)"> |
| | | @click="navTo(i.id,i.reportType,i.status)"> |
| | | <view class="item-title flex a-i-c j-c-s-b mb-20"> |
| | | <text class="f-32 fw">{{i.name}}</text> |
| | | <u-tag v-if="i.status == 4" text="待接收" type="warning" plain plainFill></u-tag> |
| | |
| | | title: "取保候审" |
| | | }) |
| | | } |
| | | if (option.from) { |
| | | if (option.from == "index") { |
| | | uni.setNavigationBarTitle({ |
| | | title: "场所任务" |
| | | }) |
| | | } |
| | | if (option.from == "task") { |
| | | this.tabIndex = 1; |
| | | this.currentStatus = 1; |
| | | } |
| | |
| | | this.loadingStatus = 'nomore' |
| | | }) |
| | | }, |
| | | navTo(name, id, type) { |
| | | navTo(id, type, status) { |
| | | if (status == 4) { |
| | | this.navToEdit(type, id); |
| | | } else { |
| | | this.navToDetail(type, id) |
| | | } |
| | | }, |
| | | |
| | | navToEdit(type, id) { |
| | | if (type == 1) { |
| | | this.$u.func.globalNavigator(`/subPackage/label/bail?id=${id}`) |
| | | } else if (type == 2) { |
| | | this.$u.func.globalNavigator(`/subPackage/label/hotel?id=${id}`) |
| | | } else if (type == 3 || type == 4 || type == 5) { |
| | | this.$u.func.globalNavigator(`/subPackage/label/form?id=${id}`) |
| | | } else if (type == 6) { |
| | | this.$u.func.globalNavigator(`/subPackage/label/school?id=${id}`) |
| | | } |
| | | }, |
| | | |
| | | navToDetail(type, id) { |
| | | if (type == 1) { |
| | | this.$u.func.globalNavigator(`bailReportDetail?id=${id}`) |
| | | } else if (type == 2) { |
| | |
| | | reLoadPrePage() { |
| | | let pages = getCurrentPages(); |
| | | let prePage = pages[pages.length - 2]; |
| | | prePage.$vm.currentPage = 1, |
| | | prePage.$vm.list = []; |
| | | prePage.$vm.currentPage = 1; |
| | | prePage.$vm.list = []; |
| | | prePage.$vm.getList(); |
| | | uni.navigateBack(); |
| | | }, |
| | |
| | | @cancel="isShowTypePicker = false" @confirm="confirmType()" keyName="dictValue"></u-picker> |
| | | <u-picker :show="isShowLabelPicker" :columns="labelList" :defaultIndex="labelIndex" |
| | | @cancel="isShowLabelPicker = false" @confirm="confirmLabelType()" keyName="name"></u-picker> |
| | | <footer-btn @click="submitInfo" /> |
| | | <footer-btn @click="submitInfo" :text="isEdit?'保存':'提交'" /> |
| | | |
| | | <u-popup :show="isShowPopup" mode="bottom" :round="10" closeable="true" @close="isShowPopup = false"> |
| | | <view class="popup-content"> |
| | |
| | | |
| | | <script> |
| | | import { |
| | | addWorkLog |
| | | addWorkLog, |
| | | getWorkLogDetail, |
| | | updateWorkLog |
| | | } from "@/api/workLog/workLog.js" |
| | | import uploadMixin from "@/mixin/uploadMixin"; |
| | | import { |
| | | bizDictionary |
| | | bizDictionary, |
| | | update |
| | | } from '@/api/system/dict.js' |
| | | import { |
| | | getLabelListByParentId |
| | |
| | | import { |
| | | fetchHousehold |
| | | } from "@/api/house/household.js" |
| | | import { |
| | | getHouseholdDetail |
| | | } from '@/api/house/household.js' |
| | | export default { |
| | | mixins: [uploadMixin], |
| | | data() { |
| | |
| | | images: [] |
| | | }, |
| | | info: { |
| | | name: "", |
| | | phone: "", |
| | | // name: "", |
| | | // phone: "", |
| | | context: "" |
| | | }, |
| | | rules: { |
| | |
| | | houseHoldList: [], |
| | | selectedHousehold: {}, |
| | | isShowPopup: false, |
| | | address: "" |
| | | address: "", |
| | | isEdit: false, |
| | | id: "" |
| | | } |
| | | }, |
| | | // onLoad() { |
| | |
| | | // }, |
| | | |
| | | |
| | | onLoad() { |
| | | this.getTypeList(); |
| | | this.getLabelLit(); |
| | | async onLoad(option) { |
| | | await this.getTypeList(); |
| | | await this.getLabelLit(); |
| | | if (option.id) { |
| | | this.isEdit = true; |
| | | this.id = option.id; |
| | | this.getDetail(option.id) |
| | | } |
| | | }, |
| | | |
| | | |
| | | methods: { |
| | | |
| | | |
| | | getDetail(id) { |
| | | getWorkLogDetail({ |
| | | id |
| | | }).then(res => { |
| | | console.log(res); |
| | | if (res.code == 200) { |
| | | let data = res.data |
| | | this.typeIndex = this.getTypeValue(data.type).index; |
| | | this.typeName = this.getTypeValue(data.type).name; |
| | | this.workTime = Number(new Date(data.workTime)) |
| | | this.info.type = data.type; |
| | | this.info.workTime = data.workTime; |
| | | this.info.context = data.context; |
| | | this.info.householdId = data.householdId; |
| | | this.info.personType = data.personType; |
| | | this.labelIndex = this.getLabelValue(data.personType).index; |
| | | this.labelName = this.getLabelValue(data.personType).name; |
| | | this.getHouseholdList(); |
| | | this.getHousehold(data.householdId); |
| | | this.form.images = this.$setImageUrl(data.url, 2); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | getTypeValue(value) { |
| | | for (let i = 0, ii = this.typeList[0].length; i < ii; i++) { |
| | | if (value == this.typeList[0][i].dictKey) { |
| | | return { |
| | | index: [i], |
| | | name: this.typeList[0][i].dictValue |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | getLabelValue(value) { |
| | | for (let i = 0, ii = this.labelList[0].length; i < ii; i++) { |
| | | if (value == this.labelList[0][i].id) { |
| | | return { |
| | | index: [i], |
| | | name: this.labelList[0][i].name |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | getTypeList() { |
| | | bizDictionary({ |
| | |
| | | parentId: 100 |
| | | }).then(res => { |
| | | this.labelList = [res.data]; |
| | | }) |
| | | }, |
| | | |
| | | getHousehold(id) { |
| | | getHouseholdDetail({ |
| | | id |
| | | }).then(res => { |
| | | console.log(res); |
| | | this.address = res.data.currentAddress; |
| | | this.selectedHousehold = res.data; |
| | | }) |
| | | }, |
| | | |
| | |
| | | submitInfo() { |
| | | this.$refs.form.validate().then(valid => { |
| | | this.checkImages(); |
| | | addWorkLog(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '提交成功', |
| | | success() { |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 1000) |
| | | } |
| | | }) |
| | | this.info.status = 2; |
| | | if (this.isEdit) { |
| | | this.updateWorkLogRequest() |
| | | } else { |
| | | this.addWorkLogRequest() |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | |
| | | addWorkLogRequest() { |
| | | addWorkLog(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '提交成功', |
| | | success() { |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 1000) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | updateWorkLogRequest() { |
| | | updateWorkLog(this.info).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '提交成功', |
| | | success() { |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 1000) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |