纸板小程序:订单/送货单:列表与详情功能
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
.page-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
background: #ebebeb;
|
||||
// background: linear-gradient( 135deg, #ca7d79 0%, #c5140a 30%, #c5140a 50%, #ca7d79 100%);
|
||||
}
|
||||
.sreach_module {
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx;
|
||||
background-color: #ffffff;
|
||||
// border-radius: 15rpx;
|
||||
// border-bottom: 1px solid #c5140a;
|
||||
// padding: ;
|
||||
.sreach_input_warp {
|
||||
width: 100%;
|
||||
.input_view {
|
||||
width: 100%;
|
||||
.t-input {
|
||||
border: 1px solid #ffffff;
|
||||
transition: all .5s;
|
||||
}
|
||||
}
|
||||
.custon_status {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 60rpx;
|
||||
overflow: hidden;
|
||||
.custom_view {
|
||||
color: #c5140a;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 20rpx;
|
||||
// font-weight: bold;
|
||||
.custom_name {
|
||||
margin-left: 10rpx;
|
||||
.t-dropdown-menu__title {
|
||||
color: #c5140a !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.status_view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.status_name {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
// font-weight: bold;
|
||||
// color: #c5140a;
|
||||
}
|
||||
}
|
||||
.date {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.date_item {
|
||||
display: flex;
|
||||
width: 48%;
|
||||
.date_label {
|
||||
min-width: 30%;
|
||||
font-size: 26rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.date_input {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
// .custom_view {
|
||||
// width: 19%;
|
||||
// }
|
||||
// .status_view {
|
||||
// width: 19%;
|
||||
// }
|
||||
}
|
||||
}
|
||||
.show_btn {
|
||||
width: 120rpx;
|
||||
font-size: 22rpx;
|
||||
color: #ffffff;
|
||||
background-color: #c5140a;
|
||||
border-radius: 15rpx;
|
||||
margin: 15rpx 0 0 20rpx;
|
||||
height: 46rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all .5s;
|
||||
}
|
||||
.show_btn_hide {
|
||||
opacity: 0;
|
||||
height: 0;
|
||||
padding: 0;
|
||||
margin: 0 0 0 20rpx;
|
||||
overflow: hidden;
|
||||
transition: all .5s;
|
||||
}
|
||||
.count {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
margin-top: 15rpx;
|
||||
border-radius: 15rpx;
|
||||
background-color: #ffffff;
|
||||
// display: flex;
|
||||
// justify-content: space-between;
|
||||
text-align: center;
|
||||
// padding: 10rpx 0;
|
||||
height: 204rpx;
|
||||
position: relative;
|
||||
transition: all .5s;
|
||||
.hide_btn {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
writing-mode: vertical-rl;
|
||||
text-orientation: upright;
|
||||
font-size: 22rpx;
|
||||
padding: 8rpx 6rpx;
|
||||
color: #ffffff;
|
||||
background-color: #c5140a;
|
||||
border-radius: 0 15rpx 0 15rpx;
|
||||
}
|
||||
.stock,.poduce {
|
||||
width: 50%;
|
||||
.title {
|
||||
font-weight: bold;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.value {
|
||||
font-size: 28rpx;
|
||||
color: #c5140a;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
}
|
||||
.value {
|
||||
height: 38.4rpx;
|
||||
}
|
||||
}
|
||||
.hide_count_view {
|
||||
opacity: 0;
|
||||
height: 0;
|
||||
padding: 0;
|
||||
margin: 0 0 0 20rpx;
|
||||
overflow: hidden;
|
||||
transition: all .5s;
|
||||
}
|
||||
.content_warp {
|
||||
height: 100%;
|
||||
// margin-top: 10rpx;
|
||||
.data_list {
|
||||
width: 100%;
|
||||
// height: calc(100vh - 665rpx);
|
||||
margin-top: 15rpx;
|
||||
transition: all .5s;
|
||||
// background-color: #c5140a;
|
||||
.data_item {
|
||||
width: 95%;
|
||||
box-sizing: border-box;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 15rpx;
|
||||
border-radius: 15rpx;
|
||||
background-color: #ffffff;
|
||||
padding: 20rpx;
|
||||
font-size: 26rpx;
|
||||
position: relative;
|
||||
.item_code {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
.status {
|
||||
font-size: 26rpx;
|
||||
padding: 10rpx 25rpx;
|
||||
border-radius: 0 15rpx 0 15rpx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
// color: #c5130a20;
|
||||
}
|
||||
}
|
||||
.item_material {
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
.item_details {
|
||||
text {
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
}
|
||||
.time {
|
||||
text-align: right;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.input_view .t-icon-base {
|
||||
color: #9da4b0;
|
||||
transition: all .5s;
|
||||
}
|
||||
.t-input__wrap {
|
||||
position: relative;
|
||||
right: 2%;
|
||||
}
|
||||
.input_focus {
|
||||
border: 1px solid #c5140a !important;
|
||||
transition: all .5s !important;
|
||||
.t-icon-base {
|
||||
color: #c5140a !important;
|
||||
transition: all .5s;
|
||||
}
|
||||
}
|
||||
.t-dropdown-menu__item--active {
|
||||
color: #c5140a !important;
|
||||
}
|
||||
.t-radio__icon--checked {
|
||||
color: #c5140a !important;
|
||||
}
|
||||
.t-dropdown-menu::after {
|
||||
background: #ffffff !important;
|
||||
}
|
||||
.not_data {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-top: 150rpx;
|
||||
.text {
|
||||
color: #c5140a;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
.custom_name_drop {
|
||||
.t-icon-base {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
// utils/app.ts.ts
|
||||
import { getMonthDay } from '../../utils/util'
|
||||
import { getCardBoardOrderDeliveryList } from '../../api/index'
|
||||
import { getAppInstance } from '../../utils/app';
|
||||
const app = getAppInstance();
|
||||
|
||||
// const userInfo = wx.getStorageSync('userInfo');
|
||||
// const devicecode = wx.getStorageSync('devicecode');
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
date_field: '',
|
||||
s_date: '',
|
||||
e_date: '',
|
||||
search_input_focus: false,
|
||||
customerId: 0,
|
||||
searchTxt: '',
|
||||
sDateVisible: false,
|
||||
startDate: '',
|
||||
list: [],
|
||||
showCount: true,
|
||||
totalData: {},
|
||||
customerList: [],
|
||||
pageNumber: 1, // 当前页码
|
||||
pageSize: 20, // 每页数量
|
||||
hasMore: true, // 是否还有更多数据
|
||||
loading: false, // 是否正在加载(防止重复请求)
|
||||
isCust: false //是否为客户账号,限制仅可查看本身的订单
|
||||
},
|
||||
hideCount() {
|
||||
this.setData({
|
||||
showCount: false
|
||||
})
|
||||
},
|
||||
showCount() {
|
||||
this.setData({
|
||||
showCount: true
|
||||
})
|
||||
},
|
||||
// 触底事件
|
||||
onScrollToLower() {
|
||||
// 防止重复加载 & 无更多数据
|
||||
if (this.data.loading || !this.data.hasMore) return
|
||||
|
||||
this.setData({ loading: true,pageNumber: this.data.pageNumber + 1 })
|
||||
wx.nextTick(() => {
|
||||
this.getOrderList(true);
|
||||
})
|
||||
},
|
||||
// 跳转订单详情
|
||||
toOrderDetail(e) {
|
||||
const id = e.currentTarget.dataset.id;
|
||||
wx.navigateTo({
|
||||
url: `/pages/cardBoardOrderDeliveryDetail/cardBoardOrderDeliveryDetail?id=${id}`
|
||||
})
|
||||
},
|
||||
// 日期相关
|
||||
showPicker(e) {
|
||||
const field = e.currentTarget.dataset.field;
|
||||
this.setData({ sDateVisible: true, date_field: field });
|
||||
},
|
||||
onCancel() {
|
||||
this.setData({ sDateVisible: false });
|
||||
},
|
||||
// 选择日期
|
||||
onConfirm(e) {
|
||||
const { value } = e.detail;
|
||||
this.setData({ [this.data.date_field]: value,sDateVisible: false });
|
||||
this.getOrderList(false);
|
||||
},
|
||||
// 关键词搜索
|
||||
handleSearchTxtChange(e) {
|
||||
const { value } = e.detail;
|
||||
this.setData({ searchTxt: value });
|
||||
},
|
||||
// 切换客户
|
||||
onCustChange(e) {
|
||||
this.setData({
|
||||
customerId: e.detail.value,
|
||||
});
|
||||
this.getOrderList(false);
|
||||
},
|
||||
// 搜索输入框焦点事件
|
||||
inputFocus() {
|
||||
this.setData({
|
||||
search_input_focus: true
|
||||
})
|
||||
},
|
||||
inputBlur() {
|
||||
this.setData({
|
||||
search_input_focus: false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad() {
|
||||
const days = getMonthDay();
|
||||
const userInfo = wx.getStorageSync('userInfo');
|
||||
this.setData({
|
||||
s_date: days[0],
|
||||
e_date: days[1],
|
||||
customerId: userInfo.custid?userInfo.custid:0,
|
||||
customerList: app.globalData.customerList,
|
||||
date_field: 's_date',
|
||||
isCust: userInfo.custid?true:false,
|
||||
})
|
||||
this.getOrderList(false);
|
||||
|
||||
},
|
||||
|
||||
async getOrderList(isLoadMore: Boolean) {
|
||||
try {
|
||||
wx.showLoading({ title: '加载中' });
|
||||
const { searchTxt, pageNumber, pageSize, s_date, e_date, customerId }= this.data;
|
||||
const filterStr = {};
|
||||
if (s_date || e_date) {
|
||||
filterStr.createtime = [(s_date?'#>=#' + s_date:''),(e_date?'#<=#' + e_date:'')]
|
||||
}
|
||||
if (customerId) {
|
||||
filterStr.custid = '#IN#' + customerId;
|
||||
}
|
||||
const params = {
|
||||
pageNumber,
|
||||
pageSize,
|
||||
searchTxt,
|
||||
screenStr: JSON.stringify(filterStr)
|
||||
};
|
||||
const res = await getCardBoardOrderDeliveryList(params).catch( () => {});
|
||||
if (res.statusCode === 200) {
|
||||
const dataList = res.data.list.map( item => {
|
||||
item.createtime = item.createtime.replace('T', ' ');
|
||||
if (item.custcode) {
|
||||
const obj = app.globalData.customerList.find( item2 => item2.code == item.custcode);
|
||||
item.customName = obj?obj.name:'';
|
||||
}
|
||||
if (item.listDetail) {
|
||||
item.totalSquaNum = item.listDetail.reduce((total,obj) => total + ((obj.wide * obj.long / 10000) * obj.num),0)?.toFixed(2);
|
||||
}
|
||||
if (item.delitime) {
|
||||
item.delitime = item.delitime.split('T').join(' ');
|
||||
}
|
||||
|
||||
return item;
|
||||
})
|
||||
let totalData = res.data.totalData;
|
||||
for (const key in totalData) {
|
||||
const val = totalData[key];
|
||||
// 是数字 且 不是整数(有小数点)
|
||||
if (typeof val === 'number' && !Number.isInteger(val)) {
|
||||
totalData[key] = val.toFixed(2); // 字符串类型,如 "3.14"
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
hasMore: this.data.list.length + this.data.pageSize >= res.data.searchListResourceParamaters.total?false:true,
|
||||
loading: false,
|
||||
list: isLoadMore == true?[...this.data.list,...dataList]: dataList,
|
||||
totalData: res.data.totalData || {}
|
||||
});
|
||||
} else {
|
||||
wx.showToast({ title: '数据加载失败', icon: 'none' });
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
wx.showToast({ title: '系统错误', icon: 'none' });
|
||||
} finally {
|
||||
wx.hideLoading();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,141 @@
|
||||
<!--index.wxml-->
|
||||
<navigation-bar title="纸板送货单" back="{{false}}" color="white" background="#c5140a"></navigation-bar>
|
||||
<view class="page-container">
|
||||
<view class="sreach_module">
|
||||
<view class="sreach_input_warp">
|
||||
<!-- <view class="input_view">
|
||||
<t-input
|
||||
class="{{search_input_focus?'input_focus':''}}"
|
||||
0 value="{{searchTxt}}"
|
||||
placeholder-style="color: #9da4b0"
|
||||
placeholder="纸质/切长/备注"
|
||||
bind:change="handleSearchTxtChange"
|
||||
cursor-spacing="30"
|
||||
prefixIcon="search"
|
||||
bind:focus="inputFocus"
|
||||
bind:blur="inputBlur"
|
||||
style="border-radius: 200rpx;height: 25rpx;background-color: #f9fafb;padding-right: 20rpx;border: 1px solid #ffffff;"
|
||||
>
|
||||
<t-button bind:tap="getOrderList" slot="extra" theme="danger" size="extra-small" style="background-color: #c5140a; border-radius: 200px;width: 120rpx;"> 搜索 </t-button>
|
||||
</t-input>
|
||||
</view> -->
|
||||
<view class="custon_status">
|
||||
<view class="custom_view">
|
||||
<t-icon name="user-business-filled" size="40rpx" style="color: #c5140a; position: relative; left: 10rpx;"></t-icon>
|
||||
<view class="custom_name">
|
||||
<t-dropdown-menu class="{{isCust?'custom_name_drop':''}}">
|
||||
<t-dropdown-item
|
||||
options="{{customerList}}"
|
||||
placement="right"
|
||||
disabled="{{isCust}}"
|
||||
value="{{customerId}}"
|
||||
bindchange="onCustChange"
|
||||
/>
|
||||
</t-dropdown-menu>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="status_view">
|
||||
<t-dropdown-menu>
|
||||
<t-dropdown-item options="{{statusOptions}}" placement="right" value="{{status}}" bindchange="onChange" />
|
||||
</t-dropdown-menu>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="date">
|
||||
<view class="date_s date_item">
|
||||
<view class="date_label">起始日期</view>
|
||||
<view class="date_input">
|
||||
<t-input
|
||||
value="{{s_date}}"
|
||||
data-field="s_date"
|
||||
placeholder-style="color: #b7b7b7;font-size: 26rpx;"
|
||||
placeholder="请选择日期"
|
||||
cursor-spacing="30"
|
||||
readonly="{{true}}"
|
||||
bind:tap="showPicker"
|
||||
style="border-radius: 20rpx;height: 20rpx;background-color: #f9fafb;padding: 20rpx 30rpx;"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="date_e date_item">
|
||||
<view class="date_label">终止日期</view>
|
||||
<view class="date_input">
|
||||
<t-input
|
||||
value="{{e_date}}"
|
||||
data-field="e_date"
|
||||
placeholder-style="color: #b7b7b7;font-size: 26rpx;"
|
||||
placeholder="请选择日期"
|
||||
cursor-spacing="30"
|
||||
readonly="{{true}}"
|
||||
bind:tap="showPicker"
|
||||
style="border-radius: 20rpx;height: 20rpx;background-color: #f9fafb;padding: 20rpx 30rpx;"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="show_btn {{showCount?'show_btn_hide':''}}" bind:tap="showCount">显示统计</view>
|
||||
<view class="count {{showCount?'':'hide_count_view'}}">
|
||||
<view style="display: flex;justify-content: space-between;padding-top: 10rpx;">
|
||||
<view class="stock">
|
||||
<view class="title">总数量</view>
|
||||
<view class="value">{{totalData.TotalNum}}</view>
|
||||
</view>
|
||||
<view class="stock">
|
||||
<view class="title">总价格</view>
|
||||
<view class="value">{{totalData.TotalMoney}}</view>
|
||||
</view>
|
||||
<view class="stock">
|
||||
<view class="title">总单数</view>
|
||||
<view class="value">{{totalData.TotalOrderNum}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;justify-content: center; margin-top: 20rpx;">
|
||||
<view class="poduce">
|
||||
<view class="title">总面积</view>
|
||||
<view class="value">{{totalData.TotalSquaNum}}㎡</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hide_btn" bind:tap="hideCount">隐藏</view>
|
||||
</view>
|
||||
<view class="content_warp">
|
||||
<scroll-view class="data_list" style="height: {{showCount?'calc(100vh - 580rpx);':'calc(100vh - 420rpx);'}}"
|
||||
scroll-y="{{list.length != 0}}" bindscrolltolower="onScrollToLower" lower-threshold="100">
|
||||
<view class="data_item" wx:for="{{list}}" wx:key="id" data-id="{{item.id}}" bind:tap="toOrderDetail">
|
||||
<view class="item_code">
|
||||
<view class="code">
|
||||
{{'订单编号:'+item.code}}
|
||||
</view>
|
||||
<view class="cutomer">
|
||||
{{item.customName}}
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;justify-content: space-between;align-items: center;margin: 20rpx 0;">
|
||||
<view class="item_material" style="min-width: 25%;max-width: 25%">{{'总数量:' + item.totalnum}}</view>
|
||||
<view class="item_spec" style="min-width: 35%;max-width: 35%">{{'总平方数:' + item.totalSquaNum}}</view>
|
||||
<view class="item_line" style="min-width: 35%;max-width: 35%">{{'总金额:' }}<text style="color: #c5140a;">{{item.totalmoney}}</text></view>
|
||||
</view>
|
||||
<view class="remark">{{'备注:' + item.remark}}</view>
|
||||
<view class="time">{{item.delitime}}</view>
|
||||
</view>
|
||||
<view class="not_data" wx:if="{{list.length == 0}}" >
|
||||
<image src="../../assets/images/not_data.png" mode="widthFix" style="width: 400rpx"/>
|
||||
<view class="text">暂无送货单数据</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="piker">
|
||||
<t-date-time-picker
|
||||
visible="{{sDateVisible}}"
|
||||
title=""
|
||||
value="{{date_field == 's_date'?s_date:e_date}}"
|
||||
mode="date"
|
||||
format="YYYY-MM-DD"
|
||||
bindconfirm="onConfirm"
|
||||
bindcancel="onCancel"
|
||||
confirm-btn="确认"
|
||||
cancel-btn="取消"
|
||||
start="{{'1900-01-01'}}"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
.page-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
background: #ebebeb;
|
||||
// background: linear-gradient( 135deg, #ca7d79 0%, #c5140a 30%, #c5140a 50%, #ca7d79 100%);
|
||||
}
|
||||
.sreach_module {
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx;
|
||||
background-color: #ffffff;
|
||||
// border-radius: 15rpx;
|
||||
// border-bottom: 1px solid #c5140a;
|
||||
// padding: ;
|
||||
.sreach_input_warp {
|
||||
width: 100%;
|
||||
.input_view {
|
||||
width: 100%;
|
||||
.t-input {
|
||||
border: 1px solid #ffffff;
|
||||
transition: all .5s;
|
||||
}
|
||||
}
|
||||
.custon_status {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 60rpx;
|
||||
overflow: hidden;
|
||||
.custom_view {
|
||||
color: #c5140a;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 20rpx;
|
||||
// font-weight: bold;
|
||||
.custom_name {
|
||||
margin-left: 10rpx;
|
||||
.t-dropdown-menu__title {
|
||||
color: #c5140a !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.status_view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.status_name {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
// font-weight: bold;
|
||||
// color: #c5140a;
|
||||
}
|
||||
}
|
||||
.date {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.date_item {
|
||||
display: flex;
|
||||
width: 48%;
|
||||
.date_label {
|
||||
min-width: 30%;
|
||||
font-size: 26rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.date_input {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
// .custom_view {
|
||||
// width: 19%;
|
||||
// }
|
||||
// .status_view {
|
||||
// width: 19%;
|
||||
// }
|
||||
}
|
||||
}
|
||||
.show_btn {
|
||||
width: 120rpx;
|
||||
font-size: 22rpx;
|
||||
color: #ffffff;
|
||||
background-color: #c5140a;
|
||||
border-radius: 15rpx;
|
||||
margin: 15rpx 0 0 20rpx;
|
||||
height: 46rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all .5s;
|
||||
}
|
||||
.show_btn_hide {
|
||||
opacity: 0;
|
||||
height: 0;
|
||||
padding: 0;
|
||||
margin: 0 0 0 20rpx;
|
||||
overflow: hidden;
|
||||
transition: all .5s;
|
||||
}
|
||||
.count {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
margin-top: 15rpx;
|
||||
border-radius: 15rpx;
|
||||
background-color: #ffffff;
|
||||
// display: flex;
|
||||
// justify-content: space-between;
|
||||
text-align: center;
|
||||
// padding: 10rpx 0;
|
||||
height: 204rpx;
|
||||
position: relative;
|
||||
transition: all .5s;
|
||||
.hide_btn {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
writing-mode: vertical-rl;
|
||||
text-orientation: upright;
|
||||
font-size: 22rpx;
|
||||
padding: 8rpx 6rpx;
|
||||
color: #ffffff;
|
||||
background-color: #c5140a;
|
||||
border-radius: 0 15rpx 0 15rpx;
|
||||
}
|
||||
.stock,.poduce {
|
||||
width: 50%;
|
||||
.title {
|
||||
font-weight: bold;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.value {
|
||||
font-size: 28rpx;
|
||||
color: #c5140a;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
}
|
||||
.value {
|
||||
height: 38.4rpx;
|
||||
}
|
||||
}
|
||||
.hide_count_view {
|
||||
opacity: 0;
|
||||
height: 0;
|
||||
padding: 0;
|
||||
margin: 0 0 0 20rpx;
|
||||
overflow: hidden;
|
||||
transition: all .5s;
|
||||
}
|
||||
.content_warp {
|
||||
height: 100%;
|
||||
// margin-top: 10rpx;
|
||||
.data_list {
|
||||
width: 100%;
|
||||
// height: calc(100vh - 665rpx);
|
||||
margin-top: 15rpx;
|
||||
transition: all .5s;
|
||||
// background-color: #c5140a;
|
||||
.data_item {
|
||||
width: 95%;
|
||||
box-sizing: border-box;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 15rpx;
|
||||
border-radius: 15rpx;
|
||||
background-color: #ffffff;
|
||||
padding: 20rpx;
|
||||
font-size: 26rpx;
|
||||
position: relative;
|
||||
.item_code {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
.code {
|
||||
font-weight: bold;
|
||||
}
|
||||
.status {
|
||||
font-size: 26rpx;
|
||||
padding: 10rpx 25rpx;
|
||||
border-radius: 0 15rpx 0 15rpx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
// color: #c5130a20;
|
||||
}
|
||||
}
|
||||
.item_material {
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
.item_details {
|
||||
text {
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
}
|
||||
.time {
|
||||
text-align: right;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.input_view .t-icon-base {
|
||||
color: #9da4b0;
|
||||
transition: all .5s;
|
||||
}
|
||||
.t-input__wrap {
|
||||
position: relative;
|
||||
right: 2%;
|
||||
}
|
||||
.input_focus {
|
||||
border: 1px solid #c5140a !important;
|
||||
transition: all .5s !important;
|
||||
.t-icon-base {
|
||||
color: #c5140a !important;
|
||||
transition: all .5s;
|
||||
}
|
||||
}
|
||||
.t-dropdown-menu__item--active {
|
||||
color: #c5140a !important;
|
||||
}
|
||||
.t-radio__icon--checked {
|
||||
color: #c5140a !important;
|
||||
}
|
||||
.t-dropdown-menu::after {
|
||||
background: #ffffff !important;
|
||||
}
|
||||
.not_data {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-top: 150rpx;
|
||||
.text {
|
||||
color: #c5140a;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
.custom_name_drop {
|
||||
.t-icon-base {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
// utils/app.ts.ts
|
||||
import { getMonthDay } from '../../utils/util'
|
||||
import { getCardBoardOrderList } from '../../api/index'
|
||||
import { getAppInstance } from '../../utils/app';
|
||||
const app = getAppInstance();
|
||||
|
||||
// const userInfo = wx.getStorageSync('userInfo');
|
||||
// const devicecode = wx.getStorageSync('devicecode');
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
date_field: '',
|
||||
s_date: '',
|
||||
e_date: '',
|
||||
search_input_focus: false,
|
||||
status: '全状态',
|
||||
customerId: 0,
|
||||
searchTxt: '',
|
||||
statusOptions: [
|
||||
{
|
||||
label: '全状态',
|
||||
value: '全状态'
|
||||
},
|
||||
{
|
||||
label: '未复核',
|
||||
value: '未复核'
|
||||
},
|
||||
{
|
||||
label: '已复核',
|
||||
value: '已复核'
|
||||
},
|
||||
{
|
||||
label: '审核中',
|
||||
value: '审核中'
|
||||
},
|
||||
{
|
||||
label: '已终审',
|
||||
value: '已终审'
|
||||
},
|
||||
{
|
||||
label: '已排程',
|
||||
value: '已排程'
|
||||
},
|
||||
{
|
||||
label: '已生产',
|
||||
value: '已生产'
|
||||
},
|
||||
{
|
||||
label: '已入库',
|
||||
value: '已入库'
|
||||
},
|
||||
{
|
||||
label: '已发货',
|
||||
value: '已发货'
|
||||
},
|
||||
{
|
||||
label: '已作废',
|
||||
value: '已作废'
|
||||
},
|
||||
],
|
||||
statusColorMap: {
|
||||
},
|
||||
sDateVisible: false,
|
||||
startDate: '',
|
||||
list: [],
|
||||
showCount: true,
|
||||
totalData: {},
|
||||
customerList: [],
|
||||
pageNumber: 1, // 当前页码
|
||||
pageSize: 20, // 每页数量
|
||||
hasMore: true, // 是否还有更多数据
|
||||
loading: false, // 是否正在加载(防止重复请求)
|
||||
isCust: false //是否为客户账号,限制仅可查看本身的订单
|
||||
},
|
||||
hideCount() {
|
||||
this.setData({
|
||||
showCount: false
|
||||
})
|
||||
},
|
||||
showCount() {
|
||||
this.setData({
|
||||
showCount: true
|
||||
})
|
||||
},
|
||||
// 触底事件
|
||||
onScrollToLower() {
|
||||
// 防止重复加载 & 无更多数据
|
||||
if (this.data.loading || !this.data.hasMore) return
|
||||
|
||||
this.setData({ loading: true,pageNumber: this.data.pageNumber + 1 })
|
||||
wx.nextTick(() => {
|
||||
this.getOrderList(true);
|
||||
})
|
||||
},
|
||||
// 跳转订单详情
|
||||
toOrderDetail(e) {
|
||||
const id = e.currentTarget.dataset.id;
|
||||
wx.navigateTo({
|
||||
url: `/pages/cardBoardOrderDetail/cardBoardOrderDetail?id=${id}`
|
||||
})
|
||||
},
|
||||
// 日期相关
|
||||
showPicker(e) {
|
||||
const field = e.currentTarget.dataset.field;
|
||||
this.setData({ sDateVisible: true, date_field: field });
|
||||
},
|
||||
onCancel() {
|
||||
this.setData({ sDateVisible: false });
|
||||
},
|
||||
// 选择日期
|
||||
onConfirm(e) {
|
||||
const { value } = e.detail;
|
||||
this.setData({ [this.data.date_field]: value,sDateVisible: false });
|
||||
},
|
||||
// 关键词搜索
|
||||
handleSearchTxtChange(e) {
|
||||
const { value } = e.detail;
|
||||
this.setData({ searchTxt: value });
|
||||
},
|
||||
// 切换状态
|
||||
onChange(e) {
|
||||
this.setData({
|
||||
status: e.detail.value,
|
||||
});
|
||||
this.getOrderList(false);
|
||||
},
|
||||
// 切换客户
|
||||
onCustChange(e) {
|
||||
this.setData({
|
||||
customerId: e.detail.value,
|
||||
});
|
||||
this.getOrderList(false);
|
||||
},
|
||||
// 搜索输入框焦点事件
|
||||
inputFocus() {
|
||||
this.setData({
|
||||
search_input_focus: true
|
||||
})
|
||||
},
|
||||
inputBlur() {
|
||||
this.setData({
|
||||
search_input_focus: false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad() {
|
||||
const days = getMonthDay();
|
||||
const userInfo = wx.getStorageSync('userInfo');
|
||||
this.setData({
|
||||
s_date: days[0],
|
||||
e_date: days[1],
|
||||
customerId: userInfo.custid?userInfo.custid:0,
|
||||
customerList: app.globalData.customerList,
|
||||
date_field: 's_date',
|
||||
isCust: userInfo.custid?true:false,
|
||||
statusColorMap: app.globalData.statusColorMap
|
||||
})
|
||||
this.getOrderList(false);
|
||||
|
||||
},
|
||||
|
||||
async getOrderList(isLoadMore: Boolean) {
|
||||
try {
|
||||
wx.showLoading({ title: '加载中' });
|
||||
const { searchTxt, pageNumber, pageSize, s_date, e_date, status, customerId }= this.data;
|
||||
const filterStr = {};
|
||||
if (s_date || e_date) {
|
||||
filterStr.createtime = [(s_date?'#>=#' + s_date:''),(e_date?'#<=#' + e_date:'')]
|
||||
}
|
||||
if (customerId) {
|
||||
filterStr.customerid = '#IN#' + customerId;
|
||||
}
|
||||
if (status && status != '全状态') {
|
||||
filterStr.productionstatus = '#IN#' + status;
|
||||
}
|
||||
const params = {
|
||||
pageNumber,
|
||||
pageSize,
|
||||
searchTxt,
|
||||
screenStr: JSON.stringify(filterStr)
|
||||
};
|
||||
const res = await getCardBoardOrderList(params).catch( () => {});
|
||||
console.log(res);
|
||||
// const res = await new Promise((resolve, reject) => {
|
||||
// wx.request({
|
||||
// url: 'https://yueyingkeji.twaycloud.com/api/WxAppCardBoardOrder',
|
||||
// method: 'GET',
|
||||
// header: {
|
||||
// Authorization: `${userInfo.id},${userInfo.accesstoken}`,
|
||||
// devicecode: devicecode
|
||||
// },
|
||||
// data: ,
|
||||
// success: resolve,
|
||||
// fail: reject
|
||||
// });
|
||||
// });
|
||||
if (res.statusCode === 200) {
|
||||
const dataList = res.data.list.map( item => {
|
||||
item.createtime = item.createtime.replace('T', ' ')
|
||||
return item;
|
||||
})
|
||||
let totalData = res.data.totalData;
|
||||
for (const key in totalData) {
|
||||
const val = totalData[key];
|
||||
// 是数字 且 不是整数(有小数点)
|
||||
if (typeof val === 'number' && !Number.isInteger(val)) {
|
||||
totalData[key] = val.toFixed(2); // 字符串类型,如 "3.14"
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
hasMore: this.data.list.length + this.data.pageSize >= res.data.searchListResourceParamaters.total?false:true,
|
||||
loading: false,
|
||||
list: isLoadMore == true?[...this.data.list,...dataList]: dataList,
|
||||
totalData: res.data.totalData || {}
|
||||
});
|
||||
} else {
|
||||
wx.showToast({ title: '数据加载失败', icon: 'none' });
|
||||
}
|
||||
} catch (err) {
|
||||
wx.showToast({ title: '系统错误', icon: 'none' });
|
||||
} finally {
|
||||
wx.hideLoading();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,148 @@
|
||||
<!--index.wxml-->
|
||||
<navigation-bar title="纸板订单" back="{{false}}" color="white" background="#c5140a"></navigation-bar>
|
||||
<view class="page-container">
|
||||
<view class="sreach_module">
|
||||
<view class="sreach_input_warp">
|
||||
<view class="input_view">
|
||||
<t-input
|
||||
class="{{search_input_focus?'input_focus':''}}"
|
||||
value="{{searchTxt}}"
|
||||
placeholder-style="color: #9da4b0"
|
||||
placeholder="纸质/切长/备注"
|
||||
bind:change="handleSearchTxtChange"
|
||||
cursor-spacing="30"
|
||||
prefixIcon="search"
|
||||
bind:focus="inputFocus"
|
||||
bind:blur="inputBlur"
|
||||
style="border-radius: 200rpx;height: 25rpx;background-color: #f9fafb;padding-right: 20rpx;border: 1px solid #ffffff;"
|
||||
>
|
||||
<t-button bind:tap="getOrderList" slot="extra" theme="danger" size="extra-small" style="background-color: #c5140a; border-radius: 200px;width: 120rpx;"> 搜索 </t-button>
|
||||
</t-input>
|
||||
</view>
|
||||
<view class="custon_status">
|
||||
<view class="custom_view">
|
||||
<t-icon name="user-business-filled" size="40rpx" style="color: #c5140a; position: relative; left: 10rpx;"></t-icon>
|
||||
<view class="custom_name">
|
||||
<t-dropdown-menu class="{{isCust?'custom_name_drop':''}}">
|
||||
<t-dropdown-item
|
||||
options="{{customerList}}"
|
||||
placement="right"
|
||||
disabled="{{isCust}}"
|
||||
value="{{customerId}}"
|
||||
bindchange="onCustChange"
|
||||
/>
|
||||
</t-dropdown-menu>
|
||||
</view>
|
||||
</view>
|
||||
<view class="status_view">
|
||||
<t-dropdown-menu>
|
||||
<t-dropdown-item options="{{statusOptions}}" placement="right" value="{{status}}" bindchange="onChange" />
|
||||
</t-dropdown-menu>
|
||||
</view>
|
||||
</view>
|
||||
<view class="date">
|
||||
<view class="date_s date_item">
|
||||
<view class="date_label">起始日期</view>
|
||||
<view class="date_input">
|
||||
<t-input
|
||||
value="{{s_date}}"
|
||||
data-field="s_date"
|
||||
placeholder-style="color: #b7b7b7;font-size: 26rpx;"
|
||||
placeholder="请选择日期"
|
||||
cursor-spacing="30"
|
||||
readonly="{{true}}"
|
||||
bind:tap="showPicker"
|
||||
style="border-radius: 20rpx;height: 20rpx;background-color: #f9fafb;padding: 20rpx 30rpx;"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="date_e date_item">
|
||||
<view class="date_label">终止日期</view>
|
||||
<view class="date_input">
|
||||
<t-input
|
||||
value="{{e_date}}"
|
||||
data-field="e_date"
|
||||
placeholder-style="color: #b7b7b7;font-size: 26rpx;"
|
||||
placeholder="请选择日期"
|
||||
cursor-spacing="30"
|
||||
readonly="{{true}}"
|
||||
bind:tap="showPicker"
|
||||
style="border-radius: 20rpx;height: 20rpx;background-color: #f9fafb;padding: 20rpx 30rpx;"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="show_btn {{showCount?'show_btn_hide':''}}" bind:tap="showCount">显示统计</view>
|
||||
<view class="count {{showCount?'':'hide_count_view'}}">
|
||||
<view style="display: flex;justify-content: space-between;padding-top: 10rpx;">
|
||||
<view class="stock">
|
||||
<view class="title">总数量</view>
|
||||
<view class="value">{{totalData.TotalNum}}</view>
|
||||
</view>
|
||||
<view class="stock">
|
||||
<view class="title">未入库</view>
|
||||
<view class="value">{{totalData.TotalUnNum}}</view>
|
||||
</view>
|
||||
<view class="stock">
|
||||
<view class="title">已入库</view>
|
||||
<view class="value">{{totalData.TotalInNum}}</view>
|
||||
</view>
|
||||
<view class="poduce">
|
||||
<view class="title">已送货</view>
|
||||
<view class="value">{{totalData.TotalDeliNum}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;justify-content: space-between; margin-top: 20rpx;">
|
||||
<view class="stock">
|
||||
<view class="title">总价格</view>
|
||||
<view class="value">{{totalData.TotalMoney}}</view>
|
||||
</view>
|
||||
<view class="poduce">
|
||||
<view class="title">总面积</view>
|
||||
<view class="value">{{totalData.TotalSquaNum}}㎡/{{totalData.TotalCubicVolume}}m³</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hide_btn" bind:tap="hideCount">隐藏</view>
|
||||
</view>
|
||||
<view class="content_warp">
|
||||
<scroll-view class="data_list" style="height: {{showCount?'calc(100vh - 670rpx);':'calc(100vh - 510rpx);'}}"
|
||||
scroll-y="{{list.length != 0}}" bindscrolltolower="onScrollToLower" lower-threshold="100">
|
||||
<view class="data_item" wx:for="{{list}}" wx:key="id" data-id="{{item.id}}" bind:tap="toOrderDetail">
|
||||
<view class="item_code">
|
||||
<view class="code">{{'订单编号:'+item.code}}</view>
|
||||
<view class="status" style="color: {{statusColorMap[item.productionstatus]}}; background-color: {{statusColorMap[item.productionstatus] + '20'}}">{{item.productionstatus}}</view>
|
||||
</view>
|
||||
<view class="item_material">{{'纸质:' + item.paper + '('+ item.corrugatedtype +')'}}</view>
|
||||
<view class="item_spec">{{'规格:' + item.wide + ' x ' + item.long +' = ' + item.totalnum + ' 片 ' + '平方数:' + item.squaNum + 'm³' }}</view>
|
||||
<view class="item_line">{{'压线:' + '(' + (item.linetype?item.linetype:'开') + ')' + item.line}}</view>
|
||||
<view class="item_details">
|
||||
{{'明细:' + '未入库: ' + item.unnum}}
|
||||
<text>{{'已入库: ' + item.innum}}</text>
|
||||
<text>{{'已送货: ' + item.delinum}}</text>
|
||||
</view>
|
||||
<view class="remark">{{'备注:' + item.remark}}</view>
|
||||
<view class="time">{{item.createtime}}</view>
|
||||
</view>
|
||||
<view class="not_data" wx:if="{{list.length == 0}}" >
|
||||
<image src="../../assets/images/not_data.png" mode="widthFix" style="width: 400rpx"/>
|
||||
<view class="text">暂无订单数据</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="piker">
|
||||
<t-date-time-picker
|
||||
visible="{{sDateVisible}}"
|
||||
title=""
|
||||
value="{{date_field == 's_date'?s_date:e_date}}"
|
||||
mode="date"
|
||||
format="YYYY-MM-DD"
|
||||
bindconfirm="onConfirm"
|
||||
bindcancel="onCancel"
|
||||
confirm-btn="确认"
|
||||
cancel-btn="取消"
|
||||
start="{{'1900-01-01'}}"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
.label {
|
||||
min-width: 170rpx;
|
||||
max-width: 170rpx;
|
||||
font-size: 28rpx;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
.value {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.page-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
background: #f4f6f9;
|
||||
// background: linear-gradient( 135deg, #ca7d79 0%, #c5140a 30%, #c5140a 50%, #ca7d79 100%);
|
||||
.info {
|
||||
background-color: #ffffff;
|
||||
padding: 30rpx ;
|
||||
border-radius: 0 0 20rpx 20rpx;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.04);
|
||||
.info_code_status {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.code {
|
||||
font-weight: bold;
|
||||
}
|
||||
.status {
|
||||
font-size: 22rpx;
|
||||
padding: 10rpx 25rpx;
|
||||
border-radius: 200px;
|
||||
}
|
||||
}
|
||||
.info_count {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 30rpx;
|
||||
.count_item {
|
||||
text-align: center;
|
||||
.count_item_label {
|
||||
font-size: 24rpx;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
.count_item_value {
|
||||
margin-top: 10rpx;
|
||||
font-size: 34rpx;
|
||||
color: #000000;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.title {
|
||||
font-weight: bold;
|
||||
font-size: 26rpx;
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
padding: 25rpx 0 10rpx 0;
|
||||
}
|
||||
.details {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
.detail_item {
|
||||
background-color: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
padding: 25rpx;
|
||||
margin-top: 15rpx;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.04);
|
||||
.item_top {
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.paper {
|
||||
font-size: 26rpx;
|
||||
padding: 2rpx 16rpx;
|
||||
background-color: #f0f0f0;
|
||||
color: #5f6368;
|
||||
border-radius: 200px;
|
||||
}
|
||||
.number {
|
||||
color: #c5140a;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.item_mid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start; /* 左对齐 */
|
||||
.mid_item {
|
||||
min-width: 23%; max-width: 23%;
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
margin-bottom: 18rpx;
|
||||
.mid_item_label {
|
||||
color: #5f6368;
|
||||
}
|
||||
}
|
||||
.long, .wide {
|
||||
min-width: 23%; max-width: 23%;
|
||||
}
|
||||
.squareprice {
|
||||
min-width: 31%; max-width: 31%;
|
||||
}
|
||||
.price {
|
||||
.mid_item_value {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.totalPrice {
|
||||
min-width: 50%; max-width: 50%;
|
||||
.mid_item_value {
|
||||
color: #c5140a;
|
||||
}
|
||||
}
|
||||
}
|
||||
.remark{
|
||||
background: #f9fafb;
|
||||
padding: 6px 10px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
color: #5f6368;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
|
||||
import { getAppInstance } from '../../utils/app';
|
||||
import { getCardBoardOrderDeliveryDetail } from '../../api/index'
|
||||
const app = getAppInstance();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
info: {},
|
||||
isCust: true
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
async onLoad(options) {
|
||||
const id = options.id;
|
||||
const res = await getCardBoardOrderDeliveryDetail(id).catch(() => {});
|
||||
if (res) {
|
||||
const info = this.formatDetail(res.data.dto);
|
||||
const userInfo = wx.getStorageSync('userInfo');
|
||||
this.setData({
|
||||
isCust: userInfo.custid?true:false,
|
||||
info: info,
|
||||
statusColorMap: app.globalData.statusColorMap
|
||||
})
|
||||
console.log(res);
|
||||
}
|
||||
},
|
||||
|
||||
// 格式化详情数据
|
||||
formatDetail(data) {
|
||||
let info = data;
|
||||
// 获取客户名称
|
||||
if (info.custcode) {
|
||||
const obj = app.globalData.customerList.find( item => item.code == info.custcode);
|
||||
info.customName = obj?obj.name:'未查询到客户';
|
||||
}
|
||||
// 计算总平方数
|
||||
if (info.listDetail) {
|
||||
info.totalSquaNum = info.listDetail.reduce((total,obj) => total + ((obj.wide * obj.long / 10000) * obj.num),0)?.toFixed(2);
|
||||
console.log(info);
|
||||
}
|
||||
// 格式化时间
|
||||
if (info.delitime) {
|
||||
info.delitime = info.delitime.split('T').join(' ');
|
||||
}
|
||||
return info;
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,77 @@
|
||||
<navigation-bar title="纸板送货单详情" back="{{true}}" color="white" background="#c5140a"></navigation-bar>
|
||||
<view class="page-container">
|
||||
<view class="info">
|
||||
<view class="info_code_status">
|
||||
<view class="code">{{'单号:' + info.code}}</view>
|
||||
</view>
|
||||
<view class="info_count">
|
||||
<view class="count_item">
|
||||
<view class="count_item_label">总金额</view>
|
||||
<view class="count_item_value" style="color: #c5140a;">¥{{info.totalmoney}}</view>
|
||||
</view>
|
||||
<view class="count_item">
|
||||
<view class="count_item_label">总数量</view>
|
||||
<view class="count_item_value">{{info.totalnum}}</view>
|
||||
</view>
|
||||
<view class="count_item">
|
||||
<view class="count_item_label">总平方数</view>
|
||||
<view class="count_item_value">{{info.totalSquaNum}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<t-divider custom-style="width: calc(100% + 60rpx); margin-left: -30rpx;"/>
|
||||
<view class=" flex" style="margin-top: 30rpx;justify-content: space-between;">
|
||||
<view class=" label">客户</view>
|
||||
<view class="value">{{info.customName}}</view>
|
||||
</view>
|
||||
<t-divider custom-style="width: calc(100% + 60rpx); margin-left: -30rpx;"/>
|
||||
<view class=" flex" style="justify-content: space-between;">
|
||||
<view class=" label">送货时间</view>
|
||||
<view class="value">{{info.delitime}}</view>
|
||||
</view>
|
||||
<t-divider custom-style="width: calc(100% + 60rpx); margin-left: -30rpx;"/>
|
||||
<view class=" flex" style="justify-content: space-between;">
|
||||
<view class=" label">备注</view>
|
||||
<view class="value">{{info.remark}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="title">商品明细<text style="font-size: 24rpx; color:#8c8c8c;font-weight: normal;">({{info.listDetail.length}}项)</text></view>
|
||||
<scroll-view class="data_list" style="height: calc(100vh - 750rpx);" scroll-y>
|
||||
<view class="details">
|
||||
<view class="detail_item" wx:for="{{info.listDetail}}" wx:key="id">
|
||||
<view class="item_top">
|
||||
<view class="code">{{item.ordercode}}</view>
|
||||
<view class="paper">{{item.paper}}</view>
|
||||
<view class="number">送货:{{item.num}}</view>
|
||||
</view>
|
||||
<t-divider/>
|
||||
<view class="item_mid">
|
||||
<view class="mid_item">
|
||||
<view class="mid_item_label wide">宽:</view>
|
||||
<view class="mid_item_value">{{item.wide}}</view>
|
||||
</view>
|
||||
<view class="mid_item long">
|
||||
<view class="mid_item_label">长:</view>
|
||||
<view class="mid_item_value">{{item.long}}</view>
|
||||
</view>
|
||||
<view class="mid_item squareprice price">
|
||||
<view class="mid_item_label">平方单价:</view>
|
||||
<view class="mid_item_value">{{item.squareprice}}</view>
|
||||
</view>
|
||||
<view class="mid_item price">
|
||||
<view class="mid_item_label">特价:</view>
|
||||
<view class="mid_item_value">{{item.specialprice}}</view>
|
||||
</view>
|
||||
<view class="mid_item price">
|
||||
<view class="mid_item_label">最终价:</view>
|
||||
<view class="mid_item_value">{{item.squareprice + item.specialprice}}</view>
|
||||
</view>
|
||||
<view class="mid_item price totalPrice">
|
||||
<view class="mid_item_label">金额:</view>
|
||||
<view class="mid_item_value">{{item.money}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="remark">备注:{{item.remark}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
.label {
|
||||
min-width: 170rpx;
|
||||
max-width: 170rpx;
|
||||
font-size: 30rpx;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
.value {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.page-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
background: #ffffff;
|
||||
// background: linear-gradient( 135deg, #ca7d79 0%, #c5140a 30%, #c5140a 50%, #ca7d79 100%);
|
||||
.info {
|
||||
padding: 30rpx 30rpx 0 30rpx;
|
||||
border-radius: 0 0 20rpx 20rpx;
|
||||
.info_code_status {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.code {
|
||||
font-weight: bold;
|
||||
}
|
||||
.status {
|
||||
font-size: 22rpx;
|
||||
padding: 10rpx 25rpx;
|
||||
border-radius: 200px;
|
||||
}
|
||||
}
|
||||
.info_count {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 30rpx;
|
||||
.count_item {
|
||||
text-align: center;
|
||||
.count_item_label {
|
||||
font-size: 24rpx;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
.count_item_value {
|
||||
margin-top: 10rpx;
|
||||
font-size: 34rpx;
|
||||
color: #000000;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
.paper {
|
||||
font-size: 24rpx;
|
||||
padding: 6rpx 30rpx;
|
||||
background-color: #f4f4f4;
|
||||
text-align: center;
|
||||
border-radius: 200px;
|
||||
}
|
||||
.corrugatedtype {
|
||||
background-color: #f4f4f4;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.discountedPrice {
|
||||
font-size: 24rpx;
|
||||
margin-left: 10rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
background-color: #c5140a20;
|
||||
color: #c5140a;
|
||||
text-align: center;
|
||||
border-radius: 200px;
|
||||
}
|
||||
.symbol {
|
||||
padding: 0 5rpx;
|
||||
color: #8c8c8c;
|
||||
}
|
||||
.number {
|
||||
font-size: 24rpx;
|
||||
padding: 6rpx 16rpx;
|
||||
background-color: #f7f8fa;
|
||||
text-align: center;
|
||||
border-radius: 15rpx;
|
||||
}
|
||||
.asterisk {
|
||||
position: relative;
|
||||
top: 8rpx;
|
||||
}
|
||||
.remark {
|
||||
background-color: #fafafa;
|
||||
padding: 20rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
border-left: 6rpx solid #d9d9d9;
|
||||
border-bottom: 3rpx solid #d9d9d9;
|
||||
.label {
|
||||
color: #000000;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.radio {
|
||||
padding: 5rpx;
|
||||
// background-color: #f0f0f0;
|
||||
border-radius: 200px;
|
||||
.radio_item {
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
padding: 5rpx 22rpx;
|
||||
color: #8c8c8c;
|
||||
border-radius: 200px;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
.act_radio_item {
|
||||
color: #c5140a;
|
||||
background-color: #f8e2e0;
|
||||
}
|
||||
}
|
||||
.counts {
|
||||
justify-content: space-between;
|
||||
.count_item {
|
||||
width: 15%;
|
||||
text-align: center;
|
||||
padding: 30rpx;
|
||||
background-color: #fafafa;
|
||||
border-radius: 20rpx;
|
||||
.count_label {
|
||||
font-size: 22rpx;
|
||||
color: #8c8c8c;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.count_value {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.produce {
|
||||
background-color: #c5140a20;
|
||||
}
|
||||
}
|
||||
.time {
|
||||
background-color: #f9fbfc;
|
||||
padding-top: 10rpx;
|
||||
.time_item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 24rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
|
||||
import { getAppInstance } from '../../utils/app';
|
||||
import { getCardBoardOrderDetail } from '../../api/index'
|
||||
const app = getAppInstance();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
info: {},
|
||||
isCust: true
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
async onLoad(options) {
|
||||
const id = options.id;
|
||||
const res = await getCardBoardOrderDetail(id).catch(() => {});
|
||||
if (res) {
|
||||
const info = this.formatDetail(res.data.dto);
|
||||
const userInfo = wx.getStorageSync('userInfo');
|
||||
this.setData({
|
||||
isCust: userInfo.custid?true:false,
|
||||
info: info,
|
||||
statusColorMap: app.globalData.statusColorMap
|
||||
})
|
||||
console.log(res);
|
||||
}
|
||||
},
|
||||
|
||||
// 格式化详情数据
|
||||
formatDetail(data) {
|
||||
let info = data;
|
||||
// 获取客户名称
|
||||
if (info.customercode) {
|
||||
const obj = app.globalData.customerList.find( item => item.code == info.customercode);
|
||||
info.customName = obj?obj.name:'未查询到客户';
|
||||
}
|
||||
// 获取供应商名称
|
||||
if (info.suppliercode) {
|
||||
const obj = app.globalData.supplierList.find( item => item.code == info.suppliercode);
|
||||
info.supplierName = obj?obj.name:'未查询到供应商';
|
||||
}
|
||||
// 计算最终价
|
||||
const val1 = info.squareprice?Number(info.squareprice):0;
|
||||
const val2 = info.specialprice?Number(info.specialprice):0;
|
||||
info.discountedPrice = (val1 + val2).toFixed(2);
|
||||
// 格式化压线
|
||||
if (info.line) {
|
||||
info.lineData = info.line.split('*');
|
||||
}
|
||||
// 格式化时间
|
||||
if (info.delitime) {
|
||||
info.delitime = info.delitime.split('T').join(' ');
|
||||
}
|
||||
if (info.predelitime) {
|
||||
info.predelitime = info.predelitime.split('T').join(' ');
|
||||
}
|
||||
if (info.intime) {
|
||||
info.intime = info.intime.split('T').join(' ');
|
||||
}
|
||||
return info;
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,133 @@
|
||||
<navigation-bar title="纸板订单详情" back="{{true}}" color="white" background="#c5140a"></navigation-bar>
|
||||
<view class="page-container">
|
||||
<scroll-view class="data_list" style="height: calc(100vh - 200rpx);" scroll-y>
|
||||
<view class="info">
|
||||
<view class="info_code_status">
|
||||
<view class="code">{{'单号:' + info.code}}</view>
|
||||
<view class="status" style="color: {{statusColorMap[info.productionstatus]}}; background-color: {{statusColorMap[info.productionstatus] + '20'}}">{{info.productionstatus}}</view>
|
||||
</view>
|
||||
<view class="info_count">
|
||||
<view class="count_item">
|
||||
<view class="count_item_label">总金额</view>
|
||||
<view class="count_item_value" style="color: #c5140a;">¥{{info.totalmoney}}</view>
|
||||
</view>
|
||||
<view class="count_item">
|
||||
<view class="count_item_label">总数量</view>
|
||||
<view class="count_item_value">{{info.totalnum}}</view>
|
||||
</view>
|
||||
<view class="count_item">
|
||||
<view class="count_item_label">总平方数</view>
|
||||
<view class="count_item_value">{{info.squaNum}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<t-divider custom-style="width: calc(100% + 60rpx); margin-left: -30rpx;"/>
|
||||
<view class=" flex" style="margin-top: 30rpx;">
|
||||
<view class=" label">客户</view>
|
||||
<view class="value">{{info.customName}}</view>
|
||||
</view>
|
||||
<t-divider custom-style="width: calc(100% + 60rpx); margin-left: -30rpx;"/>
|
||||
<view class=" flex">
|
||||
<view class=" label">供应商</view>
|
||||
<view class="value">{{info.supplierName}}</view>
|
||||
</view>
|
||||
<t-divider custom-style="width: calc(100% + 60rpx); margin-left: -30rpx;"/>
|
||||
<view class=" flex">
|
||||
<view class=" label">纸质 / 瓦楞</view>
|
||||
<view class="value paper">{{info.paper}}</view>
|
||||
<view class="value paper corrugatedtype">{{info.corrugatedtype}}</view>
|
||||
</view>
|
||||
<t-divider custom-style="width: calc(100% + 60rpx); margin-left: -30rpx;"/>
|
||||
<view class=" flex">
|
||||
<view class=" label">价格</view>
|
||||
<view class="value">
|
||||
平方单价 {{' ' + info.squareprice}}
|
||||
<text style="padding: 0 15rpx;">|</text>
|
||||
特价 {{' ' + info.specialprice}}
|
||||
<text class="discountedPrice">最终价 {{' ' + info.discountedPrice}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class=" flex" style="margin-top: 50rpx;">
|
||||
<view class=" label">纸度/长度</view>
|
||||
<view class="value">
|
||||
<text class="number">{{info.wide}}</text>
|
||||
<text class="symbol"> x </text>
|
||||
<text class="number">{{info.long}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<t-divider custom-style="width: calc(100% + 60rpx); margin-left: -30rpx;"/>
|
||||
<view class=" flex">
|
||||
<view class=" label" style="{{lineData && lineData.length > 3?'max-width: 80rpx;min-width: 80rpx;':''}}">压线</view>
|
||||
<view class="value">
|
||||
<text class="label line_type" wx:if="{{!info.linetype}}">{{' (开) '}}</text>
|
||||
<text class="number">{{info.lineData[0]}}</text>
|
||||
<text class="symbol asterisk" wx:if="{{info.lineData[1]}}"> * </text>
|
||||
<text class="number" wx:if="{{info.lineData[1]}}">{{info.lineData[1]}}</text>
|
||||
<text class="symbol asterisk" wx:if="{{info.lineData[2]}}"> * </text>
|
||||
<text class="number" wx:if="{{info.lineData[2]}}">{{info.lineData[2]}}</text>
|
||||
<text class="symbol asterisk" wx:if="{{info.lineData[3]}}"> * </text>
|
||||
<text class="number" wx:if="{{info.lineData[3]}}">{{info.lineData[3]}}</text>
|
||||
<text class="symbol asterisk" wx:if="{{info.lineData[4]}}"> * </text>
|
||||
<text class="number" wx:if="{{info.lineData[4]}}">{{info.lineData[4]}}</text>
|
||||
<text class=" label line_type" style="margin-left: 20rpx;font-size: 24rpx;" wx:if="{{info.linetype}}">({{info.linetype}})</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="remark flex" style="margin-top: 50rpx;">
|
||||
<view class="label">外部备注</view>
|
||||
<view class="value">{{info.remark}}</view>
|
||||
</view>
|
||||
<view class="remark flex" style="margin-top: 15rpx;" wx:if="{{!isCust}}">
|
||||
<view class="label">内部备注</view>
|
||||
<view class="value">{{info.innerremark}}</view>
|
||||
</view>
|
||||
<view class="flex" style="justify-content: space-between;margin-top: 40rpx;">
|
||||
<view class="flex">
|
||||
<view class="label" style="min-width: 80rpx; max-width: 80rpx;display: flex;align-items: center;">加急</view>
|
||||
<view class="flex radio">
|
||||
<view class="radio_item act_radio_item" wx:if="{{info.isurgents}}">是</view>
|
||||
<view class="radio_item" wx:else>否</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<view class="label" style="min-width: 140rpx; max-width: 140rpx;display: flex;align-items: center;">强制保存</view>
|
||||
<view class="flex radio">
|
||||
<view class="radio_item act_radio_item" wx:if="{{info.forcesave}}">是</view>
|
||||
<view class="radio_item" wx:else>否</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex counts" style="margin-top: 40rpx;">
|
||||
<view class="count_item">
|
||||
<view class="count_value" style="color: #c5140a;">{{info.unnum}}</view>
|
||||
<view class="count_label">未入库</view>
|
||||
</view>
|
||||
<view class="count_item">
|
||||
<view class="count_value" style="color: #67C23A;">{{info.innum}}</view>
|
||||
<view class="count_label">已入库</view>
|
||||
</view>
|
||||
<view class="count_item">
|
||||
<view class="count_value" style="color: #E6A23C;">{{info.delinum}}</view>
|
||||
<view class="count_label">已送货</view>
|
||||
</view>
|
||||
<view class="count_item produce">
|
||||
<view class="count_value">{{info.productionLong}}</view>
|
||||
<view class="count_label" style="color: #c5140a;">生产长度</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="time" style="margin-top: 30rpx;">
|
||||
<view class="time_item">
|
||||
<view class="time_label">🚚 送货时间</view>
|
||||
<view class="time_value">{{info.delitime}}</view>
|
||||
</view>
|
||||
<view class="time_item">
|
||||
<view class="time_label">📅 预计送货</view>
|
||||
<view class="time_value">{{info.predelitime}}</view>
|
||||
</view>
|
||||
<view class="time_item">
|
||||
<view class="time_label">⏰ 入库时间</view>
|
||||
<view class="time_value">{{info.intime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
.page-container {
|
||||
background-image: url('../../assets/images/start_bg.png');
|
||||
background-repeat: no-repeat; /* 禁止重复 */
|
||||
background-size: 100% 106%; /* 宽高铺满容器 */
|
||||
background-position: center; /* 居中显示 */
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
import { getAppInstance } from '../../utils/app'
|
||||
import { getCustomerData, getSupplierData } from '../../utils/index'
|
||||
const app = getAppInstance()
|
||||
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
async onLoad() {
|
||||
this.calcInputWidth();
|
||||
const deviceCode = wx.getStorageSync('deviceCode');
|
||||
if (!deviceCode) {
|
||||
const newCode = this.generateRandomString(32); //32位设备码
|
||||
wx.setStorageSync('deviceCode',newCode);
|
||||
}
|
||||
// setTimeout(() => {
|
||||
const userInfo = wx.getStorageSync('userInfo')
|
||||
if (userInfo && userInfo.id) {
|
||||
await getCustomerData();
|
||||
await getSupplierData();
|
||||
|
||||
wx.switchTab({url: '/pages/cardBoardOrder/cardBoardOrder'})
|
||||
// wx.switchTab({url: '/pages/cardBoardDeliveryOrder/cardBoardDeliveryOrder'})
|
||||
}else {
|
||||
wx.navigateTo({url: '/pages/login/login'})
|
||||
}
|
||||
// }, 1000);
|
||||
},
|
||||
// 生成随机码 :设备码
|
||||
generateRandomString(length:Number) {
|
||||
let result = '';
|
||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
const charactersLength = characters.length;
|
||||
for (let i = 0; i < length; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return result;
|
||||
},
|
||||
// 获取input宽度
|
||||
calcInputWidth() {
|
||||
try {
|
||||
// 1. 获取系统信息(屏幕宽度)
|
||||
const systemInfo = wx.getSystemInfoSync()
|
||||
const screenWidth = systemInfo.screenWidth // 屏幕宽度(px)
|
||||
|
||||
// 2. 计算屏幕85%的宽度(保留1位小数,避免像素偏差)
|
||||
const targetWidth = (screenWidth * 0.85).toFixed(1);
|
||||
const targetWidthW = (screenWidth * 0.95).toFixed(1);
|
||||
|
||||
app.globalData.inputWidth = Number(targetWidth);
|
||||
app.globalData.inputWidthW = Number(targetWidthW);
|
||||
|
||||
// const rect = wx.getMenuButtonBoundingClientRect()
|
||||
// wx.getSystemInfo({
|
||||
// success: res => {
|
||||
// app.globalData.safeAreaTop = res.safeArea.top + 56
|
||||
// }
|
||||
// })
|
||||
} catch (err) {
|
||||
// 异常默认值(300px)
|
||||
app.globalData.inputWidth = 300;
|
||||
app.globalData.inputWidthW = 330;
|
||||
console.error('获取屏幕宽度失败:', err);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
<!--index.wxml-->
|
||||
<!-- <navigation-bar title="Weixin" back="{{false}}" color="black" background="#FFF"></navigation-bar> -->
|
||||
<view class="page-container">
|
||||
<image src="../../assets/images/start_bg.png" mode="widthFix" style="width: 100%;height: 100%;"/>
|
||||
</view>
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
.page_container {
|
||||
// background-color: #c5140a;
|
||||
background: linear-gradient( 135deg, #ca7d79 0%, #c5140a 30%, #c5140a 50%, #ca7d79 100%);
|
||||
background-repeat: no-repeat; /* 禁止重复 */
|
||||
background-size: 100% 106%; /* 宽高铺满容器 */
|
||||
background-position: center; /* 居中显示 */
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.content_warp {
|
||||
overflow: auto;
|
||||
.icon {
|
||||
width: 25%;
|
||||
margin: 0 auto;
|
||||
background-color: #cc423a;
|
||||
border-radius: 50%;
|
||||
border: 1px solid #ffffff;
|
||||
aspect-ratio: 1 / 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 25%;
|
||||
.img_warp {
|
||||
width: 60%;
|
||||
background-color: #ffffff;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.welcome {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 50rpx;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
margin-top: 5%;
|
||||
}
|
||||
.tip {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
margin-top: 2%;
|
||||
}
|
||||
.form_warp {
|
||||
margin-top: 15%;
|
||||
}
|
||||
.login_btn {
|
||||
margin-top: 15%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
button {
|
||||
background-color: #cc423a;
|
||||
color: #ffffff;
|
||||
width: 100%;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
.btn-hover {
|
||||
background-color: #c5140a !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
import { getAppInstance } from '../../utils/app'
|
||||
import { loginWx } from '../../api/index'
|
||||
import { getCustomerData, getSupplierData } from '../../utils/index'
|
||||
|
||||
const app = getAppInstance()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
phone: '',
|
||||
password: '',
|
||||
showPassword: false
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad() {
|
||||
// this.setData({
|
||||
// inputWidth: app.globalData.inputWidth,
|
||||
// inputWidthW: app.globalData.inputWidthW
|
||||
// })
|
||||
},
|
||||
// 登录
|
||||
async loginFun() {
|
||||
const { phone, password } = this.data;
|
||||
if (!phone) {
|
||||
wx.showToast({title: '请输入手机号',icon: 'none',duration: 1500});
|
||||
return;
|
||||
}
|
||||
if (!password) {
|
||||
wx.showToast({title: '请输入密码',icon: 'none',duration: 1500});
|
||||
return;
|
||||
}
|
||||
const deviceCode = wx.getStorageSync('deviceCode');
|
||||
const res = await loginWx({ phone:phone,password:password,deviceCode: deviceCode }).catch( () => {});
|
||||
console.log(res);
|
||||
if (res && res.data && res.data.dto) {
|
||||
let userInfo = res.data.dto;
|
||||
const deviceInfo = userInfo.listOnlineDevice.find( item => item.code == deviceCode);
|
||||
userInfo.accesstoken = deviceInfo?deviceInfo.accesstoken:'';
|
||||
wx.showToast({title: '登录成功',icon: 'none',duration: 1500});
|
||||
wx.setStorageSync('userInfo',userInfo);
|
||||
await getCustomerData();
|
||||
await getSupplierData();
|
||||
setTimeout(() => {
|
||||
wx.switchTab({url: '/pages/cardBoardOrder/cardBoardOrder'})
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
// 输入手机号
|
||||
handlePhoneChange(e: any) {
|
||||
const value = e.detail.value || '';
|
||||
this.setData({
|
||||
phone: value
|
||||
});
|
||||
},
|
||||
// 密码
|
||||
onPasswordInput(e: any) {
|
||||
const value = e.detail.value || '';
|
||||
this.setData({
|
||||
password: value
|
||||
});
|
||||
},
|
||||
onPasswordIconClick() {
|
||||
this.setData({
|
||||
showPassword: !this.data.showPassword
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,48 @@
|
||||
<!--index.wxml-->
|
||||
<navigation-bar title="登录 • 粤盈科技" back="{{false}}" color="black" background="#FFF"></navigation-bar>
|
||||
<view class="page_container">
|
||||
<view class="content_warp" style="width: {{inputWidth}}px; margin: 0 auto;">
|
||||
<view class="icon">
|
||||
<view class="img_warp">
|
||||
<image src="../../assets/images/login_user.png" mode="widthFix" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="welcome">欢迎登录</view>
|
||||
<view class="tip">请输入您的账号信息</view>
|
||||
<view class="form_warp">
|
||||
<view class="phone_input">
|
||||
<t-input
|
||||
value="{{phone}}"
|
||||
placeholder-style="color: #b7b7b7"
|
||||
placeholder="请输入手机号码"
|
||||
bind:change="handlePhoneChange"
|
||||
cursor-spacing="30"
|
||||
style="border-radius: 200px;"
|
||||
/>
|
||||
</view>
|
||||
<view class="password_input">
|
||||
<t-input
|
||||
key="input2"
|
||||
placeholder="请输入密码"
|
||||
placeholder-style="color: #b7b7b7"
|
||||
type="{{ showPassword ? 'text' : 'password' }}"
|
||||
value="{{password}}"
|
||||
bind:change="onPasswordInput"
|
||||
style="border-radius: 200px;margin-top: 6%;"
|
||||
>
|
||||
<view class="password-icon" slot="suffix-icon" bind:tap="onPasswordIconClick">
|
||||
<t-icon
|
||||
class="password-icon"
|
||||
name="{{ showPassword ? 'browse' : 'browse-off' }}"
|
||||
style="color: #b7b7b7; font-size: 18px; "
|
||||
/>
|
||||
</view>
|
||||
</t-input>
|
||||
</view>
|
||||
<view class="login_btn" style="border-radius: 200px;">
|
||||
<t-button bindtap="loginFun"size="large" shape="round" hover-class="btn-hover" style="width: {{inputWidth / 2}}px;">登录</t-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
page {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.scrollarea {
|
||||
flex: 1;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.log-item {
|
||||
margin-top: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.log-item:last-child {
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// logs.ts
|
||||
// const util = require('../../utils/util.js')
|
||||
import { formatTime } from '../../utils/util'
|
||||
|
||||
Component({
|
||||
data: {
|
||||
logs: [],
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
this.setData({
|
||||
logs: (wx.getStorageSync('logs') || []).map((log: string) => {
|
||||
return {
|
||||
date: formatTime(new Date(log)),
|
||||
timeStamp: log
|
||||
}
|
||||
}),
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
<!--logs.wxml-->
|
||||
<navigation-bar title="查看启动日志" back="{{true}}" color="black" background="#FFF"></navigation-bar>
|
||||
<scroll-view class="scrollarea" scroll-y type="list">
|
||||
<block wx:for="{{logs}}" wx:key="timeStamp" wx:for-item="log">
|
||||
<view class="log-item">{{index + 1}}. {{log.date}}</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
Reference in New Issue
Block a user