index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="介绍信名称" prop="letterName">
  5. <el-input
  6. v-model="queryParams.letterName"
  7. placeholder="请输入介绍信名称"
  8. clearable
  9. @keyup.enter.native="handleQuery"
  10. />
  11. </el-form-item>
  12. <!-- <el-form-item label="状态" prop="status">
  13. <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
  14. <el-option
  15. v-for="dict in dict.type.letter_status"
  16. :key="dict.value"
  17. :label="dict.label"
  18. :value="dict.value"
  19. />
  20. </el-select>
  21. </el-form-item>-->
  22. <el-form-item>
  23. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  24. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  25. </el-form-item>
  26. </el-form>
  27. <el-row :gutter="10" class="mb8">
  28. <el-col :span="1.5">
  29. <el-button
  30. type="primary"
  31. plain
  32. icon="el-icon-plus"
  33. size="mini"
  34. @click="handleAddOrUpdate(null)"
  35. v-hasPermi="['core:letter:add']"
  36. >录入介绍信</el-button>
  37. </el-col>
  38. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  39. </el-row>
  40. <el-table v-loading="loading" :data="letterList" @selection-change="handleSelectionChange">
  41. <el-table-column label="介绍信名称" align="center" prop="letterName" />
  42. <el-table-column label="介绍信有效期" align="center" prop="startTime" width="250">
  43. <template slot-scope="scope">
  44. <span>{{ scope.row.startTime}}~{{scope.row.endTime}}</span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="接待机构" align="center" prop="orgNames" >
  48. <template slot-scope="r">
  49. <span class="text-style" :title="r.row.orgNames">{{ r.row.orgNames }}</span>
  50. </template>
  51. </el-table-column>
  52. <el-table-column label="创建机构" align="center" prop="orgName" />
  53. <!-- <el-table-column label="状态" width="80" align="center" prop="status" >
  54. <template slot-scope="r">
  55. <dict-tag :options="dict.type.letter_status" :value="r.row.status"/>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="审批状态" width="80" align="center" prop="checkStart" >
  59. <template slot-scope="r">
  60. <span>{{r.row.checkStatus==null?"待审批":r.row.checkStatus===1?"通过":"不通过"}}</span>
  61. </template>
  62. </el-table-column>-->
  63. <el-table-column label="备注" align="center" prop="description" >
  64. <template slot-scope="r">
  65. <span class="text-style" :title="r.row.description">{{ r.row.description }}</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  69. <template slot-scope="r">
  70. <el-button
  71. size="mini"
  72. type="text"
  73. icon="el-icon-view"
  74. @click="LookOrAudit(r.row.id,0)"
  75. v-hasPermi="['core:letter:query']"
  76. >详情</el-button>
  77. <!-- <el-button
  78. size="mini"
  79. type="text"
  80. icon="el-icon-edit"
  81. @click="LookOrAudit(r.row.id,1)"
  82. v-hasPermi="['core:letter:audit']"
  83. >审批</el-button>-->
  84. <el-button
  85. size="mini"
  86. type="text"
  87. icon="el-icon-edit"
  88. @click="auditAllList(r.row.id)"
  89. v-hasPermi="['core:letter:auditAllList']"
  90. >审批情况</el-button>
  91. <el-button
  92. size="mini"
  93. type="text"
  94. icon="el-icon-edit"
  95. @click="handleAddOrUpdate(r.row.id)"
  96. v-hasPermi="['core:letter:edit']"
  97. >修改</el-button>
  98. <el-button
  99. size="mini"
  100. type="text"
  101. icon="el-icon-delete"
  102. @click="handleDelete(r.row)"
  103. v-hasPermi="['core:letter:remove']"
  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="getList"
  114. />
  115. <dialog-edit-letter ref="dialogAddLetter" @success="handleQuery(true)" @closed="getList"></dialog-edit-letter>
  116. <dialog-letter-view ref="dialogLetterView" @success="handleQuery(true)" @closed="getList"></dialog-letter-view>
  117. <dialog-audit-view ref="dialogAuditView" @success="handleQuery(true)" @closed="getList"></dialog-audit-view>
  118. </div>
  119. </template>
  120. <script>
  121. import { listLetter, getLetter, delLetter, addLetter, updateLetter } from "@/api/core/letter";
  122. import dialogEditLetter from "./dialog.editletter";
  123. import dialogLetterView from "./dialog.letterview";
  124. import dialogAuditView from "./dialog.auditview";
  125. export default {
  126. components: {dialogEditLetter,dialogLetterView,dialogAuditView},
  127. dicts: ['letter_status'],
  128. name: "Letter",
  129. data() {
  130. return {
  131. // 遮罩层
  132. loading: true,
  133. // 选中数组
  134. ids: [],
  135. // 非单个禁用
  136. single: true,
  137. // 非多个禁用
  138. multiple: true,
  139. // 显示搜索条件
  140. showSearch: true,
  141. // 总条数
  142. total: 0,
  143. // 介绍信表格数据
  144. letterList: [],
  145. // 弹出层标题
  146. title: "",
  147. // 是否显示弹出层
  148. open: false,
  149. // 查询参数
  150. queryParams: {
  151. pageNum: 1,
  152. pageSize: 10,
  153. letterName: null,
  154. status: null,
  155. orgId:null,
  156. },
  157. // 表单参数
  158. form: {},
  159. // 表单校验
  160. rules: {
  161. }
  162. };
  163. },
  164. created() {
  165. this.queryParams.orgId = this.$store.getters.orgId;
  166. this.getList();
  167. },
  168. methods: {
  169. /** 查询介绍信列表 */
  170. getList() {
  171. this.loading = true;
  172. listLetter(this.queryParams).then(response => {
  173. this.letterList = response.rows;
  174. this.total = response.total;
  175. this.loading = false;
  176. });
  177. },
  178. // 取消按钮
  179. cancel() {
  180. this.open = false;
  181. this.reset();
  182. },
  183. // 表单重置
  184. reset() {
  185. this.form = {
  186. id: null,
  187. letterName: null,
  188. startTime: null,
  189. endTime: null,
  190. letterFile: null,
  191. orgId: null,
  192. orgPath: null,
  193. orgName: null,
  194. checkUser: null,
  195. checkTime: null,
  196. checkStatus: null,
  197. status:null,
  198. description: null,
  199. createBy: null,
  200. createTime: null
  201. };
  202. this.resetForm("form");
  203. },
  204. /** 搜索按钮操作 */
  205. handleQuery() {
  206. this.queryParams.pageNum = 1;
  207. this.getList();
  208. },
  209. /** 重置按钮操作 */
  210. resetQuery() {
  211. this.resetForm("queryForm");
  212. this.handleQuery();
  213. },
  214. // 多选框选中数据
  215. handleSelectionChange(selection) {
  216. this.ids = selection.map(item => item.id)
  217. this.single = selection.length!==1
  218. this.multiple = !selection.length
  219. },
  220. /** 新增按钮操作 */
  221. handleAddOrUpdate(id) {
  222. this.$refs["dialogAddLetter"].show(id,{});
  223. },
  224. LookOrAudit(id,type) {
  225. this.$refs["dialogLetterView"].show(id,type,{});
  226. },
  227. auditAllList(id) {
  228. this.$refs["dialogAuditView"].show(id,{});
  229. },
  230. /** 修改按钮操作 */
  231. handleUpdate(row) {
  232. this.reset();
  233. const id = row.id || this.ids
  234. getLetter(id).then(response => {
  235. this.form = response.data;
  236. this.open = true;
  237. this.title = "修改介绍信";
  238. });
  239. },
  240. /** 提交按钮 */
  241. submitForm() {
  242. this.$refs["form"].validate(valid => {
  243. if (valid) {
  244. if (this.form.id != null) {
  245. updateLetter(this.form).then(response => {
  246. this.$modal.msgSuccess("修改成功");
  247. this.open = false;
  248. this.getList();
  249. });
  250. } else {
  251. addLetter(this.form).then(response => {
  252. this.$modal.msgSuccess("新增成功");
  253. this.open = false;
  254. this.getList();
  255. });
  256. }
  257. }
  258. });
  259. },
  260. /** 删除按钮操作 */
  261. handleDelete(row) {
  262. const ids = row.id || this.ids;
  263. this.$modal.confirm('是否确认删除该介绍信记录?').then(function() {
  264. return delLetter(ids);
  265. }).then(() => {
  266. this.getList();
  267. this.$modal.msgSuccess("删除成功");
  268. }).catch(() => {});
  269. },
  270. /** 导出按钮操作 */
  271. handleExport() {
  272. this.download('system/letter/export', {
  273. ...this.queryParams
  274. }, `letter_${new Date().getTime()}.xlsx`)
  275. }
  276. }
  277. };
  278. </script>
  279. <style lang="scss">
  280. .title {
  281. clear: both;
  282. margin: auto;
  283. text-align: center;
  284. color: black;
  285. font-size: xx-large;
  286. letter-spacing: 3px;
  287. }
  288. .text-style{
  289. overflow: hidden;
  290. text-overflow: ellipsis;
  291. white-space: nowrap;
  292. }
  293. </style>