解决新增项目的bug
parent
65794e3e46
commit
da6513a0c9
|
@ -196,9 +196,10 @@ export default {
|
|||
return callback()
|
||||
} else {
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error("只能输入字母和数字"))
|
||||
return callback(new Error("只能输入字母和数字"))
|
||||
}
|
||||
}
|
||||
return callback()
|
||||
}
|
||||
let validateAmount = (rule, value, callback) => {//定义合通额大于等于0,而且只到小数点后2位
|
||||
var reg = new RegExp("^(([0-9]|([1-9][0-9]{0,9}))((\\.[0-9]{1,2})?))$");
|
||||
|
@ -206,9 +207,10 @@ export default {
|
|||
return callback()
|
||||
} else {
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error("请输入正确的合同额"))
|
||||
return callback(new Error("请输入正确的合同额"))
|
||||
}
|
||||
}
|
||||
return callback()
|
||||
}
|
||||
let validateFinancial = (rule, value, callback) => {//定义财务编码只能输入数字
|
||||
var reg = new RegExp("^\\d+$|^\\d+[.]?\\d+$");
|
||||
|
@ -216,13 +218,13 @@ export default {
|
|||
return callback()
|
||||
} else {
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error("请输入正确的财务编码"))
|
||||
return callback(new Error("请输入正确的财务编码"))
|
||||
}
|
||||
}
|
||||
return callback()
|
||||
}
|
||||
|
||||
return {
|
||||
dialogFormVisible: false,
|
||||
formLabelWidth: '120px',
|
||||
|
||||
currentProjectSubClasses: [],
|
||||
|
@ -355,9 +357,10 @@ export default {
|
|||
|
||||
//对表单进行提交验证
|
||||
this.$refs[formName].validate((valid) => {
|
||||
const that = this
|
||||
if (valid) {
|
||||
console.log('submit')
|
||||
let form = this.ruleForm
|
||||
let { ...form} = this.ruleForm
|
||||
form.projectFinalTestTime = form.projectFinalTestTime.getTime() / 1000
|
||||
form.projectEndTime = form.projectEndTime.getTime() / 1000
|
||||
form.projectFirstTestTime = form.projectFirstTestTime.getTime() / 1000
|
||||
|
@ -371,6 +374,8 @@ export default {
|
|||
console.log(response)
|
||||
if (response.data.code === 200) {
|
||||
//console.log(response.data.data.records)
|
||||
that.dialogFormVisible = false
|
||||
that.$emit("created");
|
||||
ElMessage({
|
||||
message: '新增项目成功',
|
||||
type: 'success',
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<CreateProjectDialog v-model:dialogFormVisible="dialogFormVisible" :projectClasses="projectClasses"
|
||||
:projectSubClasses="projectSubClasses"></CreateProjectDialog>
|
||||
:projectSubClasses="projectSubClasses" @created="getProjects"></CreateProjectDialog>
|
||||
|
||||
</template>
|
||||
<script setup>
|
||||
|
|
Loading…
Reference in New Issue