documentWarning.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. /* * @Author: JACK_LIU * @Date: 2020-07-17 09:28:08 * @Last Modified by:
  2. JACK_LIU * @Last Modified time: 2020-08-10 20:43:34 */
  3. <!-- TJ-product-体系运行-预警 -->
  4. <template>
  5. <TableView class="product waring"
  6. @body-height-change="bodyHeightChange">
  7. <template slot="header">
  8. <BaseHeaderLayout>
  9. <template slot="right">
  10. <!-- <ws-button type="text"
  11. @click="dialogDeptBudgetFilter = true">
  12. <i class="iconfont iconfilter" />
  13. <span>{{ $t('common.filter') }}</span>
  14. </ws-button>
  15. <span class="filter-total">{{ $t('common.total') }}{{ deptBudgetTotal
  16. }}{{ $t('common.result') }}</span> -->
  17. <BaseHeaderFilter :total="deptBudgetTotal"
  18. @click="dialogDeptBudgetFilter = true" />
  19. <BaseInputSearch v-model="requestData.searchKeyword"
  20. :placeholder="$t('system.systemFiles.inputMessage02')"
  21. @search="deptBudgetSearch" />
  22. </template>
  23. </BaseHeaderLayout>
  24. </template>
  25. <template slot="body">
  26. <div class="nav-search">
  27. <ws-dialog :modal="false"
  28. :title="$t('common.filter')"
  29. :visible.sync="dialogDeptBudgetFilter"
  30. class="dialog"
  31. width="328px">
  32. <span>
  33. <!-- 船舶 -->
  34. <div class="select"
  35. v-if="vesselBankFlag == 'B'">
  36. <div class="selectTitle">
  37. <span>{{ $t('system.systemFiles.ship') }}</span>
  38. </div>
  39. <!-- <ws-select filterable
  40. v-model="requestData.vesselId"
  41. :placeholder="$t('common.selected')">
  42. <ws-option v-for="item in shipList"
  43. :key="item.vesselId"
  44. :label="item.vesselName"
  45. :value="item.vesselId" />
  46. </ws-select> -->
  47. <BaseShipSelect v-model="requestData.vesselId"
  48. filterable
  49. clearable
  50. :placeholder="$t('common.selected')"
  51. :showAll="false"
  52. clearable
  53. style="width:100%;"></BaseShipSelect>
  54. </div>
  55. <!-- 部门 -->
  56. <div class="select"
  57. v-if="vesselBankFlag == 'B'">
  58. <div class="selectTitle">
  59. <span>{{ $t('system.systemFiles.dept') }}</span>
  60. </div>
  61. <ws-select v-model="requestData.deptId"
  62. :placeholder="$t('common.selected')">
  63. <ws-option v-for="item in dutyList"
  64. :key="item.deptId"
  65. :label="item.deptName"
  66. :value="item.deptId" />
  67. </ws-select>
  68. </div>
  69. <div class="select">
  70. <div class="selectTitle">
  71. <span>{{ $t('system.systemFiles.fillDate') }}</span>
  72. </div>
  73. <ws-date-picker v-model="deptBudgetDate"
  74. @change="getDeptBudgetDate"
  75. value-format="yyyy-MM-dd"
  76. :placeholder="$t('common.selected')"
  77. type="daterange" />
  78. </div>
  79. </span>
  80. <span slot="footer"
  81. class="dialog-footer">
  82. <div class="elButton">
  83. <ws-button @click="resetSearch">{{
  84. $t('common.reset')
  85. }}</ws-button>
  86. <ws-button type="primary"
  87. @click="deptBudgetSearch">{{
  88. $t('common.filter')
  89. }}</ws-button>
  90. </div>
  91. </span>
  92. </ws-dialog>
  93. </div>
  94. <!-- 一览页面 -->
  95. <ws-normal-table stripe
  96. @sort-change="sortChange"
  97. :data="warnInfo"
  98. :height="tableViewBodyHeight">
  99. <!-- 序号 -->
  100. <ws-table-column align="center"
  101. prop="crtNo"
  102. :label="$t('common.num')"
  103. width="50">
  104. <template slot-scope="scope">{{
  105. (requestData.currentPage - 1) * requestData.pageSize +
  106. scope.$index +
  107. 1
  108. }}</template>
  109. </ws-table-column>
  110. <!-- 船舶/部门 -->
  111. <ws-table-column align="center"
  112. sortable
  113. min-width="100"
  114. :label="$t('system.systemFiles.shipDepartment')">
  115. <template slot-scope="scope">
  116. <span :title="scope.row.vesselDepartmentName">{{
  117. $ph(scope.row.vesselDepartmentName)
  118. }}</span>
  119. </template>
  120. </ws-table-column>
  121. <!-- 文件名 -->
  122. <ws-table-column align="left"
  123. sortable
  124. min-width="180"
  125. :label="$t('system.systemFiles.fileName')">
  126. <template slot-scope="scope">
  127. <span>
  128. <i class="iconfont iconpdfy"
  129. v-if="scope.row.fileType === 'pdf'"
  130. style="font-size: 20px;color: #FF4867" />
  131. <i class="iconfont iconword"
  132. v-if="
  133. scope.row.fileType === 'doc' || scope.row.fileType === 'docx'
  134. "
  135. style="font-size: 20px;color: #4A8DFF" />
  136. <i class="iconfont iconexcely"
  137. v-if="
  138. scope.row.fileType === 'xls' || scope.row.fileType === 'xlsx'
  139. "
  140. style="font-size: 20px;color: #00C090" />
  141. </span>
  142. <a :href="url + scope.row.filePathId"
  143. class="clickabled"
  144. target="_blank">{{ scope.row.fileName }}</a>
  145. </template>
  146. </ws-table-column>
  147. <!-- 报告周期 -->
  148. <ws-table-column :label="$t('system.systemFiles.reportCycle')"
  149. min-width="90"
  150. align="center"
  151. sortable>
  152. <template slot-scope="scope">
  153. <span :title="scope.row.cycleNumName">{{
  154. $ph(scope.row.cycleNumName)
  155. }}</span>
  156. </template>
  157. </ws-table-column>
  158. <!-- 上次填报时间 -->
  159. <ws-table-column :label="$t('system.systemFiles.lastFilledTime')"
  160. min-width="90"
  161. align="center"
  162. sortable>
  163. <template slot-scope="scope">
  164. <span :title="scope.row.lastReportDate">{{
  165. $ph(scope.row.lastReportDate)
  166. }}</span>
  167. </template>
  168. </ws-table-column>
  169. <!-- 填报人 -->
  170. <ws-table-column :label="$t('system.systemFiles.informant')"
  171. min-width="90"
  172. align="center"
  173. sortable>
  174. <template slot-scope="scope">
  175. <span :title="scope.row.creater">{{
  176. $ph(scope.row.creater)
  177. }}</span>
  178. </template>
  179. </ws-table-column>
  180. <!-- 催办操作 -->
  181. <ws-table-column :label="$t('common.operate')"
  182. width="100"
  183. align="center">
  184. <template slot-scope="scope">
  185. <el-button type="text"
  186. @click="handleUrging(scope.row)">{{
  187. $t('system.systemFiles.urging')
  188. }}</el-button>
  189. </template>
  190. </ws-table-column>
  191. </ws-normal-table>
  192. </template>
  193. <template slot="footer">
  194. <pagination v-show="deptBudgetTotal > 0"
  195. :total="deptBudgetTotal"
  196. :page.sync="requestData.currentPage"
  197. :limit.sync="requestData.pageSize"
  198. @pagination="getWarnInfo" />
  199. </template>
  200. </TableView>
  201. </template>
  202. <script>
  203. import Pagination from '@/components/Pagination'
  204. import { EventBus } from 'base-core-lib'
  205. import {
  206. getWarnList,
  207. getDeptListByCompId,
  208. getUrging
  209. } from '@/model/system'
  210. import TableView from '@/layout/TableView'
  211. import TableViewMix from '@/layout/mixin/TableViewMix'
  212. export default {
  213. name: 'documentWarning',
  214. mixins: [TableViewMix],
  215. components: {
  216. Pagination,
  217. TableView
  218. },
  219. data () {
  220. return {
  221. url: process.env.VUE_APP_BASE_API + '/office/file?fileId=',
  222. shipList: [],
  223. dutyList: [],
  224. deptBudgetDate: [], // 过滤时间数组
  225. warnInfo: [],
  226. requestData: {
  227. currentPage: 1,
  228. pageSize: 10,
  229. orderColunm: '',
  230. order: '',
  231. searchKeyword: '',
  232. deptId: '',
  233. vesselId: '',
  234. createStartDate: '',
  235. createEndDate: ''
  236. },
  237. compId: sessionStorage.getItem('ws-pf_compId'),
  238. vesselBankFlag: sessionStorage.getItem('ws-pf_vesselBankFlag'),
  239. deptBudgetTotal: 0,
  240. dialogDeptBudgetFilter: false
  241. }
  242. },
  243. created () {
  244. this.basicInformation()
  245. this.getWarnInfo()
  246. },
  247. methods: {
  248. basicInformation () {
  249. this.shipList = JSON.parse(sessionStorage.getItem('ws-pf_vessels'))
  250. getDeptListByCompId(this.requestData.compId).toPromise().then(data => {
  251. this.dutyList = data
  252. })
  253. },
  254. // 一览页面信息
  255. getWarnInfo () {
  256. getWarnList(this.requestData).toPromise().then(data => {
  257. this.warnInfo = data.records
  258. this.deptBudgetTotal = data.total
  259. this.$store.commit('app/SET_WARN_NUM', data.total)
  260. })
  261. },
  262. // 日期筛选
  263. getDeptBudgetDate (val) {
  264. if (val != null && val.length === 2) {
  265. this.requestData.createStartDate = val[0]
  266. this.requestData.createEndDate = val[1]
  267. } else {
  268. this.requestData.createStartDate = null
  269. this.requestData.createEndDate = null
  270. }
  271. },
  272. // 重置
  273. resetSearch () {
  274. this.deptBudgetDate = null
  275. this.requestData.createStartDate = null
  276. this.requestData.createEndDate = null
  277. this.requestData.vesselId = null
  278. this.requestData.deptId = null
  279. this.requestData.currentPage = 1
  280. this.getWarnInfo()
  281. this.dialogDeptBudgetFilter = false
  282. },
  283. clearSearch () {
  284. this.requestData.searchKeyword = null
  285. this.getWarnInfo()
  286. },
  287. // 过滤,搜索
  288. deptBudgetSearch () {
  289. this.getWarnInfo()
  290. this.dialogDeptBudgetFilter = false
  291. },
  292. sortChange (column) {
  293. if (column.order === 'ascending') {
  294. this.requestData.orderColunm = column.prop // 当前列
  295. this.requestData.order = 'asc' // 排序顺序
  296. }
  297. if (column.order === 'descending') {
  298. this.requestData.orderColunm = column.prop // 当前列
  299. this.requestData.order = 'desc' // 排序顺序
  300. }
  301. this.getWarnInfo()
  302. },
  303. // 催办
  304. async handleUrging (item) {
  305. try {
  306. await getUrging({ id: item.id }).toPromise().then(() => {
  307. EventBus.$emit('success', this.$t('showMessage.dragTheSuccess'))
  308. })
  309. } catch (error) {
  310. if (error.code && error.code !== '200') {
  311. EventBus.$emit('error', error.message)
  312. }
  313. }
  314. }
  315. }
  316. }
  317. </script>
  318. <style scoped>
  319. .nav-search {
  320. float: right;
  321. }
  322. .waring .table-view__body {
  323. padding-bottom: 10px;
  324. }
  325. .nav-search /deep/.dialog .el-dialog {
  326. margin-left: 70%;
  327. }
  328. ::v-deep .el-table__row .cell {
  329. color: #ff0000;
  330. }
  331. </style>