1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342 |
- <template>
- <div class="app-container workTask">
- <el-form
- :model="queryParams"
- ref="queryForm"
- :inline="true"
- v-show="showSearch"
- label-width="120px"
- >
- <el-form-item prop="type">
- <el-select v-model="queryParams.type">
- <el-option label="周计划" value="week"></el-option>
- <el-option label="月计划" value="month"></el-option>
- <el-option label="年计划" value="year"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="executableUnit">
- <el-select
- v-model="queryParams.executableUnit"
- placeholder="请选择执行单位"
- >
- <el-option label="大队" value="productionBrigade"></el-option>
- <el-option label="发射一营" value="launch1"></el-option>
- <el-option label="发射二营" value="launch2"></el-option>
- <el-option label="发射三营" value="launch3"></el-option>
- <el-option label="发射四营" value="launch4"></el-option>
- <el-option label="技术部" value="technology"></el-option>
- <el-option label="后勤部" value="logistics"></el-option>
- <el-option label="后勤营一连" value="logistics1"></el-option>
- <el-option label="后勤营二连" value="logistics2"></el-option>
- <el-option label="后勤营三连" value="logistics3"></el-option>
- <el-option label="参谋部" value="adviser"></el-option>
- <el-option label="保障部" value="safeguard"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="unitId">
- <el-select v-model="queryParams.unitId" placeholder="请选择发布单位">
- <el-option label="大队" value="productionBrigade"></el-option>
- <el-option label="发射一营" value="launch1"></el-option>
- <el-option label="发射二营" value="launch2"></el-option>
- <el-option label="发射三营" value="launch3"></el-option>
- <el-option label="发射四营" value="launch4"></el-option>
- <el-option label="技术部" value="technology"></el-option>
- <el-option label="后勤部" value="logistics"></el-option>
- <el-option label="后勤营一连" value="logistics1"></el-option>
- <el-option label="后勤营二连" value="logistics2"></el-option>
- <el-option label="后勤营三连" value="logistics3"></el-option>
- <el-option label="参谋部" value="adviser"></el-option>
- <el-option label="保障部" value="safeguard"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button
- type="primary"
- icon="el-icon-refresh"
- size="mini"
- @click="resetQuery"
- >重置</el-button
- >
- </el-form-item>
- </el-form>
- <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="['workingArrangements:workTask: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="['workingArrangements:workTask: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="['workingArrangements:workTask: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="['workingArrangements:workTask:export']"
- >导出</el-button
- >
- </el-col>
- <right-toolbar
- :showSearch.sync="showSearch"
- @queryTable="getList"
- ></right-toolbar>
- </el-row>
- <el-table
- v-loading="loading"
- :data="workTaskList"
- @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="name" />
- <el-table-column
- label="发布单位"
- align="center"
- prop="adminId"
- :formatter="unit3Format"
- />
- <el-table-column
- label="任务类型"
- align="center"
- prop="type"
- :formatter="unit4Format"
- />
- <el-table-column
- label="执行人"
- align="center"
- prop="peopleId"
- :formatter="unit2Format"
- />
- <!-- <el-table-column label="编号" align="center" prop="number" /> -->
- <el-table-column
- label="任务开始时间"
- align="center"
- prop="startTime"
- width="180"
- >
- <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="180"
- >
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.endTime, "{y}-{m}-{d}") }}</span>
- </template>
- </el-table-column>
- <el-table-column label="描述" align="center" prop="contents" show-overflow-tooltip/>
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- >
- <template slot-scope="scope">
- <el-button
- size="btlook"
- type="text"
- @click="ViewProgress(scope.row)"
- v-if="scope.row.common == 1"
- >
- <span>进度录入</span>
- </el-button>
- <el-button
- size="btlook"
- type="text"
- @click="handleChakan(scope.row)"
- v-if="scope.row.common == 1"
- >
- <!-- 单人进度 -->
- <span class="chakan">查看</span>
- </el-button>
- <el-button
- size="btlook"
- type="text"
- @click="handleChakan1(scope.row)"
- v-if="scope.row.common == 2 || scope.row.common == 0"
- >
- <!-- 多人进度 -->
- <span class="chakan">进度查看</span>
- </el-button>
- <el-button
- size="btu"
- type="text"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['workingArrangements:planTask:edit']"
- v-if="scope.row.common == 2"
- >修改</el-button
- >
- <el-button
- size="btd"
- type="text"
- @click="handleDelete(scope.row)"
- v-if="scope.row.common == 2"
- v-hasPermi="['workingArrangements:planTask:remove']"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 添加或修改工作任务对话框 -->
- <el-dialog :title="title" :visible.sync="open" width="980px" append-to-body>
- <el-form
- ref="form"
- :model="form"
- :rules="rules"
- label-width="100px"
- :inline="true"
- >
- <div class="jiben">基本信息</div>
- <el-form-item label="任务名称" prop="name">
- <el-input
- v-model="form.name"
- placeholder="请输入任务名称"
- @click.native="planName"
- />
- </el-form-item>
- <el-form-item label="任务编号" prop="number">
- <el-input
- label="任务编号"
- v-model="form.number"
- :disabled="true"
- class="ipt"
- >
- </el-input>
- </el-form-item>
- <el-form-item label="发布单位" prop="unitName2">
- <treeselect
- v-model="form.adminId"
- :options="part"
- placeholder="选择单位"
- @select="selectPeo"
- class="threeselects"
- />
- </el-form-item>
- <el-form-item label="执行单位" prop="unitName">
- <treeselect
- v-model="form.unitId"
- :options="users"
- placeholder="请选择执行单位"
- class="threeselects"
- @select="selectPeo1"
- />
- </el-form-item>
- <el-form-item label="任务类型" prop="type">
- <el-select
- v-model="queryParams.type"
- placeholder="请选择任务类型"
- style="width: 200px"
- clearable
- size="small"
- >
- <el-option
- v-for="dict in dict.type.work_type"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- @click.native="chooseplan"
- />
- </el-select>
- </el-form-item>
- <div>
- <el-form-item label="执行人" prop="peopleName" label-width="100px">
- <div>
- <el-select
- multiple
- v-model="form.peopleName"
- placeholder="请选择执行人"
- id="execute"
- ref="peoplenames"
- >
- <el-option
- v-for="item in executor"
- :key="item.deptId"
- :label="item.nickName"
- :value="item.userId"
- id="execute"
- @click.native="returnExecutor(item.deptId, item.nickName)"
- />
- </el-select>
- </div>
- </el-form-item>
- </div>
- <el-form-item label="开始时间" prop="startTime">
- <el-date-picker
- clearable
- size="small"
- v-model="form.startTime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="请选择任务开始时间"
- style="width: 200px"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="结束时间" label-width="100px" 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>
- <div class="jiben">任务附件</div>
- <el-form-item style="margin-left: 30px">
- <fileUpload v-model="form.file" />
- </el-form-item>
- <div class="jiben">任务描述</div>
- <el-form-item prop="contents">
- <el-input
- v-model="form.contents"
- type="textarea"
- placeholder="请输入内容"
- style="width: 950px"
- />
- </el-form-item>
- <div class="jiben">备注</div>
- <el-form-item prop="remark">
- <el-input
- v-model="form.remark"
- type="textarea"
- placeholder="请输入内容"
- style="width: 950px"
- />
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">确 定</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 进度录入弹框 -->
- <el-dialog
- :title="title"
- :visible.sync="open1"
- width="980px"
- append-to-body
- class="el-dialog__header"
- >
- <el-form
- ref="Progress"
- :model="Progress"
- :rules="rules1"
- label-width="100px"
- :inline="true"
- >
- <div class="jiben">完成进度</div>
- <el-form-item prop="planProgress">
- <div>
- <el-input-number
- v-model="Progress.planProgress"
- controls-position="right"
- :min="0"
- :max="100"
- ></el-input-number>
- <el-progress
- :text-inside="true"
- :stroke-width="24"
- :percentage="Progress.planProgress"
- color="rgba(41, 231, 205, 1)"
- class="jinduProgress"
- ></el-progress>
- </div>
- </el-form-item>
- <div class="jiben">附件</div>
- <el-form-item>
- <fileUpload v-model="Progress.file" />
- </el-form-item>
- <div class="jiben">备注</div>
- <el-form-item prop="remark">
- <el-input
- v-model="Progress.remark"
- type="textarea"
- placeholder="请输入内容"
- />
- </el-form-item>
- <div class="jiben">完成时间</div>
- <el-form-item prop="accomplishTime">
- <el-date-picker
- class="comtimer"
- clearable
- size="small"
- v-model="Progress.accomplishTime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择完成时间"
- >
- </el-date-picker>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm1">确 定</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 进度查看弹框 -->
- <el-dialog
- :title="title"
- :visible.sync="open2"
- width="980px"
- append-to-body
- class="el-dialog__header"
- >
- <el-form
- ref="singleTable"
- :model="singleTable"
- :rules="rules"
- label-width="100px"
- :inline="true"
- >
- <div class="jiben">完成进度</div>
- <!-- <el-form-item prop="comPlan"> -->
- <!-- <el-input
- label="计划名称"
- v-model="ProgressLook.comPlan"
- class="big"
- /> -->
- <!-- </el-form-item> -->
- <el-progress
- :text-inside="true"
- :stroke-width="24"
- :percentage="singleTable.planProgresses"
- style="margin-bottom: 20px"
- color="rgba(41, 231, 205, 1)"
- ></el-progress>
- <div class="jiben">任务周期</div>
- <el-form-item prop="comWeek">
- <!-- <el-input
- v-model="singleTable."
- class="big"
- /> -->
- <div class="thistext">
- {{ singleTable.startTime }} 至 {{ singleTable.endTime }}
- </div>
- </el-form-item>
- <!-- <div class="thistext"></div> -->
- <div class="jiben">附件文档</div>
- <el-form-item prop="file">
- <el-input
- label="附件名称"
- v-model="singleTable.fileName"
- style="width: 820px"
- />
- <!-- <div>{{singleTableb.fileName}}</div> -->
- <a
- :href="singleTable.file"
- download
- title="下载"
- style="color: white; margin-left: 10px"
- class="downloadfile"
- >下载附件</a
- >
- </el-form-item>
- <!-- <a :href="singleTable.planProgress.file" style="color:white">下载附件</a> -->
- <div class="jiben">备注</div>
- <!-- <el-form-item prop="remark">
- <el-input
- v-model="ProgressLook.remark"
- type="textarea"
- placeholder="请输入内容"
- />
- </el-form-item> -->
- <div class="thistext">{{ singleTable.remark }}</div>
- <div class="jiben">任务描述</div>
- <!-- <el-form-item prop="contents">
- <el-input
- v-model="ProgressLook.contents"
- type="textarea"
- placeholder="请输入内容"
- />
- </el-form-item> -->
- <div class="thistext">{{ singleTable.contents }}</div>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm2">确 定</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 进度查看1弹框 -->
- <el-dialog
- :title="title"
- :visible.sync="open3"
- width="980px"
- append-to-body
- class="el-dialog__header"
- >
- <el-form
- ref="moreTable"
- :model="moreTable"
- :rules="rules"
- label-width="100px"
- :inline="true"
- >
- <div class="jiben">完成进度</div>
- <el-progress
- :text-inside="true"
- :stroke-width="24"
- :percentage="comstatus"
- style="margin-bottom: 20px"
- color="rgba(41, 231, 205, 1)"
- ></el-progress>
- <div class="jiben">任务周期</div>
- <div class="thistext">
- {{ moreTable.startTime }} 至 {{ moreTable.endTime }}
- </div>
- <!-- <div class="thistext"></div> -->
- <div class="jiben">附件文档</div>
- <el-form-item prop="file">
- <!-- <el-input label="计划名称" v-model="ProgressLook.file" class="big" /> -->
- <!-- <a :href="moreTable.file" download title="下载" style="color:white;margin-left:10px">下载附件</a> -->
- <el-input
- label="附件名称"
- v-model="singleTable.fileName"
- style="width: 820px"
- />
- <!-- <div>{{singleTableb.fileName}}</div> -->
- <a
- :href="moreTable.file"
- download
- title="下载"
- style="color: white; margin-left: 10px"
- class="downloadfile"
- >下载附件</a
- >
- </el-form-item>
- <div class="jiben">备注</div>
- <div class="thistext">{{ moreTable.remark }}</div>
- <div class="jiben">任务描述</div>
- <div class="thistext">{{ moreTable.contents }}</div>
- <div class="jiben">执行人信息</div>
- <el-table
- :data="moreTable.workProgresses"
- border
- style="width: 100%; background: #004d86"
- class="tabless"
- >
- <el-table-column prop="peopleName" label="执行人" width="180">
- </el-table-column>
- <el-table-column label="任务周期" width="190">
- <template slot-scope="scope">
- <div>{{ scope.row.taskCycle }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="schedule" label="进度">
- <template slot-scope="scope">
- <el-progress
- :text-inside="true"
- :stroke-width="24"
- :percentage="scope.row.schedule"
- style="margin-bottom: 20px"
- color="rgba(41, 231, 205, 1)"
- ></el-progress>
- </template>
- </el-table-column>
- <el-table-column prop="accomplishTime" label="完成时间" width="180">
- </el-table-column>
- <el-table-column label="状态" width="180">
- <template slot-scope="scope">
- <div>{{ scope.row.schedule == 100 ? "完成" : "未完成" }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="address" label="下载">
- <template slot-scope="scope">
- <a :href="scope.row.file" download>下载附件</a>
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm2">确 定</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- listWorkTask,
- getWorkTask,
- delWorkTask,
- addWorkTask,
- updateWorkTask,
- exportWorkTask,
- singProgress,
- moreProgress,
- uploadProgress,
- } from "@/api/workingArrangements/workTask";
- import {
- deptUser,
- allUser,
- getDept,
- getDeptList,
- } from "@/api/workingArrangements/workTask";
- import { getDicts } from "@/api/system/dict/data";
- import Treeselect from "@riophae/vue-treeselect";
- import "@riophae/vue-treeselect/dist/vue-treeselect.css";
- import { getDept2 } from "@/api/grassrootsregistration/bdglmeeting";
- export default {
- name: "WorkTask",
- dicts: ["work_type"],
- components: { Treeselect },
- data() {
- return {
- // 遮罩层
- loading: true,
- // 导出遮罩层
- exportLoading: false,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 工作任务表格数据
- workTaskList: [],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- // 显示进度录入框
- open1: false,
- // 显示进度查看框
- open2: false,
- // 显示多人进度查看框
- open3: false,
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- name: null,
- peopleId: null,
- number: null,
- type: null,
- startTime: null,
- endTime: null,
- file: null,
- fileName: null,
- contents: null,
- adminId: null,
- unitId: null,
- unitName: null,
- createtime: null,
- updatetime: null,
- peopleName: null,
- unitName2: null,
- taskProgress: null,
- releaseUnit: null,
- executableUnit: null,
- },
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- number: [{ required: true, message: "编号不能为空", trigger: "blur" }],
- },
- rules1: {
- planProgress: [
- { required: true, message: "请输入完成进度", trigger: "blur" },
- ],
- },
- // 发布单位
- part: [],
- // 执行单位
- users: [],
- // 执行人
- executor: [],
- rylist: [],
- // 查询字典
- dictType: {
- dictType: "work_type",
- },
- ziDian: [],
- // 部门列表
- getdeptList: [],
- // 单人进度查看框
- singleTable: [],
- // 多人进度查看框
- moreTable: [],
- comstatus: 0,
- // 进度录入参数
- Progress: {
- schedule: "",
- file: "",
- remark: "",
- accomplishTime: "",
- taskId: "",
- id: "",
- },
- };
- },
- created() {
- this.getList();
- this.getdept();
- allUser().then((res) => {
- this.rylist = res.rows;
- });
- this.getdict();
- this.chooseplan();
- getDeptList().then((res) => {
- this.getdeptList = res.data;
- });
- // this.handleChakan()
- },
- methods: {
- /** 进度录入按钮操作 */
- ViewProgress(row) {
- // this.reset();
- this.open1 = true;
- this.title = "进度录入";
- this.jinduId = row.id;
- singProgress(this.jinduId).then((res) => {
- console.log(res.data);
- this.Progress.id = res.data.workProgress.id;
- this.Progress.taskId = res.data.id;
- this.Progress.planProgress = res.data.workProgress.schedule;
- });
- },
- // 进度查看单人进度
- handleChakan(row) {
- this.reset();
- this.open2 = true;
- this.title = "进度查看";
- // 获取当前行的id
- console.log(row.id);
- singProgress(row.id).then((res) => {
- this.singleTable = res.data;
- this.singleTable.planProgresses =
- this.singleTable.workProgress.schedule;
- this.Progress.id = this.singleTable.workProgress.id;
- // console.log(this.Progress.id);
- // this.singleTable.jindu=singleTable.planProgress.schedule
- // console.log(this.singleTable)
- });
- },
- // 多人进度查看
- handleChakan1(row) {
- this.reset();
- this.open3 = true;
- this.title = "进度查看";
- // 获取当前行的id
- moreProgress(row.id).then((res) => {
- this.moreTable = res.data;
- console.log(this.moreTable);
- this.moreTable.workProgresses.forEach((item) => {
- this.comstatus +=
- item.schedule / this.moreTable.workProgresses.length;
- });
- });
- },
- /** 查询工作任务列表 */
- getList() {
- this.loading = true;
- listWorkTask(this.queryParams).then((response) => {
- this.workTaskList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.comstatus = 0;
- this.reset();
- this.open1 = false;
- this.open2 = false;
- this.open3 = false;
- },
- // 表单重置
- reset() {
- this.form = {
- id: null,
- name: null,
- peopleId: null,
- number: null,
- type: null,
- startTime: null,
- endTime: null,
- file: null,
- fileName: null,
- remark: null,
- contents: null,
- adminId: null,
- unitId: null,
- unitName: null,
- createtime: null,
- updatetime: null,
- peopleName: null,
- unitName2: null,
- taskProgress: null,
- releaseUnit: null,
- executableUnit: 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;
- },
- // 获取执行人
- getZhuChi(id) {
- deptUser(id).then((res) => {
- // this.renYuan = res.data;
- this.executor = res.data;
- console.log(this.executor);
- });
- },
- // 发布单位选中触发
- selectPeo(val) {
- this.form.adminId = val.id;
- this.getZhuChi(this.form.adminId);
- },
- // 执行单位选中触发
- selectPeo1(val) {
- this.form.unitId = val.id;
- this.form.peopleName = "";
- this.getZhuChi(this.form.unitId);
- },
- // 查询计划类型
- getdict() {
- getDicts(this.dictType.dictType).then((res) => {
- this.ziDian = res.data;
- });
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.reset();
- this.open = true;
- this.title = "添加工作任务";
- // 获取执行单位列表
- getDept2().then((res) => {
- // console.log(res,2)
- this.users = res.data;
- console.log(this.users);
- });
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.reset();
- getDept2().then((res) => {
- // console.log(res,2)
- this.users = res.data;
- console.log(this.users);
- });
- const id = row.id || this.ids;
- getWorkTask(id).then((response) => {
- this.form = response.data;
- // this.getDept2()
- this.getZhuChi(this.form.unitId);
- this.form.peopleName = this.form.peopleName.split(",").map(Number);
- this.open = true;
- this.title = "修改工作计划";
- });
- },
- unit2Format(row, column) {
- var deptName = "";
- if (
- parseInt(this.workTaskList[0].common) == 1 ||
- this.workTaskList[0].common == 2
- ) {
- this.rylist.map((item) => {
- row.peopleName.split(",").forEach((items, index) => {
- if (item.userId == items) {
- deptName += item.nickName + " ";
- }
- });
- });
- } else if (parseInt(this.workTaskList[0].common) == 0) {
- this.rylist.map((item) => {
- row.peopleName.split(",").forEach((items, index) => {
- if (item.userId == items) {
- deptName += item.nickName + " ";
- }
- });
- });
- }
- return deptName;
- },
- unit3Format(row, column) {
- var deptName = "";
- if (
- parseInt(this.workTaskList[0].common) == 1 ||
- this.workTaskList[0].common == 2
- ) {
- this.getdeptList.map((item) => {
- if (item.deptId == row.adminId) {
- deptName = item.deptName;
- }
- });
- } else if (parseInt(this.workTaskList[0].common) == 0) {
- this.part[0].children.map((item) => {
- if (item.id == row.adminId) {
- deptName = item.label;
- }
- });
- }
- return deptName;
- },
- unit4Format(row, column) {
- var deptName = "";
- this.ziDian.map((item) => {
- if (item.dictSort == row.type) {
- deptName = item.dictLabel;
- }
- });
- return deptName;
- },
- // 选择计划
- chooseplan() {
- this.form.type = this.queryParams.type;
- },
- /** 提交按钮 */
- submitForm() {
- console.log(this.form);
- this.$refs["form"].validate((valid) => {
- if (valid) {
- if (this.form.adminId === this.form.unitId) {
- alert("发布单位和执行单位不能相同");
- } else {
- this.form.peopleName = this.form.peopleName.join(",");
- this.form.peopleId = this.form.peopleName;
- console.log(this.form);
- if (this.form.id != null) {
- updateWorkTask(this.form).then((response) => {
- this.$modal.msgSuccess("修改成功");
- this.queryParams.type = "";
- this.open = false;
- this.getList();
- });
- } else {
- addWorkTask(this.form).then((response) => {
- this.$modal.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- });
- }
- }
- }
- });
- // this.$refs["form"].validate((valid) => {
- // if (valid) {
- // this.form.peopleName = this.form.peopleName.join(",");
- // this.form.peopleId = this.form.peopleName;
- // console.log(this.form);
- // if (this.form.id != null) {
- // updateWorkTask(this.form).then((response) => {
- // this.$modal.msgSuccess("修改成功");
- // this.open = false;
- // this.getList();
- // });
- // } else {
- // addWorkTask(this.form).then((response) => {
- // this.$modal.msgSuccess("新增成功");
- // this.open = false;
- // this.getList();
- // });
- // }
- // }
- // });
- },
- submitForm1() {
- this.$refs["Progress"].validate((valid) => {
- if (valid) {
- this.Progress.taskId = this.jinduId;
- this.Progress.schedule = this.Progress.planProgress;
- console.log(this.Progress);
- uploadProgress(this.Progress).then((res1) => {
- console.log(res1);
- this.$modal.msgSuccess("上传成功");
- // this.Progress
- this.reset();
- this.open1 = false;
- this.getList();
- });
- }
- });
- },
- submitForm2() {
- this.comstatus = 0;
- this.open2 = false;
- this.open3 = false;
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const ids = row.id || this.ids;
- this.$modal
- .confirm('是否确认删除工作任务编号为"' + ids + '"的数据项?')
- .then(function () {
- return delWorkTask(ids);
- })
- .then(() => {
- this.getList();
- this.$modal.msgSuccess("删除成功");
- })
- .catch(() => {});
- },
- /** 导出按钮操作 */
- handleExport() {
- const queryParams = this.queryParams;
- this.$modal
- .confirm("是否确认导出所有工作任务数据项?")
- .then(() => {
- this.exportLoading = true;
- return exportWorkTask(queryParams);
- })
- .then((response) => {
- this.$download.name(response.msg);
- this.exportLoading = false;
- })
- .catch(() => {});
- },
- // 发布单位接口
- getdept() {
- getDept().then((res) => {
- this.part = res.data;
- });
- },
- // 获取执行单位列表
- getdeptlist() {
- getDeptList().then((res) => {
- this.ExecutableUnit = res.data;
- console.log(this.ExecutableUnit);
- });
- },
- // 选中执行人id
- // choosedeptid(id) {
- // console.log(id)
- // this.form.unitId = id;
- // deptUser(id).then((res) => {
- // this.executor = res.data;
- // });
- // },
- // 计划编号
- planName() {
- let date = new Date();
- let year = date.getFullYear();
- let month =
- date.getMonth() + 1 <= 9
- ? "0" + (date.getMonth() + 1)
- : date.getMonth() + 1;
- let day = date.getDate();
- let hour = date.getHours() <= 9 ? "0" + date.getHours() : date.getHours();
- let minute =
- date.getMinutes <= 9 ? "0" + date.getMinutes() : date.getMinutes();
- this.form.number = year + month + day + hour + minute;
- console.log(111);
- console.log(this.form.number);
- },
- // 获取发布单位id
- issueunit(id) {
- this.form.adminId = id;
- },
- },
- };
- </script>
- <style>
- .el-input__inner {
- height: 36px;
- background-color: #00365f;
- color: #fff;
- }
- .el-select-dropdown {
- background-color: white;
- }
- .el-dialog__wrapper .el-form-item__label {
- color: white !important;
- }
- .el-dialog {
- background-color: #004d86 !important;
- }
- .el-form-item__label {
- width: 30%;
- }
- .el-textarea {
- width: 70%;
- }
- .el-dialog__title {
- color: white;
- }
- .el-dialog__header {
- border-bottom: 1px solid #718a9d;
- }
- .el-textarea__inner {
- width: 945px;
- height: 104px;
- }
- .el-textarea__inner {
- width: 940px;
- height: 104px;
- }
- /* 表宽度 */
- .el-input {
- width: 200px;
- }
- .el-date-editor.el-input,
- .el-date-editor.el-input__inner {
- width: 200px;
- }
- /* 执行 */
- #execute {
- width: 510px;
- /* width: auto; */
- }
- .el-input--suffix {
- width: auto;
- }
- /* 上传附件样式 */
- .el-icon-document {
- padding: 3px 5px;
- color: white;
- }
- .el-upload-list__item:hover {
- background-color: #00365f;
- }
- /* 上传附件的删除按钮样式 */
- .el-link--inner {
- margin-left: 3px;
- }
- /* 弹框背景 */
- .el-dialog {
- background: #00365f;
- }
- .el-dialog__title {
- color: white;
- }
- .el-input .el-input__inner {
- background: rgba(0, 0, 0, 0);
- }
- /* 下拉框样式 */
- .el-select-dropdown__wrap .el-scrollbar__view {
- background-color: white;
- }
- /* 计划附件 */
- .el-upload__tip {
- position: absolute;
- top: -5px;
- width: 500px;
- left: 100px;
- color: white;
- }
- /* 上传附件样式 */
- .el-icon-document {
- padding: 3px 5px;
- color: white;
- }
- .el-upload-list__item:hover {
- background-color: #00365f;
- }
- /* 修改编号样式 */
- .ipt .el-input__inner {
- background-color: #004d86 !important;
- }
- /* 进度查看 */
- .el-button--btlook.is-active,
- .el-button--btlook:active {
- background: #32a5d3;
- border-color: #32a5d3;
- color: #ffffff;
- }
- .el-button--btlook:focus,
- .el-button--btlook:hover {
- background: #32a5d3;
- border-color: #32a5d3;
- color: #ffffff;
- }
- .el-button--btlook {
- width: 70px !important;
- border: 1px solid transparent;
- padding: 3px 8px;
- font-size: 14px;
- line-height: 1.5;
- border-radius: 3px;
- color: #fff;
- background-color: #32a5d3;
- }
- .big .el-input__inner {
- width: 940px;
- }
- /* 树形 */
- .threeselects {
- width: 200px;
- }
- .threeselects .vue-treeselect__input {
- background-color: #004d86;
- /* color: white; */
- }
- .el-form-item__content {
- /* color: white; */
- border-bottom: 1px solid #004d86;
- }
- .vue-treeselect__control {
- background-color: #004d86;
- border-bottom: 1px solid white;
- /* color: whi; */
- /* color: white; */
- }
- .vue-treeselect__placeholder {
- color: white;
- }
- .change_plan_type .el-input__inner {
- width: 200px;
- }
- /* 表格样式 */
- .el-table__empty-block {
- background-color: #004d86;
- }
- .el-table {
- background-color: #004d86;
- }
- .comtimer .el-input__inner {
- width: 940px;
- }
- /* 备注 */
- .thistext {
- color: white;
- width: 940px;
- border: 1px solid #fff;
- border-radius: 4px;
- height: auto !important;
- line-height: 36px;
- text-indent: 1em;
- margin-bottom: 20px;
- }
- /* 完成进度 */
- .complue .el-input__inner {
- width: 940px;
- }
- .complue {
- width: 940px;
- }
- /* 进度 */
- .jinduProgress {
- width: 740px;
- position: absolute;
- left: 210px;
- top: 5px;
- }
- /* 表格 */
- .tabless .el-table__row {
- background-color: #004d86;
- }
- .tabless table {
- border: 1px solid white;
- }
- .has-gutter {
- background-color: #004d86;
- }
- .el-table tr:nth-child(odd) {
- background-color: #004d86;
- }
- .el-table tr:nth-child(even) {
- background-color: #004d86;
- }
- /* 下载按钮 */
- .downloadfile {
- border: 1px solid white;
- display: inline-block;
- width: 100px;
- height: 33px;
- border-radius: 5px;
- line-height: 33px;
- text-align: center;
- }
- .el-table__row {
- border-bottom: 1px solid white;
- }
- .el-input-number__increase {
- background-color: #004d86;
- }
- .el-input-number__decrease {
- background-color: #004d86;
- }
- /* 进度条百分比 */
- .el-progress-bar__innerText {
- color: #004d86;
- /* font-weight: 200; */
- }
- .el-progress-bar__outer {
- background-color: rgba(25, 98, 153, 1);
- }
- /* 上下箭头 */
- .el-icon-arrow-up,
- .el-icon-arrow-down {
- color: white;
- }
- .vue-treeselect__single-value {
- color: white;
- }
- /* 文字多余部分省略 */
- .el-table_1_column_8 .cell {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- </style>
|