waybill.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <div class="waybill">
  3. <el-card>
  4. <!-- 头部细节部分 -->
  5. <div class="title">
  6. <el-row>
  7. <el-col :span="24">
  8. <div class="top">
  9. <el-input placeholder="appKey" class="input-demo" v-model="appKey"></el-input>
  10. <el-input placeholder="运单编号" class="input-demo" v-model="num"></el-input>
  11. <el-input placeholder="车牌号" class="input-demo" v-model="plateNumber"></el-input>
  12. <label style="margin-left: 1%;">运单类型:</label>
  13. <el-select v-model="isHistory" placeholder="请选择">
  14. <el-option
  15. v-for="item in optionone"
  16. :key="item.value"
  17. :label="item.label"
  18. :value="item.value">
  19. </el-option>
  20. </el-select>
  21. </div>
  22. </el-col>
  23. </el-row>
  24. <el-row>
  25. <el-col :span="24">
  26. <div class="top">
  27. <label style="margin-left: 1%;">运单状态:</label>
  28. <el-select v-model="status" placeholder="请选择">
  29. <el-option
  30. v-for="item in optiontwo"
  31. :key="item.value"
  32. :label="item.label"
  33. :value="item.value">
  34. </el-option>
  35. </el-select>
  36. <el-button type="success" style="margin-left: 1%;" @click="queryLook">查询</el-button>
  37. </div>
  38. </el-col>
  39. </el-row>
  40. </div>
  41. <!-- 头部细节部分结束 -->
  42. <!-- 表格部分 -->
  43. <template>
  44. <el-table
  45. v-loading="loading"
  46. ref="multipleTable"
  47. :data="roletable"
  48. border
  49. tooltip-effect="dark"
  50. style="width: 100%">
  51. <el-table-column
  52. label="序号"
  53. type="index"
  54. width="40"
  55. show-overflow-tooltip>
  56. </el-table-column>
  57. <el-table-column
  58. prop="num"
  59. label="运单编号"
  60. show-overflow-tooltip>
  61. </el-table-column>
  62. <el-table-column
  63. prop="plateNumber"
  64. label="车牌号"
  65. show-overflow-tooltip>
  66. </el-table-column>
  67. <el-table-column
  68. prop="status"
  69. label="运单状态"
  70. show-overflow-tooltip>
  71. <template slot-scope="scope">
  72. <span v-if="scope.row.status == 1">未结束</span>
  73. <span v-if="scope.row.status == 2">已结束运单</span>
  74. <span v-if="scope.row.status == 3">已开发票</span>
  75. <span v-if="scope.row.status == 4">开票中</span>
  76. <span v-if="scope.row.status == 9">状态错误</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column
  80. prop="isHistory"
  81. label="运单类型"
  82. show-overflow-tooltip>
  83. </el-table-column>
  84. <el-table-column
  85. label="开始运单创建时间"
  86. show-overflow-tooltip>
  87. <template slot-scope="scope" show-overflow-tooltip>
  88. <span>{{scope.row.startBillCreateTime | fmtDate}}</span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column
  92. prop="realDestAddr"
  93. label="运单实际目的地"
  94. show-overflow-tooltip>
  95. </el-table-column>
  96. <el-table-column
  97. label="运单结束创建时间"
  98. show-overflow-tooltip>
  99. <template slot-scope="scope" show-overflow-tooltip>
  100. <span>{{scope.row.endBillCreateTime | fmtDate}}</span>
  101. </template>
  102. </el-table-column>
  103. <el-table-column
  104. prop="appKey"
  105. label="appKey"
  106. show-overflow-tooltip>
  107. </el-table-column>
  108. <el-table-column
  109. prop="company"
  110. label="公司名称"
  111. show-overflow-tooltip>
  112. </el-table-column>
  113. </el-table>
  114. </template>
  115. <!-- 分页 -->
  116. <div class="block">
  117. <el-pagination
  118. @size-change="handleSizeChange"
  119. @current-change="handleCurrentChange"
  120. :current-page="current"
  121. :page-sizes="[6, 8, 10]"
  122. :page-size="pagesize"
  123. layout="total, sizes, prev, pager, next, jumper"
  124. :total="total">
  125. </el-pagination>
  126. </div>
  127. </el-card>
  128. </div>
  129. </template>
  130. <script type="text/javascript">
  131. export default{
  132. data() {
  133. return {
  134. loading: true,
  135. appKey: '',
  136. num: '',
  137. status: '',
  138. isHistory: '',
  139. plateNumber: '',
  140. roletable: [],
  141. optionone: [{
  142. value: '1',
  143. label: '实时运单'
  144. }, {
  145. value: '2',
  146. label: '历史运单'
  147. }],
  148. optiontwo: [{
  149. value: '1',
  150. label: '未结束'
  151. }, {
  152. value: '2',
  153. label: '已结束运单'
  154. }, {
  155. value: '3',
  156. label: '已开发票'
  157. }, {
  158. value: '4',
  159. label: '开票中'
  160. }, {
  161. value: '9',
  162. label: '状态错误'
  163. }],
  164. formList: {
  165. "roleId": "",
  166. "permissionIds": []
  167. },
  168. current: 1,
  169. pagesize: 10,
  170. total: 0,
  171. }
  172. },
  173. created() {
  174. this.loadData();
  175. },
  176. methods: {
  177. // 请求查询数据
  178. async loadData() {
  179. const response = await this.$http.get(`app/billRecord?&current=${this.current}&size=${this.pagesize}`);
  180. if (response.data.code === 1) {
  181. this.loading = false;
  182. this.roletable = response.data.responseData.records;
  183. this.total = response.data.responseData.total;
  184. }
  185. },
  186. //查询
  187. async queryLook() {
  188. const response = await this.$http.get(`app/billRecord?&current=${this.current}&size=${this.pagesize}&appKey=${this.appKey}&num=${this.num}&status=${this.status}&isHistory=${this.isHistory}&plateNumber=${this.plateNumber}`);
  189. if (response.data.code === 1) {
  190. this.loading = false;
  191. this.roletable = response.data.data.records;
  192. this.total = response.data.data.total;
  193. }
  194. },
  195. // 分页方法
  196. handleSizeChange(val) {
  197. this.pagesize = val;
  198. if(this.appKey !== '' || this.num !== '' || this.status !== '' || this.isHistory !== '' || this.plateNumber !== '') {
  199. this.queryLook();
  200. }else{
  201. this.loadData();
  202. };
  203. console.log(`每页 ${val} 条`);
  204. },
  205. handleCurrentChange(val) {
  206. this.current = val;
  207. if(this.appKey !== '' || this.num !== '' || this.status !== '' || this.isHistory !== '' || this.plateNumber !== '') {
  208. this.queryLook();
  209. }else{
  210. this.loadData();
  211. };
  212. console.log(`当前页: ${val}`);
  213. },
  214. }
  215. };
  216. </script>
  217. <style scoped>
  218. .waybill {
  219. border: 1px solid #d9d9d9;
  220. border-radius: 10px;
  221. }
  222. .waybill .title {
  223. font-size: 5px;
  224. margin-bottom: 20px;
  225. }
  226. .waybill .top {
  227. padding-top: 20px;
  228. padding-left: 20px;
  229. }
  230. .waybill .text {
  231. display: inline-block;
  232. color: #000;
  233. font-size: 16px ;
  234. margin-left: 1%;
  235. }
  236. .waybill .input-demo {
  237. display: inline-block;
  238. width: 20%;
  239. margin-left: 1%;
  240. }
  241. .waybill .block {
  242. font-size: 5px;
  243. text-align: center;
  244. margin-top: 25px;
  245. margin-bottom: 25px;
  246. }
  247. .waybill .el-dialog {
  248. width: 60%;
  249. }
  250. .waybill .el-dialog__header, .el-dialog__body {
  251. padding: 0 20px;
  252. }
  253. .waybill .tou {
  254. font-size: 20px;
  255. height: 30px;
  256. line-height: 30px;
  257. padding-top: 15px;
  258. }
  259. .waybill .line {
  260. margin-top: 15px;
  261. margin-bottom: 15px;
  262. width: 100%;
  263. height: 2px;
  264. background-color: #d9d9d9;
  265. }
  266. .waybill .xinxi {
  267. text-align: center;
  268. margin: 15px auto;
  269. font-size: 18px;
  270. }
  271. </style>