Browse Source

完善未售买断管理

master
yunuo970428 3 years ago
parent
commit
fc26222877
  1. 74
      anrui-scm/anrui-scm-ui/src/api/weishoumaiduan/unsold.js
  2. 28
      anrui-scm/anrui-scm-ui/src/router/modules/codemenu.js
  3. 17
      anrui-scm/anrui-scm-ui/src/views/weishoumaiduan/weishoumaiduanguanli/unsoldAdd.vue
  4. 285
      anrui-scm/anrui-scm-ui/src/views/workFlow/weishoumaiduanFlow/weishoumaiduanguanli/weishoumaiduanInfo.vue
  5. 287
      anrui-scm/anrui-scm-ui/src/views/workFlow/weishoumaiduanFlow/weishoumaiduanguanli/weushoumaiduanEdit.vue

74
anrui-scm/anrui-scm-ui/src/api/weishoumaiduan/unsold.js

@ -54,48 +54,66 @@ export default {
method: 'get'
})
},
// 代办任务同意办理
businessAgree: function(params) {
// 流程审批(同意)
complete: function(params) {
return request({
url: '/scm/v1/scmapplyinbound/complete',
url: '/base/v1/basevehicleactualsales/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/basevehicleactualsales/reject',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
data: params
})
},
// 代办任务终止任务
breakTask: function(params) {
// 流程审批(终止)
breakProcess: function(params) {
return request({
url: '/base/v1/basevehicleactualsales/breakProcess/' + params.businessSid,
url: '/base/v1/basevehicleactualsales/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/basevehicleactualsales/revokeProcess',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
data: params
})
},
// 审批流程(同意)获取下一环节
getNextNodesForSubmit: function(data) {
return request({
url: '/base/v1/basevehicleactualsales/getNextNodesForSubmit',
method: 'get',
params: data
})
},
// 审批流程(驳回)获取上一环节
getPreviousNodesForReject: function(data) {
return request({
url: '/base/v1/basevehicleactualsales/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'
})
}
}

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

@ -528,6 +528,34 @@ const codemenu = [
import('@/views/workFlow/tiaojiaguanliFlow/tiaojiaguanli/tiaojiaInfo.vue'),
name: 'tiaojiaInfo'
},
// 车辆内购编辑
{
path: '/cheliangneigouFlow/neigouguanli/neigouEdit',
component: () =>
import('@/views/workFlow/cheliangneigouFlow/neigouguanli/neigouEdit.vue'),
name: 'neigouEdit'
},
// 车辆内购详情
{
path: '/cheliangneigouFlow/neigouguanli/neigouInfo',
component: () =>
import('@/views/workFlow/cheliangneigouFlow/neigouguanli/neigouInfo.vue'),
name: 'neigouInfo'
},
// 未售买断编辑
{
path: '/weishoumaiduanFlow/weishoumaiduanguanli/weushoumaiduanEdit',
component: () =>
import('@/views/workFlow/weishoumaiduanFlow/weishoumaiduanguanli/weushoumaiduanEdit.vue'),
name: 'maiduanEdit'
},
// 未售买断详情
{
path: '/weishoumaiduanFlow/weishoumaiduanguanli/weishoumaiduanInfo',
component: () =>
import('@/views/workFlow/weishoumaiduanFlow/weishoumaiduanguanli/weishoumaiduanInfo.vue'),
name: 'maiduanInfo'
},
// 采购退库驳回到发起人办理编辑页面
{
path: '/caigoutuikuFlow/caigoutuikuEdit',

17
anrui-scm/anrui-scm-ui/src/views/weishoumaiduan/weishoumaiduanguanli/unsoldAdd.vue

@ -105,10 +105,12 @@ export default {
//
formobj: {
sid: '', // sid
applicationName: window.sessionStorage.getItem('name'),
applicationName: '',
createTime: '',
reason: '',
userSid: window.sessionStorage.getItem('userSid'),
userSid: '',
instanceId: '', // ID
taskId: '', // ID
detailsList: []
},
rules: {},
@ -144,6 +146,8 @@ export default {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.formobj.applicationName = window.sessionStorage.getItem('name')
this.formobj.userSid = window.sessionStorage.getItem('userSid')
this.viewTitle = '【新增】车辆未售买断申请'
},
showEdit(row) {
@ -158,6 +162,9 @@ export default {
this.formobj.sid = data.sid
this.formobj.reason = data.reason
this.formobj.createTime = data.createTime
this.formobj.instanceId = data.procInstId
this.formobj.userSid = data.userSid
this.formobj.taskId = data.taskId
this.formobj.detailsList = data.voList
}).catch((e) => {
this.formobj = row
@ -223,10 +230,12 @@ export default {
//
this.formobj = {
sid: '', // sid
applicationName: window.sessionStorage.getItem('name'),
applicationName: '',
createTime: '',
reason: '',
userSid: window.sessionStorage.getItem('userSid'),
instanceId: '', // ID
taskId: '', // ID
userSid: '',
detailsList: []
}
this.$refs['form_obj'].resetFields()

285
anrui-scm/anrui-scm-ui/src/views/workFlow/weishoumaiduanFlow/weishoumaiduanguanli/weishoumaiduanInfo.vue

@ -7,10 +7,10 @@
<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'" type="danger" @click="openRevoke"> </el-button>
<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>
<el-button type="info"> </el-button>
</div>
</div>
@ -73,14 +73,42 @@
</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/weishoumaiduan/unsold'
import flow from '../../../baseoutsourcingapplication/workflow/flow'
export default {
name: 'weishoumaiduanInfo',
name: 'maiduanInfo',
components: {
flow
},
data() {
return {
dialogStatus: '',
@ -88,43 +116,31 @@ export default {
index: 0,
tableKey: 0,
list1: [],
//
formobj: {},
rules: {},
operation: '', //
dialogList: {
comment: ''
},
transactState: '', //
//
agreeList: {
businessSid: '',
comment: '',
instanceId: '',
taskId: '',
userSid: ''
},
//
regectList: {
businessSid: '',
comment: '',
instanceId: '',
taskId: '',
userSid: ''
xmlData: '', // xml
taskList: [],
startTask: true,
current: {
taskDefKey: '',
taskName: '' //
},
//
stopList: {
businessSid: '',
comment: '',
instanceId: '',
taskId: '',
userSid: ''
},
//
revokeList: {
nextNode: {}, //
nodeDialogVisible: false,
//
formobj: {},
rules: {},
transactState: '', //
//
linkByParameter: {
businessSid: '',
comment: '',
instanceId: '',
taskId: '',
orgSidPath: '',
taskDefKey: '',
userSid: ''
}
}
@ -143,28 +159,30 @@ export default {
var tar = data.substr(data.indexOf('=') + 1)
const obj = JSON.parse(tar)
console.log('iframe页面获取的obj:', obj)
//
this.agreeList.businessSid = sid
this.agreeList.instanceId = obj.instanceId
this.agreeList.taskId = obj.taskId
this.agreeList.userSid = obj.userSid
//
this.regectList.businessSid = sid
this.regectList.instanceId = obj.instanceId
this.regectList.taskId = obj.taskId
this.regectList.userSid = obj.userSid
//
this.stopList.businessSid = sid
this.stopList.instanceId = obj.instanceId
this.stopList.taskId = obj.taskId
this.stopList.userSid = obj.userSid
//
this.revokeList.businessSid = sid
this.revokeList.instanceId = obj.instanceId
this.revokeList.taskId = obj.taskId
this.revokeList.userSid = obj.userSid
//
this.linkByParameter.businessSid = sid
this.linkByParameter.instanceId = obj.instanceId
this.linkByParameter.taskId = obj.taskId
this.linkByParameter.taskDefKey = obj.taskDefKey
this.linkByParameter.orgSidPath = obj.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(row) {
@ -174,49 +192,53 @@ export default {
}
})
},
/** 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() {
this.$confirm('是否确认执行同意操作', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.handleAgree()
}).catch(() => {
this.$message({
type: 'info',
message: '已取消同意'
})
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() {
this.$confirm('是否确认执行驳回操作', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.handleReject()
}).catch(() => {
this.$message({
type: 'info',
message: '已取消驳回'
})
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() {
this.$confirm('是否确认执行终止操作', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.handleStop()
}).catch(() => {
this.$message({
type: 'info',
message: '已取消终止'
})
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
})
},
/** 确认撤回任务 */
@ -234,18 +256,35 @@ export default {
})
})
},
reject() {
if (this.operation === '同意') {
this.handleAgree()
} else if (this.operation === '驳回') {
this.handleReject()
} else if (this.operation === '终止') {
this.handleStop()
}
},
/** 同意任务 */
handleAgree() {
this.agreeList.comment = this.dialogList.comment
req.businessAgree(this.agreeList).then((response) => {
if (response.code === '200') {
this.linkByParameter.comment = this.dialogList.comment
req.complete(this.linkByParameter).then((response) => {
if (response.success) {
this.$notify({
title: '提示',
message: '执行成功',
type: 'success',
duration: 2000
})
this.refreshIt()
this.nodeDialogVisible = false
//
window.parent.postMessage({
cmd: 'returnHeight',
params: {
//
code: 1
}
}, '*')
} else {
this.$notify({
title: '提示',
@ -256,17 +295,26 @@ export default {
}
})
},
/** 终止任务 */
handleStop() {
this.stopList.comment = this.dialogList.comment
req.breakTask(this.stopList).then((response) => {
if (response.code === '200') {
/** 驳回任务 */
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: '提示',
@ -277,17 +325,27 @@ export default {
}
})
},
/** 驳回任务 */
handleReject() {
this.regectList.comment = this.dialogList.comment
req.rejectTask(this.regectList).then((response) => {
if (response.code === '200') {
/** 终止任务 */
handleStop() {
this.linkByParameter.comment = this.dialogList.comment
console.log(this.stopList, 99999)
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: '提示',
@ -300,15 +358,24 @@ export default {
},
/** 撤回任务 */
handleRevoke() {
this.revokeList.comment = this.dialogList.comment
req.revokeTask(this.revokeList).then((response) => {
if (response.code === '200') {
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: '提示',
@ -318,10 +385,6 @@ export default {
})
}
})
},
// ===
handleReturn() {
this.$emit('doback')
}
}
}

287
anrui-scm/anrui-scm-ui/src/views/workFlow/weishoumaiduanFlow/weishoumaiduanguanli/weushoumaiduanEdit.vue

@ -0,0 +1,287 @@
<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="save()">保存
</el-button>
<el-button type="primary" size="small" @click="submitVehicleApply()">提交
</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.applicationName }}</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.reason" type="textarea" :autosize="{ minRows: 1, maxRows: 10}" resize="none" 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.detailsList" :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.detailsList[scope.$index])">删除
</el-button>
</template>
</el-table-column>
<el-table-column label="车架号" align="center" width="300">
<template slot-scope="scope">
<span>{{ scope.row.vinNo }}</span>
</template>
</el-table-column>
<el-table-column label="车型" align="left" header-align="center">
<template slot-scope="scope">
<span>{{ scope.row.modelName }}</span>
</template>
</el-table-column>
<el-table-column label="入库日期" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.inboundDate }}</span>
</template>
</el-table-column>
<el-table-column label="入库价" align="center" width="200">
<template slot-scope="scope">
<span>{{ scope.row.inboundPrice }}</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
<!--End 添加修改部分-->
<!--选择车型和常用配置-->
<!-- <vehicle v-show="viewState == 2" ref="divVehicle" @backData="backData" @doback="closePage"/>-->
</div>
</template>
<script>
import req from '@/api/weishoumaiduan/unsold'
// import vehicle from './vehicle.vue'
export default {
name: 'maiduanAdd',
components: {
// vehicle
},
data() {
return {
viewTitle: '',
viewState: 1,
index: 0,
tableKey: 0,
//
formobj: {
sid: '', // sid
applicationName: '',
createTime: '',
reason: '',
userSid: '',
instanceId: '', // ID
taskId: '', // ID
detailsList: []
},
rules: {},
submitdisabled: false
}
},
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
},
//
addCommodity() {
this.viewState = 2
this.$refs['divVehicle'].showData(this.formobj.detailsList)
},
//
dataDelete(index, row) {
this.formobj.detailsList.splice(index, 1)
},
showAdd() {
this.newDate()
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.formobj.applicationName = window.sessionStorage.getItem('name')
this.formobj.userSid = window.sessionStorage.getItem('userSid')
this.viewTitle = '【新增】车辆未售买断申请'
},
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.applicationName = data.applicationName
this.formobj.sid = data.sid
this.formobj.reason = data.reason
this.formobj.createTime = data.createTime
this.formobj.instanceId = data.procInstId
this.formobj.userSid = data.userSid
this.formobj.taskId = data.taskId
this.formobj.detailsList = data.voList
}).catch((e) => {
this.formobj = row
})
},
// --
backData(value) {
this.viewState = 1
if (value.length > 0) {
value.forEach((e) => {
this.formobj.detailsList.push({
inboundDate: e.priceDate,
inboundPrice: e.priced,
modelName: e.vehicleAlias,
vinNo: e.vinNo
})
})
}
},
save() {
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.submitdisabled = true
req.saveOrUpdate(this.formobj).then((resp) => {
this.submitdisabled = false
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
}
}).catch(() => {
this.submitdisabled = false
})
} else {
return false
}
})
},
submitVehicleApply() {
req.submitVehicleApply(this.formobj).then((res) => {
if (res.success) {
this.$message({
showClose: true,
type: 'success',
message: '提交成功'
})
this.handleReturn('true')
} else {
this.$message({
showClose: true,
type: 'error',
message: '提交失败'
})
}
})
},
// ===
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
//
this.formobj = {
sid: '', // sid
applicationName: '',
createTime: '',
reason: '',
instanceId: '', // ID
taskId: '', // ID
userSid: '',
detailsList: []
}
this.$refs['form_obj'].resetFields()
this.$refs['divVehicle'].getList()
this.$emit('doback')
},
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>
Loading…
Cancel
Save