新增编辑防抖

dev_2022-03-03
yujialong 3 years ago
parent 517c26d5a0
commit 2249fc7dd9
  1. 4
      src/setting.js
  2. 7
      src/views/course/AddCurriculum.vue
  3. 2
      src/views/course/Curriculum.vue
  4. 12
      src/views/customer/AddCustomer.vue
  5. 2
      src/views/order/Order.vue
  6. 7
      src/views/serve/projectAdd.vue

@ -10,8 +10,8 @@ let jumpPath = "";
let host = ""; let host = "";
if (isDev) { if (isDev) {
// jumpPath = "http://www.huorantech.cn/judgmentPoint/"; // jumpPath = "http://www.huorantech.cn/judgmentPoint/";
jumpPath = "http://39.108.250.202/judgmentPoint/"; // jumpPath = "http://39.108.250.202/judgmentPoint/";
// jumpPath = "http://192.168.31.254:8087/"; // 本地调试-需要启动本地判分点系统 jumpPath = "http://192.168.31.125:8087/"; // 本地调试-需要启动本地判分点系统
// host = "http://www.huorantech.cn:9000";//线上 // host = "http://www.huorantech.cn:9000";//线上
host = "http://39.108.250.202:9000";//测试 host = "http://39.108.250.202:9000";//测试
// host = 'http://192.168.31.151:9000'// 榕 // host = 'http://192.168.31.151:9000'// 榕

@ -340,7 +340,8 @@ export default {
assessmentData: [], assessmentData: [],
assessmentTotal: 0, assessmentTotal: 0,
multipleAssessment: [] multipleAssessment: [],
submiting: false //
}; };
}, },
watch: { watch: {
@ -594,6 +595,7 @@ export default {
saveAdd(form) { saveAdd(form) {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (valid) { if (valid) {
if (this.submiting) return false
if (!this.form.coverUrl) { if (!this.form.coverUrl) {
this.$message.warning("请上传课程封面"); this.$message.warning("请上传课程封面");
return; return;
@ -626,11 +628,13 @@ export default {
return obj; return obj;
}); });
} }
this.submiting = true
if (this.form.cid) { if (this.form.cid) {
this.$post(this.api.modifyCourse, this.form).then((res) => { this.$post(this.api.modifyCourse, this.form).then((res) => {
this.$message.success("编辑成功"); this.$message.success("编辑成功");
this.$router.back(); this.$router.back();
}).catch((res) => { }).catch((res) => {
this.submiting = false
}); });
} else { } else {
this.$post(this.api.createCurriculum, this.form).then((res) => { this.$post(this.api.createCurriculum, this.form).then((res) => {
@ -644,6 +648,7 @@ export default {
this.$router.back(); this.$router.back();
}); });
}).catch((res) => { }).catch((res) => {
this.submiting = false
}); });
} }
} else { } else {

@ -72,7 +72,7 @@
<span>课程列表</span> <span>课程列表</span>
</div> </div>
<div> <div>
<el-button type="primary" round class="mag" @click="addcourse">新建课程</el-button> <el-button type="primary" round @click="addcourse">新建课程</el-button>
<el-button type="primary" round @click="delAllSelection">批量删除</el-button> <el-button type="primary" round @click="delAllSelection">批量删除</el-button>
</div> </div>
</div> </div>

@ -397,6 +397,7 @@ export default {
NoAdd: true, NoAdd: true,
phoneRepeat: false, phoneRepeat: false,
emailRepeat: false, emailRepeat: false,
submiting: false //
}; };
}, },
mounted() { mounted() {
@ -552,7 +553,7 @@ export default {
saveAdd(formName){ saveAdd(formName){
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
console.log(this.phoneRepeat); if (this.submiting) return false
if (this.phoneRepeat) { if (this.phoneRepeat) {
this.$message.warning("该手机号已存在"); this.$message.warning("该手机号已存在");
return; return;
@ -561,6 +562,7 @@ export default {
this.$message.warning("该邮箱已存在"); this.$message.warning("该邮箱已存在");
return; return;
} }
this.submiting = true
if(this.NoAdd){ if(this.NoAdd){
let obj = {}; let obj = {};
obj = this.schoolList.find((item)=>{ obj = this.schoolList.find((item)=>{
@ -591,7 +593,9 @@ export default {
this.$post(this.api.updateCustomer,data).then((res) => { this.$post(this.api.updateCustomer,data).then((res) => {
this.$message.success('编辑成功') this.$message.success('编辑成功')
this.goback() this.goback()
}).catch((res) => {}) }).catch((res) => {
this.submiting = false
})
}else{ }else{
this.$post(this.api.addCustomer,data).then((res) => { this.$post(this.api.addCustomer,data).then((res) => {
let customerId = res.customerId let customerId = res.customerId
@ -615,7 +619,9 @@ export default {
this.$message.success('添加成功') this.$message.success('添加成功')
this.goback() this.goback()
}).catch((res) => {}) }).catch((res) => {
this.submiting = false
})
} }
}else{ }else{
this.$message.warning('该客户已存在') this.$message.warning('该客户已存在')

@ -65,7 +65,7 @@
<span>订单列表</span> <span>订单列表</span>
</div> </div>
<div> <div>
<el-button type="primary" round class="mag" @click="addOrder()">新建订单</el-button> <el-button type="primary" round @click="addOrder()">新建订单</el-button>
<el-button type="primary" round @click="delAllSelection">批量删除</el-button> <el-button type="primary" round @click="delAllSelection">批量删除</el-button>
</div> </div>
</div> </div>

@ -265,6 +265,7 @@ export default {
isToPoint: false, // isToPoint: false, //
visibleLoading: false, // visibleLoading: false, //
listLoading:false,// listLoading:false,//
submiting: false //
}; };
}, },
computed: { computed: {
@ -438,9 +439,11 @@ export default {
return true; return true;
}, },
handleSubmit(state) { // handleSubmit(state) { //
if (this.submiting) return false
if (!this.judgmentRelease()) { // if (!this.judgmentRelease()) { //
return; return;
} }
this.submiting = true
this.$store.dispatch("setSystemId", this.projectManage.systemId); this.$store.dispatch("setSystemId", this.projectManage.systemId);
this.projectManage.state = state; this.projectManage.state = state;
let { systemId } = this.projectManage; let { systemId } = this.projectManage;
@ -488,7 +491,7 @@ export default {
this.$router.back(); this.$router.back();
} }
}).catch(err => { }).catch(err => {
console.log(err); this.submiting = false
}); });
}, },
addProject(params) { // addProject(params) { //
@ -498,7 +501,7 @@ export default {
this.$router.back(); this.$router.back();
} }
}).catch(err => { }).catch(err => {
console.log(err); this.submiting = false
}); });
}, },
manualDistributionScore() { // manualDistributionScore() { //

Loading…
Cancel
Save