Browse Source

年审申请

huahaiyan 6 years ago
parent
commit
8f50f5b2ab

+ 6 - 0
src/dashoo.cn/backend/api/business/organize/organize.go

@@ -44,6 +44,12 @@ type Base_Organizetree struct {
 	Fu       string `json:"fu"`
 }
 
+type Base_Orgatree struct {
+	Id       int64  `json:"id"`
+	ParentId int64  `json:"pId"`
+	FullName string `json:"name"`
+}
+
 type Base_Organizebandparentname struct {
 	Id          int
 	Parentid    int

+ 19 - 2
src/dashoo.cn/backend/api/controllers/casbin/organize.go

@@ -1,15 +1,16 @@
 package casbin
 
 import (
+	"dashoo.cn/backend/api/business/oilsupplier/technologyservice"
 	"encoding/json"
 	//	"fmt"
 
 	"strings"
 
-	"dashoo.cn/business2/permission"
 	"dashoo.cn/backend/api/business/organize"
-	"dashoo.cn/utils"
 	. "dashoo.cn/backend/api/controllers"
+	"dashoo.cn/business2/permission"
+	"dashoo.cn/utils"
 )
 
 // Operations about Users
@@ -292,6 +293,22 @@ func (this *OrganizesController) ParentList() {
 	this.ServeJSON()
 }
 
+// @Title get 业务列表
+// @Description get SampleType by token
+// @Success 200 {object} sampletype.SampleType
+// @router /getorganizetreelist [get]
+func (this *OrganizesController) GetOrganizeTreeList() {
+	svc := technologyservice.GetOilTechnologyServiceService(utils.DBE)
+	where := " 1 = 1 "
+	var list []organize.Base_Orgatree
+	//获取技术服务类资质分类层级信息
+	svc.GetEntitysByWhere("Base_Organize", where, &list)
+	var datainfo DataInfo
+	datainfo.Items = list
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
 // @Title 获取医院组织结构
 // @Description 获取医院
 // @Success 200 {object} business.device.DeviceChannels

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

@@ -153,7 +153,7 @@ func (this *AnnualAuditController) GetMyTaskEntityList() {
 	certIdList := actisvc.GetMyTasks(workflow.OIL_AUDIT_APPLY, this.User.Id)
 	where += " and Id in (" + certIdList + ")"
 	//根据部门查询待办任务
-
+	where += " and Status != 2 "
 	total := svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, asc, &list, where)
 	//total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, page.CurrentPage, page.Size, orderby, asc, &list, where)
 

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/auditoperation.vue

@@ -579,7 +579,7 @@
       makeSure() {
         //审核通过的具体操作(未编写)
         console.log("----this.shenheForm---", this.shenheForm)
-        if (this.AnnualStatus === '0') {
+        if (this.shenheForm.SuccessStatus === 1) {
           this.selectAuditShow = true
         } else {
           this.$confirm("确认审核结果!", "提示", {

+ 135 - 3
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/operation.vue

@@ -8,9 +8,9 @@
     <el-card class="box-card">
       <div slot="header" class="clearfix">
               <span>年审基本信息表</span>
-              <!-- <span style="float: right;">
-                <el-button type="primary" size="mini" @click="saveEntity">保存</el-button>
-              </span> -->
+              <span style="float: right;">
+                <el-button type="primary" size="mini" @click="addshow =true" v-if="Status == '2'">提交审核</el-button>
+              </span>
             </div>
 
       <el-steps :active="formData.Step" simple align-center finish-status="success">
@@ -179,6 +179,40 @@
         </el-tab-pane>
       </el-tabs>
     </el-card>
+     <el-dialog title="提交申请" :visible.sync="addshow" width="360px">
+      <el-form label-width="90px" :model="entityForm" :rules="rules" ref="EntityFormref">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="初审单位" prop="FirstAudit" required>
+              <el-cascader :options="orgtreelist" :props="orgtreeprops" change-on-select :show-all-levels="false"
+                filterable @change="auditOrgChang" style="width: 100%" v-model="entityForm.FirstAudit"
+                placeholder="请选择组织"></el-cascader>
+              <!-- <el-select ref="selectauditOrg" v-model="entityForm.FirstAudit" placeholder="请选择" style="width: 100%"
+                @change="auditOrgChang" filterable allow-create default-first-option>
+                <el-option v-for="item in organizeOption" :key="item.id" :label="item.name" :value="item.id">
+                </el-option>
+              </el-select> -->
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="审批人" prop="auditer" required>
+              <el-select ref="selectAuditer" v-model="entityForm.auditer" placeholder="请选择" style="width: 100%"
+                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-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span style="float: right;margin-top:-10px;">
+        <el-button size="small" @click="addshow = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="addAnnualAudit()">确 定</el-button>
+      </span>
+      <br>
+    </el-dialog>
   </div>
 </template>
 
@@ -187,6 +221,7 @@
     mapGetters
   } from 'vuex'
   import api from '@/api/oilsupplier/supplier'
+  import annualapi from '@/api/oilsupplier/annualaudit';
   import apiCert from '@/api/oilsupplier/suppliercert'
   import SupplierFileTable from '@/pages/oilsupplier/supplierfile/table.vue'
   import WfHistory from '@/components/workflow/wfhistory.vue'
@@ -222,6 +257,15 @@
 
     data() {
       return {
+        orgtreelist: [],
+        orgtreeprops: {
+          value: 'id',
+          label: 'Fullname',
+          children: 'children'
+        },
+        organizeOption: [], // 审批部门
+        auditerOption: [],
+        addshow: false,
         canUpdateSupplier: true,
         dictData: null,
         applyLoading: false,
@@ -234,6 +278,14 @@
         certId: '',
         classId: '',
         WorkflowId: '',
+        entityForm: {
+          Id: '',
+          SupplierName: '',
+          SupplierId: '',
+          SupplierTypeName: '',
+          FirstAudit: '',
+          auditer: '',
+        },
         formData: {
           Id: '',
           SupplierName: '',
@@ -334,6 +386,19 @@
           business: '',
           instance: ''
         },
+        Status:'',
+        rules: {
+          FirstAudit: [{
+            required: true,
+            message: '请选择初审单位',
+            trigger: 'blur'
+          }],
+          auditer: [{
+            required: true,
+            message: '请选择审批人',
+            trigger: 'blur'
+          }]
+        }
       }
     },
     created() {
@@ -341,8 +406,10 @@
       if (this.$route.query.certid) {
         this.certId = this.$route.query.certid + ''
       }
+      this.Status = this.$route.query.Status +''
       this.WorkflowId = this.$route.query.WorkflowId + ''
       this.getDictOptions();
+      this.getorgtreelist()
       this.formData.Id = this.serviceId
       this.initDatas();
       console.log("---this.formData---",this.formData)
@@ -497,6 +564,42 @@
         }
       },
 
+      auditOrgChang(val) {
+        console.log("------val----", val)
+        this.auditerOption = []
+        this.entityForm.auditer = ''
+        api.getAuditerByDept(val[val.length - 1], this.$axios).then(res => {
+          if (res.data.item.length === 0) {
+            this.$message({
+              type: 'warning',
+              message: '该单位未设置审批人员!'
+            })
+            return
+          }
+          this.auditerOption = res.data.item
+          console.log("---this.auditerOption--", this.auditerOption)
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+
+      getorgtreelist() {
+        let _this = this
+        // request
+        let params = {
+          IsInnerOrganize: 1
+        }
+        _this.$axios.get('organizes/list', {
+            params
+          })
+          .then(res => {
+            _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
+          })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+      },
       
       getDictOptions() {
         api.getDictList(this.$axios).then(res => {
@@ -509,6 +612,35 @@
         })
       },
 
+      addAnnualAudit() {
+        this.$refs['EntityFormref'].validate((valid) => {
+          if (valid) {
+            console.log("----this.entityForm.auditer--", this.entityForm.auditer)
+            annualapi.addEntity(this.entityForm, this.entityForm.auditer, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                console.log("--------res.data----", res.data)
+                //保存成功后,初始化数据,变成修改
+                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)
+            });
+          }
+        })
+      },
+
       AuditEntity() {
         this.applyLoading = true
         apiCert.auditEntity(this.certId, this.$axios).then(res => {

+ 92 - 37
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/index.vue

@@ -40,7 +40,7 @@
         <el-table-column label="操作" min-width="180" align="center" fixed>
           <template slot-scope="scope">
             <router-link
-              :to="'/oilsupplier/annualaudit/' + scope.row.SupplierId + '/operation?certid=' + scope.row.CerId +'&WorkflowId='+scope.row.WorkflowId">
+              :to="'/oilsupplier/annualaudit/' + scope.row.SupplierId + '/operation?certid=' + scope.row.CerId +'&WorkflowId='+scope.row.WorkflowId+'&Status='+scope.row.Status">
               <el-button type="primary" plain title="查看详情" size="mini">打开</el-button>
             </router-link>
             <el-dropdown @command="MoreCmdClick">
@@ -146,11 +146,11 @@
       </span>
     </el-dialog>
     <el-dialog title="年审申请添加" :visible.sync="addshow" width="360px">
-      <el-form label-width="90px">
+      <el-form label-width="90px" :model="entityForm" :rules="rules" ref="EntityFormref">
         <el-row>
           <el-col :span="24">
-            <el-form-item label="企业名称">
-              <el-select filterable default-first-option ref="supselect" v-model="entityForm.SupplierId"
+            <el-form-item label="企业名称" prop="SupplierId" required>
+              <el-select filterable default-first-option ref="supselect" v-model="entityForm.SupplierId" required
                 placeholder="请选择" @change="supplierchange" style="width: 100%">
                 <el-option v-for="item in selectsupplierlist" :key="item.Id" :label="item.Realname" :value="item.Id">
                 </el-option>
@@ -160,7 +160,7 @@
         </el-row>
         <el-row>
           <el-col :span="24">
-            <el-form-item label="准入类别">
+            <el-form-item label="准入类别" prop="SupplierTypeName" required>
               <el-select filterable default-first-option v-model="entityForm.SupplierTypeName" placeholder="请选择"
                 style="width: 100%">
                 <el-option label="物资类" value="01"></el-option>
@@ -172,20 +172,23 @@
         </el-row>
         <el-row>
           <el-col :span="24">
-            <el-form-item label="初审单位">
-              <el-select ref="selectauditOrg" v-model="entityForm.FirstAudit" placeholder="请选择" style="width: 100%"
+            <el-form-item label="初审单位" prop="FirstAudit" required>
+              <el-cascader :options="orgtreelist" :props="orgtreeprops" change-on-select :show-all-levels="false"
+                filterable @change="auditOrgChang" style="width: 100%" v-model="entityForm.FirstAudit"
+                placeholder="请选择组织"></el-cascader>
+              <!-- <el-select ref="selectauditOrg" v-model="entityForm.FirstAudit" placeholder="请选择" style="width: 100%"
                 @change="auditOrgChang" filterable allow-create default-first-option>
-                <el-option v-for="item in organizeOption" :key="item.Id" :label="item.Fullname" :value="item.Id">
+                <el-option v-for="item in organizeOption" :key="item.id" :label="item.name" :value="item.id">
                 </el-option>
-              </el-select>
+              </el-select> -->
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="24">
-            <el-form-item label="审批人">
-              <el-select ref="selectAuditer" v-model="auditer" placeholder="请选择" style="width: 100%" filterable
-                allow-create default-first-option>
+            <el-form-item label="审批人" prop="auditer" required>
+              <el-select ref="selectAuditer" v-model="entityForm.auditer" placeholder="请选择" style="width: 100%"
+                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>
@@ -194,7 +197,7 @@
         </el-row>
       </el-form>
       <span style="float: right;margin-top:-10px;">
-        <el-button size="small" @click="addUserShow = false">取 消</el-button>
+        <el-button size="small" @click="addshow = false">取 消</el-button>
         <el-button type="primary" size="small" @click="addAnnualAudit()">确 定</el-button>
       </span>
       <br>
@@ -225,6 +228,12 @@
 
     data() {
       return {
+        orgtreelist: [],
+        orgtreeprops: {
+          value: 'id',
+          label: 'Fullname',
+          children: 'children'
+        },
         historyVisible: false,
         addshow: false,
         dialogVisible: false,
@@ -260,6 +269,7 @@
           SupplierId: '',
           SupplierTypeName: '',
           FirstAudit: '',
+          auditer: '',
         },
         searchForm: {
           Id: '',
@@ -292,8 +302,29 @@
           ModifiedOn: '',
           ModifiedUserId: '',
           ModifiedBy: '',
-
         },
+        rules: {
+          SupplierId: [{
+            required: true,
+            message: '请选择企业名称',
+            trigger: 'blur'
+          }, ],
+          SupplierTypeName: [{
+            required: true,
+            message: '请选择准入类别',
+            trigger: 'blur'
+          }],
+          FirstAudit: [{
+            required: true,
+            message: '请选择初审单位',
+            trigger: 'blur'
+          }],
+          auditer: [{
+            required: true,
+            message: '请选择审批人',
+            trigger: 'blur'
+          }]
+        }
       }
     },
     created() {
@@ -302,6 +333,7 @@
       //查询列表
       this.initDatas()
       this.getselectsupplier()
+      this.getorgtreelist()
       this.getDictOptions()
     },
     methods: {
@@ -341,28 +373,32 @@
         this.entityForm.SupplierName = obj.Realname
       },
       addAnnualAudit() {
-        console.log("----this.auditer--", this.auditer)
-        api.addEntity(this.entityForm, this.auditer, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            console.log("--------res.data----", res.data)
-            //保存成功后,初始化数据,变成修改
-            this.entityForm.Id = res.data.item;
-            this.initDatas();
-            this.addshow = false
-            this.$message({
-              type: 'success',
-              message: res.data.message
-            });
+        this.$refs['EntityFormref'].validate((valid) => {
+          if (valid) {
+            console.log("----this.entityForm.auditer--", this.entityForm.auditer)
+            api.addEntity(this.entityForm, this.entityForm.auditer, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                console.log("--------res.data----", res.data)
+                //保存成功后,初始化数据,变成修改
+                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
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                });
+              }
+            }).catch(err => {
+              console.error(err)
             });
           }
-        }).catch(err => {
-          console.error(err)
-        });
+        })
       },
       addaudit() {
         this.addshow = true
@@ -384,9 +420,10 @@
       },
 
       auditOrgChang(val) {
+        console.log("------val----", val)
         this.auditerOption = []
-        this.auditer = ''
-        supplierapi.getAuditerByDept(val, this.$axios).then(res => {
+        this.entityForm.auditer = ''
+        supplierapi.getAuditerByDept(val[val.length - 1], this.$axios).then(res => {
           if (res.data.item.length === 0) {
             this.$message({
               type: 'warning',
@@ -395,16 +432,34 @@
             return
           }
           this.auditerOption = res.data.item
-          console.log("---this.auditerOption--",this.auditerOption)
+          console.log("---this.auditerOption--", this.auditerOption)
         }).catch(err => {
           console.error(err)
         })
       },
 
+      getorgtreelist() {
+        let _this = this
+        // request
+        let params = {
+          IsInnerOrganize: 1
+        }
+        _this.$axios.get('organizes/list', {
+            params
+          })
+          .then(res => {
+            _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
+          })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+      },
+
       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)
         })