index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="10">
  4. <!--机构数据-->
  5. <!-- <el-col :span="4" :xs="24">
  6. <org-tree
  7. v-model="queryParams.orgId"
  8. @defaultKey="getDefaultKey"
  9. @checkChange="checkChange"
  10. @click="clickTreeNode"
  11. :defaultCheckSub="true"
  12. ></org-tree>
  13. </el-col> -->
  14. <!--搜索栏-->
  15. <el-col :span="24" :xs="24">
  16. <div class="main-right-box">
  17. <div class="main-search-box">
  18. <el-form
  19. :model="queryParams"
  20. ref="queryForm"
  21. size="small"
  22. :inline="true"
  23. v-show="showSearch"
  24. >
  25. <!-- <el-form-item label="介绍信编号" prop="letterNo">
  26. <el-input
  27. v-model="queryParams.letterNo"
  28. placeholder="请输入关键字"
  29. clearable
  30. @keyup.enter.native="handleQuery"
  31. />
  32. </el-form-item> -->
  33. <el-form-item label="接待机构">
  34. <org-tree
  35. v-model="queryParams.orgId"
  36. @defaultKey="getDefaultKey"
  37. @checkChange="checkChange"
  38. @click="clickTreeNode"
  39. :defaultCheckSub="true"
  40. ref="orgTree"
  41. ></org-tree>
  42. </el-form-item>
  43. <el-form-item label="来访人员" prop="userName">
  44. <el-input
  45. v-model="queryParams.userName"
  46. placeholder="请输入关键字"
  47. clearable
  48. @keyup.enter.native="handleQuery"
  49. />
  50. </el-form-item>
  51. <el-form-item label="介绍信类型" prop="type">
  52. <el-select
  53. v-model="queryParams.type"
  54. placeholder="请选择介绍信类型"
  55. clearable
  56. >
  57. <el-option
  58. v-for="dict in dict.type.out_in_type"
  59. :key="dict.value"
  60. :label="dict.label"
  61. :value="dict.value"
  62. />
  63. </el-select>
  64. </el-form-item>
  65. <el-form-item class="searchTitle" prop="rangen" label="出入时间">
  66. <DataRangePicker
  67. v-model="queryParams.range"
  68. key="daterange"
  69. type="daterange"
  70. />
  71. </el-form-item>
  72. </el-form>
  73. <el-row :gutter="10">
  74. <el-col :span="1.5">
  75. <el-button
  76. type="primary"
  77. icon="el-icon-search"
  78. size="mini"
  79. @click="handleQuery"
  80. >搜索
  81. </el-button
  82. >
  83. </el-col>
  84. <el-col :span="1.5">
  85. <el-button
  86. type="primary"
  87. icon="el-icon-refresh"
  88. size="mini"
  89. @click="resetQuery"
  90. >重置
  91. </el-button
  92. >
  93. </el-col>
  94. <right-toolbar
  95. :showSearch.sync="showSearch"
  96. @queryTable="getList"
  97. ></right-toolbar>
  98. </el-row>
  99. </div>
  100. <el-table
  101. v-loading="loading"
  102. height="646"
  103. border
  104. :data="outInRecrodList"
  105. >
  106. <el-table-column
  107. label="来访单位"
  108. prop="companyName"
  109. align="center"
  110. width="180"
  111. :show-overflow-tooltip="true"
  112. />
  113. <el-table-column
  114. label="来访人员"
  115. prop="userName"
  116. align="center"
  117. width="180"
  118. :show-overflow-tooltip="true"
  119. />
  120. <!-- <el-table-column label="证件类型" prop="idType" align="center" width="180" >
  121. <template slot-scope="scope">
  122. <dict-tag :options="dict.type.letter_id_type" :value="scope.row.idType"/>
  123. </template>
  124. </el-table-column> -->
  125. <el-table-column
  126. label="证件号码"
  127. prop="idCard"
  128. align="center"
  129. width="180"
  130. />
  131. <el-table-column
  132. label="介绍信类型"
  133. align="center"
  134. prop="type"
  135. width="110"
  136. >
  137. <template slot-scope="scope">
  138. <dict-tag
  139. :options="dict.type.out_in_type"
  140. :value="scope.row.type"
  141. />
  142. </template>
  143. </el-table-column>
  144. <el-table-column
  145. label="来访事由"
  146. align="center"
  147. :show-overflow-tooltip="true"
  148. prop="reasons"
  149. />
  150. <el-table-column
  151. label="接待机构"
  152. align="center"
  153. prop="orgName"
  154. width="180"
  155. >
  156. </el-table-column>
  157. <el-table-column
  158. label="出入时间"
  159. align="center"
  160. width="360"
  161. >
  162. <template slot-scope="scope">
  163. <span
  164. >{{
  165. dayjs(scope.row.arrivalTime).format(
  166. "YYYY年MM月DD日HH时mm分"
  167. )
  168. }}
  169. ~
  170. </span>
  171. <span v-if="scope.row.departureTime">{{
  172. dayjs(scope.row.departureTime).format(
  173. "YYYY年MM月DD日HH时mm分"
  174. )
  175. }}</span>
  176. </template>
  177. </el-table-column>
  178. <!-- <el-table-column label="核验结果" width="250" align="center" prop="checkImage">
  179. <template slot-scope="scope">
  180. <ImageListPreview v-model="scope.row.imgFile"></ImageListPreview>
  181. </template> </el-table-column>
  182. <el-table-column label="介绍信" align="center" width="250">
  183. <template slot-scope="scope">
  184. <template v-if="scope.row.letterFile">
  185. <K-file-upload ref="upload" :isShowUploadBtn="false"
  186. :defaultValue="scope.row.letterFile"
  187. />
  188. </template>
  189. </template>
  190. </el-table-column> -->
  191. <el-table-column
  192. label="操作"
  193. align="center"
  194. width="210"
  195. fixed="right"
  196. class-name="small-padding fixed-width"
  197. >
  198. <template slot-scope="scope">
  199. <el-button
  200. size="mini"
  201. type="text"
  202. icon="el-icon-view"
  203. @click="handleDetailInfo(scope.row)"
  204. v-hasPermi="['core:record:list']"
  205. >详情
  206. </el-button>
  207. <el-button
  208. size="mini"
  209. type="text"
  210. icon="el-icon-document"
  211. v-if="scope.row.pdfUrl"
  212. @click="onDown(scope.row.pdfUrl)"
  213. >来访登记簿
  214. </el-button>
  215. </template>
  216. </el-table-column>
  217. </el-table>
  218. <pagination
  219. v-show="total > 0"
  220. :total="total"
  221. :page.sync="queryParams.pageNum"
  222. :limit.sync="queryParams.pageSize"
  223. @pagination="getList"
  224. />
  225. <dialog-out-in-detail
  226. ref="dialogDetail"
  227. @success="handleQuery(true)"
  228. ></dialog-out-in-detail>
  229. </div>
  230. </el-col>
  231. </el-row>
  232. </div>
  233. </template>
  234. <script>
  235. import {outInRecordList} from "@/api/core/letter";
  236. import KFileUpload from "@/components/K-FileUpload/index.vue";
  237. import dayjs from "dayjs";
  238. import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
  239. import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
  240. import dialogOutInDetail from "./dialog.outIn.detail.vue";
  241. import {mapGetters} from "vuex";
  242. import {imageUrl} from "@/utils/ruoyi";
  243. export default {
  244. components: {OrgTree, KFileUpload, DataRangePicker, dialogOutInDetail},
  245. dicts: ["letter_status", "out_in_type"],
  246. name: "outInLog",
  247. data() {
  248. return {
  249. // 遮罩层
  250. loading: true,
  251. // 选中数组
  252. ids: [],
  253. // 非单个停用
  254. single: true,
  255. // 非多个停用
  256. multiple: true,
  257. // 显示搜索条件
  258. showSearch: true,
  259. // 总条数
  260. total: 0,
  261. // 出入记录数据
  262. outInRecrodList: [],
  263. // 弹出层标题
  264. title: "",
  265. // 是否显示弹出层
  266. open: false,
  267. // 查询参数
  268. queryParams: {
  269. pageNum: 1,
  270. pageSize: 10,
  271. checkSub: true,
  272. userName: null,
  273. type: null,
  274. range: [],
  275. orgId: this.$store.getters.orgId,
  276. },
  277. // 表单参数
  278. form: {},
  279. // 表单校验
  280. rules: {},
  281. };
  282. },
  283. created() {
  284. this.getList();
  285. },
  286. computed: {
  287. ...mapGetters(["orgId"]),
  288. },
  289. methods: {
  290. dayjs,
  291. /** 查询介绍信列表 */
  292. getList() {
  293. this.loading = true;
  294. outInRecordList(this.queryParams).then((response) => {
  295. this.outInRecrodList = response.rows;
  296. this.total = response.total;
  297. this.loading = false;
  298. });
  299. },
  300. // 取消按钮
  301. cancel() {
  302. this.open = false;
  303. // this.reset();
  304. },
  305. /** 搜索按钮操作 */
  306. handleQuery() {
  307. this.queryParams.pageNum = 1;
  308. this.getList();
  309. },
  310. /** 重置按钮操作 */
  311. resetQuery() {
  312. this.resetForm("queryForm");
  313. this.queryParams.orgId = this.orgId;
  314. this.queryParams.checkSub = true;
  315. this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub)
  316. this.queryParams.range = ['',''];
  317. this.handleQuery();
  318. },
  319. getDefaultKey(key) {
  320. this.queryParams.orgId = key;
  321. this.getList();
  322. },
  323. //单选框状态改变
  324. checkChange(state) {
  325. this.queryParams.checkSub = state;
  326. this.handleQuery();
  327. },
  328. // 节点单击事件
  329. clickTreeNode(data) {
  330. // this.initPlanRoleList();
  331. this.queryParams.orgId = data.id;
  332. this.handleQuery();
  333. },
  334. handleDetailInfo(row) {
  335. this.$refs["dialogDetail"].show(row.id);
  336. },
  337. async onDown(pdfUrl) {
  338. // const data = await this.$api.eduTraining.predown(id);
  339. window.open(imageUrl(pdfUrl));
  340. },
  341. },
  342. };
  343. </script>