index.vue 7.0 KB

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