8 changed files with 1054 additions and 53 deletions
@ -0,0 +1,204 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div> |
|||
<div class="tab-header webtop"> |
|||
<div>车型常用列表</div> |
|||
<div> |
|||
<el-button type="primary" size="small" @click="AddUpdateReturn">确定</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<div class=""> |
|||
<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" class="tab-header"> |
|||
<el-form-item label="车型:"> |
|||
<el-input v-model="listQuery.params.vehicleAlias" placeholder="" clearable class="filter-item"/> |
|||
</el-form-item> |
|||
<el-form-item label="常用配置:"> |
|||
<el-input v-model="listQuery.params.configName" placeholder="" clearable class="filter-item"/> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center"> |
|||
<el-button type="primary" size="small" @click="handleFilter">查询</el-button> |
|||
<el-button type="primary" size="small" @click="handresetting">重置</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class=""> |
|||
<el-table :key="tableKey" ref="multipleTable" v-loading="listLoading" :data="list" border style="width: 100%" @selection-change="handleSelectionChange"> |
|||
<el-table-column width="50px" type="selection" align="center"/> |
|||
<el-table-column width="80px" label="编号" type="index" :index="indexMethod" align="center"/> |
|||
<el-table-column label="车型" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.vehicleAlias }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="常用配置" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.configName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
<div class="pages"> |
|||
<div class="tit"/> |
|||
<!-- 翻页 --> |
|||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from '@/components/pagination' |
|||
import req from '@/api/kucunguanli/price' |
|||
import { getPathSidByUserSid } from '@/api/cheliang/dictcommons' |
|||
|
|||
export default { |
|||
name: "chexingbyconfiguration", |
|||
components: { |
|||
Pagination |
|||
}, |
|||
data() { |
|||
return { |
|||
isSearchShow: false, |
|||
searchxianshitit: '隐藏查询条件', |
|||
tableKey: 0, |
|||
showbackState: 30, |
|||
sids: [], |
|||
list: [], |
|||
number: '', |
|||
listLoading: false, |
|||
userOrgSid: '', |
|||
listQuery: { |
|||
current: 1, |
|||
size: 10, |
|||
params: { |
|||
vehicleAlias: '', |
|||
configName: '', |
|||
useOrgSid: '', |
|||
vehicleStateValue: '库存', |
|||
sidList: [] |
|||
}, |
|||
total: 1 |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
getPathSid() { |
|||
const userSid = window.sessionStorage.getItem('userSid') |
|||
getPathSidByUserSid({ userSid: userSid }).then((res) => { |
|||
if (res.code === '200') { |
|||
this.listQuery.params.useOrgSid = res.data |
|||
this.getList() |
|||
} |
|||
}) |
|||
}, |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 返回 |
|||
handleReturn() { |
|||
this.$emit('doback') |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
req.configurationlistPage(this.listQuery).then((response) => { |
|||
this.listLoading = false |
|||
if (response.success) { |
|||
this.listQuery.total = response.data.total |
|||
this.list = response.data.records |
|||
} |
|||
}) |
|||
}, |
|||
// 查询按钮 |
|||
handleFilter() { |
|||
this.getList() |
|||
}, |
|||
// 重置按钮 |
|||
handresetting() { |
|||
this.listQuery.current = 1 |
|||
this.listQuery.size = 10 |
|||
this.listQuery.total = 0 |
|||
this.listQuery.params.vehicleAlias = '' |
|||
this.listQuery.params.configName = '' |
|||
this.listQuery.params.vehicleStateValue = '库存' |
|||
this.listQuery.params.useOrgSid = this.userOrgSid |
|||
this.getList() |
|||
}, |
|||
handleSelectionChange(row) { |
|||
this.sids = [] |
|||
const aa = [] |
|||
row.forEach((element) => { |
|||
aa.push({ |
|||
vehicleAlias: element.vehicleAlias, |
|||
modelSid: element.modelSid, |
|||
configName: element.configName, |
|||
configSid: element.configSid, |
|||
guidedPrice: element.guidedPrice |
|||
}) |
|||
}) |
|||
this.sids = aa |
|||
}, |
|||
showData(value) { |
|||
const aa = [] |
|||
if (value.length > 0) { |
|||
for (var i = 0; i < value.length; i++) { |
|||
aa.push({ |
|||
modelSid: value[i].modelSid, |
|||
configSid: value[i].configSid |
|||
}) |
|||
} |
|||
this.listQuery.params.sidList = aa |
|||
} else { |
|||
this.listQuery.params.sidList = [] |
|||
} |
|||
this.getPathSid() |
|||
}, |
|||
// 添加修改返回 |
|||
AddUpdateReturn() { |
|||
if (this.sids.length > 0) { |
|||
this.$emit('backData', this.sids) |
|||
} else { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '请选择至少一条车型记录!', |
|||
type: 'error', |
|||
duration: 2000 |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
.btn { |
|||
padding: 15px 0 15px 0; |
|||
border: 1px solid #e0e3eb; |
|||
} |
|||
|
|||
.tab-header { |
|||
background-color: #edf1f7; |
|||
padding: 8px 20px; |
|||
margin-bottom: 0 !important; |
|||
} |
|||
|
|||
.tab-header /deep/ .el-form-item { |
|||
margin-bottom: 10px; |
|||
} |
|||
</style> |
@ -0,0 +1,321 @@ |
|||
<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="saveOrUpdate()">保存 |
|||
</el-button> |
|||
<el-button type="primary" size="small" @click="submitVehicleApply()">提交 |
|||
</el-button> |
|||
</div> |
|||
</div> |
|||
<!--标题按钮部分结束--> |
|||
<!--Start 新增修改部分--> |
|||
<div class=""> |
|||
<div class="wlInfo"><span>车辆调价申请</span></div> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules"> |
|||
<el-row> |
|||
<el-col :span="4"> |
|||
<span>调价申请日期:</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<span style="margin-left: 5px">{{ formobj.createTime }}</span> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<span>申请人:</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<span style="margin-left: 5px">{{ formobj.applyPeoName }}</span> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="el-form-item-right"> |
|||
<span>调价原因:</span> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item> |
|||
<el-input v-model="formobj.modpriceReason" clearable style="width: 30%"/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<div class="tableStyle"> |
|||
<div style="margin-left: 5px;font-weight: bold">车辆列表</div> |
|||
<div style="margin-left: 15px"> |
|||
<el-button type="primary" size="mini" icon="el-icon-plus" @click="addCommodity()">选择车型</el-button> |
|||
</div> |
|||
</div> |
|||
<el-table :key="tableKey" :data="formobj.baseModelModpriceModels" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column fixed prop="name" label="操作" width="100px" align="center" header-align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-button size="mini" type="danger" @click="dataDelete(scope.$index, formobj.baseModelModpriceModels[scope.$index])">删除 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="车型" align="left" header-align="center" width="250"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.vehicleAlias }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="常用配置" align="left" header-align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.configName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="applyForDeposit" label="成本价" header-align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.costPrice" placeholder="" @keyup.native="UpNumber" @keydown.native="UpNumber" class="addinputw" clearable/> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="现销售指导价(万元)" header-align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.guidedPrice }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="价格增减数额" header-align="center" width="200"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.incOrDecInPrice" placeholder="" @keyup.native="UpNumber" @keydown.native="UpNumber" class="addinputw" clearable/> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="备注" header-align="center" width="200"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.remarks" placeholder="" class="addinputw" clearable/> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
</div> |
|||
<!--End 添加修改部分--> |
|||
<!--选择车型和常用配置--> |
|||
<configuration v-show="viewState == 2" ref="divconfiguration" @backData="backData" @doback="closePage"/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/kucunguanli/price' |
|||
import configuration from './chexingbyconfiguration' |
|||
|
|||
export default { |
|||
name: 'tiaojiaEdit', |
|||
components: { |
|||
configuration |
|||
}, |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
viewState: 1, |
|||
index: 0, |
|||
tableKey: 0, |
|||
// 表单数据 |
|||
formobj: { |
|||
sid: '', // 一条数据的sid |
|||
createTime: '', |
|||
applyPeoName: window.sessionStorage.getItem('name'), |
|||
useOrgSid: '', |
|||
createOrgSid: '', |
|||
modpriceReason: '', |
|||
instanceId: '', // 流程实例ID |
|||
taskId: '', // 任务ID |
|||
createBySid: '', |
|||
baseModelModpriceModels: [] |
|||
}, |
|||
rules: {}, |
|||
submitdisabled: false |
|||
} |
|||
}, |
|||
created() { |
|||
console.log('url:' + window.location.href) |
|||
var a = window.location.href.indexOf('?') + 1 // 第一个?后面的一个字符的位置 |
|||
var b = window.location.href.indexOf('#data') // 第一个#data出现的位置 |
|||
const info = window.location.href.slice(a, b) |
|||
var sid = info.substr(info.indexOf('=') + 1) |
|||
this.showInfo(sid) |
|||
}, |
|||
mounted() { |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 告诉父级页面,子页面的弹框高度。 |
|||
code: 2, |
|||
data: document.body.scrollHeight + 'px' |
|||
} |
|||
}, '*') |
|||
}, |
|||
methods: { |
|||
// 获取制单日期 |
|||
newDate() { |
|||
let date = new Date() |
|||
let year = date.getFullYear() // 年 |
|||
let month = date.getMonth() + 1 // 月 |
|||
let day = date.getDate() // 日 |
|||
if (month < 10) { |
|||
month = '0' + month |
|||
} |
|||
if (day < 10) { |
|||
day = '0' + day |
|||
} |
|||
this.formobj.createTime = year + '-' + month + '-' + day |
|||
}, |
|||
UpNumber(e) { |
|||
e.target.value = e.target.value.replace(/[^\d.-]/g, '') // 清除“数字”和“.”"-"以外的字符 |
|||
e.target.value = e.target.value.replace(/^00/, '0.') // 开头不能有两个0 |
|||
e.target.value = e.target.value.replace(/\.{2,}/g, '.') // 只保留第一个. 清除多余的 |
|||
e.target.value = e.target.value.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/\-{2,}/g, '-') // 只保留第一个- |
|||
e.target.value = e.target.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3') // 只能输入两个小数 |
|||
if (e.target.value.indexOf('.') < 0 && e.target.value !== '' && e.target.value !== '-') { |
|||
// 以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额 |
|||
e.target.value = parseFloat(e.target.value) |
|||
} |
|||
}, |
|||
// 明细表添加一行数据 |
|||
addCommodity() { |
|||
this.viewState = 2 |
|||
this.$refs['divconfiguration'].showData(this.formobj.baseModelModpriceModels) |
|||
}, |
|||
// 明细表删除一行数据 |
|||
dataDelete(index, row) { |
|||
this.formobj.baseModelModpriceModels.splice(index, 1) |
|||
}, |
|||
showInfo(sid) { |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
this.viewTitle = '【编辑】车辆调价申请' |
|||
console.log('编辑回显', sid) |
|||
req.fetchBySid(sid).then((resp) => { |
|||
if (resp.success) { |
|||
this.formobj.sid = resp.data.sid // 一条数据的sid |
|||
this.formobj.createTime = resp.data.createTime |
|||
this.formobj.applyPeoName = resp.data.applyPeoName |
|||
this.formobj.useOrgSid = resp.data.useOrgSid |
|||
this.formobj.createOrgSid = resp.data.createOrgSid |
|||
this.formobj.modpriceReason = resp.data.modpriceReason |
|||
this.formobj.instanceId = resp.data.procInstId // 流程实例ID |
|||
this.formobj.taskId = resp.data.taskId // 任务ID |
|||
this.formobj.createBySid = resp.data.createBySid |
|||
this.formobj.baseModelModpriceModels = resp.data.baseModelModpriceModels |
|||
} |
|||
}).catch((e) => { |
|||
this.formobj = {} |
|||
}) |
|||
}, |
|||
// 车型常用配置列表--新增确定返回的数据 |
|||
backData(value) { |
|||
this.viewState = 1 |
|||
if (value.length > 0) { |
|||
value.forEach((e) => { |
|||
this.formobj.baseModelModpriceModels.push({ |
|||
mainSid: '', |
|||
modelSid: e.modelSid, |
|||
vehicleAlias: e.vehicleAlias, |
|||
configSid: e.configSid, |
|||
configName: e.configName, |
|||
costPrice: '', |
|||
guidedPrice: e.guidedPrice, |
|||
incOrDecInPrice: '', |
|||
remarks: '' |
|||
}) |
|||
}) |
|||
} |
|||
}, |
|||
saveOrUpdate() { |
|||
this.$refs['form_obj'].validate((valid) => { |
|||
if (valid) { |
|||
this.submitdisabled = true |
|||
req.saveOrUpdate(this.formobj).then((resp) => { |
|||
this.submitdisabled = false |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'success', |
|||
message: resp.msg |
|||
}) |
|||
// 子页面向父级页面传递值(关闭弹框) |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
} else { |
|||
return false |
|||
} |
|||
}) |
|||
}, |
|||
submitVehicleApply() { |
|||
req.submitVehicleApply(this.formobj).then((res) => { |
|||
if (res.success) { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'success', |
|||
message: '提交成功' |
|||
}) |
|||
// 子页面向父级页面传递值(关闭弹框) |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} else { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'error', |
|||
message: '提交失败' |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
closePage() { |
|||
this.viewState = 1 |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.wlInfo { |
|||
text-align: center; |
|||
font-size: 28px; |
|||
line-height: 90px; |
|||
} |
|||
.tableStyle { |
|||
background-color: #FFFFFF; |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
align-items: center; |
|||
border: 1px solid #dfe4ed; |
|||
height: 40px; |
|||
} |
|||
/deep/ .el-col-4 { |
|||
text-align: right; |
|||
float: left; |
|||
font-size: 14px; |
|||
color: #606266; |
|||
line-height: 40px !important; |
|||
font-weight: 600; |
|||
} |
|||
/deep/ .el-col-8 { |
|||
text-align: left; |
|||
float: left; |
|||
font-size: 14px; |
|||
color: #606266; |
|||
line-height: 40px !important; |
|||
font-weight: 600; |
|||
} |
|||
|
|||
.icon { |
|||
color: #e84026; |
|||
margin-right: 4px; |
|||
} |
|||
</style> |
|||
|
@ -0,0 +1,430 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div> |
|||
<!--标题按钮部分开始--> |
|||
<div class="tab-header webtop"> |
|||
<!--标题--> |
|||
<div>车辆调价详情</div> |
|||
<!--start 添加修改按钮--> |
|||
<div> |
|||
<el-button v-show="transactState=='00'" type="primary" @click="openAgree('同意')">同 意</el-button> |
|||
<el-button v-show="transactState=='00'" type="danger" @click="openReject('驳回')">驳 回</el-button> |
|||
<el-button v-show="transactState=='00'" type="danger" @click="openStop('终止')">终 止</el-button> |
|||
<el-button v-show="transactState=='01' && current.taskName !== '调价申请'" type="danger" @click="openRevoke()">撤 回</el-button> |
|||
</div> |
|||
</div> |
|||
<!--标题按钮部分结束--> |
|||
<!--Start 新增修改部分--> |
|||
<div class="listconadd"> |
|||
<div class="wlInfo"><span>车辆调价申请</span></div> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" label-position="top"> |
|||
<el-row> |
|||
<el-col :span="4"> |
|||
<span>调价申请日期:</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<span style="margin-left: 5px">{{ formobj.createTime }}</span> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<span>申请人:</span> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<span style="margin-left: 5px">{{ formobj.applyPeoName }}</span> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="el-form-item-right"> |
|||
<span>调价原因:</span> |
|||
</el-col> |
|||
<el-col :span="20"> |
|||
<el-form-item> |
|||
<span style="margin-left: 5px">{{ formobj.modpriceReason }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<div class="tableStyle"> |
|||
<div style="margin-left: 5px;font-weight: bold">车辆列表</div> |
|||
</div> |
|||
<el-table :key="tableKey" :data="formobj.baseModelModpriceModels" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column label="车型" align="center" header-align="center" width="250"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.vehicleAlias }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="常用配置" align="left" header-align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.configName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="applyForDeposit" label="成本价" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.costPrice }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="现销售指导价(万元)" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.remarks }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="价格增减数额" header-align="center" align="center" width="200"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.incOrDecInPrice }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="备注" header-align="center" width="200"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.remarks }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
</div> |
|||
<!--End 添加修改部分--> |
|||
<span class="el-icon-picture-outline">流程图</span> |
|||
<flow :xmlData="xmlData" :taskData="taskList"></flow> |
|||
<!--End 添加修改部分--> |
|||
<!-- 选择待办人 的弹出框--> |
|||
<el-dialog title="选择待办人" :visible.sync="nodeDialogVisible" width="80%"> |
|||
<el-form label-position="right" class="formadd" > |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb">当前环节</el-col> |
|||
<el-col :span="20" class="trightb"> |
|||
<el-form-item prop="purchasingUnitName"><span>{{ current.taskName }}->{{ nextNode.name }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb">意见</el-col> |
|||
<el-col :span="20" class="trightb"> |
|||
<el-input size="small" v-model="dialogList.comment" placeholder="审批意见" class="addinputw" clearable ></el-input> |
|||
</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/kucunguanli/price' |
|||
import flow from '../../../baseoutsourcingapplication/workflow/flow' |
|||
|
|||
export default { |
|||
name: 'tiaojiaInfo', |
|||
components: { |
|||
flow |
|||
}, |
|||
data() { |
|||
return { |
|||
dialogStatus: '', |
|||
index: 0, |
|||
tableKey: 0, |
|||
operation: '', // 点击操作按钮 |
|||
dialogList: { |
|||
comment: '' |
|||
}, |
|||
xmlData: '', // 模型xml数据 |
|||
taskList: [], |
|||
startTask: true, |
|||
current: { |
|||
taskDefKey: '', |
|||
taskName: '' // 当前环节名称 |
|||
}, |
|||
nextNode: {}, // 下一环节 |
|||
nodeDialogVisible: false, |
|||
// 表单数据 |
|||
formobj: {}, |
|||
transactState: '', // 办理状态 |
|||
// 环节所需参数 |
|||
linkByParameter: { |
|||
businessSid: '', |
|||
comment: '', |
|||
instanceId: '', |
|||
taskId: '', |
|||
orgSidPath: '', |
|||
taskDefKey: '', |
|||
userSid: '' |
|||
}, |
|||
rules: {} |
|||
} |
|||
}, |
|||
created() { |
|||
console.log('url:' + window.location.href) |
|||
var a = window.location.href.indexOf('?') + 1 // 第一个?后面的一个字符的位置 |
|||
var b = window.location.href.indexOf('#data') // 第一个#data出现的位置 |
|||
const info = window.location.href.slice(a, b) |
|||
var sid = info.substr(info.indexOf('=') + 1) |
|||
this.showInfo(sid) |
|||
// ===获取参数 |
|||
var one = window.location.href.lastIndexOf('#') + 1 |
|||
var two = window.location.href.lastIndexOf('}') + 1 |
|||
const data = decodeURI(window.location.href.slice(one, two)) // url解码unescape()已从web中移除,尽量不使用 |
|||
var tar = data.substr(data.indexOf('=') + 1) |
|||
const obj = JSON.parse(tar) |
|||
console.log('iframe页面获取的obj:', obj) |
|||
// 点击(同意、终止、驳回、驳回)操作时所需的参数 |
|||
this.linkByParameter.businessSid = sid |
|||
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 = obj.userSid |
|||
this.current.taskDefKey = obj.taskDefKey |
|||
this.current.taskName = obj.taskName |
|||
// 办理状态 |
|||
this.transactState = obj.transactState |
|||
// 加载流程图相关的数据 |
|||
this.getModelDetail(obj.deployId) |
|||
this.getFlowViewer(obj.instanceId) |
|||
}, |
|||
mounted() { |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 告诉父级页面,子页面的弹框高度。 |
|||
code: 2, |
|||
data: document.body.scrollHeight + 'px' |
|||
} |
|||
}, '*') |
|||
}, |
|||
methods: { |
|||
showInfo(sid) { |
|||
req.fetchBySid(sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
} |
|||
}) |
|||
}, |
|||
/** xml 文件 */ |
|||
getModelDetail(deployId) { |
|||
// 发送请求,获取xml |
|||
req.readXml(deployId).then((res) => { |
|||
this.xmlData = res.data |
|||
}) |
|||
}, |
|||
// 已办环节的节点 |
|||
getFlowViewer(procInsId){ |
|||
req.getFlowViewer(procInsId).then((res) =>{ |
|||
this.taskList = res.data |
|||
}) |
|||
}, |
|||
// 同意 |
|||
openAgree(val) { |
|||
this.operation = val |
|||
req.getNextNodesForSubmit({ taskDefKey: this.current.taskDefKey }).then((resp) => { |
|||
if (resp.success) { |
|||
var arr = resp.data |
|||
this.nextNode = arr[0] |
|||
this.nodeDialogVisible = true |
|||
} |
|||
this.submitdisabled = false |
|||
}) |
|||
}, |
|||
// 驳回 |
|||
openReject(val) { |
|||
this.operation = val |
|||
req.getPreviousNodesForReject({ taskDefKey: this.current.taskDefKey }).then((resp) => { |
|||
if (resp.success) { |
|||
var arr = resp.data |
|||
this.nextNode = arr[0] |
|||
this.nodeDialogVisible = true |
|||
} |
|||
this.submitdisabled = false |
|||
}) |
|||
}, |
|||
// 终止 |
|||
openStop(val) { |
|||
this.operation = val |
|||
req.getPreviousNodesForReject({ taskDefKey: this.current.taskDefKey }).then((resp) => { |
|||
if (resp.success) { |
|||
var arr = resp.data |
|||
this.nextNode = arr[0] |
|||
this.nodeDialogVisible = true |
|||
} |
|||
this.submitdisabled = false |
|||
}) |
|||
}, |
|||
/** 确认撤回任务 */ |
|||
openRevoke() { |
|||
this.$confirm('是否确认执行撤回操作', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.handleRevoke() |
|||
}).catch(() => { |
|||
this.$message({ |
|||
type: 'info', |
|||
message: '已取消撤回' |
|||
}) |
|||
}) |
|||
}, |
|||
reject() { |
|||
if (this.operation === '同意') { |
|||
this.handleAgree() |
|||
} else if (this.operation === '驳回') { |
|||
this.handleReject() |
|||
} else if (this.operation === '终止') { |
|||
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 |
|||
} |
|||
}, '*') |
|||
} else { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '执行失败', |
|||
type: 'error', |
|||
duration: 2000 |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
/** 驳回任务 */ |
|||
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 |
|||
} |
|||
}, '*') |
|||
} else { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '执行失败', |
|||
type: 'error', |
|||
duration: 2000 |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
/** 终止任务 */ |
|||
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 |
|||
} |
|||
}, '*') |
|||
} else { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '执行失败', |
|||
type: 'error', |
|||
duration: 2000 |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
/** 撤回任务 */ |
|||
handleRevoke() { |
|||
this.linkByParameter.comment = this.dialogList.comment |
|||
req.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 |
|||
} |
|||
}, '*') |
|||
} else { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '执行失败', |
|||
type: 'error', |
|||
duration: 2000 |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.wlInfo { |
|||
text-align: center; |
|||
font-size: 28px; |
|||
line-height: 90px; |
|||
} |
|||
.tableStyle { |
|||
background-color: #FFFFFF; |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
align-items: center; |
|||
border: 1px solid #dfe4ed; |
|||
height: 40px; |
|||
} |
|||
/deep/ .el-col-4 { |
|||
text-align: right; |
|||
float: left; |
|||
font-size: 14px; |
|||
color: #606266; |
|||
line-height: 40px !important; |
|||
font-weight: 600; |
|||
} |
|||
/deep/ .el-col-8 { |
|||
text-align: left; |
|||
float: left; |
|||
font-size: 14px; |
|||
color: #606266; |
|||
line-height: 40px !important; |
|||
font-weight: 600; |
|||
} |
|||
</style> |
|||
|
Loading…
Reference in new issue