123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- /**
- * @description 设置审核Row的数据内容、我的申请内容数据
- */
- import store from "@/store"
- const degree2Txt = store.getters['enum/getDegreeText']
- const getapplyTypeText = store.getters["enum/getapplyTypeText"]
- const getOfferTypeList = store.getters["enum/getOfferTypeList"]
- export function formatApproveItemRow(data, type) {
- if (typeof type !== 'number') type = Number(type)
-
- let arrs = []
- switch (type) {
- case 1:
- arrs = [
- {
- label: '申请事由',
- val: data.reason
- },
- {
- label: '申购类型',
- val: getapplyTypeText(data.type)
- },
- // 只有货物采购时才有商品列表展示
- data.type == 1 && Array.isArray(data.apply_goods) ? {
- label: '申购商品',
- // 商品大于三件时 展示 xxx、xx等商品
- val: data.apply_goods.length > 3 ? data.apply_goods.map(goods => goods.goods_name).slice(0, 4).join(',') + '等商品' : data.apply_goods.map(goods => goods.goods_name).join(',')
- } : undefined
- ]
- break
- case 2:
- arrs = [
- { label: '申请标题', val: data.reason },
- { label: '呈批类型', val: getOfferTypeList(data.type) },
- { label: '缓急程度', val: degree2Txt(data.desc) }
- ]
- break
- case 3:
- arrs = [
- { label: '物品名称', val: '' }
- // { label: '', val: '' },
- // { label: '', val: '' },
- ]
- break
- case 4:
- arrs = [
- { label: '领用物品', val: '' },
- { label: '物品用途', val: data.reason }
- ]
- break
- case 5: // 出差申请展示内容
- arrs = [
- {
- label: '发起事由',
- val: data.reason
- },
- {
- label: '同行人员',
- val: Array.isArray(data.peer_user) && data.peer_user.length ? data.peer_user.map(user => (user.name)).join('、') : '暂无同行人员'
- },
- {
- label: '出差时间',
- val: `${data.start_time} — ${data.end_time}`
- }
- ]
- break
- case 6:
- arrs = [
- { label: '请假类型', val: data.type },
- { label: '开始时间', val: `${data.start_time} ${data.start_am}` },
- { label: '结束时间', val: `${data.end_time} ${data.end_am}` }
- ]
- break
- case 7:
- arrs = [
- { label: '用车地点', val: data.reason },
- { label: '出发时间', val: data.start_time },
- { label: '返回时间', val: data.end_time }
- ]
- break
- case 8:
- arrs = [
- { label: '维修地点', val: data.reason },
- { label: '具体内容', val: data.desc }
- ]
- break
- case 9:
- arrs = [
- { label: '合同编号', val: data.reason },
- { label: '拟稿日期', val: data.createTime },
- { label: '缓急程度', val: degree2Txt(data.desc) }
- ]
- break
- case 10:
- arrs = [
- { label: '来文单位', val: data.reason },
- { label: '文件名称', val: data.desc }
- ]
- break
- case 11:
- arrs = [
- { label: '文件名称', val: data.reason },
- { label: '拟发文时间', val: data.apply_date },
- { label: '缓急程度', val: degree2Txt(data.desc) }
- ]
- break
- }
- return arrs.filter(item => item)
- }
|