[update] 插入签章插入位置判断把中国重型汽车集团有限公司改为有限公司
This commit is contained in:
@@ -2248,24 +2248,17 @@ export default {
|
|||||||
*/
|
*/
|
||||||
async insertSignatureInfo () {
|
async insertSignatureInfo () {
|
||||||
Asc.scope.signatureInfo = await this.getSignatureInfo()
|
Asc.scope.signatureInfo = await this.getSignatureInfo()
|
||||||
console.log('---------获取完签章信息了')
|
|
||||||
Asc.scope.standCode = this.form.standCode
|
Asc.scope.standCode = this.form.standCode
|
||||||
Asc.scope.standCNName = this.form.standName
|
Asc.scope.standCNName = this.form.standName
|
||||||
console.log('---------获取完签章信息了1')
|
|
||||||
Asc.scope.downloadUrl = window._CONFIG.downloadUrl
|
Asc.scope.downloadUrl = window._CONFIG.downloadUrl
|
||||||
console.log('---------获取完签章信息了2')
|
|
||||||
this.ctx.callCommand(() => {
|
this.ctx.callCommand(() => {
|
||||||
try {
|
try {
|
||||||
console.log('---------获取完签章信息了3')
|
|
||||||
const oDocument = Api.GetDocument()
|
const oDocument = Api.GetDocument()
|
||||||
console.log('---------获取完签章信息了4')
|
|
||||||
// 签审信息只创建一次
|
// 签审信息只创建一次
|
||||||
const AllContentControls = oDocument.GetAllContentControls()
|
const AllContentControls = oDocument.GetAllContentControls()
|
||||||
let flag = false
|
let flag = false
|
||||||
for (let i = 0; i < AllContentControls.length; i++) {
|
for (let i = 0; i < AllContentControls.length; i++) {
|
||||||
console.log('---------GetAlias', AllContentControls[i].GetAlias())
|
|
||||||
if (AllContentControls[i].GetAlias() === 'sinotruk.signatureInfo') {
|
if (AllContentControls[i].GetAlias() === 'sinotruk.signatureInfo') {
|
||||||
console.log('已经创建过签章了')
|
|
||||||
flag = true
|
flag = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -2277,7 +2270,9 @@ export default {
|
|||||||
let coverEndParagraph, paragraphIndex
|
let coverEndParagraph, paragraphIndex
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
const element = oDocument.GetElement(i)
|
const element = oDocument.GetElement(i)
|
||||||
if ('paragraph' === element.GetClassType() && element.GetText().indexOf('中国重型汽车集团有限公司') !== -1 && element.GetText().indexOf('发布') !== -1) {
|
// 2024-09-27 出现问题:改了首页最下面的标题导致,不生成签章了
|
||||||
|
// if ('paragraph' === element.GetClassType() && element.GetText().indexOf('中国重型汽车集团有限公司') !== -1 && element.GetText().indexOf('发布') !== -1) {
|
||||||
|
if ('paragraph' === element.GetClassType() && element.GetText().indexOf('有限公司') !== -1 && element.GetText().indexOf('发布') !== -1) {
|
||||||
paragraphIndex = i + 1
|
paragraphIndex = i + 1
|
||||||
coverEndParagraph = element
|
coverEndParagraph = element
|
||||||
}
|
}
|
||||||
@@ -2305,7 +2300,6 @@ export default {
|
|||||||
oParagraphSubTitle.SetJc('center')
|
oParagraphSubTitle.SetJc('center')
|
||||||
oParagraphSubTitle.SetBold(false)
|
oParagraphSubTitle.SetBold(false)
|
||||||
emptyParagraph.InsertParagraph(oParagraphSubTitle, 'after')
|
emptyParagraph.InsertParagraph(oParagraphSubTitle, 'after')
|
||||||
console.log('------------创建完黑体标题了')
|
|
||||||
|
|
||||||
// 责任签署的大标题
|
// 责任签署的大标题
|
||||||
const oParagraphLargeTitle = Api.CreateParagraph()
|
const oParagraphLargeTitle = Api.CreateParagraph()
|
||||||
@@ -2317,7 +2311,6 @@ export default {
|
|||||||
oParagraphLargeTitle.SetColor(0, 0, 0)
|
oParagraphLargeTitle.SetColor(0, 0, 0)
|
||||||
oParagraphLargeTitle.SetJc('center')
|
oParagraphLargeTitle.SetJc('center')
|
||||||
oParagraphSubTitle.InsertParagraph(oParagraphLargeTitle, 'after')
|
oParagraphSubTitle.InsertParagraph(oParagraphLargeTitle, 'after')
|
||||||
console.log('------------创建完责任部署标题了')
|
|
||||||
|
|
||||||
// 计划编号
|
// 计划编号
|
||||||
// const oParagraphPlanNum = Api.CreateParagraph()
|
// const oParagraphPlanNum = Api.CreateParagraph()
|
||||||
@@ -2342,7 +2335,6 @@ export default {
|
|||||||
oParagraphStandardName.SetColor(0, 0, 0)
|
oParagraphStandardName.SetColor(0, 0, 0)
|
||||||
oParagraphStandardName.SetSpacingLine(1.5 * 240, 'auto')
|
oParagraphStandardName.SetSpacingLine(1.5 * 240, 'auto')
|
||||||
oParagraphLargeTitle.InsertParagraph(oParagraphStandardName, 'after')
|
oParagraphLargeTitle.InsertParagraph(oParagraphStandardName, 'after')
|
||||||
console.log('------------创建完标准名称了')
|
|
||||||
|
|
||||||
// 横线
|
// 横线
|
||||||
const oParagraphLine = Api.CreateParagraph()
|
const oParagraphLine = Api.CreateParagraph()
|
||||||
@@ -2354,7 +2346,6 @@ export default {
|
|||||||
oParagraphLine.SetSpacingLine(240, 'auto')
|
oParagraphLine.SetSpacingLine(240, 'auto')
|
||||||
oDrawing.SetDistances(0, 541, 0, 0)
|
oDrawing.SetDistances(0, 541, 0, 0)
|
||||||
oParagraphStandardName.InsertParagraph(oParagraphLine, 'after')
|
oParagraphStandardName.InsertParagraph(oParagraphLine, 'after')
|
||||||
console.log('------------创建完横线了')
|
|
||||||
|
|
||||||
// 签章信息部分
|
// 签章信息部分
|
||||||
const oParagraphBox = Api.CreateParagraph()
|
const oParagraphBox = Api.CreateParagraph()
|
||||||
@@ -2364,7 +2355,6 @@ export default {
|
|||||||
oDrawingBox.SetVerticalTextAlign('top')
|
oDrawingBox.SetVerticalTextAlign('top')
|
||||||
oParagraphBox.AddDrawing(oDrawingBox)
|
oParagraphBox.AddDrawing(oDrawingBox)
|
||||||
oParagraphLine.InsertParagraph(oParagraphBox, 'after')
|
oParagraphLine.InsertParagraph(oParagraphBox, 'after')
|
||||||
console.log('------------创建完签章信息部分了')
|
|
||||||
|
|
||||||
const signatureInfo = Asc.scope.signatureInfo
|
const signatureInfo = Asc.scope.signatureInfo
|
||||||
if (signatureInfo) {
|
if (signatureInfo) {
|
||||||
@@ -2426,7 +2416,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
console.log('------------创建完内部签章信息了')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 中国重型汽车集团有限公司
|
// 中国重型汽车集团有限公司
|
||||||
@@ -2441,7 +2430,6 @@ export default {
|
|||||||
oParagraphPageEnd.SetBold(false)
|
oParagraphPageEnd.SetBold(false)
|
||||||
oParagraphPageEnd.SetSpacing(1.8)
|
oParagraphPageEnd.SetSpacing(1.8)
|
||||||
oParagraphBox.InsertParagraph(oParagraphPageEnd, 'after')
|
oParagraphBox.InsertParagraph(oParagraphPageEnd, 'after')
|
||||||
console.log('------------创建完底部标题了')
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
@@ -2462,7 +2450,6 @@ export default {
|
|||||||
result = res.result
|
result = res.result
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
console.log('--------返回签章信息了', result)
|
|
||||||
resolve(result)
|
resolve(result)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user