BUG 30236
This commit is contained in:
		@@ -21,7 +21,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <AiEmpty :description="isGridMember?`暂无数据`:`当前人员不是网格员或网格长`" class="emptyWrap" v-else/>
 | 
			
		||||
        <AiEmpty :description="`暂无数据`" class="emptyWrap" v-else/>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="subBtn flex">
 | 
			
		||||
@@ -49,34 +49,20 @@ export default {
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    ...mapState(['user']),
 | 
			
		||||
    isGridMember() {
 | 
			
		||||
      return this.user.girdCheckType > 0
 | 
			
		||||
    },
 | 
			
		||||
    //是否展示所有网格(随手拍)
 | 
			
		||||
    isApply: v => v.query?.formType == 2,
 | 
			
		||||
    clearable: v => v.query?.clearable,
 | 
			
		||||
    isMyGirds: v => v.query?.self == true,
 | 
			
		||||
    selected: v => [v.query?.selected].flat(),
 | 
			
		||||
    isFormMap: v => v.query?.isFormMap || 0
 | 
			
		||||
  },
 | 
			
		||||
  onLoad(query) {
 | 
			
		||||
    this.query = query
 | 
			
		||||
    this.isGridMember || this.isApply ? this.getAllGrids() : this.$u.toast('当前人员不是网格员或网格长')
 | 
			
		||||
    this.getAllGrids()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getAllGrids() {
 | 
			
		||||
      this.selectList = []
 | 
			
		||||
      let {girdMemberId} = this.user,
 | 
			
		||||
          url = `/app/appgirdmemberinfo/queryMyGirdListByLevel2AndUser`,
 | 
			
		||||
          params = {girdMemberId}
 | 
			
		||||
      if (this.isApply) {
 | 
			
		||||
        url = `/app/appgirdinfo/listByInfo`
 | 
			
		||||
        params = {}
 | 
			
		||||
      }
 | 
			
		||||
      if (this.isMyGirds) {
 | 
			
		||||
        url = `/app/appgirdmemberinfo/queryMyGirdListByLevel2`
 | 
			
		||||
      }
 | 
			
		||||
      this.$instance.post(url, null, {params}).then((res) => {
 | 
			
		||||
      let url = `/app/appgirdinfo/listByInfo`
 | 
			
		||||
      this.$instance.post(url).then(res => {
 | 
			
		||||
        if (res?.data) {
 | 
			
		||||
          let parents = res.data?.map(e => e.parentGirdId)
 | 
			
		||||
          this.allData = res.data?.map(e => ({...e, hasChildren: parents.includes(e.id)}))
 | 
			
		||||
@@ -96,7 +82,7 @@ export default {
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      } else {
 | 
			
		||||
        this.options = this.allData.filter((e, i, arr) => !arr?.map(e => e.id).includes(e.parentGirdId) || this.isMyGirds)
 | 
			
		||||
        this.options = this.allData.filter((e, i, arr) => !arr?.map(e => e.id).includes(e.parentGirdId))
 | 
			
		||||
        this.options?.map((item) => item.isChecked = this.selected.includes(item.id))
 | 
			
		||||
        let obj = {girdName: '可选范围', id: ''}
 | 
			
		||||
        this.selectList.push(obj)
 | 
			
		||||
@@ -141,7 +127,7 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    submit() {
 | 
			
		||||
      if (this.SelectGird.id != null) {
 | 
			
		||||
        if (!this.isApply && !this.isMyGirds) {
 | 
			
		||||
        if (!this.isApply) {
 | 
			
		||||
          uni.setStorageSync("lastSelectedGrid", this.SelectGird.parentGirdId)
 | 
			
		||||
        }
 | 
			
		||||
        uni.navigateBack({
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user