1.订单部分页面 2.会议部分页面
This commit is contained in:
162
pages/sys/workbench/order/createOrder.vue
Normal file
162
pages/sys/workbench/order/createOrder.vue
Normal file
@@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<view class="form-container">
|
||||
<!-- 工单名称 -->
|
||||
<view class="form-item">
|
||||
<text class="label">工单名称</text>
|
||||
<input class="input" placeholder="请输入工单名称" v-model="form.name" />
|
||||
</view>
|
||||
|
||||
<!-- 工单类型 -->
|
||||
<view class="form-item">
|
||||
<text class="label">工单类型</text>
|
||||
<picker :range="orderTypes" @change="onTypeChange">
|
||||
<view class="picker">
|
||||
{{ form.type || '请选择' }}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<!-- 处理人 -->
|
||||
<view class="form-item">
|
||||
<text class="label">处理人</text>
|
||||
<view class="handler-selector">
|
||||
<picker :range="handlers" @change="onHandlerChange">
|
||||
<view class="picker">
|
||||
{{ form.handler || '请选择' }}
|
||||
</view>
|
||||
</picker>
|
||||
<button class="icon-btn" @click="addHandler">+</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 计划完成时间 -->
|
||||
<view class="form-item">
|
||||
<text class="label">计划完成时间</text>
|
||||
<picker mode="date" @change="onDateChange">
|
||||
<view class="picker">
|
||||
{{ form.date || '请选择' }}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<!-- 备注 -->
|
||||
<view class="form-item">
|
||||
<text class="label">备注</text>
|
||||
<textarea class="textarea" placeholder="请输入内容(非必填)" v-model="form.remark" />
|
||||
</view>
|
||||
|
||||
<!-- 上传图片 -->
|
||||
<view class="form-item">
|
||||
<button class="upload-btn" @click="uploadImage">+ 上传图片</button>
|
||||
</view>
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<view class="submit-wrapper">
|
||||
<button class="submit-btn" @click="submit">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
name: '',
|
||||
type: '',
|
||||
handler: '',
|
||||
date: '',
|
||||
remark: '',
|
||||
image: ''
|
||||
},
|
||||
orderTypes: ['类型1', '类型2', '类型3'],
|
||||
handlers: ['张三', '李四', '王五']
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onTypeChange(e) {
|
||||
this.form.type = this.orderTypes[e.detail.value];
|
||||
},
|
||||
onHandlerChange(e) {
|
||||
this.form.handler = this.handlers[e.detail.value];
|
||||
},
|
||||
onDateChange(e) {
|
||||
this.form.date = e.detail.value;
|
||||
},
|
||||
addHandler() {
|
||||
uni.showToast({ title: '添加处理人', icon: 'none' });
|
||||
},
|
||||
uploadImage() {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
success: (res) => {
|
||||
this.form.image = res.tempFilePaths[0];
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
uni.showToast({
|
||||
title: '提交成功',
|
||||
icon: 'success'
|
||||
});
|
||||
console.log(this.form);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.form-container {
|
||||
padding: 30rpx;
|
||||
}
|
||||
.form-item {
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.label {
|
||||
font-weight: bold;
|
||||
margin-bottom: 10rpx;
|
||||
display: block;
|
||||
}
|
||||
.input,
|
||||
.picker,
|
||||
.textarea {
|
||||
background-color: #f5f5f5;
|
||||
padding: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.textarea {
|
||||
height: 200rpx;
|
||||
}
|
||||
.handler-selector {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.icon-btn {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #eee;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.upload-btn {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border: 2rpx dashed #ccc;
|
||||
border-radius: 10rpx;
|
||||
font-size: 28rpx;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
.submit-wrapper {
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
background-color: #1890ff;
|
||||
color: #fff;
|
||||
padding: 20rpx;
|
||||
border-radius: 50rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
</style>
|
230
pages/sys/workbench/order/order.vue
Normal file
230
pages/sys/workbench/order/order.vue
Normal file
@@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<view class="order-container">
|
||||
<!-- tab栏 -->
|
||||
<view class="order-tabs">
|
||||
<view v-for="(tab, idx) in tabs" :key="idx" :class="['order-tab', {active: idx === activeTab}]"
|
||||
@click="changeTab(idx)">
|
||||
{{ tab }}
|
||||
<view v-if="idx === activeTab" class="tab-underline"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 列表区 -->
|
||||
<view class="order-list">
|
||||
<view v-for="(item, idx) in list" :key="idx" class="order-card" @click="goDetail(item)">
|
||||
<view class="order-row">
|
||||
<view class="order-no">工单号:{{ item.orderNo }}</view>
|
||||
<view class="order-status" :class="getStatusColor(item.status)">
|
||||
{{ getStatusLabel(item.status) }}</view>
|
||||
</view>
|
||||
<image class="order-line-image" src="/static/ic_my_repair_03.png" />
|
||||
<view class="order-info">工单名称:{{ item.orderName }}</view>
|
||||
<view class="order-info">工单类型:{{ item.typeName }}</view>
|
||||
<view class="order-info">创建时间:{{ item.createTime }}</view>
|
||||
<view class="order-info">有 效 期:{{ item.createTime }}-{{item.planCompleTime}}</view>
|
||||
<view v-if="item.statusText === '已结束'" class="order-eval-btn eval-btn-right">服务评价</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabs: ['待办', '全部', '发起 '],
|
||||
activeTab: 1,
|
||||
tabData: [
|
||||
[],
|
||||
[],
|
||||
[]
|
||||
], // 每个tab的数据
|
||||
tabLoaded: [false, false, false], // 每个tab是否已加载
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
list() {
|
||||
return this.tabData[this.activeTab];
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadTabData(this.activeTab); // 初始化加载当前tab数据
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
async changeTab(idx) {
|
||||
this.activeTab = idx;
|
||||
if (!this.tabLoaded[idx]) {
|
||||
await this.loadTabData(idx);
|
||||
}
|
||||
},
|
||||
async loadTabData(idx) {
|
||||
this.loading = true;
|
||||
// 模拟接口请求,不同tab返回不同mock数据
|
||||
let params = {}
|
||||
if (idx === 0) {
|
||||
params = {
|
||||
}
|
||||
}
|
||||
|
||||
let data = [];
|
||||
let res = await this.$u.api.getOrderList(params);
|
||||
|
||||
if (res.code == '200') {
|
||||
data = res.rows
|
||||
}
|
||||
|
||||
this.$set(this.tabData, idx, data);
|
||||
this.$set(this.tabLoaded, idx, true);
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
getStatusLabel(status) {
|
||||
const statusMap = {
|
||||
0: '创建工单',
|
||||
1: '处理中',
|
||||
2: '处理中',
|
||||
3: '处理中',
|
||||
4: '已完成'
|
||||
};
|
||||
return statusMap[status] || '';
|
||||
},
|
||||
getStatusColor(status) {
|
||||
const statusMap = {
|
||||
0: 'orange',
|
||||
1: 'doing',
|
||||
2: 'doing',
|
||||
3: 'doing',
|
||||
4: 'done'
|
||||
};
|
||||
return statusMap[status] || '';
|
||||
},
|
||||
goDetail(item) {
|
||||
// 将item对象转换为JSON字符串并进行编码,然后通过URL参数传递
|
||||
const itemStr = encodeURIComponent(JSON.stringify(item));
|
||||
uni.navigateTo({
|
||||
url: '/pages/sys/workbench/order/orderDetail?item=' + itemStr
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.order-container {
|
||||
height: 100vh;
|
||||
background: #f7f7f7;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
|
||||
.order-tabs {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
background: #fff;
|
||||
height: 80rpx;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
flex-shrink: 0;
|
||||
/* 防止被压缩 */
|
||||
}
|
||||
|
||||
.order-tab {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #888;
|
||||
position: relative;
|
||||
font-weight: 500;
|
||||
padding: 0 0 10rpx 0;
|
||||
/* tab点击事件 */
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.order-tab.active {
|
||||
color: #2186FF;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tab-underline {
|
||||
width: 60rpx;
|
||||
height: 6rpx;
|
||||
background: #2186FF;
|
||||
border-radius: 3rpx;
|
||||
margin: 0 auto;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.order-list {
|
||||
margin: 32rpx 0 0 0;
|
||||
padding: 0 24rpx;
|
||||
flex: 1;
|
||||
/* 占据所有剩余空间 */
|
||||
overflow-y: auto;
|
||||
/* 内容超出时,开启垂直滚动 */
|
||||
padding-bottom: 200rpx;
|
||||
/* 为底部按钮留出空间 */
|
||||
}
|
||||
|
||||
.order-card {
|
||||
background: #fff;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 24rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
|
||||
padding-top: 25rpx;
|
||||
padding-bottom: 32rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.order-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 12rpx;
|
||||
margin-top: 25rpx;
|
||||
margin-left: 19rpx;
|
||||
margin-right: 50rpx;
|
||||
}
|
||||
|
||||
.order-no {
|
||||
font-size: 24rpx;
|
||||
color: #0B0B0B;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.order-status {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.order-line-image {
|
||||
margin: left 29rpx;
|
||||
margin-right: 39rpx;
|
||||
height: 2rpx;
|
||||
margin-bottom: 29rpx;
|
||||
}
|
||||
|
||||
.order-status.orange {
|
||||
color: #F3AB44;
|
||||
}
|
||||
|
||||
.order-status.doing {
|
||||
color: #00C9AA;
|
||||
}
|
||||
|
||||
.order-status.done {
|
||||
color: #8A8A8A;
|
||||
}
|
||||
|
||||
.order-info {
|
||||
font-size: 24rpx;
|
||||
color: #888;
|
||||
margin-bottom: 30rpx;
|
||||
margin-left: 47rpx;
|
||||
}
|
||||
</style>
|
242
pages/sys/workbench/order/orderDetail.vue
Normal file
242
pages/sys/workbench/order/orderDetail.vue
Normal file
@@ -0,0 +1,242 @@
|
||||
<template>
|
||||
<view class="page-container">
|
||||
<view class="top-line"/>
|
||||
<!-- 工单状态进度 -->
|
||||
<view class="repair-detail-progress-box">
|
||||
<view class="repair-detail-progress">
|
||||
<view v-for="(step, idx) in progressSteps" :key="idx" class="repair-detail-step">
|
||||
<view
|
||||
:class="['repair-detail-dot', detailStep >= idx ? 'active' : '', (detailStep === idx && detailStatus !== '已结束') ? 'current' : '']">
|
||||
</view>
|
||||
<view v-if="idx < progressSteps.length - 1"
|
||||
:class="['repair-detail-line', detailStep > idx ? 'active' : '']"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="repair-detail-progress-labels">
|
||||
<view v-for="(step, idx) in progressSteps" :key="idx" class="repair-detail-label">{{ step }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 工单详情 -->
|
||||
<view class="detail-list">
|
||||
<view class="detail-value"><text class="detail-key">工单编号:</text>{{ detail.orderNo }}</view>
|
||||
<view class="detail-value"><text class="detail-key">工单名称:</text>{{ detail.orderName }}</view>
|
||||
<view class="detail-value"><text class="detail-key">工单类型:</text>{{ detail.typeName }}</view>
|
||||
<view class="detail-value"><text class="detail-key">处理地点:</text>{{ detail.location }}</view>
|
||||
<view class="detail-value"><text class="detail-key">创建时间:</text>{{ detail.createTime }}</view>
|
||||
<view class="detail-value"><text class="detail-key">发起单位/人:</text>{{ detail.initiatorPeople }}</view>
|
||||
<view class="detail-value"><text class="detail-key">计划完成时间:</text>{{ detail.planCompleTime }}</view>
|
||||
<view class="detail-value">
|
||||
<text>附件:</text>
|
||||
<text class="link" @click="downloadFile">下载</text>
|
||||
</view>
|
||||
<view class="detail-value remark"><text>备注:</text>{{ detail.remark }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部操作按钮 -->
|
||||
<view class="btn-group">
|
||||
<button class="btn ghost" @click="transfer">转派</button>
|
||||
<button class="btn primary" @click="complete">完成</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
detailStep: 0,
|
||||
detailStatus: '',
|
||||
progressSteps: ['创建工单', '处理中', '已结束'],
|
||||
currentStatus: 2, // 0: 待分配,1: 已接单,2: 处理中,3: 已完成
|
||||
detail: {
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.item) {
|
||||
const item = JSON.parse(decodeURIComponent(options.item));
|
||||
this.detail = item;
|
||||
console.log("t1",this.detail)
|
||||
// 现在可以使用item对象了
|
||||
// 进度映射
|
||||
if (item.status === 0) {
|
||||
this.detailStep = 0;
|
||||
this.detailStatus = '创建报';
|
||||
} else if (item.status === 4) {
|
||||
this.detailStep = 3;
|
||||
this.detailStatus = '已结束';
|
||||
} else {
|
||||
this.detailStep = 2;
|
||||
this.detailStatus = '处理中';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
transfer() {
|
||||
uni.showToast({
|
||||
title: '转派功能开发中',
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
complete() {
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
icon: 'success'
|
||||
});
|
||||
},
|
||||
|
||||
downloadFile() {
|
||||
uni.downloadFile({
|
||||
url: this.detail.attachment,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.openDocument({
|
||||
filePath: res.tempFilePath
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
background: #fff;
|
||||
}
|
||||
.top-line{
|
||||
width: 100vw;
|
||||
height: 3rpx;
|
||||
background: #ECECEC;
|
||||
}
|
||||
.repair-detail-progress-box {
|
||||
height: 107rpx;
|
||||
margin-bottom: 41rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.repair-detail-progress {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 5rpx;
|
||||
margin-left: 100rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.repair-detail-step {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.repair-detail-dot {
|
||||
width: 22rpx;
|
||||
height: 22rpx;
|
||||
border-radius: 50%;
|
||||
background: #BDBDBD;
|
||||
border: 2rpx solid #BDBDBD;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.repair-detail-dot.active {
|
||||
background: #2186FF;
|
||||
border-color: #2186FF;
|
||||
}
|
||||
|
||||
.repair-detail-dot.current {
|
||||
background: #EF8D00;
|
||||
border-color: #EF8D00;
|
||||
}
|
||||
|
||||
.repair-detail-line {
|
||||
flex: 1;
|
||||
height: 4rpx;
|
||||
background: #BDBDBD;
|
||||
margin: 0 2rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.repair-detail-line.active {
|
||||
background: #2186FF;
|
||||
}
|
||||
|
||||
.repair-detail-progress-labels {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.repair-detail-label {
|
||||
font-size: 22rpx;
|
||||
color: #888;
|
||||
text-align: center;
|
||||
flex: 1;
|
||||
position: relative;
|
||||
top: 8rpx;
|
||||
}
|
||||
|
||||
.detail-list {
|
||||
font-size: 28rpx;
|
||||
line-height: 2em;
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
|
||||
.detail-key{
|
||||
color: #595858;
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
margin-bottom: 30rpx;
|
||||
color: ##2F2F2F;
|
||||
}
|
||||
|
||||
.remark {
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.link {
|
||||
color: #007CFF;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin-top: 60rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 276rpx;
|
||||
height: 88rpx;
|
||||
padding: 20rpx;
|
||||
font-size: 30rpx;
|
||||
border-radius: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.primary {
|
||||
background-color: #1890ff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ghost {
|
||||
background-color: #fff;
|
||||
color: #1890ff;
|
||||
border: 2rpx solid #1890ff;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user