workbench.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="10" >
  4. <el-col :span="6">
  5. <el-card class="card" >
  6. <div style="color: white;">
  7. <h2>我的待办事项:{{todoTaskList}}</h2>
  8. </div>
  9. </el-card>
  10. </el-col>
  11. <el-col :span="6">
  12. <el-card class="card" style="background-color: indianred" >
  13. <div style="color: white">
  14. <h2>我的项目</h2>
  15. </div>
  16. </el-card>
  17. </el-col>
  18. <el-col :span="6">
  19. <el-card class="card" style="background-color:steelblue" >
  20. <div style="color: white;">
  21. <h2>出勤状态:上班</h2>
  22. </div>
  23. </el-card>
  24. </el-col>
  25. <el-col :span="6">
  26. <el-card class="card" style="background-color:goldenrod" >
  27. <div style="color: white;">
  28. <h2>其他事项</h2>
  29. </div>
  30. </el-card>
  31. </el-col>
  32. </el-row>
  33. <el-row :gutter="20" style="margin-top: 50px">
  34. <el-col :span="24">
  35. <h3>我的待办列表</h3>
  36. <el-table
  37. :data="tableData"
  38. style="width: 100%" border stripe size="small">
  39. <el-table-column type="index" label="序号" width="80" align="center">
  40. </el-table-column>
  41. <el-table-column
  42. prop="name"
  43. label="任务名称" align="center"
  44. width="180">
  45. </el-table-column>
  46. <el-table-column
  47. prop="hname"
  48. label="实施医院" align="center"
  49. width="180">
  50. </el-table-column>
  51. <el-table-column
  52. prop="hsytem"
  53. label="实施系统" align="center"
  54. width="160">
  55. </el-table-column>
  56. <el-table-column
  57. prop="content"
  58. label="实施内容" align="center"
  59. min-width="250">
  60. </el-table-column>
  61. <el-table-column
  62. prop="taskName"
  63. label="当前处理步骤" align="center"
  64. width="180">
  65. </el-table-column>
  66. <el-table-column
  67. prop="flowType"
  68. label="流程类型" align="center"
  69. width="180">
  70. </el-table-column>
  71. <el-table-column align="center"
  72. prop="createTime"
  73. label="创建时间" width="200">
  74. </el-table-column>
  75. <el-table-column prop="op" width="200" label="操作" align="center">
  76. <template scope="scope">
  77. <el-button size="mini" type="success" @click="searchWorkFlow(scope.row)">查阅流程</el-button>
  78. <el-button size="mini" type="primary" @click="auditFlow(scope.row)">处理</el-button>
  79. </template>
  80. </el-table-column>
  81. </el-table>
  82. </el-col>
  83. </el-row>
  84. <el-dialog :visible.sync="workFlowVisble" width="75%" title="实施流程明细">
  85. <el-steps :active="activeFlow" finish-status="success" align-center >
  86. <el-step title="开始" />
  87. <el-step title="项目启动会" />
  88. <el-step title="发货" />
  89. <el-step title="物流签收" />
  90. <el-step title="进入现场" />
  91. <el-step title="设备安装" />
  92. <el-step title="系统调试" />
  93. <el-step title="操作培训" />
  94. <el-step title="现场值守" />
  95. <el-step title="离场" />
  96. <el-step title="实施复盘" />
  97. <el-step title="文件归档" />
  98. <el-step title="结束" />
  99. </el-steps>
  100. </el-dialog>
  101. <!--处理实施工作任务--->
  102. <el-dialog title="审批处理" :visible.sync="editEnforceFormVisible" width="45%" @click="closeEnforceDialog">
  103. <el-form label-width="120px" :model="enforceForm" >
  104. <el-descriptions title="" :column="2" border>
  105. <el-descriptions-item>
  106. <template slot="label">
  107. 项目名称
  108. </template>
  109. {{enforceFlow.name}}
  110. </el-descriptions-item>
  111. <el-descriptions-item>
  112. <template slot="label">
  113. 项目总负责人
  114. </template>
  115. {{enforceFlow.enforcer}}
  116. </el-descriptions-item>
  117. <el-descriptions-item>
  118. <template slot="label">
  119. 实施医院
  120. </template>
  121. {{enforceFlow.hno}}
  122. </el-descriptions-item>
  123. <el-descriptions-item>
  124. <template slot="label">
  125. 实施系统
  126. </template>
  127. {{enforceFlow.hsytem}}
  128. </el-descriptions-item>
  129. <el-descriptions-item >
  130. <template slot="label">
  131. 实施时间
  132. </template>
  133. {{enforceFlow.time}}
  134. </el-descriptions-item>
  135. <el-descriptions-item >
  136. <template slot="label">
  137. 实施状态
  138. </template>
  139. <span style="color: darkred" v-if="enforceFlow.status===0">待开始</span>
  140. <span style="color: green" v-else-if="enforceFlow.status===1">进行中</span>
  141. <span style="color: darkblue" v-else="enforceFlow.status===2">已结束</span>
  142. </el-descriptions-item>
  143. <el-descriptions-item :span="2">
  144. <template slot="label">
  145. 当前任务
  146. </template>
  147. {{enforceFlow.flowType}}
  148. </el-descriptions-item>
  149. <el-descriptions-item :span="2">
  150. <template slot="label">
  151. 实施内容
  152. </template>
  153. {{enforceFlow.content}}
  154. </el-descriptions-item>
  155. <el-descriptions-item :span="2">
  156. <template slot="label">
  157. 下个步骤负责人
  158. </template>
  159. <el-input size="small" v-model="enforceForm.director" :disabled="true" @keyup.enter.native="openUsers()">
  160. <el-button @click="openUsers" icon="el-icon-search" slot="append"></el-button>
  161. </el-input>
  162. </el-descriptions-item>
  163. <el-descriptions-item :span="2">
  164. <template slot="label">
  165. 备注说明
  166. </template>
  167. <el-input size="small" v-model="enforceForm.remark" type="textarea" :rows="4" ></el-input>
  168. </el-descriptions-item>
  169. <el-descriptions-item :span="2">
  170. <template slot="label">
  171. 文件列表
  172. </template>
  173. <el-upload
  174. ref="upload"
  175. :action="fileAction"
  176. :on-remove="handleRemove"
  177. :on-success="handleSuccess"
  178. :on-error="handleError"
  179. name="file">
  180. <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
  181. </el-upload>
  182. </el-descriptions-item>
  183. </el-descriptions>
  184. </el-form>
  185. <div slot="footer" class="dialog-footer">
  186. <el-button size="small" @click="closeEnforceDialog">取消</el-button>
  187. <el-button size="small" type="primary" class="title" @click="submitEnforceForm('editForm')">确定处理</el-button>
  188. </div>
  189. </el-dialog>
  190. <el-dialog title="选择人员" :visible.sync="usersVisble" width="30%" @click="closeUserDialog">
  191. <el-tree
  192. ref="dept"
  193. :data="userList"
  194. node-key="id"
  195. :props="{label:'name'}" default-expand-all="true">
  196. </el-tree>
  197. <div slot="footer" class="dialog-footer">
  198. <el-button size="small" @click="closeUserDialog">取消</el-button>
  199. <el-button size="small" type="primary" class="title" @click="submitUserForm('editForm')">确定</el-button>
  200. </div>
  201. </el-dialog>
  202. </div>
  203. </template>
  204. <script>
  205. import Pagination from '@/components/Page/Pagination'
  206. import { completeTask, getPersonalTaskList } from '@/api/meeting/enforce'
  207. import { getDeptUserTree } from '@/api/system/user'
  208. import { deleteFile, uploadFileUrl } from '@/api/file/file'
  209. export default {
  210. name: 'workbench',
  211. // 注册组件
  212. components: {
  213. Pagination
  214. },
  215. data() {
  216. return {
  217. usersVisble:false,
  218. userList:[],
  219. pageparm: {
  220. current: 1,
  221. size: 10,
  222. total: 0
  223. },
  224. tableData: [],
  225. auditWin:false,
  226. formData:{
  227. },
  228. workFlowVisble:false,
  229. activeFlow:0,
  230. todoTaskList:0,
  231. editEnforceFormVisible:false,
  232. enforceForm:{
  233. id:null,
  234. enforceId:null,
  235. director:null,
  236. directorId:null,
  237. remark:null,
  238. taskId:null,
  239. currentStep:null,
  240. filess:[]
  241. },
  242. enforceFlow:{
  243. name:'',
  244. enforcer:'',
  245. time:null,
  246. hno:null,
  247. hsytem:null,
  248. content:'',
  249. status:0,
  250. flowType:null
  251. },
  252. fileAction:''
  253. }
  254. },
  255. mounted(){
  256. this.getTaskList();
  257. this.getDeptUserTrees();
  258. this.fileAction=uploadFileUrl()
  259. },
  260. methods:{
  261. getDeptUserTrees(){
  262. getDeptUserTree('').then(res => {
  263. this.userList = res.data
  264. });
  265. },
  266. // 分页插件事件
  267. callFather(parm) {
  268. this.formInline.current = parm.current
  269. this.formInline.size = parm.size
  270. },
  271. getTaskList(){
  272. getPersonalTaskList().then(res=>{
  273. this.tableData=res.data
  274. this.todoTaskList=this.tableData.length
  275. })
  276. },
  277. searchWorkFlow(row){
  278. this.workFlowVisble=true
  279. this.activeFlow=row.step
  280. },
  281. closeEnforceDialog(){
  282. this.editEnforceFormVisible=false
  283. },
  284. auditFlow(row){
  285. this.enforceFlow.name=row.name
  286. this.enforceFlow.enforcer=row.enforcer
  287. this.enforceFlow.hno=row.hname
  288. this.enforceFlow.hsytem=row.hsytem
  289. this.enforceFlow.content=row.content
  290. this.enforceFlow.time=row.beginTime+"至"+row.endTime
  291. this.enforceFlow.status=row.status
  292. this.enforceFlow.flowType=row.taskName
  293. this.enforceForm.taskId=row.taskId
  294. this.enforceForm.currentStep=row.step
  295. this.enforceForm.enforceId=row.id
  296. this.editEnforceFormVisible=true
  297. },
  298. openUsers(){
  299. this.usersVisble=true
  300. },
  301. submitUserForm(){
  302. //获取选中的节点
  303. let node=this.$refs.dept.getCurrentNode();
  304. if(node==undefined || node==null){
  305. this.$message({
  306. message: '请选择数据!',
  307. type: 'warning'
  308. });
  309. return;
  310. }
  311. if(node.type!=='u'){
  312. this.$message({
  313. message: '请选择人员!',
  314. type: 'warning'
  315. });
  316. return;
  317. }
  318. this.enforceForm.director=node.name
  319. this.enforceForm.directorId=node.id
  320. this.closeUserDialog();
  321. },
  322. closeUserDialog(){
  323. this.usersVisble=false
  324. },
  325. handleRemove(file, fileList){
  326. let url=file.response.data.url;
  327. deleteFile(url).then(res => {
  328. this.$message({
  329. message: '操作成功!',
  330. type: 'success'
  331. });
  332. });
  333. this.enforceForm.filess.splice(url);
  334. },
  335. handleSuccess(response, file, fileList){
  336. let fileUrl=response.data.url
  337. this.enforceForm.filess.push(fileUrl)
  338. },
  339. handleError(){
  340. this.$message({
  341. message: '上传失败,请稍候再试!',
  342. type: 'warning'
  343. });
  344. },
  345. submitEnforceForm(){
  346. let data=this.enforceForm;
  347. completeTask(data).then(res =>{
  348. this.$message({
  349. message: '操作成功!',
  350. type: 'success'
  351. });
  352. this.closeEnforceDialog();
  353. this.getTaskList();
  354. });
  355. }
  356. }
  357. }
  358. </script>
  359. <style scoped>
  360. .card{
  361. width: 300px;
  362. height: 150px;
  363. background-color: #1ab394;
  364. display: flex;
  365. justify-content: center;
  366. align-items: center;
  367. }
  368. </style>