newType.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <!-- 新闻管理 by wangshxc -->
  2. <template>
  3. <div>
  4. <div class="tab-item">
  5. <div class="tab-button" align="left">
  6. </div>
  7. <!-- 模糊搜索 Start -->
  8. <div class="searchThree" align="right">
  9. <span style="font-size: 14px; color: #606266;">发布租户:</span>
  10. <ws-select
  11. v-model="typeIds"
  12. multiple
  13. collapse-tags
  14. @change="getDeptBudgetList"
  15. style="width: 20%;margin-right: 10px;"
  16. placeholder="请选择">
  17. <ws-option
  18. v-for="item in shipList"
  19. :key="item.id"
  20. :label="item.name"
  21. :value="item.id">
  22. </ws-option>
  23. </ws-select>
  24. <span style="font-size: 14px; color: #606266;">发布日期:</span>
  25. <ws-date-picker
  26. v-model="deptBudgetDate"
  27. @change="getDeptBudgetDate"
  28. clearable
  29. value-format="yyyy-MM-dd"
  30. type="daterange"
  31. range-separator="-"
  32. start-placeholder="开始日期"
  33. end-placeholder="结束日期"
  34. style="width: 25%"
  35. />
  36. <ws-input
  37. v-model="deptBudgetPage.searchKeyword"
  38. maxlength="50"
  39. placeholder="请输入标题"
  40. @clear="resetSearch"
  41. @keyup.enter.native="getDeptBudgetList"
  42. style="width: 20%;padding-left: 10px;"
  43. />
  44. <svg-icon icon-class="gen" class="searchIcon" @click="getDeptBudgetList"/>
  45. </div>
  46. </div>
  47. <div>
  48. <!--一览页页面 Start -->
  49. <ws-normal-table
  50. v-loading="listLoading"
  51. stripe
  52. :data="deptBudgetList"
  53. @cell-click="jumpDeptBudget">
  54. <ws-table-column align="center" prop="crtNo" label="序号" width="100">
  55. <template slot-scope="scope">
  56. {{ (deptBudgetPage.currentPage - 1)*deptBudgetPage.pageSize + scope.$index + 1 }}
  57. </template>
  58. </ws-table-column>
  59. <ws-table-column align="center" prop="title" label="标题" width="200"/>
  60. <ws-table-column align="center" prop="typeName" label="类型" width="200"/>
  61. <ws-table-column align="center" prop="issueUserName" label="发布人" width="200"/>
  62. <ws-table-column align="center" prop="issueDate" label="发布日期" width="200"/>
  63. <ws-table-column align="center" prop="tenantName" label="发布租户">
  64. <template slot-scope="scope">
  65. <div :title="scope.row.tenantName">{{ scope.row.tenantName }}</div>
  66. </template>
  67. </ws-table-column>
  68. </ws-normal-table>
  69. <pagination
  70. v-show="deptBudgetTotal>0"
  71. :total="deptBudgetTotal"
  72. :page.sync="deptBudgetPage.currentPage"
  73. :limit.sync="deptBudgetPage.pageSize"
  74. @pagination="getDeptBudgetList"
  75. />
  76. <!--一览页页面 End -->
  77. </div>
  78. </div>
  79. </template>
  80. <script>
  81. import Pagination from '../../components/Pagination'
  82. import {getTenantPageByCondition, sendScope} from '../../api/new'
  83. export default {
  84. name: 'newList',
  85. components: {
  86. Pagination
  87. },
  88. data() {
  89. return {
  90. listLoading: false,
  91. setDialogFormVisible: false,
  92. inputVisible: false,
  93. inputValue: '',
  94. allTypeName: '全部类型',
  95. shipList: [],
  96. deptBudgetDate: [], // 过滤时间数组
  97. deptBudgetList: [],
  98. typeIds: [],
  99. deptBudgetPage: {
  100. currentPage: 1,
  101. pageSize: 10,
  102. tenantId: '',
  103. createDateStart: '',
  104. createDateEnd: '',
  105. searchKeyword: '',
  106. issueUserId: localStorage.getItem('ws-pf_userId'),
  107. },
  108. deptBudgetTotal: 0,
  109. id: '',
  110. dialogDeptBudgetFilter: false,
  111. addRemarkMsg: {
  112. id: ''
  113. },
  114. dynamicTags: [{
  115. parameterId: '',
  116. constCode: 'NEWS_TYPE',
  117. parameterKey: '',
  118. parameterValue: '',
  119. parameterValueEn: '',
  120. }
  121. ],
  122. }
  123. },
  124. created() {
  125. this.getDeptBudgetList()
  126. this.getDeptBudgetListLy()
  127. },
  128. methods: {
  129. // 一览页面信息
  130. getDeptBudgetListLy() {
  131. sendScope().then(response => {
  132. this.shipList = response.data[0].children
  133. })
  134. },
  135. getDeptBudgetList() {
  136. this.deptBudgetPage.tenantId = ''
  137. if (this.typeIds.length > 0) {
  138. for (let i = 0; i < this.typeIds.length; i++) {
  139. this.deptBudgetPage.tenantId += this.typeIds[i] + ','
  140. }
  141. }
  142. this.listLoading = true;
  143. getTenantPageByCondition(this.deptBudgetPage).then(response => {
  144. this.deptBudgetList = response.data.records;
  145. this.deptBudgetList.forEach((item) => {
  146. this.id = item.id
  147. item.operate = false;
  148. item.statusStr = '';
  149. item.issueDate = item.issueDate && item.issueDate.length > 0 ? item.issueDate.substr(0, 16) : ''
  150. item.operate = true;
  151. if (item.isIssue === '1') {
  152. item.edit = false;
  153. item.statusStr = '已发布';
  154. } else {
  155. item.edit = true;
  156. item.statusStr = '待发布';
  157. }
  158. })
  159. this.deptBudgetTotal = response.data.total
  160. this.listLoading = false;
  161. })
  162. },
  163. // 日期筛选
  164. getDeptBudgetDate(val) {
  165. if (val != null && val.length === 2) {
  166. this.deptBudgetPage.createDateStart = val[0] + ' 00:00:00'
  167. this.deptBudgetPage.createDateEnd = val[1] + ' 23:59:59'
  168. this.getDeptBudgetList()
  169. } else {
  170. this.deptBudgetPage.createDateStart = null
  171. this.deptBudgetPage.createDateEnd = null
  172. this.getDeptBudgetList()
  173. }
  174. },
  175. // 重置
  176. resetSearch() {
  177. this.deptBudgetPage.searchKeyword = null
  178. this.getDeptBudgetList()
  179. },
  180. // 一览页面跳转
  181. jumpDeptBudget(row, column) {
  182. if (column.property !== 'remark') {
  183. this.$router.push({
  184. name: 'newTenantDetails',
  185. query: {
  186. id: row.id,
  187. }
  188. })
  189. }
  190. },
  191. }
  192. }
  193. </script>
  194. <style scoped lang="scss">
  195. .tabsMain .navBar {
  196. width: 100%;
  197. }
  198. .main-list {
  199. height: calc(81vh - 0px);
  200. padding: 0 !important;
  201. }
  202. .searchThree {
  203. width: 95%;
  204. }
  205. .searchThreeFide {
  206. display: flex;
  207. }
  208. .input-main {
  209. margin-top: 0 !important
  210. }
  211. .nav-search {
  212. float: right;
  213. padding: 15px 0;
  214. }
  215. .tab-kuan {
  216. float: left;
  217. }
  218. .type {
  219. font-size: 12px;
  220. font-weight: 400;
  221. color: rgba(102, 102, 102, 1);
  222. margin-right: 10px;
  223. }
  224. .remove {
  225. margin-left: 10px;
  226. line-height: 0px;
  227. margin-top: 7px;
  228. }
  229. /deep/ .el-pagination__jump {
  230. margin-right: 46px;
  231. }
  232. /deep/ .el-tag.el-tag--info {
  233. overflow: hidden !important;
  234. text-overflow: ellipsis !important;
  235. white-space: nowrap !important;
  236. max-width: 60% !important;
  237. }
  238. .aaa {
  239. font-size: 16px;
  240. margin-left: 10px
  241. }
  242. .searchIcon {
  243. height: 32px;
  244. width: 32px;
  245. float: right;
  246. position: relative;
  247. }
  248. .tab-button {
  249. width: 5%;
  250. }
  251. .adddepartment {
  252. height: 300px;
  253. overflow-y: auto;
  254. }
  255. .tab-item {
  256. display: flex;
  257. padding: 10px 0px 10px 0px;
  258. }
  259. .button-new-tag {
  260. margin-left: 10px;
  261. height: 32px;
  262. line-height: 30px;
  263. padding-top: 0;
  264. padding-bottom: 0;
  265. }
  266. </style>