12 changed files with 569 additions and 27 deletions
Split View
Diff Options
-
34apis/applyApi.js
-
4apis/orderApi.js
-
10enums/index.js
-
16pages.json
-
263pages/apply-detail/index.vue
-
170pages/apply-manage/index.vue
-
2pages/contract-manage/index.vue
-
8pages/login/index.vue
-
76pages/mine/index.vue
-
BINstatic/imgs/digital-workshops/验厂管理.sketch
-
0static/imgs/mine/apply-manage-icon.png
-
13utils/handlePushMsg.js
@ -0,0 +1,34 @@ |
|||
import http from '@/utils/http/index.js' |
|||
|
|||
/** |
|||
* 获取远程验厂列表 |
|||
*/ |
|||
export function getApplyingList(data = {}) { |
|||
return http.get({ |
|||
url: '/base-paper-trading/get/factory-inspection/list', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
/** |
|||
* 获取远程验厂详情 |
|||
*/ |
|||
export function getApplyingInfo(data = {}) { |
|||
return http.get({ |
|||
url: `/base-paper-trading/get/factory-inspection/${data.id}`, |
|||
data |
|||
}) |
|||
} |
|||
|
|||
/** |
|||
* 处理远程验厂申请 |
|||
* @param {object} data |
|||
* @property {number} handleResult |
|||
* @property {number} id |
|||
*/ |
|||
export function handleApplying(data = {}) { |
|||
return http.post({ |
|||
url: `/base-paper-trading/handle/for-factory-inspection`, |
|||
data |
|||
}) |
|||
} |
|||
@ -0,0 +1,263 @@ |
|||
<template> |
|||
<view class="content"> |
|||
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="申请详情"></uni-nav-bar> |
|||
<view class="flex-col group_4"> |
|||
<view class="flex-col"> |
|||
<view class="flex-col items-center text-wrapper" v-if="info.status == applyingTypeEnum.WAITING"> |
|||
<text>通过后该用户可查看设备的视频信息、生产信息。</text> |
|||
</view> |
|||
<view v-else class="center-text-wrapper flex-col items-center view_1" :class="bgMap[info.status].bg"> |
|||
<text>{{ bgMap[info.status].text }}</text> |
|||
</view> |
|||
<view class="flex-col section_1"> |
|||
<view class="flex-row"> |
|||
<text class="text_5">用户名:</text> |
|||
<text class="text_6">{{ info.userName }}</text> |
|||
</view> |
|||
<view class="flex-row group_7"> |
|||
<text class="text_7">手机号:</text> |
|||
<text class="text_8">{{ info.mobile }}</text> |
|||
</view> |
|||
<view class="flex-row group_8"> |
|||
<text class="text_9">企业名:</text> |
|||
<text class="text_10">{{ info.enterpriseName }}</text> |
|||
</view> |
|||
<view class="flex-row group_9"> |
|||
<text class="text_11">申请时间:</text> |
|||
<text class="text_12">{{ info.createTime }}</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="flex-row group_10" v-if="info.status == applyingTypeEnum.WAITING"> |
|||
<view class="flex-col items-center text-wrapper_1" @click="handle(2)"> |
|||
<text>拒绝</text> |
|||
</view> |
|||
<view class="flex-col items-center text-wrapper_2" @click="handle(1)"> |
|||
<text>通过</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { go2, back } from '@/utils/hook.js' |
|||
import { applyingTypeEnum } from '@/enums/index' |
|||
import { getApplyingInfo, handleApplying } from '@/apis/applyApi' |
|||
const bgMap = { |
|||
[applyingTypeEnum.WAITING]: { |
|||
bg: 'waiting-bg', |
|||
text: '待处理' |
|||
}, |
|||
[applyingTypeEnum.AGREE]: { |
|||
bg: 'agree-bg', |
|||
text: '已同意' |
|||
}, |
|||
[applyingTypeEnum.REJECT]: { |
|||
bg: 'reject-bg', |
|||
text: '已拒绝' |
|||
}, |
|||
[applyingTypeEnum.EXPIRED]: { |
|||
bg: 'expired-bg', |
|||
text: '已过期' |
|||
} |
|||
} |
|||
export default { |
|||
data() { |
|||
return { |
|||
bgMap: Object.freeze(bgMap), |
|||
id: null, |
|||
info: { |
|||
status: applyingTypeEnum.WAITING |
|||
}, |
|||
applyingTypeEnum: Object.freeze(applyingTypeEnum) |
|||
} |
|||
}, |
|||
onLoad(options) { |
|||
if (options.id) { |
|||
this.id = options.id |
|||
getApplyingInfo({ id: this.id }).then((res) => { |
|||
if (res) { |
|||
this.info = res |
|||
} |
|||
}) |
|||
} else { |
|||
uni.showToast({ |
|||
title: '参数错误,即将跳转', |
|||
success: () => { |
|||
setTimeout(() => { |
|||
back() |
|||
}, 1500) |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
methods: { |
|||
go2, |
|||
back, |
|||
handle(handleResult) { |
|||
uni.showModal({ |
|||
title: '提示', |
|||
content: '确定要操作吗?', |
|||
success: (res) => { |
|||
if (res.confirm) { |
|||
handleApplying({ id: this.id, handleResult }).then((res) => { |
|||
if (res) { |
|||
uni.showToast({ |
|||
title: '操作成功', |
|||
success: () => { |
|||
setTimeout(() => { |
|||
back() |
|||
}, 1500) |
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.content { |
|||
width: 750rpx; |
|||
} |
|||
.group_4 { |
|||
position: relative; |
|||
flex: 1 1 auto; |
|||
overflow-y: auto; |
|||
.center-text-wrapper { |
|||
color: rgb(255, 255, 255); |
|||
font-size: 28rpx; |
|||
font-weight: 500; |
|||
line-height: 40rpx; |
|||
white-space: nowrap; |
|||
} |
|||
.view_1 { |
|||
padding: 5rpx 0; |
|||
border-radius: 0px 0px 0px 20rpx; |
|||
width: 120rpx; |
|||
position: absolute; |
|||
right: 0; |
|||
top: 0; |
|||
} |
|||
.group_10 { |
|||
margin-top: 140rpx; |
|||
padding: 0 32rpx; |
|||
.text-wrapper_1 { |
|||
padding: 21rpx 0; |
|||
flex: 1 1 332rpx; |
|||
color: rgb(238, 10, 36); |
|||
font-size: 30rpx; |
|||
font-weight: 500; |
|||
line-height: 42rpx; |
|||
white-space: nowrap; |
|||
background-color: rgb(255, 255, 255); |
|||
border-radius: 10rpx; |
|||
height: 88rpx; |
|||
border: solid 2rpx rgb(238, 10, 36); |
|||
} |
|||
.text-wrapper_2 { |
|||
margin-left: 22rpx; |
|||
padding: 23rpx 0; |
|||
flex: 1 1 332rpx; |
|||
color: rgb(255, 255, 255); |
|||
font-size: 30rpx; |
|||
font-weight: 500; |
|||
line-height: 42rpx; |
|||
white-space: nowrap; |
|||
background-color: rgb(0, 122, 255); |
|||
border-radius: 10rpx; |
|||
height: 88rpx; |
|||
} |
|||
} |
|||
.text-wrapper { |
|||
padding: 17rpx 0; |
|||
color: rgb(0, 122, 255); |
|||
font-size: 30rpx; |
|||
line-height: 42rpx; |
|||
white-space: nowrap; |
|||
background-color: rgb(229, 241, 255); |
|||
} |
|||
.section_1 { |
|||
padding: 16rpx 32rpx 31rpx; |
|||
background-color: rgb(255, 255, 255); |
|||
.group_7 { |
|||
margin-top: 15rpx; |
|||
.text_7 { |
|||
color: rgb(136, 136, 136); |
|||
font-size: 28rpx; |
|||
line-height: 40rpx; |
|||
white-space: nowrap; |
|||
} |
|||
.text_8 { |
|||
margin-left: 90rpx; |
|||
color: rgb(51, 51, 51); |
|||
font-size: 28rpx; |
|||
line-height: 40rpx; |
|||
white-space: nowrap; |
|||
} |
|||
} |
|||
.group_8 { |
|||
margin-top: 14rpx; |
|||
.text_9 { |
|||
color: rgb(136, 136, 136); |
|||
font-size: 28rpx; |
|||
line-height: 40rpx; |
|||
white-space: nowrap; |
|||
} |
|||
.text_10 { |
|||
margin-left: 90rpx; |
|||
color: rgb(51, 51, 51); |
|||
font-size: 28rpx; |
|||
line-height: 40rpx; |
|||
white-space: nowrap; |
|||
} |
|||
} |
|||
.group_9 { |
|||
margin-top: 14rpx; |
|||
.text_11 { |
|||
color: rgb(136, 136, 136); |
|||
font-size: 28rpx; |
|||
line-height: 40rpx; |
|||
white-space: nowrap; |
|||
} |
|||
.text_12 { |
|||
margin-left: 62rpx; |
|||
color: rgb(51, 51, 51); |
|||
font-size: 28rpx; |
|||
line-height: 40rpx; |
|||
white-space: nowrap; |
|||
} |
|||
} |
|||
.text_5 { |
|||
color: rgb(136, 136, 136); |
|||
font-size: 28rpx; |
|||
line-height: 40rpx; |
|||
white-space: nowrap; |
|||
} |
|||
.text_6 { |
|||
margin-left: 90rpx; |
|||
color: rgb(51, 51, 51); |
|||
font-size: 28rpx; |
|||
line-height: 40rpx; |
|||
white-space: nowrap; |
|||
} |
|||
} |
|||
} |
|||
.agree-bg { |
|||
background-color: rgba(19, 194, 194, 0.6); |
|||
} |
|||
.reject-bg { |
|||
background-color: rgba(255, 122, 69, 0.6); |
|||
} |
|||
.expired-bg { |
|||
background-color: rgb(217, 217, 217); |
|||
} |
|||
.waiting-bg { |
|||
background-color: rgba(89, 126, 247, 0.6); |
|||
} |
|||
</style> |
|||
@ -0,0 +1,170 @@ |
|||
<template> |
|||
<view class="content"> |
|||
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="验厂申请"></uni-nav-bar> |
|||
<scroll-list ref="list" :option="option" @load="upCallback" @refresh="downCallback"> |
|||
<view class="list-item flex-col" v-for="item in list" :key="item.id" @click="go2('apply-detail', { id: item.id })"> |
|||
<view class="top-group flex-col"> |
|||
<text class="text_8">{{ item.userName }} 申请远程验厂</text> |
|||
<view class="center-text-wrapper flex-col items-center view_1" :class="bgMap[item.status].bg"> |
|||
<text>{{ bgMap[item.status].text }}</text> |
|||
</view> |
|||
<text class="text_11">{{ item.createTime }}</text> |
|||
</view> |
|||
<text class="text_13">{{ item.enterpriseName }}</text> |
|||
</view> |
|||
</scroll-list> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { go2, back } from '@/utils/hook.js' |
|||
import { applyingTypeEnum } from '@/enums/index' |
|||
import { getApplyingList } from '@/apis/applyApi' |
|||
const bgMap = { |
|||
[applyingTypeEnum.WAITING]: { |
|||
bg: 'waiting-bg', |
|||
text: '待处理' |
|||
}, |
|||
[applyingTypeEnum.AGREE]: { |
|||
bg: 'agree-bg', |
|||
text: '已同意' |
|||
}, |
|||
[applyingTypeEnum.REJECT]: { |
|||
bg: 'reject-bg', |
|||
text: '已拒绝' |
|||
}, |
|||
[applyingTypeEnum.EXPIRED]: { |
|||
bg: 'expired-bg', |
|||
text: '已过期' |
|||
} |
|||
} |
|||
export default { |
|||
data() { |
|||
return { |
|||
bgMap: Object.freeze(bgMap), |
|||
option: { |
|||
size: 10, |
|||
auto: true, |
|||
emptyText: '暂无数据~', |
|||
background: '#F7F8FA', |
|||
disabled: false |
|||
}, |
|||
pagination: { |
|||
pageNum: 0, // 初始会执行一次下拉加载 |
|||
pageSize: 10 |
|||
}, |
|||
list: [] |
|||
} |
|||
}, |
|||
methods: { |
|||
go2, |
|||
back, |
|||
getList() { |
|||
return new Promise((resolve, reject) => { |
|||
getApplyingList({ ...this.pagination }) |
|||
.then((res) => { |
|||
// console.log('询价列表', res.records) |
|||
if (res) { |
|||
if (res.current == 1) { |
|||
this.list = res.records |
|||
} else { |
|||
this.list = this.list.concat(res.records) |
|||
} |
|||
resolve({ list: this.list, total: res.total }) |
|||
} else { |
|||
reject() |
|||
} |
|||
}) |
|||
.catch((err) => { |
|||
reject(err) |
|||
}) |
|||
}) |
|||
}, |
|||
downCallback() { |
|||
this.pagination.pageNum = 1 |
|||
this.getList() |
|||
.then(({ list, total }) => { |
|||
this.$refs.list.refreshSuccess({ list, total }) |
|||
}) |
|||
.catch(() => { |
|||
this.$refs.list.refreshFail() |
|||
}) |
|||
}, |
|||
upCallback() { |
|||
this.pagination.pageNum++ |
|||
this.getList() |
|||
.then(({ list, total }) => { |
|||
this.$refs.list.loadSuccess({ list, total }) |
|||
}) |
|||
.catch(() => { |
|||
this.$refs.list.loadFail() |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.content { |
|||
width: 750rpx; |
|||
} |
|||
.list-item { |
|||
margin-bottom: 20rpx; |
|||
padding-left: 32rpx; |
|||
padding-bottom: 24rpx; |
|||
background-color: rgb(255, 255, 255); |
|||
.top-group { |
|||
padding-top: 24rpx; |
|||
position: relative; |
|||
.text_8 { |
|||
color: rgb(0, 58, 140); |
|||
font-size: 32rpx; |
|||
font-weight: 500; |
|||
line-height: 45rpx; |
|||
white-space: nowrap; |
|||
} |
|||
.center-text-wrapper { |
|||
color: rgb(255, 255, 255); |
|||
font-size: 28rpx; |
|||
font-weight: 500; |
|||
line-height: 40rpx; |
|||
white-space: nowrap; |
|||
} |
|||
.view_1 { |
|||
padding: 5rpx 0; |
|||
border-radius: 0px 0px 0px 20rpx; |
|||
width: 120rpx; |
|||
position: absolute; |
|||
right: 0; |
|||
top: 0; |
|||
} |
|||
.agree-bg { |
|||
background-color: rgba(19, 194, 194, 0.6); |
|||
} |
|||
.reject-bg { |
|||
background-color: rgba(255, 122, 69, 0.6); |
|||
} |
|||
.expired-bg { |
|||
background-color: rgb(217, 217, 217); |
|||
} |
|||
.waiting-bg { |
|||
background-color: rgba(89, 126, 247, 0.6); |
|||
} |
|||
.text_11 { |
|||
margin-top: 5rpx; |
|||
color: rgb(136, 136, 136); |
|||
font-size: 24rpx; |
|||
line-height: 33rpx; |
|||
white-space: nowrap; |
|||
position: relative; |
|||
} |
|||
} |
|||
.text_13 { |
|||
margin-top: 15rpx; |
|||
color: rgb(85, 85, 85); |
|||
font-size: 28rpx; |
|||
line-height: 40rpx; |
|||
white-space: nowrap; |
|||
} |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save