|
@@ -481,15 +481,16 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
|
|
|
...temp,
|
|
|
year: date.format('YYYY'),
|
|
|
group: numberToChinese(temp.goods.length),
|
|
|
- page: numberToChinese(page)
|
|
|
+ page: numberToChinese(page),
|
|
|
+ date: dayjs(temp.date).format('YYYY-MM-DD')
|
|
|
}
|
|
|
break
|
|
|
case EXPORT_WORD_ENUM.SUB_PUT_BACK:
|
|
|
+ console.log(temp)
|
|
|
temp = {
|
|
|
...temp,
|
|
|
- year: date.format('YYYY'),
|
|
|
- month: date.format('MM'),
|
|
|
- day: date.format('DD')
|
|
|
+ num: dayjs(temp.date).format('YYYY') + temp.num,
|
|
|
+ date: dayjs(temp.date).format('YYYY年MM月DD日')
|
|
|
}
|
|
|
break
|
|
|
case EXPORT_WORD_ENUM.COLLECTION_INVENTORY:
|
|
@@ -559,24 +560,45 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
|
|
|
break
|
|
|
case EXPORT_WORD_ENUM.COLLECTION_ARCHIVES:
|
|
|
case EXPORT_WORD_ENUM.COLLECTION_CARD:
|
|
|
- console.log(temp)
|
|
|
+ const rtf2 = temp.rtf ? JSON.parse(temp.rtf).txtArr[0].txt : ''
|
|
|
+ const stack2 = []
|
|
|
+ for (const url of getImageUrlsFromHtml(rtf2)) {
|
|
|
+ stack2.push(await getBase64Sync(url))
|
|
|
+ }
|
|
|
temp = {
|
|
|
...temp,
|
|
|
year: date.format('YYYY'),
|
|
|
month: date.format('MM'),
|
|
|
day: date.format('DD'),
|
|
|
+ createTime: dayjs(temp.createTime).format('YYYY-MM-DD'),
|
|
|
size: myTableTransferSize(temp),
|
|
|
- quality: temp?.qualityDictScope ? resJiLianFu(temp.qualityDictScope) : '',
|
|
|
+ quality: temp.quality + temp.qualityUnit,
|
|
|
deptName: (temp.records || []).length ? temp.records[0].deptName : '',
|
|
|
recordDate: (temp.records || []).length ? temp.records[0].createTime : '',
|
|
|
+ dictTexture: resJiLianFu(temp.dictTexture3),
|
|
|
records: (temp.records || []).map(
|
|
|
(item: any) =>
|
|
|
- `[${temp.dictLevel}],[${item.createTime}][${item.deptName}][${item.creatorName}]意见。`
|
|
|
- )
|
|
|
+ `[${item.dictLevel}],[${item.date.split(' ')[0]}][${item.deptName}][${
|
|
|
+ item.creatorName
|
|
|
+ }]意见。`
|
|
|
+ ),
|
|
|
+ repairs: (temp.repairs || []).map(
|
|
|
+ (item: any) =>
|
|
|
+ `[${item.txt1}],[${item.txt2}],[${item.date.split(' ')[0]}][${item.authUnit}]交修。`
|
|
|
+ ),
|
|
|
+ status: (temp.status || []).map(
|
|
|
+ (item: any) => `[${item.reason}],[${item.date.split(' ')[0]}][${item.sonUser}]登记。`
|
|
|
+ ),
|
|
|
+ source: resJiLianFu(temp.source),
|
|
|
+ rtf: removeHtmlTags(rtf2),
|
|
|
+ preserveState: resJiLianFu(temp.preserveState),
|
|
|
+ imgs: stack2
|
|
|
}
|
|
|
|
|
|
if (type === EXPORT_WORD_ENUM.COLLECTION_ARCHIVES) {
|
|
|
temp.imagePages = await arrangeImages(temp.imagePages)
|
|
|
+ } else if (temp.thumb) {
|
|
|
+ temp.thumb = await getBase64Sync(temp.thumb)
|
|
|
}
|
|
|
break
|
|
|
case EXPORT_WORD_ENUM.OUTSIDER_FORM:
|
|
@@ -807,7 +829,7 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
|
|
|
worksheet.getCell('A1').value = {
|
|
|
richText: [
|
|
|
{ font: { size: 20, name: '黑体' }, text: '馆藏品注销凭证 ' },
|
|
|
- { font: { size: 11 }, text: '(编号: ) ' }
|
|
|
+ { font: { size: 11 }, text: `(编号:${temp.num}) ` }
|
|
|
]
|
|
|
}
|
|
|
worksheet.getRow(1).height = 60
|
|
@@ -817,7 +839,7 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
|
|
|
vertical: 'middle'
|
|
|
}
|
|
|
}
|
|
|
- worksheet.insertRow(2, [date.format('YYYY年MM月DD日')])
|
|
|
+ worksheet.insertRow(2, [dayjs(temp.createTime).format('YYYY年MM月DD日')])
|
|
|
worksheet.mergeCells('A2:K2')
|
|
|
worksheet.getRow(2).height = 30
|
|
|
worksheet.getCell('A2').style = {
|
|
@@ -831,7 +853,10 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
|
|
|
}
|
|
|
}
|
|
|
worksheet.insertRow(3, [
|
|
|
- `现将藏品_${temp.goods.length}_件注销,清单开列如下,本凭证连同附页全份共______页(含附件)`
|
|
|
+ // @ts-ignore
|
|
|
+ `现将藏品_${
|
|
|
+ temp.goods.length - 1
|
|
|
+ }_件注销,清单开列如下,本凭证连同附页全份共___页(含附件)`
|
|
|
])
|
|
|
worksheet.mergeCells('A3:K3')
|
|
|
worksheet.getRow(3).height = 30
|