2
3
Эх сурвалжийг харах

准入项目查询

Signed-off-by: lijunqing <lijunqing@dashoo.cn>
lijunqing 6 жил өмнө
parent
commit
ec89e20ed4

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

@@ -8,6 +8,7 @@ import (
 	"dashoo.cn/backend/api/business/register"
 	"dashoo.cn/backend/api/business/register"
 	"encoding/json"
 	"encoding/json"
 	"fmt"
 	"fmt"
+	"strconv"
 
 
 	// "fmt"
 	// "fmt"
 
 
@@ -377,3 +378,49 @@ func (this *SelectController) GetProcessAuditList() {
 	this.ServeJSON()
 	this.ServeJSON()
 
 
 }
 }
+
+
+
+
+// @Title 准入范围查询
+// @Description
+// @Success 200 {object}
+// @router /zrfwselect [get]
+func (this *SelectController) ZrfwSelect() {
+
+	//获取分页信息
+	page := this.GetPageInfoForm()
+	limitCurrent:=(page.CurrentPage-1)*page.Size
+	svc := selectbusiness.GetSelectService(utils.DBE)
+	supplierTypeCode := this.GetString("SupplierTypeCode")
+
+	//企业用户必须加创建人条件
+	var registerUser register.OilCorporateInfo
+	var company supplier.OilSupplier
+
+	sql := " UserName='" + this.User.Username + "'"
+	svc.GetEntity(&registerUser,sql)
+	if this.User.IsCompanyUser == 1 {
+		sql1:= " CreateUserId = '" + this.User.Id + "' or CommercialNo='"+registerUser.CommercialNo+"'"
+		svc.GetEntity(&company,sql1)
+	}
+
+	if company.SupplierName!=""{
+		sql2:="select distinct(Code),Name,SupplierId from OilSupplierCert2File where SupplierId='"+strconv.Itoa(company.Id)+"' and SupplierTypeCode='"+supplierTypeCode+"' order by Code limit "+strconv.FormatInt(limitCurrent,10)+","+strconv.FormatInt(page.Size,10)+""
+		result,_:=svc.DBE.QueryString(sql2)
+		fmt.Println(result)
+		sql3:="select count(distinct(Code)) total from OilSupplierCert2File where SupplierId='"+strconv.Itoa(company.Id)+"' and SupplierTypeCode='"+supplierTypeCode+"'"
+		result1,_:=svc.DBE.QueryString(sql3)
+		fmt.Println(result1)
+
+		total,_:= strconv.ParseInt(result1[0]["total"], 10, 64)
+		var datainfo DataInfo
+		datainfo.Items = result
+		datainfo.CurrentItemCount = total
+		datainfo.PageIndex = page.CurrentPage
+		datainfo.ItemsPerPage = page.Size
+		this.Data["json"] = &datainfo
+		this.ServeJSON()
+
+	}
+}

+ 3 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/supplierdataentry.go

@@ -258,9 +258,10 @@ func (this *SupplierDataEntryController) DocExport() {
 // @Title 导出数据到word,作为导出pdf的中间步骤
 // @Title 导出数据到word,作为导出pdf的中间步骤
 // @Description 数据存入word
 // @Description 数据存入word
 // @Success	200	{object} controllers.Request
 // @Success	200	{object} controllers.Request
-// @router /exportpdf/:tbid [post]
+// @router /exportpdf/:tbid/:typecode  [post]
 func (this *SupplierDataEntryController) PdfExport() {
 func (this *SupplierDataEntryController) PdfExport() {
 	Id := this.Ctx.Input.Param(":tbid")
 	Id := this.Ctx.Input.Param(":tbid")
+	SupplierTypeCode := this.Ctx.Input.Param(":typecode")
 	var Url string
 	var Url string
 	var fileName string
 	var fileName string
 	var model1 supplierdataentry.SupplierDataEntry
 	var model1 supplierdataentry.SupplierDataEntry
@@ -269,7 +270,7 @@ func (this *SupplierDataEntryController) PdfExport() {
 	svc := supplierdataentry.GetSupplierDataEntryService(utils.DBE)
 	svc := supplierdataentry.GetSupplierDataEntryService(utils.DBE)
 	where1 := "1=1"
 	where1 := "1=1"
 	where1 += " AND Id = '" + Id + "'"
 	where1 += " AND Id = '" + Id + "'"
-	where2 := "SupplierId = '" + Id + "'"
+	where2 := "SupplierId = '" + Id + "' and SupplierTypecode='"+ SupplierTypeCode +"'"
 	svc.GetEntityByWhere(OilSupplierName, where1, &model1)
 	svc.GetEntityByWhere(OilSupplierName, where1, &model1)
 	svc.GetEntityByWhere(OilSupplierCertName, where2, &model2)
 	svc.GetEntityByWhere(OilSupplierCertName, where2, &model2)
 
 

+ 3 - 3
src/dashoo.cn/frontend_web/src/api/oilsupplier/dataentry.js

@@ -1,13 +1,13 @@
 export default {
 export default {
-  docexport(tbid, myAxios){
+  docexport (tbid, myAxios) {
     return myAxios({
     return myAxios({
       url: '/supplierdataentry/exportword/' + tbid,
       url: '/supplierdataentry/exportword/' + tbid,
       method: 'post'
       method: 'post'
     })
     })
   },
   },
-  pdfexport(tbid, myAxios){
+  pdfexport (tbid, typecode, myAxios) {
     return myAxios({
     return myAxios({
-      url: '/supplierdataentry/exportpdf/' + tbid,
+      url: '/supplierdataentry/exportpdf/' + tbid + '/' + typecode,
       method: 'post'
       method: 'post'
     })
     })
   }
   }

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

@@ -901,7 +901,7 @@ export default {
     },
     },
     //导出准入范围到pdf
     //导出准入范围到pdf
     toPdf (val) {
     toPdf (val) {
-      dataapi.pdfexport(val.Id, this.$axios)
+      dataapi.pdfexport(val.Id, val.SupplierTypeCode, this.$axios)
         .then(res => {
         .then(res => {
           // response
           // response
           if (res.data.code === 0) {
           if (res.data.code === 0) {

+ 127 - 0
src/dashoo.cn/frontend_web/src/pages/select/zrfwselect/basislist.vue

@@ -0,0 +1,127 @@
+<template>
+  <div>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span style="font-weight: bold">准入范围</span>
+      </div>
+      <el-table :data="basisList" border size="mini">
+        <el-table-column prop="Code" label="分类编码" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="Name" label="分类名称" show-overflow-tooltip></el-table-column>
+      </el-table>
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="currentPage"
+        :page-sizes="[10, 50, 100, 200, 400]"
+        :page-size="size"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="currentItemCount"
+      ></el-pagination>
+    </el-card>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+import dataapi from "@/api/oilsupplier/dataentry";
+export default {
+  name: "BasisList",
+  components: {},
+  props: {},
+  watch: {},
+  data() {
+    return {
+      basisList: [],
+      size: 10,
+      currentPage: 1,
+      currentItemCount: 0,
+      SupplierTypeCode: "",
+      SupplierId:""
+    };
+  },
+  methods: {
+    initData() {
+      let _this = this;
+      const params = {
+        SupplierTypeCode: this.SupplierTypeCode,
+        _currentPage: this.currentPage,
+        _size: this.size
+      };
+      this.$axios
+        .get("/select/zrfwselect", {
+          params
+        })
+        .then(res => {
+          _this.SupplierId = res.data.items[0].SupplierId;
+          _this.basisList = res.data.items;
+          _this.currentItemCount = res.data.currentItemCount;
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    },
+
+    getvalue(SupplierTypeCode) {
+      this.SupplierTypeCode = SupplierTypeCode;
+      this.initData();
+    },
+    handleSizeChange(value) {
+      this.size = value;
+      this.currentPage = 1;
+      this.initData();
+    },
+    handleCurrentChange(value) {
+      this.currentPage = value;
+      this.initData();
+    },
+    toPdf() {
+      dataapi
+        .pdfexport(this.SupplierId, "02", this.$axios)
+        .then(res => {
+          // response
+          if (res.data.code === 0) {
+            // this.$message({
+            //   type: 'success'
+            //   message: res.data.message
+            // })
+            let docurl = res.data.item;
+            let pdfurl;
+            // 内网服务器专用
+            if (process.client && docurl.indexOf("upfile") === 0) {
+              const myDomain = window.location.host;
+              // location.href = 'http://' + myDomain + '/' + docurl
+              pdfurl = "http://" + myDomain + "/" + docurl;
+              let requestParams = {
+                pdfUrl: pdfurl,
+                watermark: "猪刚烈烧饼"
+              };
+              this.$axios
+                .post("supplierdataentry/word-to-pdf-watermark", requestParams)
+                .then(function(res) {
+                  window.open("http://" + myDomain + "/" + res.data);
+                });
+            } else {
+              // location.href = 'http://' + docurl
+              pdfurl = "http://" + docurl;
+              let requestParams = {
+                pdfUrl: pdfurl,
+                watermark: "猪刚烈烧饼"
+              };
+              this.$axios
+                .post("supplierdataentry/word-to-pdf-watermark", requestParams)
+                .then(function(res) {
+                  window.open("http://" + res.data);
+                });
+            }
+          }
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    }
+  }
+};
+</script>
+
+<style>
+</style>

+ 127 - 0
src/dashoo.cn/frontend_web/src/pages/select/zrfwselect/goodslist.vue

@@ -0,0 +1,127 @@
+<template>
+  <div>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span style="font-weight: bold">准入范围</span>
+      </div>
+      <el-table :data="goodsList" border size="mini">
+        <el-table-column prop="Code" label="分类编码" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="Name" label="分类名称" show-overflow-tooltip></el-table-column>
+      </el-table>
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="currentPage"
+        :page-sizes="[10, 50, 100, 200, 400]"
+        :page-size="size"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="currentItemCount"
+      ></el-pagination>
+    </el-card>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+import dataapi from "@/api/oilsupplier/dataentry";
+export default {
+  name: "GoodsList",
+  components: {},
+  props: {},
+  watch: {},
+  data() {
+    return {
+      goodsList: [],
+      size: 10,
+      currentPage: 1,
+      currentItemCount: 0,
+      SupplierTypeCode: "",
+      SupplierId:""
+    };
+  },
+  methods: {
+    initData() {
+      let _this = this;
+      const params = {
+        SupplierTypeCode: this.SupplierTypeCode,
+        _currentPage: this.currentPage,
+        _size: this.size
+      };
+      this.$axios
+        .get("/select/zrfwselect", {
+          params
+        })
+        .then(res => {
+          _this.SupplierId=res.data.items[0].SupplierId
+          _this.goodsList = res.data.items;
+          _this.currentItemCount = res.data.currentItemCount;
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    },
+
+    getvalue(SupplierTypeCode) {
+      this.SupplierTypeCode = SupplierTypeCode;
+      this.initData();
+    },
+    handleSizeChange(value) {
+      this.size = value;
+      this.currentPage = 1;
+      this.initData();
+    },
+    handleCurrentChange(value) {
+      this.currentPage = value;
+      this.initData();
+    },
+    toPdf() {
+      dataapi
+        .pdfexport(this.SupplierId, "01", this.$axios)
+        .then(res => {
+          // response
+          if (res.data.code === 0) {
+            // this.$message({
+            //   type: 'success'
+            //   message: res.data.message
+            // })
+            let docurl = res.data.item;
+            let pdfurl;
+            // 内网服务器专用
+            if (process.client && docurl.indexOf("upfile") === 0) {
+              const myDomain = window.location.host;
+              // location.href = 'http://' + myDomain + '/' + docurl
+              pdfurl = "http://" + myDomain + "/" + docurl;
+              let requestParams = {
+                pdfUrl: pdfurl,
+                watermark: "猪刚烈烧饼"
+              };
+              this.$axios
+                .post("supplierdataentry/word-to-pdf-watermark", requestParams)
+                .then(function(res) {
+                  window.open("http://" + myDomain + "/" + res.data);
+                });
+            } else {
+              // location.href = 'http://' + docurl
+              pdfurl = "http://" + docurl;
+              let requestParams = {
+                pdfUrl: pdfurl,
+                watermark: "猪刚烈烧饼"
+              };
+              this.$axios
+                .post("supplierdataentry/word-to-pdf-watermark", requestParams)
+                .then(function(res) {
+                  window.open("http://" + res.data);
+                });
+            }
+          }
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    }
+  }
+};
+</script>
+
+<style>
+</style>

+ 103 - 0
src/dashoo.cn/frontend_web/src/pages/select/zrfwselect/index.vue

@@ -0,0 +1,103 @@
+<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="position:relative">
+      <div slot="header">
+        <span>
+          <i class="icon icon-table2"></i> 准入范围查询
+        </span>
+        <span style="float: right;">
+          <el-button type="primary" @click="toPdf" size="mini">准入范围打印</el-button>
+        </span>
+      </div>
+
+      <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
+        <el-tab-pane label="物资类" name="first">
+          <goods-list ref="goodsList" height="360px" style="margin-top: 20px"></goods-list>
+        </el-tab-pane>
+
+        <el-tab-pane label="基建类" name="second">
+          <basis-list ref="basisList" height="360px" style="margin-top: 20px"></basis-list>
+        </el-tab-pane>
+
+        <el-tab-pane label="技术服务类" name="third">
+          <tech-list ref="techList" height="360px" style="margin-top: 20px"></tech-list>
+        </el-tab-pane>
+      </el-tabs>
+    </el-card>
+  </div>
+</template>
+
+
+<script>
+import { mapGetters } from "vuex";
+import api from "@/api/oilsupplier/select";
+import FileSaver from "file-saver";
+import XLSX from "xlsx";
+import GoodsList from "@/pages/select/zrfwselect/goodslist";
+import BasisList from "@/pages/select/zrfwselect/basislist";
+import TechList from "@/pages/select/zrfwselect/techlist";
+
+
+export default {
+  components: {
+    GoodsList,
+    BasisList,
+    TechList
+  },
+  computed: {
+    ...mapGetters({
+      authUser: "authUser"
+    })
+  },
+  data() {
+    return {
+      // 分页参数
+      activeName: "first",
+      tabinx: "0",
+      size: 10,
+      currentPage: 1,
+      currentItemCount: 0
+    };
+  },
+  mounted() {
+    this.initDatas("0");
+  },
+  methods: {
+    initDatas(val) {
+      if (val == "0") {
+        this.$refs["goodsList"].getvalue("01");
+      } else if (val == "1") {
+        this.$refs["basisList"].getvalue("02");
+      } else {
+        this.$refs["techList"].getvalue("03");
+      }
+    },
+
+    handleClick(tab) {
+      this.currentPage = 1;
+      this.size = 10;
+      this.tabinx = tab.index;
+      this.initDatas(tab.index);
+    },
+    toPdf() {
+       if (this.tabinx == "0") {
+        this.$refs["goodsList"].toPdf();
+      } else if (this.tabinx == "1") {
+        this.$refs["basisList"].toPdf();
+      } else {
+        this.$refs["techList"].toPdf();
+      }
+    }
+  }
+};
+</script>
+
+<style>
+</style>

+ 127 - 0
src/dashoo.cn/frontend_web/src/pages/select/zrfwselect/techlist.vue

@@ -0,0 +1,127 @@
+<template>
+  <div>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span style="font-weight: bold">准入范围</span>
+      </div>
+      <el-table :data="techList" border size="mini">
+        <el-table-column prop="Code" label="分类编码" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="Name" label="分类名称" show-overflow-tooltip></el-table-column>
+      </el-table>
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="currentPage"
+        :page-sizes="[10, 50, 100, 200, 400]"
+        :page-size="size"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="currentItemCount"
+      ></el-pagination>
+    </el-card>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+import dataapi from "@/api/oilsupplier/dataentry";
+export default {
+  name: "TechList",
+  components: {},
+  props: {},
+  watch: {},
+  data() {
+    return {
+      techList: [],
+      size: 10,
+      currentPage: 1,
+      currentItemCount: 0,
+      SupplierTypeCode: "",
+      SupplierId:""
+    };
+  },
+  methods: {
+    initData() {
+      let _this = this;
+      const params = {
+        SupplierTypeCode: this.SupplierTypeCode,
+        _currentPage: this.currentPage,
+        _size: this.size
+      };
+      this.$axios
+        .get("/select/zrfwselect", {
+          params
+        })
+        .then(res => {
+          _this.SupplierId = res.data.items[0].SupplierId;
+          _this.techList = res.data.items;
+          _this.currentItemCount = res.data.currentItemCount;
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    },
+
+    getvalue(SupplierTypeCode) {
+      this.SupplierTypeCode = SupplierTypeCode;
+      this.initData();
+    },
+    handleSizeChange(value) {
+      this.size = value;
+      this.currentPage = 1;
+      this.initData();
+    },
+    handleCurrentChange(value) {
+      this.currentPage = value;
+      this.initData();
+    },
+    toPdf() {
+      dataapi
+        .pdfexport(this.SupplierId, "03", this.$axios)
+        .then(res => {
+          // response
+          if (res.data.code === 0) {
+            // this.$message({
+            //   type: 'success'
+            //   message: res.data.message
+            // })
+            let docurl = res.data.item;
+            let pdfurl;
+            // 内网服务器专用
+            if (process.client && docurl.indexOf("upfile") === 0) {
+              const myDomain = window.location.host;
+              // location.href = 'http://' + myDomain + '/' + docurl
+              pdfurl = "http://" + myDomain + "/" + docurl;
+              let requestParams = {
+                pdfUrl: pdfurl,
+                watermark: "猪刚烈烧饼"
+              };
+              this.$axios
+                .post("supplierdataentry/word-to-pdf-watermark", requestParams)
+                .then(function(res) {
+                  window.open("http://" + myDomain + "/" + res.data);
+                });
+            } else {
+              // location.href = 'http://' + docurl
+              pdfurl = "http://" + docurl;
+              let requestParams = {
+                pdfUrl: pdfurl,
+                watermark: "猪刚烈烧饼"
+              };
+              this.$axios
+                .post("supplierdataentry/word-to-pdf-watermark", requestParams)
+                .then(function(res) {
+                  window.open("http://" + res.data);
+                });
+            }
+          }
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    }
+  }
+};
+</script>
+
+<style>
+</style>