tb-business-list.html 15 KB

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