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

View File

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

View File

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

View File

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

View File

@ -4,22 +4,10 @@
<view class="sta-item">
<u-row justify="between">
<text class="font-30 font-weight">业务统计</text>
<view style="width: 146rpx;;">
<tpx-select mode="drop" v-model:value="searchParam.queryDateType" :list="dateRangeList"
v-model:text="searchParam._queryDateTypeTitle" @onChange="handleDateTypeChange"
>
<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 style="width: 460rpx;;">
<tpx-date-input v-model:value="searchParam._date" @change="handleReloadData" placeholder="请选择时间"
:toolsRangesList="dateRangeList"
></tpx-date-input>
</view>
</u-row>
@ -100,10 +88,9 @@
},
data() {
return {
...JSON.parse(JSON.stringify({ dateRangeList })),
dateRangeList,
searchParam: {
queryDateType: dateRangeList[0].val,
_queryDateTypeTitle: dateRangeList[0].title,
_date: [],
},
queryOption: {
},
@ -120,10 +107,17 @@
this.initData();
},
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 = {}){
const cpParam = this.transSearchPm(this.searchParam)
let params = {
params:{
...this.searchParam,
...cpParam,
...opt,
},
_loading: true,
@ -134,11 +128,11 @@
const statListRes = await apiService.getMyBizStatList(params)
this.statList = statListRes.data || []
},
handleDateTypeChange(val){
this.initData({
queryDateType: val
})
}
handleReloadData(){
setTimeout(()=> {
this.initData()
}, 400)
},
}
}
</script>