Commit b82b57b1 authored by chuan.liu's avatar chuan.liu

月度计划调整审批联调 发货申请联调

parent e8013f8d
# oghash-template # oghash-template
## Project setup ## Project setup
``` ```
yarn install yarn install
``` ```
### Compiles and hot-reloads for development ### Compiles and hot-reloads for development
``` ```
yarn serve yarn serve
``` ```
### Compiles and minifies for production ### Compiles and minifies for production
``` ```
yarn build yarn build
``` ```
### Lints and fixes files ### Lints and fixes files
``` ```
yarn lint yarn lint
``` ```
### Customize configuration ### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/). See [Configuration Reference](https://cli.vuejs.org/config/).
## 流程审批节点
1.base(基地)
2.warZone(战区)
3.work(内勤)
import request from '@/utils/request'
import { BASE_API } from '@/api/baseUrl'
/**
* 月度计划编制
* 根据id查询月度计划申请
* @param {*} params
*/
export function apiMonthplanFindById({ id }) {
return request({
url: BASE_API() + '/monthplan/findById?id=' + id,
method: 'post'
})
}
import request from '@/utils/request'
import { BASE_API } from '@/api/baseUrl'
/**
* 月度计划编制
* 根据id查询月度计划申请
* @param {*} params
*/
export function apiMonthplanFindById({ id }) {
return request({
url: BASE_API() + '/monthplan/findById?id=' + id,
method: 'post'
})
}
/**
* 发货计划导出表单到excel
* @param {*} params
*/
export function apiExportMonthPlanOrder(data) {
return request({
url: BASE_API() + `/monthplan/exportMonthPlanOrder`,
method: 'get',
params: data
})
}
/**
* 月度计划编制
* 根据id查询月计划发货申请
* @param {*} params
*/
export function apiMonthplanAdjustFindById({ id }) {
return request({
url: BASE_API() + '/monthplanadjuseimport/findById?id=' + id,
method: 'post'
})
}
/**
* 发货计划调整导出表单到excel
* @param {*} params
*/
export function apiExportMonthPlanAdjuseOrder(data) {
return request({
url: BASE_API() + `/monthplanadjuse/exportMonthPlanAdjuseOrder`,
method: 'get',
params: data
})
}
/**
* 月度计划编制
* 创建要货申请-根据id查询要货申请
* @param {*} params
*/
export function apiWantgoodsFindById({ id }) {
return request({
url: BASE_API() + '/wantgoods/findById?id=' + id,
method: 'post'
})
}
...@@ -41,3 +41,25 @@ export function handleFormData(data) { ...@@ -41,3 +41,25 @@ export function handleFormData(data) {
return formData return formData
} }
/**
* 下载
*/
export function download(data, fileName, responseType = 'application/octet-stream') {
const blob = data instanceof Blob ? data : new Blob([data], { type: responseType })
if ('download' in document.createElement('a')) {
// 非IE下载
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
window.URL.revokeObjectURL(link.href)
document.body.removeChild(link)
} else {
// IE10+下载
navigator.msSaveBlob(blob, fileName)
}
}
...@@ -56,8 +56,12 @@ service.interceptors.response.use( ...@@ -56,8 +56,12 @@ service.interceptors.response.use(
* You can also judge the status by HTTP Status Code * You can also judge the status by HTTP Status Code
*/ */
async response => { async response => {
// console.log('22', response, typeof response.data)
// stream形式 // stream形式
if (response.data instanceof Blob) { if (
response.data instanceof Blob ||
response.headers['content-type'].indexOf('octet-stream') !== -1
) {
return { return {
data: response.data, data: response.data,
type: response.headers['content-type'], type: response.headers['content-type'],
...@@ -84,9 +88,9 @@ service.interceptors.response.use( ...@@ -84,9 +88,9 @@ service.interceptors.response.use(
router.replace('/login') router.replace('/login')
return return
} }
if (status === 2) { if (status === '2') {
Toast(message || msg) Toast(message || msg)
return return dataAxios
} }
return dataAxios return dataAxios
}, },
......
...@@ -20,7 +20,9 @@ export default { ...@@ -20,7 +20,9 @@ export default {
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 {
this.$router.push({ path: redirectedFrom.path, query: { ...this.urlObj }})
} }
} else { } else {
this.handleLogin() this.handleLogin()
...@@ -38,7 +40,9 @@ export default { ...@@ -38,7 +40,9 @@ export default {
const { redirectedFrom } = this.$route const { redirectedFrom } = this.$route
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 {
this.$router.push({ path: redirectedFrom.path, query: { ...this.urlObj }})
} }
}) })
}) })
......
...@@ -4,26 +4,16 @@ ...@@ -4,26 +4,16 @@
<div class="header-bg"><img class="header-bg-img" src="@/assets/images/nav_bg@3x.png" /></div> <div class="header-bg"><img class="header-bg-img" src="@/assets/images/nav_bg@3x.png" /></div>
<div class="main"> <div class="main">
<div class="list-wrapper"> <div class="list-wrapper">
<div class="block"> <div class="block" v-for="(item, index) in sourceData" :key="index">
<div class="top-block"> <div class="top-block">
<van-cell title="开票客户" value="步步高有限公司" /> <van-cell title="开票客户" :value="item.customer" />
<van-cell title="发货计划类型" value="新品五粮液6X6X6 500ML" /> <van-cell title="发货计划类型" :value="invoiceCondition.planType" />
<van-cell title="发票号" value="0090000578(计划内)" /> <van-cell title="发票号" :value="item.invoId" />
<van-cell title="开票日期" value="步步高商贸有限公司" /> <van-cell title="开票日期" :value="item.invoiceDate" />
<van-cell title="开票量" value="配额酒制票通知单(计划内)" /> <van-cell title="开票量" :value="item.useQuantity" />
<van-cell title="本次占用量" value="专卖店渠道" /> <van-cell title="本次占用量" :value="item.occupyQty" />
<van-cell title="剩余量" value="2022" /> <van-cell title="已使用量" :value="item.occupyQty" />
</div> <van-cell title="剩余量" value="??" />
</div>
<div class="block">
<div class="top-block">
<van-cell title="开票客户" value="步步高有限公司" />
<van-cell title="发货计划类型" value="新品五粮液6X6X6 500ML" />
<van-cell title="发票号" value="0090000578(计划内)" />
<van-cell title="开票日期" value="步步高商贸有限公司" />
<van-cell title="开票量" value="配额酒制票通知单(计划内)" />
<van-cell title="本次占用量" value="专卖店渠道" />
<van-cell title="剩余量" value="2022" />
</div> </div>
</div> </div>
</div> </div>
...@@ -32,12 +22,22 @@ ...@@ -32,12 +22,22 @@
</template> </template>
<script> <script>
export default { export default {
props: {
sourceData: {
type: Array,
default: () => []
},
invoiceCondition: {
type: Object,
default: () => {}
}
},
data() { data() {
return {} return {}
}, },
methods: { methods: {
onClickLeft() { onClickLeft() {
this.$router.go(-1) this.$emit('close')
} }
} }
} }
......
...@@ -10,18 +10,23 @@ ...@@ -10,18 +10,23 @@
<van-cell title="计划年度" :value="conditions.pyear" /> <van-cell title="计划年度" :value="conditions.pyear" />
<van-cell title="备注" :value="conditions.remark" /> <van-cell title="备注" :value="conditions.remark" />
</div> </div>
<van-button class="download-btn" :icon="downloadIcon" type="primary"> <van-button
class="download-btn"
@click="exportMonthPlanOrder"
:icon="downloadIcon"
type="primary"
>
发货计划下载 发货计划下载
</van-button> </van-button>
<van-collapse class="step-block" v-model="activeNames" :border="false"> <van-collapse class="step-block" v-model="activeNames" :border="false">
<van-collapse-item title="审批" name="1" :border="false"> <van-collapse-item title="审批" name="1" :border="false">
<van-steps <van-steps
direction="vertical" direction="vertical"
:active="1" :active="stepActive"
active-color="#FF1D32" active-color="#FF1D32"
inactive-color="#999" inactive-color="#999"
> >
<van-step v-for="(item, index) in tablePathData" :key="item.id"> <van-step v-for="(item, index) in tablePathData" :key="index">
<template #active-icon> <template #active-icon>
<span class="active-dot">{{ index + 1 }}</span> <span class="active-dot">{{ index + 1 }}</span>
</template> </template>
...@@ -34,7 +39,7 @@ ...@@ -34,7 +39,7 @@
<p class="step-title">{{ item.statusName }}</p> <p class="step-title">{{ item.statusName }}</p>
<p class="step-title2">{{ item.handler }}</p> <p class="step-title2">{{ item.handler }}</p>
</van-step> </van-step>
<van-step> <van-step class="last-step">
<template #active-icon> <template #active-icon>
<span class="active-dot"></span> <span class="active-dot"></span>
</template> </template>
...@@ -57,19 +62,22 @@ ...@@ -57,19 +62,22 @@
<p class="bottom-block"></p> <p class="bottom-block"></p>
<div class="bottom"> <div class="bottom">
<van-button plain @click="refuse" type="primary">驳回</van-button> <van-button plain @click="refuse" type="primary">驳回</van-button>
<van-button plain @click="submit" type="primary">通过</van-button> <van-button plain @click="submit('1')" type="primary">通过</van-button>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { apiMonthplanFindById } from '@/api/applyForGoods' import { apiMonthplanFindById, apiExportMonthPlanOrder } from '@/api/monthPlan.js'
import { queryApprovalHistoryByBizId, advance } from '@/api/flowHander' import { queryApprovalHistoryByBizId, advance } from '@/api/flowHander'
import { download } from '@/utils/index'
import { Toast } from 'vant' import { Toast } from 'vant'
import { mapGetters } from 'vuex'
export default { export default {
data() { data() {
return { return {
activeNames: ['1'], activeNames: ['1'],
stepActive: '1',
downloadIcon: require('@/assets/images/download@3x.png'), downloadIcon: require('@/assets/images/download@3x.png'),
conditions: { conditions: {
id: '', id: '',
...@@ -81,6 +89,9 @@ export default { ...@@ -81,6 +89,9 @@ export default {
tablePathData: [] tablePathData: []
} }
}, },
computed: {
...mapGetters['token']
},
created() { created() {
const { id, taskId } = this.$route.query const { id, taskId } = this.$route.query
if (id) { if (id) {
...@@ -105,18 +116,20 @@ export default { ...@@ -105,18 +116,20 @@ export default {
.then(res => { .then(res => {
if (res.data) { if (res.data) {
this.tablePathData = res.data.Rows this.tablePathData = res.data.Rows
this.stepActive = this.tablePathData.length
} }
}) })
.catch(() => {}) .catch(() => {})
}, },
async submit() { async submit(handleResult) {
this.conditions.handleResult = '1' this.conditions.handleResult = handleResult
const params = JSON.parse(JSON.stringify(this.conditions)) const params = JSON.parse(JSON.stringify(this.conditions))
params.currentHandleId = '' params.currentHandleId = ''
params.currentHandleGroupId = '' params.currentHandleGroupId = ''
params.taskId = this.$route.query.taskId params.taskId = this.$route.query.taskId
if (this.conditions.id) { if (this.conditions.id) {
const res = await advance(params) const res = await advance(params)
console.log('22asssssss', res)
if (res.status === 1) { if (res.status === 1) {
Toast('提交成功') Toast('提交成功')
} }
...@@ -124,7 +137,21 @@ export default { ...@@ -124,7 +137,21 @@ export default {
}, },
refuse() { refuse() {
this.conditions.handleResult = '2' this.conditions.handleResult = '2'
this.submit() this.submit('2')
},
// 导出
async exportMonthPlanOrder() {
const params = {
bizId: this.conditions.bizId,
type: this.$route.query.type
}
const res = await apiExportMonthPlanOrder(params)
try {
const { data, name, type } = res
download(data, name, type)
} catch (error) {
Toast('下载异常')
}
}, },
initCustome() {}, initCustome() {},
onClickLeft() {} onClickLeft() {}
...@@ -255,6 +282,16 @@ export default { ...@@ -255,6 +282,16 @@ export default {
border-radius: 50%; border-radius: 50%;
} }
} }
.last-step {
.van-step__circle-container {
.active-dot {
width: 10px;
height: 10px;
line-height: 10px;
background: #e5e5e5;
}
}
}
} }
} }
} }
......
...@@ -5,48 +5,40 @@ ...@@ -5,48 +5,40 @@
<div class="main"> <div class="main">
<div class="list-wrapper"> <div class="list-wrapper">
<div class="top-block"> <div class="top-block">
<van-cell title="申请时间" value="2022.06.22 17:05:28" /> <van-cell title="申请时间" :value="conditions.createdDate" />
<van-cell title="录入人" value="苏州新川商贸公司" /> <van-cell title="录入人" :value="conditions.createdByName" />
<van-cell title="备注" value="共15家客户,应市场变化调整发货计划" /> <van-cell title="计划年度" :value="conditions.pyear" />
</div> </div>
<van-button class="download-btn" :icon="downloadIcon" type="primary"> <van-button
class="download-btn"
@click="exportMonthPlanOrder"
:icon="downloadIcon"
type="primary"
>
变更发货计划下载 变更发货计划下载
</van-button> </van-button>
<van-collapse class="step-block" v-model="activeNames" :border="false"> <van-collapse class="step-block" v-model="activeNames" :border="false">
<van-collapse-item title="审批" name="1" :border="false"> <van-collapse-item title="审批" name="1" :border="false">
<van-steps <van-steps
direction="vertical" direction="vertical"
:active="1" :active="stepActive"
active-color="#FF1D32" active-color="#FF1D32"
inactive-color="#999" inactive-color="#999"
> >
<van-step> <van-step v-for="(item, index) in tablePathData" :key="index">
<template #active-icon>
<span class="active-dot">1</span>
</template>
<template #inactive-icon>
<span class="inactive-dot">1</span>
</template>
<template #finish-icon>
<span class="active-dot">1</span>
</template>
<p class="step-title">同意</p>
<p class="step-title2">战总 四川战区</p>
</van-step>
<van-step>
<template #active-icon> <template #active-icon>
<span class="active-dot">2</span> <span class="active-dot">{{ index + 1 }}</span>
</template> </template>
<template #inactive-icon> <template #inactive-icon>
<span class="inactive-dot">2</span> <span class="inactive-dot">{{ index + 1 }}</span>
</template> </template>
<template #finish-icon> <template #finish-icon>
<span class="active-dot">2</span> <span class="active-dot">{{ index + 1 }}</span>
</template> </template>
<p class="step-title">同意</p> <p class="step-title">{{ item.statusName }}</p>
<p class="step-title2">战总 四川战区</p> <p class="step-title2">{{ item.handler }}</p>
</van-step> </van-step>
<van-step> <van-step class="last-step">
<template #active-icon> <template #active-icon>
<span class="active-dot"></span> <span class="active-dot"></span>
</template> </template>
...@@ -62,26 +54,103 @@ ...@@ -62,26 +54,103 @@
</van-collapse> </van-collapse>
<div class="remark-block"> <div class="remark-block">
<span class="title">意见</span> <span class="title">意见</span>
<textarea class="text" type="textarea" rows="2" /> <textarea v-model="conditions.handleOpinion" class="text" type="textarea" rows="2" />
</div> </div>
</div> </div>
</div> </div>
<p class="bottom-block"></p> <p class="bottom-block"></p>
<div class="bottom"> <div class="bottom">
<van-button plain type="primary">驳回</van-button> <van-button plain @click="refuse" type="primary">驳回</van-button>
<van-button plain type="primary">通过</van-button> <van-button plain @click="submit('1')" type="primary">通过</van-button>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { apiMonthplanAdjustFindById, apiExportMonthPlanAdjuseOrder } from '@/api/monthPlan.js'
import { queryApprovalHistoryByBizId, advance } from '@/api/flowHander'
import { download } from '@/utils/index'
import { Toast } from 'vant'
import { mapGetters } from 'vuex'
export default { export default {
data() { data() {
return { return {
activeNames: ['1'], activeNames: ['1'],
downloadIcon: require('@/assets/images/download@3x.png') stepActive: '0',
downloadIcon: require('@/assets/images/download@3x.png'),
conditions: {
id: '',
bizId: '',
taskId: '',
handleOpinion: '',
handleResult: '1'
},
tablePathData: []
}
},
computed: {
...mapGetters['token']
},
created() {
const { id, taskId } = this.$route.query
if (id) {
this.conditions.id = id
this.conditions.bizId = id
this.conditions.taskId = taskId
this.initDetail()
this.flowPath()
} }
}, },
methods: { methods: {
initDetail() {
apiMonthplanAdjustFindById(this.conditions).then(res => {
console.log(res.data)
res.data.pyear += ''
this.conditions = { ...this.conditions, ...res.data }
})
},
flowPath() {
queryApprovalHistoryByBizId({ bizId: this.conditions.id })
.then(res => {
if (res.data) {
this.tablePathData = res.data.Rows
this.stepActive = this.tablePathData.length
}
})
.catch(() => {})
},
async submit(handleResult) {
this.conditions.handleResult = handleResult
const params = JSON.parse(JSON.stringify(this.conditions))
params.currentHandleId = ''
params.currentHandleGroupId = ''
params.taskId = this.$route.query.taskId
if (this.conditions.id) {
const res = await advance(params)
console.log('22asssssss', res)
if (res.status === 1) {
Toast('提交成功')
}
}
},
refuse() {
this.conditions.handleResult = '2'
this.submit('2')
},
// 导出
async exportMonthPlanOrder() {
const params = {
bizId: this.conditions.bizId,
type: this.$route.query.type
}
const res = await apiExportMonthPlanAdjuseOrder(params)
try {
const { data, name, type } = res
download(data, name, type)
} catch (error) {
Toast('下载异常')
}
},
onClickLeft() {} onClickLeft() {}
} }
} }
...@@ -210,6 +279,16 @@ export default { ...@@ -210,6 +279,16 @@ export default {
border-radius: 50%; border-radius: 50%;
} }
} }
.last-step {
.van-step__circle-container {
.active-dot {
width: 10px;
height: 10px;
line-height: 10px;
background: #e5e5e5;
}
}
}
} }
} }
} }
......
This diff is collapsed.
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