|
@@ -1,10 +1,10 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <a-card size="small" :bordered="false" class="rebateAmountList-wrap searchBoxNormal">
|
|
|
|
|
|
+ <a-card size="small" :bordered="false" class="estimatedOrderList-wrap searchBoxNormal">
|
|
<!-- 搜索条件 -->
|
|
<!-- 搜索条件 -->
|
|
<div class="table-page-search-wrapper" ref="tableSearch">
|
|
<div class="table-page-search-wrapper" ref="tableSearch">
|
|
<a-form-model
|
|
<a-form-model
|
|
- id="rebateAmountList-form"
|
|
|
|
|
|
+ id="estimatedOrderList-form"
|
|
ref="ruleForm"
|
|
ref="ruleForm"
|
|
class="form-model-con"
|
|
class="form-model-con"
|
|
layout="inline"
|
|
layout="inline"
|
|
@@ -14,13 +14,12 @@
|
|
<a-col :md="5" :sm="24">
|
|
<a-col :md="5" :sm="24">
|
|
<a-form-model-item label="年份" prop="confYear">
|
|
<a-form-model-item label="年份" prop="confYear">
|
|
<a-select
|
|
<a-select
|
|
- id="yearQueryList-time"
|
|
|
|
|
|
+ id="estimatedOrderList-confYear"
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
placeholder="请选择年份"
|
|
placeholder="请选择年份"
|
|
:value="queryParam.confYear"
|
|
:value="queryParam.confYear"
|
|
- @change="changeYear"
|
|
|
|
- allowClear>
|
|
|
|
- <a-select-option v-for="item in years" :value="item" :key="item">
|
|
|
|
|
|
+ @change="changeYear">
|
|
|
|
+ <a-select-option :id="'estimatedOrderList-'+item" v-for="item in years" :value="item" :key="item">
|
|
{{ item }}
|
|
{{ item }}
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
@@ -29,14 +28,14 @@
|
|
<a-col :md="4" :sm="24">
|
|
<a-col :md="4" :sm="24">
|
|
<a-button
|
|
<a-button
|
|
type="primary"
|
|
type="primary"
|
|
- @click="$refs.table.refresh(true)"
|
|
|
|
|
|
+ @click="handleSearch"
|
|
:disabled="disabled"
|
|
:disabled="disabled"
|
|
- id="rebateAmountList-refresh">查询</a-button>
|
|
|
|
|
|
+ id="estimatedOrderList-refresh">查询</a-button>
|
|
<a-button
|
|
<a-button
|
|
style="margin-left: 8px"
|
|
style="margin-left: 8px"
|
|
@click="resetSearchForm"
|
|
@click="resetSearchForm"
|
|
:disabled="disabled"
|
|
:disabled="disabled"
|
|
- id="rebateAmountList-reset">重置</a-button>
|
|
|
|
|
|
+ id="estimatedOrderList-reset">重置</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-form-model>
|
|
</a-form-model>
|
|
@@ -56,8 +55,8 @@
|
|
:data="loadData"
|
|
:data="loadData"
|
|
:scroll="{ y: tableHeight}"
|
|
:scroll="{ y: tableHeight}"
|
|
:defaultLoadData="false"
|
|
:defaultLoadData="false"
|
|
|
|
+ :showPagination="false"
|
|
bordered>
|
|
bordered>
|
|
- <!-- $hasPermissions('B_tireSubsidySetting_edit')&& -->
|
|
|
|
<!-- 1月~12月 -->
|
|
<!-- 1月~12月 -->
|
|
<template
|
|
<template
|
|
v-for="col in 12"
|
|
v-for="col in 12"
|
|
@@ -70,9 +69,11 @@
|
|
v-if="record.editable"
|
|
v-if="record.editable"
|
|
size="small"
|
|
size="small"
|
|
:min="0"
|
|
:min="0"
|
|
- :max="99999999"
|
|
|
|
|
|
+ :max="999999999"
|
|
placeholder="请输入"
|
|
placeholder="请输入"
|
|
|
|
+ :precision="0"
|
|
:value="text"
|
|
:value="text"
|
|
|
|
+ :id="'estimatedOrderList-input-'+record.id"
|
|
@change="e => handleChange(e,record, col)" />
|
|
@change="e => handleChange(e,record, col)" />
|
|
<template v-else>
|
|
<template v-else>
|
|
{{ text }}
|
|
{{ text }}
|
|
@@ -87,27 +88,22 @@
|
|
type="link"
|
|
type="link"
|
|
class="button-info"
|
|
class="button-info"
|
|
@click="handleSave(record)"
|
|
@click="handleSave(record)"
|
|
- :id="'rebateAmountList-edit-btn'+record.id"
|
|
|
|
|
|
+ :id="'estimatedOrderList-save-btn'+record.id"
|
|
>
|
|
>
|
|
保存
|
|
保存
|
|
</a-button>
|
|
</a-button>
|
|
- <a-button
|
|
|
|
- size="small"
|
|
|
|
- type="link"
|
|
|
|
- class="button-info"
|
|
|
|
- @click="handleCancel(record)"
|
|
|
|
- :id="'rebateAmountList-edit-btn'+record.id"
|
|
|
|
- >
|
|
|
|
- 取消
|
|
|
|
- </a-button>
|
|
|
|
|
|
+ <a-popconfirm title="确定取消吗?" :id="'estimatedOrderList-cancel-btn'+record.id" @confirm="() => handleCancel(record)">
|
|
|
|
+ <a>取消</a>
|
|
|
|
+ </a-popconfirm>
|
|
</span>
|
|
</span>
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
v-else
|
|
v-else
|
|
class="button-info"
|
|
class="button-info"
|
|
|
|
+ :disabled="editingKey !== ''"
|
|
@click="handleEdit(record)"
|
|
@click="handleEdit(record)"
|
|
- :id="'rebateAmountList-edit-btn'+record.id"
|
|
|
|
|
|
+ :id="'estimatedOrderList-edit-btn'+record.id"
|
|
>
|
|
>
|
|
编辑
|
|
编辑
|
|
</a-button>
|
|
</a-button>
|
|
@@ -120,12 +116,13 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
|
+import debounce from 'lodash/debounce'
|
|
// 组件
|
|
// 组件
|
|
import { STable } from '@/components'
|
|
import { STable } from '@/components'
|
|
// 接口
|
|
// 接口
|
|
import { reportDailyConfList, dailyReportConfSave } from '@/api/reportDailyConf'
|
|
import { reportDailyConfList, dailyReportConfSave } from '@/api/reportDailyConf'
|
|
export default {
|
|
export default {
|
|
- name: 'RebateAmountList',
|
|
|
|
|
|
+ name: 'EstimatedOrderList',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
components: { STable },
|
|
components: { STable },
|
|
props: {
|
|
props: {
|
|
@@ -136,12 +133,13 @@ export default {
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
const _this = this
|
|
const _this = this
|
|
|
|
+ _this.handleChange = debounce(_this.handleChange, 800)
|
|
return {
|
|
return {
|
|
spinning: false,
|
|
spinning: false,
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
tableHeight: 0, // 表格高度
|
|
tableHeight: 0, // 表格高度
|
|
- openRebateAddModal: false, // 新增弹窗
|
|
|
|
toYears: new Date().getFullYear(), // 今年
|
|
toYears: new Date().getFullYear(), // 今年
|
|
|
|
+ editingKey: '', // 按钮是否禁用
|
|
// 查询条件
|
|
// 查询条件
|
|
queryParam: {
|
|
queryParam: {
|
|
confType: undefined, // 页面类型
|
|
confType: undefined, // 页面类型
|
|
@@ -155,7 +153,7 @@ export default {
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- // 获取列表数据 有分页
|
|
|
|
|
|
+ // 获取列表数据 无分页
|
|
this.queryParam.confType = this.pageType
|
|
this.queryParam.confType = this.pageType
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
return reportDailyConfList(params).then(res => {
|
|
return reportDailyConfList(params).then(res => {
|
|
@@ -163,15 +161,18 @@ export default {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
data = res.data
|
|
data = res.data
|
|
// 计算表格序号
|
|
// 计算表格序号
|
|
- const no = (data.pageNo - 1) * data.pageSize
|
|
|
|
- for (var i = 0; i < data.list.length; i++) {
|
|
|
|
- data.list[i].no = no + i + 1
|
|
|
|
- data.list[i].editable = false
|
|
|
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
|
+ data[i].no = i + 1
|
|
|
|
+ data[i].editable = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this.dataSources = data
|
|
|
|
this.disabled = false
|
|
this.disabled = false
|
|
this.spinning = false
|
|
this.spinning = false
|
|
|
|
+ if (this.pageType === 'REGIONAL_ESTIMATED_ORDER') {
|
|
|
|
+ this.dataSources = this.processData(data, 'productTypeKey')
|
|
|
|
+ } else {
|
|
|
|
+ this.dataSources = data
|
|
|
|
+ }
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -203,18 +204,57 @@ export default {
|
|
{ title: '10月', dataIndex: 'value10', width: '8%', align: 'right', scopedSlots: { customRender: 'month10' } },
|
|
{ title: '10月', dataIndex: 'value10', width: '8%', align: 'right', scopedSlots: { customRender: 'month10' } },
|
|
{ title: '11月', dataIndex: 'value11', width: '8%', align: 'right', scopedSlots: { customRender: 'month11' } },
|
|
{ title: '11月', dataIndex: 'value11', width: '8%', align: 'right', scopedSlots: { customRender: 'month11' } },
|
|
{ title: '12月', dataIndex: 'value12', width: '8%', align: 'right', scopedSlots: { customRender: 'month12' } },
|
|
{ title: '12月', dataIndex: 'value12', width: '8%', align: 'right', scopedSlots: { customRender: 'month12' } },
|
|
- { title: '合计', dataIndex: 'summation', width: '11%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
|
|
|
+ { title: '合计', dataIndex: 'summation', width: '11%', align: 'right', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '11%', align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '11%', align: 'center' }
|
|
]
|
|
]
|
|
if (_this.pageType === 'REGIONAL_ESTIMATED_ORDER') {
|
|
if (_this.pageType === 'REGIONAL_ESTIMATED_ORDER') {
|
|
- arr.splice(0, 0, { title: '品类', dataIndex: 'productTypeName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
|
|
|
|
|
|
+ arr.splice(0, 0, { title: '品类',
|
|
|
|
+ dataIndex: 'productTypeName',
|
|
|
|
+ width: '12%',
|
|
|
|
+ align: 'center',
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ customRender: (value, row, index) => ({
|
|
|
|
+ children: value,
|
|
|
|
+ attrs: { rowSpan: row.rowSpan }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
}
|
|
}
|
|
return arr
|
|
return arr
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 添加数据处理方法
|
|
|
|
+ processData (data, field) {
|
|
|
|
+ let count = 0
|
|
|
|
+ data.forEach((item, index) => {
|
|
|
|
+ if (index === 0 || item[field] !== data[index - 1][field]) {
|
|
|
|
+ count = 1
|
|
|
|
+ // 向后查找相同项
|
|
|
|
+ for (let i = index + 1; i < data.length; i++) {
|
|
|
|
+ if (item[field] === data[i][field]) count++
|
|
|
|
+ else break
|
|
|
|
+ }
|
|
|
|
+ item.rowSpan = count // 设置合并行数
|
|
|
|
+ } else {
|
|
|
|
+ item.rowSpan = 0 // 后续相同项设置为0(不渲染)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ return data
|
|
|
|
+ },
|
|
|
|
+ // 查询
|
|
|
|
+ handleSearch () {
|
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error('请选择年份')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 选择查询年份 change
|
|
// 选择查询年份 change
|
|
changeYear (val) {
|
|
changeYear (val) {
|
|
|
|
+ this.editingKey = ''
|
|
if (!val) {
|
|
if (!val) {
|
|
this.queryParam.confYear = void 0
|
|
this.queryParam.confYear = void 0
|
|
} else {
|
|
} else {
|
|
@@ -223,15 +263,26 @@ export default {
|
|
},
|
|
},
|
|
// 编辑
|
|
// 编辑
|
|
handleEdit (row) {
|
|
handleEdit (row) {
|
|
|
|
+ this.editingKey = row.no
|
|
row.editable = true
|
|
row.editable = true
|
|
},
|
|
},
|
|
// 保存
|
|
// 保存
|
|
handleSave (row) {
|
|
handleSave (row) {
|
|
- row.editable = false
|
|
|
|
|
|
+ row.confYear = this.queryParam.confYear
|
|
|
|
+ dailyReportConfSave(row).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.$message.success(res.message)
|
|
|
|
+ row.editable = false
|
|
|
|
+ this.editingKey = ''
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 取消
|
|
// 取消
|
|
handleCancel (row) {
|
|
handleCancel (row) {
|
|
row.editable = false
|
|
row.editable = false
|
|
|
|
+ this.editingKey = ''
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
// input change事件
|
|
// input change事件
|
|
handleChange (val, row, column) {
|
|
handleChange (val, row, column) {
|
|
@@ -239,7 +290,7 @@ export default {
|
|
const newColumn = _this.padZero(column)
|
|
const newColumn = _this.padZero(column)
|
|
row['value' + newColumn] = val
|
|
row['value' + newColumn] = val
|
|
row.summation = _this.calculateTotal(row)
|
|
row.summation = _this.calculateTotal(row)
|
|
- _this.dataSources[column * 1 - 1] = row
|
|
|
|
|
|
+ // _this.dataSources[column * 1 - 1] = row
|
|
},
|
|
},
|
|
// 补零方法
|
|
// 补零方法
|
|
padZero (num) {
|
|
padZero (num) {
|
|
@@ -256,6 +307,7 @@ export default {
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
this.queryParam.confType = undefined
|
|
this.queryParam.confType = undefined
|
|
this.queryParam.confYear = new Date().getFullYear()
|
|
this.queryParam.confYear = new Date().getFullYear()
|
|
|
|
+ this.$refs.ruleForm.resetFields()
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
// 初始化
|
|
// 初始化
|
|
@@ -276,3 +328,8 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+::v-deep.button-info[disabled] {
|
|
|
|
+ color: gray;
|
|
|
|
+}
|
|
|
|
+</style>
|