file.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="20">
  4. <el-col :span="4">
  5. <!-- <div class="head-container">-->
  6. <!-- <el-input-->
  7. <!-- v-model="deptName"-->
  8. <!-- placeholder="请输入部门名称"-->
  9. <!-- clearable-->
  10. <!-- size="small"-->
  11. <!-- prefix-icon="el-icon-search"-->
  12. <!-- style="margin-bottom: 20px"-->
  13. <!-- />-->
  14. <!-- </div>-->
  15. <div class="head-container">
  16. <el-tree
  17. :data="deptOptions"
  18. :props="defaultProps"
  19. :expand-on-click-node="false"
  20. :filter-node-method="filterNode"
  21. node-key="deptId"
  22. :default-expanded-keys="idArr"
  23. ref="tree"
  24. @node-click="handleNodeClick"
  25. />
  26. </div>
  27. </el-col>
  28. <el-col :span="20">
  29. <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
  30. <el-form-item label="档案名称" prop="archivesName">
  31. <el-input
  32. v-model="queryParams.archivesName"
  33. placeholder="请输入档案名称"
  34. clearable
  35. size="small"
  36. @keyup.enter.native="handleQuery"
  37. />
  38. </el-form-item>
  39. <el-form-item label="档案编号" prop="archivesNum">
  40. <el-input
  41. v-model="queryParams.archivesNum"
  42. placeholder="请输入档案编号"
  43. clearable
  44. size="small"
  45. @keyup.enter.native="handleQuery"
  46. />
  47. </el-form-item>
  48. <el-form-item label="归档日期" prop="archivesTime">
  49. <el-date-picker clearable size="small" style="width: 200px"
  50. v-model="queryParams.archivesTime"
  51. type="date"
  52. value-format="yyyy-MM-dd"
  53. placeholder="选择日期">
  54. </el-date-picker>
  55. </el-form-item>
  56. <el-form-item>
  57. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  58. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  59. </el-form-item>
  60. </el-form>
  61. <el-row :gutter="10" class="mb8" style="margin-top: 0px;">
  62. <el-col :span="1.5">
  63. <el-button
  64. type="danger"
  65. icon="el-icon-delete"
  66. size="mini"
  67. :disabled="multiple"
  68. @click="handleDelete"
  69. >删除</el-button>
  70. </el-col>
  71. </el-row>
  72. <el-table border v-loading="loading" :data="archivesList" @selection-change="handleSelectionChange">
  73. <el-table-column type="selection" width="55" align="center" />
  74. <el-table-column label="序号" type="index" align="center">
  75. <template slot-scope="scope">
  76. <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
  77. </template>
  78. </el-table-column>
  79. <!-- <el-table-column label="主键" align="center" prop="id" />-->
  80. <el-table-column label="所属部门" width="120" align="center" prop="deptName" />
  81. <el-table-column label="档案编号" align="center" prop="archivesNum" />
  82. <el-table-column label="档案名称" align="center" prop="archivesName" />
  83. <el-table-column label="流程名称" align="center" prop="processName" />
  84. <el-table-column label="所属分类" align="center" prop="archivesType" />
  85. <el-table-column label="归档人" align="center" prop="rematk" />
  86. <el-table-column label="归档日期" align="center" prop="archivesTime" width="120">
  87. <template slot-scope="scope">
  88. <span>{{ parseTime(scope.row.archivesTime, '{y}-{m}-{d}') }}</span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  92. <template slot-scope="scope">
  93. <el-button
  94. size="mini"
  95. type="text"
  96. icon="el-icon-edit"
  97. @click="openactform(scope.row.actkey,scope.row.id,scope.row.taskId)"
  98. >详情</el-button>
  99. <el-button
  100. size="mini"
  101. type="text"
  102. icon="el-icon-delete"
  103. @click="handleDelete(scope.row)"
  104. >删除</el-button>
  105. </template>
  106. </el-table-column>
  107. </el-table>
  108. <pagination
  109. v-show="total>0"
  110. :total="total"
  111. :page.sync="queryParams.pageNum"
  112. :limit.sync="queryParams.pageSize"
  113. @pagination="getListtable"
  114. />
  115. </el-col>
  116. </el-row>
  117. <el-dialog id="actform" title="档案详情" :visible.sync="open" :before-close="cancel" append-to-body width="80%"
  118. top="10" height="90%">
  119. <!-- 动态引入组件-->
  120. <component :is="actForm" :data="details":actOpen="open" @getListtable="getListtable" ></component>
  121. </el-dialog>
  122. </div>
  123. </template>
  124. <script>
  125. import { getListright,listArchives, getArchives, delArchives, addArchives, updateArchives, exportArchives } from "@/api/system/archives/archives";
  126. import { getToken } from "@/utils/auth";
  127. // import { treeselect } from "@/api/system/dept";
  128. import Editor from '@/components/Editor';
  129. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  130. import { listDept } from "@/api/system/archives/column";
  131. import Treeselect from "@riophae/vue-treeselect";
  132. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  133. import {getStartFormKey,getCurrentFlowFormKey } from '@/api/activiti/process/startprocess'
  134. import log from '../../monitor/job/log'
  135. export default {
  136. name: "Archives",
  137. components: {
  138. Editor,
  139. Treeselect
  140. },
  141. data() {
  142. return {
  143. idArr:[100,101],
  144. data:undefined,
  145. // 遮罩层
  146. loading: true,
  147. // 选中数组
  148. ids: [],
  149. // 非单个禁用
  150. single: true,
  151. // 非多个禁用
  152. multiple: true,
  153. dqbumen:'',
  154. dqname:'',
  155. actForm: null,
  156. actOpen: false,
  157. details:{getactkey: '',
  158. formId:'',
  159. flg:'2'},
  160. //下拉选框
  161. doc: [],
  162. options: [],
  163. // 部门名称
  164. deptName: undefined,
  165. // 部门树选项
  166. deptOptions: [],
  167. defaultProps: {
  168. children: "children",
  169. label: "deptName"
  170. },
  171. // 总条数
  172. total: 0,
  173. // 【请填写功能名称】表格数据
  174. archivesList: [],
  175. // 弹出层标题
  176. title: "",
  177. // 是否显示弹出层
  178. open: false,
  179. // 查询参数
  180. queryParams: {
  181. pageNum: 1,
  182. pageSize: 10,
  183. archivesName: undefined,
  184. archivesNum: undefined,
  185. deptId: undefined,
  186. deptName: undefined,
  187. archivesType: undefined,
  188. archivesTime: undefined,
  189. state: undefined,
  190. rematk: undefined,
  191. actkey:undefined
  192. },
  193. // 表单参数
  194. form: {},
  195. // 表单校验
  196. rules: {
  197. }
  198. };
  199. },
  200. created() {
  201. this.getList();
  202. this.getListtable();
  203. // this.getTreeselect();
  204. },
  205. methods: {
  206. openactform(actkey,id,taskId) {
  207. this.open = true
  208. let vue = this
  209. actkey=actkey.split(":")[0];
  210. this.details.getactkey = actkey//动态传参到下面的页面
  211. this.details.formId = taskId//动态传参到下面的页面
  212. //this.details.formId = id//动态传参到下面的页面
  213. getStartFormKey(actkey).then(response => {
  214. var path = response.msg
  215. this.actForm = () => Promise.resolve().then(() => require(`@/views/${path}`))
  216. })
  217. return vue.actForm = this.actForm
  218. },
  219. /** 查询部门下拉树结构 */
  220. // getTreeselect() {
  221. // treeselect().then(response => {
  222. // this.deptOptions = response.data;
  223. // console.log(response.data)
  224. // });
  225. // },
  226. // 筛选节点
  227. filterNode(value, data) {
  228. if (!value) return true;
  229. return data.leabel.indexOf(value) !== -1;
  230. },
  231. // 节点单击事件
  232. handleNodeClick(data) {
  233. console.log(data)
  234. this.queryParams.deptId = data.deptId;
  235. this.getListtable();
  236. },
  237. // getListeven(){
  238. // getArchives
  239. // },
  240. getListtable(){
  241. getListright(this.queryParams).then(response => {
  242. console.log(response.rows)
  243. this.archivesList = response.rows;
  244. this.total = response.total;
  245. })
  246. // this.loading = true;
  247. // havedInfo(this.queryParams).then(response => {
  248. // this.infoList = response.rows;
  249. // this.total = response.total;
  250. // this.loading = false;
  251. // this.actOpen=false;
  252. // });
  253. },
  254. /** 查询文档列表 */
  255. getList() {
  256. this.loading = true;
  257. listDept(this.queryParams).then(response => {
  258. console.log(response.data)
  259. this.deptOptions = this.handleTree(response.data, "deptId");
  260. console.log(this.handleTree(response.data, "deptId"))
  261. this.loading = false;
  262. });
  263. },
  264. /** 转换文档数据结构 */
  265. normalizer(node) {
  266. if (node.children && !node.children.length) {
  267. delete node.children;
  268. }
  269. return {
  270. id: node.deptId,
  271. label: node.deptName,
  272. children: node.children
  273. };
  274. },
  275. handleChange(value) {
  276. this.form.documentType= JSON.stringify(this.doc)
  277. console.log(value);
  278. },
  279. // 取消按钮
  280. cancel() {
  281. this.open = false;
  282. this.reset();
  283. },
  284. // 表单重置
  285. reset() {
  286. this.form = {
  287. id: undefined,
  288. archivesName: undefined,
  289. archivesNum: undefined,
  290. deptId: undefined,
  291. deptName: undefined,
  292. archivesType: undefined,
  293. archivesTime: undefined,
  294. state: undefined,
  295. rematk: undefined,
  296. createBy: undefined,
  297. createTime: undefined
  298. };
  299. this.resetForm("form");
  300. },
  301. /** 搜索按钮操作 */
  302. handleQuery() {
  303. this.queryParams.pageNum = 1;
  304. this.queryParams.deptId = undefined;
  305. this.getListtable();
  306. },
  307. /** 重置按钮操作 */
  308. resetQuery() {
  309. this.resetForm("queryForm");
  310. this.queryParams.deptId = undefined;
  311. this.handleQuery();
  312. this.getList();
  313. },
  314. // 多选框选中数据
  315. handleSelectionChange(selection) {
  316. this.ids = selection.map(item => item.id)
  317. this.single = selection.length!=1
  318. this.multiple = !selection.length
  319. },
  320. /** 新增按钮操作 */
  321. handleAdd() {
  322. this.reset();
  323. this.open = true;
  324. this.title = "添加档案";
  325. },
  326. /** 修改按钮操作 */
  327. // handleUpdate(row) {
  328. // this.reset();
  329. // this.open = true;
  330. // const id = row.id || this.ids
  331. // getArchives(id).then(response => {
  332. // this.form = response.data;
  333. // this.open = true;
  334. // this.title = "档案详情";
  335. // });
  336. // },
  337. /** 提交按钮 */
  338. submitForm: function() {
  339. this.$refs["form"].validate(valid => {
  340. if (valid) {
  341. if (this.form.id != undefined) {
  342. updateArchives(this.form).then(response => {
  343. if (response.code === 200) {
  344. this.msgSuccess("修改成功");
  345. this.open = false;
  346. this.getList();
  347. }
  348. });
  349. } else {
  350. addArchives(this.form).then(response => {
  351. if (response.code === 200) {
  352. this.msgSuccess("新增成功");
  353. this.open = false;
  354. this.getList();
  355. }
  356. });
  357. }
  358. }
  359. });
  360. },
  361. /** 删除按钮操作 */
  362. handleDelete(row) {
  363. console.log(row)
  364. console.log("aaaaa")
  365. const ids = row.id || this.ids;
  366. this.$confirm('是否确认删除档案编号为"' + ids + '"的数据项?', "警告", {
  367. confirmButtonText: "确定",
  368. cancelButtonText: "取消",
  369. type: "warning"
  370. }).then(function() {
  371. return delArchives(ids);
  372. }).then(() => {
  373. this.getList();
  374. this.getListtable();
  375. this.msgSuccess("删除成功");
  376. }).catch(function() {});
  377. },
  378. /** 导出按钮操作 */
  379. handleExport() {
  380. const queryParams = this.queryParams;
  381. this.$confirm('是否确认导出所有【请填写功能名称】数据项?', "警告", {
  382. confirmButtonText: "确定",
  383. cancelButtonText: "取消",
  384. type: "warning"
  385. }).then(function() {
  386. return exportArchives(queryParams);
  387. }).then(response => {
  388. this.download(response.msg);
  389. }).catch(function() {});
  390. }
  391. },
  392. watch: {
  393. // 根据名称筛选部门树
  394. deptName(val) {
  395. this.$refs.tree.filter(val);
  396. }
  397. },
  398. };
  399. </script>