humingbo 2 лет назад
Родитель
Сommit
ef2212ce1a
4 измененных файлов с 383 добавлено и 72 удалено
  1. 18 0
      src/api/file/file.js
  2. 27 0
      src/api/meeting/enforce.js
  3. 78 28
      src/views/enforceflow/enforceflow.vue
  4. 260 44
      src/views/workbench/workbench.vue

+ 18 - 0
src/api/file/file.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+/**
+ * 上传文件
+ * @param data
+ * @returns {*}
+ */
+export function uploadFile(data){
+  return request({
+    url:'/file/uploadFile',
+    method:'post',
+    data:data
+  })
+}
+let domain = 'http://localhost:10050';
+export function uploadFileUrl(){
+  return  domain+'/api/oa/file/uploadFile';
+}

+ 27 - 0
src/api/meeting/enforce.js

@@ -72,4 +72,31 @@ export  function startEnforceFlow(data){
   })
 }
 
+/**
+ * 获取个人任务办理列表
+ * @returns {*}
+ */
+export  function getPersonalTaskList(){
+  return request({
+    url: '/enforce/getPersonalTaskList',
+    method : 'post'
+  })
+}
+
+/**
+ * 点击完成个人任务
+ * @param data
+ * @returns {*}
+ */
+export function completeTask(data){
+  return request({
+    url:'/enforce/completeTask',
+    method:'post',
+    data:data
+  })
+}
+
+
+
+
 

+ 78 - 28
src/views/enforceflow/enforceflow.vue

@@ -108,7 +108,7 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button size="small" @click="closeDialog">取消</el-button>
-        <el-button size="small" type="primary" :loading="loading" class="title" @click="submitForm('editForm')">保存</el-button>
+        <el-button size="small" type="primary"  class="title" @click="submitForm('editForm')">保存</el-button>
       </div>
     </el-dialog>
 
@@ -161,47 +161,45 @@
             <template slot="label">
               项目启动人
             </template>
-            <el-input size="small" v-model="enforceForm.director"></el-input>
-          </el-descriptions-item>
-          <el-descriptions-item :span="2">
-            <template slot="label">
-              备注说明
-            </template>
-            <el-input size="small" v-model="enforceForm.remark" type="textarea" :rows="4" ></el-input>
-          </el-descriptions-item>
-          <el-descriptions-item :span="2">
-            <template slot="label">
-              文件列表
-            </template>
-            <el-upload
-              class="upload-demo"
-              ref="upload"
-              action="https://jsonplaceholder.typicode.com/posts/"
-              :on-remove="handleRemove"
-              :file-list="fileList"
-              :auto-upload="false">
-              <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
-            </el-upload>
+            <el-input size="small" v-model="enforceForm.director" :disabled="true" @keyup.enter.native="openUsers()">
+              <el-button @click="openUsers" icon="el-icon-search" slot="append"></el-button>
+            </el-input>
           </el-descriptions-item>
         </el-descriptions>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button size="small" @click="closeEnforceDialog">取消</el-button>
-        <el-button size="small" type="primary" :loading="loading" class="title" @click="submitEnforceForm('editForm')">保存</el-button>
+        <el-button size="small" type="primary" class="title" @click="submitEnforceForm('editForm')">启动流程</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog title="选择人员" :visible.sync="usersVisble" width="30%" @click="closeUserDialog">
+      <el-tree
+        ref="dept"
+        :data="userList"
+        node-key="id"
+        :props="{label:'name'}" default-expand-all="true">
+      </el-tree>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="small" @click="closeUserDialog">取消</el-button>
+        <el-button size="small" type="primary" class="title" @click="submitUserForm('editForm')">确定</el-button>
       </div>
     </el-dialog>
 
+
   </div>
 </template>
 
 <script>
 import Pagination from '@/components/Page/Pagination'
 import {getEnforcesByPage,getHosInfos,getHsystems,addEnforce,deleteEnforce,startEnforceFlow} from '@/api/meeting/enforce'
+import { getDeptUserTree } from '@/api/system/user'
 
 export default {
   name: 'enforceflow',
   data() {
     return {
+      usersVisble:false,
       tableData: [],
       pageparm: {
         current: 1,
@@ -246,7 +244,12 @@ export default {
         hsytem:null,
         content:''
       },
-      fileList: []
+      fileList: [],
+      userList:[],
+      userForm:{
+        show:false
+      }
+
 
     }
   },
@@ -258,6 +261,7 @@ export default {
     this.getHosInfos()
     this.getHsystems()
     this.getData(this.formInline)
+    this.getDeptUserTrees()
   },
   methods: {
     // 分页插件事件
@@ -347,12 +351,58 @@ export default {
     closeEnforceDialog(){
       this.editEnforceFormVisible=false
     },
-    handleRemove(file, fileList) {
-     alert('Remove')
-    },
     submitEnforceForm(){
-      alert('添加保存实施流程哦')
+      let user=this.enforceForm.director;
+      if(user==null){
+        this.$message({
+          message: '请选择人员!',
+          type: 'warning'
+        });
+        return;
+      }
+      let data=this.enforceForm;
+      startEnforceFlow(data).then(res =>{
+        this.$message({
+          message: '操作成功!',
+          type: 'info'
+        });
+      })
+      this.closeEnforceDialog();
+
+    },
+    closeUserDialog(){
+      this.usersVisble=false
+    },
+    getDeptUserTrees(){
+      getDeptUserTree().then(res => {
+        this.userList = res.data
+      });
+    },
+    openUsers(){
+      this.usersVisble=true
+    },
+    submitUserForm(){
+      //获取选中的节点
+      let node=this.$refs.dept.getCurrentNode();
+      if(node==undefined || node==null){
+        this.$message({
+          message: '请选择数据!',
+          type: 'warning'
+        });
+        return;
+      }
+      if(node.type!=='u'){
+        this.$message({
+          message: '请选择人员!',
+          type: 'warning'
+        });
+        return;
+      }
+      this.enforceForm.director=node.name
+      this.enforceForm.directorId=node.id
+      this.closeUserDialog();
     }
+
   }
 }
 </script>

+ 260 - 44
src/views/workbench/workbench.vue

@@ -4,7 +4,7 @@
       <el-col :span="6">
         <el-card class="card" >
           <div style="color: white;">
-            <h2>待办事项</h2>
+            <h2>我的待办事项:{{todoTaskList}}</h2>
           </div>
         </el-card>
       </el-col>
@@ -32,61 +32,188 @@
     </el-row>
 
     <el-row :gutter="20" style="margin-top: 50px">
-      <el-col :span="12">
-        <h3>我的审批列表</h3>
+      <el-col :span="24">
+        <h3>我的待办列表</h3>
         <el-table
           :data="tableData"
           style="width: 100%" border stripe  size="small">
-          <el-table-column  type="index" label="序号" width="60">
+          <el-table-column  type="index" label="序号" width="80"  align="center">
           </el-table-column>
           <el-table-column
-            prop="date"
-            label="日期"
+            prop="name"
+            label="任务名称"  align="center"
             width="180">
           </el-table-column>
           <el-table-column
-            prop="name"
-            label="姓名"
+            prop="hname"
+            label="实施医院"  align="center"
             width="180">
           </el-table-column>
           <el-table-column
-            prop="address"
-            label="地址">
+            prop="hsytem"
+            label="实施系统"  align="center"
+            width="160">
           </el-table-column>
-        </el-table>
-        <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>
-      </el-col>
-      <el-col :span="12">
-        <h3>我的项目列表</h3>
-        <el-table
-          :data="tableData"
-          style="width: 100%" border stripe size="small">
-          <el-table-column  type="index" label="序号" width="60">
+          <el-table-column
+            prop="content"
+            label="实施内容"  align="center"
+            min-width="250">
           </el-table-column>
           <el-table-column
-            prop="date"
-            label="日期"
+            prop="taskName"
+            label="当前处理步骤"  align="center"
             width="180">
           </el-table-column>
           <el-table-column
-            prop="name"
-            label="姓名"
+            prop="flowType"
+            label="流程类型"  align="center"
             width="180">
           </el-table-column>
-          <el-table-column
-            prop="address"
-            label="地址">
+          <el-table-column  align="center"
+            prop="createTime"
+            label="创建时间" width="200">
+          </el-table-column>
+          <el-table-column prop="op" width="200" label="操作"  align="center">
+            <template scope="scope">
+              <el-button size="mini"  type="success" @click="searchWorkFlow(scope.row)">查阅流程</el-button>
+              <el-button size="mini" type="primary" @click="auditFlow(scope.row)">处理</el-button>
+            </template>
           </el-table-column>
         </el-table>
-        <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>
       </el-col>
     </el-row>
 
+    <el-dialog  :visible.sync="workFlowVisble" width="75%" title="实施流程明细">
+      <el-steps :active="activeFlow" finish-status="success" align-center  >
+        <el-step title="开始" />
+        <el-step title="项目启动会" />
+        <el-step title="发货" />
+        <el-step title="物流签收" />
+        <el-step title="进入现场" />
+        <el-step title="设备安装" />
+        <el-step title="系统调试" />
+        <el-step title="操作培训" />
+        <el-step title="现场值守" />
+        <el-step title="离场" />
+        <el-step title="实施复盘" />
+        <el-step title="文件归档" />
+        <el-step title="结束" />
+      </el-steps>
+    </el-dialog>
+
+    <!--处理实施工作任务--->
+    <el-dialog title="审批处理" :visible.sync="editEnforceFormVisible" width="45%" @click="closeEnforceDialog">
+      <el-form label-width="120px" :model="enforceForm" >
+        <el-descriptions  title="" :column="2"  border>
+          <el-descriptions-item>
+            <template slot="label">
+              项目名称
+            </template>
+            {{enforceFlow.name}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label">
+              项目总负责人
+            </template>
+            {{enforceFlow.enforcer}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label">
+              实施医院
+            </template>
+            {{enforceFlow.hno}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label">
+              实施系统
+            </template>
+            {{enforceFlow.hsytem}}
+          </el-descriptions-item>
+          <el-descriptions-item >
+            <template slot="label">
+              实施时间
+            </template>
+            {{enforceFlow.time}}
+          </el-descriptions-item>
+          <el-descriptions-item >
+            <template slot="label">
+              实施状态
+            </template>
+            <span style="color: darkred" v-if="enforceFlow.status===0">待开始</span>
+            <span style="color: green" v-else-if="enforceFlow.status===1">进行中</span>
+            <span style="color: darkblue" v-else="enforceFlow.status===2">已结束</span>
+          </el-descriptions-item>
+          <el-descriptions-item :span="2">
+            <template slot="label">
+              当前任务
+            </template>
+            {{enforceFlow.flowType}}
+          </el-descriptions-item>
+          <el-descriptions-item :span="2">
+            <template slot="label">
+              实施内容
+            </template>
+            {{enforceFlow.content}}
+          </el-descriptions-item>
+          <el-descriptions-item :span="2">
+            <template slot="label">
+             下个步骤负责人
+            </template>
+            <el-input size="small" v-model="enforceForm.director" :disabled="true" @keyup.enter.native="openUsers()">
+              <el-button @click="openUsers" icon="el-icon-search" slot="append"></el-button>
+            </el-input>
+          </el-descriptions-item>
+          <el-descriptions-item :span="2">
+            <template slot="label">
+              备注说明
+            </template>
+            <el-input size="small" v-model="enforceForm.remark" type="textarea" :rows="4" ></el-input>
+          </el-descriptions-item>
+
+          <el-descriptions-item :span="2">
+            <template slot="label">
+              文件列表
+            </template>
+            <el-upload
+              class="upload-demo"
+              ref="upload"
+              :action="fileAction"
+              :on-remove="handleRemove"
+              :file-list="fileList"
+              name="file">
+              <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
+            </el-upload>
+          </el-descriptions-item>
+
+        </el-descriptions>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="small" @click="closeEnforceDialog">取消</el-button>
+        <el-button size="small" type="primary" class="title" @click="submitEnforceForm('editForm')">确定处理</el-button>
+      </div>
+    </el-dialog>
+
+
+    <el-dialog title="选择人员" :visible.sync="usersVisble" width="30%" @click="closeUserDialog">
+      <el-tree
+        ref="dept"
+        :data="userList"
+        node-key="id"
+        :props="{label:'name'}" default-expand-all="true">
+      </el-tree>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="small" @click="closeUserDialog">取消</el-button>
+        <el-button size="small" type="primary" class="title" @click="submitUserForm('editForm')">确定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import Pagination from '@/components/Page/Pagination'
+import { completeTask, getPersonalTaskList } from '@/api/meeting/enforce'
+import { getDeptUserTree } from '@/api/system/user'
+import { uploadFileUrl} from '@/api/file/file'
 
 export default {
   name: 'workbench',
@@ -96,38 +223,127 @@ export default {
   },
   data() {
     return {
+      usersVisble:false,
+      userList:[],
       pageparm: {
         current: 1,
         size: 10,
         total: 0
       },
+      tableData: [],
+      auditWin:false,
+      formData:{
 
-      tableData: [{
-        date: '2016-05-02',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1518 弄'
-      }, {
-        date: '2016-05-04',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1517 弄'
-      }, {
-        date: '2016-05-01',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1519 弄'
-      }, {
-        date: '2016-05-03',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1516 弄'
-      }]
+      },
+      workFlowVisble:false,
+      activeFlow:0,
+      todoTaskList:0,
+      editEnforceFormVisible:false,
+      enforceForm:{
+        id:null,
+        enforceId:null,
+        director:null,
+        directorId:null,
+        remark:null,
+        taskId:null,
+        currentStep:null
+      },
+      enforceFlow:{
+        name:'',
+        enforcer:'',
+        time:null,
+        hno:null,
+        hsytem:null,
+        content:'',
+        status:0,
+        flowType:null
+      },
+      fileAction:''
     }
   },
+  mounted(){
+    this.getTaskList();
+    this.getDeptUserTrees();
+    this.fileAction=uploadFileUrl()
+  },
   methods:{
+    getDeptUserTrees(){
+      getDeptUserTree().then(res => {
+        this.userList = res.data
+      });
+    },
     // 分页插件事件
     callFather(parm) {
       this.formInline.current = parm.current
       this.formInline.size = parm.size
 
     },
+    getTaskList(){
+      getPersonalTaskList().then(res=>{
+        this.tableData=res.data
+        this.todoTaskList=this.tableData.length
+      })
+    },
+    searchWorkFlow(row){
+      this.workFlowVisble=true
+      this.activeFlow=row.step
+    },
+    closeEnforceDialog(){
+      this.editEnforceFormVisible=false
+    },
+    auditFlow(row){
+      this.enforceFlow.name=row.name
+      this.enforceFlow.enforcer=row.enforcer
+      this.enforceFlow.hno=row.hname
+      this.enforceFlow.hsytem=row.hsytem
+      this.enforceFlow.content=row.content
+      this.enforceFlow.time=row.beginTime+"至"+row.endTime
+      this.enforceFlow.status=row.status
+      this.enforceFlow.flowType=row.taskName
+      this.enforceForm.taskId=row.taskId
+      this.enforceForm.currentStep=row.step
+      this.enforceForm.enforceId=row.id
+      this.editEnforceFormVisible=true
+    },
+    openUsers(){
+      this.usersVisble=true
+    },
+    submitUserForm(){
+      //获取选中的节点
+      let node=this.$refs.dept.getCurrentNode();
+      if(node==undefined || node==null){
+        this.$message({
+          message: '请选择数据!',
+          type: 'warning'
+        });
+        return;
+      }
+      if(node.type!=='u'){
+        this.$message({
+          message: '请选择人员!',
+          type: 'warning'
+        });
+        return;
+      }
+      this.enforceForm.director=node.name
+      this.enforceForm.directorId=node.id
+      this.closeUserDialog();
+    },
+    closeUserDialog(){
+      this.usersVisble=false
+    },
+    handleRemove(file, fileList){
+      alert('Remove');
+    },
+    submitEnforceForm(){
+      let data=this.enforceForm;
+      completeTask(data).then(res =>{
+        this.$message({
+          message: '操作成功!',
+          type: 'success'
+        });
+      });
+    }
   }
 }
 </script>