Sfoglia il codice sorgente

添加资质查询

lining 6 anni fa
parent
commit
728aa9942a

+ 45 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/select.go

@@ -6,6 +6,7 @@ import (
 	"dashoo.cn/backend/api/business/oilsupplier/qualchange"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertappend"
+	"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
 	"dashoo.cn/backend/api/business/register"
 	"encoding/json"
 	"fmt"
@@ -628,7 +629,51 @@ func (this *SelectController) GetAllBusinesList() {
 }
 
 
+// @Title 文件上传
+// @Description get user by tokenaddsubfile
+// @Success 200 {object} models.Userblood
+// @router /filelist [get]
+func (this *SelectController) FileList() {
+	page := this.GetPageInfoForm()
+	var list []supplierfile.OilSupplierFile
+	svc := supplierfile.GetSupplierfileService(utils.DBE)
+	where := " 1=1"
+	orderby := "Id"
+	asc := true
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+    subfilename := this.GetString("subfileName")
+
 
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "asc" {
+			asc = true
+		}
+	}
+
+	//企业用户必须加创建人条件
+	var registerUser register.OilCorporateInfo
+	var company supplier.OilSupplier
+
+	sql := " UserName='" + this.User.Username + "'"
+	svc.GetEntity(&registerUser,sql)
+	sql1:= " CreateUserId = '" + this.User.Id + "' or CommercialNo='"+registerUser.CommercialNo+"'"
+	svc.GetEntity(&company,sql1)
+
+	where = where + " and SupplierId=" + strconv.Itoa(company.Id)
+
+	if subfilename != "" {
+		where = where + " and NeedFileType like '%" + subfilename + "%'"
+	}
+
+	total := svc.GetPagingEntitiesWithoutAccCode(page.CurrentPage, page.Size, orderby, asc, &list, where)
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
 
 
 

+ 172 - 0
src/dashoo.cn/frontend_web/src/pages/select/components/subfilelist.vue

@@ -0,0 +1,172 @@
+<template>
+  <div>
+    <el-card class="box-card" style="margin-top: 10px;">
+      <div slot="header" class="clearfix">
+        <span style="font-weight: bold"> 企业资质</span>
+        <span style="float: right;">
+          <el-form ref="form" :inline="true" style="margin-top: -10px">
+            <el-form-item label="资质名称">
+              <el-input size="mini" v-model="searchForm.subfileName" placeholder="请输入资质名称" style="width: 100%"></el-input>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" size="mini" style="margin-left: 8px" @click="search">查询</el-button>
+            </el-form-item>
+          </el-form>
+        </span>
+      </div>
+      <el-table :data="subfileList" border size="mini">
+        <el-table-column prop="NeedFileType" label="资质名称" show-overflow-tooltip></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">
+                {{scope.row.FileName.split('$')[index]}}</el-link>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="EffectDate" label="有效日期" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{ jstimehandle(scope.row.EffectDate+'') }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="OtherRemark" label="描述" show-overflow-tooltip></el-table-column>
+      </el-table>
+      <el-pagination @size-change="handleSizeChange"
+                     @current-change="handleCurrentChange"
+                     :current-page="currentPage"
+                     :page-sizes="[10, 15, 20, 25]"
+                     :page-size="size"
+                     layout="total, sizes, prev, pager, next, jumper"
+                     :total="currentItemCount"></el-pagination>
+    </el-card>
+  </div>
+
+</template>
+
+<script>
+  import {
+    mapGetters
+  } from 'vuex'
+
+  export default {
+    name: 'SubfileList1',
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser'
+      })
+    },
+    data () {
+      return {
+        size: 10,
+        currentPage: 1,
+        currentItemCount: 0,
+        SupplierId: 0,
+
+        subfileList: [],
+
+        selectedorg: [],
+
+        Title: '',
+        searchForm: {
+          subfileName: ''
+        }
+
+      }
+    },
+    created () {
+      this.initData()
+    },
+    methods: {
+      search () {
+        this.initData()
+      },
+      initData () {
+        let _this = this
+        const params = {
+          SupplierId: this.SupplierId,
+          _currentPage: this.currentPage,
+          _size: this.size
+        }
+        Object.assign(params, this.searchForm)
+        _this.$axios.get('select/filelist', {
+          params
+        })
+          .then(res => {
+            _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('$')
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      fileurlcut (val, index) {
+        let fileurlall = val.split('$')[index]
+        let fileurl = fileurlall.split('|')
+        let retUrl = fileurl[0]
+        // 内网服务器专用
+        if (process.client && retUrl.indexOf('/upfile') === 0) {
+          const myDomain = window.location.host
+          retUrl = myDomain + '/' + retUrl
+        }
+        return retUrl
+      },
+
+      jstimehandle (val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T00:00:00Z') {
+          return '----'
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return '----'
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return '永久'
+        } else {
+          val = val.replace('T', ' ')
+          return val.substring(0, 10)
+        }
+      },
+      handleCurrentChange (value) {
+        this.currentPage = value
+        this.getbusList()
+      },
+      handleSizeChange (value) {
+        this.size = value
+        this.currentPage = 1
+        this.getbusList()
+      }
+    }
+  }
+</script>
+
+<style lang='scss'>
+  .attach-uploader .el-upload {
+    border: 1px dashed #63B8FF;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    // margin-bottom: -17px;
+    margin-top: -15px;
+    margin-left: 20px
+  }
+
+  .attach-uploader .el-upload:hover {
+    border-color: #228B22;
+  }
+
+  .attach-uploader-icon {
+    font-size: 25px;
+    color: #63B8FF;
+    width: 50px;
+    height: 50px;
+    line-height: 50px;
+    text-align: center;
+  }
+
+  .attach-uploader-icon:hover {
+    color: #228B22;
+  }
+
+</style>

+ 105 - 0
src/dashoo.cn/frontend_web/src/pages/select/subfileselect/index.vue

@@ -0,0 +1,105 @@
+<template>
+  <div>
+    <!--顶部显示-->
+    <el-breadcrumb class="heading">
+      <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
+      <el-breadcrumb-item>企业资质</el-breadcrumb-item>
+    </el-breadcrumb>
+
+    <!--内框顶部显示-->
+    <el-card class="box-card"
+             style="height: calc(100vh - 115px);position:relative">
+      <div slot="header">
+        <span>
+          <i class="icon icon-table2"></i> 资质查询
+        </span>
+        <subfile-list ref="subfileList"
+                      height="360px"
+                      style="margin-top: 20px"></subfile-list>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+
+<script>
+import {
+  mapGetters
+} from 'vuex'
+import SubfileList from '@/pages/select/components/subfilelist'
+
+export default {
+  components: {
+    SubfileList
+  },
+  computed: {
+    ...mapGetters({
+      authUser: 'authUser'
+    })
+  },
+  name: 'SubfileName',
+  data () {
+    return {
+
+      size: 10,
+      currentPage: 1,
+
+      subfileList: []
+
+    }
+  },
+  created () {
+    this.initData()
+  },
+  methods: {
+
+    initData () {
+      let _this = this
+      // _this.$refs['subfileList'].getvalue(1798)
+    },
+    jstimehandle (val) {
+      if (val === '') {
+        return '----'
+      } else if (val === '0001-01-01T08:00:00+08:00') {
+        return '----'
+      } else if (val === '5000-01-01T23:59:59+08:00') {
+        return '永久'
+      } else {
+        val = val.replace('T', ' ')
+        return val.substring(0, 10)
+      }
+    },
+
+    formatDateTime (date) {
+      var y = date.getFullYear()
+      var m = date.getMonth() + 1
+      m = m < 10 ? ('0' + m) : m
+      var d = date.getDate()
+      d = d < 10 ? ('0' + d) : d
+      // var h = date.getHours()
+      // var minute = date.getMinutes()
+      // minute = minute < 10 ? ('0' + minute) : minute
+      // return y + '-' + m + '-' + d + ' ' + h + ':' + minute
+      return y + '-' + m + '-' + d
+    }
+
+  }
+}
+</script>
+<style>
+.box-card1 {
+  margin-top: 5px;
+}
+.box-card1 .el-card__header {
+  padding: 9px 10px;
+}
+.box-card1 .el-card__body {
+  padding: 5px;
+}
+.box-card1 .el-form-item {
+  margin-bottom: 10px;
+}
+.certForm .el-form-item .el-form-item__label {
+  padding: 0px;
+}
+</style>