tb-business-list.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>入境登记-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <!-- 所有的 css & js 资源 -->
  8. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  9. <link rel="stylesheet" href="../../static/sa.css">
  10. <script src="../../static/kj/vue.min.js"></script>
  11. <script src="../../static/kj/element-ui/index.js"></script>
  12. <script src="../../static/kj/httpVueLoader.js"></script>
  13. <script src="../../static/kj/jquery.min.js"></script>
  14. <script src="../../static/kj/layer/layer.js"></script>
  15. <script src="../../static/sa.js"></script>
  16. <script src="../../static/kj/upload-util.js"></script>
  17. </head>
  18. <body>
  19. <div class="vue-box" style="display: none;" :style="'display: block;'">
  20. <div class="c-panel">
  21. <!-- ------------- 检索参数 ------------- -->
  22. <div class="c-title">检索参数</div>
  23. <el-form ref="form" :model='p' @submit.native.prevent>
  24. <sa-item type="text" name="客户名称" v-model="p.customerName"></sa-item>
  25. <sa-item type="text" name="车牌号" v-model="p.cardNo"></sa-item>
  26. <sa-item type="text" name="司机名称" v-model="p.driverName"></sa-item>
  27. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  28. <br />
  29. </el-form>
  30. <!-- ------------- 快捷按钮 ------------- -->
  31. <div class="fast-btn">
  32. <el-button size="mini" type="primary" v-if="perCode.indexOf('tb-business-add')!=-1||adminId=='1'" @click="add()">新增</el-button>
  33. <el-button size="mini" type="primary" v-if="perCode.indexOf('tb-business-confirm')!=-1||adminId=='1'" @click="confirmBatch()">确认</el-button>
  34. <el-button size="mini" type="success" @click="getBySelect()">查看</el-button>
  35. <el-button size="mini" type="danger" @click="deleteByIds()">删除</el-button>
  36. <!-- <el-button size="mini" type="warning" icon="el-icon-download" @click="sa.exportExcel()">导出</el-button> -->
  37. <el-button size="mini" type="info" @click="sa.f5()">重置</el-button>
  38. </div>
  39. <!-- ------------- 数据列表 ------------- -->
  40. <el-table class="data-table" ref="data-table" :data="dataList" >
  41. <sa-td type="selection"></sa-td>
  42. <sa-td name="客户名称" prop="customerName" ></sa-td>
  43. <sa-td name="车牌号" prop="cardNo" ></sa-td>
  44. <sa-td name="载重" prop="netWeight" ></sa-td>
  45. <sa-td name="司机名称" prop="driverName" ></sa-td>
  46. <sa-td name="司机联系" prop="driverPhone" ></sa-td>
  47. <sa-td name="支付凭证" prop="payTicket" type="img-list"></sa-td>
  48. <sa-td name="业务费(元)" prop="itemPrice" ></sa-td>
  49. <sa-td width="120" name="停车时长(分)" prop="partTime" ></sa-td>
  50. <sa-td name="停车费用" prop="partMoney" ></sa-td>
  51. <sa-td width="130" name="支付状态" prop="payStatus" type="enum" :jv="{1: '未支付[#ff0000]', 2: '已支付未确认[#ffaa00]', 3: '已支付已确认[#005500]'}"></sa-td>
  52. <sa-td width="160" name="支付时间" prop="payTime" ></sa-td>
  53. <sa-td width="160" name="录入时间" prop="createTime" ></sa-td>
  54. <sa-td name="确认" prop="confirmInput" type="enum" :jv="{0: '未确认[#ff0000]', 1: '已确认[#005500]'}"></sa-td>
  55. <el-table-column label="操作" fixed="right" width="240px">
  56. <template slot-scope="s">
  57. <el-button class="c-btn" type="primary" v-if="s.row.confirmInput==0&&(perCode.indexOf('tb-business-confirm')!=-1||adminId=='1')" @click="confirmFn(s.row)">确认</el-button>
  58. <el-button class="c-btn" type="success" v-if="s.row.confirmInput==1&&(perCode.indexOf('tb-business-pay')!=-1||(adminId=='1'&&s.row.payStatus==1))" @click="payFn(s.row)">支付</el-button>
  59. <el-button class="c-btn" type="success" v-if="adminId=='1'&&s.row.payStatus==2" @click="adminSurePayFn(s.row)">确认支付</el-button>
  60. <el-button class="c-btn" type="success" @click="get(s.row)">查看</el-button>
  61. <el-button class="c-btn" type="primary" v-if="s.row.confirmInput==0" @click="update(s.row)">修改</el-button>
  62. <el-button class="c-btn" type="danger" v-if="s.row.payStatus==1" @click="del(s.row)">删除</el-button>
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. <!-- ------------- 分页 ------------- -->
  67. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  68. </div>
  69. <el-dialog
  70. title="支付业务"
  71. :visible.sync="modal.visible"
  72. width="400px">
  73. <sa-item type="img-list" name="支付凭据" v-model="modal.form.payTicket" br></sa-item>
  74. <span slot="footer" class="dialog-footer">
  75. <el-button @click="modal.visible=false">取 消</el-button>
  76. <el-button type="primary" @click="surePayFn">确 定</el-button>
  77. </span>
  78. </el-dialog>
  79. <el-dialog
  80. title="业务确认"
  81. :visible.sync="confirm.visible"
  82. width="30%">
  83. <span>是否确认所选业务?</span>
  84. <span slot="footer" class="dialog-footer">
  85. <el-button @click="confirm.visible = false">取 消</el-button>
  86. <el-button type="primary" @click="sureConfirmFn">确 认</el-button>
  87. </span>
  88. </el-dialog>
  89. <el-dialog
  90. title="支付确认"
  91. :visible.sync="pay.visible"
  92. width="30%">
  93. <span>是否确认所选业务的支付?</span>
  94. <span slot="footer" class="dialog-footer">
  95. <el-button @click="pay.visible = false">取 消</el-button>
  96. <el-button type="primary" @click="surePayirmFn">确 认</el-button>
  97. </span>
  98. </el-dialog>
  99. </div>
  100. <script>
  101. var app = new Vue({
  102. components: {
  103. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  104. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  105. },
  106. el: '.vue-box',
  107. data: {
  108. confirm:{
  109. visible:false,
  110. form:{
  111. ids:''
  112. }
  113. },
  114. pay:{
  115. visible:false,
  116. form:{
  117. ids:''
  118. }
  119. },
  120. modal:{
  121. visible:false,
  122. form:{
  123. id:'',
  124. payTicket:''
  125. }
  126. },
  127. p: { // 查询参数
  128. id: '', // 主键
  129. customerId: '', // 客户id
  130. customerName: '', // 客户名称
  131. no: '', // 编号
  132. cardNo: '', // 车牌号
  133. cardSize: '', // 车规格
  134. netWeight: '', // 载重(kg)
  135. goodsName: '', // 商品
  136. goodsCode: '', // 商品编号
  137. driverName: '', // 司机名称
  138. driverId: '', // 司机id
  139. driverPhone: '', // 司机联系号码
  140. driverIdCard: '', // 司机身份证
  141. expectInDay: '', // 预计进边境日期
  142. realInDay: '', // 实际进边境日期
  143. realInTime: '', // 实际进境时间
  144. payStatus: '', // 支付状态(1=未支付,2=已支付)
  145. payTime: '', // 支付时间
  146. payType: '', // 支付方式(1=线下支付,2现金支付,3=第三方支付)
  147. outDayTime: '', // 离境时间
  148. partMoney: '', // 停车费用
  149. partTime: '', // 停车时常(分)
  150. pageNo: 1, // 当前页
  151. pageSize: 10, // 页大小
  152. sortType: 0 // 排序方式
  153. },
  154. dataCount: 0,
  155. dataList: [], // 数据集合
  156. perCode:[],
  157. adminId:'0'
  158. },
  159. methods: {
  160. adminSurePayFn(data){
  161. Object.assign(this.pay,{
  162. visible:true,
  163. form:{
  164. ids:data.id
  165. }
  166. })
  167. },
  168. surePayirmFn (){
  169. sa.ajax('/TbBusiness/adminConfirmPay',this.pay.form,function(resp){
  170. this.pay.visible=false;
  171. this.f5();
  172. })
  173. },
  174. confirmBatch(){
  175. // 获取选中元素的id列表
  176. let selection = this.$refs['data-table'].selection;
  177. selection=selection.filter(obj=>obj.confirmInput==0)
  178. let ids = sa.getArrayField(selection, 'id');
  179. if(selection.length == 0) {
  180. return sa.msg('至少选择一条未确认数据')
  181. }
  182. },
  183. getCustomer(){
  184. sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
  185. let id=resp.data;
  186. if(id!=='1'){
  187. this.getPcodeByCurrRid();
  188. }
  189. this.adminId=id;
  190. }.bind(this));
  191. },
  192. getPcodeByCurrRid(){
  193. sa.ajax('/SpRolePermission/getPcodeByCurrRid',function(resp){
  194. this.perCode=resp.data;
  195. }.bind(this))
  196. },
  197. confirmFn(data){
  198. Object.assign(this.confirm,{
  199. visible:true,
  200. form:{
  201. ids:data.id
  202. }
  203. })
  204. },
  205. sureConfirmFn(){
  206. sa.ajax('/TbBusiness/confirm',{ids:this.confirm.form.ids},function(resp){
  207. this.confirm.visible=false;
  208. this.f5();
  209. }.bind(this))
  210. },
  211. payFn(data){
  212. Object.assign(this.modal,{
  213. visible:true,
  214. form:{
  215. id:data.id,
  216. payTicket:data.payTicket
  217. }
  218. })
  219. },
  220. surePayFn(){
  221. sa.ajax('/TbBusiness/pay',this.modal.form,function(resp){
  222. this.f5();
  223. this.modal.visible=false;
  224. }.bind(this))
  225. },
  226. // 刷新
  227. f5: function() {
  228. sa.ajax('/TbBusiness/getList', sa.removeNull(this.p), function(res) {
  229. this.dataList = res.data; // 数据
  230. this.dataCount = res.dataCount; // 数据总数
  231. sa.f5TableHeight(); // 刷新表格高度
  232. }.bind(this));
  233. },
  234. // 查看
  235. get: function(data) {
  236. sa.showIframe('数据详情', 'tb-business-info.html?id=' + data.id, '1050px', '90%');
  237. },
  238. // 查看 - 根据选中的
  239. getBySelect: function(data) {
  240. var selection = this.$refs['data-table'].selection;
  241. if(selection.length == 0) {
  242. return sa.msg('请选择一条数据')
  243. }
  244. this.get(selection[0]);
  245. },
  246. // 修改
  247. update: function(data) {
  248. sa.showIframe('修改数据', 'tb-business-add.html?id=' + data.id, '1000px', '90%');
  249. },
  250. // 新增
  251. add: function(data) {
  252. sa.showIframe('新增数据', 'tb-business-add.html?id=-1', '1000px', '90%');
  253. },
  254. // 删除
  255. del: function(data) {
  256. sa.confirm('是否删除,此操作不可撤销', function() {
  257. sa.ajax('/TbBusiness/delete?id=' + data.id, function(res) {
  258. sa.arrayDelete(this.dataList, data);
  259. sa.ok('删除成功');
  260. sa.f5TableHeight(); // 刷新表格高度
  261. }.bind(this))
  262. }.bind(this));
  263. },
  264. // 批量删除
  265. deleteByIds: function() {
  266. // 获取选中元素的id列表
  267. let selection = this.$refs['data-table'].selection;
  268. let ids = sa.getArrayField(selection, 'id');
  269. if(selection.length == 0) {
  270. return sa.msg('请至少选择一条数据')
  271. }
  272. // 提交删除
  273. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  274. sa.ajax('/TbBusiness/deleteByIds', {ids: ids.join(',')}, function(res) {
  275. sa.arrayDelete(this.dataList, selection);
  276. sa.ok('删除成功');
  277. sa.f5TableHeight(); // 刷新表格高度
  278. }.bind(this))
  279. }.bind(this));
  280. },
  281. },
  282. created: function() {
  283. this.f5();
  284. sa.onInputEnter();
  285. this.getCustomer();
  286. }
  287. })
  288. </script>
  289. </body>
  290. </html>