Browse Source

7.11晚提交

wlin1 5 years ago
parent
commit
591f3e54ba

+ 0 - 1
node_modules/.package_versions.json

@@ -1 +0,0 @@
-{}

+ 1 - 1
src/dashoo.cn/backend/api/main.go

@@ -19,7 +19,7 @@ func main() {
 	// Initialize casbin.
 	utils.InitCasbin()
 
-		//controllers.InitRedis()
+	//controllers.InitRedis()
 
 	// 定时任务
 	toolbox.TimingTask()

+ 24 - 3
src/dashoo.cn/frontend_web/package-lock.json

@@ -3174,9 +3174,9 @@
       "integrity": "sha512-VfPi+sE/1nEKOV7DWDqWSUGP7ztJG5FeqHbMEj6dBb/arKnxpOCnRXOSC6HBV6qTfK5v8CX7xWCqzN36UqG1oA=="
     },
     "element-ui": {
-      "version": "2.12.0",
-      "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.12.0.tgz",
-      "integrity": "sha512-DapyT0PW4i/1ETPHk8K8Qbe8B6hj10+dXsRTrOTFryV9wAs6e9mCxbV65awokyR2/v/KuIHJmqX+mH3wUa4rOQ==",
+      "version": "2.8.2",
+      "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.8.2.tgz",
+      "integrity": "sha512-LABKHKGUyewFNvpf9BQLecB659Wq0XYvyP1tBveZ4RWpdlPSylDfGW/RLvDYU7zuCBoRasdZAz7ryjOwq1lLNg==",
       "requires": {
         "async-validator": "~1.8.1",
         "babel-helper-vue-jsx-merge-props": "^2.0.0",
@@ -11944,6 +11944,22 @@
       "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
       "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
     },
+    "v-viewer": {
+      "version": "1.5.1",
+      "resolved": "https://registry.npmjs.org/v-viewer/-/v-viewer-1.5.1.tgz",
+      "integrity": "sha512-Q5ICKzmYQD0qTf+hti2Lhgy6UYY2zgFr+YrN9a3yPgr7pOjYrG405Pz4+6Z6FXlhdhGysCWFJUNCI2tsIyvjWQ==",
+      "requires": {
+        "throttle-debounce": "^2.0.1",
+        "viewerjs": "^1.5.0"
+      },
+      "dependencies": {
+        "throttle-debounce": {
+          "version": "2.2.1",
+          "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-2.2.1.tgz",
+          "integrity": "sha512-i9hAVld1f+woAiyNGqWelpDD5W1tpMroL3NofTz9xzwq6acWBlO2dC8k5EFSZepU6oOINtV5Q3aSPoRg7o4+fA=="
+        }
+      }
+    },
     "v8flags": {
       "version": "2.1.1",
       "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz",
@@ -11983,6 +11999,11 @@
         "extsprintf": "^1.2.0"
       }
     },
+    "viewerjs": {
+      "version": "1.6.1",
+      "resolved": "https://registry.npmjs.org/viewerjs/-/viewerjs-1.6.1.tgz",
+      "integrity": "sha512-2c6hURX1kaHNCluP0l+7nkI26/GBcQqpMRA4PGC3EsJ48lSpjYXK8C1pHC84q9kf4otANwxH2Nw8HAOk69ZTig=="
+    },
     "viewport-dimensions": {
       "version": "0.2.0",
       "resolved": "https://registry.npmjs.org/viewport-dimensions/-/viewport-dimensions-0.2.0.tgz",

+ 1 - 0
src/dashoo.cn/frontend_web/package.json

@@ -32,6 +32,7 @@
     "normalize.css": "^7.0.0",
     "nuxt": "^1.0.0",
     "store": "^2.0.12",
+    "v-viewer": "^1.5.1",
     "vue-chartjs": "^3.0.0",
     "vue-class-component": "^5.0.1",
     "vue-clipboards": "^1.1.0",

+ 42 - 6
src/dashoo.cn/frontend_web/src/components/oilsupplier/auditfilelist.vue

@@ -10,9 +10,21 @@
       </el-table-column> -->
       <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
       <!-- <el-table-column prop="NeedFileCode" label="分类编码" show-overflow-tooltip></el-table-column> -->
-      <el-table-column prop="FileName" label="文件名称" show-overflow-tooltip>
+      <el-table-column prop="FileUrlList" label="文件名称" show-overflow-tooltip>
         <template slot-scope="scope">
-            <el-link :href="'http://'+fileurlcut(scope.row.FileUrl)" target="_blank" type="primary">{{scope.row.FileName}}</el-link>
+ 
+            <!-- <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;">
+                    <img
+                      v-show="index==0 "
+                      class="photoStyle" alt=""
+                      :src="'http://'+fileurlcut(scope.row.FileUrl, index)"
+                      :key="index"
+                    >
+                    <p><el-link :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank" type="primary">
+                      {{scope.row.FileName.split('$')[index]}}</el-link>
+                    </p>
+              </div>
           </template>
       </el-table-column>
       <el-table-column prop="EffectDate" label="有效日期" show-overflow-tooltip>
@@ -105,6 +117,16 @@
   } from 'vuex'
   import axios from 'axios'
   import uploadajax from '../../assets/js/uploadajax.js'
+  // v-viewer
+  import Vue from 'vue';
+  import Viewer from 'v-viewer'
+  import 'viewerjs/dist/viewer.css'
+  Vue.use(Viewer)
+  Viewer.setDefaults({
+    Options: { 'inline': true, 'button': true, 'navbar': true, 'title': true, 'toolbar': true, 'tooltip': true, 'movable': true, 'zoomable': true, 'rotatable': true, 'scalable': true, 'transition': true, 'fullscreen': true, 'keyboard': true, 'url': 'data-source' }
+  })
+
+
   export default {
     name: 'SubfileList',
     props: {
@@ -160,7 +182,8 @@
           FileUrl: '',
           OtherRemark: '',
           Remark: '',
-          IsDelete: 0
+          IsDelete: 0,
+          FileUrlList: []
         },
         visible: false,
         selfVisible: this.visible, // 避免vue双向绑定警告
@@ -184,6 +207,12 @@
           .then(res => {
             _this.auditfileList = res.data.items
             _this.currentItemCount = res.data.currentItemCount
+
+             for (let idx in _this.auditfileList) {
+              _this.auditfileList[idx].FileUrlList = _this.auditfileList[idx].FileUrl.split('$')
+            }
+
+            console.log(_this.auditfileList)
           })
           .catch(err => {
             // handle error
@@ -365,8 +394,8 @@
         }
         _this.doclist.push(params)
       },
-      fileurlcut (val) {
-        let fileurlall = val
+      fileurlcut (val,index) {
+        let fileurlall = val.split('$')[index]
         let fileurl = fileurlall.split('|')
         let retUrl = fileurl[0]
         // 内网服务器专用
@@ -439,6 +468,9 @@
                   this.SubfileForm.FileUrl =
                     `${this.waituploads[j].url}/${this.waituploads[j].fid}|${this.$refs.refuploadattach.uploadFiles[i].name}`
                   this.SubfileForm.FileName = `${this.$refs.refuploadattach.uploadFiles[i].name}`
+                  // `${this.waituploads[j].url}/${this.waituploads[j].fid}|${this.$refs.refuploadattach.uploadFiles[i].FileUrlList}`
+                  // this.SubfileForm.FileName = `${this.$refs.refuploadattach.uploadFiles[i].FileUrlList}`
+                  alert(this.SubfileForm.FileName)
                 }
               }
             }
@@ -509,5 +541,9 @@
   .attach-uploader-icon:hover {
     color: #228B22;
   }
-
+  .photoStyle{
+    margin-top:6px;
+    width:140px;
+    height: 80px;
+  }
 </style>

+ 66 - 0
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist.vue

@@ -13,6 +13,15 @@
                      type="text"
                      @click="showDialog"
                      v-if="canadd || newcanadd">添加</el-button>
+          <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>
+                     
         </span>
       </div>
       <el-table :data="goodsList"
@@ -637,6 +646,63 @@ export default {
         .catch(() => {
           _this.Ids = []
         })
+    },
+    setManufacturer(index){
+      console.log(index)
+       if (this.Ids.length == 0) {
+        this.$message({
+          type: 'warning',
+          message: '请先选择设置的条目'
+        })
+        return
+      }
+
+      let _this = this
+      _this.$confirm('是否确定此操作, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          const delload = this.$loading({
+            lock: true,
+            text: '正在设置请稍后...'
+          })
+            // let params = {
+            //   SupplierId: parseInt(_this.SupplierId),
+            //   IsManufacturer: index
+            // }
+          _this.$axios.get('suppliercertsub/setmanufacturer/' + this.Ids.join() + "/" + parseInt(_this.SupplierId)
+          + "/"+index, {})
+            .then(function (response) {
+              if (response.data.code === 0) {
+                _this.$message({
+                  type: 'success',
+                  message: response.data.message
+                })
+                delload.close()
+                _this.Ids = []
+                _this.initData()
+              } else {
+                delload.close()
+                _this.Ids = []
+                _this.$message({
+                  type: 'warning',
+                  message: response.data.message
+                })
+              }
+            })
+            .catch(function (error) {
+              console.log(error)
+            })
+        })
+        .catch((ex) => {
+          console.error(ex)
+          _this.Ids = []
+        })
+
+
+
     },
     showDialog () {
       // this.getorgtreelist()

+ 122 - 12
src/dashoo.cn/frontend_web/src/components/oilsupplier/subfilelist.vue

@@ -74,11 +74,26 @@
         </template>
         </el-table-column>
         <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">
+          <template slot-scope="scope" >
+            <!-- <div v-for="(tmpUrl, index) in scope.row.FileUrlList" :key="index" class="pgotoStyle"> -->
+              <!-- <el-link :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank" type="primary">
+                {{scope.row.FileName.split('$')[index]}}</el-link> -->
+            <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="imgFormat(scope.row.FileUrl, index)" 
+                >
                 {{scope.row.FileName.split('$')[index]}}</el-link>
-            </div>
+               
+                <img
+                  v-else
+                  class="photoStyle" alt=""
+                  :src="'http://'+fileurlcut(scope.row.FileUrl, index)"
+                  :key="index"
+                 >
+              </div>
+            </viewer>
           </template>
         </el-table-column>
         <el-table-column prop="EffectDate" label="有效日期" show-overflow-tooltip>
@@ -115,16 +130,37 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="资质文件">
-              <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
+             <!-- <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-form-item>
-          </el-col>
+            <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="24">
             <el-form-item class="maintainlog" label="" label-width="120px">
               <div style="overflow: auto;">
@@ -162,6 +198,14 @@
   import BusinessList from '../../components/oilsupplier/businesslist'
   import setapi from '@/api/oilsupplier/oilclassorgset'
   import api from '@/api/oilsupplier/supplierfile'
+  // v-viewer
+  import Vue from 'vue';
+  import Viewer from 'v-viewer'
+  import 'viewerjs/dist/viewer.css'
+  Vue.use(Viewer)
+  Viewer.setDefaults({
+    Options: { 'inline': true, 'button': true, 'navbar': true, 'title': true, 'toolbar': true, 'tooltip': true, 'movable': true, 'zoomable': true, 'rotatable': true, 'scalable': true, 'transition': true, 'fullscreen': true, 'keyboard': true, 'url': 'data-source' }
+  })
 
   export default {
     name: 'SubfileList',
@@ -197,7 +241,9 @@
       ...mapGetters({
         session: 'session',
         authUser: 'authUser'
-      })
+      }),
+
+
     },
     data () {
       var effectDate = (rule, value, callback) => {
@@ -215,6 +261,9 @@
       }
 
       return {
+        dialogImageUrl: '',
+        dialogVisible: false,
+
         size: 10,
         currentPage: 1,
         currentItem_Count: 0,
@@ -287,6 +336,25 @@
       this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
     },
     methods: {
+      // 上传超过限制数
+      uploadExceed (files, fileList) {
+        if (fileList.length >= 5) {
+          this.$alert('超出上传照片数,禁止上传', '提示', {
+            confirmButtonText: '确定'
+          })
+        }
+      },
+       handleRemove(file) {
+        console.log(file);  
+      },
+      handlePictureCardPreview(file) {
+        this.dialogImageUrl = file.url;
+        this.dialogVisible = true;
+      },
+      handleDownload(file) {
+        console.log(file);
+      },
+
       pickerchange () {
         console.log(this.SubfileForm.EffectDate)
       },
@@ -345,8 +413,27 @@
             _this.subfileList = res.data.items
             _this.currentItemCount = res.data.currentItemCount
             for (let idx in _this.subfileList) {
-              _this.subfileList[idx].FileUrlList = _this.subfileList[idx].FileUrl.split('$')
+              // _this.subfileList[idx].FileUrlList = _this.subfileList[idx].FileUrl.split('$')
+
+              var urlList = _this.subfileList[idx].FileUrl.split('$')
+              // var img = urlList.find(fileurlall=>{
+              //   let fileurl = fileurlall.split('|')
+              //   let retUrl = fileurl[0]
+              //   let Format  = fileurl[1].split(".")
+              //   let pictureFormat = Format[1];
+              //   if("jpg"== pictureFormat ){
+              //       return true;
+              //   }
+              //   return false;
+              // })
+              // if(img != null && img != undefined){
+              //   urlList = urlList.filter(n=>n!=img)
+              //   urlList.unshift(img)
+              // }
+
+              _this.subfileList[idx].FileUrlList = urlList
             }
+
             this.getSupplierSceneFile()
           })
           .catch(err => {
@@ -541,6 +628,7 @@
       },
       showDialog () {
         // this.doclist = []
+        this.fileList = []
         this.IsMust = false
         this.Title = '新增文件'
         this.SubfileForm.Id = ''
@@ -719,6 +807,21 @@
       seachdata () {
         this.initData()
       },
+
+      imgFormat(val,index){
+        if(val !=null && val != undefined){
+          let fileurlall = val.split('$')[index]
+          let fileurl = fileurlall.split('|')
+          let retUrl = fileurl[0]
+          let Format  = fileurl[1].split(".")
+          let pictureFormat = Format[1];
+          if("jpg"== pictureFormat || "bmp" ==pictureFormat || "png" ==pictureFormat || "gif" ==pictureFormat|| "jpeg" ==pictureFormat){
+              return false;
+          }
+          return true;
+        }
+      },
+
       fileurlcut (val, index) {
         let fileurlall = val.split('$')[index]
         let fileurl = fileurlall.split('|')
@@ -728,7 +831,7 @@
           const myDomain = window.location.host
           retUrl = myDomain + '/' + retUrl
         }
-        return retUrl
+        return retUrl;
       },
       jstimehandle (val) {
         if (val === '') {
@@ -777,8 +880,10 @@
     position: relative;
     overflow: hidden;
     // margin-bottom: -17px;
-    margin-top: -15px;
-    margin-left: 20px
+    //margin-top: -15px;
+    //margin-left: 20px
+    margin-top: 0px;
+    margin-left: 0px
   }
 
   .attach-uploader .el-upload:hover {
@@ -798,4 +903,9 @@
     color: #228B22;
   }
 
+  .photoStyle{
+    margin-top:6px;
+    width:140px;
+    height: 60px;
+  }
 </style>

+ 74 - 8
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/auditoperation.vue

@@ -696,10 +696,27 @@
               <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
               <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>
-                  </div>
+                   <!-- <div v-for="(tmpUrl, index) in scope.row.OldFileUrlList" :key="index">
+                          <a :href="'http://'+fileurlcut(scope.row.OldFileUrl, index)" target="_blank"
+                          class="buttonText">{{scope.row.OldFileName.split('$')[index]}}</a>
+                          {{scope.row.OldFileUrl}}
+                        </div> -->
+                  <viewer :images="scope.row.OldFileUrlList">
+                    <div  v-for="(tmpUrl,index) in scope.row.OldFileUrlList" :key="index" style="vertical-align: middle;	text-align: center;">
+                    
+                      <el-link :href="'http://'+fileurlcut(scope.row.OldFileUrl, index)" target="_blank" type="primary"
+                        v-if="scope.row.OldFileUrl==''?false:imgFormat(scope.row.OldFileUrl, index)" 
+                      >
+                      {{scope.row.FileName.split('$')[index]}}</el-link>
+                    
+                      <img 
+                        v-if="scope.row.OldFileUrl==''?false:!imgFormat(scope.row.OldFileUrl, index)"
+                        class="photoStyle" alt=""
+                        :src="'http://'+fileurlcut(scope.row.OldFileUrl, index)"
+                        :key="index"
+                       >
+                     </div>
+                   </viewer>
                 </template>
               </el-table-column>
               <el-table-column prop="OldEffectDate" label="原有效日期" show-overflow-tooltip>
@@ -709,10 +726,30 @@
               </el-table-column>
               <el-table-column prop="FileUrlList" label="变更后文件" show-overflow-tooltip>
                 <template slot-scope="scope">
-                  <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
+                  
+                  <!-- <div v-for="(tmpUrl, index) in scope.row.FileUrlList" :key="index">
                     <a :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank"
                        class="buttonText">{{scope.row.FileName.split('$')[index]}}</a>
-                  </div>
+                  </div> -->
+                   <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>
+
+
+
                 </template>
               </el-table-column>
               <el-table-column prop="EffectDate" label="变更后有效日期" show-overflow-tooltip >
@@ -913,8 +950,16 @@
   import WfHistory from '@/components/workflow/wfmultihistory.vue'
   import ChooseAuditor from '@/components/oilsupplier/chooseauditor'
   import _ from 'lodash'
-
-  export default {
+  // v-viewer
+  import Vue from 'vue';
+  import Viewer from 'v-viewer'
+  import 'viewerjs/dist/viewer.css'
+  Vue.use(Viewer)
+  Viewer.setDefaults({
+    Options: { 'inline': true, 'button': true, 'navbar': true, 'title': true, 'toolbar': true, 'tooltip': true, 'movable': true, 'zoomable': true, 'rotatable': true, 'scalable': true, 'transition': true, 'fullscreen': true, 'keyboard': true, 'url': 'data-source' }
+  })
+
+export default {
     computed: {
       ...mapGetters({
         authUser: 'authUser'
@@ -1433,6 +1478,22 @@
       this.getsubfile()
     },
     methods: {
+
+      imgFormat(val,index){
+
+        if(val !=null && val != undefined && val !=''){
+            let fileurlall = val.split('$')[index]
+            let fileurl = fileurlall.split('|')
+            let retUrl = fileurl[0]
+            let Format  = fileurl[1].split(".")
+            let pictureFormat = Format[1];
+              if("jpg"== pictureFormat || "bmp" ==pictureFormat || "png" ==pictureFormat || "gif" ==pictureFormat|| "jpeg" ==pictureFormat){
+                  return false;
+              }
+              return true;
+            }
+       
+      },
       // Tab
       nextTab () {
         if (this.formData.AuditIndex > 0) {
@@ -2360,4 +2421,9 @@
       background-color: wheat;
     }
   }
+  .photoStyle{
+    margin-top:6px;
+    width:140px;
+    height: 80px;
+  }
 </style>

+ 59 - 4
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/basicauditoperation.vue

@@ -615,10 +615,28 @@
               <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
               <el-table-column prop="OldFileUrlList" label="原文件" show-overflow-tooltip>
                 <template slot-scope="scope">
-                  <div v-for="(tmpUrl, index) in scope.row.OldFileUrlList">
+                  <!-- <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>
-                  </div>
+                  </div> -->
+
+                  <viewer :images="scope.row.OldFileUrlList">
+                    <div  v-for="(tmpUrl,index) in scope.row.OldFileUrlList" :key="index" style="vertical-align: middle;	text-align: center;">
+                    
+                      <el-link :href="'http://'+fileurlcut(scope.row.OldFileUrl, index)" target="_blank" type="primary"
+                        v-if="scope.row.OldFileUrl==''?false:imgFormat(scope.row.OldFileUrl, index)" 
+                      >
+                      {{scope.row.FileName.split('$')[index]}}</el-link>
+                    
+                      <img 
+                        v-if="scope.row.OldFileUrl==''?false:!imgFormat(scope.row.OldFileUrl, index)"
+                        class="photoStyle" alt=""
+                        :src="'http://'+fileurlcut(scope.row.OldFileUrl, index)"
+                        :key="index"
+                       >
+                     </div>
+                   </viewer>
+
                 </template>
               </el-table-column>
               <el-table-column prop="OldEffectDate" label="原有效日期" show-overflow-tooltip>
@@ -628,10 +646,26 @@
               </el-table-column>
               <el-table-column prop="FileUrlList" label="变更后文件" show-overflow-tooltip>
                 <template slot-scope="scope">
-                  <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
+                  <!-- <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>
-                  </div>
+                  </div> -->
+                  <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>
                 </template>
               </el-table-column>
               <el-table-column prop="EffectDate" label="变更后有效日期" show-overflow-tooltip >
@@ -1332,6 +1366,22 @@
       this.getsubfile()
     },
     methods: {
+
+      imgFormat(val,index){
+
+        if(val !=null && val != undefined && val !=''){
+            let fileurlall = val.split('$')[index]
+            let fileurl = fileurlall.split('|')
+            let retUrl = fileurl[0]
+            let Format  = fileurl[1].split(".")
+            let pictureFormat = Format[1];
+              if("jpg"== pictureFormat || "bmp" ==pictureFormat || "png" ==pictureFormat || "gif" ==pictureFormat|| "jpeg" ==pictureFormat){
+                  return false;
+              }
+              return true;
+            }
+      },
+
       getFirAuditerByDept () {
         let deptid = this.authUser.Profile.DepartmentId
         this.userOptions = []
@@ -2154,4 +2204,9 @@
       background-color: wheat;
     }
   }
+  .photoStyle{
+    margin-top:6px;
+    width:140px;
+    height: 80px;
+  }  
 </style>

+ 11 - 3
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/goodsedit.vue

@@ -1410,15 +1410,23 @@ export default {
       api.getDictListByStatus(params, this.$axios).then(res => {
         this.dictData = res.data.items
         this.orgtreelist = window.toolfun_gettreejson(res.data.items['ProOrgList'], 'id', 'pId', 'id,name')
-        this.UnitOrgOptions = res.data.items['UnitOrgList']
-        this.UnitOrg = res.data.items['Register'].CheckUnitId
+        
+
+        var selectID = res.data.items['Register'].CheckUnitId;
+        var item     = res.data.items['UnitOrgList'].find(n=>n.Id == selectID)
+        var list     = res.data.items['UnitOrgList'].filter(n=>n.Id != selectID)
+
+        if(item !=null && item != undefined){
+          list.unshift(item);
+        }
+        this.UnitOrgOptions = list;
         this.allorgunitOptions = res.data.items['Allunitorglist']
         this.isInvestigate = res.data.items['isInvestigate'] === 'true'
         this.orgunitChange(this.UnitOrg)
         // this.auditerOptions = res.data.items['Auditer']
         // this.organizeOption = res.data.items['Organizes']
       }).catch(err => {
-        console.error(err)
+        console.log(err)
       })
     },
     // getorgtreelist() {