交通管理局公文项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

355 lines
12 KiB

1 month ago
2 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
1 month ago
3 weeks ago
1 month ago
1 month ago
3 weeks ago
3 weeks ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
  1. <template>
  2. <div class="app-container row-container">
  3. <div class="head-container">
  4. <div class="head-search">
  5. <el-input
  6. v-model="typeValue"
  7. size="small"
  8. clearable
  9. placeholder="请输入题名搜索关键字"
  10. style="width: 300px;"
  11. class="input-prepend filter-item"
  12. @clear="crud.toQuery"
  13. @keyup.enter.native="crud.toQuery"
  14. @input="typeInput"
  15. >
  16. <el-select slot="prepend" v-model="inputSelect" style="width: 92px" @change="clearInputValue">
  17. <el-option
  18. v-for="item in options"
  19. :key="item.value"
  20. :label="item.label"
  21. :value="item.value"
  22. />
  23. </el-select>
  24. </el-input>
  25. <div style="display: flex; justify-content: flex-start; align-items: center;">
  26. <p style="margin-right: 10px; font-size: 14px;">借阅时间</p>
  27. <date-range-picker v-model="blurryTimeStart" class="date-item" />
  28. </div>
  29. <div style="display: flex; justify-content: flex-start; align-items: center;">
  30. <p style="margin-right: 10px; font-size: 14px;">归还时间</p>
  31. <date-range-picker v-model="blurryTimeEnd" class="date-item" />
  32. </div>
  33. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="crud.toQuery">搜索</el-button>
  34. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery()">重置</el-button>
  35. </div>
  36. </div>
  37. <div class="container-wrap">
  38. <span class="right-top-line" />
  39. <span class="left-bottom-line" />
  40. <!-- @selection-change="crud.selectionChangeHandler" -->
  41. <el-table
  42. ref="table"
  43. v-loading="crud.loading"
  44. class="archives-table"
  45. :data="crud.data"
  46. style="width: 100%;"
  47. height="calc(100vh - 288px)"
  48. @cell-dblclick="tableDoubleClick"
  49. >
  50. <el-table-column prop="reg_no" label="公文登记号" width="120" />
  51. <el-table-column prop="maintitle" label="公文题名" min-width="140" show-overflow-tooltip />
  52. <el-table-column prop="details_type" label="文件类型">
  53. <template slot-scope="scope">
  54. <el-tag v-if="scope.row.details_type === 1">原件</el-tag>
  55. <el-tag v-else>复印件</el-tag>
  56. </template>
  57. </el-table-column>
  58. <el-table-column prop="borrow_name" label="借阅者" />
  59. <el-table-column prop="borrow_type" label="借阅者类型">
  60. <template slot-scope="scope">
  61. <div>
  62. <span v-if="scope.row.borrow_type === 1">部门</span>
  63. <span v-if="scope.row.borrow_type === 2">个人</span>
  64. </div>
  65. </template>
  66. </el-table-column>
  67. <el-table-column prop="start_time" label="传阅开始时间" width="200">
  68. <template slot-scope="scope">
  69. <div>{{ scope.row.start_time | parseTime }}</div>
  70. </template>
  71. </el-table-column>
  72. <el-table-column prop="latest_time" label="最迟归还时间" width="200">
  73. <template slot-scope="scope">
  74. <div>{{ scope.row.latest_time | parseTime }}</div>
  75. </template>
  76. </el-table-column>
  77. <el-table-column prop="actual_return_time" label="实际归还时间" width="200">
  78. <template slot-scope="scope">
  79. <div v-if="scope.row.actual_return_time && (scope.row.actual_return_time!=='' || scope.row.actual_return_time!== null)">{{ scope.row.actual_return_time | parseTime }}</div>
  80. <div v-else>-</div>
  81. </template>
  82. </el-table-column>
  83. <el-table-column prop="actual_return_time" label="状态" align="center" width="110">
  84. <template slot-scope="scope">
  85. <div>
  86. <!-- <span v-if="scope.row.borrow_type==='即将到期'" class="row-state soon-state">即将到期</span> -->
  87. <span v-if="scope.row.actual_return_time && (scope.row.actual_return_time!=='' || scope.row.actual_return_time!== null)" class="row-state row-physical state-active">已归还</span>
  88. <span v-else class="row-state row-binding state-active">传阅中</span>
  89. </div>
  90. </template>
  91. </el-table-column>
  92. <el-table-column prop="actual_return_time" label="操作" align="center" width="100">
  93. <!-- -->
  94. <template slot-scope="scope">
  95. <el-button v-if="!(scope.row.actual_return_time && (scope.row.actual_return_time!=='' || scope.row.actual_return_time!== null))" size="mini" style="padding: 5px;" :loading="returnBtnLoading[scope.$index]" @click="handleReturnFile(scope.$index, scope.row)"><i class="iconfont icon-weituo" />归还</el-button>
  96. </template>
  97. </el-table-column>
  98. </el-table>
  99. <pagination v-if="crud.data.length !== 0" />
  100. </div>
  101. <MidoArchivesInfo ref="archivesInfo" :is-mido-record="true" :parent-info="parentInfo" :page-type="pageType" />
  102. </div>
  103. </template>
  104. <script>
  105. import CRUD, { presenter, crud } from '@crud/crud'
  106. import { FetchDocumentReturn } from '@/api/system/documentArchives'
  107. import pagination from '@crud/Pagination'
  108. import DateRangePicker from '@/components/DateRangePicker'
  109. import MidoArchivesInfo from '@/views/archivesMIOD/miodLibrary/module/detail'
  110. // import { parseTime } from '@/utils/index'
  111. export default {
  112. name: 'MiodRecord',
  113. components: { pagination, DateRangePicker, MidoArchivesInfo },
  114. mixins: [presenter(), crud()],
  115. cruds() {
  116. return CRUD({
  117. url: 'api/documentArchives/initBorrowLog',
  118. title: '传阅记录',
  119. optShow: {
  120. add: false,
  121. edit: false,
  122. del: false,
  123. download: false,
  124. reset: false,
  125. group: false
  126. }
  127. })
  128. },
  129. data() {
  130. return {
  131. typeValue: null,
  132. options: [
  133. { value: null, label: '全部' },
  134. { value: 1, label: '传阅中' },
  135. { value: 2, label: '已归还' }
  136. ],
  137. inputSelect: '',
  138. blurryTimeStart: null,
  139. blurryTimeEnd: null,
  140. lendDetail: false,
  141. rowCurrent: null,
  142. detailArcData: [],
  143. categoryId: null,
  144. parentInfo: null,
  145. pageType: 'miodRecord',
  146. returnBtnLoading: []
  147. }
  148. },
  149. watch: {
  150. },
  151. created() {
  152. // 初始化带select的输入框的 - 搜索
  153. this.inputSelect = this.options[0].value
  154. },
  155. mounted() {
  156. },
  157. methods: {
  158. typeInput(e) {
  159. this.typeInputkey = this.getDescByValue(
  160. this.inputSelect,
  161. this.options,
  162. 'value',
  163. 'value'
  164. )
  165. this.crud.query.readType = this.typeInputkey
  166. this.crud.query.search = e
  167. // this.crud.query[this.typeInputkey] = e
  168. },
  169. clearInputValue(val) {
  170. console.log('val', val)
  171. this.inputSelect = val
  172. this.typeValue = ''
  173. // 避免向后端传递多余参数,切换和重置时,若有typeInputkey则去掉form中对应参数
  174. if (this.typeInputkey) {
  175. delete this.crud.query[this.typeInputkey]
  176. }
  177. this.crud.query.readType = val
  178. this.crud.query.search = this.typeValue
  179. this.crud.toQuery()
  180. },
  181. getDescByValue(inputValue, data, inputKey = 'value', outputKey = 'value') {
  182. let outputValue = ''
  183. if (data && data.length > 0) {
  184. for (let i = 0; i < data.length; i++) {
  185. const item = data[i]
  186. const itemValue = item[inputKey]
  187. if (inputValue + '' === itemValue + '') {
  188. outputValue = item[outputKey]
  189. break
  190. }
  191. }
  192. }
  193. return outputValue
  194. },
  195. [CRUD.HOOK.beforeRefresh]() {
  196. if (this.blurryTimeStart) {
  197. this.crud.query.borrowStartTime = this.blurryTimeStart[0]
  198. this.crud.query.borrowEndTime = this.blurryTimeStart[1]
  199. } else {
  200. this.crud.query.borrowStartTime = null
  201. this.crud.query.borrowEndTime = null
  202. }
  203. if (this.blurryTimeEnd) {
  204. this.crud.query.lastStartTime = this.blurryTimeEnd[0]
  205. this.crud.query.lastEndTime = this.blurryTimeEnd[1]
  206. } else {
  207. this.crud.query.lastStartTime = null
  208. this.crud.query.lastEndTime = null
  209. }
  210. },
  211. [CRUD.HOOK.afterRefresh](crud) {
  212. },
  213. resetQuery() {
  214. this.clearInputValue()
  215. this.inputSelect = this.options[0].value
  216. this.crud.query.readType = null
  217. this.crud.query.search = null
  218. this.blurryTimeStart = []
  219. this.blurryTimeEnd = []
  220. this.crud.query.borrowStartTime = null
  221. this.crud.query.borrowEndTime = null
  222. this.crud.query.lastStartTime = null
  223. this.crud.query.lastEndTime = null
  224. this.crud.toQuery()
  225. },
  226. tableDoubleClick(row) {
  227. console.log('row', row)
  228. this.parentInfo = row
  229. this.$nextTick(() => {
  230. this.$refs.archivesInfo.archivesInfoVisible = true
  231. this.$refs.archivesInfo.archivesTabIndex = 0
  232. this.$refs.archivesInfo.getDetial()
  233. })
  234. },
  235. handleReturnFile(index, row) {
  236. this.$set(this.returnBtnLoading, index, true)
  237. console.log('row', row)
  238. this.$confirm('确认是否归还当前所选文件,公文登记号:' + row.reg_no + '<span>你是否还要继续?</span>', '提示', {
  239. confirmButtonText: '确定',
  240. cancelButtonText: '取消',
  241. type: 'warning',
  242. dangerouslyUseHTMLString: true
  243. }).then(() => {
  244. const param = {
  245. 'documentTid': row.reg_no
  246. }
  247. console.log('param', param)
  248. FetchDocumentReturn(param).then((res) => {
  249. console.log('resReturn', res)
  250. if (res.code !== '-1') {
  251. this.$message({ message: res.msg, type: 'success', offset: 8 })
  252. } else {
  253. this.$message({ message: res.msg, type: 'error', offset: 8 })
  254. }
  255. this.crud.toQuery()
  256. this.$set(this.returnBtnLoading, index, false)
  257. }).catch(error => {
  258. console.error(error)
  259. this.$set(this.returnBtnLoading, index, false)
  260. })
  261. }).catch(() => {
  262. this.$set(this.returnBtnLoading, index, false)
  263. })
  264. },
  265. handleCloseDialog(done) {
  266. }
  267. }
  268. }
  269. </script>
  270. <style lang="scss" scoped>
  271. @import "~@/assets/styles/collect-reorganizi.scss";
  272. .recordList-main{
  273. height: calc(100vh - 236px);
  274. .start-date,
  275. .end-date{
  276. display: flex;
  277. justify-content: flex-start;
  278. padding-left: 8px;
  279. font-size: 14px;
  280. line-height: 30px;
  281. color: #0C0E1E;
  282. span{
  283. display: block;
  284. margin-right: 8px;
  285. }
  286. }
  287. .iconfont{
  288. font-size: 14px;
  289. }
  290. .icon-fou{
  291. color: #A6ADB6;
  292. }
  293. .icon-shi{
  294. color: #12C37A;
  295. }
  296. .icon-dengdai{
  297. color: #FF8329;
  298. }
  299. .icon-cuowu1{
  300. color: #ED4A41;
  301. }
  302. .row-state{
  303. width: 56px;
  304. padding: 0;
  305. text-align: center;
  306. }
  307. }
  308. .user-record{
  309. padding: 0 0 0 20px;
  310. height: calc(100vh - 320px);
  311. }
  312. .title-style{
  313. span{
  314. display: inline-block;
  315. width: 42px;
  316. height: 22px;
  317. line-height: 22px;
  318. text-align: center;
  319. font-size: 12px;
  320. color: #0348F3;
  321. background-color: #CAE1FF;
  322. border-radius: 3px;
  323. }
  324. }
  325. ::v-deep .el-dialog{
  326. width: 860px !important;
  327. .el-form-item .el-form-item__content{
  328. width: 280px;
  329. }
  330. .dialog-footer{
  331. margin-top: 15px !important;
  332. }
  333. }
  334. ::v-deep .el-checkbox-group{
  335. .el-checkbox{
  336. margin-right: 10px !important;
  337. }
  338. }
  339. ::v-deep .el-pagination{
  340. margin: 24px 0 10px 0 !important
  341. }
  342. ::v-deep .input-prepend .el-input__inner{
  343. padding-left: 100px;
  344. }
  345. .row-state{
  346. font-style: normal;
  347. padding: 0 8px;
  348. }
  349. </style>