tb-business-list.html 18 KB

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