Explorar o código

准入范围查询

shihang %!s(int64=6) %!d(string=hai) anos
pai
achega
d3c31e05ac

+ 2 - 2
src/dashoo.cn/backend/api/business/oilsupplier/technologyservice/oiltechnologyserviceService.go

@@ -54,13 +54,13 @@ func (s *OilTechnologyServiceService) GetMyPagingEntitiesWithOrderBytbl(tableNam
 	return total
 }
 
-func (s *OilTechnologyServiceService) GetTechList(goodsclass, where string) []TechnologyBusiness {
+func (s *OilTechnologyServiceService) GetTechList(techclass, where string) []TechnologyBusiness {
 	if where == "" {
 		where = " 1=1 "
 	}
 	var sql string
 	sql = `select Id, Code, Name, concat(Code, '  ', Name) as CodeName, ParentId, Remark, DeletionStateCode  
-	from ` + goodsclass + ` where ` + where + `  order by Code asc `
+	from ` + techclass + ` where ` + where + `  order by Code asc `
 	List := make([]TechnologyBusiness, 0)
 	utils.DBE.Sql(sql).Find(&List)
 	return List

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

@@ -311,7 +311,7 @@ func (this *OilBasisBuildController) BasicList() {
 	}
 	keyword := this.GetString("keyword")
 	if keyword != "" {
-		where = where + " and Name like '%" + keyword + "%'"
+		where = where + " and Name like '%" + keyword + "%' or Code like '%" + keyword + "%'"
 	}
 	total := svc.GetPagingEntitiesWithoutAccCode(page.CurrentPage, page.Size, orderby, asc, &list, where)
 	var datainfo DataInfo

+ 5 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/technologyservice.go

@@ -407,8 +407,12 @@ func (this *OilTechnologyServiceController) DeleteEntity() {
 // @Success 200 {object} sampletype.SampleType
 // @router /techbuslist [get]
 func (this *OilTechnologyServiceController) TechbusList() {
-	svc := technologyservice.GetOilTechnologyServiceService(utils.DBE)
+	keyword := this.GetString("keyword")
 	where := " 1 = 1 "
+	if keyword != "" {
+		where = where + " and Code like '%" + keyword + "%' or Name like '%" + keyword + "%'"
+	}
+	svc := technologyservice.GetOilTechnologyServiceService(utils.DBE)
 	var list []technologyservice.TechnologyBusiness
 	//获取技术服务类资质分类层级信息
 	list = svc.GetTechList(OilTechnologyServiceClassName, where)

+ 143 - 143
src/dashoo.cn/frontend_web/src/components/oilsupplier/businesslist.vue

@@ -28,16 +28,16 @@
     </el-card>
 
     <el-dialog :title="Title" :visible.sync="visible" top="5vh">
-      <el-form ref="BusinessForm" :rules="formRules" :model="BusinessForm" label-width="100px">
+      <el-form ref="BusinessForm" :model="BusinessForm" label-width="100px">
         <el-row>
-          <el-col :span="12" v-if="SupplierTypeCode == '01' && Title == '新增准入范围'">
+          <!-- <el-col :span="12" v-if="SupplierTypeCode == '01' && Title == '新增准入范围'">
             <el-form-item label="名称" prop="checkName">
               <el-cascader ref="cascader" :options="optionsList" style="width:100%" :props="goodsProps"
                 :show-all-levels="false" v-model="selectedOptList" @active-item-change="getChildrens"
                 @change="getGoodsCode" placeholder="请选择分类">
               </el-cascader>
             </el-form-item>
-          </el-col>
+          </el-col> -->
           <el-col :span="12" v-if="SupplierTypeCode == '02' && Title == '新增准入范围'">
             <el-form-item label="名称" required>
               <el-input placeholder="请选择名称" v-model="BusinessForm.Name" style="width:100%">
@@ -46,12 +46,12 @@
               </el-input>
             </el-form-item>
           </el-col>
-          <el-col :span="12" v-if="SupplierTypeCode == '03' && Title == '新增准入范围'">
+          <!-- <el-col :span="12" v-if="SupplierTypeCode == '03' && Title == '新增准入范围'">
             <el-form-item label="名称" required>
               <el-cascader :options="techTreeList" :props="orgtreeprops" change-on-select :show-all-levels="false"
                 v-model="selectedorg" placeholder="请选择菜单" @change="getCode()" style="width:100%"></el-cascader>
             </el-form-item>
-          </el-col>
+          </el-col> -->
           <el-col :span="12" v-if="Title == '编辑准入范围'">
             <el-form-item label="名称">
               <el-input v-model="BusinessForm.Name" placeholder="请输入名称" disabled></el-input>
@@ -71,7 +71,7 @@
       </el-form>
       <div slot="footer" class="dialog-footer" style="margin-top:-30px;">
         <el-button @click="visible = false">取 消</el-button>
-        <el-button type="primary" @click="savedata()">确 定</el-button>
+        <el-button type="primary" @click="addBasicBus()">确 定</el-button>
       </div>
     </el-dialog>
 
@@ -143,31 +143,31 @@
 
         businessList: [],
         techList: [],
-        techTreeList: [],
-        orgtreeprops: {
-          value: 'id',
-          label: 'Name',
-          children: 'children'
-        },
-        selectedorg: [],
+        // techTreeList: [],
+        // orgtreeprops: {
+        //   value: 'id',
+        //   label: 'Name',
+        //   children: 'children'
+        // },
+        // selectedorg: [],
         ClassId: '',
 
         //物资类懒加载
-        optionsList: [], //物资类层级列表
-        selectedOptList: [], //已选择的物资类列表
-        goodsProps: {
-          value: 'id',
-          label: 'Name',
-          children: 'children'
-        },
+        // optionsList: [], //物资类层级列表
+        // selectedOptList: [], //已选择的物资类列表
+        // goodsProps: {
+        //   value: 'id',
+        //   label: 'Name',
+        //   children: 'children'
+        // },
         //物资类表单规则
-        formRules: {
-          checkName: [{
-            required: true,
-            validator: CheckSelectedOption,
-            trigger: 'blur'
-          }],
-        },
+        // formRules: {
+        //   checkName: [{
+        //     required: true,
+        //     validator: CheckSelectedOption,
+        //     trigger: 'blur'
+        //   }],
+        // },
 
         Title: '',
         BusinessForm: {
@@ -221,56 +221,56 @@
             console.error(err)
           })
       },
-      savedata() {
-        if (this.Title === '新增准入范围') {
-          if (this.BusinessForm.SupplierTypeCode == '01') {
-            this.addGoodsBus()
-          } else if (this.BusinessForm.SupplierTypeCode == '02') {
-            this.addBasicBus()
-          } else {
-            this.addBusiness()
-          }
-        } else if (this.Title === '编辑准入范围') {
-          this.editBusiness()
-        }
-      },
-      addGoodsBus() {
-        let _this = this
-        let arr = []
-        arr = _this.$refs['cascader'].currentLabels
-        _this.BusinessForm.Name = arr[arr.length - 1]
-        _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
-        _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
-        _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
-        //因为表单验证不能用,所以采用提示验证
-        if (_this.selectedOptList.length < 1) {
-          _this.$message({
-            type: 'warning',
-            message: '名称不能为空,请选择分类!'
-          })
-        } else {
-          _this.$axios.post('/suppliercertsub/addbusiness/', _this.BusinessForm)
-            .then(res => {
-              if (res.data.code === 0) {
-                _this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-                _this.BusinessForm.Id = res.data.item + ''
-                _this.visible = false
-                _this.initData()
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-            .catch(err => {
-              console.error(err)
-            })
-        }
-      },
+      // savedata() {
+        // if (this.Title === '新增准入范围') {
+        //   if (this.BusinessForm.SupplierTypeCode == '01') {
+        //     this.addGoodsBus()
+        //   } else if (this.BusinessForm.SupplierTypeCode == '02') {
+            // this.addBasicBus()
+        //   } else {
+        //     this.addBusiness()
+        //   }
+        // } else if (this.Title === '编辑准入范围') {
+        //   this.editBusiness()
+        // }
+      // },
+      // addGoodsBus() {
+      //   let _this = this
+      //   let arr = []
+      //   arr = _this.$refs['cascader'].currentLabels
+      //   _this.BusinessForm.Name = arr[arr.length - 1]
+      //   _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
+      //   _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
+      //   _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
+      //   //因为表单验证不能用,所以采用提示验证
+      //   if (_this.selectedOptList.length < 1) {
+      //     _this.$message({
+      //       type: 'warning',
+      //       message: '名称不能为空,请选择分类!'
+      //     })
+      //   } else {
+      //     _this.$axios.post('/suppliercertsub/addbusiness/', _this.BusinessForm)
+      //       .then(res => {
+      //         if (res.data.code === 0) {
+      //           _this.$message({
+      //             type: 'success',
+      //             message: res.data.message
+      //           })
+      //           _this.BusinessForm.Id = res.data.item + ''
+      //           _this.visible = false
+      //           _this.initData()
+      //         } else {
+      //           _this.$message({
+      //             type: 'warning',
+      //             message: res.data.message
+      //           })
+      //         }
+      //       })
+      //       .catch(err => {
+      //         console.error(err)
+      //       })
+      //   }
+      // },
       addBasicBus() {
         let _this = this
         _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
@@ -297,40 +297,40 @@
             console.error(err)
           })
       },
-      addBusiness() {
-        let _this = this
-        _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
-        _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
-        _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
-        //因为表单验证不能用,所以采用提示验证
-        if (_this.selectedorg.length < 1) {
-          _this.$message({
-            type: 'warning',
-            message: '名称不能为空,请选择分类!'
-          })
-        } else {
-          _this.$axios.post('/suppliercertsub/addbusiness/', _this.BusinessForm)
-            .then(res => {
-              if (res.data.code === 0) {
-                _this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-                _this.BusinessForm.Id = res.data.item + ''
-                _this.visible = false
-                _this.initData()
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-            .catch(err => {
-              console.error(err)
-            })
-        }
-      },
+      // addBusiness() {
+      //   let _this = this
+      //   _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
+      //   _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
+      //   _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
+      //   //因为表单验证不能用,所以采用提示验证
+      //   if (_this.selectedorg.length < 1) {
+      //     _this.$message({
+      //       type: 'warning',
+      //       message: '名称不能为空,请选择分类!'
+      //     })
+      //   } else {
+      //     _this.$axios.post('/suppliercertsub/addbusiness/', _this.BusinessForm)
+      //       .then(res => {
+      //         if (res.data.code === 0) {
+      //           _this.$message({
+      //             type: 'success',
+      //             message: res.data.message
+      //           })
+      //           _this.BusinessForm.Id = res.data.item + ''
+      //           _this.visible = false
+      //           _this.initData()
+      //         } else {
+      //           _this.$message({
+      //             type: 'warning',
+      //             message: res.data.message
+      //           })
+      //         }
+      //       })
+      //       .catch(err => {
+      //         console.error(err)
+      //       })
+      //   }
+      // },
       // editBusiness() {
       //   let _this = this
       //   _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
@@ -419,18 +419,18 @@
       // },
       getbusiness() {
         let _this = this
-        if (_this.SupplierTypeCode === '01') { // 获取物资类第一级分类
-          this.$axios.get('goodsaptitude/goodsparentlist', {})
-            .then(res => {
-              _this.optionsList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
-              _this.optionsList.forEach((item, index) => {
-                _this.$set(this.optionsList[index], 'children', [])
-              })
-            })
-            .catch(err => {
-              console.error(err)
-            })
-        } else if (_this.SupplierTypeCode === '02') { // 获取基建类业务列表
+        // if (_this.SupplierTypeCode === '01') { // 获取物资类第一级分类
+        //   this.$axios.get('goodsaptitude/goodsparentlist', {})
+        //     .then(res => {
+        //       _this.optionsList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
+        //       _this.optionsList.forEach((item, index) => {
+        //         _this.$set(this.optionsList[index], 'children', [])
+        //       })
+        //     })
+        //     .catch(err => {
+        //       console.error(err)
+        //     })
+        // } else if (_this.SupplierTypeCode === '02') { // 获取基建类业务列表
           const params = {
             keyword: this.keyword,
             _currentPage: this.CurrentPage,
@@ -446,16 +446,16 @@
             .catch(err => {
               console.error(err)
             })
-        } else if (_this.SupplierTypeCode === '03') { // 获取技术服务类业务列表
-          this.$axios.get('technologyservice/businesslist', {})
-            .then(res => {
-              _this.techList = res.data.items
-              _this.techTreeList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
-            })
-            .catch(err => {
-              console.error(err)
-            })
-        }
+        // } else if (_this.SupplierTypeCode === '03') { // 获取技术服务类业务列表
+        //   this.$axios.get('technologyservice/businesslist', {})
+        //     .then(res => {
+        //       _this.techList = res.data.items
+        //       _this.techTreeList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
+        //     })
+        //     .catch(err => {
+        //       console.error(err)
+        //     })
+        // }
       },
       //获取下一级所有分类
       getChildrens(val) {
@@ -509,16 +509,16 @@
           })
       },
 
-      getCode() {
-        this.ClassId = this.selectedorg[this.selectedorg.length - 1]
-        for (var i = 0; i < this.techList.length; i++) {
-          if (this.selectedorg[this.selectedorg.length - 1] === this.techList[i].Id) {
-            this.BusinessForm.SubClassId = this.techList[i].Id
-            this.BusinessForm.Name = this.techList[i].Name
-            this.BusinessForm.Code = this.techList[i].Code
-          }
-        }
-      },
+      // getCode() {
+      //   this.ClassId = this.selectedorg[this.selectedorg.length - 1]
+      //   for (var i = 0; i < this.techList.length; i++) {
+      //     if (this.selectedorg[this.selectedorg.length - 1] === this.techList[i].Id) {
+      //       this.BusinessForm.SubClassId = this.techList[i].Id
+      //       this.BusinessForm.Name = this.techList[i].Name
+      //       this.BusinessForm.Code = this.techList[i].Code
+      //     }
+      //   }
+      // },
       getChooseCode(val) {
         this.ClassId = val.Id
         this.BusinessForm.SubClassId = val.Id

+ 20 - 4
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist.vue

@@ -26,10 +26,16 @@
     </el-card>
 
     <el-dialog title="基建类业务列表" :visible.sync="goodsDialog" top="5vh">
-      <el-row :gutter="20" style="height: calc(100vh - 450px); overflow: auto;">
+      <el-row style="margin-top: -10px">
+        <el-col :span="12">
+          <el-input v-model="filterText" placeholder="请输入名称或代码" size="mini" style="width: 250px;"></el-input>
+          <!-- <el-button style="float: right;" type="primary" size="mini" @click="getorgtreelist()">查询</el-button> -->
+        </el-col>
+      </el-row>
+      <el-row :gutter="20" style="height: calc(100vh - 450px); overflow: auto; margin-top:20px">
         <el-col :span="20">
           <el-tree highlight-current :expand-on-click-node="true" node-key="CodeName" :data="orgtreelist"
-            :props="orgtreeprops" ref="orgmanagetree" show-checkbox lazy :load="getChildrens">
+            :props="orgtreeprops" ref="orgmanagetree" show-checkbox lazy :load="getChildrens" :filter-node-method="filterNode">
           </el-tree>
         </el-col>
       </el-row>
@@ -69,6 +75,11 @@
         session: 'session'
       })
     },
+    watch: {
+      filterText(val) {
+        this.$refs.orgmanagetree.filter(val);
+      }
+    },
     data() {
       return {
         SupplierId: 0,
@@ -87,6 +98,7 @@
         checkList: [],
         Remark: '',
 
+        filterText: '',
         visible: false,
         selfVisible: this.visible, // 避免vue双向绑定警告
         currentPage: 1, // 分页
@@ -218,7 +230,7 @@
           })
       },*/
       //获取下一级所有分类
-      getChildrens (val, resolve) {
+      getChildrens(val, resolve) {
         let Id = 0
         if (val.level === 0) {
           Id = 0
@@ -240,8 +252,12 @@
             console.error(err)
           })
       },
+      filterNode(value, data) {
+        if (!value) return true;
+        return data.CodeName.indexOf(value) !== -1;
+      },
 
-      handleSizeChange (value) {
+      handleSizeChange(value) {
         this.size = value
         this.currentPage = 1
         this.initData()

+ 15 - 4
src/dashoo.cn/frontend_web/src/components/oilsupplier/techlist.vue

@@ -26,7 +26,13 @@
     </el-card>
 
     <el-dialog title="技术服务类业务列表" :visible.sync="techDialog" top="5vh">
-      <el-row :gutter="20" style="height: calc(100vh - 450px); overflow: auto;">
+      <el-row style="margin-top: -10px">
+        <el-col :span="12">
+          <el-input v-model="keyword" placeholder="请输入名称或代码" size="mini" style="width: 250px;"></el-input>
+          <el-button style="float: right;" type="primary" size="mini" @click="getorgtreelist()">查询</el-button>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20" style="height: calc(100vh - 450px); overflow: auto; margin-top:20px">
         <el-col :span="20">
           <el-tree highlight-current :expand-on-click-node="true" node-key="CodeName" :data="orgtreelist"
             :props="orgtreeprops" ref="orgmanagetree" show-checkbox>
@@ -86,6 +92,7 @@
         checkList: [],
         Remark: '',
 
+        keyword: '',
         visible: false,
         selfVisible: this.visible, // 避免vue双向绑定警告
         currentPage: 1, // 分页
@@ -121,7 +128,7 @@
             console.error(err)
           })
       },
-      getChecklist () {
+      getChecklist() {
         let val = this.$refs.orgmanagetree.getCheckedNodes()
         this.checkList = []
         for (var i = 0; i < val.length; i++) {
@@ -150,7 +157,6 @@
           })
           return
         }
-        console.log("021r--================",params)
         _this.$axios.post('/suppliercertsub/addtechbus', params)
           .then(res => {
             if (res.data.code === 0) {
@@ -206,7 +212,12 @@
       },
       getorgtreelist() {
         let _this = this
-        this.$axios.get('technologyservice/techbuslist', {})
+        let params = {
+          keyword: _this.keyword
+        }
+        this.$axios.get('technologyservice/techbuslist', {
+            params
+          })
           .then(res => {
             _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Code,Name,CodeName')
           })