tb-business-list.html 18 KB

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