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()
} }
}, },
getMethodsByYq(){
const methodMap = {
1: 'selectServicemerchantList',
2: 'selectYqMerchantList'
}
return methodMap[this.isYq]
},
async selectShippingEntityInfoAll() { async selectShippingEntityInfoAll() {
let result = await purchaseApi.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() {
......
<!-- 采购发货 --> <!-- 采购发货 -->
<template> <template>
<div class="layout"> <div class="layout">
<div class="purchase" :style="{height:isHeight?'calc(100vh - 68px)' : '100%'}"> <div class="allocate" :style="{height:isHeight?'calc(100vh - 68px)' : '100%'}">
<!-- 订单基本信息 --> <!-- 订单基本信息 -->
<div class="info-section"> <div class="info-section">
<div class="title"> <div class="title">
订单基本信息 订单基本信息
<div class="status"> <div class="status">
<span :style="{ color: getStepText('orderStatusOpts', purchaseOrderInfo.status, 'color') }">{{ getStepText('orderStatusOpts', purchaseOrderInfo.status, 'label') }}</span> <span :style="{ color: getStepText('orderStatusOpts', allocateOrderInfo.status, 'color') }">{{ getStepText('orderStatusOpts', allocateOrderInfo.status, 'label') }}</span>
| |
<span :style="{ color: getStepText('deliveryStatusOpts', purchaseOrderInfo.deliveryStatus, 'color') }"> <span :style="{ color: getStepText('deliveryStatusOpts', allocateOrderInfo.deliveryStatus, 'color') }">
{{ getStepText('deliveryStatusOpts', purchaseOrderInfo.deliveryStatus, 'label') }} {{ getStepText('deliveryStatusOpts', allocateOrderInfo.deliveryStatus, 'label') }}
</span> </span>
</div> </div>
</div> </div>
<div v-for="(item, index) in orderBasicInfoList" :key="index" class="info-item"> <div v-for="(item, index) in orderBasicInfoList" :key="index" class="info-item">
<span>{{ item.label }}</span> <span>{{ item.label }}</span>
<span class="value" v-if="item.formatter">{{ item.formatter(purchaseOrderInfo) }}</span> <span class="value" v-if="item.formatter">{{ item.formatter(allocateOrderInfo) }}</span>
<span class="value" v-else>{{ purchaseOrderInfo[item.value]||'--' }}</span> <span class="value" v-else>{{ allocateOrderInfo[item.value]||'--' }}</span>
</div> </div>
</div> </div>
<!-- 订单基本信息 --> <!-- 订单基本信息 -->
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<div class="title"> <div class="title">
商品信息<span class="title-tip">点击商品名称可查看商品全部信息</span> 商品信息<span class="title-tip">点击商品名称可查看商品全部信息</span>
</div> </div>
<StickyTable :columns="tableColumns" :data="purchaseOrderInfo.goodsList" :height="purchaseOrderInfo.goodsList.length > 5 ? '216px' : 'auto'"> <StickyTable :columns="tableColumns" :data="allocateOrderInfo.stockAllocateDetailList" :height="allocateOrderInfo.stockAllocateDetailList.length > 5 ? '216px' : 'auto'">
<template #upgradeGoodsName="{ row }"> <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> </template>
...@@ -36,36 +36,35 @@ ...@@ -36,36 +36,35 @@
<div class="title">其他信息</div> <div class="title">其他信息</div>
<div class="info-item"> <div class="info-item">
<span>备注</span> <span>备注</span>
<span>数量有限数量有限数量有限数量有限数量有限数量有限</span> <span>{{allocateOrderInfo.remark}}</span>
</div> </div>
</div> </div>
<!-- 审核流程进度 --> <!-- 审核流程进度 -->
<div class="info-section"> <div class="info-section">
<div class="title">审核流程进度</div> <div class="title">审核流程进度</div>
<review-status :infoData="purchaseOrderInfo"></review-status> <review-status :infoData="allocateOrderInfo"></review-status>
</div> </div>
<!-- 审核记录 --> <!-- 审核记录 -->
<div class="info-section"> <div class="info-section">
<div class="title">审核记录</div> <div class="title">审核记录</div>
<record :recordList="purchaseOrderInfo.auditDetailList"></record> <record :recordList="allocateOrderInfo.auditDetaiList"></record>
</div> </div>
</div> </div>
<div class="footer"> <div class="footer">
<div class="reject btn" @click="handleReject" v-if=" <div class="reject btn" @click="handleReject" v-if="
(purchaseOrderInfo.status === 1 && staffType == 2) || (allocateOrderInfo.billStatus === 1 && staffType == 2) ||
(purchaseOrderInfo.status === 2 && staffType == 5) || (allocateOrderInfo.billStatus === 2 && staffType == 3) ||
(purchaseOrderInfo.status === 8 && staffType == 3) || (allocateOrderInfo.deliveryStatus === 1 && staffType == 4 && allocateOrderInfo.billStatus == 5)
(purchaseOrderInfo.deliveryStatus === 1 && staffType == 4 && purchaseOrderInfo.status == 5)
"> ">
驳回 驳回
</div> </div>
<div class="approve btn" @click="handleApprove" <div class="approve btn" @click="handleApprove"
v-if="(purchaseOrderInfo.status === 1 && staffType == 2) v-if="(allocateOrderInfo.billStatus === 1 && staffType == 2)
|| (purchaseOrderInfo.status === 2 && staffType == 5) || (allocateOrderInfo.billStatus === 2 && staffType == 3)
|| (purchaseOrderInfo.status === 8 && staffType == 3)">通过</div> ">通过</div>
</div> </div>
<reject-comp :isVisible="rejectVisible" v-if="rejectVisible" :infoData="purchaseOrderInfo" @cancel="handleCancel" @success="handleSuccess"></reject-comp> <reject-comp :isVisible="rejectVisible" v-if="rejectVisible" :infoData="allocateOrderInfo" @cancel="handleCancel" @success="handleSuccess"></reject-comp>
<approve-comp :isVisible="approveVisible" v-if="approveVisible" :infoData="purchaseOrderInfo" @cancel="handleApproveCancel" @success="handleApproveSuccess"></approve-comp> <approve-comp :isVisible="approveVisible" v-if="approveVisible" :infoData="allocateOrderInfo" @cancel="handleApproveCancel" @success="handleApproveSuccess"></approve-comp>
<detail-comp :isVisible="detailVisible" v-if="detailVisible" :infoData="productInfo" @cancel="handleDetailCancel"></detail-comp> <detail-comp :isVisible="detailVisible" v-if="detailVisible" :infoData="productInfo" @cancel="handleDetailCancel"></detail-comp>
</div> </div>
</template> </template>
...@@ -79,7 +78,7 @@ import record from './record.vue' ...@@ -79,7 +78,7 @@ import record from './record.vue'
import rejectComp from './components/rejectComp.vue' import rejectComp from './components/rejectComp.vue'
import ApproveComp from './components/approveComp.vue' import ApproveComp from './components/approveComp.vue'
import detailComp from './components/detailComp.vue' import detailComp from './components/detailComp.vue'
import purchaseApi from '@/api/purchase' import allocateApi from '@/api/allocate'
import StickyTable from '@/components/StickyTable.vue' import StickyTable from '@/components/StickyTable.vue'
export default { export default {
components: { reviewStatus, record, rejectComp, ApproveComp, StickyTable, detailComp }, components: { reviewStatus, record, rejectComp, ApproveComp, StickyTable, detailComp },
...@@ -88,86 +87,52 @@ export default { ...@@ -88,86 +87,52 @@ export default {
return { return {
staffType: this.$route.query.staffType, // (2-运营审核 3-商务审核 4-采购发货审核) staffType: this.$route.query.staffType, // (2-运营审核 3-商务审核 4-采购发货审核)
orderCode: this.$route.query.orderCode, orderCode: this.$route.query.orderCode,
purchaseOrderInfo: {}, allocateOrderInfo: {},
productInfo: {}, productInfo: {},
approveVisible: false, approveVisible: false,
rejectVisible: false, rejectVisible: false,
detailVisible: false, detailVisible: false,
tableColumns: [ tableColumns: [
{ label: '商品名称', prop: 'upgradeGoodsName', width: '120px' }, { label: '商品名称', prop: 'goodsName', width: '120px' },
{ label: '商品编码', prop: 'type', width: '100px' }, { label: '商品编码', prop: 'productCode', width: '100px' },
{ label: '规格', prop: 'specificationData', width: '90px' }, { label: '规格', prop: 'specificationData', width: '90px' },
{ {
label: '调拨数量', label: '调拨数量',
prop: 'goodsNumber', prop: 'allocateNumber',
width: '100px', width: '100px'
// formatter: (row) => {
// const unit = row.conversionValue ? '卷' : '件'
// return (row.goodsNumber || 0) + unit
// }
}, },
{ {
label: '调入门店库存', label: '调入门店库存',
prop: 'inventoryTotal', prop: 'inStockQty',
width: '100px', width: '100px'
formatter: (row) => {
const total = (row.goodsNumber || 0) * (row.conversionValue || 1)
// 如果conversionValue为空,应该怎么算?题目说"库存数量 = goodsNumber * conversionValue 就是库存总量",但如果conversionValue为空,通常意味着是1或者就是goodsNumber。题目后半句说"如果conversionValue为空,单位就是件",暗示这种情况下库存总量可能就是goodsNumber。 这里假设 conversionValue 为空时按 1 计算,或者直接取 goodsNumber。
// 根据题目: "库存数量 = goodsNumber * conversionValue 就是库存总量。单位,如果conversionValue 为空,单位就是件,如果conversionValue 不为空,单位就是米。"
// 如果 conversionValue 为空/0/null,则总量 = goodsNumber (单位:件)
// 如果 conversionValue 有值,则总量 = goodsNumber * conversionValue (单位:米)
if (!row.conversionValue) {
return (row.goodsNumber || 0) + '件'
} else {
// 乘法可能存在精度问题,简单处理
return ((row.goodsNumber || 0) * row.conversionValue).toFixed(2) + '米'
}
}
}, },
{ {
label: '调出门店库存', prop: 'purchaseNumber', width: '100px', label: '调出门店库存', prop: 'outStockQty', width: '100px'
formatter: (row) => {
const unit = row.conversionValue ? '卷' : '件'
return (row.purchaseNumber || 0) + unit
}
}, },
{ {
label: '膜卷号', prop: 'upgradePurchasePrice', width: '90px' label: '膜卷号', prop: 'filmRollNo', width: '90px'
} }
], ],
orderBasicInfoList: [ orderBasicInfoList: [
{ label: '调拨编号', value: 'orderCode' }, { label: '调拨编号', value: 'allocateCode' },
{ label: '调入门店', value: 'merchantName' }, { label: '调入门店', value: 'callInMerchantName' },
{ label: '调出门店', value: 'sendOutMerchantName' }, { label: '调出门店', value: 'callOutMerchantName' },
{ {
label: '调拨数量', label: '调拨数量',
value: 'totalPrice', value: 'totalAllocateNumber',
formatter: cellValue => { formatter: cellValue => {
return cellValue.totalPrice||cellValue.totalPrice===0?cellValue.totalPrice:'--' return cellValue.totalAllocateNumber||cellValue.totalAllocateNumber===0?cellValue.totalAllocateNumber:'--'
} }
}, },
// { { label: '发起时间', value: 'submitTime' },
// label: '采购模式',
// value: 'purchasingPattern',
// formatter: cellValue => {
// const statusItem = this.getStatusItem(this.baseData, 'purchasingPatternOptions', cellValue, 'purchasingPattern')
// return statusItem ? statusItem.confValue : '--'
// }
// },
{ label: '发起时间', value: 'orderTime' },
{ {
label: '当前审核节点', label: '当前审核节点',
value: '商务审核', value: '商务审核',
formatter: cellValue => { formatter: cellValue => {
return cellValue.status == 1 ? '运营审核' : cellValue.status == 8 ? '商务审核' : cellValue.status == 2 ? '总监审核' : '--' return cellValue.billStatus == 1 ? '运营审核' : cellValue.status == 2 ? '商务审核' : '--'
} }
} }
], ],
receiverInfoList: [
{ label: '收货人', value: 'contactName' },
{ label: '收货人电话', value: 'contactPhone' },
{ label: '收货地址', value: 'contactAddress' }
],
deliveryStatusOpts: { deliveryStatusOpts: {
1: { 1: {
label: '未发货', label: '未发货',
...@@ -215,14 +180,6 @@ export default { ...@@ -215,14 +180,6 @@ export default {
7: { 7: {
label: '已驳回', label: '已驳回',
color: '#F24724' color: '#F24724'
},
8: {
label: '待审核',
color: '#FF9D0A'
},
9: {
label: '已驳回',
color: '#F24724'
} }
}, },
baseData: { baseData: {
...@@ -235,11 +192,11 @@ export default { ...@@ -235,11 +192,11 @@ export default {
// 第二步: http://192.168.2.111:9527/dj-scrm-wx-work-main-test/#/cannibalize?orderCode=CG202407158682&staffType=4&name=glsadmin 采购发货审核 // 第二步: http://192.168.2.111:9527/dj-scrm-wx-work-main-test/#/cannibalize?orderCode=CG202407158682&staffType=4&name=glsadmin 采购发货审核
created() { created() {
this.purchaseOrderDetailData() this.allocateOrderDetail()
}, },
computed: { computed: {
isHeight() { isHeight() {
const { status, deliveryStatus } = this.purchaseOrderInfo || {} const { status, deliveryStatus } = this.allocateOrderInfo || {}
const staffType = this.staffType const staffType = this.staffType
return ( return (
(status === 1 && staffType == 2) || (status === 1 && staffType == 2) ||
...@@ -259,11 +216,11 @@ export default { ...@@ -259,11 +216,11 @@ export default {
}, },
handleSuccess() { handleSuccess() {
this.handleCancel() this.handleCancel()
this.purchaseOrderDetailData() this.allocateOrderDetail()
}, },
handleApproveSuccess() { handleApproveSuccess() {
this.handleApproveCancel() this.handleApproveCancel()
this.purchaseOrderDetailData() this.allocateOrderDetail()
}, },
getStepText(opts, status, key) { getStepText(opts, status, key) {
const mapping = this[opts][status] const mapping = this[opts][status]
...@@ -280,11 +237,11 @@ export default { ...@@ -280,11 +237,11 @@ export default {
handleSelect() { handleSelect() {
this.sendOutVisible = true this.sendOutVisible = true
}, },
async purchaseOrderDetailData() { async allocateOrderDetail() {
let result = await purchaseApi.purchaseOrderDetail({ orderCode: this.orderCode }) let result = await allocateApi.allocateOrderDetail({ allocateCode: this.orderCode })
console.log(result,'result')
if (result.code == 0) { if (result.code == 0) {
result.data.goodsList=[... result.data.goodsList,... result.data.goodsList,... result.data.goodsList,... result.data.goodsList] this.allocateOrderInfo = result.data
this.purchaseOrderInfo = result.data
} }
}, },
handleDetailCancel() { handleDetailCancel() {
...@@ -340,7 +297,7 @@ export default { ...@@ -340,7 +297,7 @@ export default {
} }
} }
} }
.purchase { .allocate {
width: 100vw; width: 100vw;
padding: 12px 10px; padding: 12px 10px;
box-sizing: border-box; box-sizing: border-box;
......
...@@ -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:{
handler(val){
this.updateSatus(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!