feat: 修改配置文件和页面逻辑,优化商品采购和订单获取功能

This commit is contained in:
mkm 2024-09-26 10:47:19 +08:00
parent 1f200c6b12
commit 56217754ec
10 changed files with 65 additions and 60 deletions

View File

@ -17,7 +17,7 @@ switch (env) {
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull' WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
break; break;
case 'local': case 'local':
BASE_URL = 'http://192.168.1.8:8545'; BASE_URL = 'http://192.168.1.22:8545';
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull' WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
break; break;
default: default:

View File

@ -2,14 +2,12 @@
<view style="background-color: #ffffff;"> <view style="background-color: #ffffff;">
<up-sticky offset-top="0" style="background-color: #ffffff;"> <up-sticky offset-top="0" style="background-color: #ffffff;">
<view class="navbar"> <view class="navbar">
<view style="width: 580rpx;"> <view style="width:35%;">
<up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword" <up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword"
:showAction="false"></up-search> :showAction="false"></up-search>
</view> </view>
<view class="nav-item" @click="calendarShow=true"> <view style="width:65%;padding-left: 10rpx;">
<up-icon name="calendar" color="#2979ff" size="28"></up-icon> <uni-datetime-picker v-model="range" type="daterange" @change="calendarConfirm" />
<text>筛选日期</text>
</view> </view>
</view> </view>
</up-sticky> </up-sticky>
@ -50,8 +48,6 @@
</up-transition> </up-transition>
</view> </view>
</view> </view>
<up-calendar :show="calendarShow" @confirm="calendarConfirm" @close="calendarShow=false"
:closeOnClickOverlay="true" mode="range"></up-calendar>
</template> </template>
@ -80,7 +76,7 @@
const calendarConfirm = (e) => { const calendarConfirm = (e) => {
where.value.start_time = e[0]; where.value.start_time = e[0];
where.value.end_time = e[(e.length)-1]; where.value.end_time = e[1];
goodsList1.value=[] goodsList1.value=[]
getGoodsList() getGoodsList()
calendarShow.value = false calendarShow.value = false

View File

@ -2,14 +2,12 @@
<view style="background-color: #ffffff;"> <view style="background-color: #ffffff;">
<up-sticky offset-top="0" style="background-color: #ffffff;"> <up-sticky offset-top="0" style="background-color: #ffffff;">
<view class="navbar"> <view class="navbar">
<view style="width: 580rpx;"> <view style="width:55%;">
<up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword" <up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword"
:showAction="false"></up-search> :showAction="false"></up-search>
</view> </view>
<view class="nav-item" @click="calendarShow=true"> <view style="width:45%;padding-left: 10rpx;">
<up-icon name="calendar" color="#2979ff" size="28"></up-icon> <uni-datetime-picker v-model="range" type="date" @change="calendarConfirm" />
<text>筛选日期</text>
</view> </view>
</view> </view>
</up-sticky> </up-sticky>
@ -50,7 +48,7 @@
<up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line> <up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line>
</up-list-item> </up-list-item>
</up-list> </up-list>
<up-empty @click='test2' v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> <up-empty v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</up-empty> </up-empty>
</up-transition> </up-transition>
<up-modal :show="show" title="采购确认" showCancelButton @cancel="show=false" @confirm="offerUpdate()"> <up-modal :show="show" title="采购确认" showCancelButton @cancel="show=false" @confirm="offerUpdate()">
@ -72,9 +70,6 @@
</view> </view>
</view> </view>
<up-calendar :show="calendarShow" @confirm="calendarConfirm" @close="calendarShow=false"
:closeOnClickOverlay="true"></up-calendar>
</template> </template>
@ -91,18 +86,13 @@
SystemStoreStorageLists, SystemStoreStorageLists,
} from "@/api/system_store_storage.js" } from "@/api/system_store_storage.js"
const test2 = () => {
console.log("点解")
uni.navigateTo({
url: '/pages/index/index'
})
}
const show = ref(false) const show = ref(false)
const dates=ref(timeFrom(new Date()))
const where = ref({ const where = ref({
store_name: '', store_name: '',
page_no: 1, page_no: 1,
start_time: timeFrom(new Date()), start_time: dates.value,
end_time: timeFrom(new Date()) end_time: dates.value
}) })
const calendarShow = ref(false) const calendarShow = ref(false)
const formData = ref({ const formData = ref({
@ -114,9 +104,9 @@
'total_price': '' 'total_price': ''
}) })
const calendarConfirm = (e) => { const calendarConfirm = (e) => {
where.value.start_time = e[0]; where.value.start_time = e;
where.value.end_time = e[0]; where.value.end_time = e;
goodsList1.value=[] goodsList1.value = []
getGoodsList() getGoodsList()
calendarShow.value = false calendarShow.value = false
} }
@ -158,7 +148,7 @@
const searchKeyword = () => { const searchKeyword = () => {
where.value.store_name = keyword.value; where.value.store_name = keyword.value;
goodsList1.value=[] goodsList1.value = []
getGoodsList(); getGoodsList();
} }
const scrolltolower = () => { const scrolltolower = () => {

View File

@ -2,14 +2,12 @@
<view style="background-color: #ffffff;"> <view style="background-color: #ffffff;">
<up-sticky offset-top="0" style="background-color: #ffffff;"> <up-sticky offset-top="0" style="background-color: #ffffff;">
<view class="navbar"> <view class="navbar">
<view style="width: 580rpx;"> <view style="width:35%;">
<up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword" <up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword"
:showAction="false"></up-search> :showAction="false"></up-search>
</view> </view>
<view class="nav-item" @click="calendarShow=true"> <view style="width:65%;padding-left: 10rpx;">
<up-icon name="calendar" color="#2979ff" size="28"></up-icon> <uni-datetime-picker v-model="range" type="daterange" @change="calendarConfirm" />
<text>筛选日期</text>
</view> </view>
</view> </view>
</up-sticky> </up-sticky>
@ -50,8 +48,6 @@
</up-transition> </up-transition>
</view> </view>
</view> </view>
<up-calendar :show="calendarShow" @confirm="calendarConfirm" @close="calendarShow=false"
:closeOnClickOverlay="true" :min-date="min_date" monthNum="13" mode="range"></up-calendar>
</template> </template>
@ -87,7 +83,7 @@
const calendarConfirm = (e) => { const calendarConfirm = (e) => {
where.value.start_time = e[0]; where.value.start_time = e[0];
where.value.end_time = e[(e.length)-1]; where.value.end_time = e[1];
goodsList1.value = [] goodsList1.value = []
getGoodsList() getGoodsList()
calendarShow.value = false calendarShow.value = false

View File

@ -2,14 +2,12 @@
<view style="background-color: #ffffff;"> <view style="background-color: #ffffff;">
<up-sticky offset-top="0" style="background-color: #ffffff;"> <up-sticky offset-top="0" style="background-color: #ffffff;">
<view class="navbar"> <view class="navbar">
<view style="width: 580rpx;"> <view style="width:55%;">
<up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword" <up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword"
:showAction="false"></up-search> :showAction="false"></up-search>
</view> </view>
<view class="nav-item" @click="calendarShow=true"> <view style="width:45%;padding-left: 10rpx;">
<up-icon name="calendar" color="#2979ff" size="28"></up-icon> <uni-datetime-picker v-model="range" type="date" @change="calendarConfirm" />
<text>筛选日期</text>
</view> </view>
</view> </view>
</up-sticky> </up-sticky>
@ -50,9 +48,6 @@
</up-transition> </up-transition>
</view> </view>
</view> </view>
<up-calendar :show="calendarShow" @confirm="calendarConfirm" @close="calendarShow=false"
:closeOnClickOverlay="true" :min-date="min_date" monthNum="13"></up-calendar>
</template> </template>
@ -86,8 +81,8 @@
const calendarShow = ref(false) const calendarShow = ref(false)
const calendarConfirm = (e) => { const calendarConfirm = (e) => {
where.value.start_time = e[0]; where.value.start_time = e;
where.value.end_time = e[0]; where.value.end_time = e;
goodsList1.value = [] goodsList1.value = []
getGoodsList() getGoodsList()
calendarShow.value = false calendarShow.value = false

View File

@ -2,18 +2,36 @@
<view style="background-color: #fff;"> <view style="background-color: #fff;">
<up-row customStyle="margin-bottom: 10px;"> <up-row customStyle="margin-bottom: 10px;">
<up-col span="6"> <up-col span="6">
<view style="padding: 40rpx;"> <view style="padding: 30rpx 40rpx 0 40rpx;">
<up-count-to :startVal="30" :endVal="500.03" fontSize="40" decimals="2"></up-count-to> <up-count-to :startVal="30" :endVal="500.03" fontSize="40" decimals="2"></up-count-to>
<view style="padding: 20rpx;">累计铺货金额</view> <view style="padding: 20rpx;">累计铺货金额</view>
</view> </view>
</up-col> </up-col>
<up-col span="6"> <up-col span="6">
<view style="padding: 40rpx;"> <view style="padding: 30rpx 40rpx 0 40rpx;">
<up-count-to :startVal="30" :endVal="500.03" fontSize="40" decimals="2"></up-count-to> <up-count-to :startVal="30" :endVal="500.03" fontSize="40" decimals="2"></up-count-to>
<view style="padding: 20rpx;">累计销售金额</view> <view style="padding: 20rpx;">累计销售金额</view>
</view> </view>
</up-col> </up-col>
</up-row> </up-row>
<up-row customStyle="margin-bottom: 10px;">
<up-col span="6">
<view style="padding: 30rpx 40rpx 0 40rpx;">
<up-count-to :startVal="30" :endVal="500.03" fontSize="40" decimals="2"></up-count-to>
<view style="padding: 20rpx;">总支出</view>
</view>
</up-col>
<up-col span="6">
<view style="padding: 30rpx 40rpx 0 40rpx;">
<up-count-to :startVal="30" :endVal="500.03" fontSize="40" decimals="2"></up-count-to>
<view style="padding: 20rpx;">利润</view>
</view>
</up-col>
</up-row>
<view>
<span style="font-size: 20px;padding: 10rpx;">支出明细</span>
<up-divider></up-divider>
</view>
<qiun-data-charts type="column" :opts="opts" :chartData="chartData" /> <qiun-data-charts type="column" :opts="opts" :chartData="chartData" />
</view> </view>
</template> </template>
@ -62,9 +80,17 @@
data: [18] data: [18]
}, },
{ {
name: "佣金", name: "村长",
data: [18] data: [8]
} },
{
name: "队长",
data: [16]
},
{
name: "厨师",
data: [18]
}
] ]
}) })
</script> </script>

View File

@ -1,3 +1,5 @@
## 2.2.352024-09-21
- 修复 没有选中日期时点击确定直接报错的Bug [详情](https://ask.dcloud.net.cn/question/198168)
## 2.2.342024-04-24 ## 2.2.342024-04-24
- 新增 日期点击事件,在点击日期时会触发该事件。 - 新增 日期点击事件,在点击日期时会触发该事件。
## 2.2.332024-04-15 ## 2.2.332024-04-15

View File

@ -698,11 +698,11 @@
startString = getDateTime(this.start, this.hideSecond) startString = getDateTime(this.start, this.hideSecond)
} }
[startDate, startTime] = startString.split(' ') [startDate, startTime] = startString.split(' ')
if (this.start && !dateCompare(this.start, this.tempRange.startDate)) { if (this.start && !dateCompare(this.start, `${this.tempRange.startDate} ${this.tempRange.startTime}`)) {
startDateLaterRangeStartDate = true startDateLaterRangeStartDate = true
this.tempRange.startDate = startDate this.tempRange.startDate = startDate
} }
if (this.start && !dateCompare(this.start, this.tempRange.endDate)) { if (this.start && !dateCompare(this.start, `${this.tempRange.endDate} ${this.tempRange.endTime}`)) {
startDateLaterRangeEndDate = true startDateLaterRangeEndDate = true
this.tempRange.endDate = startDate this.tempRange.endDate = startDate
} }
@ -717,11 +717,11 @@
} }
[endDate, endTime] = endString.split(' ') [endDate, endTime] = endString.split(' ')
if (this.end && !dateCompare(this.tempRange.startDate, this.end)) { if (this.end && !dateCompare(`${this.tempRange.startDate} ${this.tempRange.startTime}`, this.end)) {
endDateEarlierRangeStartDate = true endDateEarlierRangeStartDate = true
this.tempRange.startDate = endDate this.tempRange.startDate = endDate
} }
if (this.end && !dateCompare(this.tempRange.endDate, this.end)) { if (this.end && !dateCompare(`${this.tempRange.endDate} ${this.tempRange.endTime}`, this.end)) {
endDateEarlierRangeEndDate = true endDateEarlierRangeEndDate = true
this.tempRange.endDate = endDate this.tempRange.endDate = endDate
} }

View File

@ -182,8 +182,8 @@ class Calendar {
if (!date) { if (!date) {
date = new Date() date = new Date()
} }
const res = this.calendar.find(item => item.fullDate === this.getDateObj(date).fullDate)
return this.calendar.find(item => item.fullDate === this.getDateObj(date).fullDate) return res ? res : this.getDateObj(date)
} }
/** /**

View File

@ -1,7 +1,7 @@
{ {
"id": "uni-datetime-picker", "id": "uni-datetime-picker",
"displayName": "uni-datetime-picker 日期选择器", "displayName": "uni-datetime-picker 日期选择器",
"version": "2.2.34", "version": "2.2.35",
"description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择", "description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择",
"keywords": [ "keywords": [
"uni-datetime-picker", "uni-datetime-picker",