2
3
فهرست منبع

修改上传资质 图片预览, 修改 设置是否为制造商 样式

wlin1 5 سال پیش
والد
کامیت
45d3c7e85a

+ 35 - 2
src/dashoo.cn/frontend_web/src/components/oilsupplier/auditfilelist.vue

@@ -14,7 +14,23 @@
         <template slot-scope="scope">
  
             <!-- <el-link :href="'http://'+fileurlcut(scope.row.FileUrl)" target="_blank" type="primary">{{scope.row.FileName}}</el-link> -->
-              <div  v-for="(tmpUrl,index) in scope.row.FileUrlList" :key="index" style="vertical-align: middle;	text-align: center;">
+            
+              <viewer :images="scope.row.FileUrlList">
+                    <div  v-for="(tmpUrl,index) in scope.row.FileUrlList" :key="index" style="vertical-align: middle;	text-align: center;">
+                    
+                      <el-link :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank" type="primary"
+                        v-if="scope.row.FileUrl==''?false:imgFormat(scope.row.FileUrl, index)" 
+                      >
+                      {{scope.row.FileName.split('$')[index]}}</el-link>
+                      <img 
+                        v-if="scope.row.FileUrl==''?false:!imgFormat(scope.row.FileUrl, index)"
+                        class="photoStyle" alt=""
+                        :src="'http://'+fileurlcut(scope.row.FileUrl, index)"
+                        :key="index"
+                       >
+                     </div>
+                   </viewer>
+              <!-- <div  v-for="(tmpUrl,index) in scope.row.FileUrlList" :key="index" style="vertical-align: middle;	text-align: center;">
                     <img
                       v-show="index==0 "
                       class="photoStyle" alt=""
@@ -24,7 +40,7 @@
                     <p><el-link :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank" type="primary">
                       {{scope.row.FileName.split('$')[index]}}</el-link>
                     </p>
-              </div>
+              </div> -->
           </template>
       </el-table-column>
       <el-table-column prop="EffectDate" label="有效日期" show-overflow-tooltip>
@@ -193,6 +209,23 @@
       }
     },
     methods: {
+
+      imgFormat(val,index){
+        if(val !=null && val != undefined && val !=''){
+          let fileurlall = val.split('$')[index]
+          let fileurl = fileurlall.split('|')
+          if(fileurl[1] != null && fileurl[1] !='' && fileurl[1] != undefined){
+            let Format  = fileurl[1].split(".")
+            if(Format[1]!=null && Format[1] !='' && Format[1] != undefined){
+               let pictureFormat = Format[1];
+              if("jpg"== pictureFormat || "bmp" ==pictureFormat || "png" ==pictureFormat || "gif" ==pictureFormat|| "jpeg" ==pictureFormat){
+                return false;
+              }
+            }
+          }
+          return true;
+        }
+      },
       initData () {
         let _this = this
         const params = {

+ 18 - 4
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist.vue

@@ -13,14 +13,14 @@
                      type="text"
                      @click="showDialog"
                      v-if="canadd || newcanadd">添加</el-button>
-          <el-button style="float: right; padding: 3px 0px"
+          <!-- <el-button style="float: right; padding: 3px 0px"
                      type="text"
                      @click="setManufacturer(2)"
-                     >设置制造商</el-button>
+                     >设置制造商1</el-button>
           <el-button style="float: right; padding: 3px 25px"
                      type="text"
                      @click="setManufacturer(1)"
-                     >设置非制造商</el-button>
+                     >设置非制造商</el-button> -->
                      
         </span>
       </div>
@@ -49,12 +49,26 @@
             <span v-if="scope.row.GoodsLevel=='2'">二级</span>
           </template>
         </el-table-column>
-        <el-table-column label="是否为制造商" width="105">
+        <el-table-column align="right" width="245">
+          <template slot="header" slot-scope="scope">
+          <!-- <el-input v-model="search" size="mini" placeholder="输入关键字搜索"/> -->
+            <el-button-group>
+            <el-button type="primary" size="small" @click="setManufacturer(2)">设置制造商</el-button>
+            <el-button type="primary" size="small" @click="setManufacturer(1)">设置非制造商<i class="el-icon--right"></i></el-button>
+            </el-button-group>
+          </template>
+
           <template slot-scope="scope">
             <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 2" @click="type_change(scope.row,canadd,newcanadd)" :disabled="isDisabledBtn()">非制造商</el-button>
             <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 1" @click="type_change(scope.row,canadd,newcanadd)" :disabled="isDisabledBtn()">制造商</el-button>
           </template>
         </el-table-column>
+        <!-- <el-table-column label="是否为制造商" width="105">
+          <template slot-scope="scope">
+            <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 2" @click="type_change(scope.row,canadd,newcanadd)" :disabled="isDisabledBtn()">非制造商</el-button>
+            <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 1" @click="type_change(scope.row,canadd,newcanadd)" :disabled="isDisabledBtn()">制造商</el-button>
+          </template>
+        </el-table-column> -->
         <el-table-column prop="CertSubStatus"
                          label="状态"
                          show-overflow-tooltip>

+ 18 - 3
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist2.vue

@@ -13,14 +13,14 @@
                      type="text"
                      @click="showDialog"
                      v-if="canadd || newcanadd">添加</el-button>
-          <el-button style="float: right; padding: 3px 0px"
+          <!-- <el-button style="float: right; padding: 3px 0px"
                      type="text"
                      @click="setManufacturer(2)"
                      >设置制造商</el-button>
           <el-button style="float: right; padding: 3px 25px"
                      type="text"
                      @click="setManufacturer(1)"
-                     >设置非制造商</el-button>
+                     >设置非制造商123</el-button> -->
         </span>
       </div>
       <el-table :data="goodsList"
@@ -48,12 +48,27 @@
             <span v-if="scope.row.GoodsLevel=='2'">二级</span>
           </template>
         </el-table-column>
-        <el-table-column label="是否为制造商" width="105">
+
+        <el-table-column align="right" width="245">
+          <template slot="header" slot-scope="scope">
+            <!-- <el-input v-model="search" size="mini" placeholder="输入关键字搜索"/> -->
+            <el-button-group>
+              <el-button type="primary" size="small" @click="setManufacturer(2)">设置制造商</el-button>
+              <el-button type="primary" size="small" @click="setManufacturer(1)">设置非制造商<i class="el-icon--right"></i></el-button>
+            </el-button-group>
+          </template>
+
           <template slot-scope="scope">
             <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 2" @click="type_change(scope.row,canadd,newcanadd)" :disabled="isDisabledBtn()">非制造商</el-button>
             <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 1" @click="type_change(scope.row,canadd,newcanadd)" :disabled="isDisabledBtn()">制造商</el-button>
           </template>
         </el-table-column>
+        <!-- <el-table-column label="是否为制造商" width="105">
+          <template slot-scope="scope">
+            <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 2" @click="type_change(scope.row,canadd,newcanadd)" :disabled="isDisabledBtn()">非制造商</el-button>
+            <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 1" @click="type_change(scope.row,canadd,newcanadd)" :disabled="isDisabledBtn()">制造商</el-button>
+          </template>
+        </el-table-column> -->
         <el-table-column prop="CertSubStatus"
                          label="状态"
                          show-overflow-tooltip>

+ 57 - 4
src/dashoo.cn/frontend_web/src/components/oilsupplier/subfilelist2.vue

@@ -81,18 +81,54 @@
               <el-input v-model="SubfileForm.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="refuploadattach"
+                 :on-remove="filremove" :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload" :file-list="fileList">
+                <i class="el-icon-plus attach-uploader-icon"></i>
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">请上传图片(大小为512KB-5MB),可上传多张图片
+                </div>
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType ==yasuoname">请上传压缩文件
+                </div>
+              </el-upload>  -->
+              <el-upload 
+                :multiple="false" style="margin-top: 10px;" class="attach-uploader"
+                action=""
+                :before-upload="beforeAvatarUpload"
+                :on-preview="handlePictureCardPreview"
+                list-type="picture-card"
+                ref="refuploadattach"
+                :file-list="fileList"
+                :on-remove="filremove"
+                :http-request="uploadrequest"
+                limit = "5"
+                :on-exceed="uploadExceed">
+                <i class="el-icon-plus"></i>
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">请上传图片(大小为512KB-5MB),最多可上传五张图片
+                </div>
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType ==yasuoname">请上传压缩文件
+                </div>
+              </el-upload>
+            <el-dialog :visible.sync="dialogVisible" :modal="false">
+          <img width="100%" style="z-index:9999" :src="dialogImageUrl" alt="">
+        </el-dialog>
+      </el-form-item>
+    </el-col>
+
+
+          <!-- <el-col :span="12">
             <el-form-item label="资质文件">
               <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
                          :on-remove="filremove" :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload" :file-list="fileList">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">请上传图片(大小为512KB-5MB),可上传多张图片
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">123请上传图片(大小为512KB-5MB),可上传多张图片
                 </div>
                 <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType ==yasuoname">请上传压缩文件
                 </div>
               </el-upload>
             </el-form-item>
-          </el-col>
+          </el-col> -->
         </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer" style="margin-top:-30px;">
@@ -178,6 +214,8 @@
       }
 
       return {
+        dialogImageUrl: '',
+        dialogVisible: false,
         size: 10,
         currentPage: 1,
         currentItem_Count: 0,
@@ -250,6 +288,14 @@
       this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
     },
     methods: {
+      // 上传超过限制数
+      uploadExceed (files, fileList) {
+        if (fileList.length >= 5) {
+          this.$alert('超出上传照片数,禁止上传', '提示', {
+            confirmButtonText: '确定'
+          })
+        }
+      },
       imgFormat(val,index){
         if(val !=null && val != undefined && val !=''){
           let fileurlall = val.split('$')[index]
@@ -266,6 +312,13 @@
           return true;
         }
       },
+      handleRemove(file, fileList) {
+        console.log(file, fileList);
+      },
+      handlePictureCardPreview(file) {
+        this.dialogImageUrl = file.url;
+        this.dialogVisible = true;
+      },
       pickerchange () {
         console.log(this.SubfileForm.EffectDate)
       },
@@ -757,8 +810,8 @@
     position: relative;
     overflow: hidden;
     // margin-bottom: -17px;
-    margin-top: -15px;
-    margin-left: 20px
+    margin-top: 0px;
+    margin-left: 0px
   }
 
   .attach-uploader .el-upload:hover {