tb-business-list.html 18 KB

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