|
@@ -79,8 +79,14 @@
|
|
|
<span slot="action" slot-scope="record">
|
|
|
<template>
|
|
|
<a @click="handleView(record)">查看</a>
|
|
|
- <a-divider v-if="record.status != 3 && record.status != 4" type="vertical" />
|
|
|
+ <a-divider type="vertical" />
|
|
|
<a v-if="record.status != 3 && record.status != 4" @click="handleEdit(record)">报废</a>
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <a @click="handleViewImage(record)">流程图</a>
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <a @click="handleViewHistory(record)">审批历史</a>
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <a @click="handleStop(record)">终止审批</a>
|
|
|
</template>
|
|
|
</span>
|
|
|
<span slot="status" slot-scope="text">
|
|
@@ -94,6 +100,8 @@
|
|
|
</a-row>
|
|
|
<base-form ref="baseModal" @ok="handleOk"/>
|
|
|
<detail ref="detailModal" @ok="handleOk"/>
|
|
|
+ <image-modal ref="imageModal"/>
|
|
|
+ <history-table ref="historyModal"/>
|
|
|
</a-card>
|
|
|
|
|
|
</template>
|
|
@@ -104,9 +112,17 @@ import BaseForm from './modules/BaseForm'
|
|
|
import Detail from './modules/Detail'
|
|
|
import DownloadModal from '@/views/download/DownloadModal'
|
|
|
import PreviewModal from '@/views/preview/PreviewModal'
|
|
|
-import { updateSbInfo, getSbInfoPage, deleteSbInfos, fetchSbInfo, fetchSbInfos, exportSbInfo } from '@/api/sb/info'
|
|
|
-import { queryDept, getDeptsAllByParentId } from '@/api/upms/dept'
|
|
|
-import BaseTool from '../../../utils/tool'
|
|
|
+import ImageModal from '@/views/activiti/ImageModal'
|
|
|
+import HistoryTable from '@/views/activiti/HistoryTable'
|
|
|
+import {
|
|
|
+ getSbInfoPage,
|
|
|
+ deleteSbInfos,
|
|
|
+ exportSbInfo,
|
|
|
+ startSbInfoScrap,
|
|
|
+ stopSbInfoScrapForAudit
|
|
|
+} from '@/api/sb/info'
|
|
|
+import { queryDept } from '@/api/upms/dept'
|
|
|
+
|
|
|
import { fetchSbTypeTree } from '@/api/sb/type'
|
|
|
|
|
|
export default {
|
|
@@ -117,7 +133,9 @@ export default {
|
|
|
BaseForm,
|
|
|
Detail,
|
|
|
DownloadModal,
|
|
|
- PreviewModal
|
|
|
+ PreviewModal,
|
|
|
+ ImageModal,
|
|
|
+ HistoryTable
|
|
|
},
|
|
|
props: {
|
|
|
filter: {
|
|
@@ -251,7 +269,7 @@ export default {
|
|
|
title: '状态',
|
|
|
checked: true,
|
|
|
dataIndex: 'status',
|
|
|
- width: 100,
|
|
|
+ width: 200,
|
|
|
fixed: 'right',
|
|
|
scopedSlots: { customRender: 'status' }
|
|
|
},
|
|
@@ -261,7 +279,7 @@ export default {
|
|
|
checked: true,
|
|
|
fixed: 'right',
|
|
|
align: 'center',
|
|
|
- width: '100',
|
|
|
+ width: '250',
|
|
|
scopedSlots: { customRender: 'action' }
|
|
|
}
|
|
|
],
|
|
@@ -347,76 +365,30 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handleEdit (record) {
|
|
|
- fetchSbInfo({ id: record.id }).then(res => {
|
|
|
- this.visible = false
|
|
|
- const modal = this.$refs.baseModal
|
|
|
- modal.base(res.data)
|
|
|
+ startSbInfoScrap(record).then(res => {
|
|
|
+ this.$message.info(res.data)
|
|
|
+ this.handleOk()
|
|
|
})
|
|
|
},
|
|
|
- printQcode (record) {
|
|
|
- let recordList = []
|
|
|
- if (this.BaseTool.String.isBlank(record)) {
|
|
|
- const length = this.selectedRows.length
|
|
|
- if (length === 0) {
|
|
|
- this.$message.info('请选择要打印的记录')
|
|
|
- return
|
|
|
- }
|
|
|
- recordList = this.selectedRows
|
|
|
- } else {
|
|
|
- recordList = [record]
|
|
|
- }
|
|
|
- this.$refs.printSbCode.base(recordList)
|
|
|
+ handleViewImage (record) {
|
|
|
+ const modal = this.$refs.imageModal
|
|
|
+ modal.base(record.processInstanceId)
|
|
|
},
|
|
|
- handleStart (record) {
|
|
|
- record.status = 2
|
|
|
- updateSbInfo(record).then(res => {
|
|
|
- this.$message.info('已启用')
|
|
|
- })
|
|
|
+ handleViewHistory (record) {
|
|
|
+ const modal = this.$refs.historyModal
|
|
|
+ modal.base(record)
|
|
|
},
|
|
|
handleStop (record) {
|
|
|
- record.status = 7
|
|
|
- updateSbInfo(record).then(res => {
|
|
|
- this.$message.info('已停用')
|
|
|
- })
|
|
|
- },
|
|
|
- handleAdd () {
|
|
|
- this.visible = false
|
|
|
- this.$refs.baseModal.base()
|
|
|
- },
|
|
|
- handleView (record) {
|
|
|
- fetchSbInfo({ id: record.id }).then(res => {
|
|
|
- this.visible = false
|
|
|
- const modal = this.$refs.detailModal
|
|
|
- modal.base(res.data)
|
|
|
- })
|
|
|
- },
|
|
|
- handleAreaChange (value) {
|
|
|
- getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.FEN_GONG_SI }).then(res => {
|
|
|
- this.companyList = res.data
|
|
|
- })
|
|
|
- },
|
|
|
- handleCompanyChange (value) {
|
|
|
- getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
|
|
|
- this.projectList = res.data
|
|
|
- })
|
|
|
- },
|
|
|
- handleProjectChange (value) {
|
|
|
- getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BU_MEN }).then(res => {
|
|
|
- this.deptList = res.data
|
|
|
- })
|
|
|
- },
|
|
|
- handleDeptChange (value) {
|
|
|
- getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BAN_ZU }).then(res => {
|
|
|
- this.groupList = res.data
|
|
|
- })
|
|
|
- },
|
|
|
- handleCopy (record) {
|
|
|
- this.visible = false
|
|
|
- fetchSbInfo({ id: record.id }).then(res => {
|
|
|
- const modal = this.$refs.baseModal
|
|
|
- res.data.id = null
|
|
|
- modal.base(res.data)
|
|
|
- })
|
|
|
+ this.$message.info('正在终止审批流程,请勿重复点击')
|
|
|
+ this.confirmLoading = true
|
|
|
+ stopSbInfoScrapForAudit(record)
|
|
|
+ .then(() => {
|
|
|
+ this.$message.info('已成功终止审批流程,可以重新发起审批')
|
|
|
+ this.confirmLoading = false
|
|
|
+ this.handleOk()
|
|
|
+ }).catch(() => {
|
|
|
+ this.confirmLoading = false
|
|
|
+ })
|
|
|
},
|
|
|
handleOk () {
|
|
|
this.visible = true
|
|
@@ -458,62 +430,6 @@ export default {
|
|
|
onExpand (expandedKeys) {
|
|
|
this.expandedKeys = expandedKeys
|
|
|
this.autoExpandParent = false
|
|
|
- },
|
|
|
- handleRepairFilePreview (record) {
|
|
|
- console.log(record, 87878)
|
|
|
- this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_REPAIRFILE)
|
|
|
- },
|
|
|
- handleRepairFileDownload (record) {
|
|
|
- // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_REPAIRFILE, getDownloadUrl(record.id))
|
|
|
- },
|
|
|
- handleUseFilePreview (record) {
|
|
|
- this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_USEFILE)
|
|
|
- },
|
|
|
- handleUseFileDownload (record) {
|
|
|
- // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_USEFILE, getDownloadUrl(record.id))
|
|
|
- },
|
|
|
- handleCheckFilePreview (record) {
|
|
|
- this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_RECHECKFILE)
|
|
|
- },
|
|
|
- handleCheckFileDownload (record) {
|
|
|
- // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_RECHECKFILE, getDownloadUrl(record.id))
|
|
|
- },
|
|
|
- doImport () {
|
|
|
- if (this.queryParam.useCompany == null) {
|
|
|
- this.$message.error('请先选择公司')
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.queryParam.useProject == null) {
|
|
|
- this.$message.error('请先选择项目部')
|
|
|
- return
|
|
|
- }
|
|
|
- this.$refs.importModal.base(this.queryParam.useCompany, this.queryParam.useProject)
|
|
|
- },
|
|
|
- doImportDe () {
|
|
|
- this.queryParam.useCompany = null
|
|
|
- this.queryParam.useProject = null
|
|
|
- this.$refs.importModal.base()
|
|
|
- },
|
|
|
- handlePrint (record) {
|
|
|
- this.visible = false
|
|
|
- fetchSbInfo({ id: record.id }).then(res => {
|
|
|
- const modal = this.$refs.printInSbInfoBatch
|
|
|
- modal.base([res.data])
|
|
|
- })
|
|
|
- },
|
|
|
- handlePrintBatch () {
|
|
|
- this.visible = false
|
|
|
- let ids = []
|
|
|
- const length = this.selectedRows.length
|
|
|
- if (length === 0) {
|
|
|
- this.$message.info('请选择要打印的记录')
|
|
|
- return
|
|
|
- }
|
|
|
- ids = this.selectedRows.map(item => item.id)
|
|
|
- fetchSbInfos(ids).then(res => {
|
|
|
- const modal = this.$refs.printInSbInfoBatch
|
|
|
- modal.base(res.data)
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
}
|