123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>发起流程</title>
- <!--#include file="common/_header.html"-->
- <style>
- .tab-labels{
- border-bottom: 1px solid #e8e8e8;
- }
- .tab-labels::after{
- content:'';
- display: block;
- clear:both;
- }
- .current{
- border-bottom-color: #1890ff !important;
- }
- .tab-label{
- cursor: pointer;
- display: inline-block;
- float: left;
- height: 40px;
- line-height: 40px;
- padding: 0 20px;
- border-bottom: solid 2px #fff;
- }
- .show {
- display: block;
- }
- .hide{
- display: none;
- }
- </style>
- </head>
- <body>
- <article id="app" class="page-container">
- <ul class="tab-labels">
- <li class="tab-label" :class="{current:index==current}" @click="current = index;" v-for="(process,index) in processList">
- {{process.description}}
- </li>
- </ul>
- <div v-for="(process,pIndex) in processList" v-show="current==pIndex">
- <h3 v-html="process.description"></h3>
- <p>
- 当前模板:
- <select v-model="process.selectedTemplateId"
- @change="loadStepList(pIndex)" class="select">
- <option :value="template.id"
- v-for="template in process.templateList">
- {{template.title}}
- </option>
- </select>
- </p>
- <table class="table table-border table-bordered">
- <thead>
- <tr>
- <td>步骤名称</td>
- <td>待办事项</td>
- <td>规定完成人天</td>
- </tr>
- </thead>
- <tbody v-if="process.stepList!=null">
- <tr v-for="step in process.stepList">
- <td v-html="step.name"></td>
- <td>
- <ul>
- <li v-for="todo,index in step.todoList">{{index+1}}.{{todo.detail}}</li>
- </ul>
- </td>
- <td>
- <input type="number" v-model="step.day"/>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <div style="text-align: center;padding:5px;">
- <input class="btn btn-primary radius size-L" type="button" value="提交" @click="submit()">
- </div>
- </article>
- <!--_footer 作为公共模版分离出去-->
- <!--#include file="common/_footer.html"-->
- <!--/_footer 作为公共模版分离出去-->
- <!--请在下方写此页面业务相关的脚本-->
- <script type="text/javascript" src="lib/vue/vue.js"></script>
- <script type="text/javascript" src="scripts/global.js"></script>
- <script type="text/javascript">
- var path = global_backend_url;
- var vm = new Vue({
- el: "#app",
- data: {
- projectId:"",
- templateId:"",
- templateList:[],
- processList:[],
- current:0
- },
- mounted:function(){
- var self = this;
- self.projectId = getQueryString("id");
- $.get(path + "/procDef/listWithTmpl",{
- procDefKeys : "ProjectPerformanceTransfer,ProjectStartUpConstruction,ProjectCompletedAndPutIntoOperation"
- },function(rs){
- if(rs.result){
- self.processList = rs.data;
- }
- else{
- alert(resp.message);
- }
- },"json");
- },
- methods:{
- loadStepList:function(pIndex){
- var self = this;
- var process = self.processList[pIndex];
- var loadingIndex = top.layer.load(0, {shade: [0.1,'#fff']});
- $.get(path + "/procDefTmpl/step/list",{
- templateId : process.selectedTemplateId
- },function(resp){
- top.layer.close(loadingIndex);
- if(resp.result) {
- process.stepList = resp.data;
- }
- else{
- console.log(resp.message);
- }
- },"json");
- },
- submit:function(){
- var self = this;
- var stepList = [];
- var failed = false;
- self.processList.forEach(function(process){
- process.stepList.forEach(function(step){
- if(step.day==null || step.day.length==0){
- layer.msg("流程:" + process.description + "中步骤" + step.name + "规定完成人天不能为空!");
- failed = true;
- return;
- }
- else{
- stepList.push({
- procDefKey: process.key,
- templateId: process.selectedTemplateId,
- taskDefKey: step.taskDefKey,
- stepId: step.id,
- day: parseInt(step.day)
- });
- }
- });
- if(failed){
- return;
- }
- });
- if(failed){
- return;
- }
- var loadingIndex = layer.load(1, {shade: [0.5,'#fff']});
- var requestDTO = {
- projectId : self.projectId,
- procDefKey: self.processList[0].key,
- templateId: self.processList[0].selectedTemplateId,
- templateId2: self.processList[1].selectedTemplateId,
- templateId3: self.processList[2].selectedTemplateId,
- stepList : stepList
- }
- $.ajax({
- url: path + "/procInst/startProcess",
- type: "POST", //请求类型
- data: JSON.stringify(requestDTO),
- dataType:"json",
- contentType:"application/json",
- success: function(resp){
- layer.close(loadingIndex);
- if(resp.result){
- layer.msg('发起成功!',{icon:1,time:1000});
-
- setTimeout(function(){
- var index = top.layer.getFrameIndex(window.name);
-
- if(index>=0){
- window.top["listWindow"].reloadList();
- top.layer.close(index);
- }
- },1000);
- }
- else{
- layer.msg(resp.message);
- }
- }
- });
- }
- }
- });
- </script>
- <!--/请在上方写此页面业务相关的脚本-->
- </body>
- </html>
|