index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <div>
  3. <basic-container v-if="show" class="page-crad">
  4. <avue-crud
  5. ref="crud"
  6. :option="option"
  7. :data="dataList"
  8. v-model="form"
  9. :page.sync="page"
  10. :search.sync="search"
  11. @search-change="searchChange"
  12. @current-change="currentChange"
  13. @size-change="sizeChange"
  14. @refresh-change="refreshChange"
  15. @on-load="onLoad"
  16. @saveColumn="saveColumn"
  17. :cell-style="cellStyle"
  18. >
  19. <template slot="menuLeft">
  20. <el-button type="info" size="small">报表</el-button>
  21. </template>
  22. <template slot="corpIdSearch">
  23. <select-component
  24. v-model="search.corpId"
  25. :configuration="configuration"
  26. ></select-component>
  27. </template>
  28. <template slot="portOfLoadSearch">
  29. <port-info v-model="search.portOfLoad" />
  30. </template>
  31. <template slot="portOfDestinationSearch">
  32. <port-info v-model="search.portOfDestination" />
  33. </template>
  34. <template slot="businesDateSearch">
  35. <el-date-picker
  36. v-model="search.businesDate"
  37. type="daterange"
  38. start-placeholder="开始日期"
  39. end-placeholder="结束日期"
  40. format="yyyy-MM-dd"
  41. value-format="yyyy-MM-dd HH:mm:ss"
  42. :default-time="['00:00:00', '23:59:59']"
  43. >
  44. </el-date-picker>
  45. </template>
  46. <template slot="plannedDeliveryDateSearch">
  47. <el-date-picker
  48. v-model="search.plannedDeliveryDate"
  49. type="daterange"
  50. start-placeholder="开始日期"
  51. end-placeholder="结束日期"
  52. format="yyyy-MM-dd"
  53. value-format="yyyy-MM-dd HH:mm:ss"
  54. :default-time="['00:00:00', '23:59:59']"
  55. >
  56. </el-date-picker>
  57. </template>
  58. <template slot="createTimeSearch">
  59. <el-date-picker
  60. v-model="search.createTime"
  61. type="daterange"
  62. start-placeholder="开始日期"
  63. end-placeholder="结束日期"
  64. format="yyyy-MM-dd"
  65. value-format="yyyy-MM-dd HH:mm:ss"
  66. :default-time="['00:00:00', '23:59:59']"
  67. >
  68. </el-date-picker>
  69. </template>
  70. <template slot-scope="{ row }" slot="createUser">
  71. <span>{{ row.createUserName }}</span>
  72. </template>
  73. <template slot-scope="scope" slot="corpId">
  74. {{ scope.row.corpName }}
  75. </template>
  76. <template slot-scope="scope" slot="menu">
  77. <el-button
  78. type="text"
  79. icon="el-icon-edit"
  80. size="small"
  81. @click.stop="editOpen(scope.row, 2)"
  82. >编辑
  83. </el-button>
  84. </template>
  85. </avue-crud>
  86. </basic-container>
  87. <detail-page @goBack="goBack" :detailData="detailData" v-else></detail-page>
  88. </div>
  89. </template>
  90. <script>
  91. import option from "./config/mainList.json";
  92. import { getList, getPorts, gainUser } from "@/api/basicData/shippingInquiry";
  93. import detailPage from "./detailsPage.vue";
  94. export default {
  95. name: "customerInformation",
  96. data() {
  97. return {
  98. configuration: {
  99. multipleChoices: false,
  100. multiple: false,
  101. collapseTags: false,
  102. placeholder: "请点击右边按钮选择",
  103. dicData: []
  104. },
  105. search: {},
  106. option: {},
  107. parentId: 0,
  108. dataList: [],
  109. page: {
  110. pageSize: 10,
  111. currentPage: 1,
  112. total: 0,
  113. pageSizes:[10,50,100,200,300,400,500]
  114. },
  115. show: true,
  116. detailData: {},
  117. loading: false
  118. };
  119. },
  120. components: { detailPage },
  121. async created() {
  122. this.option = await this.getColumnData(this.getColumnName(12), option);
  123. getPorts().then(res => {
  124. this.findObject(this.option.column, "portOfLoad").dicData = res.data;
  125. this.findObject(this.option.column, "portOfDestination").dicData =
  126. res.data;
  127. });
  128. gainUser().then(res => {
  129. this.findObject(this.option.column, "createUser").dicData = res.data.data;
  130. });
  131. },
  132. methods: {
  133. cellStyle() {
  134. return "padding:0;height:40px;";
  135. },
  136. //查看跳转页面
  137. beforeOpenPage(row, status) {
  138. this.detailData = {
  139. id: row.id,
  140. status: status
  141. };
  142. this.show = false;
  143. },
  144. editOpen(row, status) {
  145. this.detailData = {
  146. id: row.id,
  147. status: status
  148. };
  149. this.show = false;
  150. },
  151. //点击搜索按钮触发
  152. searchChange(params, done) {
  153. if (params.businesDate) {
  154. params.orderStartDate = params.businesDate[0];
  155. params.orderEndDate = params.businesDate[1];
  156. }
  157. if (params.plannedDeliveryDate) {
  158. params.plannedDeliveryStart = params.plannedDeliveryDate[0];
  159. params.plannedDeliveryEnd = params.plannedDeliveryDate[1];
  160. }
  161. if (params.createTime) {
  162. params.createTimeStart = params.createTime[0];
  163. params.createTimeEnd = params.createTime[1];
  164. }
  165. delete params.businesDate;
  166. delete params.plannedDeliveryDate;
  167. delete params.createTime;
  168. this.page.currentPage = 1;
  169. this.onLoad(this.page, params);
  170. done();
  171. },
  172. currentChange(val) {
  173. this.page.currentPage = val;
  174. },
  175. sizeChange(val) {
  176. this.page.currentPage = 1;
  177. this.page.pageSize = val;
  178. },
  179. onLoad(page, params) {
  180. if (this.search.businesDate && this.search.businesDate.length > 0) {
  181. params = {
  182. ...params,
  183. orderStartDate: this.search.businesDate[0],
  184. orderEndDate: this.search.businesDate[1]
  185. };
  186. delete params.businesDate;
  187. }
  188. getList(page.currentPage, page.pageSize, params).then(res => {
  189. this.dataList = res.data.data.records ? res.data.data.records : [];
  190. this.page.total = res.data.data.total;
  191. if (this.page.total) {
  192. this.option.height = window.innerHeight - 300;
  193. }
  194. });
  195. },
  196. refreshChange() {
  197. this.onLoad(this.page, this.search);
  198. },
  199. goBack() {
  200. this.detailData = this.$options.data().detailData;
  201. this.show = true;
  202. },
  203. async saveColumn() {
  204. const inSave = await this.saveColumnData(
  205. this.getColumnName(12),
  206. this.option
  207. );
  208. if (inSave) {
  209. this.$message.success("保存成功");
  210. //关闭窗口
  211. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  212. }
  213. }
  214. }
  215. };
  216. </script>
  217. <style scoped>
  218. ::v-deep .select-component {
  219. display: flex;
  220. }
  221. .page-crad ::v-deep .basic-container__card {
  222. height: 94.2vh;
  223. }
  224. </style>