소스 검색

年审添加申请时不启动工作流

baichengfei 5 년 전
부모
커밋
948cab1668

+ 57 - 77
src/dashoo.cn/backend/api/controllers/oilsupplier/annualaudit.go

@@ -372,59 +372,39 @@ func (this *AnnualAuditController) GetSupplierForChange() {
 // @router /adddirect [post]
 func (this *AnnualAuditController) AddEntityDirect() {
 	var model annualaudit.OilAnnualAudit
-	var errinfo ErrorDataInfo
+	var errInfo ErrorDataInfo
 	var jsonBlob = this.Ctx.Input.RequestBody
 	svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
-	firstAudit := this.GetString("firstAudit")
 	json.Unmarshal(jsonBlob, &model)
-	supwhere := "a.Id = " + utils.ToStr(model.SupplierId) + " and b.SupplierTypeCode = '" + model.SupplierTypeName+ "' and b.Status = '8' "
-	supsvc := supplier.GetOilSupplierService(utils.DBE)
+	supWhere := "a.Id = " + utils.ToStr(model.SupplierId) + " and b.SupplierTypeCode = '" + model.SupplierTypeName+ "' and b.Status = '8' "
+	supSvc := supplier.GetOilSupplierService(utils.DBE)
 	var list []supplier.OilSupplierView
-	supsvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, 1, 1, "a.Id", true, &list, supwhere)
-	var suppliermodel supplier.OilSupplierView
-	suppliermodel = list[0]
-	model.AccessCardNo = suppliermodel.AccessCardNo
-	model.RecUnitId = suppliermodel.RecUnitId
-	model.CerId, _ = strconv.Atoi(suppliermodel.CertId)
-	model.ApplyTime = suppliermodel.ApplyTime
+	supSvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, 1, 1, "a.Id", true, &list, supWhere)
+	var supplierModel supplier.OilSupplierView
+	supplierModel = list[0]
+	model.AccessCardNo = supplierModel.AccessCardNo
+	model.RecUnitId = supplierModel.RecUnitId
+	model.CerId, _ = strconv.Atoi(supplierModel.CertId)
+	model.ApplyTime = supplierModel.ApplyTime
 	model.Status = "0"
 	model.Step = 1
-	model.BackReason = suppliermodel.BackReason
+	model.BackReason = supplierModel.BackReason
 	model.CreateOn = time.Now()
 	model.CreateBy = this.User.Realname
 	model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
 	//添加一条年审记录
 	_, err := svc.InsertEntityBytbl(""+OilAnnualAuditName, &model)
-	annualId := model.Id
-	svcActiviti := workflow.GetActivitiService(utils.DBE)
-	//启动工作流
-	businessKey := utils.ToStr(annualId) + "-" + strconv.Itoa(model.AuditIndex)
-	result := strconv.Itoa(this.User.IsCompanyUser)
-	processInstanceId := svcActiviti.StartProcess2(workflow.OIL_AUDIT_APPLY, businessKey, this.User.Id, result, model.SupplierTypeName, model.SupplierName)
-	var auditmodel annualaudit.OilAnnualAudit
-	auditmodel.WorkflowId = processInstanceId
-	auditmodel.FirstAudit, _ = strconv.Atoi(firstAudit)
-	auditmodel.AuditIndex = model.AuditIndex
-	auditmodel.BusinessKey = businessKey
-	cols := []string{
-		"Id",
-		"WorkflowId",
-		"FirstAudit",
-		"AuditIndex",
-		"BusinessKey",
-	}
-	_, err = svc.UpdateEntityByIdCols(annualId, auditmodel, cols)
 	if err == nil {
 		//新增
-		errinfo.Message = "添加成功!"
-		errinfo.Code = 0
-		errinfo.Item = model.Id
-		this.Data["json"] = &errinfo
+		errInfo.Message = "添加成功!"
+		errInfo.Code = 0
+		errInfo.Item = model.Id
+		this.Data["json"] = &errInfo
 		this.ServeJSON()
 	} else {
-		errinfo.Message = "添加失败!" + utils.AlertProcess(err.Error())
-		errinfo.Code = -1
-		this.Data["json"] = &errinfo
+		errInfo.Message = "添加失败!" + utils.AlertProcess(err.Error())
+		errInfo.Code = -1
+		this.Data["json"] = &errInfo
 		this.ServeJSON()
 	}
 }
@@ -582,59 +562,59 @@ func (this *AnnualAuditController) UpdateSuppEntity() {
 // @router /add [post]
 func (this *AnnualAuditController) AddEntity() {
 	var model annualaudit.OilAnnualAudit
-	var errinfo ErrorDataInfo
+	var errInfo ErrorDataInfo
 	var jsonBlob = this.Ctx.Input.RequestBody
 	svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
 	//firstAudit := this.GetString("firstAudit")
 	json.Unmarshal(jsonBlob, &model)
 	where := "SupplierId = " + utils.ToStr(model.SupplierId) + " and SupplierTypeName = " + model.SupplierTypeName + " and Status < 5"
-	var auditentity []annualaudit.OilAnnualAudit
-	svc.GetEntitysByWhere(""+OilAnnualAuditName, where, &auditentity)
-	if len(auditentity) >= 1 {
-		errinfo.Message = "今年已提交年审,请勿重复提交!"
-		errinfo.Code = -1
-		this.Data["json"] = &errinfo
+	var auditEntity []annualaudit.OilAnnualAudit
+	svc.GetEntitysByWhere(""+OilAnnualAuditName, where, &auditEntity)
+	if len(auditEntity) >= 1 {
+		errInfo.Message = "今年已提交年审,请勿重复提交!"
+		errInfo.Code = -1
+		this.Data["json"] = &errInfo
 		this.ServeJSON()
 		return
 	}
-	supwhere := "a.Id = " + utils.ToStr(model.SupplierId) + " and b.SupplierTypeCode = '" + model.SupplierTypeName+ "' and b.Status = '8' "
-	supsvc := supplier.GetOilSupplierService(utils.DBE)
+	supWhere := "a.Id = " + utils.ToStr(model.SupplierId) + " and b.SupplierTypeCode = '" + model.SupplierTypeName+ "' and b.Status = '8' "
+	supSvc := supplier.GetOilSupplierService(utils.DBE)
 	var list []supplier.OilSupplierView
-	total := supsvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, 1, 1, "a.Id", true, &list, supwhere)
+	total := supSvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, 1, 1, "a.Id", true, &list, supWhere)
 	if total == 0 {
-		//errinfo.Message = "请先提交准入申请再提交年审!"
-		errinfo.Message = "请先提交准入,准入申请通过后,才可申请年审!"
-		errinfo.Code = -1
-		this.Data["json"] = &errinfo
+		//errInfo.Message = "请先提交准入申请再提交年审!"
+		errInfo.Message = "请先提交准入,准入申请通过后,才可申请年审!"
+		errInfo.Code = -1
+		this.Data["json"] = &errInfo
 		this.ServeJSON()
 		return
 	}
-	var suppliermodel supplier.OilSupplierView
-	suppliermodel = list[0]
-	if suppliermodel.InFlag == "3" {
-		errinfo.Message = "超过两年未年审,您已无法提交!"
-		errinfo.Code = -1
-		this.Data["json"] = &errinfo
+	var supplierModel supplier.OilSupplierView
+	supplierModel = list[0]
+	if supplierModel.InFlag == "3" {
+		errInfo.Message = "超过两年未年审,您已无法提交!"
+		errInfo.Code = -1
+		this.Data["json"] = &errInfo
 		this.ServeJSON()
 		return
 	}
-	aplytime := suppliermodel.ApplyTime
-	subtime := this.getTimeSub(aplytime, time.Now())
-	lefttime := subtime - 3
-	if subtime > 3 {
-		errinfo.Message = "还不到年审时间!请" + utils.ToStr(lefttime) + "个月后再来申请"
-		errinfo.Code = -3
-		this.Data["json"] = &errinfo
+	applyTime := supplierModel.ApplyTime
+	subTime := this.getTimeSub(applyTime, time.Now())
+	leftTime := subTime - 3
+	if subTime > 3 {
+		errInfo.Message = "还不到年审时间!请" + utils.ToStr(leftTime) + "个月后再来申请"
+		errInfo.Code = -3
+		this.Data["json"] = &errInfo
 		this.ServeJSON()
 		return
 	}
-	model.AccessCardNo = suppliermodel.AccessCardNo
-	model.RecUnitId = suppliermodel.RecUnitId
-	model.CerId, _ = strconv.Atoi(suppliermodel.CertId)
-	model.ApplyTime = suppliermodel.ApplyTime
+	model.AccessCardNo = supplierModel.AccessCardNo
+	model.RecUnitId = supplierModel.RecUnitId
+	model.CerId, _ = strconv.Atoi(supplierModel.CertId)
+	model.ApplyTime = supplierModel.ApplyTime
 	model.Status = "0"
 	model.Step = 1
-	model.BackReason = suppliermodel.BackReason
+	model.BackReason = supplierModel.BackReason
 	model.CreateOn = time.Now()
 	model.CreateBy = this.User.Realname
 	model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
@@ -642,15 +622,15 @@ func (this *AnnualAuditController) AddEntity() {
 	_, err := svc.InsertEntityBytbl(""+OilAnnualAuditName, &model)
 	if err == nil {
 		//新增
-		errinfo.Message = "添加成功!"
-		errinfo.Code = 0
-		errinfo.Item = model.Id
-		this.Data["json"] = &errinfo
+		errInfo.Message = "添加成功!"
+		errInfo.Code = 0
+		errInfo.Item = model.Id
+		this.Data["json"] = &errInfo
 		this.ServeJSON()
 	} else {
-		errinfo.Message = "添加失败!" + utils.AlertProcess(err.Error())
-		errinfo.Code = -1
-		this.Data["json"] = &errinfo
+		errInfo.Message = "添加失败!" + utils.AlertProcess(err.Error())
+		errInfo.Code = -1
+		this.Data["json"] = &errInfo
 		this.ServeJSON()
 	}
 	//annualId := model.Id

+ 98 - 108
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/basicindex.vue

@@ -209,7 +209,7 @@
 <script>
   import {
     mapGetters
-  } from 'vuex';
+  } from 'vuex'
   import WfHistory from '@/components/workflow/wfmultihistory.vue'
   import supplierapi from '@/api/oilsupplier/supplier'
   import api from '@/api/oilsupplier/annualaudit'
@@ -229,7 +229,7 @@
     },
     name: 'annualaudit',
 
-    data() {
+    data () {
       return {
         annualauditmakesure: false,
         chooseAuditorVisible: false,
@@ -247,27 +247,27 @@
         auditerOption: [],
         auditer: '',
         auditerName: '',
-        //列表数据
+        // 列表数据
         selectsupplierlist: [],
         entityList: [],
-        //分页参数
+        // 分页参数
         size: 10,
         currentPage: 1,
         currentItemCount: 0,
-        //列表排序
+        // 列表排序
         Column: {
           Order: '',
           Prop: ''
         },
-        //工作流
+        // 工作流
         entrydetail: {
           process: 'oil_audit_apply',
           business: '',
-          instance: '',
+          instance: ''
         },
-        //查询时间
+        // 查询时间
         CreateOn: '',
-        //查询项
+        // 查询项
         searchFormReset: {},
         entityForm: {
           Id: '',
@@ -309,14 +309,14 @@
           CreateBy: '',
           ModifiedOn: '',
           ModifiedUserId: '',
-          ModifiedBy: '',
+          ModifiedBy: ''
         },
         rules: {
           SupplierId: [{
             required: true,
             message: '请选择企业名称',
             trigger: 'blur'
-          }, ],
+          }],
           SupplierTypeName: [{
             required: true,
             message: '请选择准入类别',
@@ -336,14 +336,14 @@
         IsCompanyUser: 0,
         supplierList: [],
         suplen: 1,
-        certId: '',
+        certId: ''
       }
     },
-    created() {
+    created () {
       this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
-      //查询条件初始值备份
+      // 查询条件初始值备份
       Object.assign(this.searchFormReset, this.searchForm)
-      //查询列表
+      // 查询列表
       this.initDatas()
       this.getselectsupplier()
       this.getorgtreelist()
@@ -351,13 +351,13 @@
       this.getSupplierList()
     },
     methods: {
-      initDatas() {
-        //分页及列表条件
+      initDatas () {
+        // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
           _size: this.size,
           Order: this.Column.Order,
-          Prop: this.Column.Prop,
+          Prop: this.Column.Prop
         }
         let myCreateOn = []
         // 解析时间
@@ -368,9 +368,9 @@
           myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
           myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
         }
-        //查询条件
+        // 查询条件
         Object.assign(params, this.searchForm)
-        //访问接口
+        // 访问接口
         api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
@@ -382,11 +382,9 @@
         let _this = this
         _this.supplierList = []
         let params = {
-          SuppTypeCode: '02',
+          SuppTypeCode: '02'
         }
-        _this.$axios.get('/annualaudit/getsupplier', {
-            params
-          })
+        _this.$axios.get('/annualaudit/getsupplier', {params})
           .then(res => {
             _this.supplierList = res.data
             if (_this.supplierList) {
@@ -409,9 +407,7 @@
         let params = {
           IsInnerOrganize: 1
         }
-        _this.$axios.get('organizes/orgalllist', {
-            params
-          })
+        _this.$axios.get('organizes/orgalllist', {params})
           .then(res => {
             _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
             if (_this.authUser.Profile.IsCompanyUser === 0) {
@@ -425,126 +421,125 @@
             console.error(err)
           })
       },
-      setAuditer(val, name) {
+      setAuditer (val, name) {
         this.auditer = val
         this.auditerName = name
         this.chooseAuditorVisible = false
       },
-      chooseAuditorShow() {
+      chooseAuditorShow () {
         this.$refs['chooseAuditor'].getorgtreelist(this.entityForm.SupplierTypeName)
         this.chooseAuditorVisible = true
       },
-      supplierchange(value) {
-        let obj = {};
+      supplierchange (value) {
+        let obj = {}
         obj = this.selectsupplierlist.find((item) => {
-          return item.Id === value;
-        });
+          return item.Id === value
+        })
         this.entityForm.SupplierName = obj.Realname
       },
-      addAnnualAudit() {
+      addAnnualAudit () {
         this.$refs['EntityFormref'].validate((valid) => {
           if (valid) {
             this.entityForm.auditer = this.auditer
             api.addEntity(this.entityForm, this.entityForm.auditer, this.$axios).then(res => {
               if (res.data.code === 0) {
-                //保存成功后,初始化数据,变成修改
-                this.entityForm.Id = res.data.item;
-                this.initDatas();
+                // 保存成功后,初始化数据,变成修改
+                this.entityForm.Id = res.data.item
+                this.initDatas()
                 this.addshow = false
                 this.$message({
                   type: 'success',
                   message: res.data.message
-                });
-
+                })
               } else if (res.data.code === -3) {
-                this.$confirm(res.data.message + ",点击继续可继续进行年审")
+                this.$confirm(res.data.message + ',点击继续可继续进行年审')
                   .then(_ => {
                     this.addannualdirect()
                   })
-                  .catch(_ => {});
+                  .catch(_ => {})
               } else {
                 this.$message({
                   type: 'warning',
                   message: res.data.message
-                });
+                })
               }
             }).catch(err => {
               console.error(err)
-            });
+            })
           }
         })
       },
-      addaudit() {
+      addaudit () {
         this.addshow = true
       },
-      addannualdirect() {
+      addannualdirect () {
         api.addEntityDirect(this.entityForm, this.entityForm.auditer, this.$axios).then(res => {
           if (res.data.code === 0) {
-            //保存成功后,初始化数据,变成修改
-            this.entityForm.Id = res.data.item;
-            this.initDatas();
+            // 保存成功后,初始化数据,变成修改
+            this.entityForm.Id = res.data.item
+            this.initDatas()
             this.addshow = false
             this.$message({
               type: 'success',
               message: res.data.message
-            });
+            })
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
+            })
           }
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
-      addauditcom() {
-        this.$confirm("确定添加年审, 是否继续?", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          })
+      addauditcom () {
+        this.$confirm('确定添加年审, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
           .then(() => {
             api.addEntity(this.entityForm, this.entityForm.auditer, this.$axios).then(res => {
               if (res.data.code === 0) {
-                //保存成功后,初始化数据,变成修改
-                this.entityForm.Id = res.data.item;
-                this.initDatas();
+                // 保存成功后,初始化数据,变成修改
+                this.entityForm.Id = res.data.item
+                this.initDatas()
                 this.addshow = false
                 this.$router.push({
                   path: '/oilsupplier/annualaudit/' + this.entityForm.SupplierId + '/goodsoperation',
                   query: {
                     certid: this.certId,
-                    //WorkflowId: ,
+                    // WorkflowId: ,
                     Status: 0,
                     Step: 1,
-                    annualId: this.entityForm.Id,
+                    annualId: this.entityForm.Id
                   }
                 })
                 this.$message({
                   type: 'success',
                   message: res.data.message
-                });
+                })
               } else if (res.data.code === -3) {
-                this.$confirm(res.data.message + ",点击继续可继续进行年审")
+                this.$confirm(res.data.message + ',点击继续可继续进行年审')
                   .then(_ => {
                     this.addannualdirect()
                   })
-                  .catch(_ => {});
+                  .catch(_ => {})
               } else {
                 this.$message({
                   type: 'warning',
                   message: res.data.message
-                });
+                })
               }
             }).catch(err => {
               console.error(err)
-            });
+            })
           })
-          .catch(() => {});
+          .catch(() => {})
       },
 
-      getselectsupplier() {
+      getselectsupplier () {
         api.getSupList('02', this.$axios).then(res => {
           if (res.data.items.length != 0) {
             for (var i = 0; i < res.data.items.length; i++) {
@@ -564,9 +559,7 @@
         let params = {
           IsInnerOrganize: 1
         }
-        _this.$axios.get('organizes/orgalllist', {
-            params
-          })
+        _this.$axios.get('organizes/orgalllist', {params})
           .then(res => {
             _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
           })
@@ -575,15 +568,15 @@
           })
       },
 
-      getDictOptions() {
+      getDictOptions () {
         supplierapi.getDictList(this.$axios).then(res => {
           this.dictData = res.data.items
-          //this.organizeOption = res.data.items['Organizes']
+          // this.organizeOption = res.data.items['Organizes']
         }).catch(err => {
           console.error(err)
         })
       },
-      checkSupplierTypeName(val) {
+      checkSupplierTypeName (val) {
         if (val == '01') {
           return '物资类'
         } else if (val == '02') {
@@ -593,15 +586,15 @@
         }
       },
 
-      searchCommand(command) {
+      searchCommand (command) {
         if (command == 'search') {
           this.dialogVisible = true
         } else if (command == 'clear') {
           this.clearSearch()
         }
       },
-      //列表排序功能
-      orderby(column) {
+      // 列表排序功能
+      orderby (column) {
         if (column.order == 'ascending') {
           this.Column.Order = 'asc'
         } else if (column.order == 'descending') {
@@ -610,69 +603,67 @@
         this.Column.Prop = column.prop
         this.initDatas()
       },
-      clearSearch() {
+      clearSearch () {
         Object.assign(this.searchForm, this.searchFormReset);
-        //this.searchForm = this.searchFormReset;
+        // this.searchForm = this.searchFormReset;
         this.CreateOn = ''
         this.initDatas()
       },
-      handleSearch() {
-        this.currentPage = 1;
-        this.dialogVisible = false;
-        this.initDatas();
+      handleSearch () {
+        this.currentPage = 1
+        this.dialogVisible = false
+        this.initDatas()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.initDatas()
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         this.initDatas()
       },
-      deleteEntity(row) {
+      deleteEntity (row) {
         api.deleteEntity(row.Id, this.$axios).then(res => {
           if (res.data.code === 0) {
-            this.initDatas();
+            this.initDatas()
             this.$message({
               type: 'success',
               message: res.data.message
-            });
-
+            })
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
+            })
           }
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
 
-      getvalues(val) {
+      getvalues (val) {
         this.entrydetail.business = val.Id
         this.entrydetail.instance = val.WorkflowId
         this.historyVisible = true
       },
 
-      MoreCmdClick(cmd) {
+      MoreCmdClick (cmd) {
         if (cmd.Command == 'History') {
           this.getvalues(cmd.row)
-
         } else if (cmd.Command == 'Delete') {
           this.deleteEntity(cmd.row)
         }
       },
 
-      GetCommand(cmdType, row) {
+      GetCommand (cmdType, row) {
         let cmd = {}
         cmd.Command = cmdType
         cmd.row = row
         return cmd
       },
 
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T00:00:00Z') {
@@ -687,20 +678,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">

+ 106 - 111
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/techindex.vue

@@ -208,8 +208,8 @@
 <script>
   import {
     mapGetters
-  } from 'vuex';
-  import WfHistory from '@/components/workflow/wfmultihistory.vue'
+  } from 'vuex'
+import WfHistory from '@/components/workflow/wfmultihistory.vue'
   import supplierapi from '@/api/oilsupplier/supplier'
   import api from '@/api/oilsupplier/annualaudit'
   import ChooseAuditor from '@/components/oilsupplier/chooseauditor'
@@ -228,7 +228,7 @@
     },
     name: 'annualaudit',
 
-    data() {
+    data () {
       return {
         chooseAuditorVisible: false,
         orgtreelist: [],
@@ -245,27 +245,27 @@
         auditerOption: [],
         auditer: '',
         auditerName: '',
-        //列表数据
+        // 列表数据
         selectsupplierlist: [],
         entityList: [],
-        //分页参数
+        // 分页参数
         size: 10,
         currentPage: 1,
         currentItemCount: 0,
-        //列表排序
+        // 列表排序
         Column: {
           Order: '',
           Prop: ''
         },
-        //工作流
+        // 工作流
         entrydetail: {
           process: 'oil_audit_apply',
           business: '',
-          instance: '',
+          instance: ''
         },
-        //查询时间
+        // 查询时间
         CreateOn: '',
-        //查询项
+        // 查询项
         searchFormReset: {},
         entityForm: {
           Id: '',
@@ -307,14 +307,14 @@
           CreateBy: '',
           ModifiedOn: '',
           ModifiedUserId: '',
-          ModifiedBy: '',
+          ModifiedBy: ''
         },
         rules: {
           SupplierId: [{
             required: true,
             message: '请选择企业名称',
             trigger: 'blur'
-          }, ],
+          } ],
           SupplierTypeName: [{
             required: true,
             message: '请选择准入类别',
@@ -334,14 +334,14 @@
         IsCompanyUser: 0,
         supplierList: [],
         suplen: 1,
-        certId: '',
+        certId: ''
       }
     },
-    created() {
+    created () {
       this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
-      //查询条件初始值备份
+      // 查询条件初始值备份
       Object.assign(this.searchFormReset, this.searchForm)
-      //查询列表
+      // 查询列表
       this.initDatas()
       this.getselectsupplier()
       this.getorgtreelist()
@@ -349,13 +349,13 @@
       this.getSupplierList()
     },
     methods: {
-      initDatas() {
-        //分页及列表条件
+      initDatas () {
+        // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
           _size: this.size,
           Order: this.Column.Order,
-          Prop: this.Column.Prop,
+          Prop: this.Column.Prop
         }
         let myCreateOn = []
         // 解析时间
@@ -366,9 +366,9 @@
           myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
           myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
         }
-        //查询条件
+        // 查询条件
         Object.assign(params, this.searchForm)
-        //访问接口
+        // 访问接口
         api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
@@ -376,15 +376,15 @@
           console.error(err)
         })
       },
-      getSupplierList() {
+      getSupplierList () {
         let _this = this
         _this.supplierList = []
         let params = {
-          SuppTypeCode: '03',
+          SuppTypeCode: '03'
         }
         _this.$axios.get('/annualaudit/getsupplier', {
-            params
-          })
+          params
+        })
           .then(res => {
             _this.supplierList = res.data
             if (_this.supplierList) {
@@ -402,14 +402,14 @@
             console.error(err)
           })
       },
-      getorgtreelist() {
+      getorgtreelist () {
         let _this = this
         let params = {
           IsInnerOrganize: 1
         }
         _this.$axios.get('organizes/orgalllist', {
-            params
-          })
+          params
+        })
           .then(res => {
             _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
             if (_this.authUser.Profile.IsCompanyUser === 0) {
@@ -423,127 +423,125 @@
             console.error(err)
           })
       },
-      setAuditer(val, name) {
+      setAuditer (val, name) {
         this.auditer = val
         this.auditerName = name
         this.chooseAuditorVisible = false
       },
-      chooseAuditorShow() {
+      chooseAuditorShow () {
         this.$refs['chooseAuditor'].getorgtreelist(this.entityForm.SupplierTypeName)
         this.chooseAuditorVisible = true
       },
-      supplierchange(value) {
-        let obj = {};
+      supplierchange (value) {
+        let obj = {}
         obj = this.selectsupplierlist.find((item) => {
-          return item.Id === value;
-        });
+          return item.Id === value
+        })
         this.entityForm.SupplierName = obj.Realname
       },
-      addAnnualAudit() {
+      addAnnualAudit () {
         this.$refs['EntityFormref'].validate((valid) => {
           if (valid) {
             this.entityForm.auditer = this.auditer
             api.addEntity(this.entityForm, this.entityForm.auditer, this.$axios).then(res => {
               if (res.data.code === 0) {
-                //保存成功后,初始化数据,变成修改
-                this.entityForm.Id = res.data.item;
-                this.initDatas();
+                // 保存成功后,初始化数据,变成修改
+                this.entityForm.Id = res.data.item
+                this.initDatas()
                 this.addshow = false
                 this.$message({
                   type: 'success',
                   message: res.data.message
-                });
-
+                })
               } else if (res.data.code === -3) {
-                this.$confirm(res.data.message + ",点击继续可继续进行年审")
+                this.$confirm(res.data.message + ',点击继续可继续进行年审')
                   .then(_ => {
                     this.addannualdirect()
                   })
-                  .catch(_ => {});
+                  .catch(_ => {})
               } else {
                 this.$message({
                   type: 'warning',
                   message: res.data.message
-                });
+                })
               }
             }).catch(err => {
               console.error(err)
-            });
+            })
           }
         })
       },
-      addannualdirect() {
+      addannualdirect () {
         api.addEntityDirect(this.entityForm, this.entityForm.auditer, this.$axios).then(res => {
           if (res.data.code === 0) {
-            //保存成功后,初始化数据,变成修改
-            this.entityForm.Id = res.data.item;
-            this.initDatas();
+            // 保存成功后,初始化数据,变成修改
+            this.entityForm.Id = res.data.item
+            this.initDatas()
             this.addshow = false
             this.$message({
               type: 'success',
               message: res.data.message
-            });
+            })
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
+            })
           }
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
-      addaudit() {
+      addaudit () {
         this.addshow = true
       },
-      addauditcom() {
-        this.$confirm("确定添加年审, 是否继续?", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          })
+      addauditcom () {
+        this.$confirm('确定添加年审, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
           .then(() => {
             api.addEntity(this.entityForm, this.entityForm.auditer, this.$axios).then(res => {
               if (res.data.code === 0) {
-                //保存成功后,初始化数据,变成修改
-                this.entityForm.Id = res.data.item;
-                this.initDatas();
+                // 保存成功后,初始化数据,变成修改
+                this.entityForm.Id = res.data.item
+                this.initDatas()
                 this.addshow = false
                 this.$router.push({
                   path: '/oilsupplier/annualaudit/' + this.entityForm.SupplierId + '/goodsoperation',
                   query: {
                     certid: this.certId,
-                    //WorkflowId: ,
+                    // WorkflowId: ,
                     Status: 0,
                     Step: 1,
-                    annualId: this.entityForm.Id,
+                    annualId: this.entityForm.Id
                   }
                 })
                 this.$message({
                   type: 'success',
                   message: res.data.message
-                });
-
+                })
               } else if (res.data.code === -3) {
-                this.$confirm(res.data.message + ",点击继续可继续进行年审")
+                this.$confirm(res.data.message + ',点击继续可继续进行年审')
                   .then(_ => {
                     this.addannualdirect()
                   })
-                  .catch(_ => {});
+                  .catch(_ => {})
               } else {
                 this.$message({
                   type: 'warning',
                   message: res.data.message
-                });
+                })
               }
             }).catch(err => {
               console.error(err)
-            });
+            })
           })
-          .catch(() => {});
+          .catch(() => {})
       },
 
-      getselectsupplier() {
+      getselectsupplier () {
         api.getSupList('03', this.$axios).then(res => {
           if (res.data.items.length != 0) {
             for (var i = 0; i < res.data.items.length; i++) {
@@ -558,14 +556,14 @@
         })
       },
 
-      getorgtreelist() {
+      getorgtreelist () {
         let _this = this
         let params = {
           IsInnerOrganize: 1
         }
         _this.$axios.get('organizes/orgalllist', {
-            params
-          })
+          params
+        })
           .then(res => {
             _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
           })
@@ -574,15 +572,15 @@
           })
       },
 
-      getDictOptions() {
+      getDictOptions () {
         supplierapi.getDictList(this.$axios).then(res => {
           this.dictData = res.data.items
-          //this.organizeOption = res.data.items['Organizes']
+          // this.organizeOption = res.data.items['Organizes']
         }).catch(err => {
           console.error(err)
         })
       },
-      checkSupplierTypeName(val) {
+      checkSupplierTypeName (val) {
         if (val == '01') {
           return '物资类'
         } else if (val == '02') {
@@ -592,15 +590,15 @@
         }
       },
 
-      searchCommand(command) {
+      searchCommand (command) {
         if (command == 'search') {
           this.dialogVisible = true
         } else if (command == 'clear') {
           this.clearSearch()
         }
       },
-      //列表排序功能
-      orderby(column) {
+      // 列表排序功能
+      orderby (column) {
         if (column.order == 'ascending') {
           this.Column.Order = 'asc'
         } else if (column.order == 'descending') {
@@ -609,69 +607,67 @@
         this.Column.Prop = column.prop
         this.initDatas()
       },
-      clearSearch() {
-        Object.assign(this.searchForm, this.searchFormReset);
-        //this.searchForm = this.searchFormReset;
+      clearSearch () {
+        Object.assign(this.searchForm, this.searchFormReset)
+        // this.searchForm = this.searchFormReset;
         this.CreateOn = ''
         this.initDatas()
       },
-      handleSearch() {
-        this.currentPage = 1;
-        this.dialogVisible = false;
-        this.initDatas();
+      handleSearch () {
+        this.currentPage = 1
+        this.dialogVisible = false
+        this.initDatas()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.initDatas()
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         this.initDatas()
       },
-      deleteEntity(row) {
+      deleteEntity (row) {
         api.deleteEntity(row.Id, this.$axios).then(res => {
           if (res.data.code === 0) {
-            this.initDatas();
+            this.initDatas()
             this.$message({
               type: 'success',
               message: res.data.message
-            });
-
+            })
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
+            })
           }
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
 
-      getvalues(val) {
+      getvalues (val) {
         this.entrydetail.business = val.Id
         this.entrydetail.instance = val.WorkflowId
         this.historyVisible = true
       },
 
-      MoreCmdClick(cmd) {
+      MoreCmdClick (cmd) {
         if (cmd.Command == 'History') {
           this.getvalues(cmd.row)
-
         } else if (cmd.Command == 'Delete') {
           this.deleteEntity(cmd.row)
         }
       },
 
-      GetCommand(cmdType, row) {
+      GetCommand (cmdType, row) {
         let cmd = {}
         cmd.Command = cmdType
         cmd.row = row
         return cmd
       },
 
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T00:00:00Z') {
@@ -686,20 +682,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">