tb-business-list.html 19 KB

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