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