You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
807 lines
31 KiB
807 lines
31 KiB
<template>
|
|
<div class="app-container">
|
|
<!-- Start 列表页面 -->
|
|
<div v-show="viewState == 1">
|
|
<button-bar view-title="待核对单车返利列表" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
|
|
<div class="main-content">
|
|
<div class="switch_btn">
|
|
<el-button :class="{btn_style:viewState === 1}">待核对</el-button>
|
|
<el-button class="" @click="handleClick">核对审核申请</el-button>
|
|
</div>
|
|
<div class="searchcon">
|
|
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
|
|
<div v-show="isSearchShow" class="search">
|
|
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
|
|
<el-form-item label="品牌">
|
|
<el-select v-model="listQuery.params.brandSid" placeholder="请选择" filterable clearable>
|
|
<el-option v-for="item in brand_list" :key="item.sid" :label="item.brandName" :value="item.sid"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="车架号">
|
|
<el-input v-model="listQuery.params.vinNo" placeholder="" clearable/>
|
|
</el-form-item>
|
|
<el-form-item label="创建日期">
|
|
<el-date-picker v-model="listQuery.params.createStartTime" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
|
|
<span style="padding: 0 8px">至</span>
|
|
<el-date-picker v-model="listQuery.params.createEndTime" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
|
|
</el-form-item>
|
|
<el-form-item label="返利类型">
|
|
<el-select v-model="listQuery.params.rebateTypeKey" placeholder="请选择" filterable clearable>
|
|
<el-option v-for="item in rebateType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="返利名称">
|
|
<el-input v-model="listQuery.params.rebateName" placeholder="" clearable/>
|
|
</el-form-item>
|
|
<!-- <el-form-item label="上传状态">-->
|
|
<!-- <el-select v-model="listQuery.params.state" placeholder="请选择" filterable clearable>-->
|
|
<!-- <el-option v-for="item in state_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>-->
|
|
<!-- </el-select>-->
|
|
<!-- </el-form-item>-->
|
|
</el-form>
|
|
<div class="btn" style="text-align: center;">
|
|
<el-button type="primary" icon="el-icon-search" @click="handleFilter" size="small">查询</el-button>
|
|
<el-button type="primary" icon="el-icon-refresh" @click="handleReset" size="small">重置</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="listtop">
|
|
<div class="tit">单车返利待核对列表</div>
|
|
<div>
|
|
<el-button size="mini" type="success" @click="exportByFirst">一次导出</el-button>
|
|
<el-button size="mini" type="success" @click="importByFirst">一次导入</el-button>
|
|
<el-button size="mini" type="success" @click="exportBySecond">二次导出</el-button>
|
|
<el-button size="mini" type="success" @click="importBySecond">二次导入</el-button>
|
|
</div>
|
|
</div>
|
|
<div class="">
|
|
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange">
|
|
<el-table-column fixed type="selection" align="center" width="50px"/>
|
|
<el-table-column fixed label="序号" type="index" :index="indexMethod" align="center" width="80px"/>
|
|
<el-table-column label="上传状态" align="center" width="120">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.uploadState == '0' ? '未上传' : scope.row.uploadState == '1' ? '已上传' : ''}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="调整状态" align="center" width="120">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.uploadState == '0' ? '待确认' : scope.row.uploadState == '1' ? '确认调整' : scope.row.uploadState == '2' ? '暂不调整' : '' }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="品牌" align="center" width="200">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.brandName }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="车型" align="center" width="200">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.vehModelName }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="车架号" align="center" width="250">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.vinNo }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="厂家结算价" align="center" width="200">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.manufactorSettlementPrice }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="其中运费" align="center" width="200">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.freight }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="创建日期" align="center" width="120">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.createTime }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="返利名称" align="center" width="150">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.rebateName }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="返利类型" align="center" width="150">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.rebateTypeValue }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="预计返利" align="center" width="120">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.estimateRebate }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="所属年月" align="center" width="120">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.palceGenDate }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="上传日期" align="center" width="200">
|
|
<template slot-scope="scope">
|
|
<el-date-picker v-model="scope.row.uploadDate" :disabled="scope.row.secondaryUploadDate !== ''" type="date" style="width: 160px" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="上传金额" align="center" width="150">
|
|
<template slot-scope="scope">
|
|
<el-input v-model="scope.row.uploadMoney" :disabled="scope.row.secondaryUploadDate !== ''" @input="isAdjustmentInput(scope.row)" @keyup.native="scope.row.uploadMoney = getNumber(scope.row.uploadMoney, 2)" clearable placeholder=""></el-input>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="二次上传日期" align="center" width="120">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.secondaryUploadDate }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="二次上传金额" align="center" width="120">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.secondaryUploadMoney }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="待确定金额" align="center" width="150">
|
|
<template slot-scope="scope">
|
|
<el-input v-model="scope.row.stayDetermineMoney" @input="isAdjustmentInput(scope.row)" @keyup.native="scope.row.stayDetermineMoney = getNumber(scope.row.stayDetermineMoney, 2)" clearable placeholder=""></el-input>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="费用" align="center" width="150">
|
|
<template slot-scope="scope">
|
|
<el-input v-model="scope.row.money" @input="isAdjustmentInput(scope.row)" @keyup.native="scope.row.money = getNumber(scope.row.money, 2)" clearable placeholder=""></el-input>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="是否调整" align="center" width="100">
|
|
<template slot-scope="scope">
|
|
<el-select v-model="scope.row.isAdjustment" :disabled="!scope.row.adjustOrNot" @change="isAdjustmentChange($event, scope.row)" placeholder="" filterable>
|
|
<el-option v-for="item in whether_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/>
|
|
</el-select>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="调整金额" align="center" width="150">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.adjustmentMoney }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="调整说明" align="center" width="300">
|
|
<template slot-scope="scope">
|
|
<el-input v-model="scope.row.adjustmentRemarks" clearable placeholder=""></el-input>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="操作" align="center" width="180px">
|
|
<template slot-scope="scope">
|
|
<el-button type="primary" v-if="scope.row.adjustmentState == '0' || scope.row.adjustmentState == '2'" size="mini" @click="toSave(scope.row)">保存</el-button>
|
|
<el-button type="primary" v-if="scope.row.adjustmentState == '2'" size="mini" @click="toAdjust(scope.row)">调整</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<div class="pages">
|
|
<!-- 翻页 -->
|
|
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- 核对审核申请分页列表 -->
|
|
<bicyclerebatecheck v-show="viewState == 2" ref="divCheck" @doback="resetState"/>
|
|
<!-- 新增核对审核申请 -->
|
|
<bicyclerebatecheckAdd v-show="viewState == 3" ref="divCheckAdd" @doback="resetState"/>
|
|
<!-- 二次调整页面 -->
|
|
<el-dialog center :visible.sync="dialogVisible" width="60%">
|
|
<div class="app-container">
|
|
<div class="tab-header webtop">
|
|
<!--标题-->
|
|
<div>{{ viewTitle }}</div>
|
|
<!--start 添加修改按钮-->
|
|
<div>
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSave()">保存
|
|
</el-button>
|
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
|
</div>
|
|
</div>
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd">
|
|
<div class="title">
|
|
<div><span>待确定金额</span></div>
|
|
</div>
|
|
<el-row style="border-top: 1px solid #E0E3EB">
|
|
<el-col :span="4" class="tleftb">
|
|
<span>待确定金额</span>
|
|
</el-col>
|
|
<el-col :span="4">
|
|
<el-form-item><span>{{ formobj.stayDetermineMoney }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="4" class="tleftb">
|
|
<span>其中含费用</span>
|
|
</el-col>
|
|
<el-col :span="4">
|
|
<el-form-item><el-input v-model="formobj.firstCost" @input="firstCostInput" clearable placeholder=""/></el-form-item>
|
|
</el-col>
|
|
<el-col :span="4" class="tleftb">
|
|
<span>其中含返利</span>
|
|
</el-col>
|
|
<el-col :span="4">
|
|
<el-form-item><span>{{ formobj.firstRebate }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<div class="title">
|
|
<el-checkbox v-model="checked"><span style="color: #FFFFFF">返利二次上传</span></el-checkbox>
|
|
</div>
|
|
<div v-if="checked">
|
|
<el-row>
|
|
<el-col :span="4" class="tleftb">
|
|
<span>剩余预计返利</span>
|
|
</el-col>
|
|
<el-col :span="4">
|
|
<el-form-item><span>{{ formobj.surplusRebate}}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="4">
|
|
</el-col>
|
|
<el-col :span="4">
|
|
</el-col>
|
|
<el-col :span="4" class="tleftb">
|
|
<span>二次上传日期</span>
|
|
</el-col>
|
|
<el-col :span="4">
|
|
<el-form-item><el-date-picker v-model="formobj.secondaryUploadDate" type="date" clearable value-format="yyyy-MM-dd" style="width: 100%" placeholder="选择日期"/></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="4" class="tleftb">
|
|
<span>二次上传金额</span>
|
|
</el-col>
|
|
<el-col :span="4">
|
|
<el-form-item><el-input v-model="formobj.secondaryUploadMoney" clearable placeholder=""/></el-form-item>
|
|
</el-col>
|
|
<el-col :span="4" class="tleftb">
|
|
<span>其中含费用</span>
|
|
</el-col>
|
|
<el-col :span="4">
|
|
<el-form-item><el-input v-model="formobj.secondCost" @input="secondCostInput" clearable placeholder=""/></el-form-item>
|
|
</el-col>
|
|
<el-col :span="4" class="tleftb">
|
|
<span>其中含返利</span>
|
|
</el-col>
|
|
<el-col :span="4">
|
|
<el-form-item><span>{{ formobj.secondRebate }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="4" class="tleftb">
|
|
<span>调整金额合计</span>
|
|
</el-col>
|
|
<el-col :span="20">
|
|
<el-form-item><span>{{ formobj.adjustmentMoney }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</div>
|
|
</el-form>
|
|
</div>
|
|
</el-dialog>
|
|
<!-- 导入、导出 -->
|
|
<el-dialog :visible.sync="dialogFileVisible" width="70%" :show-close="false">
|
|
<el-card class="box-card">
|
|
<div>
|
|
<el-upload
|
|
ref="upload"
|
|
class="upload-demo"
|
|
accept=".xls"
|
|
name="file"
|
|
:action="updateAction"
|
|
:on-success="handleSuccess"
|
|
:on-remove="handleRemove"
|
|
:file-list="fileList"
|
|
:auto-upload="false"
|
|
:multiple="false"
|
|
:limit="1"
|
|
:data="uploadData"
|
|
:headers="headers"
|
|
>
|
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
|
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传</el-button>
|
|
</el-upload>
|
|
</div>
|
|
<div>
|
|
<h3>文件上传结果</h3>
|
|
<el-card class="box-card">
|
|
<div>{{ uploadResultMesssage }}</div>
|
|
</el-card>
|
|
</div>
|
|
</el-card>
|
|
<div slot="footer" class="dialog-footer" style="text-align: center">
|
|
<el-button type="primary" size="small" @click="handleConfirm">确定</el-button>
|
|
<el-button size="small" @click="dialogFileVisible = false">取消</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import req from '@/api/bikerebate/bicyclerebatecheck'
|
|
import Pagination from '@/components/pagination'
|
|
import ButtonBar from '@/components/ButtonBar'
|
|
import bicyclerebatecheck from './bicyclerebatecheck'
|
|
import bicyclerebatecheckAdd from './bicyclerebatecheckAdd'
|
|
import { brandDown, getOrgSidByPath, typeValues } from '@/api/cheliang/dictcommons'
|
|
|
|
export default {
|
|
name: 'BicycleRebateToBeChecked',
|
|
components: {
|
|
Pagination,
|
|
ButtonBar,
|
|
bicyclerebatecheck,
|
|
bicyclerebatecheckAdd
|
|
},
|
|
data() {
|
|
return {
|
|
btndisabled: false,
|
|
dialogVisible: false,
|
|
btnList: [
|
|
{
|
|
type: 'primary',
|
|
size: 'small',
|
|
icon: '',
|
|
btnKey: 'toAdd',
|
|
btnLabel: '核对审核申请'
|
|
},
|
|
{
|
|
type: 'info',
|
|
size: 'small',
|
|
icon: 'cross',
|
|
btnKey: 'doClose',
|
|
btnLabel: '关闭'
|
|
}
|
|
],
|
|
isSearchShow: false,
|
|
searchxianshitit: '显示查询条件',
|
|
viewState: 1,
|
|
// 查询条件 -----------
|
|
tableKey: 0,
|
|
list: [],
|
|
sids: [],
|
|
FormLoading: false,
|
|
brand_list: [],
|
|
rebateType_list: [],
|
|
state_list: [
|
|
{
|
|
dictKey: 1,
|
|
dictValue: '未上传'
|
|
},
|
|
{
|
|
dictKey: 3,
|
|
dictValue: '已上传'
|
|
}
|
|
],
|
|
whether_list: [
|
|
{
|
|
dictKey: 0,
|
|
dictValue: '否'
|
|
},
|
|
{
|
|
dictKey: 1,
|
|
dictValue: '是'
|
|
}
|
|
],
|
|
listLoading: false,
|
|
listQuery: {
|
|
params: {
|
|
brandSid: '',
|
|
createOrgSid: '',
|
|
vinNo: '',
|
|
rebateTypeKey: '',
|
|
rebateName: '',
|
|
state: '',
|
|
createEndTime: '',
|
|
createStartTime: '',
|
|
orgPath: '',
|
|
userSid: '',
|
|
menuUrl: ''
|
|
},
|
|
current: 1,
|
|
size: 5,
|
|
total: 0
|
|
},
|
|
rules: {},
|
|
viewTitle: '返利调整',
|
|
submitdisabled: false,
|
|
checked: false,
|
|
formobj: {
|
|
sid: '',
|
|
stayDetermineMoney: '',
|
|
firstCost: '',
|
|
firstRebate: '',
|
|
surplusRebate: '',
|
|
secondaryUploadDate: '',
|
|
secondaryUploadMoney: '',
|
|
secondCost: '',
|
|
secondRebate: '',
|
|
adjustmentMoney: '',
|
|
cost: ''
|
|
},
|
|
dialogFileVisible: false,
|
|
updateAction: '',
|
|
fileList: [],
|
|
uploadResultMesssage: '',
|
|
uploadData: {
|
|
sid: '',
|
|
userSid: '',
|
|
orgPath: ''
|
|
},
|
|
headers: {
|
|
token: window.sessionStorage.getItem('token')
|
|
}
|
|
}
|
|
},
|
|
created() {
|
|
// 加载列表
|
|
this.init()
|
|
},
|
|
mounted() {
|
|
this.$refs['btnbar'].setButtonList(this.btnList)
|
|
},
|
|
methods: {
|
|
init() {
|
|
typeValues({ type: 'rebateType' }).then((res) => {
|
|
if (res.success) {
|
|
this.rebateType_list = res.data
|
|
}
|
|
})
|
|
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((resp) => {
|
|
if (resp.success) {
|
|
this.listQuery.params.createOrgSid = resp.data
|
|
brandDown({ useOrg: this.listQuery.params.createOrgSid }).then((res) => {
|
|
if (res.success) {
|
|
this.brand_list = res.data
|
|
}
|
|
})
|
|
this.getList()
|
|
}
|
|
})
|
|
},
|
|
// 搜索条件效果
|
|
clicksearchShow() {
|
|
this.isSearchShow = !this.isSearchShow
|
|
if (this.isSearchShow) {
|
|
this.searchxianshitit = '隐藏查询条件'
|
|
} else {
|
|
this.searchxianshitit = '显示查询条件'
|
|
}
|
|
},
|
|
btnHandle(btnKey) {
|
|
console.log('XXXXXXXXXXXXXXX ' + btnKey)
|
|
switch (btnKey) {
|
|
case 'toAdd':
|
|
this.toAdd()
|
|
break
|
|
case 'doClose':
|
|
this.doClose()
|
|
break
|
|
default:
|
|
break
|
|
}
|
|
},
|
|
// 序号
|
|
indexMethod(index) {
|
|
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
|
|
var pageindex = index + 1 + pagestart
|
|
return pageindex
|
|
},
|
|
handleSelectionChange(row) {
|
|
const aa = []
|
|
row.forEach((element) => {
|
|
aa.push(element.sid)
|
|
})
|
|
this.sids = aa
|
|
console.log('sids', this.sids)
|
|
},
|
|
// 查询列表信息
|
|
getList() {
|
|
this.listLoading = true
|
|
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
|
|
this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
|
this.listQuery.params.menuUrl = this.$route.path
|
|
req.listPage(this.listQuery).then((response) => {
|
|
console.log('列表查询结果:', response)
|
|
this.listLoading = false
|
|
if (response.success) {
|
|
this.list = response.data.records
|
|
this.listQuery.total = response.data.total
|
|
} else {
|
|
this.list = []
|
|
this.listQuery.total = 0
|
|
}
|
|
})
|
|
},
|
|
// 查询按钮
|
|
handleFilter() {
|
|
this.listQuery.current = 1
|
|
this.getList()
|
|
},
|
|
handleReset() {
|
|
this.listQuery = {
|
|
params: {
|
|
brandSid: '',
|
|
createOrgSid: '',
|
|
vinNo: '',
|
|
rebateTypeKey: '',
|
|
rebateName: '',
|
|
state: '',
|
|
createEndTime: '',
|
|
createStartTime: '',
|
|
orgPath: '',
|
|
userSid: '',
|
|
menuUrl: ''
|
|
},
|
|
current: 1,
|
|
size: 5,
|
|
total: 0
|
|
}
|
|
this.init()
|
|
},
|
|
getNumber(val, limit) {
|
|
val = val.replace(/[^0-9.]/g, '') // 保留数字
|
|
val = val.replace(/^00/, '0.') // 开头不能有两个0
|
|
val = val.replace(/^\./g, '0.') // 开头为小数点转换为0.
|
|
val = val.replace(/\.{2,}/g, '.') // 两个以上的小数点转换成一个
|
|
val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); // 只保留一个小数点
|
|
/^0\d+/.test(val) ? val = val.slice(1) : '' // 两位以上数字开头不能为0
|
|
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$'
|
|
const reg = new RegExp(str)
|
|
if (limit === 0) {
|
|
// 不需要小数点
|
|
val = val.replace(reg, '$1')
|
|
} else {
|
|
// 通过正则保留小数点后指定的位数
|
|
val = val.replace(reg, '$1.$2')
|
|
}
|
|
return val
|
|
},
|
|
isAdjustmentInput(row) {
|
|
let money = '0'
|
|
// 上传金额(一次上传金额 + 二次上传金额) - 费用 - 待确定金额 - 预提返利
|
|
money = parseFloat(row.uploadMoney !== '' ? row.uploadMoney : 0) + parseFloat(row.secondaryUploadMoney !== '' ? row.secondaryUploadMoney : 0) - parseFloat(row.money !== '' ? row.money : 0) - parseFloat(row.stayDetermineMoney !== '' ? row.stayDetermineMoney : 0) - parseFloat(row.estimateRebate !== '' ? row.estimateRebate : 0)
|
|
if (row.stayDetermineMoney === '0') {
|
|
if (parseFloat(money) > 0) {
|
|
row.isAdjustment = '是'
|
|
row.adjustmentMoney = parseFloat(money)
|
|
row.adjustOrNot = true
|
|
} else if (parseFloat(money) === 0) {
|
|
row.isAdjustment = '是'
|
|
row.adjustmentMoney = parseFloat(money)
|
|
row.adjustOrNot = false
|
|
} else {
|
|
row.isAdjustment = '否'
|
|
row.adjustmentMoney = '0'
|
|
row.adjustmentRemarks = ''
|
|
row.adjustOrNot = true
|
|
}
|
|
} else {
|
|
row.isAdjustment = '否'
|
|
row.adjustmentMoney = '0'
|
|
row.adjustmentRemarks = ''
|
|
row.adjustOrNot = false
|
|
}
|
|
},
|
|
isAdjustmentChange(val, row) {
|
|
if (val === '是') {
|
|
row.adjustmentMoney = parseFloat(row.uploadMoney !== '' ? row.uploadMoney : 0) + parseFloat(row.secondaryUploadMoney !== '' ? row.secondaryUploadMoney : 0) - parseFloat(row.money !== '' ? row.money : 0) - parseFloat(row.stayDetermineMoney !== '' ? row.stayDetermineMoney : 0) - parseFloat(row.estimateRebate !== '' ? row.estimateRebate : 0)
|
|
} else if (val === '否') {
|
|
row.adjustmentMoney = '0'
|
|
row.adjustmentRemarks = ''
|
|
}
|
|
},
|
|
handleClick() {
|
|
this.viewState = 2
|
|
},
|
|
// 新增核对审核申请
|
|
toAdd() {
|
|
this.viewState = 3
|
|
this.$refs['divCheckAdd'].showAdd(this.listQuery.params.createOrgSid)
|
|
},
|
|
// 保存
|
|
toSave(row) {
|
|
if (row.uploadDate === '') {
|
|
this.$message({ showClose: true, type: 'error', message: '上传日期不能为空' })
|
|
return
|
|
}
|
|
if (row.uploadMoney === '') {
|
|
this.$message({ showClose: true, type: 'error', message: '上传金额不能为空' })
|
|
return
|
|
}
|
|
if (row.stayDetermineMoney === '') {
|
|
this.$message({ showClose: true, type: 'error', message: '待确定金额不能为空' })
|
|
return
|
|
}
|
|
if (row.money === '') {
|
|
this.$message({ showClose: true, type: 'error', message: '费用不能为空' })
|
|
return
|
|
}
|
|
req.updateDate(row).then((resp) => {
|
|
if (resp.success) {
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功' })
|
|
this.getList()
|
|
}
|
|
})
|
|
},
|
|
// 二次调整
|
|
toAdjust(row) {
|
|
this.dialogVisible = true
|
|
this.formobj.stayDetermineMoney = row.stayDetermineMoney
|
|
this.formobj.sid = row.sid
|
|
this.formobj.firstCost = 0
|
|
this.formobj.firstRebate = 0
|
|
this.formobj.secondCost = 0
|
|
this.formobj.secondRebate = 0
|
|
this.formobj.secondaryUploadMoney = 0
|
|
this.formobj.cost = row.money
|
|
this.formobj.surplusRebate = parseFloat(row.estimateRebate !== '' ? row.estimateRebate : 0) - parseFloat(row.uploadMoney !== '' ? row.uploadMoney : 0)
|
|
},
|
|
// 二次调整页面--待确定金额模块
|
|
firstCostInput() {
|
|
// 其中含返利 = 待确定金额 - 其中含费用
|
|
this.formobj.firstRebate = parseFloat(this.formobj.stayDetermineMoney !== '' ? this.formobj.stayDetermineMoney : 0) - parseFloat(this.formobj.firstCost !== '' ? this.formobj.firstCost : 0)
|
|
this.adjustmentMoneyAdd()
|
|
},
|
|
// 二次调整页面--返利二次上传模块
|
|
secondCostInput() {
|
|
// 其中含返利 = 二次上传金额 - 其中含费用
|
|
this.formobj.secondRebate = parseFloat(this.formobj.secondaryUploadMoney !== '' ? this.formobj.secondaryUploadMoney : 0) - parseFloat(this.formobj.secondCost !== '' ? this.formobj.secondCost : 0)
|
|
this.adjustmentMoneyAdd()
|
|
},
|
|
// 二次调整页面--返利二次上传模块
|
|
adjustmentMoneyAdd() {
|
|
// 调整金额合计 = 其中含返利之和 - 剩余预提返利
|
|
this.formobj.adjustmentMoney = parseFloat(this.formobj.firstRebate !== '' ? this.formobj.firstRebate : 0) + parseFloat(this.formobj.secondRebate !== '' ? this.formobj.secondRebate : 0) - parseFloat(this.formobj.surplusRebate !== '' ? this.formobj.surplusRebate : 0)
|
|
},
|
|
handleSave() {
|
|
let aa = null
|
|
if (!this.checked) {
|
|
aa = {
|
|
sid: this.formobj.sid,
|
|
stayDetermineMoney: 0,
|
|
cost: parseFloat(this.formobj.cost !== '' ? this.formobj.cost : 0) + parseFloat(this.formobj.firstCost !== '' ? this.formobj.firstCost : 0),
|
|
secondaryUploadDate: '',
|
|
secondaryUploadMoney: 0,
|
|
adjustmentMoney: this.formobj.adjustmentMoney
|
|
}
|
|
} else {
|
|
aa = {
|
|
sid: this.formobj.sid,
|
|
stayDetermineMoney: 0,
|
|
cost: parseFloat(this.formobj.cost !== '' ? this.formobj.cost : 0) + parseFloat(this.formobj.firstCost !== '' ? this.formobj.firstCost : 0) + parseFloat(this.formobj.secondCost !== '' ? this.formobj.secondCost : 0),
|
|
secondaryUploadDate: this.formobj.secondaryUploadDate,
|
|
secondaryUploadMoney: this.formobj.secondaryUploadMoney,
|
|
adjustmentMoney: this.formobj.adjustmentMoney
|
|
}
|
|
}
|
|
req.adjustment(aa).then((resp) => {
|
|
if (resp.success) {
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功' })
|
|
this.getList()
|
|
this.handleReturn()
|
|
}
|
|
})
|
|
},
|
|
handleReturn() {
|
|
this.dialogVisible = false
|
|
this.formobj = {
|
|
sid: '',
|
|
stayDetermineMoney: '',
|
|
firstCost: '',
|
|
firstRebate: '',
|
|
surplusRebate: '',
|
|
secondaryUploadDate: '',
|
|
secondaryUploadMoney: '',
|
|
secondCost: '',
|
|
secondRebate: '',
|
|
adjustmentMoney: '',
|
|
cost: ''
|
|
}
|
|
this.checked = false
|
|
},
|
|
resetState() {
|
|
this.viewState = 1
|
|
},
|
|
doClose() {
|
|
this.$store.dispatch('tagsView/delView', this.$route)
|
|
this.$router.go(-1)
|
|
},
|
|
exportByFirst() {
|
|
const loading = this.$loading({
|
|
lock: true,
|
|
text: 'Loading',
|
|
spinner: 'el-icon-loading',
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
})
|
|
req.excelListOne(this.listQuery.params).then((resp) => {
|
|
loading.close()
|
|
const blob = new Blob([resp], {
|
|
type: 'application/vnd.ms-excel'
|
|
})
|
|
const fileName = '一次导入模版' + '.xls'
|
|
const elink = document.createElement('a')
|
|
elink.download = fileName
|
|
elink.style.display = 'nonde'
|
|
elink.href = URL.createObjectURL(blob)
|
|
document.body.appendChild(elink)
|
|
elink.click()
|
|
URL.revokeObjectURL(elink.href)
|
|
document.body.removeChild(elink)
|
|
}).catch(() => {
|
|
loading.close()
|
|
})
|
|
},
|
|
importByFirst() {
|
|
this.dialogFileVisible = true
|
|
this.updateAction = process.env.VUE_APP_BASE_API + '/scm/v1/scmvehrebate/getExcelOneInfo'
|
|
this.fileList = []
|
|
this.uploadResultMesssage = ''
|
|
},
|
|
exportBySecond() {
|
|
const loading = this.$loading({
|
|
lock: true,
|
|
text: 'Loading',
|
|
spinner: 'el-icon-loading',
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
})
|
|
req.excelListTwo(this.listQuery.params).then((resp) => {
|
|
loading.close()
|
|
const blob = new Blob([resp], {
|
|
type: 'application/vnd.ms-excel'
|
|
})
|
|
const fileName = '二次导入模版' + '.xls'
|
|
const elink = document.createElement('a')
|
|
elink.download = fileName
|
|
elink.style.display = 'nonde'
|
|
elink.href = URL.createObjectURL(blob)
|
|
document.body.appendChild(elink)
|
|
elink.click()
|
|
URL.revokeObjectURL(elink.href)
|
|
document.body.removeChild(elink)
|
|
}).catch(() => {
|
|
loading.close()
|
|
})
|
|
},
|
|
importBySecond() {
|
|
this.dialogFileVisible = true
|
|
this.updateAction = process.env.VUE_APP_BASE_API + '/scm/v1/scmvehrebate/getExcelTwoInfo'
|
|
this.fileList = []
|
|
this.uploadResultMesssage = ''
|
|
},
|
|
handleRemove() {
|
|
this.uploadResultMesssage = ''
|
|
},
|
|
submitUpload() {
|
|
this.uploadData.userSid = window.sessionStorage.getItem('userSid')
|
|
this.uploadData.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
|
this.$refs.upload.submit()
|
|
},
|
|
handleSuccess(resp, file, fileList) {
|
|
const _this = this
|
|
if (resp.success) {
|
|
_this.uploadResultMesssage = resp.msg
|
|
} else {
|
|
_this.uploadResultMesssage = resp.msg
|
|
}
|
|
},
|
|
handleConfirm() {
|
|
if (this.uploadResultMesssage === '') {
|
|
this.$message({ showClose: true, type: 'error', message: '请先上传单车返利模版' })
|
|
return
|
|
} else {
|
|
this.dialogFileVisible = false
|
|
this.updateAction = ''
|
|
this.uploadData.userSid = ''
|
|
this.uploadData.orgPath = ''
|
|
this.getList()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<style scoped>
|
|
.switch_btn {
|
|
padding: 15px 0 10px 0;
|
|
}
|
|
.btn_style {
|
|
background-color: #018ad2;
|
|
color: white;
|
|
font-weight: 600;
|
|
}
|
|
</style>
|
|
|