list.vue 21 KB

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