Răsfoiți Sursa

增项添加资质

lining 5 ani în urmă
părinte
comite
5650a107c1

+ 2 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/badrecord.go

@@ -570,7 +570,7 @@ func (this *BadRecordController) SerachGoodsCertByCompany() {
 	sql = sql + " where a.SupplierId='"+companyId+"' and a.SupplierTypeCode='01' "+ sqlAdd +" order by a.CertSubStatus desc,a.Id asc limit "+ye+","+size+""
 	goodslist, _ = svc.DBE.QueryString(sql)
 
-	goodsTotal,_:=svc.GetCount(tempEntity,"SupplierId='"+companyId+"' and SupplierTypeCode='01' "+ sqlAdd +"")
+	goodsTotal,_:=svc.GetCount(tempEntity,"SupplierId='"+companyId+"' and SupplierTypeCode='01' "+ cwhere +"")
 
 	var datainfo DataInfo
 	datainfo.Items = goodslist
@@ -615,7 +615,7 @@ func (this *BadRecordController) SerachBasisCertByCompany() {
 	sql = sql + " where a.SupplierId='"+companyId+"' and a.SupplierTypeCode='02' "+ sqlAdd +" order by a.CertSubStatus desc,a.Id asc limit "+ye+","+size+""
 	basislist, _ = svc.DBE.QueryString(sql)
 
-	basisTotal,_:=svc.GetCount(tempEntity,"SupplierId='"+companyId+"' and SupplierTypeCode='02' "+ sqlAdd +"")
+	basisTotal,_:=svc.GetCount(tempEntity,"SupplierId='"+companyId+"' and SupplierTypeCode='02' "+ cwhere +"")
 	var datainfo DataInfo
 	datainfo.Items = basislist
 	datainfo.CurrentItemCount = basisTotal

+ 4 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

@@ -1279,6 +1279,10 @@ func (this *OilSupplierController) GetDictList() {
 	dictList["Supervisers"] = userSvc.GetUserListByDepartmentId(this.User.AccCode, userEntity.Departmentid)
 	dictList["GaodeMapChinaAreas"] = areaJsonSvc.GetGaodeMapChinaAreas()
 	dictList["CountryList"] = areaJsonSvc.GetCountryList()
+	var ysname string
+	paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
+	ysname = paramSvc.GetBaseparameterMessage("", "paramset", "YaSuoBao")
+	dictList["YaSuoName"] = ysname
 	//获取我创建的所有公司
 	var list []supplier.OilSupplier
 	if this.User.IsCompanyUser == 1 {

+ 94 - 24
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/basisdataopera.vue

@@ -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) {

+ 0 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/goodsdataopera.vue

@@ -1842,7 +1842,6 @@
         _this.newSubfileForm.SupplierId = parseInt(_this.formData.SupplierId)
         _this.newSubfileForm.SupplierCertId = parseInt(_this.formData.SupplierCertId)
         // _this.$axios.post('/supplierfile/addsubfile/', _this.newSubfileForm)
-        console.log(_this.newSubfileForm, '_this.newSubfileForm')
 
         this.$refs['newSubfileForm'].validate((valid) => {
           if (valid) {

+ 64 - 27
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/techdataopera.vue

@@ -461,13 +461,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="showDialog1">添加</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>
@@ -699,11 +702,11 @@
 
 
 
-  <el-dialog title="新增文件" :visible.sync="newVisible" top="5vh">
-      <el-form :model="newSubfileForm" label-width="100px">
+    <el-dialog title="新增文件" :visible.sync="newVisible" top="5vh">
+      <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>
@@ -711,7 +714,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>
@@ -724,7 +727,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="beforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
                 <div slot="tip" class="el-upload__tip">大小为512KB-5MB
                 </div>
@@ -1396,6 +1399,32 @@
       // 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
@@ -1502,27 +1531,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.initTsTableHeader(this.$axios).then(res => {
@@ -2646,8 +2681,10 @@
       },
 
       showDialog () {
-        this.getorgtreelist()
-        this.techDialog = true
+        this.newVisible = true
+        this.newSubfileForm.NeedFileType = ''
+        this.newSubfileForm.EffectDate = ''
+        this.newSubfileForm.OtherRemark = ''
       },
       getorgtreelist () {
         let _this = this

+ 21 - 23
src/dashoo.cn/frontend_web/src/pages/select/companyselect/index.vue

@@ -964,13 +964,8 @@
           <el-card class="box-card1"
                    shadow="never" v-if="TypeCode == '01'">
             <div slot="header">
-              <div style="width:100%;height:20px;margin-top:-20px">
-                <el-button type="primary"
-                           style="float:right;margin-top:6.5px"
-                           size="mini"
-                           @click="initCert($event)">查询</el-button>
                 <el-form :inline="true"
-                         style="float:right">
+                         style="float:right; margin-top: -20px">
                   <el-form-item label="准入范围名称">
                     <el-input size="mini"
                               style="width: 165px;"
@@ -986,8 +981,11 @@
                       <el-option label="暂停" value="2"></el-option>
                     </el-select>
                   </el-form-item>
+                  <el-button type="primary"
+                             style="float:right;margin-top:6.5px"
+                             size="mini"
+                             @click="initCert($event)">查询</el-button>
                 </el-form>
-              </div>
             </div>
             <el-table size="mini"
                       :data="goodsList"
@@ -1047,13 +1045,9 @@
           <el-card class="box-card1"
                    shadow="never" v-if="TypeCode == '02'">
             <div slot="header">
-              <div style="width:100%;height:20px;margin-top:-20px">
-                <el-button type="primary"
-                           style="float:right;margin-top:6.5px"
-                           size="mini"
-                           @click="initCert($event)">查询</el-button>
+              <!--<div style="width:100%;height:20px;margin-top:-20px">-->
                 <el-form :inline="true"
-                         style="float:right">
+                         style="float:right; margin-top: -20px">
                   <el-form-item label="准入范围名称">
                     <el-input size="mini"
                               style="width: 165px;"
@@ -1069,9 +1063,13 @@
                       <el-option label="暂停" value="2"></el-option>
                     </el-select>
                   </el-form-item>
+                  <el-button type="primary"
+                             style="float:right;margin-top:6.5px"
+                             size="mini"
+                             @click="initCert($event)">查询</el-button>
                 </el-form>
               </div>
-            </div>
+            <!--</div>-->
             <el-table size="mini"
                       :data="basisList"
                       border
@@ -1130,13 +1128,9 @@
           <el-card class="box-card1"
                    shadow="never" v-if="TypeCode == '03'">
             <div slot="header">
-              <div style="width:100%;height:20px;margin-top:-20px">
-                <el-button type="primary"
-                           style="float:right;margin-top:6.5px"
-                           size="mini"
-                           @click="initCert($event)">查询</el-button>
+              <!--<div style="width:100%;height:20px;margin-top:-20px">-->
                 <el-form :inline="true"
-                         style="float:right">
+                         style="float:right; margin-top: -20px">
                   <el-form-item label="准入范围名称">
                     <el-input size="mini"
                               style="width: 165px;"
@@ -1152,8 +1146,12 @@
                       <el-option label="暂停" value="2"></el-option>
                     </el-select>
                   </el-form-item>
+                  <el-button type="primary"
+                             style="float:right;margin-top:6.5px"
+                             size="mini"
+                             @click="initCert($event)">查询</el-button>
                 </el-form>
-              </div>
+              <!--</div>-->
             </div>
             <el-table size="mini"
                       :data="tcList"
@@ -1456,9 +1454,9 @@ export default {
 
   methods: {
     initCert (event) {
-      if (this.activeName === 'first') {
+      if (this.TypeCode === '01') {
         this.serachGoodsCertByCompany(event)
-      } else if (this.activeName === 'second') {
+      } else if (this.TypeCode === '02') {
         this.serachBasisCertByCompany(event)
       } else {
         this.serachTCCertByCompany(event)