/*
  @description: 统计分析字典信息
  @Modifier: haofengxian
  @routerPath:
  @date: 2020-7-21-9:56
  */
/* api */
import { queryTenderProjectInitInfo } from '@/api/bidding/biddingProject'// 获取信息 字典信息
/* 混入 */
import { filterDictText } from '@/assets/js/utils'// 常用方法
export const statisticalAnalysisGroupMixin = {
  data() {
    return {
      /* 方案来源*/
      schemeSourceList: [
        { typecode: '00', typename: '自增' },
        { typecode: '01', typename: '平台' }
      ],
      // 评标办法
      reviewWayList: [
        { typecode: '00', typename: '综合评估法' },
        { typecode: '01', typename: '经评审的最低投标价法' }
      ],
      // 组织形式
      tenderOrgMethodList: [
        { typecode: '00', typename: '自主招标' },
        { typecode: '01', typename: '委托招标' }
      ],
      // 开票状态
      invoiceStatusList: [
        { typecode: '00', typename: '未开票' },
        { typecode: '01', typename: '开票失败' },
        { typecode: '01', typename: '已开票' }
      ],
      // 开标方式
      bidOpeningMethodList: [
        { typename: '网上', typecode: '00' },
        { typename: '线下', typecode: '01' }
      ],
      // 是否依法必招
      isLegalTenderList: [
        { typename: '依法必招', typecode: '01' },
        { typename: '非依法必招', typecode: '00' }
      ],
      // 是否限额以下
      beyondLegalLimitList: [
        { typename: '限额以上', typecode: '01' },
        { typename: '限额以下', typecode: '00' }
      ],
      // 开标阶段
      openStageTypeList: [
        { typename: '一次开标阶段(商务技术经济)', typecode: '00' },
        { typename: '非价格开标阶段(商务技术)', typecode: '01' },
        { typename: '价格开标阶段(经济)', typecode: '02' },
        { typename: '资审开标阶段(商务技术)', typecode: '03' }
      ],
      // 是否欠费
      isDebtList: [
        { typename: '否', typecode: '00' },
        { typename: '是', typecode: '01' }
      ],
      projectNatureList: [], // 项目性质
      purchaseTypeList: [], // 采购类别
      projectClassificationList: [], // 项目分类
      purchaseClassificationList: [], // 采购分类
      purchaseContentClassList: [], // 采购内容分类
      projectIndustryList: [], // 项目行业分类
      purchaseLevelList: [], // 采购级别
      phaseTypeList: [] // 资审方式
    }
  },
  methods: {
    // 字典信息
    initWebTypeGroup() {
      queryTenderProjectInitInfo().then(res => {
        // 遍历key存储相应的数据
        for (const key in res.data) {
          /* 是否有数据*/
          if (res.data[key]) {
            this[key + 'List'] = res.data[key].typeList
          }
        }
      })
    },

    // 表格字典值替换文本-供应商企业性质
    formatIsDebt(row, column, cellValue) {
      return filterDictText(this.isDebtList, cellValue)
    }
  }
}
