tb-car-disincle-list.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  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. <sa-item type="text" name="合作伙伴" placeholder="合作伙伴" v-model="p.pickCustomerName"></sa-item>
  46. <div class="c-item">
  47. <label class="c-label">状态:</label>
  48. <el-select v-model="p.hasError" placeholder="请选择" @change="f5()">
  49. <el-option label="全部" :value="-1"></el-option>
  50. <el-option label="正常" :value="0"></el-option>
  51. <el-option label="异常" :value="1"></el-option>
  52. </el-select>
  53. </div>
  54. <div class="c-item">
  55. <label class="c-label">业务项:</label>
  56. <el-select v-model="p.goodsId">
  57. <el-option v-for="good in goodsList" :key="good.id" :label="good.name" :value="good.id">
  58. </el-option>
  59. </el-select>
  60. </div>
  61. <div class="c-item">
  62. <label class="c-label">审核状态:</label>
  63. <el-select v-model="p.confirmJudge">
  64. <el-option label="全部" value=""></el-option>
  65. <el-option label="未审核" :value="0"></el-option>
  66. <el-option label="审核通过" :value="1"></el-option>
  67. <el-option label="审核驳回" :value="2"></el-option>
  68. </el-select>
  69. </div>
  70. <div class="c-item">
  71. <label class="c-label">日期范围:</label>
  72. <el-date-picker size="mini" v-model="selectDay" type="daterange" unlink-panels="false"
  73. range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
  74. format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd" @change="f5">
  75. </el-date-picker>
  76. </div>
  77. <div>
  78. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  79. <el-button type="info" icon="el-icon-search"
  80. @click="p.carNo = '';p.confirmJudge='';p.customerName='';p.pickCustomerName='';p.owner='';p.no=''; f5()">
  81. 重置
  82. </el-button>
  83. <el-button v-if="sa.isAuth('tb-flex-business-add')" size="mini" type="primary" @click="add()">
  84. 新增
  85. </el-button>
  86. </div>
  87. </el-form>
  88. <!-- ------------- 数据列表 ------------- -->
  89. <el-table class="data-table" ref="data-table" :data="dataList" style="margin-top: 20px;">
  90. <el-table-column type="index" name="序号" width="50"></el-table-column>
  91. <sa-td name="业务单号" prop="no" width="160"></sa-td>
  92. <sa-td name="客户名称" prop="customerName" width="190"></sa-td>
  93. <sa-td name="合作伙伴" prop="pickCustomerName" width="190"></sa-td>
  94. <sa-td name="货物名称" prop="businessGoodsName" width="160"></sa-td>
  95. <sa-td name="业务项" prop="goodsName" width="180"></sa-td>
  96. <el-table-column label="车牌号" width="160">
  97. <template slot-scope="s">
  98. <label>{{s.row.carNoStr}}</label>
  99. </template>
  100. </el-table-column>
  101. <sa-td name="审核状态" prop="confirmJudge" type="enum" :jv="{0: '未审核', 1:'审核通过',2:'审核驳回'}">
  102. </sa-td>
  103. <sa-td name="审核时间" prop="confirmJudgeTime" width="160"></sa-td>
  104. <!-- <sa-td name="确认" prop="adminConfirmInput" type="enum" :jv="{1: '已确认', 0: '未确认'}"></sa-td> -->
  105. <sa-td name="业务费用(元)" prop="itemPrice" width="120"></sa-td>
  106. <sa-td name="已支付(元)" prop="payMoney" width="140"></sa-td>
  107. <sa-td name="支付时间" prop="payTime" width="160"></sa-td>
  108. <sa-td name="业务状态" prop="hasError" type="enum" :jv="{1: '异常[#ff0000]', 0: '正常[#005500]'}"></sa-td>
  109. <sa-td width="160" name="创建时间" prop="createTime"></sa-td>
  110. </sa-td>
  111. <el-table-column label="操作" width="260px" fixed="right">
  112. <template slot-scope="s">
  113. <!-- <el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-flex-business-confirm')
  114. &&currentCustomerId=='1'&&s.row.adminConfirmInput==0" @click="confirmFn(s.row)">账单确认
  115. </el-button> -->
  116. <!-- <el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-business-confirm')
  117. &&currentCustomerId=='1'&&s.row.adminConfirmInput==1" @click="checkConfirmFn(s.row)">查看账单
  118. </el-button> -->
  119. <el-button class="c-btn" type="success" @click="get(s.row)">查看</el-button>
  120. <el-button class="c-btn" type="success"
  121. v-if="sa.isAuth('tb-flex-business-judge')&&s.row.confirmJudge!=1"
  122. @click="pass(s.row)">审核</el-button>
  123. <el-button class="c-btn" type="warning"
  124. v-if="sa.isAuth('tb-flex-business-judge')&&s.row.confirmJudge==1"
  125. @click="callback(s.row)">驳回</el-button>
  126. <el-button class="c-btn" type="primary"
  127. v-if="currentCustomerId=='1'||(s.row.adminConfirmInput==0&&sa.isAuth('tb-flex-business-edit'))"
  128. @click="update(s.row)">
  129. 修改
  130. </el-button>
  131. <el-button v-if="sa.isAuth('tb-flex-business-edit')" class="c-btn" type="primary"
  132. @click="carFn(s.row)">业务车辆
  133. </el-button>
  134. <!--
  135. <el-button v-if="sa.isAuth('tb-business-car-bind')" class="c-btn" type="primary"
  136. @click="businessFn(s.row)">绑定车辆
  137. </el-button> -->
  138. <el-button v-if="sa.isAuth('tb-business-zx-print')&&zxShow(s.row.goodsName)" class="c-btn"
  139. type="success" @click="zxPrint(s.row.id)">装卸打印
  140. </el-button>
  141. <el-button class="c-btn" type="danger"
  142. v-if="sa.isAuth('tb-flex-business-del')&&s.row.adminConfirmInput==0&&s.row.payMoney==0&&s.row.confirmJudge!=1"
  143. @click="del(s.row)">删除
  144. </el-button>
  145. <el-button class="c-btn" type="warning" v-if="s.row.hasError==1" @click="addErrorFn(s.row)">
  146. 补录单
  147. </el-button>
  148. </template>
  149. </el-table-column>
  150. </el-table>
  151. <!-- ------------- 分页 ------------- -->
  152. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  153. </sa-item>
  154. </div>
  155. <el-dialog :title="confirm.title" :visible.sync="confirm.visible" width="650px">
  156. <div class="confirm-info">
  157. <el-row>
  158. <sa-info name="订单号" br>{{confirm.form.no}}</sa-info>
  159. <sa-info :name="item.itemName" br v-for="item in confirm.form.items">
  160. {{item.itemPrice}}x{{item.num}}={{item.total}}元
  161. </sa-info>
  162. <sa-info name="创建时间" br>{{confirm.form.createTime}}</sa-info>
  163. <sa-info name="总计费用" br>{{confirm.form.itemPrice}}(元)</sa-info>
  164. </el-row>
  165. </div>
  166. <span slot="footer" class="dialog-footer">
  167. <div v-if="confirm.form.adminConfirmInput==0">
  168. <el-button @click="confirm.visible = false">取 消</el-button>
  169. <el-button type="primary" @click="sureConfirmFn">确 认</el-button>
  170. </div>
  171. <div v-else>
  172. <el-button @click="confirm.visible = false">关闭</el-button>
  173. </div>
  174. </span>
  175. </el-dialog>
  176. <el-dialog title="补录异常单" :visible.sync="error.visible" width="500px">
  177. <div class="confirm-info">
  178. <el-form label-position="left">
  179. <sa-info name="订单号" br>{{error.form.no}}</sa-info>
  180. <div class="c-item">
  181. <label class="c-label"><span style="color: red;">*</span>补录业务:</label>
  182. <el-select v-model="error.form.itemId" placeholder="请选择" filterable>
  183. <el-option v-for="item in itemList" :key="item.id" :label="item.itemName"
  184. :value="item.id">
  185. </el-option>
  186. </el-select>
  187. </div>
  188. </el-form>
  189. </div>
  190. <span slot="footer" class="dialog-footer">
  191. <div>
  192. <el-button @click="error.visible = false">取 消</el-button>
  193. <el-button type="primary" @click="sureAddFn">保 存</el-button>
  194. </div>
  195. </span>
  196. </el-dialog>
  197. </div>
  198. <script>
  199. var app = new Vue({
  200. components: {
  201. "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue'),
  202. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  203. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  204. },
  205. el: '.vue-box',
  206. data: {
  207. selectDay:[],
  208. value: '',
  209. currentCustomerId: '1',
  210. error: {
  211. visible: false,
  212. form: {
  213. }
  214. },
  215. confirm: {
  216. visible: false,
  217. title: '',
  218. form: {
  219. ids: ''
  220. }
  221. },
  222. p: { // 查询参数
  223. hasError: -1,
  224. adminConfirmInput: -1,
  225. pickCustomerName: '',
  226. confirmJudge: '',
  227. customerName: '',
  228. supplement: 0,
  229. owner: '',
  230. no: '',
  231. carNo: '', // 车牌号
  232. goodsId: '',
  233. pageNo: 1, // 当前页
  234. pageSize: 20, // 页大小
  235. sortType: 0 // 排序方式
  236. },
  237. dataCount: 0,
  238. itemList: [],
  239. dataList: [], // 数据集合
  240. timmer: null,
  241. fresh: {
  242. value: 60
  243. },
  244. goodsList: [],
  245. },
  246. methods: {
  247. pass(data) {
  248. this.stopTimmer();
  249. sa.showIframe('审核业务', 'tb-car-disincle-judge.html?id=' + data.id, '1150px', '90%');
  250. },
  251. callback(data) {
  252. let that = this;
  253. console.log(data);
  254. layer.prompt({
  255. title: '填写驳回原因'
  256. }, function(content, index) {
  257. layer.close(index);
  258. sa.ajax('/TbBusiness/callback', {
  259. id: data.id,
  260. judgeContent: content
  261. }, function(res) {
  262. sa.alert('已驳回', that.f5);
  263. })
  264. });
  265. },
  266. sureAddFn() {
  267. },
  268. addErrorFn(data) {
  269. sa.showIframe('补录单', 'tb-business-item-supplement.html?id=' + data.id, '600px', '60%');
  270. },
  271. getItemList() {
  272. sa.ajax('/TbItem/getList', function(resp) {
  273. this.itemList = resp.data;
  274. }.bind(this));
  275. },
  276. judgeFn(data) {
  277. this.stopTimmer();
  278. sa.showIframe('业务审核', 'tb-business-judge.html?id=' + data.id, '1050px', '90%');
  279. },
  280. zxShow(goodsName) {
  281. var flag = goodsName.indexOf("整车");
  282. if (flag > 0 || flag === 0) {
  283. return true;
  284. } else {
  285. return false;
  286. }
  287. },
  288. zxPrint(id) {
  289. sa.showIframe('打印装卸业务确认单', 'print-zxbusiness.html?id=' + id, '1000px', '100%');
  290. },
  291. getGoodsList() {
  292. sa.ajax('/TbGoods/getList', function(resp) {
  293. this.goodsList = resp.data;
  294. }.bind(this));
  295. },
  296. stopTimmer() {
  297. if (this.timmer != null) {
  298. clearInterval(this.timmer);
  299. }
  300. },
  301. restartTimmer() {
  302. this.stopTimmer();
  303. let val = this.fresh.value;
  304. this.timmer = setInterval(() => {
  305. this.f5();
  306. }, val * 1000)
  307. },
  308. businessFn(data) {
  309. this.stopTimmer();
  310. sa.ajaxNoLoading('/TbBusinessCar/getOtherBusinessCarByBusinessId', {
  311. businessId: data.id
  312. }, function(resp) {
  313. let list = resp.data;
  314. let str = list.map(car => car.carNo).join('、');
  315. let businessCarIds = list.map(car => car.id).join(',');
  316. sa.showIframe('绑定车辆', 'tb-business-car-business.html?id=' + data.id +
  317. '&businessCarId=' + data.businessCarId + '&carNo=' + str +
  318. '&businessCarIds=' + businessCarIds, '90%', "90%");
  319. }.bind(this))
  320. },
  321. carFn(data) {
  322. this.stopTimmer();
  323. sa.showIframe('业务车辆管理', '../car/tb-business-car-list.html?id=' + data.id + '&payStatus=' + data
  324. .payStatus + '&confirm=' + data.confirmJudge, '1050px', '75%');
  325. },
  326. handlerPay(data) {
  327. this.stopTimmer();
  328. sa.showIframe('线下收费', 'tb-car-disincle-pay.html?id=' + data.id, '1050px', '95%');
  329. },
  330. getCurrendCustomer() {
  331. sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
  332. this.currentCustomerId = resp.data;
  333. }.bind(this));
  334. },
  335. // 查看
  336. get: function(data) {
  337. this.stopTimmer();
  338. sa.showIframe('数据详情', 'tb-car-disincle-info.html?id=' + data.id, '1150px', '90%');
  339. },
  340. add: function(data) {
  341. this.stopTimmer();
  342. sa.showIframe('新增数据', 'tb-car-disincle-add.html?id=-1', '90%', '90%');
  343. },
  344. update(data) {
  345. if (data.confirmJudge == 1) {
  346. sa.error('业务已审核,请驳回后修改')
  347. return;
  348. }
  349. this.stopTimmer();
  350. sa.showIframe('修改数据', 'tb-car-disincle-edit.html?id=' + data.id, '90%', '90%');
  351. },
  352. getPcodeByCurrRid() {
  353. this.stopTimmer();
  354. sa.ajax('/SpRolePermission/getPcodeByCurrRid', function(resp) {
  355. this.perCode = resp.data;
  356. }.bind(this))
  357. },
  358. confirmFn(data) {
  359. sa.ajax('/TbBusinessItem/getList', {
  360. businessId: data.id
  361. }, function(resp) {
  362. data.items = resp.data;
  363. Object.assign(this.confirm, {
  364. visible: true,
  365. title: '账单确认',
  366. form: data,
  367. })
  368. this.confirm.form.ids = data.id;
  369. }.bind(this));
  370. },
  371. checkConfirmFn(data) {
  372. sa.ajax('/TbBusinessItem/getList', {
  373. businessId: data.id
  374. }, function(resp) {
  375. data.items = resp.data;
  376. Object.assign(this.confirm, {
  377. visible: true,
  378. title: '查看账单',
  379. form: data,
  380. })
  381. }.bind(this));
  382. },
  383. // 删除
  384. del: function(data) {
  385. if (data.confirmJudge == 1) {
  386. sa.error('业务已审核,无法删除')
  387. return;
  388. }
  389. sa.confirm('是否删除,此操作不可撤销', function() {
  390. sa.ajax('/TbBusiness/deleteOtherBusiness?id=' + data.id + '&businessCarId=' +
  391. data.businessCarId,
  392. function(res) {
  393. sa.arrayDelete(this.dataList, data);
  394. sa.ok('删除成功');
  395. sa.f5TableHeight(); // 刷新表格高度
  396. }.bind(this))
  397. }.bind(this));
  398. },
  399. sureConfirmFn() {
  400. sa.ajax('/TbBusiness/confirm', {
  401. ids: this.confirm.form.ids
  402. }, function(resp) {
  403. this.confirm.visible = false;
  404. this.f5();
  405. }.bind(this))
  406. },
  407. // 刷新
  408. f5: function() {
  409. let days = this.selectDay;
  410. let p = this.p;
  411. if (days.length == 2) {
  412. p.startDay = sa.forDate(days[0]);
  413. p.endDay = sa.forDate(days[1]);
  414. }else{
  415. p.startDay = '';
  416. p.endDay = '';
  417. }
  418. sa.ajaxNoLoading('/TbBusiness/getOtherBusiness', sa.removeNull(p), function(res) {
  419. this.dataList = res.data; // 数据
  420. this.dataCount = res.dataCount; // 数据总数
  421. sa.f5TableHeight(); // 刷新表格高度
  422. this.restartTimmer();
  423. }.bind(this));
  424. },
  425. },
  426. created: function() {
  427. sa.onInputEnter();
  428. },
  429. mounted() {
  430. this.getCurrendCustomer();
  431. this.getGoodsList();
  432. this.getItemList();
  433. this.f5();
  434. },
  435. beforeDestroy() {
  436. this.stopTimmer();
  437. }
  438. })
  439. </script>
  440. </body>
  441. </html>