This commit is contained in:
aihe 2025-01-12 17:54:44 +08:00
parent c762d35faa
commit 5ff0c7ddeb
5 changed files with 69 additions and 59 deletions

View File

@ -1,27 +1,41 @@
import getCdnUrl, { getCdnRoot } from "./getCdnUrl.js" import getCdnUrl, { getCdnRoot } from "./getCdnUrl.js"
import { authCodeEnum } from "./authCode" import { authCodeEnum } from "./authCode"
import dayjs from "dayjs"
const dateTypeEnum = { const formatStr = 'YYYY-MM-DD'
week: 1, let curMonth = dayjs().month() + 1
month: 2, let curMYush = curMonth % 3
custom: 3, // 如果被整除,diff就要设置成被除以的数
if(curMYush == 0) {
curMYush = 3
} }
const dateTypeList = [
{ title: '近一周', val: dateTypeEnum.week },
{ title: '近一月', val: dateTypeEnum.month },
{ title: '自定义时间', val: dateTypeEnum.custom },
]
const dateRangeList = [ const dateRangeList = [
{ title: '天', val: 1 }, { title: '本周', val: 1,
{ title: '周', val: 2 }, range: [
{ title: '月', val: 3 }, dayjs().startOf('week').add(-6, 'day').format(formatStr),
{ title: '季度', val: 4 }, dayjs().endOf('week').add(-6, 'day').format(formatStr)
{ title: '年', val: 5 }, ],
},
{ title: '当月', val: 2,
range: [
dayjs().startOf('month').format(formatStr),
dayjs().endOf('month').format(formatStr)
],
},
{ title: '本季度', val: 3,
range: [
dayjs().month((curMonth - curMYush)).startOf('month').format(formatStr),
dayjs().month(curMonth + (3 - curMYush) - 1).endOf('month').format(formatStr)
],
},
{ title: '本年度', val: 4,
range: [
dayjs().startOf('year').format(formatStr),
dayjs().endOf('year').format(formatStr)
],
},
{ title: '自定义', val: '-1', range: [] },
] ]
const costRateTypeEnum = { const costRateTypeEnum = {
cny: 'CNY', cny: 'CNY',
usd: 'USD', usd: 'USD',
@ -108,8 +122,6 @@ export {
costRateList, costRateList,
pageEventNames, pageEventNames,
dealBtnMap, dealBtnMap,
dateTypeEnum,
dateTypeList,
authCodeEnum, authCodeEnum,
audioTypeEnum, audioTypeEnum,
} }

View File

@ -3,7 +3,7 @@
"appid" : "__UNI__BCB0FB5", "appid" : "__UNI__BCB0FB5",
"description" : "探路国际速运", "description" : "探路国际速运",
"versionName" : "1.0.1", "versionName" : "1.0.1",
"versionCode" : "1055", "versionCode" : "1056",
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus" : {

View File

@ -77,6 +77,10 @@
</template> </template>
<template v-slot:footer> <template v-slot:footer>
<view class="pos-rlt blcok-white" style="border-radius: 0;margin-top: 0;"> <view class="pos-rlt blcok-white" style="border-radius: 0;margin-top: 0;">
<view v-if="submitParam.lockFlag == 'T'">
<view class="clr-prm font-weight font-30" style="padding: 20rpx 0;">{{submitParam.lockReason}}</view>
</view>
<view v-else>
<u-row> <u-row>
<u-button @click="handleJinCang" :disabled="!submitParam.inNo" size="large" shape="circle" <u-button @click="handleJinCang" :disabled="!submitParam.inNo" size="large" shape="circle"
custom-style="width: 260rpx;height:80rpx;font-size: 30rpx;" :plain="true" type="primary">进仓登记</u-button> custom-style="width: 260rpx;height:80rpx;font-size: 30rpx;" :plain="true" type="primary">进仓登记</u-button>
@ -85,6 +89,7 @@
custom-style="width: 400rpx;height:80rpx;font-size: 30rpx;" type="primary">货齐开单</u-button> custom-style="width: 400rpx;height:80rpx;font-size: 30rpx;" type="primary">货齐开单</u-button>
</u-row> </u-row>
</view> </view>
</view>
</template> </template>
</tpx-layout> </tpx-layout>
@ -143,6 +148,11 @@
if(!res.data) { if(!res.data) {
this.showToast("进仓单号数据不存在") this.showToast("进仓单号数据不存在")
} }
if(res?.data?.lockFlag == 'T') {
setTimeout(()=> {
this.showToast(res.data.lockReason)
}, 500)
}
let data = res.data || {} let data = res.data || {}
this.submitParam = Object.assign({}, data, { this.submitParam = Object.assign({}, data, {
pickupMethod: 1, pickupMethod: 1,

View File

@ -127,9 +127,6 @@
</template> </template>
<script> <script>
import {
dateRangeList
} from "@/common/enum"
import * as apiService from "@/common/api" import * as apiService from "@/common/api"
import BpdSendRecieverTmp from "@/components/buns-post-detail-templates/bpd-send-reciever-tmp" import BpdSendRecieverTmp from "@/components/buns-post-detail-templates/bpd-send-reciever-tmp"
import { import {
@ -177,9 +174,6 @@
return { return {
baseLoading: true, baseLoading: true,
authCodeEnum, authCodeEnum,
...JSON.parse(JSON.stringify({
dateRangeList
})),
searchParam: { searchParam: {
billCode: '', billCode: '',
_date: [], _date: [],

View File

@ -4,22 +4,10 @@
<view class="sta-item"> <view class="sta-item">
<u-row justify="between"> <u-row justify="between">
<text class="font-30 font-weight">业务统计</text> <text class="font-30 font-weight">业务统计</text>
<view style="width: 146rpx;;"> <view style="width: 460rpx;;">
<tpx-select mode="drop" v-model:value="searchParam.queryDateType" :list="dateRangeList" <tpx-date-input v-model:value="searchParam._date" @change="handleReloadData" placeholder="请选择时间"
v-model:text="searchParam._queryDateTypeTitle" @onChange="handleDateTypeChange" :toolsRangesList="dateRangeList"
> ></tpx-date-input>
<u-button :hairline="false" shape="circle" size="mini" custom-style="border-radius: 23rpx;font-size: 26rpx;height: 50rpx;">
<u-row justify="between" custom-style="width: 100%;">
<view :style="'padding: 0 10rpx;white-space: nowrap;'">
{{searchParam._queryDateTypeTitle || '统计'}}
</view>
<u-icon :name="'arrow-down-fill'"
color="#666" size="18" custom-style="margin-top: 2rpx;"
></u-icon>
</u-row>
</u-button>
</tpx-select>
</view> </view>
</u-row> </u-row>
@ -100,10 +88,9 @@
}, },
data() { data() {
return { return {
...JSON.parse(JSON.stringify({ dateRangeList })), dateRangeList,
searchParam: { searchParam: {
queryDateType: dateRangeList[0].val, _date: [],
_queryDateTypeTitle: dateRangeList[0].title,
}, },
queryOption: { queryOption: {
}, },
@ -120,10 +107,17 @@
this.initData(); this.initData();
}, },
methods: { methods: {
transSearchPm(param) {
let cpParam = JSON.parse(JSON.stringify(param))
cpParam.beginDate = cpParam?._date?.[0]
cpParam.endDate = cpParam?._date?.[1]
return cpParam
},
async initData(opt = {}){ async initData(opt = {}){
const cpParam = this.transSearchPm(this.searchParam)
let params = { let params = {
params:{ params:{
...this.searchParam, ...cpParam,
...opt, ...opt,
}, },
_loading: true, _loading: true,
@ -134,11 +128,11 @@
const statListRes = await apiService.getMyBizStatList(params) const statListRes = await apiService.getMyBizStatList(params)
this.statList = statListRes.data || [] this.statList = statListRes.data || []
}, },
handleDateTypeChange(val){ handleReloadData(){
this.initData({ setTimeout(()=> {
queryDateType: val this.initData()
}) }, 400)
} },
} }
} }
</script> </script>