tb-business-car-list.html 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  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. </head>
  18. <body>
  19. <div class="vue-box" style="display: none;" :style="'display: block;'">
  20. <div class="c-panel">
  21. <div class="fast-btn">
  22. <el-button size="mini" type="primary" @click="add()"
  23. v-if="confirm==0&&sa.isAuth('tb-business-edit')">
  24. 新增</el-button>
  25. <el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
  26. </div>
  27. <!-- ------------- 数据列表 ------------- -->
  28. <el-table class="data-table" ref="data-table" :data="dataList">
  29. <sa-td name="车牌号" prop="carNo" width=120></sa-td>
  30. <sa-td name="车辆规格" prop="carSize"></sa-td>
  31. <sa-td width="130" name="支付状态" prop="pay" type="enum" :jv="{0: '未支付[#ff0000]', 1: '已支付[#005500]'}">
  32. </sa-td>
  33. <sa-td width=100 name="车辆状态" prop="isLock" type="switch" :jv="{1: '锁定[#ff0000]', 0: '正常[#005500]'}"
  34. @change="s => updateStatus(s.row)"></sa-td>
  35. <el-table-column label="证明">
  36. <template slot-scope="s">
  37. <el-button type="primary" @click="checkFn(s.row)">查看</el-button>
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="预交停车费">
  41. <template slot-scope="s">
  42. <label>{{s.row.basePartMoney}}</label>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="已交费用">
  46. <template slot-scope="s">
  47. <label v-if="s.row.money">{{s.row.money}}</label>
  48. <label v-else>-</label>
  49. </template>
  50. </el-table-column>
  51. <sa-td name="联系人" prop="driverName"></sa-td>
  52. <sa-td name="联系号码" prop="driverPhone"></sa-td>
  53. <sa-td name="入场时间" prop="realInTime" width=180></sa-td>
  54. <sa-td name="离场时间" prop="realOutTime" width=180></sa-td>
  55. <el-table-column label="操作" width="200px">
  56. <template slot-scope="s">
  57. <el-button v-if="sa.isAuth('tb-business-car-change')&&s.row.realInTime==null" class="c-btn"
  58. type="primary" @click="inFn(s.row)">确认入场
  59. </el-button>
  60. <el-button
  61. v-if="sa.isAuth('tb-business-car-change')&&s.row.realInTime!=null&&s.row.realOutTime==null"
  62. class="c-btn" type="primary" @click="outFn(s.row)">确认离场
  63. </el-button>
  64. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
  65. </el-button>
  66. <el-button v-if="confirm==0&&sa.isAuth('tb-business-edit')" class="c-btn" type="primary"
  67. icon="el-icon-edit" @click="update(s.row)">修改
  68. </el-button>
  69. <el-button v-if="confirm==0&&sa.isAuth('tb-business-edit')" class="c-btn" type="danger"
  70. icon="el-icon-delete" @click="del(s.row)">删除
  71. </el-button>
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. <!-- ------------- 分页 ------------- -->
  76. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  77. </sa-item>
  78. </div>
  79. <el-dialog title="确认入场" :visible.sync="rc.visible" width="400px">
  80. <el-form label-position="left">
  81. <div class="confirm-in">
  82. <sa-item type="datetime" name="入场时间" v-model="rc.form.realInTime" br></sa-item>
  83. <div class="c-item">
  84. <label class="c-label"><span style="color: red;">*</span>入场通道:</label>
  85. <el-input v-model="rc.form.inChannel" placeholder="入场通道">
  86. </el-input>
  87. </div>
  88. </div>
  89. </el-form>
  90. <span slot="footer" class="dialog-footer">
  91. <el-button @click="rc.visible = false">取 消</el-button>
  92. <el-button type="primary" @click="sureInFn">确 认</el-button>
  93. </span>
  94. </el-dialog>
  95. <el-dialog title="确认离场" :visible.sync="out.visible" width="400px">
  96. <el-form label-position="left">
  97. <div class="confirm-in">
  98. <sa-item type="datetime" name="离场时间" v-model="out.form.realOutTime" br></sa-item>
  99. <div class="c-item">
  100. <label class="c-label"><span style="color: red;">*</span>离场通道:</label>
  101. <el-input v-model="out.form.outChannel" placeholder="离场通道">
  102. </el-input>
  103. </div>
  104. </div>
  105. </el-form>
  106. <span slot="footer" class="dialog-footer">
  107. <el-button @click="out.visible = false">取 消</el-button>
  108. <el-button type="primary" @click="sureOutFn">确 认</el-button>
  109. </span>
  110. </el-dialog>
  111. <el-dialog title="证明" :visible.sync="report.visible" width="500px">
  112. <div>
  113. <el-form >
  114. <el-row>
  115. <el-col span="12">
  116. <sa-info name="核酸报告" :value="report.business.nucleicReport" type="img"></sa-info>
  117. </el-col>
  118. <el-col span="12">
  119. <sa-info name="出仓证明" :value="report.business.outReport" type="img"></sa-info>
  120. </el-col>
  121. </el-row>
  122. <el-row style="margin-top: 20px;">
  123. <el-col span="12">
  124. <sa-info name="消杀证明" :value="report.business.disinfectReport" type="img"></sa-info>
  125. </el-col>
  126. <el-col span="12">
  127. <sa-info name="检验检疫证" :value="report.business.checkReport" type="img"></sa-info>
  128. </el-col>
  129. </el-row>
  130. </el-form>
  131. </div>
  132. </el-dialog>
  133. </div>
  134. <script>
  135. var app = new Vue({
  136. components: {
  137. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  138. "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue'),
  139. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  140. },
  141. el: '.vue-box',
  142. data: {
  143. report: {
  144. visible: false,
  145. business: {},
  146. },
  147. payStatus: sa.p('payStatus', 1),
  148. confirm: sa.p('confirm', 0),
  149. p: { // 查询参数
  150. id: '', //
  151. businessId: sa.p('id', ''), //
  152. carNo: '', //
  153. preInTime: '', //
  154. preOutTime: '', //
  155. realInTime: '', //
  156. realOutTime: '', //
  157. money: '', //
  158. driverPhone: '', //
  159. pageNo: 1, // 当前页
  160. pageSize: 10, // 页大小
  161. sortType: 0 // 排序方式
  162. },
  163. dataCount: 0,
  164. dataList: [], // 数据集合
  165. rc: {
  166. visible: false,
  167. form: {
  168. realInTime: '',
  169. inChannel: ''
  170. }
  171. },
  172. out: {
  173. visible: false,
  174. form: {
  175. realOutTime: '',
  176. outChannel: ''
  177. }
  178. }
  179. },
  180. methods: {
  181. checkFn(data) {
  182. sa.ajax('/TbBusiness/getById?id=' + data.businessId, function(resp) {
  183. let business=resp.data;
  184. if(!business.outReport){
  185. //sa.error('未上传')
  186. }
  187. this.report.visible=true;
  188. this.report.business=business;
  189. }.bind(this))
  190. },
  191. inFn(data) {
  192. Object.assign(this.rc, {
  193. visible: true,
  194. form: data
  195. })
  196. },
  197. sureInFn() {
  198. if (!this.rc.form.realInTime) {
  199. sa.error('请填写入场时间')
  200. return;
  201. }
  202. if (!this.rc.form.inChannel) {
  203. sa.error('请填写入场通道')
  204. return;
  205. }
  206. sa.ajax('/TbBusinessCar/update', this.rc.form, function(res) {
  207. sa.alert('操作成功');
  208. this.rc.visible = false;
  209. this.f5();
  210. }.bind(this));
  211. },
  212. outFn(data) {
  213. Object.assign(this.out, {
  214. visible: true,
  215. form: data
  216. })
  217. },
  218. sureOutFn() {
  219. if (!this.out.form.realOutTime) {
  220. sa.error('请填写离场时间')
  221. return;
  222. }
  223. if (!this.out.form.outChannel) {
  224. sa.error('请填写离场通道')
  225. return;
  226. }
  227. sa.ajax('/TbBusinessCar/update', this.out.form, function(res) {
  228. sa.alert('操作成功');
  229. this.out.visible = false;
  230. this.f5();
  231. }.bind(this));
  232. },
  233. // 刷新
  234. f5: function() {
  235. sa.ajax('/TbBusinessCar/getList', sa.removeNull(this.p), function(res) {
  236. this.dataList = res.data; // 数据
  237. this.dataCount = res.dataCount; // 数据总数
  238. sa.f5TableHeight(); // 刷新表格高度
  239. }.bind(this));
  240. },
  241. // 查看
  242. get: function(data) {
  243. sa.showIframe('数据详情', 'tb-business-car-info.html?id=' + data.id + '&businessId=' + this.p
  244. .businessId, '800px', '80%');
  245. },
  246. // 修改
  247. update: function(data) {
  248. sa.showIframe('修改数据', 'tb-business-car-add.html?id=' + data.id + '&businessId=' + this.p
  249. .businessId, '500px', '70%');
  250. },
  251. // 新增
  252. add: function(data) {
  253. sa.showIframe('新增数据', 'tb-business-car-add.html?id=-1' + '&businessId=' + this.p.businessId,
  254. '550px', '80%');
  255. },
  256. // 删除
  257. del: function(data) {
  258. sa.confirm('是否删除,此操作不可撤销', function() {
  259. sa.ajax('/TbBusinessCar/delete?id=' + data.id, function(res) {
  260. sa.arrayDelete(this.dataList, data);
  261. sa.ok('删除成功');
  262. sa.f5TableHeight(); // 刷新表格高度
  263. }.bind(this))
  264. }.bind(this));
  265. },
  266. // 改 - 状态(0=否,1=是)
  267. updateStatus: function(data) {
  268. if (!sa.isAuth('tb-business-car-change')) {
  269. sa.error('无权限')
  270. return false;
  271. }
  272. // 声明变量记录是否成功
  273. var isOk = false;
  274. var oldValue = data.isLock;
  275. var ajax = sa.ajax('/TbBusinessCar/updateStatus', {
  276. id: data.id,
  277. value: data.isLock
  278. }, function(res) {
  279. isOk = true;
  280. sa.msg('修改成功');
  281. }.bind(this));
  282. // 如果未能修改成功, 则回滚
  283. $.when(ajax).done(function() {
  284. if (isOk == false) {
  285. data.isLock = oldValue;
  286. }
  287. })
  288. },
  289. },
  290. created: function() {
  291. this.f5();
  292. sa.onInputEnter();
  293. }
  294. })
  295. </script>
  296. </body>
  297. </html>