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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. 搜索
  39. </el-button>
  40. <el-button type="info" icon="el-icon-search"
  41. @click="p.cardNo = '';p.no = '';p.createTime = '';p.adminConfirmInput=-1; f5()">重置
  42. </el-button>
  43. </el-form>
  44. <!-- ------------- 数据列表 ------------- -->
  45. <el-table class="data-table" ref="data-table" :data="dataList">
  46. <sa-td type="selection"></sa-td>
  47. <sa-td name="业务单号" prop="no" width="160"></sa-td>
  48. <sa-td name="车辆类型" prop="goodsName"></sa-td>
  49. <sa-td name="业务项" prop="itemTypeName" width="160"></sa-td>
  50. <el-table-column label="车牌号" width="120px">
  51. <template slot-scope="s">
  52. <label v-if="s.row.cardNo">{{s.row.cardNo}}</label>
  53. <label v-else>{{s.row.chinaCarNo}}</label>
  54. </template>
  55. </el-table-column>
  56. <sa-td name="作业时间" prop="operateTime" width="160"></sa-td>
  57. <sa-td name="已支付(元)" prop="payMoney" width="140"></sa-td>
  58. <sa-td name="业务费用(元)" prop="itemPrice" width="120"></sa-td>
  59. <sa-td width="160" name="创建时间" prop="createTime"></sa-td>
  60. </sa-td>
  61. <el-table-column label="操作" width="120px" fixed="right">
  62. <template slot-scope="s">
  63. <el-button class="c-btn" type="primary" @click="sureFn(s.row)">选择
  64. </el-button>
  65. </template>
  66. </el-table-column>
  67. </el-table>
  68. <!-- ------------- 分页 ------------- -->
  69. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  70. </sa-item>
  71. </div>
  72. </div>
  73. <script>
  74. var app = new Vue({
  75. components: {
  76. "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue'),
  77. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  78. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  79. },
  80. el: '.vue-box',
  81. data: {
  82. carNo: sa.p('carNo', ''),
  83. businessCarId: sa.p('businessCarId', -1),
  84. p: { // 查询参数
  85. no: '', // 编号
  86. businessType: 1,
  87. carNo: '', // 车牌号
  88. createTime: '', // 离境时间
  89. no: '', // 编号
  90. pageNo: 1, // 当前页
  91. pageSize: 10, // 页大小
  92. sortType: 0 // 排序方式
  93. },
  94. dataCount: 0,
  95. dataList: [], // 数据集合
  96. },
  97. methods: {
  98. getCurrendCustomer() {
  99. sa.ajax('/TbCostomer/getCurrentCustomerId', function (resp) {
  100. this.currentCustomerId = resp.data;
  101. }.bind(this));
  102. },
  103. sureFn(data) {
  104. let carNo = data.cardNo ? data.cardNo : data.chinaCarNo;
  105. let obj = {
  106. id: data.id,
  107. businessCarId: this.businessCarId
  108. };
  109. let content = '是否将[' + this.carNo + ']绑定到此业务';
  110. if (data.businessCarId && data.businessCarId !== this.businessCarId) {
  111. content = '此业务已绑定车辆【' + carNo + '】,是否覆盖?';
  112. }
  113. if (data.businessCarId === this.businessCarId) {
  114. sa.error('该车已绑定此业务,无需绑定');
  115. return;
  116. }
  117. sa.confirm(content, function () {
  118. sa.ajax('/TbBusiness/bindCar', obj, function (resp) {
  119. sa.alert('绑定成功');
  120. setTimeout(() => {
  121. sa.closeCurrIframe(); // 关闭本页
  122. parent.app.f5(); // 刷新父页面列表
  123. }, 1000)
  124. }.bind(this))
  125. }.bind(this));
  126. },
  127. // 查看
  128. get: function (data) {
  129. sa.showIframe('数据详情', 'tb-car-disincle-info.html?id=' + data.id, '1050px', '90%');
  130. },
  131. add: function (data) {
  132. sa.showIframe('新增数据', 'tb-car-disincle-add.html?id=-1', '1080px', '90%');
  133. },
  134. update(data) {
  135. sa.showIframe('修改数据', 'tb-car-disincle-edit.html?id=' + data.id, '1080px', '90%');
  136. },
  137. getPcodeByCurrRid() {
  138. sa.ajax('/SpRolePermission/getPcodeByCurrRid', function (resp) {
  139. this.perCode = resp.data;
  140. }.bind(this))
  141. },
  142. // 刷新
  143. f5: function () {
  144. sa.ajax('/TbBusiness/getList', sa.removeNull(this.p), function (res) {
  145. let list = res.data;
  146. this.dataList = list; // 数据
  147. this.dataCount = res.dataCount; // 数据总数
  148. let businessCarId = this.businessCarId;
  149. list.forEach(row => {
  150. if (businessCarId == row.businessCarId) {
  151. this.$nextTick(() => {
  152. this.$refs['data-table'].toggleRowSelection(row,
  153. true)
  154. })
  155. }
  156. })
  157. sa.f5TableHeight(); // 刷新表格高度
  158. }.bind(this));
  159. },
  160. },
  161. created: function () {
  162. sa.onInputEnter();
  163. },
  164. mounted() {
  165. this.getCurrendCustomer();
  166. this.f5();
  167. },
  168. })
  169. </script>
  170. </body>
  171. </html>