|
...
|
...
|
@@ -4,7 +4,6 @@ import preferencesUtils from '../utils/preferences' |
|
|
|
import { AxiosResponse } from '@ohos/axios'
|
|
|
|
import { HmParseHTML } from "@wuyan/html_parse"
|
|
|
|
import { basePath } from '../utils/baseUrl'
|
|
|
|
import {getCloudDown, beanType} from '../api/user'
|
|
|
|
import loadingDialog from '../dialog/LoadingDialog'
|
|
|
|
import UploadTipDialog from '../dialog/UploadTipDialog'
|
|
|
|
import { getReportDetail, getMalfunctionList, deleteRecords, successReport, returnSing } from '../api/originalRecords'
|
|
...
|
...
|
@@ -36,7 +35,6 @@ struct DetailRecords { |
|
|
|
@State findTime: string = ''
|
|
|
|
@State applyCompanyComment: string = ''
|
|
|
|
@State maintenanceComment: string = ''
|
|
|
|
@State isShowCloudDown: boolean = false
|
|
|
|
aboutToAppear(): void {
|
|
|
|
AppStorage.setOrCreate('videoPath', '');
|
|
|
|
if(!AppStorage.get('isShowTip')) {
|
|
...
|
...
|
@@ -45,9 +43,6 @@ struct DetailRecords { |
|
|
|
}
|
|
|
|
async onPageShow() {
|
|
|
|
this.loadingController.open()
|
|
|
|
// 是否可以上传云存储
|
|
|
|
let cloudDown: AxiosResponse<beanType> = await getCloudDown()
|
|
|
|
this.isShowCloudDown = cloudDown.data.msg == 'true'
|
|
|
|
// 获取维保记录详情
|
|
|
|
const detail: AxiosResponse<reportDetailTest> = await getReportDetail(reportId)
|
|
|
|
this.reportDetail = detail.data.data
|
|
...
|
...
|
@@ -63,6 +58,7 @@ struct DetailRecords { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 加载弹窗
|
|
|
|
loadingController: CustomDialogController = new CustomDialogController({
|
|
|
|
builder: loadingDialog(),
|
|
|
|
customStyle: true,
|
|
...
|
...
|
@@ -71,6 +67,7 @@ struct DetailRecords { |
|
|
|
autoCancel: false
|
|
|
|
})
|
|
|
|
|
|
|
|
// 上传下载提示框
|
|
|
|
uploadController: CustomDialogController = new CustomDialogController({
|
|
|
|
builder: UploadTipDialog(),
|
|
|
|
cornerRadius: 10
|
|
...
|
...
|
@@ -94,6 +91,125 @@ struct DetailRecords { |
|
|
|
isImgOrVideo = (list: ItemList[]): boolean => {
|
|
|
|
return list.some(item => item.cosKey !== null)
|
|
|
|
}
|
|
|
|
|
|
|
|
// 分享签名
|
|
|
|
shareSignature = () => {
|
|
|
|
AlertDialog.show({
|
|
|
|
title: '分享签名提示',
|
|
|
|
message: `出于对多个甲方见证人签名的考虑,在甲方签名完成后,仍是"待甲方签名"的状态,需【维保公司账号】前往【更多操作】-->【完成】`,
|
|
|
|
alignment: DialogAlignment.Center,
|
|
|
|
primaryButton: {
|
|
|
|
value: '取消',
|
|
|
|
action: () => {
|
|
|
|
console.info('Callback when the first button is clicked')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
secondaryButton: {
|
|
|
|
enabled: true,
|
|
|
|
defaultFocus: true,
|
|
|
|
style: DialogButtonStyle.HIGHLIGHT,
|
|
|
|
value: '确认',
|
|
|
|
action: async () => {
|
|
|
|
this.copyText(`https://xfappht.crgx.net/report/record?id=${reportId}&token=${preferencesUtils.get('XF_TOKEN', '')}&time=${new Date().getTime()}&type=firstPartySign&username=${preferencesUtils.get('XF_USERNAME', '')}`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 查看记录
|
|
|
|
lookReport = () => {
|
|
|
|
if(personId !== '') {
|
|
|
|
router.pushUrl({
|
|
|
|
url: 'pages/LookRecords',
|
|
|
|
params: {
|
|
|
|
reportId: this.reportDetail?.reportId,
|
|
|
|
pid: personId
|
|
|
|
}
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
router.pushUrl({
|
|
|
|
url: 'pages/LookRecordCompany',
|
|
|
|
params: {
|
|
|
|
reportId: this.reportDetail?.reportId
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 修改记录
|
|
|
|
updateReport = () => {
|
|
|
|
AlertDialog.show({
|
|
|
|
title: '重要提示',
|
|
|
|
message: `退回编辑会清除所有的维保人员签名和甲方签名,确认退回?`,
|
|
|
|
alignment: DialogAlignment.Center,
|
|
|
|
primaryButton: {
|
|
|
|
value: '取消',
|
|
|
|
action: () => {
|
|
|
|
console.info('Callback when the first button is clicked')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
secondaryButton: {
|
|
|
|
enabled: true,
|
|
|
|
defaultFocus: true,
|
|
|
|
style: DialogButtonStyle.HIGHLIGHT,
|
|
|
|
value: '确认',
|
|
|
|
action: async () => {
|
|
|
|
const res: AxiosResponse<configTest> = await returnSing(reportId)
|
|
|
|
promptAction.showToast({message: res.data.msg})
|
|
|
|
const detail: AxiosResponse<reportDetailTest> = await getReportDetail(reportId)
|
|
|
|
this.reportDetail = detail.data.data
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 完成签发
|
|
|
|
IssueCompleted = () => {
|
|
|
|
AlertDialog.show({
|
|
|
|
title: '提示',
|
|
|
|
message: `完成签发后不可退回修改,确认完成吗`,
|
|
|
|
alignment: DialogAlignment.Center,
|
|
|
|
primaryButton: {
|
|
|
|
value: '取消',
|
|
|
|
action: () => {
|
|
|
|
console.info('Callback when the first button is clicked')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
secondaryButton: {
|
|
|
|
enabled: true,
|
|
|
|
defaultFocus: true,
|
|
|
|
style: DialogButtonStyle.HIGHLIGHT,
|
|
|
|
value: '确认',
|
|
|
|
action: async () => {
|
|
|
|
await successReport(reportId)
|
|
|
|
await deleteRecords({reportId, state: '1'})
|
|
|
|
promptAction.showToast({message: '修改完成'})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 删除记录
|
|
|
|
deleteReport = () => {
|
|
|
|
AlertDialog.show({
|
|
|
|
title: '删除提示',
|
|
|
|
message: `维保原始记录一经删除,无法找回,确认删除${this.reportDetail?.reportName}(${this.reportDetail?.reportNo})的原始记录吗?`,
|
|
|
|
alignment: DialogAlignment.Center,
|
|
|
|
primaryButton: {
|
|
|
|
value: '取消',
|
|
|
|
action: () => {
|
|
|
|
console.info('Callback when the first button is clicked')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
secondaryButton: {
|
|
|
|
enabled: true,
|
|
|
|
defaultFocus: true,
|
|
|
|
style: DialogButtonStyle.HIGHLIGHT,
|
|
|
|
value: '确认',
|
|
|
|
action: async () => {
|
|
|
|
await deleteRecords({reportId, state: '2'})
|
|
|
|
router.back()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
Column(){
|
|
|
|
NavHeader({title: '维保记录详情'})
|
|
...
|
...
|
@@ -175,29 +291,7 @@ struct DetailRecords { |
|
|
|
Row({space: 5}){
|
|
|
|
Image($r('app.media.share')).width(14)
|
|
|
|
Text('分享签名').fontSize(12).fontColor('#1890ff')
|
|
|
|
}.onClick(() => {
|
|
|
|
AlertDialog.show({
|
|
|
|
title: '分享签名提示',
|
|
|
|
message: `出于对多个甲方见证人签名的考虑,在甲方签名完成后,仍是"待甲方签名"的状态,需【维保公司账号】前往【更多操作】-->【完成】`,
|
|
|
|
alignment: DialogAlignment.Center,
|
|
|
|
primaryButton: {
|
|
|
|
value: '取消',
|
|
|
|
action: () => {
|
|
|
|
console.info('Callback when the first button is clicked')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
secondaryButton: {
|
|
|
|
enabled: true,
|
|
|
|
defaultFocus: true,
|
|
|
|
style: DialogButtonStyle.HIGHLIGHT,
|
|
|
|
value: '确认',
|
|
|
|
action: async () => {
|
|
|
|
console.log(`https://xfappht.crgx.net/report/record?id=${reportId}&token=${preferencesUtils.get('XF_TOKEN', '')}&time=${new Date().getTime()}&type=firstPartySign&username=${preferencesUtils.get('XF_USERNAME', '')}`)
|
|
|
|
this.copyText(`https://xfappht.crgx.net/report/record?id=${reportId}&token=${preferencesUtils.get('XF_TOKEN', '')}&time=${new Date().getTime()}&type=firstPartySign&username=${preferencesUtils.get('XF_USERNAME', '')}`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}.onClick(() => { this.shareSignature() })
|
|
|
|
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
|
|
|
|
.visibility(this.reportDetail?.state == '1' || this.reportDetail?.state == '5' ? Visibility.Visible : Visibility.None)
|
|
|
|
Column({space: 5}){
|
|
...
|
...
|
@@ -224,24 +318,7 @@ struct DetailRecords { |
|
|
|
Image($r('app.media.edit_1')).width(12)
|
|
|
|
Text('查看记录').fontColor('#1890ff').fontSize(12).margin({left: 3, right: 3})
|
|
|
|
Image($r('app.media.right_arrow')).width(12)
|
|
|
|
}.onClick(() => {
|
|
|
|
if(personId !== '') {
|
|
|
|
router.pushUrl({
|
|
|
|
url: 'pages/LookRecords',
|
|
|
|
params: {
|
|
|
|
reportId: this.reportDetail?.reportId,
|
|
|
|
pid: personId
|
|
|
|
}
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
router.pushUrl({
|
|
|
|
url: 'pages/LookRecordCompany',
|
|
|
|
params: {
|
|
|
|
reportId: this.reportDetail?.reportId
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}.onClick(() => { this.lookReport() })
|
|
|
|
}.justifyContent(FlexAlign.SpaceBetween).width('100%').margin({bottom: 10})
|
|
|
|
ForEach(this.projectList, (item: ProjectList, index) => {
|
|
|
|
Column({space: 5}){
|
|
...
|
...
|
@@ -277,9 +354,7 @@ struct DetailRecords { |
|
|
|
})
|
|
|
|
router.pushUrl({
|
|
|
|
url: 'pages/VideoDetail',
|
|
|
|
params: {
|
|
|
|
cosKeyList: newArr
|
|
|
|
}
|
|
|
|
params: { cosKeyList: newArr }
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
|
|
...
|
...
|
@@ -371,29 +446,7 @@ struct DetailRecords { |
|
|
|
Image($r('app.media.right_arrow')).width(16)
|
|
|
|
}.padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%').border({width: {bottom: 1}, color: '#eee'})
|
|
|
|
.visibility(this.reportDetail?.state == '1' ? Visibility.None : Visibility.Visible)
|
|
|
|
.onClick(() => {
|
|
|
|
AlertDialog.show({
|
|
|
|
title: '删除提示',
|
|
|
|
message: `维保原始记录一经删除,无法找回,确认删除${this.reportDetail?.reportName}(${this.reportDetail?.reportNo})的原始记录吗?`,
|
|
|
|
alignment: DialogAlignment.Center,
|
|
|
|
primaryButton: {
|
|
|
|
value: '取消',
|
|
|
|
action: () => {
|
|
|
|
console.info('Callback when the first button is clicked')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
secondaryButton: {
|
|
|
|
enabled: true,
|
|
|
|
defaultFocus: true,
|
|
|
|
style: DialogButtonStyle.HIGHLIGHT,
|
|
|
|
value: '确认',
|
|
|
|
action: async () => {
|
|
|
|
await deleteRecords({reportId, state: '2'})
|
|
|
|
router.back()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.onClick(() => { this.deleteReport() })
|
|
|
|
Row(){
|
|
|
|
Row(){
|
|
|
|
Image($r('app.media.finish')).width(16)
|
|
...
|
...
|
@@ -402,30 +455,7 @@ struct DetailRecords { |
|
|
|
Image($r('app.media.right_arrow')).width(16)
|
|
|
|
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
|
|
|
|
.visibility(this.reportDetail?.state == '5' && roleName == 'company' ? Visibility.Visible : Visibility.None)
|
|
|
|
.onClick(async () => {
|
|
|
|
AlertDialog.show({
|
|
|
|
title: '提示',
|
|
|
|
message: `完成签发后不可退回修改,确认完成吗`,
|
|
|
|
alignment: DialogAlignment.Center,
|
|
|
|
primaryButton: {
|
|
|
|
value: '取消',
|
|
|
|
action: () => {
|
|
|
|
console.info('Callback when the first button is clicked')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
secondaryButton: {
|
|
|
|
enabled: true,
|
|
|
|
defaultFocus: true,
|
|
|
|
style: DialogButtonStyle.HIGHLIGHT,
|
|
|
|
value: '确认',
|
|
|
|
action: async () => {
|
|
|
|
await successReport(reportId)
|
|
|
|
await deleteRecords({reportId, state: '1'})
|
|
|
|
promptAction.showToast({message: '修改完成'})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.onClick(async () => { this.IssueCompleted() })
|
|
|
|
Row(){
|
|
|
|
Row(){
|
|
|
|
Image($r('app.media.returnUpdate')).width(16)
|
|
...
|
...
|
@@ -434,41 +464,7 @@ struct DetailRecords { |
|
|
|
Image($r('app.media.right_arrow')).width(16)
|
|
|
|
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
|
|
|
|
.visibility(this.reportDetail?.state == '5' && roleName == 'company' ? Visibility.Visible : Visibility.None)
|
|
|
|
.onClick(async () => {
|
|
|
|
AlertDialog.show({
|
|
|
|
title: '重要提示',
|
|
|
|
message: `退回编辑会清除所有的维保人员签名和甲方签名,确认退回?`,
|
|
|
|
alignment: DialogAlignment.Center,
|
|
|
|
primaryButton: {
|
|
|
|
value: '取消',
|
|
|
|
action: () => {
|
|
|
|
console.info('Callback when the first button is clicked')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
secondaryButton: {
|
|
|
|
enabled: true,
|
|
|
|
defaultFocus: true,
|
|
|
|
style: DialogButtonStyle.HIGHLIGHT,
|
|
|
|
value: '确认',
|
|
|
|
action: async () => {
|
|
|
|
const res: AxiosResponse<configTest> = await returnSing(reportId)
|
|
|
|
promptAction.showToast({message: res.data.msg})
|
|
|
|
const detail: AxiosResponse<reportDetailTest> = await getReportDetail(reportId)
|
|
|
|
this.reportDetail = detail.data.data
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// Row(){
|
|
|
|
// Row(){
|
|
|
|
// Image($r('app.media.lookView')).width(16)
|
|
|
|
// Text('预览统计').fontColor('#1890ff').fontSize(12).margin({left: 3, right: 3})
|
|
|
|
// }
|
|
|
|
// Image($r('app.media.right_arrow')).width(16)
|
|
|
|
// }.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
|
|
|
|
// .onClick(() => {
|
|
|
|
// pushOutsideWeb(`https://xfwbzs.crgx.net/report/preview?id=${reportId}`)
|
|
|
|
// })
|
|
|
|
.onClick(async () => { this.updateReport() })
|
|
|
|
Row(){
|
|
|
|
Row(){
|
|
|
|
Image($r('app.media.document')).width(16)
|
|
...
|
...
|
@@ -477,9 +473,7 @@ struct DetailRecords { |
|
|
|
Image($r('app.media.right_arrow')).width(16)
|
|
|
|
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
|
|
|
|
.visibility(this.reportDetail?.state == '1' ? Visibility.Visible : Visibility.None)
|
|
|
|
.onClick(() => {
|
|
|
|
pushOutsideWeb(`${basePath}/report/view?id=${reportId}`)
|
|
|
|
})
|
|
|
|
.onClick(() => { pushOutsideWeb(`${basePath}/report/view?id=${reportId}`) })
|
|
|
|
Row(){
|
|
|
|
Row(){
|
|
|
|
Image($r('app.media.setting')).width(16)
|
|
...
|
...
|
@@ -488,9 +482,7 @@ struct DetailRecords { |
|
|
|
Image($r('app.media.right_arrow')).width(16)
|
|
|
|
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
|
|
|
|
.visibility(this.reportDetail?.state == '1' ? Visibility.Visible : Visibility.None)
|
|
|
|
.onClick(() => {
|
|
|
|
pushOutsideWeb(`${basePath}/report/view?id=${reportId}`)
|
|
|
|
})
|
|
|
|
.onClick(() => { pushOutsideWeb(`${basePath}/report/view?id=${reportId}`) })
|
|
|
|
}.backgroundColor('#fff').borderRadius(10).padding(10).width('100%')
|
|
|
|
}.width('100%')
|
|
|
|
}.backgroundColor('#f2f3f7').padding(10)
|
...
|
...
|
|