index.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="98px">
  4. <el-form-item label="班次号" prop="classesNo">
  5. <el-input
  6. v-model="queryParams.likeClassesNo"
  7. placeholder="请输入班次号"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="班结时间" prop="endDate">
  14. <el-date-picker style="width: 350px"
  15. v-model="dateRangeCreatedDate" size="mini" value-format="yyyy-MM-dd HH:mm:ss"
  16. type="datetimerange"
  17. range-separator="至"
  18. start-placeholder="开始日期"
  19. end-placeholder="结束日期">
  20. </el-date-picker>
  21. </el-form-item>
  22. <el-form-item label="油站名称" prop="stationId">
  23. <el-select
  24. v-model="queryParams.stationId"
  25. placeholder="请选择油站"
  26. clearable
  27. size="small"
  28. >
  29. <el-option
  30. v-for="item in stationOptions"
  31. :key="item.stationId"
  32. :label="item.stationName"
  33. :value="item.stationId"
  34. ></el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item label="班结人" prop="classesMan">
  38. <el-input
  39. v-model="queryParams.classesMan"
  40. placeholder="请输入班结人"
  41. clearable
  42. size="small"
  43. @keyup.enter.native="handleQuery"
  44. />
  45. </el-form-item>
  46. <el-form-item>
  47. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  48. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  49. </el-form-item>
  50. </el-form>
  51. <el-table v-loading="loading" :data="summaryList" >
  52. <el-table-column label="班结主键id" align="center" prop="id" v-if="false" />
  53. <el-table-column label="班次号" align="center" prop="classesNo" />
  54. <el-table-column label="班次开始时间" align="center" prop="startDate" width="180">
  55. <template slot-scope="scope">
  56. <span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="班次结束时间" align="center" prop="endDate" width="180">
  60. <template slot-scope="scope">
  61. <span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="油站id" align="center" prop="stationId" v-if="false" />
  65. <el-table-column label="油站名称" align="center" prop="stationName" />
  66. <el-table-column label="订单数" align="center" prop="orderNum" />
  67. <el-table-column label="小票数量" align="center" prop="printNum" />
  68. <el-table-column label="销量L" align="center" prop="saleLiters" />
  69. <el-table-column label="应收金额" align="center" prop="saleAmt" />
  70. <el-table-column label="实收金额" align="center" prop="amt" />
  71. <el-table-column label="优惠金额" align="center" prop="discountAmt" />
  72. <el-table-column label="微信支付金额" align="center" prop="wxAmt" />
  73. <el-table-column label="支付支付金额" align="center" prop="zfbAmt" v-if="false" />
  74. <el-table-column label="电子卡支付金额" align="center" prop="dzkAmt" v-if="false"/>
  75. <el-table-column label="班结人" align="center" prop="classesMan" />
  76. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  77. <template slot-scope="scope">
  78. <el-button
  79. size="mini"
  80. type="text"
  81. icon="el-icon-plus"
  82. @click="handlelook(scope.row)"
  83. >查看</el-button>
  84. <el-button
  85. size="mini"
  86. type="text"
  87. icon="el-icon-download"
  88. @click="handleExport(scope.row)"
  89. v-hasPermi="['station:structure:export']"
  90. >下载</el-button>
  91. </template>
  92. </el-table-column>
  93. </el-table>
  94. <pagination
  95. v-show="total>0"
  96. :total="total"
  97. :page.sync="queryParams.pageNum"
  98. :limit.sync="queryParams.pageSize"
  99. @pagination="getList"
  100. />
  101. </div>
  102. </template>
  103. <script>
  104. import { listSummary } from "@/api/station/summary";
  105. import { exportStructure } from "@/api/station/structure";
  106. import { stationinfo } from "@/api/station/gun";
  107. export default {
  108. name: "Summary",
  109. data() {
  110. return {
  111. // 遮罩层
  112. loading: true,
  113. // 选中数组
  114. ids: [],
  115. // 非单个禁用
  116. single: true,
  117. // 非多个禁用
  118. multiple: true,
  119. // 显示搜索条件
  120. showSearch: true,
  121. // 总条数
  122. total: 0,
  123. // 【请填写功能名称】表格数据
  124. summaryList: [],
  125. stationOptions: [],
  126. dateRangeCreatedDate: [],
  127. // 弹出层标题
  128. title: "",
  129. // 是否显示弹出层
  130. open: false,
  131. // 查询参数
  132. queryParams: {
  133. pageNum: 1,
  134. pageSize: 10,
  135. classesNo: null,
  136. startDate: null,
  137. endDate: null,
  138. stationId: null,
  139. stationName: null,
  140. orderNum: null,
  141. printNum: null,
  142. saleLiters: null,
  143. saleAmt: null,
  144. wxAmt: null,
  145. zfbAmt: null,
  146. dzkAmt: null,
  147. classesMan: null,
  148. likeClassesNo:null
  149. },
  150. // 查询参数
  151. queryParam: {
  152. orderNo: null,
  153. stationId: null,
  154. stationName: null,
  155. oilGun: null,
  156. oilName: null,
  157. oilPirce: null,
  158. oilType: null,
  159. consumerId: null,
  160. consumer: null,
  161. amt: null,
  162. orderLiters: null,
  163. payType: null,
  164. payWay: null,
  165. payDate: null,
  166. oilPersonnel: null,
  167. orderType: null,
  168. printNum: null,
  169. classStructureNo: null,
  170. classStartDate: null,
  171. classStructureDate: null,
  172. classStructureMan: null,
  173. oils: null,
  174. receivableAmt: null,
  175. receivedAmt: null,
  176. discountAmt: null,
  177. discountCouponAmt: null,
  178. discountCoupon: null,
  179. wxAmt: null,
  180. zfbAmt: null,
  181. posAmt: null,
  182. xjAmt: null,
  183. didiAppAmt: null,
  184. tyAppAmt: null,
  185. otherAmt: null,
  186. dzkAmt: null,
  187. score: null,
  188. memberNo: null,
  189. memberAmt: null,
  190. carNo: null,
  191. customerPhone: null,
  192. customerGrade: null
  193. },
  194. // 表单参数
  195. form: {},
  196. // 表单校验
  197. rules: {
  198. }
  199. };
  200. },
  201. created() {
  202. this.getList();
  203. stationinfo().then(response => {
  204. this.stationOptions = response.rows;
  205. });
  206. },
  207. methods: {
  208. /** 查询【请填写功能名称】列表 */
  209. getList() {
  210. this.loading = true;
  211. listSummary(this.addDateRange(this.queryParams, this.dateRangeCreatedDate)).then(response => {
  212. this.summaryList = response.rows;
  213. this.total = response.total;
  214. this.loading = false;
  215. });
  216. },
  217. // 取消按钮
  218. cancel() {
  219. this.open = false;
  220. this.reset();
  221. },
  222. // 表单重置
  223. reset() {
  224. this.form = {
  225. id: null,
  226. classesNo: null,
  227. startDate: null,
  228. endDate: null,
  229. stationId: null,
  230. stationName: null,
  231. orderNum: null,
  232. printNum: null,
  233. saleLiters: null,
  234. saleAmt: null,
  235. wxAmt: null,
  236. zfbAmt: null,
  237. dzkAmt: null,
  238. classesMan: null
  239. };
  240. this.resetForm("form");
  241. },
  242. /** 搜索按钮操作 */
  243. handleQuery() {
  244. this.queryParams.pageNum = 1;
  245. this.getList();
  246. },
  247. /** 重置按钮操作 */
  248. resetQuery() {
  249. this.resetForm("queryForm");
  250. this.dateRangeCreatedDate =[];
  251. this.handleQuery();
  252. },
  253. handlelook(row){
  254. this.$router.push({path:'/station/structure',query:{classesNo:row.classesNo,stationId:row.stationId,name:row.classesMan}});
  255. },
  256. /** 导出按钮操作 */
  257. handleExport(row) {
  258. const classesNo = row.classesNo;
  259. this.queryParam.classStructureNo=classesNo;
  260. const queryParams = this.queryParam;
  261. this.$confirm('是否确认导出所有班结数据项?', "警告", {
  262. confirmButtonText: "确定",
  263. cancelButtonText: "取消",
  264. type: "warning"
  265. }).then(function() {
  266. return exportStructure(queryParams);
  267. }).then(response => {
  268. this.download(response.msg);
  269. })
  270. }
  271. }
  272. };
  273. </script>