tb-business-list.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  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: 200px;
  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.customerName"></sa-item>
  43. <sa-item type="text" name="车牌号" placeholder="越南车牌" v-model="p.cardNo"></sa-item>
  44. <sa-item type="text" name="司机名称" placeholder="越南司机" v-model="p.driverName"></sa-item>
  45. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  46. <br />
  47. </el-form>
  48. <!-- ------------- 快捷按钮 ------------- -->
  49. <div class="fast-btn">
  50. <el-button size="mini" type="primary" v-if="perCode.indexOf('tb-business-add')!=-1" @click="add()">
  51. 新增</el-button>
  52. <!-- <el-button size="mini" type="primary" v-if="perCode.indexOf('tb-business-confirm')!=-1"
  53. @click="confirmBatch()">确认</el-button> -->
  54. <el-button size="mini" type="success" @click="getBySelect()">查看</el-button>
  55. <!-- <el-button size="mini" type="danger" @click="deleteByIds()">删除</el-button> -->
  56. <!-- <el-button size="mini" type="warning" icon="el-icon-download" @click="sa.exportExcel()">导出</el-button> -->
  57. <el-button size="mini" type="info" @click="sa.f5()">重置</el-button>
  58. </div>
  59. <!-- ------------- 数据列表 ------------- -->
  60. <el-table class="data-table" ref="data-table" :data="dataList">
  61. <sa-td type="selection"></sa-td>
  62. <sa-td name="客户名称" width="150" prop="customerName"></sa-td>
  63. <sa-td name="业务单号" prop="no" width="160"></sa-td>
  64. <sa-td name="境外车牌号" width="130" prop="cardNo"></sa-td>
  65. <sa-td name="载重(吨)" prop="netWeight"></sa-td>
  66. <sa-td name="总用费(元)" prop="totalMoney"></sa-td>
  67. <sa-td name="已支付用费(元)" prop="payMoney"></sa-td>
  68. <sa-td width="160" name="录入时间" prop="createTime"></sa-td>
  69. </sa-td>
  70. <el-table-column label="操作" width="240px" fixed="right">
  71. <template slot-scope="s">
  72. <el-button class="c-btn" type="primary" v-if="(s.row.confirmInput==0)
  73. &&s.row.payStatus==1
  74. &&s.row.complete==1
  75. &&perCode.indexOf('tb-business-confirm')!=-1
  76. &&currentCustomerId!='1'" @click="confirmFn(s.row)">确认账单</el-button>
  77. <el-button class="c-btn" type="success" v-if="perCode.indexOf('tb-business-pay')!=-1
  78. &&s.row.payStatus==1&&s.row.confirmInput==1&&currentCustomerId!='1'" @click="payFn(s.row)">
  79. 马上支付</el-button>
  80. <el-button class="c-btn" type="primary" @click="itemFn(s.row)">业务项</el-button>
  81. <el-button class="c-btn" type="primary" @click="carFn(s.row)">车辆管理
  82. </el-button>
  83. <el-button class="c-btn" type="success" @click="get(s.row)">查看</el-button>
  84. <el-button class="c-btn" type="primary" v-if="s.row.confirmInput==0" @click="update(s.row)">
  85. 修改</el-button>
  86. <el-button class="c-btn" type="danger" v-if="s.row.payStatus==1&&perCode.indexOf('tb-business-add')!=-1" @click="del(s.row)">删除
  87. </el-button>
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. <!-- ------------- 分页 ------------- -->
  92. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  93. </sa-item>
  94. </div>
  95. <el-dialog title="支付业务" :visible.sync="modal.visible" width="400px">
  96. <sa-info name="业务单号" br>{{modal.form.no}}</sa-info>
  97. <sa-info name="总计费用" br>{{modal.form.totalMoney}}元</sa-info>
  98. <sa-item type="img-list" name="支付凭据" v-model="modal.form.payTicket" br></sa-item>
  99. <span slot="footer" class="dialog-footer">
  100. <el-button @click="modal.visible=false">取 消</el-button>
  101. <el-button type="primary" @click="surePayFn">确 定</el-button>
  102. </span>
  103. </el-dialog>
  104. <el-dialog title="确认账单" :visible.sync="confirm.visible" width="400px">
  105. <div class="confirm-info">
  106. <sa-info name="订单号" br>{{confirm.form.no}}</sa-info>
  107. <sa-info :name="item.itemTypeName" br v-for="item in confirm.form.items">
  108. {{item.itemPrice}}x{{item.num}}={{item.total}}元
  109. </sa-info>
  110. <sa-info name="业务费用" br>{{confirm.form.itemPrice}}(元)</sa-info>
  111. <sa-info name="停车费用" br>{{confirm.form.partMoney+confirm.form.chinaPartMoney}}(元)</sa-info>
  112. <sa-info name="合计费用" br>{{confirm.form.totalMoney}}(元)</sa-info>
  113. </div>
  114. <span slot="footer" class="dialog-footer">
  115. <el-button @click="confirm.visible = false">取 消</el-button>
  116. <el-button type="primary" @click="sureConfirmFn">确 认</el-button>
  117. </span>
  118. </el-dialog>
  119. <el-dialog title="生成账单" :visible.sync="complete.visible" width="600px">
  120. <div class="complete-modal">
  121. <sa-info name="客户名称" br>{{complete.form.customerName}}</sa-info>
  122. <sa-info name="业务单号" br>{{complete.form.no}}</sa-info>
  123. <sa-info name="业务费用(元)" br>{{complete.form.itemPrice}}</sa-info>
  124. <sa-info name="境外车入场时间" br>{{complete.form.realInTime}}</sa-info>
  125. <sa-item type="datetime" @input="jwCaroTimeChange" name="境外车预计离场" v-model="complete.form.outDayTime"
  126. br></sa-item>
  127. <sa-info name="停车费用(元)" br>{{complete.form.partMoney}}</sa-info>
  128. <sa-info name="中国车入场时间" br>{{complete.form.realInTime}}</sa-info>
  129. <sa-item type="datetime" @input="chinaCaroTimeChange" name="中国车预计离场"
  130. v-model="complete.form.chinaCarOutTime" br></sa-item>
  131. <sa-info name="停车费用(元)" br>{{complete.form.chinaPartMoney}}</sa-info>
  132. <sa-info name="总计费用" br>{{complete.form.totalMoney}}元</sa-info>
  133. </div>
  134. <span slot="footer" class="dialog-footer">
  135. <el-button @click="complete.visible = false">取 消</el-button>
  136. <el-button type="primary" @click="sureCompleteFn">确 认</el-button>
  137. </span>
  138. </el-dialog>
  139. <el-dialog title="支付确认" :visible.sync="pay.visible" width="400px">
  140. <sa-info name="业务单号" br>{{pay.form.no}}</sa-info>
  141. <sa-info name="总计费用" br>{{pay.form.totalMoney}}元</sa-info>
  142. <sa-item type="img-list" name="支付凭据" v-model="pay.form.payTicket" br></sa-item>
  143. <span slot="footer" class="dialog-footer">
  144. <el-button @click="pay.visible = false">取 消</el-button>
  145. <el-button type="primary" @click="surePayirmFn">确 认</el-button>
  146. </span>
  147. </el-dialog>
  148. <el-dialog title="确认入场" :visible.sync="rc.visible" width="600px">
  149. <el-form label-position="left">
  150. <div class="confirm-in">
  151. <sa-item type="datetime" name="境外车入场时间" v-model="rc.form.realInTime" br></sa-item>
  152. <sa-item type="datetime" name="中国车入场时间" v-model="rc.form.chinaCarInTime" br></sa-item>
  153. </div>
  154. </el-form>
  155. <span slot="footer" class="dialog-footer">
  156. <el-button @click="rc.visible = false">取 消</el-button>
  157. <el-button type="primary" @click="sureRcFn">确 认</el-button>
  158. </span>
  159. </el-dialog>
  160. <el-dialog title="确认离场" :visible.sync="out.visible" width="600px">
  161. <el-form label-position="left">
  162. <div class="confirm-in">
  163. <sa-item type="datetime" name="境外车离场" v-model="out.form.outDayTime" br></sa-item>
  164. <sa-item type="datetime" name="中国车离场" v-model="out.form.chinaCarOutTime" br></sa-item>
  165. </div>
  166. </el-form>
  167. <span slot="footer" class="dialog-footer">
  168. <el-button @click="out.visible = false">取 消</el-button>
  169. <el-button type="primary" @click="sureOutFn">确 认</el-button>
  170. </span>
  171. </el-dialog>
  172. </div>
  173. <script>
  174. var app = new Vue({
  175. components: {
  176. "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue'),
  177. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  178. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  179. },
  180. el: '.vue-box',
  181. data: {
  182. value: '',
  183. currentCustomerId: '1',
  184. confirm: {
  185. visible: false,
  186. form: {
  187. ids: ''
  188. }
  189. },
  190. pay: {
  191. visible: false,
  192. form: {
  193. ids: ''
  194. }
  195. },
  196. modal: {
  197. visible: false,
  198. form: {
  199. id: '',
  200. payTicket: ''
  201. }
  202. },
  203. p: { // 查询参数
  204. id: '', // 主键
  205. customerId: '', // 客户id
  206. customerName: '', // 客户名称
  207. no: '', // 编号
  208. cardNo: '', // 车牌号
  209. cardSize: '', // 车规格
  210. netWeight: '', // 载重(kg)
  211. goodsName: '', // 商品
  212. goodsCode: '', // 商品编号
  213. driverName: '', // 司机名称
  214. driverId: '', // 司机id
  215. driverPhone: '', // 司机联系号码
  216. driverIdCard: '', // 司机身份证
  217. expectInDay: '', // 预计进边境日期
  218. realInDay: '', // 实际进边境日期
  219. realInTime: '', // 实际进境时间
  220. payStatus: '', // 支付状态(1=未支付,2=已支付)
  221. payTime: '', // 支付时间
  222. payType: '', // 支付方式(1=线下支付,2现金支付,3=第三方支付)
  223. outDayTime: '', // 离境时间
  224. partMoney: '', // 停车费用
  225. partTime: '', // 停车时常(分)
  226. pageNo: 1, // 当前页
  227. pageSize: 10, // 页大小
  228. sortType: 0 // 排序方式
  229. },
  230. dataCount: 0,
  231. dataList: [], // 数据集合
  232. perCode: [],
  233. adminId: '0',
  234. rc: {
  235. visible: false,
  236. form: {
  237. inChannel: '',
  238. realInTime: '',
  239. carType: '境外车'
  240. }
  241. },
  242. out: {
  243. visible: false,
  244. form: {
  245. outChannel: '',
  246. realInTime: '',
  247. carType: '境外车'
  248. }
  249. },
  250. complete: {
  251. visible: false,
  252. form: {
  253. id: '',
  254. no: ''
  255. }
  256. },
  257. timmer: null,
  258. fresh: {
  259. value: 60
  260. }
  261. },
  262. methods: {
  263. itemFn(data) {
  264. sa.showIframe('业务项', 'tb-business-item-list.html?businessId=' + data.id, '1050px', '95%');
  265. },
  266. carFn(data) {
  267. sa.showIframe('车辆管理', '../car/tb-business-car-list.html?id=' + data.id+'&payStatus='+data.payStatus, '1050px', '95%');
  268. },
  269. blurFn() {
  270. console.log(123)
  271. },
  272. stopTimmer() {
  273. if (this.timmer != null) {
  274. clearInterval(this.timmer);
  275. }
  276. },
  277. restartTimmer() {
  278. this.stopTimmer();
  279. let val = this.fresh.value;
  280. this.timmer = setInterval(() => {
  281. this.f5();
  282. }, val * 1000)
  283. },
  284. jwCaroTimeChange(oTime) {
  285. if (oTime) {
  286. let o = Object.assign(this.complete.form);
  287. o.items = [];
  288. sa.ajaxNoLoading('/TbBusiness/calJwPartMoney', sa.removeNull(o), function(resp) {
  289. this.complete.form = resp.data;
  290. }.bind(this))
  291. }
  292. },
  293. chinaCaroTimeChange(oTime) {
  294. if (oTime) {
  295. let o = Object.assign(this.complete.form);
  296. o.items = [];
  297. sa.ajaxNoLoading('/TbBusiness/calChinaPartMoney', sa.removeNull(o), function(resp) {
  298. this.complete.form = resp.data;
  299. }.bind(this))
  300. }
  301. },
  302. completeFn(data) {
  303. Object.assign(this.complete, {
  304. visible: true,
  305. form: data
  306. })
  307. this.stopTimmer();
  308. },
  309. sureCompleteFn() {
  310. this.complete.form.items = null;
  311. sa.ajax('/TbBusiness/complete', sa.removeNull(this.complete.form), function(resp) {
  312. this.complete.visible = false;
  313. this.f5();
  314. this.restartTimmer();
  315. }.bind(this))
  316. },
  317. inFn(data) {
  318. Object.assign(this.rc, {
  319. visible: true,
  320. form: {
  321. id: data.id,
  322. realInTime: data.realInTime,
  323. chinaCarInTime: data.chinaCarInTime
  324. }
  325. })
  326. this.stopTimmer()
  327. },
  328. sureRcFn() {
  329. if (!this.rc.form.realInTime) {
  330. sa.error('请选择境外车入场时间')
  331. return;
  332. }
  333. if (!this.rc.form.chinaCarInTime) {
  334. sa.error('请选择中国车入场时间')
  335. return;
  336. }
  337. sa.ajax('/TbBusiness/adminSetIn', sa.removeNull(this.rc.form), function(resp) {
  338. this.f5();
  339. this.rc.visible = false;
  340. this.restartTimmer();
  341. }.bind(this))
  342. },
  343. outFn(data) {
  344. Object.assign(this.out, {
  345. visible: true,
  346. form: {
  347. id: data.id,
  348. outDayTime: '',
  349. chinaCarOutTime: ''
  350. }
  351. })
  352. this.stopTimmer()
  353. },
  354. sureOutFn() {
  355. if (!this.out.form.outDayTime) {
  356. sa.error('选择境外车离场时间')
  357. return;
  358. }
  359. if (!this.out.form.chinaCarOutTime) {
  360. sa.error('选择中国车离场时间')
  361. return;
  362. }
  363. sa.ajax('/TbBusiness/adminOut', this.out.form, function(resp) {
  364. this.f5();
  365. this.out.visible = false;
  366. this.restartTimmer();
  367. }.bind(this))
  368. },
  369. getCurrendCustomer() {
  370. sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
  371. this.currentCustomerId = resp.data;
  372. }.bind(this));
  373. },
  374. adminSurePayFn(data) {
  375. Object.assign(this.pay, {
  376. visible: true,
  377. form: data
  378. })
  379. this.pay.form.ids = data.id;
  380. this.stopTimmer()
  381. },
  382. surePayirmFn() {
  383. sa.ajax('/TbBusiness/adminConfirmPay', this.pay.form, function(resp) {
  384. this.pay.visible = false;
  385. this.f5();
  386. this.restartTimmer();
  387. }.bind(this))
  388. },
  389. confirmBatch() {
  390. // 获取选中元素的id列表
  391. let selection = this.$refs['data-table'].selection;
  392. selection = selection.filter(obj => obj.confirmInput == 0)
  393. let ids = sa.getArrayField(selection, 'id');
  394. if (selection.length == 0) {
  395. return sa.msg('至少选择一条未确认数据')
  396. }
  397. },
  398. getPcodeByCurrRid() {
  399. sa.ajax('/SpRolePermission/getPcodeByCurrRid', function(resp) {
  400. this.perCode = resp.data;
  401. }.bind(this))
  402. },
  403. confirmFn(data) {
  404. sa.ajax('/TbBusinessItem/getList', {
  405. businessId: data.id
  406. }, function(resp) {
  407. data.items = resp.data;
  408. Object.assign(this.confirm, {
  409. visible: true,
  410. form: data,
  411. })
  412. this.confirm.form.ids = data.id;
  413. this.stopTimmer();
  414. }.bind(this));
  415. },
  416. sureConfirmFn() {
  417. sa.ajax('/TbBusiness/confirm', {
  418. ids: this.confirm.form.ids
  419. }, function(resp) {
  420. this.confirm.visible = false;
  421. this.f5();
  422. this.restartTimmer();
  423. }.bind(this))
  424. },
  425. payFn(data) {
  426. Object.assign(this.modal, {
  427. visible: true,
  428. form: data
  429. })
  430. this.stopTimmer();
  431. },
  432. surePayFn() {
  433. sa.ajax('/TbBusiness/pay', this.modal.form, function(resp) {
  434. this.f5();
  435. this.modal.visible = false;
  436. this.restartTimmer();
  437. }.bind(this))
  438. },
  439. // 刷新
  440. f5: function() {
  441. sa.ajaxNoLoading('/TbBusiness/getList', sa.removeNull(this.p), function(res) {
  442. this.dataList = res.data; // 数据
  443. this.dataCount = res.dataCount; // 数据总数
  444. sa.f5TableHeight(); // 刷新表格高度
  445. this.restartTimmer();
  446. }.bind(this));
  447. },
  448. // 查看
  449. get: function(data) {
  450. sa.showIframe('数据详情', 'tb-business-info.html?id=' + data.id, '1050px', '90%');
  451. },
  452. // 查看 - 根据选中的
  453. getBySelect: function(data) {
  454. var selection = this.$refs['data-table'].selection;
  455. if (selection.length == 0) {
  456. return sa.msg('请选择一条数据')
  457. }
  458. this.get(selection[0]);
  459. },
  460. // 修改
  461. update: function(data) {
  462. this.stopTimmer();
  463. sa.showIframe('修改数据', 'tb-business-edit.html?id=' + data.id, '1000px', '90%');
  464. },
  465. // 新增
  466. add: function(data) {
  467. this.stopTimmer();
  468. sa.showIframe('新增数据', 'tb-business-add.html?id=-1', '1080px', '90%');
  469. },
  470. // 删除
  471. del: function(data) {
  472. sa.confirm('是否删除,此操作不可撤销', function() {
  473. sa.ajax('/TbBusiness/delete?id=' + data.id, function(res) {
  474. sa.arrayDelete(this.dataList, data);
  475. sa.ok('删除成功');
  476. sa.f5TableHeight(); // 刷新表格高度
  477. }.bind(this))
  478. }.bind(this));
  479. },
  480. },
  481. created: function() {
  482. sa.onInputEnter();
  483. this.getCurrendCustomer();
  484. this.getPcodeByCurrRid();
  485. },
  486. mounted() {
  487. this.f5();
  488. },
  489. beforeDestroy() {
  490. this.stopTimmer();
  491. }
  492. })
  493. </script>
  494. </body>
  495. </html>