index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. <template>
  2. <div class="app-container">
  3. <!--机构数据-->
  4. <!-- <el-col :span="4" :xs="24" v-if="false">
  5. <org-tree
  6. v-model="queryParams.orgId"
  7. @defaultKey="getDefaultKey"
  8. @checkChange="checkChange"
  9. @click="clickTreeNode"
  10. wholeTree
  11. ></org-tree>
  12. </el-col> -->
  13. <!--用户数据-->
  14. <div class="main-right-box">
  15. <!-- 搜索条件 -->
  16. <div class="main-search-box">
  17. <el-form
  18. :model="queryParams"
  19. ref="queryForm"
  20. size="small"
  21. :inline="true"
  22. v-show="showSearch"
  23. >
  24. <el-row :gutter="50">
  25. <el-col :span="6" :xs="14">
  26. <el-form-item prop="title" label="会议主题">
  27. <el-input
  28. v-model="queryParams.title"
  29. :maxlength="50"
  30. name="title"
  31. placeholder="请输入工作主题关键字"
  32. clearable
  33. />
  34. </el-form-item>
  35. </el-col>
  36. <el-col :span="8" :xs="24">
  37. <el-form-item label="会议时间" prop="range">
  38. <DataRangePicker
  39. type="daterange"
  40. :default-time="['00:00:00', '23:59:59']"
  41. start-placeholder="开始日期"
  42. end-placeholder="结束日期"
  43. v-model="queryParams.range"
  44. >
  45. </DataRangePicker>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="6" :xs="24">
  49. <el-form-item label="组织机构" prop="orgId" class="formTreeItem">
  50. <tree-select
  51. v-model="queryParams.orgId"
  52. :options="deptOptions"
  53. :show-count="true"
  54. :normalizer="tenantIdnormalizer"
  55. :props="{ checkStrictly: true, label: 'name' }"
  56. placeholder="请选择组织机构"
  57. clearValueText="清除"
  58. :noChildrenText="''"
  59. noOptionsText="没有数据"
  60. noResultsText="没有搜索结果"
  61. />
  62. </el-form-item>
  63. </el-col>
  64. </el-row>
  65. </el-form>
  66. <el-row :gutter="10" class="mb8">
  67. <el-col :span="1.5">
  68. <el-button
  69. type="primary"
  70. icon="el-icon-search"
  71. size="mini"
  72. @click="getList"
  73. >搜索</el-button
  74. >
  75. </el-col>
  76. <el-col :span="1.5">
  77. <el-button
  78. type="primary"
  79. icon="el-icon-refresh"
  80. size="mini"
  81. @click="resetQuery"
  82. >重置</el-button
  83. >
  84. </el-col>
  85. <el-col :span="1.5">
  86. <el-button
  87. type="primary"
  88. icon="el-icon-plus"
  89. size="mini"
  90. @click="handleAdd(null)"
  91. v-hasPermi="['core:hsggbsdj:add']"
  92. >新增
  93. </el-button>
  94. </el-col>
  95. <right-toolbar
  96. :showSearch.sync="showSearch"
  97. @queryTable="getList"
  98. ></right-toolbar>
  99. </el-row>
  100. </div>
  101. <!-- 表格数据 -->
  102. <el-table
  103. border
  104. height="600"
  105. size="small"
  106. v-loading="loading"
  107. :data="dataList"
  108. >
  109. <el-table-column label="序号" type="index" align="center" width="60" />
  110. <el-table-column
  111. label="行社名称"
  112. align="left"
  113. header-align="center"
  114. width="300"
  115. prop="orgName"
  116. />
  117. <el-table-column
  118. label="会议主题"
  119. align="left"
  120. header-align="center"
  121. width="300"
  122. prop="title"
  123. />
  124. <el-table-column
  125. label="会议日期"
  126. align="center"
  127. width="260"
  128. prop="date"
  129. >
  130. <template slot-scope="r">
  131. {{ r.row.date ? dayjs(r.row.date).format("YYYY年-MM月-DD日") : "" }}
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="参会人员" align="center" prop="joinNames">
  135. </el-table-column>
  136. <el-table-column
  137. label="操作"
  138. width="240"
  139. fixed="right"
  140. align="center"
  141. class-name="small-padding fixed-width"
  142. >
  143. <template slot-scope="scope">
  144. <!-- <el-button
  145. size="mini"
  146. type="text"
  147. icon="el-icon-view"
  148. @click="showImages(scope.row.images)"
  149. v-hasPermi="['core:hsggbsdj:query']"
  150. >查看照片
  151. </el-button> -->
  152. <el-button
  153. size="mini"
  154. type="text"
  155. icon="el-icon-info"
  156. @click="handleInfo(scope.row.id)"
  157. v-hasPermi="['core:hsggbsdj:query']"
  158. >详情
  159. </el-button>
  160. <el-button
  161. size="mini"
  162. type="text"
  163. icon="el-icon-edit-outline"
  164. @click="handleAdd(scope.row.id)"
  165. v-hasPermi="['core:hsggbsdj:edit']"
  166. >编辑
  167. </el-button>
  168. <el-button
  169. size="mini"
  170. type="text"
  171. icon="el-icon-delete"
  172. @click="handleDelete(scope.row)"
  173. v-hasPermi="['core:hsggbsdj:remove']"
  174. >删除
  175. </el-button>
  176. </template>
  177. </el-table-column>
  178. </el-table>
  179. <pagination
  180. v-show="total > 0"
  181. :total="total"
  182. :page.sync="queryParams.pageNum"
  183. :limit.sync="queryParams.pageSize"
  184. @pagination="getList"
  185. />
  186. </div>
  187. <dialog-edit ref="editDialog" @success="getList()"></dialog-edit>
  188. <dialog-des ref="desDialog"></dialog-des>
  189. <el-image-viewer
  190. v-if="imageViewer"
  191. :on-close="closeImgViewer"
  192. :url-list="srcList"
  193. />
  194. </div>
  195. </template>
  196. <script>
  197. import {
  198. listhsggbsdj,
  199. gethsggbsdj,
  200. Add,
  201. edit,
  202. delhsggbsdj,
  203. } from "@/api/safetyBook/hsggbsdj";
  204. import { getLabel } from "@/views/commonOption";
  205. import DialogEdit from "./dialog.edit";
  206. import DialogDes from "./dialog.des";
  207. import { deptTreeSelect } from "@/api/system/public";
  208. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  209. import OrgTree from "@/components/orgTree/index.vue";
  210. import kOrgTree from "@/components/k-orgTree/index.vue";
  211. import KFileUpload from "@/components/K-FileUpload/index.vue";
  212. import tableList from "@/mixins/tableList";
  213. import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
  214. import dayjs from "dayjs";
  215. export default {
  216. dicts: ["safety_book_type"],
  217. name: "hsggbsdj",
  218. components: {
  219. OrgTree,
  220. kOrgTree,
  221. KFileUpload,
  222. DialogEdit,
  223. DataRangePicker,
  224. DialogDes,
  225. "el-image-viewer": () =>
  226. import("element-ui/packages/image/src/image-viewer"),
  227. },
  228. mixins: [tableList],
  229. data() {
  230. return {
  231. // 遮罩层
  232. loading: true,
  233. // 选中数组
  234. ids: [],
  235. // 非单个禁用
  236. single: true,
  237. // 非多个禁用
  238. multiple: true,
  239. // 显示搜索条件
  240. showSearch: true,
  241. // 总条数
  242. total: 0,
  243. // 行社高管部署登记表格数据
  244. dataList: [],
  245. // 弹出层标题
  246. title: "",
  247. // 是否显示弹出层
  248. open: false,
  249. // 机构树选项
  250. deptOptions: [],
  251. // 机构名称
  252. deptName: undefined,
  253. //是否关联下级
  254. checked: false,
  255. timeClearable: true,
  256. defaultProps: {
  257. children: "children",
  258. label: "name",
  259. },
  260. formFileListDefualtValue: [],
  261. // 查询参数
  262. queryParams: {
  263. checkSub: true,
  264. pageNum: 1,
  265. pageSize: 10,
  266. orgId: null,
  267. searchOrgId: null,
  268. range:[],
  269. title:null,
  270. },
  271. // 表单参数
  272. form: {},
  273. imageViewer: false,
  274. srcList: [],
  275. //默认选中节点
  276. defaultKeys: [],
  277. };
  278. },
  279. watch: {
  280. // 根据名称筛选机构树
  281. deptName(val) {
  282. this.$refs.tree.filter(val);
  283. },
  284. },
  285. created() {
  286. this.getDeptTree();
  287. this.getConfigKey("sys.user.initPassword").then((response) => {
  288. this.initPassword = response.msg;
  289. });
  290. this.getList();
  291. },
  292. methods: {
  293. dayjs,
  294. resetQuery() {
  295. this.resetForm("queryForm");
  296. this.getList();
  297. },
  298. /** treeSelect组件自定义数据*/
  299. tenantIdnormalizer(node, instanceId) {
  300. if (node.children && !node.children.length) {
  301. delete node.children;
  302. }
  303. return {
  304. id: node.id,
  305. label: node.shortName,
  306. children: node.children,
  307. };
  308. },
  309. showImages(file) {
  310. let array = file.split(",");
  311. this.srcList = array;
  312. this.imageViewer = true;
  313. },
  314. closeImgViewer() {
  315. this.imageViewer = false;
  316. this.srcList = [];
  317. },
  318. getLabel(options, value) {
  319. return getLabel(options, value);
  320. },
  321. //新增
  322. handleAdd(id) {
  323. this.$refs.editDialog.show(id);
  324. },
  325. /** 查询行社高管部署登记列表 */
  326. getList() {
  327. this.loading = true;
  328. listhsggbsdj(this.queryParams).then((response) => {
  329. this.dataList = response.rows;
  330. this.total = response.total;
  331. this.loading = false;
  332. });
  333. },
  334. getDeptTree() {
  335. deptTreeSelect().then((response) => {
  336. this.deptOptions = response.data;
  337. });
  338. },
  339. // 节点单击事件
  340. clickTreeNode(data) {
  341. this.queryParams.orgId = data.id;
  342. this.handleQuery();
  343. },
  344. /** 下穿状态改变*/
  345. changeCheckBox() {
  346. this.getList();
  347. },
  348. getDefaultKey(key) {
  349. this.queryParams.orgId = key;
  350. this.getList();
  351. },
  352. //单选框状态改变
  353. checkChange(state) {
  354. this.queryParams.checkSub = state;
  355. this.handleQuery();
  356. },
  357. // 筛选节点
  358. filterNode(value, data) {
  359. if (!value) return true;
  360. return data.name.indexOf(value) !== -1;
  361. },
  362. // 节点单击事件
  363. handleNodeClick(data) {
  364. this.queryParams.orgId = data.id;
  365. this.handleQuery();
  366. },
  367. /** 搜索按钮操作 */
  368. handleQuery() {
  369. this.queryParams.pageNum = 1;
  370. this.getList();
  371. },
  372. /** 删除按钮操作 */
  373. handleDelete(row) {
  374. const ids = row.id || this.ids;
  375. this.$modal
  376. .confirm("是否确认删除?")
  377. .then(function () {
  378. return delhsggbsdj(ids);
  379. })
  380. .then(() => {
  381. this.getList();
  382. this.$modal.msgSuccess("删除成功");
  383. })
  384. .catch(() => {});
  385. },
  386. /** 详情按钮操作 */
  387. handleInfo(id) {
  388. this.$refs.desDialog.show(id);
  389. },
  390. },
  391. };
  392. </script>
  393. <style lang="scss" scoped>
  394. .ellipsis {
  395. white-space: nowrap;
  396. overflow: hidden;
  397. text-overflow: ellipsis;
  398. }
  399. ::v-deep.formTreeItem {
  400. .el-form-item__content {
  401. width: 264px;
  402. }
  403. }
  404. </style>