index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  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="left"
  127. header-align="center"
  128. width="260"
  129. prop="date"
  130. >
  131. </el-table-column>
  132. <el-table-column label="参会人员" align="center" prop="joinNames">
  133. </el-table-column>
  134. <el-table-column
  135. label="操作"
  136. width="240"
  137. fixed="right"
  138. align="center"
  139. class-name="small-padding fixed-width"
  140. >
  141. <template slot-scope="scope">
  142. <!-- <el-button
  143. size="mini"
  144. type="text"
  145. icon="el-icon-view"
  146. @click="showImages(scope.row.images)"
  147. v-hasPermi="['core:hsggbsdj:query']"
  148. >查看照片
  149. </el-button> -->
  150. <el-button
  151. size="mini"
  152. type="text"
  153. icon="el-icon-info"
  154. @click="handleInfo(scope.row.id)"
  155. v-hasPermi="['core:hsggbsdj:query']"
  156. >详情
  157. </el-button>
  158. <el-button
  159. size="mini"
  160. type="text"
  161. icon="el-icon-edit-outline"
  162. @click="handleAdd(scope.row.id)"
  163. v-hasPermi="['core:hsggbsdj:edit']"
  164. >编辑
  165. </el-button>
  166. <el-button
  167. size="mini"
  168. type="text"
  169. icon="el-icon-delete"
  170. @click="handleDelete(scope.row)"
  171. v-hasPermi="['core:hsggbsdj:remove']"
  172. >删除
  173. </el-button>
  174. </template>
  175. </el-table-column>
  176. </el-table>
  177. <pagination
  178. v-show="total > 0"
  179. :total="total"
  180. :page.sync="queryParams.pageNum"
  181. :limit.sync="queryParams.pageSize"
  182. @pagination="getList"
  183. />
  184. </div>
  185. <dialog-edit ref="editDialog" @success="getList()"></dialog-edit>
  186. <dialog-des ref="desDialog"></dialog-des>
  187. <el-image-viewer
  188. v-if="imageViewer"
  189. :on-close="closeImgViewer"
  190. :url-list="srcList"
  191. />
  192. </div>
  193. </template>
  194. <script>
  195. import {
  196. listhsggbsdj,
  197. gethsggbsdj,
  198. Add,
  199. edit,
  200. delhsggbsdj,
  201. } from "@/api/safetyBook/hsggbsdj";
  202. import { getLabel } from "@/views/commonOption";
  203. import DialogEdit from "./dialog.edit";
  204. import DialogDes from "./dialog.des";
  205. import { deptTreeSelect } from "@/api/system/public";
  206. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  207. import OrgTree from "@/components/orgTree/index.vue";
  208. import kOrgTree from "@/components/k-orgTree/index.vue";
  209. import KFileUpload from "@/components/K-FileUpload/index.vue";
  210. import tableList from "@/mixins/tableList";
  211. import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
  212. export default {
  213. dicts: ["safety_book_type"],
  214. name: "hsggbsdj",
  215. components: {
  216. OrgTree,
  217. kOrgTree,
  218. KFileUpload,
  219. DialogEdit,
  220. DataRangePicker,
  221. DialogDes,
  222. "el-image-viewer": () =>
  223. import("element-ui/packages/image/src/image-viewer"),
  224. },
  225. mixins: [tableList],
  226. data() {
  227. return {
  228. // 遮罩层
  229. loading: true,
  230. // 选中数组
  231. ids: [],
  232. // 非单个禁用
  233. single: true,
  234. // 非多个禁用
  235. multiple: true,
  236. // 显示搜索条件
  237. showSearch: true,
  238. // 总条数
  239. total: 0,
  240. // 行社高管部署登记表格数据
  241. dataList: [],
  242. // 弹出层标题
  243. title: "",
  244. // 是否显示弹出层
  245. open: false,
  246. // 机构树选项
  247. deptOptions: [],
  248. // 机构名称
  249. deptName: undefined,
  250. //是否关联下级
  251. checked: false,
  252. timeClearable: true,
  253. defaultProps: {
  254. children: "children",
  255. label: "name",
  256. },
  257. formFileListDefualtValue: [],
  258. // 查询参数
  259. queryParams: {
  260. checkSub: true,
  261. pageNum: 1,
  262. pageSize: 10,
  263. orgId: null,
  264. searchOrgId: null,
  265. range:[],
  266. title:null,
  267. },
  268. // 表单参数
  269. form: {},
  270. imageViewer: false,
  271. srcList: [],
  272. //默认选中节点
  273. defaultKeys: [],
  274. };
  275. },
  276. watch: {
  277. // 根据名称筛选机构树
  278. deptName(val) {
  279. this.$refs.tree.filter(val);
  280. },
  281. },
  282. created() {
  283. this.getDeptTree();
  284. this.getConfigKey("sys.user.initPassword").then((response) => {
  285. this.initPassword = response.msg;
  286. });
  287. this.getList();
  288. },
  289. methods: {
  290. resetQuery() {
  291. this.resetForm("queryForm");
  292. this.getList();
  293. },
  294. /** treeSelect组件自定义数据*/
  295. tenantIdnormalizer(node, instanceId) {
  296. if (node.children && !node.children.length) {
  297. delete node.children;
  298. }
  299. return {
  300. id: node.id,
  301. label: node.shortName,
  302. children: node.children,
  303. };
  304. },
  305. showImages(file) {
  306. let array = file.split(",");
  307. this.srcList = array;
  308. this.imageViewer = true;
  309. },
  310. closeImgViewer() {
  311. this.imageViewer = false;
  312. this.srcList = [];
  313. },
  314. getLabel(options, value) {
  315. return getLabel(options, value);
  316. },
  317. //新增
  318. handleAdd(id) {
  319. this.$refs.editDialog.show(id);
  320. },
  321. /** 查询行社高管部署登记列表 */
  322. getList() {
  323. this.loading = true;
  324. listhsggbsdj(this.queryParams).then((response) => {
  325. this.dataList = response.rows;
  326. this.total = response.total;
  327. this.loading = false;
  328. });
  329. },
  330. getDeptTree() {
  331. deptTreeSelect().then((response) => {
  332. this.deptOptions = response.data;
  333. });
  334. },
  335. // 节点单击事件
  336. clickTreeNode(data) {
  337. this.queryParams.orgId = data.id;
  338. this.handleQuery();
  339. },
  340. /** 下穿状态改变*/
  341. changeCheckBox() {
  342. this.getList();
  343. },
  344. getDefaultKey(key) {
  345. this.queryParams.orgId = key;
  346. this.getList();
  347. },
  348. //单选框状态改变
  349. checkChange(state) {
  350. this.queryParams.checkSub = state;
  351. this.handleQuery();
  352. },
  353. // 筛选节点
  354. filterNode(value, data) {
  355. if (!value) return true;
  356. return data.name.indexOf(value) !== -1;
  357. },
  358. // 节点单击事件
  359. handleNodeClick(data) {
  360. this.queryParams.orgId = data.id;
  361. this.handleQuery();
  362. },
  363. /** 搜索按钮操作 */
  364. handleQuery() {
  365. this.queryParams.pageNum = 1;
  366. this.getList();
  367. },
  368. /** 删除按钮操作 */
  369. handleDelete(row) {
  370. const ids = row.id || this.ids;
  371. this.$modal
  372. .confirm("是否确认删除?")
  373. .then(function () {
  374. return delhsggbsdj(ids);
  375. })
  376. .then(() => {
  377. this.getList();
  378. this.$modal.msgSuccess("删除成功");
  379. })
  380. .catch(() => {});
  381. },
  382. /** 详情按钮操作 */
  383. handleInfo(id) {
  384. this.$refs.desDialog.show(id);
  385. },
  386. },
  387. };
  388. </script>
  389. <style lang="scss" scoped>
  390. .ellipsis {
  391. white-space: nowrap;
  392. overflow: hidden;
  393. text-overflow: ellipsis;
  394. }
  395. ::v-deep.formTreeItem {
  396. .el-form-item__content {
  397. width: 264px;
  398. }
  399. }
  400. </style>