Commit 50e3fe4e by wangzhihui

调拨发货

1 parent 403edcd5
/*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-11-20 10:20:52
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-02-02 16:29:23
* @FilePath: \wx-notification\src\api\purchase.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const url = '/rop-dj-smartcarlife/router'
export default {
/**h5调拨-详情 */
allocateOrderDetail(data = {}) {
data.method = 'dj.smartcarlife.api.stock.allocate.h5.detail'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**采购发货-驳回 */
shipmentReject(data = {}) {
data.method = 'dj.api.smarcarlife.purchaseOrder.shipmentReject'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**运营审核 */
operatorAudit(data = {}) {
data.method = 'dj.smartcarlife.api.stockAllocate.operatorAudit'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**运营驳回 */
operatorReject(data = {}) {
data.method = 'dj.smartcarlife.api.stockAllocate.operatorReject'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**商务审核 */
businessAudit(data = {}) {
data.method = 'dj.smartcarlife.api.stockAllocate.businessAudit'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**商务驳回-驳回 */
businessReject(data = {}) {
data.method = ' dj.smartcarlife.api.stockAllocate.businessReject'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**发货主体 */
selectShippingEntityInfoAll(data = {}) {
data.method = 'dj.smartcarlife.api.yqPartnerMerchant.selectShippingEntityInfoAll'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// 调拨仓库列表
selectYqMerchantList(data = {}) {
data.method = 'dj.smartcarlife.api.stock.allocate.h5.yqMerchant.list'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// 出库门店列表
selectServicemerchantList(data = {}) {
data.method = 'dj.api.servicemerchantref.list'
return window.$HTTP({
url,
data,
returnAll: true
})
}
}
...@@ -2,20 +2,21 @@ ...@@ -2,20 +2,21 @@
<template> <template>
<h-dialog ref="myDialog" :title="title" :isVisible="isVisible" @confirm="handleSubmit" @cancel="handleCancel"> <h-dialog ref="myDialog" :title="title" :isVisible="isVisible" @confirm="handleSubmit" @cancel="handleCancel">
<div class="formObj"> <div class="formObj">
<div class="cell" @click="handleSelect" v-if="[2, 5].includes(staffType)"> <div class="cell" @click="handleSelect(2)" v-if="['3'].includes(staffType)">
<div class="label"> <div class="label">
调出门店 调出仓库
<span class="require">*</span> <span class="require">*</span>
</div> </div>
<van-cell is-link :value="approveForm.sendOutMerchantName" /> <van-cell is-link :value="approveForm.callOutYqMerchantName" />
</div> </div>
<div class="cell" @click="handleSelect" v-if="[2, 5].includes(staffType)"> <div class="cell" @click="handleSelect(1)" v-if="['3'].includes(staffType)">
<div class="label"> <div class="label">
调出仓库 调出门店
<span class="require">*</span> <span class="require">*</span>
</div> </div>
<van-cell is-link :value="approveForm.sendOutMerchantName" /> <van-cell is-link :value="approveForm.callOutMerchantName" />
</div> </div>
<div class="line-feed"> <div class="line-feed">
<div class="label">备注</div> <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 /> <van-field class="textarea" v-model="approveForm.remark" rows="8" :autosize="{ maxHeight: 220 }" label="" type="textarea" maxlength="200" placeholder="请输入备注" show-word-limit />
...@@ -24,7 +25,8 @@ ...@@ -24,7 +25,8 @@
<div class="explain" v-if="staffType==3">说明:订单审核后会自动流转至供应商进行确认并发货。</div> <div class="explain" v-if="staffType==3">说明:订单审核后会自动流转至供应商进行确认并发货。</div>
<div class="explain" v-if="staffType==5">说明:订单审核后自动流转至商务进行复审。</div> <div class="explain" v-if="staffType==5">说明:订单审核后自动流转至商务进行复审。</div>
</div> </div>
<send-out-comp :isVisible="sendOutVisible" v-if="sendOutVisible" @cancel="handleSendCancel" @submit="handleSendSumit" :sendOutMerchantId="approveForm.sendOutMerchantId"></send-out-comp> <!-- 先选仓库再选门店 -->
<send-out-comp :isVisible="sendOutVisible" :isYq="isYq" v-if="sendOutVisible" @cancel="handleSendCancel" @submit="handleSendSumit" :sendOutMerchantId="isYq == 1?approveForm.callOutMerchantId:approveForm.callOutYqMerchantId" :yqMerchantId="approveForm.callOutYqMerchantId"></send-out-comp>
</h-dialog> </h-dialog>
</template> </template>
...@@ -32,11 +34,12 @@ ...@@ -32,11 +34,12 @@
import { Toast } from 'vant' import { Toast } from 'vant'
import hDialog from './dialog' import hDialog from './dialog'
import sendOutComp from './sendOutComp' import sendOutComp from './sendOutComp'
import purchaseApi from '@/api/purchase' import allocateApi from '@/api/allocate'
export default { export default {
components: { hDialog, sendOutComp }, components: { hDialog, sendOutComp },
data() { data() {
return { return {
isYq:1, //1-门店 2-仓库
isSubmit:false, isSubmit:false,
name: this.$route.query.name, name: this.$route.query.name,
staffType: this.$route.query.staffType, staffType: this.$route.query.staffType,
...@@ -44,8 +47,10 @@ export default { ...@@ -44,8 +47,10 @@ export default {
title: '通过', title: '通过',
approveForm: { approveForm: {
remark: '', remark: '',
sendOutMerchantId: '', callOutYqMerchantId: '',
sendOutMerchantName: '' callOutYqMerchantName: '',
callOutMerchantId:'',
callOutMerchantName:'',
} }
} }
}, },
...@@ -74,23 +79,41 @@ export default { ...@@ -74,23 +79,41 @@ export default {
this.sendOutVisible = false this.sendOutVisible = false
}, },
handleSendSumit(data) { handleSendSumit(data) {
this.approveForm.sendOutMerchantName = data.shippingEntity console.log('handleSendSumit',data)
this.approveForm.sendOutMerchantId = data.shippingEntityId if(data.isYq==1){
this.approveForm.callOutMerchantName = data.merchantName
this.approveForm.callOutMerchantId = data.merchantId
}else{
this.approveForm.callOutYqMerchantName = data.merchantName
this.approveForm.callOutYqMerchantId = data.merchantNo
}
console.log(this.approveForm)
this.handleSendCancel() this.handleSendCancel()
}, },
initData(val) { initData(val) {
this.approveForm.sendOutMerchantName = val.sendOutMerchantName? val.sendOutMerchantName:'' this.approveForm.callOutYqMerchantName = val.callOutYqMerchantName? val.callOutYqMerchantName:''
this.approveForm.sendOutMerchantId = val.sendOutMerchantId this.approveForm.callOutYqMerchantId = val.callOutYqMerchantId
this.approveForm.callOutMerchantName = val.callOutMerchantName? val.callOutMerchantName:''
this.approveForm.callOutMerchantId = val.callOutMerchantId
}, },
handleSelect() { handleSelect(val) {
console.log('handleSelect') console.log('handleSelect')
// this.$emit('handleSelect') // this.$emit('handleSelect')
this.isYq = val
if(this.isYq ==2&&!this.approveForm.callOutYqMerchantId){
Toast('请先选择调出仓库')
return
}
this.sendOutVisible = true this.sendOutVisible = true
}, },
validateRequiredFields() { validateRequiredFields() {
let validators = { let validators = {
sendOutMerchantId: () => { callOutYqMerchantId: () => {
Toast('请选择发货主体') Toast('请选择调出门店')
},
callOutMerchantId: () => {
Toast('请选择调出仓库')
} }
} }
for (let key in validators) { for (let key in validators) {
...@@ -104,8 +127,7 @@ export default { ...@@ -104,8 +127,7 @@ export default {
getMethodByStaffType() { getMethodByStaffType() {
const methodMap = { const methodMap = {
2: 'operatorAudit', 2: 'operatorAudit',
3: 'businessAudit', 3: 'businessAudit'
5: 'directorAudit'
} }
return methodMap[this.staffType] return methodMap[this.staffType]
}, },
...@@ -122,17 +144,19 @@ export default { ...@@ -122,17 +144,19 @@ export default {
this.$refs.myDialog.startLoading() this.$refs.myDialog.startLoading()
const params = { const params = {
orderCode: this.infoData.orderCode, allocateCode: this.infoData.allocateCode,
operatorName: this.name, updatedBy: this.name,
...this.approveForm ...this.approveForm
} }
//运营审核有该字段,商户审核没有2-运营审核 3-商务审核 //运营审核没有该字段,商户审核有 2-运营审核 3-商务审核
if (this.staffType == 3) { if (this.staffType == 2) {
delete params.sendOutMerchantName delete params.callOutYqMerchantName
delete params.sendOutMerchantId delete params.callOutYqMerchantId
delete params.callOutMerchantName
delete params.callOutMerchantId
} }
const result = await purchaseApi[methodName](params) const result = await allocateApi[methodName](params)
if (result.code == 0) { if (result.code == 0) {
Toast.success('操作成功') Toast.success('操作成功')
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<script> <script>
import hDialog from './dialog' import hDialog from './dialog'
import { Toast } from 'vant' import { Toast } from 'vant'
import purchaseApi from '@/api/purchase' import allocateApi from '@/api/allocate'
export default { export default {
components: { hDialog }, components: { hDialog },
data() { data() {
...@@ -70,8 +70,6 @@ export default { ...@@ -70,8 +70,6 @@ export default {
return baseOptions.slice(0, 2) // 返回采购审核、运营审核 return baseOptions.slice(0, 2) // 返回采购审核、运营审核
case '4': // 采购发货审核 case '4': // 采购发货审核
return baseOptions // 返回全部 return baseOptions // 返回全部
case '5': // 总监审核
return baseOptions.slice(0, 2) // 返回采购审核、运营审核
default: default:
return [] // 默认无选项 return [] // 默认无选项
} }
...@@ -99,8 +97,7 @@ export default { ...@@ -99,8 +97,7 @@ export default {
const methodMap = { const methodMap = {
2: 'operatorReject', 2: 'operatorReject',
3: 'businessReject', 3: 'businessReject',
4: 'shipmentReject', 4: 'shipmentReject'
5: 'directorReject'
} }
return methodMap[this.staffType] return methodMap[this.staffType]
}, },
...@@ -121,7 +118,7 @@ export default { ...@@ -121,7 +118,7 @@ export default {
...this.rejectForm ...this.rejectForm
} }
const result = await purchaseApi[methodName](params) const result = await allocateApi[methodName](params)
if (result.code == 0) { if (result.code == 0) {
Toast.success('操作成功') Toast.success('操作成功')
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="lists-wrap"> <div class="lists-wrap">
<template v-for="(item, index) in shippingEntityList"> <template v-for="(item, index) in shippingEntityList">
<div :class="['list', item.checked ? 'active' : '']" @click="handleCheck(index)" :key="index"> <div :class="['list', item.checked ? 'active' : '']" @click="handleCheck(index)" :key="index">
{{ item.shippingEntity }} {{ item.merchantName }}
<img v-if="item.checked" src="@/assets/images/mark.png" alt="" class="icon-mark" /> <img v-if="item.checked" src="@/assets/images/mark.png" alt="" class="icon-mark" />
</div> </div>
</template> </template>
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
<script> <script>
import hDialog from './dialog' import hDialog from './dialog'
import utils from '@/utils/util' import utils from '@/utils/util'
import purchaseApi from '@/api/purchase' import allocateApi from '@/api/allocate'
export default { export default {
components: { hDialog }, components: { hDialog },
data() { data() {
return { return {
title: '发货主体选择', title: '调出门店仓库',
keyword: '', keyword: '',
originalShippingEntityList: [], originalShippingEntityList: [],
shippingEntityList: [], shippingEntityList: [],
...@@ -45,10 +45,19 @@ export default { ...@@ -45,10 +45,19 @@ export default {
sendOutMerchantId: { sendOutMerchantId: {
type: String, type: String,
default: '' default: ''
},
isYq:{
type: Number,
default: 1
},
yqMerchantId:{
type: String,
default: ''
} }
}, },
created() { created() {
this.selectSendOutMerchantId = this.sendOutMerchantId this.selectSendOutMerchantId = this.sendOutMerchantId
this.title = this.isYq == 2 ? '调出仓库选择' : '调出门店仓库'
console.log('created', this.sendOutMerchantId) console.log('created', this.sendOutMerchantId)
this.selectShippingEntityInfoAll() this.selectShippingEntityInfoAll()
}, },
...@@ -75,7 +84,7 @@ export default { ...@@ -75,7 +84,7 @@ export default {
// 进行模糊搜索,匹配 shippingEntity 字段 // 进行模糊搜索,匹配 shippingEntity 字段
const filteredList = this.shippingEntityList.filter(item => { const filteredList = this.shippingEntityList.filter(item => {
return item.shippingEntity.toLowerCase().includes(val.toLowerCase()) return item.merchantName.toLowerCase().includes(val.toLowerCase())
}) })
// 更新列表数据 // 更新列表数据
...@@ -85,8 +94,18 @@ export default { ...@@ -85,8 +94,18 @@ export default {
this.handleFindIdAttribute() this.handleFindIdAttribute()
} }
}, },
async selectShippingEntityInfoAll() { getMethodsByYq(){
let result = await purchaseApi.selectShippingEntityInfoAll() const methodMap = {
1: 'selectServicemerchantList',
2: 'selectYqMerchantList'
}
return methodMap[this.isYq]
},
async selectShippingEntityInfoAll() {
let methodName = this.getMethodsByYq()
let params = {}
if(this.isYq ==2) params.yqMerchantId = this.yqMerchantId
let result = await allocateApi[methodName](params)
console.log(result) console.log(result)
if (result.code == 0) { if (result.code == 0) {
result.data.forEach(item => { result.data.forEach(item => {
...@@ -98,27 +117,31 @@ export default { ...@@ -98,27 +117,31 @@ export default {
} }
}, },
handleFindIdAttribute() { handleFindIdAttribute() {
let key = this.isYq == 1 ? 'merchantId' : 'merchantNo'
this.shippingEntityList.forEach(item => { this.shippingEntityList.forEach(item => {
item.checked = false item.checked = false
}) })
this.shippingEntityList.forEach(item => { this.shippingEntityList.forEach(item => {
console.log(item.shippingEntityId == this.selectSendOutMerchantId,item.shippingEntityId,this.selectSendOutMerchantId)
if (item.shippingEntityId == this.selectSendOutMerchantId) { if (item[key] == this.selectSendOutMerchantId) {
item.checked = true item.checked = true
} }
}) })
}, },
handleCheck(index) { handleCheck(index) {
let key = this.isYq == 1 ? 'merchantId' : 'merchantNo'
this.shippingEntityList.forEach(item => { this.shippingEntityList.forEach(item => {
item.checked = false item.checked = false
}) })
this.shippingEntityList[index].checked = true this.shippingEntityList[index].checked = true
this.selectSendOutMerchantId = this.shippingEntityList[index].shippingEntityId
this.selectSendOutMerchantId = this.shippingEntityList[index][key]
console.log(this.selectSendOutMerchantId) console.log(this.selectSendOutMerchantId)
}, },
handleSubmit() { handleSubmit() {
let data = this.originalShippingEntityList.find(item => item.shippingEntityId == this.selectSendOutMerchantId) || {} let key = this.isYq == 1 ? 'merchantId' : 'merchantNo'
this.$emit('submit', data) let data = this.originalShippingEntityList.find(item => item[key] == this.selectSendOutMerchantId) || {}
this.$emit('submit', {...data,isYq:this.isYq})
// this.$refs.myDialog.stopLoading(); // this.$refs.myDialog.stopLoading();
}, },
handleCancel() { handleCancel() {
......
...@@ -64,9 +64,7 @@ export default { ...@@ -64,9 +64,7 @@ export default {
4: { text: '运营审核', status: '驳回' }, 4: { text: '运营审核', status: '驳回' },
5: { text: '商务审核', status: '通过' }, 5: { text: '商务审核', status: '通过' },
6: { text: '商务审核', status: '驳回' }, 6: { text: '商务审核', status: '驳回' },
7: { text: '采购驳回', status: '驳回' }, 7: { text: '采购驳回', status: '驳回' }
8: { text: '总监审核', status: '通过' },
9: { text: '总监审核', status: '驳回' }
}, },
examineStatusClass: { examineStatusClass: {
2: '#35C376', 2: '#35C376',
......
...@@ -33,8 +33,11 @@ export default { ...@@ -33,8 +33,11 @@ export default {
} }
}, },
watch: { watch: {
infoData(val) { infoData:{
this.updateSatus(val) handler(val){
this.updateSatus(val)
},
immediate: true
} }
}, },
data() { data() {
...@@ -50,33 +53,30 @@ export default { ...@@ -50,33 +53,30 @@ export default {
}, },
methods: { methods: {
updateSatus(val) { updateSatus(val) {
console.log('updateSatus', val)
this.statusList.forEach(item => { this.statusList.forEach(item => {
item.active = false item.active = false
item.type=1 item.type=1
}) })
if (val.status == 1) { if (val.billStatus == 1) {
this.statusList[0].active = true this.statusList[0].active = true
this.statusList[0].type = 1 this.statusList[0].type = 1
if (this.staffType == 2) { if (this.staffType == 2) {
this.statusList[0].active = true this.statusList[0].active = true
} }
} else if (val.status == 2) { } else if (val.billStatus == 2) {
this.statusList[0].type = 2 this.statusList[0].type = 2
this.statusList[1].active = true this.statusList[1].active = true
this.statusList[1].type = 1 this.statusList[1].type = 1
// if (this.staffType == 3) {
// this.statusList[1].active = true } else if (val.billStatus == 5) {
// }
} else if (val.status == 5) {
this.statusList.forEach(item => { this.statusList.forEach(item => {
item.active = true item.active = true
item.type = 2 item.type = 2
}) })
this.statusList[2].active = true this.statusList[2].active = true
this.statusList[2].type = 2 this.statusList[2].type = 2
// if (this.staffType == 4) {
// this.statusList[2].active = true
// }
} else { } else {
this.statusList.forEach(item => { this.statusList.forEach(item => {
item.active = false item.active = false
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!