tb-car-disincle-list.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  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. <style>
  20. .complete-modal .c-label,
  21. .confirm-in .c-label,
  22. .confirm-info .c-label {
  23. width: 290px;
  24. }
  25. </style>
  26. <body>
  27. <div class="vue-box" style="display: none;" :style="'display: block;'">
  28. <div class="c-panel">
  29. <div style="float: right;right: 20px;margin-top: 10px;">
  30. <label>刷新频率:</label>
  31. <el-select v-model="fresh.value" placeholder="请选择" @change="restartTimmer">
  32. <el-option label="10s" :value="10"></el-option>
  33. <el-option label="20s" :value="20"></el-option>
  34. <el-option label="30s" :value="30"></el-option>
  35. <el-option label="50s" :value="50"></el-option>
  36. <el-option label="60s" :value="60"></el-option>
  37. </el-select>
  38. </div>
  39. <!-- ------------- 检索参数 ------------- -->
  40. <div class="c-title">检索参数</div>
  41. <el-form ref="form" :model='p' @submit.native.prevent>
  42. <sa-item type="text" name="业务单号" placeholder="业务单号" v-model="p.no"></sa-item>
  43. <sa-item type="text" name="车牌号" placeholder="车牌号" v-model="p.carNo"></sa-item>
  44. <sa-item type="text" name="客户" placeholder="客户" v-model="p.customerName"></sa-item>
  45. <div class="c-item">
  46. <label class="c-label">确认状态:</label>
  47. <el-select v-model="p.adminConfirmInput" placeholder="请选择" @change="f5()">
  48. <el-option label="全部" :value="-1"></el-option>
  49. <el-option label="已确认" :value="1"></el-option>
  50. <el-option label="未确认" :value="0"></el-option>
  51. </el-select>
  52. </div>
  53. <div class="c-item">
  54. <label class="c-label">业务项:</label>
  55. <el-select v-model="p.goodsId">
  56. <el-option v-for="good in goodsList" :key="good.id" :label="good.name" :value="good.id">
  57. </el-option>
  58. </el-select>
  59. </div>
  60. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  61. <el-button type="info" icon="el-icon-search"
  62. @click="p.carNo = '';p.adminConfirmInput=-1;p.customerName='';p.owner='';p.no=''; f5()">重置
  63. </el-button>
  64. <el-button v-if="sa.isAuth('tb-flex-business-add')" size="mini" type="primary" @click="add()">
  65. 新增
  66. </el-button>
  67. <br />
  68. </el-form>
  69. <!-- ------------- 数据列表 ------------- -->
  70. <el-table class="data-table" ref="data-table" :data="dataList" style="margin-top: 20px;">
  71. <el-table-column type="index" width="50"></el-table-column>
  72. <sa-td name="业务单号" prop="no" width="160"></sa-td>
  73. <sa-td name="客户名称" prop="customerName" width="190"></sa-td>
  74. <sa-td name="货物名称" prop="businessGoodsName" width="160"></sa-td>
  75. <sa-td name="业务项" prop="goodsName" width="160"></sa-td>
  76. <el-table-column label="车牌号" width="160">
  77. <template slot-scope="s">
  78. <label>{{s.row.carNoStr}}</label>
  79. </template>
  80. </el-table-column>
  81. <sa-td name="支付时间" prop="payTime" width="160"></sa-td>
  82. <sa-td name="确认" prop="adminConfirmInput" type="enum" :jv="{1: '已确认', 0: '未确认'}"></sa-td>
  83. <sa-td name="已支付(元)" prop="payMoney" width="140"></sa-td>
  84. <sa-td name="业务费用(元)" prop="itemPrice" width="120"></sa-td>
  85. <sa-td width="160" name="创建时间" prop="createTime"></sa-td>
  86. </sa-td>
  87. <el-table-column label="操作" width="415px" fixed="right">
  88. <template slot-scope="s">
  89. <el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-flex-business-confirm')
  90. &&currentCustomerId=='1'&&s.row.adminConfirmInput==0" @click="confirmFn(s.row)">账单确认
  91. </el-button>
  92. <el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-business-confirm')
  93. &&currentCustomerId=='1'&&s.row.adminConfirmInput==1" @click="checkConfirmFn(s.row)">查看账单
  94. </el-button>
  95. <el-button class="c-btn" type="success" @click="get(s.row)">查看</el-button>
  96. <el-button class="c-btn" type="primary"
  97. v-if="currentCustomerId=='1'||(s.row.adminConfirmInput==0&&sa.isAuth('tb-flex-business-edit'))"
  98. @click="update(s.row)">
  99. 修改
  100. </el-button>
  101. <el-button v-if="sa.isAuth('tb-flex-business-edit')" class="c-btn" type="primary"
  102. @click="carFn(s.row)">车辆管理
  103. </el-button>
  104. <el-button class="c-btn" type="primary" v-if="(currentCustomerId=='1'||(sa.isAuth('tb-flex-business-pay')))
  105. &&s.row.payStatus!=3" @click="handlerPay(s.row)">
  106. 线下收费
  107. </el-button>
  108. <el-button v-if="sa.isAuth('tb-business-car-bind')" class="c-btn" type="primary"
  109. @click="businessFn(s.row)">绑定车辆
  110. </el-button>
  111. <el-button v-if="sa.isAuth('tb-business-zx-print')&&zxShow(s.row.goodsName)" class="c-btn"
  112. type="success" @click="zxPrint(s.row.id)">装卸打印
  113. </el-button>
  114. <el-button class="c-btn" type="danger"
  115. v-if="sa.isAuth('tb-flex-business-del')&&s.row.adminConfirmInput==0&&s.row.payMoney==0"
  116. @click="del(s.row)">删除
  117. </el-button>
  118. </template>
  119. </el-table-column>
  120. </el-table>
  121. <!-- ------------- 分页 ------------- -->
  122. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  123. </sa-item>
  124. </div>
  125. <el-dialog :title="confirm.title" :visible.sync="confirm.visible" width="650px">
  126. <div class="confirm-info">
  127. <el-row>
  128. <sa-info name="订单号" br>{{confirm.form.no}}</sa-info>
  129. <sa-info :name="item.itemName" br v-for="item in confirm.form.items">
  130. {{item.itemPrice}}x{{item.num}}={{item.total}}元
  131. </sa-info>
  132. <sa-info name="创建时间" br>{{confirm.form.createTime}}</sa-info>
  133. <sa-info name="总计费用" br>{{confirm.form.itemPrice}}(元)</sa-info>
  134. </el-row>
  135. </div>
  136. <span slot="footer" class="dialog-footer">
  137. <div v-if="confirm.form.adminConfirmInput==0">
  138. <el-button @click="confirm.visible = false">取 消</el-button>
  139. <el-button type="primary" @click="sureConfirmFn">确 认</el-button>
  140. </div>
  141. <div v-else>
  142. <el-button @click="confirm.visible = false">关闭</el-button>
  143. </div>
  144. </span>
  145. </el-dialog>
  146. </div>
  147. <script>
  148. var app = new Vue({
  149. components: {
  150. "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue'),
  151. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  152. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  153. },
  154. el: '.vue-box',
  155. data: {
  156. value: '',
  157. currentCustomerId: '1',
  158. confirm: {
  159. visible: false,
  160. title: '',
  161. form: {
  162. ids: ''
  163. }
  164. },
  165. p: { // 查询参数
  166. adminConfirmInput: -1,
  167. confirmJudge:'',
  168. customerName: '',
  169. supplement: 0,
  170. owner: '',
  171. no: '',
  172. carNo: '', // 车牌号
  173. goodsId: '',
  174. pageNo: 1, // 当前页
  175. pageSize: 20, // 页大小
  176. sortType: 0 // 排序方式
  177. },
  178. dataCount: 0,
  179. dataList: [], // 数据集合
  180. timmer: null,
  181. fresh: {
  182. value: 60
  183. },
  184. goodsList: [],
  185. },
  186. methods: {
  187. judgeFn(data) {
  188. this.stopTimmer();
  189. sa.showIframe('业务审核', 'tb-business-judge.html?id=' + data.id, '1050px', '90%');
  190. },
  191. zxShow(goodsName) {
  192. var flag = goodsName.indexOf("整车");
  193. if (flag > 0 || flag === 0) {
  194. return true;
  195. } else {
  196. return false;
  197. }
  198. },
  199. zxPrint(id) {
  200. sa.showIframe('打印装卸业务确认单', 'print-zxbusiness.html?id=' + id, '1000px', '100%');
  201. },
  202. getGoodsList() {
  203. sa.ajax('/TbGoods/getList', function(resp) {
  204. this.goodsList = resp.data;
  205. }.bind(this));
  206. },
  207. stopTimmer() {
  208. if (this.timmer != null) {
  209. clearInterval(this.timmer);
  210. }
  211. },
  212. restartTimmer() {
  213. this.stopTimmer();
  214. let val = this.fresh.value;
  215. this.timmer = setInterval(() => {
  216. this.f5();
  217. }, val * 1000)
  218. },
  219. businessFn(data) {
  220. this.stopTimmer();
  221. sa.ajaxNoLoading('/TbBusinessCar/getOtherBusinessCarByBusinessId', {
  222. businessId: data.id
  223. }, function(resp) {
  224. let list = resp.data;
  225. let str = list.map(car => car.carNo).join('、');
  226. let businessCarIds = list.map(car => car.id).join(',');
  227. sa.showIframe('绑定车辆', 'tb-business-car-business.html?id=' + data.id +
  228. '&businessCarId=' + data.businessCarId + '&carNo=' + str +
  229. '&businessCarIds=' + businessCarIds, '90%', "90%");
  230. }.bind(this))
  231. },
  232. carFn(data) {
  233. this.stopTimmer();
  234. sa.showIframe('车辆管理', '../car/tb-business-car-list.html?id=' + data.id + '&payStatus=' + data
  235. .payStatus + '&confirm=' + data.adminConfirmInput, '1050px', '75%');
  236. },
  237. handlerPay(data) {
  238. this.stopTimmer();
  239. sa.showIframe('线下收费', 'tb-car-disincle-pay.html?id=' + data.id, '1050px', '95%');
  240. },
  241. getCurrendCustomer() {
  242. sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
  243. this.currentCustomerId = resp.data;
  244. }.bind(this));
  245. },
  246. // 查看
  247. get: function(data) {
  248. this.stopTimmer();
  249. sa.showIframe('数据详情', 'tb-car-disincle-info.html?id=' + data.id, '1150px', '90%');
  250. },
  251. add: function(data) {
  252. this.stopTimmer();
  253. sa.showIframe('新增数据', 'tb-car-disincle-add.html?id=-1', '1080px', '90%');
  254. },
  255. update(data) {
  256. sa.showIframe('修改数据', 'tb-car-disincle-edit.html?id=' + data.id, '1080px', '90%');
  257. },
  258. getPcodeByCurrRid() {
  259. this.stopTimmer();
  260. sa.ajax('/SpRolePermission/getPcodeByCurrRid', function(resp) {
  261. this.perCode = resp.data;
  262. }.bind(this))
  263. },
  264. confirmFn(data) {
  265. sa.ajax('/TbBusinessItem/getList', {
  266. businessId: data.id
  267. }, function(resp) {
  268. data.items = resp.data;
  269. Object.assign(this.confirm, {
  270. visible: true,
  271. title: '账单确认',
  272. form: data,
  273. })
  274. this.confirm.form.ids = data.id;
  275. }.bind(this));
  276. },
  277. checkConfirmFn(data) {
  278. sa.ajax('/TbBusinessItem/getList', {
  279. businessId: data.id
  280. }, function(resp) {
  281. data.items = resp.data;
  282. Object.assign(this.confirm, {
  283. visible: true,
  284. title: '查看账单',
  285. form: data,
  286. })
  287. }.bind(this));
  288. },
  289. // 删除
  290. del: function(data) {
  291. sa.confirm('是否删除,此操作不可撤销', function() {
  292. sa.ajax('/TbBusiness/deleteOtherBusiness?id=' + data.id + '&businessCarId=' +
  293. data.businessCarId,
  294. function(res) {
  295. sa.arrayDelete(this.dataList, data);
  296. sa.ok('删除成功');
  297. sa.f5TableHeight(); // 刷新表格高度
  298. }.bind(this))
  299. }.bind(this));
  300. },
  301. sureConfirmFn() {
  302. sa.ajax('/TbBusiness/confirm', {
  303. ids: this.confirm.form.ids
  304. }, function(resp) {
  305. this.confirm.visible = false;
  306. this.f5();
  307. }.bind(this))
  308. },
  309. // 刷新
  310. f5: function() {
  311. sa.ajaxNoLoading('/TbBusiness/getOtherBusiness', sa.removeNull(this.p), function(res) {
  312. this.dataList = res.data; // 数据
  313. this.dataCount = res.dataCount; // 数据总数
  314. sa.f5TableHeight(); // 刷新表格高度
  315. this.restartTimmer();
  316. }.bind(this));
  317. },
  318. },
  319. created: function() {
  320. sa.onInputEnter();
  321. },
  322. mounted() {
  323. this.getCurrendCustomer();
  324. this.getGoodsList();
  325. this.f5();
  326. },
  327. beforeDestroy() {
  328. this.stopTimmer();
  329. }
  330. })
  331. </script>
  332. </body>
  333. </html>