index.vue 11 KB

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