|
@@ -1,7 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-button type="primary" size="small" @click="actionSubmit" v-if="disabled">提报</el-button>
|
|
|
- <el-button type="primary" size="small" disabled v-else>提报</el-button>
|
|
|
+ <el-button type="primary" size="small" :disabled="disabled" @click="actionSubmit">提报</el-button>
|
|
|
<el-drawer title="提报上传" :visible.sync="isFileInfoPanlShow">
|
|
|
<el-button type="warning" size="small" class="btn1" @click="save()">保存</el-button>
|
|
|
<div class="content" style="word-break:break-all">
|
|
@@ -28,6 +27,7 @@ import FileItem from '@/components/file-block/index'
|
|
|
import upload from '@/SManagement/archives_upload/components/upload'
|
|
|
|
|
|
import removeFile from '@/utils/removeFile'
|
|
|
+import { log } from '@antv/g2plot/lib/utils';
|
|
|
export default {
|
|
|
name: 'SubmiteditItemInfo',
|
|
|
data () {
|
|
@@ -53,7 +53,8 @@ export default {
|
|
|
textarea2: '',
|
|
|
//上传模板
|
|
|
upload_panl: 0,
|
|
|
- disabled:window.sessionStorage.getItem('history') != 1
|
|
|
+ disabled:window.sessionStorage.getItem('history') == 1,
|
|
|
+ currentSubmit:''
|
|
|
};
|
|
|
},
|
|
|
props: ['detailData', 'editData'],
|
|
@@ -68,6 +69,8 @@ export default {
|
|
|
isFileInfoPanlShow: {
|
|
|
handler (val) {
|
|
|
if (val == false && this.upload_panl.status == '未提报') {
|
|
|
+ console.log(222222);
|
|
|
+
|
|
|
this.deleteSubmit()
|
|
|
//删除附件
|
|
|
if (this.upload_panl.attinfos.length != 0) removeFile.removeFileList(this.upload_panl.attinfos)
|
|
@@ -79,17 +82,25 @@ export default {
|
|
|
this.upload_panl = val
|
|
|
this.param.content.content = val.content
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ updated() {
|
|
|
+
|
|
|
+ },
|
|
|
+ created() {
|
|
|
},
|
|
|
methods: {
|
|
|
actionSubmit () {
|
|
|
this.isFileInfoPanlShow = true
|
|
|
+ this.$emit('update:editData','')
|
|
|
this.getSubmitPanl()
|
|
|
},
|
|
|
//获取上传模板
|
|
|
async getSubmitPanl () {
|
|
|
this.param.content.sat_submiteditmodelid = this.detailData.sat_submiteditmodelid
|
|
|
let res = await this.$api.requested(this.param)
|
|
|
+ console.log(res);
|
|
|
+
|
|
|
this.upload_panl = res.data
|
|
|
},
|
|
|
//删除提报记录
|
|
@@ -107,21 +118,26 @@ export default {
|
|
|
},
|
|
|
async save () {
|
|
|
//新增
|
|
|
- if (this.param.content.content == false) {
|
|
|
- this.$notify({
|
|
|
+ if (this.param.content.content == undefined && this.detailData.istextrequired == 1) {
|
|
|
+ return this.$notify({
|
|
|
title: '提示',
|
|
|
message: '请编辑内容',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
- return
|
|
|
}
|
|
|
- this.param.content.sat_submiteditmodelid = this.editData ? this.upload_panl.sat_submiteditmodelid : this.detailData.sat_submiteditmodelid
|
|
|
- this.param.content.sat_submiteditid = this.upload_panl.sat_submiteditid
|
|
|
- if (this.editData.attinfos) {
|
|
|
+ if (this.upload_panl.attinfos.length == 0 && this.detailData.isattrequired == 1) {
|
|
|
+ return this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: '请上传附件',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.param.content.sat_submiteditmodelid = this.upload_panl.sat_submiteditmodelid
|
|
|
+ this.param.content.sat_submiteditid = this.editData ? this.editData.sat_submiteditid : this.upload_panl.sat_submiteditid
|
|
|
+
|
|
|
+ if (this.editData) {
|
|
|
let res = await this.$api.requested(this.param).then(res => {
|
|
|
this.tool.showMessage(res, async () => {
|
|
|
- this.isFileInfoPanlShow = false
|
|
|
- this.$parent.getDetailData()
|
|
|
this.upload_panl = ''
|
|
|
this.param.content.content = ''
|
|
|
this.param = {
|
|
@@ -144,8 +160,9 @@ export default {
|
|
|
}).then( res => {
|
|
|
if(res.code == 1) {
|
|
|
this.$parent.getDetailData()
|
|
|
+ this.isFileInfoPanlShow = false
|
|
|
if(this.$route.query.type != 'more') {
|
|
|
- this.disabled = false
|
|
|
+ this.disabled = true
|
|
|
window.sessionStorage.setItem('history',1)
|
|
|
}
|
|
|
}
|
|
@@ -180,16 +197,13 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if(this.$route.query.type != 'more') {
|
|
|
- this.disabled = false
|
|
|
+ this.disabled = true
|
|
|
window.sessionStorage.setItem('history',1)
|
|
|
}
|
|
|
this.isFileInfoPanlShow = false
|
|
|
this.$parent.getDetailData()
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
async onSuccess (id) {
|
|
|
this.fileId = id
|
|
@@ -198,7 +212,7 @@ export default {
|
|
|
"method": "createFileLink",
|
|
|
"content": {
|
|
|
"ownertable": "sat_submitedit",
|
|
|
- "ownerid": this.upload_panl.sat_submiteditid,
|
|
|
+ "ownerid": this.editData ? this.editData.sat_submiteditid : this.upload_panl.sat_submiteditid,
|
|
|
"usetype": "default",
|
|
|
"attachmentids": [
|
|
|
id
|
|
@@ -211,7 +225,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
deleteSuccess (data) {
|
|
|
- this.upload_panl.attinfos.splice(data, 1)
|
|
|
+ this.editData ? this.editData.attinfos.splice(data,1) : this.upload_panl.attinfos.splice(data, 1)
|
|
|
}
|
|
|
},
|
|
|
};
|