|
@@ -7,12 +7,18 @@
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="创建时间">
|
|
|
- <rangeDate :allowClear="isByCustQuery" :hasDisabledAreaTime="false" ref="rangeDate" :value="time" @change="dateChange" />
|
|
|
+ <rangeDate
|
|
|
+ id="salesManagementList-date"
|
|
|
+ :allowClear="isByCustQuery"
|
|
|
+ :hasDisabledAreaTime="false"
|
|
|
+ ref="rangeDate"
|
|
|
+ :value="time"
|
|
|
+ @change="dateChange" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="客户名称" :required="isByCustQuery">
|
|
|
- <custList ref="custList" style="width: 100%;" @change="custChange"></custList>
|
|
|
+ <custList id="salesManagementList-cust" ref="custList" style="width: 100%;" @change="custChange"></custList>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
@@ -23,12 +29,12 @@
|
|
|
<template v-if="advanced">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="审核时间">
|
|
|
- <rangeDate ref="auditRangeDate" v-model="auditTime" @change="auditDateChange" />
|
|
|
+ <rangeDate id="salesManagementList-auditTime" ref="auditRangeDate" v-model="auditTime" @change="auditDateChange" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="出库时间">
|
|
|
- <rangeDate ref="outWareRangeDate" v-model="outWareTime" @change="outWareDateChange" />
|
|
|
+ <rangeDate id="salesManagementList-outWareTime" ref="outWareRangeDate" v-model="outWareTime" @change="outWareDateChange" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
@@ -91,8 +97,8 @@
|
|
|
</template>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<span class="table-page-search-submitButtons">
|
|
|
- <a-button type="primary" :disabled="disabled" @click="searchForm">查询</a-button>
|
|
|
- <a-button style="margin-left: 5px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
|
|
|
+ <a-button id="salesManagementList-searchForm" type="primary" :disabled="disabled" @click="searchForm">查询</a-button>
|
|
|
+ <a-button id="salesManagementList-resetForm" style="margin-left: 5px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
|
|
|
<a-button
|
|
|
type="primary"
|
|
|
v-if="$hasPermissions('B_salesExport')"
|
|
@@ -113,9 +119,9 @@
|
|
|
<!-- 操作按钮 -->
|
|
|
<div class="table-operator" style="display:flex;align-items: center;justify-content: space-between;">
|
|
|
<div>
|
|
|
- <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(0)">新增(零售)</a-button>
|
|
|
- <a-button type="primary" class="button-warning" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(1)">新增(铺货)</a-button>
|
|
|
- <a-checkbox style="margin-left:10px;" v-model="isByCustQuery" id="sales-byCustQuery">按客户查询</a-checkbox>
|
|
|
+ <a-button id="salesManagementList-new" type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(0)">新增(零售)</a-button>
|
|
|
+ <a-button id="salesManagementList-new1" type="primary" class="button-warning" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(1)">新增(铺货)</a-button>
|
|
|
+ <a-checkbox id="salesManagementList-custQuery" style="margin-left:10px;" v-model="isByCustQuery">按客户查询</a-checkbox>
|
|
|
<a-popover placement="right">
|
|
|
<template slot="content">
|
|
|
使用此查询时,时间可清空,必须选择一个客户
|
|
@@ -125,10 +131,10 @@
|
|
|
</div>
|
|
|
<div>
|
|
|
<a-dropdown v-model="showCell">
|
|
|
- <a-button type="link" class="button-default"> <a-icon type="setting" /> 显示</a-button>
|
|
|
+ <a-button id="salesManagementList-showCell" type="link" class="button-default"> <a-icon type="setting" /> 显示</a-button>
|
|
|
<a-menu slot="overlay">
|
|
|
<a-menu-item>
|
|
|
- <a-checkbox v-model="showDiscount" id="salesQuery-edit-discount">折后总售价</a-checkbox>
|
|
|
+ <a-checkbox v-model="showDiscount" id="salesManagementList-discount">折后总售价</a-checkbox>
|
|
|
</a-menu-item>
|
|
|
</a-menu>
|
|
|
</a-dropdown>
|
|
@@ -160,7 +166,7 @@
|
|
|
bordered>
|
|
|
<!-- 销售单号 -->
|
|
|
<template slot="salesBillNo" slot-scope="text, record">
|
|
|
- <span class="table-td-link" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
|
|
|
+ <span id="salesManagementList-viewDetail" class="table-td-link" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
|
|
|
<span v-else>{{ record.salesBillNo }}</span>
|
|
|
<a-badge count="改" :number-style="{ zoom:'80%',marginLeft:'5px' }" v-if="record.billStatus=='SUPERIOR_CHANGE'"></a-badge>
|
|
|
</template>
|
|
@@ -187,12 +193,14 @@
|
|
|
size="small"
|
|
|
type="link"
|
|
|
class="button-primary"
|
|
|
+ :id="'salesManagementList-audit-'+record.salesBillNo"
|
|
|
v-if="record.billStatus == 'WAIT_AUDIT' && $hasPermissions('B_salesAudit')"
|
|
|
@click="handleEexamine(record)"
|
|
|
>审核</a-button>
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
+ :id="'salesManagementList-sendOut-'+record.salesBillNo"
|
|
|
v-if="record.billStatus == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_salesStockOut')"
|
|
|
class="button-primary"
|
|
|
@click="handleSend(record)"
|
|
@@ -200,6 +208,7 @@
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
+ :id="'salesManagementList-edit-'+record.salesBillNo"
|
|
|
class="button-primary"
|
|
|
v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')"
|
|
|
@click="handleEdit(record)"
|
|
@@ -209,6 +218,7 @@
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
+ :id="'salesManagementList-del-'+record.salesBillNo"
|
|
|
class="button-error"
|
|
|
v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel')"
|
|
|
@click="handleDel(record)"
|
|
@@ -218,6 +228,7 @@
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
+ :id="'salesManagementList-edit1-'+record.salesBillNo"
|
|
|
class="button-primary"
|
|
|
v-if="((record.sourceType == 'CHILD_PURCHASE'||record.sourceType == 'DEALER_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesEdit')"
|
|
|
@click="handleEdit(record)"
|
|
@@ -227,6 +238,7 @@
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
+ :id="'salesManagementList-cancel-'+record.salesBillNo"
|
|
|
class="button-error"
|
|
|
v-if="((record.sourceType == 'CHILD_PURCHASE'||record.sourceType == 'DEALER_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel')"
|
|
|
@click="handleDel(record, 'cancel')"
|
|
@@ -248,16 +260,17 @@
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
+import moment from 'moment'
|
|
|
import getDate from '@/libs/getDate.js'
|
|
|
+import { downloadExcel } from '@/libs/JGPrint.js'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import chooseCustomModal from './chooseCustomModal.vue'
|
|
|
import auditModal from '@/views/common/auditModal.vue'
|
|
|
-import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount, salesExport } from '@/api/sales'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
import custList from '@/views/common/custList.vue'
|
|
|
-import { downloadExcel } from '@/libs/JGPrint.js'
|
|
|
import stateIcon from '@/views/common/stateIcon'
|
|
|
-import moment from 'moment'
|
|
|
+// 接口
|
|
|
+import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount, salesExport } from '@/api/sales'
|
|
|
export default {
|
|
|
name: 'SalesList',
|
|
|
components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal, custList, stateIcon },
|
|
@@ -265,44 +278,44 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
- tableHeight: 0,
|
|
|
+ tableHeight: 0, // 表格高度
|
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
exportLoading: false, // 导出loading
|
|
|
openModal: false, // 选择客户弹框是否显示
|
|
|
isByCustQuery: false, // 是否按客户查询
|
|
|
- showDiscount: false,
|
|
|
- showCell: false,
|
|
|
- time: [
|
|
|
+ showDiscount: false, // 是否显示折后总售价
|
|
|
+ showCell: false, // 是否显示自定义列
|
|
|
+ time: [ // 创建时间
|
|
|
getDate.getMonthDays(3).starttime,
|
|
|
getDate.getMonthDays(3).endtime
|
|
|
],
|
|
|
- auditTime: [],
|
|
|
- outWareTime: [],
|
|
|
+ auditTime: [], // 审核时间
|
|
|
+ outWareTime: [], // 出库时间
|
|
|
// 查询参数
|
|
|
queryParam: {
|
|
|
- beginDate: getDate.getMonthDays(3).starttime,
|
|
|
- endDate: getDate.getMonthDays(3).endtime,
|
|
|
- auditBeginDate: '',
|
|
|
- auditEndDate: '',
|
|
|
- outWarehouseBeginDate: '',
|
|
|
- outWarehouseEndDate: '',
|
|
|
+ beginDate: getDate.getMonthDays(3).starttime, // 开始时间
|
|
|
+ endDate: getDate.getMonthDays(3).endtime, // 结束时间
|
|
|
+ auditBeginDate: '', // 审核开始时间
|
|
|
+ auditEndDate: '', // 审核结束时间
|
|
|
+ outWarehouseBeginDate: '', // 出库开始时间
|
|
|
+ outWarehouseEndDate: '', // 出库结束时间
|
|
|
buyerNameCurrent: undefined, // 客户名称
|
|
|
- buyerSn: undefined,
|
|
|
+ buyerSn: undefined, // 客户sn
|
|
|
salesBillNo: '', // 销售单号
|
|
|
purchaseBillNo: '', // 采购单号
|
|
|
payType: undefined, // 支付方式
|
|
|
settleStyleSn: undefined, // 收款方式
|
|
|
billStatus: undefined, // 业务状态
|
|
|
financialStatus: undefined, // 财务状态
|
|
|
- sourceType: undefined,
|
|
|
- distributionFlag: undefined
|
|
|
+ sourceType: undefined, // 单据来源
|
|
|
+ distributionFlag: undefined // 是否铺货出库
|
|
|
},
|
|
|
totalData: {
|
|
|
- totalAmount: 0,
|
|
|
- totalCategory: 0,
|
|
|
- totalQty: 0,
|
|
|
- totalRecord: 0
|
|
|
+ totalAmount: 0, // 总金额
|
|
|
+ totalCategory: 0, // 总类目
|
|
|
+ totalQty: 0, // 总数量
|
|
|
+ totalRecord: 0 // 总条数
|
|
|
},
|
|
|
selType: '0', // 0零售 1铺货
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
@@ -313,6 +326,7 @@ export default {
|
|
|
salesCount(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
this.totalData = res.data
|
|
|
})
|
|
|
+ // 查询列表
|
|
|
return salesList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
@@ -327,10 +341,10 @@ export default {
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
|
- visibleAudit: false,
|
|
|
- auditInfo: null,
|
|
|
- spinningAudit: false,
|
|
|
- distributionFlag: '0'
|
|
|
+ visibleAudit: false, // 审核弹框
|
|
|
+ auditInfo: null, // 当前审核的数据
|
|
|
+ spinningAudit: false, // 审核loading
|
|
|
+ distributionFlag: '0' // 是否铺货出库
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -367,23 +381,25 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- // 时间 change
|
|
|
+ // 选择创建时间
|
|
|
dateChange (date) {
|
|
|
this.queryParam.beginDate = date[0]
|
|
|
this.queryParam.endDate = date[1]
|
|
|
},
|
|
|
+ // 选择审核时间
|
|
|
auditDateChange (date) {
|
|
|
this.auditTime = date
|
|
|
this.queryParam.auditBeginDate = date[0]
|
|
|
this.queryParam.auditEndDate = date[1]
|
|
|
},
|
|
|
+ // 选择出库时间
|
|
|
outWareDateChange (date) {
|
|
|
this.outWareTime = date
|
|
|
this.queryParam.outWarehouseBeginDate = date[0]
|
|
|
this.queryParam.outWarehouseEndDate = date[1]
|
|
|
},
|
|
|
+ // 选择客户
|
|
|
custChange (v, row) {
|
|
|
- console.log(v, row)
|
|
|
if (row && row.customerSn) {
|
|
|
this.queryParam.buyerSn = row.customerSn
|
|
|
this.queryParam.buyerNameCurrent = undefined
|
|
@@ -392,16 +408,17 @@ export default {
|
|
|
this.queryParam.buyerSn = undefined
|
|
|
}
|
|
|
},
|
|
|
- // 新增
|
|
|
+ // 新增弹框
|
|
|
handleAdd (flag) {
|
|
|
this.openModal = true
|
|
|
this.distributionFlag = flag
|
|
|
},
|
|
|
- // 审核
|
|
|
+ // 审核操作
|
|
|
handleEexamine (row) {
|
|
|
this.auditInfo = row
|
|
|
this.visibleAudit = true
|
|
|
},
|
|
|
+ // 提交审核接口
|
|
|
auditOrder (billStatus) {
|
|
|
this.spinningAudit = true
|
|
|
salesWriteAudit({
|
|
@@ -435,10 +452,8 @@ export default {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
_this.$refs.table.refresh()
|
|
|
- _this.spinning = false
|
|
|
- } else {
|
|
|
- _this.spinning = false
|
|
|
}
|
|
|
+ _this.spinning = false
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -481,7 +496,9 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 查询按钮
|
|
|
searchForm () {
|
|
|
+ // 是否按客户查询
|
|
|
if (!this.isByCustQuery) {
|
|
|
const a = moment(this.queryParam.beginDate)
|
|
|
const b = moment(this.queryParam.endDate)
|
|
@@ -533,6 +550,7 @@ export default {
|
|
|
this.queryParam.distributionFlag = undefined
|
|
|
this.$refs.custList.resetForm()
|
|
|
if (!flag) {
|
|
|
+ // 重置单据状态
|
|
|
this.setIsHomeNav(this.$route.name, null)
|
|
|
}
|
|
|
},
|
|
@@ -561,10 +579,12 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 表格高度
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
this.tableHeight = window.innerHeight - tableSearchH - 265
|
|
|
},
|
|
|
+ // 页面初始
|
|
|
pageInit () {
|
|
|
const _this = this
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
@@ -576,7 +596,6 @@ export default {
|
|
|
const b = this.$store.state.app.updateList
|
|
|
// 是否从首页点击进入
|
|
|
const isHomeNav = this.getIsHomeNav()[this.$route.name]
|
|
|
- console.log(isHomeNav)
|
|
|
// 从首页进入,判断式新建还式待办查询
|
|
|
if (isHomeNav) {
|
|
|
// 新增
|