Browse Source

前端: 目录查询 模块仅提供可查询的入口,移除管理维护相关的入口。

baichengfei 5 years ago
parent
commit
89f97c32f3

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/oilcatalog/income.vue

@@ -117,7 +117,7 @@
         </el-col>
           <el-col :span="24">
             <el-form-item label="申请备案范围" prop="RecordScope">
-              <el-input v-model="formData.RecordScope"  type="textarea" style="width: 100%"></el-input>
+              <el-input v-model="formData.RecordScope"  type="textarea" :autosize="{ minRow: 3}" style="width: 100%"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="24">

+ 8 - 7
src/dashoo.cn/frontend_web/src/pages/oilsupplier/oilcatalog/index.vue

@@ -48,7 +48,7 @@
           </el-form-item>
         </el-form>
       </div>
-      <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby" size="mini" v-loading="tableLoading">
+      <el-table :data="entityList" border highlight-current-row stripe height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby" size="mini" v-loading="tableLoading">
         <el-table-column label="操作" min-width="100px" align="center" fixed="right">
           <template slot-scope="scope">
             <el-button type="primary" size="mini" @click="editOilcatalog(scope.row)" plain>{{btnName}}</el-button>
@@ -70,15 +70,16 @@
         </el-table-column>
         <el-table-column type="index" width="50" align="center" />
         <!--<el-table-column sortable min-width="80" align="center" show-overflow-tooltip prop="SupplierName" label="序号"></el-table-column>-->
-        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="CompanyName" label="企业名称"></el-table-column>
-        <el-table-column sortable width="400" align="center" show-overflow-tooltip prop="Business" label="业务范围"></el-table-column>
-        <el-table-column sortable width="180" align="center" show-overflow-tooltip label="有效期起止">
+        <el-table-column sortable width="200" align="center" show-overflow-tooltip prop="CompanyName" label="企业名称"></el-table-column>
+        <el-table-column sortable min-width="400" align="center" show-overflow-tooltip prop="Business" label="业务范围"></el-table-column>
+        <el-table-column sortable width="175" align="center" show-overflow-tooltip label="有效期起止">
           <template slot-scope="scope">
             {{(jstimehandle(scope.row.ValidityFrom))}}--{{(jstimehandle(scope.row.ValidityTo))}}
           </template>
         </el-table-column>
-        <el-table-column sortable width="120" align="center" :key="Math.random()" v-if="formData.CatalogType == 4 || formData.CatalogType == 5" show-overflow-tooltip prop="DutyDept" label="责任部室"></el-table-column>
-        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="Remark" label="备注"></el-table-column>
+        <el-table-column sortable min-width="90" align="center" :key="Math.random()" v-if="formData.CatalogType == 4 || formData.CatalogType == 5" show-overflow-tooltip prop="DutyDept" label="责任部室"></el-table-column>
+        <el-table-column sortable width="120" align="center" :key="Math.random()" v-if="formData.CatalogType == 6 || formData.CatalogType == 7" show-overflow-tooltip prop="Dept" label="申报单位"></el-table-column>
+        <el-table-column sortable min-width="60" align="center" show-overflow-tooltip prop="Remark" label="备注"></el-table-column>
 
       </el-table>
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
@@ -103,7 +104,7 @@
           </el-col>
           <el-col :span="24">
             <el-form-item label="业务范围" prop="Business" :rules="{ required: true, message: '营业范围不能为空', trigger: 'blur'}">
-              <el-input v-model="formData.Business"  type="textarea" style="width: 100%" :readonly="!showBtn"></el-input>
+              <el-input v-model="formData.Business"  type="textarea" :autosize="{ minRows: 3}" style="width: 100%" :readonly="!showBtn"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="24" v-if="formData.CatalogType == 4 || formData.CatalogType == 5">

+ 462 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/oilcatalogselect/income.vue

@@ -0,0 +1,462 @@
+<template>
+  <div>
+    <el-breadcrumb class="heading">
+      <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
+      <el-breadcrumb-item>{{cardTitle}}目录</el-breadcrumb-item>
+    </el-breadcrumb>
+    <el-card class="box-card" style="height: calc(100vh - 115px);" v-loading="loading">
+      <div slot="header">
+        <span>
+          <i class="icon icon-table2"></i> {{cardTitle}}目录
+        </span>
+        <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
+          <el-form-item label="时间">
+            <el-date-picker size="mini" style="width: 220px" clearable v-model="CreateOn" type="daterange" range-separator="至"
+                            start-placeholder="有效期" end-placeholder="有效期"></el-date-picker>
+          </el-form-item>
+          <el-form-item label="企业名称">
+            <el-input size="mini" clearable v-model="searchForm.CompanyName" style="width:100%" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="业务范围">
+            <el-input size="mini" clearable v-model="searchForm.Business" :autosize="{ minRows: 3}" style="width:100%" placeholder="请输入"></el-input>
+          </el-form-item>
+          <!--<el-form-item label="准入类型">-->
+            <!--<el-select size="mini" style="width:100px" v-model="searchForm.SupplierTypeName" placeholder="准入类别">-->
+              <!--<el-option label="全部" value=""></el-option>-->
+              <!--<el-option label="物资类" value="物资类"></el-option>-->
+              <!--<el-option label="基建类" value="基建类"></el-option>-->
+              <!--<el-option label="服务类" value="服务类"></el-option>-->
+            <!--</el-select>-->
+          <!--</el-form-item>-->
+
+          <el-form-item>
+            <el-dropdown split-button type="primary" size="mini" @click="handleSearch" @command="searchCommand">
+              查询
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item command="clear">查询重置</el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+      <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby" size="mini" v-loading="tableLoading">
+        <el-table-column label="操作" min-width="100px" align="center" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="primary" size="mini" @click="editOilcatalog(scope.row)" plain>查看</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column type="index" width="50" align="center" />
+        <!--<el-table-column sortable min-width="80" align="center" show-overflow-tooltip prop="SupplierName" label="序号"></el-table-column>-->
+        <el-table-column sortable min-width="220" align="center" show-overflow-tooltip prop="CompanyName" label="企业名称"></el-table-column>
+        <el-table-column sortable width="100" align="center" show-overflow-tooltip prop="LegalPerson" label="法人姓名"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="IDCode" label="法人身份证号"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="Address" label="企业注册地址"></el-table-column>
+        <el-table-column sortable min-width="150" align="center" show-overflow-tooltip prop="USCCode" label="全国统一信用代码"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="RegCapital" label="注册资本"></el-table-column>
+        <el-table-column sortable min-width="300" align="center" show-overflow-tooltip prop="RecordScope" label="申请备案范围"></el-table-column>
+        <el-table-column sortable width="120" align="center" :key="Math.random()" v-if="formData.CatalogType == 6 || formData.CatalogType == 7" show-overflow-tooltip prop="Dept" label="申报单位"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="Remark" label="备注"></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>
+    <el-dialog :title="cardTitle"
+               :visible.sync="addshow"
+               width="60%">
+      <el-form label-width="135px" ref="EntityForm" :model="formData">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="企业名称" prop="CompanyName">
+              <el-input v-model="formData.CompanyName" :maxlength="255" placeholder="" readonly style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="法人姓名" prop="LegalPerson">
+              <el-input v-model="formData.LegalPerson" :maxlength="255" placeholder="" readonly style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="法人身份证号" prop="IDCode">
+              <el-input v-model="formData.IDCode" :maxlength="255" placeholder="" readonly style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="注册地址" prop="Address">
+              <el-input v-model="formData.Address" :maxlength="255" placeholder="" readonly style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="全国统一信用代码" prop="USCCode">
+              <el-input v-model="formData.USCCode" :maxlength="255" placeholder="" readonly style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="注册资金" prop="RegCapital">
+              <el-input type="number" v-model.number="formData.RegCapital" :min="1" placeholder="" readonly style="width: 100%">
+                <template slot="append">万元</template>
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12" v-if="formData.CatalogType == 6 || formData.CatalogType == 7">
+            <el-form-item label="申报单位" prop="Dept">
+              <el-input v-model="formData.Dept" :min="1" placeholder="" readonly style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="申请备案范围" prop="RecordScope">
+              <el-input v-model="formData.RecordScope"  type="textarea" :autosize="{ minRow: 3}" readonly style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="备注">
+              <el-input v-model="formData.Remark"  placeholder="" readonly type="textarea" style="width: 100%">
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item style="text-align: center;"  v-if="showBtn">
+              <el-button type="primary" size="small" @click="addshow = false">关闭</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </el-dialog>
+
+  </div>
+</template>
+<script>
+  import { mapGetters } from 'vuex'
+  import api from '@/api/oilsupplier/oilcatalog'
+
+  export default {
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser'
+      })
+    },
+    name: 'oilcatalog',
+
+    data () {
+      return {
+        tableLoading: false,
+        btnName: '打开',
+        showBtn: false,
+        cardTitle: '收入业务',
+        catalogType: '',
+        addShowTitle: '添加目录',
+        addshow: false,
+        loading: false,
+
+        // 分页参数
+        size: 10,
+        currentPage: 1,
+        currentItemCount: 0,
+
+        // 查询时间
+        CreateOn: null,
+        ValidityDate: null,
+
+        // 列表数据
+        entityList: [],
+        // 列表排序
+        Column: {
+          Order: '',
+          Prop: ''
+        },
+        // 查询项
+        searchFormReset: {},
+        searchForm: {
+          CompanyName: '',
+          Business: ''
+
+        },
+        formData: {
+          Id: '',
+          SubId: '',
+          CatalogType: '7',
+          CompanyName: '',
+          LegalPerson: '',
+          Address: '',
+          USCCode: '',
+          RegCapital: '',
+          RecordScope: '',
+          IDCode: '',
+          Business: '',
+          Remark: '',
+          Status: '',
+          FirstAudit: '',
+          SecondAudit: '',
+          ValidityFrom: null,
+          ValidityTo: null
+        }
+      }
+    },
+    watch: {
+      $route (val) {
+        this.formData.CatalogType = parseInt(val.query.catalogType)
+        if (val.query.catalogType === '6') {
+          this.cardTitle = '外部市场'
+        } else if (val.query.catalogType === '7') {
+          this.cardTitle = '收入业务'
+        }
+        this.initDatas()
+      }
+    },
+    created () {
+      this.formData.CatalogType = parseInt(this.$route.query.catalogType)
+      if (this.$route.query.catalogType === '6') {
+        this.cardTitle = '外部市场'
+      } else if (this.$route.query.catalogType === '7') {
+        this.cardTitle = '收入业务'
+      }
+      this.isAccess()
+      this.initDatas()
+    },
+
+    methods: {
+      isAccess () {
+        let params = {
+          RoleId: '10000203'
+        }
+        api.isAccess(params, this.$axios).then(res => {
+          this.showBtn = res.data
+          if (this.showBtn) {
+            this.btnName = '编辑'
+          } else {
+            this.btnName = '打开'
+          }
+        }).catch(err => {
+          console.log(err)
+        })
+      },
+      exportExcel () {
+        if (this.entityList == null || this.entityList.length <= 0) {
+          this.$message({
+            type: 'warning',
+            message: '没有数据可以导出'
+          })
+          return
+        }
+        this.loading = true
+        let params = {
+          CatalogType: this.formData.CatalogType
+        }
+        api.exportExcelIncome(params, this.$axios).then(res => {
+          this.loading = false
+          let docurl = res.data
+          // 内网服务器专用
+          if (process.client && docurl.indexOf('upfile') === 0) {
+            const myDomain = window.location.host
+            location.href = 'http://' + myDomain + '/' + docurl
+          } else {
+            location.href = 'http://' + docurl
+          }
+        })
+      },
+      addOilcatalog () {
+        this.addshow = true
+        this.formData.Id = ''
+        this.formData.CompanyName = ''
+        this.formData.Business = ''
+        this.formData.Remark = ''
+        this.ValidityDate = null
+      },
+      editOilcatalog (val) {
+        this.addshow = true
+        this.formData.Id = val.Id
+        this.formData.SubId = val.SubId
+        this.formData.CatalogType = val.CatalogType
+        this.formData.CompanyName = val.CompanyName
+        this.formData.LegalPerson = val.LegalPerson
+        this.formData.Address = val.Address
+        this.formData.USCCode = val.USCCode
+        this.formData.RegCapital = val.RegCapital
+        this.formData.RecordScope = val.RecordScope
+        this.formData.IDCode = val.IDCode
+        this.formData.Business = val.Business
+        this.formData.ProcessKey = val.ProcessKey
+        this.formData.Status = val.Status
+        this.ValidityDate = [new Date(val.ValidityFrom), new Date(val.ValidityTo)]
+      },
+      saveOilcatalog () {
+        if (this.ValidityDate && this.ValidityDate.length === 2) {
+          this.ValidityDate[1].setHours(23)
+          this.ValidityDate[1].setMinutes(59)
+          this.ValidityDate[1].setSeconds(59)
+          this.formData.ValidityFrom = this.ValidityDate[0]
+          this.formData.ValidityTo = this.ValidityDate[1]
+        }
+        if (this.formData.Id > 0) {
+          this.editEntity()
+        } else {
+          this.addEntity()
+        }
+      },
+      editEntity () {
+        this.$refs['EntityForm'].validate((valid) => {
+          if (valid) {
+            api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+                this.addshow = false
+                this.initDatas()
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+            })
+          }
+        })
+      },
+      addEntity () {
+        this.$refs['EntityForm'].validate((valid) => {
+          if (valid) {
+            api.addEntity(this.formData, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+                this.addshow = false
+                this.initDatas()
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+            })
+          }
+        })
+      },
+      initDatas () {
+        // 分页及列表条件
+        let params = {
+          _currentPage: this.currentPage,
+          _size: this.size,
+          Order: this.Column.Order,
+          Prop: this.Column.Prop,
+          CatalogType: this.formData.CatalogType,
+          Status: '2'
+        }
+        let myCreateOn = []
+        // 解析时间
+        if (this.CreateOn && this.CreateOn.length === 2) {
+          this.CreateOn[1].setHours(23)
+          this.CreateOn[1].setMinutes(59)
+          this.CreateOn[1].setSeconds(59)
+          myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
+          myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
+        }
+        // 查询条件
+        Object.assign(params, this.searchForm)
+        this.tableLoading = true
+        api.getList(myCreateOn, params, this.$axios).then(res => {
+          this.entityList = res.data.items
+          this.currentItemCount = res.data.currentItemCount
+          this.tableLoading = false
+        }).catch(err => {
+          console.log(err)
+          this.tableLoading = false
+        })
+      },
+
+      searchCommand (command) {
+        if (command === 'search') {
+          this.dialogVisible = true
+        } else if (command === 'clear') {
+          this.clearSearch()
+        }
+      },
+      // 列表排序功能
+      orderby (column) {
+        if (column.order === 'ascending') {
+          this.Column.Order = 'asc'
+        } else if (column.order === 'descending') {
+          this.Column.Order = 'desc'
+        }
+        this.Column.Prop = column.prop
+        this.initDatas()
+      },
+      clearSearch () {
+        Object.assign(this.searchForm, this.searchFormReset)
+        this.CreateOn = ''
+        this.initDatas()
+      },
+      handleSearch () {
+        this.currentPage = 1
+        this.dialogVisible = false
+        this.initDatas()
+      },
+      handleCurrentChange (value) {
+        this.currentPage = value
+        this.initDatas()
+      },
+      handleSizeChange (value) {
+        this.size = value
+        this.currentPage = 1
+        this.initDatas()
+      },
+      deleteEntity (row) {
+        api.deleteEntity(row.Id, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            this.initDatas()
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+
+      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
+      }
+    }
+  }
+</script>
+
+<style lang="scss">
+  .el-pagination {
+    margin: 1rem 0 2rem;
+    text-align: right;
+  }
+</style>

+ 551 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/oilcatalogselect/index.vue

@@ -0,0 +1,551 @@
+<template>
+  <div>
+    <el-breadcrumb class="heading">
+      <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
+      <el-breadcrumb-item>{{cardTitle}}目录</el-breadcrumb-item>
+    </el-breadcrumb>
+    <el-card class="box-card" style="height: calc(100vh - 115px);" v-loading="loading">
+      <div slot="header">
+        <span>
+          <i class="icon icon-table2"></i> {{cardTitle}}目录
+        </span>
+        <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
+          <el-form-item label="时间">
+            <el-date-picker size="mini" clearable style="width: 220px" v-model="CreateOn" type="daterange" range-separator="至"
+                            start-placeholder="有效期" end-placeholder="有效期"></el-date-picker>
+          </el-form-item>
+          <el-form-item label="企业名称">
+            <el-input size="mini" clearable v-model="searchForm.CompanyName" style="width:100%" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="业务范围">
+            <el-input size="mini" clearable v-model="searchForm.Business" style="width:100%" placeholder="请输入"></el-input>
+          </el-form-item>
+          <!--<el-form-item label="准入类型">-->
+          <!--<el-select size="mini" style="width:100px" v-model="searchForm.SupplierTypeName" placeholder="准入类别">-->
+          <!--<el-option label="全部" value=""></el-option>-->
+          <!--<el-option label="物资类" value="物资类"></el-option>-->
+          <!--<el-option label="基建类" value="基建类"></el-option>-->
+          <!--<el-option label="服务类" value="服务类"></el-option>-->
+          <!--</el-select>-->
+          <!--</el-form-item>-->
+
+          <el-form-item>
+            <el-dropdown split-button type="primary" size="mini" @click="handleSearch" @command="searchCommand">
+              查询
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item command="clear">查询重置</el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </el-form-item>
+          <el-form-item>
+            <router-link :to="'/oilsupplier/oilcatalogsub/add/incomeedit?type='+formData.CatalogType">
+              <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" v-if="formData.CatalogType == '7' || formData.CatalogType == '6'">申请</el-button>
+            </router-link>
+            &nbsp;
+            <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+      <el-table :data="entityList" border highlight-current-row stripe height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby" size="mini" v-loading="tableLoading" :header-cell-style="{'text-align':'center'}">
+        <el-table-column label="操作" min-width="60px" align="center" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="primary" size="mini" @click="editOilcatalog(scope.row)" plain>查看</el-button>
+          </template>
+
+        </el-table-column>
+        <el-table-column type="index" width="50" align="center" />
+        <!--<el-table-column sortable min-width="80" align="center" show-overflow-tooltip prop="SupplierName" label="序号"></el-table-column>-->
+        <el-table-column sortable width="200" align="center" show-overflow-tooltip prop="CompanyName" label="企业名称"></el-table-column>
+        <el-table-column sortable min-width="400" align="left" prop="Business" label="业务范围"></el-table-column>
+        <el-table-column sortable width="175" align="center" show-overflow-tooltip label="有效期起止">
+          <template slot-scope="scope">
+            {{(jstimehandle(scope.row.ValidityFrom))}}--{{(jstimehandle(scope.row.ValidityTo))}}
+          </template>
+        </el-table-column>
+        <el-table-column sortable min-width="90" align="center" :key="Math.random()" v-if="formData.CatalogType == 4 || formData.CatalogType == 5" show-overflow-tooltip prop="DutyDept" label="责任部室"></el-table-column>
+        <el-table-column sortable min-width="60" align="center" show-overflow-tooltip prop="Remark" label="备注"></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>
+    <el-dialog :title="addShowTitle"
+               :visible.sync="addshow"
+               width="60%">
+      <el-form label-width="95px" ref="EntityForm" :model="formData">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="供方名称" prop="CompanyName">
+              <el-input v-model="formData.CompanyName" :maxlength="255" placeholder="请输入" style="width: 100%" readonly></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="有效期" prop="ValidityDate" >
+              <el-date-picker style="width: 100%" v-model="ValidityDate" type="daterange" range-separator="至"
+                              start-placeholder="有效期起" end-placeholder="有效期止" readonly></el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="业务范围" prop="Business">
+              <el-input v-model="formData.Business"  type="textarea" :autosize="{ minRows: 3}" style="width: 100%" readonly></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24" v-if="formData.CatalogType == 4 || formData.CatalogType == 5">
+            <el-form-item label="责任部室" prop="DutyDept">
+              <el-input v-model="formData.DutyDept"  :maxlength="100" style="width: 100%" readonly></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24" v-if="formData.CatalogType == 6 || formData.CatalogType == 7">
+            <el-form-item label="申报单位" prop="Dept">
+              <el-input v-model="formData.Dept"  :maxlength="100" style="width: 100%" readonly></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="备注">
+              <el-input v-model="formData.Remark"  placeholder="请输入" type="textarea" style="width: 100%" readonly>
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item style="text-align: center;">
+              <el-button type="primary" size="small" @click="addshow = false">关闭</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </el-dialog>
+
+    <el-dialog title="上传文件"  width="600px" :visible.sync="uploadshow">
+      <el-form label-width="100px">
+        <el-row>
+          <el-col :span="24">
+            <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
+                       :http-request="uploadrequest" :before-upload="beforeAvatarUpload">
+              <el-button size="small" type="primary">点击上传</el-button>
+            </el-upload>
+          </el-col>
+          <el-col :span="24">
+            <el-button style="float: right;" size="mini" type="primary" @click="uploadExcel()">确定</el-button>
+          </el-col>
+        </el-row>
+      </el-form>
+    </el-dialog>
+    <el-dialog title="导入完成" :visible.sync="errorDialogVisible" :close-on-click-modal = "false" width="720px">
+      <el-input type="textarea" autosize placeholder="请输入内容" v-model="textarea"></el-input>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import { mapGetters } from 'vuex'
+  import api from '@/api/oilsupplier/oilcatalog'
+  import axios from 'axios'
+  import uploadajax from '@/assets/js/uploadajax.js'
+
+  export default {
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser'
+      })
+    },
+    name: 'oilcatalog',
+
+    data () {
+      return {
+        tableLoading: false,
+        Excelurl: '',
+        btnName: '打开',
+        showBtn: false,
+        cardTitle: '',
+        catalogType: '',
+        addShowTitle: '添加目录',
+        addshow: false,
+        loading: false,
+        uploadshow: false,
+        errorDialogVisible: false,
+        textarea: '',
+
+        // 分页参数
+        size: 10,
+        currentPage: 1,
+        currentItemCount: 0,
+
+        // 查询时间
+        CreateOn: null,
+        ValidityDate: null,
+
+        // 列表数据
+        entityList: [],
+        // 列表排序
+        Column: {
+          Order: '',
+          Prop: ''
+        },
+        // 查询项
+        searchFormReset: {},
+        searchForm: {
+          CompanyName: '',
+          Business: ''
+
+        },
+        formData: {
+          Id: '',
+          CatalogType: '',
+          OrderNo: '',
+          CompanyName: '',
+          Business: '',
+          DutyDept: '', // 责任部室
+          Dept: '', // 申报单位
+          ValidityFrom: null,
+          ValidityTo: null,
+          Remark: ''
+        }
+      }
+    },
+    watch: {
+      $route (val) {
+        console.log('值啥啥啥', val)
+        this.formData.CatalogType = parseInt(val.query.catalogType)
+        if (val.query.catalogType === '1') {
+          this.cardTitle = '自建项目'
+        } else if (val.query.catalogType === '2') {
+          this.cardTitle = '优势项目'
+        } else if (val.query.catalogType === '3') {
+          this.cardTitle = '关联交易'
+        } else if (val.query.catalogType === '4') {
+          this.cardTitle = '战略合作'
+        } else if (val.query.catalogType === '5') {
+          this.cardTitle = '特殊业务'
+        } else if (val.query.catalogType === '6') {
+          this.cardTitle = '外部市场'
+        } else if (val.query.catalogType === '7') {
+          this.cardTitle = '收入业务'
+        }
+        this.initDatas()
+      }
+    },
+    created () {
+      this.isAccess()
+      this.formData.CatalogType = parseInt(this.$route.query.catalogType)
+      if (this.$route.query.catalogType === '1') {
+        this.cardTitle = '自建项目'
+      } else if (this.$route.query.catalogType === '2') {
+        this.cardTitle = '优势项目'
+      } else if (this.$route.query.catalogType === '3') {
+        this.cardTitle = '关联交易'
+      } else if (this.$route.query.catalogType === '4') {
+        this.cardTitle = '战略合作'
+      } else if (this.$route.query.catalogType === '5') {
+        this.cardTitle = '特殊业务'
+      } else if (this.$route.query.catalogType === '6') {
+        this.cardTitle = '外部市场'
+      }
+      this.initDatas()
+    },
+
+    methods: {
+      // excel导入
+      importExcel () {
+        this.uploadshow = true
+      },
+      uploadrequest (option) {
+        let _this = this
+        if (process.client) {
+          const myDomain = window.location.host
+          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}`
+                }
+                uploadajax(option)
+                _this.Excelurl = option.action
+              } else {
+                _this.$message({
+                  type: 'warning',
+                  message: '未上传成功!请刷新界面重新上传!'
+                })
+              }
+            })
+            .catch(res => {
+              _this.$message({
+                type: 'warning',
+                message: '未上传成功!请重新上传!'
+              })
+            })
+        }
+      },
+      beforeAvatarUpload (file) {
+        if (file.name.indexOf('.xlsx') < 0) {
+          this.$message.error('文件格式必须为.xlsx')
+          return false
+        }
+        return true
+      },
+      uploadExcel () {
+        this.importloading = true
+        this.uploadshow = false
+        let params = {
+          ExcelUrl: this.Excelurl,
+          CatalogType: this.formData.CatalogType
+        }
+        api.importExcel(params, this.$axios).then(res => {
+          this.importloading = false
+          this.initDatas()
+          if (res.data.code === 0) {
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else if (res.data.code === -1) {
+            this.initDatas()
+            this.errorDialogVisible = true
+            this.textarea = res.data.message
+          } else if (res.data.code === -2) {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        })
+      },
+
+      isAccess () {
+        let params = {
+          RoleId: '10000203'
+        }
+        api.isAccess(params, this.$axios).then(res => {
+          this.showBtn = res.data
+          if (this.showBtn) {
+            this.btnName = '编辑'
+          } else {
+            this.btnName = '打开'
+          }
+        }).catch(err => {
+          console.log(err)
+        })
+      },
+      exportExcel () {
+        if (this.entityList == null || this.entityList.length <= 0) {
+          this.$message({
+            type: 'warning',
+            message: '没有数据可以导出'
+          })
+          return
+        }
+        this.loading = true
+        let params = {
+          CardTitle: this.cardTitle,
+          CatalogType: this.formData.CatalogType
+        }
+        api.exportExcelAll(params, this.$axios).then(res => {
+          this.loading = false
+          let docurl = res.data
+          // 内网服务器专用
+          if (process.client && docurl.indexOf('upfile') === 0) {
+            const myDomain = window.location.host
+            location.href = 'http://' + myDomain + '/' + docurl
+          } else {
+            location.href = 'http://' + docurl
+          }
+        })
+      },
+      addOilcatalog () {
+        this.addshow = true
+        this.formData.Id = ''
+        this.formData.CompanyName = ''
+        this.formData.Business = ''
+        this.formData.Remark = ''
+        this.ValidityDate = null
+      },
+      editOilcatalog (row) {
+        this.addshow = true
+        this.formData.Id = row.Id
+        this.formData.CatalogType = row.CatalogType
+        this.formData.CompanyName = row.CompanyName
+        this.formData.Business = row.Business
+        this.formData.Remark = row.Remark
+        this.ValidityDate = [new Date(row.ValidityFrom), new Date(row.ValidityTo)]
+      },
+      saveOilcatalog () {
+        if (this.ValidityDate && this.ValidityDate.length === 2) {
+          this.ValidityDate[1].setHours(23)
+          this.ValidityDate[1].setMinutes(59)
+          this.ValidityDate[1].setSeconds(59)
+          this.formData.ValidityFrom = this.ValidityDate[0]
+          this.formData.ValidityTo = this.ValidityDate[1]
+        }
+        if (this.formData.Id > 0) {
+          this.editEntity()
+        } else {
+          this.addEntity()
+        }
+      },
+      editEntity () {
+        this.$refs['EntityForm'].validate((valid) => {
+          if (valid) {
+            api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+                this.addshow = false
+                this.initDatas()
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+            })
+          }
+        })
+      },
+      addEntity () {
+        this.$refs['EntityForm'].validate((valid) => {
+          if (valid) {
+            api.addEntity(this.formData, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+                this.addshow = false
+                this.initDatas()
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+            })
+          }
+        })
+      },
+      initDatas () {
+        // 分页及列表条件
+        let params = {
+          _currentPage: this.currentPage,
+          _size: this.size,
+          Order: this.Column.Order,
+          Prop: this.Column.Prop,
+          CatalogType: this.formData.CatalogType,
+          Status: ''
+        }
+        if (this.formData.CatalogType == '6') {
+          params.Status = '2'
+        }
+        let myCreateOn = []
+        // 解析时间
+        if (this.CreateOn && this.CreateOn.length === 2) {
+          this.CreateOn[1].setHours(23)
+          this.CreateOn[1].setMinutes(59)
+          this.CreateOn[1].setSeconds(59)
+          myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
+          myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
+        }
+        // 查询条件
+        Object.assign(params, this.searchForm)
+        this.tableLoading = true
+        api.getList(myCreateOn, params, this.$axios).then(res => {
+          this.entityList = res.data.items
+          this.currentItemCount = res.data.currentItemCount
+          this.tableLoading = false
+        }).catch(err => {
+          console.log(err)
+          this.tableLoading = false
+        })
+      },
+
+      searchCommand (command) {
+        if (command === 'search') {
+          this.dialogVisible = true
+        } else if (command === 'clear') {
+          this.clearSearch()
+        }
+      },
+      // 列表排序功能
+      orderby (column) {
+        if (column.order === 'ascending') {
+          this.Column.Order = 'asc'
+        } else if (column.order === 'descending') {
+          this.Column.Order = 'desc'
+        }
+        this.Column.Prop = column.prop
+        this.initDatas()
+      },
+      clearSearch () {
+        Object.assign(this.searchForm, this.searchFormReset)
+        this.CreateOn = ''
+        this.initDatas()
+      },
+      handleSearch () {
+        this.currentPage = 1
+        this.dialogVisible = false
+        this.initDatas()
+      },
+      handleCurrentChange (value) {
+        this.currentPage = value
+        this.initDatas()
+      },
+      handleSizeChange (value) {
+        this.size = value
+        this.currentPage = 1
+        this.initDatas()
+      },
+      deleteEntity (row) {
+        api.deleteEntity(row.Id, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            this.initDatas()
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+
+      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
+      }
+    }
+  }
+</script>
+
+<style lang="scss">
+  .el-pagination {
+    margin: 1rem 0 2rem;
+    text-align: right;
+  }
+</style>