Browse Source

数据结构增加字段,

shihang 6 years ago
parent
commit
b58c133102

+ 15 - 14
src/dashoo.cn/backend/api/business/oilsupplier/suppliercertsub/oilsuppliercertsub.go

@@ -5,18 +5,19 @@ import (
 )
 
 type OilSupplierCertSub struct {
-	Id             int       `xorm:"not null pk autoincr INT(10)"`
-	SupplierId     int       `xorm:"not null comment('供方基本信息表主键') INT(10)"`
-	SupplierCertId int       `xorm:"not null comment('供方准入证书信息表主键') INT(10)"`
-	SubclassId     int       `xorm:"not null comment('分类表主键(物资类或基建类或技术服务类)') INT(10)"`
-	Code           string    `xorm:"not null default '' comment('分类编码') VARCHAR(8)"`
-	Name           string    `xorm:"not null default '' comment('分类名称') VARCHAR(50)"`
-	Remark         string    `xorm:"comment('备注') VARCHAR(500)"`
-	IsDelete       int       `xorm:"default 0 comment('删除状态,0正常,1已删除') INT(10)"`
-	CreateOn       time.Time `xorm:"DATETIME"`
-	CreateUserId   int       `xorm:"INT(10)"`
-	CreateBy       string    `xorm:"VARCHAR(50)"`
-	ModifiedOn     time.Time `xorm:"DATETIME"`
-	ModifiedUserId int       `xorm:"INT(10)"`
-	ModifiedBy     string    `xorm:"VARCHAR(50)"`
+	Id               int       `xorm:"not null pk autoincr INT(10)"`
+	SupplierId       int       `xorm:"not null comment('供方基本信息表主键') INT(10)"`
+	SupplierCertId   int       `xorm:"not null comment('供方准入证书信息表主键') INT(10)"`
+	SupplierTypeCode string    `xorm:"not null default '' comment('准入类别代码') VARCHAR(5)"`
+	SubclassId       int       `xorm:"not null comment('分类表主键(物资类或基建类或技术服务类)') INT(10)"`
+	Code             string    `xorm:"not null default '' comment('分类编码') VARCHAR(8)"`
+	Name             string    `xorm:"not null default '' comment('分类名称') VARCHAR(50)"`
+	Remark           string    `xorm:"comment('备注') VARCHAR(500)"`
+	IsDelete         int       `xorm:"default 0 comment('删除状态,0正常,1已删除') INT(10)"`
+	CreateOn         time.Time `xorm:"DATETIME"`
+	CreateUserId     int       `xorm:"INT(10)"`
+	CreateBy         string    `xorm:"VARCHAR(50)"`
+	ModifiedOn       time.Time `xorm:"DATETIME"`
+	ModifiedUserId   int       `xorm:"INT(10)"`
+	ModifiedBy       string    `xorm:"VARCHAR(50)"`
 }

+ 4 - 4
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertsub.go

@@ -37,7 +37,7 @@ func (this *OilSupplierCertSubController) GetEntityList() {
 	Id := this.GetString("Id")
 	SupplierId := this.GetString("SupplierId")
 	SupplierCertId := this.GetString("SupplierCertId")
-	SubClassId := this.GetString("SubClassId")
+	SupplierTypeCode := this.GetString("SubClassId")
 	Code := this.GetString("Code")
 	Name := this.GetString("Name")
 	Remark := this.GetString("Remark")
@@ -61,8 +61,8 @@ func (this *OilSupplierCertSubController) GetEntityList() {
 		where = where + " and SupplierCertId = '" + SupplierCertId + "'"
 	}
 
-	if SubClassId != "" {
-		where = where + " and SubClassId = '" + SubClassId + "'"
+	if SupplierTypeCode != "" {
+		where = where + " and SupplierTypeCode = '" + SupplierTypeCode + "'"
 	}
 
 	if Code != "" {
@@ -351,7 +351,7 @@ func (this *OilSupplierCertSubController) EditBusiness() {
 	model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
 	svc := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
 	opdesc := "编辑准入范围-" + model.Name
-	var cols []string = []string{"Name", "Code", "Remark", "IsDelete", "ModifiedBy", "ModifiedUserId"}
+	var cols []string = []string{"SubClassId", "Name", "Code", "Remark", "IsDelete", "ModifiedBy", "ModifiedUserId"}
 	err := svc.UpdateOperationAndWriteLogBytbl(OilSupplierCertSubName, BaseOperationLogName, id, &model, &entity, cols, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, "准入范围")
 
 	if err == nil {

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

@@ -31,13 +31,14 @@
         <el-button style="float: right; padding: 3px 0" type="text" @click="subfiledialog">添加</el-button>
       </div>
       <subfile-list ref="subfileList" :data="subfileList" :SupplierCertId="SupplierCertId" :SupplierCertSubId="cersubId"
-        :businessList="businessList" :BusinessForm="BusinessForm" height="360px" style="margin-top: 20px"></subfile-list>
+        :businessList="businessList" :BusinessForm="BusinessForm" height="360px" style="margin-top: 20px">
+      </subfile-list>
     </el-card>
 
     <el-dialog :title="Title" :visible.sync="visible" top="5vh">
       <el-form :model="BusinessForm" label-width="100px">
         <el-row>
-          <el-col :span="12" v-if="SubClassId == '1'">
+          <el-col :span="12" v-if="SupplierTypeCode == '01'">
             <el-form-item label="名称" required>
               <el-select filterable default-first-option v-model="OneCode" placeholder="请选择" style="width: 100%"
                 @change="getChild()">
@@ -46,7 +47,7 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="12" v-if="SubClassId == '3'">
+          <el-col :span="12" v-if="SupplierTypeCode == '02'">
             <el-form-item label="名称" required>
               <el-input placeholder="请选择名称" v-model="BusinessForm.Name" style="width:100%">
                 <el-button type="primary" style="width:30%" @click="basicDialog = true" slot="append">选择
@@ -54,7 +55,7 @@
               </el-input>
             </el-form-item>
           </el-col>
-          <el-col :span="12" v-if="SubClassId != '3'">
+          <el-col :span="12" v-if="SupplierTypeCode != '02'">
             <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>
@@ -129,7 +130,7 @@
         type: String,
         default: '0'
       },
-      SubClassId: {
+      SupplierTypeCode: {
         type: String,
         default: '0'
       }
@@ -163,6 +164,7 @@
           Id: '',
           SupplierId: '',
           SupplierCertId: '',
+          SupplierTypeCode: '',
           SubClassId: '',
           Code: '',
           Name: '',
@@ -191,7 +193,7 @@
         let _this = this
         const params = {
           SupplierCertId: this.SupplierCertId,
-          SubClassId: this.SubClassId,
+          SupplierTypeCode: this.SupplierTypeCode,
           _currentPage: this.currentPage,
           _size: this.size,
         }
@@ -308,7 +310,8 @@
         this.BusinessForm.Id = ''
         this.BusinessForm.SupplierId = this.SupplierId
         this.BusinessForm.SupplierCertId = this.SupplierCertId
-        this.BusinessForm.SubClassId = this.SubClassId
+        this.BusinessForm.SupplierTypeCode = this.SupplierTypeCode
+        this.BusinessForm.SubClassId = ''
         this.BusinessForm.Code = ''
         this.BusinessForm.Name = ''
         this.BusinessForm.Remark = ''
@@ -321,6 +324,7 @@
         this.BusinessForm.Id = val.Id
         this.BusinessForm.SupplierId = val.SupplierId
         this.BusinessForm.SupplierCertId = val.SupplierCertId
+        this.BusinessForm.SupplierTypeCode = val.SupplierTypeCode
         this.BusinessForm.SubClassId = val.SubClassId
         this.BusinessForm.Code = val.Code
         this.BusinessForm.Name = val.Name
@@ -331,7 +335,7 @@
       },
       getbusiness() {
         let _this = this
-        if (_this.SubClassId == '1') { //获取物资类业务列表
+        if (_this.SupplierTypeCode == '01') { //获取物资类业务列表
           this.$axios.get('goodsaptitude/goodsparentlist', {})
             .then(res => {
               _this.oneList = res.data.items
@@ -346,17 +350,7 @@
             .catch(err => {
               console.error(err)
             })
-        } else if (_this.SubClassId == '2') { //获取技术服务类业务列表
-          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 => {
-              // handle error
-              console.error(err)
-            })
-        } else if (_this.SubClassId == '3') { //获取基建类业务列表
+        } else if (_this.SupplierTypeCode == '02') { //获取基建类业务列表
           const params = {
             keyword: this.keyword,
             _currentPage: this.CurrentPage,
@@ -373,12 +367,23 @@
               // handle error
               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 => {
+              // handle error
+              console.error(err)
+            })
         }
       },
       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
           }
@@ -408,6 +413,7 @@
         this.ClassId = this.OneCode
         for (var i = 0; i < this.oneList.length; i++) {
           if (this.OneCode == this.oneList[i].Id) {
+            this.BusinessForm.SubClassId = this.techList[i].Id
             this.BusinessForm.Name = this.oneList[i].Name
             this.BusinessForm.Code = this.oneList[i].Code
           }
@@ -424,8 +430,7 @@
         const params = {
           ClassId: this.ClassId
         }
-        console.log(params)
-        if (_this.SubClassId == '2') { //获取技术服务类文件需求
+        if (_this.SubClassId == '03') { //获取技术服务类文件需求
           this.$axios.get('technologyservice/needfilelist', {
               params
             })

+ 2 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/techedit.vue

@@ -474,7 +474,7 @@
 
         <el-tab-pane label="准入范围及资质" :disabled="formData.Step < 2">
           <business-list ref="businessList" :data="businessList" :SupplierCertId="certId" :SupplierId="serviceId"
-            :SubClassId="classId" height="360px" style="margin-top: 20px"></business-list>
+            :SupplierTypeCode="classId" height="360px" style="margin-top: 20px"></business-list>
         </el-tab-pane>
 
         <el-tab-pane label="审批流程">
@@ -538,7 +538,7 @@
 
         serviceId: '',
         certId: '',
-        classId: '2',
+        classId: '03',
 
         formData: {
           Id: '',