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