index.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="68px"
  9. class="shouForm"
  10. >
  11. <el-form-item prop="unitname">
  12. <el-input
  13. placeholder="请输入单位"
  14. v-model="queryParams.unitname"
  15. @input="handleQuery"
  16. />
  17. </el-form-item>
  18. <el-form-item>
  19. <el-button size="btr" @click="resetQuery">重置</el-button>
  20. </el-form-item>
  21. </el-form>
  22. <el-row :gutter="10" class="mb8">
  23. <el-col :span="1.5">
  24. <el-button
  25. type="primary"
  26. plain
  27. icon="el-icon-plus"
  28. size="mini"
  29. @click="handleAdd"
  30. v-hasPermi="['grassrootsregistration:bdgldrill:add']"
  31. >新增</el-button
  32. >
  33. </el-col>
  34. <el-col :span="1.5">
  35. <el-button
  36. type="success"
  37. plain
  38. icon="el-icon-edit"
  39. size="mini"
  40. :disabled="single"
  41. @click="handleUpdate"
  42. v-hasPermi="['grassrootsregistration:bdgldrill:edit']"
  43. >修改</el-button
  44. >
  45. </el-col>
  46. <el-col :span="1.5">
  47. <el-button
  48. type="danger"
  49. plain
  50. icon="el-icon-delete"
  51. size="mini"
  52. :disabled="multiple"
  53. @click="handleDelete"
  54. v-hasPermi="['grassrootsregistration:bdgldrill:remove']"
  55. >删除</el-button
  56. >
  57. </el-col>
  58. <!-- <el-col :span="1.5">
  59. <el-button
  60. type="warning"
  61. plain
  62. icon="el-icon-download"
  63. size="mini"
  64. :loading="exportLoading"
  65. @click="handleExport"
  66. v-hasPermi="['grassrootsregistration:bdgldrill:export']"
  67. >导出</el-button
  68. >
  69. </el-col> -->
  70. </el-row>
  71. <el-table
  72. :data="bdgldrillList"
  73. @selection-change="handleSelectionChange"
  74. :header-cell-style="{ background: '#003C69', color: 'white' }"
  75. >
  76. <el-table-column type="selection" width="55" align="center" />
  77. <el-table-column label="序号" align="center" prop="id">
  78. <template scope="scope">
  79. <span>{{
  80. (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
  81. }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column
  85. label="训练类别"
  86. align="center"
  87. prop="trainingCategory"
  88. />
  89. <el-table-column label="训练地点" align="center" prop="address" />
  90. <el-table-column
  91. label="训练时间"
  92. align="center"
  93. prop="drillTime"
  94. width="150"
  95. >
  96. <template slot-scope="scope">
  97. <span>{{ parseTime(scope.row.drillTime, "{y}-{m}-{d}") }}</span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column
  101. label="训练结束时间"
  102. align="center"
  103. prop="drillEndtime"
  104. width="150"
  105. >
  106. <template slot-scope="scope">
  107. <span>{{ parseTime(scope.row.drillEndtime, "{y}-{m}-{d}") }}</span>
  108. </template>
  109. </el-table-column>
  110. <el-table-column
  111. label="单位"
  112. align="center"
  113. prop="unitname"
  114. width="200"
  115. />
  116. <!-- <el-table-column label="应训" align="center" prop="oughtTo" /> -->
  117. <el-table-column
  118. label="文件名称"
  119. align="center"
  120. prop="filename"
  121. show-overflow-tooltip
  122. />
  123. <el-table-column label="装备" align="center" prop="equipment" />
  124. <el-table-column label="弹药" align="center" prop="ammunition" />
  125. <el-table-column label="摩托时间" align="center" prop="mototime" />
  126. <el-table-column
  127. label="备注"
  128. align="center"
  129. prop="fail"
  130. show-overflow-tooltip
  131. />
  132. <!-- <el-table-column label="创建人id" align="center" prop="createId" /> -->
  133. <el-table-column
  134. label="操作"
  135. align="center"
  136. class-name="small-padding fixed-width"
  137. width="200"
  138. fixed="right"
  139. >
  140. <template slot-scope="scope">
  141. <el-button size="btk" type="text" @click="handleChakan(scope.row)"
  142. ><span class="chakan">查看</span></el-button
  143. >
  144. <el-button
  145. size="btu"
  146. type="text"
  147. @click="handleUpdate(scope.row)"
  148. v-hasPermi="['grassrootsregistration:bdgldrill:edit']"
  149. >修改</el-button
  150. >
  151. <el-button
  152. size="btd"
  153. type="text"
  154. @click="handleDelete(scope.row)"
  155. v-hasPermi="['grassrootsregistration:bdgldrill:remove']"
  156. >删除</el-button
  157. >
  158. </template>
  159. </el-table-column>
  160. </el-table>
  161. <pagination
  162. v-show="total > 0"
  163. :total="total"
  164. :page.sync="queryParams.pageNum"
  165. :limit.sync="queryParams.pageSize"
  166. @pagination="getList"
  167. />
  168. <!-- 添加军事训练登记簿对话框 -->
  169. <el-dialog
  170. :title="title"
  171. :visible.sync="open"
  172. width="1060px"
  173. append-to-body
  174. :close-on-click-modal="false"
  175. >
  176. <el-form
  177. ref="form"
  178. :model="form"
  179. :rules="rules"
  180. :inline="true"
  181. label-width="120px"
  182. >
  183. <div class="jiben">基本信息</div>
  184. <el-form-item label="单位" prop="unitId">
  185. <treeselect
  186. @select="selectPeo"
  187. v-model="form.unitId"
  188. :options="rese"
  189. placeholder="请选择单位"
  190. />
  191. </el-form-item>
  192. <el-form-item
  193. label="训练类别"
  194. prop="trainingCategory"
  195. style="margin-left: 100px"
  196. >
  197. <treeselect
  198. v-model="form.trainingCategory"
  199. :options="treeselects"
  200. :normalizer="defaultProps"
  201. placeholder="请选择训练类别"
  202. @select="trainingCategoryselectPeo"
  203. />
  204. </el-form-item>
  205. <el-form-item
  206. label="证明材料"
  207. prop="project2"
  208. style="display: inline-block; width: 900px"
  209. >
  210. <fileUpload
  211. v-model="form.filepath"
  212. style="display: inline-block"
  213. :show-file-list="false"
  214. class="m-l-20"
  215. :limit="1"
  216. />
  217. </el-form-item>
  218. <el-form-item label="训练开始时间" prop="drillTime">
  219. <el-date-picker
  220. clearable
  221. size="small"
  222. v-model="form.drillTime"
  223. type="date"
  224. value-format="yyyy-MM-dd"
  225. placeholder="选择训练开始时间"
  226. >
  227. </el-date-picker>
  228. </el-form-item>
  229. <el-form-item
  230. label="训练结束时间"
  231. prop="drillEndtime"
  232. style="margin-left: 130px"
  233. >
  234. <!-- <el-date-picker
  235. clearable
  236. size="small"
  237. v-model="form.drillEndtime"
  238. type="date"
  239. value-format="yyyy-MM-dd"
  240. placeholder="选择训练结束时间"
  241. @change="drillTimechange"
  242. >
  243. </el-date-picker> -->
  244. <el-date-picker
  245. clearable
  246. size="small"
  247. v-model="form.drillEndtime"
  248. type="date"
  249. value-format="yyyy-MM-dd"
  250. placeholder="选择训练结束时间"
  251. >
  252. </el-date-picker>
  253. </el-form-item>
  254. <el-form-item label="周工作内容" class="boxtext">
  255. <el-input
  256. type="textarea"
  257. :rows="2"
  258. placeholder="请输入内容"
  259. v-model="form.trainingContent"
  260. autosize
  261. >
  262. </el-input>
  263. </el-form-item>
  264. <el-row>
  265. <el-checkbox
  266. v-model="form.safety"
  267. style="
  268. margin-right: 80px;
  269. height: 40px;
  270. margin-left: 70px;
  271. color: #fff;
  272. "
  273. >安全训练</el-checkbox
  274. >
  275. <el-checkbox
  276. v-model="form.chiefOfficial"
  277. style="
  278. margin-right: 80px;
  279. height: 40px;
  280. margin-left: 70px;
  281. color: #fff;
  282. "
  283. >主官训练</el-checkbox
  284. >
  285. <el-checkbox
  286. v-model="form.targeted"
  287. style="
  288. margin-right: 80px;
  289. height: 40px;
  290. margin-left: 70px;
  291. color: #fff;
  292. "
  293. >针对性训练</el-checkbox
  294. >
  295. <el-checkbox
  296. v-model="form.system"
  297. style="
  298. margin-right: 80px;
  299. height: 40px;
  300. margin-left: 70px;
  301. color: #fff;
  302. "
  303. >系统性训练</el-checkbox
  304. >
  305. </el-row>
  306. <el-form-item label="地点" prop="address">
  307. <el-input v-model="form.address" placeholder="请输入训练地点" />
  308. </el-form-item>
  309. <el-form-item label="弹药" prop="ammunition">
  310. <el-input v-model="form.ammunition" placeholder="请输入弹药" />
  311. </el-form-item>
  312. <el-form-item label="摩托时间" prop="mototime">
  313. <el-input v-model="form.mototime" placeholder="请输入摩托时间" />
  314. </el-form-item>
  315. <el-form-item label="装备" prop="equipment">
  316. <el-input v-model="form.equipment" placeholder="请输入装备" />
  317. </el-form-item>
  318. <el-row>
  319. <el-checkbox
  320. v-model="form.assessment"
  321. @change="checkboxs"
  322. style="
  323. margin-right: 80px;
  324. height: 40px;
  325. margin-left: 70px;
  326. color: #fff;
  327. "
  328. >是否参加考核</el-checkbox
  329. >
  330. </el-row>
  331. <el-form-item label="应训(人数)" prop="yingxun">
  332. <el-input
  333. v-model.number="form.yingxun"
  334. placeholder="请输入应训人数"
  335. @change="yingxun"
  336. />
  337. </el-form-item>
  338. <el-form-item label="实训(人数)" prop="shixun">
  339. <el-input
  340. v-model.number="form.shixun"
  341. placeholder="请输入实训人数"
  342. @change="shixun"
  343. />
  344. </el-form-item>
  345. <el-form-item label="参训率" prop="participationRate">
  346. <el-input v-model="form.participationRate" placeholder="" disabled />
  347. </el-form-item>
  348. <el-form-item label="效果(成绩)" prop="pass">
  349. <el-input
  350. v-model="form.pass"
  351. placeholder="请输入效果成绩"
  352. :disabled="dilabled"
  353. />
  354. </el-form-item>
  355. <el-form-item label="消耗" prop="excellent">
  356. <el-input v-model="form.excellent" placeholder="请输入消耗" />
  357. </el-form-item>
  358. <div class="jiben">备注</div>
  359. <el-form-item label="" prop="fail">
  360. <el-input
  361. v-model="form.fail"
  362. type="textarea"
  363. placeholder="请输入内容"
  364. autosize
  365. />
  366. </el-form-item>
  367. <el-row>
  368. <el-button
  369. type="primary"
  370. plain
  371. icon="el-icon-plus"
  372. size="mini"
  373. @click="adddrillFus"
  374. style="margin-left: 0px; width: 100px; margin-bottom: 20px"
  375. >添加人员</el-button
  376. >
  377. </el-row>
  378. <el-table
  379. :data="drillFus"
  380. :header-cell-style="{ background: '#003C69', color: 'white' }"
  381. >
  382. <el-table-column label="姓名" align="center" prop="peopleId">
  383. <template slot-scope="scope">
  384. <el-select
  385. v-model="scope.row.peopleId"
  386. placeholder=""
  387. filterable
  388. disabled
  389. >
  390. <el-option
  391. :label="item.name"
  392. v-for="(item, i) in renYuan"
  393. :key="i"
  394. :value="item.id"
  395. class="input_xiala"
  396. ></el-option>
  397. </el-select>
  398. </template>
  399. </el-table-column>
  400. <el-table-column
  401. label="参训状态"
  402. align="center"
  403. prop="trainingStatus"
  404. >
  405. <template slot-scope="scope">
  406. <el-select
  407. v-model="scope.row.trainingStatus"
  408. placeholder="请选择参训状态"
  409. filterable
  410. >
  411. <el-option
  412. v-for="dict in dict.type.military_training"
  413. :key="dict.value"
  414. :label="dict.label"
  415. :value="dict.label"
  416. class="input_xiala"
  417. ></el-option>
  418. </el-select>
  419. </template>
  420. </el-table-column>
  421. <el-table-column label="状态" align="center" prop="state">
  422. <template slot-scope="scope">
  423. <el-button size="btd" type="text" @click="deldeitem(scope.$index)"
  424. ><span class="delete">删除</span></el-button
  425. >
  426. </template>
  427. </el-table-column>
  428. </el-table>
  429. </el-form>
  430. <div slot="footer" class="dialog-footer">
  431. <el-button type="primary" @click="submitForm">确 定</el-button>
  432. <el-button @click="cancel" size="btn">取 消</el-button>
  433. </div>
  434. </el-dialog>
  435. <!-- 修改军事训练登记薄 -->
  436. <el-dialog
  437. :title="title"
  438. :visible.sync="open1"
  439. width="1060px"
  440. append-to-body
  441. :close-on-click-modal="false"
  442. >
  443. <el-form
  444. ref="form"
  445. :model="form"
  446. :rules="rules"
  447. :inline="true"
  448. label-width="120px"
  449. >
  450. <div class="jiben">基本信息</div>
  451. <el-form-item label="单位" prop="unitId">
  452. <treeselect
  453. @select="selectPeo"
  454. v-model="form.unitId"
  455. :options="rese"
  456. placeholder="请选择单位"
  457. disabled
  458. />
  459. </el-form-item>
  460. <el-form-item
  461. label="训练类别"
  462. prop="trainingCategory"
  463. style="margin-left: 100px"
  464. >
  465. <!-- <el-input
  466. v-model="form.trainingCategory"
  467. placeholder="请输入训练类别"
  468. /> -->
  469. <treeselect
  470. v-model="form.trainingCategory"
  471. :options="treeselects"
  472. :normalizer="defaultProps"
  473. placeholder="请选择训练类别"
  474. @select="trainingCategoryselectPeo"
  475. />
  476. </el-form-item>
  477. <!-- <el-form-item label="训练项目" prop="project">
  478. <el-input v-model="form.project" placeholder="请输入训练项目" />
  479. </el-form-item> -->
  480. <el-form-item
  481. label="证明材料"
  482. prop="project2"
  483. style="display: inline-block; width: 900px"
  484. >
  485. <!-- <input
  486. type="text"
  487. v-model="form.filename"
  488. style="
  489. width: 280px;
  490. height: 36px;
  491. background: transparent;
  492. color: #fff;
  493. border: 1px solid #fff !important;
  494. display: inline-block;
  495. "
  496. /> -->
  497. <fileUpload
  498. v-model="form.filepath"
  499. style="display: inline-block"
  500. :show-file-list="false"
  501. class="m-l-20"
  502. :limit="1"
  503. />
  504. </el-form-item>
  505. <el-form-item label="训练开始时间" prop="drillTime">
  506. <el-date-picker
  507. clearable
  508. size="small"
  509. v-model="form.drillTime"
  510. type="date"
  511. value-format="yyyy-MM-dd"
  512. placeholder="选择训练开始时间"
  513. >
  514. </el-date-picker>
  515. </el-form-item>
  516. <el-form-item
  517. label="训练结束时间"
  518. prop="drillEndtime"
  519. style="margin-left: 130px"
  520. >
  521. <el-date-picker
  522. clearable
  523. size="small"
  524. v-model="form.drillEndtime"
  525. type="date"
  526. value-format="yyyy-MM-dd"
  527. placeholder="选择训练结束时间"
  528. @change="drillTimechange"
  529. >
  530. </el-date-picker>
  531. </el-form-item>
  532. <el-form-item label="周工作内容" class="boxtext">
  533. <el-input
  534. type="textarea"
  535. placeholder="请输入内容"
  536. v-model="form.trainingContent"
  537. autosize
  538. >
  539. </el-input>
  540. <!-- <input
  541. v-model="nr"
  542. placeholder=""
  543. style="
  544. width: 810px;
  545. height: 36px;
  546. background: transparent;
  547. color: #fff;
  548. border: 1px solid #fff !important;
  549. "
  550. disabled
  551. /> -->
  552. </el-form-item>
  553. <el-row>
  554. <el-checkbox
  555. v-model="form.safety"
  556. style="
  557. margin-right: 80px;
  558. height: 40px;
  559. margin-left: 70px;
  560. color: #fff;
  561. "
  562. >安全训练</el-checkbox
  563. >
  564. <el-checkbox
  565. v-model="form.chiefOfficial"
  566. style="
  567. margin-right: 80px;
  568. height: 40px;
  569. margin-left: 70px;
  570. color: #fff;
  571. "
  572. >主官训练</el-checkbox
  573. >
  574. <el-checkbox
  575. v-model="form.targeted"
  576. style="
  577. margin-right: 80px;
  578. height: 40px;
  579. margin-left: 70px;
  580. color: #fff;
  581. "
  582. >针对性训练</el-checkbox
  583. >
  584. <el-checkbox
  585. v-model="form.system"
  586. style="
  587. margin-right: 80px;
  588. height: 40px;
  589. margin-left: 70px;
  590. color: #fff;
  591. "
  592. >系统性训练</el-checkbox
  593. >
  594. </el-row>
  595. <el-form-item label="地点" prop="address">
  596. <el-input v-model="form.address" placeholder="请输入训练地点" />
  597. </el-form-item>
  598. <el-form-item label="弹药" prop="ammunition">
  599. <el-input v-model="form.ammunition" placeholder="请输入弹药" />
  600. </el-form-item>
  601. <el-form-item label="摩托时间" prop="mototime">
  602. <el-input v-model="form.mototime" placeholder="请输入摩托时间" />
  603. </el-form-item>
  604. <el-form-item label="装备" prop="equipment">
  605. <el-input v-model="form.equipment" placeholder="请输入装备" />
  606. </el-form-item>
  607. <el-row>
  608. <el-checkbox
  609. v-model="form.assessment"
  610. @change="checkboxs"
  611. style="
  612. margin-right: 80px;
  613. height: 40px;
  614. margin-left: 70px;
  615. color: #fff;
  616. "
  617. >是否参加考核</el-checkbox
  618. >
  619. </el-row>
  620. <el-form-item label="应训(人数)" prop="yingxun">
  621. <el-input
  622. v-model.number="form.yingxun"
  623. placeholder="请输入应训人数"
  624. @change="yingxun"
  625. />
  626. </el-form-item>
  627. <el-form-item label="实训(人数)" prop="shixun">
  628. <el-input
  629. v-model.number="form.shixun"
  630. placeholder="请输入实训人数"
  631. @change="shixun"
  632. />
  633. </el-form-item>
  634. <el-form-item label="参训率" prop="participationRate">
  635. <el-input v-model="form.participationRate" placeholder="" disabled />
  636. </el-form-item>
  637. <el-form-item label="效果(成绩)" prop="pass">
  638. <el-input
  639. v-model="form.pass"
  640. placeholder="请输入效果成绩"
  641. :disabled="dilabled"
  642. />
  643. </el-form-item>
  644. <el-form-item label="消耗" prop="excellent">
  645. <el-input v-model="form.excellent" placeholder="请输入消耗" />
  646. </el-form-item>
  647. <div class="jiben">备注</div>
  648. <el-form-item label="" prop="fail">
  649. <el-input
  650. v-model="form.fail"
  651. type="textarea"
  652. placeholder="请输入内容"
  653. autosize
  654. />
  655. </el-form-item>
  656. <el-row>
  657. <el-button
  658. type="primary"
  659. plain
  660. icon="el-icon-plus"
  661. size="mini"
  662. @click="adddrillFus"
  663. style="margin-left: 0px; width: 100px; margin-bottom: 20px"
  664. >添加人员</el-button
  665. >
  666. </el-row>
  667. <el-table
  668. :data="drillFus"
  669. :header-cell-style="{ background: '#003C69', color: 'white' }"
  670. >
  671. <el-table-column label="姓名" align="center" prop="peopleId">
  672. <template slot-scope="scope">
  673. <el-select
  674. v-model="scope.row.peopleId"
  675. placeholder=""
  676. filterable
  677. disabled
  678. >
  679. <el-option
  680. :label="item.name"
  681. v-for="(item, i) in renYuan"
  682. :key="i"
  683. :value="item.id"
  684. class="input_xiala"
  685. ></el-option>
  686. </el-select>
  687. </template>
  688. </el-table-column>
  689. <el-table-column
  690. label="参训状态"
  691. align="center"
  692. prop="trainingStatus"
  693. >
  694. <template slot-scope="scope">
  695. <el-select
  696. v-model="scope.row.trainingStatus"
  697. placeholder="请选择参训状态"
  698. filterable
  699. >
  700. <el-option
  701. v-for="dict in dict.type.military_training"
  702. :key="dict.value"
  703. :label="dict.label"
  704. :value="dict.label"
  705. class="input_xiala"
  706. ></el-option>
  707. </el-select>
  708. </template>
  709. </el-table-column>
  710. <el-table-column label="状态" align="center" prop="state">
  711. <template slot-scope="scope">
  712. <el-button
  713. size="btd"
  714. type="text"
  715. @click="deldeitem1(scope.$index, scope.row)"
  716. ><span class="delete">删除</span></el-button
  717. >
  718. </template>
  719. </el-table-column>
  720. </el-table>
  721. </el-form>
  722. <div slot="footer" class="dialog-footer">
  723. <el-button type="primary" @click="submitForm">确 定</el-button>
  724. <el-button @click="cancel" size="btn">取 消</el-button>
  725. </div>
  726. </el-dialog>
  727. <!-- 查看表格 -->
  728. <div class="fff">
  729. <el-dialog
  730. :visible.sync="menuRoleVisible"
  731. :title="title"
  732. append-to-body
  733. id="chakan"
  734. :close-on-click-modal="false"
  735. width="1060px"
  736. >
  737. <bdgldrill
  738. v-if="menuRoleVisible"
  739. ref="menuRole"
  740. :message="wordInfo"
  741. ></bdgldrill>
  742. </el-dialog>
  743. </div>
  744. <!-- 添加人员弹出层 -->
  745. <el-dialog
  746. title="添加人员"
  747. :visible.sync="open2"
  748. width="750px"
  749. append-to-body
  750. :close-on-click-modal="false"
  751. custom-class="boxs"
  752. >
  753. <el-transfer
  754. v-model="arr1"
  755. :data="renYuan"
  756. :props="{
  757. key: 'id',
  758. label: 'name',
  759. }"
  760. :titles="['全部人员', '已添加人员']"
  761. ></el-transfer>
  762. <div slot="footer" class="dialog-footer" style="margin-right: 28px">
  763. <el-button type="primary" @click="submitForm3">确 定</el-button>
  764. </div>
  765. </el-dialog>
  766. </div>
  767. </template>
  768. <script>
  769. import {
  770. listBdgldrill,
  771. getBdgldrill,
  772. delBdgldrill,
  773. addBdgldrill,
  774. updateBdgldrill,
  775. exportBdgldrill,
  776. treeselect,
  777. getweekwork,
  778. drillFu,
  779. treeselects,
  780. getInfoByUnitId,
  781. } from "@/api/grassrootsregistration/bdgldrill";
  782. import bdgldrill from "@/components/look_word/bdgldrill.vue";
  783. // 导入树形结构
  784. import Treeselect from "@riophae/vue-treeselect";
  785. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  786. import {
  787. getDept,
  788. getZhuChiRen,
  789. getDept2,
  790. } from "@/api/grassrootsregistration/bdglmeeting";
  791. export default {
  792. name: "Bdgldrill",
  793. components: { Treeselect, bdgldrill },
  794. dicts: ["military_training"],
  795. data() {
  796. return {
  797. // 遮罩层
  798. loading: true,
  799. // 导出遮罩层
  800. exportLoading: false,
  801. // 选中数组
  802. ids: [],
  803. // 非单个禁用
  804. single: true,
  805. // 非多个禁用
  806. multiple: true,
  807. // 显示搜索条件
  808. showSearch: true,
  809. // 总条数
  810. total: 0,
  811. // 军事训练登记簿表格数据
  812. bdgldrillList: [],
  813. // 弹出层标题
  814. title: "",
  815. // 是否显示弹出层
  816. open: false,
  817. // 查询参数
  818. queryParams: {
  819. pageNum: 1,
  820. pageSize: 10,
  821. project: null,
  822. drillTime: null,
  823. address: null,
  824. oughtTo: null,
  825. filename: null,
  826. filepath: null,
  827. equipment: null,
  828. ammunition: null,
  829. mototime: null,
  830. drillEndtime: null,
  831. unitId: null,
  832. trainingCategory: null,
  833. createtime: null,
  834. createId: null,
  835. },
  836. // 表单参数
  837. form: {
  838. safety: false,
  839. chiefOfficial: false,
  840. targeted: false,
  841. system: false,
  842. assessment: false,
  843. },
  844. // 表单校验
  845. rules: {
  846. unitId: [{ required: true, message: "请选择单位", trigger: "blur" }],
  847. },
  848. cities: ["安全训练"],
  849. cities2: ["主官组训施教"],
  850. cities3: ["针对性训练"],
  851. cities4: ["使用模拟训练系统"],
  852. checkedCities: [],
  853. checkedCities2: [],
  854. checkedCities3: [],
  855. checkedCities4: [],
  856. checkedCities5: [],
  857. drillFus: [],
  858. formdrillFus: {
  859. peopleName: "",
  860. state: "",
  861. trainingStatus: "",
  862. },
  863. open2: false,
  864. rese: [],
  865. renYuan: [],
  866. treeselects: [],
  867. defaultProps(node) {
  868. return {
  869. children: node.children,
  870. label: node.ancestors,
  871. };
  872. },
  873. menuRoleVisible: false,
  874. wordInfo: [],
  875. nr: null,
  876. fiel: [],
  877. // 修改弹出层的显示与隐藏
  878. open1: false,
  879. // 是否禁用效果成绩输入框
  880. dilabled: true,
  881. // 添加人员弹出层
  882. open2: false,
  883. arr1: [],
  884. falg: null,
  885. };
  886. },
  887. created() {
  888. this.getList();
  889. treeselect().then((res) => {
  890. this.treeselects = res.rows;
  891. });
  892. },
  893. methods: {
  894. // 添加人员确定
  895. submitForm3() {
  896. this.open2 = false;
  897. this.arr1.forEach((item) => {
  898. this.drillFus.push({
  899. peopleId: item,
  900. state: "",
  901. trainingStatus: "",
  902. });
  903. });
  904. for (var i = 0; i < this.drillFus.length - 1; i++) {
  905. for (var j = i + 1; j < this.drillFus.length; j++) {
  906. if (this.drillFus[i].peopleId == this.drillFus[j].peopleId) {
  907. this.drillFus.splice(j, 1);
  908. j--;
  909. }
  910. }
  911. }
  912. },
  913. // 应训人数触发
  914. yingxun() {
  915. if (this.form.yingxun && this.form.shixun) {
  916. var num = (this.form.shixun / this.form.yingxun) * 100;
  917. num = num.toFixed(2) + "%";
  918. this.$set(this.form, "participationRate", num);
  919. }
  920. },
  921. // 实训人数触发
  922. shixun() {
  923. if (this.form.yingxun && this.form.shixun) {
  924. var num = (this.form.shixun / this.form.yingxun) * 100;
  925. num = num.toFixed(2) + "%";
  926. this.$set(this.form, "participationRate", num);
  927. }
  928. },
  929. // 是否参加考核触发
  930. checkboxs(data) {
  931. this.dilabled = !data;
  932. if (!data) {
  933. this.form.pass = null;
  934. }
  935. },
  936. // 获取全部单位树形
  937. getQuanShu() {
  938. getDept2().then((res) => {
  939. this.rese = res.data;
  940. });
  941. },
  942. // 点击删除删除循环出来的当前数据
  943. deldeitem(row) {
  944. this.drillFus.splice(row.ids, 1);
  945. },
  946. // 修改中的删除循环数据
  947. deldeitem1(row, rows) {
  948. this.drillFus.splice(row.ids, 1);
  949. drillFu(rows.id).then((res) => {});
  950. },
  951. /** 查询军事训练登记簿列表 */
  952. getList() {
  953. this.loading = true;
  954. listBdgldrill(this.queryParams).then((response) => {
  955. this.bdgldrillList = response.rows;
  956. this.total = response.total;
  957. this.loading = false;
  958. });
  959. },
  960. // 取消按钮
  961. cancel() {
  962. this.open = false;
  963. this.open2 = false;
  964. this.open1 = false;
  965. this.reset();
  966. },
  967. // 表单重置
  968. reset() {
  969. this.form = {
  970. id: null,
  971. project: null,
  972. drillTime: null,
  973. address: null,
  974. oughtTo: null,
  975. filename: null,
  976. filepath: null,
  977. equipment: null,
  978. ammunition: null,
  979. mototime: null,
  980. remark: null,
  981. drillEndtime: null,
  982. unitId: null,
  983. trainingCategory: null,
  984. createtime: null,
  985. createId: null,
  986. };
  987. this.formdrillFus = {
  988. peopleName: null,
  989. state: null,
  990. trainingStatus: null,
  991. ids: null,
  992. };
  993. this.resetForm("form");
  994. },
  995. /** 搜索按钮操作 */
  996. handleQuery() {
  997. this.queryParams.pageNum = 1;
  998. this.getList();
  999. },
  1000. /** 重置按钮操作 */
  1001. resetQuery() {
  1002. this.resetForm("queryForm");
  1003. this.handleQuery();
  1004. },
  1005. // 多选框选中数据
  1006. handleSelectionChange(selection) {
  1007. this.ids = selection.map((item) => item.id);
  1008. this.single = selection.length !== 1;
  1009. this.multiple = !selection.length;
  1010. },
  1011. /** 新增按钮操作 */
  1012. handleAdd() {
  1013. this.reset();
  1014. this.open = true;
  1015. this.getTreeselect();
  1016. this.title = "添加军事训练登记簿";
  1017. this.drillFus = [];
  1018. this.nr = null;
  1019. this.arr1 = [];
  1020. this.falg = true;
  1021. },
  1022. //查看按钮操作
  1023. handleChakan(row) {
  1024. let unitId = row.unitId;
  1025. // 是否隐藏按钮
  1026. this.reset();
  1027. // const id = row.id || this.ids;
  1028. getInfoByUnitId(unitId).then((response) => {
  1029. this.wordInfo = response.rows;
  1030. this.title = "军事训练登记簿";
  1031. this.menuRoleVisible = true;
  1032. });
  1033. },
  1034. /** 修改按钮操作 */
  1035. handleUpdate(row) {
  1036. this.nr = null;
  1037. this.falg = false;
  1038. this.arr1 = [];
  1039. this.reset();
  1040. this.getQuanShu();
  1041. const id = row.id || this.ids;
  1042. getBdgldrill(id).then((response) => {
  1043. this.form = response.data;
  1044. if (response.data.filename != null || response.data.filepath != null) {
  1045. this.fiel = [
  1046. {
  1047. name: response.data.filename,
  1048. url: response.data.filepath,
  1049. },
  1050. ];
  1051. this.form.filepath = this.fiel;
  1052. }
  1053. if (this.form.safety == 1) {
  1054. this.form.safety = true;
  1055. } else {
  1056. this.form.safety = false;
  1057. }
  1058. if (this.form.chiefOfficial == 1) {
  1059. this.form.chiefOfficial = true;
  1060. } else {
  1061. this.form.chiefOfficial = false;
  1062. }
  1063. if (this.form.targeted == 1) {
  1064. this.form.targeted = true;
  1065. } else {
  1066. this.form.targeted = false;
  1067. }
  1068. if (this.form.system == 1) {
  1069. this.form.system = true;
  1070. } else {
  1071. this.form.system = false;
  1072. }
  1073. if (this.form.assessment == 1) {
  1074. this.form.assessment = true;
  1075. } else {
  1076. this.form.assessment = false;
  1077. }
  1078. this.nr = response.data.common;
  1079. this.drillFus = response.data.drillFus;
  1080. this.getRen(response.data.unitId);
  1081. this.open1 = true;
  1082. this.title = "修改军事训练登记簿";
  1083. });
  1084. },
  1085. /** 提交按钮 */
  1086. submitForm() {
  1087. this.$refs["form"].validate((valid) => {
  1088. if (valid) {
  1089. if (this.form.filepath) {
  1090. if (typeof this.form.filepath != "string") {
  1091. let documentProofs = this.form.filepath;
  1092. this.form.filepath = documentProofs[0].url;
  1093. this.form.filename = documentProofs[0].name;
  1094. }
  1095. }
  1096. this.form.drillFus = this.drillFus;
  1097. if (this.form.safety) {
  1098. this.form.safety = 1;
  1099. } else {
  1100. this.form.safety = 0;
  1101. }
  1102. if (this.form.chiefOfficial) {
  1103. this.form.chiefOfficial = 1;
  1104. } else {
  1105. this.form.chiefOfficial = 0;
  1106. }
  1107. if (this.form.targeted) {
  1108. this.form.targeted = 1;
  1109. } else {
  1110. this.form.targeted = 0;
  1111. }
  1112. if (this.form.system) {
  1113. this.form.system = 1;
  1114. } else {
  1115. this.form.system = 0;
  1116. }
  1117. if (this.form.assessment) {
  1118. this.form.assessment = 1;
  1119. } else {
  1120. this.form.assessment = 0;
  1121. }
  1122. if (this.form.id != null) {
  1123. updateBdgldrill(this.form).then((response) => {
  1124. this.$modal.msgSuccess("修改成功");
  1125. this.open1 = false;
  1126. this.getList();
  1127. });
  1128. } else {
  1129. console.log(this.form);
  1130. addBdgldrill(this.form).then((response) => {
  1131. this.$modal.msgSuccess("新增成功");
  1132. this.open = false;
  1133. this.getList();
  1134. });
  1135. }
  1136. }
  1137. });
  1138. },
  1139. /** 删除按钮操作 */
  1140. handleDelete(row) {
  1141. const ids = row.id || this.ids;
  1142. this.$modal
  1143. .confirm("是否确认删除军事训练登记簿的数据项?")
  1144. .then(function () {
  1145. return delBdgldrill(ids);
  1146. })
  1147. .then(() => {
  1148. this.getList();
  1149. this.$modal.msgSuccess("删除成功");
  1150. })
  1151. .catch(() => {});
  1152. },
  1153. /** 导出按钮操作 */
  1154. handleExport() {
  1155. const queryParams = this.queryParams;
  1156. this.$modal
  1157. .confirm("是否确认导出所有军事训练登记簿数据项?")
  1158. .then(() => {
  1159. this.exportLoading = true;
  1160. return exportBdgldrill(queryParams);
  1161. })
  1162. .then((response) => {
  1163. this.$download.name(response.msg);
  1164. this.exportLoading = false;
  1165. })
  1166. .catch(() => {});
  1167. },
  1168. // 新增人员
  1169. adddrillFus() {
  1170. this.open2 = true;
  1171. if (this.falg) {
  1172. console.log(1);
  1173. this.renYuan.map((item, i) => {
  1174. if (this.drillFu) {
  1175. if (item.id == this.drillFu[i]) {
  1176. this.arr1[i] = item;
  1177. }
  1178. }
  1179. return this.arr1;
  1180. });
  1181. } else if (this.falg == false) {
  1182. // this.arr1=this.drillFus
  1183. this.drillFus.forEach((item=>{
  1184. this.arr1.push(item.peopleId)
  1185. }))
  1186. }
  1187. },
  1188. submitForm2() {
  1189. this.drillFus.push(this.formdrillFus);
  1190. this.open = true;
  1191. this.open2 = false;
  1192. },
  1193. cancel2() {
  1194. this.open = true;
  1195. this.open2 = false;
  1196. this.reset();
  1197. },
  1198. handleCheckedCitiesChange() {},
  1199. /** 新增查询部门下拉树结构 */
  1200. getTreeselect() {
  1201. getDept().then((response) => {
  1202. this.rese = response.data;
  1203. });
  1204. },
  1205. // 单位选择触发
  1206. selectPeo(data) {
  1207. this.form.unitname = data.label;
  1208. this.getRen(data.id);
  1209. },
  1210. // 获取人员
  1211. getRen(id) {
  1212. getZhuChiRen(id).then((res) => {
  1213. this.renYuan = res.data;
  1214. });
  1215. },
  1216. trainingCategoryselectPeo(val) {},
  1217. // 训练开始时间触发
  1218. drillTimechange() {
  1219. if (this.form.drillTime && this.form.drillEndtime && this.form.unitId) {
  1220. getweekwork({
  1221. drillTime: this.form.drillTime,
  1222. drillEndtime: this.form.drillEndtime,
  1223. unitId: this.form.unitId,
  1224. }).then((res) => {
  1225. this.nr = "";
  1226. res.data.map((item, i) => {
  1227. if (i == 0) {
  1228. this.nr += item.contents;
  1229. } else {
  1230. this.nr += "," + item.contents;
  1231. }
  1232. });
  1233. });
  1234. }
  1235. },
  1236. },
  1237. };
  1238. </script>
  1239. <style scoped>
  1240. ::v-deep .el-dialog {
  1241. /* width: 1060px !important; */
  1242. background-color: #004d86;
  1243. margin: auto;
  1244. }
  1245. ::v-deep .el-dialog__header {
  1246. border-bottom: 1px solid #718a9d;
  1247. margin: auto;
  1248. }
  1249. ::v-deep .el-dialog__title {
  1250. color: #fff;
  1251. font: 18px;
  1252. }
  1253. ::v-deep .el-dialog__headerbtn .el-dialog__close {
  1254. color: #fff;
  1255. }
  1256. ::v-deep .el-form-item__label {
  1257. font: 16px;
  1258. color: #fff;
  1259. width: 100px !important;
  1260. }
  1261. .el-form-item ::v-deep .el-input__inner {
  1262. width: 350px;
  1263. height: 36px;
  1264. background: transparent;
  1265. color: #fff;
  1266. border: 1px solid #fff !important;
  1267. }
  1268. ::v-deep .vue-treeselect__control {
  1269. background: #004d86 !important;
  1270. color: #fff !important;
  1271. }
  1272. ::v-deep .vue-treeselect__control {
  1273. width: 250px;
  1274. color: #fff !important;
  1275. }
  1276. /* ::v-deep .el-textarea__inner {
  1277. width: 920px;
  1278. height: 104px;
  1279. }
  1280. ::v-deep .el-select-dropdown__list {
  1281. border: none;
  1282. }
  1283. .el-date-table,
  1284. .el-select-dropdown__item {
  1285. color: #fff;
  1286. }
  1287. .el-select-dropdown__item.hover,
  1288. .el-select-dropdown__item:hover {
  1289. background-color: #196299;
  1290. } */
  1291. ::v-deep .el-upload__tip {
  1292. display: none;
  1293. }
  1294. /* 去掉上面的线 */
  1295. /* ::v-deep .el-dialog .el-table th.is-leaf {
  1296. border: 1px solid white !important;
  1297. } */
  1298. /* 去掉最下面的那一条线 */
  1299. /* ::v-deep .el-dialog .el-table::before {
  1300. border: 1px solid white !important;
  1301. } */
  1302. /* 去掉表格内的线 */
  1303. /* ::v-deep .el-dialog table td {
  1304. border: 1px solid white !important;
  1305. } */
  1306. ::v-deep .el-upload-list {
  1307. display: inline-block;
  1308. margin-left: 10px;
  1309. }
  1310. ::v-deep .upload-file-uploader {
  1311. display: inline-block;
  1312. }
  1313. ::v-deep .vue-treeselect__single-value {
  1314. color: #fff !important;
  1315. }
  1316. ::v-deep .el-link--inner .el-icon-document {
  1317. color: #fff !important;
  1318. }
  1319. ::v-deep .el-input--medium .el-input__inner {
  1320. background: transparent;
  1321. color: #fff;
  1322. }
  1323. ::v-deep .vue-treeselect--single .vue-treeselect__input {
  1324. color: #fff;
  1325. }
  1326. ::v-deep .el-textarea__inner {
  1327. width: 920px;
  1328. margin: auto;
  1329. min-height: 120px !important;
  1330. }
  1331. #chakan /deep/ .el-dialog__body {
  1332. padding: 30px 64px;
  1333. margin-left: 39px;
  1334. }
  1335. .shouForm /deep/ .el-input__inner {
  1336. width: 220px;
  1337. }
  1338. ::v-deep .boxtext .el-textarea__inner {
  1339. width: 810px;
  1340. }
  1341. ::v-deep .el-dialog__body {
  1342. margin-left: 53px;
  1343. }
  1344. ::v-deep .el-form .el-table {
  1345. width: 921px;
  1346. }
  1347. ::v-deep .el-dialog__footer {
  1348. margin-right: 47px;
  1349. }
  1350. ::v-deep
  1351. .el-transfer-panel
  1352. .el-transfer-panel__header
  1353. .el-checkbox
  1354. .el-checkbox__label
  1355. span {
  1356. color: #fff;
  1357. }
  1358. ::v-deep .el-transfer-panel__item.el-checkbox {
  1359. color: #fff;
  1360. }
  1361. ::v-deep
  1362. .el-transfer-panel
  1363. .el-transfer-panel__header
  1364. .el-checkbox
  1365. .el-checkbox__label {
  1366. color: #fff;
  1367. }
  1368. ::v-deep
  1369. .el-transfer-panel
  1370. .el-transfer-panel__header
  1371. .el-checkbox
  1372. .el-checkbox__label {
  1373. color: #fff;
  1374. }
  1375. ::v-deep .el-transfer-panel {
  1376. background: rgba(255, 255, 255, 0.2);
  1377. }
  1378. ::v-deep .el-transfer-panel .el-transfer-panel__header {
  1379. background: rgba(255, 255, 255, 0.2);
  1380. }
  1381. ::v-deep .el-transfer-panel .el-transfer-panel__empty {
  1382. color: #fff;
  1383. }
  1384. ::v-deep .boxs .el-dialog__body{
  1385. margin-left: 59px;
  1386. }
  1387. </style>