更新
This commit is contained in:
parent
e590e6cc7f
commit
bca86a4119
@ -92,6 +92,7 @@
|
||||
<!--内返派工-->
|
||||
内返派工
|
||||
</view>
|
||||
<!-- v-if="order.ticketsStatus == '05' && order.ticketsWorkStatus=='01' && roleCanJd" class="btn qc"> -->
|
||||
<view @click="openFile(order.id)"
|
||||
v-if="order.ticketsStatus == '05' && order.ticketsWorkStatus=='01' && roleCanJd" class="btn qc">
|
||||
接单
|
||||
@ -186,7 +187,8 @@
|
||||
//服务顾问可以告知取车
|
||||
this.roleCanQc = true
|
||||
}
|
||||
if (this.userInfo.roleCodes.includes("repair_staff") && this.order.nowRepairId == this.userInfo.id) {
|
||||
if (this.userInfo.roleCodes.includes("repair_staff") && this.order.nowRepairId && this.order.nowRepairId
|
||||
.split(',').includes(this.userInfo.id.toString())) {
|
||||
//维修工角色,并且指派处理的人就是当前用户可以接单
|
||||
this.roleCanJd = true
|
||||
}
|
||||
|
||||
@ -1,488 +1,510 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<VNavigationBar background-color="#fff" title="选择人员" title-color="#333"></VNavigationBar>
|
||||
<view class="body">
|
||||
<!-- <div class="searchBox">-->
|
||||
<!-- <div class="inputBox">-->
|
||||
<!-- <input placeholder="请输入人员姓名" type="text">-->
|
||||
<!-- </div>-->
|
||||
<!-- <text>搜索</text>-->
|
||||
<!-- </div>-->
|
||||
<div class="userList">
|
||||
<!-- <u-checkbox-group-->
|
||||
<!-- placement="column"-->
|
||||
<!-- v-model="checked">-->
|
||||
<radio-group @change="radioChange" v-if="type == 'xs' || !type">
|
||||
<label v-for="(item, index) in list" :key="item.userId" class="userItem">
|
||||
<view class="info">
|
||||
<text class="name">{{ item.userName }}</text>
|
||||
<text class="trade">{{ item.workTypeText }}</text>
|
||||
</view>
|
||||
<radio :value="item.userId+''" :checked="index === current"/>
|
||||
<!-- <u-checkbox v-model="item.checked" :name="item.userId" iconSize="24" shape="circle" activeColor="#1890ff"></u-checkbox>-->
|
||||
</label>
|
||||
</radio-group>
|
||||
<view class="container">
|
||||
<VNavigationBar background-color="#fff" title="选择人员" title-color="#333"></VNavigationBar>
|
||||
<view class="body">
|
||||
<!-- <div class="searchBox">-->
|
||||
<!-- <div class="inputBox">-->
|
||||
<!-- <input placeholder="请输入人员姓名" type="text">-->
|
||||
<!-- </div>-->
|
||||
<!-- <text>搜索</text>-->
|
||||
<!-- </div>-->
|
||||
<div class="userList">
|
||||
<!-- <u-checkbox-group-->
|
||||
<!-- placement="column"-->
|
||||
<!-- v-model="checked">-->
|
||||
<!-- <checkbox-group @change="checkboxChange" v-if="type == 'xs' || !type">
|
||||
<label v-for="(item, index) in list" :key="item.userId" class="userItem">
|
||||
<view class="info">
|
||||
<text class="name">{{ item.userName }}</text>
|
||||
<text class="trade">{{ item.workTypeText }}</text>
|
||||
</view>
|
||||
<checkbox :value="item.userId + ''" />
|
||||
</label>
|
||||
</checkbox-group> -->
|
||||
<radio-group @change="radioChange" v-if="type == 'xs' || !type">
|
||||
<label v-for="(item, index) in list" :key="item.userId" class="userItem">
|
||||
<view class="info">
|
||||
<text class="name">{{ item.userName }}</text>
|
||||
<text class="trade">{{ item.workTypeText }}</text>
|
||||
</view>
|
||||
<radio :value="item.userId+''" :checked="index === current" />
|
||||
</label>
|
||||
</radio-group>
|
||||
|
||||
<view v-else>
|
||||
<!-- <label v-for="(item, index) in list" :key="item.id" class="userItem">-->
|
||||
<!-- <view class="info">-->
|
||||
<!-- <text class="name">{{ item.userName }}</text>-->
|
||||
<!-- <text class="trade">{{ item.workTypeText }}</text>-->
|
||||
<!-- </view>-->
|
||||
<!-- <checkbox :value="item.id+''" v-model="selectedUsers" @change="cs" />-->
|
||||
<!-- </label>-->
|
||||
<checkbox-group @change="cs">
|
||||
<label v-for="(item, index) in list" :key="item.userId" class="userItem">
|
||||
<view class="info">
|
||||
<text class="name">{{ item.userName }}</text>
|
||||
<text class="trade">{{ item.workTypeText }}</text>
|
||||
</view>
|
||||
<checkbox :value="item.userId + ''" />
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<!-- </u-checkbox-group>-->
|
||||
<view v-else>
|
||||
<!-- <label v-for="(item, index) in list" :key="item.id" class="userItem">-->
|
||||
<!-- <view class="info">-->
|
||||
<!-- <text class="name">{{ item.userName }}</text>-->
|
||||
<!-- <text class="trade">{{ item.workTypeText }}</text>-->
|
||||
<!-- </view>-->
|
||||
<!-- <checkbox :value="item.id+''" v-model="selectedUsers" @change="cs" />-->
|
||||
<!-- </label>-->
|
||||
<checkbox-group @change="cs">
|
||||
<label v-for="(item, index) in list" :key="item.userId" class="userItem">
|
||||
<view class="info">
|
||||
<text class="name">{{ item.userName }}</text>
|
||||
<text class="trade">{{ item.workTypeText }}</text>
|
||||
</view>
|
||||
<checkbox :value="item.userId + ''" />
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<!-- </u-checkbox-group>-->
|
||||
|
||||
</div>
|
||||
</view>
|
||||
<!-- 普通弹窗---拍照上传 -->
|
||||
<uni-popup ref="popup" background-color="#fff">
|
||||
<view class="popup-content">
|
||||
<view class="dl-avatar-box">
|
||||
<input type="text" placeholder="请输入内返派工原因" v-model="remark" />
|
||||
<uni-file-picker :value="fileList" :sizeType="sizeType" @select="afterRead" @delete="deleteFile" limit="9" title="请上传图片(最多上传9张)"></uni-file-picker>
|
||||
</view>
|
||||
<button type="primary" @click="submit('1')">保存</button>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<view class="foot">
|
||||
<view v-if="isNei" class="submit" @click="openFile">确定选择</view>
|
||||
<view v-else class="submit" @click="submit('0')">确定选择</view>
|
||||
</view>
|
||||
</div>
|
||||
</view>
|
||||
<!-- 普通弹窗---拍照上传 -->
|
||||
<uni-popup ref="popup" background-color="#fff">
|
||||
<view class="popup-content">
|
||||
<view class="dl-avatar-box">
|
||||
<input type="text" placeholder="请输入内返派工原因" v-model="remark" />
|
||||
<uni-file-picker :value="fileList" :sizeType="sizeType" @select="afterRead" @delete="deleteFile"
|
||||
limit="9" title="请上传图片(最多上传9张)"></uni-file-picker>
|
||||
</view>
|
||||
<button type="primary" @click="submit('1')">保存</button>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<view class="foot">
|
||||
<view v-if="isNei" class="submit" @click="openFile">确定选择</view>
|
||||
<view v-else class="submit" @click="submit('0')">确定选择</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import {bus} from "@/utils/eventBus";
|
||||
import request from '@/utils/request';
|
||||
import {getDictTextByCodeAndValue,saveTicketsRecords} from "@/utils/utils";
|
||||
import config from "@/config";
|
||||
import upload from "@/utils/upload";
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import {
|
||||
bus
|
||||
} from "@/utils/eventBus";
|
||||
import request from '@/utils/request';
|
||||
import {
|
||||
getDictTextByCodeAndValue,
|
||||
saveTicketsRecords
|
||||
} from "@/utils/utils";
|
||||
import config from "@/config";
|
||||
import upload from "@/utils/upload";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
VNavigationBar,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//上传的图片数组
|
||||
fileList: [],
|
||||
sizeType:['compressed'],
|
||||
remark:'',
|
||||
isNei:false,
|
||||
current: 0,
|
||||
ticketId: '',
|
||||
list: [],
|
||||
checkedUserId: "",
|
||||
checkedUserName: "",
|
||||
ifDetail: false,
|
||||
type: "",
|
||||
sgIds: [], // 初始化为数组
|
||||
sgNames : [],
|
||||
projectId: '',
|
||||
itemId:"",
|
||||
}
|
||||
},
|
||||
onLoad(data) {
|
||||
console.log("data", data)
|
||||
if (data.id) {
|
||||
console.log('执行了派单')
|
||||
this.ticketId = data.id
|
||||
console.log(data.canOperate,103)
|
||||
console.log(data.canOperate === '1',104)
|
||||
if (data.canOperate === '1'){
|
||||
this.listLeadsAll()
|
||||
} else {
|
||||
this.workByTicketId()
|
||||
}
|
||||
}
|
||||
if (data.isNei) {
|
||||
//内返派工
|
||||
this.isNei = true
|
||||
}
|
||||
if (data.ifDetail) {
|
||||
//从订单详情页跳过来的,返回时需要返回2步
|
||||
this.ifDetail = true
|
||||
}
|
||||
if (data.itemId) {
|
||||
//从订单详情页跳过来的,返回时需要返回2步
|
||||
this.itemId = data.itemId
|
||||
}
|
||||
if (data.type) {
|
||||
this.type = data.type
|
||||
if (data.type == 'xs') {
|
||||
this.getStaffList()
|
||||
} else {
|
||||
this.getRepairWorder()
|
||||
}
|
||||
}
|
||||
//创建工单后,订单详情页跳转过来携带
|
||||
if (data.ticketId) {
|
||||
this.ticketId = data.ticketId
|
||||
}
|
||||
if (data.projectId) {
|
||||
this.projectId = data.projectId
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
export default {
|
||||
components: {
|
||||
VNavigationBar,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//上传的图片数组
|
||||
fileList: [],
|
||||
sizeType: ['compressed'],
|
||||
remark: '',
|
||||
isNei: false,
|
||||
current: 0,
|
||||
ticketId: '',
|
||||
list: [],
|
||||
checkedUserId: "",
|
||||
checkedUserName: "",
|
||||
ifDetail: false,
|
||||
type: "",
|
||||
sgIds: [], // 初始化为数组
|
||||
sgNames: [],
|
||||
projectId: '',
|
||||
itemId: "",
|
||||
checkedUserIds: [],
|
||||
checkedUserNames: [],
|
||||
}
|
||||
},
|
||||
onLoad(data) {
|
||||
console.log("data", data)
|
||||
if (data.id) {
|
||||
console.log('执行了派单')
|
||||
this.ticketId = data.id
|
||||
console.log(data.canOperate, 103)
|
||||
console.log(data.canOperate === '1', 104)
|
||||
if (data.canOperate === '1') {
|
||||
this.listLeadsAll()
|
||||
} else {
|
||||
this.workByTicketId()
|
||||
}
|
||||
}
|
||||
if (data.isNei) {
|
||||
//内返派工
|
||||
this.isNei = true
|
||||
}
|
||||
if (data.ifDetail) {
|
||||
//从订单详情页跳过来的,返回时需要返回2步
|
||||
this.ifDetail = true
|
||||
}
|
||||
if (data.itemId) {
|
||||
//从订单详情页跳过来的,返回时需要返回2步
|
||||
this.itemId = data.itemId
|
||||
}
|
||||
if (data.type) {
|
||||
this.type = data.type
|
||||
if (data.type == 'xs') {
|
||||
this.getStaffList()
|
||||
} else {
|
||||
this.getRepairWorder()
|
||||
}
|
||||
}
|
||||
//创建工单后,订单详情页跳转过来携带
|
||||
if (data.ticketId) {
|
||||
this.ticketId = data.ticketId
|
||||
}
|
||||
if (data.projectId) {
|
||||
this.projectId = data.projectId
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
/**
|
||||
* 维修班组长修改派工
|
||||
*/
|
||||
listLeadsAll(){
|
||||
request({
|
||||
url: '/admin-api/repair/worker/listLeadsAll',
|
||||
method: 'get',
|
||||
}).then((res) => {
|
||||
this.list = res.data
|
||||
if (this.list.length > 0) {
|
||||
console.log(this.list[0].userId)
|
||||
this.checkedUserId = this.list[0].userId
|
||||
this.checkedUserName = this.list[0].userName
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 维修班组长修改派工
|
||||
*/
|
||||
listLeadsAll() {
|
||||
request({
|
||||
url: '/admin-api/repair/worker/listLeadsAll',
|
||||
method: 'get',
|
||||
}).then((res) => {
|
||||
this.list = res.data
|
||||
if (this.list.length > 0) {
|
||||
console.log(this.list[0].userId)
|
||||
this.checkedUserId = this.list[0].userId
|
||||
this.checkedUserName = this.list[0].userName
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 内返派工打开上传附件弹窗
|
||||
*/
|
||||
openFile(){
|
||||
this.$refs.popup.open("bottom")
|
||||
},
|
||||
/**
|
||||
* 内返派工打开上传附件弹窗
|
||||
*/
|
||||
openFile() {
|
||||
this.$refs.popup.open("bottom")
|
||||
},
|
||||
|
||||
afterRead(file) {
|
||||
uni.showLoading({
|
||||
title: '正在上传中...',
|
||||
mask:true
|
||||
});
|
||||
for (let i = 0; i < file.tempFilePaths.length; i++) {
|
||||
upload({
|
||||
url:'/admin-api/infra/file/upload',
|
||||
filePath: file.tempFilePaths[i]
|
||||
}).then((res)=>{
|
||||
this.fileList.push({
|
||||
url: config.baseImageUrl+res.data
|
||||
})
|
||||
if(i==file.tempFilePaths.length-1){
|
||||
uni.hideLoading()
|
||||
}
|
||||
console.log(this.fileList)
|
||||
})
|
||||
}
|
||||
},
|
||||
afterRead(file) {
|
||||
uni.showLoading({
|
||||
title: '正在上传中...',
|
||||
mask: true
|
||||
});
|
||||
for (let i = 0; i < file.tempFilePaths.length; i++) {
|
||||
upload({
|
||||
url: '/admin-api/infra/file/upload',
|
||||
filePath: file.tempFilePaths[i]
|
||||
}).then((res) => {
|
||||
this.fileList.push({
|
||||
url: config.baseImageUrl + res.data
|
||||
})
|
||||
if (i == file.tempFilePaths.length - 1) {
|
||||
uni.hideLoading()
|
||||
}
|
||||
console.log(this.fileList)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
deleteFile(file, index) {
|
||||
this.fileList.splice(index, 1);
|
||||
},
|
||||
deleteFile(file, index) {
|
||||
this.fileList.splice(index, 1);
|
||||
},
|
||||
|
||||
radioChange: function (evt) {
|
||||
for (let i = 0; i < this.list.length; i++) {
|
||||
if (this.list[i].userId == evt.detail.value) {
|
||||
this.current = i;
|
||||
this.checkedUserId = this.list[i].userId
|
||||
this.checkedUserName = this.list[i].userName
|
||||
break;
|
||||
}
|
||||
}
|
||||
console.log(this.checkedUserName)
|
||||
},
|
||||
/**
|
||||
* 获取销售列表
|
||||
*/
|
||||
getStaffList() {
|
||||
request({
|
||||
url: '/admin-api/company/staff/list',
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.list = res.data
|
||||
this.list.map((item) => {
|
||||
item.userName = item.name
|
||||
})
|
||||
if (this.list.length > 0) {
|
||||
console.log(this.list[0].userId)
|
||||
this.checkedUserId = this.list[0].userId
|
||||
this.checkedUserName = this.list[0].userName
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取维修工人
|
||||
*/
|
||||
getRepairWorder(){
|
||||
request({
|
||||
url: '/admin-api/repair/worker/page',
|
||||
method: 'get',
|
||||
params:{
|
||||
pageNo: 1,
|
||||
pageSize: 9999
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
let thisList = res.data.records
|
||||
thisList.map((item) => {
|
||||
getDictTextByCodeAndValue("repair_work_type", item.workType).then(value => {
|
||||
item.workTypeText = value
|
||||
}).catch(error => {
|
||||
item.workTypeText = "未知"
|
||||
console.error(error);
|
||||
});
|
||||
})
|
||||
this.list = thisList
|
||||
} else {
|
||||
this.list = []
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 通过工单id查询维修工人
|
||||
*/
|
||||
workByTicketId() {
|
||||
request({
|
||||
url: '/admin-api/repair/worker/listByTicketId',
|
||||
method: 'get',
|
||||
params: {ticketId: this.ticketId}
|
||||
}).then((res) => {
|
||||
this.list = res.data
|
||||
if (this.list.length > 0) {
|
||||
console.log(this.list[0].userId)
|
||||
this.checkedUserId = this.list[0].userId
|
||||
this.checkedUserName = this.list[0].userName
|
||||
}
|
||||
})
|
||||
},
|
||||
cs(e){
|
||||
let arr = []
|
||||
let nameArr = []
|
||||
for (let i = 0; i < this.list.length; i++) {
|
||||
for (let j = 0; j < e.detail.value.length; j++) {
|
||||
if (this.list[i].userId == e.detail.value[j]) {
|
||||
this.current = i;
|
||||
let checkedUserId = this.list[i].userId
|
||||
let checkedUserName = this.list[i].userName
|
||||
arr.push(checkedUserId)
|
||||
nameArr.push(checkedUserName)
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(this.checkedUserName)
|
||||
this.sgIds = arr
|
||||
this.sgNames = nameArr
|
||||
},
|
||||
async submit(type) {
|
||||
if (this.type == 'sg') {
|
||||
if (this.sgIds.length == 0) {
|
||||
uni.showToast({
|
||||
title: '请选择维修人员!',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
//以逗号拼接
|
||||
const sgIds = this.sgIds.join(',')
|
||||
const sgNames = this.sgNames.join(',')
|
||||
console.log('this.projectId',this.projectId)
|
||||
const param = {
|
||||
ticketId: this.ticketId,
|
||||
projectId: this.projectId,
|
||||
repairIds: sgIds,
|
||||
repairNames: sgNames,
|
||||
}
|
||||
request({
|
||||
url: '/admin-api/repair/titem/updateRepairAndSale',
|
||||
method: 'put',
|
||||
data: param
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: '选择维修人员成功!',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
bus.$emit('choosePeople')
|
||||
}, 700)
|
||||
})
|
||||
}
|
||||
checkboxChange: function(evt) {
|
||||
this.checkedUserIds = evt.detail.value; // 记录多个选中的值
|
||||
this.checkedUserNames = [];
|
||||
|
||||
}else if (this.type == 'xs') {
|
||||
if (this.checkedUserId == '' && this.checkedUserName == '') {
|
||||
uni.showToast({
|
||||
title: '请选择服务顾问!',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
//以逗号拼接
|
||||
const param = {
|
||||
ticketId: this.ticketId,
|
||||
projectId: this.projectId,
|
||||
saleId: this.checkedUserId,
|
||||
saleName: this.checkedUserName,
|
||||
}
|
||||
request({
|
||||
url: '/admin-api/repair/titem/updateRepairAndSale',
|
||||
method: 'put',
|
||||
data: param
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: '选择服务顾问成功!',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
bus.$emit('choosePeople')
|
||||
}, 700)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
const param = {
|
||||
id: this.ticketId,
|
||||
nowRepairId: this.checkedUserId,
|
||||
nowRepairName: this.checkedUserName
|
||||
}
|
||||
if (type == '1'){
|
||||
param.remark = this.remark
|
||||
param.image = this.fileList.map(item=>item.url.replace(config.baseImageUrl,"")).join(",")
|
||||
}
|
||||
console.log(param)
|
||||
request({
|
||||
url: '/admin-api/repair/tickets/notify',
|
||||
method: 'post',
|
||||
data: param
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: '指派成功!',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
if (this.ifDetail) {
|
||||
uni.navigateBack({
|
||||
delta: 2 // 返回倒数第2页
|
||||
})
|
||||
} else {
|
||||
uni.navigateBack()
|
||||
}
|
||||
}, 700)
|
||||
})
|
||||
//
|
||||
// console.log('this.checked', this.checked)
|
||||
// const selected = this.list.filter(f => this.checked.includes(f.id))
|
||||
// bus.$emit('choosePeople', selected)
|
||||
// uni.navigateBack()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 遍历选中的 userId,获取对应的 userName
|
||||
for (let i = 0; i < this.list.length; i++) {
|
||||
if (this.checkedUserIds.includes(this.list[i].userId + '')) {
|
||||
this.checkedUserNames.push(this.list[i].userName);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(this.checkedUserNames); // 输出选中的所有用户名
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取销售列表
|
||||
*/
|
||||
getStaffList() {
|
||||
request({
|
||||
url: '/admin-api/company/staff/list',
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.list = res.data
|
||||
this.list.map((item) => {
|
||||
item.userName = item.name
|
||||
})
|
||||
if (this.list.length > 0) {
|
||||
console.log(this.list[0].userId)
|
||||
this.checkedUserId = this.list[0].userId
|
||||
this.checkedUserName = this.list[0].userName
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取维修工人
|
||||
*/
|
||||
getRepairWorder() {
|
||||
request({
|
||||
url: '/admin-api/repair/worker/page',
|
||||
method: 'get',
|
||||
params: {
|
||||
pageNo: 1,
|
||||
pageSize: 9999
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
let thisList = res.data.records
|
||||
thisList.map((item) => {
|
||||
getDictTextByCodeAndValue("repair_work_type", item.workType).then(value => {
|
||||
item.workTypeText = value
|
||||
}).catch(error => {
|
||||
item.workTypeText = "未知"
|
||||
console.error(error);
|
||||
});
|
||||
})
|
||||
this.list = thisList
|
||||
} else {
|
||||
this.list = []
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 通过工单id查询维修工人
|
||||
*/
|
||||
workByTicketId() {
|
||||
request({
|
||||
url: '/admin-api/repair/worker/listByTicketId',
|
||||
method: 'get',
|
||||
params: {
|
||||
ticketId: this.ticketId
|
||||
}
|
||||
}).then((res) => {
|
||||
this.list = res.data
|
||||
if (this.list.length > 0) {
|
||||
console.log(this.list[0].userId)
|
||||
this.checkedUserId = this.list[0].userId
|
||||
this.checkedUserName = this.list[0].userName
|
||||
}
|
||||
})
|
||||
},
|
||||
cs(e) {
|
||||
let arr = []
|
||||
let nameArr = []
|
||||
for (let i = 0; i < this.list.length; i++) {
|
||||
for (let j = 0; j < e.detail.value.length; j++) {
|
||||
if (this.list[i].userId == e.detail.value[j]) {
|
||||
this.current = i;
|
||||
let checkedUserId = this.list[i].userId
|
||||
let checkedUserName = this.list[i].userName
|
||||
arr.push(checkedUserId)
|
||||
nameArr.push(checkedUserName)
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(this.checkedUserName)
|
||||
this.sgIds = arr
|
||||
this.sgNames = nameArr
|
||||
},
|
||||
async submit(type) {
|
||||
if (this.type == 'sg') {
|
||||
if (this.sgIds.length == 0) {
|
||||
uni.showToast({
|
||||
title: '请选择维修人员!',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
//以逗号拼接
|
||||
const sgIds = this.sgIds.join(',')
|
||||
const sgNames = this.sgNames.join(',')
|
||||
console.log('this.projectId', this.projectId)
|
||||
const param = {
|
||||
ticketId: this.ticketId,
|
||||
projectId: this.projectId,
|
||||
repairIds: sgIds,
|
||||
repairNames: sgNames,
|
||||
}
|
||||
request({
|
||||
url: '/admin-api/repair/titem/updateRepairAndSale',
|
||||
method: 'put',
|
||||
data: param
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: '选择维修人员成功!',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
bus.$emit('choosePeople')
|
||||
}, 700)
|
||||
})
|
||||
}
|
||||
|
||||
} else if (this.type == 'xs') {
|
||||
if (this.checkedUserId == '' && this.checkedUserName == '') {
|
||||
uni.showToast({
|
||||
title: '请选择服务顾问!',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
//以逗号拼接
|
||||
const param = {
|
||||
ticketId: this.ticketId,
|
||||
projectId: this.projectId,
|
||||
saleId: this.checkedUserId,
|
||||
saleName: this.checkedUserName,
|
||||
}
|
||||
request({
|
||||
url: '/admin-api/repair/titem/updateRepairAndSale',
|
||||
method: 'put',
|
||||
data: param
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: '选择服务顾问成功!',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
bus.$emit('choosePeople')
|
||||
}, 700)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
const param = {
|
||||
id: this.ticketId,
|
||||
nowRepairId: this.checkedUserIds.join(','),
|
||||
nowRepairName: this.checkedUserNames.join(',')
|
||||
}
|
||||
if (type == '1') {
|
||||
param.remark = this.remark
|
||||
param.image = this.fileList.map(item => item.url.replace(config.baseImageUrl, "")).join(",")
|
||||
}
|
||||
console.log(param)
|
||||
request({
|
||||
url: '/admin-api/repair/tickets/notify',
|
||||
method: 'post',
|
||||
data: param
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: '指派成功!',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
if (this.ifDetail) {
|
||||
uni.navigateBack({
|
||||
delta: 2 // 返回倒数第2页
|
||||
})
|
||||
} else {
|
||||
uni.navigateBack()
|
||||
}
|
||||
}, 700)
|
||||
})
|
||||
//
|
||||
// console.log('this.checked', this.checked)
|
||||
// const selected = this.list.filter(f => this.checked.includes(f.id))
|
||||
// bus.$emit('choosePeople', selected)
|
||||
// uni.navigateBack()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.popup-content {
|
||||
@include flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 30rpx 30rpx 120rpx 30rpx;
|
||||
height: auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
.container {
|
||||
height: 100%;
|
||||
background-color: #F3F5F7;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.popup-content {
|
||||
@include flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 30rpx 30rpx 120rpx 30rpx;
|
||||
height: auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.body {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
overflow: auto;
|
||||
padding: 20rpx 0;
|
||||
.container {
|
||||
height: 100%;
|
||||
background-color: #F3F5F7;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.searchBox {
|
||||
margin: 0 32rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
padding: 30rpx;
|
||||
.body {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
overflow: auto;
|
||||
padding: 20rpx 0;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
column-gap: 20rpx;
|
||||
.searchBox {
|
||||
margin: 0 32rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
padding: 30rpx;
|
||||
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #0174F6;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
column-gap: 20rpx;
|
||||
|
||||
.inputBox {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #0174F6;
|
||||
|
||||
.userList {
|
||||
margin: 20rpx 32rpx 0;
|
||||
background-color: #fff;
|
||||
padding: 0 20rpx;
|
||||
.inputBox {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
.userItem {
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #DDDDDD;
|
||||
.userList {
|
||||
margin: 20rpx 32rpx 0;
|
||||
background-color: #fff;
|
||||
padding: 0 20rpx;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.userItem {
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1rpx solid #DDDDDD;
|
||||
|
||||
.info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
row-gap: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.name {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
row-gap: 20rpx;
|
||||
|
||||
.trade {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.name {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.userItem:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
.trade {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.foot {
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
.userItem:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.submit {
|
||||
margin: 0 auto;
|
||||
width: 510rpx;
|
||||
height: 76rpx;
|
||||
background: #0174F6;
|
||||
border-radius: 38rpx 38rpx 38rpx 38rpx;
|
||||
.foot {
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.submit {
|
||||
margin: 0 auto;
|
||||
width: 510rpx;
|
||||
height: 76rpx;
|
||||
background: #0174F6;
|
||||
border-radius: 38rpx 38rpx 38rpx 38rpx;
|
||||
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1167,7 +1167,8 @@
|
||||
code: "edit"
|
||||
})
|
||||
}
|
||||
if (this.ticketInfo.nowRepairId == this.loginUser.id && "05" == this.ticketInfo.ticketsStatus) {
|
||||
if (this.ticketInfo.nowRepairId.split(',').includes(this.loginUser.id.toString()) && "05" == this
|
||||
.ticketInfo.ticketsStatus) {
|
||||
//当前用户就是处理人,可以进行总检拍照
|
||||
this.content.push({
|
||||
text: '总检拍照',
|
||||
@ -1187,7 +1188,8 @@
|
||||
code: "apply"
|
||||
})
|
||||
console.log(this.ticketInfo, "this.ticketInfo")
|
||||
if ("05" == this.ticketInfo.ticketsStatus && this.ticketInfo.nowRepairId == this.loginUser.id) {
|
||||
if ("05" == this.ticketInfo.ticketsStatus && this.ticketInfo.nowRepairId.split(',').includes(this
|
||||
.loginUser.id.toString())) {
|
||||
//订单状态处于维修中 ,且自己就是施工人
|
||||
if ("02" == this.ticketInfo.ticketsWorkStatus) {
|
||||
//当前正在施工且可以随时上传图片、也可以结束施工
|
||||
|
||||
Loading…
Reference in New Issue
Block a user