Browse Source

完善车型调价管理业务和流程相关功能

master
yunuo970428 3 years ago
parent
commit
06b533ef0f
  1. 76
      anrui-scm/anrui-scm-ui/src/api/kucunguanli/price.js
  2. 14
      anrui-scm/anrui-scm-ui/src/router/modules/codemenu.js
  3. 16
      anrui-scm/anrui-scm-ui/src/views/kucunguanli/tiaojiaguanli/chexingbyconfiguration.vue
  4. 42
      anrui-scm/anrui-scm-ui/src/views/kucunguanli/tiaojiaguanli/priceAdd.vue
  5. 4
      anrui-scm/anrui-scm-ui/src/views/kucunguanli/tiaojiaguanli/priceguanli.vue
  6. 204
      anrui-scm/anrui-scm-ui/src/views/workFlow/tiaojiaguanliFlow/tiaojiaguanli/chexingbyconfiguration.vue
  7. 321
      anrui-scm/anrui-scm-ui/src/views/workFlow/tiaojiaguanliFlow/tiaojiaguanli/tiaojiaEdit.vue
  8. 430
      anrui-scm/anrui-scm-ui/src/views/workFlow/tiaojiaguanliFlow/tiaojiaguanli/tiaojiaInfo.vue

76
anrui-scm/anrui-scm-ui/src/api/kucunguanli/price.js

@ -39,7 +39,7 @@ export default {
// 提交流程
submitVehicleApply: function(params) {
return request({
url: '/scm/v1/scmapplyinbound/submitRecordApplication',
url: '/base/v1/basemodelmodprice/submitBaseModelModPrice',
method: 'post',
data: params,
headers: { 'Content-Type': 'application/json' }
@ -52,48 +52,66 @@ export default {
method: 'get'
})
},
// 代办任务同意办理
businessAgree: function(params) {
// 流程审批(同意)
complete: function(params) {
return request({
url: '/scm/v1/scmapplyinbound/complete',
url: '/base/v1/basemodelmodprice/complete',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
data: params
})
},
// 代办任务驳回任务
rejectTask: function(params) {
// 流程审批(驳回)
reject: function(params) {
return request({
url: '/scm/v1/scmapplyinbound/reject/' + params.businessSid,
url: '/base/v1/basemodelmodprice/reject',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
data: params
})
},
// 代办任务终止任务
breakTask: function(params) {
// 流程审批(终止)
breakProcess: function(params) {
return request({
url: '/scm/v1/scmapplyinbound/breakProcess/' + params.businessSid,
url: '/base/v1/basemodelmodprice/breakProcess',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
data: params
})
},
// 代办任务撤回任务
revokeTask: function(params) {
// 流程审批(撤回)
revokeProcess: function(params) {
return request({
url: '/scm/v1/scmapplyinbound/revokeProcess/' + params.userSid + '/' + params.businessSid,
url: '/base/v1/basemodelmodprice/revokeProcess',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
data: params
})
},
// 审批流程(驳回)获取下一环节
getNextNodesForSubmit: function(data) {
return request({
url: '/base/v1/basemodelmodprice/getNextNodesForSubmit',
method: 'get',
params: data
})
},
// 审批流程(驳回)获取上一环节
getPreviousNodesForReject: function(data) {
return request({
url: '/base/v1/basemodelmodprice/getPreviousNodesForReject',
method: 'get',
params: data
})
},
// 读取xml文件
readXml: function(deployId) {
return request({
url: '/flowable/v1/flowable/task/readXml/' + deployId,
method: 'get'
})
},
// 读取image文件
getFlowViewer: function(procInsId) {
return request({
url: '/flowable/v1/flowable/task/flowViewer/' + procInsId,
method: 'get'
})
}
}

14
anrui-scm/anrui-scm-ui/src/router/modules/codemenu.js

@ -514,6 +514,20 @@ const codemenu = [
import('@/views/workFlow/paichanguanliFlow/paichanguanli/cheliangpaichanInfo.vue'),
name: 'cheliangpaichandetails'
},
// 调价管理编辑
{
path: '/tiaojiaguanliFlow/tiaojiaguanli/tiaojiaEdit',
component: () =>
import('@/views/workFlow/tiaojiaguanliFlow/tiaojiaguanli/tiaojiaEdit.vue'),
name: 'tiaojiaEdit'
},
// 调价管理详情
{
path: '/tiaojiaguanliFlow/tiaojiaguanli/tiaojiaInfo',
component: () =>
import('@/views/workFlow/tiaojiaguanliFlow/tiaojiaguanli/tiaojiaInfo.vue'),
name: 'tiaojiaInfo'
},
// 采购退库驳回到发起人办理编辑页面
{
path: '/caigoutuikuFlow/caigoutuikuEdit',

16
anrui-scm/anrui-scm-ui/src/views/kucunguanli/tiaojiaguanli/chexingbyconfiguration.vue

@ -55,6 +55,7 @@
<script>
import Pagination from '@/components/pagination'
import req from '@/api/kucunguanli/price'
import { getPathSidByUserSid } from '@/api/cheliang/dictcommons'
export default {
name: "chexingbyconfiguration",
@ -96,6 +97,15 @@ export default {
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
@ -145,7 +155,7 @@ export default {
})
this.sids = aa
},
showData(value, userOrgSid) {
showData(value) {
const aa = []
if (value.length > 0) {
for (var i = 0; i < value.length; i++) {
@ -158,9 +168,7 @@ export default {
} else {
this.listQuery.params.sidList = []
}
this.listQuery.params.useOrgSid = userOrgSid
this.userOrgSid = userOrgSid
this.getList()
this.getPathSid()
},
//
AddUpdateReturn() {

42
anrui-scm/anrui-scm-ui/src/views/kucunguanli/tiaojiaguanli/priceAdd.vue

@ -116,10 +116,13 @@ export default {
formobj: {
sid: '', // sid
createTime: '',
applyPeoName: window.sessionStorage.getItem('name'),
applyPeoName: '',
useOrgSid: '',
createOrgSid: '',
modpriceReason: '',
instanceId: '', // ID
taskId: '', // ID
createBySid: '',
baseModelModpriceModels: []
},
rules: {},
@ -155,7 +158,7 @@ export default {
//
addCommodity() {
this.viewState = 2
this.$refs['divconfiguration'].showData(this.formobj.baseModelModpriceModels, this.formobj.useOrgSid)
this.$refs['divconfiguration'].showData(this.formobj.baseModelModpriceModels)
},
//
dataDelete(index, row) {
@ -168,25 +171,22 @@ export default {
})
this.formobj.useOrgSid = createOrgSid
this.formobj.createOrgSid = createOrgSid
this.formobj.createBySid = window.sessionStorage.getItem('userSid')
this.formobj.applyPeoName = window.sessionStorage.getItem('name')
this.viewTitle = '【新增】车辆调价申请'
},
showEdit(row, createOrgSid) {
showEdit(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '【编辑】车辆调价申请'
console.log('编辑回显', row.sid)
req.fetchBySid(row.sid).then((resp) => {
const data = resp.data
this.formobj.sid = row.sid
this.formobj.createOrgSid = createOrgSid
this.formobj.useOrgSid = createOrgSid
this.formobj.createTime = data.createTime
this.formobj.applyPeoName = data.applyPeoName
this.formobj.modpriceReason = data.modpriceReason
this.formobj.baseModelModpriceModels = data.baseModelModpriceModels
if (resp.success) {
this.formobj = resp.data
}
}).catch((e) => {
this.formobj = row
this.formobj = {}
})
},
// --
@ -249,12 +249,18 @@ export default {
// ===
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj.schedulingType = '' //
this.formobj.remarks = '' //
this.formobj.currentAmount = ''
this.formobj.applicationCode = ''
this.formobj.createTime = ''
this.formobj.baseModelModpriceModels = []
this.formobj = {
sid: '', // sid
createTime: '',
applyPeoName: '',
useOrgSid: '',
createOrgSid: '',
modpriceReason: '',
instanceId: '', // ID
taskId: '', // ID
createBySid: '',
baseModelModpriceModels: []
}
this.$refs['form_obj'].resetFields()
this.$emit('doback')
},

4
anrui-scm/anrui-scm-ui/src/views/kucunguanli/tiaojiaguanli/priceguanli.vue

@ -34,7 +34,7 @@
<el-table-column width="50px" type="selection" align="center"/>
<el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toEdit(scope.row)">办理</el-button>
<el-button type="primary" size="mini" @click="toEdit(scope.row)" :disabled="scope.row.nodeState =='调价申请' ? false : scope.row.nodeState == '待提交' ? false : true">办理</el-button>
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button>
</template>
</el-table-column>
@ -245,7 +245,7 @@ export default {
},
toEdit(row) {
this.viewState = 3
this.$refs['divAdd'].showEdit(row, this.listQuery.params.createOrgSid)
this.$refs['divAdd'].showEdit(row)
},
toInfo(row) {
this.viewState = 4

204
anrui-scm/anrui-scm-ui/src/views/workFlow/tiaojiaguanliFlow/tiaojiaguanli/chexingbyconfiguration.vue

@ -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>

321
anrui-scm/anrui-scm-ui/src/views/workFlow/tiaojiaguanliFlow/tiaojiaguanli/tiaojiaEdit.vue

@ -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 !== '-') {
// 0102
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>

430
anrui-scm/anrui-scm-ui/src/views/workFlow/tiaojiaguanliFlow/tiaojiaguanli/tiaojiaInfo.vue

@ -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)) // urlunescape()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…
Cancel
Save