lining 6 年 前
コミット
e5e60adf94

+ 8 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/select.go

@@ -423,6 +423,7 @@ func (this *SelectController) ZrfwSelect() {
 	limitCurrent:=(page.CurrentPage-1)*page.Size
 	svc := selectbusiness.GetSelectService(utils.DBE)
 	supplierTypeCode := this.GetString("SupplierTypeCode")
+	certsub := this.GetString("certsub")
 
 	//企业用户必须加创建人条件
 	var registerUser register.OilCorporateInfo
@@ -435,10 +436,15 @@ func (this *SelectController) ZrfwSelect() {
 		svc.GetEntity(&company,sql1)
 	}
 
+	where := ""
+	if certsub != "" {
+		where = " and (Code like '%" + certsub + "%' or Name like '%" + certsub + "%')"
+	}
+
 	if company.SupplierName!=""{
-		sql2:="select distinct(Code),Name,SupplierId,CertSubStatus from OilSupplierCertSub where SupplierId='"+strconv.Itoa(company.Id)+"' and SupplierTypeCode='"+supplierTypeCode+"' order by CertSubStatus desc,Code asc limit "+strconv.FormatInt(limitCurrent,10)+","+strconv.FormatInt(page.Size,10)+""
+		sql2:="select distinct(Code),Name,SupplierId,CertSubStatus from OilSupplierCertSub where SupplierId='"+strconv.Itoa(company.Id)+"' and SupplierTypeCode='"+supplierTypeCode+"' " + where + " order by CertSubStatus desc,Code asc limit "+strconv.FormatInt(limitCurrent,10)+","+strconv.FormatInt(page.Size,10)+""
 		result,_:=svc.DBE.QueryString(sql2)
-		sql3:="select count(distinct(Code)) total from OilSupplierCertSub where SupplierId='"+strconv.Itoa(company.Id)+"' and SupplierTypeCode='"+supplierTypeCode+"'"
+		sql3:="select count(distinct(Code)) total from OilSupplierCertSub where SupplierId='"+strconv.Itoa(company.Id)+"' and SupplierTypeCode='"+supplierTypeCode+"'" + where
 		result1,_:=svc.DBE.QueryString(sql3)
 
 		total,_:= strconv.ParseInt(result1[0]["total"], 10, 64)

+ 8 - 2
src/dashoo.cn/frontend_web/src/pages/select/zrfwselect/basislist.vue

@@ -52,7 +52,10 @@ export default {
       currentPage: 1,
       currentItemCount: 0,
       SupplierTypeCode: '',
-      SupplierId: ''
+      SupplierId: '',
+      searchForm: {
+        certsub: ''
+      }
     }
   },
   methods: {
@@ -63,11 +66,13 @@ export default {
         _currentPage: this.currentPage,
         _size: this.size
       }
+      Object.assign(params, this.searchForm)
       this.$axios
         .get('/select/zrfwselect', {
           params
         })
         .then(res => {
+          _this.basisList = []
           if (res.data.items != null) {
             _this.SupplierId = res.data.items[0].SupplierId
             _this.basisList = res.data.items
@@ -79,8 +84,9 @@ export default {
         })
     },
 
-    getvalue (SupplierTypeCode) {
+    getvalue (SupplierTypeCode, certsub) {
       this.SupplierTypeCode = SupplierTypeCode
+      this.searchForm.certsub = certsub
       this.initData()
     },
     handleSizeChange (value) {

+ 10 - 4
src/dashoo.cn/frontend_web/src/pages/select/zrfwselect/goodslist.vue

@@ -33,8 +33,8 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex';
-import dataapi from '@/api/oilsupplier/dataentry';
+import { mapGetters } from 'vuex'
+import dataapi from '@/api/oilsupplier/dataentry'
 export default {
   computed: {
     ...mapGetters({
@@ -52,7 +52,10 @@ export default {
       currentPage: 1,
       currentItemCount: 0,
       SupplierTypeCode: '',
-      SupplierId: ''
+      SupplierId: '',
+      searchForm: {
+        certsub: ''
+      }
     }
   },
   methods: {
@@ -63,11 +66,13 @@ export default {
         _currentPage: this.currentPage,
         _size: this.size
       }
+      Object.assign(params, this.searchForm)
       this.$axios
         .get('/select/zrfwselect', {
           params
         })
         .then(res => {
+          _this.goodsList = []
           if (res.data.items != null) {
             _this.SupplierId = res.data.items[0].SupplierId
             _this.goodsList = res.data.items
@@ -79,8 +84,9 @@ export default {
         })
     },
 
-    getvalue (SupplierTypeCode) {
+    getvalue (SupplierTypeCode, certsub) {
       this.SupplierTypeCode = SupplierTypeCode
+      this.searchForm.certsub = certsub
       this.initData()
     },
     handleSizeChange (value) {

+ 42 - 32
src/dashoo.cn/frontend_web/src/pages/select/zrfwselect/index.vue

@@ -13,7 +13,15 @@
           <i class="icon icon-table2"></i> 准入范围查询
         </span>
         <span style="float: right;">
-          <el-button type="primary" @click="toPdf" size="mini">准入范围打印</el-button>
+          <el-form ref="form" :inline="true" style="margin-top: -10px">
+            <el-form-item>
+              <el-input size="mini" v-model="searchForm.certsub" placeholder="请输入资质名称或编码" style="width: 100%"></el-input>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" size="mini" style="margin-left: 8px" @click="search">查询</el-button>
+              <el-button type="primary" @click="toPdf" size="mini" style="margin-left: 25px">准入范围打印</el-button>
+            </el-form-item>
+          </el-form>
         </span>
       </div>
 
@@ -36,14 +44,10 @@
 
 
 <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";
-
+import { mapGetters } from 'vuex'
+import GoodsList from '@/pages/select/zrfwselect/goodslist'
+import BasisList from '@/pages/select/zrfwselect/basislist'
+import TechList from '@/pages/select/zrfwselect/techlist'
 
 export default {
   components: {
@@ -53,46 +57,52 @@ export default {
   },
   computed: {
     ...mapGetters({
-      authUser: "authUser"
+      authUser: 'authUser'
     })
   },
   data() {
     return {
       // 分页参数
-      activeName: "first",
-      tabinx: "0",
+      searchForm: {
+        certsub: ''
+      },
+      activeName: 'first',
+      tabinx: '0',
       size: 10,
       currentPage: 1,
       currentItemCount: 0
-    };
+    }
   },
-  mounted() {
-    this.initDatas("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");
+    search () {
+      this.initDatas(this.tabinx)
+    },
+    initDatas (val) {
+      if (val == '0') {
+        this.$refs['goodsList'].getvalue('01', this.searchForm.certsub)
+      } else if (val == '1') {
+        this.$refs['basisList'].getvalue('02', this.searchForm.certsub)
       } else {
-        this.$refs["techList"].getvalue("03");
+        this.$refs['techList'].getvalue('03', this.searchForm.certsub)
       }
     },
 
-    handleClick(tab) {
-      this.currentPage = 1;
-      this.size = 10;
-      this.tabinx = tab.index;
-      this.initDatas(tab.index);
+    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();
+    toPdf () {
+      if (this.tabinx == '0') {
+        this.$refs['goodsList'].toPdf()
+      } else if (this.tabinx == '1') {
+        this.$refs['basisList'].toPdf()
       } else {
-        this.$refs["techList"].toPdf();
+        this.$refs['techList'].toPdf()
       }
     }
   }

+ 8 - 2
src/dashoo.cn/frontend_web/src/pages/select/zrfwselect/techlist.vue

@@ -52,7 +52,10 @@ export default {
       currentPage: 1,
       currentItemCount: 0,
       SupplierTypeCode: '',
-      SupplierId: ''
+      SupplierId: '',
+      searchForm: {
+        certsub: ''
+      }
     }
   },
   methods: {
@@ -63,11 +66,13 @@ export default {
         _currentPage: this.currentPage,
         _size: this.size
       }
+      Object.assign(params, this.searchForm)
       this.$axios
         .get('/select/zrfwselect', {
           params
         })
         .then(res => {
+          _this.techList = []
           if (res.data.items != null) {
             _this.SupplierId = res.data.items[0].SupplierId
             _this.techList = res.data.items
@@ -79,8 +84,9 @@ export default {
         })
     },
 
-    getvalue (SupplierTypeCode) {
+    getvalue (SupplierTypeCode, certsub) {
       this.SupplierTypeCode = SupplierTypeCode
+      this.searchForm.certsub = certsub
       this.initData()
     },
     handleSizeChange (value) {