Commit 7ac81455 authored by Morson's avatar Morson

Merge branch 'dev' of https://git.banshouhui.com/lijundan/self-support into dev

parents ba17477b 9d0a9f2c
...@@ -3,13 +3,16 @@ ...@@ -3,13 +3,16 @@
<view class="return-cell" @click="handleClick"> <view class="return-cell" @click="handleClick">
<view class="title-view"> <view class="title-view">
<text class="title-text" :style="{'color': titleColor}">{{title}}</text> <text class="title-text" :style="{'color': titleColor}">{{title}}</text>
<view> <view class="express-view">
<text>工单编号:</text> <text>物流单号:</text>
<text @longpress="handleLongpress">{{info.orderNumber}}</text> <view class="order-file-right" @click="$u.throttle(handleClickExpress, 500)">
<text>{{info.express.number}}</text>
<u-icon name="arrow-right"></u-icon>
</view>
</view> </view>
</view> </view>
<view class="line-view"></view> <view class="line-view"></view>
<view class="list-content"> <view class="list-content" v-if="isHorizontal">
<view class="image-list"> <view class="image-list">
<image class="image-view" v-for="(item, index) in images" :key="index" :src="item"></image> <image class="image-view" v-for="(item, index) in images" :key="index" :src="item"></image>
<view class="info-view" v-if="info.items.length == 1"> <view class="info-view" v-if="info.items.length == 1">
...@@ -19,6 +22,11 @@ ...@@ -19,6 +22,11 @@
</view> </view>
<view class="count-view">共{{info.items.length}}种</view> <view class="count-view">共{{info.items.length}}种</view>
</view> </view>
<view v-else class="list-vertical-content">
<view class="list-item" v-for="(item, index) in info.items" :key="index">
<SpareCell :item="item"/>
</view>
</view>
<view class="bottom-view"> <view class="bottom-view">
<view class="total-view"> <view class="total-view">
<text>合计:</text> <text>合计:</text>
...@@ -31,15 +39,25 @@ ...@@ -31,15 +39,25 @@
</template> </template>
<script> <script>
import SpareCell from "@/components/parts/spareCell.vue"
export default { export default {
components: {
SpareCell
},
props: { props: {
info: { // 申请材料列表 info: { // 申请材料列表
type: Object, type: Object,
default() { default() {
return { return {
status: 0, // 待签收 15;待发货 10;待审核 1;已取消 -1;已驳回 -2;已签收 20 status: 0, // 待签收 15;待发货 10;待审核 1;已取消 -1;已驳回 -2;已签收 20
items: [],
express: {}
} }
} }
},
type: { // horizontal;vertical
type: String,
default: 'horizontal'
} }
}, },
data() { data() {
...@@ -56,6 +74,9 @@ ...@@ -56,6 +74,9 @@
'20': '', '20': '',
} }
}, },
isHorizontal() {
return this.type == 'horizontal'
},
operateTypes() { operateTypes() {
return { return {
'1': 'cancelParts', '1': 'cancelParts',
...@@ -102,7 +123,7 @@ ...@@ -102,7 +123,7 @@
} }
}, },
// 待签收 15 变 已签收 20; 10 待审核 1 变 已取消 -1 // 待签收 15 变 已签收 20; 10 待审核 1 变 已取消 -1
willStatus() { willStatuses() {
return { return {
'1': '-1', '1': '-1',
'10': '', '10': '',
...@@ -112,6 +133,9 @@ ...@@ -112,6 +133,9 @@
'-1': '' '-1': ''
} }
}, },
willStatus() {
return this.willStatuses[this.info.status]
},
total() { // 合计 total() { // 合计
var i = 0 var i = 0
for (var item of this.info.items) { for (var item of this.info.items) {
...@@ -142,18 +166,13 @@ ...@@ -142,18 +166,13 @@
}, },
methods: { methods: {
handleClick() { handleClick() {
this.$emit('action', this.info.id, this.buttonOperateType, this.willStatus) this.$emit('action', this.info)
}, },
handleOperate() { handleOperate() {
this.$emit('operate', this.info.id, this.buttonOperateType, this.willStatus) this.$emit('operate', this.info.id, this.buttonOperateType, this.willStatus)
}, },
handleLongpress() { // 长按复制单号 handleClickExpress() {
uni.setClipboardData({ this.$emit('express', this.info.id)
data: this.info.orderNumber,
success: function () {
console.log('success');
}
})
} }
} }
} }
...@@ -165,6 +184,9 @@ ...@@ -165,6 +184,9 @@
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
display: flex;
flex-direction: column;
height: 100%;
.title-view{ .title-view{
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -175,6 +197,15 @@ ...@@ -175,6 +197,15 @@
font-size: 36rpx; font-size: 36rpx;
font-weight: bold; font-weight: bold;
} }
.express-view {
display: flex;
justify-content: center;
.order-file-right {
font-weight: 400;
color: #2272FF;
font-size: 26rpx;
}
}
} }
.line-view { .line-view {
background-color: #F4F5F7; background-color: #F4F5F7;
...@@ -186,7 +217,7 @@ ...@@ -186,7 +217,7 @@
display: flex; display: flex;
width: 100%; width: 100%;
margin-top: 40rpx; margin-top: 40rpx;
margin-bottom: 40rpx; margin-bottom: 30rpx;
.image-list { .image-list {
overflow-x: auto; overflow-x: auto;
display: flex; display: flex;
...@@ -217,10 +248,19 @@ ...@@ -217,10 +248,19 @@
color: #666666; color: #666666;
} }
} }
.list-vertical-content {
height: 100%;
overflow: auto;
.list-item {
margin-bottom: 30rpx;
margin-top: 20rpx;
}
}
.bottom-view { .bottom-view {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-top: 20rpx;
.total-view { .total-view {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
......
<template> <template>
<u-popup v-model="show" mode="center" safe-area-inset-bottom width="690rpx" :mask-close-able="flase" close-icon-color="#FFFFFF" height="80%"> <u-popup v-model="show" mode="center" safe-area-inset-bottom width="690rpx" :mask-close-able="flase"
close-icon-color="#FFFFFF" height="86%">
<!-- 申请列表 --> <!-- 申请列表 -->
<view class="apply-list-view"> <view class="apply-list-view">
<view class="colse-view"> <view class="content-view">
<view class="right-view" @click.throttle="handleClose"> <view class="list-content">
<u-icon name="close"></u-icon> <swiper class="swiper" :indicator-dots="true" style="height: 100%;" :current="currentIndex">
</view> <swiper-item v-for="(item, index) in list" :key="index">
<view class="cell-view">
<AppliedCell @operate="handleOperate" @express="handleClickExpress" @action="handleClickCell" :info="item" :type="vertical" class="applied-cell"></AppliedCell>
</view>
</swiper-item>
</swiper>
</view>
<view class="bottom-view">
<view class="bottom-warehouse">
<view class="bottom-title">
<text>备件订单</text>
<view class="order-file-right" @click="$u.throttle(handleClick, 500)">
<text>点击查看</text>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<view class="bottom-content">
<view v-for="(item, index) in bottomItems" :key="index" class="bottom-content-item"
@click="handleClick(item.index)">
<view class="bottom-image">
<image :src="item.icon" :style="item.imageStyle"></image>
</view>
<view>{{item.title}}</view>
</view>
</view>
</view>
<view class="line-view"></view>
<view class="apply-button" @click="$u.throttle(handleApply, 500)">
<text :custom-style="applyStyle" type="primary">继续申请</text>
</view>
</view>
</view> </view>
<view class="list-content"> <view class="colse-view">
<view v-for="(item, index) in list" :key="index"> <image class="image-view" :src="closeImage" @click.throttle="$u.throttle(handleClose, 500)"></image>
<AppliedCell @operate="handleOperate" :info="item"></AppliedCell>
</view>
</view>
<view class="bottom-view">
<u-button :custom-style="applyStyle" shape="circle" @click="handleApply" type="primary">申请配件</u-button>
</view> </view>
</view> </view>
</u-popup> </u-popup>
...@@ -40,59 +66,190 @@ ...@@ -40,59 +66,190 @@
}, },
data() { data() {
return { return {
currentIndex: 0
}
},
computed: {
closeImage() {
return process.uniEnv.qn_base_url + 'dianjiquxiao.png'
},
spotlist() {
return [{
// image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
{
// image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
title: '身无彩凤双飞翼,心有灵犀一点通'
},
{
// image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
]
},
bottomItems() {
// index: 跳转到我的订单页面之后第几个tab,
return [{
index: 3,
title: '代签收',
icon: process.uniEnv.qn_base_url + 'daiqianshou.png',
imageStyle: 'width:48rpx;height:48rpx'
},
{
index: 2,
title: '待发货',
icon: process.uniEnv.qn_base_url + 'daifahuo.png',
imageStyle: 'width:48rpx;height:48rpx'
},
{
index: 1,
title: '待审核',
icon: process.uniEnv.qn_base_url + 'daishenhe.png',
imageStyle: 'width:44rpx;height:54rpx'
},
{
index: 4,
title: '已签收',
icon: process.uniEnv.qn_base_url + 'qianshou.png',
imageStyle: 'width:48rpx;height:48rpx'
},
]
} }
},
computed: {
applyStyle() {
return {
'height': '104rpx',
'width': '100%',
}
}
}, },
methods: { methods: {
handleClose() { handleClose() {
this.$emit('update:show', false) this.$emit('update:show', false)
}, },
handleOperate(type) { handleOperate(partsId, operateType, willStatus) {
// 调接口 this.$emit('operate', partsId, operateType, willStatus)
// 刷新页面
// 告诉父级做了操作
this.$emit('operate', type)
}, },
handleApply() { handleClickCell(info) {
this.$emit('apply') this.$emit('action', info)
}, },
handleClickExpress() {
this.$emit('express', info)
},
handleApply() {
this.$emit('apply')
},
handleClick(index = 0) {
uni.navigateTo({
url: 'pages/mine/warehouse/index?index=' + index
})
}
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.apply-list-view { .apply-list-view {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.colse-view {
height: 80rpx; .content-view {
display: flex; border-radius: 12rpx;
align-items: center; background-color: #FFFFFF;
justify-content: flex-end; height: 100%;
.right-view { display: flex;
width: 80rpx; flex-direction: column;
height: 80rpx;
display: flex; .list-content {
align-items: center; height: 100%;
justify-content: center;
color: #FF0000; .swiper {
} .cell-view {
} height: 100%;
.list-content { padding-bottom: 100rpx;
height: 100%; display: flex;
overflow: auto; flex-direction: column;
} .applied-cell {
.bottom-view { border-radius: 12rpx;
margin:30rpx;
} height: 100%;
box-shadow: 0px 6px 10px rgba(22,72,155,0.15);
}
}
}
}
.bottom-view {
.bottom-warehouse {
background-color: #FFFFFF;
border-radius: 12rpx;
.bottom-title {
color: #333333;
font-weight: bold;
font-size: 32rpx;
margin: 0rpx 30rpx 40rpx 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
.order-file-right {
font-weight: 400;
color: #2272FF;
font-size: 26rpx;
}
}
.bottom-content {
display: flex;
justify-content: space-around;
align-items: center;
.bottom-content-item {
color: #333333;
font-size: 26rpx;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
.bottom-image {
width: 60rpx;
height: 60rpx;
margin-bottom: 10rpx;
display: flex;
justify-content: center;
align-items: center;
}
}
}
}
.line-view {
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
margin-top: 24rpx;
}
.apply-button {
width: 100%;
color: #2272FF;
font-size: 32rpx;
display: flex;
justify-content: center;
align-items: center;
height: 112rpx;
}
}
}
.colse-view {
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
margin-top: 30rpx;
.image-view {
width: 60rpx;
height: 60rpx;
}
}
} }
</style> </style>
...@@ -61,12 +61,13 @@ ...@@ -61,12 +61,13 @@
default () { default () {
return '确定' return '确定'
} }
} },
}, customStyle: {
customStyle: { type: String,
type: String, default: 'background-color: #FFFFFF;padding: 0 30rpx;'
default: 'background-color: #FFFFFF;padding: 0 30rpx;' },
}, },
data() { data() {
return { return {
checked: false checked: false
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
:customStyle="noPartsCustomStyle" /> :customStyle="noPartsCustomStyle" />
<template v-else> <template v-else>
<view v-for="(item, index) in partsList" :key="item.id"> <view v-for="(item, index) in partsList" :key="item.id">
<AppliedCell @operate="handleOperate" :info="item" @action="handleClickCell"></AppliedCell> <AppliedCell @operate="handleOperate" :info="item" @action="handleClickCell" @express="handleClickExpress"></AppliedCell>
</view> </view>
<view class="load-more-view"> <view class="load-more-view">
<u-loadmore v-show="(pageNumber == 1 && loaded) || pageNumber > 2" :status="loadStatus" <u-loadmore v-show="(pageNumber == 1 && loaded) || pageNumber > 2" :status="loadStatus"
...@@ -127,6 +127,15 @@ ...@@ -127,6 +127,15 @@
getApp().trackPage('备件订单页') getApp().trackPage('备件订单页')
this.reloadPartsList() this.reloadPartsList()
this._freshing = false; this._freshing = false;
},
onShow() {
// 从过程反馈回来,需要刷新数据
let pages = getCurrentPages()
let page = pages[pages.length - 1]
if (page.needApplyList) {
this.currentIndex = 0
this.reloadPartsList()
}
}, },
methods: { methods: {
// tab栏切换 // tab栏切换
...@@ -188,14 +197,23 @@ ...@@ -188,14 +197,23 @@
}, },
handleClickCell(info) { handleClickCell(info) {
var pages = getCurrentPages(); this.setPageInfo(info)
if (pages.length >= 1) {
var page = pages[pages.length - 1];
page.info = info
}
uni.navigateTo({ uni.navigateTo({
url: 'pages/mine/warehouse/partsDetail' url: 'pages/mine/warehouse/partsDetail'
}) })
},
handleClickExpress(info) {
this.setPageInfo(info)
uni.navigateTo({
url: 'pages/mine/warehouse/express'
})
},
setPageInfo(info) {
var pages = getCurrentPages();
if (pages.length >= 1) {
var page = pages[pages.length - 1];
page.info = info
}
}, },
handleClickApply() { handleClickApply() {
uni.navigateTo({ uni.navigateTo({
......
...@@ -62,7 +62,8 @@ ...@@ -62,7 +62,8 @@
return { return {
info: { info: {
items: [], items: [],
express: [] express: [],
status: '0'
}, },
logisticsRecords: [], // 物流 logisticsRecords: [], // 物流
}; };
...@@ -132,7 +133,32 @@ ...@@ -132,7 +133,32 @@
'createTime': '申请时间:', 'createTime': '申请时间:',
'deliveryTime': '发货时间:', 'deliveryTime': '发货时间:',
} }
} },
operateTypes() {
return {
'1': 'cancelParts',
'10': '',
'15': 'receiveParts',
'20': '',
}
},
buttonOperateType() {
return this.operateTypes[this.info.status]
},
// 待签收 15 变 已签收 20; 10 待审核 1 变 已取消 -1
willStatuses() {
return {
'1': '-1',
'10': '',
'15': '20',
'20': '',
'-2': '',
'-1': ''
}
},
willStatus() {
return this.willStatuses[this.info.status]
},
}, },
onLoad() { onLoad() {
getApp().trackPage('仓库配件详情') getApp().trackPage('仓库配件详情')
...@@ -144,9 +170,28 @@ ...@@ -144,9 +170,28 @@
}, },
methods: { methods: {
handleClick() { handleClick() {
// 调借口 this.$u.api[this.operateType](this.info.id).then(res => {
// 修改info var type = 'error'
// 后退 var message = res.message
if (res.code === 200) {
if (res.data == true) {
this.info.status = this.willStatus
}
} else {
console.log(res.message)
}
this.$refs.uToast.show({
title: message,
type: type,
duration: 1000,
callback: function() {}
})
var pages = getCurrentPages();
if (pages.length >= 2) {
var page = pages[pages.length - 2];
page.needApplyList = true
}
})
}, },
// 查看物流 // 查看物流
handleClickExpress() { handleClickExpress() {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<view class="content-item"> <view class="content-item">
<view v-if="partsList && partsList.length > 0" class="order-row"> <view v-if="partsList && partsList.length > 0" class="order-row">
<view v-for="(item, index) in partsList" :key="item.orderId"> <view v-for="(item, index) in partsList" :key="item.orderId">
<AppliedCell @operate="handleOperate" :info="item" @action="handleClickCell"></AppliedCell> <AppliedCell @operate="handleOperate" :info="item" @action="handleClickCell" @express="handleClickExpress"></AppliedCell>
</view> </view>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore> <u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view> </view>
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
</view> </view>
</view> </view>
<view>
<u-toast ref="uToast" />
</view>
</view> </view>
</template> </template>
...@@ -70,6 +73,14 @@ ...@@ -70,6 +73,14 @@
return 'margin-top: 100rpx;background-color: #F4F5F7' return 'margin-top: 100rpx;background-color: #F4F5F7'
}, },
}, },
onShow() {
// 从过程反馈回来,需要刷新数据
let pages = getCurrentPages()
let page = pages[pages.length - 1]
if (page.needApplyList) {
this.getPartsList()
}
},
methods: { methods: {
searchOrder(index) { searchOrder(index) {
this.search.pageNumber = 1 this.search.pageNumber = 1
...@@ -124,14 +135,23 @@ ...@@ -124,14 +135,23 @@
}) })
}, },
handleClickCell(info) { handleClickCell(info) {
this.setPageInfo(info)
uni.navigateTo({
url: 'pages/mine/warehouse/partsDetail'
})
},
handleClickExpress(info) {
this.setPageInfo(info)
uni.navigateTo({
url: 'pages/mine/warehouse/express'
})
},
setPageInfo(info) {
var pages = getCurrentPages(); var pages = getCurrentPages();
if (pages.length >= 1) { if (pages.length >= 1) {
var page = pages[pages.length - 1]; var page = pages[pages.length - 1];
page.info = info page.info = info
} }
uni.navigateTo({
url: 'pages/mine/warehouse/partsDetail'
})
}, },
}, },
onReachBottom() { onReachBottom() {
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
@submit="$u.throttle(handleSubmit, 500)" /> @submit="$u.throttle(handleSubmit, 500)" />
</view> </view>
</template> </template>
<view class="fixed-button"> <view class="fixed-button" v-if="!showBounce">
<ApplyButton :type="buttonType" @click="handleClickApply"/> <ApplyButton :type="buttonType" @click="handleClickApply"/>
</view> </view>
</view> </view>
......
<template> <template>
<view class="order-wrap"> <view class="order-wrap">
<u-navbar :title="title" title-color="#FFFFFF" title-size="32" back-icon-color="#FFFFFF" :background="background" :border-bottom="false" title-bold></u-navbar> <u-navbar title-color="#FFFFFF" title-size="32" back-icon-color="#FFFFFF" :background="background" :border-bottom="false" title-bold></u-navbar>
<view class="content"> <view class="content">
<view class="header" v-if="showTimeView"> <view class="title-view">
<image class="bottom-tag-view" :src="tagImage"></image> <view class="title-text">{{title}}</view>
<!-- 倒计时 --> <!-- 拒单 -->
<view class="title"> <view v-show="allowRejection || 1" class="reject-button" @click="$u.throttle(rejectOrder, 500)">拒单</view>
<u-count-down :timestamp="timestamp" font-size="28" show-days separator="zh" separator-size="32" height="40"
:color="countColor" separator-color="#FFFFFF" @change="timeOutChange" ref="order-count-down" bg-color="#FFFFFF"></u-count-down>
<view class="header-content">
<!-- 抓紧时间提示 -->
<view class="tip-text">{{tipText}}</view>
<!-- 拒单 -->
<view v-show="allowRejection" class="reject-button" @click="$u.throttle(rejectOrder, 500)">拒单</view>
</view>
</view>
</view> </view>
<!-- 订单详情 --> <!-- 订单详情 -->
<view class="card"> <view class="card">
<view class="header" v-if="showTimeView">
<view class="header-left-view">
<image class="bottom-tag-view" :src="tagImage"></image>
<view class="tip-text" :style="{'color': countColor}">{{tipText}}</view>
</view>
<!-- 倒计时 -->
<view class="title">
<u-count-down :timestamp="timestamp" font-size="28" show-days separator="zh" separator-size="32" height="40"
color="#FFFFFF" separator-color="#666666" @change="timeOutChange" ref="order-count-down" :bg-color="countColor"></u-count-down>
</view>
</view>
<Detail :order="order" :readMore.sync="readMore" :operate="isAllowDianhuaAndDaohang"></Detail> <Detail :order="order" :readMore.sync="readMore" :operate="isAllowDianhuaAndDaohang"></Detail>
</view> </view>
<!-- 从我的页面进来显示结算信息 --> <!-- 从我的页面进来显示结算信息 -->
...@@ -77,7 +79,7 @@ ...@@ -77,7 +79,7 @@
</view> </view>
</u-popup> </u-popup>
<!-- 已申请配件列表 --> <!-- 已申请配件列表 -->
<ApplyList :show.sync="showApplyList" :list="partsList" @operate="handleOperate" @apply="handleApply"></ApplyList> <ApplyList :show.sync="showApplyList" :list="partsList" @action="handleClickCell" @operate="handleOperate" @apply="handleApply"></ApplyList>
</template> </template>
</view> </view>
</template> </template>
...@@ -240,10 +242,10 @@ ...@@ -240,10 +242,10 @@
return this.timeout ? this.chaoshiImage : this.shengyuImage return this.timeout ? this.chaoshiImage : this.shengyuImage
}, },
chaoshiImage() { chaoshiImage() {
return process.uniEnv.qn_base_url + 'chaoshi.png' return process.uniEnv.qn_base_url + 'chaoshi-red.png'
}, },
shengyuImage() { shengyuImage() {
return process.uniEnv.qn_base_url + 'shengyu.png' return process.uniEnv.qn_base_url + 'shengyu-blue.png'
}, },
types() { types() {
return { return {
...@@ -268,13 +270,7 @@ ...@@ -268,13 +270,7 @@
return [this.type0Text,'预约','签到','去完工','','','','','已被抢',''] return [this.type0Text,'预约','签到','去完工','','','','','已被抢','']
}, },
tipText() { // 时间紧迫提示文字 tipText() { // 时间紧迫提示文字
return this.timeout ? '您的订单已超时,请及时' + this.tipTypeText : '请您注意剩余时间,及时' + this.tipTypeText return this.timeout ? '订单超时' : '剩余时间'
},
tipTexts() {
return ['接单','预约','签到','完工','','','','','','']
},
tipTypeText() {
return this.tipTexts[this.types[this.type]]
}, },
title() { // 标题 title() { // 标题
return this.titles[this.types[this.type]] return this.titles[this.types[this.type]]
...@@ -359,6 +355,9 @@ ...@@ -359,6 +355,9 @@
this.loadOrderDetail() this.loadOrderDetail()
this.loadOrderRecord() this.loadOrderRecord()
} }
if (page.needApplyList) {
this.getApplyList()
}
}, },
onUnload() { onUnload() {
this.unloaded = true this.unloaded = true
...@@ -655,9 +654,16 @@ ...@@ -655,9 +654,16 @@
break break
} }
}, },
async handleApplyParts() { // 点击了配件申请按钮
handleApplyParts() { // 点击了配件申请按钮
if (this.buttons[3].count > 0) { // 已经有配件,弹出配件列表 if (this.buttons[3].count > 0) { // 已经有配件,弹出配件列表
this.showApplyList = true this.showApplyList = true
this.getApplyList()
} else { // 没有配件,跳到配件申请
this.toApplyParts()
}
},
async getApplyList() {
let res = await this.$u.api.applyList({ let res = await this.$u.api.applyList({
'pageSize': 1000, 'pageSize': 1000,
'pageNumbr': 1, 'pageNumbr': 1,
...@@ -665,11 +671,8 @@ ...@@ -665,11 +671,8 @@
'workOrderId': this.order.orderId 'workOrderId': this.order.orderId
}) })
if(res && res.code == 200) { if(res && res.code == 200) {
this.partsList = res.data this.partsList = res.data || []
} }
} else { // 没有配件,跳到配件申请
this.toApplyParts()
}
}, },
handleBtn() { handleBtn() {
console.log('click button') console.log('click button')
...@@ -907,7 +910,47 @@ ...@@ -907,7 +910,47 @@
// 添加客服 // 添加客服
}, },
handleOperate() { // 点了弹窗里的配件操作 handleOperate() { // 点了弹窗里的配件操作
this.$u.api[operateType](partsId).then(res => {
var type = 'error'
var message = res.message
if (res.code === 200) {
if (res.data == true) {
for (var item of this.partsList) {
if (item.id == partsId) {
item.status = willStatus
break
}
}
}
} else {
console.log(res.message)
}
this.$refs.uToast.show({
title: message,
type: type,
duration: 1000,
callback: function() {}
})
})
},
handleClickCell(info) {
this.setPageInfo(info)
uni.navigateTo({
url: 'pages/mine/warehouse/partsDetail'
})
},
handleClickExpress(info) {
this.setPageInfo(info)
uni.navigateTo({
url: 'pages/mine/warehouse/express'
})
},
setPageInfo(info) {
var pages = getCurrentPages();
if (pages.length >= 1) {
var page = pages[pages.length - 1];
page.info = info
}
}, },
handleApply() { // 点了弹窗的申请配件 handleApply() { // 点了弹窗的申请配件
this.toApplyParts() this.toApplyParts()
...@@ -926,6 +969,10 @@ ...@@ -926,6 +969,10 @@
margin-left: 6rpx; margin-left: 6rpx;
margin-right: 6rpx; margin-right: 6rpx;
} }
.u-mode-center-box {
background-color: transparent !important;
padding-top: 40rpx;
}
} }
</style> </style>
...@@ -941,55 +988,61 @@ ...@@ -941,55 +988,61 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.header {
padding: 4rpx 2rpx 24rpx 2rpx;
display: flex;
align-items: center;
.bottom-tag-view {
width: 116rpx;
height: 116rpx;
flex-shrink: 0;
}
.title {
margin-left: 24rpx;
margin-top: 6rpx;
width: 100%;
.header-content {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 24rpx;
min-height: 36rpx;
.tip-text {
font-size: 26rpx;
color: #EFEFEF;
}
.reject-button {
text-align: center;
width: 106rpx;
height: 52rpx;
border-radius: 40rpx;
font-size: 24rpx;
font-weight: 400;
line-height: 52rpx;
color: #DEDEDE;
text-align: right;
}
}
}
}
.content { .content {
height: 100%; height: 100%;
border-radius: 12rpx; border-radius: 12rpx;
overflow: auto; overflow: auto;
margin: 0rpx 30rpx 30rpx 30rpx; margin: 0rpx 30rpx 30rpx 30rpx;
.title-view {
display: flex;
justify-content: space-between;
align-items: flex-end;
margin-bottom: 20rpx;
.title-text {
font-weight: bold;
font-size: 48rpx;
color: #FFFFFF;
}
.reject-button {
width: 106rpx;
height: 52rpx;
font-size: 26rpx;
line-height: 52rpx;
color: #DEDEDE;
text-align: right;
margin-right: 4rpx;
}
}
.card { .card {
background-color: #FFFFFF; background-color: #FFFFFF;
margin-bottom: 20rpx; margin-bottom: 20rpx;
padding: 30rpx 30rpx 0 30rpx; padding: 30rpx 30rpx 0 30rpx;
border-radius: 6px; border-radius: 6px;
.header {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 2rpx solid #F4F5F7;
padding-bottom: 30rpx;
margin-bottom: 30rpx;
.header-left-view {
display: flex;
align-items: center;
.bottom-tag-view {
width: 40rpx;
height: 40rpx;
margin-right: 10rpx;
}
.tip-text {
font-size: 32rpx;
font-weight: bold;
color: #2272FF;
}
}
}
} }
.record-item { .record-item {
......
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