|
@@ -1,8 +1,7 @@
|
|
|
<template>
|
|
|
<view style="background-color: #fff;" v-if="content != null">
|
|
|
<view style="height: 100%;overflow: auto;">
|
|
|
- <u--form labelPosition="left" labelAlign="center" :model="content" ref="uForm" :rules="rules"
|
|
|
- errorType="toast" :labelStyle="{fontSize:'32rpx'}" labelWidth="120">
|
|
|
+ <u--form labelPosition="left" labelAlign="center" :model="content" ref="uForm" :rules="rules" :labelStyle="{fontSize:'32rpx'}" labelWidth="120">
|
|
|
<view v-if="fkFlow == '006'">
|
|
|
<u-form-item label="出差处室:" borderBottom prop="outWorkDept">
|
|
|
<u--input v-model="content.outWorkDept" border="none" readonly></u--input>
|
|
@@ -91,6 +90,40 @@
|
|
|
</view>
|
|
|
</u-form-item>
|
|
|
</view>
|
|
|
+ <view v-if="fkFlow == '015'">
|
|
|
+ <u-form-item label="申请人:" borderBottom ref="item1">
|
|
|
+ <u--input v-model="content.createBy" border="none" readonly></u--input>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="联系电话:" borderBottom prop="phone" ref="item1">
|
|
|
+ <u--input v-model="content.phone" placeholder="请输入联系电话" border="none"></u--input>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="用车日期:" borderBottom prop="startUseTime" @click="show = true">
|
|
|
+ <view :style="{color:content.startUseTime==null?'rgb(192, 196, 204)':''}">
|
|
|
+ {{content.startUseTime == null?'请选择起止日期':content.startUseTime+' 至 '+content.endUseTime}}
|
|
|
+ </view>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="用车天数:" borderBottom ref="item1">
|
|
|
+ <u--input v-model="content.dayNum" border="none" readonly
|
|
|
+ placeholder="请填写用车天数"></u--input>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="乘车人数:" borderBottom prop="carNum" ref="item1">
|
|
|
+ <u--input v-model="content.carNum" border="none" type="number"
|
|
|
+ placeholder="请填写乘车人数"></u--input>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="目的地:" borderBottom prop="addres" ref="item1">
|
|
|
+ <u--textarea v-model="content.addres" placeholder="请填写目的地" border="none"
|
|
|
+ height="100"></u--textarea>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="用途:" borderBottom prop="useMessage">
|
|
|
+ <u--textarea v-model="content.useMessage" placeholder="请填写用途" border="none"
|
|
|
+ height="100"></u--textarea>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="接收人:" borderBottom prop="toEmpsName" v-if="fzr == true" @click="peoShow = true">
|
|
|
+ <view :style="{color:content.toEmpsName==null?'rgb(192, 196, 204)':''}">
|
|
|
+ {{content.params.toEmps == null?'请选择接收人':content.toEmpsName}}
|
|
|
+ </view>
|
|
|
+ </u-form-item>
|
|
|
+ </view>
|
|
|
<view style="padding: 0 20rpx;">
|
|
|
<u-button type="primary" text="提交" @click="submit" style="margin-top: 40rpx;"></u-button>
|
|
|
</view>
|
|
@@ -128,7 +161,7 @@ import { handleTree } from '../../utils/wjw'
|
|
|
statusList: [],
|
|
|
//上个页面传过来的参数
|
|
|
parameter: null,
|
|
|
- fkFlow: null, // 006 中层出差 007 外出授课备案 009请假
|
|
|
+ fkFlow: null, // 006 中层出差 007 外出授课备案 009请假 015用车
|
|
|
show: false, //日历
|
|
|
fzr:false,//判断是否是负责人
|
|
|
peoShow:false,
|
|
@@ -201,7 +234,6 @@ import { handleTree } from '../../utils/wjw'
|
|
|
},
|
|
|
},
|
|
|
rules3: {
|
|
|
- leaveReason: null,
|
|
|
leaveTpye: {
|
|
|
type: 'string',
|
|
|
required: true,
|
|
@@ -227,6 +259,56 @@ import { handleTree } from '../../utils/wjw'
|
|
|
trigger: ['blur', 'change']
|
|
|
},
|
|
|
},
|
|
|
+ rules4:{
|
|
|
+ phone: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入手机号',
|
|
|
+ trigger: ['change','blur'],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // 自定义验证函数,见上说明
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ // 上面有说,返回true表示校验通过,返回false表示不通过
|
|
|
+ // uni.$u.test.mobile()就是返回true或者false的
|
|
|
+ return uni.$u.test.mobile(value);
|
|
|
+ },
|
|
|
+ message: '手机号码不正确',
|
|
|
+ // 触发器可以同时用blur和change
|
|
|
+ trigger: ['change','blur'],
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ addres: {
|
|
|
+ type: 'string',
|
|
|
+ required: true,
|
|
|
+ message: '请填写目的地',
|
|
|
+ trigger: ['blur', 'change']
|
|
|
+ },
|
|
|
+ startUseTime: {
|
|
|
+ type: 'string',
|
|
|
+ required: true,
|
|
|
+ message: '请选择起止时间',
|
|
|
+ trigger: ['blur', 'change']
|
|
|
+ },
|
|
|
+ useMessage: {
|
|
|
+ type: 'string',
|
|
|
+ required: true,
|
|
|
+ message: '请填写用途',
|
|
|
+ trigger: ['blur', 'change']
|
|
|
+ },
|
|
|
+ carNum: {
|
|
|
+ type: 'number',
|
|
|
+ required: true,
|
|
|
+ message: '请填写乘车人数',
|
|
|
+ trigger: ['blur', 'change']
|
|
|
+ },
|
|
|
+ toEmpsName:{
|
|
|
+ type: 'string',
|
|
|
+ required: true,
|
|
|
+ message: '请选择接收人',
|
|
|
+ trigger: ['blur', 'change']
|
|
|
+ },
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -237,7 +319,7 @@ import { handleTree } from '../../utils/wjw'
|
|
|
this.getPeoList(options.fkFlow)
|
|
|
}
|
|
|
for(let i in roles){
|
|
|
- if(roles[i].roleKey == 'chushifzr' && options.fkFlow=='009'){
|
|
|
+ if(roles[i].roleKey == 'chushifzr' && options.fkFlow=='009' || roles[i].roleKey == 'chushifzr' && options.fkFlow=='015' ){
|
|
|
this.fzr = true
|
|
|
this.getPeoList(options.fkFlow)
|
|
|
break
|
|
@@ -396,7 +478,46 @@ import { handleTree } from '../../utils/wjw'
|
|
|
})
|
|
|
})
|
|
|
break
|
|
|
- }
|
|
|
+ case '015':
|
|
|
+ uni.$u.http.post("/offcial/car/startApplyCar", this.content).then(res => {
|
|
|
+ if (res.data.VarAcceptersName != "" && res.data.VarAcceptersName != "结束") {
|
|
|
+ uni.showToast({
|
|
|
+ title: "已发送到" + res.data.VarToNodeName + "节点,接收人:" + res
|
|
|
+ .data.VarAcceptersName,
|
|
|
+ icon: "none",
|
|
|
+ mask: true,
|
|
|
+ duration: 3000
|
|
|
+ })
|
|
|
+ } else if (res.data.VarAcceptersName == "结束") {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.Message,
|
|
|
+ icon: "none",
|
|
|
+ mask: true,
|
|
|
+ duration: 3000
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.Message.replace(/[@]/g, ""),
|
|
|
+ icon: "none",
|
|
|
+ mask: true,
|
|
|
+ duration: 3000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ uni.$emit('query', {
|
|
|
+ a: 'back'
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateBack()
|
|
|
+ }, 2000)
|
|
|
+ }).catch(res => {
|
|
|
+ uni.hideLoading()
|
|
|
+ uni.showToast({
|
|
|
+ title: "请稍后重试",
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ break
|
|
|
+ }
|
|
|
}).catch(errors => {
|
|
|
console.log(errors)
|
|
|
})
|
|
@@ -407,10 +528,12 @@ import { handleTree } from '../../utils/wjw'
|
|
|
case '006':
|
|
|
this.content.startTime = e[0]
|
|
|
this.content.endTime = e[e.length - 1]
|
|
|
+ this.$refs.uForm.validateField("startTime")
|
|
|
break
|
|
|
case '007':
|
|
|
this.content.startTime = e[0]
|
|
|
this.content.endTime = e[e.length - 1]
|
|
|
+ this.$refs.uForm.validateField("startTime")
|
|
|
break
|
|
|
case '009':
|
|
|
this.content.leaveStartTime = e[0]
|
|
@@ -420,6 +543,17 @@ import { handleTree } from '../../utils/wjw'
|
|
|
}else{
|
|
|
this.content.leaveNumber = e.length
|
|
|
}
|
|
|
+ this.$refs.uForm.validateField("leaveStartTime")
|
|
|
+ break
|
|
|
+ case '015':
|
|
|
+ this.content.startUseTime = e[0]
|
|
|
+ this.content.endUseTime = e[e.length - 1]
|
|
|
+ if(e[0]==e[e.length - 1]){
|
|
|
+ this.content.dayNum = 1
|
|
|
+ }else{
|
|
|
+ this.content.dayNum = e.length
|
|
|
+ }
|
|
|
+ this.$refs.uForm.validateField("startUseTime")
|
|
|
break
|
|
|
}
|
|
|
this.show = false
|
|
@@ -487,6 +621,23 @@ import { handleTree } from '../../utils/wjw'
|
|
|
this.content.toEmpsName = null
|
|
|
}
|
|
|
break
|
|
|
+ case '015':
|
|
|
+ this.content = {
|
|
|
+ startUseTime:null,
|
|
|
+ phone:null,
|
|
|
+ endUseTime:null,
|
|
|
+ dayNum:null,
|
|
|
+ addres:null,
|
|
|
+ useMessage:null,
|
|
|
+ carNum:null,
|
|
|
+ createBy:uni.getStorageSync('userInfo').nickName,
|
|
|
+ params:{}
|
|
|
+ }
|
|
|
+ if(this.fzr == true){
|
|
|
+ this.content.params.toEmps = null
|
|
|
+ this.content.toEmpsName = null
|
|
|
+ }
|
|
|
+ break
|
|
|
}
|
|
|
},
|
|
|
getRules(v) {
|
|
@@ -500,6 +651,9 @@ import { handleTree } from '../../utils/wjw'
|
|
|
case '009':
|
|
|
this.rules = this.rules3
|
|
|
break
|
|
|
+ case '015':
|
|
|
+ this.rules = this.rules4
|
|
|
+ break
|
|
|
}
|
|
|
},
|
|
|
//获取接收人信息
|
|
@@ -512,6 +666,7 @@ import { handleTree } from '../../utils/wjw'
|
|
|
},
|
|
|
onReady() {
|
|
|
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
|
|
|
+ // if()
|
|
|
this.$refs.uForm.setRules(this.rules)
|
|
|
},
|
|
|
}
|