@@ -98,7 +98,7 @@ export default {
isExpand: {
handler: function(newVal, oldVal) {
if (newVal !== oldVal) {
- this.tableHeight(this.isExpand ? (this.isEdit ? 550 : 500) : (this.isEdit ? 380 : 330))
+ this.tableHeight(this.isExpand ? (this.isEdit ? 580 : 530) : (this.isEdit ? 400 : 350))
}
}
},
@@ -109,7 +109,7 @@ export default {
mounted() {
this.caseId = this.$route.params.id
this.$nextTick(() => {
- this.tableHeight(this.isExpand ? (this.isEdit ? 550 : 500) : (this.isEdit ? 380 : 330))
+ this.tableHeight(this.isExpand ? (this.isEdit ? 580 : 530) : (this.isEdit ? 400 : 350))
})
this.fetchData()
},
diff --git a/src/views/caseDetails/components/CommonIndex.vue b/src/views/caseDetails/components/CommonIndex.vue
index aeaaf36..0459a8f 100644
--- a/src/views/caseDetails/components/CommonIndex.vue
+++ b/src/views/caseDetails/components/CommonIndex.vue
@@ -14,7 +14,7 @@
@@ -72,7 +72,7 @@ export default {
isExpand: {
handler: function(newVal, oldVal) {
if (newVal !== oldVal) {
- this.tableHeight(this.isExpand ? 500 : 330)
+ this.tableHeight(this.isExpand ? 530 : 360)
}
},
immediate: true
diff --git a/src/views/caseDetails/components/IncriminateIndex.vue b/src/views/caseDetails/components/IncriminateIndex.vue
index 068bb6c..cadbb82 100644
--- a/src/views/caseDetails/components/IncriminateIndex.vue
+++ b/src/views/caseDetails/components/IncriminateIndex.vue
@@ -74,7 +74,7 @@ export default {
isExpand: {
handler: function(newVal, oldVal) {
if (newVal !== oldVal) {
- this.tableHeight(this.isExpand ? 500 : 330)
+ this.tableHeight(this.isExpand ? 530 : 360)
}
},
immediate: true
diff --git a/src/views/caseDetails/components/InnocentIndex.vue b/src/views/caseDetails/components/InnocentIndex.vue
index a75a464..f84a090 100644
--- a/src/views/caseDetails/components/InnocentIndex.vue
+++ b/src/views/caseDetails/components/InnocentIndex.vue
@@ -72,7 +72,7 @@ export default {
isExpand: {
handler: function(newVal, oldVal) {
if (newVal !== oldVal) {
- this.tableHeight(this.isExpand ? 500 : 330)
+ this.tableHeight(this.isExpand ? 530 : 360)
}
},
immediate: true
diff --git a/src/views/caseDetails/components/TripletInfo.vue b/src/views/caseDetails/components/TripletInfo.vue
index 5f0a9d8..8c01456 100644
--- a/src/views/caseDetails/components/TripletInfo.vue
+++ b/src/views/caseDetails/components/TripletInfo.vue
@@ -9,10 +9,13 @@
+
+ { dialogOptions.show = false }">取消
+ 保存
+
@@ -30,6 +33,8 @@ export default {
title: {
title: '选择三元组信息入库'
},
+ top: '50px',
+ hiddenFooter: true,
appendToBody: true
},
gridOptions: {
@@ -48,7 +53,7 @@ export default {
}
},
mounted() {
- this.tableHeight(330)
+ // this.tableHeight(330)
},
methods: {
// 显示弹窗
diff --git a/src/views/caseDetails/components/edit/AddCaseUser.vue b/src/views/caseDetails/components/edit/AddCaseUser.vue
index ae858ab..5e75abd 100644
--- a/src/views/caseDetails/components/edit/AddCaseUser.vue
+++ b/src/views/caseDetails/components/edit/AddCaseUser.vue
@@ -79,7 +79,7 @@ export default {
handleSubmit() {
this.$refs.userForm.validate(async valid => {
if (valid) {
- const { code, msg } = await addUser(this.userForm)
+ const { code, msg } = await addUser({ ...this.userForm, caseId: this.$route.params['id'] })
code === 200 ? this.$baseMessage.success(msg || '新增成功!') : this.$baseMessage.error(msg || '新增失败!')
this.dialogOption.show = false
this.$emit('reloadData')
diff --git a/src/views/caseDetails/components/edit/EditRecord.vue b/src/views/caseDetails/components/edit/EditRecord.vue
index ad8e8b6..c299ecc 100644
--- a/src/views/caseDetails/components/edit/EditRecord.vue
+++ b/src/views/caseDetails/components/edit/EditRecord.vue
@@ -78,15 +78,10 @@
style="width: 100%"
/>
-
+
-
-
-
-
-
-
+ -->
+
0 ? '12' : '')
- }
- }
- },
+ // watch: {
+ // // 监听文件列表
+ // fileList: {
+ // handler: function(val) {
+ // this.$set(this.recordForm, 'file', val.length > 0 ? '12' : '')
+ // }
+ // }
+ // },
mounted() {
this.caseId = this.$route.params.id
this.getUserList()
@@ -215,18 +197,21 @@ export default {
this.isEdit = isEdit
// 弹窗宽度变化
// this.drawerOption.width = isEdit ? '50%' : '35%'
- this.recordForm = isEdit ? data : {}
+ this.recordForm = isEdit ? data : { fileIdList: [] }
// 处理编辑时时间选择器
if (isEdit && data['confessionStartTime'] && data['confessionEndTime']) {
this.$set(this.recordForm, 'confessionTime', [data['confessionStartTime'], data['confessionEndTime']])
}
this.fileList = []
- // 处理文件id列表
- if (isEdit && data['fileIds']) {
- this.fileIdList = data['fileIds'].split(',')
- // files.map(item => {
- // this.fileIdList.push(`${baseURL}${commonDownloadFile}${item}`)
- // })
+ if (isEdit) {
+ const list = []
+ data.fileList.forEach(e => {
+ list.push(e.fileId)
+ this.fileList.push({
+ name: e.fileName
+ })
+ })
+ this.recordForm.fileIdList = list
}
this.drawerOption.title = isEdit ? '编辑笔录' : '添加笔录'
this.drawerOption.show = true
@@ -254,32 +239,26 @@ export default {
})
return list
},
- // 预览图片、文件
- handlePreviewItem(index) {
- this.showFileViewer = true
- this.initialIndex = index
+ handleRemove(file, uploadFiles) {
+ const list = []
+ for (const item of uploadFiles) {
+ list.push(item.response.data)
+ }
+ this.recordForm.fileIdList = list
},
- // 删除供述材料
- handleDelete(item) {
- this.$baseConfirm('确定删除该笔录材料吗?', null, async() => {
- const { code } = await deleteFile(item)
- if (code === 200) {
- this.fileIdList.splice(this.fileIdList.indexOf(item), 1)
- const params = this.$baseLodash.cloneDeep(this.recordForm)
- params['fileIds'] = this.fileIdList.join(',')
- if (this.$baseLodash.isArray(params['confessionTime'])) {
- this.$set(params, 'confessionStartTime', params['confessionTime'][0])
- this.$set(params, 'confessionEndTime', params['confessionTime'][1])
- }
- delete params['file']
- delete params['confessionTime']
- const formData = new FormData()
- this.$baseLodash.keys(params).forEach(key => {
- formData.append(key, params[key])
- })
- addOrUpdRecords(formData)
- }
- })
+ handlePreview(file) {
+ console.log(file)
+ },
+ handleExceed(files, fileList) {
+ this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
+ },
+ beforeRemove(file, fileList) {
+ return this.$confirm(`确定移除 ${file.name}?`)
+ },
+ handleSuccess(response) {
+ if (response.code === 200) {
+ this.recordForm.fileIdList.push(response.data)
+ }
},
// 重置
handleReset() {
@@ -291,26 +270,32 @@ export default {
this.$refs.form.validate(async valid => {
if (valid) {
// 处理参数
- const params = this.$baseLodash.cloneDeep(this.recordForm)
- if (this.isEdit) {
- params['fileIds'] = this.fileIdList.join(',')
+ // const params = this.$baseLodash.cloneDeep(this.recordForm)
+ // const formData = new FormData()
+ // if (this.isEdit) {
+ // params['fileIds'] = this.fileIdList.join(',')
+ // } else {
+ // formData.append('caseId', this.caseId)
+ // }
+
+ // delete params['file']
+ // delete params['confessionTime']
+ // this.$baseLodash.keys(params).forEach(key => {
+ // formData.append(key, params[key])
+ // })
+ // for (let i = 0; i < this.fileList.length; i++) {
+ // formData.append('file', this.fileList[i])
+ // }
+ const params = {
+ ...this.recordForm,
+ caseId: this.$route.params.id
}
if (this.$baseLodash.isArray(params['confessionTime'])) {
this.$set(params, 'confessionStartTime', params['confessionTime'][0])
this.$set(params, 'confessionEndTime', params['confessionTime'][1])
}
- delete params['file']
- delete params['confessionTime']
- const formData = new FormData()
- this.$baseLodash.keys(params).forEach(key => {
- formData.append(key, params[key])
- })
- for (let i = 0; i < this.fileList.length; i++) {
- formData.append('file', this.fileList[i])
- }
- formData.append('caseId', this.caseId)
const loading = this.$baseLoading(0, '笔录上传中,请勿刷新界面..')
- addOrUpdRecords(formData).then(res => {
+ addOrUpdRecords(params).then(res => {
loading.close()
const { code, msg } = res
code === 200 ? this.$baseMessage.success(msg || '上传成功') : this.$baseMessage.error(msg || '上传失败')
@@ -335,15 +320,6 @@ export default {
this.fileList.push(x.raw)
}
}
- },
- handleRemove(file, fileList) {
- console.log(file, fileList)
- },
- handlePreview(file) {
- console.log(file)
- },
- handleExceed(files, fileList) {
- this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
}
}
}
diff --git a/src/views/caseDetails/index.vue b/src/views/caseDetails/index.vue
index cccdddf..d7822b1 100644
--- a/src/views/caseDetails/index.vue
+++ b/src/views/caseDetails/index.vue
@@ -11,7 +11,7 @@