|
|
@@ -470,13 +470,16 @@
|
|
|
<el-card class="box-card" style="margin-top: 10px;">
|
|
|
<div slot="header" class="clearfix">
|
|
|
<span><i class="icon icon-table2"></i> 企业资质</span>
|
|
|
- <!--<el-button style="float: right; padding: 3px 0" type="text" @click="showDialog" >添加</el-button>-->
|
|
|
+ <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog" >添加</el-button>
|
|
|
</div>
|
|
|
<el-table :data="subfileList1" border>
|
|
|
<el-table-column label="操作" width="150" align="center" fixed>
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="primary" plain size="mini" title="文件变更" :disabled="formData.Status > 0" @click="openDialog(scope.row)">
|
|
|
变更</el-button>
|
|
|
+ <el-button type="danger" plain size="mini" title="文件删除" @click="delFile(scope.row)"
|
|
|
+ v-if="formData.Status <= 0 && scope.row.FileType == 0 && scope.row.OldFileUrl == ''">
|
|
|
+ 删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
|
|
|
@@ -730,10 +733,10 @@
|
|
|
:visible="chooseAuditorVisibleFen" typeCode="02"></choose-auditor-fen>
|
|
|
|
|
|
<el-dialog title="新增文件" :visible.sync="newVisible" top="5vh">
|
|
|
- <el-form :model="newSubfileForm" label-width="100px">
|
|
|
+ <el-form ref="newSubfileForm" :model="newSubfileForm" label-width="100px" :rules="rules">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="资质名称" required>
|
|
|
+ <el-form-item label="资质名称" prop="NeedFileType">
|
|
|
<el-select v-model="newSubfileForm.NeedFileType" placeholder="请输文件类型" size="medium">
|
|
|
<el-option v-for="item in dynamicTableColumns" :key="item.prop" :label="item.label" :value="item.label">
|
|
|
</el-option>
|
|
|
@@ -741,7 +744,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="有效日期" required>
|
|
|
+ <el-form-item label="有效日期" prop="EffectDate">
|
|
|
<el-date-picker style="width: 100%" v-model="newSubfileForm.EffectDate" type="date" placeholder="请选择有效日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
@@ -754,7 +757,7 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="资质文件">
|
|
|
<el-upload multiple style="margin-top: 10px;" action="" ref="newrefuploadattach"
|
|
|
- :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
|
|
|
+ :http-request="uploadrequest" class="attach-uploader" :before-upload="newbeforeAvatarUpload">
|
|
|
<i class="el-icon-plus attach-uploader-icon"></i>
|
|
|
<div slot="tip" class="el-upload__tip">大小为512KB-5MB
|
|
|
</div>
|
|
|
@@ -1410,6 +1413,7 @@
|
|
|
this.getBasisList() // 获取基建类层级列表
|
|
|
this.getSupplierList() // 获取供应方公司列表
|
|
|
this.getDictOptions()
|
|
|
+ this.getFileDictOptions()
|
|
|
this.getorgtreelist()
|
|
|
this.orgtreeChange(this.majorDept)
|
|
|
this.changeOrgUnit(this.selectDept)
|
|
|
@@ -1417,6 +1421,31 @@
|
|
|
//this.getsubfile()
|
|
|
},
|
|
|
methods: {
|
|
|
+ delFile (row) {
|
|
|
+ let confirmmsg = '此操作将彻底删除该数据, 是否继续?'
|
|
|
+ this.$confirm(confirmmsg, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ api2.delNewFile(row.Id, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ this.getsubfile()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+ },
|
|
|
// =======================================
|
|
|
getsubfile () {
|
|
|
let _this = this
|
|
|
@@ -1523,27 +1552,33 @@
|
|
|
},
|
|
|
addSubfile () {
|
|
|
let _this = this
|
|
|
- _this.newSubfileForm.SupplierId = parseInt(this.SupplierId)
|
|
|
- _this.$axios.post('/supplierfile/addsubfile/', _this.newSubfileForm)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- _this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
+ _this.newSubfileForm.SupplierId = parseInt(_this.formData.SupplierId)
|
|
|
+ _this.newSubfileForm.SupplierCertId = parseInt(_this.formData.SupplierCertId)
|
|
|
+
|
|
|
+ this.$refs['newSubfileForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ _this.$axios.post('/suppliercertappend/addqualchange/' + _this.Id, _this.newSubfileForm)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ this.newVisible = false
|
|
|
+ this.getsubfile()
|
|
|
+ this.$refs.newrefuploadattach.uploadFiles = []
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
- this.newVisible = false
|
|
|
- this.getsubfile()
|
|
|
- this.$refs.newrefuploadattach.uploadFiles = []
|
|
|
- } else {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: res.data.message
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
})
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
initTableHeader () {
|
|
|
setapi.initBbTableHeader(this.$axios).then(res => {
|
|
|
@@ -1552,6 +1587,9 @@
|
|
|
},
|
|
|
showDialog () {
|
|
|
this.newVisible = true
|
|
|
+ this.newSubfileForm.NeedFileType = ''
|
|
|
+ this.newSubfileForm.EffectDate = ''
|
|
|
+ this.newSubfileForm.OtherRemark = ''
|
|
|
},
|
|
|
newattachissuccess () {
|
|
|
if (this.$refs.newrefuploadattach.uploadFiles && this.$refs.newrefuploadattach.uploadFiles.length > 0) {
|
|
|
@@ -1667,6 +1705,13 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
+ getFileDictOptions () {
|
|
|
+ suppapi.getDictList(this.$axios).then(res => {
|
|
|
+ this.yasuoname = res.data.items['YaSuoName']
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
getDictOptions () {
|
|
|
let params = {
|
|
|
status: this.formData.Status,
|
|
|
@@ -1907,6 +1952,31 @@
|
|
|
return true
|
|
|
}
|
|
|
},
|
|
|
+ newbeforeAvatarUpload (file) {
|
|
|
+ let isLt512K = file.size / 1024 < 512
|
|
|
+ if (isLt512K) {
|
|
|
+ this.$message.error('上传文件大小不能小于 512KB!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (this.newSubfileForm.NeedFileType != this.yasuoname) {
|
|
|
+ if (file.type.indexOf('image') < 0) {
|
|
|
+ this.$message.error('上传图片!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let isLt50m = file.size / 1024 / 1024 / 5 < 1
|
|
|
+ if (!isLt50m) {
|
|
|
+ this.$message.error('上传文件大小不能超过 5MB!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ if (file.name.indexOf('.rar') < 0 && file.name.indexOf('.zip') < 0) {
|
|
|
+ this.$message.error('文件格式必须为rar或zip')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ },
|
|
|
uploadrequest (option) {
|
|
|
let _this = this
|
|
|
if (process.client) {
|