未符合项上传

This commit is contained in:
shen_yan_pu
2021-08-03 16:28:11 +08:00
parent 4c7f11a672
commit 28451a6343
3 changed files with 142 additions and 61 deletions
@@ -265,7 +265,7 @@
import ProcessHeader from '../../components/ProcessHeader'
import ProcessFooter from '../../components/ProcessFooter'
import ProcessTitle from '../../components/ProcessTitle'
import { startProcess, completeTask, saveTaskFirst } from '@/api/process.js'
import { startProcess, completeTask, saveTaskFirst, queryTaskFirst } from '@/api/process.js'
import { standUnqualified, dicTypeData } from '@/api/unqualProcess.js'
export default {
name: "wfhxzgStep1",
@@ -322,7 +322,23 @@ export default {
ProcessFooter,
ProcessTitle
},
mounted() {
this.bpnId = this.$route.query.bpnId
if (this.bpnId !== undefined) {
this.getData()
}
},
methods: {
getData() {
queryTaskFirst({
bpnId: this.$route.query.bpnId
}).then(res => {
let mes = JSON.parse(res.mes);
this.dataList = mes.dataList;
this.roleForm = mes.roleForm;
this.commentText = mes.commentText;
});
},
//点击新增事件
addList() {
dicTypeData().then(res => {
@@ -13,7 +13,7 @@
<ProcessTitle>
<template slot="title">基础信息</template>
</ProcessTitle>
<el-form :modal="nonSearch" inline class="label-input-form">
<!-- <el-form :modal="nonSearch" inline class="label-input-form">
<el-form-item label="标准号/标准名称" class="search-item">
<el-input
size="small"
@@ -78,7 +78,7 @@
清空
</el-button>
</el-form-item>
</el-form>
</el-form>-->
<el-table
:data="dataList"
border
@@ -87,6 +87,16 @@
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column prop="standSerialNumber" align="center" show-overflow-tooltip label="标准号">
<template slot-scope="scope">
<a class="table-jump" @click="handlePreview(scope.row)">{{ scope.row.standSerialNumber }}</a>
</template>
</el-table-column>
<el-table-column prop="standName" align="center" show-overflow-tooltip label="标准名称">
<template slot-scope="scope">
<a @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standName }}</a>
</template>
</el-table-column>
<el-table-column prop="productName" label="项目名称" align="center" show-overflow-tooltip/>
<el-table-column prop="itemsNum" label="条款号" align="center"/>
<el-table-column prop="itemsName" label="条款名称" align="center"/>
@@ -97,32 +107,30 @@
</el-table-column>
<el-table-column prop="responsibleUnit" label="责任部门" align="center"/>
<el-table-column prop="dutyPeople" label="负责人" align="center"/>
<el-table-column prop="info.fileText" label="佐证材料" align="center" show-overflow-tooltip width="150">
<el-table-column label="佐证材料" align="center" width="150">
<template slot-scope="scope">
<div style="display: inline;">
<el-input
disabled
style="display: none"
v-model="scope.row.fileText"
clearable
/>
<div v-if="scope.row.fileText" type="primary" @click="fileUpload(scope.row)" class="fileClass">
{{ scope.row.fileText }}
</div>
<div v-else>
<el-upload
multiple
ref="uploadFile"
:action="uploadPath"
name="file"
:file-list="fileTextList"
accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx"
:before-upload="handleBeforeUpload"
:before-remove="handleBeforeRemove"
:on-success="handleOnsuccess"
>
<el-button
type="primary"
class="common-button-primary"
@click="fileUpload(scope.row)"
@click="uploadFile(scope.row)"
size="mini">
点击上传
</el-button>
</div>
</div>
</el-upload>
</template>
</el-table-column>
</el-table>
<!-- <pagination :page="pageNo" :total="total" @pageChange="pageChange" @pageSizeChange="pageSizeChange"/>-->
</div>
<el-collapse accordion>
<el-collapse-item title="意见填写">
@@ -214,23 +222,6 @@
@submit="handleSubmit"
>
</ProcessFooter>
<el-dialog width='400px' :visible.sync="fileMadel" title="上传文件">
<el-upload
multiple
drag
:action="uploadPath"
ref="importfile"
name="file"
accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx"
:before-upload="handleBeforeUpload"
:on-success="handleOnsuccess"
>
<div style="padding: 20px 0">
<i class="el-icon-upload" style="color: #3399ff"></i>
<p>点击或拖拽上传文件</p>
</div>
</el-upload>
</el-dialog>
</div>
</template>
@@ -238,7 +229,7 @@
import ProcessHeader from '../../components/ProcessHeader'
import ProcessFooter from '../../components/ProcessFooter'
import ProcessTitle from '../../components/ProcessTitle'
import {interfaceUrl} from "@/sysConfig";
import {uploadFile} from '@/api/unqualProcess.js';
import {inboundLiaisonDetail, completeTask} from "@/api/process"
export default {
@@ -268,6 +259,8 @@ export default {
// 上传路径
uploadPath: 'api/att/attFile/upload',
fileMadel: false,
// 上传所储存文件数组
fileTextList: [],
newDataList: [],
// 责任部门
zNodesSItem: [],
@@ -315,12 +308,18 @@ export default {
this.$nextTick(() => {
this.dataList = [JSON.parse(JSON.stringify(item.responUserInfo.info))]
/*for (let i = 0; i<fileData.length; i++) {
if (fileData[i].name === this.$store.getters.userInfo.userName) {
this.dataList = fileData[i].standardInfoList
console.log(this.dataList)
this.newDataList = []
console.log(this.dataList)
this.dataList.forEach(item => {
if (item.fileText.length !== 0) {
item.fileText.forEach(item1 => {
this.fileTextList.push({
id: item1.id,
name: item1.name
})
})
}
}*/
})
})
},
@@ -328,16 +327,22 @@ export default {
this.active = name
},
/************ 上传佐证材料 *****************/
fileUpload (val) {
this.newDataList = val
this.fileMadel = true
uploadFile (val) {
this.fileListData = val
},
// 文件上传成功
handleOnsuccess(res, file, fileList) {
if (res.ok) {
this.newDataList.fileText = res.data.name
this.newDataList.fileTextId = res.data.id
this.newDataList.fileTextPath = res.data.filePath
this.newDataList.push({
id: res.data.attId,
name: res.data.standName
})
this.newDataList.forEach(item =>{
this.fileListData.fileText.push({
id: item.id,
name: item.name
})
})
this.$message({
showClose: true,
message: res.message,
@@ -374,13 +379,28 @@ export default {
return true
},
// 移除上传的文件
handleBeforeRemove() {},
handleOnRemove() {},
// 文件超过限制数量提示
handleExceed() {
this.$message.error(``)
handleBeforeRemove(file, fileList) {
this.fileTextList = fileList
this.newDataList.forEach((item, index) => {
if (file.name === item.name || file.id === item.id) {
this.newDataList.splice(index, 1)
}
})
},
/************ ********* *****************/
// 点击查看
handlePreview (item) {
let routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: item.standId,
pageType: 'FOREIGN_STAND'
// pageType: item.standType + '_STAND'
}
})
window.open(routeUrl.href, '_blank')
},
// 保存按钮
handleSave() {},
// 提交按钮
@@ -388,7 +408,7 @@ export default {
this.isSubmit = true
let flag=false
this.dataList.forEach(item => {
if (item.fileText === '') {
if (item.fileText.length === 0) {
flag=true
this.isSubmit = false
}
@@ -13,7 +13,7 @@
<ProcessTitle>
<template slot="title">基础信息</template>
</ProcessTitle>
<el-form :modal="nonSearch" inline class="label-input-form">
<!-- <el-form :modal="nonSearch" inline class="label-input-form">
<el-form-item label="标准号/标准名称" class="search-item">
<el-input
size="small"
@@ -78,7 +78,7 @@
清空
</el-button>
</el-form-item>
</el-form>
</el-form>-->
<el-table
:data="dataList"
border
@@ -87,6 +87,16 @@
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column prop="standSerialNumber" align="center" show-overflow-tooltip label="标准号">
<template slot-scope="scope">
<a class="table-jump" @click="handlePreview(scope.row)">{{ scope.row.standSerialNumber }}</a>
</template>
</el-table-column>
<el-table-column prop="standName" align="center" show-overflow-tooltip label="标准名称">
<template slot-scope="scope">
<a @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standName }}</a>
</template>
</el-table-column>
<el-table-column prop="productName" label="项目名称" align="center" show-overflow-tooltip/>
<el-table-column prop="itemsNum" label="条款号" align="center"/>
<el-table-column prop="itemsName" label="条款名称" align="center"/>
@@ -96,14 +106,19 @@
</template>
</el-table-column>
<el-table-column prop="responsibleUnit" label="责任部门" align="center"/>
<el-table-column prop="dutyEngineer" label="负责人" align="center"/>
<el-table-column label="佐证材料" align="center" show-overflow-tooltip>
<el-table-column prop="dutyPeople" label="负责人" align="center"/>
<el-table-column prop="fileText" label="佐证材料" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<el-button type="text" @click="download(scope.row)" >{{scope.row.fileText}}</el-button>
<el-upload
:action="''"
name="file"
:file-list="fileTextList"
:on-preview="handleOnPreview"
>
</el-upload>
</template>
</el-table-column>
</el-table>
<!-- <pagination :page="pageNo" :total="total" @pageChange="pageChange" @pageSizeChange="pageSizeChange"/>-->
</div>
<el-collapse accordion>
<el-collapse-item title="意见填写">
@@ -222,6 +237,7 @@ export default {
productName: '', // 项目名称
responsibleUnit: '' // 责任部门
},
fileTextList: [],
active: '1', // 默认显示
isSubmit: false,
backLoading: false,
@@ -281,13 +297,39 @@ export default {
getFormFieldList (item) {
this.$nextTick(() => {
this.dataList = JSON.parse(JSON.stringify(item)).info.fileDataList
this.dataList.forEach(item => {
item.fileText.forEach(item1 => {
this.fileTextList.push({
id: item1.id,
name: item1.name
})
})
})
})
},
handleTabs(name) {
this.active = name
},
// 点击查看
handlePreview (item) {
let routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: item.standId,
pageType: 'FOREIGN_STAND'
// pageType: item.standType + '_STAND'
}
})
window.open(routeUrl.href, '_blank')
},
// 点击上传的文件进行下载
handleOnPreview(file) {
let attId = file.id
if (attId != null && attId !== "") {
window.location.href = "/api/att/attFile/downloadFileForSar?fileId=" + attId;
}
},
// 提交按钮
handleSubmit() {
this.isSubmit = true
@@ -407,6 +449,9 @@ export default {
background: #E6A23C;
}
}
/deep/.el-upload{
display: block;
}
.content-center {
padding: 10px 0px 10px 10px;
}