This commit is contained in:
xuyuncong 2025-11-14 17:58:40 +08:00
parent e590e6cc7f
commit bca86a4119
3 changed files with 483 additions and 457 deletions

View File

@ -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
}

View File

@ -12,25 +12,33 @@
<!-- <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"/>
<!-- <u-checkbox v-model="item.checked" :name="item.userId" iconSize="24" shape="circle" activeColor="#1890ff"></u-checkbox>-->
<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>-->
<!-- <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">
@ -50,7 +58,8 @@
<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>
<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>
@ -64,14 +73,19 @@
</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 {
export default {
components: {
VNavigationBar,
},
@ -79,9 +93,9 @@ export default {
return {
//
fileList: [],
sizeType:['compressed'],
remark:'',
isNei:false,
sizeType: ['compressed'],
remark: '',
isNei: false,
current: 0,
ticketId: '',
list: [],
@ -90,9 +104,11 @@ export default {
ifDetail: false,
type: "",
sgIds: [], //
sgNames : [],
sgNames: [],
projectId: '',
itemId:"",
itemId: "",
checkedUserIds: [],
checkedUserNames: [],
}
},
onLoad(data) {
@ -100,9 +116,9 @@ export default {
if (data.id) {
console.log('执行了派单')
this.ticketId = data.id
console.log(data.canOperate,103)
console.log(data.canOperate === '1',104)
if (data.canOperate === '1'){
console.log(data.canOperate, 103)
console.log(data.canOperate === '1', 104)
if (data.canOperate === '1') {
this.listLeadsAll()
} else {
this.workByTicketId()
@ -141,7 +157,7 @@ export default {
/**
* 维修班组长修改派工
*/
listLeadsAll(){
listLeadsAll() {
request({
url: '/admin-api/repair/worker/listLeadsAll',
method: 'get',
@ -159,24 +175,24 @@ export default {
/**
* 内返派工打开上传附件弹窗
*/
openFile(){
openFile() {
this.$refs.popup.open("bottom")
},
afterRead(file) {
uni.showLoading({
title: '正在上传中...',
mask:true
mask: true
});
for (let i = 0; i < file.tempFilePaths.length; i++) {
upload({
url:'/admin-api/infra/file/upload',
url: '/admin-api/infra/file/upload',
filePath: file.tempFilePaths[i]
}).then((res)=>{
}).then((res) => {
this.fileList.push({
url: config.baseImageUrl+res.data
url: config.baseImageUrl + res.data
})
if(i==file.tempFilePaths.length-1){
if (i == file.tempFilePaths.length - 1) {
uni.hideLoading()
}
console.log(this.fileList)
@ -188,17 +204,20 @@ export default {
this.fileList.splice(index, 1);
},
radioChange: function (evt) {
checkboxChange: function(evt) {
this.checkedUserIds = evt.detail.value; //
this.checkedUserNames = [];
// userId userName
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;
if (this.checkedUserIds.includes(this.list[i].userId + '')) {
this.checkedUserNames.push(this.list[i].userName);
}
}
console.log(this.checkedUserName)
console.log(this.checkedUserNames); //
},
/**
* 获取销售列表
*/
@ -221,11 +240,11 @@ export default {
/**
* 获取维修工人
*/
getRepairWorder(){
getRepairWorder() {
request({
url: '/admin-api/repair/worker/page',
method: 'get',
params:{
params: {
pageNo: 1,
pageSize: 9999
}
@ -253,7 +272,9 @@ export default {
request({
url: '/admin-api/repair/worker/listByTicketId',
method: 'get',
params: {ticketId: this.ticketId}
params: {
ticketId: this.ticketId
}
}).then((res) => {
this.list = res.data
if (this.list.length > 0) {
@ -263,7 +284,7 @@ export default {
}
})
},
cs(e){
cs(e) {
let arr = []
let nameArr = []
for (let i = 0; i < this.list.length; i++) {
@ -292,7 +313,7 @@ export default {
//
const sgIds = this.sgIds.join(',')
const sgNames = this.sgNames.join(',')
console.log('this.projectId',this.projectId)
console.log('this.projectId', this.projectId)
const param = {
ticketId: this.ticketId,
projectId: this.projectId,
@ -315,7 +336,7 @@ export default {
})
}
}else if (this.type == 'xs') {
} else if (this.type == 'xs') {
if (this.checkedUserId == '' && this.checkedUserName == '') {
uni.showToast({
title: '请选择服务顾问!',
@ -347,12 +368,12 @@ export default {
} else {
const param = {
id: this.ticketId,
nowRepairId: this.checkedUserId,
nowRepairName: this.checkedUserName
nowRepairId: this.checkedUserIds.join(','),
nowRepairName: this.checkedUserNames.join(',')
}
if (type == '1'){
if (type == '1') {
param.remark = this.remark
param.image = this.fileList.map(item=>item.url.replace(config.baseImageUrl,"")).join(",")
param.image = this.fileList.map(item => item.url.replace(config.baseImageUrl, "")).join(",")
}
console.log(param)
request({
@ -382,19 +403,20 @@ export default {
}
}
}
}
}
</script>
<style lang="less" scoped>
.popup-content {
@include flex;
.popup-content {
@include flex;
align-items: center;
justify-content: center;
padding: 30rpx 30rpx 120rpx 30rpx;
height: auto;
background-color: #fff;
}
.container {
}
.container {
height: 100%;
background-color: #F3F5F7;
display: flex;
@ -484,5 +506,5 @@ export default {
color: #FFFFFF;
}
}
}
}
</style>

View File

@ -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) {
//