Selaa lähdekoodia

基建类添加业务,添加文件

shihang 6 vuotta sitten
vanhempi
commit
5e51892d53

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

@@ -6,6 +6,7 @@ import (
 
 	"dashoo.cn/backend/api/business/baseUser"
 	"dashoo.cn/business/userRole"
+
 	//"dashoo.cn/backend/api/business/items"
 	"dashoo.cn/backend/api/business/oilsupplier/basisbuild"
 	. "dashoo.cn/backend/api/controllers"
@@ -266,3 +267,34 @@ func (this *OilBasisBuildController) DeleteEntity() {
 		this.ServeJSON()
 	}
 }
+
+// @Title 基建类业务
+// @Description get user by token
+// @Success 200 {object} models.Userblood
+// @router /basiclist [get]
+func (this *OilBasisBuildController) BasicList() {
+	page := this.GetPageInfoForm()
+	var list []basisbuild.OilBasisBuild
+	svc := basisbuild.GetOilBasisBuildService(utils.DBE)
+	where := " 1=1"
+	orderby := "Id"
+	asc := false
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "asc" {
+			asc = true
+		}
+	}
+	keyword := this.GetString("keyword")
+	if keyword != "" {
+		where = where + " and Name like '%" + keyword + "%'"
+	}
+	total := svc.GetPagingEntitiesWithoutAccCode(page.CurrentPage, page.Size, orderby, asc, &list, where)
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}

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

@@ -48,7 +48,7 @@
           </el-col>
           <el-col :span="12" v-if="SubClassId == '3'">
             <el-form-item label="名称" required>
-              <el-input placeholder="请选择名称" v-model="BusinessForm.Code" style="width:100%">
+              <el-input placeholder="请选择名称" v-model="BusinessForm.Name" style="width:100%">
                 <el-button type="primary" style="width:30%" @click="basicDialog = true" slot="append">选择
                 </el-button>
               </el-input>
@@ -90,23 +90,19 @@
           <el-input size="mini" style="width: 165px;" v-model="keyword" placeholder="请输入业务名称"></el-input>
         </el-form-item>
       </el-form>
-      <el-table :data="businessList" @selection-change="handleSelectionChange">
-        <el-table-column type="selection" width="55"></el-table-column>
+      <el-table :data="techList">
         <el-table-column label="操作" width="70" align="center" fixed>
           <template slot-scope="scope">
-            <el-button type="text" title="编辑" size="small" icon="el-icon-edit" @click="openDialog(scope.row)">
-            </el-button>
-            <el-button size="small" type="text" style="margin-left:3px" icon="el-icon-delete" title="删除"
-              @click="deletedata(scope.row)"></el-button>
+            <el-button type="text" size="small" @click="getChooseCode(scope.row)">选择</el-button>
           </template>
         </el-table-column>
         <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-column prop="Remark" label="备注" show-overflow-tooltip></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 @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-dialog>
@@ -177,6 +173,10 @@
         size: 10,
         currentItemCount: 0,
         basicDialog: false,
+        keyword: '',
+        CurrentPage: 1, // 分页
+        Size: 10,
+        CurrentItemCount: 0,
 
         cersubId: '', //对应的证书分类ID
         subfileList: [], //文档
@@ -343,7 +343,13 @@
               console.error(err)
             })
         } else if (_this.SubClassId == '2') { //获取技术服务类业务列表
-          this.$axios.get('technologyservice/businesslist', {})
+          const params = {
+            _currentPage: 1,
+            _size: 1000,
+          }
+          this.$axios.get('technologyservice/businesslist', {
+              params
+            })
             .then(res => {
               _this.techList = res.data.items
               _this.techTreeList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
@@ -352,7 +358,24 @@
               // handle error
               console.error(err)
             })
-        } else {}
+        } else if (_this.SubClassId == '3') { //获取基建类业务列表
+          const params = {
+            keyword: this.keyword,
+            _currentPage: this.CurrentPage,
+            _size: this.Size,
+          }
+          this.$axios.get('basisbuild/basiclist', {
+              params
+            })
+            .then(res => {
+              _this.techList = res.data.items
+              _this.CurrentItemCount = res.data.currentItemCount
+            })
+            .catch(err => {
+              // handle error
+              console.error(err)
+            })
+        }
       },
       getCode() {
         for (var i = 0; i < this.techList.length; i++) {
@@ -390,6 +413,11 @@
           }
         }
       },
+      getChooseCode(val) {
+        this.BusinessForm.Code = val.Code
+        this.BusinessForm.Name = val.Name
+        this.basicDialog = false
+      },
 
       handleSelectionChange(val) {
         this.selectBusiness = val
@@ -418,6 +446,19 @@
         this.currentPage = value
         this.initData()
       },
+      HandleSizeChange(value) {
+        this.Size = value
+        this.CurrentPage = 1
+        this.getbusiness()
+      },
+      HandleCurrentChange(value) {
+        this.CurrentPage = value
+        this.getbusiness()
+      },
+      seachdata() {
+        this.CurrentPage = -1
+        this.getbusiness()
+      },
       jstimehandle(val) {
         if (val === '') {
           return '----'