tb-business-item-list.html 7.1 KB

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