tb-car-disincle-list.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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. <div style="float: right;right: 20px;margin-top: 10px;">
  30. <label>刷新频率:</label>
  31. <el-select v-model="fresh.value" placeholder="请选择" @change="restartTimmer">
  32. <el-option label="10s" :value="10"></el-option>
  33. <el-option label="20s" :value="20"></el-option>
  34. <el-option label="30s" :value="30"></el-option>
  35. <el-option label="50s" :value="50"></el-option>
  36. <el-option label="60s" :value="60"></el-option>
  37. </el-select>
  38. </div>
  39. <!-- ------------- 检索参数 ------------- -->
  40. <div class="c-title">检索参数</div>
  41. <el-form ref="form" :model='p' @submit.native.prevent>
  42. <sa-item type="text" name="车牌号" placeholder="车牌号" v-model="p.carNo"></sa-item>
  43. <sa-item type="text" name="客户" placeholder="客户" v-model="p.customerName"></sa-item>
  44. <sa-item type="text" name="货主" placeholder="客户" v-model="p.owner"></sa-item>
  45. <div class="c-item">
  46. <label class="c-label">确认状态:</label>
  47. <el-select v-model="p.adminConfirmInput" placeholder="请选择" @change="f5()">
  48. <el-option label="全部" :value="-1"></el-option>
  49. <el-option label="已确认" :value="1"></el-option>
  50. <el-option label="未确认" :value="0"></el-option>
  51. </el-select>
  52. </div>
  53. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  54. <el-button type="info" icon="el-icon-search" @click="p.carNo = '';p.adminConfirmInput=-1;p.customerName='';p.owner=''; f5()">重置
  55. </el-button>
  56. <el-button v-if="sa.isAuth('tb-flex-business-add')" size="mini" type="primary" @click="add()">
  57. 新增</el-button>
  58. <br />
  59. </el-form>
  60. <!-- ------------- 数据列表 ------------- -->
  61. <el-table class="data-table" ref="data-table" :data="dataList" style="margin-top: 20px;">
  62. <el-table-column type="index" width="50"></el-table-column>
  63. <sa-td name="业务单号" prop="no" width="160"></sa-td>
  64. <sa-td name="客户名称" prop="customerName" width="190"></sa-td>
  65. <sa-td name="货主" prop="owner" width="160"></sa-td>
  66. <sa-td name="业务项" prop="goodsName" width="160"></sa-td>
  67. <el-table-column label="车牌号" width="160">
  68. <template slot-scope="s">
  69. <label>{{s.row.carNoStr}}</label>
  70. </template>
  71. </el-table-column>
  72. <sa-td name="作业时间" prop="operateTime" width="160"></sa-td>
  73. <sa-td name="确认" prop="adminConfirmInput" type="enum" :jv="{1: '已确认', 0: '未确认'}"></sa-td>
  74. <sa-td name="已支付(元)" prop="payMoney" width="140"></sa-td>
  75. <sa-td name="业务费用(元)" prop="itemPrice" width="120"></sa-td>
  76. <sa-td width="160" name="创建时间" prop="createTime"></sa-td>
  77. </sa-td>
  78. <el-table-column label="操作" width="415px" fixed="right">
  79. <template slot-scope="s">
  80. <el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-flex-business-confirm')
  81. &&currentCustomerId=='1'&&s.row.adminConfirmInput==0" @click="confirmFn(s.row)">账单确认</el-button>
  82. <el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-business-confirm')
  83. &&currentCustomerId=='1'&&s.row.adminConfirmInput==1" @click="checkConfirmFn(s.row)">查看账单</el-button>
  84. <el-button class="c-btn" type="success" @click="get(s.row)">查看</el-button>
  85. <el-button class="c-btn" type="primary"
  86. v-if="currentCustomerId=='1'||(s.row.adminConfirmInput==0&&sa.isAuth('tb-flex-business-edit'))"
  87. @click="update(s.row)">
  88. 修改</el-button>
  89. <el-button v-if="sa.isAuth('tb-flex-business-edit')" class="c-btn" type="primary"
  90. @click="carFn(s.row)">车辆管理
  91. </el-button>
  92. <el-button class="c-btn" type="primary" v-if="(currentCustomerId=='1'||(sa.isAuth('tb-flex-business-pay')))
  93. &&s.row.payStatus!=3" @click="handlerPay(s.row)">
  94. 线下收费</el-button>
  95. <el-button v-if="sa.isAuth('tb-business-car-bind')" class="c-btn" type="primary"
  96. @click="businessFn(s.row)">绑定车辆
  97. </el-button>
  98. <el-button class="c-btn" type="danger"
  99. v-if="sa.isAuth('tb-flex-business-del')&&s.row.adminConfirmInput==0&&s.row.payMoney==0"
  100. @click="del(s.row)">删除
  101. </el-button>
  102. </template>
  103. </el-table-column>
  104. </el-table>
  105. <!-- ------------- 分页 ------------- -->
  106. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  107. </sa-item>
  108. </div>
  109. <el-dialog :title="confirm.title" :visible.sync="confirm.visible" width="650px">
  110. <div class="confirm-info">
  111. <el-row>
  112. <sa-info name="订单号" br>{{confirm.form.no}}</sa-info>
  113. <sa-info :name="item.itemName" br v-for="item in confirm.form.items">
  114. {{item.itemPrice}}x{{item.num}}={{item.total}}元
  115. </sa-info>
  116. <sa-info name="创建时间" br>{{confirm.form.createTime}}</sa-info>
  117. <sa-info name="总计费用" br>{{confirm.form.itemPrice}}(元)</sa-info>
  118. </el-row>
  119. </div>
  120. <span slot="footer" class="dialog-footer">
  121. <div v-if="confirm.form.adminConfirmInput==0">
  122. <el-button @click="confirm.visible = false">取 消</el-button>
  123. <el-button type="primary" @click="sureConfirmFn">确 认</el-button>
  124. </div>
  125. <div v-else>
  126. <el-button @click="confirm.visible = false">关闭</el-button>
  127. </div>
  128. </span>
  129. </el-dialog>
  130. </div>
  131. <script>
  132. var app = new Vue({
  133. components: {
  134. "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue'),
  135. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  136. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  137. },
  138. el: '.vue-box',
  139. data: {
  140. value: '',
  141. currentCustomerId: '1',
  142. confirm: {
  143. visible: false,
  144. title: '',
  145. form: {
  146. ids: ''
  147. }
  148. },
  149. p: { // 查询参数
  150. adminConfirmInput: -1,
  151. customerName:'',
  152. owner:'',
  153. carNo: '', // 车牌号
  154. pageNo: 1, // 当前页
  155. pageSize: 20, // 页大小
  156. sortType: 0 // 排序方式
  157. },
  158. dataCount: 0,
  159. dataList: [], // 数据集合
  160. timmer: null,
  161. fresh: {
  162. value: 60
  163. }
  164. },
  165. methods: {
  166. stopTimmer() {
  167. if (this.timmer != null) {
  168. clearInterval(this.timmer);
  169. }
  170. },
  171. restartTimmer() {
  172. this.stopTimmer();
  173. let val = this.fresh.value;
  174. this.timmer = setInterval(() => {
  175. this.f5();
  176. }, val * 1000)
  177. },
  178. businessFn(data) {
  179. this.stopTimmer();
  180. sa.ajaxNoLoading('/TbBusinessCar/getOtherBusinessCarByBusinessId', {
  181. businessId: data.id
  182. }, function(resp) {
  183. let list = resp.data;
  184. let str = list.map(car => car.carNo).join('、');
  185. let businessCarIds = list.map(car => car.id).join(',');
  186. sa.showIframe('绑定车辆', 'tb-business-car-business.html?id=' + data.id +
  187. '&businessCarId=' + data.businessCarId + '&carNo=' + str +
  188. '&businessCarIds=' + businessCarIds, '90%', "90%");
  189. }.bind(this))
  190. },
  191. carFn(data) {
  192. this.stopTimmer();
  193. sa.showIframe('车辆管理', '../car/tb-business-car-list.html?id=' + data.id + '&payStatus=' + data
  194. .payStatus + '&confirm=' + data.adminConfirmInput, '1050px', '75%');
  195. },
  196. handlerPay(data) {
  197. this.stopTimmer();
  198. sa.showIframe('线下收费', 'tb-car-disincle-pay.html?id=' + data.id, '1050px', '95%');
  199. },
  200. getCurrendCustomer() {
  201. sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
  202. this.currentCustomerId = resp.data;
  203. }.bind(this));
  204. },
  205. // 查看
  206. get: function(data) {
  207. this.stopTimmer();
  208. sa.showIframe('数据详情', 'tb-car-disincle-info.html?id=' + data.id, '1050px', '90%');
  209. },
  210. add: function(data) {
  211. this.stopTimmer();
  212. sa.showIframe('新增数据', 'tb-car-disincle-add.html?id=-1', '1080px', '90%');
  213. },
  214. update(data) {
  215. sa.showIframe('修改数据', 'tb-car-disincle-edit.html?id=' + data.id, '1080px', '90%');
  216. },
  217. getPcodeByCurrRid() {
  218. this.stopTimmer();
  219. sa.ajax('/SpRolePermission/getPcodeByCurrRid', function(resp) {
  220. this.perCode = resp.data;
  221. }.bind(this))
  222. },
  223. confirmFn(data) {
  224. sa.ajax('/TbBusinessItem/getList', {
  225. businessId: data.id
  226. }, function(resp) {
  227. data.items = resp.data;
  228. Object.assign(this.confirm, {
  229. visible: true,
  230. title: '账单确认',
  231. form: data,
  232. })
  233. this.confirm.form.ids = data.id;
  234. }.bind(this));
  235. },
  236. checkConfirmFn(data) {
  237. sa.ajax('/TbBusinessItem/getList', {
  238. businessId: data.id
  239. }, function(resp) {
  240. data.items = resp.data;
  241. Object.assign(this.confirm, {
  242. visible: true,
  243. title: '查看账单',
  244. form: data,
  245. })
  246. }.bind(this));
  247. },
  248. // 删除
  249. del: function(data) {
  250. sa.confirm('是否删除,此操作不可撤销', function() {
  251. sa.ajax('/TbBusiness/deleteOtherBusiness?id=' + data.id + '&businessCarId=' +
  252. data.businessCarId,
  253. function(res) {
  254. sa.arrayDelete(this.dataList, data);
  255. sa.ok('删除成功');
  256. sa.f5TableHeight(); // 刷新表格高度
  257. }.bind(this))
  258. }.bind(this));
  259. },
  260. sureConfirmFn() {
  261. sa.ajax('/TbBusiness/confirm', {
  262. ids: this.confirm.form.ids
  263. }, function(resp) {
  264. this.confirm.visible = false;
  265. this.f5();
  266. }.bind(this))
  267. },
  268. // 刷新
  269. f5: function() {
  270. sa.ajaxNoLoading('/TbBusiness/getOtherBusiness', sa.removeNull(this.p), function(res) {
  271. this.dataList = res.data; // 数据
  272. this.dataCount = res.dataCount; // 数据总数
  273. sa.f5TableHeight(); // 刷新表格高度
  274. this.restartTimmer();
  275. }.bind(this));
  276. },
  277. },
  278. created: function() {
  279. sa.onInputEnter();
  280. },
  281. mounted() {
  282. this.getCurrendCustomer();
  283. this.f5();
  284. },
  285. beforeDestroy() {
  286. this.stopTimmer();
  287. }
  288. })
  289. </script>
  290. </body>
  291. </html>