123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710 |
- <template>
- <el-dialog
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :title="dialogTitle"
- :visible.sync="dialogVisible"
- top="50px"
- width="75%"
- >
- <div class="tabsdom">
- <el-tabs v-model="activeName">
- <el-tab-pane label="请假申请" name="first" @tab-click="handleClick">
- <el-card shadow="always" style="padding: 20px 10px 10px 20px">
- <div v-for="(item,index) in hoildaylist" style="margin:10px 0px">
- <el-row v-if="item.offWorkType==1" :gutter="10" class="holidayRow">
- <el-col :span="2" class="col-txt">
- <div style="width: 100%">
-
- <span v-if="index==0">请假类型 </span>
- </div>
- </el-col>
- <el-col :span="5">
- <el-select
- v-model="item.offWorkType"
- disabled
- filterable
- placeholder="请假类型"
- style="width: 100%!important;"
- >
- <el-option
- v-for="itam in ProjectData"
- :key="itam.name"
- :disabled="itam.disabled"
- :label="itam.name"
- :value="itam.type"
- />
- </el-select>
- </el-col>
- <el-col :span="4">
- <el-date-picker
- v-model="item.startDate"
- disabled
- placeholder="选择日期"
- style="width: 100%!important;"
- type="date"
- value-format="yyyy-MM-dd"
- width="100%"
- />
- </el-col>
- <el-col :span="2">
- <el-select
- v-model="item.startIsAllday"
- disabled
- filterable
- placeholder=""
- >
- <el-option label="上午" value="上午"/>
- <el-option label="下午" value="下午"/>
- </el-select>
- </el-col>
- <el-col :span="1">
- <div style="height: 1px;background: #606266;width:100%;margin-top:40%"/>
- </el-col>
- <el-col :span="4">
- <el-date-picker
- v-model="item.endDate"
- :readonly="!item.startDate||item.startDate.length==0?true:false"
- disabled
- placeholder="选择日期"
- style="width:100%"
- type="date"
- value-format="yyyy-MM-dd"
- />
- </el-col>
- <el-col :span="2">
- <el-select
- v-model="item.endIsAllday"
- disabled
- filterable
- placeholder=""
- >
- <el-option label="上午" value="上午"/>
- <el-option label="下午" value="下午"/>
- </el-select>
- </el-col>
- <el-col :span="2" class="col-txt" style="text-align: center">
- 共{{
- !item.days ? 0 : item.days
- }}天
- </el-col>
- </el-row>
- <el-row v-if="item.offWorkType==3||item.offWorkType==2" :gutter="10" class="holidayRow">
- <el-col :span="2" class="col-txt">
- <div style="
- width: 100%"
- >
- <span v-if="index==0">请假类型 </span>
- </div>
- </el-col>
- <el-col :span="5" class="col-input">
- <el-select
- v-model="item.offWorkType"
- disabled
- filterable
- placeholder="请假类型"
- style="width: 100%"
- @change="getHolidayType($event,index,item)"
- >
- <el-option
- v-for="itam in ProjectData"
- :key="itam.name"
- :disabled="itam.disabled"
- :label="itam.name"
- :value="itam.type"
- />
- </el-select>
- </el-col>
- <el-col :span="6">
- <el-date-picker
- v-model="item.dayMerange"
- class="pdr10px mgb10px"
- disabled
- placeholder="选择日期"
- type="date"
- value-format="yyyy-MM-dd"
- >
- </el-date-picker>
- </el-col>
- <el-col :span="7">
- <el-time-picker
- v-model="item.timeMerange"
- :disabled="!item.dayMerange"
- class="el-input pdr10px mgb10px"
- clearable
- disabled
- end-placeholder="结束时间" format="HH:mm"
- is-range
- range-separator="至"
- start-placeholder="开始时间"
- value-format="HH:mm"
- @change="getTimeMerange(item.timeMerange,item.dayMerange,item.startIsAllday,item.endIsAllday,index,item.offWorkType)"
- />
- </el-col>
- <el-col :span="2" class="col-txt" style="text-align: center">
- <!-- {{ JSON.stringify(item) }}-->
- 共{{ item.hour }}小时
- </el-col>
- </el-row>
- <el-row v-if="item.offWorkType!=1&& item.offWorkType!=3&&item.offWorkType!=2" :gutter="10"
- class="holidayRow"
- >
- <el-col :span="2" class="col-txt">
- <div style="width: 100%">
-
- <span v-if="index==0">请假类型 </span>
- </div>
- </el-col>
- <el-col :span="5">
- <el-select
- v-model="item.offWorkType"
- disabled
- filterable
- placeholder="请假类型"
- @change="getHolidayType($event,index,item)"
- >
- <el-option
- v-for="itam in ProjectData"
- :key="itam.name"
- :disabled="itam.disabled"
- :label="itam.name"
- :value="itam.type"
- />
- </el-select>
- </el-col>
- <el-col :span="4">
- <el-date-picker
- v-model="item.startDate"
- disabled
- placeholder="选择日期"
- style="width: 100%!important;"
- type="date"
- value-format="yyyy-MM-dd"
- width="100%"
- @change="countDays(item.startDate,item.endDate,item.startIsAllday,item.endIsAllday,index,item.offWorkType)"
- />
- </el-col>
- <el-col :span="2">
- <el-select v-model="item.startIsAllday"
- disabled
- filterable
- placeholder=""
- @change="countDays(item.startDate,item.endDate,item.startIsAllday,item.endIsAllday,index,item.offWorkType)"
- >
- <el-option label="上午" value="上午"/>
- <el-option label="下午" value="下午"/>
- </el-select>
- </el-col>
- <el-col :span="1">
- <div style="height: 1px;background: #606266;width:100%;margin-top:40%"/>
- </el-col>
- <el-col :span="4">
- <el-date-picker v-model="item.endDate"
- :readonly="!item.startDate||item.startDate.length==0?true:false"
- disabled
- placeholder="选择日期"
- style="width:100%"
- type="date"
- value-format="yyyy-MM-dd"
- @change="countDays(item.startDate,item.endDate,item.startIsAllday,item.endIsAllday,index,item.offWorkType)"
- />
- </el-col>
- <el-col :span="2">
- <el-select v-model="item.endIsAllday"
- disabled
- filterable
- placeholder=""
- @change="countDays(item.startDate,item.endDate,item.startIsAllday,item.endIsAllday,index,item.offWorkType)"
- >
- <el-option label="上午" value="上午"/>
- <el-option label="下午" value="下午"/>
- </el-select>
- </el-col>
- <el-col :span="2" class="col-txt" style="text-align: center">
- 共{{
- !item.days ? 0 : item.days
- }}天
- </el-col>
- </el-row>
- </div>
- <div class="totalApplyTime">{{ totalApplyTime }}</div>
- <el-row>
- <el-col :span="2" class="col-txt"><span>请假事由</span></el-col>
- <el-col :span="22">
- <el-input v-model="form.applyReasons" readonly style="min-height:50px;margin-bottom: 25px"
- type="textarea"
- />
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="2" class="col-txt">附件</el-col>
- <el-col :span="22">
- <el-upload
- :action="$constant.BASE_URI+'/FileController/upload'"
- :file-list="form.fileUrlList"
- :http-request="uploadFile"
- class="upload-demo"
- disabled
- multiple
- >
- <el-button disabled size="small" type="primary">点击上传</el-button>
- <div slot="file" slot-scope="{file}">
- <a :href="file.url">{{ file.name }}</a>
- <span class="el-upload-list__item-actions">
- <i class="el-icon-delete" @click="handlePictureRemove(file,form.fileUrlList)"/>
- </span>
- </div>
- </el-upload>
- </el-col>
- </el-row>
- <el-row style="margin-top: 25px">
- <el-col :span="2" class="col-txt">发起人抄送</el-col>
- <el-col :span="22">
- <user-select
- ref="userSelect"
- :default-select="selectList"
- :multiple="true"
- disab
- width="700"
- />
- </el-col>
- </el-row>
- </el-card>
- <h3>流程历史</h3>
- <div class="tableDom">
- <el-table
- :data="tableData"
- :header-cell-style="{
- background:'#1890FF !important',
- color:'white'
- }"
- border
- style="width: 100%"
- >
- <el-table-column fixed label="序号" type="index" width="60"/>
- <el-table-column
- label="节点名称"
- prop="nodeName"
- width="180"
- />
- <el-table-column
- label="处理人"
- prop="auditUserName"
- width="180"
- />
- <el-table-column
- label="审核结果"
- prop="auditContent"
- />
- <el-table-column
- label="审核意见"
- prop="auditResultString"
- />
- <el-table-column
- label="发起/审核时间"
- prop="createdAt"
- >
- <template slot-scope="scope">
- {{ $common.transTime(scope.row.createdAt) }}
- </template>
- </el-table-column>
- </el-table>
- </div>
- <h3>处理</h3>
- <el-card shadow="always" style="padding: 0px 5px 5px 15px">
- <el-form
- ref="confirmForm"
- :model="confirmForm"
- :rules="rules"
- class="cost_form"
- label-width="100px"
- style="width: 100%;padding: 5px"
- >
- <el-row :gutter="10">
- <el-col :span="24">
- <el-form-item label="处理结果" style="margin-bottom: 15px">
- <el-radio-group v-model="confirmForm.confirmResult">
- <el-radio :label="1">同意</el-radio>
- <el-radio v-if="argeeNoStatus" :label="2">退回发起人</el-radio>
- <el-radio v-if="argeeBackStatus" :label="3">退回上节点</el-radio>
- <!-- <el-radio :label="4">结束流程</el-radio>-->
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="处理意见">
- <el-input v-model="confirmForm.confirmContent" style="margin-top:10px" type="textarea"/>
- <el-dropdown size="mini" split-button trigger="hover" type="primary">
- 常用语选择
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item
- v-for="item in dc_data.COMMON_PHRASES"
- @click.native="selectCommonPhrases(item.label)"
- >
- {{ item.label }}
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="审核人抄送">
- <user-select
- :default-select="confirmList"
- :multiple="true"
- class="cclist"
- @selectValue="parentMethod"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </el-card>
- </el-tab-pane>
- <el-tab-pane label="流程图 " name="second">
- <holidayCanvas ref="holidayCanvas"/>
- </el-tab-pane>
- </el-tabs>
- </div>
- <div slot="footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="confirmSubmit()">确 定</el-button>
- </div>
- </el-dialog>
- </template>
- <script>
- import userSelect from '@/views/components/UserSelect.vue'
- import { upload } from '@/static/utils/channel'
- import Base from '@/views/base/base'
- import BaseData from '@/views/base/baseData'
- import holidayCanvas from '@/views/workflow/components/myProcess/holidayCanvas.vue'
- export default {
- name: 'applyPay',
- components: {
- userSelect, holidayCanvas
- },
- mixins: [Base, BaseData],
- data() {
- return {
- row: {},
- rules: {
- confirmResult: [
- { required: true, message: '请选择处理结果', trigger: 'change' }
- ]
- },
- confirmList: [],
- freezeHolidayTime: 0,
- freezeExchangeTime: 0,
- confirmForm: {
- confirmContent: '',
- confirmResult: 1
- },
- dc_key: ['ORDER_STATUS', 'PAY_TYPE', 'BUDGET_FY', 'COMMON_PHRASES'],
- dc_data: {},
- tableData: [],
- loading: false,
- totalApplyTime: '共计请假0天,0.00小时',
- dialogVisible: false,
- hoildaylist: [
- { offWorkType: 2, hour: 0, days: 0 }
- ],
- fileError: false,
- fileList: [],
- selectList: [],
- argeeBackStatus: false,
- argeeNoStatus: false,
- form: {
- fileUrlList: []
- },
- daysNum: 0,
- holidayDays: {},
- hoildayist: [
- { type: 'year' }
- ],
- options: [
- { value: '陈鹏铭', label: '陈鹏铭' },
- { value: '宣胜伟', label: '宣胜伟' },
- { value: '张洮', label: '张洮' },
- { value: '潘毅', label: '潘毅' },
- { value: '崔伟', label: '崔伟' }
- ],
- value1: [],
- ProjectData: [
- { name: '年假(剩余x天)', type: 'year' },
- { name: '调休(剩余x小时)', type: 'affair' },
- { name: '病假', type: 'illness' }
- ],
- dialogTitle: '请假申请-审核',
- activeName: 'first'
- }
- },
- mounted() {
- const _this = this
- _this.initDict(this.dc_key).then((res) => {
- })
- },
- watch: {
- 'hoildaylist': {
- deep: true,
- handler(newValue, oldValue) {
- let day = 0
- let hour = 0
- for (let i = 0; i < this.hoildaylist.length; i++) {
- if (this.hoildaylist[i].hour === 0 || this.hoildaylist[i].hour) {
- hour = hour + this.hoildaylist[i].hour
- }
- if (this.hoildaylist[i].days == 0 || this.hoildaylist[i].days) {
- day = day + this.hoildaylist[i].days
- }
- }
- this.changeCotalApplyTime(`共计请假${day}天,${hour.toFixed(2)}小时`)
- }
- }
- },
- methods: {
- handleClick(tab, event) {
- this.canVasStatus = false
- if (this.activeName == 'second') {
- this.canVasStatus = true
- this.$nextTick(() => {
- this.$refs.holidayCanvas.createNodeCanvas(this.row)
- })
- }
- },
- getTimeMerange(timeMerange, dayMerange, startIsAllday, endIsAllday, index, type) {
- this.hoildaylist[index].startDate = dayMerange + ' ' + timeMerange[0] + ':00'
- this.hoildaylist[index].endDate = dayMerange + ' ' + timeMerange[1] + ':00'
- this.countDays(dayMerange + ' ' + timeMerange[0], dayMerange + ' ' + timeMerange[1], startIsAllday, endIsAllday, index, type)
- },
- selectCommonPhrases(e) {
- if (!this.confirmForm.confirmContent) this.confirmForm.confirmContent = ''
- this.confirmForm.confirmContent += e
- },
- changeCotalApplyTime(e) {
- this.totalApplyTime = e
- },
- uploadFile(param) {
- upload(param, true).then((res) => {
- this.form.fileUrlList.push(res)
- })
- },
- parentMethod(val) {
- if (val.length > 0) {
- this.confirmForm.ccList = val.join(',')
- }
- },
- async confirmSubmit() {
- const { data } = await this.baseRequest1('ApplyOffWorkController', 'AddConfirmResultOffWork', { ...this.confirmForm })
- console.log(data)
- if (data.code == 200) {
- this.$message.success('处理成功')
- this.form = {
- fileUrlList: []
- }
- this.confirmForm = {
- confirmForm: {
- confirmContent: ''
- }
- }
- this.dialogVisible = false
- this.$emit('getData')
- }
- this.dialogVisibl = false
- },
- baseRequest1(prefix, opUrl, postData) {
- return this.$channel.globleRequest(prefix, opUrl, postData, 'project task')
- },
- async setVisible(status, row) {
- this.form.fileUrlList = []
- console.log(row)
- const { data: holidayDays } = await this.baseRequest1('ApplyOffWorkController', 'getHolidayManagementByApplyUserId', { userId: row.applyUser })
- this.holidayDays = holidayDays
- this.confirmForm.flowMainPushId = row.flowMainPushId
- const noAndbackstatus = await this.baseRequest1('FlowMainController', 'getOutgoingFlowsByFlowMainPushId', { flowMainPushId: row.flowMainPushId })
- for (let i = 0; i < noAndbackstatus.data.length; i++) {
- if (noAndbackstatus.data[i].conditionExpression == '${agree==\'no\'}') this.argeeNoStatus = true
- if (noAndbackstatus.data[i].conditionExpression == '${agree==\'back\'}') this.argeeBackStatus = true
- }
- this.freezeHolidayTime = holidayDays.freezeHolidayTime
- this.freezeExchangeTime = holidayDays.freezeExchangeTime
- this.ProjectData = [
- {
- name: `年假(剩余${holidayDays.restHolidayTime}天,已冻结${holidayDays.freezeHolidayTime}天)`,
- type: 1
- },
- {
- name: `调休(剩余${holidayDays.restExchangeTime}小时,已冻结${holidayDays.freezeExchangeTime}小时)`,
- type: 3
- },
- {
- name: `事假`,
- type: 2
- },
- {
- name: `病假`,
- type: 4
- },
- {
- name: `婚假`,
- type: 5
- },
- {
- name: `产假`,
- type: 6
- },
- {
- name: `陪产假`,
- type: 7
- },
- {
- name: `丧假`,
- type: 8
- }
- ]
- const { data } = await this.baseRequest1('ApplyOffWorkController', 'getInfoByFlowMainId', { flowMainId: row.id })
- const { data: flowHistroy } = await this.baseRequest1('FlowMainController', 'getFlowHistroyByFlowMainId', { flowMainId: row.id })
- this.form = data
- this.tableData = flowHistroy
- this.hoildaylist = data.applyOffWorkTimeList.map((e) => {
- return {
- offWorkType: Number(e.offWorkType),
- endDate: this.$common.transTime(e.endDay),
- startDate: this.$common.transTime(e.startDay),
- // 这两段是针对小时做的处理
- dayMerange: Number(e.offWorkType) == 2 || Number(e.offWorkType) == 3 ? this.$common.transDate(e.startDay) : null,
- timeMerange: Number(e.offWorkType) == 2 || Number(e.offWorkType) == 3 ? [this.$common.transhh(e.startDay), this.$common.transhh(e.endDay)] : null,
- days: Number(e.offWorkType) != 2 && Number(e.offWorkType) != 3 ? e.useTime : 0,
- hour: Number(e.offWorkType) == 2 || Number(e.offWorkType) == 3 ? e.useTime : 0,
- startIsAllday: e.startTime,
- endIsAllday: e.endTime,
- endTime: e.endTime
- }
- })
- let daysNum = 0
- let yearsTime = 0
- for (let j = 0; j < this.hoildaylist.length; j++) {
- if (this.hoildaylist[j].offWorkType == 1) {
- daysNum = daysNum + this.hoildaylist[j].days
- }
- }
- for (let j = 0; j < this.hoildaylist.length; j++) {
- if (this.hoildaylist[j].offWorkType == 2) {
- yearsTime += this.hoildaylist[j].hour
- }
- }
- this.totalApplyTime = `共计请假${daysNum}天,${yearsTime.toFixed(2)}小时`
- let selectList = data.flowMainCcList.map((e) => {
- return e.ccUser
- })
- this.selectList = selectList
- if (data.fileDataIds) {
- const { data: fileTaoTaoList } = await this.baseRequest1('FileZtController', 'findFileInfoByIds/' + data.fileDataIds, '')
- console.log(fileTaoTaoList.data)
- this.form.fileUrlList = fileTaoTaoList.data.map((e) => {
- return {
- url: this.$constant.BASE_URI + '/FileController/download/' + e.id,
- name: e.fileName,
- data: e.id,
- uid: new Date().getTime()
- }
- })
- console.log(this.form.fileUrlList)
- } else {
- this.form.fileUrlList = []
- }
- this.dialogVisible = status
- },
- addListRow() {
- const _this = this
- _this.hoildayist.push({ type: 'year' })
- }
- }
- }
- </script>
- <style lang="scss">
- .totalApplyTime {
- font-size: 16px;
- font-family: 微软雅黑;
- font-weight: 400;
- color: #1890FF;
- text-align: right;
- margin: 15px 0 15px 0;
- width: 100%;
- }
- .ml5 {
- margin-left: 5px;
- }
- .tabsdom {
- .el-select {
- width: 100%;
- }
- .el-tabs__header {
- text-align: center !important;
- width: 139px !important;
- text-align: center !important;
- display: block !important;
- margin: auto !important;
- margin-bottom: 15px !important;
- }
- .el-tabs__nav-wrap::after {
- display: none;
- }
- .el-upload {
- width: 100%;
- }
- }
- </style>
|