正则等问题优化
This commit is contained in:
parent
e337b040d1
commit
a8f41928e3
|
|
@ -131,7 +131,7 @@ export function getReportFormListApi(data) {
|
|||
// 月计划-导入计划 --基建
|
||||
export function getImportMonthPlanApi(data) {
|
||||
return request_yn({
|
||||
url: '/ynPlanApp/infMonth/getPrevPlan',
|
||||
url: '/ynPlanApp/infWeb/getPrevPlan',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
|
@ -318,7 +318,7 @@ export function getReportFormListProApi(data) {
|
|||
// 月计划-导入计划 --基建
|
||||
export function getImportMonthPlanProApi(data) {
|
||||
return request_yn({
|
||||
url: '/ynPlanApp/proMonth/getPrevPlan',
|
||||
url: '/ynPlanApp/proWeb/getPrevPlan',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ export function getReportFormListApi(data) {
|
|||
// 月计划-导入计划 --基建
|
||||
export function getImportMonthPlanApi(data) {
|
||||
return request_yn({
|
||||
url: '/ynPlanApp/infMonth/getPrevPlan',
|
||||
url: '/ynPlanApp/infWeek/getPrevPlan',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ export default {
|
|||
// 获取定位位置信息
|
||||
uni.getLocation({
|
||||
type: 'gcj02', // 默认为 gcj02,可以选择 'wgs84'
|
||||
// altitude: true,
|
||||
altitude: true,
|
||||
geocode: true,
|
||||
success: res => {
|
||||
console.log(res, '位置信息--')
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@
|
|||
:type="f.isType ? f.isType : 'text'"
|
||||
v-model="item[f.name]"
|
||||
placeholder="请填写"
|
||||
@input="handleInput($event, f.isType, index, f.name)"
|
||||
/>
|
||||
<!-- <uni-easyinput
|
||||
v-if="f.items_type === 'ipt' && f.name != 'rys' && f.name != 'zynr'"
|
||||
|
|
@ -193,7 +194,7 @@
|
|||
></uni-data-select>
|
||||
|
||||
<view v-if="f.name === 'rys'" @tap="onAddSubUserInfo(f.name)">
|
||||
<uni-easyinput :autoHeight="true" type="text" v-model="item.rys" placeholder="请选择" />
|
||||
<u--input :autoHeight="true" type="text" v-model="item.rys" placeholder="请选择" disabled />
|
||||
|
||||
<!-- <uni-easyinput
|
||||
v-else
|
||||
|
|
@ -1594,14 +1595,16 @@ export default {
|
|||
}
|
||||
const params = {
|
||||
proId: this.projectId,
|
||||
month: this.DateValue
|
||||
planDate: this.DateValue
|
||||
}
|
||||
|
||||
console.log(params, 'params')
|
||||
const res = await getImportMonthPlanApi(params)
|
||||
console.log('导入计划的结果', res)
|
||||
if (res.res == 0) {
|
||||
uni.showToast({ title: '获取失败,该日期上月无计划', icon: 'none' })
|
||||
uni.showToast({ title: '获取失败,该日期上日无计划', icon: 'none' })
|
||||
this.monthParams = []
|
||||
this.monthParams.push(this.paramsItem)
|
||||
return
|
||||
} else {
|
||||
this.monthParams = res.obj
|
||||
|
|
@ -1654,6 +1657,22 @@ export default {
|
|||
})
|
||||
this.$refs.popupWorkContent.close()
|
||||
} catch (error) {}
|
||||
},
|
||||
handleInput(e, type, index, name) {
|
||||
if (type == 'number') {
|
||||
const regex = /^[1-9]\d*$/
|
||||
if (!regex.test(e)) {
|
||||
// console.log('不符合要求', typeof e)
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = ''
|
||||
e = ''
|
||||
})
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = e
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -185,6 +185,7 @@
|
|||
:type="f.isType ? f.isType : 'text'"
|
||||
v-model="item[f.name]"
|
||||
placeholder="请填写"
|
||||
@input="handleInput($event, f.isType, index, f.name)"
|
||||
/>
|
||||
<uni-data-select
|
||||
v-model="item[f.name]"
|
||||
|
|
@ -1614,14 +1615,16 @@ export default {
|
|||
}
|
||||
const params = {
|
||||
proId: this.projectId,
|
||||
month: this.DateValue
|
||||
planDate: this.DateValue
|
||||
}
|
||||
|
||||
console.log(params, 'params')
|
||||
const res = await getImportMonthPlanProApi(params)
|
||||
console.log('导入计划的结果', res)
|
||||
if (res.res == 0) {
|
||||
uni.showToast({ title: '获取失败,该日期上月无计划', icon: 'none' })
|
||||
uni.showToast({ title: '获取失败,该日期上日无计划', icon: 'none' })
|
||||
this.monthParams = []
|
||||
this.monthParams.push(this.paramsItem)
|
||||
return
|
||||
} else {
|
||||
this.monthParams = res.obj
|
||||
|
|
@ -1693,6 +1696,22 @@ export default {
|
|||
})
|
||||
} catch (error) {}
|
||||
// console.log('result_1', result_1, 'result_2', result_2)
|
||||
},
|
||||
handleInput(e, type, index, name) {
|
||||
if (type == 'number') {
|
||||
const regex = /^[1-9]\d*$/
|
||||
if (!regex.test(e)) {
|
||||
// console.log('不符合要求', typeof e)
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = ''
|
||||
e = ''
|
||||
})
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = e
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -176,6 +176,7 @@
|
|||
:type="f.isType ? f.isType : 'text'"
|
||||
v-model="item[f.name]"
|
||||
placeholder="请填写"
|
||||
@input="handleInput($event, f.isType, index, f.name)"
|
||||
/>
|
||||
<uni-data-select
|
||||
v-model="item[f.name]"
|
||||
|
|
@ -566,6 +567,7 @@ import {
|
|||
getReportFormListApi,
|
||||
getImportMonthPlanApi
|
||||
} from '../../../api/workPlan/monthPlan'
|
||||
import editProfileVue from '../../YNEduApp/user/editProfile.vue'
|
||||
export default {
|
||||
components: {
|
||||
TimeSelect
|
||||
|
|
@ -643,7 +645,14 @@ export default {
|
|||
rules: [{ required: true, errorMessage: '请填写单位负责人/联系电话' }]
|
||||
},
|
||||
planCount: {
|
||||
rules: [{ required: true, errorMessage: '请填写计划数量' }]
|
||||
rules: [
|
||||
{ required: true, errorMessage: '请填写计划数量' },
|
||||
{
|
||||
pattern: /^[1-9]\d*$/,
|
||||
message: '请输入正整数',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
infrastructureFormLabel: [
|
||||
|
|
@ -1512,10 +1521,28 @@ export default {
|
|||
console.log('导入计划的结果', res)
|
||||
if (res.res == 0) {
|
||||
uni.showToast({ title: '获取失败,该日期上月无计划', icon: 'none' })
|
||||
this.monthParams = []
|
||||
this.monthParams.push(this.paramsItem)
|
||||
return
|
||||
} else {
|
||||
this.monthParams = res.obj
|
||||
}
|
||||
},
|
||||
handleInput(e, type, index, name) {
|
||||
if (type == 'number') {
|
||||
const regex = /^[1-9]\d*$/
|
||||
if (!regex.test(e)) {
|
||||
// console.log('不符合要求', typeof e)
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = ''
|
||||
e = ''
|
||||
})
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = e
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -169,6 +169,7 @@
|
|||
:type="f.isType ? f.isType : 'text'"
|
||||
v-model="item[f.name]"
|
||||
placeholder="请填写"
|
||||
@input="handleInput($event, f.isType, index, f.name)"
|
||||
/>
|
||||
<uni-data-select
|
||||
v-model="item[f.name]"
|
||||
|
|
@ -1585,10 +1586,28 @@ export default {
|
|||
console.log('导入计划的结果', res)
|
||||
if (res.res == 0) {
|
||||
uni.showToast({ title: '获取失败,该日期上月无计划', icon: 'none' })
|
||||
this.monthParams = []
|
||||
this.monthParams.push(this.paramsItem)
|
||||
return
|
||||
} else {
|
||||
this.monthParams = res.obj
|
||||
}
|
||||
},
|
||||
handleInput(e, type, index, name) {
|
||||
if (type == 'number') {
|
||||
const regex = /^[1-9]\d*$/
|
||||
if (!regex.test(e)) {
|
||||
// console.log('不符合要求', typeof e)
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = ''
|
||||
e = ''
|
||||
})
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = e
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@
|
|||
:type="f.isType ? f.isType : 'text'"
|
||||
v-model="item[f.name]"
|
||||
placeholder="请填写"
|
||||
@input="handleInput($event, f.isType, index, f.name)"
|
||||
/>
|
||||
<uni-data-select
|
||||
v-model="item[f.name]"
|
||||
|
|
@ -1431,6 +1432,8 @@ export default {
|
|||
console.log('导入计划的结果', res)
|
||||
if (res.res == 0) {
|
||||
uni.showToast({ title: '获取失败,该日期上月无计划', icon: 'none' })
|
||||
this.monthParams = []
|
||||
this.monthParams.push(this.paramsItem)
|
||||
return
|
||||
} else {
|
||||
this.monthParams = res.obj
|
||||
|
|
@ -1440,6 +1443,22 @@ export default {
|
|||
console.log(e, index, '******')
|
||||
|
||||
this.monthParams[index].tdsj = `${e[0]}~${e[1]}`
|
||||
},
|
||||
handleInput(e, type, index, name) {
|
||||
if (type == 'number') {
|
||||
const regex = /^[1-9]\d*$/
|
||||
if (!regex.test(e)) {
|
||||
// console.log('不符合要求', typeof e)
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = ''
|
||||
e = ''
|
||||
})
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = e
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@
|
|||
:type="f.isType ? f.isType : 'text'"
|
||||
v-model="item[f.name]"
|
||||
placeholder="请填写"
|
||||
@input="handleInput($event, f.isType, index, f.name)"
|
||||
/>
|
||||
<uni-data-select
|
||||
v-model="item[f.name]"
|
||||
|
|
@ -1439,6 +1440,8 @@ export default {
|
|||
console.log('导入计划的结果', res)
|
||||
if (res.res == 0) {
|
||||
uni.showToast({ title: '获取失败,该日期上月无计划', icon: 'none' })
|
||||
this.monthParams = []
|
||||
this.monthParams.push(this.paramsItem)
|
||||
return
|
||||
} else {
|
||||
this.monthParams = res.obj
|
||||
|
|
@ -1448,6 +1451,22 @@ export default {
|
|||
console.log(e, index, '******')
|
||||
|
||||
this.monthParams[index].tdsj = `${e[0]}~${e[1]}`
|
||||
},
|
||||
handleInput(e, type, index, name) {
|
||||
if (type == 'number') {
|
||||
const regex = /^[1-9]\d*$/
|
||||
if (!regex.test(e)) {
|
||||
// console.log('不符合要求', typeof e)
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = ''
|
||||
e = ''
|
||||
})
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = e
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -196,6 +196,7 @@
|
|||
:type="f.isType ? f.isType : 'text'"
|
||||
v-model="item[f.name]"
|
||||
placeholder="请填写"
|
||||
@input="handleInput($event, f.isType, index, f.name)"
|
||||
/>
|
||||
<uni-data-select
|
||||
v-model="item[f.name]"
|
||||
|
|
@ -1727,6 +1728,22 @@ export default {
|
|||
},
|
||||
onChangeTimeDateRange(e) {
|
||||
console.log('eeee', e)
|
||||
},
|
||||
handleInput(e, type, index, name) {
|
||||
if (type == 'number') {
|
||||
const regex = /^[1-9]\d*$/
|
||||
if (!regex.test(e)) {
|
||||
// console.log('不符合要求', typeof e)
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = ''
|
||||
e = ''
|
||||
})
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = e
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -188,6 +188,7 @@
|
|||
:type="f.isType ? f.isType : 'text'"
|
||||
v-model="item[f.name]"
|
||||
placeholder="请填写"
|
||||
@input="handleInput($event, f.isType, index, f.name)"
|
||||
/>
|
||||
<uni-data-select
|
||||
v-model="item[f.name]"
|
||||
|
|
@ -1801,6 +1802,22 @@ export default {
|
|||
},
|
||||
onChangeTimeDateRange(e) {
|
||||
console.log('eeee', e)
|
||||
},
|
||||
handleInput(e, type, index, name) {
|
||||
if (type == 'number') {
|
||||
const regex = /^[1-9]\d*$/
|
||||
if (!regex.test(e)) {
|
||||
// console.log('不符合要求', typeof e)
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = ''
|
||||
e = ''
|
||||
})
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = e
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@
|
|||
:type="f.isType ? f.isType : 'text'"
|
||||
v-model="item[f.name]"
|
||||
placeholder="请填写"
|
||||
@input="handleInput($event, f.isType, index, f.name)"
|
||||
/>
|
||||
|
||||
<uni-data-select
|
||||
|
|
@ -1703,14 +1704,16 @@ export default {
|
|||
}
|
||||
const params = {
|
||||
proId: this.projectId,
|
||||
month: this.DateValue
|
||||
week: `${this.weekStart}~${this.weekEnd}`
|
||||
}
|
||||
|
||||
console.log(params, 'params')
|
||||
const res = await getImportMonthPlanApi(params)
|
||||
console.log('导入计划的结果', res)
|
||||
if (res.res == 0) {
|
||||
uni.showToast({ title: '获取失败,该日期上月无计划', icon: 'none' })
|
||||
uni.showToast({ title: '获取失败,该日期上周无计划', icon: 'none' })
|
||||
this.monthParams = []
|
||||
this.monthParams.push(this.paramsItem)
|
||||
return
|
||||
} else {
|
||||
this.monthParams = res.obj
|
||||
|
|
@ -1806,6 +1809,22 @@ export default {
|
|||
|
||||
this.weekStartCurrent = this.$moment().week(this.$moment().week()).startOf('week').format('YYYY-MM-DD')
|
||||
this.weekEndCurrent = this.$moment().week(this.$moment().week()).endOf('week').format('YYYY-MM-DD')
|
||||
},
|
||||
handleInput(e, type, index, name) {
|
||||
if (type == 'number') {
|
||||
const regex = /^[1-9]\d*$/
|
||||
if (!regex.test(e)) {
|
||||
// console.log('不符合要求', typeof e)
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = ''
|
||||
e = ''
|
||||
})
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = e
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -207,6 +207,7 @@
|
|||
:type="f.isType ? f.isType : 'text'"
|
||||
v-model="item[f.name]"
|
||||
placeholder="请填写"
|
||||
@input="handleInput($event, f.isType, index, f.name)"
|
||||
/>
|
||||
<uni-data-select
|
||||
v-model="item[f.name]"
|
||||
|
|
@ -1768,14 +1769,16 @@ export default {
|
|||
}
|
||||
const params = {
|
||||
proId: this.projectId,
|
||||
month: this.DateValue
|
||||
week: `${this.weekStart}~${this.weekEnd}`
|
||||
}
|
||||
|
||||
console.log(params, 'params')
|
||||
const res = await getImportMonthPlanProApi(params)
|
||||
console.log('导入计划的结果', res)
|
||||
if (res.res == 0) {
|
||||
uni.showToast({ title: '获取失败,该日期上月无计划', icon: 'none' })
|
||||
uni.showToast({ title: '获取失败,该日期上周无计划', icon: 'none' })
|
||||
this.monthParams = []
|
||||
this.monthParams.push(this.paramsItem)
|
||||
return
|
||||
} else {
|
||||
this.monthParams = res.obj
|
||||
|
|
@ -1871,6 +1874,22 @@ export default {
|
|||
|
||||
this.weekStartCurrent = this.$moment().week(this.$moment().week()).startOf('week').format('YYYY-MM-DD')
|
||||
this.weekEndCurrent = this.$moment().week(this.$moment().week()).endOf('week').format('YYYY-MM-DD')
|
||||
},
|
||||
handleInput(e, type, index, name) {
|
||||
if (type == 'number') {
|
||||
const regex = /^[1-9]\d*$/
|
||||
if (!regex.test(e)) {
|
||||
// console.log('不符合要求', typeof e)
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = ''
|
||||
e = ''
|
||||
})
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.monthParams[index][name] = e
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue