tb-business-car-list.html 11 KB

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