import { initDictionary } from '@/blocks/utils'
import { getOrganization } from '@/blocks/components/formConfig/departmenTree.js'

export default {
  data() {
    return {
      options: {},
    }
  },
  mounted() {
    let _this = this
    getOrganization(this)
    initDictionary([
      { objectcode: 'ORDER_BUSINESS_TYPE' },
      { objectcode: 'ORDER_TYPE' },
      { objectcode: 'PACK_TYPE' },
      { objectcode: 'CARGO_THERMOSPHERE' },
      { objectcode: 'DELIVERY_METHOD_TYPE' },
      { objectcode: 'TEMPERATURE_REQUIREMENT' },
      { objectcode: 'TRANSPORT_TYPE' },
      { objectcode: 'SHIPPER_TYPE' },
      { objectcode: 'CONSIGNEE_TYPE' },
      { objectcode: 'APPROVAL_FLOW_TYPE' },
      { objectcode: 'MAINDATA_STATUS' },
      { objectcode: 'BANK' },
      { objectcode: 'CONTRACT_NATURE'},
      { objectcode: 'NODE_APPROVAL_TYPE'},// 审批方式
      { objectcode: 'NODE_APPROVER_TYPE'},//节点审批者类型
      { objectcode: 'APPROVAL_BUSSINESS_NODE_STATUS' },//状态 数据字典
      { objectcode: 'BACK_TYPE' },
      { objectcode: 'GROUP_DISPATCH' },
      { objectcode: 'LINE_CARRIER_TYPE' },
      { objectcode: 'ORDER_BUSINESS_TYPE' },
      { objectcode: 'ORDER_TYPE' },
    ]).then((res) => {
      for (let key in res) {
        res[key].forEach((item) => {
          if (!isNaN(item.value)) {
            item.value = +item.value
          }
        })
      }

      _this.options = { ..._this.options, ...res }
    })
  },
  computed: {},
  methods: {},
}
