|  | @@ -19,9 +19,9 @@
 | 
	
		
			
				|  |  |  						<el-button size="medium" plain v-if="selectItem.id" @click="edit_class">编辑</el-button>
 | 
	
		
			
				|  |  |  					</div>
 | 
	
		
			
				|  |  |  					<div class="flex-box btns flex-v-ce">
 | 
	
		
			
				|  |  | -						<el-button size="medium"  @click="del_item" type="danger" plain>批量删除</el-button>
 | 
	
		
			
				|  |  | -						<el-button size="medium" @click="add_rule" type="primary">添加规则</el-button>
 | 
	
		
			
				|  |  | -						<el-button size="medium"  @click="import_rules_show = true" plain>导入规则</el-button>
 | 
	
		
			
				|  |  | +						<el-button size="small"  @click="del_item" type="danger" plain>批量删除</el-button>
 | 
	
		
			
				|  |  | +						<el-button size="small" @click="add_rule" type="primary">添加规则</el-button>
 | 
	
		
			
				|  |  | +						<el-button size="small"  @click="import_rules_show = true" plain>导入规则</el-button>
 | 
	
		
			
				|  |  |  					</div>
 | 
	
		
			
				|  |  |  					<el-table stripe ref="multipleTable" :data="item_list" tooltip-effect="dark" 
 | 
	
		
			
				|  |  |  					  @selection-change="handleSelectionChange" @row-click="editDetails" align="center">
 | 
	
	
		
			
				|  | @@ -100,7 +100,7 @@
 | 
	
		
			
				|  |  |  		        <el-col :span="11" v-show="rules_detail_form.range_type == 2">
 | 
	
		
			
				|  |  |  		          <el-input placeholder="请输入分值" :rules="[{ required: true, message: '请输入加分项名称', trigger: 'blur' }]"
 | 
	
		
			
				|  |  |  		            v-model="rules_detail_form.max_point" type="Number" class="input-with-select">
 | 
	
		
			
				|  |  | -		            <el-select v-model="integral_select_name2" slot="prepend" placeholder="请选择类型">
 | 
	
		
			
				|  |  | +		            <el-select v-model="integral_select_name2" slot="prepend" placeholder="请选择类型" style="width: 100px;">
 | 
	
		
			
				|  |  |  		              <el-option v-for="(item,index) in integral_select" :key="index" :label="item.name" :value="item.value"></el-option>
 | 
	
		
			
				|  |  |  		            </el-select>
 | 
	
		
			
				|  |  |  		          </el-input>
 | 
	
	
		
			
				|  | @@ -146,7 +146,7 @@
 | 
	
		
			
				|  |  |  		          :data="{type:'rule_item'}"
 | 
	
		
			
				|  |  |  		          ref="upload"
 | 
	
		
			
				|  |  |  		          :limit = '1'
 | 
	
		
			
				|  |  | -		          action="/api/upload/excel"
 | 
	
		
			
				|  |  | +		          action="https://test-ding.g107.com/api/upload/excel"
 | 
	
		
			
				|  |  |  		          :on-preview="handlePreview"
 | 
	
		
			
				|  |  |  		          :on-remove="handleRemove"
 | 
	
		
			
				|  |  |  		          :on-success="handleSuccess"
 | 
	
	
		
			
				|  | @@ -214,7 +214,7 @@ export default {
 | 
	
		
			
				|  |  |  			  remark: '',
 | 
	
		
			
				|  |  |  			  is_attendance: '0',
 | 
	
		
			
				|  |  |  			  cycle_type: '1',
 | 
	
		
			
				|  |  | -			  pt_id: 2
 | 
	
		
			
				|  |  | +			  pt_id: 0
 | 
	
		
			
				|  |  |  			},
 | 
	
		
			
				|  |  |  			rules: {
 | 
	
		
			
				|  |  |  			  remark: [{
 | 
	
	
		
			
				|  | @@ -301,6 +301,7 @@ export default {
 | 
	
		
			
				|  |  |            if(res.data.code == 1) {
 | 
	
		
			
				|  |  |              this.import_rules_show = false;
 | 
	
		
			
				|  |  |              this.$message.success({message:res.data.msg})
 | 
	
		
			
				|  |  | +			this.getData();
 | 
	
		
			
				|  |  |            }else{
 | 
	
		
			
				|  |  |              this.$message({type:'error',message:res.data.msg})
 | 
	
		
			
				|  |  |            }
 | 
	
	
		
			
				|  | @@ -342,7 +343,7 @@ export default {
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |  	  
 | 
	
		
			
				|  |  | -		edit_submit_rule(form) {
 | 
	
		
			
				|  |  | +	  edit_submit_rule(form) {
 | 
	
		
			
				|  |  |  		  let self = this
 | 
	
		
			
				|  |  |  		  self.$refs[form].validate((valid) => {
 | 
	
		
			
				|  |  |  		    if (valid) {
 | 
	
	
		
			
				|  | @@ -490,7 +491,7 @@ export default {
 | 
	
		
			
				|  |  |  		      if (res.data.code == 1) {
 | 
	
		
			
				|  |  |  		        self.$message.success(res.data.msg)
 | 
	
		
			
				|  |  |  		        self.rule_show = false
 | 
	
		
			
				|  |  | -				 self.getData();
 | 
	
		
			
				|  |  | +				self.getData(true);
 | 
	
		
			
				|  |  |  		      } else {
 | 
	
		
			
				|  |  |  		        self.$message.error(res.data.msg)
 | 
	
		
			
				|  |  |  		      }
 | 
	
	
		
			
				|  | @@ -552,7 +553,8 @@ export default {
 | 
	
		
			
				|  |  |  		    this.$axios.post('/api/integral/rule/items/destroy',data).then((res) => {
 | 
	
		
			
				|  |  |  		      if (res.data.code == 1) {
 | 
	
		
			
				|  |  |  		        this.$message.success(res.data.msg)
 | 
	
		
			
				|  |  | -		        this.getData();
 | 
	
		
			
				|  |  | +		        this.getData(true);
 | 
	
		
			
				|  |  | +				this.handleNodeClick(this.selectItem);
 | 
	
		
			
				|  |  |  		      } else {
 | 
	
		
			
				|  |  |  		        this.$message.error(res.data.msg)
 | 
	
		
			
				|  |  |  		      }
 | 
	
	
		
			
				|  | @@ -588,6 +590,7 @@ export default {
 | 
	
		
			
				|  |  |  			  this.del_item_id.push(element.id)
 | 
	
		
			
				|  |  |  			});
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  |  		handleNodeClick(e) {
 | 
	
		
			
				|  |  |  			var items=this.getItemData(e);
 | 
	
		
			
				|  |  |  			this.selectItem=e;
 | 
	
	
		
			
				|  | @@ -626,10 +629,10 @@ export default {
 | 
	
		
			
				|  |  |  			return items;
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		
 | 
	
		
			
				|  |  | -		getData() {
 | 
	
		
			
				|  |  | +		getData(is) {
 | 
	
		
			
				|  |  |  			this.rule_loading=true;
 | 
	
		
			
				|  |  |  			var that = this;
 | 
	
		
			
				|  |  | -			this.$axios.get('api/integral/rule/trees', { cycle_type: 1 }).then(res => {
 | 
	
		
			
				|  |  | +			this.$axios.get('api/integral/rule/trees',{params:{cycle_type: 1}}).then(res => {
 | 
	
		
			
				|  |  |  				var item_list = res.data.data.item_list||[];
 | 
	
		
			
				|  |  |  				var list = []
 | 
	
		
			
				|  |  |  				for (let i in item_list) {
 | 
	
	
		
			
				|  | @@ -642,6 +645,11 @@ export default {
 | 
	
		
			
				|  |  |  				that.item_list = list;
 | 
	
		
			
				|  |  |  				that.all_item_list = list;
 | 
	
		
			
				|  |  |  				that.rule_loading=false;
 | 
	
		
			
				|  |  | +				if(is){
 | 
	
		
			
				|  |  | +					that.handleNodeClick(that.selectItem)
 | 
	
		
			
				|  |  | +				}else{
 | 
	
		
			
				|  |  | +					this.selectItem={name:'积分分类'}//选择的分类
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  |  			});
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		//编辑分组
 | 
	
	
		
			
				|  | @@ -659,10 +667,11 @@ export default {
 | 
	
		
			
				|  |  |  		        delete that.dept_formdata.child
 | 
	
		
			
				|  |  |  		        that.dept_formdata.pid = that.dept_formdata.pid[that.dept_formdata.pid.length - 1] || 0
 | 
	
		
			
				|  |  |  		        that.dept_formdata.rule_id = that.dept_formdata.id
 | 
	
		
			
				|  |  | -		        request.put('/api/integral/rule', that.dept_formdata).then((res) => {
 | 
	
		
			
				|  |  | +		        this.$axios.post('/api/integral/rule/edit', that.dept_formdata).then((res) => {
 | 
	
		
			
				|  |  |  		          if (res.data.code == 1) {
 | 
	
		
			
				|  |  |  		            that.$message.success('修改积分规则成功')
 | 
	
		
			
				|  |  | -		            that.get_department_list(function() {})
 | 
	
		
			
				|  |  | +		            this.getData();  
 | 
	
		
			
				|  |  | +					that.add_dept_close();
 | 
	
		
			
				|  |  |  		          } else {
 | 
	
		
			
				|  |  |  		            that.$message.error(res.data.msg)
 | 
	
		
			
				|  |  |  		          }
 | 
	
	
		
			
				|  | @@ -690,7 +699,6 @@ export default {
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		//删除分组
 | 
	
		
			
				|  |  |  		del_dept() {
 | 
	
		
			
				|  |  | -			console.log(this.selectItem);
 | 
	
		
			
				|  |  |  		  this.$confirm('此操作将永久删除该分组, 是否继续?', '提示', {
 | 
	
		
			
				|  |  |  		    confirmButtonText: '确定',
 | 
	
		
			
				|  |  |  		    cancelButtonText: '取消',
 | 
	
	
		
			
				|  | @@ -733,6 +741,9 @@ export default {
 | 
	
		
			
				|  |  |  </script>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <style scoped lang="scss">
 | 
	
		
			
				|  |  | +	.select_width .el-select {
 | 
	
		
			
				|  |  | +	    width: 80px;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  |  	.text-center{
 | 
	
		
			
				|  |  |  	  text-align: center;
 | 
	
		
			
				|  |  |  	}
 |