tb-business-item-list.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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. <!-- ------------- 检索参数 ------------- -->
  22. <div class="c-title">检索参数</div>
  23. <el-form ref="form" :model='p' @submit.native.prevent>
  24. <sa-item type="text" name="业务单号" v-model="p.businessNo"></sa-item>
  25. <sa-item type="text" name="项目名称" v-model="p.itemName"></sa-item>
  26. <sa-item type="text" name="越南车" v-model="p.cardNo"></sa-item>
  27. <sa-item type="text" name="中国车" v-model="p.chinaCarNo"></sa-item>
  28. <sa-item type="text" name="作业公司" v-model="p.pickCustomerName"></sa-item>
  29. <sa-item type="date" name="创建日期" v-model="p.createTime"></sa-item>
  30. <div class="c-item">
  31. <label class="c-label">业务项:</label>
  32. <el-select v-model="p.goodsId" placeholder="请选择" filterable>
  33. <el-option v-for="item in goodsList" :key="item.id" :label="item.name" :value="item.id">
  34. </el-option>
  35. </el-select>
  36. </div>
  37. <div class="c-item">
  38. <label class="c-label">状态:</label>
  39. <el-select v-model="p.confirm" placeholder="请选择" filterable>
  40. <el-option v-for="item in confirmList" :key="item.id" :label="item.name" :value="item.id">
  41. </el-option>
  42. </el-select>
  43. </div>
  44. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  45. <el-button style="display: inline;" type="info" icon="el-icon-refresh" @click="sa.f5()">刷新
  46. </el-button>
  47. <el-button type="warning" icon="el-icon-download" @click="exportFn()">导出</el-button>
  48. <el-button type="primary" icon="el-icon-search" @click="confirmBatch">批量确认</el-button>
  49. <br>
  50. </el-form>
  51. <!-- ------------- 快捷按钮 ------------- -->
  52. <div class="fast-btn">
  53. </div>
  54. <!-- ------------- 数据列表 ------------- -->
  55. <el-table class="data-table" ref="data-table" :data="dataList">
  56. <sa-td type="selection"></sa-td>
  57. <sa-td name="单号" prop="no" width="160"></sa-td>
  58. <sa-td name="业务项" prop="goodsName" width="120"></sa-td>
  59. <sa-td name="收费类型" prop="itemTypeName" width="120"></sa-td>
  60. <sa-td name="收费项" prop="itemName" width="140"></sa-td>
  61. <sa-td name="越南车" prop="cardNo"></sa-td>
  62. <sa-td name="中国车" prop="chinaCarNo"></sa-td>
  63. <sa-td name="作业公司" prop="pickCustomerName"></sa-td>
  64. <sa-td name="计费标准" prop="unit">
  65. <template slot-scope="s">
  66. {{s.row.itemPrice}}{{s.row.unit}}
  67. </template>
  68. </sa-td>
  69. <!-- <sa-td name="状态" prop="status" type="enum" :jv="{0: '未完成', 1: '已完成'}"></sa-td>
  70. <sa-td name="作业时间" prop="operateTime"></sa-td> -->
  71. <sa-td name="创建时间" prop="createTime" width="160"></sa-td>
  72. <sa-td name="接单时间" prop="pickTime" width="160"></sa-td>
  73. <sa-td name="确认时间" prop="confirmTime" width="160"></sa-td>
  74. <el-table-column label="操作" fixed="right" width="200px" v-if="currentCustomerId=='1'">
  75. <template slot-scope="s">
  76. <el-button v-if="s.row.pickTime&&!s.row.confirmTime" class="c-btn" type="success"
  77. icon="el-icon-edit" @click="confirmFn(s.row)">确认
  78. </el-button>
  79. </template>
  80. </el-table-column>
  81. </el-table>
  82. <!-- ------------- 分页 ------------- -->
  83. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  84. </sa-item>
  85. </div>
  86. <el-dialog title="提示" :visible.sync="confirm.visible" width="30%">
  87. <span>是否进行接单确认?</span>
  88. <span slot="footer" class="dialog-footer">
  89. <el-button @click="confirm.visible = false">取 消</el-button>
  90. <el-button type="primary" @click="sureConfirm">确 定</el-button>
  91. </span>
  92. </el-dialog>
  93. <el-dialog title="提示" :visible.sync="emodel.visible" width="30%">
  94. <span>日期范围:</span>
  95. <el-form size="mini">
  96. <div class="c-item">
  97. <el-date-picker size="mini" v-model="dataTime" type="daterange" unlink-panels="false"
  98. range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
  99. format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
  100. </el-date-picker>
  101. </div>
  102. </el-form>
  103. <span slot="footer" class="dialog-footer">
  104. <el-button @click="emodel.visible = false">取 消</el-button>
  105. <el-button type="primary" @click="sureExport">确 定</el-button>
  106. </span>
  107. </el-dialog>
  108. </div>
  109. <script>
  110. var app = new Vue({
  111. components: {
  112. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  113. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  114. },
  115. el: '.vue-box',
  116. data: {
  117. p: { // 查询参数
  118. id: '', // 主键
  119. itemName: '', // 项目名称
  120. cardNo: '',
  121. chinaCarNo: '',
  122. businessType: '',
  123. goodsId: '',
  124. goodsName: '',
  125. pickCustomerName: '',
  126. createTime: '',
  127. businessNo: '',
  128. pageNo: 1, // 当前页
  129. pageSize: 10, // 页大小
  130. sortType: 10 // 排序方式
  131. },
  132. dataCount: 0,
  133. dataList: [], // 数据集合
  134. goodsList: [],
  135. currentCustomerId: '1',
  136. itemTypeList: [],
  137. confirmList: [{
  138. id: 0,
  139. name: '未确认'
  140. }, {
  141. id: 1,
  142. name: '已确认'
  143. }],
  144. confirm: {
  145. visible: false,
  146. form: {
  147. id: ''
  148. }
  149. },
  150. emodel: {
  151. visible: false,
  152. form: {
  153. beginTime: '',
  154. endTime: ''
  155. }
  156. },
  157. dataTime: [],
  158. },
  159. methods: {
  160. getGoods: function() {
  161. sa.ajax('/TbGoods/all', sa.removeNull(this.p), function(res) {
  162. let list = [{
  163. id: '',
  164. name: '全部'
  165. }];
  166. list = list.concat(res.data)
  167. this.goodsList = list; // 数据
  168. }.bind(this));
  169. },
  170. exportFn() {
  171. Object.assign(this.emodel, {
  172. visible: true,
  173. })
  174. },
  175. sureExport() {
  176. if (this.dataTime.length != 0) {
  177. this.emodel.form.beginTime = this.dataTime[0];
  178. this.emodel.form.endTime = this.dataTime[1];
  179. } else {
  180. sa.msg("请选择日期范围");
  181. return;
  182. }
  183. sa.ajax('/TbBusinessItem/export/items', this.emodel.form, function(resp) {
  184. window.open(resp.data);
  185. this.emodel.visible = false;
  186. }.bind(this));
  187. },
  188. confirmFn(data) {
  189. Object.assign(this.confirm, {
  190. visible: true,
  191. form: {
  192. id: data.id
  193. }
  194. })
  195. },
  196. confirmBatch() {
  197. // 获取选中元素的id列表
  198. let selection = this.$refs['data-table'].selection;
  199. let ids = sa.getArrayField(selection, 'id');
  200. if (selection.length == 0) {
  201. return sa.msg('请至少选择一条数据')
  202. }
  203. // 提交删除
  204. sa.confirm('是否批量确认选中数据?', function() {
  205. sa.ajax('/TbBusinessItem/confirmBatch', {
  206. ids: ids.join(',')
  207. }, function(res) {
  208. sa.ok('操作成功');
  209. this.f5();
  210. }.bind(this))
  211. }.bind(this));
  212. },
  213. sureConfirm() {
  214. sa.ajax('/TbBusinessItem/confirm', {
  215. id: this.confirm.form.id
  216. }, function(resp) {
  217. this.confirm.visible = false;
  218. this.f5();
  219. }.bind(this));
  220. },
  221. getCustomer() {
  222. sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
  223. this.currentCustomerId = resp.data;
  224. }.bind(this));
  225. },
  226. // 刷新
  227. f5: function() {
  228. sa.ajax('/TbBusinessItem/getList', sa.removeNull(this.p), function(res) {
  229. this.dataList = res.data; // 数据
  230. this.dataCount = res.dataCount; // 数据总数
  231. sa.f5TableHeight(); // 刷新表格高度
  232. }.bind(this));
  233. },
  234. // 查看
  235. get: function(data) {
  236. sa.showIframe('数据详情', 'tb-business-item-info.html?id=' + data.id, '1050px', '90%');
  237. },
  238. // 查看 - 根据选中的
  239. getBySelect: function(data) {
  240. var selection = this.$refs['data-table'].selection;
  241. if (selection.length == 0) {
  242. return sa.msg('请选择一条数据')
  243. }
  244. this.get(selection[0]);
  245. },
  246. },
  247. created: function() {
  248. this.getCustomer();
  249. this.getGoods();
  250. this.f5();
  251. sa.onInputEnter();
  252. }
  253. })
  254. </script>
  255. </body>
  256. </html>