Răsfoiți Sursa

压缩包不控制大小

huahaiyan 6 ani în urmă
părinte
comite
4634ee6711

+ 18 - 3
src/dashoo.cn/backend/api/controllers/oilsupplier/supplierfile.go

@@ -1,7 +1,7 @@
 package oilsupplier
 
 import (
-	baseparameter "dashoo.cn/business2/parameter"
+	"dashoo.cn/business2/parameter"
 	"encoding/json"
 	"strconv"
 	"strings"
@@ -105,8 +105,6 @@ func (this *SupplierfileController) FileList() {
 	Order := this.GetString("Order")
 	Prop := this.GetString("Prop")
 
-
-
 	if Order != "" && Prop != "" {
 		orderby = Prop
 		if Order == "asc" {
@@ -185,6 +183,23 @@ func (this *SupplierfileController) AddSubfile() {
 	}
 }
 
+// @Title 获取字典列表
+// @Description get user by token
+// @Success 200 {object} map[string]interface{}
+// @router /dictlist [get]
+func (this *SupplierfileController) GetDictList() {
+	dictList := make(map[string]interface{})
+	var ysname string
+	paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
+	ysname = paramSvc.GetBaseparameterMessage("", "paramset", "YaSuoBao")
+	dictList["YaSuoName"] = ysname
+
+	var datainfo DataInfo
+	datainfo.Items = dictList
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
 // @Title 更新文件上传
 // @Description 更新文件上传
 // @Param	id	path	string	true

+ 46 - 33
src/dashoo.cn/frontend_web/src/components/oilsupplier/subfilelist.vue

@@ -3,10 +3,12 @@
     <el-card class="box-card" style="margin-top: 10px;">
       <div slot="header" class="clearfix">
         <span style="font-weight: bold">准入范围</span>
-        <el-button type="primary" size="mini" style="float: right;margin-right: 3px" @click="nextStep()" v-if="canadd && IsCompanyUser == 0">
+        <el-button type="primary" size="mini" style="float: right;margin-right: 3px" @click="nextStep()"
+          v-if="canadd && IsCompanyUser == 0">
           提交审批
         </el-button>
-        <el-button type="primary" size="mini" style="float: right;margin-right: 3px" @click="nextStep()" v-if="canadd && IsCompanyUser == 1">
+        <el-button type="primary" size="mini" style="float: right;margin-right: 3px" @click="nextStep()"
+          v-if="canadd && IsCompanyUser == 1">
           分办
         </el-button>
       </div>
@@ -35,7 +37,8 @@
         <el-table-column prop="FileUrlList" label="资质文件" show-overflow-tooltip>
           <template slot-scope="scope">
             <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
-              <el-link :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank" type="primary">{{scope.row.FileName.split('$')[index]}}</el-link>
+              <el-link :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank" type="primary">
+                {{scope.row.FileName.split('$')[index]}}</el-link>
             </div>
           </template>
         </el-table-column>
@@ -64,13 +67,9 @@
             <el-form-item label="资质名称" required>
               <!-- <el-input v-model="SubfileForm.NeedFileType" placeholder="请输文件类型"></el-input> -->
               <el-select v-model="SubfileForm.NeedFileType" placeholder="请输文件类型" size="medium">
-                <el-option
-                  v-for="item in dynamicTableColumns"
-                  :key="item.prop"
-                  :label="item.label"
-                  :value="item.label">
+                <el-option v-for="item in dynamicTableColumns" :key="item.prop" :label="item.label" :value="item.label">
                 </el-option>
-            </el-select>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -86,10 +85,11 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="资质文件">
-              <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach" :http-request="uploadrequest"
-                class="attach-uploader" :before-upload="beforeAvatarUpload">
+              <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
+                :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip">大小为512KB-5MB</div>
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">大小为512KB-5MB
+                </div>
               </el-upload>
             </el-form-item>
           </el-col>
@@ -129,6 +129,7 @@
   import uploadajax from '../../assets/js/uploadajax.js'
   import BusinessList from '../../components/oilsupplier/businesslist'
   import setapi from '@/api/oilsupplier/oilclassorgset'
+  import api from '@/api/oilsupplier/supplierfile'
 
   export default {
     name: 'SubfileList',
@@ -140,7 +141,7 @@
         type: Boolean,
         default: false
       },
-      flag:{
+      flag: {
         type: String
       },
     },
@@ -152,6 +153,7 @@
     },
     data() {
       return {
+        yasuoname: '',
         SupplierId: 0,
         SupplierTypeCode: '',
         SupplierCertId: 0,
@@ -192,27 +194,28 @@
 
         waituploads: [], // 等待上传的附件列表
         doclist: [],
-        dynamicTableColumns:[],
+        dynamicTableColumns: [],
         IsCompanyUser: '',
       }
     },
     created() {
+      this.getDictOptions()
       this.initTableHeader()
       this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
     },
     methods: {
-      initTableHeader(){
-        if(this.flag=='01'){
+      initTableHeader() {
+        if (this.flag == '01') {
           setapi.initGoodTableHeader(this.$axios).then(res => {
-          this.dynamicTableColumns=res.data.items
-        })
-        }else if(this.flag=='02'){
+            this.dynamicTableColumns = res.data.items
+          })
+        } else if (this.flag == '02') {
           setapi.initBbTableHeader(this.$axios).then(res => {
-          this.dynamicTableColumns=res.data.items
+            this.dynamicTableColumns = res.data.items
           })
-        }else{
+        } else {
           setapi.initTsTableHeader(this.$axios).then(res => {
-          this.dynamicTableColumns=res.data.items
+            this.dynamicTableColumns = res.data.items
           })
         }
 
@@ -399,6 +402,13 @@
           })
         }
       },
+      getDictOptions() {
+        api.getDictList(this.$axios).then(res => {
+          this.yasuoname = res.data.items['YaSuoName']
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       showDialog() {
         //this.doclist = []
         this.Title = '新增文件'
@@ -455,18 +465,21 @@
         _this.doclist.push(params)
       },
 
-      beforeAvatarUpload (file) {
+      beforeAvatarUpload(file) {
         /*let isLt512K = file.size / 1024 < 512
         if (isLt512K) {
           this.$message.error('上传文件大小不能小于 512KB!')
           return false
         }*/
-        let isLt50m = file.size / 1024 / 1024 / 5 < 1
-        if (!isLt50m) {
-          this.$message.error('上传文件大小不能超过 5MB!')
-          return false
+        if (this.SubfileForm.NeedFileType != this.yasuoname) {
+          let isLt50m = file.size / 1024 / 1024 / 5 < 1
+          if (!isLt50m) {
+            this.$message.error('上传文件大小不能超过 5MB!')
+            return false
+          }
+          return true
         }
-        return true
+
       },
       uploadrequest(option) {
         let _this = this
@@ -475,11 +488,11 @@
           axios.post(process.env.upfilehost, {})
             .then(function (res) {
               if (res.data && res.data.fid && res.data.fid !== '') {
-                  if ( res.data.publicUrl.indexOf('/upfile') === 0 ) {
-                    option.action = `http://${myDomain}/${res.data.publicUrl}/${res.data.fid}`
-                  } else {
-                    option.action = `http://${res.data.publicUrl}/${res.data.fid}`
-                  }
+                if (res.data.publicUrl.indexOf('/upfile') === 0) {
+                  option.action = `http://${myDomain}/${res.data.publicUrl}/${res.data.fid}`
+                } else {
+                  option.action = `http://${res.data.publicUrl}/${res.data.fid}`
+                }
 
                 _this.waituploads.push({
                   uid: option.file.uid,

+ 18 - 23
src/dashoo.cn/frontend_web/src/pages/oilsupplier/qualchange/_opera/operation.vue

@@ -46,7 +46,8 @@
         <el-table-column prop="OldFileUrlList" label="原文件" show-overflow-tooltip>
           <template slot-scope="scope">
             <div v-for="(tmpUrl, index) in scope.row.OldFileUrlList">
-              <a :href="'http://'+fileurlcut(scope.row.OldFileUrl, index)" target="_blank" class="buttonText"  >{{scope.row.OldFileName.split('$')[index]}}</a>
+              <a :href="'http://'+fileurlcut(scope.row.OldFileUrl, index)" target="_blank"
+                class="buttonText">{{scope.row.OldFileName.split('$')[index]}}</a>
             </div>
           </template>
           <!-- <template slot-scope="scope">
@@ -66,7 +67,8 @@
           </template> -->
           <template slot-scope="scope">
             <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
-              <a :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank" class="buttonText"  >{{scope.row.FileName.split('$')[index]}}</a>
+              <a :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank"
+                class="buttonText">{{scope.row.FileName.split('$')[index]}}</a>
             </div>
           </template>
         </el-table-column>
@@ -86,7 +88,7 @@
                 <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
                   :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
                   <i class="el-icon-plus attach-uploader-icon"></i>
-                  <div slot="tip" class="el-upload__tip">大小为512KB-5MB</div>
+                  <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">大小为512KB-5MB</div>
                 </el-upload>
                 <!-- <el-upload style="margin-top: 10px;" action="" ref="refuploadattach" :http-request="uploadrequest"
                   class="attach-uploader" :before-upload="beforeAvatarUpload">
@@ -163,6 +165,7 @@
   import axios from 'axios'
   import WfBackHistory from '@/components/workflow/wfbackhistory.vue'
   import ChooseAuditor from '@/components/oilsupplier/chooseauditor'
+  import fileapi from '@/api/oilsupplier/supplierfile'
   // import uploadajax from '../../assets/js/uploadajax.js'
   export default {
     computed: {
@@ -183,13 +186,14 @@
 
     data() {
       return {
+        yasuoname: '',
         audithistoryshow: false,
         backhistroy: {
           certId: '',
           classId: '05',
           workflowId: ''
         },
-        QualId:'',
+        QualId: '',
         chooseAuditorVisible: false,
         auditer: '',
         auditerName: '',
@@ -267,7 +271,6 @@
       // if (this.QualStatus > 0) {
       //   this.butnab = true
       // }
-      console.log("----this.QualStatus---", this.QualStatus)
       this.SupplierId = this.serviceId
       this.SupplierTypeCode = this.classId
       this.SupplierCertId = this.certId
@@ -290,15 +293,11 @@
           .then(res => {
             _this.subfileList = res.data.items
             _this.currentItemCount = res.data.currentItemCount
-            console.log("----this.subfileList---", this.subfileList)
             for (let idx in _this.subfileList) {
-              console.log(_this.subfileList[idx],"2222")
               _this.subfileList[idx].FileUrlList = _this.subfileList[idx].FileUrl.split('$')
 
             }
-            console.log("111-",_this.subfileList[0].FileUrlList)
             for (let idx1 in _this.subfileList) {
-              console.log(_this.subfileList[idx1],"1111")
               _this.subfileList[idx1].OldFileUrlList = _this.subfileList[idx1].OldFileUrl.split('$')
 
             }
@@ -323,9 +322,8 @@
           })
       },
       getDictOptions() {
-        api.getDictList(this.$axios).then(res => {
-          //this.wellNoOptions = res.data.items['WellNo']
-          //this.supervisersOptions = res.data.items['Supervisers']
+        fileapi.getDictList(this.$axios).then(res => {
+          this.yasuoname = res.data.items['YaSuoName']
         }).catch(err => {
           console.error(err)
         })
@@ -371,7 +369,6 @@
         _this.SubfileForm.SupplierId = parseInt(_this.SubfileForm.SupplierId)
         _this.SubfileForm.SupplierCertSubId = parseInt(_this.SubfileForm.SupplierCertSubId)
         _this.SubfileForm.SupplierCertId = parseInt(_this.SupplierCertId)
-        console.log("----this.SubfileForm---", this.SubfileForm)
         _this.$axios.put('/qualchange/editqualchange/' + _this.SubfileForm.Id, _this.SubfileForm)
           .then(res => {
             if (res.data.code === 0) {
@@ -394,7 +391,6 @@
           })
       },
       openDialog(val) {
-        console.log("======val----", val)
         this.Title = '资质变更'
         this.SubfileForm.Id = val.Id
         this.SubfileForm.SupplierId = val.SupplierId
@@ -432,18 +428,20 @@
         _this.doclist.push(params)
       },
 
-       beforeAvatarUpload (file) {
+      beforeAvatarUpload(file) {
         /*let isLt512K = file.size / 1024 < 512
         if (isLt512K) {
           this.$message.error('上传文件大小不能小于 512KB!')
           return false
         }*/
-        let isLt50m = file.size / 1024 / 1024 / 5 < 1
-        if (!isLt50m) {
-          this.$message.error('上传文件大小不能超过 5MB!')
-          return false
+        if (this.SubfileForm.NeedFileType != this.yasuoname) {
+          let isLt50m = file.size / 1024 / 1024 / 5 < 1
+          if (!isLt50m) {
+            this.$message.error('上传文件大小不能超过 5MB!')
+            return false
+          }
+          return true
         }
-        return true
       },
       uploadrequest(option) {
         let _this = this
@@ -505,7 +503,6 @@
       },
       addQualChangeAudit() {
         this.entityForm.auditer = this.auditer
-        console.log("==this.SupplierId====", this.SupplierId)
         quaapi.auditEntity(this.SupplierId, this.entityForm, this.$axios).then(res => {
           if (res.data.code === 0) {
             // 保存成功后,初始化数据,变成修改
@@ -538,9 +535,7 @@
 
       fileurlcut(val, index) {
         let fileurlall = val.split('$')[index]
-       // console.log("------fileurlall",fileurlall)
         let fileurl = fileurlall.split("|")
-       // console.log("------dileurl",fileurl)
         return fileurl[0]
       },
 

+ 40 - 31
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/basisdataopera.vue

@@ -35,14 +35,15 @@
         <el-card class="box-card">
           <div slot="header">
             <span><i class="icon icon-table2"></i> 增项信息</span>
-            <el-button style="float: right; padding: 3px 0" type="text" v-if="formData.Status <= 0 && formData.Status != -5" @click="saveEntity()">保存信息</el-button>
+            <el-button style="float: right; padding: 3px 0" type="text"
+              v-if="formData.Status <= 0 && formData.Status != -5" @click="saveEntity()">保存信息</el-button>
           </div>
           <el-form label-width="150px" ref="EntityForm" :rules="appendRules" :model="formData">
             <el-row>
               <el-col :span="8">
                 <el-form-item label="供应方公司名称" prop="checkSelectedSupplier">
-                  <el-select ref="suppselect" :disabled="formData.Status>0" v-model="supplierOptions" filterable @change="getInfo" placeholder="请选择供应方公司"
-                    style="width: 100%">
+                  <el-select ref="suppselect" :disabled="formData.Status>0" v-model="supplierOptions" filterable
+                    @change="getInfo" placeholder="请选择供应方公司" style="width: 100%">
                     <el-option v-for="item in supplierList" :key="item.SupplierId" :label="item.SupplierName"
                       :value="item.SupplierId">
                     </el-option>
@@ -51,7 +52,8 @@
               </el-col>
               <el-col :span="16">
                 <el-form-item label="备注" prop="Remark">
-                  <el-input :disabled="formData.Status>0" type="textarea" v-model="formData.Remark" placeholder="请输入"></el-input>
+                  <el-input :disabled="formData.Status>0" type="textarea" v-model="formData.Remark" placeholder="请输入">
+                  </el-input>
                 </el-form-item>
               </el-col>
             </el-row>
@@ -61,7 +63,8 @@
         <el-card class="box-card" style="margin-top: 10px;">
           <div slot="header">
             <span><i class="icon icon-table2"></i> 增项分类</span>
-            <el-button style="float: right; padding: 3px 0" type="text" v-if="formData.Status <= 0 && formData.Status != -5" @click="addSortData()">添加</el-button>
+            <el-button style="float: right; padding: 3px 0" type="text"
+              v-if="formData.Status <= 0 && formData.Status != -5" @click="addSortData()">添加</el-button>
           </div>
           <el-table :data="entityList" border style="width: 100%" @sort-change="orderby">
             <el-table-column label="操作" min-width="100" align="center" fixed>
@@ -132,10 +135,10 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="资质文件">
-              <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach" :http-request="uploadrequest"
-                class="attach-uploader" :before-upload="beforeAvatarUpload">
+              <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
+                :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip">大小为512KB-5MB</div>
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">大小为512KB-5MB</div>
               </el-upload>
             </el-form-item>
           </el-col>
@@ -260,6 +263,7 @@
   import uploadajax from '@/assets/js//uploadajax.js'
   import ChooseAuditor from '@/components/oilsupplier/chooseauditor'
   import WfBackHistory from '@/components/workflow/wfbackhistory.vue'
+  import fileapi from '@/api/oilsupplier/supplierfile'
 
   export default {
     components: {
@@ -289,6 +293,7 @@
         }
       }
       return {
+        yasuoname: '',
         auditbusList: [],
         audithistoryshow: false,
         chooseAuditorVisible: false,
@@ -365,7 +370,7 @@
           Step: 1,
           Type: '',
           Status: '',
-          SupplierName:'',
+          SupplierName: '',
           SupplierId: 0,
           SupplierCertId: 0,
           RecUnitFlag: '', //推荐单位的级联Id标记
@@ -465,6 +470,13 @@
             console.error(err)
           })
       },
+      getDictOptions() {
+        fileapi.getDictList(this.$axios).then(res => {
+          this.yasuoname = res.data.items['YaSuoName']
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       //获取资质文件
       getFileList() {
         this.SupplierId = this.formData.SupplierId
@@ -481,7 +493,6 @@
           })
           .then(res => {
             _this.subfileList = res.data.items
-            console.log("---this.subfileList---",this.subfileList)
             _this.currentItemCount = res.data.currentItemCount
             for (let idx in _this.subfileList) {
               console.log(_this.subfileList[idx])
@@ -493,17 +504,17 @@
           })
       },
       makesure() {
-          if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
-            // 上传附件是否完成判断
-            if (!this.attachissuccess()) {
-              this.$message.error('有附件未成功上传!不能保存数据')
-              return
-            }
-            this.getattachissuccess()
-            this.editSubfile()
-          } else {
-            this.editSubfile()
+        if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+          // 上传附件是否完成判断
+          if (!this.attachissuccess()) {
+            this.$message.error('有附件未成功上传!不能保存数据')
+            return
           }
+          this.getattachissuccess()
+          this.editSubfile()
+        } else {
+          this.editSubfile()
+        }
       },
       editSubfile() {
         let _this = this
@@ -569,18 +580,20 @@
         }
         _this.doclist.push(params)
       },
-      beforeAvatarUpload (file) {
+      beforeAvatarUpload(file) {
         /*let isLt512K = file.size / 1024 < 512
         if (isLt512K) {
           this.$message.error('上传文件大小不能小于 512KB!')
           return false
         }*/
-        let isLt50m = file.size / 1024 / 1024 / 5 < 1
-        if (!isLt50m) {
-          this.$message.error('上传文件大小不能超过 5MB!')
-          return false
+        if (this.SubfileForm.NeedFileType != this.yasuoname) {
+          let isLt50m = file.size / 1024 / 1024 / 5 < 1
+          if (!isLt50m) {
+            this.$message.error('上传文件大小不能超过 5MB!')
+            return false
+          }
+          return true
         }
-        return true
       },
       uploadrequest(option) {
         let _this = this
@@ -713,7 +726,6 @@
         let _this = this
         api2.getEntityById(_this.Id, _this.$axios).then(res => {
           _this.formData = res.data
-          console.log("---this.formData---", _this.formData)
           this.backhistroy.certId = _this.Id
           this.backhistroy.workflowId = _this.formData.WorkFlowId
           this.getFileList()
@@ -779,7 +791,6 @@
         //访问接口
         api.getList(params, this.$axios).then(res => {
           this.entityList = res.data.item
-          console.log("------res.entityList==--", this.entityList)
           // this.currentItemCount = res.data.currentItemCount
         }).catch(err => {
           console.error(err)
@@ -894,7 +905,7 @@
             type: 'warning'
           })
           .then(() => {
-            _this.$axios.delete('suppliercertsub/businessdelete/' +Id, {})
+            _this.$axios.delete('suppliercertsub/businessdelete/' + Id, {})
               .then(function (response) {
                 if (response.data.code === 0) {
                   _this.$message({
@@ -978,12 +989,10 @@
       },
       auditOrgChang(val) {
         let deptid = val[val.length - 1]
-        console.log(deptid)
         this.auditerOption = []
         let auditstepcode = 'FIRST_TRIAL'
         suppapi.getAuditerByDept(deptid, auditstepcode, this.$axios).then(res => {
           this.auditerOption = res.data.item
-          console.log("---this.auditerOption---", this.auditerOption)
         }).catch(err => {
           console.error(err)
         })