list.vue 21 KB

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