浏览代码

目录管理

lining 6 年之前
父节点
当前提交
b3dd643162

+ 23 - 0
src/dashoo.cn/backend/api/business/oilsupplier/oilcatalog/oilcatalog.go

@@ -0,0 +1,23 @@
+package oilcatalog
+
+import (
+"time"
+)
+
+type OilCatalog struct {
+	Id             int       `xorm:"not null pk autoincr INT(10)"`
+	CatalogType    int       `xorm:"comment('目录类型: 1 自建项目、2 优势项目、3 关联交易、4 战略合作、5 特殊业务、6 创收业务') INT(11)"`
+	OrderNo        int       `xorm:"comment('序号') INT(11)"`
+	CompanyName    string    `xorm:"comment('企业名称') VARCHAR(255)"`
+	Business       string    `xorm:"comment('业务范围') TEXT"`
+	ValidityFrom   time.Time `xorm:"comment('有效期起') DATETIME"`
+	ValidityTo     time.Time `xorm:"comment('有效期止') DATETIME"`
+	Remark         string    `xorm:"comment('备注') VARCHAR(255)"`
+	CreateUserId   int       `xorm:"INT(11)"`
+	CreateOn       time.Time `xorm:"DATETIME"`
+	CreateBy       string    `xorm:"VARCHAR(50)"`
+	ModifiedOn     time.Time `xorm:"DATETIME"`
+	ModifiedUserId int       `xorm:"INT(11)"`
+	ModifiedBy     string    `xorm:"VARCHAR(50)"`
+}
+

+ 16 - 0
src/dashoo.cn/backend/api/business/oilsupplier/oilcatalog/oilcatalogService.go

@@ -0,0 +1,16 @@
+package oilcatalog
+
+import (
+	. "dashoo.cn/backend/api/mydb"
+	"github.com/go-xorm/xorm"
+)
+
+type OilCatalogService struct {
+	MyServiceBase
+}
+
+func GetOilCatalogService(xormEngine *xorm.Engine) *OilCatalogService {
+	s := new(OilCatalogService)
+	s.DBE = xormEngine
+	return s
+}

+ 1 - 0
src/dashoo.cn/backend/api/controllers/base.go

@@ -259,6 +259,7 @@ var (
 	OilSupplierPauseReasonName				 string = "OilSupplierPauseReason"
 	OilPaymentInfoName                       string = "OilPaymentInfo"              //交费信息
 	OilActivityName                          string = "OilActivity" //
+	OilCatalogName                           string = "OilCatalog" //目录表
 )
 
 //分页信息及数据

+ 173 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/oilcatalog.go

@@ -0,0 +1,173 @@
+package oilsupplier
+
+import (
+	"dashoo.cn/backend/api/business/oilsupplier/oilcatalog"
+	. "dashoo.cn/backend/api/controllers"
+	"dashoo.cn/utils"
+	"encoding/json"
+	"strings"
+	"time"
+)
+
+type OilCatalogController struct {
+	BaseController
+}
+
+// @Title 获取列表
+// @Description get user by token
+// @Success 200 {object} []suppliercert.OilSupplierCert
+// @router /list [get]
+func (this *OilCatalogController) GetEntityList() {
+	//获取分页信息
+	page := this.GetPageInfoForm()
+	where := " 1=1 "
+	orderby := "Id"
+	asc := false
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "asc" {
+			asc = true
+		}
+	}
+
+	catalogType := this.GetString("CatalogType")
+	CreateOn := this.GetString("CreateOn")
+	if catalogType != "" {
+		where = where + " and CatalogType=" + catalogType
+	}
+
+	if CreateOn != "" {
+		dates := strings.Split(CreateOn, ",")
+		if len(dates) == 2 {
+			minDate := dates[0]
+			maxDate := dates[1]
+			where = where + " and ValidityTo>='" + minDate + "' and ValidityTo<='" + maxDate + "'"
+		}
+	}
+
+	svc := oilcatalog.GetOilCatalogService(utils.DBE)
+	var list []oilcatalog.OilCatalog
+	total := svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &list, where)
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	datainfo.PageIndex = page.CurrentPage
+	datainfo.ItemsPerPage = page.Size
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+
+
+
+}
+
+// @Title 添加
+// @Description 新增
+// @Success	200	{object} controllers.Request
+// @router /add [post]
+func (this *OilCatalogController) AddEntity() {
+	var model oilcatalog.OilCatalog
+	var jsonBlob = this.Ctx.Input.RequestBody
+	svc := oilcatalog.GetOilCatalogService(utils.DBE)
+
+	json.Unmarshal(jsonBlob, &model)
+	model.CreateOn = time.Now()
+	model.CreateBy = this.User.Realname
+	model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+
+	_, err := svc.InsertEntityBytbl(OilCatalogName, &model)
+
+	var errinfo ErrorDataInfo
+	if err == nil {
+		//新增
+		errinfo.Message = "添加成功!"
+		errinfo.Code = 0
+		errinfo.Item = model.Id
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "添加失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}
+
+// @Title 删除单条信息
+// @Description
+// @Success 200 {object} ErrorInfo
+// @Failure 403 :id 为空
+// @router /delete/:Id [delete]
+func (this *OilCatalogController) DeleteEntity() {
+	Id := this.Ctx.Input.Param(":Id")
+	var errinfo ErrorInfo
+	if Id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+	var model oilcatalog.OilCatalog
+	svc := oilcatalog.GetOilCatalogService(utils.DBE)
+	err := svc.DeleteEntityById(Id,&model)
+	if err == nil {
+		errinfo.Message = "删除成功"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "删除失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}
+
+// @Title 修改实体
+// @Description 修改实体
+// @Success	200	{object} controllers.Request
+// @router /update/:id [post]
+func (this *OilCatalogController) UpdateEntity() {
+	id := this.Ctx.Input.Param(":id")
+	var errinfo ErrorInfo
+	if id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+	var model oilcatalog.OilCatalog
+	svc := oilcatalog.GetOilCatalogService(utils.DBE)
+
+	var jsonBlob= this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonBlob, &model)
+	model.ModifiedOn = time.Now()
+	model.ModifiedBy = this.User.Realname
+	model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
+
+	cols := []string{
+		"CatalogType",
+		"OrderNo",
+		"CompanyName",
+		"Business",
+		"ValidityFrom",
+		"ValidityTo",
+		"Remark",
+	}
+	err := svc.UpdateEntityBytbl(OilCatalogName, id, &model, cols)
+	if err == nil {
+		errinfo.Message = "修改成功!"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "修改失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}

+ 7 - 1
src/dashoo.cn/backend/api/routers/router.go

@@ -4,7 +4,6 @@
 package routers
 
 import (
-	"dashoo.cn/backend/api/controllers/tmpzcgf"
 	"dashoo.cn/backend/api/controllers"
 	"dashoo.cn/backend/api/controllers/bankapi"
 	"dashoo.cn/backend/api/controllers/casbin"
@@ -12,6 +11,7 @@ import (
 	"dashoo.cn/backend/api/controllers/oilsupplier"
 	"dashoo.cn/backend/api/controllers/register"
 	"dashoo.cn/backend/api/controllers/rtx"
+	"dashoo.cn/backend/api/controllers/tmpzcgf"
 
 	//	"dashoo.cn/backend/api/controllers/equipment"
 	//	"dashoo.cn/backend/api/controllers/instrument"
@@ -414,6 +414,12 @@ func init() {
 				&tmpzcgf.TmpCertController{},
 			),
 		),
+		//目录管理
+		beego.NSNamespace("/oilcatalog",
+			beego.NSInclude(
+				&oilsupplier.OilCatalogController{},
+			),
+		),
 	)
 	beego.AddNamespace(ns)
 }

+ 164 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/oilcatalog.js

@@ -0,0 +1,164 @@
+export default {
+  getList (CreateOn, params, myAxios) {
+    return myAxios({
+      url: '/oilcatalog/list?CreateOn=' + CreateOn,
+      method: 'GET',
+      params: params
+    })
+  },
+  getCertList (CreateOn, params, myAxios) {
+    return myAxios({
+      url: '/supplier/certlist?CreateOn=' + CreateOn,
+      method: 'GET',
+      params: params
+    })
+  },
+  getJZPSCertList (CreateOn, params, myAxios) {
+    return myAxios({
+      url: '/supplier/jzps_certlist?CreateOn=' + CreateOn,
+      method: 'GET',
+      params: params
+    })
+  },
+  getStoreList (CreateOn, params, myAxios) {
+    return myAxios({
+      url: '/supplier/storelist?CreateOn=' + CreateOn,
+      method: 'GET',
+      params: params
+    })
+  },
+  getMyTasks (CreateOn, params, myAxios) {
+    return myAxios({
+      url: '/supplier/mytasks?CreateOn=' + CreateOn,
+      method: 'GET',
+      params: params
+    })
+  },
+  getDictList (myAxios) {
+    return myAxios({
+      url: '/supplier/dictlist/',
+      method: 'GET'
+    })
+  },
+  getDictListByStatus (params, myAxios) {
+    return myAxios({
+      url: '/supplier/dictlistbystatus/',
+      method: 'GET',
+      params: params
+    })
+  },
+  getEntity (entityId, myAxios) {
+    return myAxios({
+      url: '/supplier/get/' + entityId,
+      method: 'GET'
+    })
+  },
+  getEntityAndCert (certId, myAxios) {
+    return myAxios({
+      url: '/supplier/getandcert/' + certId,
+      method: 'GET'
+    })
+  },
+  getEntityByName (name, typeCode, myAxios) {
+    return myAxios({
+      url: '/supplier/getbyname?typecode=' + typeCode + '&name=' + name,
+      method: 'GET'
+    })
+  },
+  addEntity (formData, myAxios) {
+    return myAxios({
+      url: '/oilcatalog/add',
+      method: 'post',
+      data: formData
+    })
+  },
+  updateEntity (entityId, formData, myAxios) {
+    return myAxios({
+      url: '/oilcatalog/update/' + entityId,
+      method: 'post',
+      data: formData
+    })
+  },
+  updateNumberEntity (entityId, formData, myAxios) {
+    return myAxios({
+      url: '/supplier/updatenumber/' + entityId,
+      method: 'post',
+      data: formData
+    })
+  },
+  deleteEntity (entityId, myAxios) {
+    return myAxios({
+      url: '/oilcatalog/delete/' + entityId,
+      method: 'delete'
+    })
+  },
+  deleteAllEntity (entityId, supplierTypeCode, myAxios) {
+    return myAxios({
+      url: '/supplier/deleteall/' + entityId + '/' + supplierTypeCode,
+      method: 'delete'
+    })
+  },
+  isCanApply (typeCode, myAxios) {
+    return myAxios({
+      url: '/supplier/iscanapply/' + typeCode,
+      method: 'get'
+    })
+  },
+  isCanUpdateSupplier (supplierid, myAxios) {
+    return myAxios({
+      url: '/supplier/iscanupdatesupplier/' + supplierid,
+      method: 'get'
+    })
+  },
+  getAuditerByDept (deptId, auditstepcode, myAxios) {
+    return myAxios({
+      url: '/supplier/getauditerbydept/' + deptId + '?auditstepcode=' + auditstepcode,
+      method: 'GET'
+    })
+  },
+  getFirAuditerByDept (deptId, auditstepcode, myAxios) {
+    return myAxios({
+      url: '/supplier/getfirauditerbydept/' + deptId + '?auditstepcode=' + auditstepcode,
+      method: 'GET'
+    })
+  },
+  getAuditerByFirst (firstId, auditstepcode, myAxios) {
+    return myAxios({
+      url: '/supplier/getauditerbyfirst/' + firstId + '?auditstepcode=' + auditstepcode,
+      method: 'GET'
+    })
+  },
+  getAuditerByDeptAndNoLogin (params, myAxios) {
+    return myAxios({
+      url: '/supplier/getauditerbydeptandnologin',
+      method: 'GET',
+      params: params
+    })
+  },
+  getTodoList (params, myAxios) {
+    return myAxios({
+      url: '/todolist/gettodolist/',
+      method: 'GET',
+      params: params
+    })
+  },
+  getMyTaskFinished (params, myAxios) {
+    return myAxios({
+      url: '/todolist/getmytaskfinishedlist/',
+      method: 'GET',
+      params: params
+    })
+  },
+  getJurisdiction (myAxios) {
+    return myAxios({
+      url: '/supplier/getjurisdiction',
+      method: 'GET'
+    })
+  },
+  getEntityByCommercialNo (commercialNo, myAxios) {
+    return myAxios({
+      url: '/supplier/getentitybycommercialno/' + commercialNo,
+      method: 'GET'
+    })
+  }
+}

+ 403 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/oilcatalog/index.vue

@@ -0,0 +1,403 @@
+<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);">
+      <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" v-model="CreateOn" type="daterange" range-separator="至"
+                            start-placeholder="有效期" end-placeholder="有效期"></el-date-picker>
+          </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" @click="addOilcatalog">添加</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">
+        <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>
+            <el-popover placement="top" title="提示">
+              <el-alert
+                title=""
+                description="确认要删除吗?"
+                type="warning"
+                :closable="false">
+              </el-alert>
+              <br/>
+              <div style="text-align: right; margin: 0">
+                <el-button type="danger" size="mini" @click="deleteEntity(scope.row)">删除</el-button>
+              </div>
+              <el-button slot="reference" type="danger" title="删除" style="margin-left:10px" size="mini" plain>删除</el-button>
+            </el-popover>
+          </template>
+
+        </el-table-column>
+        <!--<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 min-width="500" align="center" show-overflow-tooltip prop="Business" label="业务范围"></el-table-column>
+        <el-table-column sortable min-width="200" 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="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="addShowTitle"
+               :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" :rules="{ required: true, message: '供方名称不能为空', trigger: 'blur'}">
+              <el-input v-model="formData.CompanyName" :maxlength="255" placeholder="请输入" style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="有效期" prop="ValidityDate" >
+              <el-date-picker style="width: 220px" v-model="ValidityDate" type="daterange" range-separator="至"
+                              start-placeholder="有效期起" end-placeholder="有效期止"></el-date-picker>
+            </el-form-item>
+          </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%"></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%">
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item style="text-align: center;">
+              <el-button type="primary" size="mini" @click="saveOilcatalog">保存</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 () {
+      var validDate = (rule, value, callback) => {
+        if (!value || !value[0] || !value[1]) {
+          callback(new Error('请选择时间'))
+        } else {
+          callback()
+        }
+      }
+
+      return {
+        cardTitle: '',
+        catalogType: '',
+        addShowTitle: '添加目录',
+        addshow: false,
+
+        // 分页参数
+        size: 10,
+        currentPage: 1,
+        currentItemCount: 0,
+
+        // 查询时间
+        CreateOn: null,
+        ValidityDate: null,
+
+        // 列表数据
+        entityList: [],
+        // 列表排序
+        Column: {
+          Order: '',
+          Prop: ''
+        },
+        // 查询项
+        searchFormReset: {},
+        searchForm: {
+
+        },
+        rules: {
+          ValidityDate: [{
+            validator: validDate,
+            trigger: 'blur'
+          }]
+        },
+        formData: {
+          Id: '',
+          CatalogType: '',
+          OrderNo: '',
+          CompanyName: '',
+          Business: '',
+          ValidityFrom: null,
+          ValidityTo: null,
+          Remark: ''
+        }
+      }
+    },
+    watch: {
+      $route (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 = '创收业务'
+        }
+        this.initDatas()
+      }
+    },
+    created () {
+      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: {
+      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
+        }
+        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)
+        api.getList(myCreateOn, params, this.$axios).then(res => {
+          this.entityList = res.data.items
+          this.currentItemCount = res.data.currentItemCount
+        })
+      },
+
+      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>