Merge branch 'dev' of http://git.sinoecare.com/sinoecare/digital_village_v2/dvcp_v2_webapp into dev
This commit is contained in:
		| @@ -34,7 +34,7 @@ | ||||
|       <template #content> | ||||
|         <ai-search-bar> | ||||
|           <template #left> | ||||
|             <el-select size="small" style="width: 200px;margin-left: 16px;" v-model="search.girdId" placeholder="类型" clearable | ||||
|             <el-select size="small" style="width: 200px;" v-model="search.girdId" placeholder="类型" clearable | ||||
|                       @change="getListInit()"> | ||||
|               <el-option | ||||
|                   v-for="(item,i) in girdList" | ||||
|   | ||||
| @@ -5,21 +5,12 @@ | ||||
|         <ai-search-bar> | ||||
|           <template #left> | ||||
|             <el-button type="primary" size="small" icon="iconfont iconAdd" @click="dialog = true">批量调整积分</el-button> | ||||
|             <el-button type="primary" size="small" icon="iconfont iconAdd" @click="toDetail('')">跳转详情</el-button> | ||||
|             <el-select size="small" style="width: 200px;" v-model="search.girdId" placeholder="所属网格" clearable | ||||
|                       @change="getListInit()"> | ||||
|               <el-option | ||||
|                   v-for="(item,i) in girdList" | ||||
|                   :key="i" | ||||
|                   :label="item.girdName" | ||||
|                   :value="item.id" | ||||
|               > | ||||
|               </el-option> | ||||
|             </el-select> | ||||
|             <el-cascader ref="cascader1" clearable v-model="search.girdId" :options="girdOptions" placeholder="所属网格" size="small"  | ||||
|               :props="defaultProps" :show-all-levels="false" @change="gridChange"></el-cascader> | ||||
|           </template> | ||||
|           <template #right> | ||||
|             <el-input size="small" placeholder="请输入居民名称或真实姓名" v-model="search.name" clearable | ||||
|               @clear="page.current = 1, search.name = '', getTableData()" suffix-icon="iconfont iconSearch" | ||||
|             <el-input size="small" placeholder="请输入居民名称或真实姓名" v-model="search.userName" clearable | ||||
|               @clear="page.current = 1, search.userName = '', getTableData()" suffix-icon="iconfont iconSearch" | ||||
|               v-throttle="() => {(page.current = 1), getTableData();}"/> | ||||
|             <ai-download :instance="instance" url="" :params="search" fileName="网格员积分" | ||||
|                          :disabled="tableData.length == 0"> | ||||
| @@ -32,7 +23,7 @@ | ||||
|           <el-table-column slot="options" label="操作"  align="center"> | ||||
|             <template slot-scope="{ row }"> | ||||
|               <el-button type="text" @click="dialog = true">调整积分</el-button> | ||||
|               <el-button type="text" @click="toAdd(row.id)">详情</el-button> | ||||
|               <el-button type="text" @click="toDetail(row.id)">详情</el-button> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|         </ai-table> | ||||
| @@ -48,8 +39,8 @@ | ||||
|       <el-form ref="form" :model="form" :rules="rules" label-width="80px"> | ||||
|         <el-form-item label="选择人员" prop="residentId"> | ||||
|           <ai-person-select :instance="instance" :customClicker="true" | ||||
|                             :url="'/app/appresident/list?areaId=' + user.info.areaId" | ||||
|                             :isMultiple="false" dialogTitle="选择" @selectPerson="selectPerson"> | ||||
|                             :url="'/app/appgirdmemberinfo/list?size=10'" | ||||
|                             :isMultiple="true" dialogTitle="选择" @selectPerson="selectPerson"> | ||||
|             <template name="option" v-slot:option="{ item }"> | ||||
|               <span class="iconfont iconProlife">{{ item.name }}</span> | ||||
|               <ai-id mode="show" :show-eyes="false" :value="item.idNumber"/> | ||||
| @@ -61,17 +52,13 @@ | ||||
|                     maxlength="100"></el-input> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="上传凭证"> | ||||
|           <el-row> | ||||
|             <el-radio v-model="radio" label="1">图片</el-radio> | ||||
|             <el-radio v-model="radio" label="2">附件</el-radio> | ||||
|           </el-row> | ||||
|           <ai-uploader :instance="instance" isWechat v-model="form.files" :limit="1" url="/app/wxcp/upload/uploadFile?type=image"></ai-uploader> | ||||
|           <ai-uploader :instance="instance" fileType="file" v-model="form.enclosure" :limit="1"></ai-uploader> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="类型" prop="integralCalcType"> | ||||
|           <!-- <ai-select v-model="form.integralCalcType" :selectList="dict.getDict('integralCalcType')"/> --> | ||||
|           <ai-select v-model="form.integralCalcType" :selectList="dict.getDict('integralCalcType')"/> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="积分" prop="changeIntegral"> | ||||
|           <el-input v-model.trim="form.changeIntegral" placeholder="请输入正数" size="small"></el-input> | ||||
|         <el-form-item label="积分" prop="integral"> | ||||
|           <el-input v-model.trim="form.integral" placeholder="请输入正数" size="small"></el-input> | ||||
|         </el-form-item> | ||||
|       </el-form> | ||||
|     </ai-dialog> | ||||
| @@ -92,8 +79,7 @@ export default { | ||||
|   data() { | ||||
|     return { | ||||
|       search: { | ||||
|         current: 1, | ||||
|         name: '', | ||||
|         userName: '', | ||||
|         girdId: '', | ||||
|       }, | ||||
|       tableData: [], | ||||
| @@ -101,24 +87,40 @@ export default { | ||||
|       girdList: [], | ||||
|        | ||||
|       form: { | ||||
|  | ||||
|         ids: [], | ||||
|         eventDesc: "",   | ||||
|         enclosure: [],   // 附件 | ||||
|         integralCalcType: "", | ||||
|         integral: 0, | ||||
|       }, | ||||
|       personList: [], | ||||
|       dialog: false, | ||||
|       radio: '' | ||||
|       girdOptions: [], | ||||
|       defaultProps: { | ||||
|         label: 'girdName', | ||||
|         value: 'id', | ||||
|         checkStrictly: true, | ||||
|         expandTrigger: 'hover', | ||||
|       }, | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     // this.$dict.load('integralCalcType') | ||||
|     this.$dict.load('integralCalcType') | ||||
|     this.getTableData() | ||||
|     this.getGridList() | ||||
|   }, | ||||
|   watch: { | ||||
|     gridChange() {} | ||||
|   }, | ||||
|   computed: { | ||||
|     ...mapState(['user']), | ||||
|     colConfigs() { | ||||
|       return [ | ||||
|         { prop: "", label: '姓名', align: "left",  }, | ||||
|         { prop: "", label: '所属网格', align: "center",  }, | ||||
|         { prop: "", label: '积分余额', align: "center", }, | ||||
|         { prop: "", label: '累计积分', align: "center", }, | ||||
|         { prop: "userName", label: '姓名', align: "left",  }, | ||||
|         { prop: "girdName", label: '所属网格', align: "center",  }, | ||||
|         { prop: "integral", label: '积分余额', align: "center", }, | ||||
|         { prop: "totalIntegral", label: '累计积分', align: "center", }, | ||||
|         { prop: "usedIntegral", label: '已用积分', align: "center", }, | ||||
|         { slot: "options" }, | ||||
|       ] | ||||
|     }, | ||||
| @@ -127,26 +129,87 @@ export default { | ||||
|         residentId: [{required: true, message: '请选择人员', trigger: 'blur'},], | ||||
|         eventDesc: [{required: true, message: '请输入调整说明', trigger: 'blur'},], | ||||
|         integralCalcType: [{required: true, message: '请选择类型', trigger: 'change'},], | ||||
|         changeIntegral: [{required: true, validator: (r, v, cb) => v > 0 ? cb() : cb("请输入正数")}], | ||||
|         integral: [{required: true, validator: (r, v, cb) => v > 0 ? cb() : cb("请输入正数")}], | ||||
|       } | ||||
|     }, | ||||
|   }, | ||||
|   methods: { | ||||
|     getTableData() {}, | ||||
|     getListInit() { | ||||
|       this.search.current = 1 | ||||
|       this.getList() | ||||
|     getTableData() { | ||||
|       this.instance.post(`/app/appintegraluser/integralManager`,null,{ | ||||
|         params: { | ||||
|           ...this.page, | ||||
|           ...this.search, | ||||
|         } | ||||
|       }).then(res => { | ||||
|         if(res?.data) { | ||||
|           this.tableData = res.data.records | ||||
|           this.page.total = res.data.total | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     selectPerson(val) { | ||||
|       if (val) { | ||||
|         this.form.residentId = val.id | ||||
|         this.personList = [{...val}] | ||||
|       } else { | ||||
|         this.form.residentId = "" | ||||
|         this.personList = [] | ||||
|       } | ||||
|       this.personList = val | ||||
|       this.form.ids = this.personList.map(e => e.id) | ||||
|       // if (val) { | ||||
|       //   this.form.residentId = val.id | ||||
|       //   this.personList = [{...val}] | ||||
|       // } else { | ||||
|       //   this.form.residentId = "" | ||||
|       //   this.personList = [] | ||||
|       // } | ||||
|     }, | ||||
|     onConfirm() {}, | ||||
|     getGridList() { | ||||
|       this.instance.post(`/app/appgirdinfo/listAll3`).then((res) => { | ||||
|         if (res.code == 0) { | ||||
|           this.girdOptions = this.toTree(res.data) | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     // 转树形结构 | ||||
|     toTree(data) { | ||||
|       let result = []; | ||||
|       if (!Array.isArray(data)) { | ||||
|         return result | ||||
|       } | ||||
|       let map = {}; | ||||
|       data.forEach(item => { | ||||
|         map[item.id] = item; | ||||
|       }); | ||||
|       data.forEach(item => { | ||||
|         let parent = map[item.parentGirdId]; | ||||
|         if (parent) { | ||||
|           (parent.children || (parent.children = [])).push(item); | ||||
|         } else { | ||||
|           result.push(item); | ||||
|         } | ||||
|       }); | ||||
|       return result; | ||||
|     }, | ||||
|  | ||||
|     gridChange(val) { | ||||
|       this.search.girdId = val?.[val.length - 1] | ||||
|       this.$refs.cascader1.dropDownVisible = false; | ||||
|       this.getTableData() | ||||
|     }, | ||||
|  | ||||
|     onConfirm() { | ||||
|       this.instance.post(`/app/appintegraluser/changeIntegral`,{ | ||||
|         ids: this.form.ids, | ||||
|         eventDesc: this.form.eventDesc,   | ||||
|         enclosure: this.form.enclosure?.[0].url,   // 附件 | ||||
|         integralCalcType: this.form.integralCalcType, | ||||
|         integral: this.form.integral, | ||||
|       }).then(res => { | ||||
|         if(res.code == 0) { | ||||
|           this.$message.success('调整积分成功') | ||||
|           this.getTableData() | ||||
|           this.dialog = false | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     toDetail(id) { | ||||
|       this.$emit('change', { | ||||
|         type: 'gridScoreDetail', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user