lining 6 år sedan
förälder
incheckning
c34f16cc29

+ 18 - 1
src/dashoo.cn/backend/api/business/auditsetting/oilauditsettingService.go

@@ -2,7 +2,10 @@ package auditsetting
 
 import (
 	. "dashoo.cn/backend/api/mydb"
+	"dashoo.cn/utils"
 	"github.com/go-xorm/xorm"
+	"strings"
+	"dashoo.cn/business2/userRole"
 )
 
 type OilAuditSettingService struct {
@@ -20,4 +23,18 @@ func (s *OilAuditSettingService) GetAuditStepRoleEntity(tablename string, organi
 	where = " 1=1 and OrganizeId = '" + organizeId + "' and AuditStepCode = '" + auditStepCode + "' "
 	s.GetEntityByWhere(tablename, where, entityPtr)
 	return
-}
+}
+
+//根据用户角色获取用户列表
+func (s *OilAuditSettingService) GetUserByRole(roleid string, acccode string) (utree []userRole.Base_RoleList) {
+	users := make([]userRole.Base_RoleList, 0)
+	userlist := utils.RBAC.GetUsersForRoleInDomain("rid_"+roleid, utils.DOMAIN)
+	for _, userid := range userlist {
+		userid = strings.Trim(userid, "uid_")
+		s.DBE.SQL("SELECT Id,Realname FROM Base_User WHERE id = " + userid).Find(&users)
+	}
+	//s.DBE.Sql(` select a.UserId Id, b.Realname RealName FROM Base_UserRole a ` +
+	//	" left join Base_User b on a.UserId=b.Id " +
+	//	`where a.RoleId =` + roleid + ` and b.Realname is not null and b.AccCode = '` + acccode + `' `).Find(&users)
+	return users
+}

+ 4 - 0
src/dashoo.cn/backend/api/business/oilsupplier/suppliercert/oilsuppliercert.go

@@ -49,6 +49,10 @@ type OilSupplierCert struct {
 	DesignerTotal     int       `xorm:"default 0 comment('设计人员总数') INT(10)"`
 	SkillerTotal      int       `xorm:"default 0 comment('技术工人总数') INT(10)"`
 	WorkflowId        string    `xorm:"default '0' comment('工作流的ID') VARCHAR(255)"`
+	FirstAudit      int       `xorm:"default 0 comment('初审') INT(10)"`
+	SecondAudit      int       `xorm:"default 0 comment('复审') INT(10)"`
+	ThirdAudit      int       `xorm:"default 0 comment('专业科室审批') INT(10)"`
+	FourthAudit      int       `xorm:"default 0 comment('集中审批') INT(10)"`
 	CreateOn          time.Time `xorm:"DATETIME"`
 	CreateUserId      int       `xorm:"INT(10)"`
 	CreateBy          string    `xorm:"VARCHAR(50)"`

+ 4 - 4
src/dashoo.cn/backend/api/business/oilsupplier/suppliercert/oilsuppliercertService.go

@@ -1,16 +1,16 @@
 package suppliercert
 
 import (
+	"dashoo.cn/backend/api/business/auditsetting"
+	"dashoo.cn/backend/api/business/oilsupplier/classorgsetting"
+	"dashoo.cn/backend/api/business/workflow"
+	"dashoo.cn/business2/userRole"
 	"dashoo.cn/utils"
 	"strconv"
 	"strings"
 
-	"dashoo.cn/backend/api/business/auditsetting"
-	"dashoo.cn/backend/api/business/oilsupplier/classorgsetting"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
-	"dashoo.cn/backend/api/business/workflow"
 	. "dashoo.cn/backend/api/mydb"
-	"dashoo.cn/business2/userRole"
 	"github.com/go-xorm/xorm"
 )
 

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

@@ -1,6 +1,7 @@
 package oilsupplier
 
 import (
+	"dashoo.cn/backend/api/business/organize"
 	"encoding/json"
 	"strconv"
 	"strings"
@@ -1003,6 +1004,9 @@ func (this *OilSupplierController) GetDictList() {
 		dictList["CompanyNames"] = list
 	}
 
+	// 部门
+	orgsvc := organize.GetOrganizeService(utils.DBE)
+	dictList["Organizes"] = orgsvc.GetCollectionDetailviewlist("'"+this.User.AccCode+"'")
 	//var dictCustomer []svccustomer.Customer
 	//customerSvc.GetEntitysByWhere(this.User.AccCode + CustomerName, "", &dictCustomer)
 	//dictList["EntrustCorp"] = &dictCustomer

+ 68 - 9
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -1,6 +1,7 @@
 package oilsupplier
 
 import (
+	"dashoo.cn/backend/api/business/auditsetting"
 	"encoding/json"
 	"fmt"
 	"strconv"
@@ -497,6 +498,7 @@ func (this *OilSupplierCertController) DeleteEntity() {
 // @router /audit/:id [post]
 func (this *OilSupplierCertController) AuditEntity() {
 	certId := this.Ctx.Input.Param(":id")
+	firstAudit := this.GetString("firstAudit")
 	var errinfo ErrorDataInfo
 	defer func() { //finally处理失败的异常
 		if err := recover(); err != nil {
@@ -513,29 +515,83 @@ func (this *OilSupplierCertController) AuditEntity() {
 		}
 	}()
 
-	//判断当前部门是否企业用户
-	result := "1"
-	if this.User.IsCompanyUser == 1 {
-		result = "0"
-	}
+	////判断当前部门是否企业用户
+	//result := "1"
+	//if this.User.IsCompanyUser == 1 {
+	//	result = "0"
+	//}
 
 	//取出审批列表
 	certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
-	processInstanceId,_ := certSrv.SubmitOrgAudit(certId, workflow.OIL_SUPPLIER_APPLY, workflow.FIRST_TRIAL, this.User.Id, result, "提交给二级单位初审", OilSupplierCertSubName, OilClassOrgSettingName, "", "")
-	fmt.Println("-----------processInstanceId------------", processInstanceId)
+
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	//获得有审核权限的人员
+	var users []userRole.Base_RoleList
+	var userIds string
+	var auditWorkflow auditsetting.Base_OilAuditSetting
+	rsvc := auditsetting.GetOilAuditSettingService(utils.DBE)
+	rsvc.GetAuditStepRoleEntity(OilAuditSettingName, firstAudit, workflow.FIRST_TRIAL, &auditWorkflow)
+	users = rsvc.GetUserByRole(strconv.Itoa(auditWorkflow.RoleId), this.User.AccCode) //
+
+
+	//processInstanceId,_ := certSrv.SubmitOrgAudit(certId, workflow.OIL_SUPPLIER_APPLY, workflow.FIRST_TRIAL, this.User.Id, result, "提交给二级单位初审", OilSupplierCertSubName, OilClassOrgSettingName, "", "")
+	for _, tmpUser := range users {
+		userIds += strconv.FormatInt(tmpUser.Id, 10) + ","
+	}
+	userIds = strings.Trim(userIds, ",")
+	var ActiComplete workflow.ActiCompleteVM
+	ActiComplete.ProcessKey = workflow.OIL_SUPPLIER_APPLY
+	ActiComplete.BusinessKey = certId
+	ActiComplete.UserNames = userIds
+	ActiComplete.UserId = this.User.Id
+	ActiComplete.Result = "1"
+	ActiComplete.Remarks = "提交给二级单位初审"
+	ActiComplete.CallbackUrl = ""
+	receiveVal := svcActiviti.TaskComplete(ActiComplete)
+
+	if receiveVal == "true" {
+		errinfo.Message = "提交成功!"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "工作流异常,请联系管理员!"
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+	fmt.Println("-----------processInstanceId------------")
 	//记下workflowID(首次提交时才会记录,中间状态请忽略) 及审批状态
 	var supplierCertEntity suppliercert.OilSupplierCert
 	certSrv.GetEntityById(certId, supplierCertEntity)
-	supplierCertEntity.WorkflowId = processInstanceId
+	//supplierCertEntity.WorkflowId = processInstanceId
 	supplierCertEntity.Status = suppliercert.FIRST_TRIAL_STATUS //二级单位初审
 	supplierCertEntity.Step = 2
+	supplierCertEntity.FirstAudit,_ = strconv.Atoi(firstAudit)
 	cols := []string{
 		"Id",
 		"WorkflowId",
 		"Status",
 		"Step",
+		"FirstAudit",
 	}
 	certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
+
+	//var model classorgsetting.OilClassOrgSetting
+	//var jsonBlob = this.Ctx.Input.RequestBody
+	//svc := suppliercert.GetOilSupplierCertService(utils.DBE)
+	//
+	//json.Unmarshal(jsonBlob, &model)
+	//model.CreateOn = time.Now()
+	//model.CreateBy = this.User.Realname
+	//model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+	////model.OrganizeId, _ = utils.StrTo(this.User.DepartmentId).Int()
+	//
+	//svc.InsertEntityBytbl(OilSupplierCertName, &model)
+	//fmt.Println(model)
+
 }
 
 // @Title 专业审批
@@ -646,12 +702,15 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 
 	wfNodeCode := "" // 审批步骤
 	remarks := ""
+	step := "2"
 	if status == "1" {
 		wfNodeCode = workflow.SECOND_TRIAL
 		remarks = "提交给二级单位复审"
+		step = "2"
 	} else if status == "2" {
 		wfNodeCode = workflow.PROF_AUDIT
 		remarks = "提交给专业处审批"
+		step = "2"
 	} else if status == "3" {
 
 	} else if status == "4" {
@@ -661,7 +720,7 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 	if dataother.SuccessStatus == 1 {
 		//取出审批列表
 		certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
-		_,res := certSrv.SubmitOrgAudit(certId, workflow.OIL_SUPPLIER_APPLY, wfNodeCode, this.User.Id, "1", remarks, OilSupplierCertSubName, OilClassOrgSettingName, suppliercert.SECOND_TRIAL_STATUS, "2")
+		_,res := certSrv.SubmitOrgAudit(certId, workflow.OIL_SUPPLIER_APPLY, wfNodeCode, this.User.Id, "1", remarks, OilSupplierCertSubName, OilClassOrgSettingName, suppliercert.SECOND_TRIAL_STATUS, step)
 		if res == "true" {
 			errinfo.Message = "审核通过!"
 			errinfo.Code = 0

+ 2 - 2
src/dashoo.cn/frontend_web/src/api/oilsupplier/suppliercert.js

@@ -44,9 +44,9 @@ export default {
       method: 'delete'
     })
   },
-  auditEntity (entityId, myAxios) {
+  auditEntity (entityId, FirstAudit, myAxios) {
     return myAxios({
-      url: '/suppliercert/audit/' + entityId,
+      url: '/suppliercert/audit/' + entityId + '?firstAudit=' + FirstAudit,
       method: 'post'
     })
   },

+ 46 - 48
src/dashoo.cn/frontend_web/src/components/oilsupplier/auditbuslist.vue

@@ -91,7 +91,7 @@
   export default {
     name: 'AuditBusList',
     components: {
-      AuditfileList, //文档
+      AuditfileList // 文档
     },
     props: {
       SupplierCertId: {
@@ -107,7 +107,7 @@
         default: '0'
       }
     },
-    created() {
+    created () {
       this.initData()
       this.certId = this.$route.query.certid + ''
     },
@@ -116,8 +116,9 @@
         session: 'session'
       })
     },
-    data() {
+    data () {
       return {
+        addshow: false,
         oneList: [],
         OneCode: '',
         auditbusList: [],
@@ -152,25 +153,25 @@
         currentItemCount: 0,
 
         opinionList: [],
-        auditfileList: [], //文档
+        auditfileList: [] // 文档
       }
     },
     methods: {
-      initData() {
+      initData () {
         let _this = this
         const params = {
           SupplierCertId: this.SupplierCertId,
           SupplierTypeCode: this.SupplierTypeCode,
           _currentPage: this.currentPage,
-          _size: this.size,
+          _size: this.size
         }
         this.$axios.get('suppliercertsub/auditbuslist', {
-            params
-          })
+          params
+        })
           .then(res => {
             _this.auditbusList = res.data.items
             _this.currentItemCount = res.data.currentItemCount
-            _this.$refs["auditfileList"].initData()
+            _this.$refs['auditfileList'].initData()
           })
           .catch(err => {
             // handle error
@@ -198,74 +199,73 @@
       //   });
       // },
 
-      //准入初审 提交审批
-      AuditEntity() {
+      // 准入初审 提交审批
+      AuditEntity () {
         this.applyLoading = true
         apiCert.auditEntityadmission(this.certId, this.$axios).then(res => {
           if (res.data.code === 0) {
-            //保存成功后,初始化数据,变成修改
+            // 保存成功后,初始化数据,变成修改
             this.initData()
             this.$message({
               type: 'success',
               message: res.data.message
-            });
+            })
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
+            })
           }
           this.applyLoading = false
-
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
-      addAudit() {
-        let _this = this;
+      addAudit () {
+        let _this = this
         _this.AuditForm.SupplierId = parseInt(_this.AuditForm.SupplierId)
         _this.AuditForm.SupplierCertSubId = parseInt(_this.AuditForm.SupplierCertSubId)
         _this.AuditForm.AuditStatus = parseInt(_this.AuditForm.AuditStatus)
-        _this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          })
+        _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
           .then(() => {
             _this.$axios.post('/suppliercertsub/addopinion', _this.AuditForm, {})
               .then(function (response) {
                 if (response.data.code === 0) {
                   _this.$message({
                     type: 'success',
-                    message: response.data.message,
+                    message: response.data.message
                   })
                   _this.AuditForm.Id = response.data.item + ''
                   _this.visible = false
                 } else {
                   _this.$message({
-                    type: "warning",
+                    type: 'warning',
                     message: response.data.message
-                  });
+                  })
                 }
               })
               .catch(function (error) {
-                console.log(error);
-              });
+                console.log(error)
+              })
           })
           .catch(err => {
             console.error(err)
           })
       },
-      getopinonList(val) {
-        let _this = this;
+      getopinonList (val) {
+        let _this = this
         const params = {
-          SupplierCertSubId: val.Id,
+          SupplierCertSubId: val.Id
         }
         _this.$axios.get('/suppliercertsub/opinionlist', {
-            params
-          })
+          params
+        })
           .then(function (response) {
-            if (!!response.data.code) {
+            if (!response.data.code) {
               _this.$message({
                 type: 'warning',
                 message: response.data.message
@@ -275,10 +275,9 @@
             }
           }).catch(err => {
             console.error(err)
-          });
+          })
       },
-
-      openDialog(val) {
+      openDialog (val) {
         this.Title = '新增审核意见'
         this.AuditForm.Id = ''
         this.AuditForm.SupplierId = this.SupplierId
@@ -294,33 +293,33 @@
         this.visible = true
       },
 
-      subfiledialog() {
-        this.$refs["auditfileList"].showDialog()
+      subfiledialog () {
+        this.$refs['auditfileList'].showDialog()
       },
 
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         this.initData()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.initData()
       },
-      HandleSizeChange(value) {
+      HandleSizeChange (value) {
         this.Size = value
         this.CurrentPage = 1
         this.getbusiness()
       },
-      HandleCurrentChange(value) {
+      HandleCurrentChange (value) {
         this.CurrentPage = value
         this.getbusiness()
       },
-      seachdata() {
+      seachdata () {
         this.CurrentPage = -1
         this.getbusiness()
       },
-      transferStr(val) {
+      transferStr (val) {
         if (val === '1') {
           return '合格'
         } else if (val === '2') {
@@ -329,7 +328,7 @@
           return '----'
         }
       },
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -340,10 +339,9 @@
           val = val.replace('T', ' ')
           return val.substring(0, 10)
         }
-      },
+      }
     }
   }
-
 </script>
 
 <style>

+ 132 - 108
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/goodsedit.vue

@@ -174,7 +174,7 @@
         </el-tab-pane>
         <el-tab-pane label="企业资质" :disabled="!certId">
           <business-list ref="businessList" :data.sync="businessList" :SupplierCertId="certId+''" :SupplierId="serviceId"
-            :SupplierTypeCode="classId" :canadd="add_flat" @close="AuditEntity" height="360px" style="margin-top: 20px">
+            :SupplierTypeCode="classId" :canadd="add_flat" @close="selectAuditOrg" height="360px" style="margin-top: 20px">
           </business-list>
         </el-tab-pane>
 
@@ -196,6 +196,29 @@
         </el-tab-pane>
       </el-tabs>
     </el-card>
+    <el-dialog title="选择审批单位" :visible.sync="dialogVisible" width="520px">
+      <el-form ref="searchForm" label-width="110px">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="单位名称">
+              <el-select ref="selectauditOrg" v-model="FirstAudit" placeholder="请选择"
+                         style="width: 90%" filterable allow-create default-first-option>
+                <el-option
+                  v-for="item in organizeOption"
+                  :key="item.Id"
+                  :label="item.Fullname"
+                  :value="item.Id">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="dialogVisible = false">取 消</el-button>
+        <el-button size="mini" type="primary" @click="AuditEntity">确定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -223,12 +246,12 @@
       WfHistory,
       SupplierCertEdit,
 
-      EquipmentList, //企业主要装备情况
-      PerformanceList, //近三年主要工程业绩列表
-      PatentList, //拥有专利、专有技术及工法列表
-      WinningList, //近三年获得省部级及以上主要技术、管理成果、获奖项目列表
-      BusinessList, //选择准入范围
-      GoodsInfo,
+      EquipmentList, // 企业主要装备情况
+      PerformanceList, // 近三年主要工程业绩列表
+      PatentList, // 拥有专利、专有技术及工法列表
+      WinningList, // 近三年获得省部级及以上主要技术、管理成果、获奖项目列表
+      BusinessList, // 选择准入范围
+      GoodsInfo
     },
     computed: {
       ...mapGetters({
@@ -237,19 +260,22 @@
     },
     name: 'goodsEdit',
 
-    data() {
+    data () {
       return {
+        dialogVisible: false,
         canUpdateSupplier: true,
         dictData: null,
         applyLoading: false,
-        equipmentList: [], //企业主要装备情况
-        performanceList: [], //近三年主要工程业绩
-        patentList: [], //拥有专利、专有技术及工法
-        winningList: [], //近三年获得省部级及以上主要技术、管理成果、获奖项目
-        businessList: [], //准入业务
+        equipmentList: [], // 企业主要装备情况
+        performanceList: [], // 近三年主要工程业绩
+        patentList: [], // 拥有专利、专有技术及工法
+        winningList: [], // 近三年获得省部级及以上主要技术、管理成果、获奖项目
+        businessList: [], // 准入业务
+        organizeOption: [], // 审批部门
         serviceId: '',
         certId: '',
         classId: '01',
+        FirstAudit: '',
         formData: {
           Id: '',
           SupplierName: '',
@@ -329,7 +355,7 @@
           SupplierTypeCode: '01',
           SupplierTypeName: '物资类',
           Step: 0,
-          HseTraining: 0,
+          HseTraining: 0
         },
 
         formDataCert: {
@@ -343,15 +369,14 @@
           NationalCertTotal: 0,
           DesignerTotal: 0,
           SkillerTotal: 0,
-          Status: 0,
-          WorkflowId: ''
+          Status: 0
         },
         add_flat: true,
         entrydetail: {
           process: 'oil_supplier_apply',
           business: '',
           instance: ''
-        },
+        }
       }
     },
     mounted () {
@@ -360,7 +385,7 @@
         this.certId = this.$route.query.certid
       }
     },
-    created() {
+    created () {
       this.serviceId = this.$route.params.opera + ''
       if (this.$route.query.certid) {
         this.certId = this.$route.query.certid + ''
@@ -374,7 +399,7 @@
       this.initDatas()
     },
     methods: {
-      inputCompany(val) {
+      inputCompany (val) {
         if (!this.certId) {
           api.getEntityByName(val, this.$axios).then(res => {
             if (res.data && res.data.Id) {
@@ -385,12 +410,12 @@
           })
         }
       },
-      changeFormData(fdata) {
+      changeFormData (fdata) {
         if (!this.certId) {
           this.SetFormData(fdata)
         }
       },
-      SetFormData(fdata) {
+      SetFormData (fdata) {
         this.isCanUpdateSupplier(fdata.Id)
         this.formData.Id = fdata.Id
         this.formData.SupplierName = fdata.SupplierName
@@ -438,41 +463,41 @@
         this.formData.HseTraining = fdata.HseTraining
         this.formData.SpecTypeCode = fdata.SpecTypeCode
 
-        this.$refs["GoodsInfo"].CityAry = []
-        this.$refs["GoodsInfo"].CityAry.push(this.formData.Province)
-        this.$refs["GoodsInfo"].CityAry.push(this.formData.City)
-        this.$refs["GoodsInfo"].CityAry.push(this.formData.Street)
-        this.$refs["GoodsInfo"].LinkCityAry = []
-        this.$refs["GoodsInfo"].LinkCityAry.push(this.formData.LinkProvince)
-        this.$refs["GoodsInfo"].LinkCityAry.push(this.formData.LinkCity)
-        this.$refs["GoodsInfo"].LinkCityAry.push(this.formData.LinkStreet)
-        this.$refs["GoodsInfo"].UnitRelationAry = []
+        this.$refs['GoodsInfo'].CityAry = []
+        this.$refs['GoodsInfo'].CityAry.push(this.formData.Province)
+        this.$refs['GoodsInfo'].CityAry.push(this.formData.City)
+        this.$refs['GoodsInfo'].CityAry.push(this.formData.Street)
+        this.$refs['GoodsInfo'].LinkCityAry = []
+        this.$refs['GoodsInfo'].LinkCityAry.push(this.formData.LinkProvince)
+        this.$refs['GoodsInfo'].LinkCityAry.push(this.formData.LinkCity)
+        this.$refs['GoodsInfo'].LinkCityAry.push(this.formData.LinkStreet)
+        this.$refs['GoodsInfo'].UnitRelationAry = []
         if (this.formData.SpecTypeCode.length > 0) {
-          this.$refs["GoodsInfo"].UnitRelationAry = this.formData.SpecTypeCode.split(',')
+          this.$refs['GoodsInfo'].UnitRelationAry = this.formData.SpecTypeCode.split(',')
         }
       },
 
-      isCanUpdateSupplier(supplierId) {
+      isCanUpdateSupplier (supplierId) {
         api.isCanUpdateSupplier(supplierId, this.$axios).then(res => {
           this.canUpdateSupplier = (res.data.code === 0)
         }).catch(err => {
           console.error(err)
         })
       },
-      equipmentdialog() {
-        this.$refs["equipmentList"].showDialog()
+      equipmentdialog () {
+        this.$refs['equipmentList'].showDialog()
       },
-      performancedialog() {
-        this.$refs["performanceList"].showDialog()
+      performancedialog () {
+        this.$refs['performanceList'].showDialog()
       },
-      patentdialog() {
-        this.$refs["patentList"].showDialog()
+      patentdialog () {
+        this.$refs['patentList'].showDialog()
       },
-      winningdialog() {
-        this.$refs["winningList"].showDialog()
+      winningdialog () {
+        this.$refs['winningList'].showDialog()
       },
 
-      initDatas() {
+      initDatas () {
         this.isCanUpdateSupplier(this.formData.Id)
         if (this.formData.Id) {
           api.getEntityAndCert(this.certId, this.$axios).then(res => {
@@ -489,54 +514,55 @@
             this.formDataCert.SkillerTotal = this.formData.SkillerTotal
             this.formDataCert.Status = this.formData.Status
             this.formDataCert.WorkflowId = this.formData.WorkflowId
-            this.$refs["GoodsInfo"].CityAry = []
-            this.$refs["GoodsInfo"].CityAry.push(this.formData.Province)
-            this.$refs["GoodsInfo"].CityAry.push(this.formData.City)
-            this.$refs["GoodsInfo"].CityAry.push(this.formData.Street)
-            this.$refs["GoodsInfo"].LinkCityAry = []
-            this.$refs["GoodsInfo"].LinkCityAry.push(this.formData.LinkProvince)
-            this.$refs["GoodsInfo"].LinkCityAry.push(this.formData.LinkCity)
-            this.$refs["GoodsInfo"].LinkCityAry.push(this.formData.LinkStreet)
-            this.$refs["GoodsInfo"].UnitRelationAry = []
+            this.$refs['GoodsInfo'].CityAry = []
+            this.$refs['GoodsInfo'].CityAry.push(this.formData.Province)
+            this.$refs['GoodsInfo'].CityAry.push(this.formData.City)
+            this.$refs['GoodsInfo'].CityAry.push(this.formData.Street)
+            this.$refs['GoodsInfo'].LinkCityAry = []
+            this.$refs['GoodsInfo'].LinkCityAry.push(this.formData.LinkProvince)
+            this.$refs['GoodsInfo'].LinkCityAry.push(this.formData.LinkCity)
+            this.$refs['GoodsInfo'].LinkCityAry.push(this.formData.LinkStreet)
+            this.$refs['GoodsInfo'].UnitRelationAry = []
             if (this.formData.SpecTypeCode.length > 0) {
-              this.$refs["GoodsInfo"].UnitRelationAry = this.formData.SpecTypeCode.split(',')
+              this.$refs['GoodsInfo'].UnitRelationAry = this.formData.SpecTypeCode.split(',')
             }
 
             this.entrydetail.business = this.certId
             this.entrydetail.instance = this.formDataCert.WorkflowId
             if (this.certId && this.formDataCert.WorkflowId) {
-              this.$refs['WfHistory'].getHistoryTask() /*刷新工作流*/
+              this.$refs['WfHistory'].getHistoryTask() /* 刷新工作流 */
             }
-            this.$refs["equipmentList"].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-            this.$refs["performanceList"].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-            this.$refs["patentList"].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-            this.$refs["winningList"].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
-            this.$refs["businessList"].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+            this.$refs['equipmentList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+            this.$refs['performanceList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+            this.$refs['patentList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+            this.$refs['winningList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
+            this.$refs['businessList'].getvalue(this.formData.Id, this.formData.SupplierTypeCode, this.certId)
           }).catch(err => {
             console.error(err)
-          });
+          })
         }
       },
 
-      getDictOptions() {
+      getDictOptions () {
         api.getDictList(this.$axios).then(res => {
           this.dictData = res.data.items
-          /*this.UnitRelationOptions = res.data.items['UnitRelation']
+          this.organizeOption = res.data.items['Organizes']
+          /* this.UnitRelationOptions = res.data.items['UnitRelation']
            this.getCityList(res.data.items['GaodeMapChinaAreas'])
-           this.CompanyTypeOptions = res.data.items['CompanyType']*/
+           this.CompanyTypeOptions = res.data.items['CompanyType'] */
         }).catch(err => {
           console.error(err)
         })
       },
-      /*getCityList(val) {
+      /* getCityList(val) {
        let resultData = JSON.parse(val)
        let countstr = JSON.stringify(resultData.districts[0].districts)
        countstr = countstr.replace(/\,\"districts\"\:\[\]/g, '')
        this.countryoptions = JSON.parse(countstr)
-       },*/
+       }, */
 
-      //保存信息
-      saveEntity() {
+      // 保存信息
+      saveEntity () {
         this.$refs['GoodsInfo'].$refs['EntityForm'].validate((valid) => {
           if (valid) {
             if (!this.formData.SetupTime) {
@@ -544,71 +570,68 @@
             } else {
               this.formData.SetupTime = new Date(this.formData.SetupTime)
             }
-            //this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
+            // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
             if (!this.formData.Id || !this.certId) {
               this.addEntity()
             } else {
               this.updateEntity()
             }
-
           } else {
             return false
           }
         })
       },
 
-      //保存信息
-      saveCertEntity() {
+      // 保存信息
+      saveCertEntity () {
         this.$refs['SupplierCertEditCompoment'].saveEntity()
       },
 
-      addEntity() {
+      addEntity () {
         this.formData.SupplierTypeCode = '01'
         this.formData.SupplierTypeName = '物资类'
         api.addEntity(this.formData, this.$axios).then(res => {
           if (res.data.code === 0) {
-            //保存成功后,初始化数据,变成修改
+            // 保存成功后,初始化数据,变成修改
             this.formData.Id = res.data.item.split('_')[0]
             this.certId = res.data.item.split('_')[1]
             this.initDatas()
             this.$message({
               type: 'success',
               message: res.data.message
-            });
-
+            })
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
+            })
           }
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
 
-      updateEntity() {
+      updateEntity () {
         api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
           if (res.data.code === 0) {
-            //保存成功后,初始化数据,变成修改
+            // 保存成功后,初始化数据,变成修改
             this.initDatas()
             this.$message({
               type: 'success',
               message: res.data.message
-            });
-
+            })
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
+            })
           }
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
 
-      CheckCompanyBase() {
+      CheckCompanyBase () {
         if (!this.formData.Id) {
           this.$message({
             type: 'error',
@@ -625,54 +648,56 @@
         }
         return true
       },
-      //企业人员结构情况
-      updateNumberEntity() {
+      // 企业人员结构情况
+      updateNumberEntity () {
         if (!this.CheckCompanyBase()) {
           return false
         }
         api.updateNumberEntity(this.formData.Id + '_' + this.certId, this.formDataCert, this.$axios).then(res => {
           if (res.data.code === 0) {
-            //保存成功后,初始化数据,变成修改
+            // 保存成功后,初始化数据,变成修改
             this.initDatas()
             this.$message({
               type: 'success',
               message: res.data.message
-            });
+            })
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
+            })
           }
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
-
-      AuditEntity() {
+      selectAuditOrg () {
+        this.dialogVisible = true
+      },
+      AuditEntity () {
         this.applyLoading = true
-        apiCert.auditEntity(this.certId, this.$axios).then(res => {
+        apiCert.auditEntity(this.certId, this.FirstAudit, this.$axios).then(res => {
           if (res.data.code === 0) {
-            //保存成功后,初始化数据,变成修改
+            // 保存成功后,初始化数据,变成修改
             this.initDatas()
+            this.dialogVisible = false
             this.$message({
               type: 'success',
               message: res.data.message
-            });
+            })
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
+            })
           }
           this.applyLoading = false
-
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
 
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -685,20 +710,19 @@
         }
       },
 
-      formatDateTime(date) {
-        var y = date.getFullYear();
-        var m = date.getMonth() + 1;
-        m = m < 10 ? ('0' + m) : m;
-        var d = date.getDate();
-        d = d < 10 ? ('0' + d) : d;
-        var h = date.getHours();
-        var minute = date.getMinutes();
-        minute = minute < 10 ? ('0' + minute) : minute;
-        return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
+      formatDateTime (date) {
+        var y = date.getFullYear()
+        var m = date.getMonth() + 1
+        m = m < 10 ? ('0' + m) : m
+        var d = date.getDate()
+        d = d < 10 ? ('0' + d) : d
+        var h = date.getHours()
+        var minute = date.getMinutes()
+        minute = minute < 10 ? ('0' + minute) : minute
+        return y + '-' + m + '-' + d + ' ' + h + ':' + minute
       }
     }
   }
-
 </script>
 
 <style lang="scss">