diff --git a/ruoyi-ui/src/api/kaohe/pingce.js b/ruoyi-ui/src/api/kaohe/pingce.js
index 0673e02..92a4693 100644
--- a/ruoyi-ui/src/api/kaohe/pingce.js
+++ b/ruoyi-ui/src/api/kaohe/pingce.js
@@ -60,7 +60,7 @@ export function addsUser(data) {
return request({
url: '/system/user/adds',
method: 'post',
- params: data
+ data: data
})
}
diff --git a/ruoyi-ui/src/views/kaohe/pingce/index.vue b/ruoyi-ui/src/views/kaohe/pingce/index.vue
index 8b21d95..333c513 100644
--- a/ruoyi-ui/src/views/kaohe/pingce/index.vue
+++ b/ruoyi-ui/src/views/kaohe/pingce/index.vue
@@ -90,7 +90,7 @@
-
+
考核得分
+ >生成考核得分
+
+ 查看考核得分
-
@@ -493,8 +481,8 @@
-
-
+
+
@@ -507,6 +495,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -528,6 +542,7 @@ export default {
components: { Treeselect, TableColumn },
data() {
return {
+ // 考核得分
khdf:{
open: false,
list: [],
@@ -656,7 +671,24 @@ export default {
itemIds: null
},
// 评分选项类型数据
- vote_options: []
+ vote_options: [],
+ // 生成评分账号
+ scpfzh:{
+ open: false,
+ form:{},
+ rules: {
+ deptId: [
+ { required: true, message: "所属部门不能为空", trigger: "change" }
+ ],
+ items: [
+ { required: true, message: "评分考核项不能为空", trigger: "change" }
+ ],
+ num: [
+ { required: true, message: "生成账号数量不能为空", trigger: "change" }
+ ],
+ },
+ itemsOtions: [],
+ },
}
},
watch: {
@@ -965,18 +997,6 @@ export default {
item.vote.pingceId = this.pcSetUp.pingceId;
item.vote.pingceName = this.pcSetUp.pingceName;
}
- /*if(item.vote.voteItems){
- item.vote.voteItems = item.vote.voteItems.split(',');
- let VoteItemsName = []
- item.vote.voteItems.forEach(e => {
- this.vote_options.forEach(e1 => {
- if(e === e1.id){
- VoteItemsName.push(e1.vitemName)
- }
- })
- })
- item.vote['voteItemsName'] = VoteItemsName.join(',');
- }*/
pcSetUpList.push(item);
})
this.pcSetUp.list = pcSetUpList;
@@ -1026,12 +1046,6 @@ export default {
type: 'Danger'
})
}
- /*if(row.typeId===1 && (!Vote.voteItems)){
- flag = false;
- this.$alert(`评分选项不能为空!`, `提示`, {
- type: 'Danger'
- })
- }*/
if(row.typeId!==1 && (!Vote.maxNum)){
flag = false;
this.$alert(`最大值不能为空!`, `提示`, {
@@ -1050,29 +1064,15 @@ export default {
type: 'Danger'
})
}
- /*if(!Vote.vDescription){
- flag = false;
- this.$alert(`评分详情描述不能为空!`, `提示`, {
- type: 'Danger'
- })
- }*/
-
if(row.typeId===1){
Vote.voteItems = '1,2,3,4'
}
-
if (Vote.id != null && flag ) {
- /*if(Vote.voteItems){
- Vote.voteItems = Vote.voteItems.join(',')
- }*/
updateVote(Vote).then(response => {
this.$modal.msgSuccess("修改成功")
this.cancelVote()
})
} else if(Vote.id === null && flag){
- /*if(Vote.voteItems){
- Vote.voteItems = Vote.voteItems.join(',')
- }*/
Vote.state = '0'
addVote(Vote).then(response => {
this.$modal.msgSuccess("新增成功")
@@ -1087,27 +1087,6 @@ export default {
goVotepage(row){
this.$router.push({ path: '/votepage', query: { id: row.vote.id }});
},
- // 生成评分账号
- handleAddsUser(row){
- this.$prompt('请输入生成数量', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- inputPattern: /^([1-9][0-9]){1,3}$/,
- inputErrorMessage: '生成数量格式不正确'
- }).then(({ value }) => {
- addsUser({
- pcId: 1,
- num: value
- }).then(response => {
- this.$modal.msgSuccess("生成成功")
- })
- }).catch(() => {
-
- });
- },
- viewUser(){
- this.$router.push({ path: '/system/user', query: { pcId: 1}});
- },
getVoteItemsList() {
listVote_items({
pageSize: 1000000,
@@ -1156,20 +1135,24 @@ export default {
this.emp.queryParams.deptId = data.id;
this.empQuery();
},
- goTotalScore(row){
- this.khdf.list = [];
- this.khdf.tableHeader = [];
- this.khdf.open = true;
+ // 生成考核得分
+ goKaoHeScore(row){
generateResult({
id: row.id,
pcTitle: row.pcTitle,
bkhdxType: row.bkhdxType,
}).then(response => {
- this.getListKhResult(row.id)
- }).catch(e=>{
- this.getListKhResult(row.id)
+ this.$modal.msgSuccess("生成成功")
})
},
+ // 查看考核得分
+ viewKaoHeScore(row){
+ this.khdf.list = [];
+ this.khdf.tableHeader = [];
+ this.khdf.open = true;
+ this.getListKhResult(row.id);
+ },
+ // 获取考核得分列表
getListKhResult(pcId){
listKh_result({
pageNum: 1,
@@ -1177,7 +1160,6 @@ export default {
pcId: pcId,
}).then(response => {
this.khdf.list = JSON.parse(response.rows[0].tableData);
-
let btTabelTree = JSON.parse(response.rows[0].tableHeader);
btTabelTree.forEach(item => {
item.prop = item.name;
@@ -1185,13 +1167,10 @@ export default {
this.setProp(item.children, item.prop)
}
})
-
this.khdf.tableHeader = btTabelTree;
-
- console.log(this.khdf.list,8787);
- console.log(this.khdf.tableHeader,9898);
})
},
+ // 递归函数 设置prop参数
setProp(list, prop){
list.forEach(item=>{
if(prop){
@@ -1203,6 +1182,44 @@ export default {
this.setProp(item.children, item.prop)
}
})
+ },
+ // 生成评分账号
+ handleAddsUser(row){
+ this.scpfzh.form = {
+ deptId: null,
+ pcId: row.id,
+ items: null,
+ itemIds: null,
+ num: null,
+ }
+ this.scpfzh.itemsOtions = []
+ getItemVote({
+ id: row.templateId,
+ pingceId: row.id,
+ }).then(response => {
+ this.scpfzh.itemsOtions = response.data.items
+ this.scpfzh.open = true;
+ })
+ },
+ // 查看评分账号
+ viewUser(row){
+ this.$router.push({ path: '/system/user', query: { pcId: row.id}});
+ },
+ // 提交生成评分账号
+ scpfzhSubmit(){
+ this.$refs["scpfzhForm"].validate(valid => {
+ if (valid) {
+ this.scpfzh.form.itemIds = this.scpfzh.form.items.join(",")
+ addsUser(this.scpfzh.form).then(response => {
+ this.scpfzh.open = false;
+ this.$modal.msgSuccess("生成成功")
+ })
+ }
+ })
+ },
+ // 取消生成评分账号
+ scpfzhCancel(){
+ this.scpfzh.open = false;
}
}
}