作者 朱兆平

表单任务优化,以及自定义表单

@@ -24,7 +24,8 @@ module.exports = { @@ -24,7 +24,8 @@ module.exports = {
24 'vue$': 'vue/dist/vue.esm.js', 24 'vue$': 'vue/dist/vue.esm.js',
25 '@': resolve('src'), 25 '@': resolve('src'),
26 'scss_vars': '@/styles/vars.scss', 26 'scss_vars': '@/styles/vars.scss',
27 - 'img':resolve('src/assets/img') 27 + 'img':resolve('src/assets/img'),
  28 + 'core':path.join(__dirname,'core')
28 } 29 }
29 }, 30 },
30 module: { 31 module: {
@@ -15,13 +15,14 @@ @@ -15,13 +15,14 @@
15 "common": "^0.2.5", 15 "common": "^0.2.5",
16 "echarts": "^5.0.1", 16 "echarts": "^5.0.1",
17 "echarts-liquidfill": "^3.0.0", 17 "echarts-liquidfill": "^3.0.0",
18 - "element-ui": "^2.13.0", 18 + "element-ui": "^2.13.2",
19 "eslint": "^5.14.1", 19 "eslint": "^5.14.1",
20 "eslint-plugin-html": "^6.0.2", 20 "eslint-plugin-html": "^6.0.2",
21 "eslint-plugin-vue": "^8.7.1", 21 "eslint-plugin-vue": "^8.7.1",
22 "fecha": "^4.2.0", 22 "fecha": "^4.2.0",
23 "file-saver": "^2.0.2", 23 "file-saver": "^2.0.2",
24 "font-awesome": "^4.7.0", 24 "font-awesome": "^4.7.0",
  25 + "form-gen-parser": "^1.0.3",
25 "html2canvas": "^1.0.0-rc.5", 26 "html2canvas": "^1.0.0-rc.5",
26 "install": "^0.12.2", 27 "install": "^0.12.2",
27 "js-cookie": "^2.2.1", 28 "js-cookie": "^2.2.1",
@@ -33,12 +34,12 @@ @@ -33,12 +34,12 @@
33 "nprogress": "^0.2.0", 34 "nprogress": "^0.2.0",
34 "script-loader": "^0.7.2", 35 "script-loader": "^0.7.2",
35 "sortablejs": "^1.15.0", 36 "sortablejs": "^1.15.0",
36 - "vue": "^2.2.2", 37 + "vue": "^2.5.2",
37 "vue-count-to": "^1.0.13", 38 "vue-count-to": "^1.0.13",
38 "vue-i18n": "^8.14.0", 39 "vue-i18n": "^8.14.0",
39 "vue-quill-editor": "^3.0.6", 40 "vue-quill-editor": "^3.0.6",
40 "vue-router": "^2.3.0", 41 "vue-router": "^2.3.0",
41 - "vuex": "^2.0.0-rc.6", 42 + "vuex": "^3.6.2",
42 "xlsx": "^0.15.6" 43 "xlsx": "^0.15.6"
43 }, 44 },
44 "devDependencies": { 45 "devDependencies": {
@@ -13,6 +13,17 @@ export default { @@ -13,6 +13,17 @@ export default {
13 } 13 }
14 }) 14 })
15 }, 15 },
  16 + postWithFrom(url, data) {
  17 + return axios({
  18 + method: 'POST', // 请求协议
  19 + url: url, // 请求的地址
  20 + params: data, // post 请求的数据
  21 + timeout: 30000, // 超时时间, 单位毫秒
  22 + headers: {
  23 + 'Content-Type': 'application/x-www-form-urlencoded',
  24 + }
  25 + })
  26 + },
16 get(url, params) { 27 get(url, params) {
17 return axios({ 28 return axios({
18 method: 'GET', 29 method: 'GET',
@@ -14,10 +14,17 @@ export const instanceList = params => { return http.get(`${baseUrl}/process/inst @@ -14,10 +14,17 @@ export const instanceList = params => { return http.get(`${baseUrl}/process/inst
14 export const histroyList = params => { return http.get(`${baseUrl}/process/histroyList`, params); }; 14 export const histroyList = params => { return http.get(`${baseUrl}/process/histroyList`, params); };
15 15
16 export const processDiagram = params => { return http.getStream(`${baseUrl}/processDiagram`, params); }; 16 export const processDiagram = params => { return http.getStream(`${baseUrl}/processDiagram`, params); };
  17 +export const jobsCancelApi = params => { return http.postWithFrom(`${baseUrl}/process/deleteProcess`, params); };
17 18
18 //任务管理 19 //任务管理
19 export const allTask = params => { return http.get(`${baseUrl}/task/allTask`, params); }; 20 export const allTask = params => { return http.get(`${baseUrl}/task/allTask`, params); };
20 export const allTaskHistory = params => { return http.get(`${baseUrl}/task/allTaskHistory`, params); }; 21 export const allTaskHistory = params => { return http.get(`${baseUrl}/task/allTaskHistory`, params); };
  22 +export const myTask = params => { return http.get(`${baseUrl}/task/userTask`, params); };
  23 +export const handleTask = params => { return http.post(`${baseUrl}/task/executeTaskWithForm`, params); };
  24 +
  25 +//表单
  26 +export const getFormResource = params => { return http.get(`${baseUrl}/form/getFormResource`, params); };
  27 +export const getAllTaskFormInfo = params => { return http.get(`${baseUrl}/form/getAllTaskFormInfo`, params); };
21 28
22 29
23 30
@@ -16,6 +16,7 @@ import * as socketApi from './api/socket' @@ -16,6 +16,7 @@ import * as socketApi from './api/socket'
16 import '@/styles/index.scss' 16 import '@/styles/index.scss'
17 import sys_init from '@/common/init/sys_init' 17 import sys_init from '@/common/init/sys_init'
18 18
  19 +
19 // 条形组件 20 // 条形组件
20 import VueBarcode from '@xkeshi/vue-barcode'; //导入条形码插件 21 import VueBarcode from '@xkeshi/vue-barcode'; //导入条形码插件
21 Vue.component('barcode', VueBarcode); 22 Vue.component('barcode', VueBarcode);
@@ -38,6 +39,7 @@ Vue.use(ElementUI, @@ -38,6 +39,7 @@ Vue.use(ElementUI,
38 // eslint-disable-next-line no-undef 39 // eslint-disable-next-line no-undef
39 size: 'mini' 40 size: 'mini'
40 }) 41 })
  42 +// 注册组件库
41 Vue.use(VueRouter) 43 Vue.use(VueRouter)
42 Vue.use(Vuex) 44 Vue.use(Vuex)
43 Vue.prototype.$axios = axios; 45 Vue.prototype.$axios = axios;
@@ -13,6 +13,7 @@ import Department from './views/nav1/department.vue' @@ -13,6 +13,7 @@ import Department from './views/nav1/department.vue'
13 import Group from './views/nav1/groupcompany.vue' 13 import Group from './views/nav1/groupcompany.vue'
14 import Process from './views/hqpt/Process.vue' 14 import Process from './views/hqpt/Process.vue'
15 import Job from './views/hqpt/Job.vue' 15 import Job from './views/hqpt/Job.vue'
  16 +import FormTest from './views/nav4/formTest.vue'
16 // import Form from './views/nav1/Form.vue' 17 // import Form from './views/nav1/Form.vue'
17 18
18 19
@@ -105,6 +106,7 @@ import transit from './views/transit/transit.vue' @@ -105,6 +106,7 @@ import transit from './views/transit/transit.vue'
105 import technological from './views/technological/technological.vue' 106 import technological from './views/technological/technological.vue'
106 import example from './views/technological/example.vue' 107 import example from './views/technological/example.vue'
107 import task from './views/technological/task.vue' 108 import task from './views/technological/task.vue'
  109 +import myTask from './views/technological/myTask.vue'
108 import definition from './views/technological/definition.vue' 110 import definition from './views/technological/definition.vue'
109 111
110 112
@@ -193,7 +195,8 @@ let routes = [ @@ -193,7 +195,8 @@ let routes = [
193 iconCls: 'el-icon-collection', 195 iconCls: 'el-icon-collection',
194 children: [ 196 children: [
195 {path: '/Way', component: Way, name: '货运单'}, 197 {path: '/Way', component: Way, name: '货运单'},
196 - {path: '/Webdialog', component: Webdialog, name: '在线客服'} 198 + {path: '/Webdialog', component: Webdialog, name: '在线客服'},
  199 + {path: '/formtest', component: FormTest, name: '表单测试'}
197 ] 200 ]
198 }, 201 },
199 { 202 {
@@ -271,6 +274,7 @@ let routes = [ @@ -271,6 +274,7 @@ let routes = [
271 { path: '/process', component: Process, name: '工单管理' }, 274 { path: '/process', component: Process, name: '工单管理' },
272 { path: '/job', component: Job, name: '任务管理' }, 275 { path: '/job', component: Job, name: '任务管理' },
273 {path: '/pre1', component: PreManifest, name: '预配'}, 276 {path: '/pre1', component: PreManifest, name: '预配'},
  277 + {path:'/mytask',component:myTask,name:'我的任务'},
274 ] 278 ]
275 }, 279 },
276 { 280 {
@@ -73,6 +73,7 @@ @@ -73,6 +73,7 @@
73 label="操作"> 73 label="操作">
74 <template slot-scope="scope"> 74 <template slot-scope="scope">
75 <el-button type="success" size="mini" @click="chart(scope.$index,scope.row)">流程图</el-button> 75 <el-button type="success" size="mini" @click="chart(scope.$index,scope.row)">流程图</el-button>
  76 + <el-button type="warning" size="mini" @click="jobsCancel(scope.$index,scope.row)">停&nbsp;&nbsp;止</el-button>
76 <!-- <el-button type="warning" size="mini" @click="remove(scope.$index,scope.row)">删除</el-button>--> 77 <!-- <el-button type="warning" size="mini" @click="remove(scope.$index,scope.row)">删除</el-button>-->
77 <!-- <el-button type="danger" size="mini" @click="removeDel(scope.$index,scope.row)">彻底删除</el-button>--> 78 <!-- <el-button type="danger" size="mini" @click="removeDel(scope.$index,scope.row)">彻底删除</el-button>-->
78 </template> 79 </template>
@@ -348,7 +349,7 @@ @@ -348,7 +349,7 @@
348 </template> 349 </template>
349 350
350 <script> 351 <script>
351 - import {instanceList,processDiagram,histroyList} from "../../api/technological"; 352 + import {instanceList,processDiagram,histroyList,jobsCancelApi} from "../../api/technological";
352 353
353 export default { 354 export default {
354 name: "example", 355 name: "example",
@@ -411,7 +412,23 @@ @@ -411,7 +412,23 @@
411 this.getList(); 412 this.getList();
412 }, 413 },
413 methods: { 414 methods: {
414 - 415 + jobsCancel(index,row){
  416 + let _this = this
  417 + let para = {
  418 + processInstanceId: row.processInstanceId,
  419 + reason: "工单作废"
  420 + }
  421 + jobsCancelApi(para).then(response =>{
  422 + const res = response.data
  423 + if (res.code != '200') {
  424 + return _this.$message.error('作废失败!')
  425 + }
  426 + _this.$message.success('作废成功!')
  427 + }).catch(error => {
  428 + // 关闭加载
  429 + _this.$message.error(error.toString())
  430 + })
  431 + },
415 handleClick(tab){ 432 handleClick(tab){
416 if (tab.index == 0) { 433 if (tab.index == 0) {
417 this.getList(); 434 this.getList();
@@ -479,7 +496,6 @@ @@ -479,7 +496,6 @@
479 this.dialogloading = true; 496 this.dialogloading = true;
480 processDiagram({processId:row.processInstanceId}).then(res =>{ 497 processDiagram({processId:row.processInstanceId}).then(res =>{
481 // eslint-disable-next-line no-console 498 // eslint-disable-next-line no-console
482 - console.log(res)  
483 this.form.url=window.URL.createObjectURL(res.data); 499 this.form.url=window.URL.createObjectURL(res.data);
484 this.dialogloading = false; 500 this.dialogloading = false;
485 }); 501 });
  1 +<template>
  2 + <el-container>
  3 + <el-main>
  4 +
  5 + <el-row>
  6 + <el-tabs type="border-card" @tab-click="handleClick">
  7 + <el-tab-pane label="我的待办">
  8 + <!--检索条件-->
  9 + <el-row class="toolbar" style="background-color: white;margin-bottom: 10px">
  10 + <el-col :span="6">
  11 + <el-input v-model="queryinfo.name" placeholder="任务名称" style="width: 200px" clearable>
  12 + <template slot="prepend">任务名称</template>
  13 + </el-input>
  14 + </el-col>
  15 + <el-col :span="6">
  16 + <el-input v-model="queryinfo.taskDefinitionKey " placeholder="关键字" style="width: 200px" clearable>
  17 + <template slot="prepend">关键字</template>
  18 + </el-input>
  19 + </el-col>
  20 +
  21 + <el-col :span="8">
  22 + <el-button type="primary" v-on:click="geMyTask">查询</el-button>
  23 + <!-- <el-button type="success" v-on:click="toAddDialog">新增</el-button>-->
  24 +
  25 + </el-col>
  26 + </el-row>
  27 + <template>
  28 + <el-table
  29 + v-loading="tableloading"
  30 + :data="tableData"
  31 + style="width: 100%"
  32 + :default-sort = "{prop: 'date', order: 'descending'}"
  33 + :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="mini"
  34 + >
  35 + <el-table-column
  36 + prop="name"
  37 + label="任务名称"
  38 + width="160">
  39 + </el-table-column>
  40 + <el-table-column
  41 + prop="taskDefinitionKey "
  42 + label="关键字">
  43 + </el-table-column>
  44 + <el-table-column
  45 + prop="owner"
  46 + label="所有者">
  47 + </el-table-column>
  48 + <el-table-column
  49 + prop="assignee "
  50 + label="执行者"
  51 + width="160"
  52 + show-overflow-tooltip>
  53 + </el-table-column>
  54 + <el-table-column
  55 + prop="createTime"
  56 + label="开始时间"
  57 + width="160">
  58 + </el-table-column>
  59 + <el-table-column
  60 + fixed="right"
  61 + label="操作"
  62 + width="280">
  63 + <template slot-scope="scope">
  64 + <el-button type="success" size="mini" @click="checkProcess(scope.$index,scope.row)">查看进度</el-button>
  65 + <el-button type="warning" size="mini" @click="getProcessFormInfoPromise(scope.$index,scope.row)">办理任务</el-button>
  66 + <el-button type="danger" size="mini" @click="handleTask(scope.$index,scope.row)">驳回</el-button>
  67 + </template>
  68 + </el-table-column>
  69 + </el-table>
  70 + </template>
  71 + <!--分页模块-->
  72 + <el-row style="float: right;margin-top: 20px">
  73 + <el-col>
  74 + <div class="block">
  75 + <el-pagination
  76 + @size-change="handleSizeChange"
  77 + @current-change="handleCurrentChange"
  78 + :current-page="queryinfo.pageNum"
  79 + :page-sizes="[10, 20, 30, 40]"
  80 + :page-size="queryinfo.pageSize"
  81 + layout="total, sizes, prev, pager, next, jumper"
  82 + :total="total">
  83 + </el-pagination>
  84 + </div>
  85 + </el-col>
  86 + </el-row>
  87 + </el-tab-pane>
  88 + <el-tab-pane label="我的已办">
  89 + <!--检索条件-->
  90 + <el-row class="toolbar" style="background-color: white;margin-bottom: 10px">
  91 + <el-col :span="6">
  92 + <el-input v-model="queryinfo.name" placeholder="任务名称" style="width: 200px" clearable>
  93 + <template slot="prepend">任务名称</template>
  94 + </el-input>
  95 + </el-col>
  96 + <el-col :span="6">
  97 + <el-input v-model="queryinfo.taskDefinitionKey " placeholder="关键字" style="width: 200px" clearable>
  98 + <template slot="prepend">关键字</template>
  99 + </el-input>
  100 + </el-col>
  101 +
  102 + <el-col :span="8">
  103 + <el-button type="primary" v-on:click="getAllList">查询</el-button>
  104 + <!-- <el-button type="success" v-on:click="toAddDialog">新增</el-button>-->
  105 +
  106 + </el-col>
  107 + </el-row>
  108 + <template>
  109 + <el-table
  110 + v-loading="tableloading"
  111 + :data="tableData"
  112 + style="width: 100%"
  113 + :default-sort = "{prop: 'date', order: 'descending'}"
  114 + :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="mini"
  115 + >
  116 + <el-table-column
  117 + prop="name"
  118 + label="任务名称"
  119 + width="160">
  120 + </el-table-column>
  121 + <el-table-column
  122 + prop="taskDefinitionKey"
  123 + label="关键字">
  124 + </el-table-column>
  125 + <el-table-column
  126 + prop="owner"
  127 + label="所有者">
  128 + </el-table-column>
  129 + <el-table-column
  130 + prop="assignee"
  131 + label="执行人"
  132 + width="160"
  133 + show-overflow-tooltip>
  134 + </el-table-column>
  135 + <el-table-column
  136 + prop="createTime"
  137 + label="开始时间"
  138 + width="160">
  139 + </el-table-column>
  140 + <!-- <el-table-column-->
  141 + <!-- fixed="right"-->
  142 + <!-- label="操作"-->
  143 + <!-- width="280">-->
  144 + <!-- <template slot-scope="scope">-->
  145 + <!-- <el-button type="success" size="mini" @click="sendForm()">实例管理</el-button>-->
  146 + <!-- <el-button type="warning" size="mini" @click="remove(scope.$index,scope.row)">删除</el-button>-->
  147 + <!-- <el-button type="danger" size="mini" @click="removeDel(scope.$index,scope.row)">彻底删除</el-button>-->
  148 + <!-- </template>-->
  149 + <!-- </el-table-column>-->
  150 + </el-table>
  151 + </template>
  152 + <!--分页模块-->
  153 + <el-row style="float: right;margin-top: 20px">
  154 + <el-col>
  155 + <div class="block">
  156 + <el-pagination
  157 + @size-change="handleSizeChange"
  158 + @current-change="handleCurrentChange"
  159 + :current-page="queryinfo.pageNum"
  160 + :page-sizes="[10, 20, 30, 40]"
  161 + :page-size="queryinfo.pageSize"
  162 + layout="total, sizes, prev, pager, next, jumper"
  163 + :total="total">
  164 + </el-pagination>
  165 + </div>
  166 + </el-col>
  167 + </el-row>
  168 + </el-tab-pane>
  169 + <el-tab-pane label="我发起的">
  170 + <!--检索条件-->
  171 + <el-row class="toolbar" style="background-color: white;margin-bottom: 10px">
  172 + <el-col :span="6">
  173 + <el-input v-model="queryinfo.name" placeholder="任务名称" style="width: 200px" clearable>
  174 + <template slot="prepend">任务名称</template>
  175 + </el-input>
  176 + </el-col>
  177 + <el-col :span="6">
  178 + <el-input v-model="queryinfo.taskDefinitionKey " placeholder="关键字" style="width: 200px" clearable>
  179 + <template slot="prepend">关键字</template>
  180 + </el-input>
  181 + </el-col>
  182 +
  183 + <el-col :span="8">
  184 + <el-button type="primary" v-on:click="getMyList">查询</el-button>
  185 + <!-- <el-button type="success" v-on:click="toAddDialog">新增</el-button>-->
  186 +
  187 + </el-col>
  188 + </el-row>
  189 + <template>
  190 + <el-table
  191 + v-loading="tableloading"
  192 + :data="tableData"
  193 + style="width: 100%"
  194 + :default-sort = "{prop: 'date', order: 'descending'}"
  195 + :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="mini"
  196 + >
  197 + <el-table-column
  198 + prop="name"
  199 + label="任务名称"
  200 + width="160">
  201 + </el-table-column>
  202 + <el-table-column
  203 + prop="taskDefinitionKey"
  204 + label="关键字">
  205 + </el-table-column>
  206 + <el-table-column
  207 + prop="owner"
  208 + label="所有者">
  209 + </el-table-column>
  210 + <el-table-column
  211 + prop="assignee"
  212 + label="执行者"
  213 + width="160"
  214 + show-overflow-tooltip>
  215 + </el-table-column>
  216 + <el-table-column
  217 + prop="createTime"
  218 + label="开始时间"
  219 + width="160">
  220 + </el-table-column>
  221 + <!-- <el-table-column-->
  222 + <!-- fixed="right"-->
  223 + <!-- label="操作"-->
  224 + <!-- width="280">-->
  225 + <!-- <template slot-scope="scope">-->
  226 + <!-- <el-button type="success" size="mini" @click="sendForm()">实例管理</el-button>-->
  227 + <!-- <el-button type="warning" size="mini" @click="remove(scope.$index,scope.row)">删除</el-button>-->
  228 + <!-- <el-button type="danger" size="mini" @click="removeDel(scope.$index,scope.row)">彻底删除</el-button>-->
  229 + <!-- </template>-->
  230 + <!-- </el-table-column>-->
  231 + </el-table>
  232 + </template>
  233 + <!--分页模块-->
  234 + <el-row style="float: right;margin-top: 20px">
  235 + <el-col>
  236 + <div class="block">
  237 + <el-pagination
  238 + @size-change="handleSizeChange"
  239 + @current-change="handleCurrentChange"
  240 + :current-page="queryinfo.pageNum"
  241 + :page-sizes="[10, 20, 30, 40]"
  242 + :page-size="queryinfo.pageSize"
  243 + layout="total, sizes, prev, pager, next, jumper"
  244 + :total="total">
  245 + </el-pagination>
  246 + </div>
  247 + </el-col>
  248 + </el-row>
  249 + </el-tab-pane>
  250 + </el-tabs>
  251 + </el-row>
  252 +
  253 + </el-main>
  254 + <el-dialog title="流程图" :visible.sync="dialogFormVisible" v-loading="dialogloading">
  255 + <el-form :model="form">
  256 + <el-form-item>
  257 + <div class="demo-image__preview">
  258 + <el-image
  259 +
  260 + :src="form.url">
  261 + </el-image>
  262 + </div>
  263 + </el-form-item>
  264 + </el-form>
  265 + <div slot="footer" class="dialog-footer">
  266 + <el-button @click="dialogFormVisible = false">取 消</el-button>
  267 + </div>
  268 + </el-dialog>
  269 +
  270 + <el-dialog title="任务表单" :visible.sync="dialogTaskFormVisible" v-loading="dialogloading">
  271 + <el-divider content-position="left">已提交表单</el-divider>
  272 + <el-row>
  273 + <el-col :span="12" v-for="(item,index) in AllTaskFormInfoData" :key="item.id">
  274 + <el-input
  275 + v-model="item.variableValue"
  276 + :disabled="true"
  277 + v-if="item.variableType==='string'"
  278 + >
  279 + <template slot="prepend">{{typeOptions[item.variableName]}}</template>
  280 + </el-input>
  281 + <el-input
  282 + v-model="item.variableValue"
  283 + :disabled="true"
  284 + v-else-if="item.variableType==='long'"
  285 + >
  286 + <template slot="prepend">{{typeOptions[item.variableName]}}</template>
  287 + </el-input>
  288 + <el-input
  289 + v-model="item.variableValue"
  290 + :disabled="true"
  291 + v-else-if="item.variableType==='jodadate'"
  292 + >
  293 + <template slot="prepend">{{typeOptions[item.variableName]}}</template>
  294 + </el-input>
  295 + <el-switch
  296 + v-model="item.variableValue"
  297 + active-color="#13ce66"
  298 + inactive-color="#ff4949"
  299 + active-text="出库完成"
  300 + inactive-text="出库未完成"
  301 + v-else-if="item.variableType==='boolean'"
  302 + disabled
  303 + >
  304 + </el-switch>
  305 + <span v-else>
  306 + {{item.variableName}} = {{item.variableValue}} -[类型] {{item.variableType}}
  307 + </span>
  308 + </el-col>
  309 + </el-row>
  310 + <el-divider content-position="left">需要提交的表单</el-divider>
  311 + <parser :key="key2" :form-conf="formResource" @submit="handleTask" />
  312 + </el-dialog>
  313 +
  314 + </el-container>
  315 +</template>
  316 +
  317 +<script>
  318 + import {allTask, allTaskHistory, myTask, processDiagram, handleTask, getFormResource,getAllTaskFormInfo} from "../../api/technological";
  319 + import {loginedUserInfo} from '@/api/user';
  320 + import Parser from 'form-gen-parser'
  321 + import jsutil from "@/common/js/util";
  322 +
  323 + export default {
  324 + name: "mytask",
  325 + components: {
  326 + Parser
  327 + },
  328 + data() {
  329 + return{
  330 + queryinfo:{
  331 + assignee:'',
  332 + pageNum:1,
  333 + pageSize:10,
  334 + },
  335 + form: {
  336 + url: ''
  337 + },
  338 + dialogFormVisible: false,
  339 + dialogTaskFormVisible: false,
  340 + dialogloading: false,
  341 + sysUserName:'',
  342 + total:0,
  343 + tableData: [],
  344 + tableloading:false,
  345 + key2: +new Date(),
  346 + formResource: {
  347 + "fields": [],
  348 + "formRef": "wms_truck_plan",
  349 + "formModel": "wms_truck_plan_Data",
  350 + "size": "mini",
  351 + "labelPosition": "left",
  352 + "labelWidth": 100,
  353 + "formRules": "rules",
  354 + "gutter": 5,
  355 + "disabled": false,
  356 + "span": 12,
  357 + "formBtns": true,
  358 + "unFocusedComponentBorder": true
  359 + },
  360 + submitTaskParm:{
  361 + "assignee": "",
  362 + "cascade": true,
  363 + "outcome": "",
  364 + "processDefinitionId": "",
  365 + "processInstanceId": "",
  366 + "taskDefinitionKey": "",
  367 + "taskId": "",
  368 + "variables": {}
  369 + },
  370 + AllTaskFormInfoData: [],
  371 + typeOptions: {
  372 + "truck_type" : "车辆类型",
  373 + "truck_quantity" : "车辆数量",
  374 + "waybillNo" : "运单列表",
  375 + "scheduleTime" : "预定时间",
  376 + "userCompanyId" : "企业信息",
  377 + "busnessType" : "业务类型",
  378 + "candidateUsername" : "用户名称",
  379 + "form_wms_truck_plan_outcome" : "表单输出",
  380 + "form_truck_form_outcome" : "表单输出",
  381 + "form_truck_distribute_outcome" : "表单输出",
  382 + "delivery_complete" : "出库完成"
  383 +
  384 + }
  385 +
  386 + }
  387 + },
  388 + mounted() {
  389 + let user = loginedUserInfo();
  390 + this.queryinfo.assignee = user.username;
  391 + console.log("当前用户名:"+this.queryinfo.assignee);
  392 + this.$nextTick(function () {
  393 + this.geMyTask();
  394 + })
  395 +
  396 + },
  397 + methods: {
  398 + // 分页
  399 + handleSizeChange(val) {
  400 + this.queryinfo.pageSize= val
  401 + this.getList()
  402 + },
  403 + handleCurrentChange(val) {
  404 + this.queryinfo.pageNum = val
  405 + this.getList()
  406 + },
  407 + //查询我的任务
  408 + geMyTask() {
  409 + const _this = this
  410 + this.tableloading = true;
  411 + myTask(this.queryinfo).then((response) => {
  412 + const res = response.data
  413 + if (res.code != '200') {
  414 + return _this.$message.error('获取消息收发记录,失败!')
  415 + }
  416 + // 获取列表数据
  417 + _this.tableData = res.data
  418 + // 获取列表的总记录数
  419 + _this.total = res.total
  420 + this.tableloading = false;
  421 + _this.$message.success('获取消息收发记录,成功!')
  422 + }).catch(error => {
  423 + // 关闭加载
  424 + _this.$message.error(error.toString())
  425 + this.tableloading = false;
  426 +
  427 + })
  428 + },
  429 + //查看进度
  430 + checkProcess(index,row){
  431 + console.log(row)
  432 + this.dialogFormVisible = true
  433 + this.dialogloading = true;
  434 + processDiagram({processId:row.processInstanceId}).then(res =>{
  435 + // eslint-disable-next-line no-console
  436 + this.form.url=window.URL.createObjectURL(res.data);
  437 + this.dialogloading = false;
  438 + }).catch(err => {
  439 + this.dialogloading = false;
  440 + });
  441 + },
  442 + // 提交任务
  443 + handleTask(paras){
  444 + this.dialogloading = true;
  445 + let _this=this
  446 + this.submitTaskParm.variables = paras
  447 + handleTask(this.submitTaskParm).then(response =>{
  448 + const res = response.data
  449 + if (res.code != '200') {
  450 + return _this.$message.error('获取记录失败!')
  451 + }
  452 + _this.$message.success("任务完成"+res.msg);
  453 + _this.dialogTaskFormVisible = false
  454 + _this.geMyTask()
  455 + this.dialogloading = false;
  456 + }).catch(err=>{
  457 + _this.$message.error("失败"+err);
  458 + this.dialogTaskFormVisible = false
  459 + this.dialogloading = false;
  460 + })
  461 + },
  462 + //我发起的任务
  463 + getMyList(){
  464 +
  465 + },
  466 + //获取工单中已完成任务的表单数据的promise
  467 + getProcessFormInfoPromise(index,row){
  468 + this.dialogloading = true;
  469 + this.dialogTaskFormVisible = true
  470 + let _this = this;
  471 + this.getProcessFormInfo(index,row).then(data =>{
  472 + _this.getFormDefine(index,row)
  473 + _this.dialogloading = false;
  474 + }).catch(err => {
  475 + _this.$message.error(err)
  476 + _this.dialogloading = false;
  477 + })
  478 + },
  479 + //获取工单中已完成任务的表单数据
  480 + getProcessFormInfo(index,row){
  481 + let _this = this;
  482 + return new Promise((resolve,reject)=> {
  483 + getAllTaskFormInfo({processInstanceId:row.processInstanceId}).then(response =>{
  484 + const res = response.data
  485 + if (res.code != '200') {
  486 + _this.$message.error('获取已提交工单数据失败!')
  487 + }
  488 + const data =res.data;
  489 + _this.AllTaskFormInfoData = data
  490 + resolve(data);
  491 +
  492 + }).catch(err => {
  493 + _this.$message.error(err)
  494 + _this.dialogloading = false;
  495 + });
  496 + })
  497 + },
  498 + //获取任务的表单定义
  499 + getFormDefine(index,row){
  500 + this.submitTaskParm.taskId = row.id
  501 + let _this = this;
  502 + return new Promise((resolve,reject)=> {
  503 + getFormResource({taskid:row.id}).then(response =>{
  504 + const res = response.data
  505 + if (res.code != '200') {
  506 + _this.$message.error('提交任务失败!')
  507 + }
  508 + const data =res.data;
  509 + resolve(data);
  510 + if (jsutil.checkNull(data)){
  511 + _this.key2 = +new Date()
  512 + _this.formResource = JSON.parse(data)
  513 + }else {
  514 + console.log("此任务没有表单定义")
  515 + }
  516 + }).catch(err => {
  517 + _this.$message.error(err)
  518 + });
  519 + })
  520 +
  521 + },
  522 + //查询
  523 + getList() {
  524 + const _this = this
  525 + this.tableloading = true;
  526 + allTask(this.queryinfo).then((response) => {
  527 + const res = response.data
  528 + if (res.code != '200') {
  529 + return _this.$message.error('获取消息收发记录,失败!')
  530 + }
  531 + // 获取列表数据
  532 + _this.tableData = res.data
  533 + // 获取列表的总记录数
  534 + _this.total = res.total
  535 + this.tableloading = false;
  536 + _this.$message.success('获取消息收发记录,成功!')
  537 + }).catch(error => {
  538 +
  539 + // 关闭加载
  540 + _this.$message.error(error.toString())
  541 + this.tableloading = false;
  542 +
  543 + })
  544 + },
  545 + handleClick(tab, event){
  546 + if (tab.index == 0) {
  547 + this.geMyTask();
  548 + } else if (tab.index == 1) {
  549 + this.getAllList();
  550 + } else {
  551 + this.getMyList();
  552 + }
  553 + },
  554 + //查询
  555 + getAllList() {
  556 + const _this = this
  557 + this.tableloading = true;
  558 + allTaskHistory(this.queryinfo).then((response) => {
  559 + const res = response.data
  560 + if (res.code != '200') {
  561 + return _this.$message.error('获取消息收发记录,失败!')
  562 + }
  563 + // 获取列表数据
  564 + _this.tableData = res.data
  565 + // 获取列表的总记录数
  566 + _this.total = res.total
  567 + this.tableloading = false;
  568 + _this.$message.success('获取消息收发记录,成功!')
  569 + }).catch(error => {
  570 +
  571 + // 关闭加载
  572 + _this.$message.error(error.toString())
  573 + this.tableloading = false;
  574 +
  575 + })
  576 + },
  577 + }
  578 +
  579 + }
  580 +</script>
  581 +
  582 +<style scoped>
  583 +
  584 +</style>
@@ -13,12 +13,16 @@ @@ -13,12 +13,16 @@
13 </el-input> 13 </el-input>
14 </el-col> 14 </el-col>
15 <el-col :span="6"> 15 <el-col :span="6">
16 - <el-input v-model="queryinfo.taskDefinitionKey " placeholder="关键字" style="width: 200px" clearable> 16 + <el-input v-model="queryinfo.taskDefinitionKey" placeholder="关键字" style="width: 200px" clearable>
17 <template slot="prepend">关键字</template> 17 <template slot="prepend">关键字</template>
18 </el-input> 18 </el-input>
19 </el-col> 19 </el-col>
20 -  
21 - <el-col :span="8"> 20 + <el-col :span="6">
  21 + <el-input v-model="queryinfo.assignee" placeholder="执行人或组名" style="width: 200px" clearable>
  22 + <template slot="prepend">执行人</template>
  23 + </el-input>
  24 + </el-col>
  25 + <el-col :span="6">
22 <el-button type="primary" v-on:click="getList">查询</el-button> 26 <el-button type="primary" v-on:click="getList">查询</el-button>
23 <!-- <el-button type="success" v-on:click="toAddDialog">新增</el-button>--> 27 <!-- <el-button type="success" v-on:click="toAddDialog">新增</el-button>-->
24 28
@@ -264,8 +268,9 @@ @@ -264,8 +268,9 @@
264 queryinfo:{ 268 queryinfo:{
265 name:'', 269 name:'',
266 taskDefinitionKey:'', 270 taskDefinitionKey:'',
  271 + assignee:'',
267 pageNum:1, 272 pageNum:1,
268 - pageSize:10, 273 + pageSize:10
269 }, 274 },
270 total:0, 275 total:0,
271 tableData: [], 276 tableData: [],
@@ -317,6 +322,9 @@ @@ -317,6 +322,9 @@
317 this.getMyList(); 322 this.getMyList();
318 } 323 }
319 }, 324 },
  325 + getMyList(){
  326 +
  327 + },
320 //查询 328 //查询
321 getAllList() { 329 getAllList() {
322 const _this = this 330 const _this = this
@@ -161,6 +161,8 @@ @@ -161,6 +161,8 @@
161 <el-button type="primary" @click="trans_add">确 定</el-button> 161 <el-button type="primary" @click="trans_add">确 定</el-button>
162 </div> 162 </div>
163 </el-dialog> 163 </el-dialog>
  164 +
  165 +
164 </el-main> 166 </el-main>
165 </el-container> 167 </el-container>
166 168
@@ -174,6 +176,30 @@ @@ -174,6 +176,30 @@
174 name: "technological", 176 name: "technological",
175 data() { 177 data() {
176 return{ 178 return{
  179 + //实例对象
  180 + fApi: {},
  181 + //表单数据
  182 + formvalue: {},
  183 + //表单生成规则
  184 + formrule: [
  185 + {
  186 + type: 'input',
  187 + field: 'goods_name',
  188 + title: '商品名称'
  189 + },
  190 + {
  191 + type: 'datePicker',
  192 + field: 'created_at',
  193 + title: '创建时间'
  194 + }
  195 + ],
  196 + //组件参数配置
  197 + formoption: {
  198 + //表单提交事件
  199 + onSubmit: function (formData) {
  200 + alert(JSON.stringify(formData))
  201 + }
  202 + },
177 queryinfo:{ 203 queryinfo:{
178 name:'', 204 name:'',
179 key:'', 205 key:'',