三涧溪党员积分
This commit is contained in:
		| @@ -82,6 +82,7 @@ export default { | ||||
|         label: 'name' | ||||
|       }, | ||||
|       createTime: '', | ||||
|       partyOrgId: '', | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
| @@ -90,7 +91,7 @@ export default { | ||||
|     }, | ||||
|     getTableData() { | ||||
|       this.instance.post("/app/apppartyintegralinfo/listByOrg", null, { | ||||
|         params: {...this.page, ...this.search} | ||||
|         params: {...this.page, ...this.search, partyOrgId: this.partyOrgId }  // partyOrgId: | ||||
|       }).then(res => { | ||||
|         if (res?.data) { | ||||
|           this.tableData = res.data?.records | ||||
| @@ -116,12 +117,10 @@ export default { | ||||
|     }, | ||||
| 
 | ||||
|     onTreeChange(e) { | ||||
|       this.search.areaId = e.id | ||||
|       this.areaName = e.name | ||||
|       this.search.current = 1 | ||||
| 
 | ||||
|       console.log(e); | ||||
|       this.partyOrgId = e.id | ||||
|       this.$nextTick(() => { | ||||
|         this.getList() | ||||
|         this.getTableData() | ||||
|       }) | ||||
|     }, | ||||
| 
 | ||||
| @@ -110,7 +110,7 @@ export default { | ||||
|     onConfirm() { | ||||
|       this.$refs['form'].validate(valid => { | ||||
|         if (valid) { | ||||
|           this.instance.post(`/app/appvillagerintegraldetail/changeIntegral`, this.form).then(res => { | ||||
|           this.instance.post(`/app/apppartyintegralinfo/changeIntegral`, this.form).then(res => { | ||||
|             if (res.code == 0) { | ||||
|               this.$message.success("添加成功") | ||||
|               this.dialog = false | ||||
| @@ -71,9 +71,9 @@ | ||||
| 
 | ||||
|           <el-form-item label="规则" prop="ruleType" required> | ||||
|             <el-radio-group v-model="form.ruleType" @change="typeChange"> | ||||
|               <el-radio :label="0">常规</el-radio> | ||||
|               <el-radio :label="2">区间</el-radio> | ||||
|               <el-radio :label="1">阶梯</el-radio> | ||||
|               <el-radio label="0">常规</el-radio> | ||||
|               <el-radio label="2">区间</el-radio> | ||||
|               <el-radio label="1">阶梯</el-radio> | ||||
|             </el-radio-group> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="周期范围" prop="scoringCycle"> | ||||
| @@ -84,15 +84,15 @@ | ||||
|             <el-input placeholder="请输入,周期范围内,不填写表示不限制" v-model.number="form.numberLimit" clearable/> | ||||
|           </el-form-item> | ||||
|           <!-- 常规 --> | ||||
|           <el-form-item label="积分分值" prop="integral" v-if="form.ruleType == 0"> | ||||
|           <el-form-item label="积分分值" prop="integral" v-if="form.ruleType == '0'"> | ||||
|             <el-input placeholder="请输入" v-model="form.integral" clearable/> | ||||
|           </el-form-item> | ||||
|           <!-- 区间 --> | ||||
|           <el-form-item label="积分分值" prop="integralArr" v-if="form.ruleType == 2"> | ||||
|           <el-form-item label="积分分值" prop="integralArr" v-if="form.ruleType == '2'"> | ||||
|             <ai-range v-model="form.integralArr" clearable/> | ||||
|           </el-form-item> | ||||
|           <!-- 阶梯 --> | ||||
|           <el-form-item label="积分分值" prop="ladderIntegral" v-if="form.ruleType == 1"> | ||||
|           <el-form-item label="积分分值" prop="ladderIntegral" v-if="form.ruleType == '1'"> | ||||
|             <el-row type="flex" justify="space-between"> | ||||
|               <div></div> | ||||
|               <el-button v-if="form.ruleType==1" type="text" icon="iconfont iconAdd" | ||||
| @@ -180,7 +180,7 @@ export default { | ||||
|         classify: '0', | ||||
|         eventName: '', | ||||
|         eventDesc: '', | ||||
|         ruleType: '0', | ||||
|         ruleType: '', | ||||
|         scoringCycle: '', | ||||
|         numberLimit: '', //奖励次数 | ||||
|         integral: '',  // 常规 | ||||
| @@ -243,7 +243,7 @@ export default { | ||||
|       this.form = { | ||||
|         eventName: '', | ||||
|         eventDesc: '', | ||||
|         ruleType: 0, | ||||
|         ruleType: '', | ||||
|         scoringCycle: '', | ||||
|         numberLimit: '', | ||||
|         integral: '', | ||||
| @@ -303,16 +303,16 @@ export default { | ||||
|       this.search.ruleStatus = "" | ||||
|       this.getList(); | ||||
|     }, | ||||
|     onConfirm(id) { | ||||
|     onConfirm() { | ||||
|       this.$refs.DialogForm.validate((valid) => { | ||||
|         if (valid) { | ||||
|           this.form.integralMin = this.form.integralArr[0] || '' | ||||
|           this.form.integralMax = this.form.integralArr[1] || '' | ||||
|           this.form.integralMin = this.form.integralArr?.[0] || '' | ||||
|           this.form.integralMax = this.form.integralArr?.[1] || '' | ||||
|           this.form.ladderRule = JSON.stringify(this.form.ladderIntegral) | ||||
|            | ||||
|           this.instance.post(`/app/apppartyintegralrule/addOrUpdate`, { | ||||
|             ...this.form, | ||||
|             id: id || '' | ||||
|             id: this.form.id || '' | ||||
|           }).then((res) => { | ||||
|             if (res.code == 0) { | ||||
|               this.$message.success(`${this.isEdit ? '编辑成功' : '添加成功'}`) | ||||
| @@ -341,7 +341,7 @@ export default { | ||||
|     }, | ||||
|     handleDelete(i) { | ||||
|       this.$confirm("是否要删除该规则?").then(() => { | ||||
|         this.form.ladderRule.splice(i, 1) | ||||
|         this.form.ladderIntegral.splice(i, 1) | ||||
|       }).catch(() => 0) | ||||
|     }, | ||||
|     checkIntegral(v) { | ||||
| @@ -40,7 +40,7 @@ | ||||
|                   停用 | ||||
|                 </el-button> | ||||
|                 <el-button type="text" :disabled="!permissions('app_appvillagerintegralrule_edit')" @click="changeStatus(row.id, 1)" v-else>启用</el-button> | ||||
|                 <el-button type="text" :disabled="!permissions('app_appvillagerintegralrule_edit')" @click="toEdit(row.id)">编辑</el-button> | ||||
|                 <el-button type="text" :disabled="!permissions('app_appvillagerintegralrule_edit')" @click="toEdit(row)">编辑</el-button> | ||||
|                 <el-button type="text" :disabled="!permissions('app_appvillagerintegralrule_del')" @click="remove(row.id)">删除</el-button> | ||||
|               </div> | ||||
|             </template> | ||||
| @@ -92,8 +92,8 @@ export default { | ||||
|       tableData: [], | ||||
|       page: {current: 1, size: 10, total: 0}, | ||||
|       colConfigs: [ | ||||
|         {prop: "event", label: "事件", dict: "integralRuleEvent", align: "center"}, | ||||
|         {prop: "type", label: "类型", dict: "integralRuleEventType", align: "center"}, | ||||
|         {prop: "event", label: "事件", dict: "partyIntegralRuleEvent", align: "center"}, | ||||
|         {prop: "type", label: "类型", dict: "integralRuleEvent4", align: "center"}, | ||||
|         {prop: "ruleType", label: "规则", dict: "integralRuleRuleType"}, | ||||
|         {prop: "scoringCycle", label: "周期范围", dict: "integralRuleScoringCycle", align: "center"}, | ||||
|         {prop: "status", label: "状态", align: "center", width: 96, dict: "integralRuleStatus"}, | ||||
| @@ -122,20 +122,8 @@ export default { | ||||
|     } | ||||
|   },  | ||||
|   created() { | ||||
|     this.$dict.load("integralRuleStatus", "integralRuleRuleType", 'integralRuleScoringCycle', 'integralRuleEvent', 'integralRuleEventType','partyIntegralRuleEvent','integralRuleEvent4').then(() => { | ||||
|     this.$dict.load("integralRuleStatus", "integralRuleRuleType", 'integralRuleScoringCycle', 'integralRuleEvent', 'integralRuleEventType','partyIntegralRuleEvent','partyIntegralRuleEvent4','integralRuleEvent4').then(() => { | ||||
|       this.getList(); | ||||
| 
 | ||||
|       // let {,event, type} = this.form, | ||||
|       let dict = 'integralRuleEvent4' + this.form.event | ||||
|       this.$dict.load(dict).then(() => { | ||||
|         // this.form.eventType = [event, type] | ||||
|         this.cacheOps = this.dict.getDict('partyIntegralRuleEvent').map(e => { | ||||
|           if (e.dictValue == this.form.event) { | ||||
|             e.children = this.$dict.getDict(dict).map(d => ({...d, leaf: true})) | ||||
|           } | ||||
|           return e | ||||
|         }) | ||||
|       }) | ||||
|     }); | ||||
|   }, | ||||
|   computed: { | ||||
| @@ -150,7 +138,7 @@ export default { | ||||
|         lazyLoad: (node, resolve) => { | ||||
|           if (node.level == 0) resolve(this.dict.getDict('partyIntegralRuleEvent')) | ||||
|           else if (node.level == 1) { | ||||
|             let dict = 'integralRuleEvent4' + node.value | ||||
|             let dict = 'integralRuleEvent4'  | ||||
|             this.dict.load(dict).then(() => { | ||||
|               let nodes = this.dict.getDict(dict).map(e => ({...e, leaf: true})) | ||||
|               resolve(nodes) | ||||
| @@ -186,19 +174,29 @@ export default { | ||||
|       } | ||||
|     }, | ||||
|     close() { | ||||
| 
 | ||||
|       this.form = { | ||||
|         classify: 1, | ||||
|         eventType: '', | ||||
|         event: '', | ||||
|         type: '', | ||||
|         ruleType: 0, | ||||
|         scoringCycle: '', | ||||
|         integral: '', | ||||
|         integralArr: [], | ||||
|       } | ||||
|     }, | ||||
|     onConfirm(id) { | ||||
|     onConfirm() { | ||||
|       this.$refs.DialogForm.validate((valid) => { | ||||
|         this.flag = true | ||||
|         if (valid) { | ||||
|           this.instance.post(`/app/apppartyintegralrule/addOrUpdate`, { | ||||
|             ...this.form, | ||||
|             id: id || '' | ||||
|             id: this.form.id | ||||
|           }).then((res) => { | ||||
|             if (res.code == 0) { | ||||
|               this.$message.success(`${this.isEdit ? '编辑成功' : '添加成功'}`) | ||||
|               this.dialog = false; | ||||
|               this.getList() | ||||
|             } | ||||
|           }).catch(() => { | ||||
|             this.flag = false; | ||||
| @@ -207,24 +205,24 @@ export default { | ||||
|           this.flag = false; | ||||
|         } | ||||
|       }); | ||||
| 
 | ||||
|     }, | ||||
|     toEdit(row) { | ||||
|       // this.form = this.$copy(row) | ||||
|       // let {ladderRule, event, type} = this.form, | ||||
|       //     dict = 'integralRuleEvent' + event | ||||
|       // this.dict.load(dict).then(() => { | ||||
|       //   this.form.eventType = [event, type] | ||||
|       //   this.form.ladderRule = JSON.parse(ladderRule || "[]") | ||||
|       //   this.cacheOps = this.dict.getDict('integralRuleEvent').map(e => { | ||||
|       //     if (e.dictValue == event) { | ||||
|       //       e.children = this.dict.getDict(dict).map(d => ({...d, leaf: true})) | ||||
|       //     } | ||||
|       //     return e | ||||
|       //   }) | ||||
|       //   this.$nextTick(() => { | ||||
|       //     this.dialog = true | ||||
|       //   }) | ||||
|       // }) | ||||
|       this.form = this.$copy(row) | ||||
|       let {event, type} = this.form, | ||||
|           dict = 'partyIntegralRuleEvent' + event | ||||
|       this.$dict.load(dict).then(() => { | ||||
|         this.form.eventType = [event, type] | ||||
|         this.cacheOps = this.$dict.getDict('partyIntegralRuleEvent').map(e => { | ||||
|           if (e.dictValue == event) { | ||||
|             e.children = this.dict.getDict(dict).map(d => ({...d, leaf: true})) | ||||
|           } | ||||
|           return e | ||||
|         }) | ||||
|         this.$nextTick(() => { | ||||
|           this.dialog = true | ||||
|         }) | ||||
|       }) | ||||
|     }, | ||||
|     remove(id) { | ||||
|       this.$confirm("删除后不可恢复,是否要删除该事项?", { | ||||
		Reference in New Issue
	
	Block a user