index.vue 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342
  1. <template>
  2. <div class="app-container workTask">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="120px"
  9. >
  10. <el-form-item prop="type">
  11. <el-select v-model="queryParams.type">
  12. <el-option label="周计划" value="week"></el-option>
  13. <el-option label="月计划" value="month"></el-option>
  14. <el-option label="年计划" value="year"></el-option>
  15. </el-select>
  16. </el-form-item>
  17. <el-form-item prop="executableUnit">
  18. <el-select
  19. v-model="queryParams.executableUnit"
  20. placeholder="请选择执行单位"
  21. >
  22. <el-option label="大队" value="productionBrigade"></el-option>
  23. <el-option label="发射一营" value="launch1"></el-option>
  24. <el-option label="发射二营" value="launch2"></el-option>
  25. <el-option label="发射三营" value="launch3"></el-option>
  26. <el-option label="发射四营" value="launch4"></el-option>
  27. <el-option label="技术部" value="technology"></el-option>
  28. <el-option label="后勤部" value="logistics"></el-option>
  29. <el-option label="后勤营一连" value="logistics1"></el-option>
  30. <el-option label="后勤营二连" value="logistics2"></el-option>
  31. <el-option label="后勤营三连" value="logistics3"></el-option>
  32. <el-option label="参谋部" value="adviser"></el-option>
  33. <el-option label="保障部" value="safeguard"></el-option>
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item prop="unitId">
  37. <el-select v-model="queryParams.unitId" placeholder="请选择发布单位">
  38. <el-option label="大队" value="productionBrigade"></el-option>
  39. <el-option label="发射一营" value="launch1"></el-option>
  40. <el-option label="发射二营" value="launch2"></el-option>
  41. <el-option label="发射三营" value="launch3"></el-option>
  42. <el-option label="发射四营" value="launch4"></el-option>
  43. <el-option label="技术部" value="technology"></el-option>
  44. <el-option label="后勤部" value="logistics"></el-option>
  45. <el-option label="后勤营一连" value="logistics1"></el-option>
  46. <el-option label="后勤营二连" value="logistics2"></el-option>
  47. <el-option label="后勤营三连" value="logistics3"></el-option>
  48. <el-option label="参谋部" value="adviser"></el-option>
  49. <el-option label="保障部" value="safeguard"></el-option>
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item>
  53. <el-button
  54. type="primary"
  55. icon="el-icon-refresh"
  56. size="mini"
  57. @click="resetQuery"
  58. >重置</el-button
  59. >
  60. </el-form-item>
  61. </el-form>
  62. <el-row :gutter="10" class="mb8">
  63. <el-col :span="1.5">
  64. <el-button
  65. type="primary"
  66. plain
  67. icon="el-icon-plus"
  68. size="mini"
  69. @click="handleAdd"
  70. v-hasPermi="['workingArrangements:workTask:add']"
  71. >新增</el-button
  72. >
  73. </el-col>
  74. <el-col :span="1.5">
  75. <el-button
  76. type="success"
  77. plain
  78. icon="el-icon-edit"
  79. size="mini"
  80. :disabled="single"
  81. @click="handleUpdate"
  82. v-hasPermi="['workingArrangements:workTask:edit']"
  83. >修改</el-button
  84. >
  85. </el-col>
  86. <el-col :span="1.5">
  87. <el-button
  88. type="danger"
  89. plain
  90. icon="el-icon-delete"
  91. size="mini"
  92. :disabled="multiple"
  93. @click="handleDelete"
  94. v-hasPermi="['workingArrangements:workTask:remove']"
  95. >删除</el-button
  96. >
  97. </el-col>
  98. <el-col :span="1.5">
  99. <el-button
  100. type="warning"
  101. plain
  102. icon="el-icon-download"
  103. size="mini"
  104. :loading="exportLoading"
  105. @click="handleExport"
  106. v-hasPermi="['workingArrangements:workTask:export']"
  107. >导出</el-button
  108. >
  109. </el-col>
  110. <right-toolbar
  111. :showSearch.sync="showSearch"
  112. @queryTable="getList"
  113. ></right-toolbar>
  114. </el-row>
  115. <el-table
  116. v-loading="loading"
  117. :data="workTaskList"
  118. @selection-change="handleSelectionChange"
  119. :header-cell-style="{ background: '#003C69', color: 'white' }"
  120. >
  121. <el-table-column type="selection" width="55" align="center" />
  122. <el-table-column label="名称" align="center" prop="name" />
  123. <el-table-column
  124. label="发布单位"
  125. align="center"
  126. prop="adminId"
  127. :formatter="unit3Format"
  128. />
  129. <el-table-column
  130. label="任务类型"
  131. align="center"
  132. prop="type"
  133. :formatter="unit4Format"
  134. />
  135. <el-table-column
  136. label="执行人"
  137. align="center"
  138. prop="peopleId"
  139. :formatter="unit2Format"
  140. />
  141. <!-- <el-table-column label="编号" align="center" prop="number" /> -->
  142. <el-table-column
  143. label="任务开始时间"
  144. align="center"
  145. prop="startTime"
  146. width="180"
  147. >
  148. <template slot-scope="scope">
  149. <span>{{ parseTime(scope.row.startTime, "{y}-{m}-{d}") }}</span>
  150. </template>
  151. </el-table-column>
  152. <el-table-column
  153. label="任务结束时间"
  154. align="center"
  155. prop="endTime"
  156. width="180"
  157. >
  158. <template slot-scope="scope">
  159. <span>{{ parseTime(scope.row.endTime, "{y}-{m}-{d}") }}</span>
  160. </template>
  161. </el-table-column>
  162. <el-table-column label="描述" align="center" prop="contents" show-overflow-tooltip/>
  163. <el-table-column
  164. label="操作"
  165. align="center"
  166. class-name="small-padding fixed-width"
  167. >
  168. <template slot-scope="scope">
  169. <el-button
  170. size="btlook"
  171. type="text"
  172. @click="ViewProgress(scope.row)"
  173. v-if="scope.row.common == 1"
  174. >
  175. <span>进度录入</span>
  176. </el-button>
  177. <el-button
  178. size="btlook"
  179. type="text"
  180. @click="handleChakan(scope.row)"
  181. v-if="scope.row.common == 1"
  182. >
  183. <!-- 单人进度 -->
  184. <span class="chakan">查看</span>
  185. </el-button>
  186. <el-button
  187. size="btlook"
  188. type="text"
  189. @click="handleChakan1(scope.row)"
  190. v-if="scope.row.common == 2 || scope.row.common == 0"
  191. >
  192. <!-- 多人进度 -->
  193. <span class="chakan">进度查看</span>
  194. </el-button>
  195. <el-button
  196. size="btu"
  197. type="text"
  198. @click="handleUpdate(scope.row)"
  199. v-hasPermi="['workingArrangements:planTask:edit']"
  200. v-if="scope.row.common == 2"
  201. >修改</el-button
  202. >
  203. <el-button
  204. size="btd"
  205. type="text"
  206. @click="handleDelete(scope.row)"
  207. v-if="scope.row.common == 2"
  208. v-hasPermi="['workingArrangements:planTask:remove']"
  209. >删除</el-button
  210. >
  211. </template>
  212. </el-table-column>
  213. </el-table>
  214. <pagination
  215. v-show="total > 0"
  216. :total="total"
  217. :page.sync="queryParams.pageNum"
  218. :limit.sync="queryParams.pageSize"
  219. @pagination="getList"
  220. />
  221. <!-- 添加或修改工作任务对话框 -->
  222. <el-dialog :title="title" :visible.sync="open" width="980px" append-to-body>
  223. <el-form
  224. ref="form"
  225. :model="form"
  226. :rules="rules"
  227. label-width="100px"
  228. :inline="true"
  229. >
  230. <div class="jiben">基本信息</div>
  231. <el-form-item label="任务名称" prop="name">
  232. <el-input
  233. v-model="form.name"
  234. placeholder="请输入任务名称"
  235. @click.native="planName"
  236. />
  237. </el-form-item>
  238. <el-form-item label="任务编号" prop="number">
  239. <el-input
  240. label="任务编号"
  241. v-model="form.number"
  242. :disabled="true"
  243. class="ipt"
  244. >
  245. </el-input>
  246. </el-form-item>
  247. <el-form-item label="发布单位" prop="unitName2">
  248. <treeselect
  249. v-model="form.adminId"
  250. :options="part"
  251. placeholder="选择单位"
  252. @select="selectPeo"
  253. class="threeselects"
  254. />
  255. </el-form-item>
  256. <el-form-item label="执行单位" prop="unitName">
  257. <treeselect
  258. v-model="form.unitId"
  259. :options="users"
  260. placeholder="请选择执行单位"
  261. class="threeselects"
  262. @select="selectPeo1"
  263. />
  264. </el-form-item>
  265. <el-form-item label="任务类型" prop="type">
  266. <el-select
  267. v-model="queryParams.type"
  268. placeholder="请选择任务类型"
  269. style="width: 200px"
  270. clearable
  271. size="small"
  272. >
  273. <el-option
  274. v-for="dict in dict.type.work_type"
  275. :key="dict.value"
  276. :label="dict.label"
  277. :value="dict.value"
  278. @click.native="chooseplan"
  279. />
  280. </el-select>
  281. </el-form-item>
  282. <div>
  283. <el-form-item label="执行人" prop="peopleName" label-width="100px">
  284. <div>
  285. <el-select
  286. multiple
  287. v-model="form.peopleName"
  288. placeholder="请选择执行人"
  289. id="execute"
  290. ref="peoplenames"
  291. >
  292. <el-option
  293. v-for="item in executor"
  294. :key="item.deptId"
  295. :label="item.nickName"
  296. :value="item.userId"
  297. id="execute"
  298. @click.native="returnExecutor(item.deptId, item.nickName)"
  299. />
  300. </el-select>
  301. </div>
  302. </el-form-item>
  303. </div>
  304. <el-form-item label="开始时间" prop="startTime">
  305. <el-date-picker
  306. clearable
  307. size="small"
  308. v-model="form.startTime"
  309. type="date"
  310. value-format="yyyy-MM-dd"
  311. placeholder="请选择任务开始时间"
  312. style="width: 200px"
  313. >
  314. </el-date-picker>
  315. </el-form-item>
  316. <el-form-item label="结束时间" label-width="100px" prop="endTime">
  317. <el-date-picker
  318. clearable
  319. size="small"
  320. v-model="form.endTime"
  321. type="date"
  322. value-format="yyyy-MM-dd"
  323. placeholder="请选择任务结束时间"
  324. >
  325. </el-date-picker>
  326. </el-form-item>
  327. <div class="jiben">任务附件</div>
  328. <el-form-item style="margin-left: 30px">
  329. <fileUpload v-model="form.file" />
  330. </el-form-item>
  331. <div class="jiben">任务描述</div>
  332. <el-form-item prop="contents">
  333. <el-input
  334. v-model="form.contents"
  335. type="textarea"
  336. placeholder="请输入内容"
  337. style="width: 950px"
  338. />
  339. </el-form-item>
  340. <div class="jiben">备注</div>
  341. <el-form-item prop="remark">
  342. <el-input
  343. v-model="form.remark"
  344. type="textarea"
  345. placeholder="请输入内容"
  346. style="width: 950px"
  347. />
  348. </el-form-item>
  349. </el-form>
  350. <div slot="footer" class="dialog-footer">
  351. <el-button type="primary" @click="submitForm">确 定</el-button>
  352. <el-button @click="cancel">取 消</el-button>
  353. </div>
  354. </el-dialog>
  355. <!-- 进度录入弹框 -->
  356. <el-dialog
  357. :title="title"
  358. :visible.sync="open1"
  359. width="980px"
  360. append-to-body
  361. class="el-dialog__header"
  362. >
  363. <el-form
  364. ref="Progress"
  365. :model="Progress"
  366. :rules="rules1"
  367. label-width="100px"
  368. :inline="true"
  369. >
  370. <div class="jiben">完成进度</div>
  371. <el-form-item prop="planProgress">
  372. <div>
  373. <el-input-number
  374. v-model="Progress.planProgress"
  375. controls-position="right"
  376. :min="0"
  377. :max="100"
  378. ></el-input-number>
  379. <el-progress
  380. :text-inside="true"
  381. :stroke-width="24"
  382. :percentage="Progress.planProgress"
  383. color="rgba(41, 231, 205, 1)"
  384. class="jinduProgress"
  385. ></el-progress>
  386. </div>
  387. </el-form-item>
  388. <div class="jiben">附件</div>
  389. <el-form-item>
  390. <fileUpload v-model="Progress.file" />
  391. </el-form-item>
  392. <div class="jiben">备注</div>
  393. <el-form-item prop="remark">
  394. <el-input
  395. v-model="Progress.remark"
  396. type="textarea"
  397. placeholder="请输入内容"
  398. />
  399. </el-form-item>
  400. <div class="jiben">完成时间</div>
  401. <el-form-item prop="accomplishTime">
  402. <el-date-picker
  403. class="comtimer"
  404. clearable
  405. size="small"
  406. v-model="Progress.accomplishTime"
  407. type="date"
  408. value-format="yyyy-MM-dd"
  409. placeholder="选择完成时间"
  410. >
  411. </el-date-picker>
  412. </el-form-item>
  413. </el-form>
  414. <div slot="footer" class="dialog-footer">
  415. <el-button type="primary" @click="submitForm1">确 定</el-button>
  416. <el-button @click="cancel">取 消</el-button>
  417. </div>
  418. </el-dialog>
  419. <!-- 进度查看弹框 -->
  420. <el-dialog
  421. :title="title"
  422. :visible.sync="open2"
  423. width="980px"
  424. append-to-body
  425. class="el-dialog__header"
  426. >
  427. <el-form
  428. ref="singleTable"
  429. :model="singleTable"
  430. :rules="rules"
  431. label-width="100px"
  432. :inline="true"
  433. >
  434. <div class="jiben">完成进度</div>
  435. <!-- <el-form-item prop="comPlan"> -->
  436. <!-- <el-input
  437. label="计划名称"
  438. v-model="ProgressLook.comPlan"
  439. class="big"
  440. /> -->
  441. <!-- </el-form-item> -->
  442. <el-progress
  443. :text-inside="true"
  444. :stroke-width="24"
  445. :percentage="singleTable.planProgresses"
  446. style="margin-bottom: 20px"
  447. color="rgba(41, 231, 205, 1)"
  448. ></el-progress>
  449. <div class="jiben">任务周期</div>
  450. <el-form-item prop="comWeek">
  451. <!-- <el-input
  452. v-model="singleTable."
  453. class="big"
  454. /> -->
  455. <div class="thistext">
  456. {{ singleTable.startTime }} 至 {{ singleTable.endTime }}
  457. </div>
  458. </el-form-item>
  459. <!-- <div class="thistext"></div> -->
  460. <div class="jiben">附件文档</div>
  461. <el-form-item prop="file">
  462. <el-input
  463. label="附件名称"
  464. v-model="singleTable.fileName"
  465. style="width: 820px"
  466. />
  467. <!-- <div>{{singleTableb.fileName}}</div> -->
  468. <a
  469. :href="singleTable.file"
  470. download
  471. title="下载"
  472. style="color: white; margin-left: 10px"
  473. class="downloadfile"
  474. >下载附件</a
  475. >
  476. </el-form-item>
  477. <!-- <a :href="singleTable.planProgress.file" style="color:white">下载附件</a> -->
  478. <div class="jiben">备注</div>
  479. <!-- <el-form-item prop="remark">
  480. <el-input
  481. v-model="ProgressLook.remark"
  482. type="textarea"
  483. placeholder="请输入内容"
  484. />
  485. </el-form-item> -->
  486. <div class="thistext">{{ singleTable.remark }}</div>
  487. <div class="jiben">任务描述</div>
  488. <!-- <el-form-item prop="contents">
  489. <el-input
  490. v-model="ProgressLook.contents"
  491. type="textarea"
  492. placeholder="请输入内容"
  493. />
  494. </el-form-item> -->
  495. <div class="thistext">{{ singleTable.contents }}</div>
  496. </el-form>
  497. <div slot="footer" class="dialog-footer">
  498. <el-button type="primary" @click="submitForm2">确 定</el-button>
  499. <el-button @click="cancel">取 消</el-button>
  500. </div>
  501. </el-dialog>
  502. <!-- 进度查看1弹框 -->
  503. <el-dialog
  504. :title="title"
  505. :visible.sync="open3"
  506. width="980px"
  507. append-to-body
  508. class="el-dialog__header"
  509. >
  510. <el-form
  511. ref="moreTable"
  512. :model="moreTable"
  513. :rules="rules"
  514. label-width="100px"
  515. :inline="true"
  516. >
  517. <div class="jiben">完成进度</div>
  518. <el-progress
  519. :text-inside="true"
  520. :stroke-width="24"
  521. :percentage="comstatus"
  522. style="margin-bottom: 20px"
  523. color="rgba(41, 231, 205, 1)"
  524. ></el-progress>
  525. <div class="jiben">任务周期</div>
  526. <div class="thistext">
  527. {{ moreTable.startTime }} 至 {{ moreTable.endTime }}
  528. </div>
  529. <!-- <div class="thistext"></div> -->
  530. <div class="jiben">附件文档</div>
  531. <el-form-item prop="file">
  532. <!-- <el-input label="计划名称" v-model="ProgressLook.file" class="big" /> -->
  533. <!-- <a :href="moreTable.file" download title="下载" style="color:white;margin-left:10px">下载附件</a> -->
  534. <el-input
  535. label="附件名称"
  536. v-model="singleTable.fileName"
  537. style="width: 820px"
  538. />
  539. <!-- <div>{{singleTableb.fileName}}</div> -->
  540. <a
  541. :href="moreTable.file"
  542. download
  543. title="下载"
  544. style="color: white; margin-left: 10px"
  545. class="downloadfile"
  546. >下载附件</a
  547. >
  548. </el-form-item>
  549. <div class="jiben">备注</div>
  550. <div class="thistext">{{ moreTable.remark }}</div>
  551. <div class="jiben">任务描述</div>
  552. <div class="thistext">{{ moreTable.contents }}</div>
  553. <div class="jiben">执行人信息</div>
  554. <el-table
  555. :data="moreTable.workProgresses"
  556. border
  557. style="width: 100%; background: #004d86"
  558. class="tabless"
  559. >
  560. <el-table-column prop="peopleName" label="执行人" width="180">
  561. </el-table-column>
  562. <el-table-column label="任务周期" width="190">
  563. <template slot-scope="scope">
  564. <div>{{ scope.row.taskCycle }}</div>
  565. </template>
  566. </el-table-column>
  567. <el-table-column prop="schedule" label="进度">
  568. <template slot-scope="scope">
  569. <el-progress
  570. :text-inside="true"
  571. :stroke-width="24"
  572. :percentage="scope.row.schedule"
  573. style="margin-bottom: 20px"
  574. color="rgba(41, 231, 205, 1)"
  575. ></el-progress>
  576. </template>
  577. </el-table-column>
  578. <el-table-column prop="accomplishTime" label="完成时间" width="180">
  579. </el-table-column>
  580. <el-table-column label="状态" width="180">
  581. <template slot-scope="scope">
  582. <div>{{ scope.row.schedule == 100 ? "完成" : "未完成" }}</div>
  583. </template>
  584. </el-table-column>
  585. <el-table-column prop="address" label="下载">
  586. <template slot-scope="scope">
  587. <a :href="scope.row.file" download>下载附件</a>
  588. </template>
  589. </el-table-column>
  590. </el-table>
  591. </el-form>
  592. <div slot="footer" class="dialog-footer">
  593. <el-button type="primary" @click="submitForm2">确 定</el-button>
  594. <el-button @click="cancel">取 消</el-button>
  595. </div>
  596. </el-dialog>
  597. </div>
  598. </template>
  599. <script>
  600. import {
  601. listWorkTask,
  602. getWorkTask,
  603. delWorkTask,
  604. addWorkTask,
  605. updateWorkTask,
  606. exportWorkTask,
  607. singProgress,
  608. moreProgress,
  609. uploadProgress,
  610. } from "@/api/workingArrangements/workTask";
  611. import {
  612. deptUser,
  613. allUser,
  614. getDept,
  615. getDeptList,
  616. } from "@/api/workingArrangements/workTask";
  617. import { getDicts } from "@/api/system/dict/data";
  618. import Treeselect from "@riophae/vue-treeselect";
  619. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  620. import { getDept2 } from "@/api/grassrootsregistration/bdglmeeting";
  621. export default {
  622. name: "WorkTask",
  623. dicts: ["work_type"],
  624. components: { Treeselect },
  625. data() {
  626. return {
  627. // 遮罩层
  628. loading: true,
  629. // 导出遮罩层
  630. exportLoading: false,
  631. // 选中数组
  632. ids: [],
  633. // 非单个禁用
  634. single: true,
  635. // 非多个禁用
  636. multiple: true,
  637. // 显示搜索条件
  638. showSearch: true,
  639. // 总条数
  640. total: 0,
  641. // 工作任务表格数据
  642. workTaskList: [],
  643. // 弹出层标题
  644. title: "",
  645. // 是否显示弹出层
  646. open: false,
  647. // 显示进度录入框
  648. open1: false,
  649. // 显示进度查看框
  650. open2: false,
  651. // 显示多人进度查看框
  652. open3: false,
  653. // 查询参数
  654. queryParams: {
  655. pageNum: 1,
  656. pageSize: 10,
  657. name: null,
  658. peopleId: null,
  659. number: null,
  660. type: null,
  661. startTime: null,
  662. endTime: null,
  663. file: null,
  664. fileName: null,
  665. contents: null,
  666. adminId: null,
  667. unitId: null,
  668. unitName: null,
  669. createtime: null,
  670. updatetime: null,
  671. peopleName: null,
  672. unitName2: null,
  673. taskProgress: null,
  674. releaseUnit: null,
  675. executableUnit: null,
  676. },
  677. // 表单参数
  678. form: {},
  679. // 表单校验
  680. rules: {
  681. number: [{ required: true, message: "编号不能为空", trigger: "blur" }],
  682. },
  683. rules1: {
  684. planProgress: [
  685. { required: true, message: "请输入完成进度", trigger: "blur" },
  686. ],
  687. },
  688. // 发布单位
  689. part: [],
  690. // 执行单位
  691. users: [],
  692. // 执行人
  693. executor: [],
  694. rylist: [],
  695. // 查询字典
  696. dictType: {
  697. dictType: "work_type",
  698. },
  699. ziDian: [],
  700. // 部门列表
  701. getdeptList: [],
  702. // 单人进度查看框
  703. singleTable: [],
  704. // 多人进度查看框
  705. moreTable: [],
  706. comstatus: 0,
  707. // 进度录入参数
  708. Progress: {
  709. schedule: "",
  710. file: "",
  711. remark: "",
  712. accomplishTime: "",
  713. taskId: "",
  714. id: "",
  715. },
  716. };
  717. },
  718. created() {
  719. this.getList();
  720. this.getdept();
  721. allUser().then((res) => {
  722. this.rylist = res.rows;
  723. });
  724. this.getdict();
  725. this.chooseplan();
  726. getDeptList().then((res) => {
  727. this.getdeptList = res.data;
  728. });
  729. // this.handleChakan()
  730. },
  731. methods: {
  732. /** 进度录入按钮操作 */
  733. ViewProgress(row) {
  734. // this.reset();
  735. this.open1 = true;
  736. this.title = "进度录入";
  737. this.jinduId = row.id;
  738. singProgress(this.jinduId).then((res) => {
  739. console.log(res.data);
  740. this.Progress.id = res.data.workProgress.id;
  741. this.Progress.taskId = res.data.id;
  742. this.Progress.planProgress = res.data.workProgress.schedule;
  743. });
  744. },
  745. // 进度查看单人进度
  746. handleChakan(row) {
  747. this.reset();
  748. this.open2 = true;
  749. this.title = "进度查看";
  750. // 获取当前行的id
  751. console.log(row.id);
  752. singProgress(row.id).then((res) => {
  753. this.singleTable = res.data;
  754. this.singleTable.planProgresses =
  755. this.singleTable.workProgress.schedule;
  756. this.Progress.id = this.singleTable.workProgress.id;
  757. // console.log(this.Progress.id);
  758. // this.singleTable.jindu=singleTable.planProgress.schedule
  759. // console.log(this.singleTable)
  760. });
  761. },
  762. // 多人进度查看
  763. handleChakan1(row) {
  764. this.reset();
  765. this.open3 = true;
  766. this.title = "进度查看";
  767. // 获取当前行的id
  768. moreProgress(row.id).then((res) => {
  769. this.moreTable = res.data;
  770. console.log(this.moreTable);
  771. this.moreTable.workProgresses.forEach((item) => {
  772. this.comstatus +=
  773. item.schedule / this.moreTable.workProgresses.length;
  774. });
  775. });
  776. },
  777. /** 查询工作任务列表 */
  778. getList() {
  779. this.loading = true;
  780. listWorkTask(this.queryParams).then((response) => {
  781. this.workTaskList = response.rows;
  782. this.total = response.total;
  783. this.loading = false;
  784. });
  785. },
  786. // 取消按钮
  787. cancel() {
  788. this.open = false;
  789. this.comstatus = 0;
  790. this.reset();
  791. this.open1 = false;
  792. this.open2 = false;
  793. this.open3 = false;
  794. },
  795. // 表单重置
  796. reset() {
  797. this.form = {
  798. id: null,
  799. name: null,
  800. peopleId: null,
  801. number: null,
  802. type: null,
  803. startTime: null,
  804. endTime: null,
  805. file: null,
  806. fileName: null,
  807. remark: null,
  808. contents: null,
  809. adminId: null,
  810. unitId: null,
  811. unitName: null,
  812. createtime: null,
  813. updatetime: null,
  814. peopleName: null,
  815. unitName2: null,
  816. taskProgress: null,
  817. releaseUnit: null,
  818. executableUnit: null,
  819. };
  820. this.resetForm("form");
  821. },
  822. /** 搜索按钮操作 */
  823. handleQuery() {
  824. this.queryParams.pageNum = 1;
  825. this.getList();
  826. },
  827. /** 重置按钮操作 */
  828. resetQuery() {
  829. this.resetForm("queryForm");
  830. this.handleQuery();
  831. },
  832. // 多选框选中数据
  833. handleSelectionChange(selection) {
  834. this.ids = selection.map((item) => item.id);
  835. this.single = selection.length !== 1;
  836. this.multiple = !selection.length;
  837. },
  838. // 获取执行人
  839. getZhuChi(id) {
  840. deptUser(id).then((res) => {
  841. // this.renYuan = res.data;
  842. this.executor = res.data;
  843. console.log(this.executor);
  844. });
  845. },
  846. // 发布单位选中触发
  847. selectPeo(val) {
  848. this.form.adminId = val.id;
  849. this.getZhuChi(this.form.adminId);
  850. },
  851. // 执行单位选中触发
  852. selectPeo1(val) {
  853. this.form.unitId = val.id;
  854. this.form.peopleName = "";
  855. this.getZhuChi(this.form.unitId);
  856. },
  857. // 查询计划类型
  858. getdict() {
  859. getDicts(this.dictType.dictType).then((res) => {
  860. this.ziDian = res.data;
  861. });
  862. },
  863. /** 新增按钮操作 */
  864. handleAdd() {
  865. this.reset();
  866. this.open = true;
  867. this.title = "添加工作任务";
  868. // 获取执行单位列表
  869. getDept2().then((res) => {
  870. // console.log(res,2)
  871. this.users = res.data;
  872. console.log(this.users);
  873. });
  874. },
  875. /** 修改按钮操作 */
  876. handleUpdate(row) {
  877. this.reset();
  878. getDept2().then((res) => {
  879. // console.log(res,2)
  880. this.users = res.data;
  881. console.log(this.users);
  882. });
  883. const id = row.id || this.ids;
  884. getWorkTask(id).then((response) => {
  885. this.form = response.data;
  886. // this.getDept2()
  887. this.getZhuChi(this.form.unitId);
  888. this.form.peopleName = this.form.peopleName.split(",").map(Number);
  889. this.open = true;
  890. this.title = "修改工作计划";
  891. });
  892. },
  893. unit2Format(row, column) {
  894. var deptName = "";
  895. if (
  896. parseInt(this.workTaskList[0].common) == 1 ||
  897. this.workTaskList[0].common == 2
  898. ) {
  899. this.rylist.map((item) => {
  900. row.peopleName.split(",").forEach((items, index) => {
  901. if (item.userId == items) {
  902. deptName += item.nickName + " ";
  903. }
  904. });
  905. });
  906. } else if (parseInt(this.workTaskList[0].common) == 0) {
  907. this.rylist.map((item) => {
  908. row.peopleName.split(",").forEach((items, index) => {
  909. if (item.userId == items) {
  910. deptName += item.nickName + " ";
  911. }
  912. });
  913. });
  914. }
  915. return deptName;
  916. },
  917. unit3Format(row, column) {
  918. var deptName = "";
  919. if (
  920. parseInt(this.workTaskList[0].common) == 1 ||
  921. this.workTaskList[0].common == 2
  922. ) {
  923. this.getdeptList.map((item) => {
  924. if (item.deptId == row.adminId) {
  925. deptName = item.deptName;
  926. }
  927. });
  928. } else if (parseInt(this.workTaskList[0].common) == 0) {
  929. this.part[0].children.map((item) => {
  930. if (item.id == row.adminId) {
  931. deptName = item.label;
  932. }
  933. });
  934. }
  935. return deptName;
  936. },
  937. unit4Format(row, column) {
  938. var deptName = "";
  939. this.ziDian.map((item) => {
  940. if (item.dictSort == row.type) {
  941. deptName = item.dictLabel;
  942. }
  943. });
  944. return deptName;
  945. },
  946. // 选择计划
  947. chooseplan() {
  948. this.form.type = this.queryParams.type;
  949. },
  950. /** 提交按钮 */
  951. submitForm() {
  952. console.log(this.form);
  953. this.$refs["form"].validate((valid) => {
  954. if (valid) {
  955. if (this.form.adminId === this.form.unitId) {
  956. alert("发布单位和执行单位不能相同");
  957. } else {
  958. this.form.peopleName = this.form.peopleName.join(",");
  959. this.form.peopleId = this.form.peopleName;
  960. console.log(this.form);
  961. if (this.form.id != null) {
  962. updateWorkTask(this.form).then((response) => {
  963. this.$modal.msgSuccess("修改成功");
  964. this.queryParams.type = "";
  965. this.open = false;
  966. this.getList();
  967. });
  968. } else {
  969. addWorkTask(this.form).then((response) => {
  970. this.$modal.msgSuccess("新增成功");
  971. this.open = false;
  972. this.getList();
  973. });
  974. }
  975. }
  976. }
  977. });
  978. // this.$refs["form"].validate((valid) => {
  979. // if (valid) {
  980. // this.form.peopleName = this.form.peopleName.join(",");
  981. // this.form.peopleId = this.form.peopleName;
  982. // console.log(this.form);
  983. // if (this.form.id != null) {
  984. // updateWorkTask(this.form).then((response) => {
  985. // this.$modal.msgSuccess("修改成功");
  986. // this.open = false;
  987. // this.getList();
  988. // });
  989. // } else {
  990. // addWorkTask(this.form).then((response) => {
  991. // this.$modal.msgSuccess("新增成功");
  992. // this.open = false;
  993. // this.getList();
  994. // });
  995. // }
  996. // }
  997. // });
  998. },
  999. submitForm1() {
  1000. this.$refs["Progress"].validate((valid) => {
  1001. if (valid) {
  1002. this.Progress.taskId = this.jinduId;
  1003. this.Progress.schedule = this.Progress.planProgress;
  1004. console.log(this.Progress);
  1005. uploadProgress(this.Progress).then((res1) => {
  1006. console.log(res1);
  1007. this.$modal.msgSuccess("上传成功");
  1008. // this.Progress
  1009. this.reset();
  1010. this.open1 = false;
  1011. this.getList();
  1012. });
  1013. }
  1014. });
  1015. },
  1016. submitForm2() {
  1017. this.comstatus = 0;
  1018. this.open2 = false;
  1019. this.open3 = false;
  1020. },
  1021. /** 删除按钮操作 */
  1022. handleDelete(row) {
  1023. const ids = row.id || this.ids;
  1024. this.$modal
  1025. .confirm('是否确认删除工作任务编号为"' + ids + '"的数据项?')
  1026. .then(function () {
  1027. return delWorkTask(ids);
  1028. })
  1029. .then(() => {
  1030. this.getList();
  1031. this.$modal.msgSuccess("删除成功");
  1032. })
  1033. .catch(() => {});
  1034. },
  1035. /** 导出按钮操作 */
  1036. handleExport() {
  1037. const queryParams = this.queryParams;
  1038. this.$modal
  1039. .confirm("是否确认导出所有工作任务数据项?")
  1040. .then(() => {
  1041. this.exportLoading = true;
  1042. return exportWorkTask(queryParams);
  1043. })
  1044. .then((response) => {
  1045. this.$download.name(response.msg);
  1046. this.exportLoading = false;
  1047. })
  1048. .catch(() => {});
  1049. },
  1050. // 发布单位接口
  1051. getdept() {
  1052. getDept().then((res) => {
  1053. this.part = res.data;
  1054. });
  1055. },
  1056. // 获取执行单位列表
  1057. getdeptlist() {
  1058. getDeptList().then((res) => {
  1059. this.ExecutableUnit = res.data;
  1060. console.log(this.ExecutableUnit);
  1061. });
  1062. },
  1063. // 选中执行人id
  1064. // choosedeptid(id) {
  1065. // console.log(id)
  1066. // this.form.unitId = id;
  1067. // deptUser(id).then((res) => {
  1068. // this.executor = res.data;
  1069. // });
  1070. // },
  1071. // 计划编号
  1072. planName() {
  1073. let date = new Date();
  1074. let year = date.getFullYear();
  1075. let month =
  1076. date.getMonth() + 1 <= 9
  1077. ? "0" + (date.getMonth() + 1)
  1078. : date.getMonth() + 1;
  1079. let day = date.getDate();
  1080. let hour = date.getHours() <= 9 ? "0" + date.getHours() : date.getHours();
  1081. let minute =
  1082. date.getMinutes <= 9 ? "0" + date.getMinutes() : date.getMinutes();
  1083. this.form.number = year + month + day + hour + minute;
  1084. console.log(111);
  1085. console.log(this.form.number);
  1086. },
  1087. // 获取发布单位id
  1088. issueunit(id) {
  1089. this.form.adminId = id;
  1090. },
  1091. },
  1092. };
  1093. </script>
  1094. <style>
  1095. .el-input__inner {
  1096. height: 36px;
  1097. background-color: #00365f;
  1098. color: #fff;
  1099. }
  1100. .el-select-dropdown {
  1101. background-color: white;
  1102. }
  1103. .el-dialog__wrapper .el-form-item__label {
  1104. color: white !important;
  1105. }
  1106. .el-dialog {
  1107. background-color: #004d86 !important;
  1108. }
  1109. .el-form-item__label {
  1110. width: 30%;
  1111. }
  1112. .el-textarea {
  1113. width: 70%;
  1114. }
  1115. .el-dialog__title {
  1116. color: white;
  1117. }
  1118. .el-dialog__header {
  1119. border-bottom: 1px solid #718a9d;
  1120. }
  1121. .el-textarea__inner {
  1122. width: 945px;
  1123. height: 104px;
  1124. }
  1125. .el-textarea__inner {
  1126. width: 940px;
  1127. height: 104px;
  1128. }
  1129. /* 表宽度 */
  1130. .el-input {
  1131. width: 200px;
  1132. }
  1133. .el-date-editor.el-input,
  1134. .el-date-editor.el-input__inner {
  1135. width: 200px;
  1136. }
  1137. /* 执行 */
  1138. #execute {
  1139. width: 510px;
  1140. /* width: auto; */
  1141. }
  1142. .el-input--suffix {
  1143. width: auto;
  1144. }
  1145. /* 上传附件样式 */
  1146. .el-icon-document {
  1147. padding: 3px 5px;
  1148. color: white;
  1149. }
  1150. .el-upload-list__item:hover {
  1151. background-color: #00365f;
  1152. }
  1153. /* 上传附件的删除按钮样式 */
  1154. .el-link--inner {
  1155. margin-left: 3px;
  1156. }
  1157. /* 弹框背景 */
  1158. .el-dialog {
  1159. background: #00365f;
  1160. }
  1161. .el-dialog__title {
  1162. color: white;
  1163. }
  1164. .el-input .el-input__inner {
  1165. background: rgba(0, 0, 0, 0);
  1166. }
  1167. /* 下拉框样式 */
  1168. .el-select-dropdown__wrap .el-scrollbar__view {
  1169. background-color: white;
  1170. }
  1171. /* 计划附件 */
  1172. .el-upload__tip {
  1173. position: absolute;
  1174. top: -5px;
  1175. width: 500px;
  1176. left: 100px;
  1177. color: white;
  1178. }
  1179. /* 上传附件样式 */
  1180. .el-icon-document {
  1181. padding: 3px 5px;
  1182. color: white;
  1183. }
  1184. .el-upload-list__item:hover {
  1185. background-color: #00365f;
  1186. }
  1187. /* 修改编号样式 */
  1188. .ipt .el-input__inner {
  1189. background-color: #004d86 !important;
  1190. }
  1191. /* 进度查看 */
  1192. .el-button--btlook.is-active,
  1193. .el-button--btlook:active {
  1194. background: #32a5d3;
  1195. border-color: #32a5d3;
  1196. color: #ffffff;
  1197. }
  1198. .el-button--btlook:focus,
  1199. .el-button--btlook:hover {
  1200. background: #32a5d3;
  1201. border-color: #32a5d3;
  1202. color: #ffffff;
  1203. }
  1204. .el-button--btlook {
  1205. width: 70px !important;
  1206. border: 1px solid transparent;
  1207. padding: 3px 8px;
  1208. font-size: 14px;
  1209. line-height: 1.5;
  1210. border-radius: 3px;
  1211. color: #fff;
  1212. background-color: #32a5d3;
  1213. }
  1214. .big .el-input__inner {
  1215. width: 940px;
  1216. }
  1217. /* 树形 */
  1218. .threeselects {
  1219. width: 200px;
  1220. }
  1221. .threeselects .vue-treeselect__input {
  1222. background-color: #004d86;
  1223. /* color: white; */
  1224. }
  1225. .el-form-item__content {
  1226. /* color: white; */
  1227. border-bottom: 1px solid #004d86;
  1228. }
  1229. .vue-treeselect__control {
  1230. background-color: #004d86;
  1231. border-bottom: 1px solid white;
  1232. /* color: whi; */
  1233. /* color: white; */
  1234. }
  1235. .vue-treeselect__placeholder {
  1236. color: white;
  1237. }
  1238. .change_plan_type .el-input__inner {
  1239. width: 200px;
  1240. }
  1241. /* 表格样式 */
  1242. .el-table__empty-block {
  1243. background-color: #004d86;
  1244. }
  1245. .el-table {
  1246. background-color: #004d86;
  1247. }
  1248. .comtimer .el-input__inner {
  1249. width: 940px;
  1250. }
  1251. /* 备注 */
  1252. .thistext {
  1253. color: white;
  1254. width: 940px;
  1255. border: 1px solid #fff;
  1256. border-radius: 4px;
  1257. height: auto !important;
  1258. line-height: 36px;
  1259. text-indent: 1em;
  1260. margin-bottom: 20px;
  1261. }
  1262. /* 完成进度 */
  1263. .complue .el-input__inner {
  1264. width: 940px;
  1265. }
  1266. .complue {
  1267. width: 940px;
  1268. }
  1269. /* 进度 */
  1270. .jinduProgress {
  1271. width: 740px;
  1272. position: absolute;
  1273. left: 210px;
  1274. top: 5px;
  1275. }
  1276. /* 表格 */
  1277. .tabless .el-table__row {
  1278. background-color: #004d86;
  1279. }
  1280. .tabless table {
  1281. border: 1px solid white;
  1282. }
  1283. .has-gutter {
  1284. background-color: #004d86;
  1285. }
  1286. .el-table tr:nth-child(odd) {
  1287. background-color: #004d86;
  1288. }
  1289. .el-table tr:nth-child(even) {
  1290. background-color: #004d86;
  1291. }
  1292. /* 下载按钮 */
  1293. .downloadfile {
  1294. border: 1px solid white;
  1295. display: inline-block;
  1296. width: 100px;
  1297. height: 33px;
  1298. border-radius: 5px;
  1299. line-height: 33px;
  1300. text-align: center;
  1301. }
  1302. .el-table__row {
  1303. border-bottom: 1px solid white;
  1304. }
  1305. .el-input-number__increase {
  1306. background-color: #004d86;
  1307. }
  1308. .el-input-number__decrease {
  1309. background-color: #004d86;
  1310. }
  1311. /* 进度条百分比 */
  1312. .el-progress-bar__innerText {
  1313. color: #004d86;
  1314. /* font-weight: 200; */
  1315. }
  1316. .el-progress-bar__outer {
  1317. background-color: rgba(25, 98, 153, 1);
  1318. }
  1319. /* 上下箭头 */
  1320. .el-icon-arrow-up,
  1321. .el-icon-arrow-down {
  1322. color: white;
  1323. }
  1324. .vue-treeselect__single-value {
  1325. color: white;
  1326. }
  1327. /* 文字多余部分省略 */
  1328. .el-table_1_column_8 .cell {
  1329. overflow: hidden;
  1330. text-overflow: ellipsis;
  1331. white-space: nowrap;
  1332. }
  1333. </style>