Commit 453719a0 authored by chuan.liu's avatar chuan.liu

新增生产计划 生产订单页面

parent 82da038c
...@@ -405,6 +405,48 @@ ...@@ -405,6 +405,48 @@
} }
} }
} }
},
{
"path": "pages/produce-order/produce-order",
"style": {
"app-plus": {
"titleNView": {
"titleAlign": "left",
"titleColor": "#333",
"titleSize": "17px",
"backgroundColor": "#fff",
"titleText": "生产下单",
"autoBackButton": false,
"buttons": [{
"type": "none",
"text": "新增",
"fontSize": "14px",
"color": "#555"
}]
}
}
}
},
{
"path": "pages/produce-order/produce-plan",
"style": {
"app-plus": {
"titleNView": {
"titleAlign": "left",
"titleColor": "#333",
"titleSize": "17px",
"backgroundColor": "#fff",
"titleText": "生产计划",
"autoBackButton": false,
"buttons": [{
"type": "none",
"text": "提交",
"fontSize": "14px",
"color": "#555"
}]
}
}
}
} }
], ],
"globalStyle": { "globalStyle": {
......
<template>
<view class="order view">
<view class="listview">
<view class="cell-list">
<view class="middle view planout-block-item">
<view class="item-block item-block-code">
<text class="item-block-label">单号:TP10000021</text>
<button class="item-block-btn" type="default">待审批</button>
</view>
<view class="item-block item-block-name">
<text class="item-block-label item-block__label">配额生产计划</text>
</view>
<view class="item-block">
<text class="item-block-label-des">2021-08-06 05:14</text>
</view>
<view class="item-block item-block-date">
<text class="detal-item-label">下单日期</text>
</view>
<view class="block-detal">
<view class="block-detal-item">
<text class="detal-item-label">产品</text>
<text class="detal-item-value">1618五粮液 500ml*6</text>
</view>
<view class="block-detal-item">
<text class="detal-item-label">件数</text>
<text class="detal-item-value">220</text>
</view>
<view class="block-detal-item block-detal-item-last">
<text class="detal-item-label">期望交货期</text>
<text class="detal-item-value">7</text>
</view>
</view>
<view class="block-detal block-detal-last">
<view class="block-detal-item">
<text class="detal-item-label">产品</text>
<text class="detal-item-value">1618五粮液 500ml*6</text>
</view>
<view class="block-detal-item">
<text class="detal-item-label">件数</text>
<text class="detal-item-value">220</text>
</view>
<view class="block-detal-item block-detal-item-last">
<text class="detal-item-label">期望交货期</text>
<text class="detal-item-value">7</text>
</view>
</view>
<view class="item-block">
<text class="item-block-label-des">尽快发货</text>
</view>
<view class="item-block item-block-date">
<text class="detal-item-label">备注</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
mapState
} from 'vuex'
export default {
props: {
newsItem: {
type: Object,
default: function(e) {
return {}
}
}
},
data() {
return {
}
},
computed: {
navHeight() {
return {
'height': `${this.sysinfo.safeArea.top + 44}px`
}
},
...mapState(['sysinfo'])
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.view {
flex-direction: column;
}
.order {
flex: 1;
padding: 0 16rpx;
margin-top: 28rpx;
}
.listview {
flex: 1;
flex-direction: column;
}
.cell-list {
flex-direction: column;
}
.date{
font-size: 28rpx;
color: #999999;
font-size: 28rpx;
text-align: center;
margin-bottom: 24rpx;
}
.icon-address {
width: 44rpx;
height: 44rpx;
margin-right: 16rpx;
}
.cell-list-block__content {
display: flex;
flex: 1;
flex-direction: column;
margin-bottom: 40rpx;
}
.cell-list-block__title {
color: #333;
font-size: 30rpx;
flex: 1;
align-items: center;
margin-bottom: 4rpx;
}
.cell-list-block {
overflow: hidden;
display: flex;
flex-direction: column;
background: #fff;
padding: 20rpx 24rpx;
border-radius: 20rpx;
margin-bottom: 56rpx;
}
.list-block-title {
display: flex;
align-items: center;
margin-bottom: 16rpx;
}
.list-block-title__text {
color: #999999;
font-size: 26rpx;
}
.planout-block-item {
flex: 1;
padding: 40rpx 32rpx;
background-color: #fff;
border-radius: 16rpx 100rpx 16rpx 16rpx;
}
.item-block {
overflow: hidden;
background-color: #fff;
padding: 0 16rpx;
}
.item-block-label {
font-size: 24rpx;
color: #333;
}
.item-block__label {
flex: 1;
text-align: left;
font-size: 32rpx;
color: #333;
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.item-block-code {
display: flex;
align-items: center;
justify-content: space-between;
}
.item-block-btn{
width: 120rpx;
height: 48rpx;
line-height: 48rpx;
background: #f61d30;
border-radius: 8rpx 200rpx 200rpx 8rpx;
font-size: 12px;
color: #fff;
text-align: center;
}
.item-block-name {
margin-top: 32rpx;
margin-bottom: 32rpx;
}
.item-block-date{
margin-top: 12rpx;
margin-bottom: 48rpx;
}
.item-block-label-des {
flex: 1;
text-align: left;
font-size: 28rpx;
color: #333;
}
.block-detal {
display: flex;
flex-direction: column;
background: #f8f8f8;
border-radius: 20rpx;
padding: 28rpx 32rpx;
margin-bottom: 16rpx;
}
.block-detal-last{
margin-bottom: 32rpx;
}
.block-detal-item {
display: flex;
margin-bottom: 32rpx;
justify-content: space-between;
}
.block-detal-item-last{
margin-bottom: 0;
}
.detal-item-label {
color: #999;
font-size: 24rpx;
}
.detal-item-value{
color: #333;
font-size: 28rpx;
}
</style>
<template>
<view class="page-news">
<view class="status_bar" :style="navHeight"></view>
<view class="conditon-block">
<uni-collapse>
<uni-collapse-item titleBorder="none">
<template v-slot:title>
<uni-list>
<uni-list-item title="标题使用自定义标题插槽" :show-extra-icon="true" :extra-icon="extraIcon">
</uni-list-item>
</uni-list>
</template>
<view class="content">
<text class="text">折叠内容主体,可自定义内容及样式</text>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
<uni-list ref="list" class="listview" :enableBackToTop="true" :scroll-y="true" @scrolltolower="loadMore()">
<uni-refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown"
:display="refreshing ? 'show' : 'hide'">
<div class="refresh-view">
<image class="refresh-icon" :src="refreshIcon" :style="{width: (refreshing || pulling) ? 0: '32px'}"
:class="{'refresh-icon-active': refreshFlag}"></image>
<uni-load-more v-if="refreshing" class="loading-icon" status="loading"
:contentText="loadingMoreText"></uni-load-more>
<text class="loading-text">{{refreshText}}</text>
</div>
</uni-refresh>
<uni-cell v-for="(item, index) in dataList" :key="item.id">
<order-list :newsItem="item" @click="goDetail(item)"></order-list>
</uni-cell>
<uni-cell v-if="isLoading || dataList.length > 4">
<view class="loading-more">
<text class="loading-more-text">{{loadingText}}</text>
</view>
</uni-cell>
</uni-list>
<!-- <no-data class="no-data" v-if="isNoData" @retry="loadMore"></no-data> -->
</view>
</template>
<script>
import uniList from '@/components/uni-list.vue';
import uniCell from '@/components/uni-cell.vue';
import uniRefresh from '@/components/uni-refresh.vue';
import uniLoadMore from '@/components/uni-load-more.vue';
import noData from '@/components/nodata.nvue';
import orderList from './order-list.nvue';
import {
mapState
} from 'vuex'
export default {
components: {
uniList,
uniCell,
uniRefresh,
uniLoadMore,
noData,
orderList
},
props: {
nid: {
type: [Number, String],
default: '0'
}
},
data() {
return {
dataList: [{
id: "tab01",
name: '最新',
newsid: 0
}, {
id: "tab02",
name: '大公司',
newsid: 23
}],
navigateFlag: false,
pulling: false,
refreshing: false,
refreshFlag: false,
refreshText: "",
isLoading: false,
loadingText: '加载中...',
isNoData: false,
pulling: false,
angle: 0,
loadingMoreText: {
contentdown: '',
contentrefresh: '',
contentnomore: ''
},
extraIcon: {
color: '#4cd964',
size: '26',
type: 'image'
},
refreshIcon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAB5QTFRFcHBw3Nzct7e39vb2ycnJioqK7e3tpqam29vb////D8oK7wAAAAp0Uk5T////////////ALLMLM8AAABxSURBVHja7JVBDoAgDASrjqj//7CJBi90iyYeOHTPMwmFZrHjYyyFYYUy1bwUZqtJIYVxhf1a6u0R7iUvWsCcrEtwJHp8MwMdvh2amHduiZD3rpWId9+BgPd7Cc2LIkPyqvlQvKxKBJ//Qwq/CacAAwDUv0a0YuKhzgAAAABJRU5ErkJggg=="
}
},
computed: {
navHeight() {
return {
'height': `${this.sysinfo.safeArea.top + 44}px`
}
},
...mapState(['sysinfo'])
},
created() {
this.pullTimer = null;
this.requestParams = {
columnId: this.nid,
minId: 0,
pageSize: 10,
column: 'id,post_id,title,author_name,cover,published_at,comments_count'
};
this._isWidescreen = false;
// #ifdef H5
var mediaQueryOb = uni.createMediaQueryObserver(this)
mediaQueryOb.observe({
minWidth: 768
}, matches => {
this._isWidescreen = matches;
})
// #endif
},
methods: {
loadData(refresh) {
if (this.isLoading) {
return;
}
this.isLoading = true;
this.isNoData = false;
this.requestParams.time = new Date().getTime() + '';
var startTime = new Date();
uni.request({
// url: this.$host + 'api/news',
url: 'https://unidemo.dcloud.net.cn/api/news',
data: this.requestParams,
success: (result) => {
var endTime = new Date();
const data = result.data;
this.isNoData = (data.length <= 0);
const data_list = data.map((news) => {
return {
id: this.newGuid() + news.id,
newsid: news.id,
article_type: 1,
datetime: (new Date(news.published_at.replace(/\-/g, '/')).getTime()),
title: news.title,
image_url: news.cover,
source: news.author_name,
comment_count: news.comments_count,
post_id: news.post_id
};
});
if (refresh) {
this.dataList = data_list;
this.requestParams.minId = 0;
} else {
this.dataList = this.dataList.concat(data_list);
this.requestParams.minId = data[data.length - 1].id;
}
if (this.dataList.length > 0 && this._isWidescreen && this.dataList.length <= 10) {
this.goDetail(this.dataList[0]);
}
},
fail: (err) => {
if (this.dataList.length == 0) {
this.isNoData = true;
}
},
complete: (e) => {
this.isLoading = false;
if (refresh) {
this.refreshing = false;
this.refreshFlag = false;
this.refreshText = "已刷新";
if (this.pullTimer) {
clearTimeout(this.pullTimer);
}
this.pullTimer = setTimeout(() => {
this.pulling = false;
}, 1000);
}
}
});
},
loadMore(e) {
this.loadData();
},
clear() {
this.dataList.length = 0;
this.requestParams.minId = 0;
},
goDetail(detail) {
},
refreshData() {
if (this.isLoading) {
return;
}
this.pulling = true;
this.refreshing = true;
this.refreshText = "正在刷新...";
this.loadData(true);
},
onrefresh(e) {
this.refreshData();
// #ifdef APP-NVUE
this.$refs.list.resetLoadmore();
// #endif
},
onpullingdown(e) {
if (this.refreshing) {
return;
}
// var angle = (e.pullingDistance) / e.viewHeight * 180;
// if (angle > 180) {
// angle = 180;
// }
// tab.angle = angle;
this.pulling = false;
if (Math.abs(e.pullingDistance) > Math.abs(e.viewHeight)) {
this.refreshFlag = true;
this.refreshText = "释放立即刷新";
} else {
this.refreshFlag = false;
this.refreshText = "下拉可以刷新";
}
},
newGuid() {
let s4 = function() {
return (65536 * (1 + Math.random()) | 0).toString(16).substring(1);
}
return (s4() + s4() + "-" + s4() + "-4" + s4().substr(0, 3) + "-" + s4() + "-" + s4() + s4() + s4())
.toUpperCase();
}
}
}
</script>
<style lang="scss" scoped>
/* #ifndef APP-PLUS */
page {
width: 100%;
min-height: 100%;
display: flex;
background: #fff;
}
.status_bar {
height: var(--status-bar-height);
}
/* #endif */
.no-data {
flex: 1;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 10;
}
.page-news {
flex: 1;
flex-direction: column;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
.listview {
position: absolute;
left: 0;
top: 216rpx;
right: 0;
bottom: 0;
background: #f0f4f5;
/* #ifndef APP-NVUE */
display: flex;
flex-direction: column;
/* #endif */
/* #ifndef MP-ALIPAY */
flex-direction: column;
/* #endif */
}
.conditon-block{
height: 128rpx;
}
.refresh {
justify-content: center;
}
.refresh-view {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
width: 750rpx;
height: 64px;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
}
.refresh-icon {
width: 32px;
height: 32px;
transition-duration: .5s;
transition-property: transform;
transform: rotate(0deg);
transform-origin: 15px 15px;
}
.refresh-icon-active {
transform: rotate(180deg);
}
.loading-icon {
width: 28px;
height: 28px;
margin-right: 5px;
color: gray;
}
.loading-text {
margin-left: 2px;
font-size: 16px;
color: #999999;
}
.loading-more {
align-items: center;
justify-content: center;
padding-top: 14px;
padding-bottom: 14px;
text-align: center;
}
.loading-more-text {
font-size: 28upx;
color: #999;
}
</style>
<template>
<div>
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>
...@@ -64,7 +64,8 @@ ...@@ -64,7 +64,8 @@
<text class="detal-item-value">7</text> <text class="detal-item-value">7</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</view> </view>
</view> </view>
<view class="middle"> <view class="middle">
<view class="entry-block"> <view class="entry-block" @click="goPage('purchase-plan')">
<view class="entry-bill"> <view class="entry-bill">
<image class="entry-bill-icon" src="@/static/image/uc_bill@3x.png" mode=""></image> <image class="entry-bill-icon" src="@/static/image/uc_bill@3x.png" mode=""></image>
<text class="entry-bill-dot">25</text> <text class="entry-bill-dot">25</text>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<text class="entry-bill-text">采购计划</text> <text class="entry-bill-text">采购计划</text>
</view> </view>
<view class="entry-block" @tap="checkApplyOrder"> <view class="entry-block" @click="goPage('produce-order')">
<view class="entry-bill"> <view class="entry-bill">
<image class="entry-bill-icon" src="@/static/image/uc_shop@3x.png" mode=""></image> <image class="entry-bill-icon" src="@/static/image/uc_shop@3x.png" mode=""></image>
</view> </view>
...@@ -101,6 +101,11 @@ ...@@ -101,6 +101,11 @@
...mapState(['sysinfo']) ...mapState(['sysinfo'])
}, },
methods:{ methods:{
goPage(page){
uni.navigateTo({
url:`/pages/${page}/${page}`
})
},
checkApplyOrder(){ checkApplyOrder(){
uni.navigateTo({ uni.navigateTo({
url:"/pages/apply-order/apply-order" url:"/pages/apply-order/apply-order"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment