index.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <div>
  3. <basic-container v-show="!show">
  4. <avue-crud
  5. :option="option"
  6. :data="dataList"
  7. :page.sync="page"
  8. :table-loading="loading"
  9. @refresh-change="refreshChange"
  10. @search-change="searchChange"
  11. @on-load="onLoad">
  12. <template slot-scope="scope" slot="menuLeft">
  13. <el-button type="primary"
  14. icon="el-icon-plus"
  15. size="small"
  16. @click="rowSave">新增</el-button>
  17. </template>
  18. <template slot-scope="{type,size,row,index}" slot="menu">
  19. <el-button icon="el-icon-view" :size="size" :type="type" @click.stop="rowCell(row,index)">查看</el-button>
  20. <el-button icon="el-icon-delete" :size="size" :type="type" v-if="row.status === 0" @click.stop="rowDel(row)">删除</el-button>
  21. </template>
  22. </avue-crud>
  23. </basic-container>
  24. <details-page-edit v-if="show" @backToList="backToList" :detailData="detailData" :id="id"></details-page-edit>
  25. </div>
  26. </template>
  27. <script>
  28. import detailsPageEdit from './detailsPageEdit'
  29. import {selectInvoiceList,removeDelegationList} from '@/api/bidingDocument/issueTender'
  30. export default {
  31. components: {
  32. detailsPageEdit
  33. },
  34. data(){
  35. return {
  36. page: {
  37. pageSize: 10,
  38. currentPage: 1,
  39. total: 0,
  40. pageSizes: [10, 50, 100, 200, 300]
  41. },
  42. query:{},
  43. dataList:[],
  44. detailData: {},
  45. loading:false,
  46. show:false,
  47. id:'',
  48. option:{
  49. addBtn:false,
  50. editBtn:false,
  51. delBtn:false,
  52. align: 'center',
  53. index: true,
  54. border: true,
  55. stripe: true,
  56. searchMenuPosition:"right",
  57. searchSpan: 8,
  58. searchIcon: true,
  59. searchIndex: 2,
  60. highlightCurrentRow: true,
  61. selection: true,
  62. height: "auto",
  63. column: [{
  64. label: '发布日期',
  65. prop: 'releaseTime',
  66. search: true,
  67. overHidden: true,
  68. type: "date",
  69. searchRange: true,
  70. defaultTime: ['00:00:00', '23:59:59'],
  71. format: "yyyy-MM-dd HH:mm",
  72. valueFormat: "yyyy-MM-dd HH:mm:ss",
  73. width:150,
  74. index:1,
  75. },{
  76. label: '截止日期',
  77. prop: 'deadlineTime',
  78. overHidden: true,
  79. search: true,
  80. type: "date",
  81. searchRange: true,
  82. defaultTime: ['00:00:00', '23:59:59'],
  83. format: "yyyy-MM-dd HH:mm",
  84. valueFormat: "yyyy-MM-dd HH:mm:ss",
  85. width:150,
  86. index:2,
  87. },{
  88. label: '起运港',
  89. prop: 'departureHarbor',
  90. overHidden: true,
  91. width:120,
  92. index:3,
  93. },{
  94. label: '目的港',
  95. prop: 'objectiveHarbor',
  96. overHidden: true,
  97. width:120,
  98. index:4,
  99. },{
  100. label: '箱型箱量',
  101. prop: 'boxTypeQuantity',
  102. overHidden: true,
  103. width:120,
  104. index:5,
  105. },{
  106. label: '装柜日期',
  107. prop: 'loadingTime',
  108. overHidden: true,
  109. search: true,
  110. type: "date",
  111. searchRange: true,
  112. defaultTime: ['00:00:00', '23:59:59'],
  113. format: "yyyy-MM-dd HH:mm",
  114. valueFormat: "yyyy-MM-dd HH:mm:ss",
  115. width:150,
  116. index:6,
  117. },{
  118. label: '货物信息',
  119. prop: 'cargoInformation',
  120. overHidden: true,
  121. width:120,
  122. index:7,
  123. },{
  124. label: '制单日期',
  125. prop: 'createTime',
  126. search: true,
  127. overHidden: true,
  128. type: "date",
  129. searchRange: true,
  130. defaultTime: ['00:00:00', '23:59:59'],
  131. format: "yyyy-MM-dd HH:mm",
  132. valueFormat: "yyyy-MM-dd HH:mm:ss",
  133. width:150,
  134. index:8,
  135. }, {
  136. label: '状态',
  137. disabled:true,
  138. prop: 'status',
  139. dataType: "string",
  140. type: 'select',
  141. dicUrl: "/api/blade-system/dict-biz/dictionary?code=main_bid_status",
  142. props: {
  143. label: "dictValue",
  144. value: "dictKey"
  145. },
  146. width:100,
  147. index:9,
  148. }]
  149. }
  150. }
  151. },
  152. created() {
  153. if (this.$route.query.check){
  154. this.detailData = {
  155. id: this.$route.query.check.billId,
  156. check: this.$route.query.check,
  157. auditId: this.$route.query.check.id
  158. };
  159. this.id = this.$route.query.check.billId
  160. this.show = true
  161. this.$router.$avueRouter.closeTag(window.location.hash.slice(1))
  162. }else {
  163. this.detailData = {}
  164. }
  165. let i = 0;
  166. if (i % 3 !== 0) {
  167. const num = 3 - Number(i % 3)
  168. this.option.searchMenuSpan = num * 8;
  169. this.option.searchMenuPosition = "right";
  170. }
  171. },
  172. methods:{
  173. rowSave(){
  174. this.show = true
  175. },
  176. backToList(args){
  177. this.show = false
  178. this.id = ''
  179. },
  180. //查看
  181. rowCell(row, index) {
  182. this.id = row.id
  183. this.show = true
  184. },
  185. //列表删除
  186. rowDel(row) {
  187. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  188. confirmButtonText: '确定',
  189. cancelButtonText: '取消',
  190. type: 'warning'
  191. }).then(() => {
  192. removeDelegationList({id: row.id}).then(res => {
  193. this.$message.success('删除成功');
  194. this.onLoad(this.page)
  195. })
  196. }).catch(() => {
  197. this.$message({
  198. type: 'info',
  199. message: '已取消删除'
  200. });
  201. });
  202. },
  203. //刷新按钮
  204. refreshChange(){
  205. this.onLoad(this.page)
  206. },
  207. //搜索
  208. searchChange(params, done) {
  209. let data = params
  210. if (params.releaseTime) {
  211. data.releaseBeginTime = params.releaseTime[0]
  212. data.releaseEndTime = params.releaseTime[1]
  213. }
  214. if (params.deadlineTime) {
  215. data.deadlineBeginTime = params.deadlineTime[0]
  216. data.deadlineEndTime = params.deadlineTime[1]
  217. }
  218. if (params.loadingTime) {
  219. data.loadingBeginTime = params.loadingTime[0]
  220. data.loadingEndTime = params.loadingTime[1]
  221. }
  222. if (params.createTime) {
  223. data.createBeginTime = params.createTime[0]
  224. data.createEndTime = params.createTime[1]
  225. }
  226. delete data.releaseTime
  227. delete data.deadlineTime
  228. delete data.loadingTime
  229. delete data.createTime
  230. this.query = data;
  231. this.onLoad(this.page, data)
  232. done();
  233. },
  234. onLoad(page, params = {}) {
  235. let queryParams = {
  236. size: page.pageSize,
  237. current: page.currentPage,
  238. ...Object.assign(params, this.query)
  239. }
  240. this.loading = true;
  241. selectInvoiceList(queryParams).then(res=>{
  242. this.dataList = res.data.data.records
  243. this.page.total = res.data.data.total
  244. }).finally(() => {
  245. this.loading = false;
  246. })
  247. }
  248. }
  249. }
  250. </script>
  251. <style scoped>
  252. </style>