list.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <template>
  2. <div class="salesList-wrap">
  3. <a-card size="small" :bordered="false" class="searchBoxNormal">
  4. <!-- 搜索条件 -->
  5. <div ref="tableSearch" class="table-page-search-wrapper">
  6. <a-form-model
  7. id="allocateBillList-form"
  8. ref="ruleForm"
  9. class="form-model-con"
  10. layout="inline"
  11. :rules="rules"
  12. :model="queryParam"
  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="submitDateChange" />
  18. </a-form-model-item>
  19. </a-col>
  20. <a-col :md="6" :sm="24">
  21. <a-form-model-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
  22. <dealerSubareaScopeList ref="dealerSubareaScopeList" id="salesList-buyerName" @change="custChange" />
  23. </a-form-model-item>
  24. </a-col>
  25. <a-col :md="6" :sm="24">
  26. <a-form-model-item label="销售单号">
  27. <a-input id="salesList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
  28. </a-form-model-item>
  29. </a-col>
  30. <template v-if="advanced">
  31. <a-col :md="6" :sm="24">
  32. <a-form-model-item label="超时环节提醒">
  33. <a-select v-model="queryParam.timeoutflag" allowClear placeholder="请选择超时环节提醒状态">
  34. <a-select-option value="NOT_SENDGOODS">未发货</a-select-option>
  35. <a-select-option value="NOT_STOCK">未备货</a-select-option>
  36. <a-select-option value="NOT_COLLECTION">未收款</a-select-option>
  37. </a-select>
  38. </a-form-model-item>
  39. </a-col>
  40. <a-col :md="6" :sm="24">
  41. <a-form-model-item label="审核时间">
  42. <rangeDate ref="processRangeDate" :value="examineTime" @change="processDateChange" />
  43. </a-form-model-item>
  44. </a-col>
  45. <a-col :md="6" :sm="24">
  46. <a-form-model-item label="业务状态">
  47. <v-select
  48. v-model="queryParam.billStatus"
  49. ref="billStatus"
  50. id="salesList-billStatus"
  51. code="SALES_OVERVIEW_BILL_STATUS"
  52. placeholder="请选择业务状态"
  53. allowClear></v-select>
  54. </a-form-model-item>
  55. </a-col>
  56. <a-col :md="6" :sm="24">
  57. <a-form-model-item label="发货状态">
  58. <v-select
  59. v-model="queryParam.sendFlag"
  60. ref="sendFlag"
  61. id="outboundOrderList-sendFlag"
  62. code="SEND_FLAG"
  63. placeholder="请选择发货状态"
  64. allowClear></v-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="salesList-subarea" 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="收款时间">
  74. <rangeDate ref="collectionRangeDate" :value="paymentTime" @change="collectionDateChange" />
  75. </a-form-model-item>
  76. </a-col>
  77. <a-col :md="6" :sm="24">
  78. <a-form-model-item label="财务状态">
  79. <v-select
  80. v-model="queryParam.financialStatus"
  81. ref="financialStatus"
  82. id="salesList-financialStatus"
  83. code="FINANCIAL_RECEIVE_STATUS"
  84. placeholder="请选择财务状态"
  85. allowClear></v-select>
  86. </a-form-model-item>
  87. </a-col>
  88. <a-col :md="6" :sm="24">
  89. <a-form-item label="是否促销单">
  90. <v-select
  91. v-model="queryParam.promoFlag"
  92. ref="cxFlag"
  93. code="FLAG"
  94. placeholder="请选择是否促销单"
  95. allowClear></v-select>
  96. </a-form-item>
  97. </a-col>
  98. <a-col :md="6" :sm="24">
  99. <a-form-model-item label="省份" prop="provinceSn">
  100. <Area id="salesList-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
  101. </a-form-model-item>
  102. </a-col>
  103. </template>
  104. <a-col :md="advanced ? 24 : 6" :sm="24" :style="{textAlign: advanced ? 'center' : 'left'}">
  105. <div class="table-page-search-submitButtons">
  106. <a-button type="primary" :disabled="disabled" @click="handleSearch">查询</a-button>
  107. <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
  108. <a @click="advanced=!advanced" style="margin-left: 8px">
  109. {{ advanced ? '收起' : '展开' }}
  110. <a-icon :type="advanced ? 'up' : 'down'"/>
  111. </a>
  112. </div>
  113. </a-col>
  114. </a-row>
  115. </a-form-model>
  116. </div>
  117. </a-card>
  118. <a-card size="small" :bordered="false">
  119. <a-spin :spinning="spinning" tip="Loading...">
  120. <!-- 列表 -->
  121. <s-table
  122. class="sTable fixPagination"
  123. ref="table"
  124. :style="{ height: tableHeight+87+'px' }"
  125. size="small"
  126. :rowKey="(record) => record.no"
  127. rowKeyName="no"
  128. :columns="columns"
  129. :pageSize="30"
  130. :data="loadData"
  131. :scroll="{ y:tableHeight, x:1890 }"
  132. :defaultLoadData="false"
  133. bordered>
  134. <!-- 超时环节提示 -->
  135. <template slot="tip" slot-scope="text, record">
  136. <a-tooltip placement="top" v-if="record.dispatchOverDay*1!=0||record.sendOverDay*1!=0||record.settleOverDay*1!=0">
  137. <template slot="title">
  138. <div v-if="record.dispatchOverDay*1>0">已超时{{ record.dispatchOverDay }}天(要求销售单下推后3天内备货)</div>
  139. <div v-if="record.settleOverDay*1>0">已超时{{ record.settleOverDay }}天(要求销售单下推后2天内收款)</div>
  140. <div v-if="record.sendOverDay*1>0">已超时{{ record.sendOverDay }}天(要求销售单允许打印后3天内发货)</div>
  141. </template>
  142. <div class="statusBox">
  143. <a-icon type="exclamation-circle" theme="filled" :style="{color:'#ed1c24',fontSize:'18px',marginRight:'6px',display:'inlineBlock'}"/>
  144. <span v-if="record.dispatchOverDay*1>0">未备货</span>
  145. <span v-if="record.settleOverDay*1>0">未收款</span>
  146. <span v-if="record.sendOverDay*1>0">未发货</span>
  147. </div>
  148. </a-tooltip>
  149. <span v-else>--</span>
  150. </template>
  151. <!-- 销售单号 -->
  152. <template slot="salesBillNo" slot-scope="text, record">
  153. <span class="link-bule" @click="handleDetail(record,0)">{{ record.salesBillNo||'--' }}</span>
  154. <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
  155. </template>
  156. <!-- 备货单号 -->
  157. <template slot="dispatchBillNo" slot-scope="text, record">
  158. <span class="link-bule" @click="handleDetail(record,1)">{{ record.dispatchBillNo||'--' }}</span>
  159. </template>
  160. <!-- 发货单号 -->
  161. <template slot="sendBillNo" slot-scope="text, record">
  162. <span class="link-bule" @click="handleDetail(record,2)">{{ record.sendBillNo||'--' }}</span>
  163. </template>
  164. </s-table>
  165. <!-- 查看销售单或备货单详情 -->
  166. <commonModal
  167. :modalTit="detailType?'备货单详情':'销售单详情'"
  168. bodyPadding="10px"
  169. width="70%"
  170. :showFooter="false"
  171. :openModal="showDetailModal"
  172. @cancel="closeDetailModal">
  173. <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
  174. <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
  175. </commonModal>
  176. <!-- 发货单详情 -->
  177. <detailModal v-drag ref="detailModal" :openModal="showTipModal" @cancel="showTipModal=false" @ok="sendSuccess"></detailModal>
  178. </a-spin>
  179. </a-card>
  180. </div>
  181. </template>
  182. <script>
  183. import { commonMixin } from '@/utils/mixin'
  184. import moment from 'moment'
  185. import getDate from '@/libs/getDate.js'
  186. import rangeDate from '@/views/common/rangeDate.vue'
  187. import { STable, VSelect } from '@/components'
  188. import subarea from '@/views/common/subarea.js'
  189. import Area from '@/views/common/area.js'
  190. import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
  191. import commonModal from '@/views/common/commonModal.vue'
  192. import customerService from '@/views/common/customerService.vue'
  193. import salesDetail from '@/views/salesManagement/salesQueryNew/detailAll.vue'
  194. import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
  195. import detailModal from '@/views/salesManagement/sendOutOrder/detailModal.vue'
  196. import { salesOverviewQueryPage } from '@/api/salesNew'
  197. export default {
  198. name: 'SalesListManagementList',
  199. mixins: [commonMixin],
  200. components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, dispatchDetail, commonModal, Area, salesDetail, detailModal, customerService },
  201. data () {
  202. return {
  203. spinning: false,
  204. advanced: true, // 高级搜索 展开/关闭
  205. disabled: false, // 查询、重置按钮是否可操作
  206. showDetailModal: false,
  207. showTipModal: false,
  208. bizSn: null,
  209. tableHeight: 0,
  210. detailType: 0,
  211. examineTime: [],
  212. paymentTime: [],
  213. rules: {
  214. 'time': [{ required: true, message: '请选择退货完成时间', trigger: 'change' }]
  215. },
  216. // 查询参数
  217. queryParam: {
  218. time: [
  219. moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
  220. moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
  221. ],
  222. submitBeginDate: getDate.getCurrMonthDays().starttime,
  223. submitEndDate: getDate.getCurrMonthDays().endtime,
  224. salesBillNo: '', // 销售单号
  225. subareaSn: undefined,
  226. subareaAreaSn: undefined,
  227. buyerSn: undefined, // 收货客户
  228. buyerName: undefined,
  229. financialStatus: undefined, // 财务状态
  230. auditBeginDate: undefined, // 审核时间
  231. auditEndDate: undefined,
  232. beginDate: undefined, // 收款开始时间
  233. endDate: undefined,
  234. billStatus: undefined, // 业务状态
  235. sendFlag: '', // 发货状态
  236. promoFlag: undefined,
  237. provinceSn: undefined, // 省份
  238. timeoutflag: undefined // 超时环节提醒
  239. },
  240. // 加载数据方法 必须为 Promise 对象
  241. loadData: parameter => {
  242. this.disabled = true
  243. this.spinning = true
  244. return salesOverviewQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
  245. let data
  246. if (res.status == 200) {
  247. data = res.data
  248. const no = (data.pageNo - 1) * data.pageSize
  249. for (var i = 0; i < data.list.length; i++) {
  250. data.list[i].no = no + i + 1
  251. }
  252. this.disabled = false
  253. }
  254. this.spinning = false
  255. return data
  256. })
  257. }
  258. }
  259. },
  260. computed: {
  261. columns () {
  262. const _this = this
  263. const arr = [
  264. { title: '超时环节提醒', scopedSlots: { customRender: 'tip' }, width: '160px', align: 'center', fixed: 'left' },
  265. { title: '提交时间', dataIndex: 'submitDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
  266. { title: '省份', dataIndex: 'provinceName', align: 'center', width: '80px', customRender: function (text) { return text || '--' }, fixed: 'left' },
  267. { title: '客户名称', dataIndex: 'buyerName', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
  268. { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '120px', align: 'center', fixed: 'left' },
  269. { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '120px', align: 'center' },
  270. { title: '发货单号', scopedSlots: { customRender: 'sendBillNo' }, width: '120px', align: 'center' },
  271. { title: '所在区域', dataIndex: 'subareaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  272. { title: '所在分区', dataIndex: 'subareaAreaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  273. { title: '仓库', dataIndex: 'warehouseName', width: '130px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  274. { title: '收货客户名称', dataIndex: 'receiverName', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  275. { title: '收款方式', dataIndex: 'settleStyleDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  276. { title: '审核时间', dataIndex: 'auditDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  277. { title: '下推数量', dataIndex: 'dispatchTotalQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  278. { title: '下推金额', dataIndex: 'dispatchTotalAmount', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
  279. { title: '收款金额', dataIndex: 'dispatchSettledAmount', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
  280. { title: '收款时间', dataIndex: 'dispatchSettleTime', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  281. { title: '备货允许打印时间', dataIndex: 'dispatchAllowPrintTime', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  282. { title: '备货时间', dataIndex: 'dispatchAuditDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  283. { title: '发货编号', dataIndex: 'dispatchSendNo', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
  284. { title: '发货创建时间', dataIndex: 'sendCreateDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  285. { title: '业务状态', dataIndex: 'billStatusDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  286. { title: '发货状态', dataIndex: 'sendFlagDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  287. { title: '托运日期', dataIndex: 'sendDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  288. { title: '收货人', dataIndex: 'sendCustomerContactName', width: '80px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  289. { title: '物流电话', dataIndex: 'sendTransportTele', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  290. { title: '物流单号', dataIndex: 'sendTransportNo', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  291. { title: '总件数', dataIndex: 'sendTotalQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  292. { title: '运费合计', dataIndex: 'sendTotalAmount', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
  293. { title: '收货状态', dataIndex: 'sendReceiveFlagDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  294. { title: '收货时间', dataIndex: 'sendReceiveDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  295. { title: '物流情况', dataIndex: 'sendTransportStateDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
  296. { title: '备注', dataIndex: 'sendRemarks', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
  297. ]
  298. return arr
  299. }
  300. },
  301. methods: {
  302. // 查询
  303. handleSearch () {
  304. const _this = this
  305. this.$refs.ruleForm.validate(valid => {
  306. if (valid) {
  307. _this.$refs.table.refresh(true)
  308. } else {
  309. _this.$message.error('请选择提交时间')
  310. return false
  311. }
  312. })
  313. },
  314. // 提交时间 change
  315. submitDateChange (date) {
  316. if (date[0] && date[1]) {
  317. this.queryParam.time = date
  318. } else {
  319. this.queryParam.time = []
  320. }
  321. this.queryParam.submitBeginDate = date[0] || ''
  322. this.queryParam.submitEndDate = date[1] || ''
  323. },
  324. // 审核时间 change
  325. processDateChange (date) {
  326. this.queryParam.auditBeginDate = date[0]
  327. this.queryParam.auditEndDate = date[1]
  328. },
  329. // 收款开始时间 change
  330. collectionDateChange (date) {
  331. this.queryParam.beginDate = date[0]
  332. this.queryParam.endDate = date[1]
  333. },
  334. custChange (val) {
  335. if (val.row) {
  336. this.queryParam.buyerSn = val.row.dealerSn
  337. this.queryParam.buyerName = undefined
  338. } else {
  339. this.queryParam.buyerSn = undefined
  340. this.queryParam.buyerName = val.key
  341. }
  342. },
  343. // 详情
  344. handleDetail (row, type) {
  345. this.detailType = type
  346. if (type != 2) {
  347. this.bizSn = type == 0 ? row.salesBillSn : row.dispatchBillSn
  348. if (this.bizSn) {
  349. this.showDetailModal = true
  350. }
  351. } else {
  352. const infoObj = {
  353. sendBillSn: row.sendBillSn,
  354. customeName: row.buyerName
  355. }
  356. if (row.sendBillSn) {
  357. this.showTipModal = true
  358. this.$refs.detailModal.getDetail(infoObj, 1, '发货单详情')
  359. }
  360. }
  361. },
  362. closeDetailModal () {
  363. this.showDetailModal = false
  364. this.bizSn = null
  365. },
  366. sendSuccess () {
  367. this.showTipModal = false
  368. this.$refs.table.refresh()
  369. },
  370. subareaChange (val) {
  371. this.queryParam.subareaSn = val[0] ? val[0] : undefined
  372. this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
  373. },
  374. // 重置
  375. resetSearchForm () {
  376. this.queryParam.time = [
  377. getDate.getCurrMonthDays().starttime,
  378. getDate.getCurrMonthDays().endtime
  379. ]
  380. this.$refs.rangeDate.resetDate(this.queryParam.time)
  381. this.queryParam.submitBeginDate = getDate.getCurrMonthDays().starttime
  382. this.queryParam.submitEndDate = getDate.getCurrMonthDays().endtime
  383. this.queryParam.salesBillNo = ''
  384. this.queryParam.subareaSn = undefined
  385. this.queryParam.subareaAreaSn = undefined
  386. this.queryParam.buyerName = ''
  387. this.queryParam.buyerSn = undefined
  388. this.queryParam.financialStatus = undefined
  389. this.queryParam.auditBeginDate = undefined
  390. this.queryParam.auditEndDate = undefined
  391. this.queryParam.settleBeginDate = undefined
  392. this.queryParam.settleEndDate = undefined
  393. this.queryParam.billStatus = undefined
  394. this.queryParam.sendFlag = ''
  395. this.queryParam.promoFlag = undefined
  396. this.queryParam.provinceSn = undefined
  397. this.queryParam.timeoutflag = undefined
  398. this.examineTime = []
  399. this.paymentTime = []
  400. this.$refs.subarea.clearData()
  401. if (this.advanced) {
  402. this.$refs.dealerSubareaScopeList.resetForm()
  403. this.$refs.processRangeDate.resetDate()
  404. this.$refs.collectionRangeDate.resetDate()
  405. }
  406. this.$refs.table.refresh(true)
  407. },
  408. pageInit () {
  409. const _this = this
  410. this.$nextTick(() => { // 页面渲染完成后的回调
  411. _this.setTableH()
  412. })
  413. _this.resetSearchForm()
  414. },
  415. setTableH () {
  416. const tableSearchH = this.$refs.tableSearch.offsetHeight
  417. this.tableHeight = window.innerHeight - tableSearchH - 220
  418. }
  419. },
  420. watch: {
  421. advanced (newValue, oldValue) {
  422. const _this = this
  423. this.$nextTick(() => { // 页面渲染完成后的回调
  424. _this.setTableH()
  425. })
  426. },
  427. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  428. this.setTableH()
  429. }
  430. },
  431. mounted () {
  432. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  433. this.pageInit()
  434. }
  435. },
  436. activated () {
  437. // 如果是新页签打开,则重置当前页面
  438. if (this.$store.state.app.isNewTab) {
  439. this.pageInit()
  440. }
  441. // 仅刷新列表,不重置页面
  442. if (this.$store.state.app.updateList) {
  443. this.pageInit()
  444. this.$refs.table.refresh()
  445. }
  446. },
  447. beforeRouteEnter (to, from, next) {
  448. next(vm => {})
  449. }
  450. }
  451. </script>
  452. <style lang="less">
  453. .salesList-wrap{
  454. .statusBox{
  455. span{
  456. vertical-align:top;
  457. }
  458. span::after{
  459. content:'/';
  460. }
  461. span:last-child::after{
  462. content:'' !important;
  463. }
  464. }
  465. }
  466. </style>