selfCarApply.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <template>
  2. <div class="invoice_container">
  3. <div class="title">
  4. <el-row>
  5. <el-col :span="24">
  6. <div class="top">
  7. <el-input placeholder="企业编号" class="input-demo" v-model="formCondition.companyNum"></el-input>
  8. <el-input placeholder="申请Id" class="input-demo" v-model="formCondition.applId"></el-input>
  9. <el-input placeholder="etc卡号" class="input-demo" v-model="formCondition.etcNum"></el-input>
  10. <el-button type="success" style="margin-left: 1%;" @click="loadData">查询</el-button>
  11. <el-button type="primary" style="margin-left: 1%;" @click="exportExcel">导出报表</el-button>
  12. </div>
  13. </el-col>
  14. </el-row>
  15. </div>
  16. <!-- 表格部分 -->
  17. <template>
  18. <el-table
  19. class="table"
  20. v-loading="loading"
  21. ref="multipleTable"
  22. :data="invoiceTable"
  23. :height="heightt"
  24. border
  25. tooltip-effect="dark">
  26. <el-table-column
  27. prop="plateNum"
  28. label="车牌号"
  29. show-overflow-tooltip>
  30. </el-table-column>
  31. <el-table-column
  32. prop="cardId"
  33. label="ETC卡号"
  34. show-overflow-tooltip>
  35. </el-table-column>
  36. <el-table-column
  37. prop="tradeId"
  38. label="交易Id"
  39. show-overflow-tooltip>
  40. </el-table-column>
  41. <el-table-column
  42. prop="sellerTaxpayerCode"
  43. label="销方税号"
  44. show-overflow-tooltip>
  45. </el-table-column>
  46. <el-table-column
  47. prop="sellerName"
  48. label="销方名称"
  49. show-overflow-tooltip>
  50. </el-table-column>
  51. <el-table-column
  52. prop="enStation"
  53. label="入口收费站"
  54. width="100"
  55. show-overflow-tooltip>
  56. </el-table-column>
  57. <el-table-column
  58. prop="exStation"
  59. label="出口收费站"
  60. width="100"
  61. show-overflow-tooltip>
  62. </el-table-column>
  63. <el-table-column
  64. prop="invoiceCode"
  65. label="发票代码"
  66. show-overflow-tooltip>
  67. </el-table-column>
  68. <el-table-column
  69. prop="invoiceNum"
  70. label="发票号码"
  71. show-overflow-tooltip>
  72. </el-table-column>
  73. <el-table-column
  74. prop="invoiceMakeTime"
  75. label="开票时间"
  76. show-overflow-tooltip>
  77. </el-table-column>
  78. <el-table-column
  79. prop="exTime"
  80. label="交易时间"
  81. show-overflow-tooltip>
  82. </el-table-column>
  83. <!-- <el-table-column
  84. prop="enStation"
  85. label="入口收费站"
  86. width="100"
  87. show-overflow-tooltip>
  88. </el-table-column>
  89. <el-table-column
  90. prop="exStation"
  91. label="出口收费站"
  92. width="100"
  93. show-overflow-tooltip>
  94. </el-table-column>
  95. <el-table-column
  96. prop="sellerName"
  97. label="销方名称"
  98. show-overflow-tooltip>
  99. </el-table-column>
  100. <el-table-column
  101. prop="sellerTaxpayerCode"
  102. label="销方税号"
  103. show-overflow-tooltip>
  104. </el-table-column> -->
  105. <el-table-column
  106. prop="fee"
  107. label="交易金额"
  108. show-overflow-tooltip>
  109. <template slot-scope="scope">
  110. <span>{{scope.row.fee/100| rounding}}</span>
  111. </template>
  112. </el-table-column>
  113. <el-table-column
  114. prop="totalAmount"
  115. label="价税合计"
  116. show-overflow-tooltip>
  117. <template slot-scope="scope">
  118. <span>{{scope.row.totalAmount/100| rounding}}</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column
  122. prop="totalTaxAmount"
  123. label="税额"
  124. show-overflow-tooltip>
  125. <template slot-scope="scope">
  126. <span>{{scope.row.totalTaxAmount/100| rounding}}</span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column
  130. prop="amount"
  131. label="金额"
  132. show-overflow-tooltip>
  133. <template slot-scope="scope">
  134. <span>{{scope.row.fee/100| rounding}}</span>
  135. </template>
  136. </el-table-column>
  137. <el-table-column
  138. prop="taxRate"
  139. label="税率"
  140. show-overflow-tooltip>
  141. <template slot-scope="scope">
  142. <span>{{scope.row.taxRate| rounding}}</span>
  143. </template>
  144. </el-table-column>
  145. <el-table-column
  146. prop="invoiceHtmlUrl"
  147. label="预览地址"
  148. show-overflow-tooltip>
  149. <template slot-scope="scope">
  150. <a :href="scope.row.invoiceHtmlUrl" target="_blank">{{scope.row.invoiceHtmlUrl}}</a>
  151. </template>
  152. </el-table-column>
  153. <el-table-column
  154. prop="invoiceUrl"
  155. label="下载地址"
  156. show-overflow-tooltip>
  157. <template slot-scope="scope">
  158. <a :href="scope.row.invoiceUrl" target="_blank">{{scope.row.invoiceUrl}}</a>
  159. </template>
  160. </el-table-column>
  161. <el-table-column
  162. prop="invoiceStatus"
  163. label="状态"
  164. show-overflow-tooltip>
  165. <template slot-scope="scope">
  166. <span v-if="scope.row.tradeStatus == 1" style="color: green">待开票</span>
  167. <span v-else-if="scope.row.tradeStatus == 2" style="color: red">开票中</span>
  168. <span v-else-if="scope.row.tradeStatus == 3" style="color: red">已开票</span>
  169. </template>
  170. </el-table-column>
  171. <el-table-column
  172. prop="msg"
  173. label="发票状态信息"
  174. width="100"
  175. show-overflow-tooltip>
  176. </el-table-column>
  177. </el-table>
  178. </template>
  179. </div>
  180. </template>
  181. <script type="text/javascript">
  182. import FileSaver from "file-saver";
  183. import XLSX from "xlsx";
  184. export default {
  185. data(){
  186. return{
  187. formCondition:{
  188. etcNum:'',
  189. applId:'',
  190. companyNum:''
  191. },
  192. invoiceTable:[],
  193. hightt:'0px',
  194. }
  195. },
  196. created() {
  197. this.heightt = tableHeight-50;
  198. },
  199. filters: {
  200. rounding (value) {
  201. return value.toFixed(2)
  202. }
  203. },
  204. methods:{
  205. firstLoadData(){
  206. },
  207. // 列表展示
  208. async loadData() {
  209. const formData = new FormData();
  210. for(var i in this.formCondition){
  211. formData.append(i,this.formCondition[i]);
  212. }
  213. const response = await this.$http.post('selfCarService/getSelfCarInvoicesByAppl', formData);
  214. if (response.data.code === 0) {
  215. this.invoiceTable = response.data.data;
  216. }
  217. },
  218. exportExcel() {
  219. const loading = this.$loading({
  220. lock: true,
  221. text: '系统正在努力接收中,过程大概需要几分钟的时间,请您耐心等待...',
  222. spinner: 'el-icon-loading',
  223. background: 'rgba(0, 0, 0, 0.7)'
  224. });
  225. // 设置当前日期
  226. let time = new Date();
  227. let year = time.getFullYear();
  228. let month = time.getMonth() + 1;
  229. let day = time.getDate();
  230. let name = "自有车发票查询列表_"+year + "" + month + "" + day;
  231. /* generate workbook object from table */
  232. // .table要导出的是哪一个表格
  233. var wb = XLSX.utils.table_to_book(document.querySelector(".table"),{ raw: true });
  234. this.formartNum(wb);
  235. /* get binary string as output */
  236. var wbout = XLSX.write(wb, {
  237. bookType: "xlsx",
  238. bookSST: true,
  239. type: "array"
  240. });
  241. try {
  242. // name+'.xlsx'表示导出的excel表格名字
  243. FileSaver.saveAs(
  244. new Blob([wbout], { type: "application/octet-stream" }),
  245. name + ".xlsx"
  246. );
  247. } catch (e) {
  248. if (typeof console !== "undefined") console.log(e, wbout);
  249. }
  250. loading.close();
  251. return wbout;
  252. },
  253. }
  254. };
  255. </script>
  256. <style>
  257. .invoice_container {
  258. border: 1px solid #d9d9d9;
  259. border-radius: 10px;
  260. }
  261. .invoice_container .title {
  262. font-size: 5px;
  263. margin-bottom: 20px;
  264. }
  265. .invoice_container .top {
  266. padding-top: 20px;
  267. padding-left: 20px;
  268. }
  269. .invoice_container .text {
  270. display: inline-block;
  271. color: #000;
  272. font-size: 16px ;
  273. margin-left: 1%;
  274. }
  275. .invoice_container .input-demo {
  276. display: inline-block;
  277. width: 15%;
  278. margin-left: 1%;
  279. }
  280. .invoice_container .block {
  281. font-size: 5px;
  282. text-align: center;
  283. margin-top: 25px;
  284. margin-bottom: 25px;
  285. }
  286. .invoice_container .el-dialog {
  287. width: 60%;
  288. }
  289. .invoice_container .el-dialog__header, .el-dialog__body {
  290. padding: 0 20px;
  291. }
  292. .invoice_container .tou {
  293. font-size: 20px;
  294. height: 30px;
  295. line-height: 30px;
  296. padding-top: 15px;
  297. }
  298. .invoice_container .line {
  299. margin-top: 15px;
  300. margin-bottom: 15px;
  301. width: 100%;
  302. height: 2px;
  303. background-color: #d9d9d9;
  304. }
  305. .invoice_container .xinxi {
  306. text-align: center;
  307. margin: 15px auto;
  308. font-size: 18px;
  309. }
  310. </style>