Browse Source

增项申请添加修改,物资类,技术服务类

huahaiyan 7 years ago
parent
commit
c8d9134476

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

@@ -13,6 +13,7 @@ type OilSupplierFile struct {
 	NeedFileType      string    `xorm:"VARCHAR(50)"`
 	NeedFileType      string    `xorm:"VARCHAR(50)"`
 	NeedFileCode      string    `xorm:"VARCHAR(20)"`
 	NeedFileCode      string    `xorm:"VARCHAR(20)"`
 	FileType          int       `xorm:"INT(10)"`
 	FileType          int       `xorm:"INT(10)"`
+	SupType           int       `xorm:"INT(10)"`
 	FileExt           string    `xorm:"VARCHAR(10)"`
 	FileExt           string    `xorm:"VARCHAR(10)"`
 	FileName          string    `xorm:"VARCHAR(50)"`
 	FileName          string    `xorm:"VARCHAR(50)"`
 	EffectDate        time.Time `xorm:"DATETIME"`
 	EffectDate        time.Time `xorm:"DATETIME"`

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

@@ -1,8 +1,14 @@
 package oilsupplier
 package oilsupplier
 
 
 import (
 import (
+	"dashoo.cn/backend/api/business/oilsupplier/supplier"
+	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
+	"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
+	"dashoo.cn/business2/parameter"
 	"encoding/json"
 	"encoding/json"
+	"strconv"
+	"strings"
 	"time"
 	"time"
 
 
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertappendsub"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertappendsub"
@@ -52,7 +58,7 @@ func (this *OilSupplierCertAppendSubController) GetList() {
 }
 }
 
 
 // @Title 添加
 // @Title 添加
-// @Description 添加增项分类信息
+// @Description 添加增项分类信息基建类
 // @Success	200	{object} controllers.Request
 // @Success	200	{object} controllers.Request
 // @router /addappendsub [post]
 // @router /addappendsub [post]
 func (this *OilSupplierCertAppendSubController) AddAppendSub() {
 func (this *OilSupplierCertAppendSubController) AddAppendSub() {
@@ -67,7 +73,63 @@ func (this *OilSupplierCertAppendSubController) AddAppendSub() {
 	model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
 	model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
 
 
 	svc := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
 	svc := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
+	//添加到准入分类表中
 	_, err := svc.InsertEntityBytbl(OilSupplierCertSubName, &model)
 	_, err := svc.InsertEntityBytbl(OilSupplierCertSubName, &model)
+
+	var supplierCertModel suppliercert.OilSupplierCert
+	svcCert := suppliercert.GetOilSupplierCertService(utils.DBE)
+	svcCert.GetEntityById(model.SupplierCertId, &supplierCertModel)
+
+	filesvc := supplierfile.GetSupplierfileService(utils.DBE)
+	var needList []supplierfile.FileList
+	if model.SupplierTypeCode == "01" {
+		//		needList = filesvc.GetGoodsNeedFileList(model.SubClassId)
+	} else if model.SupplierTypeCode == "02" {
+		needList = filesvc.GetBasicNeedFileList(model.SubClassId)
+	} else {
+		//		needList = filesvc.GetTechNeedFileList(model.SubClassId)
+	}
+
+	if supplierCertModel.InStyle == "4" {
+		var needFile supplierfile.FileList
+		needFile.FileName = "战略合作协议扫描件"
+		needList = append(needList, needFile)
+	}
+
+	if err == nil {
+		var list []supplierfile.OilSupplierFile
+		where := "SupplierId = '" + strconv.Itoa(model.SupplierId) + "'"
+		svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
+
+		hasField := ""
+		for i := 0; i < len(list); i++ {
+			hasField += list[i].NeedFileType + ","
+		}
+		mustField := "营业执照,组织代码,税务登记,开户许可,银行开户许可证,承诺书,企业信息系统截图,战略合作协议扫描件,"
+		for i := 0; i < len(needList); i++ {
+			var entity supplierfile.OilSupplierFile
+			entity.SupplierId = model.SupplierId
+
+			if strings.Contains(mustField, needList[i].FileName+",") {
+				entity.SupplierTypeCode = "000"
+			} else {
+				entity.SupplierTypeCode = model.SupplierTypeCode
+			}
+			entity.NeedFileType = needList[i].FileName
+			entity.FileType = 1
+			entity.EffectDate = time.Now()
+			entity.CreateBy = this.User.Realname
+			entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+
+			if strings.Contains(hasField, needList[i].FileName+",") {
+				//已存在,不能重复添加
+				continue
+			}
+			entity.SupType = 2
+			svc.InsertEntityBytbl(OilSupplierFileName, &entity)
+		}
+
+	}
 	if err == nil {
 	if err == nil {
 		errinfo.Message = "操作成功!"
 		errinfo.Message = "操作成功!"
 		errinfo.Code = 0
 		errinfo.Code = 0
@@ -81,6 +143,185 @@ func (this *OilSupplierCertAppendSubController) AddAppendSub() {
 		this.ServeJSON()
 		this.ServeJSON()
 	}
 	}
 }
 }
+// @Title 批量添加增项准入范围--技术服务类
+// @Description 批量添加准入范围
+// @Success 200 {object} business.device.DeviceChannels
+// @router /addtechbus [post]
+func (this *OilSupplierCertAppendSubController) AddTechBus() {
+	var jsonblob = this.Ctx.Input.RequestBody
+	var datamain suppliercertsub.OilSupplierCertSub
+	var dataother suppliercertsub.TechnologySubModel
+	json.Unmarshal(jsonblob, &datamain)
+	json.Unmarshal(jsonblob, &dataother)
+
+	var supplierCertModel suppliercert.OilSupplierCert
+	svcCert := suppliercert.GetOilSupplierCertService(utils.DBE)
+	svcCert.GetEntityById(datamain.SupplierCertId, &supplierCertModel)
+
+	for n := 0; n < len(dataother.CheckList); n++ {
+		where_sub := "SupplierTypeCode = 03 and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
+		where_sub += " and SupplierCertId = '" + strconv.Itoa(dataother.SupplierCertId) + "'"
+		where_sub += " and SubClassId = '" + strconv.Itoa(dataother.CheckList[n].Id) + "'"
+		var model suppliercertsub.OilSupplierCertSub
+		svc := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
+		has := svc.GetEntityByWhere(OilSupplierCertSubName, where_sub, &model)
+
+		if !has {
+			datamain.Type = "2"
+			datamain.SubClassId = dataother.CheckList[n].Id
+			datamain.Code = dataother.CheckList[n].Code
+			datamain.Name = dataother.CheckList[n].Name
+			datamain.Remark = dataother.Remark
+			datamain.IsDelete = 0
+			datamain.CreateBy = this.User.Realname
+			datamain.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+			svc.InsertEntityBytbl(OilSupplierCertSubName, &datamain)
+
+			filesvc := supplierfile.GetSupplierfileService(utils.DBE)
+			needList := filesvc.GetTechNeedFileList(dataother.CheckList[n].Id)
+
+			if supplierCertModel.InStyle == "4" {
+				var needFile supplierfile.FileList
+				needFile.FileName = "战略合作协议扫描件"
+				needList = append(needList, needFile)
+			}
+
+			var list []supplierfile.OilSupplierFile
+			where := "SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
+			svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
+			hasField := ""
+			for i := 0; i < len(list); i++ {
+				hasField += list[i].NeedFileType + ","
+			}
+			mustField := "营业执照,组织代码,税务登记,开户许可,银行开户许可证,承诺书,企业信息系统截图,战略合作协议扫描件,"
+			for i := 0; i < len(needList); i++ {
+				var entity supplierfile.OilSupplierFile
+				entity.SupplierId = dataother.SupplierId
+
+				if strings.Contains(mustField, needList[i].FileName+",") {
+					entity.SupplierTypeCode = "000"
+				} else {
+					entity.SupplierTypeCode = dataother.SupplierTypeCode
+				}
+				entity.NeedFileType = needList[i].FileName
+				entity.SupType = 2
+				entity.FileType = 1
+				entity.EffectDate = time.Now()
+				entity.CreateBy = this.User.Realname
+				entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+
+				if strings.Contains(hasField, needList[i].FileName+",") {
+					//已存在,不能重复添加
+					continue
+				}
+				svc.InsertEntityBytbl(OilSupplierFileName, &entity)
+			}
+
+		}
+	}
+	var errinfo ErrorDataInfo
+	errinfo.Message = "操作成功!"
+	errinfo.Code = 0
+	this.Data["json"] = &errinfo
+	this.ServeJSON()
+}
+
+// @Title 批量添加增项准入范围--物资类
+// @Description 批量添加增项准入范围
+// @Success 200 {object} business.device.DeviceChannels
+// @router /addgoodsbus [post]
+func (this *OilSupplierCertAppendSubController) AddGoodsBus() {
+	var jsonblob = this.Ctx.Input.RequestBody
+	var datamain suppliercertsub.OilSupplierCertSub
+	var dataother suppliercertsub.SupplierCertSubModel
+
+	json.Unmarshal(jsonblob, &datamain)
+	json.Unmarshal(jsonblob, &dataother)
+
+	var supplierCertModel suppliercert.OilSupplierCert
+	svcCert := suppliercert.GetOilSupplierCertService(utils.DBE)
+	svcCert.GetEntityById(datamain.SupplierCertId, &supplierCertModel)
+
+	var supplierModel supplier.OilSupplier
+	svcSupplier := supplier.GetOilSupplierService(utils.DBE)
+	svcSupplier.GetEntityById(datamain.SupplierCertId, &supplierModel)
+
+	for n := 0; n < len(dataother.CheckList); n++ {
+		where_sub := "SupplierTypeCode = 01 and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
+		where_sub += " and SupplierCertId = '" + strconv.Itoa(dataother.SupplierCertId) + "'"
+		where_sub += " and SubClassId = '" + dataother.CheckList[n].Id + "'"
+		var model suppliercertsub.OilSupplierCertSub
+		svc := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
+		has := svc.GetEntityByWhere(OilSupplierCertSubName, where_sub, &model)
+
+		if !has {
+			datamain.Type = "2"
+			datamain.SubClassId, _ = utils.StrTo(dataother.CheckList[n].Id).Int()
+			datamain.Code = dataother.CheckList[n].Code
+			datamain.Name = dataother.CheckList[n].Name
+			datamain.Remark = dataother.Remark
+			datamain.IsDelete = 0
+			datamain.CreateBy = this.User.Realname
+			datamain.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+			svc.InsertEntityBytbl(OilSupplierCertSubName, &datamain)
+
+			paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
+			filesvc := supplierfile.GetSupplierfileService(utils.DBE)
+			needList := filesvc.GetGoodsNeedFileList(dataother.CheckList[n].Id)
+			if supplierCertModel.InStyle == "4" {
+				var needFile supplierfile.FileList
+				//战略合作协议扫描件
+				needFile.FileName = paramSvc.GetBaseparameterMessage("GFGL", "paramset", "CooperationFile")
+				needList = append(needList, needFile)
+			}
+
+			var list []supplierfile.OilSupplierFile
+			where := "SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
+			svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
+			hasField := ""
+			for i := 0; i < len(list); i++ {
+				hasField += list[i].NeedFileType + ","
+			}
+			//三证合一或五证合一不需要的字段
+			mergerCertSkipField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MergerCertSkipFieldName")
+			//"营业执照,组织代码,组织机构代码证,税务登记证,税务登记,开户许可,银行开户许可证,承诺书,诚信合规承诺书,企业信息系统截图,战略合作协议扫描件,"
+			mustField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName")
+			for i := 0; i < len(needList); i++ {
+				var entity supplierfile.OilSupplierFile
+				entity.SupplierId = dataother.SupplierId
+
+				if (supplierModel.CredentialFlag == "1" || supplierModel.CredentialFlag == "2") && strings.Contains(mergerCertSkipField, needList[i].FileName+",") { //三证合一或五证合一了
+					continue
+				}
+
+				if strings.Contains(mustField, needList[i].FileName+",") {
+					entity.SupplierTypeCode = "000"
+				} else {
+					entity.SupplierTypeCode = dataother.SupplierTypeCode
+				}
+				entity.NeedFileType = needList[i].FileName
+				entity.FileType = 1
+				entity.SupType = 2
+				entity.EffectDate = time.Now()
+				entity.CreateBy = this.User.Realname
+				entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+
+				if strings.Contains(hasField, needList[i].FileName+",") {
+					//已存在,不能重复添加
+					continue
+				}
+				svc.InsertEntityBytbl(OilSupplierFileName, &entity)
+			}
+
+		}
+	}
+
+	var errinfo ErrorDataInfo
+	errinfo.Message = "操作成功!"
+	errinfo.Code = 0
+	this.Data["json"] = &errinfo
+	this.ServeJSON()
+}
 
 
 // @Title 修改实体
 // @Title 修改实体
 // @Description 修改实体
 // @Description 修改实体

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

@@ -31,7 +31,7 @@
       </el-pagination>
       </el-pagination>
     </el-card>
     </el-card>
 
 
-    <el-dialog title="基建类业务列表" :visible.sync="goodsDialog" top="5vh">
+    <el-dialog title="物资类业务列表" :visible.sync="goodsDialog" top="5vh">
       <el-row style="margin-top: -10px">
       <el-row style="margin-top: -10px">
         <el-col :span="12">
         <el-col :span="12">
           <el-input v-model="filterText" placeholder="请输入名称或代码" size="mini" style="width: 250px;"></el-input>
           <el-input v-model="filterText" placeholder="请输入名称或代码" size="mini" style="width: 250px;"></el-input>

+ 65 - 22
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/basisdataopera.vue

@@ -67,7 +67,7 @@
             <el-table-column label="操作" min-width="100" align="center" fixed>
             <el-table-column label="操作" min-width="100" align="center" fixed>
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-button type="primary" title="删除" size="mini" plain @click="deleteData(scope.row.Id)"
                 <el-button type="primary" title="删除" size="mini" plain @click="deleteData(scope.row.Id)"
-                  :disabled="scope.row.SupplierTypeCode != ''">删除</el-button>
+                  :disabled="scope.row.Type == '1'">删除</el-button>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <!-- <el-table-column prop="SortFlag" label="分类标记" v-if="1==2" show-overflow-tooltip></el-table-column> -->
             <!-- <el-table-column prop="SortFlag" label="分类标记" v-if="1==2" show-overflow-tooltip></el-table-column> -->
@@ -82,13 +82,13 @@
         </el-card>
         </el-card>
         <el-card class="box-card" style="margin-top: 10px;">
         <el-card class="box-card" style="margin-top: 10px;">
           <div slot="header" class="clearfix">
           <div slot="header" class="clearfix">
-            <span style="font-weight: bold"> 企业资质</span>
+            <span><i class="icon icon-table2"></i> 企业资质</span>
           </div>
           </div>
           <el-table :data="subfileList" border>
           <el-table :data="subfileList" border>
             <el-table-column label="操作" width="150" align="center" fixed>
             <el-table-column label="操作" width="150" align="center" fixed>
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-button type="primary" plain size="mini" title="编辑" @click="openDialog(scope.row)"
                 <el-button type="primary" plain size="mini" title="编辑" @click="openDialog(scope.row)"
-                  :disabled="editbtn">编辑
+                  :disabled="scope.row.SupType != 2">编辑
                 </el-button>
                 </el-button>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
@@ -133,10 +133,10 @@
           <el-col :span="12">
           <el-col :span="12">
             <el-form-item label="资质文件">
             <el-form-item label="资质文件">
               <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
               <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
-                :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
-                <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip">大小为512KB-5MB</div>
-              </el-upload>
+                  :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
+                  <i class="el-icon-plus attach-uploader-icon"></i>
+                  <div slot="tip" class="el-upload__tip">大小为512KB-5MB</div>
+                </el-upload>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
         </el-row>
         </el-row>
@@ -253,9 +253,11 @@
   import {
   import {
     mapGetters
     mapGetters
   } from 'vuex'
   } from 'vuex'
+  import axios from 'axios'
   import suppapi from '@/api/oilsupplier/supplier'
   import suppapi from '@/api/oilsupplier/supplier'
   import api from '@/api/oilsupplier/supplierappendsub'
   import api from '@/api/oilsupplier/supplierappendsub'
   import api2 from '@/api/oilsupplier/supplierappend'
   import api2 from '@/api/oilsupplier/supplierappend'
+  import uploadajax from '@/assets/js//uploadajax.js'
   import ChooseAuditor from '@/components/oilsupplier/chooseauditor'
   import ChooseAuditor from '@/components/oilsupplier/chooseauditor'
   import WfBackHistory from '@/components/workflow/wfbackhistory.vue'
   import WfBackHistory from '@/components/workflow/wfbackhistory.vue'
 
 
@@ -269,7 +271,7 @@
         authUser: 'authUser'
         authUser: 'authUser'
       })
       })
     },
     },
-    name: 'oilsuppliercertappendsub',
+    name: 'basisdataOperation',
 
 
     data() {
     data() {
       var CheckSelectedOption = (rule, value, callback) => {
       var CheckSelectedOption = (rule, value, callback) => {
@@ -477,11 +479,49 @@
           })
           })
           .then(res => {
           .then(res => {
             _this.subfileList = res.data.items
             _this.subfileList = res.data.items
+            console.log("---this.subfileList---",this.subfileList)
             _this.currentItemCount = res.data.currentItemCount
             _this.currentItemCount = res.data.currentItemCount
             for (let idx in _this.subfileList) {
             for (let idx in _this.subfileList) {
               console.log(_this.subfileList[idx])
               console.log(_this.subfileList[idx])
               _this.subfileList[idx].FileUrlList = _this.subfileList[idx].FileUrl.split('$')
               _this.subfileList[idx].FileUrlList = _this.subfileList[idx].FileUrl.split('$')
-
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      makesure() {
+          if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+            // 上传附件是否完成判断
+            if (!this.attachissuccess()) {
+              this.$message.error('有附件未成功上传!不能保存数据')
+              return
+            }
+            this.getattachissuccess()
+            this.editSubfile()
+          } else {
+            this.editSubfile()
+          }
+      },
+      editSubfile() {
+        let _this = this
+        _this.SubfileForm.SupplierId = parseInt(_this.SubfileForm.SupplierId)
+        _this.SubfileForm.SupplierCertSubId = parseInt(_this.SubfileForm.SupplierCertSubId)
+        _this.$axios.put('/supplierfile/editsubfile/' + _this.SubfileForm.Id, _this.SubfileForm)
+          .then(res => {
+            if (res.data.code === 0) {
+              _this.$message({
+                type: 'success',
+                message: res.data.message,
+              })
+              this.visible = false
+              this.initData()
+              this.$refs.refuploadattach.uploadFiles = []
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
             }
             }
           })
           })
           .catch(err => {
           .catch(err => {
@@ -527,7 +567,7 @@
         }
         }
         _this.doclist.push(params)
         _this.doclist.push(params)
       },
       },
-      beforeAvatarUpload(file) {
+      beforeAvatarUpload (file) {
         /*let isLt512K = file.size / 1024 < 512
         /*let isLt512K = file.size / 1024 < 512
         if (isLt512K) {
         if (isLt512K) {
           this.$message.error('上传文件大小不能小于 512KB!')
           this.$message.error('上传文件大小不能小于 512KB!')
@@ -542,7 +582,7 @@
       },
       },
       uploadrequest(option) {
       uploadrequest(option) {
         let _this = this
         let _this = this
-        axios.post(process.env.upfilehost, {})
+        _this.$axios.post(process.env.upfilehost, {})
           .then(function (res) {
           .then(function (res) {
             if (res.data && res.data.fid && res.data.fid !== '') {
             if (res.data && res.data.fid && res.data.fid !== '') {
               option.action = `http://${res.data.url}/${res.data.fid}`
               option.action = `http://${res.data.url}/${res.data.fid}`
@@ -703,6 +743,7 @@
         let _this = this
         let _this = this
         api2.updateEntity(_this.Id, _this.formData, _this.$axios).then(res => {
         api2.updateEntity(_this.Id, _this.formData, _this.$axios).then(res => {
           if (res.data.code === 0) {
           if (res.data.code === 0) {
+            this.getEntityById()
             this.$message({
             this.$message({
               type: 'success',
               type: 'success',
               message: res.data.message
               message: res.data.message
@@ -750,6 +791,7 @@
               this.entityList = res.data.item
               this.entityList = res.data.item
               this.dialogFormData.SupplierCertAppendId = res.data.info //接收插入数据后返回的Id
               this.dialogFormData.SupplierCertAppendId = res.data.info //接收插入数据后返回的Id
               this.Id = res.data.info
               this.Id = res.data.info
+              this.getEntityById()
               this.$message({
               this.$message({
                 type: 'success',
                 type: 'success',
                 message: res.data.message,
                 message: res.data.message,
@@ -845,29 +887,30 @@
             confirmButtonText: '确定',
             confirmButtonText: '确定',
             cancelButtonText: '取消',
             cancelButtonText: '取消',
             type: 'warning'
             type: 'warning'
-          }).then(() => {
-            api.deleteEntity(Id, _this.$axios)
-              .then(res => {
-                // response
-                if (res.data.code === 0) {
+          })
+          .then(() => {
+            _this.$axios.delete('suppliercertsub/businessdelete/' +Id, {})
+              .then(function (response) {
+                if (response.data.code === 0) {
                   _this.$message({
                   _this.$message({
                     type: 'success',
                     type: 'success',
-                    message: res.data.message
+                    message: response.data.message
                   })
                   })
-                  // 更新列表
-                  this.getSortList()
+                  _this.getEntityById()
                 } else {
                 } else {
                   _this.$message({
                   _this.$message({
                     type: 'warning',
                     type: 'warning',
-                    message: res.data.message
+                    message: response.data.message
                   })
                   })
                 }
                 }
               })
               })
-              .catch(() => {})
+              .catch(function (error) {
+                console.log(error)
+              })
           })
           })
           .catch(() => {})
           .catch(() => {})
       },
       },
-
+      
       selectAuditOrg() {
       selectAuditOrg() {
         this.dialogVisible = true
         this.dialogVisible = true
       },
       },

+ 416 - 156
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/goodsdataopera.vue

@@ -47,7 +47,7 @@
                   </el-cascader>
                   </el-cascader>
                 </el-form-item>
                 </el-form-item>
               </el-col> -->
               </el-col> -->
-              <el-col :span="12">
+              <el-col :span="8">
                 <el-form-item label="供应方公司名称" prop="checkSelectedSupplier">
                 <el-form-item label="供应方公司名称" prop="checkSelectedSupplier">
                   <el-select v-model="supplierOptions" filterable @change="getInfo" placeholder="请选择供应方公司"
                   <el-select v-model="supplierOptions" filterable @change="getInfo" placeholder="请选择供应方公司"
                     style="width: 100%">
                     style="width: 100%">
@@ -57,12 +57,7 @@
                   </el-select>
                   </el-select>
                 </el-form-item>
                 </el-form-item>
               </el-col>
               </el-col>
-              <!-- <el-col :span="12">
-                <el-form-item label="推荐单位编码" prop="RecUnitId">
-                  <el-input v-model="formData.RecUnitId" placeholder="请输入推荐单位编码"></el-input>
-                </el-form-item>
-              </el-col> -->
-              <el-col :span="24">
+              <el-col :span="16">
                 <el-form-item label="备注" prop="Remark">
                 <el-form-item label="备注" prop="Remark">
                   <el-input type="textarea" v-model="formData.Remark" placeholder="请输入"></el-input>
                   <el-input type="textarea" v-model="formData.Remark" placeholder="请输入"></el-input>
                 </el-form-item>
                 </el-form-item>
@@ -76,11 +71,11 @@
             <span><i class="icon icon-table2"></i> 增项分类</span>
             <span><i class="icon icon-table2"></i> 增项分类</span>
             <el-button style="float: right; padding: 3px 0" type="text" @click="addSortData()">添加</el-button>
             <el-button style="float: right; padding: 3px 0" type="text" @click="addSortData()">添加</el-button>
           </div>
           </div>
-          <el-table :data="entityList" border height="calc(100vh - 345px)" style="width: 100%" @sort-change="orderby">
+          <el-table :data="entityList" border style="width: 100%" @sort-change="orderby">
             <el-table-column label="操作" min-width="100" align="center" fixed>
             <el-table-column label="操作" min-width="100" align="center" fixed>
               <template slot-scope="scope">
               <template slot-scope="scope">
-                <el-button type="primary" title="编辑" size="mini" plain @click="editSortData(scope.row)">打开</el-button>
-                <el-button type="primary" title="删除" size="mini" plain @click="deleteData(scope.row.Id)">删除</el-button>
+                <el-button type="primary" title="删除" size="mini" plain @click="deleteData(scope.row.Id)"
+                  :disabled="scope.row.Type == '1'">删除</el-button>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column prop="SortFlag" label="分类标记" v-if="1==2" show-overflow-tooltip></el-table-column>
             <el-table-column prop="SortFlag" label="分类标记" v-if="1==2" show-overflow-tooltip></el-table-column>
@@ -93,60 +88,112 @@
             layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
             layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
           </el-pagination>
           </el-pagination>
         </el-card>
         </el-card>
+        <el-card class="box-card" style="margin-top: 10px;">
+          <div slot="header" class="clearfix">
+            <span><i class="icon icon-table2"></i> 企业资质</span>
+          </div>
+          <el-table :data="subfileList" border>
+            <el-table-column label="操作" width="150" align="center" fixed>
+              <template slot-scope="scope">
+                <el-button type="primary" plain size="mini" title="编辑" @click="openDialog(scope.row)"
+                  :disabled="scope.row.SupType != 2">编辑
+                </el-button>
+              </template>
+            </el-table-column>
+            <el-table-column prop="NeedFileType" label="资质名称" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="FileUrlList" label="资质文件" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
+                  <a :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank"
+                    class="buttonText">{{scope.row.FileName.split('$')[index]}}</a>
+                </div>
+              </template>
+            </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>
+        </el-card>
       </div>
       </div>
     </el-card>
     </el-card>
-    <!-- 增项分类添加、修改 -->
-    <el-dialog :title="dialogTitle" :visible.sync="dialogVisible">
-      <el-form label-width="150px" ref="dialogFormData" :rules="sortEntityFormRules" :model="dialogFormData">
+    <el-dialog title="编辑文件" :visible.sync="visible" top="5vh">
+      <el-form :model="SubfileForm" label-width="100px">
         <el-row>
         <el-row>
           <el-col :span="12">
           <el-col :span="12">
-            <el-form-item label="分类名称" prop="checkSelectedOptList">
-              <el-cascader ref="cascader" :options="optionsList" style="width:100%" :props="goodsProps"
-                :show-all-levels="false" v-model="selectedOptList" @active-item-change="getChildrens" @change="getCode"
-                placeholder="请选择分类">
-              </el-cascader>
+            <el-form-item label="资质名称" required>
+              <el-input v-model="SubfileForm.NeedFileType" placeholder="请输文件类型" :disabled="true"></el-input>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
           <el-col :span="12">
           <el-col :span="12">
-            <el-form-item label="分类编码" prop="Code">
-              <el-input v-model="dialogFormData.Code" placeholder="请输入分类编码" disabled></el-input>
+            <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-form-item>
           </el-col>
           </el-col>
           <el-col :span="24">
           <el-col :span="24">
-            <el-form-item label="备注" prop="Remark">
-              <el-input type="textarea" v-model="dialogFormData.Remark" placeholder="请输入备注" style="width: 100%">
-              </el-input>
+            <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="12">
+            <el-form-item label="资质文件">
+              <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
+                :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
+                <i class="el-icon-plus attach-uploader-icon"></i>
+                <div slot="tip" class="el-upload__tip">大小为512KB-5MB</div>
+              </el-upload>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
         </el-row>
         </el-row>
       </el-form>
       </el-form>
+      <div slot="footer" class="dialog-footer" style="margin-top:-30px;">
+        <el-button @click="visible = false">取 消</el-button>
+        <el-button type="primary" @click="makesure()">确 定</el-button>
+      </div>
+    </el-dialog>
+    <!-- 增项分类添加、修改 -->
+    <el-dialog :title="dialogTitle" :visible.sync="dialogVisible">
+      <el-form label-width="150px" ref="dialogFormData" :rules="sortEntityFormRules" :model="dialogFormData">
+        <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"
+              :filter-node-method="filterNode">
+            </el-tree>
+          </el-col>
+        </el-row>
+        <el-row style="margin-top: 30px">
+          备注信息:
+          <el-col :span="24">
+            <el-input type="textarea" :rows=3 v-model="dialogFormData.Remark" placeholder="请输入备注" style="width: 100%">
+            </el-input>
+          </el-col>
+        </el-row>
+      </el-form>
       <span slot="footer" class="dialog-footer">
       <span slot="footer" class="dialog-footer">
         <el-button size="mini" @click="cancelOption()">取 消</el-button>
         <el-button size="mini" @click="cancelOption()">取 消</el-button>
         <el-button size="mini" type="primary" @click="ensureOption()">确 定</el-button>
         <el-button size="mini" type="primary" @click="ensureOption()">确 定</el-button>
       </span>
       </span>
     </el-dialog>
     </el-dialog>
 
 
-     <el-dialog title="审批历史" :visible.sync="audithistoryshow" width="1200px">
+    <el-dialog title="审批历史" :visible.sync="audithistoryshow" width="1200px">
       <wf-back-history ref="WfBackHistory" :entryinfo="backhistroy"></wf-back-history>
       <wf-back-history ref="WfBackHistory" :entryinfo="backhistroy"></wf-back-history>
     </el-dialog>
     </el-dialog>
 
 
-   <el-dialog title="提交初审" :visible.sync="AuditdialogShow" width="520px">
+    <el-dialog title="提交初审" :visible.sync="AuditdialogShow" width="520px">
       <el-form ref="searchForm" label-width="70px">
       <el-form ref="searchForm" label-width="70px">
         <el-row>
         <el-row>
-          <!--<el-col :span="24">
-            <el-form-item label="二级单位">
-              <el-cascader :options="orgtreelist" :props="orgtreeprops" change-on-select :show-all-levels="false"
-                filterable style="width: 100%" @change="auditOrgChang" v-model="secOrganize" placeholder="请选择组织">
-              </el-cascader>
-            </el-form-item>
-          </el-col>-->
           <el-col :span="24">
           <el-col :span="24">
             <el-form-item label="审批人">
             <el-form-item label="审批人">
-              <!--<el-select ref="selectAuditer" v-model="auditer" placeholder="请选择" style="width: 90%" filterable
-                allow-create default-first-option>
-                <el-option v-for="item in auditerOption" :key="item.id" :label="item.realname" :value="item.id">
-                </el-option>
-              </el-select>-->
               <el-input ref="selectAuditer" readonly v-model="auditerName" placeholder="请选择审批人">
               <el-input ref="selectAuditer" readonly v-model="auditerName" placeholder="请选择审批人">
                 <el-button slot="append" icon="el-icon-search" @click="chooseAuditorShow"></el-button>
                 <el-button slot="append" icon="el-icon-search" @click="chooseAuditorShow"></el-button>
               </el-input>
               </el-input>
@@ -175,6 +222,8 @@
   import {
   import {
     mapGetters
     mapGetters
   } from 'vuex'
   } from 'vuex'
+  import axios from 'axios'
+  import uploadajax from '@/assets/js//uploadajax.js'
   import suppapi from '@/api/oilsupplier/supplier'
   import suppapi from '@/api/oilsupplier/supplier'
   import api from '@/api/oilsupplier/supplierappendsub'
   import api from '@/api/oilsupplier/supplierappendsub'
   import api2 from '@/api/oilsupplier/supplierappend'
   import api2 from '@/api/oilsupplier/supplierappend'
@@ -223,9 +272,10 @@
         organizeOption: [], // 审批部门
         organizeOption: [], // 审批部门
         auditerOption: [], // 审批人
         auditerOption: [], // 审批人
         orgtreeprops: {
         orgtreeprops: {
-          value: 'id',
-          label: 'Fullname',
-          children: 'children'
+          value: 'Id',
+          label: 'CodeName',
+          children: 'children',
+          isLeaf: 'Leaf'
         },
         },
         backhistroy: {
         backhistroy: {
           certId: '',
           certId: '',
@@ -237,6 +287,35 @@
           CertId: '',
           CertId: '',
           AuditRemark: ''
           AuditRemark: ''
         },
         },
+        auditbusList: [],
+        SupplierId: 0,
+        SupplierTypeCode: '',
+        SupplierCertId: 0,
+        subfileList: [],
+        visible: false,
+        dynamicTableColumns: [],
+        flag: '',
+        editbtn: true,
+        //资质文件
+        SubfileForm: {
+          Id: '',
+          SupplierId: '',
+          SupplierTypeCode: '',
+          SupplierCertSubId: '',
+          CertSubName: '',
+          NeedFileType: '',
+          NeedFileCode: '',
+          FileType: '',
+          FileExt: '',
+          FileName: '',
+          EffectDate: new Date(),
+          FileUrl: '',
+          OtherRemark: '',
+          Remark: '',
+          IsDelete: 0,
+          FileUrlList: [],
+        },
+        checkList: [],
         auditer: '',
         auditer: '',
         auditerName: '',
         auditerName: '',
         FirstAudit: '',
         FirstAudit: '',
@@ -335,10 +414,7 @@
       if (this.editFlag == '1' && this.Id !== '') {
       if (this.editFlag == '1' && this.Id !== '') {
         this.getEntityById()
         this.getEntityById()
         this.dialogFormData.SupplierCertAppendId = this.Id
         this.dialogFormData.SupplierCertAppendId = this.Id
-        this.getSortList()
       }
       }
-      this.getOrgTreeList() //获取推荐单位层级列表
-      this.getGoodsTreeList(this.ParentId) //获取物资类层级列表
       this.getSupplierList() //获取供应方公司列表
       this.getSupplierList() //获取供应方公司列表
       this.getDictOptions()
       this.getDictOptions()
       this.getorgtreelist()
       this.getorgtreelist()
@@ -380,54 +456,46 @@
       },
       },
 
 
       //获取物资类第一级分类
       //获取物资类第一级分类
-      getGoodsTreeList(Id) {
-        let _this = this
-        this.$axios.get('goodsaptitudeclass/getgoodsclasslist/' + Id, {})
+      // getGoodsTreeList(Id) {
+      //   let _this = this
+      //   this.$axios.get('goodsaptitudeclass/getgoodsclasslist/' + Id, {})
+      //     .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)
+      //     })
+      // },
+
+      //获取下一级所有分类
+      getChildrens(val, resolve) {
+        let Id = 0
+        if (val.level === 0) {
+          Id = 0
+        } else {
+          Id = val.data.Id
+        }
+        this.$axios.get('goodsaptitude/goodschildlistbypid/' + Id, {})
           .then(res => {
           .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', [])
-            })
+            if (!res.data.items || res.data.items.length <= 0) {
+              val.isLeaf = true
+              return resolve([])
+            }
+            for (let idx in res.data.items) {
+              res.data.items[idx].Leaf = res.data.items[idx].Leaf === '1' ? true : false
+            }
+            return resolve(res.data.items)
           })
           })
           .catch(err => {
           .catch(err => {
             console.error(err)
             console.error(err)
           })
           })
       },
       },
-
-      //获取下一级所有分类
-      getChildrens(val) {
-        let _this = this
-        let Id = val[0]
-        if (Id != _this.flagId) { //判断是否是第一次,若不相等则为第一次
-          this.$axios.get('goodsaptitudeclass/getchildlist/' + Id, {})
-            .then(res => {
-              //获取下一级所有级联数据
-              if (res.data.items) { //判断是否有数据
-                let tempList = []
-                tempList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
-                //添加到上一级对应的选项中
-                for (let i = 0; i < _this.optionsList.length; i++) {
-                  if (_this.optionsList[i].id === Id) {
-                    _this.$set(_this.optionsList[i], 'children', tempList)
-                    break
-                  }
-                }
-              } else {
-                //修改上一级的children属性
-                for (let i = 0; i < _this.optionsList.length; i++) {
-                  if (_this.optionsList[i].id === Id) {
-                    _this.$set(_this.optionsList[i], 'children', '')
-                    break
-                  }
-                }
-              }
-              //做标记
-              _this.flagId = Id
-            })
-            .catch(err => {
-              console.error(err)
-            })
-        }
+      filterNode(value, data) {
+        if (!value) return true;
+        return data.CodeName.indexOf(value) !== -1;
       },
       },
 
 
       //获取分类级联Id
       //获取分类级联Id
@@ -475,24 +543,190 @@
         let _this = this
         let _this = this
         api2.getEntityById(_this.Id, _this.$axios).then(res => {
         api2.getEntityById(_this.Id, _this.$axios).then(res => {
           _this.formData = res.data
           _this.formData = res.data
-          console.log("---------_this.formData-----",_this.formData)
+          console.log("---this.formData---", _this.formData)
           this.backhistroy.certId = _this.Id
           this.backhistroy.certId = _this.Id
           this.backhistroy.workflowId = _this.formData.WorkFlowId
           this.backhistroy.workflowId = _this.formData.WorkFlowId
-          //显示原推荐单位
-          if (_this.formData.RecUnitFlag != null) {
-            let arr = _this.formData.RecUnitFlag.split(',')
-            let arr2 = []
-            for (let i = 0; i < arr.length; i++) {
-              arr2.push(parseInt(arr[i]))
-            }
-            _this.selectedOrgList = arr2
-          }
+          this.getFileList()
           //显示公司名
           //显示公司名
           _this.supplierOptions = _this.formData.SupplierId.toString()
           _this.supplierOptions = _this.formData.SupplierId.toString()
+          _this.getSortList()
         }).catch(err => {
         }).catch(err => {
           console.error(err)
           console.error(err)
         })
         })
       },
       },
+      //获取资质文件
+      getFileList() {
+        this.SupplierId = this.formData.SupplierId
+        this.SupplierTypeCode = this.formData.AppendType
+        let _this = this
+        const params = {
+          SupplierId: this.SupplierId,
+          SupplierTypeCode: this.SupplierTypeCode,
+          _currentPage: 1,
+          _size: 1000,
+        }
+        _this.$axios.get('supplierfile/filelist', {
+            params
+          })
+          .then(res => {
+            _this.subfileList = res.data.items
+            console.log("---this.subfileList---", this.subfileList)
+            _this.currentItemCount = res.data.currentItemCount
+            for (let idx in _this.subfileList) {
+              console.log(_this.subfileList[idx])
+              _this.subfileList[idx].FileUrlList = _this.subfileList[idx].FileUrl.split('$')
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      makesure() {
+        if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+          // 上传附件是否完成判断
+          if (!this.attachissuccess()) {
+            this.$message.error('有附件未成功上传!不能保存数据')
+            return
+          }
+          this.getattachissuccess()
+          this.editSubfile()
+        } else {
+          this.editSubfile()
+        }
+      },
+      editSubfile() {
+        let _this = this
+        _this.SubfileForm.SupplierId = parseInt(_this.SubfileForm.SupplierId)
+        _this.SubfileForm.SupplierCertSubId = parseInt(_this.SubfileForm.SupplierCertSubId)
+        _this.$axios.put('/supplierfile/editsubfile/' + _this.SubfileForm.Id, _this.SubfileForm)
+          .then(res => {
+            if (res.data.code === 0) {
+              _this.$message({
+                type: 'success',
+                message: res.data.message,
+              })
+              this.visible = false
+              this.initData()
+              this.$refs.refuploadattach.uploadFiles = []
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      fileurlcut(val, index) {
+        let fileurlall = val.split('$')[index]
+        let fileurl = fileurlall.split("|")
+        return fileurl[0]
+      },
+      openDialog(val) {
+        this.SubfileForm.Id = val.Id
+        this.SubfileForm.SupplierId = val.SupplierId
+        this.SubfileForm.SupplierTypeCode = val.SupplierTypeCode
+        if (val.SupplierCertSubId == 0) {
+          this.SubfileForm.SupplierCertSubId = ''
+        } else {
+          this.SubfileForm.SupplierCertSubId = val.SupplierCertSubId
+        }
+        this.SubfileForm.CertSubName = val.CertSubName
+        this.SubfileForm.NeedFileType = val.NeedFileType
+        this.SubfileForm.NeedFileCode = val.NeedFileCode
+        this.SubfileForm.FileExt = val.FileExt
+        this.SubfileForm.FileType = val.FileType
+        this.SubfileForm.FileName = val.FileName
+        this.SubfileForm.EffectDate = new Date(val.EffectDate)
+        this.SubfileForm.FileUrl = val.FileUrl
+        this.getwendanginfo(val.FileUrl)
+        this.SubfileForm.OtherRemark = val.OtherRemark
+        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 isLt512K = file.size / 1024 < 512
+        if (isLt512K) {
+          this.$message.error('上传文件大小不能小于 512KB!')
+          return false
+        }*/
+        let isLt50m = file.size / 1024 / 1024 / 5 < 1
+        if (!isLt50m) {
+          this.$message.error('上传文件大小不能超过 5MB!')
+          return false
+        }
+        return true
+      },
+      uploadrequest(option) {
+        let _this = 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) {
+            _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}$`
+                  this.SubfileForm.FileName += `${this.$refs.refuploadattach.uploadFiles[i].name}$`
+                }
+              }
+            }
+          }
+        }
+      },
+      clickachment(url, uid) {
+        window.open(`http://${url}`)
+      },
 
 
       //保存增项信息
       //保存增项信息
       saveEntity() {
       saveEntity() {
@@ -515,6 +749,7 @@
         let _this = this
         let _this = this
         api2.updateEntity(_this.Id, _this.formData, _this.$axios).then(res => {
         api2.updateEntity(_this.Id, _this.formData, _this.$axios).then(res => {
           if (res.data.code === 0) {
           if (res.data.code === 0) {
+            this.getEntityById()
             this.$message({
             this.$message({
               type: 'success',
               type: 'success',
               message: res.data.message
               message: res.data.message
@@ -534,16 +769,20 @@
       getSortList() {
       getSortList() {
         //分页及列表条件
         //分页及列表条件
         let params = {
         let params = {
-          _currentPage: this.currentPage,
-          _size: this.size,
-          Order: this.Column.Order,
-          Prop: this.Column.Prop,
+          // _currentPage: this.currentPage,
+          // _size: this.size,
+          // Order: this.Column.Order,
+          // Prop: this.Column.Prop,
           SupplierCertAppendId: this.dialogFormData.SupplierCertAppendId,
           SupplierCertAppendId: this.dialogFormData.SupplierCertAppendId,
+          SupCertId: this.formData.SupplierCertId,
+          SupTypeCode: this.formData.AppendType,
         };
         };
+
         //访问接口
         //访问接口
         api.getList(params, this.$axios).then(res => {
         api.getList(params, this.$axios).then(res => {
-          this.entityList = res.data.items
-          this.currentItemCount = res.data.currentItemCount
+          this.entityList = res.data.item
+          console.log("------res.entityList==--", this.entityList)
+          // this.currentItemCount = res.data.currentItemCount
         }).catch(err => {
         }).catch(err => {
           console.error(err)
           console.error(err)
         })
         })
@@ -556,8 +795,10 @@
         _this.$axios.post('/suppliercertappend/addappend/', _this.formData)
         _this.$axios.post('/suppliercertappend/addappend/', _this.formData)
           .then(res => {
           .then(res => {
             if (res.data.code === 0) {
             if (res.data.code === 0) {
-              _this.dialogFormData.SupplierCertAppendId = res.data.item //接收插入数据后返回的Id
-              _this.Id = res.data.item
+              this.entityList = res.data.item
+              this.dialogFormData.SupplierCertAppendId = res.data.info //接收插入数据后返回的Id
+              this.Id = res.data.info
+              this.getEntityById()
               _this.$message({
               _this.$message({
                 type: 'success',
                 type: 'success',
                 message: res.data.message,
                 message: res.data.message,
@@ -640,48 +881,19 @@
 
 
       //确定
       //确定
       ensureOption() {
       ensureOption() {
-        this.$refs['dialogFormData'].validate((valid) => {
-          if (valid) {
-            let _this = this
-            if (_this.dialogTitle == '添加') {
-              let arr = []
-              arr = _this.$refs['cascader'].currentLabels //_this.$refs['cascader'].currentLabels获取当前级联选项的id对应的value
-              _this.dialogFormData.Name = arr[arr.length - 1]
-              _this.dialogFormData.SupplierId = _this.formData.SupplierId
-              _this.dialogFormData.SupplierCertId = _this.formData.SupplierCertId
-              _this.dialogFormData.SupplierCertAppendId = parseInt(_this.dialogFormData.SupplierCertAppendId)
-              _this.addSortAppend()
-              _this.getEntityById()
-            }
-            if (_this.dialogTitle == '编辑') {
-              let arr = []
-              arr = _this.$refs['cascader'].currentLabels
-              _this.dialogFormData.Name = arr[arr.length - 1]
-              api.updateEntity(_this.dialogFormData.Id, _this.dialogFormData, _this.$axios).then(res => {
-                if (res.data.code === 0) {
-                  this.$message({
-                    type: 'success',
-                    message: res.data.message
-                  });
-                  //关闭dialog
-                  _this.dialogVisible = false
-                  //更新列表
-                  this.getSortList()
-                  this.getEntityById()
-                } else {
-                  this.$message({
-                    type: 'warning',
-                    message: res.data.message
-                  });
-                }
-              }).catch(err => {
-                console.error(err)
-              })
-            }
-          } else {
-            return false
+        let _this = this
+        let arr = []
+        let val = this.$refs.orgmanagetree.getCheckedNodes()
+        this.checkList = []
+        for (var i = 0; i < val.length; i++) {
+          if (!val[i].children || val[i].children.length <= 0) {
+            this.checkList.push(val[i])
           }
           }
-        })
+        }
+        _this.dialogFormData.SupplierId = _this.formData.SupplierId
+        _this.dialogFormData.SupplierCertId = _this.formData.SupplierCertId
+        _this.dialogFormData.SupplierCertAppendId = parseInt(_this.dialogFormData.SupplierCertAppendId)
+        _this.addSortAppend()
       },
       },
 
 
       //判断是否保存了增项信息
       //判断是否保存了增项信息
@@ -699,7 +911,25 @@
       //添加增项分类信息
       //添加增项分类信息
       addSortAppend() {
       addSortAppend() {
         let _this = this
         let _this = this
-        _this.$axios.post('/suppliercertappendsub/addappendsub/', _this.dialogFormData)
+        let params = {
+          SupplierId: parseInt(this.formData.SupplierId),
+          SupplierCertId: parseInt(this.formData.SupplierCertId),
+          SupplierCertAppendId: parseInt(this.dialogFormData.SupplierCertAppendId),
+          SupplierTypeCode: '01',
+          Remark: this.dialogFormData.Remark
+        }
+        if (_this.checkList.length > 0) {
+          params = Object.assign(params, {
+            CheckList: _this.checkList
+          })
+        } else {
+          _this.$message({
+            type: 'warning',
+            message: '名称不能为空,请选择分类!'
+          })
+          return
+        }
+        _this.$axios.post('/suppliercertappendsub/addgoodsbus/', params)
           .then(res => {
           .then(res => {
             if (res.data.code === 0) {
             if (res.data.code === 0) {
               _this.$message({
               _this.$message({
@@ -729,25 +959,26 @@
             confirmButtonText: '确定',
             confirmButtonText: '确定',
             cancelButtonText: '取消',
             cancelButtonText: '取消',
             type: 'warning'
             type: 'warning'
-          }).then(() => {
-            api.deleteEntity(Id, _this.$axios)
-              .then(res => {
-                // response
-                if (res.data.code === 0) {
+          })
+          .then(() => {
+            _this.$axios.delete('suppliercertsub/businessdelete/' + Id, {})
+              .then(function (response) {
+                if (response.data.code === 0) {
                   _this.$message({
                   _this.$message({
                     type: 'success',
                     type: 'success',
-                    message: res.data.message
+                    message: response.data.message
                   })
                   })
-                  // 更新列表
-                  this.getSortList()
+                  _this.getEntityById()
                 } else {
                 } else {
                   _this.$message({
                   _this.$message({
                     type: 'warning',
                     type: 'warning',
-                    message: res.data.message
+                    message: response.data.message
                   })
                   })
                 }
                 }
               })
               })
-              .catch(() => {})
+              .catch(function (error) {
+                console.log(error)
+              })
           })
           })
           .catch(() => {})
           .catch(() => {})
       },
       },
@@ -776,7 +1007,7 @@
         this.applyLoading = true
         this.applyLoading = true
         this.auditform.FirstAuditName = this.auditer
         this.auditform.FirstAuditName = this.auditer
         this.auditform.CertId = this.formData.Id
         this.auditform.CertId = this.formData.Id
-        console.log("---this.auditform---",this.auditform)
+        console.log("---this.auditform---", this.auditform)
         api2.auditEntity(this.formData.Id, this.auditform, this.$axios).then(res => {
         api2.auditEntity(this.formData.Id, this.auditform, this.$axios).then(res => {
           if (res.data.code === 0) {
           if (res.data.code === 0) {
             // 保存成功后,初始化数据,变成修改
             // 保存成功后,初始化数据,变成修改
@@ -869,3 +1100,32 @@
   }
   }
 
 
 </script>
 </script>
+<style lang='scss'>
+  .attach-uploader .el-upload {
+    border: 1px dashed #63B8FF;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    // margin-bottom: -17px;
+    margin-top: -15px;
+    margin-left: 20px
+  }
+
+  .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>

+ 388 - 133
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/techdataopera.vue

@@ -47,7 +47,7 @@
                   </el-cascader>
                   </el-cascader>
                 </el-form-item>
                 </el-form-item>
               </el-col> -->
               </el-col> -->
-              <el-col :span="12">
+              <el-col :span="8">
                 <el-form-item label="供应方公司名称" prop="checkSelectedSupplier">
                 <el-form-item label="供应方公司名称" prop="checkSelectedSupplier">
                   <el-select v-model="supplierOptions" filterable @change="getInfo" placeholder="请选择供应方公司"
                   <el-select v-model="supplierOptions" filterable @change="getInfo" placeholder="请选择供应方公司"
                     style="width: 100%">
                     style="width: 100%">
@@ -62,7 +62,7 @@
                   <el-input v-model="formData.RecUnitId" placeholder="请输入推荐单位编码"></el-input>
                   <el-input v-model="formData.RecUnitId" placeholder="请输入推荐单位编码"></el-input>
                 </el-form-item>
                 </el-form-item>
               </el-col> -->
               </el-col> -->
-              <el-col :span="24">
+              <el-col :span="16">
                 <el-form-item label="备注" prop="Remark">
                 <el-form-item label="备注" prop="Remark">
                   <el-input type="textarea" v-model="formData.Remark" placeholder="请输入"></el-input>
                   <el-input type="textarea" v-model="formData.Remark" placeholder="请输入"></el-input>
                 </el-form-item>
                 </el-form-item>
@@ -76,11 +76,11 @@
             <span><i class="icon icon-table2"></i> 增项分类</span>
             <span><i class="icon icon-table2"></i> 增项分类</span>
             <el-button style="float: right; padding: 3px 0" type="text" @click="addSortData()">添加</el-button>
             <el-button style="float: right; padding: 3px 0" type="text" @click="addSortData()">添加</el-button>
           </div>
           </div>
-          <el-table :data="entityList" border height="calc(100vh - 345px)" style="width: 100%" @sort-change="orderby">
+          <el-table :data="entityList" border style="width: 100%" @sort-change="orderby">
             <el-table-column label="操作" min-width="100" align="center" fixed>
             <el-table-column label="操作" min-width="100" align="center" fixed>
               <template slot-scope="scope">
               <template slot-scope="scope">
-                <el-button type="primary" title="编辑" size="mini" plain @click="editSortData(scope.row)">打开</el-button>
-                <el-button type="primary" title="删除" size="mini" plain @click="deleteData(scope.row.Id)">删除</el-button>
+                <el-button type="primary" title="删除" size="mini" plain @click="deleteData(scope.row.Id)"
+                  :disabled="scope.row.Type == '1'">删除</el-button>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column prop="SortFlag" label="分类标记" v-if="1==2" show-overflow-tooltip></el-table-column>
             <el-table-column prop="SortFlag" label="分类标记" v-if="1==2" show-overflow-tooltip></el-table-column>
@@ -93,60 +93,111 @@
             layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
             layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
           </el-pagination>
           </el-pagination>
         </el-card>
         </el-card>
+        <el-card class="box-card" style="margin-top: 10px;">
+          <div slot="header" class="clearfix">
+            <span><i class="icon icon-table2"></i> 企业资质</span>
+          </div>
+          <el-table :data="subfileList" border>
+            <el-table-column label="操作" width="150" align="center" fixed>
+              <template slot-scope="scope">
+                <el-button type="primary" plain size="mini" title="编辑" @click="openDialog(scope.row)"
+                  :disabled="scope.row.SupType != 2">编辑
+                </el-button>
+              </template>
+            </el-table-column>
+            <el-table-column prop="NeedFileType" label="资质名称" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="FileUrlList" label="资质文件" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
+                  <a :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank"
+                    class="buttonText">{{scope.row.FileName.split('$')[index]}}</a>
+                </div>
+              </template>
+            </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>
+        </el-card>
       </div>
       </div>
     </el-card>
     </el-card>
-    <!-- 增项分类添加、修改 -->
-    <el-dialog :title="dialogTitle" :visible.sync="dialogVisible">
-      <el-form label-width="150px" ref="dialogFormData" :rules="sortEntityFormRules" :model="dialogFormData">
+    <el-dialog title="编辑文件" :visible.sync="visible" top="5vh">
+      <el-form :model="SubfileForm" label-width="100px">
         <el-row>
         <el-row>
           <el-col :span="12">
           <el-col :span="12">
-            <el-form-item label="分类名称" prop="checkSelectedOptList">
-              <el-cascader ref="cascader" :options="optionsList" style="width:100%" :props="tytreeprops"
-                change-on-select :show-all-levels="false" v-model="selectedOptList" @change="getCode"
-                placeholder="请选择分类">
-              </el-cascader>
+            <el-form-item label="资质名称" required>
+              <el-input v-model="SubfileForm.NeedFileType" placeholder="请输文件类型" :disabled="true"></el-input>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
           <el-col :span="12">
           <el-col :span="12">
-            <el-form-item label="分类编码" prop="Code">
-              <el-input v-model="dialogFormData.Code" placeholder="请输入分类编码" disabled></el-input>
+            <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-form-item>
           </el-col>
           </el-col>
           <el-col :span="24">
           <el-col :span="24">
-            <el-form-item label="备注" prop="Remark">
-              <el-input type="textarea" v-model="dialogFormData.Remark" placeholder="请输入备注" style="width: 100%">
-              </el-input>
+            <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="12">
+            <el-form-item label="资质文件">
+              <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
+                :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
+                <i class="el-icon-plus attach-uploader-icon"></i>
+                <div slot="tip" class="el-upload__tip">大小为512KB-5MB</div>
+              </el-upload>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
         </el-row>
         </el-row>
       </el-form>
       </el-form>
+      <div slot="footer" class="dialog-footer" style="margin-top:-30px;">
+        <el-button @click="visible = false">取 消</el-button>
+        <el-button type="primary" @click="makesure()">确 定</el-button>
+      </div>
+    </el-dialog>
+    <!-- 增项分类添加、修改 -->
+    <el-dialog title="添加" :visible.sync="dialogVisible">
+      <el-form label-width="150px" ref="dialogFormData" :rules="sortEntityFormRules" :model="dialogFormData">
+        <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>
+            </el-tree>
+          </el-col>
+        </el-row>
+        <el-row style="margin-top: 30px">
+          备注信息:
+          <el-col :span="24">
+            <el-input type="textarea" :rows=3 v-model="dialogFormData.Remark" placeholder="请输入备注" style="width: 100%">
+            </el-input>
+          </el-col>
+        </el-row>
+      </el-form>
       <span slot="footer" class="dialog-footer">
       <span slot="footer" class="dialog-footer">
         <el-button size="mini" @click="cancelOption()">取 消</el-button>
         <el-button size="mini" @click="cancelOption()">取 消</el-button>
         <el-button size="mini" type="primary" @click="ensureOption()">确 定</el-button>
         <el-button size="mini" type="primary" @click="ensureOption()">确 定</el-button>
       </span>
       </span>
     </el-dialog>
     </el-dialog>
 
 
-     <el-dialog title="审批历史" :visible.sync="audithistoryshow" width="1200px">
+    <el-dialog title="审批历史" :visible.sync="audithistoryshow" width="1200px">
       <wf-back-history ref="WfBackHistory" :entryinfo="backhistroy"></wf-back-history>
       <wf-back-history ref="WfBackHistory" :entryinfo="backhistroy"></wf-back-history>
     </el-dialog>
     </el-dialog>
 
 
     <el-dialog title="提交初审" :visible.sync="AuditdialogShow" width="520px">
     <el-dialog title="提交初审" :visible.sync="AuditdialogShow" width="520px">
       <el-form ref="searchForm" label-width="70px">
       <el-form ref="searchForm" label-width="70px">
         <el-row>
         <el-row>
-          <!--<el-col :span="24">
-            <el-form-item label="二级单位">
-              <el-cascader :options="orgtreelist" :props="orgtreeprops" change-on-select :show-all-levels="false"
-                filterable style="width: 100%" @change="auditOrgChang" v-model="secOrganize" placeholder="请选择组织">
-              </el-cascader>
-            </el-form-item>
-          </el-col>-->
           <el-col :span="24">
           <el-col :span="24">
             <el-form-item label="审批人">
             <el-form-item label="审批人">
-              <!--<el-select ref="selectAuditer" v-model="auditer" placeholder="请选择" style="width: 90%" filterable
-                allow-create default-first-option>
-                <el-option v-for="item in auditerOption" :key="item.id" :label="item.realname" :value="item.id">
-                </el-option>
-              </el-select>-->
               <el-input ref="selectAuditer" readonly v-model="auditerName" placeholder="请选择审批人">
               <el-input ref="selectAuditer" readonly v-model="auditerName" placeholder="请选择审批人">
                 <el-button slot="append" icon="el-icon-search" @click="chooseAuditorShow"></el-button>
                 <el-button slot="append" icon="el-icon-search" @click="chooseAuditorShow"></el-button>
               </el-input>
               </el-input>
@@ -176,7 +227,9 @@
   import {
   import {
     mapGetters
     mapGetters
   } from 'vuex'
   } from 'vuex'
+  import axios from 'axios'
   import suppapi from '@/api/oilsupplier/supplier'
   import suppapi from '@/api/oilsupplier/supplier'
+  import uploadajax from '@/assets/js//uploadajax.js'
   import api from '@/api/oilsupplier/supplierappendsub'
   import api from '@/api/oilsupplier/supplierappendsub'
   import api2 from '@/api/oilsupplier/supplierappend'
   import api2 from '@/api/oilsupplier/supplierappend'
   import apiCert from '@/api/oilsupplier/suppliercert'
   import apiCert from '@/api/oilsupplier/suppliercert'
@@ -225,8 +278,8 @@
         organizeOption: [], // 审批部门
         organizeOption: [], // 审批部门
         auditerOption: [], // 审批人
         auditerOption: [], // 审批人
         orgtreeprops: {
         orgtreeprops: {
-          value: 'id',
-          label: 'Fullname',
+          value: 'Id',
+          label: 'CodeName',
           children: 'children'
           children: 'children'
         },
         },
         backhistroy: {
         backhistroy: {
@@ -239,6 +292,35 @@
           CertId: '',
           CertId: '',
           AuditRemark: ''
           AuditRemark: ''
         },
         },
+        auditbusList: [],
+        SupplierId: 0,
+        SupplierTypeCode: '',
+        SupplierCertId: 0,
+        subfileList: [],
+        visible: false,
+        dynamicTableColumns: [],
+        flag: '',
+        editbtn: true,
+        //资质文件
+        SubfileForm: {
+          Id: '',
+          SupplierId: '',
+          SupplierTypeCode: '',
+          SupplierCertSubId: '',
+          CertSubName: '',
+          NeedFileType: '',
+          NeedFileCode: '',
+          FileType: '',
+          FileExt: '',
+          FileName: '',
+          EffectDate: new Date(),
+          FileUrl: '',
+          OtherRemark: '',
+          Remark: '',
+          IsDelete: 0,
+          FileUrlList: [],
+        },
+        checkList: [],
         auditer: '',
         auditer: '',
         auditerName: '',
         auditerName: '',
         FirstAudit: '',
         FirstAudit: '',
@@ -280,7 +362,6 @@
           Remark: '', //备注
           Remark: '', //备注
         },
         },
         dialogVisible: false, //增项分类dialog
         dialogVisible: false, //增项分类dialog
-        dialogTitle: '',
         dialogFormData: {
         dialogFormData: {
           Id: '',
           Id: '',
           SupplierId: 0, //供方表ID
           SupplierId: 0, //供方表ID
@@ -341,7 +422,6 @@
       this.getTechTreeList() //获取技术服务类层级列表
       this.getTechTreeList() //获取技术服务类层级列表
       this.getSupplierList() //获取供应方公司列表
       this.getSupplierList() //获取供应方公司列表
       this.getDictOptions()
       this.getDictOptions()
-      this.getorgtreelist()
     },
     },
     methods: {
     methods: {
 
 
@@ -385,6 +465,7 @@
         this.$axios.get('technologyservice/businesslist', {})
         this.$axios.get('technologyservice/businesslist', {})
           .then(res => {
           .then(res => {
             _this.optionsList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
             _this.optionsList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
+            console.log("----this.optionsList--", this.optionsList)
           })
           })
           .catch(err => {
           .catch(err => {
             console.error(err)
             console.error(err)
@@ -436,23 +517,190 @@
         let _this = this
         let _this = this
         api2.getEntityById(_this.Id, _this.$axios).then(res => {
         api2.getEntityById(_this.Id, _this.$axios).then(res => {
           _this.formData = res.data
           _this.formData = res.data
+          console.log("---this.formData---", _this.formData)
           this.backhistroy.certId = _this.Id
           this.backhistroy.certId = _this.Id
           this.backhistroy.workflowId = _this.formData.WorkFlowId
           this.backhistroy.workflowId = _this.formData.WorkFlowId
-          //显示原推荐单位
-          if (_this.formData.RecUnitFlag != null) {
-            let arr = _this.formData.RecUnitFlag.split(',')
-            let arr2 = []
-            for (let i = 0; i < arr.length; i++) {
-              arr2.push(parseInt(arr[i]))
-            }
-            _this.selectedOrgList = arr2
-          }
+          this.getFileList()
           //显示公司名
           //显示公司名
           _this.supplierOptions = _this.formData.SupplierId.toString()
           _this.supplierOptions = _this.formData.SupplierId.toString()
+          _this.getSortList()
         }).catch(err => {
         }).catch(err => {
           console.error(err)
           console.error(err)
         })
         })
       },
       },
+      //获取资质文件
+      getFileList() {
+        this.SupplierId = this.formData.SupplierId
+        this.SupplierTypeCode = this.formData.AppendType
+        let _this = this
+        const params = {
+          SupplierId: this.SupplierId,
+          SupplierTypeCode: this.SupplierTypeCode,
+          _currentPage: 1,
+          _size: 1000,
+        }
+        _this.$axios.get('supplierfile/filelist', {
+            params
+          })
+          .then(res => {
+            _this.subfileList = res.data.items
+            console.log("---this.subfileList---", this.subfileList)
+            _this.currentItemCount = res.data.currentItemCount
+            for (let idx in _this.subfileList) {
+              console.log(_this.subfileList[idx])
+              _this.subfileList[idx].FileUrlList = _this.subfileList[idx].FileUrl.split('$')
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      makesure() {
+        if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+          // 上传附件是否完成判断
+          if (!this.attachissuccess()) {
+            this.$message.error('有附件未成功上传!不能保存数据')
+            return
+          }
+          this.getattachissuccess()
+          this.editSubfile()
+        } else {
+          this.editSubfile()
+        }
+      },
+      editSubfile() {
+        let _this = this
+        _this.SubfileForm.SupplierId = parseInt(_this.SubfileForm.SupplierId)
+        _this.SubfileForm.SupplierCertSubId = parseInt(_this.SubfileForm.SupplierCertSubId)
+        _this.$axios.put('/supplierfile/editsubfile/' + _this.SubfileForm.Id, _this.SubfileForm)
+          .then(res => {
+            if (res.data.code === 0) {
+              _this.$message({
+                type: 'success',
+                message: res.data.message,
+              })
+              this.visible = false
+              this.initData()
+              this.$refs.refuploadattach.uploadFiles = []
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      fileurlcut(val, index) {
+        let fileurlall = val.split('$')[index]
+        let fileurl = fileurlall.split("|")
+        return fileurl[0]
+      },
+      openDialog(val) {
+        this.SubfileForm.Id = val.Id
+        this.SubfileForm.SupplierId = val.SupplierId
+        this.SubfileForm.SupplierTypeCode = val.SupplierTypeCode
+        if (val.SupplierCertSubId == 0) {
+          this.SubfileForm.SupplierCertSubId = ''
+        } else {
+          this.SubfileForm.SupplierCertSubId = val.SupplierCertSubId
+        }
+        this.SubfileForm.CertSubName = val.CertSubName
+        this.SubfileForm.NeedFileType = val.NeedFileType
+        this.SubfileForm.NeedFileCode = val.NeedFileCode
+        this.SubfileForm.FileExt = val.FileExt
+        this.SubfileForm.FileType = val.FileType
+        this.SubfileForm.FileName = val.FileName
+        this.SubfileForm.EffectDate = new Date(val.EffectDate)
+        this.SubfileForm.FileUrl = val.FileUrl
+        this.getwendanginfo(val.FileUrl)
+        this.SubfileForm.OtherRemark = val.OtherRemark
+        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 isLt512K = file.size / 1024 < 512
+        if (isLt512K) {
+          this.$message.error('上传文件大小不能小于 512KB!')
+          return false
+        }*/
+        let isLt50m = file.size / 1024 / 1024 / 5 < 1
+        if (!isLt50m) {
+          this.$message.error('上传文件大小不能超过 5MB!')
+          return false
+        }
+        return true
+      },
+      uploadrequest(option) {
+        let _this = 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) {
+            _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}$`
+                  this.SubfileForm.FileName += `${this.$refs.refuploadattach.uploadFiles[i].name}$`
+                }
+              }
+            }
+          }
+        }
+      },
+      clickachment(url, uid) {
+        window.open(`http://${url}`)
+      },
       //保存增项信息
       //保存增项信息
       saveEntity() {
       saveEntity() {
         let _this = this
         let _this = this
@@ -474,6 +722,7 @@
         let _this = this
         let _this = this
         api2.updateEntity(_this.Id, _this.formData, _this.$axios).then(res => {
         api2.updateEntity(_this.Id, _this.formData, _this.$axios).then(res => {
           if (res.data.code === 0) {
           if (res.data.code === 0) {
+            this.getEntityById()
             this.$message({
             this.$message({
               type: 'success',
               type: 'success',
               message: res.data.message
               message: res.data.message
@@ -493,16 +742,20 @@
       getSortList() {
       getSortList() {
         //分页及列表条件
         //分页及列表条件
         let params = {
         let params = {
-          _currentPage: this.currentPage,
-          _size: this.size,
-          Order: this.Column.Order,
-          Prop: this.Column.Prop,
+          // _currentPage: this.currentPage,
+          // _size: this.size,
+          // Order: this.Column.Order,
+          // Prop: this.Column.Prop,
           SupplierCertAppendId: this.dialogFormData.SupplierCertAppendId,
           SupplierCertAppendId: this.dialogFormData.SupplierCertAppendId,
+          SupCertId: this.formData.SupplierCertId,
+          SupTypeCode: this.formData.AppendType,
         };
         };
+
         //访问接口
         //访问接口
         api.getList(params, this.$axios).then(res => {
         api.getList(params, this.$axios).then(res => {
-          this.entityList = res.data.items
-          this.currentItemCount = res.data.currentItemCount
+          this.entityList = res.data.item
+          console.log("------res.entityList==--", this.entityList)
+          // this.currentItemCount = res.data.currentItemCount
         }).catch(err => {
         }).catch(err => {
           console.error(err)
           console.error(err)
         })
         })
@@ -515,8 +768,10 @@
         _this.$axios.post('/suppliercertappend/addappend/', _this.formData)
         _this.$axios.post('/suppliercertappend/addappend/', _this.formData)
           .then(res => {
           .then(res => {
             if (res.data.code === 0) {
             if (res.data.code === 0) {
-              _this.dialogFormData.SupplierCertAppendId = res.data.item //接收插入数据后返回的Id
-              _this.Id = res.data.item
+              this.entityList = res.data.item
+              this.dialogFormData.SupplierCertAppendId = res.data.info //接收插入数据后返回的Id
+              this.Id = res.data.info
+              this.getEntityById()
               _this.$message({
               _this.$message({
                 type: 'success',
                 type: 'success',
                 message: res.data.message,
                 message: res.data.message,
@@ -538,7 +793,6 @@
         let _this = this
         let _this = this
         //先判断是否保存了增项信息
         //先判断是否保存了增项信息
         if (this.checkAppendSave()) {
         if (this.checkAppendSave()) {
-          _this.dialogTitle = '添加'
           _this.dialogVisible = true
           _this.dialogVisible = true
           _this.selectedOptList = [] //置空,防止先修改再添加时的已选分类信息保留
           _this.selectedOptList = [] //置空,防止先修改再添加时的已选分类信息保留
           _this.dialogFormData.Id = ''
           _this.dialogFormData.Id = ''
@@ -546,75 +800,28 @@
           _this.dialogFormData.Code = ''
           _this.dialogFormData.Code = ''
           _this.dialogFormData.Remark = ''
           _this.dialogFormData.Remark = ''
         }
         }
-      },
-
-      //编辑增项分类
-      editSortData(row) {
-        let _this = this
-        _this.dialogTitle = '编辑'
-        _this.dialogVisible = true
-        _this.dialogFormData = row
-        //显示原增项结构
-        if (_this.dialogFormData.SortFlag != null) {
-          let arr = _this.dialogFormData.SortFlag.split(',')
-          let arr2 = []
-          for (let i = 0; i < arr.length; i++) {
-            arr2.push(parseInt(arr[i]))
-          }
-          _this.selectedOptList = arr2
-        }
+        this.getorgtreelist()
       },
       },
 
 
       //取消
       //取消
       cancelOption() {
       cancelOption() {
-        let _this = this
-        _this.dialogVisible = false
+        this.dialogVisible = false
       },
       },
 
 
       //确定
       //确定
       ensureOption() {
       ensureOption() {
-        this.$refs['dialogFormData'].validate((valid) => {
-          if (valid) {
-            let _this = this
-            if (_this.dialogTitle == '添加') {
-              let arr = []
-              arr = _this.$refs['cascader'].currentLabels //_this.$refs['cascader'].currentLabels获取当前级联选项的id对应的value
-              _this.dialogFormData.Name = arr[arr.length - 1]
-              _this.dialogFormData.SupplierId = _this.formData.SupplierId
-              _this.dialogFormData.SupplierCertId = _this.formData.SupplierCertId
-              _this.dialogFormData.SupplierCertAppendId = parseInt(_this.dialogFormData.SupplierCertAppendId)
-              _this.addSortAppend()
-              _this.getEntityById()
-            }
-            if (_this.dialogTitle == '编辑') {
-              let arr = []
-              arr = _this.$refs['cascader'].currentLabels
-              _this.dialogFormData.Name = arr[arr.length - 1]
-              api.updateEntity(_this.dialogFormData.Id, _this.dialogFormData, _this.$axios).then(res => {
-                if (res.data.code === 0) {
-                  this.$message({
-                    type: 'success',
-                    message: res.data.message
-                  });
-                  //关闭dialog
-                  _this.dialogVisible = false
-                  //更新列表
-                  this.getSortList()
-                  this.getEntityById()
-                } else {
-                  this.$message({
-                    type: 'warning',
-                    message: res.data.message
-                  });
-                }
-              }).catch(err => {
-                console.error(err)
-              })
-            }
-          } else {
-            return false
+        let arr = []
+        let val = this.$refs.orgmanagetree.getCheckedNodes()
+        this.checkList = []
+        for (var i = 0; i < val.length; i++) {
+          if (!val[i].children || val[i].children.length <= 0) {
+            this.checkList.push(val[i])
           }
           }
-        })
+        }
+        this.dialogFormData.SupplierId = this.formData.SupplierId
+        this.dialogFormData.SupplierCertId = this.formData.SupplierCertId
+        this.dialogFormData.SupplierCertAppendId = parseInt(this.dialogFormData.SupplierCertAppendId)
+        this.addSortAppend()
       },
       },
 
 
       //判断是否保存了增项信息
       //判断是否保存了增项信息
@@ -632,7 +839,25 @@
       //添加增项分类信息
       //添加增项分类信息
       addSortAppend() {
       addSortAppend() {
         let _this = this
         let _this = this
-        _this.$axios.post('/suppliercertappendsub/addappendsub/', _this.dialogFormData)
+        let params = {
+          SupplierId: parseInt(this.formData.SupplierId),
+          SupplierCertId: parseInt(this.formData.SupplierCertId),
+          SupplierCertAppendId: parseInt(this.dialogFormData.SupplierCertAppendId),
+          SupplierTypeCode: '03',
+          Remark: this.dialogFormData.Remark
+        }
+        if (_this.checkList.length > 0) {
+          params = Object.assign(params, {
+            CheckList: _this.checkList
+          })
+        } else {
+          _this.$message({
+            type: 'warning',
+            message: '名称不能为空,请选择分类!'
+          })
+          return
+        }
+        _this.$axios.post('/suppliercertappendsub/addtechbus/', params)
           .then(res => {
           .then(res => {
             if (res.data.code === 0) {
             if (res.data.code === 0) {
               _this.$message({
               _this.$message({
@@ -642,7 +867,7 @@
               //关闭dialog
               //关闭dialog
               _this.dialogVisible = false
               _this.dialogVisible = false
               //更新增项分类表
               //更新增项分类表
-              _this.getSortList()
+              _this.getEntityById()
             } else {
             } else {
               _this.$message({
               _this.$message({
                 type: 'warning',
                 type: 'warning',
@@ -662,25 +887,26 @@
             confirmButtonText: '确定',
             confirmButtonText: '确定',
             cancelButtonText: '取消',
             cancelButtonText: '取消',
             type: 'warning'
             type: 'warning'
-          }).then(() => {
-            api.deleteEntity(Id, _this.$axios)
-              .then(res => {
-                // response
-                if (res.data.code === 0) {
+          })
+          .then(() => {
+            _this.$axios.delete('suppliercertsub/businessdelete/' + Id, {})
+              .then(function (response) {
+                if (response.data.code === 0) {
                   _this.$message({
                   _this.$message({
                     type: 'success',
                     type: 'success',
-                    message: res.data.message
+                    message: response.data.message
                   })
                   })
-                  // 更新列表
-                  this.getSortList()
+                  _this.getEntityById()
                 } else {
                 } else {
                   _this.$message({
                   _this.$message({
                     type: 'warning',
                     type: 'warning',
-                    message: res.data.message
+                    message: response.data.message
                   })
                   })
                 }
                 }
               })
               })
-              .catch(() => {})
+              .catch(function (error) {
+                console.log(error)
+              })
           })
           })
           .catch(() => {})
           .catch(() => {})
       },
       },
@@ -688,10 +914,6 @@
       selectAuditOrg() {
       selectAuditOrg() {
         this.dialogVisible = true
         this.dialogVisible = true
       },
       },
-      chooseAuditorShow() {
-        this.$refs['chooseAuditor'].getorgtreelist(this.formData.SupplierTypeCode)
-        this.chooseAuditorVisible = true
-      },
       setAuditer(val, name) {
       setAuditer(val, name) {
         this.auditer = val
         this.auditer = val
         this.auditerName = name
         this.auditerName = name
@@ -710,7 +932,7 @@
         this.applyLoading = true
         this.applyLoading = true
         this.auditform.FirstAuditName = this.auditer
         this.auditform.FirstAuditName = this.auditer
         this.auditform.CertId = this.formData.Id
         this.auditform.CertId = this.formData.Id
-        console.log("---this.auditform---",this.auditform)
+        console.log("---this.auditform---", this.auditform)
         api2.auditEntity(this.formData.Id, this.auditform, this.$axios).then(res => {
         api2.auditEntity(this.formData.Id, this.auditform, this.$axios).then(res => {
           if (res.data.code === 0) {
           if (res.data.code === 0) {
             // 保存成功后,初始化数据,变成修改
             // 保存成功后,初始化数据,变成修改
@@ -732,16 +954,20 @@
         })
         })
       },
       },
 
 
+      showDialog() {
+        this.getorgtreelist()
+        this.techDialog = true
+      },
       getorgtreelist() {
       getorgtreelist() {
         let _this = this
         let _this = this
         let params = {
         let params = {
-          IsInnerOrganize: 1
+          keyword: _this.keyword
         }
         }
-        _this.$axios.get('organizes/orgalllist', {
+        this.$axios.get('technologyservice/techbuslist', {
             params
             params
           })
           })
           .then(res => {
           .then(res => {
-            _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
+            _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Code,Name,CodeName')
           })
           })
           .catch(err => {
           .catch(err => {
             console.error(err)
             console.error(err)
@@ -804,3 +1030,32 @@
   }
   }
 
 
 </script>
 </script>
+<style lang='scss'>
+  .attach-uploader .el-upload {
+    border: 1px dashed #63B8FF;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    // margin-bottom: -17px;
+    margin-top: -15px;
+    margin-left: 20px
+  }
+
+  .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>

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/basislist.vue

@@ -53,7 +53,7 @@
             {{ jstimehandle(scope.row.ApplyDate) }}
             {{ jstimehandle(scope.row.ApplyDate) }}
           </template>
           </template>
         </el-table-column>
         </el-table-column>
-        <el-table-column prop="RecUnitName" label="推荐单位名称" sortable min-width="130" align="center"
+        <el-table-column prop="RecUnitName" label="供方名称" sortable min-width="130" align="center"
           show-overflow-tooltip></el-table-column>
           show-overflow-tooltip></el-table-column>
         <!-- <el-table-column prop="RecUnitId" label="推荐单位编码" sortable min-width="130" align="center" show-overflow-tooltip></el-table-column> -->
         <!-- <el-table-column prop="RecUnitId" label="推荐单位编码" sortable min-width="130" align="center" show-overflow-tooltip></el-table-column> -->
         <el-table-column prop="AppendType" label="增项类别" sortable min-width="130" align="center" show-overflow-tooltip>
         <el-table-column prop="AppendType" label="增项类别" sortable min-width="130" align="center" show-overflow-tooltip>

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/goodslist.vue

@@ -52,7 +52,7 @@
             {{ jstimehandle(scope.row.ApplyDate) }}
             {{ jstimehandle(scope.row.ApplyDate) }}
           </template>
           </template>
         </el-table-column>
         </el-table-column>
-        <el-table-column prop="RecUnitName" label="推荐单位名称" sortable min-width="130" align="center"
+        <el-table-column prop="RecUnitName" label="供方名称" sortable min-width="130" align="center"
           show-overflow-tooltip></el-table-column>
           show-overflow-tooltip></el-table-column>
         <!-- <el-table-column prop="RecUnitId" label="推荐单位编码" sortable min-width="130" align="center" show-overflow-tooltip></el-table-column> -->
         <!-- <el-table-column prop="RecUnitId" label="推荐单位编码" sortable min-width="130" align="center" show-overflow-tooltip></el-table-column> -->
         <el-table-column prop="AppendType" label="增项类别" sortable min-width="130" align="center" show-overflow-tooltip>
         <el-table-column prop="AppendType" label="增项类别" sortable min-width="130" align="center" show-overflow-tooltip>

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/techlist.vue

@@ -53,7 +53,7 @@
             {{ jstimehandle(scope.row.ApplyDate) }}
             {{ jstimehandle(scope.row.ApplyDate) }}
           </template>
           </template>
         </el-table-column>
         </el-table-column>
-        <el-table-column prop="RecUnitName" label="推荐单位名称" sortable min-width="130" align="center"
+        <el-table-column prop="RecUnitName" label="供方名称" sortable min-width="130" align="center"
           show-overflow-tooltip></el-table-column>
           show-overflow-tooltip></el-table-column>
         <!-- <el-table-column prop="RecUnitId" label="推荐单位编码" sortable min-width="130" align="center" show-overflow-tooltip></el-table-column> -->
         <!-- <el-table-column prop="RecUnitId" label="推荐单位编码" sortable min-width="130" align="center" show-overflow-tooltip></el-table-column> -->
         <el-table-column prop="AppendType" label="增项类别" sortable min-width="130" align="center" show-overflow-tooltip>
         <el-table-column prop="AppendType" label="增项类别" sortable min-width="130" align="center" show-overflow-tooltip>