瀏覽代碼

年审更新最后一次年审时间,基建类准入分类增项分类不重复添加

huahaiyan 6 年之前
父節點
當前提交
8fc6ba6da5

+ 2 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/annualaudit.go

@@ -700,9 +700,11 @@ func (this *AnnualAuditController) AnnualAudit() {
 		}
 		var certmodel suppliercert.OilSupplierCert
 		certmodel.ApplyTime = oldtimeaply.AddDate(1,0,0)
+		certmodel.AuditDate = time.Now()
 		certcols := []string{
 			"Id",
 			"ApplyTime",
+			"AuditDate",
 		}
 		if receiveVal == "true" {
 			_, err := svc.UpdateEntityByIdCols(dataother.AnnualId, auditmodel, cols)

+ 11 - 3
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertappendsub.go

@@ -102,6 +102,7 @@ func (this *OilSupplierCertAppendSubController) AddAppendSub() {
 	var model suppliercertsub.OilSupplierCertSub
 	var jsonblob = this.Ctx.Input.RequestBody
 	var errinfo ErrorDataInfo
+	var err error
 
 	json.Unmarshal(jsonblob, &model)
 	model.Type = "2"
@@ -110,8 +111,16 @@ func (this *OilSupplierCertAppendSubController) AddAppendSub() {
 	model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
 
 	svc := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
-	//添加到准入分类表中
-	_, err := svc.InsertEntityBytbl(OilSupplierCertSubName, &model)
+	var submodel suppliercertsub.OilSupplierCertSub
+	where_certsub := " SupplierCertId = "+ utils.ToStr(model.SupplierCertId) + " and SupplierTypeCode = 02"
+	where_certsub += " and SubClassId = '" + utils.ToStr(model.SubClassId) + "'"
+	has := svc.GetEntityByWhere(OilSupplierCertSubName, where_certsub, &submodel)
+	if !has{
+		//添加到准入分类表中
+		_, err = svc.InsertEntityBytbl(OilSupplierCertSubName, &model)
+	}else{
+		model.Id = submodel.Id
+	}
 
 	var supplierCertModel suppliercert.OilSupplierCert
 	svcCert := suppliercert.GetOilSupplierCertService(utils.DBE)
@@ -165,7 +174,6 @@ func (this *OilSupplierCertAppendSubController) AddAppendSub() {
 			entity.SupType = 2
 			svc.InsertEntityBytbl(OilSupplierFileName, &entity)
 		}
-
 	}
 	if err == nil {
 		errinfo.Message = "操作成功!"

+ 11 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertsub.go

@@ -486,12 +486,22 @@ func (this *OilSupplierCertSubController) AddTechBus() {
 // @router /addbusiness [post]
 func (this *OilSupplierCertSubController) AddBusiness() {
 	var model suppliercertsub.OilSupplierCertSub
+	var err error
 	var jsonblob = this.Ctx.Input.RequestBody
 	json.Unmarshal(jsonblob, &model)
 	model.CreateBy = this.User.Realname
 	model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
 	svc := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
-	_, err := svc.InsertEntityBytbl(OilSupplierCertSubName, &model)
+	var submodel suppliercertsub.OilSupplierCertSub
+	where_certsub := " SupplierCertId = "+ utils.ToStr(model.SupplierCertId) + " and SupplierTypeCode = 02"
+	where_certsub += " and SubClassId = '" + utils.ToStr(model.SubClassId) + "'"
+	has := svc.GetEntityByWhere(OilSupplierCertSubName, where_certsub, &submodel)
+	if !has{
+		//添加到准入分类表中
+		_, err = svc.InsertEntityBytbl(OilSupplierCertSubName, &model)
+	}else{
+		model.Id = submodel.Id
+	}
 
 	var supplierCertModel suppliercert.OilSupplierCert
 	svcCert := suppliercert.GetOilSupplierCertService(utils.DBE)

+ 1 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/addtionaudit/techlist.vue

@@ -250,6 +250,7 @@
         //访问接口
         api.getMyTasks(myCreateOn.join(','), params, this.$axios).then(res => {
           this.entityList = res.data.items
+          console.log("--this.entityList----",this.entityList)
           this.currentItemCount = res.data.currentItemCount
         }).catch(err => {
           console.error(err)

+ 223 - 0
src/dashoo.cn/frontend_web/src/pages/select/processselect/index.vue

@@ -0,0 +1,223 @@
+<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>
+
+        <el-form :model="searchForm" ref="searchformRef" :inline="true"
+          style="float: right;position:absolute;right:15px;top:10.5px">
+          <el-form-item label="企业名称">
+            <el-input size="mini" v-model="searchForm.SupplierName" placeholder="请输入内容"></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-dropdown split-button type="primary" size="mini" @click="initDatas($event)" @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="exportExcel">导出</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <!--内框表格显示-->
+      <!-- <el-table id="rebateSetTable" :data="entityList" size="small" border height="calc(100vh - 243px)"
+        style="width: 100%" @sort-change="orderby" @cell-click="handle" @cell-mouse-enter="changeClor"
+        @cell-mouse-leave="backClor">
+        <el-table-column label="企业名称" prop="SupplierName" sortable align="center"></el-table-column>
+        <el-table-column label="曾用名" prop="OldSupplierName" align="center"></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 api from "@/api/oilsupplier/usednameselect";
+  import FileSaver from "file-saver";
+  import XLSX from "xlsx";
+  export default {
+    created() {
+      // 执行初始化方法
+      this.initDatas();
+    },
+    data() {
+      return {
+        show: false,
+        // 定义列表数据
+        entityList: [],
+        // 分页参数
+        size: 10,
+        currentPage: 1,
+        currentItemCount: 0,
+        //查询时间
+        CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
+        searchForm: {
+          SupplierName: "",
+          SupplierTypeName: ""
+        },
+        //列表排序
+        Column: {
+          Order: "",
+          Prop: ""
+        }
+      };
+    },
+
+    methods: {
+      //初始化列表方法
+      initDatas(event) {
+        console.log(event);
+        if (event != null) {
+          this.currentPage = 1;
+        }
+        let params = {
+          _size: this.size,
+          _currentPage: this.currentPage,
+          Order: this.Column.Order,
+          Prop: this.Column.Prop
+        };
+        let myCreateOn = []
+        // 解析时间
+        if (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.getNameList(myCreateOn,params, this.$axios)
+          .then(res => {
+            console.log(res.data.items);
+            this.entityList = res.data.items;
+            this.currentItemCount = res.data.currentItemCount;
+          })
+          .catch(err => {
+            console.error(err);
+          });
+      },
+      exportExcel() {
+        /* generate workbook object from table */
+        let wb = XLSX.utils.table_to_book(
+          document.querySelector("#rebateSetTable")
+        );
+        /* get binary string as output */
+        let wbout = XLSX.write(wb, {
+          bookType: "xlsx",
+          bookSST: true,
+          type: "array"
+        });
+        try {
+          FileSaver.saveAs(
+            new Blob([wbout], {
+              type: "application/octet-stream"
+            }),
+            "SupplierSituation.xlsx"
+          );
+        } catch (e) {
+          if (typeof console !== "undefined") console.log(e, wbout);
+        }
+        return wbout;
+      },
+      backClor(row, column, event, cell) {
+        if (column.property === "SupplierName") {
+          event.style.background = "";
+        }
+      },
+      changeClor(row, column, event, cell) {
+        if (column.property === "SupplierName") {
+          event.style.background = "#d3dce6";
+        }
+      },
+
+      //列表排序功能
+      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();
+      },
+      jstimehandle(val) {
+        if (val === "") {
+          return "----";
+        } else if (val === "0001-01-01T08:00:00+08:00") {
+          return "----";
+        } else if (val === "0001-01-01T00:00:00Z") {
+          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.initDatas();
+      },
+      handleSizeChange(value) {
+        this.size = value;
+        this.currentPage = 1;
+        this.initDatas();
+      },
+      searchCommand(command) {
+        if (command == "clear") {
+          this.clearSearch();
+        }
+      },
+      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;
+      },
+      clearSearch() {
+        this.searchForm.SupplierTypeName = "";
+        this.searchForm.SupplierName = "";
+        this.currentPage = 1;
+        this.initDatas();
+      }
+    }
+  };
+
+</script>
+
+<style>
+  .eldialog .el-input__inner {
+    border: none;
+  }
+
+  .eldialog .el-textarea__inner {
+    border: none;
+    resize: none;
+    height: 70px;
+  }
+
+</style>

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/select/usednameselect/index.vue

@@ -132,7 +132,7 @@
             new Blob([wbout], {
               type: "application/octet-stream"
             }),
-            "SupplierSituation.xlsx"
+            "SupplierUsedName.xlsx"
           );
         } catch (e) {
           if (typeof console !== "undefined") console.log(e, wbout);