| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535 |
- <template>
- <div class="ele-body">
- <el-card
- class="card_box"
- :body-style="{
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'flex-start'
- }"
- shadow="never"
- >
- <ele-split-layout
- width="252px"
- allow-collapse
- :right-style="{ overflow: 'hidden' }"
- >
- <div class="ele-border-lighter split-layout-right-content">
- <!-- 动态表单配置-->
- <div class="content-box">
- <div
- v-for="category in Object.keys(templateList)"
- :key="category"
- class="category_box"
- >
- <div class="category_box_title">{{
- getDictV('collaborative_type', category)
- }}</div>
- <div class="category_box_content">
- <div
- v-for="v in templateList[category]"
- :key="v.id"
- class="category_content"
- :title="v.name"
- @click="handleStartProcess(v)"
- >
- <svg-icon
- style="width: 1.5em; height: 1.5em"
- :icon-class="v.icon"
- className="svg-icon-set"
- ></svg-icon>
- <span>
- {{
- v.name.length > 3
- ? v.name[0] + v.name[1] + v.name[2] + '...'
- : v.name
- }}
- </span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 表格 -->
- <template v-slot:content>
- <div class="tab-box el-form-box">
- <el-tabs
- type="border-card"
- @tab-click="tabClick"
- v-model="activeName"
- >
- <el-tab-pane label="个人记录" name="user">
- <ele-pro-table
- ref="table"
- height="calc(100vh - 380px)"
- :columns="columns"
- :datasource="datasource"
- :init-load="false"
- @columns-change="handleColumnChange"
- :cache-key="cacheKeyUrl"
- :page-size="20"
- >
- <template v-slot:toolbar="{ row }">
- <div class="filter-container">
- <el-form
- class="ele-form-search"
- @keyup.enter.native="reload"
- @submit.native.prevent
- >
- <el-row
- :gutter="15"
- style="display: flex; align-items: center"
- >
- <el-col v-bind="{ span: 4 }">
- <el-form-item label="分类:" label-width="60px">
- <el-select v-model="params.dictType">
- <el-option
- v-for="(item, index) in dictList[
- 'collaborative_type'
- ]"
- :key="index"
- :value="item.value"
- :label="item.label"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 4 }">
- <el-form-item label="单据:" label-width="60px">
- <el-select v-model="params.formId">
- <el-option
- v-for="(item, index) in templateList[
- params.dictType
- ]"
- :key="index"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 4 }">
- <el-form-item
- label="结果:"
- prop="result"
- label-width="60px"
- >
- <!-- <el-select
- v-model="params.status"
- placeholder="请选择状态"
- clearable
- >
- <el-option
- v-for="dict in statusList"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select> -->
- <DictSelection
- dictName="流程实例的结果"
- clearable
- v-model="params.result"
- >
- </DictSelection>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 10 }">
- <el-form-item
- label="创建时间:"
- prop="createTime1"
- label-width="90px"
- >
- <el-date-picker
- v-model="createTime1"
- style="width: 100%"
- value-format="yyyy-MM-dd HH:mm:ss"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :default-time="['00:00:00', '23:59:59']"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- </template>
- <template v-slot:toolkit="{ row }">
- <div class="filter-container">
- <div class="ele-form-actions">
- <el-button
- type="primary"
- icon="el-icon-search"
- class="ele-btn-icon"
- @click="reload"
- >
- 查询
- </el-button>
- <el-button @click="reset">重置</el-button>
- </div>
- </div>
- </template>
- <template v-slot:formName="{ row }">
- <el-link
- type="primary"
- :underline="false"
- @click="handleDetail(row)"
- >
- {{ row.formName }}
- </el-link>
- </template>
- <template v-slot:result="{ row }">
- <el-tag
- size="medium"
- :type="
- getTimelineItemType(
- getDictValue('流程实例的结果', row.result)
- )
- "
- >
- {{ getDictValue('流程实例的结果', row.result) }}
- </el-tag>
- </template>
- <template v-slot:dictType="{ row }">
- {{ getDictV('collaborative_type', row.dictType) }}
- </template>
- <template v-slot:durationInMillis="{ row }">
- {{ getDateTime(row.durationInMillis) }}
- </template>
- <template v-slot:name="{ row }">
- <el-link
- type="primary"
- :underline="false"
- @click="handleDetail(row)"
- >
- {{ row.name }}
- </el-link>
- </template>
- <template
- v-if="formColumnList.length"
- v-for="(item, index) in formColumnList"
- v-slot:[item.model]="{ row }"
- >
- <div v-if="item.type == 'imgupload'">
- <el-image
- v-if="row[item.model].length"
- style="width: 100px; height: 100px"
- :src="row[item.model][0].url"
- :preview-src-list="row[item.model].map((i) => i.url)"
- >
- </el-image>
- </div>
- <div v-else-if="item.type == 'fileupload'">
- <!-- <el-button
- type="text"
- v-if="row[item.model]?.length"
- @click="getFiles(row[item.model])"
- >下载
- </el-button> -->
- <fileMain
- v-if="row[item.model]?.length"
- type="view"
- v-model="row[item.model]"
- ></fileMain>
- </div>
- <div v-else-if="item.type == 'userSelect'">
- <el-link
- type="primary"
- :underline="false"
- @click="handleDetail(row)"
- >
- {{ getUserName(row[item.model]) }}
- </el-link>
- </div>
- <div v-else-if="item.type == 'deptAndUserCascader'">
- {{ getDeptAndUserName(row[item.model]) }}
- </div>
- <div v-else-if="item.type == 'deptCascader'">
- {{ getDeptName(row[item.model]) }}
- </div>
- <div v-else>
- {{ formatValue(row[item.model]) }}
- </div>
- </template>
- <!-- 操作列 -->
- <!-- <template v-slot:action="{ row }">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleAudit(row)"
- >详情
- </el-button>
- </template> -->
- </ele-pro-table>
- </el-tab-pane>
- <el-tab-pane label="部门记录" name="dept" v-if="$hasPermission('wt:collaborative:department')">
- <ele-pro-table
- ref="deptTable"
- :columns="deptColumns"
- :datasource="deptDatasource"
- cache-key="deptDatasource"
- :toolkit="[]"
- height="calc(100vh - 450px)"
- :init-load="false"
- >
- <template v-slot:toolbar="{ row }">
- <div class="filter-container">
- <el-form
- class="ele-form-search"
- @keyup.enter.native="deptReload"
- @submit.native.prevent
- >
- <el-row
- :gutter="15"
- style="display: flex; align-items: center"
- >
- <el-col v-bind="{ span: 4 }">
- <el-form-item label="分类:" label-width="60px">
- <el-select v-model="params.dictType">
- <el-option
- v-for="(item, index) in dictList[
- 'collaborative_type'
- ]"
- :key="index"
- :value="item.value"
- :label="item.label"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 4 }">
- <el-form-item label="单据:" label-width="60px">
- <el-select v-model="params.formId">
- <el-option
- v-for="(item, index) in defaultTemplateList"
- :key="index"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 4 }">
- <el-form-item
- label="结果:"
- prop="result"
- label-width="60px"
- >
- <!-- <el-select
- v-model="params.status"
- placeholder="请选择状态"
- clearable
- >
- <el-option
- v-for="dict in statusList"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select> -->
- <DictSelection
- dictName="流程实例的结果"
- clearable
- v-model="params.result"
- >
- </DictSelection>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 4 }">
- <el-form-item
- label="发起人:"
- prop="startUserName"
- label-width="70px"
- >
- <el-input
- v-model="params.startUserName"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 6 }">
- <el-form-item
- label="创建时间:"
- prop="createTime1"
- label-width="90px"
- >
- <el-date-picker
- v-model="createTime1"
- style="width: 100%"
- value-format="yyyy-MM-dd HH:mm:ss"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :default-time="['00:00:00', '23:59:59']"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- </template>
- <template v-slot:toolkit="{ row }">
- <div class="filter-container">
- <div class="ele-form-actions">
- <el-button
- type="primary"
- icon="el-icon-search"
- class="ele-btn-icon"
- @click="deptReload"
- >
- 查询
- </el-button>
- <el-button @click="deptReset">重置</el-button>
- </div>
- </div>
- </template>
- <template v-slot:dictType="{ row }">
- {{ getDictV('collaborative_type', row.dictType) }}
- </template>
- <template
- v-if="formColumnList.length"
- v-for="(item, index) in formColumnList"
- v-slot:[item.model]="{ row }"
- >
- <div v-if="item.type == 'imgupload'">
- <el-image
- v-if="row[item.model].length"
- style="width: 100px; height: 100px"
- :src="row[item.model][0].url"
- :preview-src-list="row[item.model].map((i) => i.url)"
- >
- </el-image>
- </div>
- <div v-else-if="item.type == 'fileupload'">
- <!-- <el-button
- type="text"
- v-if="row[item.model]?.length"
- @click="getFiles(row[item.model])"
- >下载
- </el-button> -->
- <fileMain
- v-if="row[item.model]?.length"
- type="view"
- v-model="row[item.model]"
- ></fileMain>
- </div>
- <div v-else-if="item.type == 'userSelect'">
- {{ getUserName(row[item.model]) }}
- </div>
- <div v-else-if="item.type == 'deptAndUserCascader'">
- {{ getDeptAndUserName(row[item.model]) }}
- </div>
- <div v-else-if="item.type == 'deptCascader'">
- {{ getDeptName(row[item.model]) }}
- </div>
- <div v-else>
- {{ formatValue(row[item.model]) }}
- </div>
- </template>
- <template v-slot:result="{ row }">
- <el-tag
- size="medium"
- :type="
- getTimelineItemType(
- getDictValue('流程实例的结果', row.result)
- )
- "
- >
- {{ getDictValue('流程实例的结果', row.result) }}
- </el-tag>
- </template>
- <template v-slot:durationInMillis="{ row }">
- {{ getDateTime(row.durationInMillis) }}
- </template>
- <template v-slot:name="{ row }">
- <el-link
- type="primary"
- :underline="false"
- @click="handleDetail(row)"
- >
- {{ row.name }}
- </el-link>
- </template>
- <!-- 操作列 -->
- <!-- <template v-slot:action="{ row }">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleAudit(row)"
- >详情
- </el-button>
- </template> -->
- </ele-pro-table>
- </el-tab-pane>
- <el-tab-pane label="通知我的记录" name="notice">
- <ele-pro-table
- ref="noticeTable"
- :columns="deptColumns"
- :datasource="noticeDatasource"
- cache-key="noticeDatasource"
- height="calc(100vh - 450px)"
- :toolkit="[]"
- :init-load="false"
- >
- <template v-slot:toolbar="{ row }">
- <div class="filter-container">
- <el-form
- class="ele-form-search"
- @keyup.enter.native="noticeReload"
- @submit.native.prevent
- >
- <el-row
- :gutter="15"
- style="display: flex; align-items: center"
- >
- <el-col v-bind="{ span: 4 }">
- <el-form-item label="单据:" label-width="60px">
- <el-select v-model="params.dictType">
- <el-option
- v-for="(item, index) in dictList[
- 'collaborative_type'
- ]"
- :key="index"
- :value="item.value"
- :label="item.label"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 4 }">
- <el-form-item label="分类:" label-width="60px">
- <el-select v-model="params.formId">
- <el-option
- v-for="(item, index) in defaultTemplateList"
- :key="index"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 4 }">
- <el-form-item
- label="结果:"
- prop="result"
- label-width="60px"
- >
- <!-- <el-select
- v-model="params.status"
- placeholder="请选择状态"
- clearable
- >
- <el-option
- v-for="dict in statusList"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select> -->
- <DictSelection
- dictName="流程实例的结果"
- clearable
- v-model="params.result"
- >
- </DictSelection>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 4 }">
- <el-form-item
- label="发起人:"
- prop="startUserName"
- label-width="70px"
- >
- <el-input
- v-model="params.startUserName"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 6 }">
- <el-form-item
- label="创建时间:"
- prop="createTime1"
- label-width="90px"
- >
- <el-date-picker
- v-model="createTime1"
- style="width: 100%"
- value-format="yyyy-MM-dd HH:mm:ss"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :default-time="['00:00:00', '23:59:59']"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- </template>
- <template v-slot:toolkit="{ row }">
- <div class="filter-container">
- <div class="ele-form-actions">
- <el-button
- type="primary"
- icon="el-icon-search"
- class="ele-btn-icon"
- @click="noticeReload"
- >
- 查询
- </el-button>
- <el-button @click="noticeReset">重置</el-button>
- </div>
- </div>
- </template>
- <template v-slot:dictType="{ row }">
- {{ getDictV('collaborative_type', row.dictType) }}
- </template>
- <template
- v-if="formColumnList.length"
- v-for="(item, index) in formColumnList"
- v-slot:[item.model]="{ row }"
- >
- <div v-if="item.type == 'imgupload'">
- <el-image
- v-if="row[item.model].length"
- style="width: 100px; height: 100px"
- :src="row[item.model][0].url"
- :preview-src-list="row[item.model].map((i) => i.url)"
- >
- </el-image>
- </div>
- <div v-else-if="item.type == 'fileupload'">
- <!-- <el-button
- type="text"
- v-if="row[item.model]?.length"
- @click="getFiles(row[item.model])"
- >下载
- </el-button> -->
- <fileMain
- v-if="row[item.model]?.length"
- type="view"
- v-model="row[item.model]"
- ></fileMain>
- </div>
- <div v-else-if="item.type == 'userSelect'">
- {{ getUserName(row[item.model]) }}
- </div>
- <div v-else-if="item.type == 'deptAndUserCascader'">
- {{ getDeptAndUserName(row[item.model]) }}
- </div>
- <div v-else-if="item.type == 'deptCascader'">
- {{ getDeptName(row[item.model]) }}
- </div>
- <div v-else>
- {{ formatValue(row[item.model]) }}
- </div>
- </template>
- <template v-slot:result="{ row }">
- <el-tag
- size="medium"
- :type="
- getTimelineItemType(
- getDictValue('流程实例的结果', row.result)
- )
- "
- >
- {{ getDictValue('流程实例的结果', row.result) }}
- </el-tag>
- </template>
- <template v-slot:durationInMillis="{ row }">
- {{ getDateTime(row.durationInMillis) }}
- </template>
- <template v-slot:name="{ row }">
- <el-link
- type="primary"
- :underline="false"
- @click="handleDetail(row)"
- >
- {{ row.name }}
- </el-link>
- </template>
- <!-- 操作列 -->
- <!-- <template v-slot:action="{ row }">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleAudit(row)"
- >详情
- </el-button>
- </template> -->
- </ele-pro-table>
- </el-tab-pane>
- <el-tab-pane label="全部记录" name="all" v-if="$hasPermission('wt:collaborative:all')">
- <ele-pro-table
- ref="allTable"
- :columns="deptColumns"
- :datasource="allDatasource"
- cache-key="allDatasource"
- :toolkit="[]"
- height="calc(100vh - 450px)"
- :init-load="false"
- >
- <template v-slot:toolbar="{ row }">
- <div class="filter-container">
- <el-form
- class="ele-form-search"
- @keyup.enter.native="allReload"
- @submit.native.prevent
- >
- <el-row
- :gutter="15"
- style="display: flex; align-items: center"
- >
- <el-col v-bind="{ span: 4 }">
- <el-form-item label="分类:" label-width="60px">
- <el-select v-model="params.dictType">
- <el-option
- v-for="(item, index) in dictList[
- 'collaborative_type'
- ]"
- :key="index"
- :value="item.value"
- :label="item.label"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 4 }">
- <el-form-item label="单据:" label-width="60px">
- <el-select v-model="params.formId">
- <el-option
- v-for="(item, index) in defaultTemplateList"
- :key="index"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 4 }">
- <el-form-item
- label="结果:"
- prop="result"
- label-width="60px"
- >
- <DictSelection
- dictName="流程实例的结果"
- clearable
- v-model="params.result"
- >
- </DictSelection>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 4 }">
- <el-form-item
- label="发起人:"
- prop="startUserName"
- label-width="70px"
- >
- <el-input
- v-model="params.startUserName"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col v-bind="{ span: 6 }">
- <el-form-item
- label="创建时间:"
- prop="createTime1"
- label-width="90px"
- >
- <el-date-picker
- v-model="createTime1"
- style="width: 100%"
- value-format="yyyy-MM-dd HH:mm:ss"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :default-time="['00:00:00', '23:59:59']"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- </template>
- <template v-slot:toolkit="{ row }">
- <div class="filter-container">
- <div class="ele-form-actions">
- <el-button
- type="primary"
- icon="el-icon-search"
- class="ele-btn-icon"
- @click="allReload"
- >
- 查询
- </el-button>
- <el-button @click="allReset">重置</el-button>
- </div>
- </div>
- </template>
- <template v-slot:dictType="{ row }">
- {{ getDictV('collaborative_type', row.dictType) }}
- </template>
- <template
- v-if="formColumnList.length"
- v-for="(item, index) in formColumnList"
- v-slot:[item.model]="{ row }"
- >
- <div v-if="item.type == 'imgupload'">
- <el-image
- v-if="row[item.model].length"
- style="width: 100px; height: 100px"
- :src="row[item.model][0].url"
- :preview-src-list="row[item.model].map((i) => i.url)"
- >
- </el-image>
- </div>
- <div v-else-if="item.type == 'fileupload'">
- <!-- <el-button
- type="text"
- v-if="row[item.model]?.length"
- @click="getFiles(row[item.model])"
- >下载
- </el-button> -->
- <fileMain
- v-if="row[item.model]?.length"
- type="view"
- v-model="row[item.model]"
- ></fileMain>
- </div>
- <div v-else-if="item.type == 'userSelect'">
- {{ getUserName(row[item.model]) }}
- </div>
- <div v-else-if="item.type == 'deptAndUserCascader'">
- {{ getDeptAndUserName(row[item.model]) }}
- </div>
- <div v-else-if="item.type == 'deptCascader'">
- {{ getDeptName(row[item.model]) }}
- </div>
- <div v-else>
- {{ formatValue(row[item.model]) }}
- </div>
- </template>
- <template v-slot:result="{ row }">
- <el-tag
- size="medium"
- :type="
- getTimelineItemType(
- getDictValue('流程实例的结果', row.result)
- )
- "
- >
- {{ getDictValue('流程实例的结果', row.result) }}
- </el-tag>
- </template>
- <template v-slot:durationInMillis="{ row }">
- {{ getDateTime(row.durationInMillis) }}
- </template>
- <template v-slot:name="{ row }">
- <el-link
- type="primary"
- :underline="false"
- @click="handleDetail(row)"
- >
- {{ row.name }}
- </el-link>
- </template>
- </ele-pro-table>
- </el-tab-pane>
- </el-tabs>
- </div>
- </template>
- </ele-split-layout>
- </el-card>
- <process-submit-dialog
- :process-submit-dialog-flag.sync="processSubmitDialogFlag"
- v-if="processSubmitDialogFlag"
- ref="processSubmitDialogRef"
- @reload="reload"
- ></process-submit-dialog>
- <detail ref="detailRef"></detail>
- <formDetail
- v-if="formDetailDialogFlag"
- :view="true"
- ref="formDetailDialogRef"
- :form-detail-dialog-flag.sync="formDetailDialogFlag"
- ></formDetail>
- </div>
- </template>
- <script>
- import {
- getBpmCustomFormList,
- getProcessInstanceDeptPage,
- getProcessInstanceNoticePage,
- getProcessInstancePage,
- getProcessInstanceAllPage
- } from '@/api/bpm/task';
- import { getDate } from '@/utils/dateUtils';
- import dictMixins from '@/mixins/dictMixins';
- import detail from '@/views/bpm/processInstance/detail.vue';
- import formDetail from './detail.vue';
- import { getByCode } from '@/api/system/dictionary-data';
- import { getFile } from '@/api/system/file';
- import { getUserPage } from '@/api/tickets';
- import { listOrganizations } from '@/api/system/organization';
- import tabMixins from '@/mixins/tableColumnsMixin';
- // 默认表单数据
- const defaultParams = {
- dictType: '',
- status: '',
- name: '',
- formId: ''
- };
- export default {
- name: 'index',
- components: {
- detail,
- formDetail
- },
- mixins: [dictMixins, tabMixins],
- data() {
- return {
- cacheKeyUrl: 'wt-eaf1548b-collaborative',
- configFormDialogFlag: false,
- processSubmitDialogFlag: false,
- formDetailDialogFlag: false,
- templateList: {},
- dictList: {},
- defaultTemplateList: [],
- userList: [],
- deptList: [],
- params: { ...defaultParams },
- statusList: [],
- formColumnList: [],
- createTime1: [],
- // 个人 / 部门 / 通知我的
- activeName: 'user'
- };
- },
- computed: {
- // 是否开启响应式布局
- styleResponsive() {
- return this.$store.state.theme.styleResponsive;
- },
- columns() {
- let list = this.formColumnList.filter(item => item.name && item.name != '自定义区域').map((item) => {
- return {
- prop: item.model,
- label: item.name,
- align: 'center',
- slot: item.model,
- showOverflowTooltip: true,
- minWidth: 120
- };
- });
- return [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'dictType',
- label: '分类',
- align: 'center',
- slot: 'dictType',
- showOverflowTooltip: true,
- minWidth: 70
- },
- {
- prop: 'formName',
- label: '单据',
- align: 'center',
- slot: 'formName',
- showOverflowTooltip: true,
- minWidth: 70
- },
- // {
- // prop: 'name',
- // label: '名称',
- // align: 'center',
- // slot: 'name',
- // showOverflowTooltip: true,
- // minWidth: 80
- // },
- ...list,
- {
- prop: 'result',
- slot: 'result',
- label: '结果',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 80
- },
- {
- prop: 'endTime',
- label: '审批时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 120
- },
- {
- prop: 'createTime',
- label: '创建时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 120
- },
- // {
- // prop: 'durationInMillis',
- // slot: 'durationInMillis',
- // label: '耗时',
- // align: 'center',
- // showOverflowTooltip: true,
- // minWidth: 130
- // },
- {
- columnKey: 'action',
- label: '操作',
- width: 100,
- align: 'center',
- resizable: false,
- slot: 'action',
- showOverflowTooltip: true,
- fixed: 'right'
- }
- ];
- },
- deptColumns() {
- let list = this.formColumnList.filter(item => item.name && item.name != '自定义区域').map((item) => {
- return {
- prop: item.model,
- label: item.name,
- align: 'center',
- slot: item.model,
- showOverflowTooltip: true,
- minWidth: 120
- };
- });
- return [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'dictType',
- label: '分类',
- align: 'center',
- slot: 'dictType',
- showOverflowTooltip: true,
- minWidth: 70
- },
- {
- prop: 'formName',
- label: '单据',
- align: 'center',
- slot: 'formName',
- showOverflowTooltip: true,
- minWidth: 70
- },
- {
- prop: 'name',
- label: '名称',
- align: 'center',
- slot: 'name',
- showOverflowTooltip: true,
- minWidth: 150
- },
- {
- prop: 'startUserName',
- label: '发起人',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 180
- },
- ...list,
- {
- prop: 'result',
- slot: 'result',
- label: '结果',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 100
- },
- {
- prop: 'endTime',
- label: '审批时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 180
- },
- {
- prop: 'createTime',
- label: '创建时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 180
- }
- // {
- // prop: 'durationInMillis',
- // slot: 'durationInMillis',
- // label: '耗时',
- // align: 'center',
- // showOverflowTooltip: true,
- // minWidth: 130
- // },
- // {
- // columnKey: 'action',
- // label: '操作',
- // width: 230,
- // align: 'center',
- // resizable: false,
- // slot: 'action',
- // showOverflowTooltip: true,
- // fixed: 'right'
- // }
- ];
- },
- getUserName() {
- return (id) => {
- if (!id) return '';
- let find = this.userList.find((item) => item.id == id) || {};
- return find.name;
- };
- },
- getDeptAndUserName() {
- return (id = []) => {
- if (!id.length) return '';
- id = Array.isArray(id) ? id : [id];
- let find =
- this.userList.find((item) => item.id == id[id.length - 1]) || {};
- return find.name;
- };
- },
- getDeptName() {
- return (id = []) => {
- if (!id.length) return '';
- id = Array.isArray(id) ? id : [id];
- let find =
- this.deptList.find((item) => item.id == id[id.length - 1]) || {};
- return find.name;
- };
- }
- },
- watch: {
- 'params.formId': {
- handler(val) {
- this.allReload();
- this.reload();
- this.deptReload();
- this.noticeReload();
- }
- },
- 'params.dictType': {
- handler(val) {
- this.params.formId = this.templateList[val][0].id;
- this.allReload();
- this.reload();
- this.deptReload();
- this.noticeReload();
- }
- }
- },
- async created() {
- await this.getDictList('collaborative_type');
- await this.getTemplateList();
- await this.getUserList();
- await this.getDeptList();
- console.log(this.$hasPermission('wt:collaborative:all'))
- },
- methods: {
- formatValue(value) {
- if (value === null || value === undefined) {
- return ''; // 空值处理
- }
- if (typeof value === 'object' && value !== null) {
- if ('id' in value && 'code' in value && 'name' in value) {
- return value.code;
- } else {
- return JSON.stringify(value, null, 2);
- }
- }
- return value;
- },
- getDictV(code, val) {
- if (!this.dictList[code]) return '';
- return this.dictList[code].find((item) => item.value == val)?.label;
- },
- async getDictList(code) {
- let { data: res } = await getByCode(code);
- this.dictList[code] = res.map((item) => {
- let values = Object.keys(item);
- return {
- value: values[0],
- label: item[values[0]]
- };
- });
- },
- //获取人员数据
- async getUserList() {
- let params = { pageNum: 1, size: -1 };
- let { list } = await getUserPage(params);
- this.userList = list;
- },
- //获取部门数据
- async getDeptList() {
- this.deptList = await listOrganizations();
- },
- getFiles(row = []) {
- row.forEach((item) => {
- getFile({ objectName: item.storePath }, item.name);
- });
- },
- async getTemplateList() {
- this.defaultTemplateList = await getBpmCustomFormList({ status: 1 });
- this.templateList = _.groupBy(this.defaultTemplateList, 'dictType');
- this.params.dictType = this.dictList['collaborative_type'][0].value;
- this.params.formId = this.defaultTemplateList[0]?.id;
- let makingJson =
- JSON.parse(this.defaultTemplateList[0].formJson.makingJson) || {};
- console.log('makingJson~~~', makingJson);
- this.formColumnList = makingJson.list;
- console.log(this.formColumnList);
- },
- handleStartProcess(i) {
- this.processSubmitDialogFlag = true;
- this.$nextTick(() => {
- this.$refs.processSubmitDialogRef.init(i);
- });
- },
- /* 表格数据源 */
- async allDatasource({ page, limit, where, order }) {
- let [createTimeBegin, createTimeEnd] = this.createTime1 || [];
- let data = await getProcessInstanceAllPage({
- pageNo: page,
- pageSize: limit,
- ...this.params,
- processType: '1',
- createTimeBegin,
- createTimeEnd
- });
- // data = data.list.map((item) => {
- // return {
- // ...item,
- // ...item.valueJson
- // };
- // });
- return {
- count: data.count,
- list: data.list.map((item) => {
- return {
- ...item,
- ...item.valueJson
- };
- })
- };
- },
- /* 刷新表格 */
- allReload(where) {
- let find =
- this.defaultTemplateList.find(
- (item) => item.id == this.params.formId
- ) || {};
- let makingJson = JSON.parse(find.formJson.makingJson) || {};
- this.formColumnList = makingJson.list;
- this.$refs.allTable.reload({ page: 1, where });
- },
- /* 重置 */
- allReset() {
- this.params = { ...defaultParams };
- this.createTime1 = [];
- this.params.formId = this.defaultTemplateList[0]?.id;
- this.params.dictType = this.dictList['collaborative_type'][0].value;
- this.allReload();
- },
- /* 表格数据源 */
- async datasource({ page, limit, where, order }) {
- let [createTimeBegin, createTimeEnd] = this.createTime1 || [];
- let data = await getProcessInstancePage({
- pageNo: page,
- pageSize: limit,
- ...this.params,
- processType: '1',
- createTimeBegin,
- createTimeEnd
- });
- data = data.list.map((item) => {
- return {
- ...item,
- ...item.valueJson
- };
- });
- return data;
- },
- /* 刷新表格 */
- reload(where) {
- let find =
- this.defaultTemplateList.find(
- (item) => item.id == this.params.formId
- ) || {};
- let makingJson = JSON.parse(find.formJson.makingJson) || {};
- this.formColumnList = makingJson.list;
- this.$refs.table.reload({ page: 1, where });
- this.$refs.table.reRenderTable();
- },
- /* 重置 */
- reset() {
- this.params = { ...defaultParams };
- this.createTime1 = [];
- this.params.dictType = this.dictList['collaborative_type'][0].value;
- this.params.formId = this.templateList[this.params.dictType][0]?.id;
- this.reload();
- },
- /* 表格数据源 */
- async deptDatasource({ page, limit, where, order }) {
- let [createTimeBegin, createTimeEnd] = this.createTime1 || [];
- let data = await getProcessInstanceDeptPage({
- pageNo: page,
- pageSize: limit,
- ...this.params,
- processType: '1',
- createTimeBegin,
- createTimeEnd
- });
- data = data.list.map((item) => {
- return {
- ...item,
- ...item.valueJson
- };
- });
- return data;
- },
- /* 刷新表格 */
- deptReload(where) {
- let find =
- this.defaultTemplateList.find(
- (item) => item.id == this.params.formId
- ) || {};
- let makingJson = JSON.parse(find.formJson.makingJson) || {};
- this.formColumnList = makingJson.list;
- this.$refs.deptTable.reload({ page: 1, where });
- },
- /* 重置 */
- deptReset() {
- this.params = { ...defaultParams };
- this.createTime1 = [];
- this.params.formId = this.defaultTemplateList[0]?.id;
- this.params.dictType = this.dictList['collaborative_type'][0].value;
- this.deptReload();
- },
- /* 表格数据源 */
- async noticeDatasource({ page, limit, where, order }) {
- let [createTimeBegin, createTimeEnd] = this.createTime1 || [];
- let data = await getProcessInstanceNoticePage({
- pageNo: page,
- pageSize: limit,
- ...this.params,
- processType: '1',
- createTimeBegin,
- createTimeEnd
- });
- data = data.list.map((item) => {
- return {
- ...item,
- ...item.valueJson
- };
- });
- return data;
- },
- /* 刷新表格 */
- noticeReload(where) {
- let find =
- this.defaultTemplateList.find(
- (item) => item.id == this.params.formId
- ) || {};
- let makingJson = JSON.parse(find.formJson.makingJson) || {};
- this.formColumnList = makingJson.list;
- this.$refs.noticeTable.reload({ page: 1, where });
- },
- /* 重置 */
- noticeReset() {
- this.params = { ...defaultParams };
- this.createTime1 = [];
- this.params.formId = this.defaultTemplateList[0]?.id;
- this.params.dictType = this.dictList['collaborative_type'][0].value;
- this.noticeReload();
- },
- /** */
- handleAudit(row) {
- this.$refs.detailRef.open(row.id);
- },
- /** */
- handleDetail(row) {
- this.formDetailDialogFlag = true;
- this.$nextTick(() => {
- this.$refs.formDetailDialogRef.open(row);
- });
- },
- getTimelineItemType(result) {
- if (result === '通过') {
- return 'success';
- }
- if (result === '不通过') {
- return 'danger';
- }
- if (result === '取消') {
- return 'info';
- }
- if (result === '处理中') {
- return 'warning';
- }
- return '';
- },
- getDateTime(ms) {
- return getDate(ms);
- },
- tabClick() {
- if (this.activeName == 'all') {
- this.allReset();
- } else if (this.activeName == 'user') {
- this.reset();
- } else if (this.activeName == 'dept') {
- this.deptReset();
- } else if (this.activeName == 'notice') {
- this.noticeReset();
- }
- }
- }
- };
- </script>
- <style scoped lang="scss">
- .ele-body {
- padding: 15px;
- }
- .ele-split-panel {
- width: 100%;
- }
- .content-box {
- width: 100%;
- //max-width: 273px;
- //min-width: 90px;
- // margin-right: 10px;
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- //justify-content: space-between;
- .category_box {
- border-left: 1px solid #e1e1e1;
- border-bottom: 1px solid #e1e1e1;
- border-radius: 1px;
- // flex: 1 0 25%;
- margin-top: 5px;
- overflow: auto;
- width: 100%;
- .category_box_title {
- font-size: 14px;
- font-weight: bold;
- color: #fff8f8;
- height: 39px;
- display: flex;
- padding: 5px 20px;
- align-items: center;
- background: #1890ffd6;
- border-bottom: 1px solid #e1e1e1;
- }
- .category_box_content {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- // height: 60px;
- overflow: auto;
- .category_content {
- min-width: 33%;
- min-height: 60px;
- //flex: 1 1 0;
- display: flex;
- flex-direction: column;
- border-right: 1px solid #e1e1e1;
- border-bottom: 1px solid #e1e1e1;
- align-items: center;
- justify-content: center;
- // font-weight: bold;
- &:nth-child(n) {
- span:nth-child(1) {
- transform: scale(2);
- }
- span:nth-child(2) {
- padding-top: 5px;
- }
- }
- }
- .category_content:hover {
- cursor: pointer;
- background-color: rgba(135, 181, 243, 0.29);
- }
- }
- }
- .category_box:last-child {
- border-right: 1px solid #e1e1e1;
- }
- }
- .tab-box {
- // width: calc(100vw - 552px);
- //max-width: 1100px;
- //min-width: 600px;
- margin-top: 6px;
- height: 98%;
- .el-tabs--border-card {
- height: 100%;
- }
- }
- ::v-deep .card_box {
- .el-card__body {
- padding: 10px;
- height: 86vh;
- }
- }
- ::v-deep .ele-table-tool {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap !important;
- }
- </style>
|