This commit is contained in:
宋伟佳
2021-08-05 14:53:20 +08:00
6 changed files with 69 additions and 33 deletions
@@ -45,18 +45,23 @@
v-model="form.modelName" v-model="form.modelName"
clearable clearable
></el-input> ></el-input>
<div v-if="form.modelName" @click="fileUpload" class="fileClass"> <!-- <div v-if="form.modelName" @click="fileUpload" class="fileClass">-->
{{ form.modelName }} <!-- {{ form.modelName }}-->
</div> <!-- </div>-->
<div v-else> <!-- <div v-else>-->
<el-button <!-- <el-button-->
type="primary" <!-- type="primary"-->
class="common-button-primary" <!-- class="common-button-primary"-->
@click="fileUpload" <!-- @click="fileUpload"-->
size="mini"> <!-- size="mini">-->
点击上传 <!-- 点击上传-->
<!-- </el-button>-->
<el-button type="primary" @click="fileUpload">
<i class="el-icon-upload el-icon--right"></i>
{{isFileUploadStr}}
</el-button> </el-button>
</div> <!-- </div>-->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -169,6 +174,7 @@
></Role-tree> ></Role-tree>
<el-dialog width='400px' :visible.sync="fileMadel" title="上传文件"> <el-dialog width='400px' :visible.sync="fileMadel" title="上传文件">
<el-upload <el-upload
class="upload-demo"
multiple multiple
drag drag
:action="fileUrl" :action="fileUrl"
@@ -177,13 +183,15 @@
accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx" accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx"
:before-upload="beginImportFile" :before-upload="beginImportFile"
:on-success="importFileSuccess" :on-success="importFileSuccess"
:show-file-list="false" :on-progress="progressFile"
:show-file-list="true"
> >
<div style="padding: 20px 0"> <div style="padding: 20px 0">
<i class="el-icon-upload" style="color: #3399ff"></i> <i class="el-icon-upload" style="color: #3399ff"></i>
<p>点击或拖拽上传文件</p> <p>点击或拖拽上传文件</p>
</div> </div>
</el-upload> </el-upload>
<el-progress style="width: 380px; margin-top: 5px;" v-show="progressType" :percentage="loadProgress"></el-progress>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@@ -198,6 +206,9 @@ export default {
name: "bzdyStep1", name: "bzdyStep1",
data() { data() {
return { return {
isFileUploadStr:'点击上传',
progressType: false,
loadProgress: 0,
commentText: '', commentText: '',
nodeList: [], nodeList: [],
nodeList2: [], nodeList2: [],
@@ -310,6 +321,10 @@ export default {
this.drawerTitle = title this.drawerTitle = title
this.modalshowflag = true this.modalshowflag = true
}, },
progressFile (event, file, fileList) {
let loadProgress = Math.floor(event.percent)
this.loadProgress = loadProgress
},
// 导入按钮 上传之前的钩子 // 导入按钮 上传之前的钩子
beginImportFile (file) { beginImportFile (file) {
var filename = file.name var filename = file.name
@@ -318,11 +333,13 @@ export default {
var fileSuffix = filename.substring(index1, index2) var fileSuffix = filename.substring(index1, index2)
// const fileSuffix = file.name.split('.')[1] // 后缀名 // const fileSuffix = file.name.split('.')[1] // 后缀名
// 判断上传文件格式 // 判断上传文件格式
this.progressType = true
if (fileSuffix === '.ppt' || fileSuffix === '.docx' || fileSuffix === '.DOCX' || fileSuffix === '.PPT' || fileSuffix === '.xls' || fileSuffix === '.xlsx') { if (fileSuffix === '.ppt' || fileSuffix === '.docx' || fileSuffix === '.DOCX' || fileSuffix === '.PPT' || fileSuffix === '.xls' || fileSuffix === '.xlsx') {
return true return true
} else { } else {
this.spinShow = false this.spinShow = false
this.$message.error('文件' + file.name + '格式不正确,请上传PPT,DOCX,XLS文件') this.$message.error('文件' + file.name + '格式不正确,请上传PPT,DOCX,XLS文件')
this.progressType = false
return false return false
} }
// 判断文件上传大小 // 判断文件上传大小
@@ -331,6 +348,7 @@ export default {
return true return true
} else { } else {
this.$message.error('文件' + file.name + '大小不超过200M') this.$message.error('文件' + file.name + '大小不超过200M')
this.progressType = false
return false return false
} }
return true return true
@@ -338,7 +356,10 @@ export default {
// 导入标准数据成功后执行 // 导入标准数据成功后执行
importFileSuccess (response, file) { importFileSuccess (response, file) {
if (response.ok) { if (response.ok) {
this.fileMadel = false this.isFileUploadStr='点击查看已上传文件';
this.fileMadel = true;
this.loadProgress = 0
this.progressType = false
this.form.model = response.data.id this.form.model = response.data.id
this.form.modelName = response.data.name this.form.modelName = response.data.name
this.$message({ this.$message({
@@ -412,7 +433,7 @@ export default {
}) })
} }
}, },
mounted () {} mounted () {},
} }
</script> </script>
@@ -102,12 +102,12 @@
width="100" width="100"
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
prop="itemsTitle" <!-- prop="itemsTitle"-->
label="条款内容" <!-- label="条款内容"-->
show-overflow-tooltip <!-- show-overflow-tooltip-->
align="center"> <!-- align="center">-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <el-table-column
prop="technicalRequir" prop="technicalRequir"
width="150" width="150"
@@ -118,7 +118,6 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="sarType === 'INLAND'"
prop="changePoint" prop="changePoint"
width="150" width="150"
label="基于上一版本差异" label="基于上一版本差异"
@@ -538,17 +537,17 @@
} }
itemList.forEach(item => { itemList.forEach(item => {
item.unitDeptName = this.$store.getters.userInfo.orgName item.unitDeptName = this.$store.getters.userInfo.orgName
item.onlineData = '' item.onlineData = item.onlineData || ''
item.newData = '' item.newData = item.newData || ''
item.complianceState = '' item.complianceState = item.complianceState || ''
item.oldNumber = '' item.oldNumber = item.oldNumber || ''
item.complianceRequir = '1' item.complianceRequir = item.complianceRequir || '1'
item.changePoint = '' item.changePoint = item.changePoint || ''
item.technicalRequir = '' item.technicalRequir = item.technicalRequir || ''
item.itemsTitle = item.itermsConditions item.itemsTitle = item.itermsConditions
}) })
console.log(2);
this.itemList = itemList this.itemList = itemList
console.log(this.itemList)
this.loading = false this.loading = false
}).catch(e => { }).catch(e => {
}) })
@@ -862,8 +862,13 @@
}, },
methods: { methods: {
downloadFile (fileType) { downloadFile (fileType) {
//文件id中出现了','字符,去除掉
if(fileType === 'fbgbjbd'){ if(fileType === 'fbgbjbd'){
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + this.fbgbjbdFileId if(this.fbgbjbdFileId.search(',')){
this.fbgbjbdFileId=this.fbgbjbdFileId.replace(",","");
console.log(this.fbgbjbdFileId);
}
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + this.fbgbjbdFileId
}else if(fileType === 'xgd'){ }else if(fileType === 'xgd'){
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + this.xgdFileId window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + this.xgdFileId
}else if(fileType === 'bpg'){ }else if(fileType === 'bpg'){
@@ -885,11 +890,12 @@
} }
}, },
getRule(){ getRule(){
if (this.formTongGuo.approvalOpinion === '0') { if (this.formTongGuo.approvalOpinion === '0') {
this.rules.commentText.required = false this.rules.commentText[0].required = false;
this.$refs.formTongGuo.clearValidate('commentText') this.$refs.formTongGuo.clearValidate('commentText')
} else { }else {
this.rules.commentText.required = true this.rules.commentText[0].required = true;
} }
}, },
popoverHide (checkedIds, checkedData) { popoverHide (checkedIds, checkedData) {
@@ -964,6 +970,7 @@
this.caFileId = processForm.ca this.caFileId = processForm.ca
this.zbjbdFileId = processForm.zbjbd this.zbjbdFileId = processForm.zbjbd
this.getFormFieldList(processForm) this.getFormFieldList(processForm)
console.log(processForm);
} }
}).catch(e => { }).catch(e => {
}) })
@@ -836,6 +836,10 @@ export default {
methods: { methods: {
downloadFile (fileType) { downloadFile (fileType) {
if(fileType === 'fbgbjbd'){ if(fileType === 'fbgbjbd'){
if(this.fbgbjbdFileId.search(',')){
this.fbgbjbdFileId=this.fbgbjbdFileId.replace(",","");
console.log(this.fbgbjbdFileId);
}
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + this.fbgbjbdFileId window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + this.fbgbjbdFileId
}else if(fileType === 'xgd'){ }else if(fileType === 'xgd'){
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + this.xgdFileId window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + this.xgdFileId
@@ -815,6 +815,10 @@
methods: { methods: {
downloadFile (fileType) { downloadFile (fileType) {
if(fileType === 'fbgbjbd'){ if(fileType === 'fbgbjbd'){
if(this.fbgbjbdFileId.search(',')){
this.fbgbjbdFileId=this.fbgbjbdFileId.replace(",","");
console.log(this.fbgbjbdFileId);
}
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + this.fbgbjbdFileId window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + this.fbgbjbdFileId
}else if(fileType === 'xgd'){ }else if(fileType === 'xgd'){
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + this.xgdFileId window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + this.xgdFileId
@@ -43,6 +43,7 @@
<el-table-column <el-table-column
prop="partCode" prop="partCode"
label="章节编号" label="章节编号"
sortable
align="center" align="center"
width="180"> width="180">
</el-table-column> </el-table-column>