list.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. <template>
  2. <div>
  3. <a-card size="small" :bordered="false" class="salesOrderTotalList-wrap searchBoxNormal">
  4. <!-- 搜索条件 -->
  5. <div class="table-page-search-wrapper" ref="tableSearch">
  6. <a-form-model
  7. id="salesOrderTotalList-form"
  8. ref="ruleForm"
  9. class="form-model-con"
  10. layout="inline"
  11. :model="queryParam"
  12. :rules="rules"
  13. @keyup.enter.native="handleSearch">
  14. <a-row :gutter="15">
  15. <a-col :md="6" :sm="24">
  16. <a-form-model-item label="下推时间" prop="time">
  17. <rangeDate ref="rangeDate" id="salesOrderTotalList-time" :value="queryParam.time" @change="dateChange" />
  18. </a-form-model-item>
  19. </a-col>
  20. <a-col :md="6" :sm="24">
  21. <a-form-model-item label="销售单号">
  22. <a-input
  23. id="salesOrderTotalList-salesBillNo"
  24. v-model.trim="queryParam.salesBillNo"
  25. allowClear
  26. placeholder="请输入销售单号" />
  27. </a-form-model-item>
  28. </a-col>
  29. <a-col :md="6" :sm="24">
  30. <a-form-model-item label="客户名称">
  31. <a-input
  32. id="salesOrderTotalList-dealerName"
  33. v-model.trim="queryParam.dealerName"
  34. allowClear
  35. placeholder="请输入客户名称" />
  36. </a-form-model-item>
  37. </a-col>
  38. <template v-if="advanced">
  39. <a-col :md="6" :sm="24">
  40. <a-form-model-item label="客户级别">
  41. <v-select
  42. v-model="queryParam.dealerLevel"
  43. ref="dealerLevel"
  44. id="salesOrderTotalList-dealerLevel"
  45. code="DEALER_LEVEL"
  46. placeholder="请选择客户级别"
  47. allowClear></v-select>
  48. </a-form-model-item>
  49. </a-col>
  50. <a-col :md="6" :sm="24">
  51. <a-form-model-item label="操作员">
  52. <a-select
  53. id="salesOrderTotalList-operatorSn"
  54. allowClear
  55. v-model="queryParam.operatorSn"
  56. placeholder="请选择操作员"
  57. :showSearch="true"
  58. option-filter-prop="children"
  59. :filter-option="filterOption">
  60. <a-select-option
  61. v-for="item in operatorList"
  62. :key="item.sn"
  63. :value="item.sn">{{ item.name }}</a-select-option>
  64. </a-select>
  65. </a-form-model-item>
  66. </a-col>
  67. <a-col :md="6" :sm="24">
  68. <a-form-model-item label="所在区域">
  69. <subarea id="salesOrderTotalList-subareaSn" ref="subarea" @change="subareaChange"></subarea>
  70. </a-form-model-item>
  71. </a-col>
  72. <a-col :md="6" :sm="24">
  73. <a-form-model-item label="地区" prop="dealerProvinceSn">
  74. <Area
  75. id="salesOrderTotalList-dealerProvinceSn"
  76. defValKey="id"
  77. v-model="queryParam.dealerProvinceSn"
  78. placeholder="请选择省"></Area>
  79. </a-form-model-item>
  80. </a-col>
  81. <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
  82. <a-form-model-item label="客服">
  83. <customerService id="salesOrderTotalList-bizUserSn" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
  84. </a-form-model-item>
  85. </a-col>
  86. <a-col :md="6" :sm="24">
  87. <a-form-model-item label="新/老客户">
  88. <a-select id="salesOrderTotalList-dealerNewFlag" v-model="queryParam.dealerNewFlag" placeholder="请选择" allowClear>
  89. <a-select-option value="1">新客户</a-select-option>
  90. <a-select-option value="0">老客户</a-select-option>
  91. </a-select>
  92. </a-form-model-item>
  93. </a-col>
  94. </template>
  95. <a-col :md="!isShowCustomerSearch?24:6" :sm="24" style="margin-bottom: 10px;" :style="{textAlign: !isShowCustomerSearch?'center':''}">
  96. <a-button
  97. style="margin-left: 5px"
  98. type="primary"
  99. @click="handleSearch"
  100. :disabled="disabled"
  101. id="salesOrderTotalList-refresh">查询</a-button>
  102. <a-button
  103. style="margin-left: 8px"
  104. @click="resetSearchForm"
  105. :disabled="disabled"
  106. id="salesOrderTotalList-reset">重置</a-button>
  107. <a-button
  108. style="margin-left: 10px"
  109. type="primary"
  110. class="button-warning"
  111. @click="handleExport"
  112. :disabled="disabled"
  113. :loading="exportLoading"
  114. v-if="$hasPermissions('B_salesOrderTotalExport')"
  115. id="salesOrderTotalList-export">导出</a-button>
  116. <a @click="advanced=!advanced" style="margin-left: 5px">
  117. {{ advanced ? '收起' : '展开' }}
  118. <a-icon :type="advanced ? 'up' : 'down'" />
  119. </a>
  120. </a-col>
  121. </a-row>
  122. </a-form-model>
  123. </div>
  124. </a-card>
  125. <a-card size="small" :bordered="false">
  126. <a-spin :spinning="spinning" tip="Loading...">
  127. <div style="margin-bottom:12px;text-align: right;">
  128. <span>显示:</span>
  129. <a-tree-select
  130. size="small"
  131. v-model="showCols"
  132. style="min-width: 200px"
  133. dropdownMatchSelectWidth
  134. :maxTagCount="3"
  135. id="salesOrderTotalList-isShowColumn"
  136. :tree-data="colsArr"
  137. tree-checkable
  138. placeholder="请选择要显示的列(多选)"
  139. />
  140. </div>
  141. <!-- 列表 -->
  142. <s-table
  143. class="sTable fixPagination"
  144. ref="table"
  145. size="small"
  146. :rowKey="(record) => record.salesBillNo"
  147. :style="{ height: tableHeight+84.5+'px' }"
  148. rowKeyName="salesBillNo"
  149. :columns="columns"
  150. :data="loadData"
  151. :pageSize="30"
  152. :scroll="{ x: 1990, y: tableHeight-32 }"
  153. :defaultLoadData="false"
  154. bordered>
  155. <template slot="footer">
  156. <a-row :gutter="15">
  157. <a-col :md="4" :sm="24">下推数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</a-col>
  158. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_salesPrice')">实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount) : '--' }}</a-col>
  159. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_salesPrice')">开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
  160. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_costPrice')">成本金额:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</a-col>
  161. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_costPrice')&&$hasPermissions('M_salesOrderTotalList_salesPrice')">毛利:{{ (totalData && (totalData.grossProfit || totalData.grossProfit==0)) ? toThousands(totalData.grossProfit) : '--' }}</a-col>
  162. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_salesPrice')">返利:{{ (totalData &&totalData.reportRebateAmountInfo&&(totalData.reportRebateAmountInfo.rebateAmount || totalData.reportRebateAmountInfo.rebateAmount==0)) ? toThousands(totalData.reportRebateAmountInfo.rebateAmount) : '--' }}</a-col>
  163. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_salesPrice')">优惠金额:{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? toThousands(totalData.discountAmount) : '--' }}</a-col>
  164. <!-- <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_salesPrice')">折扣金额:{{ (totalData && (totalData.totalDiscountAmount || totalData.totalDiscountAmount==0)) ? toThousands(totalData.totalDiscountAmount) : '--' }}</a-col>
  165. <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesOrderTotalList_salesPrice')">折后金额:{{ (totalData && (totalData.totalDiscountedAmount || totalData.totalDiscountedAmount==0)) ? toThousands(totalData.totalDiscountedAmount) : '--' }}</a-col> -->
  166. </a-row>
  167. </template>
  168. </s-table>
  169. </a-spin>
  170. <!-- 导出提示框 -->
  171. <reportModal :visible="showExport" @close="showExport=false"></reportModal>
  172. </a-card>
  173. </div>
  174. </template>
  175. <script>
  176. import { commonMixin } from '@/utils/mixin'
  177. import getDate from '@/libs/getDate.js'
  178. import { hdExportExcel } from '@/libs/exportExcel'
  179. // 组件
  180. import { STable, VSelect } from '@/components'
  181. import rangeDate from '@/views/common/rangeDate.vue'
  182. import subarea from '@/views/common/subarea.js'
  183. import custList from '@/views/common/custList.vue'
  184. import reportModal from '@/views/common/reportModal.vue'
  185. import customerService from '@/views/common/customerService.vue'
  186. import Area from '@/views/common/area.js'
  187. // 接口
  188. import { userQueryList } from '@/api/power-user'
  189. import { reportSalesBillList, reportSalesBillCount, reportSalesBillExport } from '@/api/reportData'
  190. export default {
  191. name: 'SalesOrderTotalList',
  192. mixins: [commonMixin],
  193. components: { STable, VSelect, rangeDate, custList, subarea, reportModal, Area, customerService },
  194. data () {
  195. return {
  196. spinning: false,
  197. advanced: false, // 高级搜索 展开/关闭
  198. disabled: false, // 查询、重置按钮是否可操作
  199. tableHeight: 0, // 表格高度
  200. exportLoading: false, // 导出按钮加载状态
  201. showExport: false, // 导出到下载中心弹窗
  202. // 查询参数
  203. queryParam: {
  204. // 默认时间
  205. time: [
  206. getDate.getCurrMonthDays().starttime,
  207. getDate.getCurrMonthDays().endtime
  208. ],
  209. beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
  210. endDate: getDate.getCurrMonthDays().endtime, // 结束时间
  211. salesBillNo: '', // 销售单号
  212. dealerName: '', // 客户名称
  213. dealerLevel: undefined, // 客户级别
  214. operatorSn: undefined, // 操作员sn
  215. subareaArea: {
  216. subareaSn: undefined, // 区域
  217. subareaAreaSn: undefined// 分区
  218. },
  219. dealerProvinceSn: undefined, // 省份
  220. bizUserSn: undefined, // 客服
  221. dealerNewFlag: undefined // 客户类型
  222. },
  223. rules: { 'time': [{ required: true, message: '请选择下推时间', trigger: 'change' }] }, // 查询时间必选项
  224. // 加载数据方法 必须为 Promise 对象
  225. loadData: parameter => {
  226. this.disabled = true
  227. this.spinning = true
  228. const params = Object.assign(parameter, this.queryParam)
  229. // 列表查询
  230. return reportSalesBillList(params).then(res => {
  231. let data
  232. if (res.status == 200) {
  233. data = res.data
  234. // 统计查询
  235. this.getCount(params)
  236. // 计算序号
  237. const no = (data.pageNo - 1) * data.pageSize
  238. for (var i = 0; i < data.list.length; i++) {
  239. data.list[i].no = no + i + 1
  240. }
  241. this.disabled = false
  242. }
  243. this.spinning = false
  244. return data
  245. })
  246. },
  247. totalData: null, // 合计统计
  248. operatorList: [], // 操作员下拉数据
  249. // 列表列显示
  250. colsArr: [
  251. {
  252. title: '直接差价金额(明细)',
  253. value: 'directRebateAmountInfo',
  254. key: 'directRebateAmountInfo',
  255. disabled: !this.$hasPermissions('M_salesOrderTotalList_salesPrice')
  256. },
  257. {
  258. title: '间接差价金额(明细)',
  259. value: 'indirectRebateAmountInfo',
  260. key: 'indirectRebateAmountInfo',
  261. disabled: !this.$hasPermissions('M_salesOrderTotalList_salesPrice')
  262. }
  263. ],
  264. showCols: []// 已勾选显示的列
  265. }
  266. },
  267. computed: {
  268. columns () {
  269. const _this = this
  270. const arr = [
  271. { title: '销售单号', dataIndex: 'salesBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  272. { title: '创建时间', dataIndex: 'createDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
  273. { title: '销售审核时间', dataIndex: 'auditDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
  274. { title: '客户名称', dataIndex: 'dealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  275. { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  276. // { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  277. // { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  278. { title: '总下推数量', dataIndex: 'totalQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  279. { title: '下推数量(促)', dataIndex: 'giftQty', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
  280. // { title: '实售价', dataIndex: 'totalRealAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  281. // { title: '开单价', dataIndex: 'totalAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  282. // { title: '成本价', dataIndex: 'totalCost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  283. // { title: '毛利', dataIndex: 'grossProfit', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  284. // { title: '省级价', dataIndex: 'totalProvinceAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  285. // { title: '市级价', dataIndex: 'totalCityAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  286. // { title: '特约加盟店价', dataIndex: 'totalSpecialAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  287. // { title: '直接差价', dataIndex: 'directRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  288. // { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  289. // { title: '返利', dataIndex: 'rebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  290. // { title: '折扣金额', dataIndex: 'totalDiscountAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  291. // { title: '折后金额', dataIndex: 'totalDiscountedAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  292. ]
  293. // 根据权限及勾选按原型图固定顺序动态显示列
  294. if (this.$hasPermissions('M_salesOrderTotalList_salesPrice')) {
  295. arr.push({ title: '实售金额', dataIndex: 'totalRealAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  296. arr.push({ title: '开单金额', dataIndex: 'totalAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  297. }
  298. if (this.$hasPermissions('M_salesOrderTotalList_costPrice')) { // 成本价权限
  299. arr.push({ title: '成本金额', dataIndex: 'totalCost', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  300. arr.push({ title: '成本金额(促)', dataIndex: 'totalGiftCost', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  301. if (this.$hasPermissions('M_salesOrderTotalList_salesPrice')) {
  302. arr.push({ title: '毛利', dataIndex: 'grossProfit', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  303. }
  304. }
  305. if (this.$hasPermissions('M_salesOrderTotalList_provincePrice')) {
  306. arr.push({ title: '省级金额', dataIndex: 'totalProvinceAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  307. }
  308. if (this.$hasPermissions('M_salesOrderTotalList_cityPrice')) {
  309. arr.push({ title: '市级金额', dataIndex: 'totalCityAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  310. }
  311. if (this.$hasPermissions('M_salesOrderTotalList_specialPrice')) {
  312. arr.push({ title: '特约金额', dataIndex: 'totalSpecialAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  313. }
  314. if (this.$hasPermissions('M_salesOrderTotalList_salesPrice')) {
  315. if (this.showCols.includes('directRebateAmountInfo')) {
  316. arr.push({ title: '直接上级差价', dataIndex: 'reportRebateAmountInfo.directRebateUpAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  317. arr.push({ title: '直接指定差价', dataIndex: 'reportRebateAmountInfo.directRebateAssignAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  318. arr.push({ title: '直接总部差价', dataIndex: 'reportRebateAmountInfo.directRebateHeadAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  319. }
  320. arr.push({ title: '直接差价金额', dataIndex: 'reportRebateAmountInfo.directRebateAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  321. if (this.showCols.includes('indirectRebateAmountInfo')) {
  322. arr.push({ title: '间接上级差价', dataIndex: 'reportRebateAmountInfo.indirectRebateUpAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  323. arr.push({ title: '间接指定差价', dataIndex: 'reportRebateAmountInfo.indirectRebateAssignAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  324. arr.push({ title: '间接总部差价', dataIndex: 'reportRebateAmountInfo.indirectRebateHeadAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  325. }
  326. arr.push({ title: '间接差价金额', dataIndex: 'reportRebateAmountInfo.indirectRebateAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  327. arr.push({ title: '返利', dataIndex: 'reportRebateAmountInfo.rebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  328. arr.push({ title: '优惠金额', dataIndex: 'discountAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
  329. }
  330. arr.push({ title: '操作员', dataIndex: 'operatorName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
  331. return arr
  332. }
  333. },
  334. watch: {
  335. // 展开收起
  336. advanced (newValue, oldValue) {
  337. const _this = this
  338. this.$nextTick(() => { // 页面渲染完成后的回调
  339. _this.setTableH()
  340. })
  341. },
  342. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  343. this.setTableH()
  344. }
  345. },
  346. methods: {
  347. // 总计
  348. getCount (params) {
  349. reportSalesBillCount(params).then(res => {
  350. if (res.status == 200 && res.data) {
  351. this.totalData = res.data
  352. } else {
  353. this.totalData = null
  354. }
  355. })
  356. },
  357. // 查询
  358. handleSearch () {
  359. const _this = this
  360. this.$refs.ruleForm.validate(valid => {
  361. if (valid) {
  362. _this.$refs.table.refresh(true)
  363. } else {
  364. _this.$message.error('请选择下推时间')
  365. return false
  366. }
  367. })
  368. },
  369. // 下推时间 change
  370. dateChange (date) {
  371. if (date[0] && date[1]) {
  372. this.queryParam.time = date
  373. } else {
  374. this.queryParam.time = []
  375. }
  376. this.queryParam.beginDate = date[0] || ''
  377. this.queryParam.endDate = date[1] || ''
  378. },
  379. // 所在区域查询
  380. subareaChange (val) {
  381. this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
  382. this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
  383. },
  384. // 重置列表
  385. resetSearchForm () {
  386. this.queryParam.time = [
  387. getDate.getCurrMonthDays().starttime,
  388. getDate.getCurrMonthDays().endtime
  389. ]
  390. this.$refs.rangeDate.resetDate(this.queryParam.time)
  391. this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
  392. this.queryParam.endDate = getDate.getCurrMonthDays().endtime
  393. this.queryParam.salesBillNo = ''
  394. this.queryParam.dealerName = ''
  395. this.queryParam.dealerLevel = undefined
  396. this.queryParam.operatorSn = undefined
  397. this.queryParam.subareaArea.subareaSn = undefined
  398. this.queryParam.subareaArea.subareaAreaSn = undefined
  399. this.queryParam.dealerProvinceSn = undefined
  400. this.queryParam.bizUserSn = undefined
  401. this.queryParam.dealerNewFlag = undefined
  402. this.totalData = null
  403. if (this.advanced) {
  404. this.$refs.subarea.clearData()
  405. }
  406. this.$refs.ruleForm.resetFields()
  407. this.$refs.table.clearTable()
  408. },
  409. // 导出
  410. handleExport () {
  411. const _this = this
  412. this.$refs.ruleForm.validate(valid => {
  413. if (valid) {
  414. const params = _this.queryParam
  415. _this.$store.state.app.curActionPermission = 'B_salesOrderTotalExport'
  416. _this.showExport = true
  417. _this.exportLoading = true
  418. _this.spinning = true
  419. hdExportExcel(reportSalesBillExport, params, '销售(开单统计)报表', function () {
  420. _this.exportLoading = false
  421. _this.spinning = false
  422. _this.$store.state.app.curActionPermission = ''
  423. })
  424. } else {
  425. return false
  426. }
  427. })
  428. },
  429. // 操作员列表获取 无分页
  430. getUserList () {
  431. userQueryList({}).then(res => {
  432. if (res.status == 200) {
  433. this.operatorList = res.data
  434. } else {
  435. this.operatorList = []
  436. }
  437. })
  438. },
  439. // 操作员列名称筛选
  440. filterOption (input, option) {
  441. return (
  442. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  443. )
  444. },
  445. // 初始化
  446. pageInit () {
  447. const _this = this
  448. _this.getUserList()
  449. this.$nextTick(() => { // 页面渲染完成后的回调
  450. _this.setTableH()
  451. })
  452. },
  453. // 计算页面高度
  454. setTableH () {
  455. const tableSearchH = this.$refs.tableSearch.offsetHeight
  456. this.tableHeight = window.innerHeight - tableSearchH - 252
  457. }
  458. },
  459. mounted () {
  460. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  461. this.pageInit()
  462. this.resetSearchForm()
  463. }
  464. },
  465. activated () {
  466. // 如果是新页签打开,则重置当前页面
  467. if (this.$store.state.app.isNewTab) {
  468. this.pageInit()
  469. this.resetSearchForm()
  470. }
  471. },
  472. beforeRouteEnter (to, from, next) {
  473. next(vm => {})
  474. }
  475. }
  476. </script>