|
@@ -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" id="waitCostList-back-btn"><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">
|
|
@@ -14,13 +14,19 @@
|
|
<a-form layout="inline" @keyup.enter.native="searchTable">
|
|
<a-form layout="inline" @keyup.enter.native="searchTable">
|
|
<a-row :gutter="15" type="flex">
|
|
<a-row :gutter="15" type="flex">
|
|
<a-col flex="300px">
|
|
<a-col flex="300px">
|
|
- <a-form-item label="促销名称/简称">
|
|
|
|
- <a-input v-model.trim="queryParam.promotionDescription" allowClear placeholder="请输入促销名称/简称"/>
|
|
|
|
|
|
+ <a-form-item label="销售单号">
|
|
|
|
+ <a-input id="waitCostList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col flex="300px">
|
|
|
|
+ <a-form-item label="客户名称">
|
|
|
|
+ <dealerSubareaScopeList id="waitCostList-dealerSubareaScopeList" ref="dealerSubareaScopeList" @change="custChange" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col flex="300px">
|
|
<a-col flex="300px">
|
|
<a-form-item label="费用类型">
|
|
<a-form-item label="费用类型">
|
|
<v-select
|
|
<v-select
|
|
|
|
+ id="waitCostList-convertExpenseAccountType"
|
|
v-model="queryParam.convertExpenseAccountType"
|
|
v-model="queryParam.convertExpenseAccountType"
|
|
code="CONVERT_EXPENSE_ACCOUNT_TYPE"
|
|
code="CONVERT_EXPENSE_ACCOUNT_TYPE"
|
|
placeholder="请选择费用类型"
|
|
placeholder="请选择费用类型"
|
|
@@ -28,23 +34,18 @@
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col flex="300px">
|
|
<a-col flex="300px">
|
|
- <a-form-item label="客户名称">
|
|
|
|
- <dealerSubareaScopeList ref="dealerSubareaScopeList" @change="custChange" />
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col flex="300px">
|
|
|
|
- <a-form-item label="销售单号">
|
|
|
|
- <a-input v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
|
|
|
|
|
|
+ <a-form-item label="促销名称/简称">
|
|
|
|
+ <a-input id="waitCostList-promotionDescription" v-model.trim="queryParam.promotionDescription" allowClear placeholder="请输入促销名称/简称"/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col flex="300px">
|
|
<a-col flex="300px">
|
|
<a-form-item label="规则简称">
|
|
<a-form-item label="规则简称">
|
|
- <a-input v-model.trim="queryParam.promotionRuleDescription" allowClear placeholder="请输入规则简称"/>
|
|
|
|
|
|
+ <a-input id="waitCostList-promotionRuleDescription" v-model.trim="queryParam.promotionRuleDescription" allowClear placeholder="请输入规则简称"/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col flex="150px">
|
|
<a-col flex="150px">
|
|
- <a-button type="primary" :disabled="disabled" @click="searchForm">查询</a-button>
|
|
|
|
- <a-button style="margin-left: 10px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
|
|
|
|
|
|
+ <a-button type="primary" id="handel-search" :disabled="disabled" @click="searchForm(false)">查询</a-button>
|
|
|
|
+ <a-button style="margin-left: 10px" id="handel-reset" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-form>
|
|
</a-form>
|
|
@@ -64,8 +65,7 @@
|
|
ref="table"
|
|
ref="table"
|
|
:style="{ height: pageHeight+67+'px' }"
|
|
:style="{ height: pageHeight+67+'px' }"
|
|
size="small"
|
|
size="small"
|
|
- :rowKey="(record) => record.no"
|
|
|
|
- rowKeyName="no"
|
|
|
|
|
|
+ :rowKey="(record) => record.id"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: curExpenseAccountType ? record.convertExpenseAccountType != curExpenseAccountType : false } }) }"
|
|
:row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: curExpenseAccountType ? record.convertExpenseAccountType != curExpenseAccountType : false } }) }"
|
|
@rowSelection="rowSelectionFun"
|
|
@rowSelection="rowSelectionFun"
|
|
@@ -78,6 +78,7 @@
|
|
<div>
|
|
<div>
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
|
|
+ :id="'handel-submit-'+record.no"
|
|
type="link"
|
|
type="link"
|
|
class="button-warning"
|
|
class="button-warning"
|
|
@click="handleSave(record)"
|
|
@click="handleSave(record)"
|
|
@@ -91,54 +92,68 @@
|
|
<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;"
|
|
- type="primary"
|
|
|
|
- class="button-info"
|
|
|
|
|
|
+ type="info"
|
|
|
|
+ id="handel-views"
|
|
@click="handleView()"
|
|
@click="handleView()"
|
|
>
|
|
>
|
|
- 查看
|
|
|
|
|
|
+ 查看已选
|
|
</a-button>
|
|
</a-button>
|
|
<a-button
|
|
<a-button
|
|
type="primary"
|
|
type="primary"
|
|
|
|
+ class="button-info"
|
|
|
|
+ id="handel-submit"
|
|
:disabled="spinning"
|
|
:disabled="spinning"
|
|
style="width: 100px;margin: 0 20px;"
|
|
style="width: 100px;margin: 0 20px;"
|
|
@click="handleSave()"
|
|
@click="handleSave()"
|
|
>
|
|
>
|
|
提交
|
|
提交
|
|
</a-button>
|
|
</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ type="primary"
|
|
|
|
+ id="handel-mergeSubmit"
|
|
|
|
+ :disabled="spinning"
|
|
|
|
+ style="width: 100px;"
|
|
|
|
+ @click="handleMerge()"
|
|
|
|
+ >
|
|
|
|
+ 合并提交
|
|
|
|
+ </a-button>
|
|
</div>
|
|
</div>
|
|
<!-- 新增费用单 -->
|
|
<!-- 新增费用单 -->
|
|
<baseDataModal ref="expenseModal" @expenseSaveOk="expenseSaveOk" :show="openBaseModal" @close="openBaseModal=false"></baseDataModal>
|
|
<baseDataModal ref="expenseModal" @expenseSaveOk="expenseSaveOk" :show="openBaseModal" @close="openBaseModal=false"></baseDataModal>
|
|
<!-- 查看已选费用单 -->
|
|
<!-- 查看已选费用单 -->
|
|
- <viewSelectModal ref="viewModal" :openModal="showViewModal" @close="showViewModal=false"></viewSelectModal>
|
|
|
|
|
|
+ <viewSelectModal ref="viewModal" :openModal="showViewModal" @close="showViewModal=false" @submit="meargeSubmit"></viewSelectModal>
|
|
|
|
+ <!-- 合并选项弹框 -->
|
|
|
|
+ <meargeOptionModal ref="meargeModal" :openModal="showMeargeModal" @close="showMeargeModal=false" @meargeOk="meargeOk"/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
-import moment from 'moment'
|
|
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
|
|
import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
|
|
import baseDataModal from '@/views/expenseManagement/expenseReimbursement/baseDataModal.vue'
|
|
import baseDataModal from '@/views/expenseManagement/expenseReimbursement/baseDataModal.vue'
|
|
import viewSelectModal from './viewSelectModal.vue'
|
|
import viewSelectModal from './viewSelectModal.vue'
|
|
-import { salesConvertExpenseList, expenseAccountSave, queryBatchCreateBySalesBillSn } from '@/api/salesNew'
|
|
|
|
|
|
+import meargeOptionModal from './meargeOptionModal.vue'
|
|
|
|
+import { salesConvertExpenseList, expenseAccountSave, queryBatchCreateBySalesBillSn, expenseAccountSaveGroupType, queryBatchCreateBySalesPromoSnListGroupType } from '@/api/salesNew'
|
|
export default {
|
|
export default {
|
|
name: 'WaitCostOrder',
|
|
name: 'WaitCostOrder',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
- components: { STable, VSelect, dealerSubareaScopeList, baseDataModal, viewSelectModal },
|
|
|
|
|
|
+ components: { STable, VSelect, dealerSubareaScopeList, baseDataModal, viewSelectModal, meargeOptionModal },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
spinning: false,
|
|
spinning: false,
|
|
disabled: false,
|
|
disabled: false,
|
|
- hideFooter: false,
|
|
|
|
|
|
+ hideFooter: false, // 隐藏页面底部
|
|
openBaseModal: false, // 费用弹框
|
|
openBaseModal: false, // 费用弹框
|
|
- fromRouter: '',
|
|
|
|
- authCode: '',
|
|
|
|
|
|
+ showMeargeModal: false, // 合并选项弹框
|
|
|
|
+ fromRouter: '', // 从那个页面打开
|
|
|
|
+ authCode: '', // 数据权限码
|
|
queryParam: {
|
|
queryParam: {
|
|
- promotionDescription: '',
|
|
|
|
- convertExpenseAccountType: '',
|
|
|
|
- salesBillNo: '',
|
|
|
|
- promotionRuleDescription: '',
|
|
|
|
- buyerName: ''
|
|
|
|
|
|
+ promotionDescription: '', // 销名称/简称
|
|
|
|
+ convertExpenseAccountType: '', // 费用类型
|
|
|
|
+ salesBillNo: '', // 销售单号
|
|
|
|
+ promotionRuleDescription: '', // 规则简称
|
|
|
|
+ buyerName: '' // 客户名称
|
|
},
|
|
},
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
@@ -146,7 +161,7 @@ export default {
|
|
this.spinning = true
|
|
this.spinning = true
|
|
delete parameter.tableId
|
|
delete parameter.tableId
|
|
delete parameter.index
|
|
delete parameter.index
|
|
- this.getPageHeight()
|
|
|
|
|
|
+ this.getPageHeight() // 获取表格高度
|
|
return salesConvertExpenseList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
return salesConvertExpenseList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
let data
|
|
let data
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
@@ -161,28 +176,29 @@ export default {
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- rowSelectionInfo: null,
|
|
|
|
- curExpenseAccountType: '',
|
|
|
|
- pageHeight: 300,
|
|
|
|
- showViewModal: false,
|
|
|
|
- isSearch: false
|
|
|
|
|
|
+ rowSelectionInfo: null, // 已选行
|
|
|
|
+ curExpenseAccountType: '', // 当前已选费用类型
|
|
|
|
+ pageHeight: 300, // 默认页面高度
|
|
|
|
+ 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: '4%', 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: '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: 'expense', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
{ title: '促销名称', dataIndex: 'promotionTitle', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '促销名称', dataIndex: 'promotionTitle', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '促销简称', dataIndex: 'promotionDescription', width: '17%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
|
|
|
|
- { title: '规则简称', dataIndex: 'promotionRuleDescription', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, sorter: true },
|
|
|
|
|
|
+ { title: '促销简称', dataIndex: 'promotionDescription', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '规则简称', dataIndex: 'promotionRuleDescription', width: '16%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
{ 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' }
|
|
]
|
|
]
|
|
@@ -194,22 +210,23 @@ export default {
|
|
handleBack () {
|
|
handleBack () {
|
|
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
|
|
if (obj.selectedRows) {
|
|
if (obj.selectedRows) {
|
|
this.curExpenseAccountType = obj.selectedRows && obj.selectedRows[0] && obj.selectedRows[0]['convertExpenseAccountType'] || ''
|
|
this.curExpenseAccountType = obj.selectedRows && obj.selectedRows[0] && obj.selectedRows[0]['convertExpenseAccountType'] || ''
|
|
|
|
+ // 没用勾选任何数据,刷新列表
|
|
if (obj.selectedRows.length <= 1) {
|
|
if (obj.selectedRows.length <= 1) {
|
|
if (!this.isSearch) {
|
|
if (!this.isSearch) {
|
|
this.$refs.table.refresh()
|
|
this.$refs.table.refresh()
|
|
}
|
|
}
|
|
this.isSearch = false
|
|
this.isSearch = false
|
|
} else {
|
|
} else {
|
|
- // 全选
|
|
|
|
|
|
+ // 全选,盘点是否类型一致,否则不能全选
|
|
const ret = obj.selectedRows.filter(item => item.convertExpenseAccountType == this.curExpenseAccountType)
|
|
const ret = obj.selectedRows.filter(item => item.convertExpenseAccountType == this.curExpenseAccountType)
|
|
if (ret.length != obj.selectedRows.length) {
|
|
if (ret.length != obj.selectedRows.length) {
|
|
this.$message.warning('费用类型不一致,请重新勾选!')
|
|
this.$message.warning('费用类型不一致,请重新勾选!')
|
|
@@ -218,54 +235,108 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 客户选择
|
|
custChange (val) {
|
|
custChange (val) {
|
|
this.queryParam.buyerName = val.name || ''
|
|
this.queryParam.buyerName = val.name || ''
|
|
},
|
|
},
|
|
- // 提交
|
|
|
|
|
|
+ // 合并提交
|
|
|
|
+ handleMerge () {
|
|
|
|
+ if (!this.hasSelect) {
|
|
|
|
+ this.$message.warning('请先勾选再合并提交!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 打开合并选项弹框
|
|
|
|
+ this.showMeargeModal = true
|
|
|
|
+ },
|
|
|
|
+ // 确定合并
|
|
|
|
+ meargeOk (groupType) {
|
|
|
|
+ // 批量合并
|
|
|
|
+ const salesPromoSnList = []
|
|
|
|
+ this.rowSelectionInfo.selectedRows.map(item => {
|
|
|
|
+ salesPromoSnList.push(item.salesPromoSn)
|
|
|
|
+ })
|
|
|
|
+ const params = {
|
|
|
|
+ salesPromoSnList: salesPromoSnList,
|
|
|
|
+ groupType: groupType
|
|
|
|
+ }
|
|
|
|
+ const meargeType = { 'CUSTOMER': '相同客户名称', 'CUSTOMER_PROMO': '相同促销活动', 'CUSTOMER_PROMO_RULE': '相同活动规则' }
|
|
|
|
+ // 开始合并
|
|
|
|
+ queryBatchCreateBySalesPromoSnListGroupType(params).then(res => {
|
|
|
|
+ // 打开已合并的待转费用报销单弹框
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ const list = res.data && res.data.detailList || []
|
|
|
|
+ if (list.length) {
|
|
|
|
+ // 打开查看弹框
|
|
|
|
+ this.showViewModal = true
|
|
|
|
+ this.$refs.viewModal.title = '已合并的待转费用报销单' + '(按' + meargeType[groupType] + '合并)'
|
|
|
|
+ this.$refs.viewModal.submitType = 'mearge'
|
|
|
|
+ this.$refs.viewModal.setData(list, res.data)
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.warning('没有可合并的待转费用报销单!')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 确定合并提交转费用单弹框
|
|
|
|
+ meargeSubmit (data) {
|
|
|
|
+ this.expenseSave(data, 'salesMearge')
|
|
|
|
+ },
|
|
|
|
+ // 直接提交(不合并)
|
|
handleSave (row) {
|
|
handleSave (row) {
|
|
- 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
|
|
|
|
- if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && slen < 1)) {
|
|
|
|
- _this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
|
|
|
|
+ // 批量转
|
|
|
|
+ if (!this.hasSelect) {
|
|
|
|
+ this.$message.warning('请在列表勾选后再进行提交操作!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- // 批量转
|
|
|
|
this.rowSelectionInfo.selectedRows.map(item => {
|
|
this.rowSelectionInfo.selectedRows.map(item => {
|
|
salesPromoSnList.push(item.salesPromoSn)
|
|
salesPromoSnList.push(item.salesPromoSn)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ // 打开转费用单弹框
|
|
this.handleExpense(salesPromoSnList)
|
|
this.handleExpense(salesPromoSnList)
|
|
},
|
|
},
|
|
// 转费用单
|
|
// 转费用单
|
|
async handleExpense (snList) {
|
|
async handleExpense (snList) {
|
|
const _this = this
|
|
const _this = this
|
|
|
|
+ this.spinning = true
|
|
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 (const key in hasExpense) {
|
|
for (const key in hasExpense) {
|
|
result = hasExpense[key]
|
|
result = hasExpense[key]
|
|
}
|
|
}
|
|
- _this.expenseSave(result)
|
|
|
|
|
|
+ // 转费用单弹框
|
|
|
|
+ _this.expenseSave(result, 'sales')
|
|
},
|
|
},
|
|
- // 转费用单
|
|
|
|
- expenseSave (data) {
|
|
|
|
- console.log(data)
|
|
|
|
|
|
+ // 新建费用单
|
|
|
|
+ expenseSave (data, type) {
|
|
if (data) {
|
|
if (data) {
|
|
|
|
+ // 关闭查看弹框
|
|
|
|
+ this.$refs.viewModal.spinning = false
|
|
|
|
+ this.showViewModal = false
|
|
|
|
+ // 打开新建转费用单弹框
|
|
this.openBaseModal = true
|
|
this.openBaseModal = true
|
|
- this.$refs.expenseModal.setDetail(data, 'sales')
|
|
|
|
|
|
+ this.$refs.expenseModal.setDetail(data, type)
|
|
|
|
+ this.spinning = false
|
|
|
|
+ } else {
|
|
|
|
+ this.spinning = false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- expenseSaveOk (params) {
|
|
|
|
- expenseAccountSave(params).then(res => {
|
|
|
|
|
|
+ // 转费用单成功,并跳转到费用单详情页面
|
|
|
|
+ expenseSaveOk (params, type) {
|
|
|
|
+ // type:
|
|
|
|
+ // sales:不合并
|
|
|
|
+ // salesMearge:合并转
|
|
|
|
+ const fun = type == 'sales' ? expenseAccountSave : expenseAccountSaveGroupType
|
|
|
|
+ fun(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.$message.info(res.message)
|
|
this.$message.info(res.message)
|
|
this.openBaseModal = false
|
|
this.openBaseModal = false
|
|
- this.searchForm()
|
|
|
|
|
|
+ this.searchForm(true)
|
|
this.$router.push({ name: 'expenseReimbursementEdit', params: { sn: res.data.expenseAccountSn } })
|
|
this.$router.push({ name: 'expenseReimbursementEdit', params: { sn: res.data.expenseAccountSn } })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -277,6 +348,8 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.showViewModal = true
|
|
this.showViewModal = true
|
|
|
|
+ this.$refs.viewModal.title = '已选待转费用报销单'
|
|
|
|
+ this.$refs.viewModal.submitType = 'noMearge'
|
|
this.$refs.viewModal.setData(this.rowSelectionInfo && this.rowSelectionInfo.selectedRows)
|
|
this.$refs.viewModal.setData(this.rowSelectionInfo && this.rowSelectionInfo.selectedRows)
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
@@ -291,10 +364,12 @@ export default {
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.clearSelected()
|
|
this.$refs.table.clearSelected()
|
|
},
|
|
},
|
|
- searchForm () {
|
|
|
|
|
|
+ searchForm (flag) {
|
|
this.isSearch = true
|
|
this.isSearch = true
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
- this.$refs.table.clearSelected()
|
|
|
|
|
|
+ if (flag) {
|
|
|
|
+ this.$refs.table.clearSelected()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
activated () {
|
|
activated () {
|