Commit 729d2d4a by 前端

Merge branch 'SAAS+V5.8.4' into 'master'

上线合并

See merge request !29
2 parents 1734315f a4aca32a
...@@ -527,4 +527,8 @@ module.exports = { ...@@ -527,4 +527,8 @@ module.exports = {
'/rop-dj-business-school-miniprogram/router' '/rop-dj-business-school-miniprogram/router'
) )
}, },
// 获取潜客列表
getPotentialCustomersPage(data) {
return api.post('dj.api.staff.miniprogram.recruitment.demand.potentialCustomers.page', data)
},
} }
...@@ -100,7 +100,9 @@ ...@@ -100,7 +100,9 @@
"pages/performanceRating/batchOperation/batchOperation", "pages/performanceRating/batchOperation/batchOperation",
"pages/validReferralCount/referraCountEdit/referraCountEdit", "pages/validReferralCount/referraCountEdit/referraCountEdit",
"pages/attendanceStatis/attendanceDetail/attendanceDetail", "pages/attendanceStatis/attendanceDetail/attendanceDetail",
"pages/appealFormManage/appealFormDetail/appealFormDetail" "pages/appealFormManage/appealFormDetail/appealFormDetail",
"pages/cashFlowReview/pages/cashFlowList/cashFlowList",
"pages/cashFlowReview/pages/cashFlowDetail/cashFlowDetail"
] ]
}, },
{ {
......
import api from '~/utils/request/request.js'
module.exports = {
// 获取流水审批列表
getCashFlowReviewList(data) {
return api.post('dj.api.smartcarlife.abnormalFlowDeclaration.page', data)
},
// 获取流水审批详情
getCashFlowDetail(data) {
return api.post('dj.api.smartcarlife.abnormalFlowDeclaration.detail', data)
},
// 流水审批
auditCashFlow(data) {
return api.post('dj.api.smartcarlife.abnormalFlowDeclaration.regionManagerApprove', data)
},
// 获取运营经理关联的所有4s店数据
getMerchantListByRole(data) {
return api.post('dj.api.smartcarlife.abnormalFlowDeclaration.getAreaSupervisionShops', data)
}
}
\ No newline at end of file \ No newline at end of file
// packageWorkspace/pages/orderApprovalManage/components/approvalPopup/approvalPopup.js
Component({
/**
* 组件的属性列表
*/
properties: {
infoData: {
type: Object
},
show: {
type: Boolean,
observer: function(val) {
this.setData({remark: '', contentLength: 0})
}
}
},
/**
* 组件的初始数据
*/
data: {
contentLength: 0,
remark: ''
},
/**
* 组件的方法列表
*/
methods: {
textAreaInput(e) {
let val = e.detail.value || ""
if (val.length > 200) {
val = val.substring(0, 200)
}
this.setData({
remark: val,
contentLength: val.length
})
},
onConfirm() {
let { infoData, remark } = this.data
if (infoData.type == 2 && !remark) return wx.$util.showToast('请输入驳回备注')
this.triggerEvent('confirm', remark)
},
onCancel() {
this.triggerEvent('cancel')
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageWorkspace/pages/orderApprovalManage/components/approvalPopup/approvalPopup.wxss */
.container {
.label {
margin: 32rpx 0 16rpx;
font-size: 28rpx;
color: #222222;
.requiredLabel {
color: #F24724;
}
}
.textarea-wrap{
position: relative;
.textarea-input {
width: 100%;
height: 550rpx;
border-radius: 28rpx;
background: #f4f5f7;
padding: 24rpx;
box-sizing: border-box;
font-size: 28rpx;
}
.counter {
position: absolute;
right: 16rpx;
bottom: 8rpx;
font-size: 24rpx;
color: #BBBBBB;
}
}
.tips {
color: #999999;
font-size: 26rpx;
margin: 16rpx 0;
}
}
\ No newline at end of file \ No newline at end of file
<!--packageWorkspace/pages/orderApprovalManage/components/approvalPopup/approvalPopup.wxml-->
<popup show="{{show}}" title="{{infoData.title}}" height="68%" bind:confirm="onConfirm" bind:cancel="onCancel" customPopupSlotStyle="overflow:auto;">
<scroll-view class="container">
<view class="label">{{infoData.label}}<text class="requiredLabel" wx:if="{{infoData.type == 2}}">*</text></view>
<view class="textarea-wrap">
<textarea class="textarea-input" placeholder-style="color:#BEC1C7" placeholder="请输入" maxlength="200" value="{{remark}}" bindinput="textAreaInput" />
<view class="counter">{{contentLength}}/200</view>
</view>
<view wx:if="{{infoData.type == 3}}" class="tips">审批通过后将自动流转至线上运营审批</view>
<view wx:if="{{infoData.type == 2}}" class="tips">驳回后流转至驻店报备节点</view>
</scroll-view>
</popup>
\ No newline at end of file \ No newline at end of file
// 异常类型
const exceptionTypes = [
{
name: '已付款未录单',
value: '1'
},
{
name: '多流水对应一单',
value: '2'
},
{
name: '一流水对应多单',
value: '3'
},
{
name: '对公收款',
value: '4'
},
{
name: '混合支付',
value: '5'
},
{
name: '金额不一致',
value: '6'
},
{
name: '其他异常',
value: '7'
}
]
// 收款来源
const payTypeMap = [
{
name: '线上微信支付',
value: '1'
},
{
name: '线下收款',
value: '2'
},
{
name: 'POS机收款',
value: '3'
},
{
name: '支付宝支付',
value: '4'
},
{
name: '嘀加收款',
value: '5'
},
{
name: '对公转账',
value: '6'
},
{
name: '其他收款',
value: '7'
}
]
// 分账状态
const distributionStatusMap = [
{
name: '未分账',
value: '0'
},
{
name: '已分帐',
value: '1'
}
]
// 退款状态
const refundStatusMap = [
{
name: '未退款',
value: '0'
},
{
name: '已退款',
value: '1'
}
]
export default{
exceptionTypes,
payTypeMap,
distributionStatusMap,
refundStatusMap
}
\ No newline at end of file \ No newline at end of file
// packageWorkspace/pages/orderApprovalManage/orderApprovalDetail/orderApprovalDetail.js
import NP from 'number-precision'
import dayjs from "dayjs"
import constantData from '../../constant'
import cashflowApi from '~/packageWorkspace/pages/cashFlowReview/api'
Page({
/**
* 页面的初始数据
*/
data: {
// 订单信息
detailInfo: {
tradeInfo: {}, // 流水信息
declarationInfo: {}, // 报备信息
approvalLogs: [] // 审批日志
},
constantData,
approvalStatusMap: {
'1': {name: '待审批', color: '#FF9D0A', background: '#ff9d0a1a'},
'2': {name: '审批驳回', color: '#F24724', background: '#f247241a'},
'3': {name: '待线上运营审批', color: '#7A66FE', background: '#7a66fe14'},
'5': {name: '审批通过', color: '#35C376', background: '#35C3761a'}, //
'4': {name: '审批驳回', color: '#F24724', background: '#f247241a'}
},
orderForm:[{
label: '交易参考号',
key: 'tradeNo'
}, {
label: '原支付金额',
key: 'totalPrice',
unit: '¥',
customerClass: 'blue-text'
}, {
label: '结余金额',
key: 'notRefundedTotalPrice',
unit: '¥',
customerClass: 'blue-text'
}, {
label: '终端编码',
key: 'posTrmNo'
}, {
label: '支付时间',
key: 'payDateStr'
}, {
label: '所属园区店',
key: 'yqMerchantName'
}, {
label: '支付渠道',
key: 'payChannel'
}, {
label: '收款来源',
key: 'payTypeText'
}, {
label: '分账状态',
key: 'distributionStatusText'
}, {
label: '所属流量方',
key: 'merchantName'
}, {
label: '退款状态',
key: 'refundStatusText'
}],
registerForm: [{
label: '驻店姓名',
key: 'createdBy'
}, {
label: '提交报备时间',
key: 'createdDate'
}, {
label: '异常类型',
key: 'abnormalTypeText'
}, {
label: '凭证',
key: 'voucherImageUrls',
image: true,
flexStart: true
}, {
label: '报备备注',
key: 'remark',
flexStart: true
}],
statusForShow: {
3: { text: '区域运营审批', status: '通过' },
5: { text: '线上运营审批', status: '通过' },
2: { text: '区域运营审批', status: '驳回' },
4: { text: '线上运营审批', status: '驳回' }
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 可以从 options 中获取订单ID,然后加载详情
const { id } = options
this.setData({queryId: id})
if (id) {
this.loadOrderDetail(id)
}
},
processOrderData(rawOrder) {
if (!rawOrder) return rawOrder
const processed = { ...rawOrder }
// 处理普通商品订单(goodsOrderDTO)
if (processed.goodsOrderDTO) {
processed.goodsOrderDTO = this.addPackagePrice(processed.goodsOrderDTO)
}
// 处理原错误订单(oldGoodsOrderDTO)
if (processed.oldGoodsOrderDTO) {
processed.oldGoodsOrderDTO = this.addPackagePrice(processed.oldGoodsOrderDTO)
}
return processed
},
addPackagePrice(orderDTO) {
const dto = { ...orderDTO }
if (Array.isArray(dto.packageGoodsList)) {
dto.packageGoodsList = dto.packageGoodsList.map(pkg => {
let total = 0
if (Array.isArray(pkg.packageGoodsOrderList)) {
total = pkg.packageGoodsOrderList.reduce((sum, item) => {
// const itemTotal = NP.times(item.finalPrice || 0, item.number || 1)
return NP.plus(sum, item.finalPrice)
}, 0)
}
return {
...pkg,
packagePrice: total
}
})
}
return dto
},
previewImage(e) {
let { url, index } = e.currentTarget.dataset
let urlList = url.map(v => {
return v.payVoucher
})
wx.previewImage({
urls: urlList,
current: urlList[index]
})
},
/**
* 加载订单详情
*/
loadOrderDetail(id) {
let { orderForm } = this.data
wx.$util.showLoading()
cashflowApi.getCashFlowDetail({id}).then(res => {
wx.$util.hideLoading()
let { code, data, message } = res
if (code == 0) {
// 异常类型
data.declarationInfo.abnormalTypeText = constantData.exceptionTypes.find(v => v.value == data.declarationInfo?.abnormalType)?.name
// 收款来源
data.tradeInfo.payTypeText = constantData.payTypeMap?.find(v => v.value == data.tradeInfo.payType)?.name
// 分账状态
data.tradeInfo.distributionStatusText = constantData.distributionStatusMap?.find(v => v.value == data.tradeInfo.distributionStatus)?.name
// 退款状态
data.tradeInfo.refundStatusText = constantData.refundStatusMap?.find(v => v.value == data.tradeInfo.refundStatus)?.name
// 处理审批日志时间字段
data?.approvalLogs?.forEach(val => {
val.createdDateStr = val.createdDate ? dayjs(val.createdDate).format('YYYY-MM-DD HH:mm:ss') : '-'
})
if (data.tradeInfo.payDate) {
data.tradeInfo.payDateStr = dayjs(data.tradeInfo.payDate).format('YYYY-MM-DD HH:mm:ss')
}
this.setData({
detailInfo: data || {tradeInfo: {}, declarationInfo: {}, approvalLogs: []}
})
} else {
wx.$util.showToast(message)
}
})
},
/**
* 通过审批
*/
pass() {
this.setData({
showPopup: true,
popupInfo: {
type: '3',
title: '审批通过',
label: '通过备注'
}
})
},
/**
* 驳回
*/
reject() {
this.setData({
showPopup: true,
popupInfo: {
type: '2',
title: '审批驳回',
label: '驳回备注'
}
})
},
/**
* 提交审批结果
*/
handlePopupConfirm(e) {
if (this.data.submitFlag) return
this.setData({
submitFlag: true
})
wx.$util.showLoading()
const { popupInfo, queryId } = this.data
cashflowApi.auditCashFlow({approvalStatus: popupInfo?.type, id: queryId, remark: e.detail}).then(res => {
wx.$util.hideLoading()
this.setData({
submitFlag: false
})
let { code, data, message } = res
if (code == 0) {
this.loadOrderDetail(queryId)
const pages = getCurrentPages()
if (pages?.[pages.length - 2]) { // 从列表进入,审批后返回列表页
wx.navigateBack()
} else { // 企微消息直接进入页面 审批后关闭页面跳转到列表页
wx.reLaunch({url: '/packageWorkspace/pages/cashFlowReview/pages/cashFlowList/cashFlowList'})
}
} else {
wx.$util.showToast(message)
}
}).catch(() => {
wx.$util.hideLoading()
this.setData({
submitFlag: false
})
})
},
hidePopup() {
this.setData({showPopup: false})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"van-icon": "@vant/weapp/icon/index",
"approval-popup": "../../components/approvalPopup/approvalPopup"
},
"navigationBarTitleText": "审批详情"
}
\ No newline at end of file \ No newline at end of file
page {
background: #F2F3F7;
}
.isFullSucreen-btn {
padding-bottom: 34px !important;
}
.flex {
display: flex;
align-items: center;
}
.column {
flex-flow: column;
}
.flex-start {
align-items: flex-start;
}
.page-container {
padding: 24rpx;
.content-scroll {
.status-section {
.status-text {
font-size: 36rpx;
font-weight: 500;
color: #222222;
margin-left: 20rpx;
}
.status-tip {
font-size: 26rpx;
color: #999999;
margin-left: 52rpx;
}
}
.section {
border-radius: 32rpx;
background: #ffffff;
margin: 24rpx 0;
padding: 24rpx 32rpx;
.section-title {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 32rpx;
font-weight: 500;
color: #222222;
margin-bottom: 24rpx;
.status {
font-size: 24rpx;
font-weight: 400;
height: 48rpx;
line-height: 48rpx;
border-radius: 8rpx;
padding: 0 12rpx;
}
}
.info-item {
display: flex;
align-items: center;
font-size: 26rpx;
color: #222222;
margin-bottom: 12rpx;
&.flex-start {
align-items: flex-start;
}
&:last-child {
margin-bottom: 0;
}
.info-label {
width: 184rpx;
margin-right: 32rpx;
color: #999999;
flex-shrink: 0;
}
.blue-text {
color: #2C66F7;
}
.info-value {
word-break: break-all;
.text-hide {
max-width: 280rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
&.name {
max-width: 120rpx;
}
}
.split {
margin: 0 8rpx;
}
}
}
.image-value {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 16rpx;
.image-item {
width: 112rpx;
height: 112rpx;
border-radius: 16rpx;
overflow: hidden;
}
}
.timeline {
.timeline-item {
display: flex;
position: relative;
overflow: visible;
.timeline-left {
width: 40rpx;
display: flex;
flex-direction: column;
align-items: center;
margin-right: 10rpx;
position: relative;
flex-shrink: 0;
align-self: stretch;
.dot-wrapper {
width: 100%;
height: 44rpx;
display: flex;
align-items: center;
justify-content: center;
}
.dot {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
background: #E5E5E5;
z-index: 2;
box-sizing: border-box;
}
.step-active {
background: #FFFFFF;
border: 4rpx solid #D6E4FF;
width: 28rpx;
height: 28rpx;
position: relative;
}
.step-active::after {
content: '';
position: absolute;
width: 10rpx;
height: 10rpx;
background: #FFFFFF;
border-radius: 50%;
border: 4rpx solid #347BFF;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.step-done {
background: #8EB2FB;
}
.statusLine {
position: absolute;
top: 38rpx;
bottom: -10rpx;
left: 50%;
transform: translateX(-50%);
width: 2rpx;
background: #D8E5FE;
z-index: 1;
}
}
.timeline-content {
font-size: 28rpx;
color: #333333;
.status-text {
margin-bottom: 16rpx;
font-weight: 600;
.mar-r16{
margin-right: 16rpx;
}
.success {
color: #35C376;
}
.error {
color: #F24724;
}
}
.flex {
display: flex;
align-items: flex-start;
margin-bottom: 16rpx;
.label {
width: 168rpx;
flex-shrink: 0;
color: #999999;
margin-right: 16rpx;
}
.value {
word-break: break-all;
}
}
}
}
}
}
}
.empty-box {
width: 100%;
height: 180rpx;
}
.footerBtn {
position: fixed;
left: 0;
width: 100%;
bottom: 0;
min-height: var(--fontSize100);
background: #FFFFFF;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
font-size: var(--fontSize32);
font-weight: 500;
z-index: 99;
padding: 20rpx 32rpx;
.btn {
width: 320rpx;
height: 80rpx;
border-radius: 20rpx;
text-align: center;
line-height: 80rpx;
font-size: 32rpx;
}
.cancel {
height: 76rpx;
line-height: 76rpx;
border: 2rpx solid #2C66F7;
background: #f0f4ff;
color: #2C66F7;
}
.confirm {
color: #ffffff;
font-weight: 500;
height: 80rpx;
line-height: 80rpx;
background: #347BFF;
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packageWorkspace/pages/orderApprovalManage/orderApprovalDetail/orderApprovalDetail.wxml-->
<view class="page-container">
<!-- 页面内容 -->
<view class="content-scroll">
<view class="status-section" wx:if="{{detailInfo.declarationInfo.approvalStatus == 1}}">
<view class="status-badge">
<van-icon name="more-o" color="#FF9D0A"></van-icon>
<text class="status-text">待审批</text>
</view>
<text class="status-tip">请尽快处理</text>
</view>
<!-- 审批日志 -->
<view class="section" wx:if="{{detailInfo.declarationInfo.approvalStatus != 1 && detailInfo.approvalLogs.length}}">
<view class="section-title">
<view>审批日志</view>
<view class="status text-center" style="color:{{ approvalStatusMap[detailInfo.declarationInfo.approvalStatus].color }};background-color:{{approvalStatusMap[detailInfo.declarationInfo.approvalStatus].background }};">
{{approvalStatusMap[detailInfo.declarationInfo.approvalStatus].name }}
</view>
</view>
<view class="log-box" wx:for="{{detailInfo.approvalLogs}}" wx:key="index">
<view class="timeline">
<view class="timeline-item">
<view class="timeline-left">
<view class="dot-wrapper">
<view class="dot {{ index == 0 ? 'step-active' : 'step-done' }}"></view>
</view>
<view wx:if="{{detailInfo.approvalLogs.length > 1 && index != (detailInfo.approvalLogs.length - 1)}}" class="statusLine step-done"></view>
</view>
<view class="timeline-content">
<view class="status-text">
<text class='mar-r16'>{{statusForShow[item.approvalStatus].text}}</text>
<text class="status mar-r16 {{ item.approvalStatus == 3 || item.approvalStatus == 5 ? 'success' : 'error' }}">{{statusForShow[item.approvalStatus].status}}</text>
<block wx:if="{{item.approvalStatus == 2 || item.approvalStatus == 4}}">
<text class="mar-r16">至</text>
<text>驻店销售</text>
</block>
</view>
<view class="flex" wx:if="{{item.remark}}">
<view class="label">{{item.approvalStatus == 3 || item.approvalStatus == 5 ? '备注' : '驳回备注'}}</view>
<view class="value">{{item.remark}}</view>
</view>
<view class="flex">
<view class="label">审批人</view>
<view class="value">{{item.operatorName}}</view>
</view>
<view class="flex">
<view class="label">审批时间</view>
<view class="value">{{item.createdDateStr}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 流水信息 -->
<view class="section">
<view class="section-title">流水信息</view>
<view class="info-item flex-start" wx:for="{{orderForm}}" wx:key="index">
<text class="info-label">{{item.label}}</text>
<block>
<text class="info-value {{item.customerClass}}"><text style="margin-right: 8rpx;" wx:if="{{item.unit}}">{{item.unit}}</text>{{ detailInfo.tradeInfo[item.key] || '-' }}</text>
</block>
</view>
</view>
<!-- 驻店报备信息 -->
<view class="section">
<view class="section-title">驻店报备信息</view>
<view class="info-item flex-start" wx:for="{{registerForm}}" wx:key="index">
<text class="info-label">{{item.label}}</text>
<block wx:if="{{item.image}}">
<view class="image-value" wx:if="{{detailInfo.declarationInfo[item.key].length}}">
<view class="image-item" bindtap="previewImage" data-index="{{ subIndex }}" data-url="{{ detailInfo.declarationInfo[item.key] }}" wx:for="{{detailInfo.declarationInfo[item.key]}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex">
<image src="{{subItem}}" mode=""/>
</view>
</view>
<view wx:else>-</view>
</block>
<block wx:else>
<text class="info-value"><text style="margin-right: 8rpx;" wx:if="{{item.unit}}">{{item.unit}}</text>{{ detailInfo.declarationInfo[item.key] || '-' }}</text>
</block>
</view>
</view>
<view class="empty-box"></view>
</view>
<view wx:if="{{detailInfo.declarationInfo.approvalStatus == 1}}" class="footerBtn {{ isFullSucreen?'isFullSucreen-btn':'' }}">
<view class="btn cancel" bindtap="reject">驳回</view>
<view class="btn confirm" bindtap="pass">通过</view>
</view>
</view>
<approval-popup wx:if="{{showPopup}}" show="{{ showPopup }}" infoData="{{popupInfo}}" bindconfirm="handlePopupConfirm" bindcancel="hidePopup"></approval-popup>
\ No newline at end of file \ No newline at end of file
// packageWorkspace/pages/cashFlowReview/pages/cashFlowList/cashFlowList.js
import dayjs from 'dayjs'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
import constantData from '../../constant'
import cashflowApi from '~/packageWorkspace/pages/cashFlowReview/api'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
filterObj: {
merchantId: '',
approvalStatuses: '1',
date: ''
},
maxDate: new Date().format('yyyy-MM-dd'),
merchantMap: {
'': '门店名称'
},
approvalStatusesMap: {
'': '流水状态',
'1': '待审批',
'3': '待线上运营审批',
'5': '审批通过',
'2,4': '审批驳回'
},
listAuditStatusMap: {
'1': {name: '待审批', color: '#FF9D0A', background: '#ff9d0a1a'},
'2': {name: '审批驳回', color: '#F24724', background: '#f247241a'}, // 包含区域经理驳回和线上运营驳回
'3': {name: '待线上运营审批', color: '#7A66FE', background: '#7a66fe14'},
'5': {name: '审批通过', color: '#35C376', background: '#35C3761a'}, //
'4': {name: '审批驳回', color: '#F24724', background: '#f247241a'}
},
merchantList: [{
merchantId: '',
merchantName: '全部'
}, {
merchantId: 123456,
merchantName: '明明崇文明明崇文明明崇文明明崇文明明崇文'
}, {
merchantId: 123123,
merchantName: '崇文11'
}],
constantData,
approvalStatusesList: [{
name: '全部',
value: ''
}, {
name: '待审批',
value: '1'
}, {
name: '待线上运营审批',
value: '3'
}, {
name: '审批通过',
value: '5'
}, {
name: '审批驳回',
value: '2,4'
}],
list: [],
orderItems: [{
label: '驻店姓名',
key: 'submitterName'
}, {
label: '异常类型',
key: 'abnormalTypeText',
}, {
label: '交易参考号',
key: 'tradeNo'
}, {
label: '原支付金额',
key: 'totalPrice',
unit: '¥',
customerClass: 'blue-text'
}, {
label: '结余金额',
key: 'notRefundedTotalPrice',
unit: '¥',
customerClass: 'blue-text'
}, {
label: '支付时间',
key: 'accountDateStr'
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getSearchMerchantList()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.search()
},
getSearchMerchantList() {
cashflowApi.getMerchantListByRole({}).then(res => {
const allItems = [{merchantId: '', merchantName: '全部'}]
this.setData({
merchantList: allItems.concat(res?.data)
})
})
},
input(e) {
let { value } = e.detail
this.setData({sellerName: value})
},
clear() {
this.setData({sellerName: ''})
this.search()
},
search() {
this.setData({
list: [],
pageNum: 1,
flag: false,
nothing: false,
})
this.getList()
},
getList() {
let { pageNum, nothing, filterObj, sellerName, endStr, startStr } = this.data
let userInfo = wx.$util.getUserInfo()
// 未获取到再获取一次
if ((userInfo?.sceneType) ?? '' === '') userInfo = wx.$util.getUserInfo()
if (nothing) return
wx.$util.showLoading()
let params = {
sellerName,
appShopMerchantId: filterObj.merchantId,
approvalStatuses: filterObj.approvalStatuses ? filterObj.approvalStatuses?.split(',') : [],
pageNum,
pageSize: 10,
accountStartDate: startStr ? `${startStr} 00:00:00` : '',
accountEndDate: endStr ? `${endStr} 23:59:59` : ''
}
cashflowApi.getCashFlowReviewList(params).then(res => {
wx.$util.hideLoading()
let total = 0
let list = []
let {
code,
data,
message
} = res
data?.list?.forEach(val => {
val.abnormalTypeText = constantData.exceptionTypes?.find(v => v.value == val.abnormalType)?.name
val.accountDateStr = val.accountDate ? dayjs(val.accountDate).format('YYYY-MM-DD HH:mm:ss') : '-'
})
if (code == 0) {
list = data.list
total = data.total
} else {
wx.$util.showToast(message)
}
if (total != 0) {
this.setData({
[`list[${pageNum - 1}]`]: list
})
}
this.setData({
total,
flag: true,
triggered: false,
pageNum: pageNum + 1,
nothing: pageNum == data?.pages
})
})
},
scrollonReachBottom() {
this.getList()
},
handleDetail(e) {
let { target } = e.currentTarget.dataset
wx.navigateTo({
url: `/packageWorkspace/pages/cashFlowReview/pages/cashFlowDetail/cashFlowDetail?id=${target.id}`,
})
},
rangeSelect(e) {
let {
date: { start, end }
} = e.detail
this.setData({
['filterObj.date']: `${start} 至 ${end}`,
startStr: start,
endStr: end
}, () => {
this.search()
})
},
// 重置筛选条件
handleFilterReset() {
this.setData({
filterObj: {
merchantId: '',
approvalStatuses: '',
date: ''
},
startStr: '',
endStr: '',
merchantMap: {'': '门店名称'}
}, () => {
this.search()
})
},
// 选择门店
handleMerchantFilter() {
let {
filterObj,
merchantList
} = this.data
this.setData({
showSelectPopup: true,
selectOptions: merchantList,
selectTitle: '选择门店',
selectMultiple: false,
selectValue: [filterObj.merchantId],
selectType: 'merchantId',
labelKey: 'merchantName',
valueKey: 'merchantId'
})
},
// 选择处理状态
handleOrderStatusFilter() {
let {
filterObj,
approvalStatusesList
} = this.data
this.setData({
showSelectPopup: true,
selectOptions: approvalStatusesList,
selectTitle: '选择状态',
selectMultiple: false,
selectValue: [filterObj.approvalStatuses],
selectType: 'approvalStatuses',
labelKey: 'name',
valueKey: 'value'
})
},
handlePopupConfirm(e) {
let { values, items } = e.detail
let { selectType } = this.data
if (selectType == 'merchantId') {
this.setData({
merchantMap: values[0] ? {[items[0].merchantId]: items[0].merchantName} : {'': '门店名称'}
})
}
this.setData({
[`filterObj.${selectType}`]: values[0]
}, () => {
this.search()
})
this.hideSelectPopup()
},
hideSelectPopup() {
this.setData({
showSelectPopup: false
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"select-popup": "/packageWorkspace/components/selectPopup/selectPopup"
},
"navigationBarTitleText": "流水审批"
}
\ No newline at end of file \ No newline at end of file
/* packageWorkspace/pages/cashFlowReview/pages/cashFlowList/cashFlowList.wxss */
page {
background: #F2F3F7;
}
.list-page {
.flex {
display: flex;
align-items: center;
}
.top-box {
background: #FFFFFF;
padding: 16rpx 24rpx 24rpx;
.search-input {
background: #F7F8FA;
border-radius: var(--fontSize72);
width: 100%;
height: var(--fontSize72);
display: flex;
align-items: center;
margin-bottom: 16rpx;
.search-icon {
width: var(--fontSize28);
height: var(--fontSize28);
margin: 0 var(--fontSize10) 0 var(--fontSize26);
}
.search-clear {
width: var(--fontSize36);
height: var(--fontSize36);
margin: 0 var(--fontSize26) 0 var(--fontSize10);
}
.input {
font-size: var(--fontSize28);
height: var(--fontSize38);
line-height: var(--fontSize38);
width: calc(100% - var(--fontSize136));
}
.input-placeholder {
color: #BBBBBB;
}
}
.filter-box {
justify-content: space-between;
.filter-item {
height: 56rpx;
border-radius: 56rpx;
background: #F7F8FA;
padding: 0 16rpx 0 24rpx;
font-size: 26rpx;
color: #666666;
margin-right: 16rpx;
&.active {
color: #2C66F7;
}
.hide-text {
max-width: 150rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
text {
line-height: 40rpx;
}
image {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
}
}
.reset-btn {
color: #222222;
font-size: 26rpx;
}
}
}
.list {
.empty-box {
width: 100%;
height: 24rpx;
}
.item {
margin: 0 24rpx 24rpx;
border-radius: 32rpx;
background: #FFFFFF;
padding: 24rpx 32rpx;
.item-top {
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 -24rpx;
padding: 0 24rpx;
font-size: 26rpx;
font-weight: 500;
color: #666666;
.code {
width: calc(100% - 220rpx);
}
.code-text {
display: inline-block;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
color: #222222;
font-size: 32rpx;
}
.status {
height: 48rpx;
line-height: 48rpx;
border-radius: 8rpx;
padding: 0 12rpx;
}
}
.order-list {
padding: 24rpx 0;
font-size: 26rpx;
.order {
margin-bottom: 12rpx;
font-size: 26rpx;
color: #222222;
&:last-child {
margin-bottom: 0;
}
.order-label {
width: 184rpx;
margin-right: 32rpx;
color: #999999;
}
.order-value {
width: calc(100% - 184rpx);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.blue-text {
color: #2C66F7;
}
}
}
.btn-box {
justify-content: flex-end;
font-weight: 500;
.label {
font-size: 26rpx;
color: #666666;
margin-right: 16rpx;
}
.btn {
font-weight: 400;
width: 168rpx;
height: 64rpx;
line-height: 64rpx;
text-align: center;
border-radius: 16rpx;
font-size: 26rpx;
color: #2C66F7;
background: #2c66f71a;
&.primary {
color: #FFFFFF;
background: #2c66f7;
}
}
}
}
}
.list-nothing {
padding: 0 0 50rpx;
}
}
\ No newline at end of file \ No newline at end of file
<!-- packageWorkspace/pages/cashFlowReview/pages/cashFlowList/cashFlowList.wxml-->
<view class="list-page">
<view class="top-box">
<view class="search-box">
<view class="search-input">
<image src="/images/search.png" class="search-icon" />
<input type="text" placeholder="员工姓名/交易参考号/门店名称" class="input" value="{{ sellerName }}" placeholder-class="input-placeholder" bindinput="input" bindconfirm="search" />
<block wx:if="{{ sellerName }}">
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view>
</view>
<view class="filter-box flex">
<view class="flex">
<calendar id="calender" class="calendar" allowSameDay shortcut bindselect="rangeSelect" calenderColor="#347BFF" vertical dateType='range' minDate="2025-06-01" maxDate="{{ maxDate }}" isComponents>
<view class="filter-item flex {{filterObj.date ? 'active': ''}}">
<text class="hide-text">{{filterObj.date || '支付时间'}}</text>
<image src="{{IMG_URL}}{{filterObj.date ? 'expand_icon_blue' : 'expand_icon'}}.png" mode=""/>
</view>
</calendar>
<view class="filter-item flex {{filterObj.merchantId ? 'active': ''}}" bindtap="handleMerchantFilter">
<text class="hide-text">{{merchantMap[filterObj.merchantId]}}</text><image src="{{IMG_URL}}{{filterObj.merchantId ? 'expand_icon_blue' : 'expand_icon'}}.png" mode=""/>
</view>
<view class="filter-item flex {{filterObj.approvalStatuses ? 'active': ''}}" bindtap="handleOrderStatusFilter">
<text class="hide-text">{{approvalStatusesMap[filterObj.approvalStatuses]}}</text><image src="{{IMG_URL}}{{filterObj.approvalStatuses ? 'expand_icon_blue' : 'expand_icon'}}.png" mode=""/>
</view>
</view>
<view class="reset-btn" bindtap="handleFilterReset">重置</view>
</view>
</view>
<scroll-view scroll-y enable-back-to-top
refresher-enabled="{{ true }}"
bindrefresherrefresh="search"
bindscrolltolower="scrollonReachBottom"
class="list"
style="height:calc(100vh - var(--fontSize184));"
refresher-threshold="104"
refresher-triggered="{{ triggered }}">
<block wx:if="{{ list.length > 0 }}">
<view class="empty-box"></view>
<block wx:for="{{ list }}" wx:key="index">
<block wx:for="{{ item }}" wx:for-item="li" wx:for-index="ind" wx:key="ind">
<view
data-ind="{{ ind }}"
data-index="{{ index }}"
>
<view
class="item content"
data-ind="{{ ind }}"
data-index="{{ index }}"
data-item="{{ li }}"
>
<view class="item-top">
<view class="code">
<text class="code-text">{{li.merchantName}}</text>
</view>
<view class="status text-center" style="color:{{ listAuditStatusMap[li.approvalStatus].color }};background-color:{{listAuditStatusMap[li.approvalStatus].background }};">
{{listAuditStatusMap[li.approvalStatus].name }}
</view>
</view>
<view class="order-list">
<block wx:for="{{orderItems }}" wx:key="sindex" wx:for-index="sindex" wx:for-item="i">
<view class="order flex">
<view class="order-label">{{i.label}}</view>
<view class="order-value {{i.customerClass}}">
<block><text wx:if="{{i.unit}}">{{i.unit}}</text>{{li[i.key] || ''}}</block>
</view>
</view>
</block>
</view>
<view class="btn-box flex">
<view bindtap="handleDetail" data-target="{{li}}" class="btn {{li.approvalStatus == 1 ? 'primary' : ''}}">{{li.approvalStatus == 1 ? '去审批' : '查看'}}</view>
</view>
</view>
</view>
</block>
</block>
<block wx:if="{{ nothing }}">
<view class="list-nothing">到底了~</view>
</block>
</block>
<block wx:else>
<empty-data />
</block>
</scroll-view>
</view>
<select-popup show="{{ showSelectPopup }}" options="{{ selectOptions }}" height="60%" multiple="{{ selectMultiple }}" values="{{ selectValues }}" value="{{ selectValue }}" bindconfirm="handlePopupConfirm" title="{{ selectTitle }}" bindcancel="hideSelectPopup" customIsTab="{{ true }}" labelKey="{{labelKey}}" valueKey="{{valueKey}}"></select-popup>
\ No newline at end of file \ No newline at end of file
...@@ -48,6 +48,15 @@ module.exports = { ...@@ -48,6 +48,15 @@ module.exports = {
'/rop-dj-staff-miniprogram/router' '/rop-dj-staff-miniprogram/router'
) )
}, },
// 获取潜客门店列表
getPotentialCustomersPage(data) {
return api.post(
'dj.api.staff.miniprogram.recruitment.demand.potentialCustomers.page',
data,
[],
'/rop-dj-staff-miniprogram/router'
)
},
// 招聘管理字典查询 // 招聘管理字典查询
getStaffDictListAPI(data) { getStaffDictListAPI(data) {
return api.post( return api.post(
......
...@@ -5,28 +5,29 @@ import { ...@@ -5,28 +5,29 @@ import {
getDemandStoreListAPI, getDemandStoreListAPI,
getStaffDictListAPI, getStaffDictListAPI,
addStaffDictListAPI, addStaffDictListAPI,
getCarBrandList getPotentialCustomersPage
// getCarBrandList
} from '../api' } from '../api'
// 表单字段配置 // 表单字段配置
const FORM_FIELDS = { const FORM_FIELDS = {
MERCHANT: 0, // 门店 MERCHANT: 0, // 门店
SALES: 1, // 近一月新车销量 // SALES: 1, // 近一月新车销量
BRANDS: 2, // 主营品牌 // BRANDS: 1, // 主营品牌
ADDRESS: 3, // 所属省市 // ADDRESS: 3, // 所属省市
ADDRESS_DETAIL: 4, // 详细地址 // ADDRESS_DETAIL: 4, // 详细地址
BUSINESS_TYPE: 5, // 业务类型 BUSINESS_TYPE: 1, // 业务类型
QUANTITY: 6, // 招聘数量 QUANTITY: 2, // 招聘数量
RECRUIT_TYPE: 7, // 招聘类型 RECRUIT_TYPE: 3, // 招聘类型
URGENT: 8, // 是否急招 URGENT: 4, // 是否急招
DESCRIPTION: 9 // 需求描述 DESCRIPTION: 5 // 需求描述
} }
// 表单验证配置 // 表单验证配置
const VALIDATION_CONFIG = { const VALIDATION_CONFIG = {
[FORM_FIELDS.MERCHANT]: { tip: '请填写/选择招聘门店', required: true }, [FORM_FIELDS.MERCHANT]: { tip: '请填写/选择招聘门店', required: true },
[FORM_FIELDS.SALES]: { tip: '请输入近一月新车销量', required: false }, // [FORM_FIELDS.SALES]: { tip: '请输入近一月新车销量', required: false },
[FORM_FIELDS.BRANDS]: { tip: '请选择主营品牌', required: false }, // [FORM_FIELDS.BRANDS]: { tip: '请选择主营品牌', required: false },
[FORM_FIELDS.ADDRESS]: { tip: '请选择所属省市', required: false }, // [FORM_FIELDS.ADDRESS]: { tip: '请选择所属省市', required: false },
[FORM_FIELDS.ADDRESS_DETAIL]: { tip: '请输入详细地址', required: false }, // [FORM_FIELDS.ADDRESS_DETAIL]: { tip: '请输入详细地址', required: false },
[FORM_FIELDS.BUSINESS_TYPE]: { tip: '请选择业务类型', required: true }, [FORM_FIELDS.BUSINESS_TYPE]: { tip: '请选择业务类型', required: true },
[FORM_FIELDS.QUANTITY]: { tip: '请输入招聘数量', required: true }, [FORM_FIELDS.QUANTITY]: { tip: '请输入招聘数量', required: true },
[FORM_FIELDS.RECRUIT_TYPE]: { tip: '请选择招聘类型', required: true }, [FORM_FIELDS.RECRUIT_TYPE]: { tip: '请选择招聘类型', required: true },
...@@ -41,10 +42,10 @@ Page({ ...@@ -41,10 +42,10 @@ Page({
IMG_URL, IMG_URL,
formList: [ formList: [
{ id: 0, label: '门店名称', placeholder: '请选择招聘门店', options: [] }, { id: 0, label: '门店名称', placeholder: '请选择招聘门店', options: [] },
{ id: 1, label: '近一月新车销量', placeholder: '请输入近一月新车销量' }, // { id: 1, label: '近一月新车销量', placeholder: '请输入近一月新车销量' },
{ id: 2, label: '主营品牌', placeholder: '请选择主营品牌', options: [], multi: true }, // { id: 2, label: '主营品牌', placeholder: '请选择主营品牌', options: [], multi: true },
{ id: 3, label: '所属省市', placeholder: '请选择所属省市' }, // { id: 3, label: '所属省市', placeholder: '请选择所属省市' },
{ id: 4, label: '详细地址', placeholder: '请输入详细地址' }, // { id: 4, label: '详细地址', placeholder: '请输入详细地址' },
{ id: 5, label: '业务类型', placeholder: '请选择业务类型', options: [] }, { id: 5, label: '业务类型', placeholder: '请选择业务类型', options: [] },
{ id: 6, label: '招聘数量', placeholder: '请输入招聘数量' }, { id: 6, label: '招聘数量', placeholder: '请输入招聘数量' },
{ id: 7, label: '招聘类型', placeholder: '请选择招聘类型', options: [] }, { id: 7, label: '招聘类型', placeholder: '请选择招聘类型', options: [] },
...@@ -69,51 +70,52 @@ Page({ ...@@ -69,51 +70,52 @@ Page({
isDialogShowing: false, // Dialog显示状态 isDialogShowing: false, // Dialog显示状态
bySystemMerchant:false, bySystemMerchant:false,
// 地址选择相关 // 地址选择相关
regionData: [], // 原始的省市数据 // regionData: [], // 原始的省市数据
regionPickerRange: [[], []], // pick-view 的列数据 // regionPickerRange: [[], []], // pick-view 的列数据
regionPickerValue: [0, 0] // picker-view 的选中索引 // regionPickerValue: [0, 0] // picker-view 的选中索引
}, },
onLoad() { onLoad() {
this.initRegionData() // this.initRegionData()
this.getPotentialCustomerStoreList()
}, },
// 获取高德省市数据 // 获取高德省市数据
initRegionData() { // initRegionData() {
wx.request({ // wx.request({
url: 'https://eshield.didihu.com.cn/nesi/apiRegion/search?keyword=中国&extensions_code=1&sub_admin=2', // url: 'https://eshield.didihu.com.cn/nesi/apiRegion/search?keyword=中国&extensions_code=1&sub_admin=2',
method: 'GET', // method: 'GET',
success: (res) => { // success: (res) => {
const obj = JSON.parse(res.data.data) // const obj = JSON.parse(res.data.data)
if (obj && obj.status == '0' && obj.districts.length > 0) { // if (obj && obj.status == '0' && obj.districts.length > 0) {
const countryData = obj.districts[0].districts || []; // const countryData = obj.districts[0].districts || [];
//
// 格式化省份数据 // // 格式化省份数据
const provinces = countryData.map(p => ({ // const provinces = countryData.map(p => ({
name: p.name, // name: p.name,
adcode: p.code, // adcode: p.code,
cities: p.districts ? p.districts.map(c => ({ // cities: p.districts ? p.districts.map(c => ({
name: c.name, // name: c.name,
adcode: c.code // adcode: c.code
})) : [] // })) : []
})); // }));
//
// 初始化 picker-view 的第一列(省份)和第二列(第一个省份对应的城市) // // 初始化 picker-view 的第一列(省份)和第二列(第一个省份对应的城市)
const provinceNames = provinces.map(p => p.name); // const provinceNames = provinces.map(p => p.name);
const cityNames = provinces.length > 0 ? provinces[0].cities.map(c => c.name) : []; // const cityNames = provinces.length > 0 ? provinces[0].cities.map(c => c.name) : [];
//
this.setData({ // this.setData({
regionData: provinces, // regionData: provinces,
regionPickerRange: [provinceNames, cityNames], // regionPickerRange: [provinceNames, cityNames],
regionPickerValue: [0, 0] // regionPickerValue: [0, 0]
}); // });
} // }
}, // },
fail: (err) => { // fail: (err) => {
console.error('获取省市数据失败', err); // console.error('获取省市数据失败', err);
} // }
}); // });
}, // },
// 勾选/取消勾选“未创建系统门店” // 勾选/取消勾选“未创建系统门店”
toggleUncreatedStore() { toggleUncreatedStore() {
const bySystemMerchant = !this.data.bySystemMerchant const bySystemMerchant = !this.data.bySystemMerchant
...@@ -122,25 +124,33 @@ Page({ ...@@ -122,25 +124,33 @@ Page({
// 切换时清空门店相关数据 // 切换时清空门店相关数据
formList[FORM_FIELDS.MERCHANT].value = '' formList[FORM_FIELDS.MERCHANT].value = ''
formList[FORM_FIELDS.MERCHANT].displayValue = '' formList[FORM_FIELDS.MERCHANT].displayValue = ''
formList[FORM_FIELDS.MERCHANT].options = []
formList[FORM_FIELDS.MERCHANT].placeholder = bySystemMerchant
? '请选择潜客门店'
: '请选择招聘门店'
if (!bySystemMerchant) { if (!bySystemMerchant) {
// 隐藏的字段清空 // 隐藏的字段清空
formList[FORM_FIELDS.SALES].value = '' // formList[FORM_FIELDS.SALES].value = ''
formList[FORM_FIELDS.SALES].displayValue = '' // formList[FORM_FIELDS.SALES].displayValue = ''
formList[FORM_FIELDS.BRANDS].value = '' // formList[FORM_FIELDS.BRANDS].value = ''
formList[FORM_FIELDS.BRANDS].displayValue = '' // formList[FORM_FIELDS.BRANDS].displayValue = ''
formList[FORM_FIELDS.ADDRESS].value = '' // formList[FORM_FIELDS.ADDRESS].value = ''
formList[FORM_FIELDS.ADDRESS].displayValue = '' // formList[FORM_FIELDS.ADDRESS].displayValue = ''
formList[FORM_FIELDS.ADDRESS].otherValue = '' // formList[FORM_FIELDS.ADDRESS].otherValue = ''
formList[FORM_FIELDS.ADDRESS_DETAIL].value = '' // formList[FORM_FIELDS.ADDRESS_DETAIL].value = ''
formList[FORM_FIELDS.ADDRESS_DETAIL].displayValue = '' // formList[FORM_FIELDS.ADDRESS_DETAIL].displayValue = ''
} }
// 更新校验规则 // 更新校验规则
VALIDATION_CONFIG[FORM_FIELDS.SALES].required = bySystemMerchant // VALIDATION_CONFIG[FORM_FIELDS.SALES].required = bySystemMerchant
VALIDATION_CONFIG[FORM_FIELDS.BRANDS].required = bySystemMerchant // VALIDATION_CONFIG[FORM_FIELDS.BRANDS].required = bySystemMerchant
VALIDATION_CONFIG[FORM_FIELDS.ADDRESS].required = bySystemMerchant // VALIDATION_CONFIG[FORM_FIELDS.ADDRESS].required = bySystemMerchant
VALIDATION_CONFIG[FORM_FIELDS.ADDRESS_DETAIL].required = bySystemMerchant // VALIDATION_CONFIG[FORM_FIELDS.ADDRESS_DETAIL].required = bySystemMerchant
if (bySystemMerchant && this.potentialCustomerStoreOptions?.length) {
formList[FORM_FIELDS.MERCHANT].options = this.potentialCustomerStoreOptions
}
this.setData({ this.setData({
bySystemMerchant, bySystemMerchant,
...@@ -158,90 +168,89 @@ Page({ ...@@ -158,90 +168,89 @@ Page({
}, },
// 近一月新车销量输入 // 近一月新车销量输入
onSalesInput(e) { // onSalesInput(e) {
let value = e.detail.value // let value = e.detail.value
const formList = this.data.formList // const formList = this.data.formList
value = value.replace(/\D/g, '') // value = value.replace(/\D/g, '')
if (value.length > 1 && value.startsWith('0')) { // if (value.length > 1 && value.startsWith('0')) {
value = value.replace(/^0+/, '') // value = value.replace(/^0+/, '')
} // }
if (value !== '') { // if (value !== '') {
let numValue = parseInt(value, 10) // let numValue = parseInt(value, 10)
if (numValue > 9999) { // if (numValue > 9999) {
value = '9999' // value = '9999'
} else if (numValue < 1) { // } else if (numValue < 1) {
value = '1' // value = '1'
} // }
} // }
formList[FORM_FIELDS.SALES].value = value // formList[FORM_FIELDS.SALES].value = value
formList[FORM_FIELDS.SALES].displayValue = value // formList[FORM_FIELDS.SALES].displayValue = value
this.setData({ formList }) // this.setData({ formList })
}, // },
// 所属省市选择 (高德地图省市二级联动) // 所属省市选择 (高德地图省市二级联动)
onRegionChange(e) { // onRegionChange(e) {
const value = e.detail.value; // const value = e.detail.value;
const { regionData, formList } = this.data; // const { regionData, formList } = this.data;
//
const provinceIndex = value[0] || 0; // const provinceIndex = value[0] || 0;
const cityIndex = value[1] || 0; // const cityIndex = value[1] || 0;
//
if (!regionData || regionData.length === 0) return; // if (!regionData || regionData.length === 0) return;
//
const province = regionData[provinceIndex]; // const province = regionData[provinceIndex];
const city = province.cities[cityIndex]; // const city = province.cities[cityIndex];
//
const provinceName = province ? province.name : ''; // const provinceName = province ? province.name : '';
const cityName = city ? city.name : ''; // const cityName = city ? city.name : '';
const provinceCode = province ? province.adcode : ''; // const provinceCode = province ? province.adcode : '';
const cityCode = city ? city.adcode : ''; // const cityCode = city ? city.adcode : '';
//
// const addressStr = provinceName === cityName ? provinceName : `${provinceName}${cityName}`; // // const addressStr = provinceName === cityName ? provinceName : `${provinceName}${cityName}`;
const addressStr = `${provinceName}${cityName}`; // const addressStr = `${provinceName}${cityName}`;
const addressCode = `${provinceCode}/${cityCode}`; // const addressCode = `${provinceCode}/${cityCode}`;
//
formList[FORM_FIELDS.ADDRESS].value = addressCode; // formList[FORM_FIELDS.ADDRESS].value = addressCode;
formList[FORM_FIELDS.ADDRESS].displayValue = addressStr; // formList[FORM_FIELDS.ADDRESS].displayValue = addressStr;
formList[FORM_FIELDS.ADDRESS].otherValue = provinceName; // formList[FORM_FIELDS.ADDRESS].otherValue = provinceName;
//
this.setData({ // this.setData({
formList, // formList,
regionPickerValue: value // regionPickerValue: value
}); // });
}, // },
// 详细地址输入(未创建系统门店时) // 详细地址输入(未创建系统门店时)
onAddressDetailInput(e) { // onAddressDetailInput(e) {
const value = e.detail.value.substring(0, 60) // const value = e.detail.value.substring(0, 60)
const formList = this.data.formList // const formList = this.data.formList
formList[FORM_FIELDS.ADDRESS_DETAIL].value = value // formList[FORM_FIELDS.ADDRESS_DETAIL].value = value
formList[FORM_FIELDS.ADDRESS_DETAIL].displayValue = value // formList[FORM_FIELDS.ADDRESS_DETAIL].displayValue = value
this.setData({ formList }) // this.setData({ formList })
}, // },
onRegionColumnChange(e) { // onRegionColumnChange(e) {
const { column, value } = e.detail; // const { column, value } = e.detail;
if (column === 0) { // if (column === 0) {
const { regionData, regionPickerRange } = this.data; // const { regionData, regionPickerRange } = this.data;
const provinceIndex = value; // const provinceIndex = value;
const province = regionData[provinceIndex]; // const province = regionData[provinceIndex];
const cityNames = province && province.cities ? province.cities.map(c => c.name) : []; // const cityNames = province && province.cities ? province.cities.map(c => c.name) : [];
//
this.setData({ // this.setData({
'regionPickerRange[1]': cityNames, // 'regionPickerRange[1]': cityNames,
'regionPickerValue[0]': value, // 'regionPickerValue[0]': value,
'regionPickerValue[1]': 0 // 'regionPickerValue[1]': 0
}); // });
} // }
}, // },
onFormItemTap(e) { onFormItemTap(e) {
const index = e.currentTarget.dataset.index const index = e.currentTarget.dataset.index
const item = this.data.formList && this.data.formList[index] const item = this.data.formList && this.data.formList[index]
const label = item && item.label const label = item && item.label
// 如果是门店名称且勾选了未创建系统门店,则不弹出 if (label === '需求描述' || label === '招聘数量' || label === '是否急招') return
if (label === '门店名称' && this.data.bySystemMerchant) return // if (label === '近一月新车销量' || label === '所属省市' || label === '详细地址' || label === '需求描述' || label === '招聘数量' || label === '是否急招') return
if (label === '近一月新车销量' || label === '所属省市' || label === '详细地址' || label === '需求描述' || label === '招聘数量' || label === '是否急招') return
return this.showPopup(e) return this.showPopup(e)
}, },
...@@ -255,10 +264,13 @@ Page({ ...@@ -255,10 +264,13 @@ Page({
wx.showLoading({ title: '加载中...', mask: true }) wx.showLoading({ title: '加载中...', mask: true })
try { try {
if (index === 0) { if (index === 0) {
// 获取全部门店列表(不传关键词) if (this.data.bySystemMerchant) {
await this.getPotentialCustomerStoreList()
} else {
await this.getDemandStoreList() await this.getDemandStoreList()
} else if (index === FORM_FIELDS.BRANDS) { }
await this.getBrandList() // } else if (index === FORM_FIELDS.BRANDS) {
// await this.getBrandList()
} else { } else {
await this.getDictList(index) await this.getDictList(index)
} }
...@@ -299,7 +311,7 @@ Page({ ...@@ -299,7 +311,7 @@ Page({
? item.value[0] ? item.value[0]
: item.value : item.value
options = options.map(option => { options = options.map(option => {
if (option.value === selectedValue) { if (String(option.value) === String(selectedValue)) {
option.checked = true option.checked = true
selectedOptions.push(option.value) selectedOptions.push(option.value)
} }
...@@ -364,16 +376,38 @@ Page({ ...@@ -364,16 +376,38 @@ Page({
async performSearch(keyword) { async performSearch(keyword) {
const { currentIndex } = this.data const { currentIndex } = this.data
if (currentIndex === FORM_FIELDS.BRANDS) { // if (currentIndex === FORM_FIELDS.BRANDS) {
// 主营品牌本地过滤 // // 主营品牌本地过滤
const { options } = this.data // const { options } = this.data
const filteredOptions = keyword ? options.filter(option => option.text.includes(keyword)) : options // const filteredOptions = keyword ? options.filter(option => option.text.includes(keyword)) : options
this.setData({ filteredOptions }) // this.setData({ filteredOptions })
// return
// }
if (currentIndex !== 0) {
return return
} }
// 只有在门店选择时才进行远程搜索 // 潜客门店:接口搜索
if (currentIndex !== 0) { if (this.data.bySystemMerchant) {
const options = await this.getPotentialCustomerStoreList(keyword)
const processedOptions = options.map(option => ({
...option,
checked: false
}))
const { selectedOptions } = this.data
if (selectedOptions.length > 0) {
const selectedValue = selectedOptions[0]
processedOptions.forEach(option => {
if (String(option.value) === String(selectedValue)) {
option.checked = true
}
})
}
this.setData({
options: processedOptions,
filteredOptions: processedOptions
})
return return
} }
...@@ -392,7 +426,7 @@ Page({ ...@@ -392,7 +426,7 @@ Page({
if (selectedOptions.length > 0) { if (selectedOptions.length > 0) {
const selectedValue = selectedOptions[0] const selectedValue = selectedOptions[0]
processedOptions.forEach(option => { processedOptions.forEach(option => {
if (option.value === selectedValue) { if (String(option.value) === String(selectedValue)) {
option.checked = true option.checked = true
} }
}) })
...@@ -423,9 +457,13 @@ Page({ ...@@ -423,9 +457,13 @@ Page({
const currentIndex = this.data.currentIndex const currentIndex = this.data.currentIndex
const item = this.data.formList[currentIndex] const item = this.data.formList[currentIndex]
// 找到点击的选项在原始options中的索引 // 找到点击的选项在原始options中的索引(dataset.value 会被转为字符串)
const originalIndex = options.findIndex(option => option.value === value) const originalIndex = options.findIndex(
const filteredIndex = filteredOptions.findIndex(option => option.value === value) option => String(option.value) === String(value)
)
const filteredIndex = filteredOptions.findIndex(
option => String(option.value) === String(value)
)
if (item.multi) { if (item.multi) {
if (originalIndex >= 0) { if (originalIndex >= 0) {
...@@ -567,10 +605,10 @@ Page({ ...@@ -567,10 +605,10 @@ Page({
const selectedValue = selectedOptions[0] || '' const selectedValue = selectedOptions[0] || ''
if (selectedValue) { if (selectedValue) {
const selectedOption = this.data.options.find( const selectedOption = this.data.options.find(
option => option.value === selectedValue option => String(option.value) === String(selectedValue)
) )
if (selectedOption) { if (selectedOption) {
value = selectedValue value = selectedOption.value
displayValue = selectedOption.text || '' displayValue = selectedOption.text || ''
} }
} }
...@@ -608,15 +646,17 @@ Page({ ...@@ -608,15 +646,17 @@ Page({
// 构建提交数据 // 构建提交数据
buildSubmitData() { buildSubmitData() {
const { formList, bySystemMerchant } = this.data const { formList, bySystemMerchant } = this.data
const merchantId = formList[FORM_FIELDS.MERCHANT].value || null
return { return {
merchantId: bySystemMerchant ? null : formList[FORM_FIELDS.MERCHANT].value, merchantId,
merchantName: bySystemMerchant ? formList[FORM_FIELDS.MERCHANT].value : formList[FORM_FIELDS.MERCHANT].displayValue, ...(bySystemMerchant ? { potentialCustomerId: merchantId } : {}),
salesVolume: bySystemMerchant ? formList[FORM_FIELDS.SALES].value : null, merchantName: formList[FORM_FIELDS.MERCHANT].displayValue,
brand: bySystemMerchant ? formList[FORM_FIELDS.BRANDS].displayValue : null, // salesVolume: bySystemMerchant ? formList[FORM_FIELDS.SALES].value : null,
provinceCityCode:bySystemMerchant ? formList[FORM_FIELDS.ADDRESS].value : null, // brand: bySystemMerchant ? formList[FORM_FIELDS.BRANDS].displayValue : null,
merchantAddress: bySystemMerchant ? formList[FORM_FIELDS.ADDRESS].displayValue : null, // provinceCityCode:bySystemMerchant ? formList[FORM_FIELDS.ADDRESS].value : null,
merchantAddressDetail: bySystemMerchant ? formList[FORM_FIELDS.ADDRESS_DETAIL].value : null, // merchantAddress: bySystemMerchant ? formList[FORM_FIELDS.ADDRESS].displayValue : null,
province: bySystemMerchant ? formList[FORM_FIELDS.ADDRESS].otherValue : null, // merchantAddressDetail: bySystemMerchant ? formList[FORM_FIELDS.ADDRESS_DETAIL].value : null,
// province: bySystemMerchant ? formList[FORM_FIELDS.ADDRESS].otherValue : null,
businessType: formList[FORM_FIELDS.BUSINESS_TYPE].value, businessType: formList[FORM_FIELDS.BUSINESS_TYPE].value,
businessTypeName: formList[FORM_FIELDS.BUSINESS_TYPE].displayValue, businessTypeName: formList[FORM_FIELDS.BUSINESS_TYPE].displayValue,
recruitmentQuantity: formList[FORM_FIELDS.QUANTITY].value, recruitmentQuantity: formList[FORM_FIELDS.QUANTITY].value,
...@@ -720,34 +760,76 @@ Page({ ...@@ -720,34 +760,76 @@ Page({
navigateToResult() { navigateToResult() {
wx.$router.redirectTo(`recruitResult`) wx.$router.redirectTo(`recruitResult`)
}, },
// /**
// * 获取主营品牌列表
// */
// getBrandList() {
// return new Promise((resolve, reject) => {
// getCarBrandList({})
// .then(res => {
// let { code, data } = res
// if (code == 0 && data) {
//
// const options = data.map(item => ({
// text: item.brandName || item.name || '--',
// value: item.brandId || item.id
// }))
// this.setData({
// [`formList[${FORM_FIELDS.BRANDS}].options`]: options
// })
// resolve(options)
// } else {
// reject(new Error('获取品牌列表失败'))
// }
// })
// .catch(err => {
// console.error('获取品牌列表失败', err)
// reject(err)
// })
// })
// },
/** /**
* 获取主营品牌列表 * 获取潜客门店列表
* @param {String} keyword 搜索关键词(可选)
*/ */
getBrandList() { getPotentialCustomerStoreList(keyword = '') {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getCarBrandList({}) const params = {
currentPage: 1,
pageSize: 999
}
if (keyword) {
params.storeName = keyword
}
getPotentialCustomersPage(params)
.then(res => { .then(res => {
let { code, data } = res let { code, data } = res
if (code == 0 && data) { if (code == 0) {
const list = (data && data.list) || data || []
const options = data.map(item => ({ const options = list.map(item => ({
text: item.brandName || item.name || '--', text: item.storeName || '-',
value: item.brandId || item.id value: item.id
})) }))
if (!keyword) {
this.potentialCustomerStoreOptions = options
if (this.data.bySystemMerchant) {
this.setData({ this.setData({
[`formList[${FORM_FIELDS.BRANDS}].options`]: options 'formList[0].options': options
}) })
}
}
resolve(options) resolve(options)
} else { } else {
reject(new Error('获取品牌列表失败')) reject(new Error('获取潜客门店列表失败'))
} }
}) })
.catch(err => { .catch(err => {
console.error('获取品牌列表失败', err) console.error('获取潜客门店列表失败', err)
reject(err) reject(err)
}) })
}) })
}, },
/** /**
* 动态获取门店列表 * 动态获取门店列表
* @param {String} keyword 搜索关键词(可选) * @param {String} keyword 搜索关键词(可选)
......
...@@ -7,27 +7,24 @@ ...@@ -7,27 +7,24 @@
<view class="checkbox {{ bySystemMerchant ? 'checked' : '' }}"> <view class="checkbox {{ bySystemMerchant ? 'checked' : '' }}">
<van-icon wx:if="{{ bySystemMerchant }}" name="success" size="12px" color="#fff" /> <van-icon wx:if="{{ bySystemMerchant }}" name="success" size="12px" color="#fff" />
</view> </view>
<text class="checkbox-text">未创建系统门店</text> <!-- <text class="checkbox-text">未创建系统门店</text> -->
<text class="checkbox-text">选择潜客门店</text>
</view> </view>
</view> </view>
</view> </view>
<view class="form"> <view class="form">
<block wx:for="{{ formList }}" wx:key="index"> <block wx:for="{{ formList }}" wx:key="index">
<block wx:if="{{ index === 0 || index > 4 || (index > 0 && index <= 4 && bySystemMerchant) }}">
<view class="form-item {{ item.label === '需求描述' ? 'form-item-textarea' : '' }}" bindtap="onFormItemTap" data-index="{{ index }}"> <view class="form-item {{ item.label === '需求描述' ? 'form-item-textarea' : '' }}" bindtap="onFormItemTap" data-index="{{ index }}">
<view class="label"> <view class="label">
{{item.label}} {{item.label}}
<text wx:if="{{ item.label !== '需求描述' }}" class="required">*</text> <text wx:if="{{ item.label !== '需求描述' }}" class="required">*</text>
</view> </view>
<view class="value" wx:if="{{ item.label === '门店名称' && bySystemMerchant }}"> <view class="value" wx:if="{{ item.label === '门店名称' }}">
<input class="number-input" type="text" placeholder="请输入门店名称" placeholder-style="color: #BBBBBB;font-size:var(--fontSize28);text-align:right;" value="{{ item.displayValue }}" bindinput="onStoreNameInput" maxlength="50" />
</view>
<view class="value" wx:elif="{{ item.label === '门店名称' && !bySystemMerchant }}">
<text class="display_value" wx:if="{{ item.displayValue }}">{{item.displayValue}}</text> <text class="display_value" wx:if="{{ item.displayValue }}">{{item.displayValue}}</text>
<text class="placeholder" wx:else>{{item.placeholder}}</text> <text class="placeholder" wx:else>{{item.placeholder}}</text>
<image class="arrow_right" src="/packageWorkspace/pages/image/arrow-right.png" mode="aspectFill" /> <image class="arrow_right" src="/packageWorkspace/pages/image/arrow-right.png" mode="aspectFill" />
</view> </view>
<view class="value" wx:elif="{{ item.label === '近一月新车销量' }}"> <!-- <view class="value" wx:elif="{{ item.label === '近一月新车销量' }}">
<input class="number-input" type="number" placeholder="{{ item.placeholder }}" placeholder-style="color: #BBBBBB;font-size:var(--fontSize28)" value="{{ item.displayValue }}" bindinput="onSalesInput" /> <input class="number-input" type="number" placeholder="{{ item.placeholder }}" placeholder-style="color: #BBBBBB;font-size:var(--fontSize28)" value="{{ item.displayValue }}" bindinput="onSalesInput" />
</view> </view>
<view class="value" wx:elif="{{ item.label === '所属省市' }}"> <view class="value" wx:elif="{{ item.label === '所属省市' }}">
...@@ -41,11 +38,11 @@ ...@@ -41,11 +38,11 @@
</view> </view>
<view class="value" wx:elif="{{ item.label === '详细地址' }}"> <view class="value" wx:elif="{{ item.label === '详细地址' }}">
<input class="number-input" type="text" placeholder="{{ item.placeholder }}" placeholder-style="color: #BBBBBB;font-size:var(--fontSize28);text-align:right;" value="{{ item.displayValue }}" bindinput="onAddressDetailInput" maxlength="60" /> <input class="number-input" type="text" placeholder="{{ item.placeholder }}" placeholder-style="color: #BBBBBB;font-size:var(--fontSize28);text-align:right;" value="{{ item.displayValue }}" bindinput="onAddressDetailInput" maxlength="60" />
</view> </view> -->
<view class="value" wx:elif="{{ item.label === '是否急招' }}"> <view class="value" wx:elif="{{ item.label === '是否急招' }}">
<switch checked="{{ switch1Checked }}" bindchange="switch1Change" /> <switch checked="{{ switch1Checked }}" bindchange="switch1Change" />
</view> </view>
<view class="value" wx:elif="{{ item.label !== '需求描述' && item.label !== '招聘数量' && item.label !== '是否急招' && item.label !== '详细地址' }}"> <view class="value" wx:elif="{{ item.label !== '需求描述' && item.label !== '招聘数量' && item.label !== '是否急招' }}">
<text class="display_value" wx:if="{{ item.displayValue }}">{{item.displayValue}}</text> <text class="display_value" wx:if="{{ item.displayValue }}">{{item.displayValue}}</text>
<text class="placeholder" wx:else>{{item.placeholder}}</text> <text class="placeholder" wx:else>{{item.placeholder}}</text>
<image class="arrow_right" src="/packageWorkspace/pages/image/arrow-right.png" mode="aspectFill" /> <image class="arrow_right" src="/packageWorkspace/pages/image/arrow-right.png" mode="aspectFill" />
...@@ -62,7 +59,6 @@ ...@@ -62,7 +59,6 @@
</block> </block>
</view> </view>
</block> </block>
</block>
</view> </view>
<view class="footer"> <view class="footer">
<view class="btn" bind:tap="submit">提交</view> <view class="btn" bind:tap="submit">提交</view>
...@@ -75,7 +71,7 @@ ...@@ -75,7 +71,7 @@
<!-- 固定顶部区域 --> <!-- 固定顶部区域 -->
<view class="popup-fixed-top"> <view class="popup-fixed-top">
<view class="popup-title">选择{{currentItem.label}}</view> <view class="popup-title">选择{{currentItem.label}}</view>
<view class="search-box" wx:if="{{ currentIndex === 0 || currentIndex === 2 }}"> <view class="search-box" wx:if="{{ currentIndex === 0 }}">
<view class="search-input"> <view class="search-input">
<block wx:if="{{ !keyWord }}"> <block wx:if="{{ !keyWord }}">
<image src="/images/search.png" class="search-icon" /> <image src="/images/search.png" class="search-icon" />
......
...@@ -57,6 +57,12 @@ Page({ ...@@ -57,6 +57,12 @@ Page({
reportTypeVal: "3", reportTypeVal: "3",
trackingCode: "regional-assistant-server-center", trackingCode: "regional-assistant-server-center",
}, },
{
name: "流水审批",
url: "packageWorkspace.cashFlowList",
icon: "cashflow-review",
trackingCode: "regional-assistant-cashflow-review",
}
], ],
staffDevelopmentMenus: [ staffDevelopmentMenus: [
{ {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!