Commit 8fdb1ab9 authored by levante's avatar levante

Initial commit

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