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.
 
 
 
 
 
 

220 lines
7.6 KiB

<template>
<div class="app-container">
<div v-show="viewState == 1">
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleConfirm()">确认</el-button>
<el-button type="danger" size="small" :disabled="submitdisabled" @click="handleBack()">退回</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="listconadd">
<div class="titwu"><span>回款返利分摊</span></div>
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
<el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="6">
<div class="span-sty">分公司</div>
<el-form-item><span class="addinputInfo">{{ formobj.createOrgName }}</span></el-form-item>
</el-col>
<el-col :span="6">
<div class="span-sty">采购系统</div>
<el-form-item><span class="addinputInfo">{{ formobj.purchaseSystemName }}</span></el-form-item>
</el-col>
<el-col :span="6">
<div class="span-sty">品牌</div>
<el-form-item><span class="addinputInfo">{{ formobj.brandName }}</span></el-form-item>
</el-col>
<el-col :span="6">
<div class="span-sty">提交日期</div>
<el-form-item><span class="addinputInfo">{{ formobj.subitDate }}</span></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<div class="span-sty">分摊参考比例(%)</div>
<el-form-item><span class="addinputInfo">{{ formobj.shareGinExaProportion }}</span></el-form-item>
</el-col>
<el-col :span="6">
<div class="span-sty">分摊比例(%)</div>
<el-form-item><span class="addinputInfo">{{ formobj.shareProportion }}</span></el-form-item>
</el-col>
<el-col :span="6">
<div class="span-sty">分摊返利总额</div>
<el-form-item><span class="addinputInfo">{{ formobj.shareRebateTotal }}</span></el-form-item>
</el-col>
<el-col :span="6">
<div class="span-sty">台数</div>
<el-form-item><span class="addinputInfo">{{ formobj.number }}</span></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">备注</div>
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">附件</div>
<el-form-item><el-image class="addinputInfo" style="width: 150px;height: 150px" v-for="(item, index) in list" :key="index" :src="item" :preview-src-list="list" /></el-form-item>
</el-col>
</el-row>
<div class="title">回款返利分摊车辆列表</div>
<el-table :key="tableKey" :data="formobj.scmCollectionRebateVehs" :index="index" border style="width: 100%">
<el-table-column width="80" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="carModelName" label="车型" align="center" min-width="150" />
<el-table-column prop="vinNo" label="车架号" align="center" width="120" />
<el-table-column prop="costPrice" label="车辆入库价" align="center" width="130" />
<el-table-column prop="priceDate" label="入库日期" align="center" width="120" />
<el-table-column prop="salesDate" label="销售日期" align="center" width="120" />
<el-table-column prop="solidDate" label="买断日期" align="center" width="120" />
<el-table-column prop="distributionCollectionRebate" label="分摊金额" align="center" width="130" />
</el-table>
</el-form>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/manufacturerrebates/collectionrebateallot'
export default {
name: 'HuiKuanFanLiFenPeiAdd',
data() {
return {
viewTitle: '',
index: 0,
tableKey: 0,
viewState: 1,
list: [],
// 表单数据
formobj: {
sid: '',
useOrgName: '',
useOrgSid: '',
createOrgName: '',
createOrgSid: '',
purchaseSystemSid: '',
purchaseSystemName: '',
brandName: '',
brandSid: '',
subitDate: '',
shareGinExaProportion: '',
shareProportion: '',
shareRebateTotal: '',
number: '',
remarks: '',
state: '',
urls: [],
scmCollectionRebateVehs: []
},
rules: {},
submitdisabled: false
}
},
methods: {
showEdit(val) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '回款返利分摊'
req.fetchBySid(val.sid).then((res) => {
if (res.success) {
this.formobj = res.data
this.formobj.number = this.formobj.scmCollectionRebateVehs.length
if (this.formobj.urls.length > 0) {
const aa = []
this.formobj.urls.forEach((e) => {
aa.push(e.url)
})
this.list = aa
}
}
})
},
handleConfirm() {
const tip = '请确认是否通过该申请?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.formobj.state = '2'
this.submitdisabled = true
req.save(this.formobj).then((resp) => {
if (resp.success) {
this.$message({ showClose: true, type: 'success', message: '操作成功' })
this.handleReturn('true')
}
}).catch(() => {
this.submitdisabled = false
})
})
},
handleBack() {
const tip = '请确认是否退回该申请?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.formobj.state = '3'
this.submitdisabled = true
req.save(this.formobj).then((resp) => {
if (resp.success) {
this.$message({ showClose: true, type: 'success', message: '操作成功' })
this.handleReturn('true')
}
}).catch(() => {
this.submitdisabled = false
})
})
},
// 返回(===既判断)
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
// 表单数据
this.formobj = {
sid: '',
useOrgName: '',
useOrgSid: '',
createOrgName: '',
createOrgSid: '',
purchaseSystemSid: '',
purchaseSystemName: '',
brandName: '',
brandSid: '',
subitDate: '',
shareGinExaProportion: '',
shareProportion: '',
shareRebateTotal: '',
number: '',
remarks: '',
state: '',
urls: [],
scmCollectionRebateVehs: []
}
this.list = []
this.submitdisabled = false
this.$refs['form_obj'].resetFields()
this.$emit('doback')
}
}
}
</script>
<style scoped>
.span-sty {
width: 140px !important;
}
.addinputInfo {
margin-left: 130px !important;
}
</style>