index_20220314105320.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  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. >
  10. <el-form-item label="" prop="unitId">
  11. <el-select
  12. v-model="queryParams.unitId"
  13. placeholder="请选择单位"
  14. @change="Company"
  15. >
  16. <el-option
  17. v-for="item in buMeng"
  18. :key="item.deptId"
  19. :label="item.deptName"
  20. :value="item.deptId"
  21. >
  22. </el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item label="" prop="compereId">
  26. <el-select
  27. v-model="queryParams.compereId"
  28. placeholder="请选择主持人"
  29. @change="compere"
  30. >
  31. <el-option
  32. v-for="item in renYuan"
  33. :key="item.id"
  34. :label="item.name"
  35. :value="item.id"
  36. >
  37. </el-option>
  38. </el-select>
  39. </el-form-item>
  40. <el-form-item>
  41. <el-button size="btr" @click="resetQuery" icon="el-icon-refresh"
  42. >重置</el-button
  43. >
  44. </el-form-item>
  45. </el-form>
  46. <el-row :gutter="10" class="mb8">
  47. <el-col :span="1.5">
  48. <el-button
  49. type="primary"
  50. plain
  51. icon="el-icon-plus"
  52. size="mini"
  53. @click="handleAdd"
  54. v-hasPermi="['grassrootsregistration :bdglparty:add']"
  55. >新增</el-button
  56. >
  57. </el-col>
  58. <el-col :span="1.5">
  59. <el-button
  60. type="success"
  61. plain
  62. icon="el-icon-edit"
  63. size="mini"
  64. :disabled="single"
  65. @click="handleUpdate"
  66. v-hasPermi="['grassrootsregistration :bdglparty:edit']"
  67. >修改</el-button
  68. >
  69. </el-col>
  70. <el-col :span="1.5">
  71. <el-button
  72. type="danger"
  73. plain
  74. icon="el-icon-delete"
  75. size="mini"
  76. :disabled="multiple"
  77. @click="handleDelete"
  78. v-hasPermi="['grassrootsregistration :bdglparty:remove']"
  79. >删除</el-button
  80. >
  81. </el-col>
  82. <el-col :span="1.5">
  83. <el-button
  84. type="warning"
  85. plain
  86. icon="el-icon-download"
  87. size="mini"
  88. :loading="exportLoading"
  89. @click="handleExport"
  90. v-hasPermi="['grassrootsregistration :bdglparty:export']"
  91. >导出</el-button
  92. >
  93. </el-col>
  94. </el-row>
  95. <el-table
  96. v-loading="loading"
  97. :data="bdglpartyList"
  98. @selection-change="handleSelectionChange"
  99. :header-cell-style="{ background: '#003C69', color: 'white' }"
  100. >
  101. <el-table-column type="selection" width="55" align="center" />
  102. <el-table-column label="序号" align="center" prop="id" />
  103. <el-table-column label="单位" align="center" prop="unitName" />
  104. <el-table-column label="会议议题" align="center" prop="title" />
  105. <el-table-column label="主持人" align="center" prop="compereRen" />
  106. <el-table-column label="参加人" align="center" prop="joinId" />
  107. <el-table-column label="召开地点" align="center" prop="address" />
  108. <el-table-column
  109. label="操作"
  110. align="center"
  111. class-name="small-padding fixed-width"
  112. width="200"
  113. >
  114. <template slot-scope="scope">
  115. <el-button
  116. size="btu"
  117. type="text"
  118. @click="handleUpdate(scope.row)"
  119. v-hasPermi="['grassrootsregistration :bdglparty:edit']"
  120. ><span class="edit">修改</span></el-button
  121. >
  122. <el-button
  123. size="btd"
  124. type="text"
  125. @click="handleDelete(scope.row)"
  126. v-hasPermi="['grassrootsregistration :bdglparty:remove']"
  127. ><span class="delete">删除</span></el-button
  128. >
  129. </template>
  130. </el-table-column>
  131. </el-table>
  132. <pagination
  133. v-show="total > 0"
  134. :total="total"
  135. :page.sync="queryParams.pageNum"
  136. :limit.sync="queryParams.pageSize"
  137. @pagination="getList"
  138. />
  139. <!-- 添加或修改党支部会议登记本对话框 -->
  140. <el-dialog
  141. :title="title"
  142. :visible.sync="open"
  143. width="1016px"
  144. append-to-body
  145. >
  146. <div class="jiben">基本信息</div>
  147. <el-form
  148. ref="form"
  149. :model="form"
  150. :rules="rules"
  151. label-width="80px"
  152. :inline="true"
  153. >
  154. <el-form-item label="单位" prop="unitId">
  155. <treeselect
  156. v-model="form.unitId"
  157. :options="deptOptions"
  158. placeholder="选择单位"
  159. @select="selectPeo"
  160. />
  161. </el-form-item>
  162. <el-form-item label="召开时间" prop="convokeTime">
  163. <el-date-picker
  164. clearable
  165. size="small"
  166. v-model="form.convokeTime"
  167. type="date"
  168. :editable="false"
  169. value-format="yyyy-MM-dd"
  170. placeholder="选择召开时间"
  171. >
  172. </el-date-picker>
  173. </el-form-item>
  174. <el-form-item label="召开地点" prop="address" class="address">
  175. <el-input v-model="form.address" placeholder="请输入召开地点" />
  176. </el-form-item>
  177. <el-form-item label="主持人" prop="compereId">
  178. <el-select
  179. v-model="form.compereId"
  180. placeholder="请选择主持人"
  181. >
  182. <el-option
  183. v-for="(item, i) in renYuan"
  184. :key="i"
  185. :label="item.name"
  186. :value="item.id"
  187. :disabled="item.status == 1"
  188. @click.native="ZhuChiRen(item.name)"
  189. >
  190. </el-option>
  191. </el-select>
  192. </el-form-item>
  193. <el-form-item label="记录人" prop="peopleId">
  194. <el-select
  195. v-model="form.peopleId"
  196. placeholder="请选择记录人"
  197. >
  198. <el-option
  199. v-for="(item, i) in renYuan"
  200. :key="i"
  201. :label="item.name"
  202. :value="item.id"
  203. @click.native="peoples(item.name)"
  204. >
  205. </el-option>
  206. </el-select>
  207. </el-form-item>
  208. <el-form-item label="会议议题" prop="title">
  209. <el-input v-model="form.title" placeholder="请输入会议议题" />
  210. </el-form-item>
  211. <el-form-item label="参加人" prop="joinId" class="joinId">
  212. <el-select v-model="form.joinId" multiple placeholder="请选择参加人">
  213. <el-option
  214. v-for="item in renYuan"
  215. :key="item.id"
  216. :label="item.name"
  217. :value="item.name"
  218. >
  219. </el-option>
  220. </el-select>
  221. </el-form-item>
  222. <el-form-item label="列席人" prop="peopleIds" class="joinId">
  223. <el-select
  224. v-model="form.peopleIds"
  225. multiple
  226. placeholder="请选择列席人"
  227. >
  228. <el-option
  229. v-for="item in renYuan"
  230. :key="item.id"
  231. :label="item.name"
  232. :value="item.name"
  233. >
  234. </el-option>
  235. </el-select>
  236. </el-form-item>
  237. <el-form-item label="缺席人" prop="absentIds" class="joinId">
  238. <el-select
  239. v-model="form.absentIds"
  240. multiple
  241. placeholder="请选择缺席人"
  242. >
  243. <el-option
  244. v-for="item in renYuan"
  245. :key="item.id"
  246. :label="item.name"
  247. :value="item.name"
  248. >
  249. </el-option>
  250. </el-select>
  251. </el-form-item>
  252. <div class="jiben">会议内容</div>
  253. <quill-editor
  254. class="quill-editor"
  255. ref="myTextEditor"
  256. v-model="form.contents"
  257. style="height: 150px; width: 870px; margin: auto; margin-bottom: 60px"
  258. ></quill-editor>
  259. </el-form>
  260. <div slot="footer" class="dialog-footer">
  261. <el-button @click="resertwo">重置</el-button>
  262. <el-button type="primary" @click="submitForm(1)">确 定</el-button>
  263. </div>
  264. </el-dialog>
  265. </div>
  266. </template>
  267. <script>
  268. // 自建API
  269. import { getDeptId } from "@/api/getApi/getApi";
  270. import {
  271. listBdglparty,
  272. getBdglparty,
  273. delBdglparty,
  274. addBdglparty,
  275. updateBdglparty,
  276. exportBdglparty,
  277. getDept,
  278. getZhuChiRen,
  279. } from "@/api/grassrootsregistration/bdglparty";
  280. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  281. import { treeselect } from "@/api/system/dept";
  282. // 富文本
  283. import "quill/dist/quill.core.css";
  284. import "quill/dist/quill.snow.css";
  285. import "quill/dist/quill.bubble.css";
  286. import { quillEditor } from "vue-quill-editor";
  287. import Treeselect from "@riophae/vue-treeselect";
  288. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  289. export default {
  290. name: "Bdglparty",
  291. components: {
  292. Treeselect,
  293. quillEditor,
  294. },
  295. data() {
  296. return {
  297. //判断关闭
  298. style: "2",
  299. // 遮罩层
  300. loading: true,
  301. // 导出遮罩层
  302. exportLoading: false,
  303. // 选中数组
  304. ids: [],
  305. // 非单个禁用
  306. single: true,
  307. // 非多个禁用
  308. multiple: true,
  309. // 显示搜索条件
  310. showSearch: true,
  311. // 总条数
  312. total: 0,
  313. // 党支部会议登记本表格数据
  314. bdglpartyList: [],
  315. // 弹出层标题
  316. title: "",
  317. // 是否显示弹出层
  318. open: false,
  319. // 查询参数
  320. queryParams: {
  321. pageNum: 1,
  322. pageSize: 10,
  323. convokeTime: null,
  324. address: null,
  325. compereId: null,
  326. joinId: null,
  327. peopleIds: null,
  328. absentIds: null,
  329. peopleId: null,
  330. title: null,
  331. contents: null,
  332. createtime: null,
  333. updatetime: null,
  334. unitId: null,
  335. },
  336. // 表单参数
  337. form: {},
  338. // 表单校验
  339. rules: {
  340. unitId: [
  341. { required: true, message: "单位名称不能为空", trigger: "blur" },
  342. ],
  343. convokeTime: [
  344. { required: true, message: "召开时间不能为空", trigger: "blur" },
  345. ],
  346. address: [
  347. { required: true, message: "召开地点不能为空", trigger: "blur" },
  348. ],
  349. compereId: [
  350. { required: true, message: "主持人不能为空", trigger: "blur" },
  351. ],
  352. peopleId: [
  353. { required: true, message: "记录人不能为空", trigger: "blur" },
  354. ],
  355. title: [
  356. { required: true, message: "会议议题不能为空", trigger: "blur" },
  357. ],
  358. joinId: [
  359. { required: true, message: "参加人不能为空", trigger: "blur" },
  360. ],
  361. peopleIds: [
  362. { required: true, message: "列席人不能为空", trigger: "blur" },
  363. ],
  364. absentIds: [
  365. { required: true, message: "缺席人不能为空", trigger: "blur" },
  366. ],
  367. },
  368. // 人员
  369. renYuan: [],
  370. // 外面的部门
  371. buMeng: [],
  372. // 部门列表
  373. deptOptions: [],
  374. // 搜索人员列表
  375. personnel: [],
  376. // 树形配置对象
  377. defaultProps: {
  378. children: "children",
  379. label: "label",
  380. },
  381. // 修改拿到的数据
  382. result: {},
  383. };
  384. },
  385. created() {
  386. this.getList();
  387. this.getdept();
  388. },
  389. methods: {
  390. // 重置表单人员
  391. ChongZhiRen() {
  392. (this.form.compereId = null),
  393. // this.form.compereRen=null,
  394. (this.form.peopleId = null);
  395. // this.form. peopleJiLu=null,
  396. this.form.joinId=null
  397. this.form.peopleIds=null,
  398. this.form.absentIds=null
  399. },
  400. // 获取主持人
  401. getZhuChi(id) {
  402. getZhuChiRen(id).then((res) => {
  403. this.renYuan = res.data;
  404. });
  405. },
  406. // -新增选折单位触发
  407. selectPeo(val) {
  408. this.ChongZhiRen();
  409. // 获取人员1
  410. this.form.unitId = val.id;
  411. this.getZhuChi(this.form.unitId);
  412. },
  413. // 搜索单位触发
  414. Company() {
  415. this.getList();
  416. var url = "/grassrootsregistration/common/getZhuChiRen";
  417. getDeptId(url, this.queryParams.unitId).then((res) => {
  418. this.renYuan = res.data;
  419. });
  420. },
  421. // 搜索主持人触发
  422. compere() {
  423. this.getList();
  424. },
  425. // 选中主持人触发
  426. ZhuChiRen(name) {
  427. this.form.compereRen = name;
  428. },
  429. // 选中记录人触发
  430. peoples(name) {
  431. this.form.peopleJiLu = name;
  432. },
  433. /** 查询党支部会议登记本列表 */
  434. getList() {
  435. this.loading = true;
  436. listBdglparty(this.queryParams).then((response) => {
  437. this.bdglpartyList = response.rows;
  438. this.total = response.total;
  439. this.loading = false;
  440. });
  441. },
  442. // 取消按钮
  443. cancel() {
  444. this.open = false;
  445. this.reset();
  446. },
  447. // 表单重置
  448. reset() {
  449. this.form = {
  450. id: null,
  451. convokeTime: null,
  452. address: null,
  453. compereId: null,
  454. joinId: null,
  455. peopleIds: null,
  456. absentIds: null,
  457. peopleId: null,
  458. title: null,
  459. contents: null,
  460. createtime: null,
  461. updatetime: null,
  462. unitId: null,
  463. };
  464. this.resetForm("form");
  465. },
  466. /** 搜索按钮操作 */
  467. handleQuery() {
  468. this.queryParams.pageNum = 1;
  469. this.getList();
  470. },
  471. /** 重置按钮操作 */
  472. resetQuery() {
  473. this.resetForm("queryForm");
  474. this.handleQuery();
  475. },
  476. /** 对话框重置按钮操作 */
  477. resertwo() {
  478. this.reset();
  479. },
  480. // 多选框选中数据
  481. handleSelectionChange(selection) {
  482. this.ids = selection.map((item) => item.id);
  483. this.single = selection.length !== 1;
  484. this.multiple = !selection.length;
  485. },
  486. /** 新增按钮操作 */
  487. handleAdd() {
  488. // 人员
  489. this.renYuan=[],
  490. this.style = 2;
  491. this.reset();
  492. this.getTreeselect();
  493. this.open = true;
  494. this.title = "添加党支部会议登记本";
  495. },
  496. /** 修改按钮操作 */
  497. handleUpdate(row) {
  498. this.reset();
  499. this.form.unitId = row.unitId;
  500. this.getZhuChi(this.form.unitId);
  501. this.getTreeselect();
  502. const id = row.id || this.ids;
  503. getBdglparty(id).then((response) => {
  504. this.result = response.data;
  505. if (this.result.joinId !== "") {
  506. this.result.joinId = response.data.joinId.split(",");
  507. this.result.joinId= this.result.joinId.map(i => parseInt(i, 0))
  508. }
  509. if (this.result.peopleIds !== "") {
  510. this.result.peopleIds = response.data.peopleIds.split(",");
  511. this.result.peopleIds= this.result.peopleIds.map(i => parseInt(i, 0))
  512. }
  513. if (this.result.absentIds !== "") {
  514. this.result.absentIds = response.data.absentIds.split(",");
  515. this.result.absentIds= this.result.absentIds.map(i => parseInt(i, 0))
  516. }
  517. this.form = this.result;
  518. this.open = true;
  519. this.title = "修改党支部会议登记本";
  520. });
  521. },
  522. /** 提交按钮 */
  523. submitForm(style) {
  524. this.style = style;
  525. this.$refs["form"].validate((valid) => {
  526. this.style = style;
  527. if (valid) {
  528. if (this.form.id != null) {
  529. if (this.form.joinId !== undefined) {
  530. this.form.joinId = this.form.joinId.join(",");
  531. }
  532. if (this.form.peopleIds !== undefined) {
  533. this.form.peopleIds = this.form.peopleIds.join(",");
  534. }
  535. if (this.form.absentIds !== undefined) {
  536. this.form.absentIds = this.form.absentIds.join(",");
  537. }
  538. updateBdglparty(this.form).then((response) => {
  539. this.$modal.msgSuccess("修改成功");
  540. this.open = false;
  541. this.getList();
  542. });
  543. } else {
  544. (this.form.joinId = this.form.joinId.join(",")),
  545. (this.form.peopleIds = this.form.peopleIds.join(",")),
  546. (this.form.absentIds = this.form.absentIds.join(",")),
  547. addBdglparty(this.form).then((response) => {
  548. this.$modal.msgSuccess("新增成功");
  549. this.open = false;
  550. this.getList();
  551. });
  552. }
  553. }
  554. });
  555. },
  556. /** 删除按钮操作 */
  557. handleDelete(row) {
  558. const ids = row.id || this.ids;
  559. this.$modal
  560. .confirm('是否确认删除党支部会议登记本编号为"' + ids + '"的数据项?')
  561. .then(function () {
  562. return delBdglparty(ids);
  563. })
  564. .then(() => {
  565. this.getList();
  566. this.$modal.msgSuccess("删除成功");
  567. })
  568. .catch(() => {});
  569. },
  570. /** 导出按钮操作 */
  571. handleExport() {
  572. const queryParams = this.queryParams;
  573. this.$modal
  574. .confirm("是否确认导出所有党支部会议登记本数据项?")
  575. .then(() => {
  576. this.exportLoading = true;
  577. return exportBdglparty(queryParams);
  578. })
  579. .then((response) => {
  580. this.$download.name(response.msg);
  581. this.exportLoading = false;
  582. })
  583. .catch(() => {});
  584. },
  585. //获取部门列表
  586. getdept() {
  587. getDept().then((response) => {
  588. this.buMeng = response.data;
  589. });
  590. },
  591. /** 查询部门下拉树结构 */
  592. getTreeselect() {
  593. treeselect().then((response) => {
  594. this.deptOptions = response.data;
  595. });
  596. },
  597. },
  598. };
  599. </script>
  600. <style scoped>
  601. /* 对话框背景颜色 */
  602. ::v-deep .el-dialog {
  603. background: #004d86 !important;
  604. }
  605. ::v-deep .el-textarea__inner {
  606. width: 884px;
  607. height: 104px;
  608. }
  609. ::v-deep .el-dialog__header {
  610. border-bottom: 1px solid #718a9d;
  611. }
  612. ::v-deep .el-dialog__title {
  613. color: #fff;
  614. font: 18px;
  615. }
  616. ::v-deep .el-dialog__headerbtn .el-dialog__close {
  617. color: #fff;
  618. }
  619. ::v-deep .el-form-item__label {
  620. font: 16px;
  621. color: #fff;
  622. width: 100px !important;
  623. }
  624. ::v-deep .el-input__inner {
  625. /* width: 200px !important;
  626. height: 36px; */
  627. color: #fff;
  628. background: transparent;
  629. }
  630. ::v-deep .el-textarea__inner {
  631. width: 884px;
  632. height: 104px;
  633. }
  634. /* 基本信息背景 */
  635. .jiben {
  636. width: 952px;
  637. height: 32px;
  638. background-image: url(../../../images/小标题底.png);
  639. margin-bottom: 25px;
  640. color: #fff;
  641. padding-left: 16px;
  642. line-height: 32px;
  643. }
  644. /* 调整表单间距 */
  645. ::v-deep .el-form-item__content {
  646. width: 200px;
  647. }
  648. .contents {
  649. padding: 0px 40px !important;
  650. }
  651. /* 下拉菜单字体/背景颜色 */
  652. .el-select-dropdown__item.hover,
  653. .el-select-dropdown__item:hover {
  654. background-color: #196299;
  655. color: #fff;
  656. }
  657. .el-select-dropdown__item {
  658. color: #fff;
  659. }
  660. /* 刷新图标 */
  661. /* .el-icon-refresh {
  662. width: 76px;
  663. height: 36px;
  664. color: #fff;
  665. background-color: #1d96ff !important;
  666. border-radius: 4px;
  667. border: none;
  668. margin-left: 20px;
  669. font-size: 14px;
  670. } */
  671. /* 时间选择 */
  672. ::v-deep .el-input--small .el-input__inner {
  673. width: 200px;
  674. height: 36px;
  675. line-height: 36px;
  676. }
  677. .el-date-editor.el-input {
  678. width: 200px;
  679. height: 36px;
  680. line-height: 36px;
  681. }
  682. ::v-deep .el-date-editor.el-input .el-input__inner {
  683. height: 36px;
  684. line-height: 36px;
  685. }
  686. /* 富文本 */
  687. ::v-deep .ql-snow .ql-fill,
  688. .ql-snow .ql-stroke.ql-fill {
  689. fill: #fff !important;
  690. }
  691. ::v-deep .ql-snow .ql-stroke {
  692. stroke: #fff !important;
  693. }
  694. ::v-deep .ql-snow .ql-picker {
  695. color: #fff !important;
  696. }
  697. /* 单位框背景颜色 */
  698. ::v-deep .vue-treeselect__control {
  699. background: #004d86 !important;
  700. }
  701. /* 单位下拉菜单选中字体颜色 */
  702. ::v-deep .vue-treeselect__single-value {
  703. color: #fff !important;
  704. }
  705. /* 出席人 */
  706. ::v-deep .joinId {
  707. width: 650px !important;
  708. }
  709. ::v-deep .joinId .el-input__inner {
  710. width: 510px !important;
  711. }
  712. /* 分页按钮 */
  713. ::v-deep .el-pagination.is-background .el-pager li {
  714. background-color: #004d86;
  715. color: #fff;
  716. }
  717. ::v-deep .el-pagination.is-background .btn-next {
  718. background-color: #004d86;
  719. color: #fff;
  720. }
  721. /* 富文本删除功能 */
  722. ::v-deep .ql-blockquote {
  723. display: none !important;
  724. }
  725. ::v-deep .ql-strike {
  726. display: none !important;
  727. }
  728. ::v-deep .ql-script {
  729. display: none !important;
  730. }
  731. ::v-deep .ql-code-block {
  732. display: none !important;
  733. }
  734. ::v-deep .ql-direction {
  735. display: none !important;
  736. }
  737. ::v-deep .ql-toolbar.ql-snow .ql-formats {
  738. margin-right: 7px;
  739. }
  740. ::v-deep .el-input__inner {
  741. cursor: pointer !important;
  742. }
  743. </style>