|
|
|
|
@ -27,15 +27,24 @@
|
|
|
|
|
<view class="ding"></view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="end">
|
|
|
|
|
<view class="msg_k">
|
|
|
|
|
<view v-if="workOrderstatus.status==1 || workOrderstatus.status==2 " >
|
|
|
|
|
<switch :checked="switchchecked" color="#ff7c2e" @change="CloseWorkOrderChange" style="transform:scale(0.7); margin-bottom: 10rpx;"/><span style="color:#808080; font-size: 22rpx;">关闭此工单</span>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="msg_k">
|
|
|
|
|
<view class="msg_k_left">
|
|
|
|
|
<uni-easyinput :disabled="workOrderstatus.status!=3?false:true" type="textarea" v-model="msgContent" placeholder="请输入留言信息" />
|
|
|
|
|
<uni-easyinput :disabled="workOrderstatus.status!=3?false:true" type="textarea" v-model="msgContent" placeholder="请输入留言信息" />
|
|
|
|
|
</view>
|
|
|
|
|
<view class="msg_k_right"><button type="primary" size="mini" plain="true" @click="send">发送</button></view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view>
|
|
|
|
|
<!-- 提示窗示例 -->
|
|
|
|
|
<uni-popup ref="alertDialog" type="dialog">
|
|
|
|
|
<uni-popup-dialog cancelText="取消" confirmText="确定" title="提示" content="确定关闭此工单吗?" @confirm="dialogConfirm"
|
|
|
|
|
@close="dialogClose"></uni-popup-dialog>
|
|
|
|
|
</uni-popup>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -47,13 +56,55 @@
|
|
|
|
|
import {
|
|
|
|
|
ChatInsertMsgAction,
|
|
|
|
|
ChatGetSelfMsgListAction,
|
|
|
|
|
$response
|
|
|
|
|
ChatChangeWorkOrderAction,
|
|
|
|
|
$response
|
|
|
|
|
} from '@/api'
|
|
|
|
|
let workOrderId=ref('')
|
|
|
|
|
let switchchecked=ref(true);
|
|
|
|
|
let alertDialog=ref(null)
|
|
|
|
|
const dialogClose=()=>{
|
|
|
|
|
|
|
|
|
|
switchchecked.value=true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//关闭工单
|
|
|
|
|
const CloseWorkOrderChange=(e)=>{
|
|
|
|
|
if(e.detail.value==false){
|
|
|
|
|
alertDialog.value.open()
|
|
|
|
|
switchchecked.value=false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let workOrderId=ref('')
|
|
|
|
|
onLoad((option)=>{
|
|
|
|
|
workOrderId.value=option.workorder
|
|
|
|
|
})
|
|
|
|
|
let msgContent = ref("")
|
|
|
|
|
})
|
|
|
|
|
//更改工单状态
|
|
|
|
|
const dialogConfirm=async ()=>{
|
|
|
|
|
let data={
|
|
|
|
|
WorkOrder:workOrderId.value
|
|
|
|
|
}
|
|
|
|
|
const response = await ChatChangeWorkOrderAction(data)
|
|
|
|
|
$response(response, () => {
|
|
|
|
|
console.log(response)
|
|
|
|
|
if(response.data.status){
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: "工单成功关闭",
|
|
|
|
|
duration: 2000,
|
|
|
|
|
icon:'none'
|
|
|
|
|
});
|
|
|
|
|
getList()
|
|
|
|
|
}else{
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: response.data.msg,
|
|
|
|
|
duration: 2000,
|
|
|
|
|
icon:'none'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let msgContent = ref("")
|
|
|
|
|
let chatList=ref([]) //聊天记录
|
|
|
|
|
let workOrderstatus=ref('')//工单状态
|
|
|
|
|
const send= async ()=>{
|
|
|
|
|
@ -92,7 +143,7 @@
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
$response(response, () => {
|
|
|
|
|
console.log(response)
|
|
|
|
|
chatList.value=response.data.list.reverse()
|
|
|
|
|
chatList.value=response.data.list.reverse()
|
|
|
|
|
workOrderstatus.value=response.data.workorder_status
|
|
|
|
|
toBottom()
|
|
|
|
|
})
|
|
|
|
|
@ -102,10 +153,10 @@
|
|
|
|
|
const toBottom=()=>{
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
const container = document.getElementById('container'); // 替换为你的容器元素ID
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
container.scrollIntoView(false);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
onMounted(()=>{
|
|
|
|
|
getList()
|
|
|
|
|
@ -115,12 +166,12 @@
|
|
|
|
|
<style scoped>
|
|
|
|
|
.chatk{
|
|
|
|
|
height: 100vh;
|
|
|
|
|
background-color: #f4f4f4;
|
|
|
|
|
background-color: #f4f4f4;
|
|
|
|
|
}
|
|
|
|
|
.msg_list{
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.end{
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
@ -131,7 +182,7 @@
|
|
|
|
|
}
|
|
|
|
|
.msg_k {
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.msg_k_left {
|
|
|
|
|
@ -142,7 +193,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.msg_k_right {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
margin-left: 20rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
@ -190,14 +241,14 @@
|
|
|
|
|
}
|
|
|
|
|
.tishi{
|
|
|
|
|
text-align: center;
|
|
|
|
|
font-size: 20rpx;
|
|
|
|
|
font-size: 20rpx;
|
|
|
|
|
color: #ccc;
|
|
|
|
|
margin-bottom: 10rpx;
|
|
|
|
|
}
|
|
|
|
|
.user_img{
|
|
|
|
|
width: 80rpx;
|
|
|
|
|
height: 80rpx;
|
|
|
|
|
background-color: #eeeeee;
|
|
|
|
|
width: 80rpx;
|
|
|
|
|
height: 80rpx;
|
|
|
|
|
background-color: #eeeeee;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
}
|
|
|
|
|
.username{
|
|
|
|
|
@ -205,4 +256,4 @@
|
|
|
|
|
color: #ccc;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</style>
|
|
|
|
|
|