|
|
@@ -603,12 +603,16 @@
|
|
|
<el-card class="box-card" style="margin-top: 10px;">
|
|
|
<div slot="header" class="clearfix">
|
|
|
<span style="font-weight: bold">企业资质</span>
|
|
|
+ <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog" >添加</el-button>
|
|
|
</div>
|
|
|
<el-table :data="subfileList" border>
|
|
|
<el-table-column label="操作" width="150" align="center" fixed v-if="Status <= 0">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="primary" plain size="mini" title="文件变更" @click="openDialog(scope.row)">
|
|
|
变更</el-button>
|
|
|
+ <el-button type="danger" plain size="mini" title="文件删除" @click="delFile(scope.row)"
|
|
|
+ v-if="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>
|
|
|
@@ -838,6 +842,47 @@
|
|
|
<el-button type="primary" @click="makesure()">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog title="新增文件" :visible.sync="newVisible" top="5vh">
|
|
|
+ <el-form ref="newSubfileForm" :model="newSubfileForm" label-width="100px" :rules="newrules">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <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>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <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>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="描述">
|
|
|
+ <el-input v-model="newSubfileForm.OtherRemark" type="textarea" :rows=3 placeholder="请输入备注信息"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <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="newbeforeAvatarUpload">
|
|
|
+ <i class="el-icon-plus attach-uploader-icon"></i>
|
|
|
+ <div slot="tip" class="el-upload__tip">大小为512KB-5MB
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer" style="margin-top:-30px;">
|
|
|
+ <el-button @click="newVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="makeNewSure()">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<choose-auditor ref="chooseAuditor" @close="setAuditer" @hideChooseAuditer="chooseAuditorVisible=false"
|
|
|
:visible="chooseAuditorVisible"></choose-auditor>
|
|
|
<choose-auditor-fen ref="chooseAuditorFen" @close="setAuditerFen" @hideChooseAuditer="chooseAuditorVisibleFen=false"
|
|
|
@@ -870,6 +915,7 @@ import apiCert from '@/api/oilsupplier/suppliercert'
|
|
|
import axios from 'axios'
|
|
|
import uploadajax from '@/assets/js//uploadajax.js'
|
|
|
import fileapi from '@/api/oilsupplier/supplierfile'
|
|
|
+ import setapi from '@/api/oilsupplier/oilclassorgset'
|
|
|
|
|
|
export default {
|
|
|
computed: {
|
|
|
@@ -1038,6 +1084,34 @@ import apiCert from '@/api/oilsupplier/suppliercert'
|
|
|
}
|
|
|
}
|
|
|
return {
|
|
|
+ newVisible: false,
|
|
|
+ newSubfileForm: {
|
|
|
+ Id: '',
|
|
|
+ SupplierId: '',
|
|
|
+ SupplierTypeCode: '02',
|
|
|
+ SupplierCertSubId: '',
|
|
|
+ CertSubName: '',
|
|
|
+ SupType: 2,
|
|
|
+ NeedFileType: '',
|
|
|
+ NeedFileCode: '',
|
|
|
+ FileType: 66,
|
|
|
+ FileExt: '',
|
|
|
+ FileName: '',
|
|
|
+ EffectDate: new Date(),
|
|
|
+ FileUrl: '',
|
|
|
+ OtherRemark: '',
|
|
|
+ Remark: '',
|
|
|
+ IsDelete: 0,
|
|
|
+ FileUrlList: []
|
|
|
+ },
|
|
|
+ dynamicTableColumns: [],
|
|
|
+ newrules: {
|
|
|
+ NeedFileType: [
|
|
|
+ {required: true, message: '资质名称不能为空', trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ EffectDate:
|
|
|
+ [{ required: true, validator: effectDate, trigger: 'change' }]
|
|
|
+ },
|
|
|
IsCompanyUser: 0,
|
|
|
totalTab: 4,
|
|
|
activeName: '0',
|
|
|
@@ -1513,8 +1587,153 @@ import apiCert from '@/api/oilsupplier/suppliercert'
|
|
|
}
|
|
|
// this.orgtreeChange(this.majorDept)
|
|
|
this.getsubfile()
|
|
|
+ this.initTableHeader()
|
|
|
+ this.getFileDictOptions()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getFileDictOptions () {
|
|
|
+ api.getDictList(this.$axios).then(res => {
|
|
|
+ this.yasuoname = res.data.items['YaSuoName']
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 添加资质
|
|
|
+ initTableHeader () {
|
|
|
+ setapi.initBbTableHeader(this.$axios).then(res => {
|
|
|
+ this.dynamicTableColumns = res.data.items
|
|
|
+ })
|
|
|
+ },
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ },
|
|
|
+ makeNewSure () {
|
|
|
+ if (this.$refs.newrefuploadattach.uploadFiles && this.$refs.newrefuploadattach.uploadFiles.length > 0) {
|
|
|
+ // 上传附件是否完成判断
|
|
|
+ if (!this.newattachissuccess()) {
|
|
|
+ this.$message.error('有附件未成功上传!不能保存数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.newgetattachissuccess()
|
|
|
+ this.addSubfile()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请上传文件!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addSubfile () {
|
|
|
+ let _this = this
|
|
|
+ _this.newSubfileForm.SupplierId = parseInt(_this.serviceId)
|
|
|
+ _this.newSubfileForm.SupplierCertId = parseInt(_this.certId)
|
|
|
+
|
|
|
+ this.$refs['newSubfileForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ _this.$axios.post('/annualaudit/addqualchange/' + _this.annualId, _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
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ newattachissuccess () {
|
|
|
+ if (this.$refs.newrefuploadattach.uploadFiles && this.$refs.newrefuploadattach.uploadFiles.length > 0) {
|
|
|
+ for (let i = 0; i < this.$refs.newrefuploadattach.uploadFiles.length; i++) {
|
|
|
+ if (this.$refs.newrefuploadattach.uploadFiles[i].status !== 'success') {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ },
|
|
|
+ newgetattachissuccess () {
|
|
|
+ this.newSubfileForm.FileUrl = ''
|
|
|
+ this.newSubfileForm.FileName = ''
|
|
|
+ if (this.$refs.newrefuploadattach.uploadFiles && this.$refs.newrefuploadattach.uploadFiles.length > 0) {
|
|
|
+ for (let i = 0; i < this.$refs.newrefuploadattach.uploadFiles.length; i++) {
|
|
|
+ if (this.$refs.newrefuploadattach.uploadFiles[i].status === 'success') {
|
|
|
+ for (let j = 0; j < this.waituploads.length; j++) {
|
|
|
+ if (this.waituploads[j].uid === this.$refs.newrefuploadattach.uploadFiles[i].uid) {
|
|
|
+ this.newSubfileForm.FileUrl +=
|
|
|
+ `${this.waituploads[j].url}/${this.waituploads[j].fid}|${this.$refs.newrefuploadattach.uploadFiles[i].name}$`
|
|
|
+ this.newSubfileForm.FileName += `${this.$refs.newrefuploadattach.uploadFiles[i].name}$`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ delFile (row) {
|
|
|
+ let confirmmsg = '此操作将彻底删除该数据, 是否继续?'
|
|
|
+ this.$confirm(confirmmsg, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ annualapi.deleteAddfile(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(() => {})
|
|
|
+ },
|
|
|
+ showDialog () {
|
|
|
+ this.newVisible = true
|
|
|
+ this.newSubfileForm.NeedFileType = ''
|
|
|
+ this.newSubfileForm.EffectDate = ''
|
|
|
+ this.newSubfileForm.OtherRemark = ''
|
|
|
+ },
|
|
|
+
|
|
|
// Tab
|
|
|
nextTab () {
|
|
|
let valid = true
|
|
|
@@ -2419,7 +2638,6 @@ import apiCert from '@/api/oilsupplier/suppliercert'
|
|
|
MInfoId: this.annualId,
|
|
|
InfochangeForm: this.infochangeItemList
|
|
|
}
|
|
|
- console.log('----', AllInfochangeItemList)
|
|
|
annualapi.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
|
|
|
if (res.data.code === 0) {
|
|
|
// 保存成功后,初始化数据,变成修改
|