Browse Source

查询准入范围

Signed-off-by: lijunqing <lijunqing@dashoo.cn>
lijunqing 6 năm trước cách đây
mục cha
commit
78d80c37b2

+ 7 - 3
src/dashoo.cn/backend/api/controllers/oilsupplier/select.go

@@ -408,10 +408,8 @@ func (this *SelectController) ZrfwSelect() {
 	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
@@ -421,6 +419,12 @@ func (this *SelectController) ZrfwSelect() {
 		datainfo.ItemsPerPage = page.Size
 		this.Data["json"] = &datainfo
 		this.ServeJSON()
-
+	}else{
+		var datainfo DataInfo
+		datainfo.Items = ""
+		datainfo.PageIndex = page.CurrentPage
+		datainfo.ItemsPerPage = page.Size
+		this.Data["json"] = &datainfo
+		this.ServeJSON()
 	}
 }

+ 19 - 5
src/dashoo.cn/frontend_web/src/pages/select/zrfwselect/basislist.vue

@@ -25,6 +25,11 @@
 import { mapGetters } from "vuex";
 import dataapi from "@/api/oilsupplier/dataentry";
 export default {
+  computed: {
+    ...mapGetters({
+      authUser: "authUser"
+    })
+  },
   name: "BasisList",
   components: {},
   props: {},
@@ -52,9 +57,11 @@ export default {
           params
         })
         .then(res => {
-          _this.SupplierId = res.data.items[0].SupplierId;
-          _this.basisList = res.data.items;
-          _this.currentItemCount = res.data.currentItemCount;
+          if (res.data.items != null) {
+            _this.SupplierId = res.data.items[0].SupplierId;
+            _this.basisList = res.data.items;
+            _this.currentItemCount = res.data.currentItemCount;
+          }
         })
         .catch(err => {
           console.error(err);
@@ -75,6 +82,13 @@ export default {
       this.initData();
     },
     toPdf() {
+      if (this.SupplierId == "") {
+        this.$message({
+          type: "warning",
+          message: "请先准入申请"
+        });
+        return;
+      }
       dataapi
         .pdfexport(this.SupplierId, "02", this.$axios)
         .then(res => {
@@ -93,7 +107,7 @@ export default {
               pdfurl = "http://" + myDomain + "/" + docurl;
               let requestParams = {
                 pdfUrl: pdfurl,
-                watermark: "猪刚烈烧饼"
+                watermark: this.authUser.Profile.Realname
               };
               this.$axios
                 .post("supplierdataentry/word-to-pdf-watermark", requestParams)
@@ -105,7 +119,7 @@ export default {
               pdfurl = "http://" + docurl;
               let requestParams = {
                 pdfUrl: pdfurl,
-                watermark: "猪刚烈烧饼"
+                watermark: this.authUser.Profile.Realname
               };
               this.$axios
                 .post("supplierdataentry/word-to-pdf-watermark", requestParams)

+ 19 - 5
src/dashoo.cn/frontend_web/src/pages/select/zrfwselect/goodslist.vue

@@ -25,6 +25,11 @@
 import { mapGetters } from "vuex";
 import dataapi from "@/api/oilsupplier/dataentry";
 export default {
+  computed: {
+    ...mapGetters({
+      authUser: "authUser"
+    })
+  },
   name: "GoodsList",
   components: {},
   props: {},
@@ -52,9 +57,11 @@ export default {
           params
         })
         .then(res => {
-          _this.SupplierId=res.data.items[0].SupplierId
-          _this.goodsList = res.data.items;
-          _this.currentItemCount = res.data.currentItemCount;
+          if (res.data.items != null) {
+            _this.SupplierId = res.data.items[0].SupplierId;
+            _this.goodsList = res.data.items;
+            _this.currentItemCount = res.data.currentItemCount;
+          }
         })
         .catch(err => {
           console.error(err);
@@ -75,6 +82,13 @@ export default {
       this.initData();
     },
     toPdf() {
+      if (this.SupplierId == "") {
+        this.$message({
+          type: "warning",
+          message: "请先准入申请"
+        });
+        return;
+      }
       dataapi
         .pdfexport(this.SupplierId, "01", this.$axios)
         .then(res => {
@@ -93,7 +107,7 @@ export default {
               pdfurl = "http://" + myDomain + "/" + docurl;
               let requestParams = {
                 pdfUrl: pdfurl,
-                watermark: "猪刚烈烧饼"
+                watermark: this.authUser.Profile.Realname
               };
               this.$axios
                 .post("supplierdataentry/word-to-pdf-watermark", requestParams)
@@ -105,7 +119,7 @@ export default {
               pdfurl = "http://" + docurl;
               let requestParams = {
                 pdfUrl: pdfurl,
-                watermark: "猪刚烈烧饼"
+                watermark: this.authUser.Profile.Realname
               };
               this.$axios
                 .post("supplierdataentry/word-to-pdf-watermark", requestParams)

+ 19 - 5
src/dashoo.cn/frontend_web/src/pages/select/zrfwselect/techlist.vue

@@ -25,6 +25,11 @@
 import { mapGetters } from "vuex";
 import dataapi from "@/api/oilsupplier/dataentry";
 export default {
+  computed: {
+    ...mapGetters({
+      authUser: "authUser"
+    })
+  },
   name: "TechList",
   components: {},
   props: {},
@@ -52,9 +57,11 @@ export default {
           params
         })
         .then(res => {
-          _this.SupplierId = res.data.items[0].SupplierId;
-          _this.techList = res.data.items;
-          _this.currentItemCount = res.data.currentItemCount;
+          if (res.data.items != null) {
+            _this.SupplierId = res.data.items[0].SupplierId;
+            _this.techList = res.data.items;
+            _this.currentItemCount = res.data.currentItemCount;
+          }
         })
         .catch(err => {
           console.error(err);
@@ -75,6 +82,13 @@ export default {
       this.initData();
     },
     toPdf() {
+      if (this.SupplierId == "") {
+        this.$message({
+          type: "warning",
+          message: "请先准入申请"
+        });
+        return;
+      }
       dataapi
         .pdfexport(this.SupplierId, "03", this.$axios)
         .then(res => {
@@ -93,7 +107,7 @@ export default {
               pdfurl = "http://" + myDomain + "/" + docurl;
               let requestParams = {
                 pdfUrl: pdfurl,
-                watermark: "猪刚烈烧饼"
+                watermark: this.authUser.Profile.Realname
               };
               this.$axios
                 .post("supplierdataentry/word-to-pdf-watermark", requestParams)
@@ -105,7 +119,7 @@ export default {
               pdfurl = "http://" + docurl;
               let requestParams = {
                 pdfUrl: pdfurl,
-                watermark: "猪刚烈烧饼"
+                watermark: this.authUser.Profile.Realname
               };
               this.$axios
                 .post("supplierdataentry/word-to-pdf-watermark", requestParams)