123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993 |
- <template>
- <a-card :bordered="false">
- <!-- 查询区域 -->
- <div class="table-page-search-wrapper">
- <a-form layout="inline" @keyup.enter.native="searchQuery">
- <a-row :gutter="24">
- <a-col :md="6" :sm="8">
- <a-form-item label="流程名称">
- <a-input placeholder="请输入搜索关键词" v-model="queryParam.lcmc"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="流程标识">
- <a-input placeholder="请输入搜索关键词" v-model="queryParam.lckey"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="4" :sm="8">
- <a-form-item label="是否最新">
- <a-switch
- checkedChildren="是"
- unCheckedChildren="否"
- defaultChecked
- v-model="queryParam.zx"
- />
- </a-form-item>
- </a-col>
- <!--<a-col :md="6" :sm="10">
- <a-form-item label="创建时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-range-picker
- style="width: 210px"
- v-model="queryParam.createTimeRange"
- format="YYYY-MM-DD"
- :placeholder="['开始时间', '结束时间']"
- @change="onDateChange"
- @ok="onDateOk"
- />
- </a-form-item>
- </a-col>-->
- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
- <a-col :md="8" :sm="12">
- <a-button type="primary" style="left: 10px" @click="searchQuery" icon="search">查询</a-button>
- <a-button
- type="primary"
- @click="searchReset"
- icon="reload"
- style="margin-left: 8px;left: 10px"
- >重置</a-button>
- <a-button @click="editFormsOnline" style="margin-left: 8px;left: 10px;">在线编辑表单</a-button>
- </a-col>
- </span>
- <span style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
- <a-col :md="12" :sm="12">
- <!-- <a-button type="primary" style="left: 10px" @click="createObj.visible=true" icon="search">创建流程模型</a-button>-->
- </a-col>
- </span>
- </a-row>
- </a-form>
- </div>
- <!-- table区域-begin -->
- <a-table
- :scroll="{x:2250,y:500}"
- bordered
- ref="table"
- size="small"
- rowKey="id"
- :dataSource="dataSource"
- :pagination="ipagination"
- :loading="loading"
- @change="handleTableChange"
- >
- <a-table-column title="#" :width="50" fixed="left" key="a">
- <template slot-scope="t,r,i">
- <span>{{i+1}}</span>
- </template>
- </a-table-column>
- <a-table-column title="流程名称" data-index="name" :width="200" align="center" fixed="left">
- <template slot-scope="t,r,i">
- <span>{{t}}</span>
- </template>
- </a-table-column>
- <a-table-column title="流程标识" data-index="processKey" :width="200" align="center">
- <template slot-scope="t,r,i">
- <span>{{t}}</span>
- </template>
- </a-table-column>
- <a-table-column
- title="版本"
- data-index="version"
- key="asa"
- :width="100"
- align="center"
- :sorter="(a, b) => a.version - b.version"
- >
- <template slot-scope="t,r,i">
- <span>v.{{t}}</span>
- </template>
- </a-table-column>
- <a-table-column
- title="图标"
- data-index="iconAddress"
- key="iconAddress"
- :width="100"
- align="center"
- >
- <template slot-scope="t,r,i">
- <span><a-avatar
- shape="square"
- :src="t"
- /></span>
- </template>
- </a-table-column>
- <a-table-column
- title="所属分类"
- data-index="categoryId"
- :width="200"
- align="center"
- key="categoryId_"
- :filters="lcTypeF"
- @filter="filter_categoryId"
- >
- <template slot-scope="t,r,i">
- <span>{{filterDictText(dictOptions, t)}}</span>
- </template>
- </a-table-column>
- <a-table-column title="流程图片" data-index="diagramName" :width="200" align="center">
- <template slot-scope="t,r,i">
- <span @click="showResource(r)" style="color: blue;cursor: pointer;">{{t}}</span>
- </template>
- </a-table-column>
- <a-table-column title="表单路由" data-index="routeName" :width="200" align="center">
- <template slot-scope="t,r,i">
- <span @click="viewForm(r)" style="color: blue;cursor: pointer;">
- <!-- {{getFormComponent(t).text}} -->
- 预览表单
- </span>
- </template>
- </a-table-column>
- <a-table-column title="状态" data-index="status" :width="200" align="center">
- <template slot-scope="t,r,i">
- <span v-if="t==1" style="color: #00A0E9;">已启用</span>
- <span v-if="t!=1" style="color: #999;">未启用</span>
- </template>
- </a-table-column>
- <a-table-column title="备注说明" data-index="description" :width="200" align="center">
- <template slot-scope="t,r,i">
- <j-ellipsis :value="t" :length="10" />
- </template>
- </a-table-column>
- <a-table-column title="部署时间" data-index="createTime" :width="200" align="center">
- <template slot-scope="t,r,i">
- <span>{{t}}</span>
- </template>
- </a-table-column>
- <a-table-column title="更新时间" data-index="updateTime" :width="200" align="center">
- <template slot-scope="t,r,i">
- <span>{{t}}</span>
- </template>
- </a-table-column>
- <a-table-column title="操作" data-index align="center" :width="250" fixed="right">
- <template slot-scope="t,r,i">
- <a
- href="javascript:void(0);"
- v-if="r.status!=1"
- @click="editStatus(1,r)"
- style="color: rgb(144,96,255);"
- >启用</a>
- <a
- href="javascript:void(0);"
- v-if="r.status==1"
- @click="editStatus(0,r)"
- style="color: #cb892d"
- >禁用</a>
- <a-divider type="vertical" />
- <a href="javascript:void(0);" @click="getNodeData(r)">节点设置</a>
- <a-divider type="vertical" />
- <!-- <a href="javascript:void(0);" @click="convertToModel(r)" >转为模型</a> -->
- <a href="javascript:void(0);" @click="edit(r)">编辑</a>
- <a-divider type="vertical" />
- <br />
- <!-- 是自定义的表单才显示 -->
- <a
- v-if="r.routeName!=null&&r.routeName.indexOf('自定义')!=-1"
- href="javascript:void(0);"
- @click="editFrom(r)"
- >编辑表单</a>
- <a-divider v-if="r.routeName!=null&&r.routeName.indexOf('自定义')!=-1" type="vertical" />
- <a href="javascript:void(0);" style="color: red;" @click="remove(r)">删除</a>
- </template>
- </a-table-column>
- </a-table>
- <!-- table区域-end -->
- <!--编辑-->
- <a-modal
- :confirmLoading="confirmLoading"
- title="编辑流程"
- :visible="editObj.visible"
- @ok="editObjOk"
- @cancel="editObj.visible = false"
- >
- <a-form :form="editForm" v-if="editObj.visible">
- <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="流程分类">
- <component
- :is="LcDict"
- :trigger-change="true"
- v-decorator="[ 'categoryId', {initialValue:editObj.categoryId, rules: [{ required: true, message: '不能为空' }] },]"
- placeholder="请选择流程分类"
- dictCode="bpm_process_type"
- ></component>
- </a-form-item>
- <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="关联表单">
- <a-select
- @change="change_routeName"
- placeholder="请选择关联表单"
- :trigger-change="true"
- v-decorator="[ 'routeName', {initialValue:editObj.routeName, rules: [{ required: true, message: '不能为空' }] },]"
- >
- <a-select-option value>请选择</a-select-option>
- <a-select-option
- v-for="(item, i) in allFormComponent"
- :key="item.routeName"
- :value="item.routeName"
- >
- <span style="display: inline-block;width: 100%" :title=" item.text">{{ item.text}}</span>
- </a-select-option>
- </a-select>
- <!-- <a href="javascrip:void(0)" @click="viewForm">预览表单</a> -->
- </a-form-item>
- <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="图标">
- <a-upload
- name="avatar"
- list-type="picture-card"
- class="avatar-uploader"
- :show-upload-list="false"
- action="/jeecg-boot/sys/common/uploadFile"
- @change="imgHandleChange"
- >
- <img v-if="imageUrl" :src="imageUrl" alt="avatar" />
- <div v-else>
- <a-icon type="plus" />
- <div class="ant-upload-text">上传</div>
- </div>
- </a-upload>
- </a-form-item>
- <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="角色授权">
- <j-select-role
- placeholder="不选择则所有人可用"
- v-decorator="[ 'roles', {initialValue:editObj.roles, rules: []}]"
- />
- </a-form-item>
- <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="备注描述">
- <a-textarea
- v-decorator="[ 'description', {initialValue:editObj.description, rules: []}]"
- placeholder="备注描述"
- :autoSize="{ minRows: 3, maxRows: 5 }"
- />
- </a-form-item>
- </a-form>
- </a-modal>
- <!--节点设置-->
- <a-modal
- title="编辑流程节点"
- width="900px"
- :maskClosable="false"
- :confirmLoading="confirmLoading"
- :visible="showProcessNodeEdit"
- :footer="null"
- @cancel="closeNode"
- >
- <a-row>
- <a-col :md="4" :sm="4" style="border-right: 1px solid #999">
- <!-- 选择流程节点-->
- <a-steps direction="vertical" :current="current" size="small">
- <template v-for="item,i in nodeList" >
- <a-step
- style="cursor: pointer;"
- :title="item.title"
- :description="item.description"
- :status="i==current?'process':'wait'"
- @click="change_steps(item,i)"
- />
- </template>
- </a-steps>
- </a-col>
- <a-col :md="20" :sm="20">
- <a-alert message="温馨提示:若流程运行至未分配审批人员的审批节点时,流程将自动中断取消!" banner />
- <span></span>
- <a-form :form="nodeForm" v-if="showProcessNodeEdit">
- <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="节点名称">
- <span class="nodespan">{{editNode.title}}</span>
- </a-form-item>
- <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="节点类型">
- <span class="nodespan">{{dictNodeType[editNode.type]}}</span>
- </a-form-item>
- <a-alert v-if="editNode.type!=2&&!confirmLoading" message="温馨提示:若每步流程填写表单的内容不同则需要选择关联表单,相同则不需要选择!" banner /><br/>
- <a-form-item v-if="editNode.type!=2&&!confirmLoading" :label-col="labelCol" :wrapper-col="wrapperCol" label="关联表单">
- <a-select
- placeholder="请选择关联表单"
- v-model="spry.tbTableInfoId"
- >
- <a-select-option
- v-for="(item, i) in tableByBusinessTableList"
- :key="item.id"
- :value="item.id"
- >
- <span style="display: inline-block;width: 100%" :title="item.stepMemo">{{ item.stepMemo}}</span>
- </a-select-option>
- </a-select>
- </a-form-item>
- <a-alert type="info" message="每个节点设置,如有修改都请保存一次,跳转节点后数据不会自动保存!" banner />
- <br />
- <a-form-item
- :label-col="labelCol"
- :wrapper-col="wrapperCol"
- label="审批人员"
- v-show="editNode.type==1"
- >
- <a-checkbox-group @change="spryType" v-model="spryTypes">
- <!-- 0角色 1用户 2部门 3发起人 4发起人的部门负责人-->
- <a-checkbox value="0">根据角色选择</a-checkbox>
- <a-checkbox value="1">直接选择人员</a-checkbox>
- <a-checkbox value="2">部门负责人</a-checkbox>
- <a-checkbox value="3">
- 发起人
- <a-tooltip placement="topLeft" title="自动获取发起人">
- <a-icon type="exclamation-circle" />
- </a-tooltip>
- </a-checkbox>
- <a-checkbox value="4">
- 发起人的部门负责人
- <a-tooltip
- placement="topLeft"
- title="自动获取发起人所在部门的负责人,即其上级领导。(如果其本身就是部门负责人,则指向发起人自己。)"
- >
- <a-icon type="exclamation-circle" />
- </a-tooltip>
- </a-checkbox>
- <a-checkbox value="5">上级部门负责人</a-checkbox>
- </a-checkbox-group>
- </a-form-item>
- <!-- 0角色 1用户 2部门 3发起人 4发起人的部门负责人-->
- <a-form-item
- :label-col="labelCol"
- :wrapper-col="wrapperCol"
- label="选择角色"
- v-if="spryTypes.indexOf('0')>-1"
- >
- <j-select-role v-model="spry.roleIds" />
- </a-form-item>
- <a-form-item
- :label-col="labelCol"
- :wrapper-col="wrapperCol"
- label="选择人员"
- v-if="spryTypes.indexOf('1')>-1"
- >
- <!-- 通过部门选择用户控件 -->
- <j-select-user-by-dep v-model="spry.userIds" :multi="true"></j-select-user-by-dep>
- </a-form-item>
- <a-form-item
- :label-col="labelCol"
- :wrapper-col="wrapperCol"
- label="选择部门"
- v-if="spryTypes.indexOf('2')>-1"
- >
- <j-select-depart v-model="spry.departmentIds" :multi="true"></j-select-depart>
- </a-form-item>
- <!--btn-->
- <!-- :disabled="editNode.type==0||editNode.type==2||confirmLoading" -->
- <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
- <a-button
- @click="sprySubmit"
- type="primary"
- html-type="submit"
- :disabled="editNode.type==2||confirmLoading"
- >提交并保存</a-button>
- <a-button @click="closeNode" style="margin-left: 10px">关闭</a-button>
- </a-form-item>
- </a-form>
- </a-col>
- </a-row>
- </a-modal>
-
- <!--查看图片-->
- <a-modal
- :title="viewTitle"
- width="90%"
- :visible="viewImage"
- :footer="null"
- @cancel="viewImage = false"
- >
- <div style="min-height: 400px">
- <img :src="diagramUrl" :alt="viewTitle" />
- </div>
- </a-modal>
- <!-- 表单编辑器 -->
- <a-drawer
- title="编辑器"
- width="100%"
- style="top:0%;height: 100%;"
- :visible="editorVisible"
- @close="editFromClose"
- >
- <iframe :src="editorJumpUrl" width="100%" height="800" frameborder="0" scrolling="auto" id="iframename" name="iframename"></iframe>
- <div
- :style="{
- position: 'absolute',
- right: 0,
- bottom: 0,
- width: '100%',
- borderTop: '1px solid #e9e9e9',
- padding: '10px 16px',
- background: '#fff',
- textAlign: 'right',
- zIndex: 1,
- }"
- >
- <a-button :style="{ marginRight: '8px' }" @click="editFromClose">
- 关闭
- </a-button>
- </div>
- </a-drawer>
- <!--流程表单 预览-->
- <!-- <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="80%">
- <component :is="lcModa.formComponent" :disabled="true"></component>
- </a-modal>-->
- <a-modal
- :title="lcModa.title"
- v-model="lcModa.visible"
- :footer="null"
- :maskClosable="false"
- width="80%"
- >
- <component
- :disabled="lcModa.disabled"
- v-if="lcModa.visible"
- :is="lcModa.formComponent"
- :processData="lcModa.processData"
- :isNew="lcModa.isNew"
- @close="lcModa.visible=false,lcModa.disabled = false"
- ></component>
- </a-modal>
- </a-card>
- </template>
- <script>
- import { filterObj } from '@/utils/util'
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
- import JEllipsis from '@/components/jeecg/JEllipsis'
- import { deleteAction, getAction, downFile,postFormAction2 } from '@/api/manage'
- import pick from 'lodash.pick'
- import JTreeSelect from '@/components/jeecg/JTreeSelect'
- import { initDictOptions, filterDictText } from '@/components/dict/JDictSelectUtil'
- import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
- import JSelectRole from '@/components/jeecgbiz/JSelectRole'
- import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
- import {getEditorJumpUrl}from '../../../url.config'
- import { queryList,updateTbTableInfo } from '@/api/api'
- export default {
- name: 'ProcessModelList',
- mixins: [activitiMixin, JeecgListMixin],
- components: {
- JEllipsis,
- JSelectUserByDep,
- JSelectRole,
- JSelectDepart,
- JTreeSelect
- },
- data() {
- return {
- tableByBusinessTableList:[],//节点关联表单下拉集合
- imageUrl:"",
- viewImage: false,
- editorVisible:false,
- editorJumpUrl:"",
- viewTitle: '',
- diagramUrl: '',
- /*编辑流程*/
- editObj: {
- visible: false
- },
- editForm: this.$form.createForm(this),
- description: '已部署模型',
- // 查询条件
- queryParam: {
- createTimeRange: [],
- keyWord: ''
- },
- tabKey: '1',
- // 表头
- labelCol: {
- xs: { span: 4 },
- sm: { span: 4 }
- },
- wrapperCol: {
- xs: { span: 20 },
- sm: { span: 20 }
- },
- confirmLoading: false,
- current: 0,
- nodeForm: this.$form.createForm(this),
- dictOptions: [],
- nodeList: [],
- editNode: {},
- showProcessNodeEdit: false,
- dictNodeType: {
- '0': '开始节点',
- '1': '审批节点',
- '2': '结束节点'
- },
- spryTypes: [],
- url: {
- list: '/activiti_process/listData',
- img: '/activiti/models/export',
- updateStatus: '/activiti_process/updateStatus',
- delByIds: '/activiti_process/delByIds',
- convertToModel: '/activiti_process/convertToModel',
- updateInfo: '/activiti_process/updateInfo',
- updateInfo2: '/activiti_process/updateInfo2',
- getProcessNode: '/activiti_process/getProcessNode',
- editNodeUser: '/activiti_process/editNodeUser'
- },
- spry: {
- //选中的用户
- userIds: '',
- roleIds: '',
- departmentIds: '',
- chooseSponsor: false,
- chooseDepHeader: false,
- headSuperiorDepartment:false,
- tbTableInfoId:null
- },
- lcModa: {
- title: '',
- disabled: false,
- visible: false,
- formComponent: null,
- isNew: false
- },
- lcTypeF: [],
- dataList: [],
- allFormComponent2: []
- }
- },
- computed: {
- //可行性测试,根据文件路径动态加载组件
- LcDict: function() {
- var myComponent = () => import(`@/components/dict/JDictSelectTag`)
- return myComponent
- }
- },
- created() {
- // getAction("/actBusiness/getTableInfoList").then(res=>{
- // this.allFormComponent2=res.result;
- // })
- //获取关联表下拉数据
- this.getTableList()
- },
- methods: {
- initDictConfig() {
- //初始化字典 - 流程分类
- initDictOptions('bpm_process_type').then(res => {
- if (res.success) {
- var lcTypes = []
- this.dictOptions = res.result || []
- for (const dict of this.dictOptions) {
- lcTypes.push({ text: dict.text, value: dict.value })
- }
- this.lcTypeF = lcTypes
- console.log(lcTypes)
- }
- })
- },
- filterDictText(dictOptions, text) {
- if (dictOptions instanceof Array) {
- for (let dictItem of dictOptions) {
- if (text === dictItem.value) {
- return dictItem.text
- }
- }
- }
- return text
- },
- closeNode() {
- ;(this.showProcessNodeEdit = false), (this.current = 0), (this.spryTypes = []), (this.spry = {})
- },
- /*编辑流程节点*/
- change_steps(node, index) {
- this.spryTypes = []
- console.log('onChange:', node)
- this.current = index
- this.editNode = node
- /* 0角色 1用户 2部门 3发起人 4发起人的部门负责人 5上级部门负责人*/
- this.spry.headSuperiorDepartment=node.headSuperiorDepartment||false
- if(this.spry.headSuperiorDepartment) this.spryTypes.push('5')
- this.spry.chooseDepHeader = node.chooseDepHeader || false
- if (this.spry.chooseDepHeader) this.spryTypes.push('4')
- this.spry.chooseSponsor = node.chooseSponsor || false
- if (this.spry.chooseSponsor) this.spryTypes.push('3')
- var userIds = []
- for (const user of node.users || []) {
- userIds.push(user.username)
- }
- this.spry.userIds = userIds.join(',')
- if (userIds.length > 0) this.spryTypes.push('1')
- var roleIds = []
- for (const role of node.roles || []) {
- roleIds.push(role.roleCode)
- }
- this.spry.roleIds = roleIds.join(',')
- if (roleIds.length > 0) this.spryTypes.push('0')
- var departmentIds = []
- for (const department of node.departments || []) {
- departmentIds.push(department.id)
- }
- this.spry.departmentIds = departmentIds.join(',')
- if (departmentIds.length > 0) this.spryTypes.push('2')
- //关联表单
- var tbTableInfoId=null;
- if(node.tbTableInfoId){
- tbTableInfoId=node.tbTableInfoId
- }
- this.spry.tbTableInfoId=tbTableInfoId;
-
- console.log('回显this.spry', this.spry)
- },
- spryType(types) {
- /* 0角色 1用户 2部门 3发起人 4发起人的部门负责人*/
- // this.spryTypes = types;
- if (this.spryTypes.indexOf('0') == -1) this.spry.roleIds = ''
- if (this.spryTypes.indexOf('1') == -1) this.spry.userIds = ''
- if (this.spryTypes.indexOf('2') == -1) this.spry.departmentIds = ''
- //是否选中发起人
- this.spry.chooseSponsor = this.spryTypes.indexOf('3') > -1
- //是否选中发起人的部门领导
- this.spry.chooseDepHeader = this.spryTypes.indexOf('4') > -1
- //是否选中上级部门负责人
- this.spry.headSuperiorDepartment = this.spryTypes.indexOf('5') > -1
- console.log('this.spry', this.spry)
- },
- sprySubmit() {
- var _this = this
- //开始节点 选择初始提交表单
- if(this.editNode.type==0){
- let where={id:this.spry.tbTableInfoId,isInitial:"1"}
- updateTbTableInfo(where).then((res)=>{
- if(res.success){
- _this.$message.success('操作成功')
- }else{
- _this.$message.error('操作失败')
- }
- });
- }else{
- //修改关联表单信息
- // let where={id:this.spry.tbTableInfoId,isInitial:"1"}
- // updateTbTableInfo(where).then((res)=>{
- // if(res.success){
- // _this.$message.success('操作成功')
- // }else{
- // _this.$message.error('操作失败')
- // return;
- // }
- // });
- if (this.spryTypes.length == 0) {
- _this.$message.error('必须选择审批人!')
- return
- }
- _this.confirmLoading = true
- this.spry.nodeId = this.editNode.id
- this.postFormAction(_this.url.editNodeUser, this.spry)
- .then(res => {
- if (res.success) {
- _this.$message.success('操作成功')
- // _this.getData();
- } else {
- _this.$message.error(res.message)
- }
- })
- .finally(() => (_this.confirmLoading = false))
- }
- },
- getNodeData(row) {
- //查询节点关联表单下拉数据
- const where={businessTable:row.businessTable}
- queryList(where).then((res)=>{
- this.tableByBusinessTableList=res.result;
- })
- var _this = this
- _this
- .postFormAction(_this.url.getProcessNode, {
- id: row.id
- })
- .then(res => {
- if (res.success) {
- // 转换null为""
- _this.nodeList = res.result || []
- console.log('_this.nodeList', _this.nodeList)
- if (_this.nodeList.length > 0) {
- _this.editNode = _this.nodeList[0]
- _this.showProcessNodeEdit = true
- if(_this.nodeList[0].tbTableInfoId){
- this.spry.tbTableInfoId=_this.nodeList[0].tbTableInfoId;
- }
- }
- } else {
- _this.$message.error(res.message)
- }
- })
- },
- /*编辑流程信息*/
- edit(row) {
- //获取关联表下拉数据
- this.getTableList()
- this.editObj = Object.assign(this.editObj, row)
- this.imageUrl=this.editObj.iconAddress
- this.editObj.visible = true
- },
- editObjOk() {
- var _this = this
- this.editForm.validateFields((err, values) => {
- if (!err) {
- let formData = Object.assign(this.editObj, values)
- console.log('formData', formData)
- formData.iconAddress=this.imageUrl;
- this.confirmLoading = true
- postFormAction2(this.url.updateInfo2, formData)
- .then(res => {
- if (res.success) {
- _this.$message.success('操作成功')
- _this.loadData()
- _this.editObj.visible = false
- } else {
- _this.$message.error(res.message)
- }
- })
- .finally(() => (_this.confirmLoading = false))
- }
- })
- },
- change_routeName(event) {
- this.$nextTick(() => {
- let routeName = this.editForm.getFieldValue('routeName')
- console.log('routeName', routeName)
- var route = this.getFormComponent(routeName)
- this.editObj.businessTable = route.businessTable
- this.editObj.routeName = route.routeName
- console.log('this.editObj', this.editObj)
- })
- },
- viewForm(r) {
- // if (!routeName) routeName = this.editObj.routeName;
- // if (!routeName) {
- // this.$message.warning(
- // "请先选择表单!"
- // );
- // return;
- // }
- // let formComponent = this.getFormComponent(routeName);
- // this.lcModa.formComponent = formComponent.component;
- // this.lcModa.title = '流程表单预览:'+formComponent.text;
- // this.lcModa.visible = true;
- if (r.routeName.indexOf('外部表单') != -1) {
- alert('调用其他项目页面')
- } else if (r.routeName.indexOf('自定义') != -1) {
- //自定义表单展开
- this.lcModa.disabled = true
- let com = { component: () => import(`@/views/activiti/form/demoForm2`) }
- this.lcModa.formComponent = com.component
- this.lcModa.title = '流程表单预览'
- this.lcModa.isNew = true
- this.lcModa.processData = { businessTable: r.businessTable }
- this.lcModa.visible = true
- } else {
- //自带表单展开
- this.lcModa.disabled = true
- this.lcModa.formComponent = this.getFormComponent(r.routeName).component
- this.lcModa.title = '流程表单预览'
- this.lcModa.isNew = true
- this.lcModa.processData = r
- this.lcModa.visible = true
- }
- },
- convertToModel(row) {
- let that = this
- this.$confirm({
- title: '确认转化',
- content: '您确认要转化流程 ' + row.name + ' 为模型?',
- loading: true,
- onOk: () => {
- that.postFormAction(`${that.url.convertToModel}`, { id: row.id }).then(res => {
- if (res.success) {
- setTimeout(function() {
- that.$message.success('转化成功')
- }, 300)
- } else {
- that.$message.error(res.message)
- }
- })
- }
- })
- },
- remove(row) {
- var _this = this
- _this.$confirm({
- title: '确认删除',
- content: '您确认要删除流程 ' + row.name + ' ?',
- loading: true,
- onOk: () => {
- _this.postFormAction(_this.url.delByIds, { ids: row.id }).then(res => {
- if (res.success) {
- _this.$message.success('操作成功')
- _this.loadData()
- } else {
- _this.$message.error(res.message)
- }
- })
- }
- })
- },
- editStatus(status, row) {
- var _this = this
- let operation = ''
- if (status == 0) {
- operation = '不启用'
- } else {
- operation = '启用'
- }
- this.$confirm({
- title: '确认' + operation + '?',
- content: `您确认要${operation}流程${row.name}?`,
- onOk() {
- let params = {
- status: status,
- id: row.id
- }
- _this.postFormAction(_this.url.updateStatus, params).then(res => {
- if (res.success) {
- _this.$message.success('操作成功')
- _this.loadData()
- } else {
- _this.$message.error(res.message)
- }
- })
- },
- onCancel() {}
- })
- },
- /*查看流程图片*/
- showResource(row) {
- this.viewTitle = '流程图片预览(' + row.diagramName + ')'
- this.diagramUrl = `${this.doMian}${this.url.img}?id=${row.id}`
- this.viewImage = true
- },
- /*删除模型*/
- deletelc(y, row) {
- console.log(y, row)
- if (y) {
- getAction(this.url.delete + row.id).then(res => {
- if (res.success) {
- this.$message.success(res.message)
- } else {
- this.$message.error(res.message)
- }
- this.loadData()
- })
- }
- },
- handleTableChange(pagination, filters, sorter) {
- //分页、排序、筛选变化时触发
- //TODO 筛选
- if (Object.keys(sorter).length > 0) {
- this.isorter.column = sorter.field
- this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
- }
- this.ipagination = pagination
- console.log(pagination, filters, sorter)
- /*if (Object.keys(filters).length>0&&this.dataList.length>0){
- for (const filterField in filters) {
- let fiterVals = filters[filterField]||[];
- }
- }*/
- // this.loadData();
- },
- loadData(arg) {
- if (!this.url.list) {
- this.$message.error('请设置url.list属性!')
- return
- }
- //加载数据 若传入参数1则加载第一页的内容
- if (arg === 1) {
- this.ipagination.current = 1
- }
- var params = this.getQueryParams() //查询条件
- this.loading = true
- getAction(this.url.list, params).then(res => {
- if (res.success) {
- let records = res.result || []
- this.dataSource = records
- this.dataList = records
- this.ipagination.total = records.length
- }
- if (res.code === 510) {
- this.$message.warning(res.message)
- }
- this.loading = false
- })
- },
- getQueryParams() {
- var param = Object.assign({}, this.queryParam, this.isorter)
- delete param.createTimeRange // 时间参数不传递后台
- return filterObj(param)
- },
- // 重置
- searchReset() {
- var that = this
- var logType = that.queryParam.logType
- that.queryParam = {} //清空查询区域参数
- that.queryParam.logType = logType
- that.loadData(this.ipagination.current)
- },
- onDateChange: function(value, dateString) {
- console.log(dateString[0], dateString[1])
- this.queryParam.createTime_begin = dateString[0]
- this.queryParam.createTime_end = dateString[1]
- },
- onDateOk(value) {
- console.log(value)
- },
- filter_categoryId(v, r) {
- // console.log(v,r)
- return r.categoryId == v
- },
- editFormsOnline() {
- //在线编辑表单
- // window.location.href = 'http://localhost:8080/#/formDesign'
- // window.open('http://localhost:8080/#/formDesign', '_blank')
- // window.open('http://106.15.206.14:8089/#/formDesign', '_blank')//测试地址
- // window.open(getEditorJumpUrl()+'/#/formDesign', '_blank')
- this.editorVisible=true;
- this.editorJumpUrl=getEditorJumpUrl()+'/#/formDesign';
- },
- //编辑表单
- editFrom(r) {
- // window.open('http://localhost:8080/#/formDesign?tableName=' + r.businessTable, '_blank')
- // window.open('http://106.15.206.14:8089/#/formDesign?tableName='+r.businessTable, '_blank')//测试地址
- this.editorVisible=true;
- // window.open(getEditorJumpUrl()+'/#/formDesign?tableName='+r.businessTable, '_blank')//测试地址
- this.editorJumpUrl=getEditorJumpUrl()+'/#/formDesign?tableName='+r.businessTable;
- },
- //编辑表单弹框关闭按钮
- editFromClose(){
- this.editorVisible=false;
- this.editorJumpUrl="";
- },
- imgHandleChange(info){
- if (info.file.status === 'done') {
- // Get this url from response in real world.
- getBase64(info.file.originFileObj, imageUrl => {
- this.imageUrl = imageUrl;
- this.editObj.iconAddress=imageUrl
- console.log(this.editObj.iconAddress)
- this.loading = false;
- });
- }
-
- }
- }
- }
- function getBase64(img, callback) {
- const reader = new FileReader();
- reader.addEventListener('load', () => callback(reader.result));
- reader.readAsDataURL(img);
- }
- </script>
- <style scoped>
- @import '~@assets/less/common.less';
- .nodespan {
- color: #999;
- }
- .ant-checkbox-wrapper + .ant-checkbox-wrapper {
- margin-left: 0;
- margin-right: 8px;
- }
- </style>
|