parent
df9fd2f09c
commit
7099fed766
6 changed files with 619 additions and 667 deletions
@ -1,640 +0,0 @@ |
||||
<template> |
||||
<view class="page-box"> |
||||
<view class="page-search-top"> |
||||
<betone-new-input v-model="searchInfo.requirementCode" :placeholder="dataTypes == 1 ? '搜索单号' : '搜索单号或单位名称'" |
||||
icon="search" style="margin-bottom: 32rpx" @changevalue="searchData()" /> |
||||
<u-tabs :list="tabList" :is-scroll="true" :current="current" @change="changeTab"></u-tabs> |
||||
</view> |
||||
<view class="order-box"> |
||||
<!-- @click="goPage(item, 'details')" --> |
||||
<view class="order-item" v-for="(item, index) in orderData" :key="index"> |
||||
<view class="item-top"> |
||||
<view class="item-left" v-if="dataTypes == 1"> |
||||
<text class="item-orderNo" v-if="item.status != -1">单号:{{ item.requirementCode }}</text> |
||||
<text class="item-time"> {{ item.fillingTime }}</text> |
||||
</view> |
||||
<view class="item-left" v-else> |
||||
<text class="item-orderNo">{{ item.reportUnit ? item.reportUnit : '单位' }}</text> |
||||
<text class="item-time"> 单号:{{ item.requirementCode }}</text> |
||||
</view> |
||||
<view class="item-right"> |
||||
<u-tag :text="statusName(item.status)" type="success" mode="dark" shape="circle" |
||||
:bg-color="tagColor[statusName(item.status)]" /> |
||||
</view> |
||||
</view> |
||||
<view class="item-con"> |
||||
<view class="con-left"> |
||||
<image src="@/static/images/pic-default.png" alt="" /> |
||||
</view> |
||||
<view class="con-right"> |
||||
<text class="con-title">提报类型:{{ item.faultType }}</text> |
||||
<view class="con-content"> |
||||
<text>{{ item.faultDescribe }}</text> |
||||
</view> |
||||
<view class="con-btn"> |
||||
<!-- 客户 --> |
||||
<u-button size="mini" plain style="margin-right:16rpx" |
||||
@click.stop="openWorkOrder(item)">查看</u-button> |
||||
<u-button size="mini" plain style="margin-right:16rpx" |
||||
@click="openModel(item, 'details')">下载</u-button> |
||||
<block v-if="dataTypes == 1"> |
||||
<!-- 工单详情 查看维修详情 --> |
||||
|
||||
|
||||
<u-button v-if="item.status == -1" size="mini" :plain="true" style="margin-right:16rpx" |
||||
:hair-line="true" type="primary" @click="subOrder(item)">提报</u-button> |
||||
<u-button size="mini" v-if="item.status == -1" :plain="true" style="margin-right:16rpx" |
||||
:hair-line="true" type="primary" @click="orderUpdate(item)">修改</u-button> |
||||
<u-button v-if="item.status == 4" size="mini" :plain="true" style="margin-right:16rpx" |
||||
:hair-line="true" type="primary" @click="orderConfirm(item)">确认方案</u-button> |
||||
|
||||
<u-button v-if="item.status == 5" size="mini" :plain="true" style="margin-right:16rpx" |
||||
:hair-line="true" type="primary" @click="goPageLocation(item)">查看位置</u-button> |
||||
<u-button v-if="item.status == 6" size="mini" :plain="true" style="margin-right:16rpx" |
||||
:hair-line="true" type="primary" @click="openEvaluate(item)">评价</u-button> |
||||
</block> |
||||
<!-- 客服 --> |
||||
<block v-if="dataTypes == 2"> |
||||
<!-- 查看的提报单 --> |
||||
|
||||
<u-button v-if="item.status == 0" size="mini" :plain="true" style="margin-right:16rpx" |
||||
@click.stop="sendOrders(item)" type="primary">接单</u-button> |
||||
<u-button v-if="item.status == 7" size="mini" :plain="true" style="margin-right:16rpx" |
||||
@click.stop="openModel(item, 'paymentInfo')" type="primary">确认付款</u-button> |
||||
<u-button v-if="item.status == 0" size="mini" plain type="primary" |
||||
style="margin-right:16rpx" @click="openModel(item, 'close')">关闭</u-button> |
||||
|
||||
</block> |
||||
|
||||
<!-- 维修负责人 --> |
||||
<block v-if="dataTypes == 3"> |
||||
<!-- 查看维修详情 --> |
||||
|
||||
<u-button v-if="item.status == 3" size="mini" :plain="true" style="margin-right:16rpx" |
||||
:hair-line="true" type="primary" @click="orderConfirm(item)">审批</u-button> |
||||
|
||||
</block> |
||||
<!-- 维修人员 --> |
||||
<block v-if="dataTypes == 4"> |
||||
<!-- 查看维修详情 --> |
||||
<u-button v-if="item.status == 1" size="mini" :plain="true" style="margin-right:16rpx" |
||||
type="primary" @click="orderConfirm(item)">确认</u-button> |
||||
<u-button v-if="item.status == 1" size="mini" :plain="true" style="margin-right:16rpx" |
||||
type="primary" @click="openModel(item, 'turn')">驳回</u-button> |
||||
<u-button v-if="item.status == 2" size="mini" :plain="true" style="margin-right:16rpx" |
||||
type="primary" @click="orderConfirm(item)">提交</u-button> |
||||
<u-button v-if="item.status == 5" size="mini" :plain="true" style="margin-right:16rpx" |
||||
type="primary" @click="openModel(item, 'repair')">维修完成</u-button> |
||||
</block> |
||||
|
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<u-loadmore margin-top="10" margin-bottom="40" :status="loadingState" /> |
||||
|
||||
|
||||
|
||||
<!-- 关闭 弹框 --> |
||||
<betone-modal :title="'关闭原因'" :confirmText="'确认'" v-model="cloneVisible" @cancel="cloneVisible = false" |
||||
@confirm="confirmCloseSub"> |
||||
<view class="modal-text"> |
||||
<u-input :border="true" v-model="closeReason" placeholder="请输入" style="margin-bottom: 32rpx" /> |
||||
</view> |
||||
</betone-modal> |
||||
|
||||
<!-- 维修人员驳回 --> |
||||
<betone-modal v-model="turnShow" :title="'驳回原因'" @confirm="turnFn" @cancel="turnShow = false"> |
||||
<view class="modal-text"> |
||||
<u-input :border="true" v-model="repaiRejectReason" placeholder="请输入" style="margin-bottom: 32rpx" /> |
||||
</view> |
||||
</betone-modal> |
||||
|
||||
<!-- 维修人员 确认 维修完成 --> |
||||
<betone-modal v-model="repairShow" :title="'提示'" @confirm="repairFn" @cancel="repairShow = false"> |
||||
<view class="modal-text"> |
||||
请确认维修是否已经完成? |
||||
</view> |
||||
</betone-modal> |
||||
|
||||
<!-- 客服确认付款 --> |
||||
<betone-modal v-model="paymentShow" :title="'提示'" @confirm="paymentFn" @cancel="paymentShow = false"> |
||||
<view class="modal-text"> |
||||
请确认付款是否已经完成? |
||||
</view> |
||||
</betone-modal> |
||||
<!-- 维修人员确认接单 --> |
||||
<betone-modal v-model="submitOrderShow" :title="'提示'" @confirm="submitOrderShowFn" |
||||
@cancel="submitOrderShow = false"> |
||||
<view class="modal-text"> |
||||
请确认是否进行接单? |
||||
</view> |
||||
</betone-modal> |
||||
|
||||
<betone-loading ref="BetLoading" /> |
||||
|
||||
<betone-modal v-model="detailsShow" :title="'下载内容'" @confirm="detailsShowFn" @cancel="detailsShow = false"> |
||||
<recordsdetails :data="rowInfo" :detailId="rowInfo.id" id="capture"></recordsdetails> |
||||
</betone-modal> |
||||
<sp-html2canvas-render domId="capture" ref="renderRef" @renderOver="renderOver" pdfFileName="这是一个pdf文件" |
||||
@beforeSavePDF="beforeSavePDF" @successSavePDF="successSavePDF"></sp-html2canvas-render> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import recordsdetails from '@/pages/submission/components/details.vue' |
||||
import { tabList, tabListColor } from '@/config/status.js' |
||||
export default { |
||||
props: { |
||||
// tabList: { |
||||
// type: Array, |
||||
// default: [] |
||||
// }, |
||||
type: { |
||||
type: String, |
||||
default: '' |
||||
} |
||||
}, |
||||
components: { |
||||
recordsdetails |
||||
}, |
||||
data() { |
||||
return { |
||||
searchInfo: { |
||||
requirementCode: "", |
||||
statusSearch: '',//状态 |
||||
reportUnit: '',//提报单位 |
||||
}, |
||||
|
||||
current: 0, |
||||
loadingState: "loadmore", |
||||
isNomore: false, |
||||
noDataFlag: false, |
||||
|
||||
orderData: [], |
||||
page: { |
||||
currentPage: 1, |
||||
pageSize: 10, |
||||
}, |
||||
|
||||
sendOrdersShow: false,//派单弹框 |
||||
sendOrdersList: [], |
||||
|
||||
cloneVisible: false,//关闭弹框 |
||||
closeReason: '',//关闭原因 |
||||
rowInfo: {},//需要关闭的订单信息 |
||||
|
||||
turnShow: false,//驳回弹框 |
||||
repaiRejectReason: '',//驳回弹框 |
||||
|
||||
repairShow: false,//维修人员 去人维修完成弹框 |
||||
|
||||
paymentShow: false,//客服确付款 |
||||
|
||||
submitOrderShow: false,//维修人员确认接单 |
||||
|
||||
detailsShow: false,//打印详情页面 |
||||
|
||||
tabList: [],//tab状态 |
||||
}; |
||||
}, |
||||
computed: { |
||||
noData() { |
||||
return this.orderData && this.orderData.length == 0; |
||||
}, |
||||
dataTypes() { |
||||
this.tabList = tabList[this.$store.state.dataType] |
||||
return this.$store.state.dataType |
||||
}, |
||||
tagColor() { |
||||
return tabListColor |
||||
}, |
||||
}, |
||||
|
||||
mounted() { |
||||
this.$nextTick(() => { |
||||
this.getRecordsList() |
||||
// 触底触发 |
||||
uni.$on('onReachBottom', () => { |
||||
if (this.isNomore) { |
||||
return; |
||||
} |
||||
this.page.currentPage++; |
||||
this.getRecordsList(); |
||||
}) |
||||
// 下拉刷新 |
||||
uni.$on('onPullDownRefresh', () => { |
||||
this.isNomore = false |
||||
this.page.currentPage = 1; |
||||
this.getRecordsList(); |
||||
uni.stopPullDownRefresh(); |
||||
}); |
||||
}); |
||||
}, |
||||
methods: { |
||||
// 获取列表 |
||||
getRecordsList() { |
||||
this.BetLoading.show(); |
||||
this.loadingState = "loading"; |
||||
let query = { |
||||
current: this.page.currentPage, //页数 |
||||
size: this.page.pageSize, //条数 |
||||
dataType: this.dataTypes,//数据权限 |
||||
...this.searchInfo |
||||
} |
||||
this.$u.api.getWorkOrderRecords(query).then(res => { |
||||
if (res.code == 200) { |
||||
|
||||
var totalPage = res.data.total; |
||||
var newOrders = res.data.records; |
||||
if (this.page.currentPage == 1) { |
||||
this.orderData = []; |
||||
} |
||||
|
||||
this.orderData = [...this.orderData, ...(res.data.records || [])]; |
||||
if (newOrders.length == 0) { |
||||
this.loadingState = "nomore"; |
||||
this.isNomore = true; |
||||
} |
||||
if (totalPage == this.orderData.length) { |
||||
this.loadingState = "nomore"; |
||||
this.isNomore = true; |
||||
} |
||||
this.BetLoading.hide(); |
||||
} |
||||
}).catch(err => { |
||||
|
||||
}) |
||||
}, |
||||
// 搜索 单号 |
||||
searchData() { |
||||
if (this.dataTypes != 1) { |
||||
// 非管理员和客户 不传提报单位 |
||||
this.searchInfo.reportUnit = this.searchInfo.requirementCode |
||||
} else { |
||||
this.searchInfo.reportUnit = '' |
||||
} |
||||
this.isNomore = false |
||||
this.page.currentPage = 1; |
||||
this.getRecordsList() |
||||
}, |
||||
// tab切换 |
||||
changeTab(index) { |
||||
this.current = index; |
||||
this.searchInfo.statusSearch = this.tabList[index].key == '9999' ? '' : this.tabList[index].key |
||||
this.isNomore = false |
||||
this.page.currentPage = 1; |
||||
this.getRecordsList() |
||||
}, |
||||
// 获取状态信息 |
||||
statusName(item) { |
||||
if (this.tabList.length > 0) { |
||||
let newArr = this.tabList.filter(i => { |
||||
|
||||
let sta = i.key.split(',') |
||||
|
||||
return sta.includes(item + '') |
||||
}) |
||||
|
||||
return newArr[0].name |
||||
} |
||||
|
||||
}, |
||||
|
||||
// 提报按钮 |
||||
subOrder(row) { |
||||
let query_ = [row] |
||||
this.$u.api.workOrderSave(query_).then(res => { |
||||
this.BetLoading.hide(); |
||||
if (res.code == 200) { |
||||
this.page.currentPage = 1; |
||||
this.getRecordsList() |
||||
} |
||||
}).catch(err => { |
||||
this.BetLoading.hide(); |
||||
}) |
||||
}, |
||||
|
||||
// 派单弹框 |
||||
sendOrders(item) { |
||||
let param = { |
||||
id: item.id |
||||
} |
||||
uni.navigateTo({ |
||||
url: `/pages/submission/sendOrders${this.$u.queryParams(param)}`, |
||||
}); |
||||
}, |
||||
|
||||
// 、维修人员、维修主管、客服 操作流程页面 |
||||
orderConfirm(row) { |
||||
let param = { |
||||
id: row.id |
||||
} |
||||
uni.navigateTo({ |
||||
url: `/pages/submission/sendOrders${this.$u.queryParams(param)}`, |
||||
}); |
||||
}, |
||||
// 获取维修人员列表 |
||||
getRepairPersons() { |
||||
this.$u.api.getRepairPersons().then(res => { |
||||
if (res.code == 200) { |
||||
let data_ = res.data |
||||
data_.forEach(i => { |
||||
this.sendOrdersList.push({ ...i, label: i.name }) |
||||
}) |
||||
|
||||
} |
||||
|
||||
}) |
||||
}, |
||||
// 客服关闭 |
||||
openModel(item, type) { |
||||
if (type == 'close') { |
||||
this.cloneVisible = true |
||||
} |
||||
if (type == 'turn') { |
||||
this.turnShow = true |
||||
} |
||||
if (type == 'repair') { |
||||
this.repairShow = true |
||||
} |
||||
if (type == 'paymentInfo') { |
||||
this.paymentShow = true |
||||
} |
||||
if (type == 'submitOrder') { |
||||
this.submitOrderShow = true |
||||
} |
||||
if (type == 'details') { |
||||
this.detailsShow = true |
||||
} |
||||
|
||||
this.rowInfo = item |
||||
}, |
||||
confirmCloseSub() { |
||||
if (this.closeReason == '') { |
||||
uni.showToast({ title: "请填写关闭原因", icon: "none" }); |
||||
return false; |
||||
} |
||||
let query = { |
||||
id: this.rowInfo.id, |
||||
closeReason: this.closeReason, |
||||
} |
||||
this.BetLoading.show(); |
||||
|
||||
this.$u.api.cloneOrder(query).then(res => { |
||||
this.cloneVisible = false |
||||
this.BetLoading.hide(); |
||||
if (res.code == 200) { |
||||
uni.showToast({ title: "关闭成功", icon: "none" }); |
||||
this.getRecordsList() |
||||
} |
||||
}) |
||||
}, |
||||
// 查看需求工单 |
||||
openWorkOrder(row) { |
||||
let param = { |
||||
id: row.id, |
||||
type: 'breakdownView' |
||||
} |
||||
uni.navigateTo({ |
||||
url: `/pages/submission/recordsdetails${this.$u.queryParams(param)}`, |
||||
}); |
||||
}, |
||||
// 客服 修改 |
||||
orderUpdate(item) { |
||||
let param = { |
||||
id: item.id, |
||||
type: 'breakdownUpdate' |
||||
} |
||||
uni.navigateTo({ |
||||
url: `/pages/submission/submissionDetails${this.$u.queryParams(param)}`, |
||||
}); |
||||
}, |
||||
// 维修人员驳回 |
||||
turnFn() { |
||||
if (this.repaiRejectReason == '') { |
||||
uni.showToast({ title: "请输入驳回原因", icon: "none" }); |
||||
return false |
||||
} |
||||
let query = { |
||||
id: this.rowInfo.id, |
||||
repaiRejectReason: this.repaiRejectReason, |
||||
} |
||||
this.$u.api.repairReject(query).then(res => { |
||||
if (res.code == 200) { |
||||
this.turnShow = false |
||||
uni.showToast({ title: "驳回成功", icon: "none" }); |
||||
this.getRecordsList() |
||||
} |
||||
}) |
||||
}, |
||||
// 维修人员确认维修是否完成 |
||||
repairFn() { |
||||
let query = { |
||||
id: this.rowInfo.id, |
||||
} |
||||
this.$u.api.servicemanRepairSubmit(query).then(res => { |
||||
if (res.code == 200) { |
||||
this.repairShow = false |
||||
uni.showToast({ title: "维修完成", icon: "none" }); |
||||
this.getRecordsList() |
||||
} |
||||
}) |
||||
}, |
||||
// 跳转评价 |
||||
openEvaluate(item) { |
||||
let param = { |
||||
id: item.id, |
||||
} |
||||
uni.navigateTo({ |
||||
url: `/pages/submission/evaluate${this.$u.queryParams(param)}`, |
||||
}); |
||||
}, |
||||
// 客服确认是否已经付款 |
||||
paymentFn() { |
||||
let query = { |
||||
id: this.rowInfo.id, |
||||
} |
||||
this.BetLoading.show(); |
||||
|
||||
this.$u.api.cloneOrder(query).then(res => { |
||||
this.paymentShow = false |
||||
this.BetLoading.hide(); |
||||
if (res.code == 200) { |
||||
uni.showToast({ title: "确认成功", icon: "none" }); |
||||
this.submitOrderShow = false |
||||
this.getRecordsList() |
||||
} |
||||
}) |
||||
}, |
||||
// 维修人员确认接单 |
||||
submitOrderShowFn() { |
||||
let query_ = { |
||||
id: this.rowInfo.id |
||||
} |
||||
this.$u.api.servicemanReceive(query_).then(res => { |
||||
if (res.code == 200) { |
||||
uni.showToast({ title: "确认成功", icon: "none" }); |
||||
this.getRecordsList() |
||||
} |
||||
}) |
||||
}, |
||||
goPageLocation(item) { |
||||
let param = { |
||||
userid: item.repairPerson, |
||||
} |
||||
//查看位置 |
||||
uni.navigateTo({ |
||||
url: `/pages/order/location${this.$u.queryParams(param)}`, |
||||
}) |
||||
|
||||
}, |
||||
detailsShowFn() { |
||||
// 调用组件实例中h2cRenderDom方法 |
||||
this.$refs.renderRef.h2pRenderDom(); |
||||
}, |
||||
renderOver(e) { |
||||
// e为导出截图的base64格式字符串 |
||||
// this.imageSrc = e |
||||
console.log("==== renderOver :", e); |
||||
// 将canvas转换为图片 |
||||
}, |
||||
beforeSavePDF(e) { |
||||
// e为导出的pdf(base64) |
||||
console.log("==== beforeSavePDF :", e); |
||||
}, |
||||
successSavePDF(path) { |
||||
// e为打开的pdf(临时路径) |
||||
console.log("==== successSavePDF :", path); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.page-box { |
||||
padding: 0; |
||||
|
||||
.page-search-top { |
||||
background-color: #fff; |
||||
padding: 0 40rpx 0; |
||||
} |
||||
|
||||
.order-box { |
||||
margin-top: 20rpx; |
||||
|
||||
.order-item { |
||||
height: 414rpx; |
||||
margin: 0 24rpx 20rpx; |
||||
border-radius: 20rpx; |
||||
background: #fff; |
||||
display: flex; |
||||
flex-direction: column; |
||||
|
||||
.item-top { |
||||
height: 114rpx; |
||||
border-bottom: 1px solid rgba(239, 239, 239, 1); |
||||
display: flex; |
||||
flex-direction: row; |
||||
width: 100%; |
||||
|
||||
.item-left { |
||||
flex: 1; |
||||
|
||||
text { |
||||
display: block; |
||||
} |
||||
|
||||
.item-orderNo { |
||||
color: rgba(51, 51, 51, 1); |
||||
font-size: 28rpx; |
||||
padding: 12rpx 0 0 26rpx; |
||||
} |
||||
|
||||
.item-time { |
||||
color: rgba(190, 190, 190, 1); |
||||
font-size: 24rpx; |
||||
padding: 12rpx 0 0 26rpx; |
||||
} |
||||
} |
||||
|
||||
.item-right { |
||||
max-width: 162rpx; |
||||
height: 48rpx; |
||||
margin: 36rpx 24rpx 0 0; |
||||
} |
||||
} |
||||
|
||||
.item-con { |
||||
flex: 1; |
||||
display: flex; |
||||
flex-direction: row; |
||||
|
||||
.con-left { |
||||
width: 150rpx; |
||||
height: 150rpx; |
||||
margin: 24rpx 28rpx 0 28rpx; |
||||
|
||||
image { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
} |
||||
|
||||
.con-right { |
||||
flex: 1; |
||||
margin-right: 24rpx; |
||||
display: flex; |
||||
flex-direction: column; |
||||
|
||||
text { |
||||
display: block; |
||||
} |
||||
|
||||
.con-title { |
||||
margin-top: 12rpx; |
||||
line-height: 60rpx; |
||||
color: rgba(0, 0, 0, 1); |
||||
font-size: 28rpx; |
||||
} |
||||
|
||||
.con-content { |
||||
|
||||
color: rgba(108, 108, 108, 1); |
||||
font-size: 24rpx; |
||||
// line-height: 36rpx; |
||||
margin-top: 14rpx; |
||||
flex: 1; |
||||
|
||||
text { |
||||
display: -webkit-box; |
||||
-webkit-box-orient: vertical; |
||||
-webkit-line-clamp: 2; |
||||
overflow: hidden; |
||||
text-overflow: ellipsis; |
||||
line-height: 1.5em; |
||||
/* 这个值根据你的需求调整,这里假设为1.5倍行高 */ |
||||
max-height: 3em; |
||||
/* 3行的高度 */ |
||||
width: 100%; |
||||
/* 根据需要设置宽度 */ |
||||
word-wrap: break-word; |
||||
/* 允许在单词内换行 */ |
||||
word-break: break-all; |
||||
/* 允许在任意字符处换行 */ |
||||
} |
||||
} |
||||
|
||||
.con-btn { |
||||
margin-top: 56rpx; |
||||
margin-bottom: 32rpx; |
||||
display: inline-block; |
||||
text-align: right; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
</style> |
||||
Loading…
Reference in new issue