Commit f242b1ca authored by 刘文虎's avatar 刘文虎

1.5.7版本更新 收货 盘点功能

parent aebe688a
import util from '@/utils/util.js'
const jsonType = {'content-type': 'application/json'}
const formType = {'content-type': 'application/x-www-form-urlencoded'}
const dataType = {'content-type': 'multipart/form-data'}
const jsonType = {
'content-type': 'application/json'
}
const formType = {
'content-type': 'application/x-www-form-urlencoded'
}
const dataType = {
'content-type': 'multipart/form-data'
}
let inventoryApiFun = function(vm){
let inventoryApiFun = function(vm) {
// 接口公共前缀
let parts="/wxh-worker-rest/rest/parts/" //收货 inventory 模块
let parts = "/wxh-worker-rest/rest/parts/" //收货 inventory 模块
/**
* 盘点列表
*/
let inventoryListByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token +
'/take/stock/take/stock', params);
/**
* 盘点详情
*/
let inventoryDetailByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token +
'/take/stock/detail/' + params);
/**
* 新增盘点
*/
let addInventoryByInventoryModules = async (params = {}) => await vm.$u.post(parts + vm.vuex_token +
'/take/stock/detail/add', params, formType);
/**
* 收货列表
* 删除盘点
*/
let inventoryListByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/take/stock/take/stock', params);
let deleteInventoryByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token +
'/take/stock/detail/delete/' + params);
/**
* 收货单详情
* 提交盘点
*/
let inventoryDetailByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/take/stock/sign/detail/'+ params);
let confirmInventoryByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token +
'/take/stock/take/submit/' + params);
/**
* 确认收货
* 提交盘点
*/
let addInventoryByInventoryModules = async (params = {}) => await vm.$u.post(parts + vm.vuex_token + '/take/stock/detail/add', params,formType);
let applyReInventoryByInventoryModules = async (params = {}) => await vm.$u.get(parts + vm.vuex_token +
'/take/stock/take/submit/' + params);
const inventoryApi = {
inventoryListByInventoryModules,
inventoryDetailByInventoryModules,
addInventoryByInventoryModules,
deleteInventoryByInventoryModules,
confirmInventoryByInventoryModules,
applyReInventoryByInventoryModules
}
return inventoryApi
}
module.exports = {
module.exports = {
inventoryApiFun
}
// 自定义filter
export function myFilter(value, options,key="label") {
export function myFilter(value, options, key = "label") {
if (options && options instanceof Array) {
let arr = options.filter(item => item.value === value)
if (arr.length) {
......@@ -13,12 +13,12 @@ export function myFilter(value, options,key="label") {
}
// showToast
export function showToast(title,mask=true) {
export function showToast(title, mask = true) {
uni.showToast({
title,
icon: 'none',
mask,
duration:2000
duration: 2000
})
}
......@@ -46,4 +46,12 @@ export function showModal({
}
});
}, 1);
}
\ No newline at end of file
}
export function setNeedRefresh() {
var pages = getCurrentPages();
if (pages.length >= 2) {
var page = pages[pages.length - 2];
page.needRefresh = true
}
}
export const inventoryStatusOptions = [{
value: "0",
label: "盘点中",
},
{
value: "1",
label: "已提交",
},
{
value: "2",
label: "申请重盘",
},
{
value: "3",
label: "盘点完成",
},
]
export const takeDetailStatusOptions = [{
value: "0",
label: "匹配",
},
{
value: "1",
label: "已使用",
},
{
value: "2",
label: "未在库",
}
]
......@@ -7,3 +7,19 @@ export const receiveStatusOptions = [{
value: 1
}
]
export const statusOptions = [{
label: '未使用',
value: "0"
},
{
label: '已使用',
value: "1"
}
]
export const statusColorOptions = {
"已使用": '#666666',
"匹配": '#2272ff',
"未在库": '#FA5A49'
}
<template>
<!-- 底部按钮 -->
<view class="fixed-button"><xh-button @handleClick="handleClick" :text="text"></xh-button></view>
<view class="fixed-button"><xh-button :disabled="disabled" :text="text" @handleClick="handleClick"></xh-button></view>
</template>
<script>
import XhButton from "./xh-button.vue"
import XhButton from './xh-button.vue';
export default {
name:"FixedButton",
components:{
name: 'FixedButton',
components: {
XhButton
},
props:{
text:{
type:String,
default:"提交"
props: {
text: {
type: String | null,
default: '提交'
},
disabled:{
type:Boolean,
default: false
}
},
data() {
......@@ -26,9 +30,9 @@ export default {
}
};
},
methods:{
handleClick(){
this.$emit("handleClick")
methods: {
handleClick() {
this.$emit('handleClick');
}
}
};
......@@ -39,6 +43,7 @@ export default {
width: 100%;
box-sizing: border-box;
position: fixed;
z-index: 99999;
left: 0;
padding: 0 30rpx;
padding-bottom: constant(safe-area-inset-bottom);
......
<template>
<u-button class="settle-button" type="primary" shape="circle" @click="handleClick" :custom-style="buttonStyle">{{ text }}</u-button>
<u-button class="settle-button" type="primary" shape="circle" @click="handleClick" :disabled="disabled" :custom-style="buttonStyle">{{ text }}</u-button>
</template>
<script>
......@@ -7,8 +7,12 @@ export default {
name: 'XhButton',
props: {
text: {
type: String,
type: String | null,
default: '提交'
},
disabled:{
type:Boolean,
default: false
}
},
data() {
......
......@@ -9,7 +9,7 @@
export default {
props: {
customStyle: {
type: String,
type: String|null,
default: 'background-color: #FFFFFF'
},
imageName: { // 图片
......
......@@ -388,7 +388,8 @@
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "充电桩收货",
"enablePullDownRefresh": false
"enablePullDownRefresh": false,
"disableScroll": true
}
},
......
<template>
<TabBarPage title="扳手会" :fixed="true" @click="goTop">
<view class="content-view">
<scroll-view
style="height: 100%;"
scroll-y
@scrolltolower="reachBottom"
:scroll-top="scrollTop"
@scroll="scroll"
scroll-anchoring
refresher-enabled="true"
:refresher-triggered="triggered"
:refresher-threshold="100"
refresher-background="#F4F5F7"
@refresherrefresh="onRefresh"
@refresherrestore="onRestore"
enable-back-to-top
>
<image
class="banner-image"
:src="bannerImage"
@click="handleClickBanner"
></image>
<view class="msg-view">
<view class="msg-title">最新消息</view>
<view class="msg-list-view">
<view
class="msg-content"
v-for="(item, index) in messageList"
:key="index"
@click="toNewsDetail(item)"
>
<view class="msg-content-view">
<view class="left-view">
<image
class="msg-icon"
:src="msgStyleImage[item.is_top]"
></image>
<text class="msg-text">{{ item.title }}</text>
</view>
<image class="right-icon" :src="shouyeyouImage"></image>
</view>
<view class="line-view" v-if="index != 1"></view>
</view>
</view>
</view>
<view class="sticky">
<text>订单推荐</text>
</view>
<view class="order-view">
<!-- 入驻成功之后显示推荐订单列表 -->
<view class="order-list-view" v-if="loaded">
<!-- 入驻前-->
<view v-if="needSettled" class="tip-view">
<image :src="weiruzhuImage" class="tip-view-image"></image>
<view class="tip-other">入驻后平台将向您分配或推荐订单</view>
<u-button
class="settle-button"
type="primary"
shape="circle"
@click="immediatelyIn"
:custom-style="buttonStyle"
>
立即入驻
</u-button>
</view>
<template v-else>
<!-- 入驻成功之后无推荐订单 -->
<view
v-if="orderList.length <= 0 && loadedOrder"
class="no-order-view"
>
<NoOrder />
</view>
<view v-else-if="orderList.length > 0" class="order-item-view">
<view v-for="(item, index) in orderList" :key="index">
<OrderCell
:orderData="item"
type="waitAccept"
:location="location"
@click="handleClick"
@action="handleClick"
>
</OrderCell>
</view>
<view
class="load-more-view"
v-show="
(search.pageNumber == 1 && loadedOrder) ||
search.pageNumber > 1
"
>
<u-loadmore
:status="currentLoadStatus"
bgColor="#F4F5F7"
></u-loadmore>
</view>
</view>
</template>
</view>
</view>
<view class="bottom-view" v-if="needSettled || orderList.length <= 0">
<view class="bottom-line-view"></view>
<view class="bottom-text">我也是有底线哒</view>
<view class="bottom-line-view"></view>
</view>
</scroll-view>
<!-- 悬浮按钮 -->
<!-- <EusingList /> -->
</view>
<upload-progress />
<MaskTip
:show="showMask"
imageName="mengceng2.png"
:imageStyle="imageStyle"
name="upload_tip"
/>
</TabBarPage>
<TabBarPage title="扳手会" :fixed="true" @click="goTop">
<view class="content-view">
<scroll-view
style="height: 100%;"
scroll-y
@scrolltolower="reachBottom"
:scroll-top="scrollTop"
@scroll="scroll"
scroll-anchoring
refresher-enabled="true"
:refresher-triggered="triggered"
:refresher-threshold="100"
refresher-background="#F4F5F7"
@refresherrefresh="onRefresh"
@refresherrestore="onRestore"
enable-back-to-top
>
<image class="banner-image" :src="bannerImage" @click="handleClickBanner"></image>
<view class="msg-view">
<view class="msg-title">最新消息</view>
<view class="msg-list-view">
<view class="msg-content" v-for="(item, index) in messageList" :key="index" @click="toNewsDetail(item)">
<view class="msg-content-view">
<view class="left-view">
<image class="msg-icon" :src="msgStyleImage[item.is_top]"></image>
<text class="msg-text">{{ item.title }}</text>
</view>
<image class="right-icon" :src="shouyeyouImage"></image>
</view>
<view class="line-view" v-if="index != 1"></view>
</view>
</view>
</view>
<view class="sticky"><text>订单推荐</text></view>
<view class="order-view">
<!-- 入驻成功之后显示推荐订单列表 -->
<view class="order-list-view" v-if="loaded">
<!-- 入驻前-->
<view v-if="needSettled" class="tip-view">
<image :src="weiruzhuImage" class="tip-view-image"></image>
<view class="tip-other">入驻后平台将向您分配或推荐订单</view>
<u-button class="settle-button" type="primary" shape="circle" @click="immediatelyIn" :custom-style="buttonStyle">立即入驻</u-button>
</view>
<template v-else>
<!-- 入驻成功之后无推荐订单 -->
<view v-if="orderList.length <= 0 && loadedOrder" class="no-order-view"><NoOrder /></view>
<view v-else-if="orderList.length > 0" class="order-item-view">
<view v-for="(item, index) in orderList" :key="index">
<OrderCell :orderData="item" type="waitAccept" :location="location" @click="handleClick" @action="handleClick"></OrderCell>
</view>
<view class="load-more-view" v-show="(search.pageNumber == 1 && loadedOrder) || search.pageNumber > 1">
<u-loadmore :status="currentLoadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
</view>
</template>
</view>
</view>
<view class="bottom-view" v-if="needSettled || orderList.length <= 0">
<view class="bottom-line-view"></view>
<view class="bottom-text">我也是有底线哒</view>
<view class="bottom-line-view"></view>
</view>
</scroll-view>
<!-- 悬浮按钮 -->
<!-- <EusingList /> -->
</view>
<upload-progress />
<MaskTip :show="showMask" imageName="mengceng2.png" :imageStyle="imageStyle" name="upload_tip" />
</TabBarPage>
</template>
<script>
import TabBarPage from '@/components/tabBarList/index.vue'
import NoOrder from '@/components/order/noOrder.vue'
import MaskTip from '@/components/mask-tip/index.vue'
const app = getApp()
import OrderCell from '@/components/order/index.vue'
import TabBarPage from '@/components/tabBarList/index.vue';
import NoOrder from '@/components/order/noOrder.vue';
import MaskTip from '@/components/mask-tip/index.vue';
const app = getApp();
import OrderCell from '@/components/order/index.vue';
// import EusingList from '@/components/order/eusingList.vue'
export default {
components: {
OrderCell,
TabBarPage,
NoOrder,
MaskTip,
// EusingList,
},
data() {
return {
status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',6=>'已签约',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
location: [], // 经纬度
// title: false,
// title: 'Hello',
loaded: false,
loadedOrder: false,
needSettled: false,
count: 0, // 推荐订单数量
messageList: [],
currentLoadStatus: 'loading',
orderList: [],
search: {
token: '',
pageNumber: 0,
pageSize: 15,
},
waitInit: false, // 当token为空时,等待自动登录结束
triggered: true,
scrollTop: 0,
old: {
scrollTop: 0,
},
showMask: false,
}
},
watch: {
vuex_token(val, oldVal) {
// 监听token变化,如果更新则重新加载页面数据
val && this.waitInit && this.getData()
},
},
computed: {
buttonStyle() {
return {
width: '300rpx',
height: '80rpx',
'font-size': '32rpx',
'font-weight': 'bold',
}
},
countKeys() {
return [
'toAppointmentCount',
'toCheckinCount',
'toFinishCount',
'reviewingCount',
'exceptionCount',
]
},
msgStyleImage() {
return {
'1': process.uniEnv.qn_base_url + 'zhiding.png', // 置顶
'0': process.uniEnv.qn_base_url + 'tongzhi.png', // 通知
// '3': process.uniEnv.qn_base_url + "xiaoxi.png", // 消息
}
},
bannerImage() {
return process.uniEnv.qn_base_url + 'banner-1.png'
},
shouyeyouImage() {
return process.uniEnv.qn_base_url + 'shouyeyou.png'
},
weiruzhuImage() {
return process.uniEnv.qn_base_url + 'weiruzhu.png'
},
imageStyle() {
return 'width:628rpx; margin-top:816rpx; margin-left:122rpx'
}
},
onLoad(e) {
app.trackPage('自营平台首页')
this._freshing = false
if (this.vuex_token) {
this.getOrderCount()
} else {
this.waitInit = true
}
this.showMaskTip()
},
onShow() {
// 每次进入页面都刷新入驻状态
this.pageNumber = 0
this.initSettleInfo()
},
methods: {
getData() {
this.getOrderCount()
this.initSettleInfo()
},
handleClick(item, type, showCountTime) {
// 跳转工单详情页面 showCountTime:是否显示倒计时
// type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url:
'pages/order/detail?id=' +
item.orderId +
'&type=' +
type +
'&showCountTime=' +
showCountTime,
})
},
async initSettleInfo() {
let self = this
// 加载消息列表
this.loadMessageList()
if (this.vuex_token) {
const callBack = (vm, result) => {
// 后台自动判断入驻流程是否完成,前台通过status确定状态
if (result && result.record) {
// 不返回该字段或返回true代表需要入驻
vm.needSettled = result.needSettled == undefined ? true : result.needSettled
vm.status = Number(result.record.status || '0')
// vm.status = 8
}
}
self.search.pageNumber = 0
self.loadedOrder = false
await app.getBaseInfo(self, callBack)
if (this.status == 7) {
this.getLocation()
self.loadOrderList()
}
this.loaded = true
} else {
this.loaded = true
}
},
loadMessageList() {
let self = this
self.$u.api.listByNotice().then((res) => {
uni.stopPullDownRefresh() // 结束下拉刷新
if (res.code == 200) {
if (res.data && res.data.length > 2) {
self.messageList = res.data.slice(0, 2)
} else {
self.messageList = res.data || []
}
} else {
console.log(res.message, '初始化消息列表异常')
}
})
},
async loadOrderList() {
this.search.pageNumber += 1
let self = this
// 加载订单列表
self.search.token = self.vuex_token
self.$u.api.listByRecommendOrder(self.search).then((res) => {
self.loadedOrder = true
if (res.code == 200 && res.data) {
if (self.search.pageNumber == 1) {
self.orderList = []
}
if (res.data.list) {
// self.orderList.push(...res.data.list)
// 更新每一条时间戳,防止后台返回的数据和原先一样,不触发ordercell的时间计算
var time = new Date().getTime()
for (var item of res.data.list) {
item.currentCellTime = time
self.orderList.push(item)
}
}
self.currentLoadStatus =
res.data.total > self.orderList.length &&
(res.data.list || []).length == self.search.pageSize
? 'loadmore'
: 'nomore'
} else {
console.log(res.message, '初始化订单列表异常')
}
self.$nextTick(() => {
if (self._freshing) {
self.triggered = false
self._freshing = false
}
})
})
},
reachBottom() {
if (this.vuex_token) {
if (this.currentLoadStatus != 'loadmore') return
this.currentLoadStatus == 'loading'
this.loadOrderList()
}
},
onRefresh() {
if (this._freshing) return
this._freshing = true
this.initSettleInfo()
},
onRestore() {
this.triggered = 'restore' // 需要重置
},
scroll(e) {
this.old.scrollTop = e.detail.scrollTop
},
goTop(e) {
this.scrollTop = this.old.scrollTop
this.$nextTick(function() {
this.scrollTop = 0
})
},
/* 立即入驻 */
immediatelyIn() {
if (this.vuex_token) {
// 用户已登录
var pageIndex = 1
// 0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
switch (this.status) {
case 1:
case 2:
case 3:
case 4:
pageIndex = 2
break
case 8:
pageIndex = 3
break
case 5:
case 6:
pageIndex = 4
break
case 7:
pageIndex = 5
break
default:
pageIndex = 1
break
}
uni.navigateTo({
url:
this.status > 0
? '/pages/settle/prompt?pageIndex=' + pageIndex
: '/pages/settle/index',
})
} else {
// 用户未登录
uni.navigateTo({
url: 'pages/login/index',
})
}
},
// 获取订单数量
getOrderCount() {
var self = this // 加载订单列表
self.$u.api.listOrderCount().then((res) => {
if (res.code == 200) {
if (res.data) {
var count = 0
for (var item of this.countKeys) {
count += res.data[item] || 0
}
// 修改tab总数
if (count > 0) {
uni.setTabBarBadge({
index: 1,
text: String(count),
})
} else {
uni.removeTabBarBadge({
index: 1,
})
}
}
} else {
console.log(res.message, '获取订单数量失败!')
}
})
},
/**
* 获取当前位置的经纬度
*/
getLocation() {
let self = this
uni.getLocation({
type: 'gcj02',
success: function(res) {
self.location = [res.latitude, res.longitude]
},
complete: function(res) {
if (res.errMsg.indexOf('auth') != -1) {
uni.showModal({
title: '提示',
content: '获取权限失败,请到设置页面开启权限',
confirmText: '好的',
success(res) {
if (res.confirm) {
uni.openSetting({
success(res) {
console.log(res.authSetting)
},
})
}
},
})
}
},
fail: function(err) {},
})
},
toNewsDetail(item) {
wx.navigateTo({
url: '/pages/learn/news-details',
success: function(res) {
res.eventChannel.emit('acceptDataFromLearn', item)
},
})
},
handleClickBanner() {
uni.navigateTo({
url: '/pages/mine/customer/index' + '?type=exclusive',
})
},
// 显示提示蒙版
showMaskTip() {
this.showMask = true
},
},
}
components: {
OrderCell,
TabBarPage,
NoOrder,
MaskTip
// EusingList,
},
data() {
return {
status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',6=>'已签约',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
location: [], // 经纬度
// title: false,
// title: 'Hello',
loaded: false,
loadedOrder: false,
needSettled: false,
count: 0, // 推荐订单数量
messageList: [],
currentLoadStatus: 'loading',
orderList: [],
search: {
token: '',
pageNumber: 0,
pageSize: 15
},
waitInit: false, // 当token为空时,等待自动登录结束
triggered: true,
scrollTop: 0,
old: {
scrollTop: 0
},
showMask: false
};
},
watch: {
vuex_token(val, oldVal) {
// 监听token变化,如果更新则重新加载页面数据
val && this.waitInit && this.getData();
}
},
computed: {
buttonStyle() {
return {
width: '300rpx',
height: '80rpx',
'font-size': '32rpx',
'font-weight': 'bold'
};
},
countKeys() {
return ['toAppointmentCount', 'toCheckinCount', 'toFinishCount', 'reviewingCount', 'exceptionCount'];
},
msgStyleImage() {
return {
'1': process.uniEnv.qn_base_url + 'zhiding.png', // 置顶
'0': process.uniEnv.qn_base_url + 'tongzhi.png' // 通知
// '3': process.uniEnv.qn_base_url + "xiaoxi.png", // 消息
};
},
bannerImage() {
return process.uniEnv.qn_base_url + 'banner-1.png';
},
shouyeyouImage() {
return process.uniEnv.qn_base_url + 'shouyeyou.png';
},
weiruzhuImage() {
return process.uniEnv.qn_base_url + 'weiruzhu.png';
},
imageStyle() {
return 'width:628rpx; margin-top:816rpx; margin-left:122rpx';
}
},
onLoad(e) {
app.trackPage('自营平台首页');
this.freshing = false;
if (this.vuex_token) {
this.getOrderCount();
} else {
this.waitInit = true;
}
this.showMaskTip();
},
onShow() {
// 每次进入页面都刷新入驻状态
this.pageNumber = 0;
this.initSettleInfo();
},
methods: {
getData() {
this.getOrderCount();
this.initSettleInfo();
},
handleClick(item, type, showCountTime) {
// 跳转工单详情页面 showCountTime:是否显示倒计时
// type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url: 'pages/order/detail?id=' + item.orderId + '&type=' + type + '&showCountTime=' + showCountTime
});
},
async initSettleInfo() {
let self = this;
// 加载消息列表
this.loadMessageList();
if (this.vuex_token) {
const callBack = (vm, result) => {
// 后台自动判断入驻流程是否完成,前台通过status确定状态
if (result && result.record) {
// 不返回该字段或返回true代表需要入驻
vm.needSettled = result.needSettled == undefined ? true : result.needSettled;
vm.status = Number(result.record.status || '0');
// vm.status = 8
}
};
self.search.pageNumber = 0;
self.loadedOrder = false;
await app.getBaseInfo(self, callBack);
if (this.status == 7) {
this.getLocation();
self.loadOrderList();
}
this.loaded = true;
} else {
this.loaded = true;
}
},
loadMessageList() {
let self = this;
self.$u.api.listByNotice().then(res => {
uni.stopPullDownRefresh(); // 结束下拉刷新
if (res.code == 200) {
if (res.data && res.data.length > 2) {
self.messageList = res.data.slice(0, 2);
} else {
self.messageList = res.data || [];
}
} else {
console.log(res.message, '初始化消息列表异常');
}
});
},
async loadOrderList() {
this.search.pageNumber += 1;
let self = this;
// 加载订单列表
self.search.token = self.vuex_token;
self.$u.api.listByRecommendOrder(self.search).then(res => {
self.loadedOrder = true;
if (res.code == 200 && res.data) {
if (self.search.pageNumber == 1) {
self.orderList = [];
}
if (res.data.list) {
// self.orderList.push(...res.data.list)
// 更新每一条时间戳,防止后台返回的数据和原先一样,不触发ordercell的时间计算
var time = new Date().getTime();
for (var item of res.data.list) {
item.currentCellTime = time;
self.orderList.push(item);
}
}
self.currentLoadStatus = res.data.total > self.orderList.length && (res.data.list || []).length == self.search.pageSize ? 'loadmore' : 'nomore';
} else {
console.log(res.message, '初始化订单列表异常');
}
self.$nextTick(() => {
if (self.freshing) {
self.triggered = false;
self.freshing = false;
}
});
});
},
reachBottom() {
if (this.vuex_token) {
if (this.currentLoadStatus != 'loadmore') return;
this.currentLoadStatus == 'loading';
this.loadOrderList();
}
},
onRefresh() {
if (this.freshing) return;
this.freshing = true;
this.initSettleInfo();
},
onRestore() {
this.triggered = 'restore'; // 需要重置
},
scroll(e) {
this.old.scrollTop = e.detail.scrollTop;
},
goTop(e) {
this.scrollTop = this.old.scrollTop;
this.$nextTick(function() {
this.scrollTop = 0;
});
},
/* 立即入驻 */
immediatelyIn() {
if (this.vuex_token) {
// 用户已登录
var pageIndex = 1;
// 0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
switch (this.status) {
case 1:
case 2:
case 3:
case 4:
pageIndex = 2;
break;
case 8:
pageIndex = 3;
break;
case 5:
case 6:
pageIndex = 4;
break;
case 7:
pageIndex = 5;
break;
default:
pageIndex = 1;
break;
}
uni.navigateTo({
url: this.status > 0 ? '/pages/settle/prompt?pageIndex=' + pageIndex : '/pages/settle/index'
});
} else {
// 用户未登录
uni.navigateTo({
url: 'pages/login/index'
});
}
},
// 获取订单数量
getOrderCount() {
var self = this; // 加载订单列表
self.$u.api.listOrderCount().then(res => {
if (res.code == 200) {
if (res.data) {
var count = 0;
for (var item of this.countKeys) {
count += res.data[item] || 0;
}
// 修改tab总数
if (count > 0) {
uni.setTabBarBadge({
index: 1,
text: String(count)
});
} else {
uni.removeTabBarBadge({
index: 1
});
}
}
} else {
console.log(res.message, '获取订单数量失败!');
}
});
},
/**
* 获取当前位置的经纬度
*/
getLocation() {
let self = this;
uni.getLocation({
type: 'gcj02',
success: function(res) {
self.location = [res.latitude, res.longitude];
},
complete: function(res) {
if (res.errMsg.indexOf('auth') != -1) {
uni.showModal({
title: '提示',
content: '获取权限失败,请到设置页面开启权限',
confirmText: '好的',
success(res) {
if (res.confirm) {
uni.openSetting({
success(res) {
console.log(res.authSetting);
}
});
}
}
});
}
},
fail: function(err) {}
});
},
toNewsDetail(item) {
wx.navigateTo({
url: '/pages/learn/news-details',
success: function(res) {
res.eventChannel.emit('acceptDataFromLearn', item);
}
});
},
handleClickBanner() {
uni.navigateTo({
url: '/pages/mine/customer/index' + '?type=exclusive'
});
},
// 显示提示蒙版
showMaskTip() {
this.showMask = true;
}
}
};
</script>
<style lang="scss" scoped>
.banner-image {
width: 730rpx;
height: 280rpx;
margin-left: -16rpx;
width: 730rpx;
height: 280rpx;
margin-left: -16rpx;
}
.content-view {
height: 100%;
overflow: auto;
height: 100%;
overflow: auto;
}
.msg-view {
.msg-title {
color: #333333;
font-size: 32rpx;
font-weight: bold;
padding: 1rpx 0rpx 30rpx 0rpx;
}
.msg-list-view {
border-radius: 12rpx;
background-color: #ffffff;
padding: 12rpx 30rpx;
height: 174rpx;
}
.msg-content {
color: #333333;
font-size: 26rpx;
.msg-content-view {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20rpx;
margin-bottom: 20rpx;
.left-view {
display: flex;
align-items: center;
.msg-icon {
width: 80rpx;
height: 36rpx;
margin-right: 20rpx;
}
.msg-text {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 448rpx;
}
}
.right-icon {
width: 14rpx;
height: 24rpx;
}
}
.line-view {
height: 2rpx;
background-color: #f4f5f7;
}
}
.msg-title {
color: #333333;
font-size: 32rpx;
font-weight: bold;
padding: 1rpx 0rpx 30rpx 0rpx;
}
.msg-list-view {
border-radius: 12rpx;
background-color: #ffffff;
padding: 12rpx 30rpx;
height: 174rpx;
}
.msg-content {
color: #333333;
font-size: 26rpx;
.msg-content-view {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20rpx;
margin-bottom: 20rpx;
.left-view {
display: flex;
align-items: center;
.msg-icon {
width: 80rpx;
height: 36rpx;
margin-right: 20rpx;
}
.msg-text {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 448rpx;
}
}
.right-icon {
width: 14rpx;
height: 24rpx;
}
}
.line-view {
height: 2rpx;
background-color: #f4f5f7;
}
}
}
.logo {
height: 200 rpx;
width: 100%;
margin: 0 rpx auto 50 rpx auto;
height: 200 rpx;
width: 100%;
margin: 0 rpx auto 50 rpx auto;
}
.text-area {
display: flex;
justify-content: center;
display: flex;
justify-content: center;
}
.title {
font-size: 36 rpx;
color: #8f8f94;
font-size: 36 rpx;
color: #8f8f94;
}
// .sticky-view {
......@@ -560,73 +492,73 @@ export default {
// }
.sticky {
background-color: #f4f5f7;
color: #fff;
padding: 24 rpx;
text-align: left;
font-size: 32rpx;
font-weight: bold;
color: #333333;
padding: 46rpx 0 28rpx 0;
background-color: #f4f5f7;
color: #fff;
padding: 24 rpx;
text-align: left;
font-size: 32rpx;
font-weight: bold;
color: #333333;
padding: 46rpx 0 28rpx 0;
}
.order-view {
text-align: center;
.order-list-view {
.tip-view {
padding: 30rpx;
background-color: #ffffff;
border-radius: 12rpx;
min-height: 460rpx;
.tip-view-image {
width: 328rpx;
height: 200rpx;
margin-top: 30rpx;
}
.tip-other {
font-size: 28rpx;
color: #666666;
margin-bottom: 30rpx;
}
.settle-button {
}
}
.order-item-view {
background-color: #f4f5f7;
border-radius: 12rpx;
margin-bottom: 20rpx;
.load-more-view {
padding-bottom: 44rpx;
}
}
}
text-align: center;
.order-list-view {
.tip-view {
padding: 30rpx;
background-color: #ffffff;
border-radius: 12rpx;
min-height: 460rpx;
.tip-view-image {
width: 328rpx;
height: 200rpx;
margin-top: 30rpx;
}
.tip-other {
font-size: 28rpx;
color: #666666;
margin-bottom: 30rpx;
}
.settle-button {
}
}
.order-item-view {
background-color: #f4f5f7;
border-radius: 12rpx;
margin-bottom: 20rpx;
.load-more-view {
padding-bottom: 44rpx;
}
}
}
}
.bottom-view {
display: flex;
align-items: center;
justify-content: space-between;
padding: 50rpx 40rpx 50rpx 40rpx;
.bottom-line-view {
background-color: #d5d5d5;
height: 2rpx;
width: 30%;
}
.bottom-text {
color: #999999;
font-size: 24rpx;
}
display: flex;
align-items: center;
justify-content: space-between;
padding: 50rpx 40rpx 50rpx 40rpx;
.bottom-line-view {
background-color: #d5d5d5;
height: 2rpx;
width: 30%;
}
.bottom-text {
color: #999999;
font-size: 24rpx;
}
}
.fixed-button {
position: fixed;
right: 10rpx;
bottom: 64rpx;
position: fixed;
right: 10rpx;
bottom: 64rpx;
}
</style>
<template>
<view class="study">
<u-navbar :is-back="false" background="{background: transparent}" :border-bottom="false" :is-fixed="false">
<text class="title-view">学习</text>
</u-navbar>
<image :src="bannerImage" mode="" class="banner"></image>
<u-tabs-swiper bg-color="#F4F5F7" inactive-color="#999999" font-size="28" ref="uTabs" :list="tabs" :current="current" @change="tabsChange" :is-scroll="false" :bar-width="52" swiperWidth="750"></u-tabs-swiper>
<swiper class="swiper_group" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
<swiper-item @touchmove.stop.prevent="stopTouchMove">
<scroll-view scroll-y style="width:100%;">
<view class="jf-currency-class">
<image :src="jianBianImg" mode="" class="current-img"></image>
<view class="class1" style="position: relative;" @click="goToPrint">
<image class="jf-img" :src="rule.pic" mode=""></image>
<view class="right u-padding-top-10 u-padding-bottom-14 jf-right">
<view class="u-font-32 font-bold u-margin-left-30 u-margin-top-30">充电桩交付规范</view>
<view class="u-font-24 u-margin-left-30 u-margin-top-30">请点击学习</view>
</view>
<view class="jf-line u-margin-right-30 u-margin-top-60">去查看</view>
</view>
</view>
<view class="study">
<u-navbar :is-back="false" background="{background: transparent}" :border-bottom="false" :is-fixed="false"><text class="title-view">学习</text></u-navbar>
<image :src="bannerImage" mode="" class="banner"></image>
<u-tabs-swiper
bg-color="#F4F5F7"
inactive-color="#999999"
font-size="28"
ref="uTabs"
:list="tabs"
:current="current"
@change="tabsChange"
:is-scroll="false"
:bar-width="52"
swiperWidth="750"
></u-tabs-swiper>
<swiper class="swiper_group" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
<swiper-item @touchmove.stop.prevent="stopTouchMove">
<scroll-view scroll-y style="width:100%;">
<view class="jf-currency-class">
<image :src="jianBianImg" mode="" class="current-img"></image>
<view class="class1" style="position: relative;" @click="goToPrint">
<image class="jf-img" :src="rule.pic" mode=""></image>
<view class="right u-padding-top-10 u-padding-bottom-14 jf-right">
<view class="u-font-32 font-bold u-margin-left-30 u-margin-top-30">充电桩交付规范</view>
<view class="u-font-24 u-margin-left-30 u-margin-top-30">请点击学习</view>
</view>
<view class="jf-line u-margin-right-30 u-margin-top-60">去查看</view>
</view>
</view>
<view class="jf-currency-class u-margin-top-100">
<image :src="jianbianImage" mode="" class="current-img"></image>
<view class="class1" style="position: relative;" @click="goToDocument">
<image class="jf-img" :src="anzhuangwenjianImage" mode=""></image>
<view class="right u-padding-top-10 u-padding-bottom-14 jf-right">
<view class="u-font-32 font-bold u-margin-left-30 u-margin-top-30">充电桩安装文件</view>
<view class="u-font-24 u-margin-left-30 u-margin-top-30">请点击查看</view>
</view>
<view class="jf-line u-margin-right-30 u-margin-top-60 red-color">去查看</view>
</view>
<image :src="jianbianImage" mode="" class="current-img"></image>
<view class="class1" style="position: relative;" @click="goToDocument">
<image class="jf-img" :src="anzhuangwenjianImage" mode=""></image>
<view class="right u-padding-top-10 u-padding-bottom-14 jf-right">
<view class="u-font-32 font-bold u-margin-left-30 u-margin-top-30">充电桩安装文件</view>
<view class="u-font-24 u-margin-left-30 u-margin-top-30">请点击查看</view>
</view>
<view class="jf-line u-margin-right-30 u-margin-top-60 red-color">去查看</view>
</view>
</view>
</scroll-view>
</swiper-item>
<swiper-item @touchmove.stop.prevent="stopTouchMove">
<scroll-view
scroll-y
style="height:100%;width:100%;"
@scrolltolower="onreachBottom"
scroll-y="true"
refresher-enabled="true"
:refresher-triggered="triggered"
:refresher-threshold="100"
@refresherpulling="onPulling"
@refresherrefresh="onRefresh"
@refresherrestore="onRestore"
@refresherabort="onAbort"
>
<view v-for="item in list" :key="item.id" class="notice" @click="bbb(item)">
<view class="notice-bottom-left">{{ item.create_at }}</view>
<view class="notice-content">
<img :src="item.img" alt="" style="width:690rpx;height:260rpx;display:block" />
<view class="notice-content-bottom">
<view class="n-head">{{ item.title }}</view>
<view class="news">{{ item.text }}</view>
</view>
</view>
</view>
<view v-shou="isLoadMore" class="load-more"><u-loadmore :status="loadStatus" /></view>
</scroll-view>
</swiper-item>
<swiper-item @touchmove.stop.prevent="stopTouchMove" v-if="version">
<scroll-view scroll-y style="height:100%;width:100%;">
<view class="title u-margin-top-10 u-margin-bottom-30">通用课程</view>
<view class="learn-currency-class">
<view class="learn-class1" @click="goPlay(courselist[0])">
<image class="learn-img" :src="courselist[0].pic" mode=""></image>
<image class="bofang" :src="bofang" mode=""></image>
<view class="learn-desc">
<view class="u-font-28 font-bold h68">{{ courselist[0].title }}</view>
<view class="u-font-20 learn-intro h48">{{ courselist[0].desc }}</view>
</view>
<view class="line-percent u-margin-top-35">
<u-line-progress active-color="#2979ff" :percent="courselist[0].percent" :show-percent="false"></u-line-progress>
<text class="font-default-color" :class="{ 'font-active-color': courselist[0].percent }" v-text="courselist[0].status"></text>
</view>
</view>
<view class="learn-class1 u-margin-left-30" @click="goPlay(courselist[1])">
<image class="learn-img" :src="courselist[1].pic" mode=""></image>
<image class="bofang" :src="bofang" mode=""></image>
<view class="learn-desc">
<view class="u-font-28 font-bold h68">{{ courselist[1].title }}</view>
<view class="u-font-20 learn-intro h48">{{ courselist[1].desc }}</view>
</view>
<view class="line-percent u-margin-top-35">
<u-line-progress active-color="#2979ff" :percent="courselist[1].percent" :show-percent="false"></u-line-progress>
<text class="font-default-color" :class="{ 'font-active-color': courselist[1].percent }" v-text="courselist[1].status"></text>
</view>
</view>
</view>
<view class="learn-currency-class u-margin-bottom-20 u-margin-top-30" style="padding-bottom: 300rpx;">
<view class="learn-class1" @click="goPlay(courselist[2])">
<image class="learn-img" :src="courselist[2].pic" mode=""></image>
<image class="bofang" :src="bofang" mode=""></image>
<view class="learn-desc">
<view class="u-font-28 font-bold h68">{{ courselist[2].title }}</view>
<view class="u-font-20 learn-intro h48">{{ courselist[2].desc }}</view>
</view>
<view class="line-percent u-margin-top-35" style="display:flex;justify-content: space-between;">
<u-line-progress active-color="#2979ff" :percent="courselist[2].percent" :show-percent="false"></u-line-progress>
<text class="font-default-color" :class="{ 'font-active-color': courselist[2].percent }" v-text="courselist[2].status"></text>
</view>
</view>
<view class="learn-class1 u-margin-left-30" @click="goPlay(courselist[3])">
<image class="learn-img" :src="courselist[3].pic" mode=""></image>
<image class="bofang" :src="bofang" mode=""></image>
<view class="learn-desc">
<view class="u-font-28 font-bold h68">{{ courselist[3].title }}</view>
<view class="u-font-20 learn-intro h48">{{ courselist[3].desc }}</view>
</view>
<view class="line-percent u-margin-top-35">
<u-line-progress active-color="#2979ff" :percent="courselist[3].percent" :show-percent="false"></u-line-progress>
<text class="font-default-color" :class="{ 'font-active-color': courselist[3].percent }" v-text="courselist[3].status"></text>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
<swiper-item @touchmove.stop.prevent="stopTouchMove">
<scroll-view scroll-y style="height:100%;width:100%;" @scrolltolower="onreachBottom" scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100" @refresherpulling="onPulling" @refresherrefresh="onRefresh" @refresherrestore="onRestore" @refresherabort="onAbort">
<view v-for="item in list" :key="item.id" class="notice" @click="bbb(item)">
<view class="notice-bottom-left">{{item.create_at}}</view>
<view class="notice-content">
<img :src="item.img" alt="" style="width:690rpx;height:260rpx;display:block">
<view class="notice-content-bottom">
<view class="n-head">{{item.title}}</view>
<view class="news">{{item.text}}</view>
</view>
</view>
</view>
<view v-shou="isLoadMore" class="load-more">
<u-loadmore :status="loadStatus" />
</view>
</scroll-view>
</swiper-item>
<swiper-item @touchmove.stop.prevent="stopTouchMove" v-if="version">
<scroll-view scroll-y style="height:100%;width:100%;">
<view class="title u-margin-top-10 u-margin-bottom-30">通用课程</view>
<view class="learn-currency-class">
<view class="learn-class1" @click="goPlay(courselist[0])">
<image class="learn-img" :src="courselist[0].pic" mode=""></image>
<image class="bofang" :src="bofang" mode=""></image>
<view class="learn-desc">
<view class="u-font-28 font-bold h68">
{{ courselist[0].title }}
</view>
<view class="u-font-20 learn-intro h48">
{{ courselist[0].desc }}
</view>
</view>
<view class="line-percent u-margin-top-35">
<u-line-progress active-color="#2979ff" :percent="courselist[0].percent" :show-percent="false">
</u-line-progress>
<text class="font-default-color" :class="{'font-active-color':courselist[0].percent}" v-text="courselist[0].status"></text>
</view>
</view>
<view class="learn-class1 u-margin-left-30" @click="goPlay(courselist[1])">
<image class="learn-img" :src="courselist[1].pic" mode=""></image>
<image class="bofang" :src="bofang" mode=""></image>
<view class="learn-desc">
<view class="u-font-28 font-bold h68">
{{ courselist[1].title }}
</view>
<view class="u-font-20 learn-intro h48">
{{ courselist[1].desc }}
</view>
</view>
<view class="line-percent u-margin-top-35">
<u-line-progress active-color="#2979ff" :percent="courselist[1].percent" :show-percent="false">
</u-line-progress>
<text class="font-default-color" :class="{'font-active-color':courselist[1].percent}" v-text="courselist[1].status"></text>
</view>
</view>
</view>
<view class="learn-currency-class u-margin-bottom-20 u-margin-top-30" style="padding-bottom: 300rpx;">
<view class="learn-class1" @click="goPlay(courselist[2])">
<image class="learn-img" :src="courselist[2].pic" mode=""></image>
<image class="bofang" :src="bofang" mode=""></image>
<view class="learn-desc">
<view class="u-font-28 font-bold h68">
{{ courselist[2].title }}
</view>
<view class="u-font-20 learn-intro h48">
{{ courselist[2].desc }}
</view>
</view>
<view class="line-percent u-margin-top-35" style="display:flex;justify-content: space-between;">
<u-line-progress active-color="#2979ff" :percent="courselist[2].percent" :show-percent="false">
</u-line-progress>
<text class="font-default-color" :class="{'font-active-color':courselist[2].percent}" v-text="courselist[2].status"></text>
</view>
</view>
<view class="learn-class1 u-margin-left-30" @click="goPlay(courselist[3])">
<image class="learn-img" :src="courselist[3].pic" mode=""></image>
<image class="bofang" :src="bofang" mode=""></image>
<view class="learn-desc">
<view class="u-font-28 font-bold h68">
{{ courselist[3].title }}
</view>
<view class="u-font-20 learn-intro h48">
{{ courselist[3].desc }}
</view>
</view>
<view class="line-percent u-margin-top-35">
<u-line-progress active-color="#2979ff" :percent="courselist[3].percent" :show-percent="false">
</u-line-progress>
<text class="font-default-color" :class="{'font-active-color':courselist[3].percent}" v-text="courselist[3].status"></text>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
<swiper-item @touchmove.stop.prevent="stopTouchMove">
<scroll-view scroll-y style="width:100%;">
<view class="title u-margin-top-10 u-margin-bottom-30">通用认证</view>
<view class="currency-class">
<view class="class1" @click="aaa(0)">
<image class="img" :src="examList[0].pic" mode=""></image>
<view class="right">
<view class="u-font-32 font-bold">
{{ examList[0].title }}
</view>
<view class="u-font-24">
{{ examList[0].desc }}
</view>
<view class="u-font-24" style="display:flex;justify-content: space-between;">
<text class="font-color-999999">{{ examList[0].condition }}</text>
<text class="font-default-exam-color" :class="{'font-active-color':examList[0].isComplete}">
{{ examList[0].status }}
</text>
</view>
</view>
</view>
<view class="class1 u-margin-top-40" @click="aaa(1)">
<image class="img" :src="examList[1].pic" mode=""></image>
<view class="right">
<view class="u-font-32 font-bold">
{{examList[1].title}}
</view>
<view class="u-font-24">
{{ examList[1].desc }}
</view>
<view class="u-font-24" style="display:flex;justify-content: space-between;">
<text class="font-color-999999">{{ examList[1].condition }}</text>
<text class="font-default-exam-color" :class="{'font-active-color':examList[1].isComplete}">
{{ examList[1].status }}</text>
</view>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
</scroll-view>
</swiper-item>
<swiper-item @touchmove.stop.prevent="stopTouchMove">
<scroll-view scroll-y style="width:100%;">
<view class="title u-margin-top-10 u-margin-bottom-30">通用认证</view>
<view class="currency-class">
<view class="class1" @click="aaa(0)">
<image class="img" :src="examList[0].pic" mode=""></image>
<view class="right">
<view class="u-font-32 font-bold">{{ examList[0].title }}</view>
<view class="u-font-24">{{ examList[0].desc }}</view>
<view class="u-font-24" style="display:flex;justify-content: space-between;">
<text class="font-color-999999">{{ examList[0].condition }}</text>
<text class="font-default-exam-color" :class="{ 'font-active-color': examList[0].isComplete }">{{ examList[0].status }}</text>
</view>
</view>
</view>
<view class="class1 u-margin-top-40" @click="aaa(1)">
<image class="img" :src="examList[1].pic" mode=""></image>
<view class="right">
<view class="u-font-32 font-bold">{{ examList[1].title }}</view>
<view class="u-font-24">{{ examList[1].desc }}</view>
<view class="u-font-24" style="display:flex;justify-content: space-between;">
<text class="font-color-999999">{{ examList[1].condition }}</text>
<text class="font-default-exam-color" :class="{ 'font-active-color': examList[1].isComplete }">{{ examList[1].status }}</text>
</view>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
</template>
<script>
var json = {
dev: [
{
title: "安装材料及工具准备",
desc: "前期的安装材料及安装工具的准备是工作的良好开始",
pic: process.uniEnv.qn_base_url + "fwgf-3x-v2.png",
percent: 0,
status: "",
id: 173,
sectionId: "",
},
{
title: "服务理念与时效",
desc: "为用户提供更好的服务,自己赚更多的钱",
pic: process.uniEnv.qn_base_url + "jdgf-3x-v2.png",
percent: 0,
status: "",
id: 173,
sectionId: "",
},
{
title: "充电桩安装要点提示",
desc: "在充电装安装过程中需要着重注意的要点",
pic: process.uniEnv.qn_base_url + "cdz-3x-v2.png",
percent: 0,
status: "",
id: 173,
sectionId: "",
},
{
title: "充电桩安装要点提示",
desc: "在充电装安装过程中需要着重注意的要点",
pic: process.uniEnv.qn_base_url + "cdz-3x-v2.png",
percent: 0,
status: "",
id: 173,
sectionId: "",
},
],
test: [
{
title: "安装材料及工具准备",
desc: "前期的安装材料及安装工具的准备是工作的良好开始",
pic: process.uniEnv.qn_base_url + "fwgf-3x-v2.png",
percent: 0,
status: "",
id: 150,
sectionId: "",
},
{
title: "服务理念与时效",
desc: "为用户提供更好的服务,自己赚更多的钱",
pic: process.uniEnv.qn_base_url + "jdgf-3x-v2.png",
percent: 0,
status: "",
id: 149,
sectionId: "",
},
{
title: "充电桩安装要点提示",
desc: "在充电装安装过程中需要着重注意的要点",
pic: process.uniEnv.qn_base_url + "cdz-3x-v2.png",
percent: 0,
status: "",
id: 151,
sectionId: "",
},
{
title: "小程序使用指南",
desc: "小程序使用指南",
pic: process.uniEnv.qn_base_url + "cdz-3x-v2.png",
percent: 0,
status: "",
id: 152,
sectionId: "",
},
],
prod: [
{
title: "安装材料及工具准备",
desc: "前期的安装材料及安装工具的准备是工作的良好开始",
pic: process.uniEnv.qn_base_url + "fwgf-3x-v2.png",
percent: 0,
status: "",
id: 597,
sectionId: "",
},
{
title: "服务理念与时效",
desc: "为用户提供更好的服务,自己赚更多的钱",
pic: process.uniEnv.qn_base_url + "jdgf-3x-v2.png",
percent: 0,
status: "",
id: 598,
sectionId: "",
},
{
title: "充电桩安装要点提示",
desc: "在充电装安装过程中需要着重注意的要点",
pic: process.uniEnv.qn_base_url + "cdz-3x-v2.png",
percent: 0,
status: "",
id: 599,
sectionId: "",
},
{
title: "小程序使用指南",
desc: "小程序使用指南",
pic: process.uniEnv.qn_base_url + "yaodiantishi.png",
percent: 0,
status: "",
id: 600,
sectionId: "",
},
],
dev: [
{
title: '安装材料及工具准备',
desc: '前期的安装材料及安装工具的准备是工作的良好开始',
pic: process.uniEnv.qn_base_url + 'fwgf-3x-v2.png',
percent: 0,
status: '',
id: 173,
sectionId: ''
},
{
title: '服务理念与时效',
desc: '为用户提供更好的服务,自己赚更多的钱',
pic: process.uniEnv.qn_base_url + 'jdgf-3x-v2.png',
percent: 0,
status: '',
id: 173,
sectionId: ''
},
{
title: '充电桩安装要点提示',
desc: '在充电装安装过程中需要着重注意的要点',
pic: process.uniEnv.qn_base_url + 'cdz-3x-v2.png',
percent: 0,
status: '',
id: 173,
sectionId: ''
},
{
title: '充电桩安装要点提示',
desc: '在充电装安装过程中需要着重注意的要点',
pic: process.uniEnv.qn_base_url + 'cdz-3x-v2.png',
percent: 0,
status: '',
id: 173,
sectionId: ''
}
],
test: [
{
title: '安装材料及工具准备',
desc: '前期的安装材料及安装工具的准备是工作的良好开始',
pic: process.uniEnv.qn_base_url + 'fwgf-3x-v2.png',
percent: 0,
status: '',
id: 150,
sectionId: ''
},
{
title: '服务理念与时效',
desc: '为用户提供更好的服务,自己赚更多的钱',
pic: process.uniEnv.qn_base_url + 'jdgf-3x-v2.png',
percent: 0,
status: '',
id: 149,
sectionId: ''
},
{
title: '充电桩安装要点提示',
desc: '在充电装安装过程中需要着重注意的要点',
pic: process.uniEnv.qn_base_url + 'cdz-3x-v2.png',
percent: 0,
status: '',
id: 151,
sectionId: ''
},
{
title: '小程序使用指南',
desc: '小程序使用指南',
pic: process.uniEnv.qn_base_url + 'cdz-3x-v2.png',
percent: 0,
status: '',
id: 152,
sectionId: ''
}
],
prod: [
{
title: '安装材料及工具准备',
desc: '前期的安装材料及安装工具的准备是工作的良好开始',
pic: process.uniEnv.qn_base_url + 'fwgf-3x-v2.png',
percent: 0,
status: '',
id: 597,
sectionId: ''
},
{
title: '服务理念与时效',
desc: '为用户提供更好的服务,自己赚更多的钱',
pic: process.uniEnv.qn_base_url + 'jdgf-3x-v2.png',
percent: 0,
status: '',
id: 598,
sectionId: ''
},
{
title: '充电桩安装要点提示',
desc: '在充电装安装过程中需要着重注意的要点',
pic: process.uniEnv.qn_base_url + 'cdz-3x-v2.png',
percent: 0,
status: '',
id: 599,
sectionId: ''
},
{
title: '小程序使用指南',
desc: '小程序使用指南',
pic: process.uniEnv.qn_base_url + 'yaodiantishi.png',
percent: 0,
status: '',
id: 600,
sectionId: ''
}
]
};
var examJson = {
dev: [
{
title: "安装材料及工具准备",
desc: "通过本认证,是接单的必要条件",
condition: "随机20题,及格20题",
status: "",
pic: process.uniEnv.qn_base_url + "fuwuguifan-d.png",
id: 2,
examId: "",
examStatus: "",
isComplete: false,
questionTime: null,
},
{
title: "接单操作",
desc: "快速认证,是否具备接单操作能力",
condition: "随机20题,及格16题",
status: "",
pic: process.uniEnv.qn_base_url + "jiedanguifan-d.png",
id: 2,
examId: "",
examStatus: "",
isComplete: false,
questionTime: null,
},
],
test: [
{
title: "安装材料及工具准备",
desc: "通过本认证,是接单的必要条件",
condition: "随机4题,及格4题",
status: "",
pic: process.uniEnv.qn_base_url + "fuwuguifan-d.png",
id: 3,
examId: "",
examStatus: "",
questionTime: null,
isComplete: false,
},
{
title: "接单规范",
desc: "快速认证,是否具备接单操作能力",
condition: "随机5题,及格5题",
status: "",
pic: process.uniEnv.qn_base_url + "jiedanguifan-d.png",
id: 4,
examId: "",
examStatus: "",
questionTime: null,
isComplete: false,
},
],
prod: [
{
title: "安装材料及工具准备",
desc: "通过本认证,是接单的必要条件",
condition: "随机4题,及格4题",
status: "",
pic: process.uniEnv.qn_base_url + "fuwuguifan-d.png",
id: 3,
examId: "",
examStatus: "",
isComplete: false,
questionTime: null,
},
{
title: "接单规范",
desc: "快速认证,是否具备接单操作能力",
condition: "随机5题,及格5题",
status: "",
pic: process.uniEnv.qn_base_url + "jiedanguifan-d.png",
id: 4,
examId: "",
examStatus: "",
isComplete: false,
questionTime: null,
},
],
dev: [
{
title: '安装材料及工具准备',
desc: '通过本认证,是接单的必要条件',
condition: '随机20题,及格20题',
status: '',
pic: process.uniEnv.qn_base_url + 'fuwuguifan-d.png',
id: 2,
examId: '',
examStatus: '',
isComplete: false,
questionTime: null
},
{
title: '接单操作',
desc: '快速认证,是否具备接单操作能力',
condition: '随机20题,及格16题',
status: '',
pic: process.uniEnv.qn_base_url + 'jiedanguifan-d.png',
id: 2,
examId: '',
examStatus: '',
isComplete: false,
questionTime: null
}
],
test: [
{
title: '安装材料及工具准备',
desc: '通过本认证,是接单的必要条件',
condition: '随机4题,及格4题',
status: '',
pic: process.uniEnv.qn_base_url + 'fuwuguifan-d.png',
id: 3,
examId: '',
examStatus: '',
questionTime: null,
isComplete: false
},
{
title: '接单规范',
desc: '快速认证,是否具备接单操作能力',
condition: '随机5题,及格5题',
status: '',
pic: process.uniEnv.qn_base_url + 'jiedanguifan-d.png',
id: 4,
examId: '',
examStatus: '',
questionTime: null,
isComplete: false
}
],
prod: [
{
title: '安装材料及工具准备',
desc: '通过本认证,是接单的必要条件',
condition: '随机4题,及格4题',
status: '',
pic: process.uniEnv.qn_base_url + 'fuwuguifan-d.png',
id: 3,
examId: '',
examStatus: '',
isComplete: false,
questionTime: null
},
{
title: '接单规范',
desc: '快速认证,是否具备接单操作能力',
condition: '随机5题,及格5题',
status: '',
pic: process.uniEnv.qn_base_url + 'jiedanguifan-d.png',
id: 4,
examId: '',
examStatus: '',
isComplete: false,
questionTime: null
}
]
};
let env = process.uniEnv.node_env;
let courseListJson = json[env];
let examListJson = examJson[env];
export default {
data() {
return {
tabs: [
{
name: "交付规范",
},
{
name: "消息通知",
},
{
name: "在线学习",
},
{
name: "考核认证",
},
],
tabs2: [
{
name: "交付规范",
},
{
name: "消息通知",
},
{
name: "考核认证",
},
],
bofang: process.uniEnv.qn_base_url + "bofang@3x.png",
current: 0,
swiperCurrent: 0,
params: {
start: 0,
},
list: [],
rule: {
pic: process.uniEnv.qn_base_url + "guifan-d.png",
},
courselist: [
{
title: courseListJson[0].title,
desc: courseListJson[0].desc,
percent: courseListJson[0].percent,
status: courseListJson[0].status,
pic: courseListJson[0].pic,
id: courseListJson[0].id,
sectionId: courseListJson[0].sectionId,
},
{
title: courseListJson[1].title,
desc: courseListJson[1].desc,
percent: courseListJson[1].percent,
status: courseListJson[1].status,
pic: courseListJson[1].pic,
id: courseListJson[1].id,
sectionId: courseListJson[1].sectionId,
},
{
title: courseListJson[2].title,
desc: courseListJson[2].desc,
percent: courseListJson[2].percent,
status: courseListJson[2].status,
pic: courseListJson[2].pic,
id: courseListJson[2].id,
sectionId: courseListJson[2].sectionId,
},
{
title: courseListJson[3].title,
desc: courseListJson[3].desc,
percent: courseListJson[3].percent,
status: courseListJson[3].status,
pic: courseListJson[3].pic,
id: courseListJson[3].id,
sectionId: courseListJson[3].sectionId,
},
],
examList: [
{
title: examListJson[0].title,
desc: examListJson[0].desc,
condition: examListJson[0].condition,
status: examListJson[0].status,
pic: examListJson[0].pic,
id: examListJson[0].id,
examId: examListJson[0].examId,
examStatus: examListJson[0].examStatus,
isComplete: examListJson[0].isComplete,
questionTime: examListJson[0].questionTime,
},
{
title: examListJson[1].title,
desc: examListJson[1].desc,
condition: examListJson[1].condition,
status: examListJson[1].status,
pic: examListJson[1].pic,
id: examListJson[1].id,
examId: examListJson[1].examId,
examStatus: examListJson[1].examStatus,
isComplete: examListJson[1].isComplete,
questionTime: examListJson[1].questionTime,
},
],
loadStatus: "loading",
isLoadMore: false,
exam: null,
jianBianImg: process.uniEnv.qn_base_url + "jianbian-fp.png",
isReflesh: true,
triggered: false,
_freshing: false,
version: true,
};
},
onLoad(param) {
getApp().trackPage("学习首页");
var that = this;
try {
if (param.tabs) {
this.current = param.tabs;
this.swiperCurrent = param.tabs;
}
} catch (e) {}
this.getVersion();
},
computed: {
bannerImage() {
return process.uniEnv.qn_base_url + "xuexibanner-p.png";
},
data() {
return {
tabs: [
{
name: '交付规范'
},
{
name: '消息通知'
},
{
name: '在线学习'
},
{
name: '考核认证'
}
],
tabs2: [
{
name: '交付规范'
},
{
name: '消息通知'
},
{
name: '考核认证'
}
],
bofang: process.uniEnv.qn_base_url + 'bofang@3x.png',
current: 0,
swiperCurrent: 0,
params: {
start: 0
},
list: [],
rule: {
pic: process.uniEnv.qn_base_url + 'guifan-d.png'
},
courselist: [
{
title: courseListJson[0].title,
desc: courseListJson[0].desc,
percent: courseListJson[0].percent,
status: courseListJson[0].status,
pic: courseListJson[0].pic,
id: courseListJson[0].id,
sectionId: courseListJson[0].sectionId
},
{
title: courseListJson[1].title,
desc: courseListJson[1].desc,
percent: courseListJson[1].percent,
status: courseListJson[1].status,
pic: courseListJson[1].pic,
id: courseListJson[1].id,
sectionId: courseListJson[1].sectionId
},
{
title: courseListJson[2].title,
desc: courseListJson[2].desc,
percent: courseListJson[2].percent,
status: courseListJson[2].status,
pic: courseListJson[2].pic,
id: courseListJson[2].id,
sectionId: courseListJson[2].sectionId
},
{
title: courseListJson[3].title,
desc: courseListJson[3].desc,
percent: courseListJson[3].percent,
status: courseListJson[3].status,
pic: courseListJson[3].pic,
id: courseListJson[3].id,
sectionId: courseListJson[3].sectionId
}
],
examList: [
{
title: examListJson[0].title,
desc: examListJson[0].desc,
condition: examListJson[0].condition,
status: examListJson[0].status,
pic: examListJson[0].pic,
id: examListJson[0].id,
examId: examListJson[0].examId,
examStatus: examListJson[0].examStatus,
isComplete: examListJson[0].isComplete,
questionTime: examListJson[0].questionTime
},
{
title: examListJson[1].title,
desc: examListJson[1].desc,
condition: examListJson[1].condition,
status: examListJson[1].status,
pic: examListJson[1].pic,
id: examListJson[1].id,
examId: examListJson[1].examId,
examStatus: examListJson[1].examStatus,
isComplete: examListJson[1].isComplete,
questionTime: examListJson[1].questionTime
}
],
loadStatus: 'loading',
isLoadMore: false,
exam: null,
jianBianImg: process.uniEnv.qn_base_url + 'jianbian-fp.png',
isReflesh: true,
triggered: false,
freshing: false,
version: true
};
},
onLoad(param) {
getApp().trackPage('学习首页');
var that = this;
try {
if (param.tabs) {
this.current = param.tabs;
this.swiperCurrent = param.tabs;
}
} catch (e) {}
this.getVersion();
},
computed: {
bannerImage() {
return process.uniEnv.qn_base_url + 'xuexibanner-p.png';
},
jianbianImage() {
return process.uniEnv.qn_base_url + "jianbian-p.png";
return process.uniEnv.qn_base_url + 'jianbian-p.png';
},
anzhuangwenjianImage() {
return process.uniEnv.qn_base_url + "wenjian-d.png";
return process.uniEnv.qn_base_url + 'wenjian-d.png';
}
},
onShow: function(param) {
try {
if (param.tabs) {
this.current = param.tabs;
this.swiperCurrent = param.tabs;
}
} catch (e) {}
if (this.current == 2 || this.current == 3) {
this.tabsChange(this.current);
}
},
methods: {
getVersion() {
let version = process.uniEnv.version_number;
let that = this;
this.$u.api
.getVersionInfo(version)
.then(res => {
let data = res.data;
if (data.hasOwnProperty('is_audit') && data.is_audit == 0) {
that.tabs = that.tabs2;
that.version = false;
}
})
.catch(err => {});
},
stopPull() {
let that = this;
setTimeout(function() {
that.triggered = false;
that.freshing = false;
}, 1000);
},
onPulling(e) {
return true;
},
onRefresh() {
if (this.freshing) return;
this.triggered = true;
this.freshing = true;
this.isLoadMore = false;
this.loadStatus = 'loading';
this.loadNews();
},
onRestore() {
this.triggered = 'restore'; // 需要重置
},
onAbort() {
console.log('onAbort');
},
transition(e) {
// swiper-item左右移动,通知tabs的滑块跟随移动
let dx = e.detail.dx;
this.$refs.uTabs.setDx(dx);
},
//scroll-view到底部加载更多
onreachBottom() {
//上拉触底函数
if (!this.isLoadMore) {
this.isLoadMore = true;
this.params.start += 5;
if (this.loadStatus !== 'nomore') {
this.getNoticeList();
}
}
},
stopTouchMove() {
return false;
},
},
onShow: function (param) {
try {
if (param.tabs) {
this.current = param.tabs;
this.swiperCurrent = param.tabs;
}
} catch (e) {}
if (this.current == 2 || this.current == 3) {
this.tabsChange(this.current);
}
},
methods: {
getVersion() {
let version = process.uniEnv.version_number;
let that = this;
this.$u.api
.getVersionInfo(version)
.then((res) => {
let data = res.data;
if (data.hasOwnProperty("is_audit") && data.is_audit == 0) {
that.tabs = that.tabs2;
that.version = false;
}
})
.catch((err) => {});
},
stopPull() {
let that = this;
setTimeout(function () {
that.triggered = false;
that._freshing = false;
}, 1000);
},
onPulling(e) {
return true;
},
onRefresh() {
if (this._freshing) return;
this.triggered = true;
this._freshing = true;
this.isLoadMore = false;
this.loadStatus = "loading";
this.loadNews();
},
onRestore() {
this.triggered = "restore"; // 需要重置
},
onAbort() {
console.log("onAbort");
},
transition(e) {
// swiper-item左右移动,通知tabs的滑块跟随移动
let dx = e.detail.dx;
this.$refs.uTabs.setDx(dx);
},
//scroll-view到底部加载更多
onreachBottom() {
//上拉触底函数
if (!this.isLoadMore) {
this.isLoadMore = true;
this.params.start += 5;
if (this.loadStatus !== "nomore") {
this.getNoticeList();
}
}
},
stopTouchMove() {
return false;
},
//取文本第一张图片
imgUrlFun(str) {
var data = "";
str.replace(
/<img [^>]*src=['"]([^'"]+)[^>]*>/,
function (match, capture) {
data = capture;
}
);
return data;
},
//取文本信息
getText(str) {
return str
.replace(/<[^<>]+>/g, "")
.replace(/&nbsp;/gi, "")
.replace(/(\n)/g, "");
},
getNoticeList() {
let that = this;
this.$u.api
.getTrainingNoticeList(this.params)
.then((res) => {
that.stopPull();
if (res.code != 200) {
uni.showToast({
title: res.message,
icon: "none",
});
that.isLoadMore = false;
if (that.params.start > 0) {
that.page -= 5;
}
}
if (res.data) {
let length = res.data.length;
for (let i = 0; i < length; i++) {
res.data[i].create_at = this.timeFormat(
res.data[i].create_at,
"yyyy.MM.dd hh:mm"
);
res.data[i].img = this.imgUrlFun(res.data[i].body);
res.data[i].text = this.getText(res.data[i].body);
}
that.list = that.list.concat(res.data);
console.log("消息列表", that.list);
}
if (res.data.length >= 5) {
that.isLoadMore = false;
} else {
that.isLoadMore = true;
that.loadStatus = "nomore";
}
})
.catch((err) => {
uni.showToast({
title: err,
icon: "none",
});
that.isLoadMore = false;
if (that.params.start > 0) {
that.page -= 5;
}
});
},
timeFormat(time, format, fromMysql = true) {
let rate = fromMysql ? 1000 : 1;
let dataFmt = format || "yyyy-MM-dd hh:mm:ss"; // 需要格式化的规则
time = typeof time == "number" ? time : new Date(time * rate); // 处理传入的time
let fmt = {
"y+": time.getFullYear(), // 年份
"M+": time.getMonth() + 1, // 月份
"d+": time.getDate(), // 日
"h+": time.getHours(), // 小时
"m+": time.getMinutes(), // 分钟
"s+": time.getSeconds(), // 秒
};
//取文本第一张图片
imgUrlFun(str) {
var data = '';
str.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/, function(match, capture) {
data = capture;
});
return data;
},
//取文本信息
getText(str) {
return str
.replace(/<[^<>]+>/g, '')
.replace(/&nbsp;/gi, '')
.replace(/(\n)/g, '');
},
getNoticeList() {
let that = this;
this.$u.api
.getTrainingNoticeList(this.params)
.then(res => {
that.stopPull();
if (res.code != 200) {
uni.showToast({
title: res.message,
icon: 'none'
});
that.isLoadMore = false;
if (that.params.start > 0) {
that.page -= 5;
}
}
if (res.data) {
let length = res.data.length;
for (let i = 0; i < length; i++) {
res.data[i].create_at = this.timeFormat(res.data[i].create_at, 'yyyy.MM.dd hh:mm');
res.data[i].img = this.imgUrlFun(res.data[i].body);
res.data[i].text = this.getText(res.data[i].body);
}
that.list = that.list.concat(res.data);
console.log('消息列表', that.list);
}
if (res.data.length >= 5) {
that.isLoadMore = false;
} else {
that.isLoadMore = true;
that.loadStatus = 'nomore';
}
})
.catch(err => {
uni.showToast({
title: err,
icon: 'none'
});
that.isLoadMore = false;
if (that.params.start > 0) {
that.page -= 5;
}
});
},
timeFormat(time, format, fromMysql = true) {
let rate = fromMysql ? 1000 : 1;
let dataFmt = format || 'yyyy-MM-dd hh:mm:ss'; // 需要格式化的规则
time = typeof time == 'number' ? time : new Date(time * rate); // 处理传入的time
let fmt = {
'y+': time.getFullYear(), // 年份
'M+': time.getMonth() + 1, // 月份
'd+': time.getDate(), // 日
'h+': time.getHours(), // 小时
'm+': time.getMinutes(), // 分钟
's+': time.getSeconds() // 秒
};
for (let i in fmt) {
if (new RegExp("(" + i + ")").test(dataFmt)) {
dataFmt = dataFmt.replace(
RegExp.$1,
fmt[i].toString().length <= 1 ? "0" + fmt[i] : fmt[i]
);
}
}
return dataFmt;
},
getTypeName(percent) {
if (percent == 0) {
return "未开始";
} else if (percent == "100") {
return "已完成";
} else {
return "继续";
}
},
//在线学习通用课程信息
getCourseList() {
let courseLength = this.courselist.length;
for (let i = 0; i < courseLength; i++) {
let param = {
course_id: this.courselist[i].id,
};
this.$u.api
.CourseList(param)
.then((res) => {
if (res.code != 200) {
uni.showToast({
title: res.message,
icon: "none",
});
}
if (res.data) {
res.data.learnedInfo.learnPercent *= 100;
this.courselist[i].status = this.getTypeName(
res.data.learnedInfo.learnPercent
);
this.courselist[i].percent =
res.data.learnedInfo.learnPercent;
this.courselist[i].sectionId =
res.data.learnedInfo.nextLearnedSectionId;
}
})
.catch((err) => {
uni.showToast({
title: err,
icon: "none",
});
});
}
},
//tabs通知swiper切换
tabsChange(index) {
this.swiperCurrent = Number(index);
switch (this.swiperCurrent) {
case 1:
this.loadNews();
break;
case 2:
this.getCourseList();
break;
case 3:
this.getUserExamInfo();
break;
}
},
loadNews() {
this.params.start = 0;
this.list = [];
this.getNoticeList();
},
animationfinish(e) {
let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
},
//跳转到拍照小程序首页
goToPrint() {
uni.navigateToMiniProgram({
appId: "wxd1d6eede324b0465",
path: "/pages/photo/index",
success(res) {
//打开成功
console.log("success", res);
},
fail(err) {
console.log("err", err);
},
});
},
for (let i in fmt) {
if (new RegExp('(' + i + ')').test(dataFmt)) {
dataFmt = dataFmt.replace(RegExp.$1, fmt[i].toString().length <= 1 ? '0' + fmt[i] : fmt[i]);
}
}
return dataFmt;
},
getTypeName(percent) {
if (percent == 0) {
return '未开始';
} else if (percent == '100') {
return '已完成';
} else {
return '继续';
}
},
//在线学习通用课程信息
getCourseList() {
let courseLength = this.courselist.length;
for (let i = 0; i < courseLength; i++) {
let param = {
course_id: this.courselist[i].id
};
this.$u.api
.CourseList(param)
.then(res => {
if (res.code != 200) {
uni.showToast({
title: res.message,
icon: 'none'
});
}
if (res.data) {
res.data.learnedInfo.learnPercent *= 100;
this.courselist[i].status = this.getTypeName(res.data.learnedInfo.learnPercent);
this.courselist[i].percent = res.data.learnedInfo.learnPercent;
this.courselist[i].sectionId = res.data.learnedInfo.nextLearnedSectionId;
}
})
.catch(err => {
uni.showToast({
title: err,
icon: 'none'
});
});
}
},
//tabs通知swiper切换
tabsChange(index) {
this.swiperCurrent = Number(index);
switch (this.swiperCurrent) {
case 1:
this.loadNews();
break;
case 2:
this.getCourseList();
break;
case 3:
this.getUserExamInfo();
break;
}
},
loadNews() {
this.params.start = 0;
this.list = [];
this.getNoticeList();
},
animationfinish(e) {
let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
},
//跳转到拍照小程序首页
goToPrint() {
uni.navigateToMiniProgram({
appId: 'wxd1d6eede324b0465',
path: '/pages/photo/index',
success(res) {
//打开成功
console.log('success', res);
},
fail(err) {
console.log('err', err);
}
});
},
// 安装文件
goToDocument() {
getApp().track("learn_goToDocument", {})
getApp().track('learn_goToDocument', {});
this.$u.route({
url: 'pages/order/document',
})
url: 'pages/order/document'
});
},
//考核认证,通用认证,考试通过or未通过查询接口请求
getUserExamInfo() {
uni.hideLoading();
//考核认证,通用认证,考试通过or未通过查询接口请求
getUserExamInfo() {
uni.hideLoading();
let that = this;
let token = that.vuex_token;
let length = this.examList.length;
for (let i = 0; i < length; i++) {
let examId = this.examList[i].id;
this.$u.api
.getExamResult(examId)
.then((res) => {
if (res.code != 200) {
console.log("getUserExamInfo 200 err");
uni.showToast({
icon: "none",
title: "获取考试信息失败",
});
}
this.examList[i].examId = res.data.id;
this.examList[i].examStatus = res.data.examStatus; //i;//
this.examList[i].questionTime = res.data.questionTime;
let examResult = res.data.examLevelResult;
this.examList[i].status =
examResult != "" ? examResult : "未通过";
//动态获取条件
let that = this;
let token = that.vuex_token;
let length = this.examList.length;
for (let i = 0; i < length; i++) {
let examId = this.examList[i].id;
this.$u.api
.getExamResult(examId)
.then(res => {
if (res.code != 200) {
console.log('getUserExamInfo 200 err');
uni.showToast({
icon: 'none',
title: '获取考试信息失败'
});
}
this.examList[i].examId = res.data.id;
this.examList[i].examStatus = res.data.examStatus; //i;//
this.examList[i].questionTime = res.data.questionTime;
let examResult = res.data.examLevelResult;
this.examList[i].status = examResult != '' ? examResult : '未通过';
//动态获取条件
let ruleDisc = res.data.ruleDisc;
let targetIndex = ruleDisc.indexOf("(");
let ruleDisc = res.data.ruleDisc;
let targetIndex = ruleDisc.indexOf('(');
if (targetIndex) {
this.examList[i].condition = ruleDisc
.substr(targetIndex + 1)
.replace(")", "");
}
if (targetIndex) {
this.examList[i].condition = ruleDisc.substr(targetIndex + 1).replace(')', '');
}
// examStatus 用户考试状态 0考试中 1考试完成 2未参与
that.exam = res.data;
if (res.data.examStatus == 2) {
return;
}
if (res.data.examStatus == 1) {
that.examList[i].isComplete =
this.examList[i].status == "已通过";
that.examScore = res.data.examScore;
return;
}
if (res.data.examStatus == 0) {
that.userExamId = res.data.id;
}
})
.catch((err) => {
uni.hideLoading();
uni.showToast({
icon: "none",
title: "获取考试信息失败",
});
});
}
},
//跳转到assessment页面
aaa(index) {
//examStatus 用户考试状态 0考试中 1考试完成 2未参与
//考试完成分成通过、未通过
getApp().globalData.questionTime =
this.examList[index].questionTime;
var examInfo = this.examList[index];
wx.navigateTo({
url: "/pages/learn/assessment?examId=" + examInfo.id,
});
},
//跳转到播放
goPlay(info) {
getApp().track("learn_allPlayCounts", {courseId: info.id})
if(info.title === "小程序使用指南") {
getApp().track("learn_guidePlayCounts", {courseId: info.id})
}
uni.navigateTo({
url:
"/pages/learn/section?section_id=" +
info.sectionId +
"&course_id=" +
info.id,
});
},
//跳转到消息详情页
bbb(e) {
var news = {
body: e.body,
title: e.title,
create_at: e.create_at,
};
getApp().track("learn_goToMessage", {})
let that = this;
wx.navigateTo({
url: "/pages/learn/news-details",
success: function (res) {
res.eventChannel.emit("acceptDataFromLearn", news);
},
});
},
},
// examStatus 用户考试状态 0考试中 1考试完成 2未参与
that.exam = res.data;
if (res.data.examStatus == 2) {
return;
}
if (res.data.examStatus == 1) {
that.examList[i].isComplete = this.examList[i].status == '已通过';
that.examScore = res.data.examScore;
return;
}
if (res.data.examStatus == 0) {
that.userExamId = res.data.id;
}
})
.catch(err => {
uni.hideLoading();
uni.showToast({
icon: 'none',
title: '获取考试信息失败'
});
});
}
},
//跳转到assessment页面
aaa(index) {
//examStatus 用户考试状态 0考试中 1考试完成 2未参与
//考试完成分成通过、未通过
getApp().globalData.questionTime = this.examList[index].questionTime;
var examInfo = this.examList[index];
wx.navigateTo({
url: '/pages/learn/assessment?examId=' + examInfo.id
});
},
//跳转到播放
goPlay(info) {
getApp().track('learn_allPlayCounts', { courseId: info.id });
if (info.title === '小程序使用指南') {
getApp().track('learn_guidePlayCounts', { courseId: info.id });
}
uni.navigateTo({
url: '/pages/learn/section?section_id=' + info.sectionId + '&course_id=' + info.id
});
},
//跳转到消息详情页
bbb(e) {
var news = {
body: e.body,
title: e.title,
create_at: e.create_at
};
getApp().track('learn_goToMessage', {});
let that = this;
wx.navigateTo({
url: '/pages/learn/news-details',
success: function(res) {
res.eventChannel.emit('acceptDataFromLearn', news);
}
});
}
}
};
</script>
<style>
.study {
height: 100vh;
background-color: #f4f5f7;
padding: 0rpx 30rpx 0 30rpx;
height: 100vh;
background-color: #f4f5f7;
padding: 0rpx 30rpx 0 30rpx;
}
.title-view {
color: #333333;
font-weight: bold;
font-size: 40rpx;
color: #333333;
font-weight: bold;
font-size: 40rpx;
}
.banner {
width: 690rpx;
height: 220rpx;
margin-top: 10rpx;
width: 690rpx;
height: 220rpx;
margin-top: 10rpx;
}
/* 交付规范 */
.standard {
width: 690rpx;
height: 180rpx;
display: flex;
justify-content: space-between;
/* border-bottom: 1rpx solid #82848a; */
/* padding: 0 34rpx; */
/* margin: 72rpx auto; */
border-radius: 12rpx;
padding: 30rpx;
margin-top: 30rpx;
background-color: #ffffff;
width: 690rpx;
height: 180rpx;
display: flex;
justify-content: space-between;
/* border-bottom: 1rpx solid #82848a; */
/* padding: 0 34rpx; */
/* margin: 72rpx auto; */
border-radius: 12rpx;
padding: 30rpx;
margin-top: 30rpx;
background-color: #ffffff;
}
/* 培训通知 */
.notice {
/* border: #808080 solid 2rpx; */
width: 100%;
min-height: 370rpx;
margin-top: 36rpx;
overflow: hidden;
border-radius: 12rpx;
/* border: #808080 solid 2rpx; */
width: 100%;
min-height: 370rpx;
margin-top: 36rpx;
overflow: hidden;
border-radius: 12rpx;
}
.notice-content {
background: #ffffff;
width: 100%;
border-radius: 12rpx;
overflow: hidden;
background: #ffffff;
width: 100%;
border-radius: 12rpx;
overflow: hidden;
}
.notice-content-bottom {
height: 150rpx;
padding: 0 30rpx;
overflow: hidden;
height: 150rpx;
padding: 0 30rpx;
overflow: hidden;
}
.n-head {
text-align: left;
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin-top: 30rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: left;
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin-top: 30rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.news {
overflow: hidden;
/* margin-top: 30rpx; */
white-space: nowrap;
text-overflow: ellipsis;
font-size: 24rpx;
color: #666666;
line-height: 34rpx;
margin-bottom: 20rpx;
margin-top: 16rpx;
overflow: hidden;
/* margin-top: 30rpx; */
white-space: nowrap;
text-overflow: ellipsis;
font-size: 24rpx;
color: #666666;
line-height: 34rpx;
margin-bottom: 20rpx;
margin-top: 16rpx;
}
/* 在线学习 */
.currency-class {
width: 100%;
background: #ffffff;
padding: 30rpx;
border-radius: 12rpx;
width: 100%;
background: #ffffff;
padding: 30rpx;
border-radius: 12rpx;
}
.learn-currency-class {
width: 100%;
border-radius: 12rpx;
display: flex;
width: 100%;
border-radius: 12rpx;
display: flex;
}
.jf-currency-class {
width: 100%;
height: 180rpx;
/* position: absolute; */
width: 100%;
height: 180rpx;
/* position: absolute; */
position: relative;
border-radius: 12rpx;
margin-top: 80rpx;
border-radius: 12rpx;
margin-top: 80rpx;
}
.title {
font-size: 32rpx;
font-weight: bold;
font-family: PingFang-SC-Bold, PingFang-SC;
font-size: 32rpx;
font-weight: bold;
font-family: PingFang-SC-Bold, PingFang-SC;
}
.class1 {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
}
.learn-class1 {
display: -webkit-box;
display: -webkit-flex;
display: block;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
width: 330rpx;
height: 420rpx;
background-color: #ffffff;
position: relative;
border-radius: 12rpx;
display: -webkit-box;
display: -webkit-flex;
display: block;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
width: 330rpx;
height: 420rpx;
background-color: #ffffff;
position: relative;
border-radius: 12rpx;
}
.img {
width: 160rpx;
height: 120rpx;
width: 160rpx;
height: 120rpx;
border-radius: 12rpx;
}
.learn-img {
width: 330rpx;
height: 194rpx;
width: 330rpx;
height: 194rpx;
}
.jf-img {
width: 160rpx;
height: 200rpx;
position: absolute;
bottom: 5rpx;
left: 30rpx;
width: 160rpx;
height: 200rpx;
position: absolute;
bottom: 5rpx;
left: 30rpx;
border-radius: 10rpx;
}
.right {
width: 434rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
width: 434rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.intro {
color: #9999a6;
color: #9999a6;
}
.tab {
background: #fff;
height: 82rpx;
margin: 0 0;
background: #fff;
height: 82rpx;
margin: 0 0;
}
.text {
margin: 0 40rpx;
line-height: 82rpx;
color: #667eb5;
margin: 0 40rpx;
line-height: 82rpx;
color: #667eb5;
}
.content {
margin: 5px 0;
height: 485rpx;
background: #fff;
margin: 5px 0;
height: 485rpx;
background: #fff;
}
swiper {
height: 70vh;
height: 70vh;
}
.line-percent {
display: flex;
justify-content: space-between;
font-size: 24rpx;
color: #999999;
margin: 20rpx;
margin-top: 25rpx;
display: flex;
justify-content: space-between;
font-size: 24rpx;
color: #999999;
margin: 20rpx;
margin-top: 25rpx;
}
.jf-line {
width: 120rpx;
height: 52rpx;
border-radius: 26rpx;
background-color: #ffffff;
color: #2272ff;
text-align: center;
width: 120rpx;
height: 52rpx;
border-radius: 26rpx;
background-color: #ffffff;
color: #2272ff;
text-align: center;
font-size: 24rpx;
line-height: 52rpx;
}
.red-color {
color: #FA5A49;
color: #fa5a49;
}
.u-progress {
width: 160rpx !important;
height: 12rpx !important;
background-color: #ececec;
width: 160rpx !important;
height: 12rpx !important;
background-color: #ececec;
}
.font-bold {
font-weight: bold;
font-weight: bold;
}
.font-default-color {
color: #999999;
color: #999999;
}
.font-default-exam-color {
color: #fa5a49;
color: #fa5a49;
}
.font-active-color {
color: #2272ff;
color: #2272ff;
}
.font-color-999999 {
color: #999999;
color: #999999;
}
.standard-img {
width: 160rpx;
height: 120rpx;
width: 160rpx;
height: 120rpx;
}
.standard-body {
height: 120rpx;
display: flex;
height: 120rpx;
display: flex;
}
.standard-body-title {
font-size: 32rpx;
font-weight: bold;
font-size: 32rpx;
font-weight: bold;
}
.jf-right {
padding-left: 190rpx;
width: 460rpx;
color: #ffffff;
padding-left: 190rpx;
width: 460rpx;
color: #ffffff;
}
.notice-bottom {
margin-top: 20rpx;
display: block;
position: relative;
margin-top: 20rpx;
display: block;
position: relative;
}
.notice-bottom-left {
font-size: 24rpx;
font-weight: 500;
color: #999999;
text-align: center;
margin-bottom: 20rpx;
font-size: 24rpx;
font-weight: 500;
color: #999999;
text-align: center;
margin-bottom: 20rpx;
}
.notice-bottom-right {
font-size: 24rpx;
color: #2272ff;
float: right;
font-size: 24rpx;
color: #2272ff;
float: right;
}
.bofang {
width: 60rpx;
height: 60rpx;
position: absolute;
left: 130rpx;
top: 70rpx;
width: 60rpx;
height: 60rpx;
position: absolute;
left: 130rpx;
top: 70rpx;
}
.learn-desc {
height: 138rpx;
margin-top: -10rpx;
padding-top: 20rpx;
padding-left: 20rpx;
padding-right: 20rpx;
height: 138rpx;
margin-top: -10rpx;
padding-top: 20rpx;
padding-left: 20rpx;
padding-right: 20rpx;
}
.learn-intro {
color: #999999;
margin-top: 20rpx;
font-size: 20rpx;
color: #999999;
margin-top: 20rpx;
font-size: 20rpx;
}
.h48 {
height: 48rpx;
height: 48rpx;
}
.current-img {
width: 100%;
height: 180rpx;
position: absolute;
width: 100%;
height: 180rpx;
position: absolute;
}
.load-more {
padding-top: 50rpx;
padding-bottom: 200rpx;
padding-top: 50rpx;
padding-bottom: 200rpx;
}
.u-margin-top-100 {
margin-top: 100rpx;
margin-top: 100rpx;
}
</style>
......@@ -265,9 +265,6 @@ export default {
app.getBaseInfo(self);
},
handleClick(path, isWarehouse) {
this.$u.route({
url: 'pages/mine/' + path
});
if (this.vuex_token) {
// 没入驻不能进入仓配相关页面
if (isWarehouse && this.needSettled) {
......@@ -284,7 +281,6 @@ export default {
} else {
this.$u.route({ url: 'pages/login/index' });
}
},
handleClickSetting() {
this.$u.route({ url: 'pages/mine/setting/index' });
......@@ -449,7 +445,7 @@ export default {
}
.ware-house-title-received {
font-size: 24rpx;
color: #409eff;
color: #2272ff;
}
}
.ware-house-content {
......
<template>
<TabBarPage title="订单" :fixed="true" @click="goTop">
<view class="tools-box">
<view class="search-sub">
<u-subsection
:current="curNow"
:list="subList"
active-color="white"
bg-color="white"
inactive-color="#666"
button-color="#2272FF"
border-radius="36"
@change="sectionChange"
height="72"
bold
>
</u-subsection>
</view>
<view class="search-btn" @click="handleClickSearch">
<image class="search-image" mode="widthFix" :src="sousuoImage"></image>
<text class="search-btn-text">搜订单</text>
</view>
</view>
<view class="u-tabs-box">
<!-- 写两个是避免切换subsection时候,current不是0的时候底部蓝条有初始动画 -->
<view v-for="index of [0, 1]" :key="index">
<u-tabs
v-show="curNow == index"
height="66"
activeColor="#2272FF"
bg-color="none"
inactive-color="#999"
bar-height="4"
bar-width="44"
:offset="offset[index]"
:list="list[index]"
count="total"
:current="current[index]"
@change="change"
:is-scroll="false"
font-size="28"
bold
></u-tabs>
</view>
</view>
<TabBarPage title="订单" :fixed="true" @click="goTop">
<view class="tools-box">
<view class="search-sub">
<u-subsection
:current="curNow"
:list="subList"
active-color="white"
bg-color="white"
inactive-color="#666"
button-color="#2272FF"
border-radius="36"
@change="sectionChange"
height="72"
bold
></u-subsection>
</view>
<view class="search-btn" @click="handleClickSearch">
<image class="search-image" mode="widthFix" :src="sousuoImage"></image>
<text class="search-btn-text">搜订单</text>
</view>
</view>
<view class="u-tabs-box">
<!-- 写两个是避免切换subsection时候,current不是0的时候底部蓝条有初始动画 -->
<view v-for="index of [0, 1]" :key="index">
<u-tabs
v-show="curNow == index"
height="66"
activeColor="#2272FF"
bg-color="none"
inactive-color="#999"
bar-height="4"
bar-width="44"
:offset="offset[index]"
:list="list[index]"
count="total"
:current="current[index]"
@change="change"
:is-scroll="false"
font-size="28"
bold
></u-tabs>
</view>
</view>
<view class="tab-view">
<scroll-view
scroll-y
style="height: 100%;width: 100%;"
@scrolltolower="reachBottom"
scroll-anchoring
refresher-enabled="true"
:refresher-triggered="triggered"
:refresher-threshold="100"
:scroll-top="scrollTop"
refresher-background="#F4F5F7"
@refresherrefresh="onRefresh"
@refresherrestore="onRestore"
@scroll="scroll"
enable-back-to-top
>
<NoOrder
v-if="noMore"
imageName="zwdd.png"
:customStyle="noOrderCustomStyle"
/>
<template v-else>
<view
v-for="item in orderList[curNow][current[curNow]]"
:key="item.orderId"
>
<OrderCell
:orderData="item"
:type="cellType"
:location="dataValue"
@click="handleClick"
@action="handleClickCellButton"
>
</OrderCell>
</view>
<view
class="load-more-view"
v-show="(pageNumber == 1 && loaded) || pageNumber > 1"
>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
</template>
<view class="loading-view" v-if="!loaded && !_freshing">
<u-loading mode="flower"></u-loading>
</view>
</scroll-view>
</view>
<!-- 悬浮按钮 -->
<!-- <EusingList type="collapse" /> -->
<MaskTip
:show="showMask"
imageName="mengceng1.png"
:imageStyle="imageStyle"
name="today_tip"
/>
</TabBarPage>
<view class="tab-view">
<scroll-view
scroll-y
style="height: 100%;width: 100%;"
@scrolltolower="reachBottom"
scroll-anchoring
refresher-enabled="true"
:refresher-triggered="triggered"
:refresher-threshold="100"
:scroll-top="scrollTop"
refresher-background="#F4F5F7"
@refresherrefresh="onRefresh"
@refresherrestore="onRestore"
@scroll="scroll"
enable-back-to-top
>
<NoOrder v-if="noMore" imageName="zwdd.png" :customStyle="noOrderCustomStyle" />
<template v-else>
<view v-for="item in orderList[curNow][current[curNow]]" :key="item.orderId">
<OrderCell :orderData="item" :type="cellType" :location="dataValue" @click="handleClick" @action="handleClickCellButton"></OrderCell>
</view>
<view class="load-more-view" v-show="(pageNumber == 1 && loaded) || pageNumber > 1"><u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore></view>
</template>
<view class="loading-view" v-if="!loaded && !freshing"><u-loading mode="flower"></u-loading></view>
</scroll-view>
</view>
<!-- 悬浮按钮 -->
<!-- <EusingList type="collapse" /> -->
<MaskTip :show="showMask" imageName="mengceng1.png" :imageStyle="imageStyle" name="today_tip" />
</TabBarPage>
</template>
<script>
import TabBarPage from '@/components/tabBarList/index.vue'
import OrderCell from '@/components/order/index.vue'
import NoOrder from '@/components/order/noOrder.vue'
import upload from '@/components/upload/task.js'
import MaskTip from '@/components/mask-tip/index.vue'
import TabBarPage from '@/components/tabBarList/index.vue';
import OrderCell from '@/components/order/index.vue';
import NoOrder from '@/components/order/noOrder.vue';
import upload from '@/components/upload/task.js';
import MaskTip from '@/components/mask-tip/index.vue';
// import EusingList from '@/components/order/eusingList.vue'
export default {
components: {
TabBarPage,
OrderCell,
NoOrder,
MaskTip,
// EusingList,
},
data() {
return {
curNow: 0,
pageNumber: 0,
orderList: [
// 用多个数组存储可以优化用户切换体验,但是会增加内存
[[], [], [], [], [], []],
[[], [], []],
],
list: [
[
{
name: '待预约',
total: 0,
},
{
name: '待签到',
total: 0,
},
{
name: '待完工',
total: 0,
},
{
name: '审核中',
total: 0,
},
{
name: '异常单',
total: 0,
},
{
name: '已完工',
total: 0,
},
],
[
{
name: '待联系',
total: 0,
},
{
name: '待完工',
total: 0,
},
{
name: '异常单',
total: 0,
},
],
],
current: { 0: 0, 1: 0 },
loadStatus: 'loading',
dataValue: [],
loaded: false,
triggered: true,
_freshing: false,
scrollTop: 0,
old: {
scrollTop: 0,
},
showMask: false,
}
},
computed: {
subList() {
return ['全部订单', '今日订单']
},
// 0 全部订单: 0:'待预约', 1:'待签到', 2:'待完工', 3:'审核中', 4:'异常单', 5'已完工'
// 1 今日订单: 0:'今日待联系', 1:'今日待完工', 2:'今日异常单'
orderType() {
return this.indexStatus[this.curNow][this.current[this.curNow]]
},
pageSize() {
// 待预约, 待签到,待完工,因为需要排序,所以暂时去掉分页,一次要完所有
return this.pageSizes[this.curNow][this.current[this.curNow]]
},
needSort() {
// 待预约, 待签到,待完工需要排序
return this.curNow + this.current[this.curNow] < 3
},
pageSizes() {
// 待预约, 待签到,待完工,因为需要排序,所以暂时去掉分页,一次要完所有
return [
[10000, 10000, 10000, 15, 15, 15],
[10000, 10000, 15],
]
},
offset() {
return [
[0, 0],
[0, 44],
]
},
sousuoImage() {
return process.uniEnv.qn_base_url + 'sousuo.png'
},
// 每一种状态对应的tab的index
types() {
return [
{
waitAppointment: 0, // 待预约、
waitCheckIn: 1, // 待签到、
waitFinish: 2, // 待完工、
audit: 3, // 审核中、
exception: 4, // 异常单、
finish: 5, //已完工
},
{
todayWaitContact: 0, // 今日待联系、
todayWaitFinish: 1, // 今日待完工、
todayException: 2, // 今日异常单、
},
]
},
// 每一个tab对应的状态
indexStatus() {
return [
[
'waitAppointment',
'waitCheckIn',
'waitFinish',
'audit',
'exception',
'finish',
],
['todayWaitContact', 'todayWaitFinish', 'todayException'],
]
},
// 订单数量接的返回数量的key
countKeys() {
return [
[
'toAppointmentCount',
'toCheckinCount',
'toFinishCount',
'reviewingCount',
'exceptionCount',
'', // 待完工没有数量
],
['todayContactCount', 'todayFinishCount', 'todayExceptionCount'],
]
},
isFinish() {
return this.orderType == 'finish'
},
noMore() {
return (
this.orderList[this.curNow][this.current[this.curNow]].length == 0 &&
this.loaded
)
},
cellTypes() {
return [
[
'waitAppointment',
'waitCheckIn',
'waitFinish',
'audit',
'exception',
'finish',
],
['', 'waitFinish', 'exception'],
]
},
// 仅用于传给OrderCell的type
cellType() {
return this.cellTypes[this.curNow][this.current[this.curNow]]
},
noOrderCustomStyle() {
return 'margin-top: 100rpx;background-color: #F4F5F7'
},
imageStyle() {
return 'width:546rpx; margin-top:80rpx; margin-left:100rpx'
}
},
onLoad(e) {
getApp().trackPage('订单首页')
this._freshing = false
// 跳转到本页是否带了跳到那个tab的参数
if (e && e.type) {
this.current[this.curNow] = Math.max(
0,
this.indexStatus[this.curNow].indexOf(e.type)
)
}
},
onShow() {
if (this.uploadTask.length > 0) {
upload.uploadImageTask(this)
}
this.reloadOrderInfo()
},
methods: {
sectionChange(index) {
this.curNow = index
this.reloadOrderList()
},
// tab栏切换
change(index) {
this.current[this.curNow] = index
this.reloadOrderList()
},
// 滚动底部
reachBottom(e) {
if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading'
this.getOrderList()
},
// 页面数据
getOrderList() {
// 状态处理
this.pageNumber += 1
if (this.pageNumber == 1) {
this.loaded = false
}
var param = {
pageNumber: this.pageNumber,
pageSize: this.pageSize,
keyword: '',
type: this.orderType,
}
var self = this
self.$u.api.listOrder(param).then((res) => {
if (res.code == 200) {
if (res.data.type != self.orderType) return // 已切换到其他tab,则不处理后台返回的数据
components: {
TabBarPage,
OrderCell,
NoOrder,
MaskTip
// EusingList,
},
data() {
return {
curNow: 0,
pageNumber: 0,
orderList: [
// 用多个数组存储可以优化用户切换体验,但是会增加内存
[[], [], [], [], [], []],
[[], [], []]
],
list: [
[
{
name: '待预约',
total: 0
},
{
name: '待签到',
total: 0
},
{
name: '待完工',
total: 0
},
{
name: '审核中',
total: 0
},
{
name: '异常单',
total: 0
},
{
name: '已完工',
total: 0
}
],
[
{
name: '待联系',
total: 0
},
{
name: '待完工',
total: 0
},
{
name: '异常单',
total: 0
}
]
],
current: { 0: 0, 1: 0 },
loadStatus: 'loading',
dataValue: [],
loaded: false,
triggered: true,
freshing: false,
scrollTop: 0,
old: {
scrollTop: 0
},
showMask: false
};
},
computed: {
subList() {
return ['全部订单', '今日订单'];
},
// 0 全部订单: 0:'待预约', 1:'待签到', 2:'待完工', 3:'审核中', 4:'异常单', 5'已完工'
// 1 今日订单: 0:'今日待联系', 1:'今日待完工', 2:'今日异常单'
orderType() {
return this.indexStatus[this.curNow][this.current[this.curNow]];
},
pageSize() {
// 待预约, 待签到,待完工,因为需要排序,所以暂时去掉分页,一次要完所有
return this.pageSizes[this.curNow][this.current[this.curNow]];
},
needSort() {
// 待预约, 待签到,待完工需要排序
return this.curNow + this.current[this.curNow] < 3;
},
pageSizes() {
// 待预约, 待签到,待完工,因为需要排序,所以暂时去掉分页,一次要完所有
return [[10000, 10000, 10000, 15, 15, 15], [10000, 10000, 15]];
},
offset() {
return [[0, 0], [0, 44]];
},
sousuoImage() {
return process.uniEnv.qn_base_url + 'sousuo.png';
},
// 每一种状态对应的tab的index
types() {
return [
{
waitAppointment: 0, // 待预约、
waitCheckIn: 1, // 待签到、
waitFinish: 2, // 待完工、
audit: 3, // 审核中、
exception: 4, // 异常单、
finish: 5 //已完工
},
{
todayWaitContact: 0, // 今日待联系、
todayWaitFinish: 1, // 今日待完工、
todayException: 2 // 今日异常单、
}
];
},
// 每一个tab对应的状态
indexStatus() {
return [['waitAppointment', 'waitCheckIn', 'waitFinish', 'audit', 'exception', 'finish'], ['todayWaitContact', 'todayWaitFinish', 'todayException']];
},
// 订单数量接的返回数量的key
countKeys() {
return [
[
'toAppointmentCount',
'toCheckinCount',
'toFinishCount',
'reviewingCount',
'exceptionCount',
'' // 待完工没有数量
],
['todayContactCount', 'todayFinishCount', 'todayExceptionCount']
];
},
isFinish() {
return this.orderType == 'finish';
},
noMore() {
return this.orderList[this.curNow][this.current[this.curNow]].length == 0 && this.loaded;
},
cellTypes() {
return [['waitAppointment', 'waitCheckIn', 'waitFinish', 'audit', 'exception', 'finish'], ['', 'waitFinish', 'exception']];
},
// 仅用于传给OrderCell的type
cellType() {
return this.cellTypes[this.curNow][this.current[this.curNow]];
},
noOrderCustomStyle() {
return 'margin-top: 100rpx;background-color: #F4F5F7';
},
imageStyle() {
return 'width:546rpx; margin-top:80rpx; margin-left:100rpx';
}
},
onLoad(e) {
getApp().trackPage('订单首页');
this.freshing = false;
// 跳转到本页是否带了跳到那个tab的参数
if (e && e.type) {
this.current[this.curNow] = Math.max(0, this.indexStatus[this.curNow].indexOf(e.type));
}
},
onShow() {
if (this.uploadTask.length > 0) {
upload.uploadImageTask(this);
}
this.reloadOrderInfo();
},
methods: {
sectionChange(index) {
this.curNow = index;
this.reloadOrderList();
},
// tab栏切换
change(index) {
this.current[this.curNow] = index;
this.reloadOrderList();
},
// 滚动底部
reachBottom(e) {
if (this.loadStatus != 'loadmore') return;
this.loadStatus == 'loading';
this.getOrderList();
},
// 页面数据
getOrderList() {
// 状态处理
this.pageNumber += 1;
if (this.pageNumber == 1) {
this.loaded = false;
}
var param = {
pageNumber: this.pageNumber,
pageSize: this.pageSize,
keyword: '',
type: this.orderType
};
var self = this;
self.$u.api.listOrder(param).then(res => {
if (res.code == 200) {
if (res.data.type != self.orderType) return; // 已切换到其他tab,则不处理后台返回的数据
if (self.pageNumber == 1) {
// 下拉刷新或切换到新tab,清空对应数组
self.orderList[this.curNow][this.current[this.curNow]] = []
}
if (res.data.list) {
self.orderList[this.curNow][this.current[this.curNow]].push(
...res.data.list
)
// 更新tab数字
if (
!this.isFinish &&
self.list[this.curNow][self.types[this.curNow][res.data.type]]
) {
self.list[this.curNow][
self.types[this.curNow][res.data.type]
].total = res.data.total
}
// 待预约, 待签到,待完工需要排序
if (this.needSort) {
self.orderList[this.curNow][this.current[this.curNow]].sort(
(x, y) => {
return x.currentOverTime < y.currentOverTime ? 1 : -1
}
)
}
// 更新底部加载状态
self.loadStatus =
res.data.total >
self.orderList[this.curNow][this.current[this.curNow]].length &&
res.data.list.length == self.pageSize
? 'loadmore'
: 'nomore'
}
} else {
console.log(res.message, '获取订单数量失败!')
}
self.$nextTick(() => {
if (self._freshing) {
self.triggered = false
self._freshing = false
}
})
this.loaded = true
})
},
if (self.pageNumber == 1) {
// 下拉刷新或切换到新tab,清空对应数组
self.orderList[this.curNow][this.current[this.curNow]] = [];
}
if (res.data.list) {
self.orderList[this.curNow][this.current[this.curNow]].push(...res.data.list);
// 更新tab数字
if (!this.isFinish && self.list[this.curNow][self.types[this.curNow][res.data.type]]) {
self.list[this.curNow][self.types[this.curNow][res.data.type]].total = res.data.total;
}
// 待预约, 待签到,待完工需要排序
if (this.needSort) {
self.orderList[this.curNow][this.current[this.curNow]].sort((x, y) => {
return x.currentOverTime < y.currentOverTime ? 1 : -1;
});
}
// 更新底部加载状态
self.loadStatus =
res.data.total > self.orderList[this.curNow][this.current[this.curNow]].length && res.data.list.length == self.pageSize ? 'loadmore' : 'nomore';
}
} else {
console.log(res.message, '获取订单数量失败!');
}
self.$nextTick(() => {
if (self.freshing) {
self.triggered = false;
self.freshing = false;
}
});
this.loaded = true;
});
},
// 获取订单数量
getOrderCount() {
this.$u.api.listOrderCount().then((res) => {
if (res.code == 200) {
if (res.data) {
// 修改各个tab数量
var j = 0
var count = 0
for (var items of this.list) {
var i = 0
for (var item of items) {
item.total = res.data[this.countKeys[j][i]] || 0
if (j == 0) {
// 非今日订单数量加起来
count += item.total
}
i++
}
j++
}
// 修改tab总数
if (count > 0) {
uni.setTabBarBadge({
index: 1,
text: String(count),
})
} else {
uni.removeTabBarBadge({
index: 1,
})
}
}
} else {
console.log(res.message, '获取订单数量失败!')
}
})
},
handleClickCellButton(item) {
if (!this.loaded) return
uni.navigateTo({
url:
'pages/order/complete?orderId=' +
item.orderId +
'&categoryId=' +
item.categoryId +
'&orderServiceType=' +
item.orderServiceType +
'&inGuaranteePeriod=' +
item.inGuaranteePeriod +
'&partnerCompanyId=' +
item.partnerCompanyId +
'&maintainStep=' +
item.maintainStep +
'&orderStatus=' +
item.orderStatus +
'&brandId=' +
item.lianbaoBrandId +
'&auditResults=' +
(item.auditResults ? item.auditResults.join() : '') +
'&orderNumber=' +
item.orderNumber,
})
},
handleClick(item, type, showCountTime) {
if (!this.loaded) return
// type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
//type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url:
'pages/order/detail?id=' +
item.orderId +
'&type=' +
type +
'&showCountTime=' +
showCountTime,
})
},
handleClickSearch() {
uni.navigateTo({
url: 'pages/order/search',
})
},
onRefresh() {
if (this._freshing) return
this._freshing = true
this.reloadOrderInfo()
},
onRestore() {
this.triggered = 'restore' // 需要重置
},
reloadOrderInfo() {
this.reloadOrderList()
this.getOrderCount()
},
reloadOrderList() {
this.pageNumber = 0
this.loadStatus = 'loading'
this.getOrderList()
},
scroll(e) {
this.old.scrollTop = e.detail.scrollTop
},
goTop(e) {
this.scrollTop = this.old.scrollTop
this.$nextTick(function() {
this.scrollTop = 0
})
},
// 显示提示蒙版
showMaskTip() {
this.showMask = true
},
},
}
// 获取订单数量
getOrderCount() {
this.$u.api.listOrderCount().then(res => {
if (res.code == 200) {
if (res.data) {
// 修改各个tab数量
var j = 0;
var count = 0;
for (var items of this.list) {
var i = 0;
for (var item of items) {
item.total = res.data[this.countKeys[j][i]] || 0;
if (j == 0) {
// 非今日订单数量加起来
count += item.total;
}
i++;
}
j++;
}
// 修改tab总数
if (count > 0) {
uni.setTabBarBadge({
index: 1,
text: String(count)
});
} else {
uni.removeTabBarBadge({
index: 1
});
}
}
} else {
console.log(res.message, '获取订单数量失败!');
}
});
},
handleClickCellButton(item) {
if (!this.loaded) return;
uni.navigateTo({
url:
'pages/order/complete?orderId=' +
item.orderId +
'&categoryId=' +
item.categoryId +
'&orderServiceType=' +
item.orderServiceType +
'&inGuaranteePeriod=' +
item.inGuaranteePeriod +
'&partnerCompanyId=' +
item.partnerCompanyId +
'&maintainStep=' +
item.maintainStep +
'&orderStatus=' +
item.orderStatus +
'&brandId=' +
item.lianbaoBrandId +
'&auditResults=' +
(item.auditResults ? item.auditResults.join() : '') +
'&orderNumber=' +
item.orderNumber
});
},
handleClick(item, type, showCountTime) {
if (!this.loaded) return;
// type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
//type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url: 'pages/order/detail?id=' + item.orderId + '&type=' + type + '&showCountTime=' + showCountTime
});
},
handleClickSearch() {
uni.navigateTo({
url: 'pages/order/search'
});
},
onRefresh() {
if (this.freshing) return;
this.freshing = true;
this.reloadOrderInfo();
},
onRestore() {
this.triggered = 'restore'; // 需要重置
},
reloadOrderInfo() {
this.reloadOrderList();
this.getOrderCount();
},
reloadOrderList() {
this.pageNumber = 0;
this.loadStatus = 'loading';
this.getOrderList();
},
scroll(e) {
this.old.scrollTop = e.detail.scrollTop;
},
goTop(e) {
this.scrollTop = this.old.scrollTop;
this.$nextTick(function() {
this.scrollTop = 0;
});
},
// 显示提示蒙版
showMaskTip() {
this.showMask = true;
}
}
};
</script>
<style lang="scss" scoped>
.u-tabs-box {
margin-bottom: 30rpx;
margin-bottom: 30rpx;
}
.tab-view {
height: 100%;
overflow: auto;
.load-more-view {
padding-bottom: 44rpx;
}
.loading-view {
width: 100%;
background-color: transparent;
display: flex;
align-items: center;
justify-content: center;
top: 50%;
left: 0;
position: fixed;
}
height: 100%;
overflow: auto;
.load-more-view {
padding-bottom: 44rpx;
}
.loading-view {
width: 100%;
background-color: transparent;
display: flex;
align-items: center;
justify-content: center;
top: 50%;
left: 0;
position: fixed;
}
}
.tools-box {
display: flex;
flex-direction: row;
justify-content: space-between;
padding-bottom: 18rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
padding-bottom: 18rpx;
.search-sub {
height: 72rpx;
width: 320rpx;
}
.search-sub {
height: 72rpx;
width: 320rpx;
}
.search-btn {
height: 72rpx;
width: 220rpx;
background-color: #ffffff;
border-radius: 36rpx;
color: #999999;
display: flex;
justify-content: center;
align-items: center;
.search-btn {
height: 72rpx;
width: 220rpx;
background-color: #ffffff;
border-radius: 36rpx;
color: #999999;
display: flex;
justify-content: center;
align-items: center;
.search-image {
width: 36rpx;
height: 32rpx;
flex-shrink: 0;
margin-right: 24rpx;
}
.search-image {
width: 36rpx;
height: 32rpx;
flex-shrink: 0;
margin-right: 24rpx;
}
.search-btn-text {
line-height: 36rpx;
font-weight: 400;
font-size: 26rpx;
}
}
.search-btn-text {
line-height: 36rpx;
font-weight: 400;
font-size: 26rpx;
}
}
}
</style>
......@@ -3,7 +3,11 @@
<view class="xh-select" :style="{ width: width }">
<view class="u-flex u-row-between picker-common" :class="{ border: border }" :style="{ background: background }">
<picker mode="selector" :value="index" :range-key="rangeKey" :range="list" @click="onOpen" @change="pickerChange" @cancel="close" class="u-flex-1" :disabled="disabled">
<view class="txt">{{ text || placeholder }}</view>
<view class="txt">
<view class="text-inner">
{{ text || placeholder }}
</view>
</view>
</picker>
<u-icon class="input-icon" color="#2272FF" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon>
</view>
......@@ -121,7 +125,6 @@ export default {
border-radius: 6px;
color: #333333;
padding-left: 10px;
padding-right: 50rpx;
width: 100%;
height: 36px;
.u-flex-1 {
......@@ -129,9 +132,13 @@ export default {
.txt {
font-size: 14px;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
.text-inner{
padding-right: 50rpx;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
......
......@@ -2,12 +2,12 @@
<view class="goods-count">
<view class="goods-count-item">
<view class="goods-count-item-title">充电桩库存量</view>
<view class="goods-count-item-count">{{inventoryCount}}</view>
<view class="goods-count-item-count">{{signCount}}</view>
</view>
<view class="goods-count-line"></view>
<view class="goods-count-item">
<view class="goods-count-item-title">充电桩盘点量</view>
<view class="goods-count-item-count">{{checkCount}}</view>
<view class="goods-count-item-count">{{takeCount}}</view>
</view>
</view>
</template>
......@@ -16,11 +16,11 @@
export default {
name: 'GoodsCount',
props:{
inventoryCount:{
signCount:{
type:Number,
default:0
},
checkCount:{
takeCount:{
type:Number,
default:0
},
......
......@@ -3,55 +3,62 @@
<view class="tools-box">
<view class="tools-box-left">
<view class="tools-box-left-title">选择品牌</view>
<view class="tools-box-left-select"><xh-picker-select background="#f4f5f7" placeholder="全部" :rangeKey="rangeKey" :value="value" :list="brandList" @change="pickerchange"></xh-picker-select></view>
</view>
<view class="tools-box-navi">
<xh-button @handleClick="naviTo" text="去盘点"></xh-button>
<view class="tools-box-left-select">
<xh-picker-select background="#f4f5f7" placeholder="全部" :rangeKey="rangeKey" :value="value" :list="brandList" @change="pickerchange"></xh-picker-select>
</view>
</view>
<view class="tools-box-navi"><xh-button :disabled="buttonShow" @handleClick="naviTo" text="去盘点"></xh-button></view>
</view>
</template>
<script>
import XhPickerSelect from '../XhPickerSelect.vue';
import XhButton from "@/components/mine/xh-button.vue"
import { receiveStatusOptions } from '@/common/optinos/mine/received.js';
import XhButton from '@/components/mine/xh-button.vue';
import { showToast } from '@/common/common.js';
export default {
props: ['current','value'],
props: {
current: {
type: Number | null
},
value: {
type: Number | null
},
takeStatus: {
type: Number | null,
default: 9
}
},
components: {
XhPickerSelect,
XhButton
},
data() {
return {
receiveStatusOptions,
rangeKey:"name",
brandList: [
{
id:0,
name:'全部',
},
{
id:982,
name:'长城',
},
],
rangeKey: 'name',
brandList: []
};
},
computed: {
buttonShow() {
return this.takeStatus !== 0 && this.takeStatus !== 1;
}
},
methods: {
// 获取品牌列表
async getBrandList() {
let res = await this.$u.api.brandListByReceivedModules();
let { code, data } = res;
if (code === 200){
let { code, data, message } = res;
if (code === 200) {
this.brandList = data || [];
}
} else {
showToast(message);
}
},
pickerchange(data) {
this.$emit('pickerchange', data);
},
naviTo(){
naviTo() {
this.$emit('toAdd');
}
}
......@@ -66,27 +73,27 @@ export default {
align-items: center;
margin-bottom: 30rpx;
height: 100rpx;
background-color: #FFFFFF;
background-color: #ffffff;
padding: 0 30rpx;
border-radius: 12rpx;
&-left{
&-left {
display: flex;
align-items: center;
&-title{
&-title {
width: 120rpx;
display: flex;
align-items: center;
justify-content: flex-start;
margin-right: 20rpx;
}
&-select{
&-select {
width: 240rpx;
background-color: #ffffff;
border-radius: 8rpx;
}
}
&-navi{
&-navi {
width: 180rpx;
}
}
......
<template>
<uni-swipe-action-item :right-options="rightOptions" @click.stop="swipeClick" >
<uni-swipe-action-item :right-options="rightOptions" @click.stop="swipeClick">
<view class="receiving-info" @click.stop="handleClick">
<view class="receiving-info-content">
<text class="receiving-info-content-left">箱码</text>
<text class="receiving-info-content-right">{{ detail.code }}</text>
<text class="receiving-info-content-right">{{ detail.productCode }}</text>
</view>
<view class="receiving-info-content">
<text class="receiving-info-content-left">状态</text>
<text class="receiving-info-content-right" :class="[statusColor]">{{ statusLabel }}</text>
<text class="receiving-info-content-right" :style="{ color: statusColor }">{{ takeStatusLabel }}</text>
</view>
</view>
</uni-swipe-action-item>
</template>
<script>
import { myFilter } from '@/common/common.js';
import { receiveStatusOptions } from '@/common/optinos/mine/received.js';
import { showModal } from '@/common/common.js';
import { statusColorOptions } from '@/common/optinos/mine/received.js';
import { takeDetailStatusOptions } from '@/common/optinos/mine/inventory.js';
import { showModal,myFilter } from '@/common/common.js';
export default {
name: 'ReceivingInfo',
props: {
......@@ -26,17 +26,14 @@ export default {
},
/* 品牌类型 */
options: {
type: Array|null,
type: Array | null,
default: () => []
}
},
data() {
return {
receiveStatusOptions,
statusColorOptions: {
1: 'receiving-info-footer-status-grey',
2: 'receiving-info-footer-status-blue'
},
takeDetailStatusOptions,
statusColorOptions,
rightOptions: [
{
text: '取消',
......@@ -55,11 +52,10 @@ export default {
},
computed: {
statusColor() {
return this.statusColorOptions[this.detail.status] || '';
return this.statusColorOptions[this.takeStatusLabel] || '';
},
statusLabel() {
// 按钮文字
return myFilter(this.detail.status, this.receiveStatusOptions, 'name');
takeStatusLabel(){
return myFilter(this.detail.status, this.takeDetailStatusOptions);
},
brandLabel() {
return myFilter(this.detail.brand, this.options);
......@@ -76,16 +72,16 @@ export default {
this.openDelete();
}
},
handleClick() {
this.$emit('handleClick', this.detail.id);
this.$emit('handleClick', this.detail.detailId);
},
openDelete(index) {
showModal({
content: '删除车辆后,将无法收到车辆信息,是否删除该车辆?',
content: '是否删除该数据?',
success: res => {
if (res.confirm) {
this.$emit('handleDelete', this.detail.id );
this.$emit('handleDelete', this.detail.detailId);
}
}
});
......
......@@ -73,8 +73,8 @@ export default {
let { scanType, result } = res;
console.log('类型:' + scanType);
console.log('内容:' + result);
this.dataValue = result;
this.$emit('onBarCodeChange', result);
this.dataValue = result.substring(0,200);
this.$emit('onBarCodeChange', this.dataValue);
}
});
},
......
<template>
<view class="receive-images">
<view class="title-view">
<view class="title-left-view" >
<text>{{ uploadForm.label }}</text>
</view>
<view class="info-tip-text" v-if="!disabled">{{ uploadForm.tips }}</view>
<view class="image-view">
<block v-for="(item, key) in uploadForm.imgs" :key="key">
<view class="info-image-box" v-if="key < uploadForm.count">
<image class="info-image-box-inner" mode="aspectFill" v-if="item.path" :src="item.path" @click="perview(key)"></image>
<view class="info-image-box-close" v-if="!disabled" @click="removeImage(key)"><u-icon name="close"></u-icon></view>
</view>
</block>
<view class="info-image-box" @click="handleClick" v-if="!disabled&&uploadForm.imgs.length < uploadForm.count">
<view class="info-image-box-add"><u-icon name="plus"></u-icon></view>
</view>
</view>
<view v-if="!disabled&&uploadForm.imgs.length == 0" class="bottom-tip-view">
<image class="bottom-tip-image" mode="widthFix" :src="tishiImage"></image>
<text>最少上传一张箱码照片</text>
</view>
</view>
</view>
</template>
<script>
import base from '@/components/upload/index';
export default {
name: 'ReceiveImages',
mixins: [base],
props: {
disabled: {
type: Boolean,
default: false,
},
},
data() {
return {
tishiImage: process.uniEnv.qn_base_url + 'tishi.png',
uploadForm: {
filedName: '',
count: 3,
label: '箱码照片',
tips: '上传箱码照片',
imgs: []
}
};
},
computed: {},
created() {},
mounted() {
this.initImages();
},
methods: {
initImages(images) {
this.uploadForm.imgs = images || [];
console.log(this.uploadForm.imgs)
},
valueChange(e) {
this.$emit('onScanCodeChange', e);
},
async handleClick() {
if(this.disabled) return false;
let { count, imgs } = this.uploadForm;
// let imgCount=count-imgs.length;
// 已满3张不能再上传
if (imgs.length === count) {
return false;
}
let imgList = await this.chooseImg({ count: 1, size: ['compressed'] });
this.uploadForm.imgs.push(...imgList);
console.log(this.uploadForm.imgs)
this.updateImages();
},
// 预览
perview(index) {
let urls = this.uploadForm.imgs.map(item => {
return item.path;
});
uni.previewImage({
current: index,
urls: urls
});
},
removeImage(index) {
this.uploadForm.imgs.splice(index, 1);
this.updateImages();
},
updateImages() {
this.$emit('updateImages', this.uploadForm.imgs);
}
}
};
</script>
<style lang="scss" scoped>
.receive-images {
background-color: #ffffff;
border-radius: 12rpx;
padding: 20rpx 30rpx;
margin-bottom: 20rpx;
color: #333333;
.title-view {
font-size: 32rpx;
.title-left-view {
font-weight: bold;
}
.info-tip-text {
font-size: 24rpx;
color: #666666;
margin-top: 10rpx;
}
}
.bottom-tip-view {
color: #999999;
font-size: 20rpx;
display: flex;
align-items: flex-start;
margin-top: 30rpx;
}
.bottom-tip-image {
width: 22rpx;
height: 22rpx;
margin-right: 8rpx;
margin-top: 4rpx;
flex-shrink: 0;
}
.image-view {
margin-top: 30rpx;
display: flex;
.info-image-box {
width: 216rpx;
height: 216rpx;
background-color: #cccccc;
position: relative;
margin-right: 20rpx;
border-radius: 12rpx;
&:last-child {
margin-right: 0;
}
}
.info-image-box-inner {
border-radius: 12rpx;
overflow: hidden;
width: 100%;
height: 100%;
}
.info-image-box-close {
width: 38rpx;
height: 38rpx;
border-radius: 50%;
background-color: #666666;
font-size: 22rpx;
line-height: 38rpx;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: -8rpx;
right: -8rpx;
z-index: 1;
}
.info-image-box-add {
width: 100%;
height: 100%;
font-size: 120rpx;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
}
}
}
</style>
......@@ -50,7 +50,7 @@ export default {
computed: {},
created() {},
mounted() {
this.initImages();
// this.initImages();
},
methods: {
initImages(images) {
......@@ -69,9 +69,9 @@ export default {
if (imgs.length === count) {
return false;
}
let imgList = await this.chooseImg({ count: 1, size: ['compressed'] });
// size: ["original",'compressed']
let imgList = await this.chooseImg({ count: 1 });
this.uploadForm.imgs.push(...imgList);
console.log(this.uploadForm.imgs)
this.updateImages();
},
// 预览
......
......@@ -80,8 +80,8 @@ export default {
console.log('类型:' + scanType);
console.log('内容:' + result);
if (scanType === 'QR_CODE') {
this.dataValue = result;
this.$emit("onScanCodeChange",result)
this.dataValue = result.substring(0,200);
this.$emit("onScanCodeChange",this.dataValue)
}
}
});
......
......@@ -22,15 +22,16 @@
<script>
import XhPickerSelect from '../XhPickerSelect.vue';
import { receiveStatusOptions } from '@/common/optinos/mine/received.js';
import { showToast } from '@/common/common.js';
export default {
props: ['current','value'],
props: ['current', 'value'],
components: {
XhPickerSelect
},
data() {
return {
receiveStatusOptions,
rangeKey:"name",
rangeKey: 'name',
brandList: []
};
},
......@@ -38,10 +39,12 @@ export default {
// 获取品牌列表
async getBrandList() {
let res = await this.$u.api.brandListByReceivedModules();
let { code, data } = res;
if (code === 200){
let { code, data, message } = res;
if (code === 200) {
this.brandList = data || [];
}
} else {
showToast(message);
}
},
// tab栏切换
change(index) {
......
......@@ -9,14 +9,14 @@
<text class="receiving-info-content-right">{{ detail.brandName }}</text>
</view>
<view class="receiving-info-footer">
<view :class="[statusColor]">{{ detail.status }}</view>
<view :class="[statusColor]">{{ statusLabel }}</view>
</view>
</view>
</template>
<script>
import { myFilter } from '@/common/common.js';
import { receiveStatusOptions } from '@/common/optinos/mine/received.js';
import { statusOptions } from '@/common/optinos/mine/received.js';
export default {
name: 'ReceivingInfo',
props: {
......@@ -27,23 +27,23 @@ export default {
},
data() {
return {
receiveStatusOptions
statusOptions
};
},
computed: {
statusColor() {
return this.detail.status === "已使用" ? 'receiving-info-footer-status-grey' : 'receiving-info-footer-status-blue';
return this.detail.status === "1" ? 'receiving-info-footer-status-grey' : 'receiving-info-footer-status-blue';
},
statusLabel() {
// 按钮文字
return myFilter(this.detail.status, this.receiveStatusOptions, 'name');
return myFilter(this.detail.status, this.statusOptions);
},
},
created() {},
methods: {
handleClick() {
this.$emit('handleClick', this.detail.id);
this.$emit('handleClick', this.detail.signId);
}
}
};
......
......@@ -53,7 +53,7 @@
enable-back-to-top
>
<!-- 加载中 && 没有下拉:显示加载中 -->
<view class="loading-view" v-if="!loaded && _freshing"><u-loading mode="flower"></u-loading></view>
<view class="loading-view" v-if="!loaded && freshing"><u-loading mode="flower"></u-loading></view>
<!-- 无数据 -->
<NoOrder v-else-if="noParts" imageName="wupeijianxinxi.png" text="当前暂无物料信息" :customStyle="noPartsCustomStyle" />
<template v-else>
......@@ -92,7 +92,7 @@ export default {
loadStatus: 'loading', // 底部加载状态
loaded: false, // 页面加载
triggered: true, // true:下拉刷新
_freshing: false, // 防止下拉刷新重复触发
freshing: false, // 防止下拉刷新重复触发
buttonType: 'expand' // 申请按钮宽 collapse': '80rpx', 'expand': '220rpx''
};
},
......@@ -157,7 +157,7 @@ export default {
// 跳转到第几个tab页
this.currentIndex = e.index;
}
this._freshing = false;
this.freshing = false;
this.reloadPartsList(); // 加载数据
},
onShow() {
......@@ -204,9 +204,9 @@ export default {
}
this.$nextTick(() => {
// 页面刷新完之后更新下拉状态
if (this._freshing) {
if (this.freshing) {
this.triggered = false;
this._freshing = false;
this.freshing = false;
}
});
this.loaded = true; // 加载完成
......@@ -270,8 +270,8 @@ export default {
},
// 下拉刷新
onRefresh() {
if (this._freshing) return;
this._freshing = true;
if (this.freshing) return;
this.freshing = true;
this.reloadPartsList();
},
// 重置下拉状态
......@@ -350,4 +350,4 @@ export default {
bottom: 64rpx;
}
}
</style>
</style>
<template>
<!-- 收货列表 -->
<view class="ware-house">
<view class="ware-house" @click="closeAll">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="盘点" titleColor="#333333" :border-bottom="false" title-bold></u-navbar>
<inventory-head ref="inventory-head" @toAdd="toAdd" :value="form.brandId" @pickerchange="pickerchange"></inventory-head>
<goods-count :inventoryCount="inventoryCount" :checkCount="checkCount"></goods-count>
<inventory-head ref="inventory-head" @toAdd="toAdd" :takeStatus="takeStatus" :value="form.brandId" @pickerchange="pickerchange"></inventory-head>
<goods-count :signCount="signCount" :takeCount="takeCount"></goods-count>
<!-- 列表 -->
<view class="tab-view" @click="closeAll">
<view class="tab-view">
<scroll-view
scroll-y
style="height: 100%;width: 100%;"
@scrolltolower="reachBottom"
scroll-anchoring
refresher-enabled="true"
:refresher-triggered="triggered"
:refresher-threshold="100"
:scroll-top="scrollTop"
refresher-background="#F4F5F7"
@refresherrefresh="onRefresh"
@refresherrestore="onRestore"
@scroll="scroll"
enable-back-to-top
>
<NoOrder v-if="noParts" imageName="zwdd.png" :customStyle="noOrderCustomStyle" />
<NoOrder v-if="noParts" imageName="zwdd.png" text="暂无数据" :customStyle="noOrderCustomStyle" />
<template v-else>
<uni-swipe-action ref="uni-swipe-action">
<view class="swipe-action" v-for="(item, index) in list" :key="item.id">
<view class="swipe-action" v-for="(item, index) in list" :key="item.detailId">
<inventory-info :detail="item" :options="brandList" @handleClick="handleClick" @handleDelete="handleDelete"></inventory-info>
</view>
</uni-swipe-action>
<view class="load-more-view" v-show="(form.pageNumber == 1 && loaded) || form.pageNumber > 1"><u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore></view>
</template>
<view class="loading-view" v-if="!loaded && !freshing"><u-loading mode="flower"></u-loading></view>
</scroll-view>
</view>
<!-- 底部按钮 -->
<fixed-button text="确认盘点" @handleClick="confirm"></fixed-button>
<fixed-button :disabled="disabled" :text="fixedButtonTxt" @handleClick="submit"></fixed-button>
<!-- 通用提示框 -->
<view><u-toast ref="uToast" /></view>
</view>
......@@ -50,6 +45,8 @@ import InventoryInfo from './components/inventory/inventoryInfo.vue';
import NoOrder from '@/components/order/noOrder.vue';
import ApplyButton from '@/components/parts/applyButton.vue';
import { receiveStatusOptions } from '@/common/optinos/mine/received.js';
import { inventoryStatusOptions } from '@/common/optinos/mine/inventory.js';
import { showToast, showModal, myFilter } from '@/common/common.js';
export default {
components: {
inventoryHead,
......@@ -62,56 +59,27 @@ export default {
data() {
return {
receiveStatusOptions,
list: [
{ id: 1, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 2, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 3, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 4, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 5, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 6, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 7, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 8, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 9, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 10, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 11, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 12, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 13, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 14, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 15, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 16, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 17, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 18, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 19, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 20, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 21, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 22, status: 1, code: 'dsadq4231', brand: 'byd', show: false },
{ id: 23, status: 1, code: 'dsadq4231', brand: 'byd', show: false }
], // 物料订单列表
inventoryStatusOptions, // 盘点状态
list: [], // 物料订单列表
form: {
pageNumber: 0,
pageSize: 10,
brandId: '',
brandId: ''
},
show: false,
loadStatus: 'loading', // 底部加载状态
loaded: false, // 页面加载
triggered: true, // true:下拉刷新
freshing: false, // 防止下拉刷新重复触发
buttonType: 'expand', // 申请按钮宽 collapse': '80rpx', 'expand': '220rpx''
scrollTop: 0,
old: {
scrollTop: 0
},
buttonStyle: {
width: '100%',
height: '80rpx',
fontSize: '32rpx',
fontWeight: 'bold'
stock: {
takeId: '',
takeStatus: '' // 盘点中 已提交 盘点完成 申请重盘
},
inventoryCount: 0,
checkCount: 0
signCount: 0, // 库存数量
takeCount: 0, // 当前盘点数量
takeStatusOptions: {
0: '去盘点',
1: '确认盘点',
2: '申请重盘',
3: '已完成'
}
};
},
computed: {
......@@ -122,6 +90,28 @@ export default {
// 无数据页面样式
noPartsCustomStyle() {
return 'margin-top: 100rpx;background-color: #F4F5F7';
},
takeStatus() {
let status;
switch (this.stock.takeStatus) {
case '1':
case '2':
status = 2;
break;
case '3':
status = 3;
break;
default:
status = 1;
break;
}
return status;
},
fixedButtonTxt() {
return this.takeStatusOptions[this.takeStatus];
},
disabled() {
return this.stock.takeStatus === '3' ? true : false;
}
},
onLoad(e) {
......@@ -130,6 +120,7 @@ export default {
// // 跳转到第几个tab页
// this.currentIndex = e.index;
// }
this.getBrandList();
this.freshing = false;
this.reloadList(); // 加载数据
},
......@@ -144,32 +135,36 @@ export default {
},
methods: {
pickerchange(data) {
this.form.brandId = data.id||"";
this.form.brandId = data.id || '';
if (data.name === '全部') {
this.form.brandName = '';
} else {
this.form.brandName = data.name || '';
}
this.reloadList();
},
// 获取品牌列表
getBrandList(){
this.$refs["inventory-head"].getBrandList()
getBrandList() {
this.$refs['inventory-head'].getBrandList();
},
// 页面数据:未入库
async getList() {
async getList(noReset = false) {
// 状态处理
this.form.pageNumber += 1;
if (this.form.pageNumber == 1) {
this.loaded = false;
}
var param = this.form
let res = await this.$u.api.inventoryListByReceivedModules(param);
this.loaded = false;
var param = this.form;
let res = await this.$u.api.inventoryListByInventoryModules(param);
if (res.code == 200) {
if (this.form.pageNumber == 1) {
this.list = [];
let { list, count, signCount, stock, takeCount } = res.data;
if (!noReset) {
let arr = list || [];
arr.forEach(item => (item.show = false));
this.list = arr;
}
let list = res.data || [];
list.forEach(item => (item.show = false));
this.list.push(...list);
this.loadStatus = list.length < this.pageSize ? 'nomore' : 'loadmore'; // 底部加载状态
this.stock = stock;
this.signCount = signCount;
this.takeCount = takeCount;
} else {
// this.loadStatus = 'loadmore';
showToast(res.message);
console.log(res.message);
}
this.$nextTick(() => {
......@@ -183,8 +178,11 @@ export default {
},
// 跳转到详情
handleClick(id) {
let url = 'pages/mine/warehouse/inventoryDetail';
if (id) url += `?id=${id}`;
if (!this.stock.takeId) {
return false;
}
let url = `pages/mine/warehouse/inventoryDetail?takeId=${this.stock.takeId}`;
if (id) url += `&id=${id}`;
uni.navigateTo({
url
});
......@@ -193,14 +191,6 @@ export default {
toAdd() {
this.handleClick();
},
// 本页数据设置,用于其他页面访问本页数据
setPageInfo(info) {
var pages = getCurrentPages();
if (pages.length >= 1) {
var page = pages[pages.length - 1];
page.info = info;
}
},
// 下拉刷新
onRefresh() {
if (this.freshing) return;
......@@ -214,33 +204,74 @@ export default {
// 初始化加载
reloadList() {
// 第一页数据
this.form.pageNumber = 0;
this.loadStatus = 'loading';
this.getList();
},
// 滚到底部加载下一页
reachBottom(e) {
if (this.loadStatus != 'loadmore') return;
this.loadStatus == 'loading';
this.getList();
},
scroll(e) {
// this.old.scrollTop = e.detail.scrollTop;
},
closeAll() {
if (this.list.length) {
this.$refs['uni-swipe-action'].closeOther(undefined);
}
},
async handleDelete(id) {
if (this.stock.takeStatus !== '0') {
showToast('盘点已提交,无法删除');
return false;
}
console.log('删除--', id);
// let {code,data}=await onDelete(id)
let { code, message } = await this.$u.api.deleteInventoryByInventoryModules(id);
if (code === 200) {
showToast('操作成功');
setTimeout(() => {
this.reloadList();
}, 1200);
} else {
showToast(message);
}
},
// 确认盘点
// 提交
submit() {
let content = '';
if (this.stock.takeStatus === '0') {
content = '是否提交所有盘点?';
} else if (this.stock.takeStatus === '1') {
content = '是否申请重新盘点?';
} else {
if (this.stock.takeStatus === '2') {
showToast('已申请重新盘点,请等待审核');
}
return false;
}
showModal({
content,
success: res => {
if (res.confirm) {
if (this.stock.takeStatus === '0') {
this.confirm();
} else if (this.stock.takeStatus === '1') {
this.applyReInventory();
}
}
}
});
},
// 确认提交盘点
async confirm() {
if (this.list.length) {
// let res=await confirmSubmit()
let { code, message } = await this.$u.api.confirmInventoryByInventoryModules(this.stock.takeId);
if (code === 200) {
showToast('操作成功');
this.getList(true);
} else {
showToast(message);
}
},
// 申请重新盘点
async applyReInventory() {
let { code, message } = await this.$u.api.confirmInventoryByInventoryModules(this.stock.takeId);
if (code === 200) {
showToast('已申请重盘');
} else {
showToast(message);
}
await this.getList(true);
}
}
};
......
<template>
<!-- 收货详情 -->
<view class="ware-house">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="盘点" titleColor="#333333" :border-bottom="false" title-bold></u-navbar>
<u-navbar back-icon-color="#333333" :background="{ backgroundColor: '#F4F5F7' }" title="盘点" titleColor="#333333" :border-bottom="false" title-bold></u-navbar>
<view class="tools-box">
<text class="tools-box-title">品牌</text>
<view class="select-view">
......@@ -20,11 +20,11 @@
</view>
<!-- 列表 -->
<view class="tab-view">
<receive-qr-code @onScanCodeChange="onScanCodeChange"></receive-qr-code>
<receive-images ref="receive-images" @updateImages="updateImages"></receive-images>
<receive-qr-code :disabled="disabled" :value="form.productCode" @onScanCodeChange="onScanCodeChange"></receive-qr-code>
<receive-images ref="receive-images" :value="form.image" :disabled="disabled" @updateImages="updateImages"></receive-images>
</view>
<!-- 底部按钮 -->
<fixed-button text="保存并下一个" @handleClick="submit"></fixed-button>
<fixed-button text="保存并下一个" @handleClick="submit" v-if="!disabled"></fixed-button>
<!-- 通用提示框 -->
<view><u-toast ref="uToast" /></view>
</view>
......@@ -36,7 +36,7 @@ import FixedButton from '@/components/mine/fixed-button.vue';
import ReceiveQrCode from './components/receiveDetail/receiveQrCode.vue';
import ReceiveImages from './components/receiveDetail/receiveImages.vue';
import { receiveStatusOptions } from '@/common/optinos/mine/received.js';
import { showToast } from '@/common/common.js';
import { showToast,setNeedRefresh } from '@/common/common.js';
export default {
components: {
XhPickerSelect,
......@@ -48,16 +48,8 @@ export default {
return {
receiveStatusOptions,
rangeKey: 'name',
brandList: [
{
id: 0,
name: '全部'
},
{
id: 982,
name: '长城'
}
],
disabled:false,
brandList: [],
form: {
id: '',
takeId: '',
......@@ -71,42 +63,53 @@ export default {
computed: {},
onLoad(e) {
this.getBrandList();
if (e && e.id) {
this.form.id = e.id;
this.getDetail();
this.disabled = true;
console.log(e)
if (e) {
let {id,takeId}=e
this.form.takeId = takeId;
if(id){
this.form.id = id;
this.getDetail();
this.disabled = true;
}
}
},
onShow() {},
methods: {
pickerchange(data) {
this.form.brandId = data.id;
this.form.brandName = data.brandName;
this.form.brandName = data.name;
},
onScanCodeChange(data) {
this.form.productCode = data;
},
updateImages(data) {
let image = data.map(item => process.uniEnv.qn_asset_url + '/' + item.src + '?imageView2/1/w/100/h/100/q/75');
let image = data.map(item => process.uniEnv.qn_asset_url + '/' + item.src);
// + '?imageView2/1/w/100/h/100/q/75' 添加此项为图片参数,配置大小
this.form.image = image.join(";");
},
// 获取品牌列表
async getBrandList() {
let res = await this.$u.api.brandListByReceivedModules();
let { code, data } = res;
let { code, data,message } = res;
if (code === 200) {
this.brandList = data || [];
}else{
showToast(message);
}
},
async getDetail() {
let res = await this.$u.api.inventoryDetailByInventoryModules(this.form.id);
let { code, data } = res;
let { code, data,message } = res;
if (code === 200) {
let image = data.image.split(';').map(item => {
return { path: item };
});
this.$refs['receive-images'].initImages(image);
this.form = Object.assign(this.form, data);
}else{
showToast(message);
}
},
submit() {
......@@ -128,18 +131,21 @@ export default {
},
async createdReceive(form) {
let res=await this.$u.api.addInventoryByInventoryModules(form)
let { code, data } = res;
let { code, data,message } = res;
if (code === 200) {
showToast('操作成功');
setNeedRefresh()
setTimeout(() => {
this.replacePage()
}, 1500);
}else{
showToast(message);
}
},
// 刷新当前页
replacePage() {
uni.redirectTo({
url: 'pages/mine/warehouse/receiveDetail'
url: `pages/mine/warehouse/inventoryDetail?takeId=${this.form.takeId}`
});
}
}
......
<template>
<!-- 收货详情 -->
<view class="ware-house">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="收货" titleColor="#333333" :border-bottom="false" title-bold></u-navbar>
<u-navbar back-icon-color="#333333" :background="{ backgroundColor: '#F4F5F7' }" title="收货" titleColor="#333333" :border-bottom="false" title-bold></u-navbar>
<view class="tools-box">
<text class="tools-box-title">品牌</text>
<view class="select-view">
......@@ -38,7 +38,7 @@ import ReceiveQrCode from './components/receiveDetail/receiveQrCode.vue';
import ReceiveBarCode from './components/receiveDetail/receiveBarCode.vue';
import ReceiveImages from './components/receiveDetail/receiveImages.vue';
import { receiveStatusOptions } from '@/common/optinos/mine/received.js';
import { showToast } from '@/common/common.js';
import { showToast,setNeedRefresh } from '@/common/common.js';
export default {
components: {
XhPickerSelect,
......@@ -54,7 +54,7 @@ export default {
brandList: [],
disabled: false,
form: {
id: '',
// id: '',
brandId: '',
brandName:"",
productCode: '', // 箱码二维码
......@@ -76,7 +76,7 @@ export default {
methods: {
pickerchange(data) {
this.form.brandId = data.id;
this.form.brandName = data.brandName;
this.form.brandName = data.name;
},
onScanCodeChange(data) {
this.form.productCode = data;
......@@ -85,30 +85,36 @@ export default {
this.form.courierNumber = data;
},
updateImages(data) {
let image = data.map(item => process.uniEnv.qn_asset_url + '/' + item.src + '?imageView2/1/w/100/h/100/q/75');
let image = data.map(item => process.uniEnv.qn_asset_url + '/' + item.src);
this.form.image = image.join(";");
},
// 获取品牌列表
async getBrandList() {
let res = await this.$u.api.brandListByReceivedModules();
let { code, data } = res;
let { code, data,message } = res;
if (code === 200) {
this.brandList = data || [];
}else{
showToast(message);
}
},
async getDetail() {
let res = await this.$u.api.receiveDetailByReceivedModules(this.form.id);
let { code, data } = res;
let { code, data,message } = res;
if (code === 200) {
let image = data.image.split(';').map(item => {
return { path: item };
});
this.$refs['receive-images'].initImages(image);
this.form = Object.assign(this.form, data);
if(!this.form.signId){
showToast('箱码不存在');
}
}else{
showToast(message);
}
},
submit() {
console.log(this.form)
let { brandId, productCode, courierNumber, image } = this.form;
if (!brandId) {
showToast('请选择品牌');
......@@ -131,12 +137,15 @@ export default {
},
async createdReceive(form) {
let res=await this.$u.api.addReceiveByReceivedModules(form)
let { code, data } = res;
let { code, data,message } = res;
if (code === 200) {
showToast('操作成功');
setNeedRefresh()
setTimeout(() => {
this.replacePage()
}, 1500);
}else{
showToast(message);
}
},
// 刷新当前页
......
......@@ -13,17 +13,17 @@
refresher-enabled="true"
:refresher-triggered="triggered"
:refresher-threshold="100"
:scroll-top="scrollTop"
refresher-background="#F4F5F7"
@refresherrefresh="onRefresh"
@refresherrestore="onRestore"
@scroll="scroll"
enable-back-to-top
>
<NoOrder v-if="noParts" imageName="zwdd.png" :customStyle="noOrderCustomStyle" />
<NoOrder v-if="noParts" imageName="zwdd.png" text="暂无数据" :customStyle="noOrderCustomStyle" />
<template v-else>
<view v-for="(item, index) in list" :key="index"><receiving-info :detail="item" @handleClick="handleClick"></receiving-info></view>
<view class="load-more-view" v-show="(form.pageNumber == 1 && loaded) || form.pageNumber > 1"><u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore></view>
<view class="load-more-view" v-show="(form.pageNumber == 1 && loaded) || form.pageNumber > 1">
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
</template>
<view class="loading-view" v-if="!loaded && !freshing"><u-loading mode="flower"></u-loading></view>
</scroll-view>
......@@ -43,6 +43,7 @@ import ReceivingInfo from './components/received/receivingInfo.vue';
import NoOrder from '@/components/order/noOrder.vue';
import ApplyButton from '@/components/parts/applyButton.vue';
import { receiveStatusOptions } from '@/common/optinos/mine/received.js';
import { showToast } from '@/common/common.js';
export default {
components: {
ReceivedHead,
......@@ -54,17 +55,12 @@ export default {
data() {
return {
receiveStatusOptions,
list: [
{ id: 123456, status: "未使用", productCode: 'dsadq4231', brandName: '比亚迪',courierNumber:"SF7720" },
{ id: 1111, status: "未使用", productCode: 'dsadq4231', brandName: '比亚迪' ,courierNumber:"SF7720"},
{ id: 1111, status: "未使用", productCode: 'dsadq4231', brandName: '比亚迪',courierNumber:"SF7720" },
{ id: 1111, status: "未使用", productCode: 'dsadq4231', brandName: '比亚迪',courierNumber:"SF7720" },
], // 物料订单列表
list: [], // 物料订单列表
form: {
pageNumber: 0,
pageSize: 10,
status: 0,
brandId: 982,
brandId: ''
},
show: false,
loadStatus: 'loading', // 底部加载状态
......@@ -106,7 +102,7 @@ export default {
// this.status = e.index;
// }
this.freshing = false;
this.getBrandList() // 获取品牌列表
this.getBrandList(); // 获取品牌列表
this.reloadList(); // 加载数据
},
onShow() {
......@@ -125,12 +121,12 @@ export default {
this.reloadList();
},
pickerchange(data) {
this.form.brandId = data.id||"";
this.form.brandId = data.id || '';
this.reloadList();
},
// 获取品牌列表
getBrandList(){
this.$refs["received-head"].getBrandList()
getBrandList() {
this.$refs['received-head'].getBrandList();
},
// 页面数据:收货列表
async getList() {
......@@ -139,18 +135,20 @@ export default {
if (this.form.pageNumber == 1) {
this.loaded = false;
}
var param = this.form
var param = this.form;
let res = await this.$u.api.receiveListByReceivedModules(param);
if (res.code == 200) {
if (this.form.pageNumber == 1) {
this.list = [];
}
let list = res.data || [];
this.list.push(...list);
this.loadStatus = list.length < this.pageSize ? 'nomore' : 'loadmore'; // 底部加载状态
let { list, count } = res.data;
let arr = list || [];
this.list.push(...arr);
this.loadStatus = arr.length < this.form.pageSize ? 'nomore' : 'loadmore'; // 底部加载状态
} else {
// this.loadStatus = 'loadmore';
console.log(res.message);
showToast(res.message);
}
this.$nextTick(() => {
// 页面刷新完之后更新下拉状态
......@@ -221,7 +219,7 @@ export default {
/* 兼容 iOS < 11.2 */
padding-bottom: env(safe-area-inset-bottom);
/* 兼容 iOS >= 11.2 */
.tab-view{
.tab-view {
height: 100%;
overflow: auto;
margin-bottom: 100rpx;
......@@ -232,7 +230,7 @@ export default {
.load-more-view {
padding-bottom: 64rpx;
}
.loading-view {
width: 100%;
display: flex;
......
<template>
<view class="pg-complete">
<complete-check
:show="completeCheck.status"
:list-data="completeCheck.result"
:pass="pass"
@close="closeCheckResult"
@confirm="confirm"
:confirm-button-text="completeCheck.confirmText"
:cancel-button-text="completeCheck.cancelText"
></complete-check>
<view class="com-content">
<u-navbar
:background="{ background: '#2272FF' }"
back-icon-color="#fff"
:title-size="32"
title-color="#fff"
:border-bottom="false"
:title="list[tabIndex].panelName"
title-bold
:custom-back="backGo"
></u-navbar>
<u-tabs
class="order-tabs"
ref="tabs"
:current="current"
name="panelName"
:list="tabList"
@change="swichMenu"
bg-color="#2272FF"
inactive-color="#a6c6ff"
active-color="#fff"
height="80"
font-size="32"
></u-tabs>
<view class="u-menu-wrap">
<scroll-view
:scroll-top="scrollRightTop"
style="height: 100%"
scroll-y
scroll-with-animation
scroll-anchoring
class="right-box"
@scroll="rightScroll"
:scroll-into-view="itemId"
>
<u-form :model="form" ref="uForm">
<template
v-for="(groupItem, groupIndex) in list.length > 0
? list[tabIndex].items
: []"
>
<view
class="class-item"
:id="'item' + groupIndex"
:key="groupIndex"
>
<view class="title">{{ groupItem.name }}</view>
<view class="class-bd">
<u-form-item
v-for="(item, itemIndex) in groupItem.items"
:key="itemIndex"
label-position="top"
:prop="item.fieldsName"
:border-bottom="false"
v-show="
checkFields(item.fieldsName) &&
((readOnly &&
!$u.test.isEmpty(form[item.fieldsName])) ||
!readOnly)
"
:id="`item${item.fieldsId}`"
>
<view
class="label"
v-if="!hiddenTitle.includes(item.formType)"
>
<image
class="item-image"
:src="mixingImage"
v-if="item.required"
></image>
{{ item.fieldsTitle }}
</view>
<template v-if="item.fieldsType">
<xh-input
v-if="item.formType === 'input'"
:groupIndex="groupIndex"
:type="item.inputType"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly || item.disabled || false"
:slotContent="item.fieldsInfo"
@value-change="fieldValueChange"
>
</xh-input>
<xh-multi-input
v-if="item.formType === 'multiinput'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
>
</xh-multi-input>
<xh-radio
v-if="item.formType === 'radio'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly || item.disabled || false"
@value-change="fieldValueChange"
>
</xh-radio>
<xh-checkbox
v-if="item.formType === 'checkbox'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
>
</xh-checkbox>
<xh-select
v-if="item.formType === 'select'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
>
</xh-select>
<xh-specifications
v-if="item.formType === 'select-new-page'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
>
</xh-specifications>
<view v-if="item.formType === 'file'">
<xh-files
:ref="`fileChild${groupIndex}${itemIndex}`"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:partnerCompanyId="partnerCompanyId"
:categoryId="categoryId"
:value="form[item.fieldsName] || []"
:disabled="readOnly"
@value-change="fieldValueChange"
>
<template v-slot>
<view class="img-list" v-if="!readOnly">
<u-image
class="pic"
width="160rpx"
height="160rpx"
:border-radius="10"
@click="
selectUpload(
JSON.stringify(item),
groupIndex,
itemIndex
)
"
:src="uploadImage"
></u-image>
</view>
</template>
</xh-files>
</view>
<view class="pg-complete">
<complete-check
:show="completeCheck.status"
:list-data="completeCheck.result"
:pass="pass"
@close="closeCheckResult"
@confirm="confirm"
:confirm-button-text="completeCheck.confirmText"
:cancel-button-text="completeCheck.cancelText"
></complete-check>
<view class="com-content">
<u-navbar
:background="{ background: '#2272FF' }"
back-icon-color="#fff"
:title-size="32"
title-color="#fff"
:border-bottom="false"
:title="list[tabIndex].panelName"
title-bold
:custom-back="backGo"
></u-navbar>
<u-tabs
class="order-tabs"
ref="tabs"
:current="current"
name="panelName"
:list="tabList"
@change="swichMenu"
bg-color="#2272FF"
inactive-color="#a6c6ff"
active-color="#fff"
height="80"
font-size="32"
></u-tabs>
<view class="u-menu-wrap">
<scroll-view
:scroll-top="scrollRightTop"
style="height: 100%"
scroll-y
scroll-with-animation
scroll-anchoring
class="right-box"
@scroll="rightScroll"
:scroll-into-view="itemId"
>
<u-form :model="form" ref="uForm">
<template v-for="(groupItem, groupIndex) in list.length > 0 ? list[tabIndex].items : []">
<view class="class-item" :id="'item' + groupIndex" :key="groupIndex">
<view class="title">{{ groupItem.name }}</view>
<view class="class-bd">
<u-form-item
v-for="(item, itemIndex) in groupItem.items"
:key="itemIndex"
label-position="top"
:prop="item.fieldsName"
:border-bottom="false"
v-show="checkFields(item.fieldsName) && ((readOnly && !$u.test.isEmpty(form[item.fieldsName])) || !readOnly)"
:id="`item${item.fieldsId}`"
>
<view class="label" v-if="!hiddenTitle.includes(item.formType)">
<image class="item-image" :src="mixingImage" v-if="item.required"></image>
{{ item.fieldsTitle }}
</view>
<template v-if="item.fieldsType">
<xh-input
v-if="item.formType === 'input'"
:groupIndex="groupIndex"
:type="item.inputType"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly || item.disabled || false"
:slotContent="item.fieldsInfo"
@value-change="fieldValueChange"
></xh-input>
<xh-multi-input
v-if="item.formType === 'multiinput'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
></xh-multi-input>
<xh-radio
v-if="item.formType === 'radio'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly || item.disabled || false"
@value-change="fieldValueChange"
></xh-radio>
<xh-checkbox
v-if="item.formType === 'checkbox'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
></xh-checkbox>
<xh-select
v-if="item.formType === 'select'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
></xh-select>
<xh-specifications
v-if="item.formType === 'select-new-page'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
></xh-specifications>
<view v-if="item.formType === 'file'">
<xh-files
:ref="`fileChild${groupIndex}${itemIndex}`"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:partnerCompanyId="partnerCompanyId"
:categoryId="categoryId"
:value="form[item.fieldsName] || []"
:disabled="readOnly"
@value-change="fieldValueChange"
>
<template v-slot>
<view class="img-list" v-if="!readOnly">
<u-image
class="pic"
width="160rpx"
height="160rpx"
:border-radius="10"
@click="selectUpload(JSON.stringify(item), groupIndex, itemIndex)"
:src="uploadImage"
></u-image>
</view>
</template>
</xh-files>
</view>
<xh-location
v-if="item.formType === 'location'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
>
</xh-location>
<xh-scan
v-if="item.formType === 'scan'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
>
</xh-scan>
<xh-service-measure
v-if="item.formType === 'servicemeasure'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:orderId="orderId"
:categoryId="categoryId"
:orderServiceType="orderServiceType"
:specificationId="form['specificationId'] || 0"
:value="form[item.fieldsName]"
:disabled="readOnly"
@value-change="fieldValueChange"
>
</xh-service-measure>
<xh-time
v-if="item.formType === 'time'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
>
</xh-time>
<xh-service-more
v-if="item.formType === 'form'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:order-id="orderId"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
>
</xh-service-more>
<xh-label
v-if="item.formType === 'label'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
>
</xh-label>
<xh-parts
ref="fileChildParts"
v-if="item.formType === 'parts'"
:categoryId="categoryId"
:brandId="brandId"
:order-id="orderId"
:orderNumber="orderNumber"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
:maintainStep="list[tabIndex].panelFieldsName"
@value-change="fieldValueChange"
>
</xh-parts>
</template>
</u-form-item>
</view>
</view>
</template>
</u-form>
</scroll-view>
</view>
<view
:class="[
'btn-wrap',
'flex-xc',
{ 'btn-bottom': tabIndex > 0, 'read-only': readOnly },
]"
>
<u-button
class="btn-submit"
v-if="!readOnly"
@click="saveComplete"
type="primary"
shape="circle"
:custom-style="customStyle"
:hover-class="submitStatus ? '' : 'none'"
>
暂存
</u-button>
<u-button
class="btn-submit"
@click="nextStep"
:custom-style="buttonStyle"
type="primary"
shape="circle"
:hover-class="submitStatus ? '' : 'none'"
>
{{
tabIndex === list.length - 1
? readOnly
? '返回列表'
: '提交'
: readOnly
? '查看下一步'
: '下一步'
}}
</u-button>
</view>
</view>
<u-toast ref="uToast" />
<take-photo
v-if="takeStatus"
@close="closeTake"
:upload="false"
:currentItem="currentItemDate"
></take-photo>
<u-action-sheet
:list="carmeraList"
v-model="maskShow"
:cancel-btn="true"
@click="uploadSelect"
></u-action-sheet>
<upload-progress />
</view>
<xh-location
v-if="item.formType === 'location'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
></xh-location>
<xh-scan
v-if="item.formType === 'scan'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
></xh-scan>
<xh-service-measure
v-if="item.formType === 'servicemeasure'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:orderId="orderId"
:categoryId="categoryId"
:orderServiceType="orderServiceType"
:specificationId="form['specificationId'] || 0"
:value="form[item.fieldsName]"
:disabled="readOnly"
@value-change="fieldValueChange"
></xh-service-measure>
<xh-time
v-if="item.formType === 'time'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
></xh-time>
<xh-service-more
v-if="item.formType === 'form'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:order-id="orderId"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
@value-change="fieldValueChange"
></xh-service-more>
<xh-label
v-if="item.formType === 'label'"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
></xh-label>
<xh-parts
ref="fileChildParts"
v-if="item.formType === 'parts'"
:categoryId="categoryId"
:brandId="brandId"
:order-id="orderId"
:orderNumber="orderNumber"
:groupIndex="groupIndex"
:itemIndex="itemIndex"
:item="item"
:value="form[item.fieldsName] || ''"
:disabled="readOnly"
:maintainStep="list[tabIndex].panelFieldsName"
@value-change="fieldValueChange"
></xh-parts>
</template>
</u-form-item>
</view>
</view>
</template>
</u-form>
</scroll-view>
</view>
<view :class="['btn-wrap', 'flex-xc', { 'btn-bottom': tabIndex > 0, 'read-only': readOnly }]">
<u-button
class="btn-submit"
v-if="!readOnly"
@click="saveComplete"
type="primary"
shape="circle"
:custom-style="customStyle"
:hover-class="submitStatus ? '' : 'none'"
>
暂存
</u-button>
<u-button class="btn-submit" @click="nextStep" :custom-style="buttonStyle" type="primary" shape="circle" :hover-class="submitStatus ? '' : 'none'">
{{ tabIndex === list.length - 1 ? (readOnly ? '返回列表' : '提交') : readOnly ? '查看下一步' : '下一步' }}
</u-button>
</view>
</view>
<u-toast ref="uToast" />
<take-photo v-if="takeStatus" @close="closeTake" :upload="false" :currentItem="currentItemDate"></take-photo>
<u-action-sheet :list="carmeraList" v-model="maskShow" :cancel-btn="true" @click="uploadSelect"></u-action-sheet>
<upload-progress />
</view>
</template>
<script>
import XhInput from '@/components/createCom/XhInput.vue'
import XhMultiInput from '@/components/createCom/XhMultiInput.vue'
import XhRadio from '@/components/createCom/XhRadio.vue'
import XhCheckbox from '@/components/createCom/XhCheckbox.vue'
import XhSelect from '@/components/createCom/XhSelect.vue'
import XhSpecifications from '@/components/createCom/XhSpecifications.vue'
import XhFiles from '@/components/createCom/XhFiles.vue'
import XhLocation from '@/components/createCom/XhLocation.vue'
import XhScan from '@/components/createCom/XhScan.vue'
import XhTime from '@/components/createCom/XhTime.vue'
import XhServiceMeasure from '@/components/createCom/XhServiceMeasure.vue'
import XhServiceMore from '@/components/createCom/XhServiceMore'
import XhLabel from '@/components/createCom/XhLabel'
import XhParts from '@/components/createCom/XhParts'
import takePhoto from '@/components/take/index.vue'
import baseFile from '@/components/upload/index'
import XhInput from '@/components/createCom/XhInput.vue';
import XhMultiInput from '@/components/createCom/XhMultiInput.vue';
import XhRadio from '@/components/createCom/XhRadio.vue';
import XhCheckbox from '@/components/createCom/XhCheckbox.vue';
import XhSelect from '@/components/createCom/XhSelect.vue';
import XhSpecifications from '@/components/createCom/XhSpecifications.vue';
import XhFiles from '@/components/createCom/XhFiles.vue';
import XhLocation from '@/components/createCom/XhLocation.vue';
import XhScan from '@/components/createCom/XhScan.vue';
import XhTime from '@/components/createCom/XhTime.vue';
import XhServiceMeasure from '@/components/createCom/XhServiceMeasure.vue';
import XhServiceMore from '@/components/createCom/XhServiceMore';
import XhLabel from '@/components/createCom/XhLabel';
import XhParts from '@/components/createCom/XhParts';
import takePhoto from '@/components/take/index.vue';
import baseFile from '@/components/upload/index';
// 表单类型map
const formType = new Map([
['text', ['input', 'textarea']],
['password', ['password', 'input']],
['textarea', ['input', 'digit']],
['number', ['input', 'digit']],
['decimal', ['input', 'digit']],
['double', ['input', 'digit']],
['integer', ['input', 'digit']],
['string', ['input', 'text']],
['jscode', ['input', 'text']],
['multiinput', ['multiinput', 'text']],
['select', ['select', 'text']],
['specifications', ['select-new-page', 'text']],
['radio', ['radio', 'text']],
['checkbox', ['checkbox', 'text']],
['file', ['file', 'text']],
['photos', ['file', 'text']],
['location', ['location', 'text']],
['scan', ['scan', 'text']],
['machine_code', ['scan', 'text']],
['service_measures', ['servicemeasure', 'text']],
['time', ['time', 'text']],
['date', ['time', 'text']],
['form', ['form', 'text']],
['label', ['label', 'text']],
['parts', ['parts', 'text']],
])
['text', ['input', 'textarea']],
['password', ['password', 'input']],
['textarea', ['input', 'digit']],
['number', ['input', 'digit']],
['decimal', ['input', 'digit']],
['double', ['input', 'digit']],
['integer', ['input', 'digit']],
['string', ['input', 'text']],
['jscode', ['input', 'text']],
['multiinput', ['multiinput', 'text']],
['select', ['select', 'text']],
['specifications', ['select-new-page', 'text']],
['radio', ['radio', 'text']],
['checkbox', ['checkbox', 'text']],
['file', ['file', 'text']],
['photos', ['file', 'text']],
['location', ['location', 'text']],
['scan', ['scan', 'text']],
['machine_code', ['scan', 'text']],
['service_measures', ['servicemeasure', 'text']],
['time', ['time', 'text']],
['date', ['time', 'text']],
['form', ['form', 'text']],
['label', ['label', 'text']],
['parts', ['parts', 'text']]
]);
/**
* modal 弹窗校验
......@@ -375,1113 +305,1071 @@ const formType = new Map([
* @property {submit} submit 提交或下一步
*/
const actions = (name, pass, type, submit) => {
const handerProgrom = {
perfect: {
confirmText: '去完善',
action: 'handerProgrom',
},
appointment: {
confirmText: '好的,再次预约',
action: 'appointment',
},
next: {
confirmText: '下一步',
action: 'nextAction',
},
noPerfectSubmit: {
confirmText: '去完善',
action: 'handerProgrom',
cancelText: '部分提交',
cancelAction: 'appointment',
},
submit: {
confirmText: '提交',
action: 'orderFinish',
},
confirm: {
confirmText: '确定',
action: 'nextAction',
cancelText: '取消',
cancelAction: 'closeResult',
},
}
if (name === 'partnerInspectItem') {
// 勘察
if (!pass) return handerProgrom.perfect
return type
? type === '01'
? handerProgrom.next
: handerProgrom.appointment
: handerProgrom.perfect
} else if (name === 'partnerInstallItem') {
// 安装
let hander = ''
switch (type) {
case '01': // 安装完成
hander = !pass ? handerProgrom.perfect : handerProgrom.next
break
case '02': // 二次安装
hander = !pass
? handerProgrom.noPerfectSubmit
: handerProgrom.appointment
break
case '03': //不安装
hander = handerProgrom.confirm
break
default:
hander = handerProgrom.perfect
break
}
return hander
} else {
// 基础信息
if (!pass) return handerProgrom.perfect
return submit ? handerProgrom.submit : handerProgrom.next
}
}
const handerProgrom = {
perfect: {
confirmText: '去完善',
action: 'handerProgrom'
},
appointment: {
confirmText: '好的,再次预约',
action: 'appointment'
},
next: {
confirmText: '下一步',
action: 'nextAction'
},
noPerfectSubmit: {
confirmText: '去完善',
action: 'handerProgrom',
cancelText: '部分提交',
cancelAction: 'appointment'
},
submit: {
confirmText: '提交',
action: 'orderFinish'
},
confirm: {
confirmText: '确定',
action: 'nextAction',
cancelText: '取消',
cancelAction: 'closeResult'
}
};
if (name === 'partnerInspectItem') {
// 勘察
if (!pass) return handerProgrom.perfect;
return type ? (type === '01' ? handerProgrom.next : handerProgrom.appointment) : handerProgrom.perfect;
} else if (name === 'partnerInstallItem') {
// 安装
let hander = '';
switch (type) {
case '01': // 安装完成
hander = !pass ? handerProgrom.perfect : handerProgrom.next;
break;
case '02': // 二次安装
hander = !pass ? handerProgrom.noPerfectSubmit : handerProgrom.appointment;
break;
case '03': //不安装
hander = handerProgrom.confirm;
break;
default:
hander = handerProgrom.perfect;
break;
}
return hander;
} else {
// 基础信息
if (!pass) return handerProgrom.perfect;
return submit ? handerProgrom.submit : handerProgrom.next;
}
};
const fields = {
'paymentMethodsType': { // 基本信息-不需要收款
fieldsName: ['actualPaid', 'eSerialNum'],
value: '03'
},
'usePart': { // 维修工单-是否使用配件
fieldsName: ['partName'],
value: '02'
},
'getMoney': { // 维修工单-是否收款
fieldsName: ['feeValue', 'feeProject'],
value: '02'
}
}
paymentMethodsType: {
// 基本信息-不需要收款
fieldsName: ['actualPaid', 'eSerialNum'],
value: '03'
},
usePart: {
// 维修工单-是否使用配件
fieldsName: ['partName'],
value: '02'
},
getMoney: {
// 维修工单-是否收款
fieldsName: ['feeValue', 'feeProject'],
value: '02'
}
};
const fieldsNameArr = Object.values(fields).map(v => v.fieldsName).reduce((acc, cur) => [...acc, ...cur], [])
const fieldsNameArr = Object.values(fields)
.map(v => v.fieldsName)
.reduce((acc, cur) => [...acc, ...cur], []);
export default {
data() {
return {
hiddenTitle: ['location', 'form', 'label', 'parts'],
orderId: 0,
categoryId: 0,
brandId: 0,
orderNumber: '',
orderServiceType: '',
inGuaranteePeriod: '',
partnerCompanyId: '',
auditResults: [],
list: [],
tabIndex: 0,
scrollTop: 0, //tab标题的滚动条位置
oldScrollTop: 0,
current: 0, // 预设当前项的值
menuHeight: 0, // 左边菜单的高度
menuItemHeight: 0, // 左边菜单item的高度
itemId: '', // 栏目右边scroll-view用于滚动的id
oldItemId: '',
menuItemPos: [],
arr: [],
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
timer: null, // 定时器
form: {},
submitBtnStatus: false,
completeCheck: {
status: false,
resulut: [],
confirmText: '去完善',
cancelText: '',
action: '',
cancelAction: '',
},
waitHandlerPanelIndex: 0,
waitHandlerGroupIndex: 0,
waitHandlerEleIndex: 0,
pass: false,
// 上传组件相关
carmeraList: [
{
text: '相册',
},
{
text: '拍照',
},
],
maskShow: false,
takeStatus: false,
currentItemDate: {},
photoItem: {},
maintainStep: 'partnerInspectItem',
orderStatus: '',
// showTab: true,
}
},
components: {
XhInput,
XhMultiInput,
XhRadio,
XhCheckbox,
XhSelect,
XhSpecifications,
XhFiles,
XhLocation,
XhScan,
XhTime,
XhServiceMeasure,
XhServiceMore,
XhLabel,
XhParts,
'take-photo': takePhoto,
},
mixins: [baseFile],
onLoad(option) {
getApp().trackPage('订单完工信息页')
if (option) {
this.orderNumber = option.orderNumber
this.maintainStep = option.maintainStep
this.orderId = option.orderId
this.categoryId = option.categoryId
this.brandId = option.brandId
this.orderServiceType = decodeURIComponent(option.orderServiceType)
this.inGuaranteePeriod = option.inGuaranteePeriod
this.partnerCompanyId = option.partnerCompanyId
this.orderStatus = option.orderStatus
this.auditResults = option?.auditResults
? option?.auditResults.split(',')
: []
}
this.getCompleteData()
},
updated() {
//console.log(this.form.name, 'form.name')
},
computed: {
exception() {
return this.orderStatus == '86'
},
readOnly() {
return (
[80, 81, 83, 85, 87, 89, 88, 110].indexOf(Number(this.orderStatus)) !=
-1
)
},
tabList() {
// 没有数据的时候tab要有占位数据,不然有页面有晃动
return this.list.length > 0
? this.list[this.tabIndex].items
: [{ name: '' }]
},
mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png'
},
uploadImage() {
return process.uniEnv.qn_base_url + 'upload-file.png'
},
buttonStyle() {
return {
color: '#FFFFFF',
'background-color': '#2272FF;',
width: '300rpx',
height: '104rpx',
'font-size': '32rpx',
'font-weight': 'bold',
'margin-left': '50rpx',
}
},
customStyle() {
return {
'background-color': '#D1D4D4',
width: '300rpx',
height: '104rpx',
'background-color': 'transparent',
border: '1px solid #2272FF',
color: '#2272FF',
'font-weight': 'bold',
'font-size': '32rpx',
}
},
show200() {
return (
this.form.paymentMethodsType && this.form.paymentMethodsType != '03'
)
},
// 从订单管理和浏览记录进来,不跳转到订单列表,而是后退到订单管理和浏览记录
completeBack() {
let pages = getCurrentPages()
var i = 0
for (var item of pages) {
if (
['/pages/mine/history/index', '/pages/mine/order/index'].indexOf(
item.$page?.fullPath.split('?')[0]
) != -1
) {
return pages.length - i - 1
}
i++
}
return 0
},
},
methods: {
checkFields(name) {
let status = true
if (fieldsNameArr.includes(name)) {
Object.entries(fields).forEach(v => {
if (v[1].fieldsName.includes(name)) {
status = this.form[v[0]] ? this.form[v[0]] !== v[1].value : false
}
})
}
return status
},
getCompleteData() {
//获取工单配置的完工项目
uni.showLoading({
title: '加载中',
})
if (this.orderId) {
this.$u.api.getCompleteConfigAndData(this.orderId).then((res) => {
if (res.code == 200) {
this.initData(res)
} else {
this.$refs.uToast.show({
title: res.message || res.data,
type: 'error',
})
}
})
}
},
initData(res) {
this.form = res.data.value || {}
this.loadOrderDetail()
const data = Object.create(res.data.config, {})
const list = data.sort((a, b) => a.order - b.order)
if (this.readOnly) this.tabIndex = 0
list.forEach((item, index) => {
if (this.maintainStep === item.panelFieldsName && !this.readOnly) {
this.tabIndex = index
}
item.items.forEach((v) => {
v.items.forEach((d) => {
const type = d.fieldsType.toLocaleLowerCase()
const formMap = formType.get(type) || formType.get('text')
d.formType = formMap[0]
d.inputType = formMap[1]
if (fieldsNameArr.includes(d.fieldsName)) {
d.required = this.checkFields(d.fieldsName)
}
data() {
return {
hiddenTitle: ['location', 'form', 'label', 'parts'],
orderId: 0,
categoryId: 0,
brandId: 0,
orderNumber: '',
orderServiceType: '',
inGuaranteePeriod: '',
partnerCompanyId: '',
auditResults: [],
list: [],
tabIndex: 0,
scrollTop: 0, //tab标题的滚动条位置
oldScrollTop: 0,
current: 0, // 预设当前项的值
menuHeight: 0, // 左边菜单的高度
menuItemHeight: 0, // 左边菜单item的高度
itemId: '', // 栏目右边scroll-view用于滚动的id
oldItemId: '',
menuItemPos: [],
arr: [],
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
timer: null, // 定时器
form: {},
submitBtnStatus: false,
completeCheck: {
status: false,
resulut: [],
confirmText: '去完善',
cancelText: '',
action: '',
cancelAction: ''
},
waitHandlerPanelIndex: 0,
waitHandlerGroupIndex: 0,
waitHandlerEleIndex: 0,
pass: false,
// 上传组件相关
carmeraList: [
{
text: '相册'
},
{
text: '拍照'
}
],
maskShow: false,
takeStatus: false,
currentItemDate: {},
photoItem: {},
maintainStep: 'partnerInspectItem',
orderStatus: ''
// showTab: true,
};
},
components: {
XhInput,
XhMultiInput,
XhRadio,
XhCheckbox,
XhSelect,
XhSpecifications,
XhFiles,
XhLocation,
XhScan,
XhTime,
XhServiceMeasure,
XhServiceMore,
XhLabel,
XhParts,
'take-photo': takePhoto
},
mixins: [baseFile],
onLoad(option) {
getApp().trackPage('订单完工信息页');
if (option) {
this.orderNumber = option.orderNumber;
this.maintainStep = option.maintainStep;
this.orderId = option.orderId;
this.categoryId = option.categoryId;
this.brandId = option.brandId;
this.orderServiceType = decodeURIComponent(option.orderServiceType);
this.inGuaranteePeriod = option.inGuaranteePeriod;
this.partnerCompanyId = option.partnerCompanyId;
this.orderStatus = option.orderStatus;
this.auditResults = option?.auditResults ? option?.auditResults.split(',') : [];
}
this.getCompleteData();
},
updated() {
//console.log(this.form.name, 'form.name')
},
computed: {
exception() {
return this.orderStatus == '86';
},
readOnly() {
return [80, 81, 83, 85, 87, 89, 88, 110].indexOf(Number(this.orderStatus)) != -1;
},
tabList() {
// 没有数据的时候tab要有占位数据,不然有页面有晃动
return this.list.length > 0 ? this.list[this.tabIndex].items : [{ name: '' }];
},
mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png';
},
uploadImage() {
return process.uniEnv.qn_base_url + 'upload-file.png';
},
buttonStyle() {
return {
color: '#FFFFFF',
'background-color': '#2272FF;',
width: '300rpx',
height: '104rpx',
'font-size': '32rpx',
'font-weight': 'bold',
'margin-left': '50rpx'
};
},
customStyle() {
return {
'background-color': '#D1D4D4',
width: '300rpx',
height: '104rpx',
'background-color': 'transparent',
border: '1px solid #2272FF',
color: '#2272FF',
'font-weight': 'bold',
'font-size': '32rpx'
};
},
show200() {
return this.form.paymentMethodsType && this.form.paymentMethodsType != '03';
},
// 从订单管理和浏览记录进来,不跳转到订单列表,而是后退到订单管理和浏览记录
completeBack() {
let pages = getCurrentPages();
var i = 0;
for (var item of pages) {
if (['/pages/mine/history/index', '/pages/mine/order/index'].indexOf(item.$page?.fullPath.split('?')[0]) != -1) {
return pages.length - i - 1;
}
i++;
}
return 0;
}
},
methods: {
checkFields(name) {
let status = true;
if (fieldsNameArr.includes(name)) {
Object.entries(fields).forEach(v => {
if (v[1].fieldsName.includes(name)) {
status = this.form[v[0]] ? this.form[v[0]] !== v[1].value : false;
}
});
}
return status;
},
getCompleteData() {
//获取工单配置的完工项目
uni.showLoading({
title: '加载中'
});
if (this.orderId) {
this.$u.api.getCompleteConfigAndData(this.orderId).then(res => {
if (res.code == 200) {
this.initData(res);
} else {
this.$refs.uToast.show({
title: res.message || res.data,
type: 'error'
});
}
});
}
},
initData(res) {
this.form = res.data.value || {};
this.loadOrderDetail();
const data = Object.create(res.data.config, {});
const list = data.sort((a, b) => a.order - b.order);
if (this.readOnly) this.tabIndex = 0;
if (d.fieldsName === 'pipe' || d.fieldsName === 'pipeUseLength') {
// 申请费用计算
this.calcMoney()
}
list.forEach((item, index) => {
if (this.maintainStep === item.panelFieldsName && !this.readOnly) {
this.tabIndex = index;
}
item.items.forEach(v => {
v.items.forEach(d => {
const type = d.fieldsType.toLocaleLowerCase();
const formMap = formType.get(type) || formType.get('text');
d.formType = formMap[0];
d.inputType = formMap[1];
if (fieldsNameArr.includes(d.fieldsName)) {
d.required = this.checkFields(d.fieldsName);
}
if (d.fieldsName === 'materialList') {
d.subtitle = '(必填项)'
}
if (d.fieldsName === 'craftList') {
d.subtitle = '(若有增项,则为必填项)'
}
})
})
})
if (d.fieldsName === 'pipe' || d.fieldsName === 'pipeUseLength') {
// 申请费用计算
this.calcMoney();
}
// this.showTab = this.list.length > 1
// 异常单处理
if (this.exception) {
if (this.auditResults.length === 0) {
this.$refs.uToast.show({
title: '未找到不通过项',
type: 'error',
back: true,
})
}
this.checkCompleteError(list)
} else {
this.list = Object.freeze(list)
}
uni.hideLoading()
},
loadOrderDetail() {
if (
!this.$u.test.isEmpty(this.form) &&
this.form.hasOwnProperty('installComfirmTime') &&
this.$u.test.isEmpty(this.form.installComfirmTime)
) {
this.$u.api.orderDetail(null, this.orderId).then((res) => {
if (res.code == 200) {
if (!this.$u.test.isEmpty(res.data.checkInDateTime)) {
this.$set(
this.form,
'installComfirmTime',
this.moment(res.data.checkInDateTime).format('YYYY-MM-DD')
)
}
}
})
}
},
checkCompleteError(list) {
// 异常单定位错误项
let errArr = []
list.forEach((panel, panelIndex) => {
panel.items.forEach((group, groupIndex) => {
group.items.forEach((ele, eleIndex) => {
if (this.auditResults.includes(ele.fieldsName)) {
const errGroup = {
componentType: group.componentType,
name: group.name,
items: ele,
}
if (ele.fieldsName === 'orderSpareParts') {
const index = errArr.findIndex(v => v.name === '备件信息' || v.name === '物料信息')
if (index > -1) return
}
errArr.push(errGroup)
}
})
})
})
// 图片分组
const result = errArr.reduce((groups, item) => {
let groupFound = groups.find((arrItem) => item.name === arrItem.name)
if (groupFound) {
groupFound.componentType = item.componentType
if (groupFound.items.indexOf(item.items) == -1) {
//去重
groupFound.items.push(item.items)
}
} else {
//不要直接在原来的对象修改,新建对象
let newGroup = {
name: item.name,
componentType: item.componentType,
items: [item.items],
}
groups.push(newGroup)
}
return groups
}, [])
if (d.fieldsName === 'materialList') {
d.subtitle = '(必填项)';
}
if (d.fieldsName === 'craftList') {
d.subtitle = '(若有增项,则为必填项)';
}
});
});
});
let index = list.length++
list[index] = {
order: index + 1,
panelFieldsName: 'error',
panelName: '异常处理',
items: result,
}
this.list = Object.freeze(list)
this.tabIndex = index
},
// this.showTab = this.list.length > 1
// 异常单处理
if (this.exception) {
if (this.auditResults.length === 0) {
this.$refs.uToast.show({
title: '未找到不通过项',
type: 'error',
back: true
});
}
this.checkCompleteError(list);
} else {
this.list = Object.freeze(list);
}
uni.hideLoading();
},
loadOrderDetail() {
if (!this.$u.test.isEmpty(this.form) && this.form.hasOwnProperty('installComfirmTime') && this.$u.test.isEmpty(this.form.installComfirmTime)) {
this.$u.api.orderDetail(null, this.orderId).then(res => {
if (res.code == 200) {
if (!this.$u.test.isEmpty(res.data.checkInDateTime)) {
this.$set(this.form, 'installComfirmTime', this.moment(res.data.checkInDateTime).format('YYYY-MM-DD'));
}
}
});
}
},
checkCompleteError(list) {
// 异常单定位错误项
let errArr = [];
list.forEach((panel, panelIndex) => {
panel.items.forEach((group, groupIndex) => {
group.items.forEach((ele, eleIndex) => {
if (this.auditResults.includes(ele.fieldsName)) {
const errGroup = {
componentType: group.componentType,
name: group.name,
items: ele
};
if (ele.fieldsName === 'orderSpareParts') {
const index = errArr.findIndex(v => v.name === '备件信息' || v.name === '物料信息');
if (index > -1) return;
}
errArr.push(errGroup);
}
});
});
});
// 图片分组
const result = errArr.reduce((groups, item) => {
let groupFound = groups.find(arrItem => item.name === arrItem.name);
if (groupFound) {
groupFound.componentType = item.componentType;
if (groupFound.items.indexOf(item.items) == -1) {
//去重
groupFound.items.push(item.items);
}
} else {
//不要直接在原来的对象修改,新建对象
let newGroup = {
name: item.name,
componentType: item.componentType,
items: [item.items]
};
groups.push(newGroup);
}
return groups;
}, []);
handleSaveData() {
let param = {}
const name = this.list[this.tabIndex].panelFieldsName
this.list.forEach((panel) => {
param[panel.panelFieldsName] = []
panel.items.forEach((group) => {
group.items.forEach((ele) => {
if (name === 'partnerInspectItem') {
if (!this.form?.installationMethodType) {
this.$set(
this.form,
'installationMethodType',
this.form.installType
)
}
}
if (this.form[ele.fieldsName]) {
param[panel.panelFieldsName].push({
fieldsName: ele.fieldsName,
fieldsType: ele.fieldsType,
fieldsValue: this.form[ele.fieldsName],
required: ele.required,
})
}
})
})
})
return param
},
saveComplete() {
// 保存完工信息
// this.submitParts() // 不调这个接口;没完工不能调提交配件
const param = this.handleSaveData()
this.$u.api.saveCompleteData(param, this.orderId).then((res) => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '保存成功',
type: 'success',
})
} else {
this.$refs.uToast.show({
title: res.data || res.message,
type: 'error',
})
}
})
},
checkCompleteItem() {
let checkResult = []
let pass = true
let first = true
const lists = this.tabList
console.log("lists", lists)
lists.forEach((group, groupIndex) => {
const checkRequired = group.items.some((v) => v.required)
if (checkRequired) {
let panelResult = {
label: group.name,
submitted: 0,
required: 0,
pass: true,
}
group.items.forEach((ele, eleIndex) => {
if (ele.fieldsType == 'PARTS') {
console.log("ele", ele)
}
if (ele.required) {
panelResult.required++
let value = this.form[ele.fieldsName]
// "ele.fieldsName != 'eSerialNum' || value.length == 8" 意思是: "非付款流水号 || 8位付款流水号"
if (value && !Array.isArray(value) && (ele.fieldsName != 'eSerialNum' || value.length == 8)) {
panelResult.submitted++
} else if (value && Array.isArray(value) && value.length > 0) {
if (ele.fieldsName === 'materialList') {
let hasMate = false
let mateRow = value.find((mate) => {
if (mate.hasOwnProperty('useLength')) {
hasMate = true
return !this.$u.test.isEmpty(mate.useLength)
}
})
if (!hasMate || !this.$u.test.isEmpty(mateRow)) {
panelResult.submitted++
}
} else {
panelResult.submitted++
}
} else if (first) {
// 记录第一个 为空 并且需要必填的项 用于定位
first = false
this.waitHandlerPanelIndex = this.tabIndex
this.waitHandlerGroupIndex = groupIndex
this.waitHandlerEleIndex = eleIndex
this.oldItemId = `item${ele.fieldsId}`
}
}
})
panelResult.pass = panelResult.required <= panelResult.submitted
pass = pass && panelResult.pass
checkResult.push(panelResult)
}
})
let index = list.length++;
list[index] = {
order: index + 1,
panelFieldsName: 'error',
panelName: '异常处理',
items: result
};
this.list = Object.freeze(list);
this.tabIndex = index;
},
this.completeCheck.result = checkResult
return pass
},
closeResult() {
},
// 检查结果窗口取消回调
closeCheckResult() {
this.completeCheck.status = false
this[this.completeCheck.cancelAction]()
},
// 检查结果窗口 确认回调
confirm() {
this.completeCheck.status = false
this[this.completeCheck.action]()
},
// 去完善
handerProgrom() {
this.locationCompleteItem(
this.waitHandlerPanelIndex,
this.waitHandlerGroupIndex,
this.waitHandlerEleIndex
)
},
// 去预约
async appointment() {
const save = await this.nextStepSaveData()
if (save) {
if (this.completeBack) {
// 从订单管理和浏览记录进来
uni.navigateBack({
delta: this.completeBack,
})
} else {
uni.reLaunch({
url: '/pages/index/order?type=waitAppointment',
})
}
}
},
// 下一步动作
async nextAction() {
const save = await this.nextStepSaveData()
if (save) {
this.nextTab()
}
},
nextTab() {
if (this.tabIndex < this.list.length - 1) {
this.tabIndex++
this.arr = []
this.scrollRightTop = 0
this.current = 0
//this.itemId = ''
//const itemId = this.list[this.tabIndex].items[0].items[0].fieldsId
//this.oldItemId = `item${itemId}`
this.$nextTick(async () => {
await this.swichMenu(0)
})
}
},
handleSaveData() {
let param = {};
const name = this.list[this.tabIndex].panelFieldsName;
this.list.forEach(panel => {
param[panel.panelFieldsName] = [];
panel.items.forEach(group => {
group.items.forEach(ele => {
if (name === 'partnerInspectItem') {
if (!this.form?.installationMethodType) {
this.$set(this.form, 'installationMethodType', this.form.installType);
}
}
if (this.form[ele.fieldsName]) {
param[panel.panelFieldsName].push({
fieldsName: ele.fieldsName,
fieldsType: ele.fieldsType,
fieldsValue: this.form[ele.fieldsName],
required: ele.required
});
}
});
});
});
return param;
},
saveComplete() {
// 保存完工信息
// this.submitParts() // 不调这个接口;没完工不能调提交配件
const param = this.handleSaveData();
this.$u.api.saveCompleteData(param, this.orderId).then(res => {
let { code, data, message } = res;
if (code == 200) {
this.$refs.uToast.show({
title: '保存成功',
type: 'success'
});
} else {
let msg = '';
if (data && data instanceof string) {
msg = data;
} else {
msg = message;
}
this.$refs.uToast.show({
title: msg,
type: 'error'
});
}
});
},
checkCompleteItem() {
let checkResult = [];
let pass = true;
let first = true;
const lists = this.tabList;
console.log('lists', lists);
lists.forEach((group, groupIndex) => {
const checkRequired = group.items.some(v => v.required);
if (checkRequired) {
let panelResult = {
label: group.name,
submitted: 0,
required: 0,
pass: true
};
group.items.forEach((ele, eleIndex) => {
if (ele.fieldsType == 'PARTS') {
console.log('ele', ele);
}
if (ele.required) {
panelResult.required++;
let value = this.form[ele.fieldsName];
// "ele.fieldsName != 'eSerialNum' || value.length == 8" 意思是: "非付款流水号 || 8位付款流水号"
if (value && !Array.isArray(value) && (ele.fieldsName != 'eSerialNum' || value.length == 8)) {
panelResult.submitted++;
} else if (value && Array.isArray(value) && value.length > 0) {
if (ele.fieldsName === 'materialList') {
let hasMate = false;
let mateRow = value.find(mate => {
if (mate.hasOwnProperty('useLength')) {
hasMate = true;
return !this.$u.test.isEmpty(mate.useLength);
}
});
if (!hasMate || !this.$u.test.isEmpty(mateRow)) {
panelResult.submitted++;
}
} else {
panelResult.submitted++;
}
} else if (first) {
// 记录第一个 为空 并且需要必填的项 用于定位
first = false;
this.waitHandlerPanelIndex = this.tabIndex;
this.waitHandlerGroupIndex = groupIndex;
this.waitHandlerEleIndex = eleIndex;
this.oldItemId = `item${ele.fieldsId}`;
}
}
});
panelResult.pass = panelResult.required <= panelResult.submitted;
pass = pass && panelResult.pass;
checkResult.push(panelResult);
}
});
// 下一步弹窗处理
nextStep() {
if (this.readOnly) {
if (this.tabIndex === this.list.length - 1) {
uni.navigateBack()
} else {
this.nextTab()
}
return
}
this.pass = this.checkCompleteItem()
this.completeCheck.result = checkResult;
return pass;
},
closeResult() {},
// 检查结果窗口取消回调
closeCheckResult() {
this.completeCheck.status = false;
this[this.completeCheck.cancelAction]();
},
// 检查结果窗口 确认回调
confirm() {
this.completeCheck.status = false;
this[this.completeCheck.action]();
},
// 去完善
handerProgrom() {
this.locationCompleteItem(this.waitHandlerPanelIndex, this.waitHandlerGroupIndex, this.waitHandlerEleIndex);
},
// 去预约
async appointment() {
const save = await this.nextStepSaveData();
if (save) {
if (this.completeBack) {
// 从订单管理和浏览记录进来
uni.navigateBack({
delta: this.completeBack
});
} else {
uni.reLaunch({
url: '/pages/index/order?type=waitAppointment'
});
}
}
},
// 下一步动作
async nextAction() {
const save = await this.nextStepSaveData();
if (save) {
this.nextTab();
}
},
nextTab() {
if (this.tabIndex < this.list.length - 1) {
this.tabIndex++;
this.arr = [];
this.scrollRightTop = 0;
this.current = 0;
//this.itemId = ''
//const itemId = this.list[this.tabIndex].items[0].items[0].fieldsId
//this.oldItemId = `item${itemId}`
this.$nextTick(async () => {
await this.swichMenu(0);
});
}
},
const name = this.list[this.tabIndex].panelFieldsName
const type =
name === 'partnerInspectItem'
? this.form.inspectConclusionType
: this.form.constructionConclusionType
const submit = this.tabIndex === this.list.length - 1
const result = actions(name, this.pass, type, submit)
// 下一步弹窗处理
nextStep() {
if (this.readOnly) {
if (this.tabIndex === this.list.length - 1) {
uni.navigateBack();
} else {
this.nextTab();
}
return;
}
this.pass = this.checkCompleteItem();
this.completeCheck.status = true
this.completeCheck.confirmText = result.confirmText
this.completeCheck.action = result.action
this.completeCheck.cancelText = result.cancelText || ''
this.completeCheck.cancelAction = result.cancelAction || ''
},
// 下一步数据保存
nextStepSaveData() {
const params = {
maintainFields: this.handleSaveData(),
currentStep: this.list[this.tabIndex].panelFieldsName,
nextStep: this.list[this.tabIndex + 1].panelFieldsName,
version: 2,
}
uni.showLoading({
title: '加载中',
})
return this.$u.api.completeNextStep(params, this.orderId).then((res) => {
uni.hideLoading()
if (res.code == 200) {
return Promise.resolve(true)
} else {
this.$refs.uToast.show({
title: res.message || res.data,
type: 'error',
})
return Promise.resolve(false)
}
})
},
locationCompleteItem(panelIndex, groupIndex, eleIndex) {
// 页面定位到某一项
this.tabIndex = panelIndex
this.current = groupIndex
this.itemId = ''
this.$nextTick(function() {
if (this.oldItemId) this.itemId = this.oldItemId
})
},
// 提交配件信息
submitParts() {
return new Promise((resolve, reject) => {
if (this.form.orderSpareParts) {
const orderSpareParts = JSON.parse(this.form.orderSpareParts)
const lists = orderSpareParts.filter((v) => v.quantity > 0)
const params = {
workOrderId: this.orderId,
applyType: '10',
parts: lists ? JSON.stringify(lists) : '',
}
this.$u.api.createParts(params).then((res) => {
if (res.code !== 200) {
this.$refs.uToast.show({
title: res.data,
type: 'error',
})
resolve(false)
}
resolve(true)
})
} else {
resolve(true)
}
})
},
// 提交订单
orderFinish() {
const param = this.handleSaveData()
// 完工事件埋点
getApp().track('order_finish', {
id: this.vuex_user.id,
mobile: this.vuex_user.mobile,
orderId: Number(this.orderId),
})
this.$u.api.saveCompleteData(param, this.orderId).then(async (res) => {
if (res.code == 200) {
//完工项信息保存成功再次完工工单
// if (!this.exception) { // 核销配件
// const submitPart = await this.submitParts()
// if (!submitPart) return
// }
const name = this.list[this.tabIndex].panelFieldsName;
const type = name === 'partnerInspectItem' ? this.form.inspectConclusionType : this.form.constructionConclusionType;
const submit = this.tabIndex === this.list.length - 1;
const result = actions(name, this.pass, type, submit);
if (this.inGuaranteePeriod === 'Y') {
this.$u.api.inOrderFinish(this.orderId).then((res) => {
if (res.code == 200) {
this.successTips()
} else {
this.$refs.uToast.show({
title: res.data,
type: 'error',
})
}
})
} else {
this.$u.api
.outOrderFinish({ customerPayType: 'CASH' }, this.orderId)
.then((res) => {
if (res.code == 200) {
this.successTips()
} else {
this.$refs.uToast.show({
title: res.data,
type: 'error',
})
}
})
}
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
}
})
},
// 提交成功后续
successTips() {
uni.showModal({
title: '提交成功',
content: '是否查看本单服务质量详情?',
confirmText: '好的',
cancelText: '算了',
success: res => {
if (res.confirm) {
uni.reLaunch({
url: `/pages/order/quality?id=${this.orderId}`,
})
} else if (res.cancel) {
if (this.completeBack) {
// 从订单管理和浏览记录进来
uni.navigateBack({
delta: this.completeBack,
})
} else {
uni.reLaunch({
url: '/pages/index/order?type=audit',
})
}
}
}
})
},
calMaterialCraftListAmount(arr) {
let amount = 0
if (arr) {
arr.forEach((item) => {
let useLength =
(item.hasOwnProperty('useLength') && Number(item.useLength)) || 0
let freeLength =
(item.hasOwnProperty('freeLength') && Number(item.freeLength)) || 0
let unitAmt =
(item.hasOwnProperty('unitAmt') && Number(item.unitAmt)) || 0
amount += Math.max(useLength - freeLength, 0) * unitAmt
if (item.hasOwnProperty('extraAmt') && Number(item.extraAmt)) {
amount += Number(item.extraAmt)
}
})
}
return amount
},
this.completeCheck.status = true;
this.completeCheck.confirmText = result.confirmText;
this.completeCheck.action = result.action;
this.completeCheck.cancelText = result.cancelText || '';
this.completeCheck.cancelAction = result.cancelAction || '';
},
// 下一步数据保存
nextStepSaveData() {
const params = {
maintainFields: this.handleSaveData(),
currentStep: this.list[this.tabIndex].panelFieldsName,
nextStep: this.list[this.tabIndex + 1].panelFieldsName,
version: 2
};
uni.showLoading({
title: '加载中'
});
return this.$u.api.completeNextStep(params, this.orderId).then(res => {
uni.hideLoading();
if (res.code == 200) {
return Promise.resolve(true);
} else {
this.$refs.uToast.show({
title: res.message || res.data,
type: 'error'
});
return Promise.resolve(false);
}
});
},
locationCompleteItem(panelIndex, groupIndex, eleIndex) {
// 页面定位到某一项
this.tabIndex = panelIndex;
this.current = groupIndex;
this.itemId = '';
this.$nextTick(function() {
if (this.oldItemId) this.itemId = this.oldItemId;
});
},
// 提交配件信息
submitParts() {
return new Promise((resolve, reject) => {
if (this.form.orderSpareParts) {
const orderSpareParts = JSON.parse(this.form.orderSpareParts);
const lists = orderSpareParts.filter(v => v.quantity > 0);
const params = {
workOrderId: this.orderId,
applyType: '10',
parts: lists ? JSON.stringify(lists) : ''
};
this.$u.api.createParts(params).then(res => {
if (res.code !== 200) {
this.$refs.uToast.show({
title: res.data,
type: 'error'
});
resolve(false);
}
resolve(true);
});
} else {
resolve(true);
}
});
},
// 提交订单
orderFinish() {
const param = this.handleSaveData();
// 完工事件埋点
getApp().track('order_finish', {
id: this.vuex_user.id,
mobile: this.vuex_user.mobile,
orderId: Number(this.orderId)
});
this.$u.api.saveCompleteData(param, this.orderId).then(async res => {
if (res.code == 200) {
//完工项信息保存成功再次完工工单
// if (!this.exception) { // 核销配件
// const submitPart = await this.submitParts()
// if (!submitPart) return
// }
setData(data) {
// 通过页面设置数据
Object.keys(data).forEach((key) => {
this.$set(this.form, key, data[key])
})
// 更新预计超出金额
let amount = 0
amount += this.calMaterialCraftListAmount(this.form.materialList)
amount += this.calMaterialCraftListAmount(this.form.craftList)
this.$set(this.form, 'overAmount', amount || 0)
},
// 字段的值更新
fieldValueChange(data) {
const groupItem = this.list[this.tabIndex].items[data.groupIndex]
let innerItem
if (groupItem.items) {
innerItem = groupItem.items[data.itemIndex]
}
if (this.inGuaranteePeriod === 'Y') {
this.$u.api.inOrderFinish(this.orderId).then(res => {
if (res.code == 200) {
this.successTips();
} else {
this.$refs.uToast.show({
title: res.data,
type: 'error'
});
}
});
} else {
this.$u.api.outOrderFinish({ customerPayType: 'CASH' }, this.orderId).then(res => {
if (res.code == 200) {
this.successTips();
} else {
this.$refs.uToast.show({
title: res.data,
type: 'error'
});
}
});
}
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
}
});
},
// 提交成功后续
successTips() {
uni.showModal({
title: '提交成功',
content: '是否查看本单服务质量详情?',
confirmText: '好的',
cancelText: '算了',
success: res => {
if (res.confirm) {
uni.reLaunch({
url: `/pages/order/quality?id=${this.orderId}`
});
} else if (res.cancel) {
if (this.completeBack) {
// 从订单管理和浏览记录进来
uni.navigateBack({
delta: this.completeBack
});
} else {
uni.reLaunch({
url: '/pages/index/order?type=audit'
});
}
}
}
});
},
calMaterialCraftListAmount(arr) {
let amount = 0;
if (arr) {
arr.forEach(item => {
let useLength = (item.hasOwnProperty('useLength') && Number(item.useLength)) || 0;
let freeLength = (item.hasOwnProperty('freeLength') && Number(item.freeLength)) || 0;
let unitAmt = (item.hasOwnProperty('unitAmt') && Number(item.unitAmt)) || 0;
amount += Math.max(useLength - freeLength, 0) * unitAmt;
if (item.hasOwnProperty('extraAmt') && Number(item.extraAmt)) {
amount += Number(item.extraAmt);
}
});
}
return amount;
},
if (innerItem.fieldsType === 'multiInput') {
// 多个输入框的值触发
let key = Object.keys(data.value)[0]
this.form[key] = data.value[key]
} else {
if (innerItem.fieldsName === 'orderSpareParts' && data.value === '[]') {
this.$set(this.form, innerItem.fieldsName, '')
} else {
this.$set(this.form, innerItem.fieldsName, data.value)
}
}
setData(data) {
// 通过页面设置数据
Object.keys(data).forEach(key => {
this.$set(this.form, key, data[key]);
});
// 更新预计超出金额
let amount = 0;
amount += this.calMaterialCraftListAmount(this.form.materialList);
amount += this.calMaterialCraftListAmount(this.form.craftList);
this.$set(this.form, 'overAmount', amount || 0);
},
// 字段的值更新
fieldValueChange(data) {
const groupItem = this.list[this.tabIndex].items[data.groupIndex];
let innerItem;
if (groupItem.items) {
innerItem = groupItem.items[data.itemIndex];
}
// 根据选择的值隐藏对应的项
if (fields[innerItem.fieldsName]) {
groupItem.items.forEach(c => {
if (fields[innerItem.fieldsName]['fieldsName'].includes(c.fieldsName)) {
c.required = data.value !== fields[innerItem.fieldsName]['value']
}
})
}
if (innerItem.fieldsType === 'multiInput') {
// 多个输入框的值触发
let key = Object.keys(data.value)[0];
this.form[key] = data.value[key];
} else {
if (innerItem.fieldsName === 'orderSpareParts' && data.value === '[]') {
this.$set(this.form, innerItem.fieldsName, '');
} else {
this.$set(this.form, innerItem.fieldsName, data.value);
}
}
if (
innerItem.fieldsName === 'pipe' ||
innerItem.fieldsName === 'pipeUseLength'
) {
// 申请费用计算
this.calcMoney()
}
// console.log("this.form", this.form)
},
// 申请费用计算
calcMoney() {
const price = parseInt(this.form.pipe) || 0
const pipeUseLength = parseFloat(this.form.pipeUseLength) || 0
if (price && pipeUseLength) {
const money = (price * pipeUseLength).toFixed(2)
this.$set(this.form, 'pipeAmount', money)
} else {
this.$set(this.form, 'pipeAmount', 0)
}
},
// ------------------------- 以下方法为上传组件相关 -------------------------
// 弹出上传选项
selectUpload(item, groupIndex, itemIndex) {
const imgList = this.$refs[`fileChild${groupIndex}${itemIndex}`][0]
.imgList
if (imgList.length === 10) {
return this.$refs.uToast.show({
title: '图片已超出最大数量',
type: 'error',
})
}
this.photoItem = {
...JSON.parse(item),
groupIndex,
itemIndex,
}
// 弹窗展示
this.maskShow = true
},
// 区分上传动作
uploadSelect(index) {
if (index === 0) {
this.uploadFile('photo')
} else {
this.uploadFile()
}
},
// 拍照回调
async closeTake(val) {
if (val && val.length > 0) {
const order = {
orderNumber: this.orderNumber,
fieldsName: this.photoItem.fieldsName,
fieldsTitle: this.photoItem.fieldsTitle,
uploadType: 'camera',
}
const value = await this.saveToTask(val, order)
this.$refs[
`fileChild${this.photoItem.groupIndex}${this.photoItem.itemIndex}`
][0].setTmpValue(value)
}
this.takeStatus = false
},
// 上传图片
async uploadFile(type) {
const self = this
if (type && type === 'photo') {
// 直接打开相册
let options = {
sourceType: ['album'], //['album', 'camera']
count: 3,
sizeType: ['original'],
}
const order = {
orderNumber: this.orderNumber,
fieldsName: this.photoItem.fieldsName,
fieldsTitle: this.photoItem.fieldsTitle,
uploadType: 'album',
}
const value = await this.chooseImg(options, order)
self.$refs[
`fileChild${self.photoItem.groupIndex}${self.photoItem.itemIndex}`
][0].setTmpValue(value)
return
}
// 使用拍照工具拍摄
this.photograph()
this.getWatermark()
},
// 获取拍照规范
photograph() {
let self = this
let param = {
partnerCompanyId: this.partnerCompanyId || '',
categoryId: this.categoryId,
brandId: this.brandId || '',
fieldName: this.photoItem.fieldsName,
}
this.$u.api.orderStandardItem(param).then((res) => {
if (res.code == 200 && res.data.length > 0) {
self.currentItemDate = res.data[0]
} else {
console.log('获取完工项的拍照标准异常', res.data.message)
}
self.takeStatus = true
})
},
// 获取水印
getWatermark() {
if (getApp().globalData.photo.waterSetting) {
return
}
var data = { partnerCompanyId: this.partnerCompanyId || '' }
this.$u.api.getWatermark(data).then((res) => {
if (res.code == 200) {
getApp().globalData.photo.waterSetting = res.data
} else {
console.log('获取水印备注异常', res.data.message)
}
})
},
// ------------------------- 以上方法为上传组件相关 -------------------------
// 根据选择的值隐藏对应的项
if (fields[innerItem.fieldsName]) {
groupItem.items.forEach(c => {
if (fields[innerItem.fieldsName]['fieldsName'].includes(c.fieldsName)) {
c.required = data.value !== fields[innerItem.fieldsName]['value'];
}
});
}
// ------------------------- 以下方法为展示滚动切换 -------------------------
// 点击左边的栏目切换
async swichMenu(index) {
if (this.arr.length == 0) {
await this.getMenuItemTop()
}
// if (index == this.current) return;
this.scrollRightTop = this.oldScrollTop
this.$nextTick(function() {
setTimeout(() => {
// 没有指定滚动到某一小项,就滚动到大的项
this.scrollRightTop = this.arr[index]
this.current = index
}, 100)
})
},
// 获取右边菜单每个item到顶部的距离
getMenuItemTop() {
new Promise((resolve) => {
let selectorQuery = uni.createSelectorQuery()
selectorQuery
.selectAll('.class-item')
.boundingClientRect((rects) => {
// 如果节点尚未生成,rects值为[](因为用selectAll,所以返回的是数组),循环调用执行
if (!rects.length) {
setTimeout(() => {
this.getMenuItemTop()
}, 10)
return
}
rects.forEach((rect) => {
// 这里减去rects[0].top,是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
this.arr.push(rect.top - rects[0].top)
resolve()
})
})
.exec()
})
},
// 右边菜单滚动
async rightScroll(e) {
this.oldScrollTop = e.detail.scrollTop
if (this.arr.length == 0) {
await this.getMenuItemTop()
}
if (this.timer) return
this.timer = setTimeout(() => {
// 节流
this.timer = null
// scrollHeight为右边菜单垂直中点位置
let scrollHeight = e.detail.scrollTop
for (let i = 0; i < this.arr.length; i++) {
let height1 = this.arr[i]
let height2 = this.arr[i + 1]
// 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
if (!height2 || (scrollHeight >= height1 && scrollHeight < height2)) {
this.current = i
return
}
}
}, 100)
},
handleTouchstart() {
// 防止输入光标滚动出现错乱
uni.hideKeyboard()
},
// 返回上一页更新订单状态
backGo() {
// const pages = getCurrentPages()
// const beforePage = pages[pages.length - 2]
// if (beforePage.$vm.loadOrderDetail) beforePage.$vm.loadOrderDetail()
uni.navigateBack()
},
},
}
if (innerItem.fieldsName === 'pipe' || innerItem.fieldsName === 'pipeUseLength') {
// 申请费用计算
this.calcMoney();
}
// console.log("this.form", this.form)
},
// 申请费用计算
calcMoney() {
const price = parseInt(this.form.pipe) || 0;
const pipeUseLength = parseFloat(this.form.pipeUseLength) || 0;
if (price && pipeUseLength) {
const money = (price * pipeUseLength).toFixed(2);
this.$set(this.form, 'pipeAmount', money);
} else {
this.$set(this.form, 'pipeAmount', 0);
}
},
// ------------------------- 以下方法为上传组件相关 -------------------------
// 弹出上传选项
selectUpload(item, groupIndex, itemIndex) {
const imgList = this.$refs[`fileChild${groupIndex}${itemIndex}`][0].imgList;
if (imgList.length === 10) {
return this.$refs.uToast.show({
title: '图片已超出最大数量',
type: 'error'
});
}
this.photoItem = {
...JSON.parse(item),
groupIndex,
itemIndex
};
// 弹窗展示
this.maskShow = true;
},
// 区分上传动作
uploadSelect(index) {
if (index === 0) {
this.uploadFile('photo');
} else {
this.uploadFile();
}
},
// 拍照回调
async closeTake(val) {
if (val && val.length > 0) {
const order = {
orderNumber: this.orderNumber,
fieldsName: this.photoItem.fieldsName,
fieldsTitle: this.photoItem.fieldsTitle,
uploadType: 'camera'
};
const value = await this.saveToTask(val, order);
this.$refs[`fileChild${this.photoItem.groupIndex}${this.photoItem.itemIndex}`][0].setTmpValue(value);
}
this.takeStatus = false;
},
// 上传图片
async uploadFile(type) {
const self = this;
if (type && type === 'photo') {
// 直接打开相册
let options = {
sourceType: ['album'], //['album', 'camera']
count: 3,
sizeType: ['original']
};
const order = {
orderNumber: this.orderNumber,
fieldsName: this.photoItem.fieldsName,
fieldsTitle: this.photoItem.fieldsTitle,
uploadType: 'album'
};
const value = await this.chooseImg(options, order);
self.$refs[`fileChild${self.photoItem.groupIndex}${self.photoItem.itemIndex}`][0].setTmpValue(value);
return;
}
// 使用拍照工具拍摄
this.photograph();
this.getWatermark();
},
// 获取拍照规范
photograph() {
let self = this;
let param = {
partnerCompanyId: this.partnerCompanyId || '',
categoryId: this.categoryId,
brandId: this.brandId || '',
fieldName: this.photoItem.fieldsName
};
this.$u.api.orderStandardItem(param).then(res => {
if (res.code == 200 && res.data.length > 0) {
self.currentItemDate = res.data[0];
} else {
console.log('获取完工项的拍照标准异常', res.data.message);
}
self.takeStatus = true;
});
},
// 获取水印
getWatermark() {
if (getApp().globalData.photo.waterSetting) {
return;
}
var data = { partnerCompanyId: this.partnerCompanyId || '' };
this.$u.api.getWatermark(data).then(res => {
if (res.code == 200) {
getApp().globalData.photo.waterSetting = res.data;
} else {
console.log('获取水印备注异常', res.data.message);
}
});
},
// ------------------------- 以上方法为上传组件相关 -------------------------
// ------------------------- 以下方法为展示滚动切换 -------------------------
// 点击左边的栏目切换
async swichMenu(index) {
if (this.arr.length == 0) {
await this.getMenuItemTop();
}
// if (index == this.current) return;
this.scrollRightTop = this.oldScrollTop;
this.$nextTick(function() {
setTimeout(() => {
// 没有指定滚动到某一小项,就滚动到大的项
this.scrollRightTop = this.arr[index];
this.current = index;
}, 100);
});
},
// 获取右边菜单每个item到顶部的距离
getMenuItemTop() {
new Promise(resolve => {
let selectorQuery = uni.createSelectorQuery();
selectorQuery
.selectAll('.class-item')
.boundingClientRect(rects => {
// 如果节点尚未生成,rects值为[](因为用selectAll,所以返回的是数组),循环调用执行
if (!rects.length) {
setTimeout(() => {
this.getMenuItemTop();
}, 10);
return;
}
rects.forEach(rect => {
// 这里减去rects[0].top,是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
this.arr.push(rect.top - rects[0].top);
resolve();
});
})
.exec();
});
},
// 右边菜单滚动
async rightScroll(e) {
this.oldScrollTop = e.detail.scrollTop;
if (this.arr.length == 0) {
await this.getMenuItemTop();
}
if (this.timer) return;
this.timer = setTimeout(() => {
// 节流
this.timer = null;
// scrollHeight为右边菜单垂直中点位置
let scrollHeight = e.detail.scrollTop;
for (let i = 0; i < this.arr.length; i++) {
let height1 = this.arr[i];
let height2 = this.arr[i + 1];
// 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
if (!height2 || (scrollHeight >= height1 && scrollHeight < height2)) {
this.current = i;
return;
}
}
}, 100);
},
handleTouchstart() {
// 防止输入光标滚动出现错乱
uni.hideKeyboard();
},
// 返回上一页更新订单状态
backGo() {
// const pages = getCurrentPages()
// const beforePage = pages[pages.length - 2]
// if (beforePage.$vm.loadOrderDetail) beforePage.$vm.loadOrderDetail()
uni.navigateBack();
}
}
};
</script>
<style lang="scss" scoped>
// ---------------------------- 表单样式begin ----------------------------
/deep/ .u-form-item {
.u-form-item__message {
padding-left: 0 !important;
}
.u-form-item__message {
padding-left: 0 !important;
}
.u-form-item--left__content--required {
vertical-align: top;
}
.u-form-item--left__content--required {
vertical-align: top;
}
}
.class-item {
background-color: #fff;
padding: 28rpx;
border-radius: 8rpx;
.title {
font-weight: bold;
font-size: 32rpx;
line-height: 32rpx;
color: #333;
}
.label {
color: #333;
font-size: 28rpx;
line-height: 40rpx;
padding-bottom: 20rpx;
}
.label-bold {
font-size: 32rpx;
font-weight: bold;
}
.required {
padding-right: 10rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #fa3534;
}
background-color: #fff;
padding: 28rpx;
border-radius: 8rpx;
.title {
font-weight: bold;
font-size: 32rpx;
line-height: 32rpx;
color: #333;
}
.label {
color: #333;
font-size: 28rpx;
line-height: 40rpx;
padding-bottom: 20rpx;
}
.label-bold {
font-size: 32rpx;
font-weight: bold;
}
.required {
padding-right: 10rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #fa3534;
}
.item-image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
.item-image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
}
// ---------------------------- 表单样式end ----------------------------
.com-content {
height: calc(100vh);
/* #ifdef H5 */
height: calc(100vh - var(--window-top));
/* #endif */
display: flex;
flex-direction: column;
background-color: #ffffff;
background-image: linear-gradient(to top, #2272ff 0%, #2272ff 100%);
background-size: 750rpx 600rpx;
background-repeat: no-repeat;
height: calc(100vh);
/* #ifdef H5 */
height: calc(100vh - var(--window-top));
/* #endif */
display: flex;
flex-direction: column;
background-color: #ffffff;
background-image: linear-gradient(to top, #2272ff 0%, #2272ff 100%);
background-size: 750rpx 600rpx;
background-repeat: no-repeat;
}
.u-search-box {
padding: 18rpx 30rpx;
padding: 18rpx 30rpx;
}
.order-tabs {
margin-top: 20rpx;
margin-bottom: 32rpx;
margin-top: 20rpx;
margin-bottom: 32rpx;
}
.u-menu-wrap {
// flex: 1;
height: 100%;
overflow: auto;
// overflow: hidden;
border-radius: 12rpx 12rpx 0 0;
// flex: 1;
height: 100%;
overflow: auto;
// overflow: hidden;
border-radius: 12rpx 12rpx 0 0;
}
.detail-view {
border-radius: 12rpx;
margin: 30rpx;
border-radius: 12rpx;
margin: 30rpx;
}
.u-search-inner {
background-color: rgb(234, 234, 234);
border-radius: 100rpx;
display: flex;
align-items: center;
padding: 10rpx 16rpx;
background-color: rgb(234, 234, 234);
border-radius: 100rpx;
display: flex;
align-items: center;
padding: 10rpx 16rpx;
}
.u-search-text {
font-size: 26rpx;
color: $u-tips-color;
margin-left: 10rpx;
font-size: 26rpx;
color: $u-tips-color;
margin-left: 10rpx;
}
.u-tab-view {
width: 200rpx;
height: 100%;
border: 4rpx solid #f4f5f7;
overflow: auto;
width: 200rpx;
height: 100%;
border: 4rpx solid #f4f5f7;
overflow: auto;
}
.u-tab-item {
height: 110rpx;
background: #fff;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #333333;
font-weight: 400;
line-height: 1;
height: 110rpx;
background: #fff;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #333333;
font-weight: 400;
line-height: 1;
}
.u-tab-item-active {
position: relative;
color: #2272ff;
background: #fff;
position: relative;
color: #2272ff;
background: #fff;
}
// .u-tab-item-active::before {
......@@ -1494,91 +1382,91 @@ export default {
// }
.u-tab-view {
height: 100%;
height: 100%;
}
.right-box,
.right-boxs {
// background-color: rgb(250, 250, 250);
background-color: #ffffff;
overflow: auto;
width: 100%;
// background-color: rgb(250, 250, 250);
background-color: #ffffff;
overflow: auto;
width: 100%;
}
.page-view {
padding: 16rpx;
padding: 16rpx;
}
.class-item:last-child {
max-height: 100vh;
max-height: 100vh;
}
.item-title {
font-size: 26rpx;
color: $u-main-color;
font-weight: bold;
font-size: 26rpx;
color: $u-main-color;
font-weight: bold;
}
.item-menu-name {
font-weight: normal;
font-size: 24rpx;
color: $u-main-color;
font-weight: normal;
font-size: 24rpx;
color: $u-main-color;
}
.item-container {
display: flex;
flex-wrap: wrap;
display: flex;
flex-wrap: wrap;
}
.thumb-box {
width: 33.333333%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin-top: 20rpx;
width: 33.333333%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin-top: 20rpx;
}
.item-menu-image {
width: 120rpx;
height: 120rpx;
width: 120rpx;
height: 120rpx;
}
/*提交按钮*/
.btn-bottom {
border: 2rpx solid #f4f5f7;
border: 2rpx solid #f4f5f7;
}
.btn-wrap {
width: 100%;
padding: 20rpx 0 44rpx 0;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
padding: 20rpx 0 44rpx 0;
display: flex;
justify-content: center;
align-items: center;
}
.read-only {
justify-content: flex-end;
padding-right: 30rpx;
justify-content: flex-end;
padding-right: 30rpx;
}
.btn-save {
color: #ffffff;
background-color: #2272ff;
font-size: 32rpx;
font-weight: bold;
color: #ffffff;
background-color: #2272ff;
font-size: 32rpx;
font-weight: bold;
}
.img-list {
position: relative;
margin: 8rpx;
width: 160rpx;
height: 160rpx;
position: relative;
margin: 8rpx;
width: 160rpx;
height: 160rpx;
.pic {
// margin-right: 15rpx;
// margin-bottom: 15rpx;
&:nth-child(3n) {
margin-right: 0;
}
}
.pic {
// margin-right: 15rpx;
// margin-bottom: 15rpx;
&:nth-child(3n) {
margin-right: 0;
}
}
}
</style>
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