
/*
  @description:订单管理-字典信息
  @Modifier:苏志刚/wxy
  @routerPath:
  @date:2020-6-29 10:32
*/
import { queryProcurementProjectRuleInitInfo } from '@/api/procurement/procurementProject'
import { queryProcurementOrderInitInfo } from '@/api/procurement/procurementContract' // 订单字典信息
/* api*/
import { queryPurchasePlanInitInfo } from '@/api/procurement/purchasplan'// 采购计划公共字典
export const orderManagementGroupMixin = {
  data() {
    return {
      tendermethodList: [], // 采购方式
      procurementOrderOrderStatus: [], // 采购项目订单状态
      procurementSupplierOrderStatus: [], // 采购项目供应商订单状态
      protproject_line: [], // 评审方式
      auditStatus: [
        { typecode: '00', typename: '提交审核' },
        { typecode: '01', typename: '审核通过' },
        { typecode: '02', typename: '审核驳回' }
      ], // 审核状态
      planPurchaseList: [], // 行项目信息类型
      // 订单审核状态
      orderAuditStatus: [
        { typecode: '02', typename: '待审核' },
        { typecode: '03', typename: '审核驳回' },
        { typecode: '04', typename: '审核通过' },
        { typecode: '', typename: '全部' }
      ],
      // 中选审核状态
      winningAuditStatus: [
        { typecode: '00', typename: '待审核' },
        { typecode: '01', typename: '审核通过' },
        { typecode: '02', typename: '审核驳回' },
        { typecode: '03', typename: '全部' }
      ],
      // 采购单结果文件
      auditStatusList: [
        { typecode: '00', typename: '提交审核' },
        { typecode: '01', typename: '审核通过' },
        { typecode: '02', typename: '审核驳回' }
      ],
      reviewMethodList: [],
      currencyList: [], // 币种
      // 计量单位
      purchaseUnitList: [],
      // 综合评审确定中选人是否中标
      chosenList: [
        { typecode: '00', typename: '否' },
        { typecode: '01', typename: '是' }
      ],
      // 发票类型
      billingTypeList: [],
      listAll: {
        typecode: '10',
        typename: '全部'
      }
    }
  },
  methods: {
    // 查询订单信息数据字典
    getProcurementOderInfo() {
      queryProcurementOrderInitInfo().then(res => {
        // 获取采购方式
        this.tendermethodList = res.data.tender_method.typeList
        // 采购项目订单状态
        this.procurementOrderOrderStatus = res.data.procurementOrderOrderStatus.typeList
        this.procurementOrderOrderStatus.push(this.listAll)
        // 项目信息类型
        this.planPurchaseList = res.data.plan_purchase_type.typeList
        // 采购项目供应商订单状态
        this.procurementSupplierOrderStatus = res.data.ProcurementSupplierOrderStatus.typeList
        this.billingTypeList = res.data.billingType.typeList // 订单类型
      }).catch(() => {
      })
    },
    // 字典信息-项目类型
    initWebTypeGroup() {
      queryProcurementProjectRuleInitInfo().then(res => {
        this.reviewMethodList = res.data.protproject_reviewMethod.typeList // 评审方法
        this.currencyList = res.data.protproject_currency.typeList // 币种
        this.protproject_line = res.data.protproject_line.typeList // 评审方式 00线上 01 线下
      })
    },
    // 获取计量单位
    initUnit() {
      queryPurchasePlanInitInfo().then(res => {
        this.purchaseUnitList = res.data.purchaseUnit.typeList
      })
    }
  }
}
