ソースを参照

文档上传 编辑组件

shihang 6 年 前
コミット
4d9fb16cdc
16 ファイル変更512 行追加273 行削除
  1. 0 21
      src/dashoo.cn/backend/api/business/oilsupplier/enterprisemajorequipment/oilenterprisepersonnelstructure.go
  2. 0 16
      src/dashoo.cn/backend/api/business/oilsupplier/enterprisemajorequipment/oilenterprisepersonnelstructureService.go
  3. 0 22
      src/dashoo.cn/backend/api/business/oilsupplier/patentstatistical/oilpatentstatistical.go
  4. 0 16
      src/dashoo.cn/backend/api/business/oilsupplier/patentstatistical/oilpatentstatisticalService.go
  5. 26 0
      src/dashoo.cn/backend/api/business/oilsupplier/supplierfile/supplierfile.go
  6. 21 0
      src/dashoo.cn/backend/api/business/oilsupplier/supplierfile/supplierfileService.go
  7. 0 24
      src/dashoo.cn/backend/api/business/oilsupplier/threeyearsperformance/oilthreeyearsperformance.go
  8. 0 16
      src/dashoo.cn/backend/api/business/oilsupplier/threeyearsperformance/oilthreeyearsperformanceService.go
  9. 0 21
      src/dashoo.cn/backend/api/business/oilsupplier/winningproject/oilwinningproject.go
  10. 0 16
      src/dashoo.cn/backend/api/business/oilsupplier/winningproject/oilwinningprojectService.go
  11. 3 2
      src/dashoo.cn/backend/api/controllers/base.go
  12. 145 0
      src/dashoo.cn/backend/api/controllers/oilsupplier/supplierfile.go
  13. 5 0
      src/dashoo.cn/backend/api/routers/router.go
  14. 66 18
      src/dashoo.cn/frontend_web/src/components/oilsupplier/businesslist.vue
  15. 244 78
      src/dashoo.cn/frontend_web/src/components/oilsupplier/subfilelist.vue
  16. 2 23
      src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/techedit.vue

+ 0 - 21
src/dashoo.cn/backend/api/business/oilsupplier/enterprisemajorequipment/oilenterprisepersonnelstructure.go

@@ -1,21 +0,0 @@
-package enterprisepersonnelstructure
-
-import (
-	"time"
-)
-
-type OilenterPrisePersonnelStructure struct {
-	Id             int       `xorm:"not null pk autoincr INT(10)"`
-	SupplierCertId int       `xorm:"not null comment('供方准入证书信息表ID') INT(10)"`
-	MainEquipment  string    `xorm:"comment('主要设备名称') VARCHAR(100)"`
-	Specifications string    `xorm:"not null default '0' comment('规格型号') VARCHAR(10)"`
-	Number         string    `xorm:"not null default '0' comment('数量') CHAR(10)"`
-	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)"`
-}

+ 0 - 16
src/dashoo.cn/backend/api/business/oilsupplier/enterprisemajorequipment/oilenterprisepersonnelstructureService.go

@@ -1,16 +0,0 @@
-package oilpatentstatistical
-
-import (
-	. "dashoo.cn/backend/api/mydb"
-	"github.com/go-xorm/xorm"
-)
-
-type OilPatentStatisticalService struct {
-	MyServiceBase
-}
-
-func GetOilPatentStatisticalService(xormEngine *xorm.Engine) *OilPatentStatisticalService {
-	s := new(OilPatentStatisticalService)
-	s.DBE = xormEngine
-	return s
-}

+ 0 - 22
src/dashoo.cn/backend/api/business/oilsupplier/patentstatistical/oilpatentstatistical.go

@@ -1,22 +0,0 @@
-package patentstatistical
-
-import (
-	"time"
-)
-
-type OilpatentStatiStical struct {
-	Id                int       `xorm:"not null pk autoincr INT(10)"`
-	SupplierCertId    int       `xorm:"not null comment('供方准入证书信息表ID') INT(10)"`
-	Name              string    `xorm:"comment('名称') VARCHAR(100)"`
-	Content           string    `xorm:"not null default '0' comment('主要内容') VARCHAR(100)"`
-	ApprovalAuthority string    `xorm:"not null default '0' comment('批准机关') VARCHAR(50)"`
-	ApprovalDate      time.Time `xorm:"comment('批准日期') DATETIME"`
-	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)"`
-}

+ 0 - 16
src/dashoo.cn/backend/api/business/oilsupplier/patentstatistical/oilpatentstatisticalService.go

@@ -1,16 +0,0 @@
-package oilpatentstatistical
-
-import (
-	. "dashoo.cn/backend/api/mydb"
-	"github.com/go-xorm/xorm"
-)
-
-type OilPatentStatisticalService struct {
-	MyServiceBase
-}
-
-func GetOilPatentStatisticalService(xormEngine *xorm.Engine) *OilPatentStatisticalService {
-	s := new(OilPatentStatisticalService)
-	s.DBE = xormEngine
-	return s
-}

+ 26 - 0
src/dashoo.cn/backend/api/business/oilsupplier/supplierfile/supplierfile.go

@@ -0,0 +1,26 @@
+package supplierfile
+
+import (
+	"time"
+)
+
+type OilSupplierFile struct {
+	Id                int       `xorm:"not null pk autoincr INT(10)"`
+	AppendClassId     int       `xorm:"INT(10)"`
+	SupplierCertSubId int       `xorm:"INT(10)"`
+	NeedFileType      string    `xorm:"VARCHAR(50)"`
+	NeedFileCode      string    `xorm:"VARCHAR(20)"`
+	FileExt           string    `xorm:"VARCHAR(10)"`
+	FileSize          int       `xorm:"INT(10)"`
+	EffectDate        time.Time `xorm:"DATETIME"`
+	FileUrl           string    `xorm:"VARCHAR(100)"`
+	OtherRemark       string    `xorm:"VARCHAR(500)"`
+	Remark            string    `xorm:"VARCHAR(500)"`
+	IsDelete          int       `xorm:"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)"`
+}

+ 21 - 0
src/dashoo.cn/backend/api/business/oilsupplier/supplierfile/supplierfileService.go

@@ -0,0 +1,21 @@
+package supplierfile
+
+import (
+	//"fmt"
+	//"strconv"
+
+	. "dashoo.cn/backend/api/mydb"
+	//"dashoo.cn/utils"
+	//. "dashoo.cn/utils/db"
+	"github.com/go-xorm/xorm"
+)
+
+type SupplierfileService struct {
+	MyServiceBase
+}
+
+func GetSupplierfileService(xormEngine *xorm.Engine) *SupplierfileService {
+	s := new(SupplierfileService)
+	s.DBE = xormEngine
+	return s
+}

+ 0 - 24
src/dashoo.cn/backend/api/business/oilsupplier/threeyearsperformance/oilthreeyearsperformance.go

@@ -1,24 +0,0 @@
-package threeyearsperformance
-
-import (
-	"time"
-)
-
-type OilThreeYearsPerformance struct {
-	Id             int       `xorm:"not null pk autoincr INT(10)"`
-	SupplierCertid int       `xorm:"not null comment('供方准入证书信息表ID') INT(10)"`
-	ProjectName    string    `xorm:"comment('主要设备名称') VARCHAR(100)"`
-	BearContent    string    `xorm:"not null default '0' comment('承担项目主要内容') VARCHAR(100)"`
-	OwnerUnit      string    `xorm:"not null default '0' comment('业主单位') VARCHAR(100)"`
-	StartTime      time.Time `xorm:"comment('起止时间') DATETIME"`
-	StopTime       time.Time `xorm:"comment('起止时间') DATETIME"`
-	Tudge          string    `xorm:"not null default '0' comment('是否发生过质量、安全、环境事故') VARCHAR(20)"`
-	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)"`
-}

+ 0 - 16
src/dashoo.cn/backend/api/business/oilsupplier/threeyearsperformance/oilthreeyearsperformanceService.go

@@ -1,16 +0,0 @@
-package oilpatentstatistical
-
-import (
-	. "dashoo.cn/backend/api/mydb"
-	"github.com/go-xorm/xorm"
-)
-
-type OilPatentStatisticalService struct {
-	MyServiceBase
-}
-
-func GetOilPatentStatisticalService(xormEngine *xorm.Engine) *OilPatentStatisticalService {
-	s := new(OilPatentStatisticalService)
-	s.DBE = xormEngine
-	return s
-}

+ 0 - 21
src/dashoo.cn/backend/api/business/oilsupplier/winningproject/oilwinningproject.go

@@ -1,21 +0,0 @@
-package winningproject
-
-import (
-	"time"
-)
-
-type OilWinningProject struct {
-	Id             int       `xorm:"not null pk autoincr INT(10)"`
-	SupplierCertid int       `xorm:"not null comment('供方准入证书信息表ID') INT(10)"`
-	AwardName      string    `xorm:"comment('奖项名称') VARCHAR(100)"`
-	WinningTime    time.Time `xorm:"comment('获奖时间') DATETIME"`
-	Authorities    string    `xorm:"not null default '0' comment('颁奖机关') VARCHAR(10)"`
-	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)"`
-}

+ 0 - 16
src/dashoo.cn/backend/api/business/oilsupplier/winningproject/oilwinningprojectService.go

@@ -1,16 +0,0 @@
-package oilwinningproject
-
-import (
-	. "dashoo.cn/backend/api/mydb"
-	"github.com/go-xorm/xorm"
-)
-
-type OilWinningProjectService struct {
-	MyServiceBase
-}
-
-func GetOilWinningProjectService(xormEngine *xorm.Engine) *OilWinningProjectService {
-	s := new(OilWinningProjectService)
-	s.DBE = xormEngine
-	return s
-}

+ 3 - 2
src/dashoo.cn/backend/api/controllers/base.go

@@ -231,6 +231,7 @@ var (
 	OilSupplierName                 string = "OilSupplier"                 // 供方基本信息表
 	OilSupplierCertName             string = "OilSupplierCert"             // 供方准入证书信息表
 	OilSupplierCertSubName          string = "OilSupplierCertSub"          // 供方对应准入子分类表
+	OilSupplierFileName             string = "OilSupplierFile"             //供方准入文件表
 	OilGoodsAptitudeClassName       string = "OilGoodsAptitudeClass"       // 物资类资质分类层级表
 	OilTechnologyServiceClassName   string = "OilTechnologyServiceClass"   // 物资类资质分类层级表
 	OilAuditSettingName             string = "OilAuditSetting"             // 单位审批步骤自定义配置
@@ -238,8 +239,8 @@ var (
 	OilThreeYearsPerformanceName    string = "OilThreeYearsPerformance"    //近三年主要工程业绩
 	OilPatentStatisticalName        string = "OilPatentStatistical"        //拥有专利、专有技术及工法
 	OilWinningProjectName           string = "OilWinningProject"           //近三年获得省部级及以上主要技术、管理成果、获奖项目
-	OilTechsrvDetailViewName        string = "oil_techsrv_detail_view"      //技术服务类视图
-	OilGoodsAptDetailViewName       string = "oil_goodsapt_detail_view"      //物資类视图
+	OilTechsrvDetailViewName        string = "oil_techsrv_detail_view"     //技术服务类视图
+	OilGoodsAptDetailViewName       string = "oil_goodsapt_detail_view"    //物資类视图
 )
 
 //分页信息及数据

+ 145 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/supplierfile.go

@@ -0,0 +1,145 @@
+package oilsupplier
+
+import (
+	"encoding/json"
+	//"strings"
+
+	//"time"
+	//"fmt"
+
+	"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
+	. "dashoo.cn/backend/api/controllers"
+	"dashoo.cn/utils"
+)
+
+type SupplierfileController struct {
+	BaseController
+}
+
+// @Title 文件上传
+// @Description get user by token
+// @Success 200 {object} models.Userblood
+// @router /filelist [get]
+func (this *SupplierfileController) FileList() {
+	page := this.GetPageInfoForm()
+	var list []supplierfile.OilSupplierFile
+	svc := supplierfile.GetSupplierfileService(utils.DBE)
+	where := " 1=1"
+	orderby := "EffectDate"
+	asc := false
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "asc" {
+			asc = true
+		}
+	}
+	SupplierCertSubId := this.GetString("SupplierCertSubId")
+	if SupplierCertSubId != "" {
+		where = where + " and SupplierCertSubId = '" + SupplierCertSubId + "'"
+	}
+	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()
+}
+
+// @Title 文件上传
+// @Description 文件上传
+// @Success	200	{object} controllers.Request
+// @router /addsubfile [post]
+func (this *SupplierfileController) AddSubfile() {
+	var model supplierfile.OilSupplierFile
+	var jsonblob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonblob, &model)
+	model.CreateBy = this.User.Realname
+	model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+	svc := supplierfile.GetSupplierfileService(utils.DBE)
+	_, err := svc.InsertEntityBytbl(OilSupplierFileName, &model)
+	var errinfo ErrorDataInfo
+	if err == nil {
+		errinfo.Message = "操作成功!"
+		errinfo.Code = 0
+		errinfo.Item = model.Id
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "操作失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}
+
+// @Title 更新文件上传
+// @Description 更新文件上传
+// @Param	id	path	string	true
+// @Success	200	{object}
+// @router /editsubfile/:id [put]
+func (this *SupplierfileController) EditSubfile() {
+	id := this.Ctx.Input.Param(":id")
+	var errinfo ErrorInfo
+	if id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+	var model supplierfile.OilSupplierFile
+	var jsonblob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonblob, &model)
+	var entity supplierfile.OilSupplierFile
+	model.ModifiedBy = this.User.Realname
+	model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
+	svc := supplierfile.GetSupplierfileService(utils.DBE)
+	opdesc := "编辑文件上传-" + model.NeedFileType
+	var cols []string = []string{"SupplierCertSubId", "NeedFileType", "NeedFileCode", "EffectDate", "FileUrl", "OtherRemark", "Remark", "IsDelete", "ModifiedBy", "ModifiedUserId"}
+	err := svc.UpdateOperationAndWriteLogBytbl(OilSupplierFileName, BaseOperationLogName, id, &model, &entity, cols, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, "文件上传")
+
+	if err == nil {
+		errinfo.Message = "操作成功!"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "操作失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}
+
+// @Title 删除文件上传
+// @Description
+// @Success 200 {object} ErrorInfo
+// @Failure 403 :id 为空
+// @router /subfiledelete/:Id [delete]
+func (this *SupplierfileController) SubfileDelete() {
+	Id := this.Ctx.Input.Param(":Id")
+	var errinfo ErrorInfo
+	if Id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+	where := " Id= " + Id
+	svc := supplierfile.GetSupplierfileService(utils.DBE)
+	err := svc.DeleteEntityBytbl(OilSupplierFileName, where)
+	if err == nil {
+		errinfo.Message = "删除成功"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "删除失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}

+ 5 - 0
src/dashoo.cn/backend/api/routers/router.go

@@ -244,6 +244,11 @@ func init() {
 				&oilsupplier.OilSupplierCertSubController{},
 			),
 		),
+		beego.NSNamespace("/supplierfile",
+			beego.NSInclude(
+				&oilsupplier.SupplierfileController{},
+			),
+		),
 		beego.NSNamespace("/goodsaptitudeclass",
 			beego.NSInclude(
 				&oilsupplier.OilGoodsAptitudeClassController{},

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

@@ -1,21 +1,39 @@
 <template>
   <div>
-    <el-table :data="businessList">
-      <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>
-        </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>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span style="font-weight: bold">分类</span>
+        <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog">添加</el-button>
+        <el-button style="float: right; padding: 3px 0" type="text" @click="getfilelist">文档列表</el-button>
+      </div>
+      <el-table :data="businessList" @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55"></el-table-column>
+        <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>
+          </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>
+    </el-card>
+
+    <el-card class="box-card" style="margin-top: 10px;">
+      <div slot="header" class="clearfix">
+        <span style="font-weight: bold">分类文档</span>
+        <el-button style="float: right; padding: 3px 0" type="text" @click="subfiledialog">添加</el-button>
+      </div>
+      <subfile-list ref="subfileList" :data="subfileList" :SupplierCertSubId="cersubId" :businessList="businessList"
+        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">
@@ -23,7 +41,7 @@
           <el-col :span="12">
             <el-form-item label="名称" required>
               <el-cascader :options="techTreeList" :props="orgtreeprops" change-on-select :show-all-levels="false"
-                v-model="selectedorg" placeholder="请选择菜单" @change="getCode()"></el-cascader>
+                v-model="selectedorg" placeholder="请选择菜单" @change="getCode()" style="width:100%"></el-cascader>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -44,15 +62,19 @@
       </div>
     </el-dialog>
   </div>
-
 </template>
 
 <script>
   import {
     mapGetters
   } from 'vuex'
+  import SubfileList from '../../components/oilsupplier/subfilelist'
+
   export default {
     name: 'EquipmentList',
+    components: {
+      SubfileList, //文档
+    },
     props: {
       SupplierCertId: {
         type: String,
@@ -104,6 +126,11 @@
         currentPage: 1, // 分页
         size: 10,
         currentItemCount: 0,
+
+        cersubId: '', //对应的证书分类ID
+        subfileList: [], //文档
+        selectBusiness: [],
+        selectId: [],
       }
     },
     methods: {
@@ -121,6 +148,9 @@
           .then(res => {
             _this.businessList = res.data.items
             _this.currentItemCount = res.data.currentItemCount
+            if (_this.businessList && _this.businessList.length > 0) {
+              _this.cersubId = _this.businessList[0].Id + ''
+            }
           })
           .catch(err => {
             // handle error
@@ -257,6 +287,24 @@
         this.BusinessForm.IsDelete = val.IsDelete
         this.visible = true
       },
+
+      handleSelectionChange(val) {
+        this.selectBusiness = val
+        if (this.selectBusiness && this.selectBusiness.length > 0) {
+          for (var i = 0; i < this.selectBusiness.length; i++) {
+            this.selectId.push(this.selectBusiness[i].Id)
+          }
+        }
+        console.log("===========================", this.selectId)
+      },
+      subfiledialog() {
+        this.$refs["subfileList"].showDialog()
+      },
+      getfilelist(val) {
+        this.cersubId = val.Id + ''
+        this.$refs["subfileList"].initData()
+      },
+
       seachdata() {
         this.initData()
       },

+ 244 - 78
src/dashoo.cn/frontend_web/src/components/oilsupplier/subfilelist.vue

@@ -8,9 +8,15 @@
             @click="deletedata(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-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
+      <el-table-column prop="NeedFileCode" label="分类编码" show-overflow-tooltip></el-table-column>
+      <el-table-column prop="EffectDate" label="有效日期" show-overflow-tooltip>
+        <template slot-scope="scope">
+          {{ jstimehandle(scope.row.EffectDate+'') }}
+        </template>
+      </el-table-column>
+      <el-table-column prop="OtherRemark" 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"
@@ -18,22 +24,62 @@
     </el-pagination>
 
     <el-dialog :title="Title" :visible.sync="visible" top="5vh">
-      <el-form :model="BusinessForm" label-width="100px">
+      <el-form :model="SubfileForm" label-width="100px">
         <el-row>
           <el-col :span="12">
-            <el-form-item label="名称" required>
-              <el-cascader :options="techTreeList" :props="orgtreeprops" change-on-select :show-all-levels="false"
-                v-model="selectedorg" placeholder="请选择菜单" @change="getCode()"></el-cascader>
+            <el-form-item label="文件分类" required>
+              <el-select ref="refSupplierCertSub" v-model="SubfileForm.SupplierCertSubId" style="width:100%"
+                placeholder="请选择文件分类" @change="getCode()">
+                <el-option v-for="item in businessList" :label="item.Name" :value="item.Id" :key="item.Code">
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="编码" required>
-              <el-input v-model="BusinessForm.Code" placeholder="请输入编码"></el-input>
+            <el-form-item label="分类编码" required>
+              <el-input v-model="SubfileForm.NeedFileCode" placeholder="请输入编码"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="有效日期" required>
+              <el-date-picker style="width: 100%" v-model="SubfileForm.EffectDate" type="date" placeholder="请选择有效日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="其他信息">
+              <el-input v-model="SubfileForm.OtherRemark" type="textarea" :rows=3 placeholder="请输入备注信息"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="24">
             <el-form-item label="备注信息">
-              <el-input v-model="BusinessForm.Remark" type="textarea" :rows=3 placeholder="请输入备注信息"></el-input>
+              <el-input v-model="SubfileForm.Remark" type="textarea" :rows=3 placeholder="请输入备注信息"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="文档上传">
+              <el-upload style="margin-top: 10px;" multiple action="" :limit="1" ref="refuploadattach"
+                :http-request="uploadrequest" class="attach-uploader" :show-file-list="true"
+                :before-upload="beforeAvatarUpload">
+                <i class="el-icon-plus attach-uploader-icon"></i>
+              </el-upload>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item class="maintainlog" label="" label-width="120px">
+              <div style="overflow: auto;">
+                <template>
+                  <el-row>
+                    <el-col :span="24" v-for="(v,K) in doclist" :key="v">
+                      <span>
+                        <el-button size="small" type="text" icon="el-icon-delete" title="删除" @click="deletefile(K)">
+                        </el-button>
+                      </span>
+                      <a style="margin-left:10px" @click="clickachment(v.url)">{{ v.name }}</a>
+                    </el-col>
+                  </el-row>
+                </template>
+              </div>
             </el-form-item>
           </el-col>
         </el-row>
@@ -51,25 +97,22 @@
   import {
     mapGetters
   } from 'vuex'
+  import axios from 'axios'
+  import uploadajax from '../../assets/js/uploadajax.js'
   export default {
-    name: 'EquipmentList',
+    name: 'SubfileList',
     props: {
-      SupplierCertId: {
+      SupplierCertSubId: {
         type: String,
         default: '0'
       },
-      SupplierId: {
-        type: String,
-        default: '0'
+      businessList: {
+        type: Array,
+        default: []
       },
-      SubClassId: {
-        type: String,
-        default: '0'
-      }
     },
     created() {
       this.initData()
-      this.getbusiness()
     },
     computed: {
       ...mapGetters({
@@ -89,13 +132,17 @@
         selectedorg: [],
 
         Title: '',
-        BusinessForm: {
+        SubfileForm: {
           Id: '',
-          SupplierId: '',
-          SupplierCertId: '',
-          SubClassId: '',
-          Code: '',
-          Name: '',
+          AppendClassId: '',
+          SupplierCertSubId: '',
+          NeedFileType: '',
+          NeedFileCode: '',
+          FileExt: '',
+          FileSize: '',
+          EffectDate: new Date(),
+          FileUrl: '',
+          OtherRemark: '',
           Remark: '',
           IsDelete: 0
         },
@@ -104,18 +151,20 @@
         currentPage: 1, // 分页
         size: 10,
         currentItemCount: 0,
+
+        waituploads: [], // 等待上传的附件列表
+        doclist: [],
       }
     },
     methods: {
       initData() {
         let _this = this
         const params = {
-          SupplierCertId: this.SupplierCertId,
-          SubClassId: this.SubClassId,
+          SupplierCertSubId: this.SupplierCertSubId,
           _currentPage: this.currentPage,
           _size: this.size,
         }
-        this.$axios.get('suppliercertsub/list', {
+        this.$axios.get('supplierfile/filelist', {
             params
           })
           .then(res => {
@@ -127,39 +176,35 @@
             console.error(err)
           })
       },
-      getbusiness() {
-        let _this = this
-        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() {
-        for (var i = 0; i < this.techList.length; i++) {
-          if (this.selectedorg[this.selectedorg.length - 1] == this.techList[i].Id) {
-            this.BusinessForm.Name = this.techList[i].Name
-            this.BusinessForm.Code = this.techList[i].Code
+        if (this.businessList && this.businessList.length > 0) {
+          for (var i = 0; i < this.businessList.length; i++) {
+            if (this.SubfileForm.SupplierCertSubId == this.businessList[i].Id) {
+              this.SubfileForm.NeedFileType = this.businessList[i].Name
+              this.SubfileForm.NeedFileCode = this.businessList[i].Code
+            }
           }
         }
       },
       savedata() {
-        if (this.Title == '新增准入范围') {
-          this.addBusiness()
-        } else if (this.Title == '编辑准入范围') {
-          this.editBusiness()
+        if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+          // 上传附件是否完成判断
+          if (!this.attachissuccess()) {
+            this.$message.error('有附件未成功上传!不能保存数据')
+            return
+          }
+          this.getattachissuccess()
+          if (this.Title == '新增文件') {
+            this.addSubfile()
+          } else if (this.Title == '编辑文件') {
+            this.editSubfile()
+          }
         }
       },
-      addBusiness() {
+      addSubfile() {
         let _this = this
-        _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
-        _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
-        _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
-        _this.$axios.post('/suppliercertsub/addbusiness/', _this.BusinessForm)
+        _this.SubfileForm.AppendClassId = parseInt(_this.SubfileForm.AppendClassId)
+        _this.$axios.post('/supplierfile/addsubfile/', _this.SubfileForm)
           .then(res => {
             if (res.data.code === 0) {
               _this.$message({
@@ -179,12 +224,10 @@
             console.error(err)
           })
       },
-      editBusiness() {
+      editSubfile() {
         let _this = this
-        _this.BusinessForm.SupplierId = parseInt(_this.BusinessForm.SupplierId)
-        _this.BusinessForm.SupplierCertId = parseInt(_this.BusinessForm.SupplierCertId)
-        _this.BusinessForm.SubClassId = parseInt(_this.BusinessForm.SubClassId)
-        _this.$axios.put('/suppliercertsub/editbusiness/' + _this.BusinessForm.Id, _this.BusinessForm)
+        _this.SubfileForm.AppendClassId = parseInt(_this.SubfileForm.AppendClassId)
+        _this.$axios.put('/supplierfile/editsubfile/' + _this.SubfileForm.Id, _this.SubfileForm)
           .then(res => {
             if (res.data.code === 0) {
               _this.$message({
@@ -212,7 +255,7 @@
             type: "warning"
           })
           .then(() => {
-            _this.$axios.delete('suppliercertsub/businessdelete/' + val.Id, {})
+            _this.$axios.delete('supplierfile/subfiledelete/' + val.Id, {})
               .then(function (response) {
                 // response
                 if (response.data.code === 0) {
@@ -235,28 +278,128 @@
           .catch(() => {});
       },
       showDialog() {
-        this.Title = '新增准入范围'
-        this.BusinessForm.SupplierId = this.SupplierId
-        this.BusinessForm.SupplierCertId = this.SupplierCertId
-        this.BusinessForm.SubClassId = this.SubClassId
-        this.BusinessForm.Code = ''
-        this.BusinessForm.Name = ''
-        this.BusinessForm.Remark = ''
-        this.BusinessForm.IsDelete = 0
+        this.Title = '新增文件'
+        this.SubfileForm.Id = ''
+        this.SubfileForm.AppendClassId = ''
+        this.SubfileForm.SupplierCertSubId = ''
+        this.SubfileForm.NeedFileType = ''
+        this.SubfileForm.NeedFileCode = ''
+        this.SubfileForm.FileExt = ''
+        this.SubfileForm.FileSize = ''
+        this.SubfileForm.EffectDate = new Date()
+        this.SubfileForm.FileUrl = ''
+        this.SubfileForm.OtherRemark = ''
+        this.SubfileForm.Remark = ''
+        this.SubfileForm.IsDelete = 0
         this.visible = true
       },
       openDialog(val) {
-        this.Title = '编辑准入范围'
-        this.BusinessForm.Id = val.Id
-        this.BusinessForm.SupplierId = val.SupplierId
-        this.BusinessForm.SupplierCertId = val.SupplierCertId
-        this.BusinessForm.SubClassId = val.SubClassId
-        this.BusinessForm.Code = val.Code
-        this.BusinessForm.Name = val.Name
-        this.BusinessForm.Remark = val.Remark
-        this.BusinessForm.IsDelete = val.IsDelete
+        this.Title = '编辑文件'
+        this.SubfileForm.Id = val.Id
+        this.SubfileForm.AppendClassId = val.AppendClassId
+        this.SubfileForm.SupplierCertSubId = val.SupplierCertSubId
+        this.SubfileForm.NeedFileType = val.NeedFileType
+        this.SubfileForm.NeedFileCode = val.NeedFileCode
+        this.SubfileForm.FileExt = val.FileExt
+        this.SubfileForm.FileSize = val.FileSize
+        this.SubfileForm.EffectDate = new Date(val.EffectDate)
+        this.SubfileForm.OtherRemark = val.OtherRemark
+        if (val.FileUrl != '') {
+          this.getwendanginfo(val.FileUrl)
+        }
+        this.SubfileForm.Remark = val.Remark
+        this.SubfileForm.IsDelete = val.IsDelete
         this.visible = true
       },
+      //文档列表
+      getwendanginfo(iUrl) {
+        let _this = this
+        _this.doclist = []
+        let exArr = iUrl.split('|')
+        let params = {
+          name: exArr[1],
+          url: exArr[0]
+        }
+        _this.doclist.push(params)
+      },
+
+      beforeAvatarUpload(file) {
+        let isLt50m = file.size / 1024 / 1024 / 50 < 1
+        if (!isLt50m) {
+          this.$message.error('上传文件大小不能超过 50MB!')
+          return false
+        }
+        return true
+      },
+      uploadrequest(option) {
+        let _this = this
+        axios.post(process.env.upfilehost, {})
+          .then(function (res) {
+            if (res.data && res.data.fid && res.data.fid !== '') {
+              option.action = `http://${res.data.url}/${res.data.fid}`
+              _this.waituploads.push({
+                uid: option.file.uid,
+                url: res.data.publicUrl,
+                fid: res.data.fid
+              })
+              uploadajax(option)
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: '未上传成功!请刷新界面重新上传!'
+              })
+            }
+          })
+          .catch(function (error) {
+            console.log(error)
+            _this.$message({
+              type: 'warning',
+              message: '未上传成功!请重新上传!'
+            })
+          })
+      },
+      // 判断附件是否上传成功
+      attachissuccess() {
+        if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+          for (let i = 0; i < this.$refs.refuploadattach.uploadFiles.length; i++) {
+            if (this.$refs.refuploadattach.uploadFiles[i].status !== 'success') {
+              return false
+            }
+          }
+        }
+        return true
+      },
+      getattachissuccess() {
+        this.SubfileForm.FileUrl = ''
+        if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+          for (let i = 0; i < this.$refs.refuploadattach.uploadFiles.length; i++) {
+            if (this.$refs.refuploadattach.uploadFiles[i].status === 'success') {
+              for (let j = 0; j < this.waituploads.length; j++) {
+                if (this.waituploads[j].uid === this.$refs.refuploadattach.uploadFiles[i].uid) {
+                  this.SubfileForm.FileUrl =
+                    `${this.waituploads[j].url}/${this.waituploads[j].fid}|${this.$refs.refuploadattach.uploadFiles[i].name}`
+                }
+              }
+            }
+          }
+        }
+      },
+      clickachment(url, uid) {
+        window.open(`http://${url}`)
+      },
+      deletefile() {
+        let _this = this
+        _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+          .then(() => {
+            _this.doclist = []
+          })
+          .catch(() => {})
+      },
+
       seachdata() {
         this.initData()
       },
@@ -286,7 +429,30 @@
 
 </script>
 
-<style>
+<style lang='scss'>
+  .attach-uploader .el-upload {
+    border: 1px dashed #63B8FF;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    margin-bottom: -17px;
+  }
+
+  .attach-uploader .el-upload:hover {
+    border-color: #228B22;
+  }
+
+  .attach-uploader-icon {
+    font-size: 25px;
+    color: #63B8FF;
+    width: 50px;
+    height: 50px;
+    line-height: 50px;
+    text-align: center;
+  }
 
+  .attach-uploader-icon:hover {
+    color: #228B22;
+  }
 
 </style>

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

@@ -476,22 +476,8 @@
         </el-tab-pane>
 
         <el-tab-pane label="选择准入范围" :disabled="formData.Step < 2">
-          <el-card class="box-card">
-            <div slot="header" class="clearfix">
-              <span style="font-weight: bold">分类</span>
-              <el-button style="float: right; padding: 3px 0" type="text" @click="businessdialog">添加</el-button>
-            </div>
-            <business-list ref="businessList" :data="businessList" :SupplierCertId="certId" :SupplierId="serviceId"
-              :SubClassId="classId" height="360px" style="margin-top: 20px"></business-list>
-          </el-card>
-
-          <el-card class="box-card" style="margin-top: 10px;">
-            <div slot="header" class="clearfix">
-              <span style="font-weight: bold">分类文档</span>
-              <el-button style="float: right; padding: 3px 0" type="text" @click="subfiledialog">添加</el-button>
-            </div>
-            <subfile-list ref="subfileList" :data="subfileList" height="360px" style="margin-top: 20px"></subfile-list>
-          </el-card>
+          <business-list ref="businessList" :data="businessList" :SupplierCertId="certId" :SupplierId="serviceId"
+            :SubClassId="classId" height="360px" style="margin-top: 20px"></business-list>
         </el-tab-pane>
 
         <el-tab-pane label="审批流程">
@@ -553,7 +539,6 @@
         patentList: [], //拥有专利、专有技术及工法      
         winningList: [], //近三年获得省部级及以上主要技术、管理成果、获奖项目
         businessList: [], //准入业务
-        subfileList: [], //文档
 
         serviceId: '',
         certId: '',
@@ -694,12 +679,6 @@
       winningdialog() {
         this.$refs["winningList"].showDialog()
       },
-      businessdialog() {
-        this.$refs["businessList"].showDialog()
-      },
-      subfiledialog() {
-        this.$refs["subfileList"].showDialog()
-      },
 
       initDatas() {
         if (this.formData.Id) {