billwayException.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <template>
  2. <div class="billWay_container">
  3. <div class="title">
  4. <el-row>
  5. <el-col :span="24">
  6. <div class="top">
  7. <div class="demo-input-suffix">
  8. <el-input placeholder="客户名称" class="input-demo" v-model="noCarWayBill.companyName"></el-input>
  9. <el-input placeholder="运单编号" class="input-demo" v-model="noCarWayBill.billNum"></el-input>
  10. <el-input placeholder="税号" class="input-demo" v-model="noCarWayBill.taxplayerCode"></el-input>
  11. </div>
  12. <div class="demo-input-suffix" style="margin-top: 5px;margin-left: 10px;">
  13. <el-date-picker v-model="noCarWayBill.endBegin" type="daterange" value-format="yyyy-MM-dd HH:mm:SS" range-separator="至" start-placeholder="指令结束始" end-placeholder="指令结束止"></el-date-picker>
  14. <!-- <el-date-picker v-model="noCarWayBill.startEnd" type="date" placeholder="开始指令上传时间止"></el-date-picker>
  15. <el-date-picker v-model="noCarWayBill.startBegin" type="date" placeholder="开始指令上传时间始"></el-date-picker> -->
  16. <!-- <el-date-picker v-model="noCarWayBill.endBegin" type="date" placeholder="结束指令上传时间始"></el-date-picker>
  17. <el-date-picker v-model="noCarWayBill.endEnd" type="date" placeholder="结束指令上传时间止"></el-date-picker> -->
  18. <el-button type="success" style="margin-left: 1%;" @click="loadData">查询</el-button>
  19. <el-button type="success" style="margin-left: 1%;" @click="updateStatus">更新状态</el-button>
  20. <el-button type="primary" style="margin-left: 1%;" @click="exportExcel">导出报表</el-button>
  21. </div>
  22. </div>
  23. </el-col>
  24. </el-row>
  25. </div>
  26. <!-- 表格部分 -->
  27. <template>
  28. <el-table
  29. class="table"
  30. v-loading="loading"
  31. ref="multipleTable"
  32. :data="billWayTable"
  33. height="370px"
  34. border
  35. tooltip-effect="dark">
  36. <el-table-column
  37. label="企业编号"
  38. prop="companyNum"
  39. show-overflow-tooltip>
  40. </el-table-column>
  41. <el-table-column
  42. prop="companyName"
  43. label="客戶名称"
  44. show-overflow-tooltip>
  45. </el-table-column>
  46. <el-table-column
  47. prop="billNum"
  48. label="运单编号"
  49. show-overflow-tooltip>
  50. </el-table-column>
  51. <el-table-column
  52. prop="taxplayerCode"
  53. label="税号"
  54. show-overflow-tooltip>
  55. </el-table-column>
  56. <el-table-column
  57. prop="interfaceEndTime"
  58. label="结束指令时间"
  59. width="120"
  60. show-overflow-tooltip>
  61. </el-table-column>
  62. <el-table-column
  63. prop="billwayStatus"
  64. label="运单状态"
  65. show-overflow-tooltip>
  66. <template slot-scope="scope">
  67. <span v-if="scope.row.billwayStatus == 1" style="color: green">未结束</span>
  68. <span v-else-if="scope.row.billwayStatus == 2" style="color: green">开票中</span>
  69. <span v-else-if="scope.row.billwayStatus == 3" style="color: green">开票完成</span>
  70. <span v-else-if="scope.row.billwayStatus == 4" style="color: red">超时运单</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column
  74. prop="updateTime"
  75. label="最后更新时间"
  76. width="120"
  77. show-overflow-tooltip>
  78. </el-table-column>
  79. <el-table-column
  80. prop="updateTime"
  81. label="超长时间(天)"
  82. width="120"
  83. show-overflow-tooltip>
  84. </el-table-column>
  85. <el-table-column
  86. prop="hisFlag"
  87. label="运单类型"
  88. show-overflow-tooltip>
  89. <template slot-scope="scope">
  90. <span v-if="scope.row.hisFlag == 0" >实时运单</span>
  91. <span v-else-if="scope.row.hisFlag == 1">历史运单</span>
  92. </template>
  93. </el-table-column>
  94. </el-table>
  95. </template>
  96. <!-- 分页 -->
  97. <div class="block">
  98. <el-pagination
  99. @size-change="handleSizeChange"
  100. @current-change="handleCurrentChange"
  101. :current-page="current"
  102. :page-sizes="[6, 8, 10, 20, 50, 100]"
  103. :page-size="pagesize"
  104. layout="total, sizes, prev, pager, next, jumper"
  105. :total="total">
  106. </el-pagination>
  107. </div>
  108. </div>
  109. </template>
  110. <script type="text/javascript">
  111. import FileSaver from "file-saver";
  112. import XLSX from "xlsx";
  113. export default {
  114. data(){
  115. return{
  116. noCarWayBill:{
  117. },
  118. optionone: [{
  119. value: 0,
  120. label: '实时运单'
  121. }, {
  122. value: 1,
  123. label: '历史运单'
  124. }],
  125. billWayTable:[],
  126. current: 1,
  127. pagesize: 8,
  128. total:''
  129. }
  130. },
  131. created() {
  132. this.loadData();
  133. },
  134. methods:{
  135. // 列表展示
  136. async loadData() {
  137. const formData = new FormData();
  138. formData.append('current', this.current);
  139. formData.append('size', this.pagesize);
  140. for(var i in this.noCarWayBill){
  141. formData.append(i,this.noCarWayBill[i]);
  142. }
  143. const response = await this.$http.post(`noCar/findBillWayException`, formData);
  144. if (response.data.code === 0) {
  145. this.billWayTable = response.data.data.records;
  146. this.total = response.data.data.total;
  147. }
  148. },
  149. async updateStatus(){
  150. const response = await this.$http.post(`noCar/updateStatus`);
  151. if(response.data.code === 0) {
  152. this.loadData();
  153. this.$message({
  154. type: 'success',
  155. message: '更新成功'
  156. });
  157. }else {
  158. this.$message({
  159. type: 'error',
  160. message: '更新失败'
  161. });
  162. }
  163. },
  164. // 分页方法
  165. handleSizeChange(val) {
  166. this.pagesize = val;
  167. this.loadData();
  168. console.log(`每页 ${val} 条`);
  169. },
  170. handleCurrentChange(val) {
  171. this.current = val;
  172. this.loadData();
  173. // console.log(`当前页: ${val}`);
  174. },
  175. exportExcel() {
  176. // 设置当前日期
  177. let time = new Date();
  178. //console.log(time);
  179. let year = time.getFullYear();
  180. let month = time.getMonth() + 1;
  181. let day = time.getDate();
  182. let name = "无车异常运单查询列表_"+year + "" + month + "" + day;
  183. // console.log(name)
  184. /* generate workbook object from table */
  185. // .table要导出的是哪一个表格
  186. var wb = XLSX.utils.table_to_book(document.querySelector(".table"));
  187. /* get binary string as output */
  188. var wbout = XLSX.write(wb, {
  189. bookType: "xlsx",
  190. bookSST: true,
  191. type: "array"
  192. });
  193. try {
  194. // name+'.xlsx'表示导出的excel表格名字
  195. FileSaver.saveAs(
  196. new Blob([wbout], { type: "application/octet-stream" }),
  197. name + ".xlsx"
  198. );
  199. } catch (e) {
  200. if (typeof console !== "undefined") console.log(e, wbout);
  201. }
  202. return wbout;
  203. },
  204. }
  205. };
  206. </script>
  207. <style>
  208. .billWay_container {
  209. border: 1px solid #d9d9d9;
  210. border-radius: 10px;
  211. }
  212. .billWay_container .title {
  213. font-size: 5px;
  214. margin-bottom: 20px;
  215. }
  216. .billWay_container .top {
  217. padding-top: 20px;
  218. padding-left: 20px;
  219. }
  220. .billWay_container .text {
  221. display: inline-block;
  222. color: #000;
  223. font-size: 16px ;
  224. margin-left: 1%;
  225. }
  226. .billWay_container .input-demo {
  227. display: inline-block;
  228. width: 20%;
  229. margin-left: 1%;
  230. }
  231. .billWay_container .block {
  232. font-size: 5px;
  233. text-align: center;
  234. margin-top: 25px;
  235. margin-bottom: 25px;
  236. }
  237. .billWay_container .el-dialog {
  238. width: 60%;
  239. }
  240. .billWay_container .el-dialog__header, .el-dialog__body {
  241. padding: 0 20px;
  242. }
  243. .billWay_container .tou {
  244. font-size: 20px;
  245. height: 30px;
  246. line-height: 30px;
  247. padding-top: 15px;
  248. }
  249. .billWay_container .line {
  250. margin-top: 15px;
  251. margin-bottom: 15px;
  252. width: 100%;
  253. height: 2px;
  254. background-color: #d9d9d9;
  255. }
  256. .billWay_container .xinxi {
  257. text-align: center;
  258. margin: 15px auto;
  259. font-size: 18px;
  260. }
  261. </style>