8 changed files with 1222 additions and 66 deletions
@ -0,0 +1,129 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
// Pc根据条件分页查询数据的列表
|
||||
|
export function pagerList(data) { |
||||
|
return request({ |
||||
|
url: '/base/v1/basediscountpackageapply/listPage', |
||||
|
method: 'post', |
||||
|
data: data, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 欠款提车申请--新增保存
|
||||
|
export function saveOrUpdate(data) { |
||||
|
return request({ |
||||
|
url: '/base/v1/basediscountpackageapply/saveDiscountPackageApplyInfo', |
||||
|
method: 'post', |
||||
|
data: data, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 回显
|
||||
|
export function fetchSid(data) { |
||||
|
return request({ |
||||
|
url: '/base/v1/basediscountpackageapply/fetchDetailsBySid/' + data, |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 获取合同信息
|
||||
|
export function selectBycreateBySid(data) { |
||||
|
return request({ |
||||
|
url: '/base/v1/commoncontract/selectBycreateBySid', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 获取优惠包(销售政策)
|
||||
|
export function getAppPackageByUseOrg(data) { |
||||
|
return request({ |
||||
|
url: '/base/v1/basediscountpackage/getAppPackageByUseOrg', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 删除
|
||||
|
export function delBySids(data) { |
||||
|
return request({ |
||||
|
url: '/base/v1/basediscountpackageapply/delBySids', |
||||
|
method: 'DELETE', |
||||
|
data: data, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 提交
|
||||
|
export function submit(data) { |
||||
|
return request({ |
||||
|
url: '/base/v1/basediscountpackageapply/submitRecordApplication', |
||||
|
method: 'post', |
||||
|
data: data, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 流程审批(同意)
|
||||
|
export function complete(params) { |
||||
|
return request({ |
||||
|
url: '/base/v1/basediscountpackageapply/complete', |
||||
|
method: 'post', |
||||
|
data: params |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 流程审批(驳回)
|
||||
|
export function reject(params) { |
||||
|
return request({ |
||||
|
url: '/base/v1/basediscountpackageapply/reject', |
||||
|
method: 'post', |
||||
|
data: params |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 流程审批(终止)
|
||||
|
export function breakProcess(params) { |
||||
|
return request({ |
||||
|
url: '/base/v1/basediscountpackageapply/breakProcess', |
||||
|
method: 'post', |
||||
|
data: params |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 流程审批(撤回)
|
||||
|
export function revokeProcess(params) { |
||||
|
return request({ |
||||
|
url: '/base/v1/basediscountpackageapply/revokeProcess', |
||||
|
method: 'post', |
||||
|
data: params |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 审批流程(同意)获取下一环节
|
||||
|
export function getNextNodesForSubmit(data) { |
||||
|
return request({ |
||||
|
url: '/base/v1/basediscountpackageapply/getNextNodesForSubmit', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 审批流程(驳回)获取上一环节
|
||||
|
export function getPreviousNodesForReject(data) { |
||||
|
return request({ |
||||
|
url: '/base/v1/basediscountpackageapply/getPreviousNodesForReject', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
@ -0,0 +1,331 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<div class="tab-header webtop"> |
||||
|
<div>{{ viewTitle }}</div> |
||||
|
<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> |
||||
|
<div class=""> |
||||
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd"> |
||||
|
<el-row style="border-top: 1px solid #E0E3EB"> |
||||
|
<el-col :span="4" class="tleftb"> |
||||
|
<span>合同编号</span> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item><span>{{ formobj.contractId }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="4" class="tleftb"> |
||||
|
<span>客户名称</span> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item> |
||||
|
<span>{{ formobj.customerName }}</span> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="4" class="tleftb"> |
||||
|
<span>车型</span> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item> |
||||
|
<span>{{ formobj.model }}</span> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="4" class="tleftb"> |
||||
|
<span>订单台数</span> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item> |
||||
|
<span>{{ formobj.number }}</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.remarks }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<div class="title"> |
||||
|
<div>优惠包列表</div> |
||||
|
</div> |
||||
|
<el-table :key="tableKey" :data="formobj.discountPackageList" :index="index" border style="width: 100%;"> |
||||
|
<el-table-column fixed label="序号" type="index" :index="index + 1" align="center" width="60"></el-table-column> |
||||
|
<el-table-column label="优惠包名称" align="center" width="180"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ scope.row.discountName }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="价值" align="center" width="120"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ scope.row.price }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="优惠包说明" align="center" min-idth="200"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ scope.row.packageExplain }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="数量" align="center" width="150"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ scope.row.number }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="总价值" align="center" width="130"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ scope.row.totalPrice }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<!-- 选择待办人 的弹出框--> |
||||
|
<el-dialog title="填写审批意见" :visible.sync="nodeDialogVisible" width="80%"> |
||||
|
<el-form class="formadd" > |
||||
|
<el-row v-show="currentLink" style="border-top: 1px solid #e0e3eb"> |
||||
|
<el-col :span="4" class="tleftb"> |
||||
|
<span>当前环节:</span> |
||||
|
</el-col> |
||||
|
<el-col :span="20"> |
||||
|
<el-form-item><span>{{ current.taskName }}->{{ nextNode.name }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row :class="{rowClass:!currentLink}"> |
||||
|
<el-col :span="4" class="tleftb"> |
||||
|
<span>意见:</span> |
||||
|
</el-col> |
||||
|
<el-col :span="20"> |
||||
|
<el-form-item><el-input size="small" v-model="dialogList.comment" placeholder="审批意见" class="addinputw" type="textarea" :autosize="{ minRows: 1, maxRows: 10}" 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 { fetchSid, complete, reject, breakProcess, getNextNodesForSubmit, getPreviousNodesForReject } from '@/api/discountpackage/discountpackage' |
||||
|
|
||||
|
export default { |
||||
|
name: 'YouHuiBaoDaiBanInfo', |
||||
|
data() { |
||||
|
return { |
||||
|
viewTitle: '', |
||||
|
submitdisabled: false, |
||||
|
tableKey: 0, |
||||
|
index: 0, |
||||
|
formobj: { |
||||
|
sid: '', |
||||
|
userSid: '', |
||||
|
applyName: '', |
||||
|
contractId: '', |
||||
|
customerName: '', |
||||
|
model: '', |
||||
|
number: '', |
||||
|
createOrgSid: '', |
||||
|
createOrgName: '', |
||||
|
useOrgSid: '', |
||||
|
useOrgName: '', |
||||
|
discountPackageList: [] |
||||
|
}, |
||||
|
rules: {}, |
||||
|
operation: '', // 点击操作按钮 |
||||
|
dialogList: { |
||||
|
comment: '' |
||||
|
}, |
||||
|
startTask: true, |
||||
|
current: { |
||||
|
taskDefKey: '', |
||||
|
taskName: '' // 当前环节名称 |
||||
|
}, |
||||
|
nextNode: {}, // 下一环节 |
||||
|
nodeDialogVisible: false, |
||||
|
currentLink: true, |
||||
|
// 环节所需参数 |
||||
|
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.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: 400 + 'px' |
||||
|
} |
||||
|
}, '*') |
||||
|
}, |
||||
|
methods: { |
||||
|
showInfo(sid) { |
||||
|
this.viewTitle = '优惠包申请详情' |
||||
|
fetchSid(sid).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.formobj = res.data |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 同意 |
||||
|
openAgree(val) { |
||||
|
this.operation = val |
||||
|
this.currentLink = true |
||||
|
this.dialogList.comment = '同意' |
||||
|
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 = '' |
||||
|
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 |
||||
|
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 |
||||
|
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 |
||||
|
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> |
||||
|
.rowClass{ |
||||
|
border-top: 1px solid #E0E3EB; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,268 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<div class="tab-header webtop"> |
||||
|
<div>{{ viewTitle }}</div> |
||||
|
<div> |
||||
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存 |
||||
|
</el-button> |
||||
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submitVehicleApply()">提交 |
||||
|
</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class=""> |
||||
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd"> |
||||
|
<el-row style="border-top: 1px solid #E0E3EB"> |
||||
|
<el-col :span="4" class="tleftb"> |
||||
|
<span><span class="icon">*</span>合同编号</span> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item prop="contractId"> |
||||
|
<el-select v-model="formobj.contractId" placeholder="请选择" @change="changeContractId" filterable> |
||||
|
<el-option v-for="item in discounts_list" :key="item.contractId" :label="item.contractId" :value="item.contractId"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="4" class="tleftb"> |
||||
|
<span>客户名称</span> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item> |
||||
|
<span>{{ formobj.customerName }}</span> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="4" class="tleftb"> |
||||
|
<span>车型</span> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item> |
||||
|
<span>{{ formobj.model }}</span> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="4" class="tleftb"> |
||||
|
<span>订单台数</span> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item> |
||||
|
<span>{{ formobj.number }}</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><el-input v-model="formobj.remarks" clearable placeholder=""/></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<div class="title"> |
||||
|
<div>优惠包列表</div> |
||||
|
<el-button type="primary" size="mini" icon="el-icon-plus" @click="handleAdd">添加</el-button> |
||||
|
</div> |
||||
|
<el-table :key="tableKey" :data="formobj.discountPackageList" :index="index" border style="width: 100%;"> |
||||
|
<el-table-column fixed label="序号" type="index" :index="index + 1" align="center" width="60"></el-table-column> |
||||
|
<el-table-column fixed label="操作" align="center" width="80"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button size="mini" type="danger" @click="dataDelete(scope.$index)">删除 |
||||
|
</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="优惠包名称" align="center" width="180"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-select v-model="scope.row.discountName" placeholder="请选择" @change="changeDiscountName($event, scope.row)" filterable clearable> |
||||
|
<el-option v-for="item in discountsName_list" :key="item.discountName" :label="item.discountName" :value="item.discountName"></el-option> |
||||
|
</el-select> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="价值" align="center" width="120"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ scope.row.price }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="优惠包说明" header-align="center" align="left" min-idth="200"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ scope.row.packageExplain }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="数量" align="center" width="150"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.number" clearable placeholder="" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="总价值" align="center" width="130"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ totalPrice(scope.row) }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { selectBycreateBySid, getAppPackageByUseOrg, saveOrUpdate, submit, fetchSid } from '@/api/discountpackage/discountpackage' |
||||
|
export default { |
||||
|
name: 'YouHuiBaoEdit', |
||||
|
data() { |
||||
|
return { |
||||
|
viewTitle: '', |
||||
|
submitdisabled: false, |
||||
|
tableKey: 0, |
||||
|
index: 0, |
||||
|
discounts_list: [], |
||||
|
discountsName_list: [], |
||||
|
formobj: { |
||||
|
sid: '', |
||||
|
userSid: '', |
||||
|
applyName: '', |
||||
|
contractId: '', |
||||
|
customerName: '', |
||||
|
model: '', |
||||
|
number: '', |
||||
|
createOrgSid: '', |
||||
|
createOrgName: '', |
||||
|
useOrgSid: '', |
||||
|
useOrgName: '', |
||||
|
orgSidPath: '', |
||||
|
discountPackageList: [] |
||||
|
}, |
||||
|
rules: { |
||||
|
contractId: [{ required: true, message: '合同编号不能为空', trigger: 'change' }] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
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)) |
||||
|
this.showInfo(obj.businessSid) |
||||
|
}, |
||||
|
mounted() { |
||||
|
window.parent.postMessage({ |
||||
|
cmd: 'returnHeight', |
||||
|
params: { |
||||
|
// 告诉父级页面,子页面的弹框高度。 |
||||
|
code: 2, |
||||
|
data: 400 + 'px' |
||||
|
} |
||||
|
}, '*') |
||||
|
}, |
||||
|
methods: { |
||||
|
showInfo(sid) { |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs['form_obj'].clearValidate() |
||||
|
}) |
||||
|
this.viewTitle = '【编辑】优惠包申请' |
||||
|
fetchSid(sid).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.formobj = res.data |
||||
|
this.formobj.instanceId = res.data.procInstId |
||||
|
selectBycreateBySid({ createBySid: this.formobj.userSid }).then((resp) => { |
||||
|
if (resp.success) { |
||||
|
this.discounts_list = resp.data |
||||
|
} |
||||
|
}) |
||||
|
getAppPackageByUseOrg({ userOrg: this.formobj.createOrgSid }).then((resp) => { |
||||
|
if (resp.success) { |
||||
|
this.discountsName_list = resp.data |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
changeContractId(value) { |
||||
|
const choose = this.discounts_list.filter((item) => item.contractId === value) |
||||
|
this.formobj.customerName = choose[0].customerName |
||||
|
this.formobj.model = choose[0].model |
||||
|
this.formobj.number = choose[0].number |
||||
|
}, |
||||
|
handleAdd() { |
||||
|
this.formobj.discountPackageList.push({ |
||||
|
discountName: '', |
||||
|
price: '', |
||||
|
packageExplain: '', |
||||
|
number: '', |
||||
|
totalPrice: '' |
||||
|
}) |
||||
|
}, |
||||
|
dataDelete(index) { |
||||
|
this.formobj.discountPackageList.splice(index, 1) |
||||
|
}, |
||||
|
changeDiscountName(value, row) { |
||||
|
const choose = this.discountsName_list.filter((item) => item.discountName === value) |
||||
|
row.price = choose[0].price |
||||
|
row.packageExplain = choose[0].packageExplain |
||||
|
}, |
||||
|
totalPrice(row) { |
||||
|
if (row.price !== '' && row.number !== '') { |
||||
|
row.totalPrice = parseFloat(row.price) * parseFloat(row.number) |
||||
|
} |
||||
|
return row.totalPrice |
||||
|
}, |
||||
|
saveOrUpdate() { |
||||
|
this.$refs['form_obj'].validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.submitdisabled = true |
||||
|
saveOrUpdate(this.formobj).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.$message({ showClose: true, type: 'success', message: '保存成功' }) |
||||
|
this.submitdisabled = false |
||||
|
// 子页面向父级页面传递值(关闭弹框) |
||||
|
window.parent.postMessage({ |
||||
|
cmd: 'returnHeight', |
||||
|
params: { |
||||
|
// 操作成功,告诉父级页面关闭弹框 |
||||
|
code: 1 |
||||
|
} |
||||
|
}, '*') |
||||
|
} else { |
||||
|
this.submitdisabled = false |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
this.submitdisabled = false |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
submitVehicleApply() { |
||||
|
this.$refs['form_obj'].validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.submitdisabled = true |
||||
|
submit(this.formobj).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.$message({ showClose: true, type: 'success', message: '操作成功' }) |
||||
|
this.submitdisabled = false |
||||
|
// 子页面向父级页面传递值(关闭弹框) |
||||
|
window.parent.postMessage({ |
||||
|
cmd: 'returnHeight', |
||||
|
params: { |
||||
|
// 操作成功,告诉父级页面关闭弹框 |
||||
|
code: 1 |
||||
|
} |
||||
|
}, '*') |
||||
|
} else { |
||||
|
this.submitdisabled = false |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
this.submitdisabled = false |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.title { |
||||
|
padding: 7px; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,203 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<div class="tab-header webtop"> |
||||
|
<div>{{ viewTitle }}</div> |
||||
|
<div> |
||||
|
<el-button type="danger" size="small" @click="openRevoke()">撤回</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class=""> |
||||
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd"> |
||||
|
<el-row style="border-top: 1px solid #E0E3EB"> |
||||
|
<el-col :span="4" class="tleftb"> |
||||
|
<span>合同编号</span> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item><span>{{ formobj.contractId }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="4" class="tleftb"> |
||||
|
<span>客户名称</span> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item> |
||||
|
<span>{{ formobj.customerName }}</span> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="4" class="tleftb"> |
||||
|
<span>车型</span> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item> |
||||
|
<span>{{ formobj.model }}</span> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="4" class="tleftb"> |
||||
|
<span>订单台数</span> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item> |
||||
|
<span>{{ formobj.number }}</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.remarks }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<div class="title"> |
||||
|
<div>优惠包列表</div> |
||||
|
</div> |
||||
|
<el-table :key="tableKey" :data="formobj.discountPackageList" :index="index" border style="width: 100%;"> |
||||
|
<el-table-column fixed label="序号" type="index" :index="index + 1" align="center" width="60"></el-table-column> |
||||
|
<el-table-column label="优惠包名称" align="center" width="180"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ scope.row.discountName }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="价值" align="center" width="120"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ scope.row.price }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="优惠包说明" align="center" min-idth="200"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ scope.row.packageExplain }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="数量" align="center" width="150"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ scope.row.number }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="总价值" align="center" width="130"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ scope.row.totalPrice }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { fetchSid, revokeProcess } from '@/api/discountpackage/discountpackage' |
||||
|
|
||||
|
export default { |
||||
|
name: 'YouHuiBaoYiBanInfo', |
||||
|
data() { |
||||
|
return { |
||||
|
viewTitle: '', |
||||
|
submitdisabled: false, |
||||
|
tableKey: 0, |
||||
|
index: 0, |
||||
|
formobj: { |
||||
|
sid: '', |
||||
|
userSid: '', |
||||
|
applyName: '', |
||||
|
contractId: '', |
||||
|
customerName: '', |
||||
|
model: '', |
||||
|
number: '', |
||||
|
createOrgSid: '', |
||||
|
createOrgName: '', |
||||
|
useOrgSid: '', |
||||
|
useOrgName: '', |
||||
|
discountPackageList: [] |
||||
|
}, |
||||
|
rules: {}, |
||||
|
// 环节所需参数 |
||||
|
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.userSid = window.sessionStorage.getItem('userSid') |
||||
|
// 加载表单数据 |
||||
|
this.showInfo(obj.businessSid) |
||||
|
}, |
||||
|
mounted() { |
||||
|
window.parent.postMessage({ |
||||
|
cmd: 'returnHeight', |
||||
|
params: { |
||||
|
// 告诉父级页面,子页面的弹框高度。 |
||||
|
code: 2, |
||||
|
data: 400 + 'px' |
||||
|
} |
||||
|
}, '*') |
||||
|
}, |
||||
|
methods: { |
||||
|
showInfo(sid) { |
||||
|
this.viewTitle = '优惠包申请详情' |
||||
|
fetchSid(sid).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.formobj = res.data |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
/** 确认撤回任务 */ |
||||
|
openRevoke() { |
||||
|
this.$confirm('是否确认执行撤回操作', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.handleRevoke() |
||||
|
}).catch(() => { |
||||
|
this.$message({ |
||||
|
type: 'info', |
||||
|
message: '已取消撤回' |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
/** 撤回任务 */ |
||||
|
handleRevoke() { |
||||
|
revokeProcess(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> |
||||
|
</style> |
Loading…
Reference in new issue