Commit 57f98c4a by Jaxon

feat(purchase): 添加经理审核节点并重构审核流程

1 parent 152d660b
......@@ -8,6 +8,43 @@
*/
const url = '/rop-dj-smartcarlife/router'
export default {
// /**采购发货-详情 */
// purchaseOrderDetail(data = {}) {
// data.method = 'dj.api.smarcarlife.purchaseOrder.h5.detail'
// return window.$HTTP({
// url,
// data,
// returnAll: true
// })
// },
managerAudit(data = {}) {
data.method = 'dj.api.smarcarlife.managerreview.managerAudit'
return window.$HTTP({
url,
data,
returnAll: true
})
},
managerReject(data = {}) {
data.method = 'dj.api.smarcarlife.managerreview.managerReject'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// purchaseOrderDetail(data = {}) {
// data.method = 'dj.api.smarcarlife.purchaseOrder.h5.detail'
// return window.$HTTP({
// url,
// data,
// returnAll: true
// })
// },
/**采购发货-详情 */
purchaseOrderDetail(data = {}) {
data.method = 'dj.api.smarcarlife.purchaseOrder.h5.detail'
......@@ -106,5 +143,5 @@ export default {
data,
returnAll: true
})
},
}
}
<template>
<h-dialog ref="myDialog" :title="title" :isVisible="isVisible" @confirm="handleSubmit" @cancel="handleCancel">
<div class="formObj">
<div class="cell" @click="handleSelect" v-if="['2', '5'].includes(staffType)">
<div class="cell" @click="handleSelect" v-if="['2', '5', '6'].includes(staffType)">
<div class="label">
发货主体
<span class="require">*</span>
......@@ -13,9 +12,10 @@
<div class="label">备注</div>
<van-field class="textarea" v-model="approveForm.remark" rows="8" :autosize="{ maxHeight: 220 }" label="" type="textarea" maxlength="200" placeholder="请输入备注" show-word-limit />
</div>
<div class="explain" v-if="staffType==2">说明:订单审核后自动流转至下一节点进行复审。</div>
<div class="explain" v-if="staffType==3">说明:订单审核后会自动流转至供应商进行确认并发货。</div>
<div class="explain" v-if="staffType==5">说明:订单审核后自动流转至商务进行复审。</div>
<div class="explain" v-if="staffType == 2">说明:订单审核后自动流转至下一节点进行复审。</div>
<div class="explain" v-if="staffType == 6">说明:订单审核后自动流转至下一节点进行复审。</div>
<div class="explain" v-if="staffType == 3">说明:订单审核后会自动流转至供应商进行确认并发货。</div>
<div class="explain" v-if="staffType == 5">说明:订单审核后自动流转至商务进行复审。</div>
</div>
<send-out-comp :isVisible="sendOutVisible" v-if="sendOutVisible" @cancel="handleSendCancel" @submit="handleSendSumit" :sendOutMerchantId="approveForm.sendOutMerchantId"></send-out-comp>
</h-dialog>
......@@ -30,7 +30,7 @@ export default {
components: { hDialog, sendOutComp },
data() {
return {
isSubmit:false,
isSubmit: false,
name: this.$route.query.name,
staffType: this.$route.query.staffType,
sendOutVisible: false,
......@@ -72,7 +72,7 @@ export default {
this.handleSendCancel()
},
initData(val) {
this.approveForm.sendOutMerchantName = val.sendOutMerchantName? val.sendOutMerchantName:''
this.approveForm.sendOutMerchantName = val.sendOutMerchantName ? val.sendOutMerchantName : ''
this.approveForm.sendOutMerchantId = val.sendOutMerchantId
},
handleSelect() {
......@@ -98,7 +98,8 @@ export default {
const methodMap = {
2: 'operatorAudit',
3: 'businessAudit',
5: 'directorAudit'
5: 'directorAudit',
6: 'managerAudit'
}
return methodMap[this.staffType]
},
......@@ -129,10 +130,10 @@ export default {
if (result.code == 0) {
Toast.success('操作成功')
this.isSubmit = false
this.$refs.myDialog.stopLoading()
this.handleCancel()
this.$emit('success')
this.isSubmit = false
this.$refs.myDialog.stopLoading()
this.handleCancel()
this.$emit('success')
} else {
this.$refs.myDialog.stopLoading()
Toast.fail(result.message || '请求失败')
......@@ -183,7 +184,7 @@ export default {
.textarea {
border-radius: 8px;
border: 1px solid #eff0f2;
// height: 220px;
// height: 220px;
}
}
.explain {
......
......@@ -60,18 +60,31 @@ export default {
const baseOptions = [
{ label: '采购商户', value: '1' },
{ label: '运营审核', value: '2' },
{ label: '经理审核', value: '6' },
{ label: '商务审核', value: '3' }
]
switch (this.staffType) {
case '2': // 运营审核
return [baseOptions[0]] // 只返回采购审核
case '3': // 商务审核
return baseOptions.slice(0, 2) // 返回采购审核、运营审核
case '4': // 采购发货审核
return baseOptions // 返回全部
case '5': // 总监审核
return baseOptions.slice(0, 2) // 返回采购审核、运营审核
// 运营审核
case '2':
// 只返回采购审核
return [baseOptions[0]]
// 商务审核
case '3':
// 返回采购审核、运营审核
return baseOptions.slice(0, 3)
// 采购发货审核
case '4':
// 返回全部
return baseOptions
// 总监审核
case '5':
// 返回采购审核、运营审核
return baseOptions.slice(0, 2)
// 经理审核
case '6':
// 返回采购审核、运营审核
return baseOptions.slice(0, 2)
default:
return [] // 默认无选项
}
......@@ -100,7 +113,8 @@ export default {
2: 'operatorReject',
3: 'businessReject',
4: 'shipmentReject',
5: 'directorReject'
5: 'directorReject',
6: 'managerReject'
}
return methodMap[this.staffType]
},
......@@ -125,9 +139,9 @@ export default {
if (result.code == 0) {
Toast.success('操作成功')
this.$refs.myDialog.stopLoading()
this.handleCancel()
this.$emit('success')
this.$refs.myDialog.stopLoading()
this.handleCancel()
this.$emit('success')
} else {
this.$refs.myDialog.stopLoading()
Toast.fail(result.message || '请求失败')
......
<!-- 采购发货 -->
<template>
<div class="layout">
<div class="purchase" :style="{height:isHeight?'calc(100vh - 68px)' : '100%'}">
<div class="purchase" :style="{ height: isHeight ? 'calc(100vh - 68px)' : '100%' }">
<!-- 订单基本信息 -->
<div class="info-section">
<div class="title">
......@@ -17,17 +17,22 @@
<div v-for="(item, index) in orderBasicInfoList" :key="index" class="info-item">
<span>{{ item.label }}</span>
<span class="value" v-if="item.formatter">{{ item.formatter(purchaseOrderInfo) }}</span>
<span class="value" v-else>{{ purchaseOrderInfo[item.value]||'--' }}</span>
<span class="value" v-else>{{ purchaseOrderInfo[item.value] || '--' }}</span>
</div>
</div>
<!-- 订单基本信息 -->
<div class="info-section">
<div class="title">
商品信息<span class="title-tip">点击商品名称可查看商品全部信息</span>
商品信息
<span class="title-tip">点击商品名称可查看商品全部信息</span>
</div>
<sticky-table :columns="tableColumns" :data="purchaseOrderInfo.goodsList" :height="purchaseOrderInfo&&purchaseOrderInfo.goodsList&&purchaseOrderInfo.goodsList.length > 5 ? '216px' : 'auto'">
<sticky-table
:columns="tableColumns"
:data="purchaseOrderInfo.goodsList"
:height="purchaseOrderInfo && purchaseOrderInfo.goodsList && purchaseOrderInfo.goodsList.length > 5 ? '216px' : 'auto'"
>
<template #upgradeGoodsName="{ row }">
<span style="color: #347bff; cursor: pointer;" @click="handleProductClick(row)">{{ row.upgradeGoodsName }}</span>
<span style="color: #347bff; cursor: pointer" @click="handleProductClick(row)">{{ row.upgradeGoodsName }}</span>
</template>
</sticky-table>
</div>
......@@ -51,18 +56,8 @@
</div>
</div>
<div class="footer">
<div class="reject btn" @click="handleReject" v-if="
(purchaseOrderInfo.status === 1 && staffType == 2) ||
(purchaseOrderInfo.status === 2 && staffType == 5) ||
(purchaseOrderInfo.status === 8 && staffType == 3) ||
(purchaseOrderInfo.deliveryStatus === 1 && staffType == 4 && purchaseOrderInfo.status == 5)
">
驳回
</div>
<div class="approve btn" @click="handleApprove"
v-if="(purchaseOrderInfo.status === 1 && staffType == 2)
|| (purchaseOrderInfo.status === 2 && staffType == 5)
|| (purchaseOrderInfo.status === 8 && staffType == 3)">通过</div>
<div class="reject btn" @click="handleReject" v-if="showRejectBtn">驳回</div>
<div class="approve btn" @click="handleApprove" v-if="showApproveBtn">通过</div>
</div>
<reject-comp :isVisible="rejectVisible" v-if="rejectVisible" :infoData="purchaseOrderInfo" @cancel="handleCancel" @success="handleSuccess"></reject-comp>
<approve-comp :isVisible="approveVisible" v-if="approveVisible" :infoData="purchaseOrderInfo" @cancel="handleApproveCancel" @success="handleApproveSuccess"></approve-comp>
......@@ -173,7 +168,13 @@ export default {
label: '当前审核节点',
value: '商务审核',
formatter: cellValue => {
return cellValue.status == 1 ? '运营审核' : cellValue.status == 8 ? '商务审核' : cellValue.status == 2 ? '总监审核' : '--'
const keys = {
1:'运营审核',
8:'商务审核',
10:'总监审核',
2:'经理审核'
}
return keys[cellValue.status] || '--'
}
}
],
......@@ -200,7 +201,11 @@ export default {
color: '#F24724'
}
},
// 订单状态 1.待审核,2运营已审核,3.已取消,4.运营已驳回,5.商务已审核,6.商务已驳回,7.发货已驳回
// 订单状态
// 1.待审核,2运营已审核,3.已取消,4.运营已驳回,5.商务已审核,6.商务已驳回,7.发货已驳回
// 4.20更新
// 1.待审核,2运营已审核,3.已取消,4.运营已驳回,5.商务已审核,6.商务已驳回,7.发货已驳回,8.总监已审核,9.总监已驳回,10.经理审核,11.经理已驳回
orderStatusOpts: {
1: {
label: '待审核',
......@@ -210,18 +215,30 @@ export default {
label: '待审核',
color: '#FF9D0A'
},
3: {
label: '已取消',
color: '#999999'
10: {
label: '待审核',
color: '#FF9D0A'
},
4: {
label: '已驳回',
color: '#F24724'
8: {
label: '待审核',
color: '#FF9D0A'
},
5: {
label: '已审核',
color: '#35C376'
},
4: {
label: '已驳回',
color: '#F24724'
},
3: {
label: '已取消',
color: '#999999'
},
6: {
label: '已驳回',
color: '#F24724'
......@@ -230,13 +247,13 @@ export default {
label: '已驳回',
color: '#F24724'
},
8: {
label: '待审核',
color: '#FF9D0A'
},
9: {
label: '已驳回',
color: '#F24724'
},
11: {
label: '已驳回',
color: '#F24724'
}
},
baseData: {
......@@ -257,11 +274,38 @@ export default {
const staffType = this.staffType
return (
(status === 1 && staffType == 2) ||
(status === 2 && staffType == 5) ||
(status === 2 && staffType == 6) ||
(status === 8 && staffType == 3) ||
(status === 10 && staffType == 5) ||
(deliveryStatus === 1 && staffType == 4 && status == 5)
)
}
},
showRejectBtn(){
const purchaseOrderInfo = this.purchaseOrderInfo;
const staffType = this.staffType
// 运营审核
return (purchaseOrderInfo.status === 1 && staffType == 2) ||
// 经理审核
(purchaseOrderInfo.status === 2 && staffType == 6) ||
// 商务审核
(purchaseOrderInfo.status === 8 && staffType == 3) ||
// 总监审核
(purchaseOrderInfo.status === 10 && staffType == 5) ||
// 采购发货
(purchaseOrderInfo.deliveryStatus === 1 && staffType == 4 && purchaseOrderInfo.status == 5)
},
showApproveBtn(){
const purchaseOrderInfo = this.purchaseOrderInfo;
const staffType = this.staffType
// 运营审核
return (purchaseOrderInfo.status === 1 && staffType == 2) ||
// 经理审核
(purchaseOrderInfo.status === 2 && staffType == 6) ||
// 商务审核
(purchaseOrderInfo.status === 8 && staffType == 3) ||
// 总监审核
(purchaseOrderInfo.status === 10 && staffType == 5)
},
},
mounted() { },
methods: {
......
......@@ -10,7 +10,7 @@
{{ getStepText(item.status, 'status') }}
</div>
<span v-if="item.rejectedStatus">
<span style="display: inline-block; margin: 0 8px;">至</span>
<span style="display: inline-block; margin: 0 8px">至</span>
<span>{{ getRejectText(item.rejectedStatus, 'rejectedStatus') }}</span>
</span>
</div>
......@@ -54,7 +54,7 @@ export default {
props: {
recordList: {
type: Array,
default: () => ([])
default: () => []
}
},
data() {
......@@ -66,7 +66,9 @@ export default {
6: { text: '商务审核', status: '驳回' },
7: { text: '采购驳回', status: '驳回' },
8: { text: '总监审核', status: '通过' },
9: { text: '总监审核', status: '驳回' }
9: { text: '总监审核', status: '驳回' },
10: { text: '经理审核', status: '通过' },
11: { text: '经理审核', status: '驳回' }
},
examineStatusClass: {
2: '#35C376',
......@@ -75,12 +77,15 @@ export default {
6: '#F24724',
7: '#F24724',
8: '#35C376',
9: '#F24724'
9: '#F24724',
10: '#35C376',
11: '#F24724'
},
rejectedForShow: {
1: { rejectedStatus: '采购商户' },
2: { rejectedStatus: '运营审核' },
3: { rejectedStatus: '商务审核' }
3: { rejectedStatus: '商务审核' },
6: { rejectedStatus: '经理审核' }
}
}
},
......
<template>
<div>
<div class="wrapper">
<div class="status-wrap">
<div class="status-item" v-for="(item, index) in statusList" :key="index">
<div :class="['info', item.active && item.type == 1 ? 'active' : '']">
<div class="circle-box">
<div class="circle">
<img v-if="item.active" class="status-img" :src="IMG_URL + 'equity/review_icon.png'" />
<img v-if="item.type == 2" class="status-img" :src="IMG_URL + 'equity/review_success_icon.png'" />
<!-- <img v-if="item.active && item.type == 3" class="status-img" :src="IMG_URL + 'equity/review_error_icon.png'" /> -->
<div v-if="!item.active && item.type < 2" class="circle_text">{{ index + 1 }}</div>
<div class="step-icon-wrapper">
<div :class="['info', item.active && item.type == 1 ? 'active' : '']">
<div class="circle-box">
<div class="circle">
<img v-if="item.active" class="status-img" :src="IMG_URL + 'equity/review_icon.png'" />
<img v-if="item.type == 2" class="status-img" :src="IMG_URL + 'equity/review_success_icon.png'" />
<div v-if="!item.active && item.type < 2" class="circle_text">{{ index + 1 }}</div>
</div>
</div>
</div>
<!-- <div class="name" :style="{ color: item.active || item.type > 1 ? '#292D33' : '#999EA8' }">{{ item.name }}</div> -->
<!-- <template>
<div v-if="(index == 1 || index == 2) && item.type > 1" class="status-text" :style="{ color: item.type == 2 ? '#292D33' : '#E75E58' }">{{ item.type == 2 ? '通过' : '不通过' }}</div>
<div style="height: var(--fontSize32)" v-else>{{ ' ' }}</div>
</template> -->
<div :class="['line', item.type == 2 ? 'line_color' : '']" v-if="index != statusList.length - 1"></div>
</div>
<div class="step-label">
<div :class="['name', `name${index}`]" :style="{ color: item.active || item.type > 1 ? '#292D33' : '#999EA8' }">{{ item.name }}</div>
</div>
<div :class="['line', item.type == 2 ? 'line_color' : '']" v-if="index != statusList.length - 1"></div>
</div>
</div>
<div class="status-txt-box">
<div v-for="(item, index) in statusList" :key="index">
<div :class="['name', `name${index}`]" :style="{ color: item.active || item.type > 1 ? '#292D33' : '#999EA8' }">{{ item.name }}</div>
</div>
</div>
</div>
......@@ -32,7 +26,7 @@ export default {
props: {
infoData: {
type: Object,
default: () => { }
default: () => {}
},
status: {
type: Number,
......@@ -46,10 +40,11 @@ export default {
},
data() {
return {
staffType: this.$route.query.staffType,// (2-运营审核 3-商务审核 4-采购发货审核,5-总监审核)
staffType: this.$route.query.staffType, // (2-运营审核 3-商务审核 4-采购发货审核,5-总监审核)
IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/',
statusList: [
{ name: '运营审核', active: false, type: 1 },
{ name: '经理审核', active: false, type: 1 },
{ name: '总监审核', active: false, type: 1 },
{ name: '商务审核', active: false, type: 1 },
{ name: '采购发货审核', active: false, type: 1 }
......@@ -62,6 +57,7 @@ export default {
item.active = false
item.type = 1
})
// 待运营审核
if (val.status == 1) {
this.statusList[0].active = true
......@@ -69,52 +65,66 @@ export default {
if (this.staffType == 2) {
this.statusList[0].active = true
}
} else if (val.status == 2) {
// 待总监审核
}
// 待经理审核
if (val.status == 2) {
this.statusList[0].type = 2
this.statusList[1].active = true
this.statusList[1].type = 1
} else if (val.status == 8) {
// 待商务审核
}
// 待总监审核
if (val.status == 10) {
this.statusList[0].type = 2
this.statusList[1].type = 2
this.statusList[2].active = true
this.statusList[2].type = 1
}
// 待商务审核
if (val.status == 8) {
this.statusList[0].type = 2
this.statusList[1].type = 2
this.statusList[2].type = 2
this.statusList[3].active = true
this.statusList[3].type = 1
// if (this.staffType == 3) {
// this.statusList[1].active = true
// }
} else if (val.status == 5) {
}
if (val.status == 5) {
this.statusList.forEach(item => {
item.active = true
item.type = 2
})
this.statusList[3].active = true
this.statusList[3].type = 2
// if (this.staffType == 4) {
// this.statusList[2].active = true
// }
} else {
this.statusList.forEach(item => {
item.active = false
})
}
}
}
}
</script>
<style lang="scss" scoped>
.wrapper {
overflow: hidden;
width: 100%;
}
.status-wrap {
display: flex;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
margin: 16px 0 0;
overflow: scroll;
.status-item {
display: flex;
flex-wrap: nowrap;
font-size: 12px;
font-weight: 500;
color: #999ea8;
flex-direction: column;
.step-icon-wrapper {
display: flex;
flex-wrap: nowrap;
font-size: 12px;
font-weight: 500;
color: #999ea8;
}
.step-label {
white-space: nowrap;
margin: 10px 0;
}
.info {
display: flex;
flex-direction: column;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!