diff --git a/src/api/common.js b/src/api/common.js
index 61b27ef..77e27d7 100644
--- a/src/api/common.js
+++ b/src/api/common.js
@@ -209,4 +209,15 @@ export function uploadFileFn(params) {
data: params,
responseType: 'blob'
})
-}
+}
+export function updateInspectionSystemFile(params) {
+ return preview({
+ url: '/inspectionSystemFile',
+ method: 'put',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ },
+ data: params,
+ responseType: 'blob'
+ })
+}
diff --git a/src/views/document/index.vue b/src/views/document/index.vue
index f355d2d..f076b2a 100644
--- a/src/views/document/index.vue
+++ b/src/views/document/index.vue
@@ -38,18 +38,18 @@
- 在线预览
+ 预览
下载
- 查看历史版本
+ 历史
@@ -57,10 +57,10 @@
-
+
-
-
+
+
1) {
+ this.$notify.warning('请选择单份体系文件进行更新上传!')
+ return false
+ }
const fd = new FormData()
fd.append('file', file)
- uploadFileFn(fd).then(() => {
- this.$notify.success('导入数据成功。')
- this.crud.toQuery()
- })
+ if (this.$refs.customTable.$refs.table.selection.length) {
+ fd.append('id', this.$refs.customTable.$refs.table.selection[0].id)
+ updateInspectionSystemFile(fd).then(() => {
+ this.$notify.success('体系更新成功。')
+ this.crud.toQuery()
+ })
+ } else {
+ uploadFileFn(fd).then(() => {
+ this.$notify.success('体系上传成功。')
+ this.crud.toQuery()
+ })
+ }
+ return false
},
downLoad(item) {
downloadFileUrl(this.url + '/' + item.id + item.suffix, item.filename, item.suffix)
@@ -188,6 +197,18 @@ export default {
},
closeReportDialog() {
this.$refs['reportForm'].resetFields()
+ },
+ formatterFlowName(row, column, cellValue) {
+ switch (cellValue) {
+ case 0:
+ return '保存'
+ case 1:
+ return '更新'
+ case 2:
+ return '删除'
+ default:
+ break
+ }
}
}
}