tb-business-car-list.html 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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="payType">
  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 v-if="s.row.money">{{s.row.money}}</label>
  43. <label v-else>-</label>
  44. </template>
  45. </el-table-column>
  46. <sa-td name="入场时间" prop="realInTime" width=160></sa-td>
  47. <sa-td name="入场通道" prop="inChannel" width=180></sa-td>
  48. <sa-td name="离场时间" prop="realOutTime" width=160></sa-td>
  49. <sa-td name="离场通道" prop="outChannel" width=180></sa-td>
  50. <el-table-column label="操作" width="120px" fixed="right">
  51. <template slot-scope="s">
  52. <el-button v-if="sa.isAuth('tb-business-car-change')&&s.row.realInTime==null" class="c-btn"
  53. type="primary" @click="inFn(s.row)">确认入场
  54. </el-button>
  55. <el-button
  56. v-if="sa.isAuth('tb-business-car-change')&&s.row.realInTime!=null&&s.row.realOutTime==null"
  57. class="c-btn" type="primary" @click="outFn(s.row)">确认离场
  58. </el-button>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. </div>
  63. <el-dialog title="确认入场" :visible.sync="rc.visible" width="400px">
  64. <el-form label-position="left">
  65. <div class="confirm-in">
  66. <sa-item type="datetime" name="入场时间" v-model="rc.form.realInTime" br></sa-item>
  67. <div class="c-item">
  68. <label class="c-label"><span style="color: red;">*</span>入场通道:</label>
  69. <el-input v-model="rc.form.inChannel" placeholder="入场通道">
  70. </el-input>
  71. </div>
  72. </div>
  73. </el-form>
  74. <span slot="footer" class="dialog-footer">
  75. <el-button @click="rc.visible = false">取 消</el-button>
  76. <el-button type="primary" @click="sureInFn">确 认</el-button>
  77. </span>
  78. </el-dialog>
  79. <el-dialog title="确认离场" :visible.sync="out.visible" width="400px">
  80. <el-form label-position="left">
  81. <div class="confirm-in">
  82. <sa-item type="datetime" name="离场时间" v-model="out.form.realOutTime" br></sa-item>
  83. <div class="c-item">
  84. <label class="c-label"><span style="color: red;">*</span>离场通道:</label>
  85. <el-input v-model="out.form.outChannel" placeholder="离场通道">
  86. </el-input>
  87. </div>
  88. </div>
  89. </el-form>
  90. <span slot="footer" class="dialog-footer">
  91. <el-button @click="out.visible = false">取 消</el-button>
  92. <el-button type="primary" @click="sureOutFn">确 认</el-button>
  93. </span>
  94. </el-dialog>
  95. <el-dialog title="证明" :visible.sync="report.visible" width="500px">
  96. <div>
  97. <el-form>
  98. <el-row>
  99. <el-col span="12">
  100. <sa-info name="核酸报告" :value="report.business.nucleicReport" type="img"></sa-info>
  101. </el-col>
  102. <el-col span="12">
  103. <sa-info name="出仓证明" :value="report.business.outReport" type="img"></sa-info>
  104. </el-col>
  105. </el-row>
  106. <el-row style="margin-top: 20px;">
  107. <el-col span="12">
  108. <sa-info name="消杀证明" :value="report.business.disinfectReport" type="img"></sa-info>
  109. </el-col>
  110. <el-col span="12">
  111. <sa-info name="检验检疫证" :value="report.business.checkReport" type="img"></sa-info>
  112. </el-col>
  113. </el-row>
  114. </el-form>
  115. </div>
  116. </el-dialog>
  117. </div>
  118. <script>
  119. var app = new Vue({
  120. components: {
  121. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  122. "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue'),
  123. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  124. },
  125. el: '.vue-box',
  126. data: {
  127. report: {
  128. visible: false,
  129. business: {},
  130. },
  131. payStatus: sa.p('payStatus', 1),
  132. confirm: sa.p('confirm', 0),
  133. p: { // 查询参数
  134. businessId: sa.p('id', ''), //
  135. carNo: '', //
  136. },
  137. dataCount: 0,
  138. dataList: [], // 数据集合
  139. rc: {
  140. visible: false,
  141. form: {
  142. realInTime: '',
  143. inChannel: ''
  144. }
  145. },
  146. out: {
  147. visible: false,
  148. form: {
  149. realOutTime: '',
  150. outChannel: ''
  151. }
  152. }
  153. },
  154. methods: {
  155. checkFn(data) {
  156. sa.ajax('/TbBusiness/getById?id=' + this.p.businessId, function(resp) {
  157. let business = resp.data;
  158. if (!business.outReport) {
  159. //sa.error('未上传')
  160. }
  161. this.report.visible = true;
  162. this.report.business = business;
  163. }.bind(this))
  164. },
  165. inFn(data) {
  166. Object.assign(this.rc, {
  167. visible: true,
  168. form: data
  169. })
  170. },
  171. sureInFn() {
  172. if (!this.rc.form.realInTime) {
  173. sa.error('请填写入场时间')
  174. return;
  175. }
  176. if (!this.rc.form.inChannel) {
  177. sa.error('请填写入场通道')
  178. return;
  179. }
  180. sa.ajax('/TbBusinessCar/inCar', this.rc.form, function(res) {
  181. sa.alert('操作成功');
  182. this.rc.visible = false;
  183. this.f5();
  184. }.bind(this));
  185. },
  186. outFn(data) {
  187. Object.assign(this.out, {
  188. visible: true,
  189. form: data
  190. })
  191. },
  192. sureOutFn() {
  193. if (!this.out.form.realOutTime) {
  194. sa.error('请填写离场时间')
  195. return;
  196. }
  197. if (!this.out.form.outChannel) {
  198. sa.error('请填写离场通道')
  199. return;
  200. }
  201. sa.ajax('/TbBusinessCar/outCar', this.out.form, function(res) {
  202. sa.alert('操作成功');
  203. this.out.visible = false;
  204. this.f5();
  205. }.bind(this));
  206. },
  207. // 刷新
  208. f5: function() {
  209. sa.ajax('/TbBusinessCar/getBusinessByBusinessCarId', sa.removeNull(this.p), function(res) {
  210. this.dataList = res.data; // 数据
  211. this.dataCount = res.dataCount; // 数据总数
  212. sa.f5TableHeight(); // 刷新表格高度
  213. }.bind(this));
  214. },
  215. // 查看
  216. get: function(data) {
  217. sa.showIframe('数据详情', 'tb-business-car-info.html?id=' + data.id + '&businessId=' + this.p
  218. .businessId, '800px', '80%');
  219. },
  220. // 修改
  221. update: function(data) {
  222. sa.showIframe('修改数据', 'tb-business-car-add.html?id=' + data.id + '&businessId=' + this.p
  223. .businessId, '500px', '70%');
  224. },
  225. // 新增
  226. add: function(data) {
  227. sa.showIframe('新增数据', 'tb-business-car-add.html?id=-1' + '&businessId=' + this.p.businessId,
  228. '550px', '80%');
  229. },
  230. // 删除
  231. del: function(data) {
  232. sa.confirm('是否删除,此操作不可撤销', function() {
  233. sa.ajax('/TbBusinessCar/delete?id=' + data.id, function(res) {
  234. sa.arrayDelete(this.dataList, data);
  235. sa.ok('删除成功');
  236. sa.f5TableHeight(); // 刷新表格高度
  237. }.bind(this))
  238. }.bind(this));
  239. },
  240. // 改 - 状态(0=否,1=是)
  241. updateStatus: function(data) {
  242. if (!sa.isAuth('tb-business-car-change')) {
  243. sa.error('无权限')
  244. return false;
  245. }
  246. // 声明变量记录是否成功
  247. var isOk = false;
  248. var oldValue = data.isLock;
  249. var ajax = sa.ajax('/TbBusinessCar/updateStatus', {
  250. id: data.id,
  251. value: data.isLock
  252. }, function(res) {
  253. isOk = true;
  254. sa.msg('修改成功');
  255. }.bind(this));
  256. // 如果未能修改成功, 则回滚
  257. $.when(ajax).done(function() {
  258. if (isOk == false) {
  259. data.isLock = oldValue;
  260. }
  261. })
  262. },
  263. },
  264. created: function() {
  265. this.f5();
  266. sa.onInputEnter();
  267. }
  268. })
  269. </script>
  270. </body>
  271. </html>