1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372 |
- <template>
- <div class="app-container">
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- plain
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['peopleChuRu:bdglLeave:add']"
- >新增</el-button
- >
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="success"
- plain
- icon="el-icon-edit"
- size="mini"
- :disabled="single"
- @click="handleUpdate"
- v-hasPermi="['peopleChuRu:bdglLeave:edit']"
- >修改</el-button
- >
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- plain
- icon="el-icon-delete"
- size="mini"
- :disabled="multiple"
- @click="handleDelete"
- v-hasPermi="['peopleChuRu:bdglLeave:remove']"
- >删除</el-button
- >
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- plain
- icon="el-icon-download"
- size="mini"
- :loading="exportLoading"
- @click="handleExport"
- v-hasPermi="['peopleChuRu:bdglLeave:export']"
- >导出</el-button
- >
- </el-col>
- <!-- <right-toolbar
- :showSearch.sync="showSearch"
- @queryTable="getList"
- ></right-toolbar> -->
- </el-row>
- <el-table
- v-loading="loading"
- :data="bdglLeaveList"
- @selection-change="handleSelectionChange"
- :header-cell-style="{ background: '#003C69', color: 'white' }"
- >
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="序号" align="center" prop="id" />
- <el-table-column label="单位" align="center" prop="unitName" />
- <el-table-column label="请假人员" align="center" prop="peopleName" />
- <el-table-column
- label="请假开始时间"
- align="center"
- prop="startTime"
- width="100"
- >
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.startTime, "{y}-{m}-{d}") }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="请假结束时间"
- align="center"
- prop="endTime"
- width="100"
- >
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.endTime, "{y}-{m}-{d}") }}</span>
- </template>
- </el-table-column>
- <el-table-column label="请假类型" align="center" prop="leaveType" :formatter="qingJia"
- >
- <template slot-scope="scope">
- <dict-tag
- :options="dict.type.Leave_type"
- :value="scope.row.leaveType"
- />
- </template>
- </el-table-column>
- <el-table-column label="请假原因" align="center" prop="leaveReason" />
- <el-table-column
- label="离队时间"
- align="center"
- prop="departureTime"
- width="100"
- />
- <el-table-column
- label="归队时间"
- align="center"
- prop="returnTime"
- width="100"
- />
- <el-table-column label="是否归队" align="center" prop="isReturn" >
- <template slot-scope="scope">
- <dict-tag
- :options="dict.type.sys_is"
- :value="scope.row.isReturn"
- />
- </template>
- </el-table-column>
- <el-table-column
- label="一级审批人"
- align="center"
- prop="peopleName1"
- width="100"
- />
- <el-table-column
- label="一级审批状态"
- align="center"
- prop="peopleId2"
- width="100"
- >
- <template slot-scope="scope">
- <el-col v-if="scope.row.status1 == 0" style="color: #ffba00"
- >未审批</el-col
- >
- <el-col v-if="scope.row.status1 == 1" style="color: #13ce66"
- >已通过</el-col
- >
- <el-col
- v-if="scope.row.status1 == 2"
- :title="scope.row.reasons"
- style="color: #ff4949"
- >已驳回</el-col
- >
- <el-col
- v-if="scope.row.status1 == 3"
- :title="scope.row.bdglLeaveFus[0].specialApproval"
- style="color: #1f73d7"
- >特殊审批</el-col
- >
- </template></el-table-column
- >
- <el-table-column
- label="二级审批人"
- align="center"
- prop="peopleName2"
- width="100"
- />
- <el-table-column
- label="二级审批状态"
- align="center"
- prop="peopleId4"
- width="100"
- >
- <template slot-scope="scope">
- <el-col v-if="scope.row.status2 == 0" style="color: #ffba00"
- >未审批</el-col
- >
- <el-col v-if="scope.row.status2 == 1" style="color: #13ce66"
- >已通过</el-col
- >
- <el-col
- v-if="scope.row.status2 == 2"
- :title="scope.row.reasons"
- style="color: #ff4949"
- >已驳回</el-col
- >
- <el-col
- v-if="scope.row.status2 == 3"
- :title="scope.row.bdglLeaveFus[1].specialApproval"
- style="color: #1f73d7"
- >特殊审批</el-col
- >
- </template>
- </el-table-column>
- <el-table-column
- label="三级审批人"
- align="center"
- prop="peopleName3"
- width="100"
- />
- <el-table-column
- label="三级审批状态"
- align="center"
- prop="status2"
- width="100"
- >
- <template slot-scope="scope">
- <el-col v-if="scope.row.status3 == 0" style="color: #ffba00"
- >未审批</el-col
- >
- <el-col v-if="scope.row.status3 == 1" style="color: #13ce66"
- >已通过</el-col
- >
- <el-col
- v-if="scope.row.status3 == 2"
- :title="scope.row.reasons"
- style="color: #ff4949"
- >已驳回</el-col
- >
- <el-col v-if="scope.row.status3 == 3" style="color: #1f73d7"
- >特殊审批</el-col
- >
- </template>
- <!-- :title="scope.row.bdglLeaveFus[2].specialApproval" -->
- </el-table-column>
- <el-table-column
- label="四级审批人"
- align="center"
- prop="peopleName4"
- width="100"
- />
- <el-table-column
- label="四级审批状态"
- align="center"
- prop="status4"
- width="100"
- >
- <template slot-scope="scope">
- <el-col v-if="scope.row.status4 == 0" style="color: #ffba00"
- >未审批</el-col
- >
- <el-col v-if="scope.row.status4 == 1" style="color: #13ce66"
- >已通过</el-col
- >
- <el-col
- v-if="scope.row.status4 == 2"
- :title="scope.row.reasons"
- style="color: #ff4949"
- >已驳回</el-col
- >
- <el-col v-if="scope.row.status4 == 3" style="color: #1f73d7"
- >特殊审批</el-col
- >
- <!-- :title="scope.row.bdglLeaveFus[3].specialApproval" -->
- </template>
- </el-table-column>
- <el-table-column
- label="总审批状态"
- align="center"
- prop="contents"
- width="100"
- />
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- width="210"
- >
- <template slot-scope="scope">
- <el-button
- v-if="scope.row.common == '1'"
- size="btc"
- type="text"
- @click="handleUpdates(scope.row)"
- v-hasPermi="['peopleChuRu:bdglLeave:edit']"
- >审批</el-button
- >
- <el-button
- v-else-if="scope.row.common == '2'"
- size="mini"
- type="text"
- @click="handleUpdatess(scope.row)"
- v-hasPermi="['peopleChuRu:bdglLeave:edit']"
- >特殊审批</el-button
- >
- <el-button
- size="btu"
- type="text"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['peopleChuRu:bdglLeave:edit']"
- >修改</el-button
- >
- <el-button
- size="btd"
- type="text"
- @click="handleDelete(scope.row)"
- v-hasPermi="['peopleChuRu:bdglLeave:remove']"
- >删除</el-button
- >
- <el-button
- v-if="scope.row.common == '3'"
- size="btc"
- type="text"
- @click="handleGuiDui(scope.row)"
- v-hasPermi="['peopleChuRu:bdglLeave:edit']"
- >归队</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <!-- 添加或修改人员请假对话框 -->
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
- <el-form
- ref="form"
- :model="form"
- :rules="rules"
- label-width="80px"
- inline
- >
- <div class="jiben">基本信息</div>
- <el-form-item label="单位" prop="unitId">
- <treeselect
- v-model="form.unitId"
- :options="deptOptions"
- placeholder="请选择单位"
- @select="selectPeo"
- @open="blurSelect"
- />
- </el-form-item>
- <el-form-item label="请假人员" prop="peopleId">
- <!-- <el-input v-model="form.peopleId" placeholder="请输入请假人员" /> -->
- <el-select
- v-model="form.peopleId"
- placeholder="请输入请假人员"
- ref="headerSearchSelect"
- >
- <el-option
- v-for="(item, i) in renYuan"
- :key="i"
- :label="item.name"
- :value="item.id"
- @click.native="qingRen(item.name)"
- class="input_xiala"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="请假开始时间" prop="startTime">
- <el-date-picker
- clearable
- size="small"
- v-model="form.startTime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择请假开始时间"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="请假结束时间" prop="endTime">
- <el-date-picker
- clearable
- size="small"
- v-model="form.endTime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择请假结束时间"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="请假类型" prop="leaveType">
- <el-select v-model="form.leaveType" placeholder="请选择请假类型">
- <!-- <el-option label="请选择字典生成" value="" /> -->
- <el-option
- v-for="item in ziDian"
- :key="item.dictCode"
- :label="item.dictLabel"
- :value="item.dictValue"
- class="input_xiala"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="离队时间" prop="departureTime">
- <!-- <el-input v-model="form.departureTime" placeholder="请输入离队时间" /> -->
- <el-date-picker
- clearable
- size="small"
- v-model="form.departureTime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="请输入离队时间"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="归队时间" prop="returnTime">
- <!-- <el-input v-model="form.returnTime" placeholder="请输入归队时间" /> -->
- <el-date-picker
- clearable
- size="small"
- v-model="form.returnTime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="请输入归队时间"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="一级审批人" prop="peopleId2">
- <!-- <el-input v-model="form.peopleId2" placeholder="请输入二级审批人" /> -->
- <el-select
- v-model="form.peopleId1"
- filterable
- placeholder="请输入一级审批人"
- ref="abcdef"
- >
- <el-option
- v-for="(item, i) in yongHu"
- :key="i"
- :label="item.userName"
- :value="item.userId"
- @click.native="oneRen(item.userName)"
- class="input_xiala"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="二级审批人" prop="peopleId2">
- <!-- <el-input v-model="form.peopleId2" placeholder="请输入二级审批人" /> -->
- <el-select
- v-model="form.peopleId2"
- filterable
- placeholder="请输入二级审批人"
- ref="abcde"
- >
- <el-option
- v-for="(item, i) in yongHu"
- :key="i"
- :label="item.userName"
- :value="item.userId"
- @click.native="twoRen(item.userName)"
- class="input_xiala"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="三级审批人" prop="peopleId3">
- <!-- <el-input v-model="form.peopleId3" placeholder="请输入三级审批人" /> -->
- <el-select
- v-model="form.peopleId3"
- filterable
- placeholder="请输入三级审批人"
- ref="abcd"
- >
- <el-option
- v-for="(item, i) in yongHu"
- :key="i"
- :label="item.userName"
- :value="item.userId"
- @click.native="thereRen(item.userName)"
- class="input_xiala"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="四级审批人" prop="peopleId4">
- <!-- <el-input v-model="form.peopleId4" placeholder="请输入四级审批人" /> -->
- <el-select
- v-model="form.peopleId4"
- filterable
- placeholder="请输入四级审批人"
- ref="abc"
- >
- <el-option
- v-for="(item, i) in yongHu"
- :key="i"
- :label="item.userName"
- :value="item.userId"
- @click.native="fourRen(item.userName)"
- class="input_xiala"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <div class="jiben">请假原因</div>
- <el-form-item prop="leaveReason">
- <el-input
- v-model="form.leaveReason"
- type="textarea"
- placeholder="请输入内容"
- />
- </el-form-item>
- <div class="jiben" v-if="statussp == '1'">驳回原因</div>
- <el-form-item v-if="statussp == '1'" prop="reasons">
- <el-input
- v-model="form.reasons"
- type="textarea"
- placeholder="请输入内容"
- />
- </el-form-item>
- <div class="jiben" v-if="statussp == '2'">驳回原因</div>
- <el-form-item v-if="statussp == '2'" prop="reasons">
- <el-input
- v-model="form.reasons"
- type="textarea"
- placeholder="请输入内容"
- />
- </el-form-item>
- <div class="jiben" v-if="statussp == '2'">特殊审批原因</div>
- <el-form-item v-if="statussp == '2'" prop="reasons">
- <el-input
- v-model="form.specialApproval"
- type="textarea"
- placeholder="请输入内容"
- />
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer" v-if="statussp == '0'">
- <el-button type="primary" @click="submitForm">确 定</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- <div v-if="statussp == '1'" class="dialog-footer" slot="footer">
- <el-button type="primary" @click="submitForms">通过</el-button>
- <el-button @click="boHui">驳回</el-button>
- </div>
- </el-dialog>
- <!--特殊审批对话框 -->
- <el-dialog
- :title="title"
- :visible.sync="opens"
- width="500px"
- append-to-body
- >
- <el-form
- ref="forms"
- :model="form"
- :rules="rulesform"
- label-width="80px"
- inline
- >
- <el-form-item label="单位" prop="unitId">
- <treeselect
- v-model="form.unitId"
- :options="deptOptions"
- placeholder="选择单位"
- @select="selectPeo"
- @open="blurSelect"
- />
- </el-form-item>
- <el-form-item label="请假人员" prop="peopleId">
- <el-select
- v-model="form.peopleId"
- placeholder="请输入请假人员"
- ref="headerSearchSelect"
- >
- <el-option
- v-for="(item, i) in renYuan"
- :key="i"
- :label="item.name"
- :value="item.id"
- @click.native="qingRen(item.name)"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="请假开始时间" prop="startTime">
- <el-date-picker
- clearable
- size="small"
- v-model="form.startTime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择请假开始时间"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="请假结束时间" prop="endTime">
- <el-date-picker
- clearable
- size="small"
- v-model="form.endTime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择请假结束时间"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="请假类型" prop="leaveType">
- <el-select v-model="form.leaveType" placeholder="请选择请假类型">
- <el-option
- v-for="item in ziDian"
- :key="item.dictCode"
- :label="item.dictLabel"
- :value="item.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="离队时间" prop="departureTime">
- <el-date-picker
- clearable
- size="small"
- v-model="form.departureTime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="请输入离队时间"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="归队时间" prop="returnTime">
- <el-date-picker
- clearable
- size="small"
- v-model="form.returnTime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="请输入归队时间"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="一级审批人" prop="peopleId2">
- <el-select
- v-model="form.peopleId1"
- filterable
- placeholder="请输入一级审批人"
- ref="abcdef"
- >
- <el-option
- v-for="(item, i) in yongHu"
- :key="i"
- :label="item.nickName"
- :value="item.userId"
- @click.native="oneRen(item.nickName)"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="二级审批人" prop="peopleId2">
- <el-select
- v-model="form.peopleId2"
- filterable
- placeholder="请输入二级审批人"
- ref="abcde"
- >
- <el-option
- v-for="(item, i) in yongHu"
- :key="i"
- :label="item.nickName"
- :value="item.userId"
- @click.native="twoRen(item.nickName)"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="三级审批人" prop="peopleId3">
- <el-select
- v-model="form.peopleId3"
- filterable
- placeholder="请输入三级审批人"
- ref="abcd"
- >
- <el-option
- v-for="(item, i) in yongHu"
- :key="i"
- :label="item.nickName"
- :value="item.userId"
- @click.native="thereRen(item.nickName)"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="四级审批人" prop="peopleId4">
- <el-select
- v-model="form.peopleId4"
- filterable
- placeholder="请输入四级审批人"
- ref="abc"
- >
- <el-option
- v-for="(item, i) in yongHu"
- :key="i"
- :label="item.nickName"
- :value="item.userId"
- @click.native="fourRen(item.nickName)"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <div class="jiben">请假原因</div>
- <el-form-item prop="leaveReason">
- <el-input
- v-model="form.leaveReason"
- type="textarea"
- placeholder="请输入内容"
- />
- </el-form-item>
- <div class="jiben">驳回原因</div>
- <el-form-item prop="reasons">
- <el-input
- v-model="form.reasons"
- type="textarea"
- placeholder="请输入内容"
- />
- </el-form-item>
- <div class="jiben">特殊审批原因</div>
- <el-form-item prop="specialApproval">
- <el-input
- v-model="form.specialApproval"
- type="textarea"
- placeholder="请输入内容"
- />
- </el-form-item>
- </el-form>
- <div class="dialog-footer" slot="footer">
- <el-button type="primary" @click="TSsubmitForms">通过</el-button>
- <el-button @click="TSboHui">驳回</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- listBdglLeave,
- getBdglLeave,
- delBdglLeave,
- addBdglLeave,
- updateBdglLeave,
- exportBdglLeave,
- } from "@/api/peopleChuRu/bdglLeave";
- import {
- getUser,
- getDept,
- getQuanBu,
- } from "@/api/grassrootsregistration/bdglmeeting";
- // 导入树形结构
- import Treeselect from "@riophae/vue-treeselect";
- import "@riophae/vue-treeselect/dist/vue-treeselect.css";
- // 查询字典
- import { getDicts } from "@/api/system/dict/data";
- export default {
- name: "BdglLeave",
- components: {
- Treeselect,
- },
- dicts: ["Leave_type", "sys_is"],
- data() {
- return {
- // 审批按钮状态 审批按钮状态1 修改为0,超级审批状态2
- statussp: "1",
- // 遮罩层
- loading: true,
- // 导出遮罩层
- exportLoading: false,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 人员请假表格数据
- bdglLeaveList: [],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- // 是否显示特殊权限弹出层
- opens: false,
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- peopleId: null,
- unitId: null,
- startTime: null,
- endTime: null,
- leaveType: null,
- leaveReason: null,
- departureTime: null,
- returnTime: null,
- returnStatus: null,
- isReturn: null,
- updatetime: null,
- adminId: null,
- createtime: null,
- peopleId1: null,
- postId: null,
- peopleId2: null,
- peopleId3: null,
- peopleId4: null,
- status1: null,
- status2: null,
- status3: null,
- status4: null,
- contents: null,
- statusd: null,
- rejoin: null,
- },
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- unitId: [{ required: true, message: "单位不能为空", trigger: "blur" }],
- peopleId: [
- { required: true, message: "人员不能为空", trigger: "blur" },
- ],
- reasons: [
- { required: true, message: "请填写驳回原因", trigger: "blur" },
- ],
- leaveType: [
- { required: true, message: "请假类型不能为空", trigger: "blur" },
- ],
- },
- // 特殊审批表单验证
- rulesform: {
- reasons: [
- { required: true, message: "请填写驳回原因", trigger: "blur" },
- ],
- specialApproval: [
- {
- required: true,
- message: "审批原因不能为空",
- trigger: "blur",
- },
- ],
- },
- // 树形结构列表
- deptOptions: [],
- // 用户列表
- yongHu: [],
- // 人员列表
- renYuan: [],
- // 查询字典
- dictType: {
- dictType: "Leave_type",
- },
- // 字典的列表
- ziDian: [],
- // 审批状态
- ziDians: [],
- // 特殊审批通过验证
- trueng: true,
- // 归队数据
- guidui: {},
- };
- },
- created() {
- this.getList();
- // 字典查询数据
- this.getDicts("approve").then((response) => {
- this.ziDians = response.data;
- });
- },
- methods: {
- // 归队按钮
- handleGuiDui(row) {
- const id = row.id || this.ids;
- getBdglLeave(id).then((response) => {
- this.form = response.data;
- });
- this.$modal
- .confirm("是否确认归队人员的数据项?")
- .then(() => {
- if (this.form.id != null) {
- this.form.rejoin = "1";
- console.log(this.form, 1);
- updateBdglLeave(this.form).then((response) => {
- this.$modal.msgSuccess("归队成功");
- this.getList();
- });
- }
- })
- .catch(() => {});
- },
- // // 特殊审批按钮触发
- handleUpdatess(row) {
- this.statussp = "2";
- this.getBuMeng();
- // 获取字典类型
- this.getdict();
- this.reset();
- const id = row.id || this.ids;
- getBdglLeave(id).then((response) => {
- this.form = response.data;
- this.getYong(this.form.unitId);
- this.getRen(this.form.unitId);
- this.opens = true;
- this.title = "审批人员请假";
- });
- },
- // 审批按钮操作
- handleUpdates(row) {
- this.statussp = "1";
- this.getBuMeng();
- // 获取字典类型
- this.getdict();
- this.reset();
- const id = row.id || this.ids;
- getBdglLeave(id).then((response) => {
- this.form = response.data;
- this.getYong(this.form.unitId);
- this.getRen(this.form.unitId);
- this.open = true;
- this.title = "审批人员请假";
- });
- },
- // 让单位失去焦点
- blurSelect() {
- this.$refs.headerSearchSelect.blur();
- this.$refs.abc.blur();
- this.$refs.abcd.blur();
- this.$refs.abcde.blur();
- this.$refs.abcdef.blur();
- },
- // 重置表单人员
- ChongZhiRen() {
- (this.form.peopleId = null), (this.form.peopleId1 = null);
- this.form.peopleId2 = null;
- this.form.peopleId3 = null;
- this.form.peopleId4 = null;
- },
- // 查询请假类型
- getdict() {
- getDicts(this.dictType.dictType).then((res) => {
- this.ziDian = res.data;
- });
- },
- // 请假人选中
- qingRen(name) {
- this.form.peopleName = name;
- },
- // 一级审批人选中
- oneRen(name) {
- this.form.peopleName1 = name;
- },
- //二级审批人选中
- twoRen(name) {
- this.form.peopleName2 = name;
- },
- // 三级审批人选中
- thereRen(name) {
- this.form.peopleName3 = name;
- },
- // 四级审批人选中
- fourRen(name) {
- this.form.peopleName4 = name;
- },
- // 获取部门列表
- getBuMeng() {
- getDept().then((res) => {
- this.deptOptions = res.data;
- });
- },
- // 选择部门单位触发
- selectPeo(data) {
- this.ChongZhiRen();
- this.form.unitId = data.id;
- this.getYong(this.form.unitId);
- this.getRen(this.form.unitId, 0);
- },
- // 获取用户列表
- getYong(id) {
- getUser(id).then((res) => {
- this.yongHu = res.data;
- });
- },
- // 获取人员
- getRen(id, num) {
- getQuanBu(id, num).then((response) => {
- this.renYuan = response.data;
- });
- },
- /** 查询人员请假列表 */
- getList() {
- this.loading = true;
- listBdglLeave(this.queryParams).then((response) => {
- console.log(response);
- this.bdglLeaveList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.reset();
- },
- //审批通过按钮
- submitForms() {
- this.bdglLeaveList.forEach((item) => {
- if (item.shenPiJiBie == "一级") {
- this.form.status1 = 1;
- this.form.contents = "一级审批通过";
- } else if (item.shenPiJiBie == "二级") {
- this.form.status2 = 1;
- this.form.contents = "二级审批通过";
- } else if (item.shenPiJiBie == "三级") {
- this.form.status3 = 1;
- this.form.contents = "三级审批通过";
- } else if (item.shenPiJiBie == "四级") {
- this.form.status4 = 1;
- this.form.contents = "四级审批通过";
- }
- });
- updateBdglLeave(this.form).then((response) => {
- this.$modal.msgSuccess("审批成功");
- this.open = false;
- this.getList();
- });
- },
- // 审批驳回按钮
- boHui() {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- this.bdglLeaveList.forEach((item) => {
- if (item.shenPiJiBie == "一级") {
- this.form.status1 = 2;
- return (this.form.contents = "一级审批驳回");
- } else if (item.shenPiJiBie == "二级") {
- this.form.status2 = 2;
- return (this.form.contents = "二级审批驳回");
- } else if (item.shenPiJiBie == "三级") {
- this.form.status3 = 2;
- return (this.form.contents = "三级审批驳回");
- } else if (item.shenPiJiBie == "四级") {
- this.form.status4 = 2;
- return (this.form.contents = "四级审批驳回");
- }
- });
- console.log(this.form);
- updateBdglLeave(this.form).then((response) => {
- this.$modal.msgSuccess("审批成功");
- this.open = false;
- this.getList();
- });
- }
- });
- },
- //超级审批通过按钮
- TSsubmitForms() {
- this.$refs["forms"].validateField("specialApproval", (valid) => {
- if (!valid) {
- this.bdglLeaveList.forEach((item) => {
- if (item.shenPiJiBie == "一级") {
- this.form.status1 = 3;
- this.form.common = "1";
- this.form.contents = "一级审批通过";
- } else if (item.shenPiJiBie == "二级") {
- this.form.status2 = 3;
- this.form.common = "2";
- this.form.contents = "二级审批通过";
- } else if (item.shenPiJiBie == "三级") {
- this.form.status3 = 3;
- this.form.common = "3";
- this.form.contents = "三级审批通过";
- } else if (item.shenPiJiBie == "四级") {
- this.form.status4 = 3;
- this.form.common = "4";
- this.form.contents = "四级审批通过";
- }
- });
- if (this.form.id != null) {
- updateBdglLeave(this.form).then((response) => {
- this.$modal.msgSuccess("审批成功");
- this.opens = false;
- this.getList();
- });
- }
- }
- });
- },
- // 超级审批驳回按钮
- TSboHui() {
- this.$refs["forms"].validate((valid) => {
- if (valid) {
- this.bdglLeaveList.forEach((item) => {
- if (item.shenPiJiBie == "一级") {
- this.form.status1 = 2;
- this.form.common = "1";
- return (this.form.contents = "一级审批驳回");
- } else if (item.shenPiJiBie == "二级") {
- this.form.status2 = 2;
- this.form.common = "2";
- return (this.form.contents = "二级审批驳回");
- } else if (item.shenPiJiBie == "三级") {
- this.form.status3 = 2;
- this.form.common = "3";
- return (this.form.contents = "三级审批驳回");
- } else if (item.shenPiJiBie == "四级") {
- this.form.status4 = 2;
- this.form.common = "4";
- return (this.form.contents = "四级审批驳回");
- }
- });
- if (this.form.id != null) {
- updateBdglLeave(this.form).then((response) => {
- this.$modal.msgSuccess("审批成功");
- this.opens = false;
- this.getList();
- });
- }
- }
- });
- },
- // 表单重置
- reset() {
- this.form = {
- id: null,
- peopleId: null,
- unitId: null,
- startTime: null,
- endTime: null,
- leaveType: null,
- leaveReason: null,
- departureTime: null,
- returnTime: null,
- returnStatus: "0",
- isReturn: null,
- updatetime: null,
- adminId: null,
- createtime: null,
- peopleId1: null,
- postId: null,
- peopleId2: null,
- peopleId3: null,
- peopleId4: null,
- status1: null,
- status2: null,
- status3: null,
- status4: null,
- contents: null,
- statusd: null,
- rejoin: null,
- specialApproval: null,
- };
- this.resetForm("form");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map((item) => item.id);
- this.single = selection.length !== 1;
- this.multiple = !selection.length;
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.statussp = "0";
- (this.renYuan = []),
- // 获取单位树形
- this.getBuMeng();
- // 获取字典类型
- this.getdict();
- this.reset();
- this.open = true;
- this.title = "添加人员请假";
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.statussp = "0";
- this.getBuMeng();
- // 获取字典类型
- this.getdict();
- this.reset();
- const id = row.id || this.ids;
- getBdglLeave(id).then((response) => {
- this.form = response.data;
- this.getYong(this.form.unitId);
- this.getRen(this.form.unitId);
- this.open = true;
- this.title = "修改人员请假";
- });
- },
- /** 提交按钮 */
- submitForm() {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- if (this.form.id != null) {
- updateBdglLeave(this.form).then((response) => {
- this.$modal.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- });
- } else if (this.form.common != null) {
- } else {
- addBdglLeave(this.form).then((response) => {
- this.$modal.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- });
- }
- }
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const ids = row.id || this.ids;
- this.$modal
- .confirm('是否确认删除人员请假编号为"' + ids + '"的数据项?')
- .then(function () {
- return delBdglLeave(ids);
- })
- .then(() => {
- this.getList();
- this.$modal.msgSuccess("删除成功");
- })
- .catch(() => {});
- },
- /** 导出按钮操作 */
- handleExport() {
- const queryParams = this.queryParams;
- this.$modal
- .confirm("是否确认导出所有人员请假数据项?")
- .then(() => {
- this.exportLoading = true;
- return exportBdglLeave(queryParams);
- })
- .then((response) => {
- this.$download.name(response.msg);
- this.exportLoading = false;
- })
- .catch(() => {});
- },
- },
- };
- </script>
- <style scoped>
- /* 对话框背景颜色 */
- ::v-deep .el-dialog {
- background: #004d86 !important;
- width: 800px !important;
- }
- ::v-deep .el-textarea__inner {
- width: 920px;
- height: 104px;
- margin: auto;
- }
- ::v-deep .el-dialog__header {
- border-bottom: 1px solid #718a9d;
- }
- ::v-deep .el-dialog__title {
- color: #fff;
- font: 18px;
- }
- ::v-deep .el-dialog__headerbtn .el-dialog__close {
- color: #fff;
- }
- ::v-deep .el-form-item__label {
- font: 16px;
- color: #fff;
- width: 100px !important;
- }
- ::v-deep .el-input__inner {
- /* width: 200px !important;
- height: 36px; */
- background: transparent;
- color: #fff;
- }
- /* 单位框背景颜色 */
- ::v-deep .vue-treeselect__control {
- background: #004d86 !important;
- }
- /* 基本信息背景 */
- .jiben {
- width: 920px;
- height: 32px;
- background-image: url(../../../images/小标题底.png);
- margin-bottom: 25px;
- color: #fff;
- padding-left: 16px;
- line-height: 32px;
- }
- /*调整表单间距 */
- ::v-deep .el-form-item__content {
- width: 200px;
- }
- ::v-deep .el-input__inner {
- cursor: pointer !important;
- }
- /* 底部确定取消按钮 */
- ::v-deep .el-dialog__footer {
- padding: 30px 50px;
- }
- ::v-deep .el-dialog__body {
- margin: 10px 30px 20px 30px;
- padding-top: 20px !important;
- box-sizing: border-box;
- /* padding: 30px 12px 30px 28px; */
- }
- .contents {
- padding: 0px 40px !important;
- }
- /* 下拉菜单 */
- .el-dropdown-link {
- cursor: pointer;
- color: #409eff;
- }
- .el-icon-arrow-down {
- font-size: 12px;
- }
- /* 下拉菜单字体/背景颜色 */
- .el-select-dropdown__item.hover,
- .el-select-dropdown__item:hover {
- background-color: #004d86;
- color: #fff;
- }
- .el-select-dropdown__item {
- color: #fff;
- }
- /* 时间选择 */
- ::v-deep .el-input--small .el-input__inner {
- width: 200px;
- height: 36px;
- line-height: 36px;
- }
- .el-date-editor.el-input {
- width: 200px;
- height: 36px;
- line-height: 36px;
- }
- ::v-deep .el-date-editor.el-input .el-input__inner {
- height: 36px;
- line-height: 36px;
- }
- /* 单位框背景颜色 */
- ::v-deep .vue-treeselect__control {
- background: #004d86 !important;
- color: #fff;
- }
- /* 单位下拉菜单选中字体颜色 */
- ::v-deep .vue-treeselect__single-value {
- color: #fff !important;
- }
- /* 分页按钮 */
- ::v-deep .el-pagination.is-background .el-pager li {
- background-color: #004d86;
- color: #fff;
- }
- ::v-deep .el-pagination.is-background .btn-next {
- background-color: #004d86;
- color: #fff;
- }
- /* 底部确定取消按钮 */
- ::v-deep .el-dialog__footer {
- padding: 18px 50px;
- margin-right: 42px;
- }
- /* 增加按钮弹框 */
- ::v-deep .el-dialog {
- width: 1060px !important;
- }
- ::v-deep .el-dialog__body {
- padding: none !important;
- }
- /* 小手样式 */
- ::v-deep .el-table__cell {
- cursor: pointer;
- }
- .el-button--mini {
- width: 80px !important;
- border: 1px solid transparent;
- padding: 3px 8px;
- font-size: 14px;
- line-height: 1.5;
- border-radius: 3px;
- color: #fff;
- background-color: #1890ff;
- }
- </style>
|