tb-business-item-list.html 7.9 KB

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