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.
400 lines
15 KiB
400 lines
15 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" @click="openAgree('同意')">同 意</el-button>
|
|
<el-button type="danger" size="small" @click="openReject('驳回')">驳 回</el-button>
|
|
<el-button type="danger" size="small" @click="openStop('终止')">终 止</el-button>
|
|
</div>
|
|
</div>
|
|
<!--标题按钮部分结束-->
|
|
<!--Start 新增修改部分-->
|
|
<div class="">
|
|
<div class="titwu"><span>{{ formobj.checkApply }}专项返利核对审核申请</span></div>
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
|
<el-row style="border-top: 1px solid #E0E3EB">
|
|
<el-col :span="16">
|
|
<div class="span-sty">申请编号</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.billNo }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<div class="span-sty">申请日期</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="8">
|
|
<div class="span-sty">分公司</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.createOrgName }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<div class="span-sty">申请部门</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<div class="span-sty">申请人</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<div class="title">本月上传返利核对情况(按返利类型统计)</div>
|
|
<el-table :key="tableKey" :data="formobj.scmWhenSpecialrebateCheckapplydetailDetails" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
|
|
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
|
|
<el-table-column prop="purchaseSystemName" label="采购系统" align="center" min-width="120" />
|
|
<el-table-column prop="brandName" label="品牌" align="center" min-width="100" />
|
|
<el-table-column prop="rebateTypeValue" label="返利类型" align="center" min-width="120" />
|
|
<el-table-column prop="num" label="数量" align="center" min-width="100" />
|
|
<el-table-column prop="withRebate" label="预提金额" align="center" min-width="120" />
|
|
<el-table-column prop="withholdCost" label="其中预提费用" align="center" min-width="140" />
|
|
<el-table-column prop="uploadMoney" label="上传金额" align="center" min-width="120" />
|
|
<el-table-column prop="stayDetermineMoney" label="其中待确认金额" align="center" min-width="150" />
|
|
<el-table-column prop="money" label="其中费用" align="center" min-width="120" />
|
|
<el-table-column prop="adjustmentMoney" label="返利调整金额" align="center" min-width="140" />
|
|
<el-table-column prop="fyAdjustmentMoney" label="其中费用调整金额" align="center" min-width="160" />
|
|
<el-table-column label="明细" align="center" min-width="100">
|
|
<template slot-scope="scope">
|
|
<el-button type="primary" size="mini" @click="handleLook(scope.row)">查看</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<div class="title">本月上传返利核对情况(按预提年月统计)</div>
|
|
<el-table :key="lastSpecialrebateKey" :data="formobj.scmLastSpecialrebateCheckapplydetailDetails" border style="width: 100%">
|
|
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
|
|
<el-table-column prop="purchaseSystemName" label="采购系统" align="center" min-width="120" />
|
|
<el-table-column prop="brandName" label="品牌" align="center" min-width="100" />
|
|
<el-table-column prop="withholdingDate" label="预提年月" align="center" min-width="120" />
|
|
<el-table-column prop="num" label="预提数量" align="center" min-width="120" />
|
|
<el-table-column prop="withRebate" label="预提金额" align="center" min-width="120" />
|
|
<el-table-column prop="withholdCost" label="其中预提费用" align="center" min-width="140" />
|
|
<el-table-column prop="uploadMoney" label="上传金额" align="center" min-width="120" />
|
|
<el-table-column prop="stayDetermineMoney" label="其中待确认金额" align="center" min-width="150" />
|
|
<el-table-column prop="money" label="其中费用" align="center" min-width="120" />
|
|
<el-table-column prop="adjustmentMoney" label="返利调整金额" align="center" min-width="140" />
|
|
<el-table-column prop="fyAdjustmentMoney" label="其中费用调整金额" align="center" min-width="160" />
|
|
<el-table-column label="明细" align="center" min-width="100">
|
|
<template slot-scope="scope">
|
|
<el-button type="primary" size="mini" @click="handleLook(scope.row)">查看</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<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-form>
|
|
</div>
|
|
</div>
|
|
<!--End 添加修改部分-->
|
|
<specialrebatetobecheckedInfo v-show="viewState == 2" ref="divInfo" @doback="resetState"/>
|
|
<!-- 选择待办人 的弹出框-->
|
|
<el-dialog title="填写审批意见" :visible.sync="nodeDialogVisible" width="80%">
|
|
<el-form class="formaddcopy02" >
|
|
<el-row v-show="currentLink" style="border-top: 1px solid #e0e3eb">
|
|
<el-col :span="24">
|
|
<div class="span-sty"><span>当前环节:</span></div>
|
|
<el-form-item><span class="addinputInfo">{{ current.taskName }}->{{ nextNode.name }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row :class="{ rowClass:!currentLink }">
|
|
<el-col :span="24">
|
|
<div class="span-sty"><span>意见:</span></div>
|
|
<el-form-item><el-input size="small" v-model="dialogList.comment" placeholder="审批意见" class="addinputInfo addinputw" clearable ></el-input></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<div style="text-align:center;margin-top: 20px;">
|
|
<el-button type="primary" size="mini" @click="reject">确 定</el-button>
|
|
<el-button type="info " size="mini" @click="nodeDialogVisible = false">取 消</el-button>
|
|
</div>
|
|
</el-form>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import req from '@/api/specialrebate/specialrebatecheck'
|
|
import specialrebatetobecheckedInfo from './relation/specialrebatetobecheckedInfo'
|
|
|
|
export default {
|
|
name: 'ZhuanXiangFanLiHeDuiDaiBanInfo',
|
|
components: {
|
|
specialrebatetobecheckedInfo
|
|
},
|
|
data() {
|
|
return {
|
|
viewTitle: '',
|
|
index: 0,
|
|
tableKey: 0,
|
|
lastSpecialrebateKey: 1,
|
|
viewState: 1,
|
|
operation: '', // 点击操作按钮
|
|
dialogList: {
|
|
comment: ''
|
|
},
|
|
startTask: true,
|
|
current: {
|
|
taskDefKey: '',
|
|
taskName: '' // 当前环节名称
|
|
},
|
|
nextNode: {}, // 下一环节
|
|
nodeDialogVisible: false,
|
|
currentLink: true,
|
|
// 表单数据
|
|
formobj: {
|
|
sid: '',
|
|
createTime: '',
|
|
deptSid: '',
|
|
deptName: '',
|
|
createByName: '',
|
|
createBySid: '',
|
|
checkApply: '',
|
|
createOrgName: '',
|
|
createOrgSid: '',
|
|
useOrgName: '',
|
|
useOrgSid: '',
|
|
remarks: '',
|
|
instanceId: '', // 流程实例ID
|
|
taskId: '', // 任务ID
|
|
orgPath: '',
|
|
scmWhenSpecialrebateCheckapplydetailDetails: [],
|
|
scmLastSpecialrebateCheckapplydetailDetails: [],
|
|
scmSpecialrebateCheckapplydetailDetails: []
|
|
},
|
|
rules: {},
|
|
submitdisabled: false,
|
|
// 环节所需参数
|
|
linkByParameter: {
|
|
businessSid: '',
|
|
comment: '',
|
|
instanceId: '',
|
|
taskId: '',
|
|
orgSidPath: '',
|
|
taskDefKey: '',
|
|
userSid: ''
|
|
}
|
|
}
|
|
},
|
|
created() {
|
|
console.log('url:' + window.location.href)
|
|
var one = window.location.href.indexOf('&data') + 6
|
|
const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用
|
|
const obj = JSON.parse(decodeURIComponent(data))
|
|
console.log('iframe页面获取的obj:', obj)
|
|
// 点击(同意、终止、驳回、驳回)操作时所需的参数
|
|
this.linkByParameter.businessSid = obj.businessSid
|
|
this.linkByParameter.instanceId = obj.instanceId
|
|
this.linkByParameter.taskId = obj.taskId
|
|
this.linkByParameter.taskDefKey = obj.taskDefKey
|
|
this.linkByParameter.orgSidPath = window.sessionStorage.getItem('orgSidPath')
|
|
this.linkByParameter.userSid = window.sessionStorage.getItem('userSid')
|
|
this.current.taskDefKey = obj.taskDefKey
|
|
this.current.taskName = obj.taskName
|
|
// 加载表单数据
|
|
this.showInfo(obj.businessSid)
|
|
},
|
|
mounted() {
|
|
window.parent.postMessage({
|
|
cmd: 'returnHeight',
|
|
params: {
|
|
// 告诉父级页面,子页面的弹框高度。
|
|
code: 2,
|
|
data: 450 + 'px'
|
|
}
|
|
}, '*')
|
|
},
|
|
methods: {
|
|
showInfo(sid) {
|
|
this.$nextTick(() => {
|
|
this.$refs['form_obj'].clearValidate()
|
|
})
|
|
this.viewTitle = '专项返利核对审核申请详情'
|
|
console.log('编辑回显', sid)
|
|
req.fetchDetailsBySid(sid).then((resp) => {
|
|
if (resp.success) {
|
|
this.formobj = resp.data
|
|
}
|
|
}).catch((e) => {
|
|
this.formobj = {}
|
|
})
|
|
},
|
|
handleLook(row) {
|
|
this.viewState = 2
|
|
this.$refs['divInfo'].showInfo(row.specialRebateSids)
|
|
},
|
|
resetState() {
|
|
this.viewState = 1
|
|
},
|
|
// 合计
|
|
getSummaries(param) {
|
|
const { columns, data } = param
|
|
const sums = []
|
|
columns.forEach((column, index) => {
|
|
if (index === 0) {
|
|
sums[index] = '合计'
|
|
return
|
|
}
|
|
const values = data.map(item => Number(item[column.property]))
|
|
if (column.property !== 'purchaseSystemName' && column.property !== 'brandName' && column.property !== 'rebateTypeValue' && column.property !== undefined) {
|
|
sums[index] = values.reduce((prev, curr) => {
|
|
const value = Number(curr)
|
|
if (!isNaN(value)) {
|
|
return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100
|
|
} else {
|
|
return Math.round((parseFloat(prev)) * 100) / 100
|
|
}
|
|
}, 0)
|
|
sums[index] += ''
|
|
}
|
|
})
|
|
return sums
|
|
},
|
|
// 同意
|
|
openAgree(val) {
|
|
this.operation = val
|
|
this.currentLink = true
|
|
this.dialogList.comment = '同意'
|
|
req.getNextNodesForSubmit({ taskDefKey: this.current.taskDefKey, businessSid: this.linkByParameter.businessSid }).then((resp) => {
|
|
if (resp.success) {
|
|
var arr = resp.data
|
|
this.nextNode = arr[0]
|
|
this.nodeDialogVisible = true
|
|
}
|
|
this.submitdisabled = false
|
|
})
|
|
},
|
|
// 驳回
|
|
openReject(val) {
|
|
this.operation = val
|
|
this.currentLink = true
|
|
this.dialogList.comment = ''
|
|
req.getPreviousNodesForReject({ taskDefKey: this.current.taskDefKey, businessSid: this.linkByParameter.businessSid }).then((resp) => {
|
|
if (resp.success) {
|
|
var arr = resp.data
|
|
this.nextNode = arr[0]
|
|
this.nodeDialogVisible = true
|
|
}
|
|
this.submitdisabled = false
|
|
})
|
|
},
|
|
// 终止
|
|
openStop(val) {
|
|
this.operation = val
|
|
this.currentLink = false
|
|
this.dialogList.comment = ''
|
|
this.nodeDialogVisible = true
|
|
},
|
|
reject() {
|
|
if (this.operation === '同意') {
|
|
this.handleAgree()
|
|
} else if (this.operation === '驳回') {
|
|
if (this.dialogList.comment === '') {
|
|
this.$message({ showClose: true, type: 'error', message: '请填写审批意见' })
|
|
} else {
|
|
this.handleReject()
|
|
}
|
|
} else if (this.operation === '终止') {
|
|
if (this.dialogList.comment === '') {
|
|
this.$message({ showClose: true, type: 'error', message: '请填写审批意见' })
|
|
} else {
|
|
this.handleStop()
|
|
}
|
|
}
|
|
},
|
|
/** 同意任务 */
|
|
handleAgree() {
|
|
this.linkByParameter.comment = this.dialogList.comment
|
|
req.complete(this.linkByParameter).then((response) => {
|
|
if (response.success) {
|
|
this.$notify({
|
|
title: '提示',
|
|
message: '执行成功',
|
|
type: 'success',
|
|
duration: 2000
|
|
})
|
|
this.nodeDialogVisible = false
|
|
// 子页面向父级页面传递值
|
|
window.parent.postMessage({
|
|
cmd: 'returnHeight',
|
|
params: {
|
|
// 操作成功,告诉父级页面关闭弹框
|
|
code: 1
|
|
}
|
|
}, '*')
|
|
}
|
|
})
|
|
},
|
|
/** 驳回任务 */
|
|
handleReject() {
|
|
this.linkByParameter.comment = this.dialogList.comment
|
|
req.reject(this.linkByParameter).then((response) => {
|
|
if (response.success) {
|
|
this.$notify({
|
|
title: '提示',
|
|
message: '执行成功',
|
|
type: 'success',
|
|
duration: 2000
|
|
})
|
|
this.nodeDialogVisible = false
|
|
// 子页面向父级页面传递值
|
|
window.parent.postMessage({
|
|
cmd: 'returnHeight',
|
|
params: {
|
|
// 操作成功,告诉父级页面关闭弹框
|
|
code: 1
|
|
}
|
|
}, '*')
|
|
}
|
|
})
|
|
},
|
|
/** 终止任务 */
|
|
handleStop() {
|
|
this.linkByParameter.comment = this.dialogList.comment
|
|
req.breakProcess(this.linkByParameter).then((response) => {
|
|
if (response.success) {
|
|
this.$notify({
|
|
title: '提示',
|
|
message: '执行成功',
|
|
type: 'success',
|
|
duration: 2000
|
|
})
|
|
this.nodeDialogVisible = false
|
|
// 子页面向父级页面传递值
|
|
window.parent.postMessage({
|
|
cmd: 'returnHeight',
|
|
params: {
|
|
// 操作成功,告诉父级页面关闭弹框
|
|
code: 1
|
|
}
|
|
}, '*')
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<style scoped>
|
|
.titwu {
|
|
font-size: 28px;
|
|
text-align: center;
|
|
padding: 30px 0 20px 0;
|
|
}
|
|
.rowClass {
|
|
border-top: 1px solid #E0E3EB;
|
|
}
|
|
.span-sty {
|
|
width: 130px !important;
|
|
}
|
|
.addinputInfo {
|
|
margin-left: 120px !important;
|
|
}
|
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
|
margin-left: 120px !important;
|
|
width: calc(100% - 115px);
|
|
}
|
|
</style>
|
|
|
|
|