Commit 403edcd5 by wangzhihui

```

feat(cannibalize): 新增调拨订单审核相关组件和功能

- 添加调拨订单审核相关的路由配置,包括列表页和详情页
- 新增ScrollView组件用于实现滚动加载功能
- 新增approveComp组件用于审批操作
- 新增detailComp组件用于展示商品详情
- 新增dialog组件作为通用弹窗基类
- 新增rejectComp组件用于驳回操作
- 新增sendOutComp组件用于发货主体选择
- 新增detail页面展示订单基本信息和库存明细
- 修复StickyTable组件在显示数值为0时的判断逻辑
- 新增salary.js API文件用于工资条推送详情接口

添加了完整的调拨订单审核流程,包含审批、驳回、详情查看等功能模块,
以及相应的UI组件和交互逻辑。

BREAKING CHANGE: StickyTable组件的formatter判断逻辑有所调整
```
1 parent c0a5c209
const url = '/rop-dj-staff/router'
export default {
/**每月工资条推送-详情 */
getSalaryDetail(data = {}) {
data.method = 'dj.staff.api.staff.month.salary.send.detail'
return window.$HTTP({
url,
data,
returnAll: true
})
},
}
\ No newline at end of file \ No newline at end of file
<template>
<div :class="['scroll-view', ScrollViewclass]" id="van-list" >
<van-list v-model="loading" :finished="finished" finished-text="到底啦!!" @load="onLoad" offset="100" :immediate-check="false">
<slot></slot>
</van-list>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ScrollView',
data() {
return {
loading: false,
finished: false
}
},
props: ['ScrollViewclass'],
mounted() {
},
methods: {
onLoad() {
this.$emit('ReachBottom')
}
}
}
</script>
<style scoped lang='scss'>
.scroll-view {
overflow-y: scroll;
box-sizing: border-box;
}
.van-list {
background-color: #ffffff;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<td v-for="(col, colIndex) in columns" :key="colIndex" :class="{ 'fixed-col': colIndex === 0 && fixedFirstColumn }" :style="getCellStyle(colIndex)"> <td v-for="(col, colIndex) in columns" :key="colIndex" :class="{ 'fixed-col': colIndex === 0 && fixedFirstColumn }" :style="getCellStyle(colIndex)">
<div class="cell-content"> <div class="cell-content">
<slot :name="col.prop" :row="row" :index="rowIndex"> <slot :name="col.prop" :row="row" :index="rowIndex">
{{ col.formatter ? col.formatter(row) : (row[col.prop] || '-') }} {{ col.formatter ? col.formatter(row) : ((row[col.prop] ||row[col.prop]===0) ? row[col.prop] : '-') }}
</slot> </slot>
</div> </div>
</td> </td>
......
/* /*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-11-18 14:23:31
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-01-30 17:55:22
* @FilePath: \wx-notification\src\components\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/*
* @Descripttion: * @Descripttion:
* @version: * @version:
* @Author: limin * @Author: limin
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 'wangzhihui' '1733904062@qq.com' * @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-11-18 14:23:31 * @Date: 2025-11-18 14:23:31
* @LastEditors: 'wangzhihui' '1733904062@qq.com' * @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-11-18 17:00:07 * @LastEditTime: 2026-01-30 15:58:21
* @FilePath: \wx-notification\src\router\routes.js * @FilePath: \wx-notification\src\router\routes.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%A * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%A
*/ */
...@@ -23,7 +23,29 @@ const pages = { ...@@ -23,7 +23,29 @@ const pages = {
} }
} }
] ],
cannibalize: [
{
name: 'index',
meta: {
keepAlive: true,
title: '调拨订单审核',
noAuth: true,
backgroundColor: '#f7f8fa',
showAction: true
}
},
{
name: 'detail',
meta: {
keepAlive: true,
title: '商品详情',
noAuth: true,
backgroundColor: '#f7f8fa',
showAction: true
}
}
],
} }
let routes = [ let routes = [
{ {
......
<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="label">
调出门店
<span class="require">*</span>
</div>
<van-cell is-link :value="approveForm.sendOutMerchantName" />
</div>
<div class="cell" @click="handleSelect" v-if="[2, 5].includes(staffType)">
<div class="label">
调出仓库
<span class="require">*</span>
</div>
<van-cell is-link :value="approveForm.sendOutMerchantName" />
</div>
<div class="line-feed">
<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>
<send-out-comp :isVisible="sendOutVisible" v-if="sendOutVisible" @cancel="handleSendCancel" @submit="handleSendSumit" :sendOutMerchantId="approveForm.sendOutMerchantId"></send-out-comp>
</h-dialog>
</template>
<script>
import { Toast } from 'vant'
import hDialog from './dialog'
import sendOutComp from './sendOutComp'
import purchaseApi from '@/api/purchase'
export default {
components: { hDialog, sendOutComp },
data() {
return {
isSubmit:false,
name: this.$route.query.name,
staffType: this.$route.query.staffType,
sendOutVisible: false,
title: '通过',
approveForm: {
remark: '',
sendOutMerchantId: '',
sendOutMerchantName: ''
}
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
infoData: {
type: Object,
default: () => ({})
}
},
watch: {
infoData: {
handler(val) {
this.initData(val)
},
immediate: true,
deep: true
}
},
methods: {
handleSendCancel() {
this.sendOutVisible = false
},
handleSendSumit(data) {
this.approveForm.sendOutMerchantName = data.shippingEntity
this.approveForm.sendOutMerchantId = data.shippingEntityId
this.handleSendCancel()
},
initData(val) {
this.approveForm.sendOutMerchantName = val.sendOutMerchantName? val.sendOutMerchantName:''
this.approveForm.sendOutMerchantId = val.sendOutMerchantId
},
handleSelect() {
console.log('handleSelect')
// this.$emit('handleSelect')
this.sendOutVisible = true
},
validateRequiredFields() {
let validators = {
sendOutMerchantId: () => {
Toast('请选择发货主体')
}
}
for (let key in validators) {
if (!this.approveForm[key]) {
validators[key]()
return false
}
}
return true
},
getMethodByStaffType() {
const methodMap = {
2: 'operatorAudit',
3: 'businessAudit',
5: 'directorAudit'
}
return methodMap[this.staffType]
},
async handleSubmit() {
const isValid = this.validateRequiredFields()
if (!isValid) return
const methodName = this.getMethodByStaffType()
if (!methodName) {
Toast('当前角色不支持此操作')
return
}
try {
this.isSubmit = true
this.$refs.myDialog.startLoading()
const params = {
orderCode: this.infoData.orderCode,
operatorName: this.name,
...this.approveForm
}
//运营审核有该字段,商户审核没有2-运营审核 3-商务审核
if (this.staffType == 3) {
delete params.sendOutMerchantName
delete params.sendOutMerchantId
}
const result = await purchaseApi[methodName](params)
if (result.code == 0) {
Toast.success('操作成功')
this.isSubmit = false
this.$refs.myDialog.stopLoading()
this.handleCancel()
this.$emit('success')
} else {
this.$refs.myDialog.stopLoading()
Toast.fail(result.message || '请求失败')
}
} catch (error) {
this.isSubmit = false
this.$refs.myDialog.stopLoading()
Toast.fail('系统异常,请稍后再试')
console.error(error)
}
},
handleCancel() {
this.$emit('cancel')
}
}
}
</script>
<style lang="scss" scoped>
.formObj {
margin: 0 12px;
font-size: 14px;
.cell {
display: flex;
align-items: center;
height: 52px;
border-bottom: 1px solid #eff0f2;
}
.label {
color: #333333;
font-size: 14px;
margin-right: 18px;
display: flex;
align-items: center;
white-space: nowrap;
line-height: 20px;
.require {
color: #f24724;
font-size: 14px;
margin-left: 4px;
line-height: 52px;
margin-top: 5px;
}
}
.line-feed {
.label {
line-height: 52px;
}
.textarea {
border-radius: 8px;
border: 1px solid #eff0f2;
// height: 220px;
}
}
.explain {
color: #999999;
font-size: 14px;
margin-top: 10px;
}
::v-deep .van-cell__value--alone {
text-align: right;
color: #333333;
font-size: 14px;
width: 300px;
}
}
</style>
<template>
<h-dialog ref="myDialog" :title="title" :isVisible="isVisible" :hideCancelBtn="hideBtn" :hideConfirmBtn="hideBtn" :showCloseBtn="hideBtn" @confirm="handleSubmit" @cancel="handleCancel">
<div class="formObj">
<div class="cell" v-for="(item, index) in editFormData" :key="index">
<div class="label">
{{ item.label }}
</div>
<div>{{ item.formatter ? item.formatter(infoData) : (infoData[item.prop] || '-') }}</div>
</div>
</div>
</h-dialog>
</template>
<script>
import hDialog from './dialog'
import { Toast } from 'vant'
import purchaseApi from '@/api/purchase'
export default {
components: { hDialog },
data() {
return {
name: this.$route.query.name,
title: '商品详情',
hideBtn: true,
editFormData: [
{
label: '商品名称',
prop: 'upgradeGoodsName'
},
{ label: '商品编码', prop: 'type', width: '100px' },
{ label: '规格', prop: 'specificationData', width: '90px' },
{
label: '采购数量',
prop: 'goodsNumber',
width: '100px',
formatter: (row) => {
const unit = row.conversionValue ? '卷' : '件'
return (row.goodsNumber || 0) + unit
}
},
{
label: '库存总量',
prop: 'inventoryTotal',
width: '100px',
formatter: (row) => {
const total = (row.goodsNumber || 0) * (row.conversionValue || 1)
if (!row.conversionValue) {
return (row.goodsNumber || 0) + '件'
} else {
// 乘法可能存在精度问题,简单处理
return ((row.goodsNumber || 0) * row.conversionValue).toFixed(2) + '米'
}
}
},
{
label: '已发货数量', prop: 'purchaseNumber', width: '100px',
formatter: (row) => {
const unit = row.conversionValue ? '卷' : '件'
return (row.purchaseNumber || 0) + unit
}
},
{
label: '单价', prop: 'upgradePurchasePrice', width: '90px',
formatter: (row) => {
return '¥' + row.upgradePurchasePrice
}
},
{
label: '总价', prop: 'goodsTotalPrice', width: '90px',
formatter: (row) => {
return '¥' + row.goodsTotalPrice
}
}
]
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
infoData: {
type: Object,
default: () => ({})
}
},
mounted() {
console.log('mounted', this.infoData)
},
methods: {
handleSubmit() {
},
handleCancel() {
this.$emit('cancel')
// this.isVisible = false
}
}
}
</script>
<style lang="scss" scoped>
.formObj {
margin: 0 12px;
font-size: 14px;
.cell {
display: flex;
align-items: center;
margin-top: 14px;
color: #222222;
// height: 52px;
// border-bottom: 1px solid #eff0f2;
}
.label {
width: 72px;
color: #999999;
font-size: 14px;
display: flex;
align-items: center;
white-space: nowrap;
line-height: 17px;
margin-right: 10px;
.require {
color: #f24724;
font-size: 14px;
margin-left: 4px;
line-height: 52px;
margin-top: 5px;
}
}
.line-feed {
.label {
line-height: 52px;
}
.textarea {
border-radius: 8px;
border: 1px solid #eff0f2;
// height: 220px;
}
}
.explain {
color: #999999;
font-size: 14px;
margin-top: 10px;
}
}
</style>
<template>
<van-popup round v-model="isShow" position="bottom" :style="{ height: '75%' }" class="popup" @close="onClose" :close-on-click-overlay="false">
<div class="title">{{ title }}</div>
<!-- <div v-if="loading"> -->
<div class="content">
<slot></slot>
</div>
<div class="btn-group">
<div v-if="!hideCancelBtn" class="btn cancel" @click="handleCancel">取消</div>
<div v-if="!hideConfirmBtn" class="btn confirm" @click="handleConfirm" :class="{ disabled: loading }">
{{ loading ? '提交中...' : '确定' }}
</div>
<div v-if="showCloseBtn" class="close-btn" @click="handleCancel">关闭</div>
</div>
<!-- </div> -->
<template v-if="loading">
<div class="mask">
<div class="loading-home">
<van-loading size="50" color="#1989fa" />
</div>
</div>
</template>
</van-popup>
</template>
<script>
export default {
data() {
return {
isShow: this.isVisible,
loading: false,
confirmPromise: null // 保存最近一次 confirm promise
};
},
props: {
title: {
type: String,
default: '驳回'
},
isVisible: {
type: Boolean,
default: true
},
hideCancelBtn: {
type: Boolean,
default: false
},
hideConfirmBtn: {
type: Boolean,
default: false
},
showCloseBtn: {
type: Boolean,
default: false
}
},
watch: {
isVisible(val) {
this.isShow = val;
}
},
methods: {
async handleConfirm() {
if (this.loading) return; // 避免重复点击
this.$emit('confirm');
},
handleCancel() {
this.$emit('cancel');
this.isShow = false;
},
onClose() {
this.$emit('update:visible', false);
},
/**
* 公开方法:允许外部手动停止 loading 状态
*/
stopLoading() {
this.loading = false;
},
/**
* 公开方法:允许外部手动开始 loading 状态
*/
startLoading() {
this.loading = true;
}
}
};
</script>
<style scoped lang="scss">
.popup {
.title {
height: 55px;
line-height: 55px;
box-shadow: inset 0 -0.5px 0 0 #e8e8ea;
color: #333333;
font-size: 16px;
text-align: center;
border-bottom: 1px solid #eff0f2;
}
.content {
height: calc(100% - 111px);
overflow-y: scroll;
}
.btn-group {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 16px;
.btn {
flex: 1;
border-radius: 6px;
height: 41px;
line-height: 41px;
font-size: 16px;
cursor: pointer;
&.disabled {
opacity: 0.6;
pointer-events: none;
}
}
.close-btn {
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 6px;
opacity: 1;
background: #f4f5f7;
text-align: center;
color: #333333;
font-size: 16px;
}
.cancel {
border: 1px solid #dee0e3;
background: #f4f5f7;
color: #292d33;
text-align: center;
}
.confirm {
background: #347bff;
color: #ffffff;
text-align: center;
margin-left: 11px;
}
}
.mask {
position: absolute;
height: 100%;
width: 100%;
background: #ffffff;
opacity: 0.6;
top: 0;
}
.loading-home {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
</style>
<template>
<h-dialog ref="myDialog" :title="title" :isVisible="isVisible" @confirm="handleSubmit" @cancel="handleCancel">
<div class="formObj">
<div class="cell">
<div class="label">
驳回节点
<span class="require">*</span>
</div>
<van-radio-group v-model="rejectForm.rejectNode" direction="horizontal">
<van-radio v-for="item in dynamicNodeList" :key="item.value" :name="item.value" icon-size="16px">
{{ item.label }}
</van-radio>
</van-radio-group>
</div>
<div class="line-feed">
<div class="label">
驳回原因
<span class="require">*</span>
</div>
<van-field class="textarea" v-model="rejectForm.rejectCause" rows="8" :autosize="{ maxHeight: 220 }" label="" type="textarea" maxlength="200" placeholder="请输入驳回原因" show-word-limit />
</div>
<div class="explain" v-if="staffType == 4">说明:驳回后,整个采购订单进行驳回,无法再重新进行发货操作。</div>
</div>
</h-dialog>
</template>
<script>
import hDialog from './dialog'
import { Toast } from 'vant'
import purchaseApi from '@/api/purchase'
export default {
components: { hDialog },
data() {
return {
name: this.$route.query.name,
staffType: this.$route.query.staffType, //(2-运营审核 3-商务审核 4-采购发货审核)
title: '驳回',
rejectForm: {
rejectNode: '',
rejectCause: ''
}
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
infoData: {
type: Object,
default: () => ({})
}
},
computed: {
/**
* 根据 staffType 动态生成驳回节点列表
*/
dynamicNodeList() {
const baseOptions = [
{ label: '调拨商户', value: '1' },
{ label: '运营审核', value: '2' },
{ 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) // 返回采购审核、运营审核
default:
return [] // 默认无选项
}
}
},
methods: {
validateRequiredFields() {
let validators = {
rejectNode: () => {
Toast('请选择驳回节点')
},
rejectCause: () => {
Toast('请输入驳回原因')
}
}
for (let key in validators) {
if (!this.rejectForm[key]) {
validators[key]()
return false
}
}
return true
},
getRejectMethodByStaffType() {
const methodMap = {
2: 'operatorReject',
3: 'businessReject',
4: 'shipmentReject',
5: 'directorReject'
}
return methodMap[this.staffType]
},
async handleSubmit() {
const isValid = this.validateRequiredFields()
if (!isValid) return
const methodName = this.getRejectMethodByStaffType()
if (!methodName) {
Toast('当前角色不支持此操作')
return
}
try {
this.$refs.myDialog.startLoading()
const params = {
orderCode: this.infoData.orderCode,
operatorName: this.name,
...this.rejectForm
}
const result = await purchaseApi[methodName](params)
if (result.code == 0) {
Toast.success('操作成功')
this.$refs.myDialog.stopLoading()
this.handleCancel()
this.$emit('success')
} else {
this.$refs.myDialog.stopLoading()
Toast.fail(result.message || '请求失败')
}
} catch (error) {
this.$refs.myDialog.stopLoading()
Toast.fail('系统异常,请稍后再试')
console.error(error)
}
// this.$refs.myDialog.stopLoading();
},
handleCancel() {
this.$emit('cancel')
// this.isVisible = false
}
}
}
</script>
<style lang="scss" scoped>
.formObj {
margin: 0 12px;
font-size: 14px;
.cell {
display: flex;
align-items: center;
height: 52px;
border-bottom: 1px solid #eff0f2;
}
.label {
color: #333333;
font-size: 14px;
margin-right: 18px;
display: flex;
align-items: center;
white-space: nowrap;
line-height: 20px;
.require {
color: #f24724;
font-size: 14px;
margin-left: 4px;
line-height: 52px;
margin-top: 5px;
}
}
.line-feed {
.label {
line-height: 52px;
}
.textarea {
border-radius: 8px;
border: 1px solid #eff0f2;
// height: 220px;
}
}
.explain {
color: #999999;
font-size: 14px;
margin-top: 10px;
}
}
</style>
<template>
<h-dialog ref="myDialog" :title="title" :isVisible="isVisible" @confirm="handleSubmit" @cancel="handleCancel">
<div class="formObj">
<div class="search-pop-input">
<van-field v-model="keyword" placeholder="搜索" left-icon="https://img02.glsx.com.cn/weapp/resource/saas/scrm/search-icon.png" @input="onSearch" />
</div>
<template v-if="shippingEntityList.length > 0">
<div class="lists-wrap">
<template v-for="(item, index) in shippingEntityList">
<div :class="['list', item.checked ? 'active' : '']" @click="handleCheck(index)" :key="index">
{{ item.shippingEntity }}
<img v-if="item.checked" src="@/assets/images/mark.png" alt="" class="icon-mark" />
</div>
</template>
</div>
</template>
<div v-else class="no-data">
<img src="@/assets/images/no-data.png" />
<span class="no-data-text">暂无数据</span>
</div>
</div>
</h-dialog>
</template>
<script>
import hDialog from './dialog'
import utils from '@/utils/util'
import purchaseApi from '@/api/purchase'
export default {
components: { hDialog },
data() {
return {
title: '发货主体选择',
keyword: '',
originalShippingEntityList: [],
shippingEntityList: [],
selectSendOutMerchantId: ''
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
sendOutMerchantId: {
type: String,
default: ''
}
},
created() {
this.selectSendOutMerchantId = this.sendOutMerchantId
console.log('created', this.sendOutMerchantId)
this.selectShippingEntityInfoAll()
},
methods: {
onSearch(val) {
const debouncedSearch = utils.debounce(
val => {
this.handleSearch(val)
},
200,
true
)
// 调用防抖函数
debouncedSearch(val)
},
handleSearch(val) {
// 如果搜索值为空,显示全部数据
if (!val || val.trim() === '') {
this.shippingEntityList = this.originalShippingEntityList || this.shippingEntityList
return
}
// 进行模糊搜索,匹配 shippingEntity 字段
const filteredList = this.shippingEntityList.filter(item => {
return item.shippingEntity.toLowerCase().includes(val.toLowerCase())
})
// 更新列表数据
this.shippingEntityList = filteredList
if (this.shippingEntityList.length) {
this.handleFindIdAttribute()
}
},
async selectShippingEntityInfoAll() {
let result = await purchaseApi.selectShippingEntityInfoAll()
console.log(result)
if (result.code == 0) {
result.data.forEach(item => {
item.checked = false
})
this.shippingEntityList = result.data
this.originalShippingEntityList = [...this.shippingEntityList]
this.handleFindIdAttribute()
}
},
handleFindIdAttribute() {
this.shippingEntityList.forEach(item => {
item.checked = false
})
this.shippingEntityList.forEach(item => {
console.log(item.shippingEntityId == this.selectSendOutMerchantId,item.shippingEntityId,this.selectSendOutMerchantId)
if (item.shippingEntityId == this.selectSendOutMerchantId) {
item.checked = true
}
})
},
handleCheck(index) {
this.shippingEntityList.forEach(item => {
item.checked = false
})
this.shippingEntityList[index].checked = true
this.selectSendOutMerchantId = this.shippingEntityList[index].shippingEntityId
console.log(this.selectSendOutMerchantId)
},
handleSubmit() {
let data = this.originalShippingEntityList.find(item => item.shippingEntityId == this.selectSendOutMerchantId) || {}
this.$emit('submit', data)
// this.$refs.myDialog.stopLoading();
},
handleCancel() {
this.$emit('cancel')
}
}
}
</script>
<style lang="scss" scoped>
.formObj {
margin: 0 16px;
font-size: 14px;
.lists-wrap {
box-sizing: border-box;
overflow: scroll;
height: calc(100% - 52px);
.list {
display: inline-block;
height: 46px;
line-height: 46px;
color: #292d33;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #eff0f2;
}
.active {
color: #347bff;
}
.icon-mark {
width: 16px;
height: 16px;
}
}
.search-pop-input {
margin: 8px 0;
position: relative;
z-index: 99;
width: 343px;
::v-deep(.van-cell) {
width: 100%;
background: #f2f3f5;
height: 36px;
border-radius: 253px;
}
::v-deep(.van-field__left-icon) {
position: absolute;
width: 16px;
height: 16px;
margin: 4px 6px 8px 12px;
z-index: 999;
.van-icon {
color: #999ea8;
}
}
::v-deep(.van-field__body) {
position: absolute;
width: 343px;
border-radius: 16px;
left: 0;
}
::v-deep(.van-field__control) {
padding-left: 33px;
font-size: 14px;
}
}
.no-data {
display: flex;
flex-direction: column;
align-items: center;
justify-items: center;
img {
width: 72px;
height: 72px;
}
.no-data-text {
color: #999ea8;
font-size: 12px;
margin-top: 16px;
}
}
}
</style>
<!-- 商品详情 -->
<template>
<div class="detail-container">
<div class="info-section">
<div class="title">订单基本信息</div>
<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(orderInfo) }}</span>
<span class="value" v-else>{{ orderInfo[item.value] || '--' }}</span>
</div>
</div>
<div class="title">库存明细</div>
<div class="search-pop-input">
<van-field v-model="keyword" placeholder="查询门店库存明细" left-icon="https://img02.glsx.com.cn/weapp/resource/saas/scrm/search-icon.png" @input="onSearch" />
</div>
<scroll-view class="content" @ReachBottom="onReachBottom" ref="scrollView">
<template v-if="flag">
<template v-if="list.length">
<div class="list">
<div class="item">
<div class="name">门店名称门店名称门店名称门店名称门店名称门店名称门店名称</div>
<div class="line">
<div class="label">当前库存</div>
<div class="value">1件</div>
</div>
<div class="line">
<div class="label">膜卷号</div>
<div class="value">XXXXXX</div>
</div>
</div>
</div>
</template>
</template>
</scroll-view>
</div>
</template>
<script>
import utils from '@/utils/util'
export default {
data() {
return {
page: {
pageNum: 1,
pageSize: 10
},
flag: false,
list: [{}],
orderInfo: {
allocateNumber: 10,
goodsName: '全铝一体电动踏板(黑耀款)(不带灯)超过换行',
productCode: 'JC-JP-0077',
specificationData: '折叠小桌板 -不带杯架不带无线充不带氛围/默认分配/如指定请备注/星云红',
filmRollNo: '',
callInMerchantNumber: 20,
callInMerchantNumber: 10
},
orderBasicInfoList: [
{ label: '商品名称', value: 'goodsName' },
{ label: '商品编码', value: 'productCode' },
{ label: '规格', value: 'specificationData' },
{
label: '调拨数量',
value: 'allocateNumber',
formatter: cellValue => {
// return (cellValue.allocateNumber || cellValue.allocateNumber === 0) ? parseFloat(cellValue.allocateNumber).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
return cellValue.allocateNumber || cellValue.allocateNumber === 0 ? cellValue.allocateNumber + '件' : '--'
}
},
{
label: '调入门店库存',
value: 'callInMerchantNumber',
formatter: cellValue => {
return cellValue.callInMerchantNumber || cellValue.callInMerchantNumber === 0 ? cellValue.callInMerchantNumber + '件' : '--'
}
},
{
label: '调出门店库存',
value: 'callOutMerchantNumber',
formatter: cellValue => {
return cellValue.callOutMerchantNumber || cellValue.callOutMerchantNumber === 0 ? cellValue.callOutMerchantNumber + '件' : '--'
}
},
{ label: '膜卷号', value: 'filmRollNo' }
]
}
},
methods: {
getList() {
let list = this.list
groupCustomer.getcustomerRecordList({ ...this.page }).then(({ code, data, message }) => {
this.hideLoading()
if (code == 0) {
this.recordList = [...list, ...data.list]
if (this.page.pageNum > 1) this.$refs.scrollView.loading = false
if (data.list == 0 && this.flag) {
this.$refs.scrollView.finished = true
}
} else {
Notify(message)
}
this.flag = true
})
},
onReachBottom() {
console.log('触底')
this.page.pageNum++
this.getList()
},
onSearch(val) {
const debouncedSearch = utils.debounce(
val => {
this.list = []
this.page.pageNum =1
this.getList(val)
},
200,
true
)
// 调用防抖函数
debouncedSearch(val)
},
handleSearch(val) {}
}
}
</script>
<style lang="scss" scoped>
.detail-container {
padding: 12px 10px;
.info-section {
padding: 16px 16px 6px;
border-radius: 8px;
font-size: 14px;
background: #ffffff;
box-sizing: border-box;
margin-bottom: 12px;
}
.title {
color: #333333;
font-size: 15px;
margin-bottom: 10px;
position: relative;
font-weight: 600;
}
.info-item {
margin-bottom: 10px;
display: flex;
}
.info-item :nth-child(1) {
display: inline-block;
width: 88px;
color: #999999;
margin-right: 12px;
}
.info-item :nth-child(2) {
color: #292d33;
width: 223px;
white-space: wrap;
display: inline-block;
}
.search-pop-input {
margin: 8px 0;
position: relative;
z-index: 99;
width: 343px;
::v-deep(.van-cell) {
width: 100%;
height: 40px;
border-radius: 253px;
}
::v-deep(.van-field__left-icon) {
position: absolute;
width: 16px;
height: 16px;
margin: 4px 6px 8px 12px;
z-index: 999;
.van-icon {
color: #999ea8;
}
}
::v-deep(.van-field__body) {
position: absolute;
width: 343px;
border-radius: 16px;
left: 0;
}
::v-deep(.van-field__control) {
padding-left: 33px;
font-size: 14px;
}
}
.list {
.item {
padding: 16px;
border-radius: 8px;
background: #ffffff;
box-shadow: 0 0 10px 0 #bababa40;
.name {
color: #333333;
font-size: 15px;
font-weight: 600;
}
.line {
display: flex;
align-items: center;
margin-top: 10px;
.label {
width: 88px;
color: #999999;
font-size: 14px;
margin-right: 12px;
}
.value {
color: #333333;
font-size: 14px;
}
}
}
}
}
</style>
<template>
<div class="record-layout">
<div class="timeline" v-if="recordList.length">
<div v-for="(item, index) in recordList" :key="index" class="timeline-item">
<!-- 内容 -->
<div class="step">
{{ getStepText(item.status, 'text') }}
<div class="status" :style="{ color: examineStatusClass[item.status] }">
{{ getStepText(item.status, 'status') }}
</div>
<span v-if="item.rejectedStatus">
<span style="display: inline-block; margin: 0 8px;">至</span>
<span>{{ getRejectText(item.rejectedStatus, 'rejectedStatus') }}</span>
</span>
</div>
<div class="details">
<div class="detail-row" v-if="item.rejectCause">
<span>驳回原因:</span>
<span class="word-break">{{ item.rejectCause }}</span>
</div>
<div class="detail-row">
<span>审核人:</span>
<span>{{ item.reviewedBy }}</span>
</div>
<div class="detail-row">
<span>审核时间:</span>
<span>{{ item.reviewedDate }}</span>
</div>
<div v-if="item.remark" class="detail-row">
<span>备注:</span>
<span class="remark word-break">{{ item.remark }}</span>
</div>
</div>
<!-- 圆点 -->
<div class="dot" v-if="index != 0"></div>
<img class="highlight" v-else src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/highlight.png" />
<!-- 线 -->
<div class="line" v-if="index < recordList.length - 1"></div>
</div>
</div>
<div v-else class="no-data">
<img src="@/assets/images/no-data.png" />
<span class="no-data-text">暂无数据</span>
</div>
</div>
</template>
<script>
import { parseTime } from '@/utils/tools.js'
export default {
name: 'record',
props: {
recordList: {
type: Array,
default: () => ([])
}
},
data() {
return {
statusForShow: {
2: { text: '运营审核', status: '通过' },
4: { text: '运营审核', status: '驳回' },
5: { text: '商务审核', status: '通过' },
6: { text: '商务审核', status: '驳回' },
7: { text: '采购驳回', status: '驳回' },
8: { text: '总监审核', status: '通过' },
9: { text: '总监审核', status: '驳回' }
},
examineStatusClass: {
2: '#35C376',
4: '#F24724',
5: '#35C376',
6: '#F24724',
7: '#F24724',
8: '#35C376',
9: '#F24724'
},
rejectedForShow: {
1: { rejectedStatus: '采购商户' },
2: { rejectedStatus: '运营审核' },
3: { rejectedStatus: '商务审核' }
}
}
},
methods: {
getStepText(status, key) {
const mapping = this.statusForShow[status]
return mapping ? mapping[key] : ''
},
getRejectText(status, key) {
const mapping = this.rejectedForShow[status]
return mapping ? mapping[key] : ''
},
formatReviewTime(timestamp) {
if (!timestamp) return '-'
return parseTime(timestamp, '{y}-{m}-{d} {h}:{i}:{s}')
},
// 可添加接口请求逻辑
fetchRecordData() {
// 示例:axios.get('/api/audit/record')
// .then(res => {
// this.recordList = res.data;
// });
}
},
mounted() {
// this.fetchRecordData();
}
}
</script>
<style scoped lang="scss">
.record-layout {
// padding: 0 20px 20px;
.no-data {
display: flex;
flex-direction: column;
align-items: center;
justify-items: center;
img {
width: 72px;
height: 72px;
}
.no-data-text {
color: #999ea8;
font-size: 12px;
}
}
}
.dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: #8eb2fb;
position: absolute;
left: 3px;
top: 9px;
z-index: 99;
}
.highlight {
width: 16px;
height: 16px;
position: absolute;
left: 0px;
top: 4px;
z-index: 99;
}
.line {
position: absolute;
top: 16px;
left: 7.5px;
width: 1.5px;
height: 94%;
background-color: #d6e4ff;
}
.timeline-item {
padding: 4px 0 12px 30px;
font-size: 14px;
position: relative;
}
.step {
font-weight: bold;
color: #333333;
margin-bottom: 8px;
}
.status {
margin-left: 6px;
display: inline-block;
}
.detail-row {
display: flex;
margin-bottom: 8px;
font-size: 14px;
color: #666;
}
.detail-row :nth-child(1) {
display: inline-block;
width: 84px;
color: #999999;
margin-right: 9px;
}
.detail-row :nth-child(2) {
color: #333333;
width: calc(100% - 84px);
}
.word-break {
word-break: break-all;
}
</style>
<template>
<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>
</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>
<div :class="['line', item.type == 2 ? 'line_color' : '']" v-if="index != statusList.length - 1"></div>
</div>
</div>
</template>
<script>
export default {
props: {
infoData: {
type: Object,
default: () => {}
},
status: {
type: Number,
default: 0
}
},
watch: {
infoData(val) {
this.updateSatus(val)
}
},
data() {
return {
staffType: this.$route.query.staffType,// (2-运营审核 3-商务审核 4-采购发货审核)
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 }
]
}
},
methods: {
updateSatus(val) {
this.statusList.forEach(item => {
item.active = false
item.type=1
})
if (val.status == 1) {
this.statusList[0].active = true
this.statusList[0].type = 1
if (this.staffType == 2) {
this.statusList[0].active = true
}
} else if (val.status == 2) {
this.statusList[0].type = 2
this.statusList[1].active = true
this.statusList[1].type = 1
// if (this.staffType == 3) {
// this.statusList[1].active = true
// }
} else if (val.status == 5) {
this.statusList.forEach(item => {
item.active = true
item.type = 2
})
this.statusList[2].active = true
this.statusList[2].type = 2
// if (this.staffType == 4) {
// this.statusList[2].active = true
// }
} else {
this.statusList.forEach(item => {
item.active = false
})
}
}
}
}
</script>
<style lang="scss" scoped>
.status-wrap {
display: flex;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
margin: 16px 0;
.status-item {
display: flex;
flex-wrap: nowrap;
font-size: 12px;
font-weight: 500;
color: #999ea8;
.info {
display: flex;
flex-direction: column;
align-items: center;
width: 80rpx;
.circle-box {
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.circle {
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
font-size: 12px;
font-weight: 500;
.circle_text {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
border-radius: 50%;
background: #dee0e3;
}
}
.status-img {
position: absolute;
top: 0;
left: 0;
z-index: 1;
width: 28px;
height: 28px;
}
}
.name {
margin-top: 10px;
font-weight: 500;
white-space: nowrap;
color: #7a8299;
margin-bottom: 2px;
}
}
.line {
margin: 12px 4px 0;
width: 50px;
height: 4px;
background: #dee0e3;
border-radius: 4px;
}
.line_color {
background: #347bff1a;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -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="purchaseOrderInfo.goodsList" :height="purchaseOrderInfo.goodsList.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>
...@@ -239,6 +239,9 @@ export default { ...@@ -239,6 +239,9 @@ export default {
} }
} }
}, },
// 第一步:http://192.168.2.111:9527/dj-scrm-wx-work-main-test/#/purchase?orderCode=CG26012916474916&staffType=2&name=glsadmin 运营审核
// 第二步:http://192.168.2.111:9527/dj-scrm-wx-work-main-test/#/purchase?orderCode=CG202407158682&staffType=3&name=glsadmin 商务审核
// 第二步: http://192.168.2.111:9527/dj-scrm-wx-work-main-test/#/purchase?orderCode=CG202407158682&staffType=4&name=glsadmin 采购发货审核
created() { created() {
this.purchaseOrderDetailData() this.purchaseOrderDetailData()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!