tb-business-car-business-add.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>入境登记-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  8. <!-- 所有的 css & js 资源 -->
  9. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  10. <link rel="stylesheet" href="../../static/sa.css">
  11. <script src="../../static/kj/vue.min.js"></script>
  12. <script src="../../static/kj/element-ui/index.js"></script>
  13. <script src="../../static/kj/httpVueLoader.js"></script>
  14. <script src="../../static/kj/jquery.min.js"></script>
  15. <script src="../../static/kj/layer/layer.js"></script>
  16. <script src="../../static/sa.js"></script>
  17. <script src="../../static/kj/upload-util.js"></script>
  18. </head>
  19. <style>
  20. .complete-modal .c-label,
  21. .confirm-in .c-label,
  22. .confirm-info .c-label {
  23. width: 290px;
  24. }
  25. </style>
  26. <body>
  27. <div class="vue-box" style="display: none;" :style="'display: block;'">
  28. <div class="c-panel">
  29. <el-form ref="form" :model='p' @submit.native.prevent>
  30. <sa-item type="text" name="订单号" placeholder="订单号" v-model="p.no"></sa-item>
  31. <sa-item type="text" name="车牌号" placeholder="车牌号" v-model="p.carNo"></sa-item>
  32. <div class="c-item">
  33. <label class="c-label">录入日期:</label>
  34. <el-date-picker :clearable="false" value-format="yyyy-MM-dd" v-model="p.createTime" type="date">
  35. </el-date-picker>
  36. </div>
  37. <el-button size="mini" type="primary" @click="f5()">
  38. 搜索</el-button>
  39. <el-button type="info" icon="el-icon-search"
  40. @click="p.cardNo = '';p.no = '';p.createTime = '';p.adminConfirmInput=-1; f5()">重置
  41. </el-button>
  42. </el-form>
  43. <!-- ------------- 数据列表 ------------- -->
  44. <el-table class="data-table" ref="data-table" :data="dataList">
  45. <sa-td type="selection"></sa-td>
  46. <sa-td name="业务单号" prop="no" width="160"></sa-td>
  47. <sa-td name="车辆类型" prop="goodsName"></sa-td>
  48. <sa-td name="业务项" prop="itemTypeName" width="160"></sa-td>
  49. <el-table-column label="车牌号" width="120px">
  50. <template slot-scope="s">
  51. <label v-if="s.row.cardNo">{{s.row.cardNo}}</label>
  52. <label v-else>{{s.row.chinaCarNo}}</label>
  53. </template>
  54. </el-table-column>
  55. <sa-td name="作业时间" prop="operateTime" width="160"></sa-td>
  56. <sa-td name="已支付(元)" prop="payMoney" width="140"></sa-td>
  57. <sa-td name="业务费用(元)" prop="itemPrice" width="120"></sa-td>
  58. <sa-td width="160" name="创建时间" prop="createTime"></sa-td>
  59. </sa-td>
  60. <el-table-column label="操作" width="120px" fixed="right">
  61. <template slot-scope="s">
  62. <el-button class="c-btn" type="primary" @click="sureFn(s.row)">选择
  63. </el-button>
  64. </template>
  65. </el-table-column>
  66. </el-table>
  67. <!-- ------------- 分页 ------------- -->
  68. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  69. </sa-item>
  70. </div>
  71. </div>
  72. <script>
  73. var app = new Vue({
  74. components: {
  75. "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue'),
  76. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  77. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  78. },
  79. el: '.vue-box',
  80. data: {
  81. carNo: sa.p('carNo', ''),
  82. businessCarId: sa.p('businessCarId', -1),
  83. p: { // 查询参数
  84. no: '', // 编号
  85. businessType: 1,
  86. carNo: '', // 车牌号
  87. createTime: '', // 离境时间
  88. no: '', // 编号
  89. pageNo: 1, // 当前页
  90. pageSize: 10, // 页大小
  91. sortType: 0 // 排序方式
  92. },
  93. dataCount: 0,
  94. dataList: [], // 数据集合
  95. },
  96. methods: {
  97. getCurrendCustomer() {
  98. sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
  99. this.currentCustomerId = resp.data;
  100. }.bind(this));
  101. },
  102. sureFn(data) {
  103. let carNo=data.cardNo?data.cardNo:data.chinaCarNo;
  104. let obj = {
  105. id: data.id,
  106. businessCarId: this.businessCarId
  107. };
  108. let content = '是否将[' + this.carNo + ']绑定到此业务';
  109. if (data.businessCarId && data.businessCarId !== this.businessCarId) {
  110. content = '此业务已绑定车辆【' + carNo + '】,是否覆盖?';
  111. }
  112. if (data.businessCarId === this.businessCarId) {
  113. sa.error('该车已绑定此业务,无需绑定');
  114. return;
  115. }
  116. sa.confirm(content, function() {
  117. sa.ajax('/TbBusiness/bindCar', obj, function(resp) {
  118. sa.alert('绑定成功');
  119. setTimeout(() => {
  120. sa.closeCurrIframe(); // 关闭本页
  121. parent.app.f5(); // 刷新父页面列表
  122. }, 1000)
  123. }.bind(this))
  124. }.bind(this));
  125. },
  126. // 查看
  127. get: function(data) {
  128. sa.showIframe('数据详情', 'tb-car-disincle-info.html?id=' + data.id, '1050px', '90%');
  129. },
  130. add: function(data) {
  131. sa.showIframe('新增数据', 'tb-car-disincle-add.html?id=-1', '1080px', '90%');
  132. },
  133. update(data) {
  134. sa.showIframe('修改数据', 'tb-car-disincle-edit.html?id=' + data.id, '1080px', '90%');
  135. },
  136. getPcodeByCurrRid() {
  137. sa.ajax('/SpRolePermission/getPcodeByCurrRid', function(resp) {
  138. this.perCode = resp.data;
  139. }.bind(this))
  140. },
  141. // 刷新
  142. f5: function() {
  143. sa.ajax('/TbBusiness/getList', sa.removeNull(this.p), function(res) {
  144. let list = res.data;
  145. this.dataList = list; // 数据
  146. this.dataCount = res.dataCount; // 数据总数
  147. let businessCarId = this.businessCarId;
  148. list.forEach(row => {
  149. if (businessCarId == row.businessCarId) {
  150. this.$nextTick(() => {
  151. this.$refs['data-table'].toggleRowSelection(row,
  152. true)
  153. })
  154. }
  155. })
  156. sa.f5TableHeight(); // 刷新表格高度
  157. }.bind(this));
  158. },
  159. },
  160. created: function() {
  161. sa.onInputEnter();
  162. },
  163. mounted() {
  164. this.getCurrendCustomer();
  165. this.f5();
  166. },
  167. })
  168. </script>
  169. </body>
  170. </html>