增加新增专家功能

This commit is contained in:
范露尧
2023-09-14 21:16:41 +08:00
parent deba0675d7
commit 93e9ae19f8
6 changed files with 104 additions and 2 deletions

View File

@@ -27,7 +27,34 @@
<h3 style="text-align:center;">
<el-button @click="load_vote">刷新数据</el-button>
<el-button @click="show_expert_vote">查看项目投票情况</el-button>
<el-button @click="show_dialog">新增专家</el-button>
</h3>
<el-dialog title="新增专家" :visible.sync="dialogVisible" width="20%">
<div class="blocks">
<el-input v-model="addexpertnum" placeholder="输入新增专家个数" style="width:100px"></el-input>
<el-button @click="add_expert">确定</el-button>
</div>
</el-dialog>
<!--<el-dialog v-model="dialogVisible" title="弹框" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false" append-to-body width="60%">
<el-form :model="pageData.loginForm" ref="loginFormRef" label-position="top">
<el-form-item label="手机号码" label-width="80px" prop="phone" :rules="[{ required: true, trigger: 'blur', min: 11, max: 11, message: '请输入正确的手机号码' }]">
<el-input v-model="pageData.loginForm.phone" autocomplete="off" />
</el-form-item>
<el-form-item label="验证码" label-width="80px" prop="code" :rules="[{ required: true, trigger: 'blur', min: 4, max: 4, message: '请输入验证码' }]">
<el-input type="text" maxlength="4" placeholder="验证码" v-model="pageData.loginForm.code">
<template slot="append" #append>
<el-button :disabled="pageData.loginForm.disabled" @click="(v,v2)=>funHandles.getCode(v,pageData,loginFormRef)">{{ pageData.loginForm.valiBtn }}</el-button>
</template>
</el-input>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">-->
<!--<el-button @click="dialogFormVisible = false">Cancel</el-button>-->
<!--<el-button type="primary" @click="(v,v2)=>funHandles.verifyKey(pageData,loginFormRef)">登录</el-button>
</span>
</template>
</el-dialog>-->
</div>
</body>
<style scoped>
@@ -43,7 +70,9 @@
return {
tableData: [],
loading: false,
token: ''
token: '',
dialogVisible: false,
addexpertnum: 0
}
},
created: function () {
@@ -79,6 +108,8 @@
console.log(_this.tableData)
_this.loading = false;
}).catch(function (error) {
if (error.response.status == 403)
location = '../manage/login.html'
console.log(error)
_this.$message({
type: 'error',
@@ -108,6 +139,35 @@
};
return fmt;
}
,
show_dialog() {
this.dialogVisible = true
}
,
add_expert() {
this.loading = true;
let _this = this;
axios({
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
method: 'post',
url: '/gb/yjb/api/projects/expert',
data: { expertnum: this.addexpertnum },
responseType: "json",
headers: {
Authorization: 'Bearer ' + _this.token
}
}).then(function (response) {
_this.loading = false;
location.reload();
}).catch(function (error) {
console.log(error)
_this.$message({
type: 'error',
message: error.message
})
_this.loading = false;
})
}
}
})
</script>

View File

@@ -109,6 +109,8 @@
//console.log(_this.tableData0)
_this.loading = false;
}).catch(function (error) {
if (error.response.status == 403)
location = '../manage/login.html'
console.log(error)
_this.$message({
type: 'error',