list.vue 25 KB

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