dialogTsFormSubmit(formName){
var that = this
var material_id = that.materialTSCLForm.parent_id;
if(that.materialTSCLForm.material_specs_id == ""){
that.$message({
message: "请选择规格或编号!",
type: 'warning'
})
return ;
}
this.$refs[formName].validate((valid) => {
if (valid) {
// 开启loading
that.$confirm('确认提交?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$(".dialogTsFormSubmit").attr("disabled" , true)
that.loadingstatus = true
that.materialTSCLForm.actionType = that.type
that.materialTSCLForm._token = '{{ csrf_token() }}'
$.ajax({
url: "/admin/materials/createTsInfo",
type: "POST",
data: that.materialTSCLForm,
dataType:'json',
success: function (res) {
if (res.code == 200) {
that.$message({
message: res.message,
type: 'success'
});
// 成功后重载 关闭提交框
that.getTsclList(material_id)
that.dialogTSCLFormVisible = false;
}else{
that.$message.error(res.message);
}
that.loadingstatus = false
}
});
});
} else {
return false;
}
});
}
VUE的保存写法,对话框、提示框
最新推荐文章于 2024-06-06 10:02:08 发布