|
@@ -3,14 +3,18 @@
|
|
|
*/
|
|
|
|
|
|
import store from "@/store"
|
|
|
-// const degree2Txt = store.getters['enum/getDegreeText']
|
|
|
+const degree2Txt = store.getters['enum/getDegreeText']
|
|
|
const maintainTypeList = store.getters['enum/getMaintainText']
|
|
|
|
|
|
const getPayTypeText = store.getters["enum/getPayTypeText"]
|
|
|
const getapplyTypeText = store.getters["enum/getapplyTypeText"]
|
|
|
+const getOfferTypeList = store.getters["enum/getOfferTypeList"]
|
|
|
+const getEvectionTypeList = store.getters["enum/getEvectionTypeList"]
|
|
|
+const getLeaveTypeTypeList = store.getters["enum/getLeaveTypeTypeList"]
|
|
|
+const getContractTypeList = store.getters["enum/getContractTypeList"]
|
|
|
|
|
|
-
|
|
|
-function getModule1(data){
|
|
|
+// 申购审批详情
|
|
|
+function getModule1(data){ /* eslint-disable-line */
|
|
|
const { order_no, department_data, create_at, module_info, apply_user } = data
|
|
|
return [
|
|
|
{
|
|
@@ -49,10 +53,13 @@ function getModule1(data){
|
|
|
title: '预计申购完成日期',
|
|
|
value: module_info.apply_date
|
|
|
},
|
|
|
- {
|
|
|
+ module_info.document_text.length ? {
|
|
|
+ type: 'files',
|
|
|
title: '附件材料',
|
|
|
- value: "@TODO"
|
|
|
- },
|
|
|
+ value: module_info.document_text.map(doc => ({
|
|
|
+ url: doc
|
|
|
+ }))
|
|
|
+ } : undefined,
|
|
|
module_info.images_text.length ? {
|
|
|
type: 'images',
|
|
|
title: '图片',
|
|
@@ -67,7 +74,320 @@ function getModule1(data){
|
|
|
]
|
|
|
}
|
|
|
|
|
|
-function getModule8(data) {
|
|
|
+// 呈批申请
|
|
|
+function getModule2(data){ /* eslint-disable-line */
|
|
|
+ const { order_no, department_data, create_at, module_info, apply_user } = data
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '审批编号',
|
|
|
+ value: order_no
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '所在部门',
|
|
|
+ value: department_data.map(department => (department.name)).join(',')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请日期',
|
|
|
+ value: create_at
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请人',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '呈批类型',
|
|
|
+ value: getOfferTypeList(data.type)
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '发文字号',
|
|
|
+ value: `${module_info.word_size}`
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '缓急程度',
|
|
|
+ value: degree2Txt(module_info.desc)
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '印制份数',
|
|
|
+ value: `${module_info.number}`
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请标题',
|
|
|
+ value: module_info.reason
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请内容',
|
|
|
+ value: module_info.remark
|
|
|
+ },
|
|
|
+ module_info.document_text.length ? {
|
|
|
+ type: 'files',
|
|
|
+ title: '附件材料',
|
|
|
+ value: module_info.document_text.map(doc => ({
|
|
|
+ url: doc
|
|
|
+ }))
|
|
|
+ } : undefined,
|
|
|
+ ]
|
|
|
+}
|
|
|
+
|
|
|
+// 入库申请
|
|
|
+function getModule3(data) { /* eslint-disable-line */
|
|
|
+ const { order_no, department_data, module_info, apply_user } = data
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '审批编号',
|
|
|
+ value: order_no
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '所在部门',
|
|
|
+ value: department_data.map(department => (department.name)).join(',')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请日期',
|
|
|
+ value: data.create_at
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请人',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ // TODO: 物品明细
|
|
|
+ // 物品明细
|
|
|
+ module_info.document_text.length ? {
|
|
|
+ type: 'files',
|
|
|
+ title: '附件材料',
|
|
|
+ value: module_info.document_text.map(doc => ({
|
|
|
+ url: doc
|
|
|
+ }))
|
|
|
+ } : undefined,
|
|
|
+ module_info.images_text.length ? {
|
|
|
+ type: 'images',
|
|
|
+ title: '图片',
|
|
|
+ value: module_info.images_text.map(img => ({
|
|
|
+ url: img
|
|
|
+ }))
|
|
|
+ } : undefined,
|
|
|
+ {
|
|
|
+ title: '其他补充说明',
|
|
|
+ value: module_info.remark
|
|
|
+ }
|
|
|
+ ]
|
|
|
+}
|
|
|
+
|
|
|
+// 领用申请
|
|
|
+function getModule4(data) { /* eslint-disable-line */
|
|
|
+ const { order_no, department_data, module_info, apply_user } = data
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '审批编号',
|
|
|
+ value: order_no
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '所在部门',
|
|
|
+ value: department_data.map(department => (department.name)).join(',')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请日期',
|
|
|
+ value: data.create_at
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请人',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ // TODO: 物品明细
|
|
|
+ module_info.document_text.length ? {
|
|
|
+ type: 'files',
|
|
|
+ title: '附件材料',
|
|
|
+ value: module_info.document_text.map(doc => ({
|
|
|
+ url: doc
|
|
|
+ }))
|
|
|
+ } : undefined,
|
|
|
+ {
|
|
|
+ title: '其他补充说明',
|
|
|
+ value: module_info.remark
|
|
|
+ }
|
|
|
+ ]
|
|
|
+}
|
|
|
+
|
|
|
+// 出差申请
|
|
|
+function getModule5(data) { /* eslint-disable-line */
|
|
|
+ const { order_no, department_data, module_info, apply_user } = data
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '审批编号',
|
|
|
+ value: order_no
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '所在部门',
|
|
|
+ value: department_data.map(department => (department.name)).join(',')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请日期',
|
|
|
+ value: data.create_at
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请人',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '出差事由',
|
|
|
+ value: module_info.reason
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '同行人员',
|
|
|
+ value: Array.isArray(data.peer_user) && data.peer_user.length ? data.peer_user.map(user => (user.name)).join('、') : '暂无同行人员'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '出差开始时间',
|
|
|
+ value: module_info.start_time
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '出差结束时间',
|
|
|
+ value: module_info.end_time
|
|
|
+ },
|
|
|
+ module_info.document_text.length ? {
|
|
|
+ type: 'files',
|
|
|
+ title: '附件材料',
|
|
|
+ value: module_info.document_text.map(doc => ({
|
|
|
+ url: doc
|
|
|
+ }))
|
|
|
+ } : undefined,
|
|
|
+ module_info.images_text.length ? {
|
|
|
+ type: 'images',
|
|
|
+ title: '图片',
|
|
|
+ value: module_info.images_text.map(img => ({
|
|
|
+ url: img
|
|
|
+ }))
|
|
|
+ } : undefined,
|
|
|
+ {
|
|
|
+ title: '出差类型',
|
|
|
+ value: getEvectionTypeList(module_info.type)
|
|
|
+ },
|
|
|
+ // NOTE: type === 1 show that.
|
|
|
+ module_info.type == 1 ? {
|
|
|
+ title: '是否跨关内关外',
|
|
|
+ value: module_info.is_who == 0 ? '否' : '是'
|
|
|
+ } : undefined
|
|
|
+ ]
|
|
|
+}
|
|
|
+
|
|
|
+// 请假申请
|
|
|
+function getModule6(data) { /* eslint-disable-line */
|
|
|
+ const { order_no, department_data, module_info, apply_user } = data
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '审批编号',
|
|
|
+ value: order_no
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '所在部门',
|
|
|
+ value: department_data.map(department => (department.name)).join(',')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请日期',
|
|
|
+ value: data.create_at
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请人',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '请假类型',
|
|
|
+ value: getLeaveTypeTypeList(module_info.type)
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '请假开始时间',
|
|
|
+ value: apply_user.start_time
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '请假结束时间',
|
|
|
+ value: apply_user.end_time
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '请假时长',
|
|
|
+ value: apply_user.time
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '原因',
|
|
|
+ value: apply_user.reason
|
|
|
+ },
|
|
|
+ module_info.document_text.length ? {
|
|
|
+ type: 'files',
|
|
|
+ title: '附件材料',
|
|
|
+ value: module_info.document_text.map(doc => ({
|
|
|
+ url: doc
|
|
|
+ }))
|
|
|
+ } : undefined,
|
|
|
+ module_info.images_text.length ? {
|
|
|
+ type: 'images',
|
|
|
+ title: '图片',
|
|
|
+ value: module_info.images_text.map(img => ({
|
|
|
+ url: img
|
|
|
+ }))
|
|
|
+ } : undefined,
|
|
|
+ {
|
|
|
+ title: '是否离“深”',
|
|
|
+ value: apply_user.remark
|
|
|
+ }
|
|
|
+ ]
|
|
|
+}
|
|
|
+
|
|
|
+// 用车申请
|
|
|
+function getModule7(data) { /* eslint-disable-line */
|
|
|
+ const { order_no, department_data, module_info, apply_user } = data
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '审批编号',
|
|
|
+ value: order_no
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '所在部门',
|
|
|
+ value: department_data.map(department => (department.name)).join(',')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请日期',
|
|
|
+ value: data.create_at
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请人',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '出发地点',
|
|
|
+ value: apply_user.reason
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '出发时间',
|
|
|
+ value: apply_user.start_time
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '到达地点',
|
|
|
+ value: apply_user.end_address
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '返回时间',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '返回地点',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ module_info.document_text.length ? {
|
|
|
+ type: 'files',
|
|
|
+ title: '附件材料',
|
|
|
+ value: module_info.document_text.map(doc => ({
|
|
|
+ url: doc
|
|
|
+ }))
|
|
|
+ } : undefined,
|
|
|
+ module_info.images_text.length ? {
|
|
|
+ type: 'images',
|
|
|
+ title: '图片',
|
|
|
+ value: module_info.images_text.map(img => ({
|
|
|
+ url: img
|
|
|
+ }))
|
|
|
+ } : undefined,
|
|
|
+ ]
|
|
|
+}
|
|
|
+
|
|
|
+// 维修申请
|
|
|
+function getModule8(data) { /* eslint-disable-line */
|
|
|
const { order_no, department_data, module_info} = data
|
|
|
return [
|
|
|
{
|
|
@@ -105,20 +425,196 @@ function getModule8(data) {
|
|
|
]
|
|
|
}
|
|
|
|
|
|
+// 合同呈批
|
|
|
+function getModule9(data) { /* eslint-disable-line */
|
|
|
+ const { order_no, department_data, module_info, apply_user } = data
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '审批编号',
|
|
|
+ value: order_no
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '所在部门',
|
|
|
+ value: department_data.map(department => (department.name)).join(',')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请日期',
|
|
|
+ value: data.create_at
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请人',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '合同类型',
|
|
|
+ value: getContractTypeList(module_info.type)
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '合同编号',
|
|
|
+ value: `${apply_user.reason}`
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '缓急程度',
|
|
|
+ value: degree2Txt(module_info.desc)
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '印制份数',
|
|
|
+ value: `${apply_user.number}`
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '发放范围',
|
|
|
+ value: `${apply_user.scope}`
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '法务意见',
|
|
|
+ value: `${apply_user.legal_opinion}`
|
|
|
+ },
|
|
|
+ module_info.document_text.length ? {
|
|
|
+ type: 'files',
|
|
|
+ title: '附件材料',
|
|
|
+ value: module_info.document_text.map(doc => ({
|
|
|
+ url: doc
|
|
|
+ }))
|
|
|
+ } : undefined,
|
|
|
+ {
|
|
|
+ title: '备注',
|
|
|
+ value: module_info.remark
|
|
|
+ }
|
|
|
+ ]
|
|
|
+}
|
|
|
+
|
|
|
+// 收文批阅
|
|
|
+function getModule10(data) { /* eslint-disable-line */
|
|
|
+ const { order_no, department_data, create_at, module_info, apply_user } = data
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '审批编号',
|
|
|
+ value: order_no
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '所在部门',
|
|
|
+ value: department_data.map(department => (department.name)).join(',')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请日期',
|
|
|
+ value: create_at
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请人',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ //
|
|
|
+ {
|
|
|
+ title: '创建人',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ //
|
|
|
+ {
|
|
|
+ title: '发起人',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '来文单位名称',
|
|
|
+ value: apply_user.desc
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '收文序号',
|
|
|
+ value: apply_user.serial_number
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '文件名称',
|
|
|
+ value: apply_user.reason
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '收文日期',
|
|
|
+ value: apply_user.apply_date
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '内容摘要',
|
|
|
+ value: apply_user.remark
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '缓急程度',
|
|
|
+ value: degree2Txt(module_info.desc)
|
|
|
+ },
|
|
|
+ module_info.document_text.length ? {
|
|
|
+ type: 'files',
|
|
|
+ title: '附件材料',
|
|
|
+ value: module_info.document_text.map(doc => ({
|
|
|
+ url: doc
|
|
|
+ }))
|
|
|
+ } : undefined,
|
|
|
+ ]
|
|
|
+}
|
|
|
+
|
|
|
+// 学校文件
|
|
|
+function getModule11(data) { /* eslint-disable-line */
|
|
|
+ const { order_no, department_data, module_info, apply_user } = data
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '审批编号',
|
|
|
+ value: order_no
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '所在部门',
|
|
|
+ value: department_data.map(department => (department.name)).join(',')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请日期',
|
|
|
+ value: data.create_at
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '申请人',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ // TODO:
|
|
|
+ {
|
|
|
+ title: '拟稿部门',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '文件名称',
|
|
|
+ value: apply_user.reason
|
|
|
+ },
|
|
|
+ // TODO:
|
|
|
+ {
|
|
|
+ title: '落款',
|
|
|
+ value: apply_user.name
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '上会情况',
|
|
|
+ value: apply_user.remark
|
|
|
+ },
|
|
|
+ module_info.document_text.length ? {
|
|
|
+ type: 'files',
|
|
|
+ title: '附件材料',
|
|
|
+ value: module_info.document_text.map(doc => ({
|
|
|
+ url: doc
|
|
|
+ }))
|
|
|
+ } : undefined,
|
|
|
+ {
|
|
|
+ title: '缓急程度',
|
|
|
+ value: degree2Txt(module_info.desc)
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '拟发文时间',
|
|
|
+ value: apply_user.apply_date
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '文件号',
|
|
|
+ value: apply_user.serial_number
|
|
|
+ },
|
|
|
+ ]
|
|
|
+}
|
|
|
+
|
|
|
export const formatApplyforRows = (data) => {
|
|
|
let type = data.module
|
|
|
if (typeof type !== 'number') type = Number(type)
|
|
|
let arrs = []
|
|
|
+ if (![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(type)) return []
|
|
|
+ const moduleFunc = `getModule${type}`
|
|
|
|
|
|
- switch (type) {
|
|
|
- case 1:
|
|
|
- arrs = getModule1(data)
|
|
|
- break
|
|
|
- case 8:
|
|
|
- arrs = getModule8(data)
|
|
|
- break
|
|
|
- }
|
|
|
-
|
|
|
+ arrs = moduleFunc(data)
|
|
|
// NOTE: 过滤为undefined字段
|
|
|
return arrs.filter(item => (item))
|
|
|
}
|