|
@@ -49,12 +49,13 @@
|
|
|
class="sTable"
|
|
|
ref="table"
|
|
|
size="small"
|
|
|
- :rowKey="(record) => record.id"
|
|
|
+ :rowKey="(record) => record.dealerSn"
|
|
|
+ rowKeyName="dealerSn"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
:defaultLoadData="false"
|
|
|
:scroll="{ y: 450 }"
|
|
|
- :rowClassName="(record, index) => record.checkProfitLossQty < 0 ? 'redBg-row':''"
|
|
|
+ :rowClassName="(record, index) => record.dataActType ==='CREATE'? 'fontRed':record.dataActType ==='DELETE'?'fontGreen':''"
|
|
|
bordered>
|
|
|
<!-- 地区 -->
|
|
|
<template slot="address" slot-scope="text, record">
|
|
@@ -62,9 +63,19 @@
|
|
|
</template>
|
|
|
</s-table>
|
|
|
</a-card>
|
|
|
- <div class="btn-cont">
|
|
|
+ <div class="btn-cont" v-if="showType ==='isEdit'">
|
|
|
<a-button type="primary" class="button-warning" @click="editDealerModal">修改</a-button>
|
|
|
- <a-button type="primary" style="margin-left: 15px;" :loading="spinning" id="promotion-modal-save" @click="handleSaveAudit">提交审核</a-button>
|
|
|
+ <a-button type="primary" style="margin-left: 15px;" :loading="spinning" id="promotion-modal-save" @click="submitAudit">提交审核</a-button>
|
|
|
+ </div>
|
|
|
+ <div class="btn-cont" v-if="showType === 'isAudit'&& $hasPermissions('B_dealerAudit') ">
|
|
|
+ <a-button @click="handleAudit('AUDIT_REJECT')">审核不通过</a-button>
|
|
|
+ <a-button type="primary" style="margin-left: 15px;" :loading="spinning" id="promotion-modal-save" @click="handleAudit('AUDIT_PASS')">审核通过</a-button>
|
|
|
+ </div>
|
|
|
+ <div class="btn-cont" v-if="showType === 'isAudit' && !$hasPermissions('B_dealerAudit')">
|
|
|
+ <a-button id="lookUpCustomers-modal-back" @click="isShow = false">关闭</a-button>
|
|
|
+ </div>
|
|
|
+ <div class="btn-cont" v-if="showType === 'isClose'">
|
|
|
+ <a-button id="lookUpCustomers-modal-back" @click="isShow = false">关闭</a-button>
|
|
|
</div>
|
|
|
</a-spin>
|
|
|
<!-- 选择参与客户 -->
|
|
@@ -78,7 +89,7 @@
|
|
|
width="60%"
|
|
|
>
|
|
|
<div class="dealerModalCon">
|
|
|
- <chooseDealer ref="dealerChoose" pageType="dealerPromotion" @plAdd="handleAddDealer"></chooseDealer>
|
|
|
+ <chooseDealer ref="dealerChoose" @plAdd="handleAddDealer"></chooseDealer>
|
|
|
</div>
|
|
|
</a-modal>
|
|
|
</a-modal>
|
|
@@ -92,7 +103,7 @@ import AreaList from '@/views/common/areaList.js'
|
|
|
import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
import { dealerExport } from '@/api/promoTerminal'
|
|
|
import { queryAuditPageList, dealerMidwayUpdate } from '@/api/promotion'
|
|
|
-import chooseDealer from '../promotionManagement/chooseDealer'
|
|
|
+import chooseDealer from './chooseDealer'
|
|
|
|
|
|
export default {
|
|
|
name: 'LookUpCustomersModal',
|
|
@@ -106,6 +117,10 @@ export default {
|
|
|
itemSn: {
|
|
|
type: String,
|
|
|
default: ''
|
|
|
+ },
|
|
|
+ showType: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
}
|
|
|
},
|
|
|
data () {
|
|
@@ -130,8 +145,7 @@ export default {
|
|
|
this.spinning = true
|
|
|
this.queryParam.promotionSn = this.itemSn
|
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
|
- const ajaxName = !this.updateFlag ? queryAuditPageList : dealerMidwayUpdate
|
|
|
- return ajaxName(params).then(res => {
|
|
|
+ return queryAuditPageList(params).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
@@ -163,23 +177,39 @@ export default {
|
|
|
editDealerModal () {
|
|
|
const _this = this
|
|
|
_this.openDealerModal = true
|
|
|
-
|
|
|
// const arr = _this.chooseDealerList.map(item => {
|
|
|
// return item.dealerSn
|
|
|
// })
|
|
|
// // 选择参与客户回显
|
|
|
- // _this.$nextTick(() => {
|
|
|
- // _this.$refs.dealerChoose.pageInit(arr)
|
|
|
- // })
|
|
|
+ _this.$nextTick(() => {
|
|
|
+ _this.$refs.dealerChoose.pageInit()
|
|
|
+ })
|
|
|
},
|
|
|
// 添加经销商
|
|
|
handleAddDealer (list) {
|
|
|
- // this.chooseDealerList = list
|
|
|
- // this.openDealerModal = false
|
|
|
- debugger
|
|
|
- this.updateFlag = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.table.refresh()
|
|
|
+ const newArr = []
|
|
|
+ list.forEach(item => {
|
|
|
+ const obj = {
|
|
|
+ dealerScope: this.itemSn ? 'SOME_DEALER' : 'ALL_DEALER',
|
|
|
+ promotionSn: this.itemSn ? this.itemSn : undefined,
|
|
|
+ dealerSn: item.dealerSn
|
|
|
+ }
|
|
|
+ newArr.push(obj)
|
|
|
+ })
|
|
|
+ this.openDealerModal = false
|
|
|
+ this.updateDataList(newArr)
|
|
|
+ },
|
|
|
+ // 更新列表显示状态
|
|
|
+ updateDataList (list) {
|
|
|
+ const ajaxData = {
|
|
|
+ promotionSn: this.itemSn ? this.itemSn : undefined,
|
|
|
+ promotionDealerList: list
|
|
|
+ }
|
|
|
+ dealerMidwayUpdate(ajaxData).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
areaChange (val) {
|
|
@@ -206,7 +236,7 @@ export default {
|
|
|
this.updateFlag = false
|
|
|
this.$refs.areaList.clearData()
|
|
|
this.$refs.subarea.clearData()
|
|
|
- this.$refs.table.refresh(true)
|
|
|
+ this.$refs.table.clearTable()
|
|
|
},
|
|
|
// 导出
|
|
|
handleExport () {
|
|
@@ -220,8 +250,13 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 提交审核
|
|
|
- handleSaveAudit () {
|
|
|
-
|
|
|
+ submitAudit () {
|
|
|
+ this.$emit('submitAudit')
|
|
|
+ this.isShow = false
|
|
|
+ },
|
|
|
+ handleAudit (statusInfo) {
|
|
|
+ this.$emit('handleAudit', statusInfo)
|
|
|
+ this.isShow = false
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -235,7 +270,10 @@ export default {
|
|
|
this.$emit('close')
|
|
|
this.resetSearchForm()
|
|
|
} else {
|
|
|
- this.$refs.table.refresh(true)
|
|
|
+ console.log('this.showType', this.showType)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -270,5 +308,12 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ /deep/.fontRed{
|
|
|
+ color:red;
|
|
|
+ }
|
|
|
+ /deep/.fontGreen{
|
|
|
+ color:green;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
</style>
|