工单 预警

This commit is contained in:
liyuanchao 2025-08-22 17:27:27 +08:00
parent 2833f7d28b
commit 58cb07d33f
7 changed files with 295 additions and 263 deletions

View File

@ -30,5 +30,5 @@ const config = {
// config.baseUrl = 'http://183.230.235.66:11010/api'; // config.baseUrl = 'http://183.230.235.66:11010/api';
config.baseUrl = 'http://818aa9b.r28.cpolar.top'; config.baseUrl = 'http://9143b75.r28.cpolar.top';
export default config; export default config;

View File

@ -35,12 +35,14 @@ const install = (Vue, vm) => {
addOrder2:(params = {})=>vm.$u.post(config.adminPath+'/property/mobile/workOrders',params), addOrder2:(params = {})=>vm.$u.post(config.adminPath+'/property/mobile/workOrders',params),
//修改订单 //修改订单
updateOrder:(params = {})=>vm.$u.put(config.adminPath+'/property/workOrders',params), updateOrder:(params = {})=>vm.$u.put(config.adminPath+'/property/workOrders',params),
updateOrder2:(params = {})=>vm.$u.put(config.adminPath+'/property/mobile/workOrders',params),
//获取处理人 //获取处理人
getHandler:(params = {})=>vm.$u.get(config.adminPath+'/property/enum-fetcher/enum-values/getServiceWorkOrdersHandler',params), getHandler:(params = {})=>vm.$u.get(config.adminPath+'/property/enum-fetcher/enum-values/getServiceWorkOrdersHandler',params),
getHandler2:(params = {})=>vm.$u.get(config.adminPath+'/property/enum-fetcher/enum-values/getAccount',params), getHandler2:(params = {})=>vm.$u.get(config.adminPath+'/property/enum-fetcher/enum-values/getAccount',params),
getHandler3:(params = {}, type) => vm.$u.get(config.adminPath+`/property/enum-fetcher/enum-getShiftScheduler/${type}`,params),
//会议列表 //会议列表
getMeetings:(params = {})=>vm.$u.get(config.adminPath+'/property/roomBooking/list',params), getMeetings:(params = {})=>vm.$u.get(config.adminPath+'/property/roomBooking/list',params),
@ -57,6 +59,7 @@ const install = (Vue, vm) => {
warnsProcess:(params = {})=>vm.$u.post(config.adminPath+'/sis/alarmEvents/complete',params), warnsProcess:(params = {})=>vm.$u.post(config.adminPath+'/sis/alarmEvents/complete',params),
getWarnDetail:(params = {}, id) => vm.$u.get(config.adminPath+`/sis/alarmEvents/${id}`,params), getWarnDetail:(params = {}, id) => vm.$u.get(config.adminPath+`/sis/alarmEvents/${id}`,params),
getWarnEventInfo:(params = {}, alarmId) => vm.$u.get(config.adminPath+`/sis/alarmEventAttachments/query/${alarmId}`,params),
//巡检任务列表 //巡检任务列表
getInspection:(params = {})=>vm.$u.get(config.adminPath+'/property/item/list',params), getInspection:(params = {})=>vm.$u.get(config.adminPath+'/property/item/list',params),

View File

@ -19,7 +19,7 @@
<!-- 列表 --> <!-- 列表 -->
<scroll-view class="user-list" scroll-y> <scroll-view class="user-list" scroll-y>
<view v-for="item in filteredList" :key="item.id" class="user-item" @click="selectUser(item)"> <view v-for="item in filteredList" :key="item.value" class="user-item" @click="selectUser(item)">
<view class="radio" :class="{ checked: isSelected(item) }"></view> <view class="radio" :class="{ checked: isSelected(item) }"></view>
<text>{{ item.name }}{{ item.department }}</text> <text>{{ item.name }}{{ item.department }}</text>
</view> </view>
@ -64,7 +64,7 @@
computed: { computed: {
filteredList() { filteredList() {
if (!this.keyword) return this.list; if (!this.keyword) return this.list;
return this.list.filter(item => item.name.includes(this.keyword) || item.id.includes(this.keyword)); return this.list.filter(item => item.name.includes(this.keyword) || item.value.includes(this.keyword));
} }
}, },
methods: { methods: {
@ -74,7 +74,7 @@
selectUser(item) { selectUser(item) {
if (this.multiple) { if (this.multiple) {
if (this.isSelected(item)) { if (this.isSelected(item)) {
this.selected = this.selected.filter(i => i.id !== item.id); this.selected = this.selected.filter(i => i.value !== item.value);
} else { } else {
this.selected.push(item); this.selected.push(item);
} }
@ -83,7 +83,7 @@
} }
}, },
isSelected(item) { isSelected(item) {
return this.selected.some(i => i.id === item.id); return this.selected.some(i => i.value === item.value);
}, },
confirm() { confirm() {
this.$emit('confirm', this.selected); this.$emit('confirm', this.selected);

View File

@ -14,7 +14,7 @@
</view> </view>
<view class="input-row"> <view class="input-row">
<image class="iconfont2" src="/static/ic_login_code.png" /> <image class="iconfont2" src="/static/ic_login_code.png" />
<input class="login-input" type="text" placeholder="请输入验证码" /> <input class="login-input" type="text" placeholder="请输入验证码" v-model="password"/>
<button class="code-btn">获取校验码</button> <button class="code-btn">获取校验码</button>
</view> </view>
<view class="protocol-row"> <view class="protocol-row">

View File

@ -136,11 +136,11 @@ export default {
} }
}, },
created() { created() {
this.loadDetail(); this.loadEevetInfo();
}, },
methods: { methods: {
async loadDetail() { async loadEevetInfo() {
let res = await this.$u.api.getWarnDetail({}, this.warnInfo.id); let res = await this.$u.api.getWarnEventInfo({}, this.warnInfo.id);
if (res.code == "200") { if (res.code == "200") {
} }

View File

@ -4,7 +4,7 @@
<view class="filter"> <view class="filter">
<!-- 工单类型按钮 --> <!-- 工单类型按钮 -->
<view class="filter-btn" @click.stop="togglePopup('type')"> <view class="filter-btn" @click.stop="togglePopup('type')">
{{ !selectedFilters.type || selectedFilters.type.orderTypeName === '全部' ? '工单类型' : selectedFilters.type.orderTypeName }} {{ (!selectedFilters.type || selectedFilters.type.orderTypeName === '全部') ? '工单类型' : (selectedFilters.type.orderTypeName.length > 5 ? selectedFilters.type.orderTypeName.substring(0, 5) + '...' : selectedFilters.type.orderTypeName) }}
<image class="filter-img" src="/static/ic_down_arrow_g.png" /> <image class="filter-img" src="/static/ic_down_arrow_g.png" />
<view v-if="activePopup === 'type'" class="dropdown"> <view v-if="activePopup === 'type'" class="dropdown">
<view class="dropdown-triangle"></view> <view class="dropdown-triangle"></view>
@ -19,7 +19,7 @@
<!-- 工单状态按钮 --> <!-- 工单状态按钮 -->
<view v-if="activeTab == 1" class="filter-btn" @click.stop="togglePopup('status')"> <view v-if="activeTab == 1" class="filter-btn" @click.stop="togglePopup('status')">
{{ !selectedFilters.status || selectedFilters.status.name === '全部' ? '工单状态' : selectedFilters.status.name }} {{ (!selectedFilters.status || selectedFilters.status.name === '全部') ? '工单状态' : (selectedFilters.status.name.length > 5 ? selectedFilters.status.name.substring(0, 5) + '...' : selectedFilters.status.name) }}
<image class="filter-img" src="/static/ic_down_arrow_g.png" /> <image class="filter-img" src="/static/ic_down_arrow_g.png" />
<view v-if="activePopup === 'status'" class="dropdown"> <view v-if="activePopup === 'status'" class="dropdown">
<view class="dropdown-triangle"></view> <view class="dropdown-triangle"></view>
@ -33,8 +33,8 @@
</view> </view>
<!-- 处理人按钮 --> <!-- 处理人按钮 -->
<view class="filter-btn" @click.stop="togglePopup('handler')"> <view v-if="isManager" class="filter-btn" @click.stop="togglePopup('handler')">
{{ !selectedFilters.handler || selectedFilters.handler.name === '全部' ? '处理人' : selectedFilters.handler.name }} {{ (!selectedFilters.handler || selectedFilters.handler.name === '全部') ? '处理人' : (selectedFilters.handler.name.length > 5 ? selectedFilters.handler.name.substring(0, 5) + '...' : selectedFilters.handler.name) }}
<image class="filter-img" src="/static/ic_down_arrow_g.png" /> <image class="filter-img" src="/static/ic_down_arrow_g.png" />
<view v-if="activePopup === 'handler'" class="dropdown"> <view v-if="activePopup === 'handler'" class="dropdown">
<view class="dropdown-triangle"></view> <view class="dropdown-triangle"></view>
@ -102,6 +102,7 @@
export default { export default {
data() { data() {
return { return {
tabs: ["待办", "全部"], tabs: ["待办", "全部"],
activeTab: 0, activeTab: 0,
// tab // tab
@ -123,6 +124,7 @@ export default {
typeList: [{ orderTypeName: '全部' }], typeList: [{ orderTypeName: '全部' }],
statusList: [], statusList: [],
handlerList: [{ name: "全部" }], handlerList: [{ name: "全部" }],
isManager: false,
}; };
}, },
computed: { computed: {
@ -136,10 +138,17 @@ export default {
created() { created() {
this.loadFilterData() this.loadFilterData()
this.onRefresh(); this.onRefresh();
this.isManager = this.vuex_user.roles[0].roleId == 1
},
onShow() {
uni.$once('refreshData', () => {
this.onRefresh()
});
}, },
methods: { methods: {
async changeTab(idx) { async changeTab(idx) {
this.activeTab = idx; this.activeTab = idx;
console.log('t1',"11111111")
if (!this.tabLoaded[idx]) { if (!this.tabLoaded[idx]) {
this.isRefreshing = true; this.isRefreshing = true;
await this.onRefresh(); await this.onRefresh();

View File

@ -38,11 +38,12 @@
</view> </view>
<!-- 底部操作按钮 --> <!-- 底部操作按钮 -->
<view v-if="((!this.isManager&&this.detailStep != 0) || (this.isManager&&this.detailStep == 0))&&this.detailStep!=3" class="btn-group"> <view
v-if="((!this.isManager&&this.detailStep != 0) || (this.isManager&&this.detailStep == 0))&&this.detailStep!=3"
class="btn-group">
<button class="btn ghost" <button class="btn ghost"
@click="transfer">{{this.isManager ? '指派':this.detailStep == 1 ? '开始':'完成'}}</button> @click="transfer(1)">{{this.isManager ? '指派':this.detailStep == 2 ? '完成':'开始'}}</button>
<button v-if="this.detailStep == 1" class="btn primary" <button v-if="this.detailStep == 1" class="btn primary" @click="transfer(2)">转派</button>
@click="complete">转派</button>
</view> </view>
<SelectUser :visible.sync="showSelect" :list="users" :multiple="false" @confirm="onConfirm" /> <SelectUser :visible.sync="showSelect" :list="users" :multiple="false" @confirm="onConfirm" />
@ -53,7 +54,7 @@
import SelectUser from '@/components/SelectUser.vue' import SelectUser from '@/components/SelectUser.vue'
export default { export default {
components: { components: {
SelectUser SelectUser
}, },
data() { data() {
return { return {
@ -64,22 +65,7 @@
detail: {}, detail: {},
isManager: false, isManager: false,
showSelect: false, showSelect: false,
users: [{ users: []
id: '1',
name: '秦玉兰',
department: '物业修维部'
},
{
id: '2',
name: '秦桂花',
department: '物业修维部'
},
{
id: '3',
name: '李小明',
department: '物业修维部'
}
]
}; };
}, },
onLoad(options) { onLoad(options) {
@ -87,28 +73,38 @@
if (options.item) { if (options.item) {
const item = JSON.parse(decodeURIComponent(options.item)); const item = JSON.parse(decodeURIComponent(options.item));
this.detail = item; this.detail = item;
this.detail.orderImgUrl =
"https://picsum.photos/80/80?random=3,https://picsum.photos/80/80?random=3,https://picsum.photos/80/80?random=3";
// 使item // 使item
// //
if (item.status == 0) { this.getStepInfo()
}
if ((this.isManager && this.detailStep == 0) || (!this.isManager && this.detailStep == 1)) {
this.getHandler()
}
},
methods: {
goBack() {
uni.navigateBack();
},
async getHandler() {
let handlers = await this.$u.api.getHandler3({}, this.detail.type);
if (handlers.code === 200) {
this.users = [...this.users, ...handlers.data];
}
},
getStepInfo(){
if (this.detail.status == 0) {
this.detailStep = 0; this.detailStep = 0;
this.detailStatus = '创建工单'; this.detailStatus = '创建工单';
} else if (item.status == 4) { } else if (this.detail.status == 4) {
this.detailStep = 3; this.detailStep = 3;
this.detailStatus = '已结束'; this.detailStatus = '已结束';
} else if (item.status == 3) { } else if (this.detail.status == 3) {
this.detailStep = 2; this.detailStep = 2;
this.detailStatus = '处理中'; this.detailStatus = '处理中';
} else { } else {
this.detailStep = 1; this.detailStep = 1;
this.detailStatus = '已接单'; this.detailStatus = '已接单';
} }
}
},
methods: {
goBack() {
uni.navigateBack();
}, },
previewImage(urls, index) { previewImage(urls, index) {
// 使uView // 使uView
@ -117,18 +113,42 @@
current: index current: index
}); });
}, },
onConfirm(selected) { async onConfirm(selected) {
let params = this.detail
params.handler = selected[0].value
params.status = 1
let res = await this.$u.api.updateOrder2(params);
if (res.code == '200') {
//
uni.$emit('refreshData', '');
this.detail.handler = selected.value
this.detail.status = 1
this.getStepInfo()
}
}, },
transfer() { async submit() {
this.showSelect = true let params = this.detail
if(this.detail.status == 1||this.detail.status == 2){
params.status = 3
}else {
params.status = 4
}
let res = await this.$u.api.updateOrder2(params);
if (res.code == '200') {
//
uni.$emit('refreshData', '');
this.detail.status = params.status
console.log("t1", params.status)
this.getStepInfo()
}
}, },
complete() { transfer(type) {
uni.showToast({ if (this.isManager || type == 2) {
title: '操作成功', this.showSelect = true
icon: 'success' } else {
}); this.submit()
}
}, },
} }
}; };
</script> </script>