Blame view

src/utils/filter.js 4.01 KB
1
/*
yuanbo committed
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-09-25 10:56:39
5
 */
任超 committed
6
import store from '@/store'
任超 committed
7 8
// table 内部过滤器 由于过滤器只能在模板中使用 所以 就有了 jsx内部方法过滤器
export default class filter {
yuanbo committed
9 10 11 12 13
  /**
   * @description: selected
   * @param {*} row
   * @author: renchao
   */
任超 committed
14
  selected (row) {
15
    // if (row.sfbl == 0) { // 正在办理不能申请
yuanbo committed
16
    //   return false
17 18 19 20
    // } else {
    //   return true //可选择
    // }
    return true
任超 committed
21
  }
任超 committed
22
  // 业务来源
yuanbo committed
23 24 25 26 27
  /**
   * @description: 业务来源
   * @param {*} val
   * @author: renchao
   */
任超 committed
28
  busSource (val) {
29
    let status = { 1: '办事大厅', 2: '微信小程序' }
任超 committed
30 31
    return status[val]
  }
32 33

  //申请分类(1:正常申请,2:一并申请,3:补录申请)
yuanbo committed
34 35 36 37 38
  /**
   * @description: 申请分类
   * @param {*} val
   * @author: renchao
   */
39 40 41 42
  sqfls (val) {
    let status = { 1: '正常申请', 2: '一并申请', 3: '补录申请' }
    return status[val]
  }
yuanbo committed
43 44 45 46 47 48
  /**
   * @description: 字典
   * @param {*} val
   * @param {*} code
   * @author: renchao
   */
任超 committed
49 50 51 52 53 54 55 56 57 58 59 60
  dicStatus (val, code) {
    let data = store.getters.dictData[code],
      name = '暂无'
    if (data) {
      data.map((item) => {
        if (item.dcode == val) {
          name = item.dname
        }
      })
      return name
    }
  }
赵千 committed
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119

  /**
   * @description: blzt
   * @param {*} val
   * @author:
   */
  blzt (val) {
    if (val ===  0) {
      return "未提交"
    } else if (val === 1) {
      return "已提交"
    } else if (val === 2) {
      return "办理中"
    } else if (val === 3) {
      return "已办结"
    } else if (val === 4) {
      return "已终止"
    } else if (val === 5) {
      return "已退回"
    } else if (val === 8) {
      return "已登簿"
    }
  }

  /**
   * @description: ywlx
   * @param {*} val
   * @author:
   */
  ywlx (val) {
    if (val === "1") {
      return "预售商品房买卖预告登记"
    } else if (val === "2") {
      return "预售商品房抵押权预告登记"
    } else if (val === "3") {
      return "商品房初始登记"
    } else if (val === "4") {
      return "不动产抵押登记"
    } else if (val === "5") {
      return "预购商品房预告登记/预购商品房抵押登记"
    } else if (val === "6") {
      return "预售商品房预告登记转房屋所有权登记/预售商品房抵押登记转抵押权登记"
    } else if (val === "7") {
      return "查封登记"
    } else if (val === "8") {
      return "解封登记"
    } else if (val === "9") {
      return "商品房转移登记"
    } else if (val === "10") {
      return "存量房转移登记"
    } else if (val === "23") {
      return "续封登记"
    } else if (val === "41") {
      return "独幢宅基地首次登记"
    } else if (val === "42") {
      return "多幢宅基地首次登记"
    }
  }

yuanbo committed
120 121 122 123 124
  /**
   * @description: filterHtml
   * @param {*} content
   * @author: renchao
   */
125 126 127
  filterHtml (content) {
    return content.replace(/<[^>]+>/g, '');
  }
yuanbo committed
128 129 130 131 132
  /**
   * @description: getDictData
   * @param {*} val
   * @author: renchao
   */
133
  getDictData (val) {
134 135
    return store.getters.dictData[val]
  }
yuanbo committed
136 137 138 139 140
  /**
   * @description: yWstatus
   * @param {*} row
   * @author: renchao
   */
141 142
  yWstatus (row) {
    let text = "";
143
    let keys = 0;
144 145 146
    // 定义策略对象
    const strategies = {
      djblzt: "正在办理",
147 148 149 150 151 152 153 154
      zjgcdyzt: "在建工程抵押",
      ycfzt: "已预查封",
      cfzt: "已查封",
      diyizt: "已地役",
      yyzt: "异议中",
      xzzt: "已限制",
      ygmmzt: "已预告买卖",
      ygdyzt: "已预告抵押",
155 156
      dyzt: "已抵押",
      sfbl: "正在补录"
157 158 159 160
    };

    for (let key in row) {
      if (row[key] === 1 && strategies[key]) {
161 162 163 164 165 166
        keys++;
        if (keys == 1) {
          text += strategies[key];
        } else {
          text += ',' + strategies[key];
        }
167 168 169 170 171
      }
    }

    return text;
  }
172 173 174 175 176 177 178
  joinItem (val) {
    if (Array.isArray(val) && val.length > 0) {
      return val.join()
    } else {
      return val
    }
  }
yuanbo committed
179
}