提交 707737a3 编写于 作者: tao.wu's avatar tao.wu

no message

上级 ab9793d9
......@@ -19,7 +19,8 @@ export const checkRange = (rule, value, callback) => {
// 校验是否是整数
export const checkIsInteger = (rule, value, callback) => {
if(Number.isInteger(parseFloat(value))){
const num = Number.isInteger(parseFloat(value));
if(num){
callback()
}else{
callback(new Error(`输入整数`))
......@@ -35,3 +36,14 @@ export const checkNumberIsToFixed = (rule, value, callback) => {
callback(new Error(`最多输入1位小数`))
}
}
// 大于0的正整数
export const checkNormalInt = (rule, value, callback) => {
const isInteger = Number.isInteger(parseFloat(value));
const num = parseFloat(value);
if(isInteger && num > 0){
callback()
}else{
callback(new Error(`请输入大于0的正整数`))
}
}
import { checkNormalInt } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
return [
{
......@@ -32,7 +34,7 @@ export default ($this) => {
type: 'number',
labmsg: '次',
slots: [{ name: '次', type: 'append' }],
rules: [{ required: true, message: '请输入发病次数', trigger: 'submit' }]
rules: [{ required: true, message: '请输入发病次数', trigger: 'submit' }, { validator: checkNormalInt , trigger: 'submit' }]
},
{
formType: 'date-picker',
......
......@@ -111,10 +111,11 @@
});
}
console.log(this.formData)
this.formData.doctorId = parseFloat(this.doctorId)
this.formData.saveWay = parseFloat(this.saveWay)
this.formData.planPatientsTimesId = parseFloat(this.planPatientsTimesId)
this.formData.scaleNo = this.scaleNo
this.formData.doctorId = parseFloat(this.doctorId);
this.formData.saveWay = parseFloat(this.saveWay);
this.formData.planPatientsTimesId = parseFloat(this.planPatientsTimesId);
this.formData.scaleNo = this.scaleNo;
this.formData.isLine = 2;
console.log(JSON.stringify(this.formData))
if(this.valid){
......@@ -165,7 +166,7 @@
this.doctorId = this.$route.query.doctorId
axios({
method: 'get',
url: getFollowUpSC(`/scale/${this.planPatientsTimesId}/${this.scaleNo}/info?type=2`),
url: getFollowUpSC(`/scale/${this.planPatientsTimesId}/${this.scaleNo}/info?type=2&isLine=2`),
data: JSON.stringify(this.formData),
}).then(res=>{
this.formData = res.data.data
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册