|  | @@ -9,14 +9,7 @@
 | 
	
		
			
				|  |  |  				<div class="terr-left">
 | 
	
		
			
				|  |  |  					<el-button size="medium" @click="add_class" type="primary">+ 添加规则分类</el-button>
 | 
	
		
			
				|  |  |  					<div class="rule_class_box">
 | 
	
		
			
				|  |  | -						<el-tree
 | 
	
		
			
				|  |  | -							accordion
 | 
	
		
			
				|  |  | -							:data="rule_tree"
 | 
	
		
			
				|  |  | -							 class="cate-tree"
 | 
	
		
			
				|  |  | -							:props="defaultProps"
 | 
	
		
			
				|  |  | -							:highlight-current="true"
 | 
	
		
			
				|  |  | -							@node-click="handleNodeClick"
 | 
	
		
			
				|  |  | -						></el-tree>
 | 
	
		
			
				|  |  | +						<el-tree accordion :data="rule_tree" class="cate-tree" :props="defaultProps" :highlight-current="true" @node-click="handleNodeClick"></el-tree>
 | 
	
		
			
				|  |  |  					</div>
 | 
	
		
			
				|  |  |  				</div>
 | 
	
		
			
				|  |  |  				<div class="terr-right border-right flex-1">
 | 
	
	
		
			
				|  | @@ -75,16 +68,20 @@
 | 
	
		
			
				|  |  |  				<div @click.stop="downloadE">下载保存此二维码</div>
 | 
	
		
			
				|  |  |  			</div>
 | 
	
		
			
				|  |  |  		</el-dialog> -->
 | 
	
		
			
				|  |  | -		
 | 
	
		
			
				|  |  | -		<el-dialog @close="closeCode" :visible.sync="innerVisible" width="400px" append-to-body>
 | 
	
		
			
				|  |  | -			<div style="border-radius: 15px;border: 1px solid #f1f1f1;padding: 10px; width: 223px;box-sizing: border-box;margin: 0 auto;">
 | 
	
		
			
				|  |  | -				<div id="qrcode" ref="qrcode"></div>
 | 
	
		
			
				|  |  | -			</div>
 | 
	
		
			
				|  |  | -			<div class="qrcodesave" ><span @click.stop="downloadE">下载保存此二维码</span></div>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		<el-dialog @close="closeCode" :visible.sync="innerVisible" width="600px" append-to-body>
 | 
	
		
			
				|  |  | +			<div style="border-radius: 15px;border: 1px solid #f1f1f1;padding: 10px; width: 423px;box-sizing: border-box;margin: 0 auto;"><div id="qrcode" ref="qrcode"></div></div>
 | 
	
		
			
				|  |  | +			<div class="qrcodesave"><span @click.stop="downloadE">下载保存此二维码</span></div>
 | 
	
		
			
				|  |  |  		</el-dialog>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		<!-- 编辑添加分类 -->
 | 
	
		
			
				|  |  | -		<el-dialog :title="class_type == 'add' ? '添加规则分类' : '编辑规则分类'" :visible.sync="class_show" @close="add_dept_close('dept_formdata')" :close-on-click-modal="false" width="500px">
 | 
	
		
			
				|  |  | +		<el-dialog
 | 
	
		
			
				|  |  | +			:title="class_type == 'add' ? '添加规则分类' : '编辑规则分类'"
 | 
	
		
			
				|  |  | +			:visible.sync="class_show"
 | 
	
		
			
				|  |  | +			@close="add_dept_close('dept_formdata')"
 | 
	
		
			
				|  |  | +			:close-on-click-modal="false"
 | 
	
		
			
				|  |  | +			width="500px"
 | 
	
		
			
				|  |  | +		>
 | 
	
		
			
				|  |  |  			<el-form :model="dept_formdata" ref="dept_formdata" :rules="dept_formdata_rules" label-width="80px">
 | 
	
		
			
				|  |  |  				<el-form-item label="规则分类" prop="name"><el-input v-model="dept_formdata.name"></el-input></el-form-item>
 | 
	
		
			
				|  |  |  				<el-form-item label="上级分类">
 | 
	
	
		
			
				|  | @@ -148,9 +145,9 @@
 | 
	
		
			
				|  |  |  							</el-select>
 | 
	
		
			
				|  |  |  						</el-input>
 | 
	
		
			
				|  |  |  					</el-form-item>
 | 
	
		
			
				|  |  | -					
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  					<div v-if="rules_detail_form.range_type == 2" style="position: relative;bottom: 10px;padding: 0 10px;">至</div>
 | 
	
		
			
				|  |  | -					<el-form-item  v-if="rules_detail_form.range_type == 2" class="form-right select_width">
 | 
	
		
			
				|  |  | +					<el-form-item v-if="rules_detail_form.range_type == 2" class="form-right select_width">
 | 
	
		
			
				|  |  |  						<el-input placeholder="请输入分值" v-model.number="rules_detail_form.max_point" type="age" class="input-with-select">
 | 
	
		
			
				|  |  |  							<el-select v-model="integral_select_name2" slot="prepend" placeholder="请选择类型">
 | 
	
		
			
				|  |  |  								<el-option v-for="(item, index) in integral_select" :key="index" :label="item.name" :value="item.value"></el-option>
 | 
	
	
		
			
				|  | @@ -158,8 +155,8 @@
 | 
	
		
			
				|  |  |  						</el-input>
 | 
	
		
			
				|  |  |  					</el-form-item>
 | 
	
		
			
				|  |  |  				</div>
 | 
	
		
			
				|  |  | -				
 | 
	
		
			
				|  |  | -<!-- 			<el-form-item prop="min_point">
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +				<!-- 			<el-form-item prop="min_point">
 | 
	
		
			
				|  |  |  					<el-row :gutter="20" class="select_width">
 | 
	
		
			
				|  |  |  						<el-col :span="11">
 | 
	
		
			
				|  |  |  							<el-input
 | 
	
	
		
			
				|  | @@ -186,13 +183,17 @@
 | 
	
		
			
				|  |  |  						</el-col>
 | 
	
		
			
				|  |  |  					</el-row>
 | 
	
		
			
				|  |  |  				</el-form-item> -->
 | 
	
		
			
				|  |  | -				
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  				<div class="flex-box flex-v-ce">
 | 
	
		
			
				|  |  |  					<el-button type="danger" @click="del_rule" :loading="delRule_loading" :disabled="delRule_loading" v-show="rule_type == 'edit'">删除规则</el-button>
 | 
	
		
			
				|  |  |  					<div class="flex-1"></div>
 | 
	
		
			
				|  |  |  					<el-button @click="rule_close('rules_detail_form')">取消</el-button>
 | 
	
		
			
				|  |  | -					<el-button type="primary" v-show="rule_type == 'add'" :loading="rule_loading2" :disabled="rule_loading2"  @click="add_submit_rule('rules_detail_form')">确定</el-button>
 | 
	
		
			
				|  |  | -					<el-button type="primary" v-show="rule_type == 'edit'" :loading="rule_loading2" :disabled="rule_loading2"  @click="edit_submit_rule('rules_detail_form')">确定</el-button>
 | 
	
		
			
				|  |  | +					<el-button type="primary" v-show="rule_type == 'add'" :loading="rule_loading2" :disabled="rule_loading2" @click="add_submit_rule('rules_detail_form')">
 | 
	
		
			
				|  |  | +						确定
 | 
	
		
			
				|  |  | +					</el-button>
 | 
	
		
			
				|  |  | +					<el-button type="primary" v-show="rule_type == 'edit'" :loading="rule_loading2" :disabled="rule_loading2" @click="edit_submit_rule('rules_detail_form')">
 | 
	
		
			
				|  |  | +						确定
 | 
	
		
			
				|  |  | +					</el-button>
 | 
	
		
			
				|  |  |  				</div>
 | 
	
		
			
				|  |  |  			</el-form>
 | 
	
		
			
				|  |  |  		</el-dialog>
 | 
	
	
		
			
				|  | @@ -243,12 +244,12 @@ import QRCode from 'qrcodejs2';
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |  	data() {
 | 
	
		
			
				|  |  |  		return {
 | 
	
		
			
				|  |  | -			ruleDetails:{},
 | 
	
		
			
				|  |  | -			innerVisible:false,
 | 
	
		
			
				|  |  | -      		bodyLoad: false,
 | 
	
		
			
				|  |  | -			action:process.env.VUE_APP_BASE_API+'api/rule/import',
 | 
	
		
			
				|  |  | -			downloadUrl:process.env.VUE_APP_BASE_API+'api/download/rule_item',
 | 
	
		
			
				|  |  | -			ATOKEN: { 'A-TOKEN': this.$getToken(),'Accept':'application/vnd.test.v2+json' },
 | 
	
		
			
				|  |  | +			ruleDetails: {},
 | 
	
		
			
				|  |  | +			innerVisible: false,
 | 
	
		
			
				|  |  | +			bodyLoad: false,
 | 
	
		
			
				|  |  | +			action: process.env.VUE_APP_BASE_API + 'api/rule/import',
 | 
	
		
			
				|  |  | +			downloadUrl: process.env.VUE_APP_BASE_API + 'api/download/rule_item',
 | 
	
		
			
				|  |  | +			ATOKEN: { 'A-TOKEN': this.$getToken(), Accept: 'application/vnd.test.v2+json' },
 | 
	
		
			
				|  |  |  			tips_show: true,
 | 
	
		
			
				|  |  |  			rule_loading: false,
 | 
	
		
			
				|  |  |  			rule_tree: [],
 | 
	
	
		
			
				|  | @@ -262,7 +263,7 @@ export default {
 | 
	
		
			
				|  |  |  			selectItem: { name: '积分规则' }, //选择的分类
 | 
	
		
			
				|  |  |  			//添加分类
 | 
	
		
			
				|  |  |  			class_show: false,
 | 
	
		
			
				|  |  | -			delRule_loading:false,
 | 
	
		
			
				|  |  | +			delRule_loading: false,
 | 
	
		
			
				|  |  |  			dept_formdata_rules: {
 | 
	
		
			
				|  |  |  				name: [
 | 
	
		
			
				|  |  |  					{
 | 
	
	
		
			
				|  | @@ -284,7 +285,7 @@ export default {
 | 
	
		
			
				|  |  |  				cycle_type: '1'
 | 
	
		
			
				|  |  |  			},
 | 
	
		
			
				|  |  |  			class_type: 'add',
 | 
	
		
			
				|  |  | -			dept_loading:false,
 | 
	
		
			
				|  |  | +			dept_loading: false,
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  			// 规则相关
 | 
	
		
			
				|  |  |  			del_item_id: [], //选择规则ID集合
 | 
	
	
		
			
				|  | @@ -318,7 +319,7 @@ export default {
 | 
	
		
			
				|  |  |  						message: '请选择分类',
 | 
	
		
			
				|  |  |  						trigger: 'change'
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  | -				],
 | 
	
		
			
				|  |  | +				]
 | 
	
		
			
				|  |  |  				// min_point2:[{ required: true, message: '分值不能为空'},{ pattern: /^[1-9]\d*$/, message: '分值必须为数字值'}],
 | 
	
		
			
				|  |  |  				// max_point2:[{ required: true, message: '分值不能为空'},{ pattern: /^[1-9]\d*$/, message: '分值必须为数字值'}],
 | 
	
		
			
				|  |  |  			},
 | 
	
	
		
			
				|  | @@ -351,26 +352,26 @@ export default {
 | 
	
		
			
				|  |  |  			import_btn_show: false,
 | 
	
		
			
				|  |  |  			fileList: [],
 | 
	
		
			
				|  |  |  			file: null,
 | 
	
		
			
				|  |  | -			flName:'',
 | 
	
		
			
				|  |  | +			flName: ''
 | 
	
		
			
				|  |  |  		};
 | 
	
		
			
				|  |  |  	},
 | 
	
		
			
				|  |  |  	components: {
 | 
	
		
			
				|  |  |  		noData
 | 
	
		
			
				|  |  |  	},
 | 
	
		
			
				|  |  | -	watch:{
 | 
	
		
			
				|  |  | +	watch: {
 | 
	
		
			
				|  |  |  		'dept_formdata.pid'(val, old_val) {
 | 
	
		
			
				|  |  | -			this.$nextTick(()=>{
 | 
	
		
			
				|  |  | +			this.$nextTick(() => {
 | 
	
		
			
				|  |  |  				this.$refs.dept.dropDownVisible = false;
 | 
	
		
			
				|  |  | -			})
 | 
	
		
			
				|  |  | -		},		
 | 
	
		
			
				|  |  | +			});
 | 
	
		
			
				|  |  | +		},
 | 
	
		
			
				|  |  |  		'rules_detail_form.rule_id'(val, old_val) {
 | 
	
		
			
				|  |  | -			this.$nextTick(()=>{
 | 
	
		
			
				|  |  | +			this.$nextTick(() => {
 | 
	
		
			
				|  |  |  				this.$refs.dept2.dropDownVisible = false;
 | 
	
		
			
				|  |  | -			})
 | 
	
		
			
				|  |  | +			});
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  	},
 | 
	
		
			
				|  |  |  	created() {
 | 
	
		
			
				|  |  | -		this.point_types = this.$getTyps().reverse()
 | 
	
		
			
				|  |  | +		this.point_types = this.$getTyps().reverse();
 | 
	
		
			
				|  |  |  	},
 | 
	
		
			
				|  |  |  	mounted() {
 | 
	
		
			
				|  |  |  		this.$nextTick(function() {
 | 
	
	
		
			
				|  | @@ -380,59 +381,61 @@ export default {
 | 
	
		
			
				|  |  |  				this.tips_show = true;
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  		});
 | 
	
		
			
				|  |  | -		var that=this;
 | 
	
		
			
				|  |  | +		var that = this;
 | 
	
		
			
				|  |  |  		// setTimeout(function(){
 | 
	
		
			
				|  |  | -			that.getData();
 | 
	
		
			
				|  |  | +		that.getData();
 | 
	
		
			
				|  |  |  		// },1000);
 | 
	
		
			
				|  |  |  	},
 | 
	
		
			
				|  |  |  	methods: {
 | 
	
		
			
				|  |  |  		downloadE() {
 | 
	
		
			
				|  |  | -			let rule_remark = ''
 | 
	
		
			
				|  |  | -			if(this.ruleDetails.remark.length > 10){
 | 
	
		
			
				|  |  | -				rule_remark = this.ruleDetails.remark
 | 
	
		
			
				|  |  | +			let rule_remark = '';
 | 
	
		
			
				|  |  | +			if (this.ruleDetails.remark.length > 10) {
 | 
	
		
			
				|  |  | +				rule_remark = this.ruleDetails.remark;
 | 
	
		
			
				|  |  |  				rule_remark = rule_remark.slice(0, 10);
 | 
	
		
			
				|  |  | -			}else{
 | 
	
		
			
				|  |  | -				rule_remark = this.ruleDetails.remark
 | 
	
		
			
				|  |  | +			} else {
 | 
	
		
			
				|  |  | +				rule_remark = this.ruleDetails.remark;
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  | -			var canvasData = this.$refs.qrcode.getElementsByTagName('canvas')
 | 
	
		
			
				|  |  | -			var a = document.createElement("a");
 | 
	
		
			
				|  |  | -			var event = new MouseEvent("click"); // 创建一个单击事件
 | 
	
		
			
				|  |  | -			a.href = canvasData[0].toDataURL("image/png");;
 | 
	
		
			
				|  |  | +			var canvasData = this.$refs.qrcode.getElementsByTagName('canvas');
 | 
	
		
			
				|  |  | +			var a = document.createElement('a');
 | 
	
		
			
				|  |  | +			var event = new MouseEvent('click'); // 创建一个单击事件
 | 
	
		
			
				|  |  | +			a.href = canvasData[0].toDataURL('image/png');
 | 
	
		
			
				|  |  |  			a.download = rule_remark;
 | 
	
		
			
				|  |  |  			a.dispatchEvent(event); // 触发a的单击事件
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  | -		payOrder (row) {// 展示二维码
 | 
	
		
			
				|  |  | -			let url = 'dingtalk://dingtalkclient/action/open_micro_app'
 | 
	
		
			
				|  |  | -			let appid = '?appId='+this.$appId
 | 
	
		
			
				|  |  | -			let corpId = '&corpId='+localStorage.getItem('corpId')
 | 
	
		
			
				|  |  | -			// let corpId = '&corpId=ding011f57ab048cf202ffe93478753d9884'
 | 
	
		
			
				|  |  | -			let page = '&page='+encodeURIComponent(`pages/workbench/apply/apply?item=${encodeURIComponent(row)}`)//encodeURIComponent('小米')
 | 
	
		
			
				|  |  | -			let urls = url+appid+corpId+page
 | 
	
		
			
				|  |  | -			var qrcode = new QRCode('qrcode', {
 | 
	
		
			
				|  |  | -				text: urls, // 二维码内容
 | 
	
		
			
				|  |  | -				width: 200,
 | 
	
		
			
				|  |  | -				height: 200,
 | 
	
		
			
				|  |  | -				// render: 'canvas' // 设置渲染方式(有两种方式 table和canvas,默认是canvas)
 | 
	
		
			
				|  |  | -				colorDark: '#34373e', // 二维码色
 | 
	
		
			
				|  |  | -				colorLight: '#ffffff', // 背景色
 | 
	
		
			
				|  |  | -				correctLevel: QRCode.CorrectLevel.H // 容错等级,H是heigh,最高,所以二维码看起来很密
 | 
	
		
			
				|  |  | -			})
 | 
	
		
			
				|  |  | +		payOrder(row) {
 | 
	
		
			
				|  |  | +			// 展示二维码
 | 
	
		
			
				|  |  | +			let url = 'dingtalk://dingtalkclient/action/open_micro_app';
 | 
	
		
			
				|  |  | +			let appid = '?appId=' + this.$appId;
 | 
	
		
			
				|  |  | +			// let corpId = '&corpId=' + localStorage.getItem('corpId');
 | 
	
		
			
				|  |  | +			let corpId = '&corpId=ding011f57ab048cf202ffe93478753d9884'
 | 
	
		
			
				|  |  | +			let page = '&page=' + encodeURIComponent(`pages/workbench/apply/apply?item=${encodeURIComponent(row)}`); //encodeURIComponent('小米')
 | 
	
		
			
				|  |  | +			let urls = url + appid + corpId + page;
 | 
	
		
			
				|  |  | +			this.$nextTick(() => {
 | 
	
		
			
				|  |  | +				var qrcode = new QRCode('qrcode', {
 | 
	
		
			
				|  |  | +					text: urls, // 二维码内容
 | 
	
		
			
				|  |  | +					width: 400,
 | 
	
		
			
				|  |  | +					height: 400,
 | 
	
		
			
				|  |  | +					// render: 'canvas' // 设置渲染方式(有两种方式 table和canvas,默认是canvas)
 | 
	
		
			
				|  |  | +					colorDark: '#34373e', // 二维码色
 | 
	
		
			
				|  |  | +					colorLight: '#ffffff', // 背景色
 | 
	
		
			
				|  |  | +					correctLevel: QRCode.CorrectLevel.H // 容错等级,H是heigh,最高,所以二维码看起来很密
 | 
	
		
			
				|  |  | +				});
 | 
	
		
			
				|  |  | +			});
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  | -		ruleQRcode(row){
 | 
	
		
			
				|  |  | -			this.ruleDetails = row
 | 
	
		
			
				|  |  | -			console.log(row)
 | 
	
		
			
				|  |  | +		ruleQRcode(row) {
 | 
	
		
			
				|  |  | +			this.ruleDetails = row;
 | 
	
		
			
				|  |  |  			// 生成二维码
 | 
	
		
			
				|  |  | -			this.innerVisible = true
 | 
	
		
			
				|  |  | +			this.innerVisible = true;
 | 
	
		
			
				|  |  |  			// 使用$nextTick确保数据渲染
 | 
	
		
			
				|  |  |  			this.$nextTick(() => {
 | 
	
		
			
				|  |  | -				this.payOrder(row)
 | 
	
		
			
				|  |  | -			})
 | 
	
		
			
				|  |  | +				this.payOrder(row.id);
 | 
	
		
			
				|  |  | +			});
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		// 关闭弹框,清除已经生成的二维码
 | 
	
		
			
				|  |  | -		closeCode () {
 | 
	
		
			
				|  |  | -			setTimeout(()=>{
 | 
	
		
			
				|  |  | -				this.$refs.qrcode.innerHTML = ''
 | 
	
		
			
				|  |  | -			},150)
 | 
	
		
			
				|  |  | +		closeCode() {
 | 
	
		
			
				|  |  | +			setTimeout(() => {
 | 
	
		
			
				|  |  | +				this.$refs.qrcode.innerHTML = '';
 | 
	
		
			
				|  |  | +			}, 150);
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		// 导入相关
 | 
	
	
		
			
				|  | @@ -446,7 +449,8 @@ export default {
 | 
	
		
			
				|  |  |  			let params = {
 | 
	
		
			
				|  |  |  				file: this.file
 | 
	
		
			
				|  |  |  			};
 | 
	
		
			
				|  |  | -			this.$axios('post','/api/rule/import', params,).then(res => {
 | 
	
		
			
				|  |  | +			this.$axios('post', '/api/rule/import', params)
 | 
	
		
			
				|  |  | +				.then(res => {
 | 
	
		
			
				|  |  |  					if (res.data.code == 1) {
 | 
	
		
			
				|  |  |  						this.close_import();
 | 
	
		
			
				|  |  |  						this.$message.success({ message: res.data.msg });
 | 
	
	
		
			
				|  | @@ -454,32 +458,33 @@ export default {
 | 
	
		
			
				|  |  |  					} else {
 | 
	
		
			
				|  |  |  						this.$message({ type: 'error', message: res.data.msg });
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  | -				}).finally(() => {
 | 
	
		
			
				|  |  | +				})
 | 
	
		
			
				|  |  | +				.finally(() => {
 | 
	
		
			
				|  |  |  					this.save_loading = false;
 | 
	
		
			
				|  |  |  				});
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		handleSuccess(response) {
 | 
	
		
			
				|  |  |  			if (response.code == 1) {
 | 
	
		
			
				|  |  | -				if(response.data.length>0){
 | 
	
		
			
				|  |  | -					var htmls=response.data;
 | 
	
		
			
				|  |  | -					var str="<div class='red'></div>";
 | 
	
		
			
				|  |  | -					htmls.forEach(item=>{
 | 
	
		
			
				|  |  | -						str+=`<div>${item.errors}</div>`;
 | 
	
		
			
				|  |  | -					})
 | 
	
		
			
				|  |  | +				if (response.data.length > 0) {
 | 
	
		
			
				|  |  | +					var htmls = response.data;
 | 
	
		
			
				|  |  | +					var str = "<div class='red'></div>";
 | 
	
		
			
				|  |  | +					htmls.forEach(item => {
 | 
	
		
			
				|  |  | +						str += `<div>${item.errors}</div>`;
 | 
	
		
			
				|  |  | +					});
 | 
	
		
			
				|  |  |  					this.close_import();
 | 
	
		
			
				|  |  |  					this.$notify.error({
 | 
	
		
			
				|  |  | -					          title: '导入错误',
 | 
	
		
			
				|  |  | -					          dangerouslyUseHTMLString: true,
 | 
	
		
			
				|  |  | -					          message: str,
 | 
	
		
			
				|  |  | -							  duration:0,
 | 
	
		
			
				|  |  | -							  offset:50,
 | 
	
		
			
				|  |  | -							  customClass:'notifyBox',
 | 
	
		
			
				|  |  | +						title: '导入错误',
 | 
	
		
			
				|  |  | +						dangerouslyUseHTMLString: true,
 | 
	
		
			
				|  |  | +						message: str,
 | 
	
		
			
				|  |  | +						duration: 0,
 | 
	
		
			
				|  |  | +						offset: 50,
 | 
	
		
			
				|  |  | +						customClass: 'notifyBox'
 | 
	
		
			
				|  |  |  					});
 | 
	
		
			
				|  |  | -				}else{
 | 
	
		
			
				|  |  | -						this.file = response.data;
 | 
	
		
			
				|  |  | -						this.$message.success({ message: response.msg });
 | 
	
		
			
				|  |  | -						this.getData();
 | 
	
		
			
				|  |  | -						this.close_import();
 | 
	
		
			
				|  |  | +				} else {
 | 
	
		
			
				|  |  | +					this.file = response.data;
 | 
	
		
			
				|  |  | +					this.$message.success({ message: response.msg });
 | 
	
		
			
				|  |  | +					this.getData();
 | 
	
		
			
				|  |  | +					this.close_import();
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  		},
 | 
	
	
		
			
				|  | @@ -516,9 +521,9 @@ export default {
 | 
	
		
			
				|  |  |  			let self = this;
 | 
	
		
			
				|  |  |  			self.$refs[form].validate(valid => {
 | 
	
		
			
				|  |  |  				if (valid) {
 | 
	
		
			
				|  |  | -					if(self.rules_detail_form.min_point==0||!self.rules_detail_form.min_point){
 | 
	
		
			
				|  |  | +					if (self.rules_detail_form.min_point == 0 || !self.rules_detail_form.min_point) {
 | 
	
		
			
				|  |  |  						this.$message.error('请输入积分分值');
 | 
	
		
			
				|  |  | -						return
 | 
	
		
			
				|  |  | +						return;
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  					// self.rules_detail_form.min_point=self.rules_detail_form.min_point2;
 | 
	
		
			
				|  |  |  					// self.rules_detail_form.max_point=self.rules_detail_form.max_point2;
 | 
	
	
		
			
				|  | @@ -531,8 +536,8 @@ export default {
 | 
	
		
			
				|  |  |  					if (self.rules_detail_form.range_type == 1) {
 | 
	
		
			
				|  |  |  						self.rules_detail_form.max_point = self.rules_detail_form.min_point;
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  | -					if(Array.isArray(self.rules_detail_form.rule_id)){
 | 
	
		
			
				|  |  | -						self.rules_detail_form.rule_id=self.rules_detail_form.rule_id[self.rules_detail_form.rule_id.length-1];
 | 
	
		
			
				|  |  | +					if (Array.isArray(self.rules_detail_form.rule_id)) {
 | 
	
		
			
				|  |  | +						self.rules_detail_form.rule_id = self.rules_detail_form.rule_id[self.rules_detail_form.rule_id.length - 1];
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  					if (parseFloat(self.rules_detail_form.min_point) > parseFloat(self.rules_detail_form.max_point)) {
 | 
	
		
			
				|  |  |  						this.$confirm(
 | 
	
	
		
			
				|  | @@ -551,52 +556,54 @@ export default {
 | 
	
		
			
				|  |  |  								cancelButtonText: '取消',
 | 
	
		
			
				|  |  |  								type: 'warning'
 | 
	
		
			
				|  |  |  							}
 | 
	
		
			
				|  |  | -						)
 | 
	
		
			
				|  |  | -							.then(() => {
 | 
	
		
			
				|  |  | -								this.rule_loading2=true;
 | 
	
		
			
				|  |  | -								let min_point = self.rules_detail_form.min_point;
 | 
	
		
			
				|  |  | -								self.rules_detail_form.min_point = self.rules_detail_form.max_point;
 | 
	
		
			
				|  |  | -								self.rules_detail_form.max_point = min_point;
 | 
	
		
			
				|  |  | -								let data = self.rules_detail_form;
 | 
	
		
			
				|  |  | -								data.item_id = self.rules_detail_form.id;
 | 
	
		
			
				|  |  | -								if (self.rules_detail_form.min_point == 0 && self.rules_detail_form.range_type == 1) {
 | 
	
		
			
				|  |  | -									self.$message.error('积分不能为零');
 | 
	
		
			
				|  |  | -									this.rule_loading2=false;
 | 
	
		
			
				|  |  | -									return false;
 | 
	
		
			
				|  |  | -								}
 | 
	
		
			
				|  |  | -								this.$axios('post','/api/integral/rule/items/edit', data).then(res => {
 | 
	
		
			
				|  |  | -										if (res.data.code == 1) {
 | 
	
		
			
				|  |  | -											self.$message.success(res.data.msg);
 | 
	
		
			
				|  |  | -											self.getData();
 | 
	
		
			
				|  |  | -											self.rule_close(form);
 | 
	
		
			
				|  |  | -										}
 | 
	
		
			
				|  |  | -								}).finally(err=>{
 | 
	
		
			
				|  |  | -									this.rule_loading2=false;
 | 
	
		
			
				|  |  | +						).then(() => {
 | 
	
		
			
				|  |  | +							this.rule_loading2 = true;
 | 
	
		
			
				|  |  | +							let min_point = self.rules_detail_form.min_point;
 | 
	
		
			
				|  |  | +							self.rules_detail_form.min_point = self.rules_detail_form.max_point;
 | 
	
		
			
				|  |  | +							self.rules_detail_form.max_point = min_point;
 | 
	
		
			
				|  |  | +							let data = self.rules_detail_form;
 | 
	
		
			
				|  |  | +							data.item_id = self.rules_detail_form.id;
 | 
	
		
			
				|  |  | +							if (self.rules_detail_form.min_point == 0 && self.rules_detail_form.range_type == 1) {
 | 
	
		
			
				|  |  | +								self.$message.error('积分不能为零');
 | 
	
		
			
				|  |  | +								this.rule_loading2 = false;
 | 
	
		
			
				|  |  | +								return false;
 | 
	
		
			
				|  |  | +							}
 | 
	
		
			
				|  |  | +							this.$axios('post', '/api/integral/rule/items/edit', data)
 | 
	
		
			
				|  |  | +								.then(res => {
 | 
	
		
			
				|  |  | +									if (res.data.code == 1) {
 | 
	
		
			
				|  |  | +										self.$message.success(res.data.msg);
 | 
	
		
			
				|  |  | +										self.getData();
 | 
	
		
			
				|  |  | +										self.rule_close(form);
 | 
	
		
			
				|  |  | +									}
 | 
	
		
			
				|  |  | +								})
 | 
	
		
			
				|  |  | +								.finally(err => {
 | 
	
		
			
				|  |  | +									this.rule_loading2 = false;
 | 
	
		
			
				|  |  |  								});
 | 
	
		
			
				|  |  | -							
 | 
	
		
			
				|  |  | -							})
 | 
	
		
			
				|  |  | +						});
 | 
	
		
			
				|  |  |  					} else {
 | 
	
		
			
				|  |  | -						this.rule_loading2=true;
 | 
	
		
			
				|  |  | +						this.rule_loading2 = true;
 | 
	
		
			
				|  |  |  						self.rules_detail_form.item_id = self.rules_detail_form.id;
 | 
	
		
			
				|  |  |  						let data = self.rules_detail_form;
 | 
	
		
			
				|  |  |  						data.item_id = self.rules_detail_form.id;
 | 
	
		
			
				|  |  |  						if (self.rules_detail_form.min_point == 0 && self.rules_detail_form.range_type == 1) {
 | 
	
		
			
				|  |  |  							self.$message.error('积分不能为零');
 | 
	
		
			
				|  |  | -							this.rule_loading2=false;
 | 
	
		
			
				|  |  | +							this.rule_loading2 = false;
 | 
	
		
			
				|  |  |  							return false;
 | 
	
		
			
				|  |  |  						}
 | 
	
		
			
				|  |  | -						this.$axios('post','/api/integral/rule/items/edit', data).then(res => {
 | 
	
		
			
				|  |  | +						this.$axios('post', '/api/integral/rule/items/edit', data)
 | 
	
		
			
				|  |  | +							.then(res => {
 | 
	
		
			
				|  |  |  								if (res.data.code == 1) {
 | 
	
		
			
				|  |  |  									self.$message.success(res.data.msg);
 | 
	
		
			
				|  |  |  									self.getData();
 | 
	
		
			
				|  |  |  									self.rule_close(form);
 | 
	
		
			
				|  |  |  								}
 | 
	
		
			
				|  |  | -							}).finally(() => {
 | 
	
		
			
				|  |  | +							})
 | 
	
		
			
				|  |  | +							.finally(() => {
 | 
	
		
			
				|  |  |  								this.rule_loading2 = false;
 | 
	
		
			
				|  |  |  							});
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  				} else {
 | 
	
		
			
				|  |  | -					this.rule_loading2=false;
 | 
	
		
			
				|  |  | +					this.rule_loading2 = false;
 | 
	
		
			
				|  |  |  					return false;
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  |  			});
 | 
	
	
		
			
				|  | @@ -617,69 +624,81 @@ export default {
 | 
	
		
			
				|  |  |  					if (self.rules_detail_form.range_type == 1) {
 | 
	
		
			
				|  |  |  						self.rules_detail_form.max_point = self.rules_detail_form.min_point;
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  | -					if(self.rules_detail_form.min_point==0||!self.rules_detail_form.min_point||self.rules_detail_form.max_point==0||!self.rules_detail_form.max_point){
 | 
	
		
			
				|  |  | +					if (self.rules_detail_form.min_point == 0 || !self.rules_detail_form.min_point || self.rules_detail_form.max_point == 0 || !self.rules_detail_form.max_point) {
 | 
	
		
			
				|  |  |  						this.$message.error('请输入积分分值');
 | 
	
		
			
				|  |  | -						return
 | 
	
		
			
				|  |  | +						return;
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  | -					if(Array.isArray(self.rules_detail_form.rule_id)){
 | 
	
		
			
				|  |  | -						self.rules_detail_form.rule_id=self.rules_detail_form.rule_id[self.rules_detail_form.rule_id.length-1];
 | 
	
		
			
				|  |  | +					if (Array.isArray(self.rules_detail_form.rule_id)) {
 | 
	
		
			
				|  |  | +						self.rules_detail_form.rule_id = self.rules_detail_form.rule_id[self.rules_detail_form.rule_id.length - 1];
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  					if (parseFloat(self.rules_detail_form.min_point) > parseFloat(self.rules_detail_form.max_point)) {
 | 
	
		
			
				|  |  |  						this.$confirm(
 | 
	
		
			
				|  |  | -							'填写的规则积分是' +self.rules_detail_form.min_point +' ~ ' +self.rules_detail_form.max_point +',应该是 ' +self.rules_detail_form.max_point +
 | 
	
		
			
				|  |  | -								' ~ ' +self.rules_detail_form.min_point +'吧?','提示',
 | 
	
		
			
				|  |  | +							'填写的规则积分是' +
 | 
	
		
			
				|  |  | +								self.rules_detail_form.min_point +
 | 
	
		
			
				|  |  | +								' ~ ' +
 | 
	
		
			
				|  |  | +								self.rules_detail_form.max_point +
 | 
	
		
			
				|  |  | +								',应该是 ' +
 | 
	
		
			
				|  |  | +								self.rules_detail_form.max_point +
 | 
	
		
			
				|  |  | +								' ~ ' +
 | 
	
		
			
				|  |  | +								self.rules_detail_form.min_point +
 | 
	
		
			
				|  |  | +								'吧?',
 | 
	
		
			
				|  |  | +							'提示',
 | 
	
		
			
				|  |  |  							{
 | 
	
		
			
				|  |  |  								confirmButtonText: '确定',
 | 
	
		
			
				|  |  |  								cancelButtonText: '取消',
 | 
	
		
			
				|  |  |  								type: 'warning'
 | 
	
		
			
				|  |  |  							}
 | 
	
		
			
				|  |  |  						).then(() => {
 | 
	
		
			
				|  |  | -							this.rule_loading2=true;
 | 
	
		
			
				|  |  | +							this.rule_loading2 = true;
 | 
	
		
			
				|  |  |  							let min_point = self.rules_detail_form.min_point;
 | 
	
		
			
				|  |  |  							self.rules_detail_form.min_point = self.rules_detail_form.max_point;
 | 
	
		
			
				|  |  |  							self.rules_detail_form.max_point = min_point;
 | 
	
		
			
				|  |  |  							if (self.rules_detail_form.min_point == 0 && self.rules_detail_form.range_type == 1) {
 | 
	
		
			
				|  |  |  								self.$message.error('积分不能为零');
 | 
	
		
			
				|  |  | -								this.rule_loading2=false;
 | 
	
		
			
				|  |  | +								this.rule_loading2 = false;
 | 
	
		
			
				|  |  |  								return false;
 | 
	
		
			
				|  |  |  							}
 | 
	
		
			
				|  |  |  							let data = {
 | 
	
		
			
				|  |  |  								items: [self.rules_detail_form]
 | 
	
		
			
				|  |  |  							};
 | 
	
		
			
				|  |  | -							this.$axios('post','/api/integral/rule/items', data).then(res => {
 | 
	
		
			
				|  |  | +							this.$axios('post', '/api/integral/rule/items', data)
 | 
	
		
			
				|  |  | +								.then(res => {
 | 
	
		
			
				|  |  |  									if (res.data.code == 1) {
 | 
	
		
			
				|  |  |  										self.$message.success(res.data.msg);
 | 
	
		
			
				|  |  |  										self.getData();
 | 
	
		
			
				|  |  |  										self.rule_close(form);
 | 
	
		
			
				|  |  |  									}
 | 
	
		
			
				|  |  | -								}).finally(() => {
 | 
	
		
			
				|  |  | +								})
 | 
	
		
			
				|  |  | +								.finally(() => {
 | 
	
		
			
				|  |  |  									this.rule_loading2 = false;
 | 
	
		
			
				|  |  |  								});
 | 
	
		
			
				|  |  |  						});
 | 
	
		
			
				|  |  |  					} else {
 | 
	
		
			
				|  |  | -						this.rule_loading2=true;
 | 
	
		
			
				|  |  | +						this.rule_loading2 = true;
 | 
	
		
			
				|  |  |  						self.rules_detail_form.item_id = self.rules_detail_form.id;
 | 
	
		
			
				|  |  | -						
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  						if (self.rules_detail_form.min_point == 0 && self.rules_detail_form.range_type == 1) {
 | 
	
		
			
				|  |  |  							self.$message.error('积分不能为零');
 | 
	
		
			
				|  |  | -							this.rule_loading2=false;
 | 
	
		
			
				|  |  | +							this.rule_loading2 = false;
 | 
	
		
			
				|  |  |  							return false;
 | 
	
		
			
				|  |  |  						}
 | 
	
		
			
				|  |  |  						let data = {
 | 
	
		
			
				|  |  |  							items: [self.rules_detail_form]
 | 
	
		
			
				|  |  |  						};
 | 
	
		
			
				|  |  | -						this.$axios('post','/api/integral/rule/items', data).then(res => {
 | 
	
		
			
				|  |  | +						this.$axios('post', '/api/integral/rule/items', data)
 | 
	
		
			
				|  |  | +							.then(res => {
 | 
	
		
			
				|  |  |  								if (res.data.code == 1) {
 | 
	
		
			
				|  |  |  									self.$message.success(res.data.msg);
 | 
	
		
			
				|  |  |  									self.getData();
 | 
	
		
			
				|  |  |  									self.rule_close(form);
 | 
	
		
			
				|  |  |  								}
 | 
	
		
			
				|  |  | -							}).finally(() => {
 | 
	
		
			
				|  |  | +							})
 | 
	
		
			
				|  |  | +							.finally(() => {
 | 
	
		
			
				|  |  |  								this.rule_loading2 = false;
 | 
	
		
			
				|  |  |  							});
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  				} else {
 | 
	
		
			
				|  |  | -					this.rule_loading2=false;
 | 
	
		
			
				|  |  | +					this.rule_loading2 = false;
 | 
	
		
			
				|  |  |  					return false;
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  |  			});
 | 
	
	
		
			
				|  | @@ -690,20 +709,25 @@ export default {
 | 
	
		
			
				|  |  |  			let data = {
 | 
	
		
			
				|  |  |  				item_id: [this.rules_detail_form.id]
 | 
	
		
			
				|  |  |  			};
 | 
	
		
			
				|  |  | -			this.delRule_loading=true;
 | 
	
		
			
				|  |  | -			self.$confirm('此操作将永久删除该选项, 是否继续?', '提示').then(() => {
 | 
	
		
			
				|  |  | -					this.$axios('post','/api/integral/rule/items/destroy', data).then(res => {
 | 
	
		
			
				|  |  | +			this.delRule_loading = true;
 | 
	
		
			
				|  |  | +			self.$confirm('此操作将永久删除该选项, 是否继续?', '提示').then(
 | 
	
		
			
				|  |  | +				() => {
 | 
	
		
			
				|  |  | +					this.$axios('post', '/api/integral/rule/items/destroy', data)
 | 
	
		
			
				|  |  | +						.then(res => {
 | 
	
		
			
				|  |  |  							if (res.data.code == 1) {
 | 
	
		
			
				|  |  |  								self.$message.success(res.data.msg);
 | 
	
		
			
				|  |  |  								self.rule_show = false;
 | 
	
		
			
				|  |  |  								self.getData(true);
 | 
	
		
			
				|  |  |  							}
 | 
	
		
			
				|  |  | -						}).finally(() => {
 | 
	
		
			
				|  |  | +						})
 | 
	
		
			
				|  |  | +						.finally(() => {
 | 
	
		
			
				|  |  |  							this.delRule_loading = false;
 | 
	
		
			
				|  |  | -					});
 | 
	
		
			
				|  |  | -			},(err)=>{
 | 
	
		
			
				|  |  | -				this.delRule_loading = false;
 | 
	
		
			
				|  |  | -			});
 | 
	
		
			
				|  |  | +						});
 | 
	
		
			
				|  |  | +				},
 | 
	
		
			
				|  |  | +				err => {
 | 
	
		
			
				|  |  | +					this.delRule_loading = false;
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			);
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		//关闭规则弹窗
 | 
	
		
			
				|  |  |  		rule_close(form) {
 | 
	
	
		
			
				|  | @@ -716,9 +740,9 @@ export default {
 | 
	
		
			
				|  |  |  				cancelButtonText: '取消',
 | 
	
		
			
				|  |  |  				type: 'warning'
 | 
	
		
			
				|  |  |  			}).then(() => {
 | 
	
		
			
				|  |  | -					this.rule_show = false;
 | 
	
		
			
				|  |  | -					this.class_show = true;
 | 
	
		
			
				|  |  | -			})
 | 
	
		
			
				|  |  | +				this.rule_show = false;
 | 
	
		
			
				|  |  | +				this.class_show = true;
 | 
	
		
			
				|  |  | +			});
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		add_rule() {
 | 
	
		
			
				|  |  |  			this.rule_show = true;
 | 
	
	
		
			
				|  | @@ -753,45 +777,45 @@ export default {
 | 
	
		
			
				|  |  |  				let data = {
 | 
	
		
			
				|  |  |  					item_id: this.del_item_id
 | 
	
		
			
				|  |  |  				};
 | 
	
		
			
				|  |  | -				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.handleNodeClick(this.selectItem);
 | 
	
		
			
				|  |  | -						}
 | 
	
		
			
				|  |  | -					})
 | 
	
		
			
				|  |  | +				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.handleNodeClick(this.selectItem);
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				});
 | 
	
		
			
				|  |  |  			});
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		editDetails(val) {
 | 
	
		
			
				|  |  |  			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 {
 | 
	
		
			
				|  |  |  				this.rules_detail_form.range_type = '2';
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  | -			
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  			if (this.rules_detail_form.min_point < 0) {
 | 
	
		
			
				|  |  |  				this.integral_select_name1 = '2';
 | 
	
		
			
				|  |  | -				let str=this.rules_detail_form.min_point;
 | 
	
		
			
				|  |  | -				this.rules_detail_form.min_point=str.toString().substring(1);
 | 
	
		
			
				|  |  | +				let str = this.rules_detail_form.min_point;
 | 
	
		
			
				|  |  | +				this.rules_detail_form.min_point = str.toString().substring(1);
 | 
	
		
			
				|  |  |  				// this.rules_detail_form.min_point2=str.toString().substring(1);
 | 
	
		
			
				|  |  |  			} else {
 | 
	
		
			
				|  |  |  				this.integral_select_name1 = '1';
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  | -			
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  			if (this.rules_detail_form.max_point < 0) {
 | 
	
		
			
				|  |  |  				this.integral_select_name2 = '2';
 | 
	
		
			
				|  |  | -				let str=this.rules_detail_form.max_point;
 | 
	
		
			
				|  |  | -				this.rules_detail_form.max_point=str.toString().substring(1);
 | 
	
		
			
				|  |  | +				let str = this.rules_detail_form.max_point;
 | 
	
		
			
				|  |  | +				this.rules_detail_form.max_point = str.toString().substring(1);
 | 
	
		
			
				|  |  |  				// this.rules_detail_form.max_point2=str.toString().substring(1);
 | 
	
		
			
				|  |  |  			} else {
 | 
	
		
			
				|  |  |  				this.integral_select_name2 = '1';
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  			// this.rules_detail_form.min_point2=this.rules_detail_form.min_point;
 | 
	
		
			
				|  |  |  			// this.rules_detail_form.max_point2=this.rules_detail_form.max_point;
 | 
	
		
			
				|  |  | -			
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  			this.rule_show = true;
 | 
	
		
			
				|  |  |  			this.rule_type = 'edit';
 | 
	
		
			
				|  |  |  		},
 | 
	
	
		
			
				|  | @@ -807,10 +831,10 @@ export default {
 | 
	
		
			
				|  |  |  			this.selectItem = {
 | 
	
		
			
				|  |  |  				child: e.child,
 | 
	
		
			
				|  |  |  				id: e.id,
 | 
	
		
			
				|  |  | -				name:e.name,
 | 
	
		
			
				|  |  | -				pid: e.pid,
 | 
	
		
			
				|  |  | +				name: e.name,
 | 
	
		
			
				|  |  | +				pid: e.pid
 | 
	
		
			
				|  |  |  			};
 | 
	
		
			
				|  |  | -			this.flName=e.name;
 | 
	
		
			
				|  |  | +			this.flName = e.name;
 | 
	
		
			
				|  |  |  			this.item_list = items;
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		getItemData(e) {
 | 
	
	
		
			
				|  | @@ -851,86 +875,91 @@ export default {
 | 
	
		
			
				|  |  |  		getData(is) {
 | 
	
		
			
				|  |  |  			this.rule_loading = true;
 | 
	
		
			
				|  |  |  			var that = this;
 | 
	
		
			
				|  |  | -			this.$axios('get','/api/integral/rule/trees', {cycle_type: 1}).then(res => {
 | 
	
		
			
				|  |  | -				var item_list = res.data.data.item_list || [];
 | 
	
		
			
				|  |  | -				var list = [];
 | 
	
		
			
				|  |  | -				for (let i in item_list) {
 | 
	
		
			
				|  |  | -					for (let k in item_list[i]) {
 | 
	
		
			
				|  |  | -						item_list[i][k].pt_Obj = that.$getTyps(item_list[i][k].pt_id);
 | 
	
		
			
				|  |  | -						list.push(item_list[i][k]);
 | 
	
		
			
				|  |  | +			this.$axios('get', '/api/integral/rule/trees', { cycle_type: 1 })
 | 
	
		
			
				|  |  | +				.then(res => {
 | 
	
		
			
				|  |  | +					var item_list = res.data.data.item_list || [];
 | 
	
		
			
				|  |  | +					var list = [];
 | 
	
		
			
				|  |  | +					for (let i in item_list) {
 | 
	
		
			
				|  |  | +						for (let k in item_list[i]) {
 | 
	
		
			
				|  |  | +							item_list[i][k].pt_Obj = that.$getTyps(item_list[i][k].pt_id);
 | 
	
		
			
				|  |  | +							list.push(item_list[i][k]);
 | 
	
		
			
				|  |  | +						}
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  | -				}
 | 
	
		
			
				|  |  | -				that.rule_tree = res.data.data.rule_tree || [];
 | 
	
		
			
				|  |  | -				that.item_list = list;
 | 
	
		
			
				|  |  | -				that.all_item_list = list;
 | 
	
		
			
				|  |  | -				if (is) {
 | 
	
		
			
				|  |  | -					that.handleNodeClick(that.selectItem);
 | 
	
		
			
				|  |  | -				} else {
 | 
	
		
			
				|  |  | -					this.selectItem = { name: '积分规则' }; //选择的分类
 | 
	
		
			
				|  |  | -				}
 | 
	
		
			
				|  |  | -			}).finally(() => {
 | 
	
		
			
				|  |  | -				this.rule_loading = false;
 | 
	
		
			
				|  |  | -			});
 | 
	
		
			
				|  |  | +					that.rule_tree = res.data.data.rule_tree || [];
 | 
	
		
			
				|  |  | +					that.item_list = list;
 | 
	
		
			
				|  |  | +					that.all_item_list = list;
 | 
	
		
			
				|  |  | +					if (is) {
 | 
	
		
			
				|  |  | +						that.handleNodeClick(that.selectItem);
 | 
	
		
			
				|  |  | +					} else {
 | 
	
		
			
				|  |  | +						this.selectItem = { name: '积分规则' }; //选择的分类
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				})
 | 
	
		
			
				|  |  | +				.finally(() => {
 | 
	
		
			
				|  |  | +					this.rule_loading = false;
 | 
	
		
			
				|  |  | +				});
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		//编辑分组
 | 
	
		
			
				|  |  |  		edit_class() {
 | 
	
		
			
				|  |  |  			this.class_show = true;
 | 
	
		
			
				|  |  |  			this.class_type = 'edit';
 | 
	
		
			
				|  |  | -			this.dept_formdata={
 | 
	
		
			
				|  |  | +			this.dept_formdata = {
 | 
	
		
			
				|  |  |  				child: this.selectItem.child,
 | 
	
		
			
				|  |  |  				id: this.selectItem.id,
 | 
	
		
			
				|  |  |  				name: this.selectItem.name,
 | 
	
		
			
				|  |  | -				pid: this.selectItem.pid,
 | 
	
		
			
				|  |  | -			}
 | 
	
		
			
				|  |  | +				pid: this.selectItem.pid
 | 
	
		
			
				|  |  | +			};
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		//添加分组
 | 
	
		
			
				|  |  |  		submit_add_dept(form) {
 | 
	
		
			
				|  |  | -			this.dept_loading=true;
 | 
	
		
			
				|  |  | +			this.dept_loading = true;
 | 
	
		
			
				|  |  |  			let that = this;
 | 
	
		
			
				|  |  |  			that.$refs[form].validate(valid => {
 | 
	
		
			
				|  |  |  				if (valid) {
 | 
	
		
			
				|  |  |  					if (that.class_type == 'edit') {
 | 
	
		
			
				|  |  |  						delete that.dept_formdata.child;
 | 
	
		
			
				|  |  |  						that.dept_formdata.rule_id = that.dept_formdata.id;
 | 
	
		
			
				|  |  | -						if(typeof(that.dept_formdata.pid)=='number'){
 | 
	
		
			
				|  |  | -						}else{
 | 
	
		
			
				|  |  | -							if(that.dept_formdata.pid.length>0){
 | 
	
		
			
				|  |  | -								that.dept_formdata.pid =that.dept_formdata.pid[that.dept_formdata.pid.length - 1];
 | 
	
		
			
				|  |  | -							}else{
 | 
	
		
			
				|  |  | -								that.dept_formdata.pid=0;
 | 
	
		
			
				|  |  | +						if (typeof that.dept_formdata.pid == 'number') {
 | 
	
		
			
				|  |  | +						} else {
 | 
	
		
			
				|  |  | +							if (that.dept_formdata.pid.length > 0) {
 | 
	
		
			
				|  |  | +								that.dept_formdata.pid = that.dept_formdata.pid[that.dept_formdata.pid.length - 1];
 | 
	
		
			
				|  |  | +							} else {
 | 
	
		
			
				|  |  | +								that.dept_formdata.pid = 0;
 | 
	
		
			
				|  |  |  							}
 | 
	
		
			
				|  |  |  						}
 | 
	
		
			
				|  |  | -						this.$axios('post','/api/integral/rule/edit', that.dept_formdata).then(res => {
 | 
	
		
			
				|  |  | -							if (res.data.code == 1) {
 | 
	
		
			
				|  |  | -								that.selectItem.name=that.dept_formdata.name;
 | 
	
		
			
				|  |  | -								that.$message.success('修改积分分类成功');
 | 
	
		
			
				|  |  | -								this.getData(true);
 | 
	
		
			
				|  |  | -								this.add_dept_close('dept_formdata');
 | 
	
		
			
				|  |  | -							}
 | 
	
		
			
				|  |  | -						}).finally(() => {
 | 
	
		
			
				|  |  | -							this.dept_loading = false;
 | 
	
		
			
				|  |  | -						});
 | 
	
		
			
				|  |  | +						this.$axios('post', '/api/integral/rule/edit', that.dept_formdata)
 | 
	
		
			
				|  |  | +							.then(res => {
 | 
	
		
			
				|  |  | +								if (res.data.code == 1) {
 | 
	
		
			
				|  |  | +									that.selectItem.name = that.dept_formdata.name;
 | 
	
		
			
				|  |  | +									that.$message.success('修改积分分类成功');
 | 
	
		
			
				|  |  | +									this.getData(true);
 | 
	
		
			
				|  |  | +									this.add_dept_close('dept_formdata');
 | 
	
		
			
				|  |  | +								}
 | 
	
		
			
				|  |  | +							})
 | 
	
		
			
				|  |  | +							.finally(() => {
 | 
	
		
			
				|  |  | +								this.dept_loading = false;
 | 
	
		
			
				|  |  | +							});
 | 
	
		
			
				|  |  |  					} else {
 | 
	
		
			
				|  |  |  						if (that.dept_formdata.pid !== null && that.dept_formdata.pid.length == 0) {
 | 
	
		
			
				|  |  |  							that.dept_formdata.pid = 0;
 | 
	
		
			
				|  |  |  						} else {
 | 
	
		
			
				|  |  |  							that.dept_formdata.pid = that.dept_formdata.pid[that.dept_formdata.pid.length - 1];
 | 
	
		
			
				|  |  |  						}
 | 
	
		
			
				|  |  | -						this.$axios('post','/api/integral/rule', that.dept_formdata).then(res => {
 | 
	
		
			
				|  |  | -							if (res.data.code == 1) {
 | 
	
		
			
				|  |  | -								that.$message.success('添加积分分类成功');
 | 
	
		
			
				|  |  | -								this.getData(true);
 | 
	
		
			
				|  |  | -								this.add_dept_close('dept_formdata');
 | 
	
		
			
				|  |  | -							}
 | 
	
		
			
				|  |  | -						}).finally(() => {
 | 
	
		
			
				|  |  | -							this.dept_loading = false;
 | 
	
		
			
				|  |  | -						});
 | 
	
		
			
				|  |  | +						this.$axios('post', '/api/integral/rule', that.dept_formdata)
 | 
	
		
			
				|  |  | +							.then(res => {
 | 
	
		
			
				|  |  | +								if (res.data.code == 1) {
 | 
	
		
			
				|  |  | +									that.$message.success('添加积分分类成功');
 | 
	
		
			
				|  |  | +									this.getData(true);
 | 
	
		
			
				|  |  | +									this.add_dept_close('dept_formdata');
 | 
	
		
			
				|  |  | +								}
 | 
	
		
			
				|  |  | +							})
 | 
	
		
			
				|  |  | +							.finally(() => {
 | 
	
		
			
				|  |  | +								this.dept_loading = false;
 | 
	
		
			
				|  |  | +							});
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  				} else {
 | 
	
		
			
				|  |  | -					this.dept_loading=false;
 | 
	
		
			
				|  |  | +					this.dept_loading = false;
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  |  			});
 | 
	
		
			
				|  |  | -			
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		//删除分组
 | 
	
		
			
				|  |  |  		del_dept() {
 | 
	
	
		
			
				|  | @@ -939,7 +968,7 @@ export default {
 | 
	
		
			
				|  |  |  				cancelButtonText: '取消',
 | 
	
		
			
				|  |  |  				type: 'warning'
 | 
	
		
			
				|  |  |  			}).then(() => {
 | 
	
		
			
				|  |  | -				this.$axios('post','/api/integral/rule/destroy', { rule_id: this.selectItem.id }).then(res => {
 | 
	
		
			
				|  |  | +				this.$axios('post', '/api/integral/rule/destroy', { rule_id: this.selectItem.id }).then(res => {
 | 
	
		
			
				|  |  |  					if (res.data.code == 1) {
 | 
	
		
			
				|  |  |  						this.$message.success(res.data.msg);
 | 
	
		
			
				|  |  |  						this.getData();
 | 
	
	
		
			
				|  | @@ -1028,7 +1057,7 @@ $red: #f56c6c;
 | 
	
		
			
				|  |  |  		white-space: nowrap;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  | -.form-right ::v-deep .el-form-item__content{
 | 
	
		
			
				|  |  | +.form-right ::v-deep .el-form-item__content {
 | 
	
		
			
				|  |  |  	margin-left: 0px !important;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  .terr-left button {
 | 
	
	
		
			
				|  | @@ -1038,36 +1067,36 @@ $red: #f56c6c;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  .el-dropdown-links {
 | 
	
		
			
				|  |  | -    font-size: 20px;
 | 
	
		
			
				|  |  | -    cursor: pointer;
 | 
	
		
			
				|  |  | -    color: #686a6d;
 | 
	
		
			
				|  |  | +	font-size: 20px;
 | 
	
		
			
				|  |  | +	cursor: pointer;
 | 
	
		
			
				|  |  | +	color: #686a6d;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  | -.color-red{
 | 
	
		
			
				|  |  | -  color: $red;
 | 
	
		
			
				|  |  | -  &:hover{
 | 
	
		
			
				|  |  | -    color: #f14141;
 | 
	
		
			
				|  |  | -  }
 | 
	
		
			
				|  |  | +.color-red {
 | 
	
		
			
				|  |  | +	color: $red;
 | 
	
		
			
				|  |  | +	&:hover {
 | 
	
		
			
				|  |  | +		color: #f14141;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  | -.qrcodesave{
 | 
	
		
			
				|  |  | +.qrcodesave {
 | 
	
		
			
				|  |  |  	text-align: center;
 | 
	
		
			
				|  |  |  	margin-top: 15px;
 | 
	
		
			
				|  |  |  	font-size: 18px;
 | 
	
		
			
				|  |  | -	span{
 | 
	
		
			
				|  |  | +	span {
 | 
	
		
			
				|  |  |  		color: #606266;
 | 
	
		
			
				|  |  | -		cursor:pointer;
 | 
	
		
			
				|  |  | -    	transition: all .3s;
 | 
	
		
			
				|  |  | +		cursor: pointer;
 | 
	
		
			
				|  |  | +		transition: all 0.3s;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -.qrcodesave span:hover{
 | 
	
		
			
				|  |  | +.qrcodesave span:hover {
 | 
	
		
			
				|  |  |  	color: #2490fd;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  | -.lookQrcode{
 | 
	
		
			
				|  |  | +.lookQrcode {
 | 
	
		
			
				|  |  |  	color: #606266;
 | 
	
		
			
				|  |  | -	cursor:pointer;
 | 
	
		
			
				|  |  | -	transition: all .3s;
 | 
	
		
			
				|  |  | +	cursor: pointer;
 | 
	
		
			
				|  |  | +	transition: all 0.3s;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  | -.lookQrcode:hover{
 | 
	
		
			
				|  |  | +.lookQrcode:hover {
 | 
	
		
			
				|  |  |  	color: #2490fd;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  </style>
 |