|
@@ -64,8 +64,8 @@
|
|
|
<el-table-column prop="remark" label="内容" width="500" style="padding-right:30px;"></el-table-column>
|
|
|
<el-table-column label="分值">
|
|
|
<template slot-scope="scope">
|
|
|
- <div v-if="scope.row.range_type == 1"><span :class="scope.row.min_point > 0?'color_red':'color_green'"> {{scope.row.min_point}} </span> {{types_list[scope.row.pt_id]}} </div>
|
|
|
- <div v-if="scope.row.range_type == 2"><span :class="scope.row.min_point > 0?'color_red':'color_green'"> {{scope.row.min_point}} </span> 至 <span :class="scope.row.max_point > 0?'color_red':'color_green'"> {{scope.row.max_point}} </span> {{types_list[scope.row.pt_id]}} </div>
|
|
|
+ <div v-if="scope.row.range_type == 1"><span :class="scope.row.min_point > 0?'color_green':'color_red'"> {{scope.row.min_point}} </span> {{types_list[scope.row.pt_id]}} </div>
|
|
|
+ <div v-if="scope.row.range_type == 2"><span :class="scope.row.min_point > 0?'color_green':'color_red'"> {{scope.row.min_point}} </span> 至 <span :class="scope.row.max_point > 0?'color_green':'color_red'"> {{scope.row.max_point}} </span> {{types_list[scope.row.pt_id]}} </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -356,7 +356,11 @@
|
|
|
save_loading: false,
|
|
|
import_btn_show: false,
|
|
|
fileList: [],
|
|
|
- file: null
|
|
|
+ file: null,
|
|
|
+
|
|
|
+ ruleTreeList: [],//规则分类列表
|
|
|
+ ruleTree_pid: [],//上级分类Pid
|
|
|
+ itemRule_id: [],//所属分类rule_id
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -800,7 +804,7 @@
|
|
|
if(self.dept_formdata.pid.length>0){
|
|
|
self.dept_formdata.pid = self.dept_formdata.pid[self.dept_formdata.pid.length - 1] || 0
|
|
|
}else{
|
|
|
- self.dept_formdata.pid = 0
|
|
|
+ self.dept_formdata.pid = 0;
|
|
|
}
|
|
|
self.dept_formdata.rule_id = self.dept_formdata.id
|
|
|
this.$http('put','/api/integral/rule', self.dept_formdata).then((res) => {
|
|
@@ -835,13 +839,29 @@
|
|
|
this.class_show = false
|
|
|
this.$refs[form].resetFields()
|
|
|
},
|
|
|
+ ruleTree_list(rule){
|
|
|
+ rule.forEach((item)=>{
|
|
|
+ this.ruleTreeList.push({
|
|
|
+ id: item.id,
|
|
|
+ pid: item.pid
|
|
|
+ })
|
|
|
+ if(item.child.length > 0){
|
|
|
+ this.ruleTree_list(item.child)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
get_department_list(done) {
|
|
|
this.dept_loading = true
|
|
|
this.$http('get','/api/integral/rule/trees',{cycle_type: '1',keyword:this.keyword}).then((res) => {
|
|
|
this.dept_list = res.data.data.rule_tree
|
|
|
- console.log(this.dept_list)
|
|
|
+ //展开多维数组分类rule_tree。
|
|
|
+ this.ruleTreeList = []
|
|
|
+ this.ruleTree_list(res.data.data.rule_tree)
|
|
|
+
|
|
|
this.rule_category_list = []
|
|
|
this.item_list = res.data.data.item_list
|
|
|
+
|
|
|
+
|
|
|
this.parse_tree(this.dept_list, this.pid)
|
|
|
if (this.pid > 0) {
|
|
|
this.list = this.cur_item_list
|
|
@@ -913,11 +933,36 @@
|
|
|
cycle_type: '1'
|
|
|
}
|
|
|
},
|
|
|
+ //递归寻找当前点击的所有上级id。
|
|
|
+ ruleTree_data(id,ifs){
|
|
|
+ let that = ifs ? this.ruleTree_pid : this.itemRule_id
|
|
|
+ let list = this.ruleTreeList
|
|
|
+ that.unshift(id)
|
|
|
+ list.some((item)=>{
|
|
|
+ if(item.id == id){
|
|
|
+ if(item.pid > 0){
|
|
|
+ this.ruleTree_data(item.pid,ifs)
|
|
|
+ }else{
|
|
|
+ if(ifs){
|
|
|
+ this.dept_formdata.pid = that
|
|
|
+ }else{
|
|
|
+ this.rules_detail_form.rule_id = that
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
edit_class() {
|
|
|
+ this.dept_formdata = JSON.parse(JSON.stringify(this.class_item))
|
|
|
+ //整合上级分类格式变为可选中状态 Pid。让上级分类变为选中
|
|
|
+ this.ruleTree_pid = []
|
|
|
+ if(this.dept_formdata.pid > 0){
|
|
|
+ this.ruleTree_data(this.dept_formdata.pid,true)
|
|
|
+ }
|
|
|
+
|
|
|
this.class_show = true
|
|
|
this.class_type = 'edit'
|
|
|
- this.dept_formdata = JSON.parse(JSON.stringify(this.class_item))
|
|
|
- console.log(this.dept_formdata)
|
|
|
},
|
|
|
handleSelectionChange(val) {
|
|
|
this.del_item_id = []
|
|
@@ -978,7 +1023,6 @@
|
|
|
}).catch(() => {});
|
|
|
},
|
|
|
cascader_close(val){
|
|
|
- console.log(val)
|
|
|
// let rule_ids = '';
|
|
|
// for(let i in val){
|
|
|
// rule_ids = val[i]
|
|
@@ -1050,6 +1094,7 @@
|
|
|
let data = {
|
|
|
items: [self.rules_detail_form]
|
|
|
}
|
|
|
+ if(typeof data.items[0].rule_id == 'object') data.items[0].rule_id = data.items[0].rule_id[data.items[0].rule_id.length - 1]
|
|
|
this.$http('post','/api/integral/rule/items', data).then((res) => {
|
|
|
if (res.data.code == 1) {
|
|
|
self.$message.success(res.data.msg)
|
|
@@ -1072,6 +1117,7 @@
|
|
|
let data = {
|
|
|
items: [self.rules_detail_form]
|
|
|
}
|
|
|
+ if(typeof data.items[0].rule_id == 'object') data.items[0].rule_id = data.items[0].rule_id[data.items[0].rule_id.length - 1]
|
|
|
this.$http('post','/api/integral/rule/items', data).then((res) => {
|
|
|
if (res.data.code == 1) {
|
|
|
self.$message.success(res.data.msg)
|
|
@@ -1116,7 +1162,6 @@
|
|
|
self.rules_detail_form.max_point = min_point
|
|
|
// let data = self.rules_detail_form
|
|
|
let datas = self.rules_detail_form
|
|
|
- console.log(datas)
|
|
|
let data = {}
|
|
|
for(let key in datas){
|
|
|
data[key] = datas[key]
|
|
@@ -1127,11 +1172,6 @@
|
|
|
return false
|
|
|
}
|
|
|
if(typeof datas.rule_id == 'object') data.rule_id = datas.rule_id[datas.rule_id.length - 1]
|
|
|
- console.log(data.rule_id)
|
|
|
-
|
|
|
- console.log(data)
|
|
|
- console.log(self.rules_detail_form)
|
|
|
- return
|
|
|
this.$http('put','/api/integral/rule/items', data).then((res) => {
|
|
|
if (res.data.code == 1) {
|
|
|
self.$message.success(res.data.msg)
|
|
@@ -1150,7 +1190,6 @@
|
|
|
// let data = self.rules_detail_form
|
|
|
|
|
|
let datas = self.rules_detail_form
|
|
|
- console.log(datas)
|
|
|
let data = {}
|
|
|
for(let key in datas){
|
|
|
data[key] = datas[key]
|
|
@@ -1161,13 +1200,6 @@
|
|
|
return false
|
|
|
}
|
|
|
if(typeof datas.rule_id == 'object') data.rule_id = datas.rule_id[datas.rule_id.length - 1]
|
|
|
- console.log(data.rule_id)
|
|
|
-
|
|
|
- console.log(data)
|
|
|
- console.log(self.rules_detail_form)
|
|
|
-
|
|
|
- console.log(this.cur_item_list)
|
|
|
- return
|
|
|
this.$http('put','/api/integral/rule/items', data).then((res) => {
|
|
|
if (res.data.code == 1) {
|
|
|
self.$message.success(res.data.msg)
|
|
@@ -1187,10 +1219,18 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+
|
|
|
editDetails(val) {
|
|
|
+ this.rules_detail_form = JSON.parse(JSON.stringify(val))
|
|
|
+ //整合上级分类格式变为可选中状态 rule_id。让所属分类变为选中
|
|
|
+ this.itemRule_id = []
|
|
|
+ if(this.rules_detail_form.rule_id > 0){
|
|
|
+ this.ruleTree_data(this.rules_detail_form.rule_id)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
this.rule_show = true
|
|
|
this.rule_type = 'edit'
|
|
|
- this.rules_detail_form = JSON.parse(JSON.stringify(val))
|
|
|
if(this.rules_detail_form.min_point == this.rules_detail_form.max_point){
|
|
|
this.rules_detail_form.range_type = '1'
|
|
|
}else{
|