|
@@ -3,7 +3,7 @@
|
|
<a-card size="small" :bordered="false" class="table-page-search-wrapper">
|
|
<a-card size="small" :bordered="false" class="table-page-search-wrapper">
|
|
<!-- 搜索条件 -->
|
|
<!-- 搜索条件 -->
|
|
<a-form-model
|
|
<a-form-model
|
|
- id="salesReturnReportList-form"
|
|
|
|
|
|
+ id="salesOutofStockReport-form"
|
|
ref="ruleForm"
|
|
ref="ruleForm"
|
|
class="form-model-con"
|
|
class="form-model-con"
|
|
layout="inline"
|
|
layout="inline"
|
|
@@ -20,12 +20,20 @@
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-model-item label="客户名称">
|
|
<a-form-model-item label="客户名称">
|
|
- <custList id="salesReturnReportList-buyerName" ref="custSatelliteList" @change="custSatelliteChange"></custList>
|
|
|
|
|
|
+ <custList id="salesOutofStockReport-buyerName" ref="custSatelliteList" @change="custSatelliteChange"></custList>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
- <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesReturnReportList-refresh">查询</a-button>
|
|
|
|
- <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnReportList-reset">重置</a-button>
|
|
|
|
|
|
+ <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesOutofStockReport-refresh">查询</a-button>
|
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesOutofStockReport-reset">重置</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ style="margin-left: 5px"
|
|
|
|
+ type="primary"
|
|
|
|
+ class="button-warning"
|
|
|
|
+ @click="handleExport"
|
|
|
|
+ :disabled="disabled"
|
|
|
|
+ :loading="exportLoading"
|
|
|
|
+ id="salesOutofStockReport-export">导出</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-form-model>
|
|
</a-form-model>
|
|
@@ -64,7 +72,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
|
|
import { downloadExcel } from '@/libs/JGPrint.js'
|
|
import { downloadExcel } from '@/libs/JGPrint.js'
|
|
import custList from '@/views/common/custList.vue'
|
|
import custList from '@/views/common/custList.vue'
|
|
import detailModal from './detailModal.vue'
|
|
import detailModal from './detailModal.vue'
|
|
-import { reportSalesReturnPageList, reportSalesReturnBillTotal, reportSalesReturnExport } from '@/api/reportData'
|
|
|
|
|
|
+import { salesOosQueryList, salesOosExport } from '@/api/reportData'
|
|
export default {
|
|
export default {
|
|
components: { STable, VSelect, rangeDate, custList, detailModal },
|
|
components: { STable, VSelect, rangeDate, custList, detailModal },
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
@@ -73,20 +81,14 @@ export default {
|
|
spinning: false,
|
|
spinning: false,
|
|
labelCol: { span: 8 },
|
|
labelCol: { span: 8 },
|
|
wrapperCol: { span: 16 },
|
|
wrapperCol: { span: 16 },
|
|
- advanced: false, // 高级搜索 展开/关闭
|
|
|
|
- tableHeight: 0,
|
|
|
|
queryParam: { // 查询条件
|
|
queryParam: { // 查询条件
|
|
time: [],
|
|
time: [],
|
|
beginDate: '',
|
|
beginDate: '',
|
|
endDate: '',
|
|
endDate: '',
|
|
- buyerNameCurrent: undefined, // 客户名称
|
|
|
|
- buyerSnCurrent: undefined, // 客户sn
|
|
|
|
- salesReturnNo: ''
|
|
|
|
- },
|
|
|
|
- openDetailModal: true,
|
|
|
|
- rules: {
|
|
|
|
- 'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
|
|
|
|
|
|
+ targetName: undefined, // 客户名称
|
|
|
|
+ targetSn: undefined // 客户sn
|
|
},
|
|
},
|
|
|
|
+ openDetailModal: false, // 详情弹窗
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
exportLoading: false,
|
|
exportLoading: false,
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
@@ -95,16 +97,13 @@ export default {
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
this.spinning = true
|
|
this.spinning = true
|
|
delete params.time
|
|
delete params.time
|
|
- return reportSalesReturnPageList(params).then(res => {
|
|
|
|
|
|
+ return salesOosQueryList(params).then(res => {
|
|
let data
|
|
let data
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
data = res.data
|
|
data = res.data
|
|
- // 总计
|
|
|
|
- this.getCount(params)
|
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
- data.list[i].inStockQty = data.list[i].totalQty
|
|
|
|
}
|
|
}
|
|
this.disabled = false
|
|
this.disabled = false
|
|
}
|
|
}
|
|
@@ -112,7 +111,9 @@ export default {
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- totalData: null // 合计
|
|
|
|
|
|
+ rules: {
|
|
|
|
+ 'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -120,9 +121,9 @@ export default {
|
|
const _this = this
|
|
const _this = this
|
|
const arr = [
|
|
const arr = [
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
- { title: '创建时间', dataIndex: 'auditTime', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '销售单号', dataIndex: 'salesReturnNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '客户名称', dataIndex: 'buyerName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
|
|
+ { title: '创建时间', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '销售单号', dataIndex: 'salesOosBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '客户名称', dataIndex: 'targetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '缺货次数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '缺货次数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '缺货数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '缺货数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '缺货金额', dataIndex: 'totalAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
{ title: '缺货金额', dataIndex: 'totalAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
@@ -132,18 +133,23 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 查询
|
|
|
|
+ handleSearch () {
|
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.info('请至少输入一个查询条件')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 查看详情
|
|
// 查看详情
|
|
handleDetail (row) {
|
|
handleDetail (row) {
|
|
this.openDetailModal = true
|
|
this.openDetailModal = true
|
|
- },
|
|
|
|
- // 合计
|
|
|
|
- getCount (params) {
|
|
|
|
- reportSalesReturnBillTotal(params).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.totalData = res.data
|
|
|
|
- } else {
|
|
|
|
- this.totalData = null
|
|
|
|
- }
|
|
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ _this.$refs.detailModal.getDetail(row)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 创建时间 change
|
|
// 创建时间 change
|
|
@@ -152,17 +158,6 @@ export default {
|
|
this.queryParam.beginDate = date[0] || ''
|
|
this.queryParam.beginDate = date[0] || ''
|
|
this.queryParam.endDate = date[1] || ''
|
|
this.queryParam.endDate = date[1] || ''
|
|
},
|
|
},
|
|
- // 查询
|
|
|
|
- handleSearch () {
|
|
|
|
- this.$refs.ruleForm.validate(valid => {
|
|
|
|
- if (valid) {
|
|
|
|
- this.$refs.table.refresh(true)
|
|
|
|
- } else {
|
|
|
|
- console.log('error submit!!')
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
custSatelliteChange (v, row) {
|
|
custSatelliteChange (v, row) {
|
|
if (row && row.customerSn) {
|
|
if (row && row.customerSn) {
|
|
this.queryParam.buyerSnCurrent = row.customerSn
|
|
this.queryParam.buyerSnCurrent = row.customerSn
|
|
@@ -178,12 +173,10 @@ export default {
|
|
this.queryParam.time = []
|
|
this.queryParam.time = []
|
|
this.queryParam.beginDate = ''
|
|
this.queryParam.beginDate = ''
|
|
this.queryParam.endDate = ''
|
|
this.queryParam.endDate = ''
|
|
- this.queryParam.salesReturnNo = ''
|
|
|
|
this.queryParam.buyerNameCurrent = undefined
|
|
this.queryParam.buyerNameCurrent = undefined
|
|
this.queryParam.buyerSnCurrent = undefined
|
|
this.queryParam.buyerSnCurrent = undefined
|
|
- this.$refs.custSatelliteList.resetForm()
|
|
|
|
this.$refs.ruleForm.resetFields()
|
|
this.$refs.ruleForm.resetFields()
|
|
- this.totalData = null
|
|
|
|
|
|
+ this.$refs.custSatelliteList.resetForm()
|
|
this.$refs.table.clearTable()
|
|
this.$refs.table.clearTable()
|
|
},
|
|
},
|
|
// 导出
|
|
// 导出
|
|
@@ -192,37 +185,22 @@ export default {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
const params = _this.queryParam
|
|
const params = _this.queryParam
|
|
- params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
|
|
|
|
_this.exportLoading = true
|
|
_this.exportLoading = true
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
- reportSalesReturnExport(params).then(res => {
|
|
|
|
- downloadExcel(res, '销售退货报表')
|
|
|
|
|
|
+ salesOosExport(params).then(res => {
|
|
|
|
+ downloadExcel(res, '销售缺货报表')
|
|
_this.exportLoading = false
|
|
_this.exportLoading = false
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- console.log('error submit!!')
|
|
|
|
|
|
+ this.$message.info('请至少输入一个查询条件')
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- pageInit () {}
|
|
|
|
- },
|
|
|
|
- mounted () {
|
|
|
|
- if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
|
- this.pageInit()
|
|
|
|
- this.resetSearchForm()
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- activated () {
|
|
|
|
- // 如果是新页签打开,则重置当前页面
|
|
|
|
- if (this.$store.state.app.isNewTab) {
|
|
|
|
- this.pageInit()
|
|
|
|
- this.resetSearchForm()
|
|
|
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
|
+ next(vm => {})
|
|
}
|
|
}
|
|
- },
|
|
|
|
- beforeRouteEnter (to, from, next) {
|
|
|
|
- next(vm => {})
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|