Commit 8fdb1ab9 authored by levante's avatar levante

Initial commit

parent 36740f55
......@@ -140,15 +140,27 @@ Vue.use(Calendar)
Vue.use(Tooltip)
import { NavBar } from 'vant';
Vue.use(NavBar);
import { Form as vantForm } from 'vant';
import { Field } from 'vant';
import { Button as vantButton } from 'vant';
import { Calendar as vanCalendar } from 'vant';
import { Picker as vanPicker } from 'vant';
import { DatetimePicker as vanDatetimePicker } from 'vant';
import { Popup } from 'vant';
import { Notify } from 'vant';
import { Dialog } from 'vant';
Vue.use(vantForm);
Vue.use(NavBar);
Vue.use(Field);
Vue.use(vantButton);
Vue.use(vanCalendar)
Vue.use(vanPicker)
Vue.use(vanDatetimePicker)
Vue.use(Popup)
Vue.use(Notify)
Vue.use(Dialog)
import 'vant/lib/index.css';
......
......@@ -12,17 +12,17 @@ const router = new Router({
routes,
})
router.beforeEach((to, from, next) => {
// TODO
store.commit('setWebviewSrc', to.meta && to.meta.src) // 判断有src的话为需要嵌入iframe的子项目
// router.beforeEach((to, from, next) => {
// // TODO
// store.commit('setWebviewSrc', to.meta && to.meta.src) // 判断有src的话为需要嵌入iframe的子项目
const token = Cookie.get('token')
// 当前无token且不在login页面则推到登录页面
if (to.path != '/login' && !token) {
next('/login')
} else {
next()
}
})
// const token = Cookie.get('token')
// // 当前无token且不在login页面则推到登录页面
// if (to.path != '/login' && !token) {
// next('/login')
// } else {
// next()
// }
// })
export default router
let BASE_URL = '', MOCK_URL='',
let BASE_URL = '', MOCK_URL='',WBX_URL = '',
FANGDI_URL = 'http://962121.fgj.sh.gov.cn/wyweb/shanghaiwuye'
switch (process.env.NODE_ENV) {
......@@ -39,6 +39,7 @@ default: // 默认环境下(开发环境)
// BASE_URL = 'http://211.136.105.193/apiv2'
// BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2'
BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2'
WBX_URL = 'http://wbx.omniview.pro'
// BASE_URL = 'http://pudong.hm.omniview.pro/api/v2'
// BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2'
BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2'
......@@ -228,5 +229,6 @@ export default {
POST_LABEL_RESULT_PREVIEW: '/service-customkey-ddd/findLabelObject', // 标签预览
POST_LABEL_CREATE_CONFIRM: '/service-customkey-ddd/label/confirm',
GET_ID_INFO_BY_LABEL: '/service-customkey-ddd/label/resource/datas',
GET_WY_AND_YWH_LIST: '/service-customkey-ddd/datas'
GET_WY_AND_YWH_LIST: '/service-customkey-ddd/datas',
POST_RESERVATION_FORM: WBX_URL + '/api/service-documents/repair/reservation'
}
<template>
<div style="height: 100%; background-color: #F5F5F5">
<van-dialog v-model="showDialog" title="是否再填写一份?" showConfirmButton show-cancel-button @confirm='clearAllFormFields'></van-dialog>
<van-nav-bar
title="首页"
left-arrow
/>
<van-form @submit="onSubmit" style="border-radius: 10px; margin: 10px">
......@@ -10,61 +10,81 @@
v-model="sectName"
label="小区名称"
placeholder="请输入"
:rules="[{ required: true, message: '请填写小区名称!' }]"
:rules="[{ required: true, message: '此项为必填项!' }]"
required
clearable
label-width='8em'
/>
<van-field
v-model="sectAddr"
label="小区地址"
v-model="sectAddrRoad"
label="小区地址(路名)"
placeholder="请输入"
:rules="[{ required: true, message: '请填写小区地址!' }]"
:rules="[{ required: true, message: '此项为必填项!' }]"
required
clearable
label-width='8em'
/>
<van-field
v-model="sectAddrLong"
label="小区地址(弄/号)"
placeholder="请输入"
:rules="[{ required: true, message: '此项为必填项!' }]"
required
clearable
label-width='8em'
/>
<van-field
v-model="mpzAddr"
label="门牌幢地址"
placeholder="例:19号101室"
:rules="[{ required: true, message: '请填写门牌幢地址!' }]"
:rules="[{ required: true, message: '此项为必填项!' }]"
required
clearable
label-width='8em'
/>
<!-- 报修部位 -->
<van-field
<!-- <van-field
readonly
clickable
name="picker"
:value="repairArea"
label="报修部位"
placeholder="请选择"
@click="showPicker = true"
@click="showrepairAreaPicker = true"
:rules="[{ required: true, message: '请至少选择一项!' }]"
/>
<van-popup v-model="repairAreaPicker" position="bottom">
<van-popup v-model="showrepairAreaPicker" position="bottom">
<van-picker
show-toolbar
:columns="columns"
:columns="areaColumns"
@confirm="repairAreaConfirm"
@cancel="showrepairAreaPicker = false"
/>
</van-popup>
</van-popup> -->
<!-- 报修类型 -->
<van-field
<!-- <van-field
readonly
clickable
name="picker"
:value="repairType"
label="报修类型"
placeholder="请选择"
@click="showPicker = true"
@click="showrepairTypePicker = true"
:rules="[{ required: true, message: '请至少选择一项!' }]"
/>
<van-popup v-model="repairTypePicker" position="bottom">
<van-popup v-model="showrepairTypePicker" position="bottom">
<van-picker
show-toolbar
:columns="columns"
:columns="typeColumns"
@confirm="repairTypeConfirm"
@cancel="showrepairTypePicker = false"
/>
</van-popup>
-->
<van-field
v-model="description"
......@@ -75,7 +95,10 @@
maxlength="150"
placeholder="请输入详细信息"
show-word-limit
:rules="[{ required: true, message: '请填写详细信息!' }]"
:rules="[{ required: true, message: '此项为必填项!' }]"
required
clearable
label-width='8em'
/>
<van-field
......@@ -86,9 +109,12 @@
label="上门日期"
placeholder="请选择"
@click="showCalendar = true"
:rules="[{ required: true, message: '请选择上门日期!' }]"
:rules="[{ required: true, message: '此项为必填项!' }]"
required
clearable
label-width='8em'
/>
<van-calendar v-model="showCalendar" @confirm="onConfirm" />
<van-calendar v-model="showCalendar" @confirm="calendarOnConfirm" />
<van-field
readonly
......@@ -97,14 +123,17 @@
:value="dueTime"
label="上门时间"
placeholder="请选择"
@click="showPicker = true"
:rules="[{ required: true, message: '请选择上门时间!' }]"
@click="showTime = true"
:rules="[{ required: true, message: '此项为必填项!' }]"
required
clearable
label-width='8em'
/>
<van-popup v-model="showPicker" position="bottom">
<van-popup v-model="showTime" position="bottom">
<van-datetime-picker
type="time"
@confirm="onConfirm"
@cancel="showPicker = false"
@confirm="timeOnConfirm"
@cancel="showTime = false"
/>
</van-popup>
<div style="margin: 16px;">
......@@ -118,8 +147,12 @@
export default {
data() {
return {
areaColumns: [],
typeColumns: [],
sectName: '',
sectAddr: '',
sectAddrRoad: '',
sectAddrLong: '',
mpzAddr: '',
repairArea: '',
repairType: '',
......@@ -132,18 +165,58 @@ export default {
showrepairAreaPicker: false,
showrepairTypePicker: false,
showCalendar: false,
showTime: false,
showDialog: false
}
},
mounted() {},
mounted() {
},
methods:{
onConfirm() {},
onSubmit() {
const parseForm = {
stNameFrst: sectName,
this.$ajax.post({
url: this.$api.POST_RESERVATION_FORM,
params: {
"stNameFrst": this.sectName,
"unitLoad": this.sectAddrRoad,
"unitLong": this.sectAddrLong,
"addrFrst": this.mpzAddr,
"place": this.repairArea,
"type": this.repairType,
"dscr": this.description,
"homeDate": this.dueDate,
"homeTime": this.dueTime
}
}).then(res => {
if(res.code == 200) {
this.$notify({ type: 'primary', message: '提交成功!' });
this.showDialog = !this.showDialog
}
})
},
repairAreaConfirm() {},
repairTypeConfirm() {}
repairTypeConfirm() {},
calendarOnConfirm(val) {
this.dueDate = this.$moment(val).format('YYYY-MM-DD')
this.showCalendar = !this.showCalendar
},
timeOnConfirm(val) {
this.dueTime = val
this.showTime = !this.showTime
},
clearAllFormFields() {
this.sectName = ''
this.sectAddrRoad = ''
this.sectAddrLong = ''
this.mpzAddr = ''
this.repairArea = ''
this.repairType = ''
this.description = ''
this.dueDate = ''
this.dueTime = ''
}
}
}
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment