|
@@ -3,7 +3,7 @@
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
<a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
|
|
<a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
|
|
<template slot="subTitle">
|
|
<template slot="subTitle">
|
|
- <a href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
|
|
|
|
+ <a href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
</template>
|
|
</template>
|
|
</a-page-header>
|
|
</a-page-header>
|
|
<a-card size="small" :bordered="false" class="pages-wrap">
|
|
<a-card size="small" :bordered="false" class="pages-wrap">
|
|
@@ -54,43 +54,42 @@
|
|
<!-- 产品列表 -->
|
|
<!-- 产品列表 -->
|
|
<div style="padding:0 0 5px;">
|
|
<div style="padding:0 0 5px;">
|
|
<span>
|
|
<span>
|
|
- 已选 <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ rowSelectionInfo.selectedRowKeys.length }}</template><template v-else>0</template> 项
|
|
|
|
|
|
+ 已选 <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ rowSelectionInfo.selectedRowKeys.length }}</template><template v-else>0</template> 项
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
- <s-table
|
|
|
|
- class="sTable fixPagination"
|
|
|
|
- ref="table"
|
|
|
|
- :style="{ height: pageHeight+67+'px' }"
|
|
|
|
- size="small"
|
|
|
|
- :rowKey="(record) => record.no"
|
|
|
|
- rowKeyName="no"
|
|
|
|
- :columns="columns"
|
|
|
|
- :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: curExpenseAccountType ? record.convertExpenseAccountType != curExpenseAccountType : false } }) }"
|
|
|
|
- @rowSelection="rowSelectionFun"
|
|
|
|
- :data="loadData"
|
|
|
|
- :scroll="{ y: pageHeight }"
|
|
|
|
- :defaultLoadData="false"
|
|
|
|
- bordered>
|
|
|
|
- <!-- 操作 -->
|
|
|
|
- <template slot="action" slot-scope="text, record">
|
|
|
|
- <div>
|
|
|
|
- <a-button
|
|
|
|
- size="small"
|
|
|
|
- type="link"
|
|
|
|
- class="button-warning"
|
|
|
|
- @click="handleSave(record)"
|
|
|
|
- >转费用报销单</a-button>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </s-table>
|
|
|
|
|
|
+ <s-table
|
|
|
|
+ class="sTable fixPagination"
|
|
|
|
+ ref="table"
|
|
|
|
+ :style="{ height: pageHeight+67+'px' }"
|
|
|
|
+ size="small"
|
|
|
|
+ :rowKey="(record) => record.no"
|
|
|
|
+ rowKeyName="no"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: curExpenseAccountType ? record.convertExpenseAccountType != curExpenseAccountType : false } }) }"
|
|
|
|
+ @rowSelection="rowSelectionFun"
|
|
|
|
+ :data="loadData"
|
|
|
|
+ :scroll="{ y: pageHeight }"
|
|
|
|
+ :defaultLoadData="false"
|
|
|
|
+ bordered>
|
|
|
|
+ <!-- 操作 -->
|
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
|
+ <div>
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-warning"
|
|
|
|
+ @click="handleSave(record)"
|
|
|
|
+ >转费用报销单</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </s-table>
|
|
</div>
|
|
</div>
|
|
</a-card>
|
|
</a-card>
|
|
</a-spin>
|
|
</a-spin>
|
|
<div class="affix-cont" :style="{padding:hideFooter?0:'7px 0 4px'}">
|
|
<div class="affix-cont" :style="{padding:hideFooter?0:'7px 0 4px'}">
|
|
<a-button
|
|
<a-button
|
|
style="width: 100px;"
|
|
style="width: 100px;"
|
|
- :disabled="!hasSelect"
|
|
|
|
type="primary"
|
|
type="primary"
|
|
class="button-info"
|
|
class="button-info"
|
|
@click="handleView()"
|
|
@click="handleView()"
|
|
@@ -131,8 +130,8 @@ export default {
|
|
disabled: false,
|
|
disabled: false,
|
|
hideFooter: false,
|
|
hideFooter: false,
|
|
openBaseModal: false, // 费用弹框
|
|
openBaseModal: false, // 费用弹框
|
|
- fromRouter:'',
|
|
|
|
- authCode:'',
|
|
|
|
|
|
+ fromRouter: '',
|
|
|
|
+ authCode: '',
|
|
queryParam: {
|
|
queryParam: {
|
|
promotionDescription: '',
|
|
promotionDescription: '',
|
|
convertExpenseAccountType: '',
|
|
convertExpenseAccountType: '',
|
|
@@ -162,27 +161,28 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
rowSelectionInfo: null,
|
|
rowSelectionInfo: null,
|
|
- curExpenseAccountType:'',
|
|
|
|
|
|
+ curExpenseAccountType: '',
|
|
pageHeight: 300,
|
|
pageHeight: 300,
|
|
- showViewModal: false
|
|
|
|
|
|
+ showViewModal: false,
|
|
|
|
+ isSearch: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- hasSelect(){
|
|
|
|
|
|
+ hasSelect () {
|
|
return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
|
|
return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
|
|
},
|
|
},
|
|
columns () {
|
|
columns () {
|
|
const _this = this
|
|
const _this = this
|
|
const arr = [
|
|
const arr = [
|
|
- { title: '编号', dataIndex: 'no', width: '5%', align: 'center', customRender: function (text) { return text || '--' }},
|
|
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '销售单号', dataIndex: 'salesBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '销售单号', dataIndex: 'salesBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '客户名称', dataIndex: 'buyerName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '客户名称', dataIndex: 'buyerName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
- { title: '费用类型', dataIndex: 'convertExpenseAccountTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' }},
|
|
|
|
- { title: '待转金额', dataIndex: 'totalAmount', width: '8%', align: 'right',customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
|
|
|
+ { title: '费用类型', dataIndex: 'convertExpenseAccountTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '待转金额', dataIndex: 'expense', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
{ title: '促销名称', dataIndex: 'promotionTitle', width: '17%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
{ title: '促销名称', dataIndex: 'promotionTitle', width: '17%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
{ title: '促销简称', dataIndex: 'promotionDescription', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, sorter: true },
|
|
{ title: '促销简称', dataIndex: 'promotionDescription', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, sorter: true },
|
|
{ title: '规则简称', dataIndex: 'promotionRuleDescription', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, sorter: true },
|
|
{ title: '规则简称', dataIndex: 'promotionRuleDescription', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, sorter: true },
|
|
- { title: '规则类型', dataIndex: 'promotionRuleTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
|
|
+ { title: '促销类型', dataIndex: 'promotionRuleTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
|
|
]
|
|
]
|
|
return arr
|
|
return arr
|
|
@@ -194,24 +194,40 @@ export default {
|
|
this.$router.push({ name: 'salesQueryNewList' })
|
|
this.$router.push({ name: 'salesQueryNewList' })
|
|
},
|
|
},
|
|
getPageHeight () {
|
|
getPageHeight () {
|
|
- this.pageHeight = window.innerHeight - 290 - ( this.$refs.searchbox ? this.$refs.searchbox.clientHeight : 0 );
|
|
|
|
|
|
+ this.pageHeight = window.innerHeight - 290 - (this.$refs.searchbox ? this.$refs.searchbox.clientHeight : 0)
|
|
},
|
|
},
|
|
// 表格选中项
|
|
// 表格选中项
|
|
rowSelectionFun (obj) {
|
|
rowSelectionFun (obj) {
|
|
|
|
+ console.log(obj)
|
|
this.rowSelectionInfo = obj || null
|
|
this.rowSelectionInfo = obj || null
|
|
- this.curExpenseAccountType = obj.selectedRows&&obj.selectedRows[0]&&obj.selectedRows[0]['convertExpenseAccountType'] || ''
|
|
|
|
|
|
+ if (obj.selectedRows) {
|
|
|
|
+ this.curExpenseAccountType = obj.selectedRows && obj.selectedRows[0] && obj.selectedRows[0]['convertExpenseAccountType'] || ''
|
|
|
|
+ if (obj.selectedRows.length <= 1) {
|
|
|
|
+ if (!this.isSearch) {
|
|
|
|
+ this.$refs.table.refresh()
|
|
|
|
+ }
|
|
|
|
+ this.isSearch = false
|
|
|
|
+ } else {
|
|
|
|
+ // 全选
|
|
|
|
+ const ret = obj.selectedRows.filter(item => item.convertExpenseAccountType == this.curExpenseAccountType)
|
|
|
|
+ if (ret.length != obj.selectedRows.length) {
|
|
|
|
+ this.$message.warning('费用类型不一致,请重新勾选!')
|
|
|
|
+ this.$refs.table.clearSelected()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
custChange (val) {
|
|
custChange (val) {
|
|
this.queryParam.buyerName = val.name || ''
|
|
this.queryParam.buyerName = val.name || ''
|
|
},
|
|
},
|
|
// 提交
|
|
// 提交
|
|
- handleSave(row){
|
|
|
|
|
|
+ handleSave (row) {
|
|
const _this = this
|
|
const _this = this
|
|
const salesPromoSnList = []
|
|
const salesPromoSnList = []
|
|
// 单个转
|
|
// 单个转
|
|
- if(row){
|
|
|
|
|
|
+ if (row) {
|
|
salesPromoSnList.push(row.salesPromoSn)
|
|
salesPromoSnList.push(row.salesPromoSn)
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
const slen = _this.rowSelectionInfo.selectedRowKeys.length
|
|
const slen = _this.rowSelectionInfo.selectedRowKeys.length
|
|
if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && slen < 1)) {
|
|
if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && slen < 1)) {
|
|
_this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
_this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
@@ -222,7 +238,7 @@ export default {
|
|
salesPromoSnList.push(item.salesPromoSn)
|
|
salesPromoSnList.push(item.salesPromoSn)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
this.handleExpense(salesPromoSnList)
|
|
this.handleExpense(salesPromoSnList)
|
|
},
|
|
},
|
|
// 转费用单
|
|
// 转费用单
|
|
@@ -230,7 +246,7 @@ export default {
|
|
const _this = this
|
|
const _this = this
|
|
const hasExpense = await queryBatchCreateBySalesBillSn({ salesPromoSnList: snList }).then(res => res.data || [])
|
|
const hasExpense = await queryBatchCreateBySalesBillSn({ salesPromoSnList: snList }).then(res => res.data || [])
|
|
let result = null
|
|
let result = null
|
|
- for(let key in hasExpense){
|
|
|
|
|
|
+ for (const key in hasExpense) {
|
|
result = hasExpense[key]
|
|
result = hasExpense[key]
|
|
}
|
|
}
|
|
_this.expenseSave(result)
|
|
_this.expenseSave(result)
|
|
@@ -249,35 +265,37 @@ export default {
|
|
this.$message.info(res.message)
|
|
this.$message.info(res.message)
|
|
this.openBaseModal = false
|
|
this.openBaseModal = false
|
|
this.searchForm()
|
|
this.searchForm()
|
|
|
|
+ this.$router.push({ name: 'expenseReimbursementEdit', params: { sn: res.data.expenseAccountSn } })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 查看
|
|
// 查看
|
|
handleView () {
|
|
handleView () {
|
|
|
|
+ if (!this.hasSelect) {
|
|
|
|
+ this.$message.warning('请先勾选!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.showViewModal = true
|
|
this.showViewModal = true
|
|
- this.$refs.viewModal.setData(this.rowSelectionInfo&&this.rowSelectionInfo.selectedRows)
|
|
|
|
|
|
+ this.$refs.viewModal.setData(this.rowSelectionInfo && this.rowSelectionInfo.selectedRows)
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
- this.queryParam.buyerName = undefined
|
|
|
|
- this.queryParam.convertExpenseAccountType = undefined
|
|
|
|
- this.queryParam.salesBillNo = ''
|
|
|
|
- this.queryParam.promotionDescription = ''
|
|
|
|
- this.queryParam.promotionRuleDescription = ''
|
|
|
|
- this.$refs.dealerSubareaScopeList.resetForm()
|
|
|
|
- this.$refs.table.refresh(true)
|
|
|
|
- this.$refs.table.clearSelected()
|
|
|
|
|
|
+ this.isSearch = true
|
|
|
|
+ this.queryParam.buyerName = undefined
|
|
|
|
+ this.queryParam.convertExpenseAccountType = undefined
|
|
|
|
+ this.queryParam.salesBillNo = ''
|
|
|
|
+ this.queryParam.promotionDescription = ''
|
|
|
|
+ this.queryParam.promotionRuleDescription = ''
|
|
|
|
+ this.$refs.dealerSubareaScopeList.resetForm()
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
|
+ this.$refs.table.clearSelected()
|
|
},
|
|
},
|
|
- searchForm(){
|
|
|
|
- this.$refs.table.refresh(true)
|
|
|
|
|
|
+ searchForm () {
|
|
|
|
+ this.isSearch = true
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
this.$refs.table.clearSelected()
|
|
this.$refs.table.clearSelected()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- mounted () {
|
|
|
|
- if (!this.$store.state.app.isNewTab || this.bizSn) { // 页签刷新时调用
|
|
|
|
- this.resetSearchForm()
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
activated () {
|
|
activated () {
|
|
// 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
|
|
// 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
|
|
if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
|
|
if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
|