Commit 0eee90ee authored by xiangzj's avatar xiangzj

节点流程问题处理

parent 2f7c7988
......@@ -16,18 +16,18 @@ export default {
},
created() {
console.log('2222', this.$route, this.$store, this.$store.getters.token)
const { query } = this.$route
const { query, redirectedFrom } = this.$route
this.urlObj = query
// if (this.$store.getters.token) {
// if (!redirectedFrom) return this.$router.back()
// if (redirectedFrom.path.indexOf('delivery-plan-approve') !== -1) {
// this.$router.push({ name: 'MonthFlow', query: { ...this.urlObj }})
// } else {
// this.$router.push({ path: redirectedFrom.path, query: { ...this.urlObj }})
// }
// } else {
// }
if (this.$store.getters.token) {
if (!redirectedFrom) return this.$router.back()
if (redirectedFrom.path.indexOf('delivery-plan-approve') !== -1) {
this.$router.push({ name: 'MonthFlow', query: { ...this.urlObj }})
} else {
this.$router.push({ path: redirectedFrom.path, query: { ...this.urlObj }})
}
} else {
this.handleLogin()
}
},
methods: {
handleLogin() {
......
......@@ -9,8 +9,8 @@
<van-cell title="发运单号" :value="conditions.wantCode" />
<van-cell title="发货计划类型" :value="conditions.planTypeTextView" />
<van-cell title="制票类型" :value="conditions.noticeSheetTypeTextView" />
<van-cell title="开票客户" :value="conditions.customerName" />
<van-cell title="订单客户" :value="conditions.billCustomer" />
<van-cell title="开票客户" :value="conditions.billCustomer" />
<van-cell title="订单客户" :value="conditions.customerName" />
<van-cell title="渠道类型" :value="conditions.channelsTypeTextView" />
<van-cell title="年度" :value="conditions.quotasYear" />
</div>
......@@ -245,14 +245,8 @@
@click="submit('1')"
>确认</van-button
>
<van-button
v-else
plain :disabled="!flag"
type="primary" @click="submit('2')"
>退回</van-button
>
<van-button v-else plain :disabled="!flag" type="primary" @click="submit('2')">退回</van-button>
</div>
<van-popup v-model:show="showPicker" round position="bottom">
<van-picker :columns="columns" @cancel="showPicker = false" @confirm="onConfirm" />
</van-popup>
......@@ -273,7 +267,12 @@ type="primary" @click="submit('2')"
<script>
import Cookies from 'js-cookie'
import { apiWantgoodsFindById } from '@/api/monthPlan.js'
import { queryApprovalHistoryByBizId, advance, backToApplyActivity } from '@/api/flowHander'
import {
queryApprovalHistoryByBizId,
advance,
backToApplyActivity,
taskExecutionFindByBizId
} from '@/api/flowHander'
import { Toast } from 'vant'
import { mapGetters } from 'vuex'
import InvoiceOccupancyDetail from '../invoice-occupancy-detail/InvoiceOccupancyDetail'
......@@ -339,7 +338,6 @@ export default {
this.conditions.bizId = id
this.conditions.taskId = taskId
this.initDetail()
this.flowPath()
}
},
methods: {
......@@ -366,6 +364,7 @@ export default {
res.data.pyear += ''
this.conditions = { ...this.conditions, ...res.data }
this.status = res.data.status
this.flowPath()
for (const key in this.conditions) {
if (this.conditions.hasOwnProperty(key)) {
if (key === 'isShunt') {
......@@ -379,8 +378,19 @@ export default {
}
this.form.baseAuditQuantity = res.data.wantGoodsDetailList[0].baseAuditQuantity || 0
this.form.warAuditQuantity = res.data.wantGoodsDetailList[0].warAuditQuantity || 0
this.form.salecenterAuditQuantity =
res.data.wantGoodsDetailList[0].salecenterAuditQuantity || 0
this.form.salecenterAuditQuantity = res.data.wantGoodsDetailList[0].salecenterAuditQuantity || 0
if (this.conditions.subProcUnitId === 'warZone' && !this.form.baseAuditQuantity) {
this.form.baseAuditQuantity = res.data.wantGoodsDetailList[0].wantQuantity
}
if (this.conditions.subProcUnitId === 'work') {
if(!this.form.warAuditQuantity){
if(!this.form.baseAuditQuantity){
this.form.warAuditQuantity = this.form.baseAuditQuantity = res.data.wantGoodsDetailList[0].wantQuantity
}else{
this.form.warAuditQuantity = this.form.baseAuditQuantity
}
}
}
})
},
flowPath() {
......@@ -406,6 +416,18 @@ export default {
this.conditions = { ...this.conditions }
this.conditions.handleResult = handleResult
const params = JSON.parse(JSON.stringify(this.conditions))
// if (this.isShowWarZone && !this.form.baseAuditQuantity) {
// this.form.baseAuditQuantity = params.wantGoodsDetailList[0].wantQuantity
// }
// if (this.isShowWork) {
// if(!this.form.warAuditQuantity){
// if(!this.form.baseAuditQuantity){
// this.form.warAuditQuantity = this.form.baseAuditQuantity = params.wantGoodsDetailList[0].wantQuantity
// }else{
// this.form.warAuditQuantity = this.form.baseAuditQuantity
// }
// }
// }
params.wantGoodsDetailList[0].baseAuditQuantity = this.form.baseAuditQuantity
params.wantGoodsDetailList[0].warAuditQuantity = this.form.warAuditQuantity
params.wantGoodsDetailList[0].salecenterAuditQuantity = this.form.salecenterAuditQuantity
......@@ -426,13 +448,13 @@ export default {
window.open('', '_self', '')
window.close()
this.initDetail()
this.flowPath()
}
} catch (error) {
toast.clear()
}
return
}
if (this.isShowBase && this.taskNode.subProcUnitId === 'base') {
if (this.form.baseAuditQuantity - 0 <= 0 || !Number(this.form.baseAuditQuantity)) {
Toast('请正确填写基地审批量')
......@@ -471,8 +493,36 @@ export default {
message: '提交中...',
forbidClick: true
})
const currentData = {
currentHandleId: '',
currentHandleGroupId: ''
}
try {
// 处理流程
const { data } = await taskExecutionFindByBizId({
bizId: this.conditions.id,
procUnitId: 'Approve'
})
// return
if (!data.length) {
Toast('没有查到审批人!')
return
}
data.forEach(item => {
item.handlers.forEach(v => {
if (v.readonly === false) {
currentData.currentHandleId = v.id
currentData.currentHandleGroupId = v.groupId
}
})
})
} catch (error) {}
try {
const res = await advance(params)
const backParams = {
...params,
...currentData
}
const res = await advance(backParams)
toast.clear()
if (res.status === 1) {
Toast('提交成功')
......@@ -480,7 +530,6 @@ export default {
window.open('', '_self', '')
window.close()
this.initDetail()
this.flowPath()
}
} catch (error) {
toast.clear()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment