Commit 0eee90ee authored by xiangzj's avatar xiangzj

节点流程问题处理

parent 2f7c7988
...@@ -16,18 +16,18 @@ export default { ...@@ -16,18 +16,18 @@ export default {
}, },
created() { created() {
console.log('2222', this.$route, this.$store, this.$store.getters.token) console.log('2222', this.$route, this.$store, this.$store.getters.token)
const { query } = this.$route const { query, redirectedFrom } = this.$route
this.urlObj = query this.urlObj = query
// if (this.$store.getters.token) { if (this.$store.getters.token) {
// if (!redirectedFrom) return this.$router.back() if (!redirectedFrom) return this.$router.back()
// if (redirectedFrom.path.indexOf('delivery-plan-approve') !== -1) { if (redirectedFrom.path.indexOf('delivery-plan-approve') !== -1) {
// this.$router.push({ name: 'MonthFlow', query: { ...this.urlObj }}) this.$router.push({ name: 'MonthFlow', query: { ...this.urlObj }})
// } else { } else {
// this.$router.push({ path: redirectedFrom.path, query: { ...this.urlObj }}) this.$router.push({ path: redirectedFrom.path, query: { ...this.urlObj }})
// } }
// } else { } else {
// } this.handleLogin()
this.handleLogin() }
}, },
methods: { methods: {
handleLogin() { handleLogin() {
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
<van-cell title="发运单号" :value="conditions.wantCode" /> <van-cell title="发运单号" :value="conditions.wantCode" />
<van-cell title="发货计划类型" :value="conditions.planTypeTextView" /> <van-cell title="发货计划类型" :value="conditions.planTypeTextView" />
<van-cell title="制票类型" :value="conditions.noticeSheetTypeTextView" /> <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.channelsTypeTextView" />
<van-cell title="年度" :value="conditions.quotasYear" /> <van-cell title="年度" :value="conditions.quotasYear" />
</div> </div>
...@@ -245,14 +245,8 @@ ...@@ -245,14 +245,8 @@
@click="submit('1')" @click="submit('1')"
>确认</van-button >确认</van-button
> >
<van-button <van-button v-else plain :disabled="!flag" type="primary" @click="submit('2')">退回</van-button>
v-else
plain :disabled="!flag"
type="primary" @click="submit('2')"
>退回</van-button
>
</div> </div>
<van-popup v-model:show="showPicker" round position="bottom"> <van-popup v-model:show="showPicker" round position="bottom">
<van-picker :columns="columns" @cancel="showPicker = false" @confirm="onConfirm" /> <van-picker :columns="columns" @cancel="showPicker = false" @confirm="onConfirm" />
</van-popup> </van-popup>
...@@ -273,7 +267,12 @@ type="primary" @click="submit('2')" ...@@ -273,7 +267,12 @@ type="primary" @click="submit('2')"
<script> <script>
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import { apiWantgoodsFindById } from '@/api/monthPlan.js' 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 { Toast } from 'vant'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import InvoiceOccupancyDetail from '../invoice-occupancy-detail/InvoiceOccupancyDetail' import InvoiceOccupancyDetail from '../invoice-occupancy-detail/InvoiceOccupancyDetail'
...@@ -339,7 +338,6 @@ export default { ...@@ -339,7 +338,6 @@ export default {
this.conditions.bizId = id this.conditions.bizId = id
this.conditions.taskId = taskId this.conditions.taskId = taskId
this.initDetail() this.initDetail()
this.flowPath()
} }
}, },
methods: { methods: {
...@@ -366,6 +364,7 @@ export default { ...@@ -366,6 +364,7 @@ export default {
res.data.pyear += '' res.data.pyear += ''
this.conditions = { ...this.conditions, ...res.data } this.conditions = { ...this.conditions, ...res.data }
this.status = res.data.status this.status = res.data.status
this.flowPath()
for (const key in this.conditions) { for (const key in this.conditions) {
if (this.conditions.hasOwnProperty(key)) { if (this.conditions.hasOwnProperty(key)) {
if (key === 'isShunt') { if (key === 'isShunt') {
...@@ -379,8 +378,19 @@ export default { ...@@ -379,8 +378,19 @@ export default {
} }
this.form.baseAuditQuantity = res.data.wantGoodsDetailList[0].baseAuditQuantity || 0 this.form.baseAuditQuantity = res.data.wantGoodsDetailList[0].baseAuditQuantity || 0
this.form.warAuditQuantity = res.data.wantGoodsDetailList[0].warAuditQuantity || 0 this.form.warAuditQuantity = res.data.wantGoodsDetailList[0].warAuditQuantity || 0
this.form.salecenterAuditQuantity = this.form.salecenterAuditQuantity = res.data.wantGoodsDetailList[0].salecenterAuditQuantity || 0
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() { flowPath() {
...@@ -406,6 +416,18 @@ export default { ...@@ -406,6 +416,18 @@ export default {
this.conditions = { ...this.conditions } this.conditions = { ...this.conditions }
this.conditions.handleResult = handleResult this.conditions.handleResult = handleResult
const params = JSON.parse(JSON.stringify(this.conditions)) 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].baseAuditQuantity = this.form.baseAuditQuantity
params.wantGoodsDetailList[0].warAuditQuantity = this.form.warAuditQuantity params.wantGoodsDetailList[0].warAuditQuantity = this.form.warAuditQuantity
params.wantGoodsDetailList[0].salecenterAuditQuantity = this.form.salecenterAuditQuantity params.wantGoodsDetailList[0].salecenterAuditQuantity = this.form.salecenterAuditQuantity
...@@ -426,13 +448,13 @@ export default { ...@@ -426,13 +448,13 @@ export default {
window.open('', '_self', '') window.open('', '_self', '')
window.close() window.close()
this.initDetail() this.initDetail()
this.flowPath()
} }
} catch (error) { } catch (error) {
toast.clear() toast.clear()
} }
return return
} }
if (this.isShowBase && this.taskNode.subProcUnitId === 'base') { if (this.isShowBase && this.taskNode.subProcUnitId === 'base') {
if (this.form.baseAuditQuantity - 0 <= 0 || !Number(this.form.baseAuditQuantity)) { if (this.form.baseAuditQuantity - 0 <= 0 || !Number(this.form.baseAuditQuantity)) {
Toast('请正确填写基地审批量') Toast('请正确填写基地审批量')
...@@ -471,8 +493,36 @@ export default { ...@@ -471,8 +493,36 @@ export default {
message: '提交中...', message: '提交中...',
forbidClick: true forbidClick: true
}) })
const currentData = {
currentHandleId: '',
currentHandleGroupId: ''
}
try { try {
const res = await advance(params) // 处理流程
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 backParams = {
...params,
...currentData
}
const res = await advance(backParams)
toast.clear() toast.clear()
if (res.status === 1) { if (res.status === 1) {
Toast('提交成功') Toast('提交成功')
...@@ -480,7 +530,6 @@ export default { ...@@ -480,7 +530,6 @@ export default {
window.open('', '_self', '') window.open('', '_self', '')
window.close() window.close()
this.initDetail() this.initDetail()
this.flowPath()
} }
} catch (error) { } catch (error) {
toast.clear() 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