This commit is contained in:
PQZ 2024-11-04 17:04:44 +08:00
parent 85a3ec3f81
commit bf1385b3cc
2 changed files with 115 additions and 24 deletions

View File

@ -45,9 +45,17 @@
<view >
<u-modal showCancelButton @cancel="doVoidCancel" @confirm = "doVoidConfirm" :show="show" :title="title">
<input type="text" v-model="voidData.remark" placeholder="请输入作废原因" >
</u-modal>
</view>
<!-- 普通弹窗---拍照上传 -->
<uni-popup ref="popup" background-color="#fff">
<view class="popup-content">
<view class="dl-avatar-box">
<uni-file-picker :value="fileList" :sizeType="sizeType" @select="afterRead" @delete="deleteFile" limit="9" title="请上传诊断维修单和车辆维修前照片"></uni-file-picker>
</view>
<button type="primary" @click="receiveOrder">保存</button>
</view>
</uni-popup>
<view class="footer">
<view @click="projectDis" v-if="order.ticketsStatus == '04' && (userInfo.roleCodes.includes('service_advisor') || userInfo.roleCodes.includes('general_inspection'))" class="btn pg">
项目派工
@ -60,7 +68,7 @@
<!--服务顾问和总检可以重新派工-->
重新派工
</view>
<view @click="receiveOrder(order.id)" 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">
接单
</view>
<!-- <view @click="doOrder(order.id)" v-if="order.ticketsStatus == '05' && order.ticketsWorkStatus=='04' && roleCanSg" class="btn qc">-->
@ -88,6 +96,8 @@ import {
getStrData
} from '@/utils/auth';
import request from '@/utils/request';
import config from "@/config";
import upload from "@/utils/upload";
export default {
name: "orderCard",
props: {
@ -108,6 +118,9 @@ export default {
},
data() {
return {
//
fileList: [],
sizeType:['compressed'],
show:false,
title:'作废',
voidData:{},
@ -120,6 +133,7 @@ export default {
//
userInfo:{},
ifLeader:false,
takeOrderId:'',
}
},
mounted(){
@ -142,6 +156,33 @@ export default {
},
methods: {
/**
* 接单上传附件
*/
openFile(id){
this.takeOrderId = id
this.$refs.popup.open("bottom")
},
afterRead(file) {
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
})
console.log(this.fileList)
})
}
},
deleteFile(file, index) {
this.fileList.splice(index, 1);
},
getFlagColor(flag) {
if (flag == 1) {
return '#E8A321'
@ -152,11 +193,15 @@ export default {
/**
* 接单
*/
receiveOrder(id){
receiveOrder(){
let fileStr = this.fileList.map(item=>item.url.replace(config.baseImageUrl,"")).join(",")
request({
url: '/admin-api/repair/tickets/take',
method: 'get',
params:{id:id}
params:{
id:this.takeOrderId,
image:fileStr
}
}).then((res) => {
console.log(res)
if (res.code == 200) {
@ -237,6 +282,14 @@ export default {
</script>
<style lang="less" scoped>
.popup-content {
@include flex;
align-items: center;
justify-content: center;
padding: 15px;
height: auto;
background-color: #fff;
}
.orderCard {
background: #FFFFFF;
border-radius: 8rpx 8rpx 8rpx 8rpx;

View File

@ -29,11 +29,20 @@
</view>
</view>
</view>
<!-- 普通弹窗---拍照上传 -->
<uni-popup ref="popup" background-color="#fff">
<view class="popup-content">
<view class="dl-avatar-box">
<uni-file-picker :value="fileList" :sizeType="sizeType" @select="afterRead" @delete="deleteFile" limit="9" title="请拍照上传图片最多上传9张"></uni-file-picker>
</view>
<button type="primary" @click="confirmOpe('yes')">保存</button>
</view>
</uni-popup>
<view v-if="canOperate" class="footer">
<view class="no" @click="confirmOpe('no')">
{{ backText }}
</view>
<view class="yes" @click="confirmOpe('yes')">
<view class="yes" @click="openFile">
{{ yesText }}
</view>
</view>
@ -44,36 +53,24 @@
import VNavigationBar from "@/components/VNavigationBar.vue";
import request from '@/utils/request';
import {getDictTextByCodeAndValue} from "@/utils/utils";
import config from "@/config";
import upload from "@/utils/upload";
export default {
components: {
VNavigationBar
},
data() {
return {
//
fileList: [],
sizeType:['compressed'],
viewType:"",
id:"",
title:"",
canOperate:false,
backText:"",
yesText:"",
repairList: [
// {
// name: '7',
// num: 3,
// type: '',
// unit: '',
// total: 35,
// code: 'XCQHCJYS7 SPI SP 5W30 4L'
// },
// {
// name: '7',
// num: 3,
// type: '',
// unit: '',
// total: 35,
// code: 'XCQHCJYS7 SPI SP 5W30 4L'
// }
]
repairList: []
};
},
onLoad(data){
@ -83,6 +80,35 @@ export default {
this.getDetail()
},
methods:{
/**
* 接单上传附件
*/
openFile(){
this.$refs.popup.open("bottom")
},
afterRead(file) {
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
})
console.log(this.fileList)
})
}
},
deleteFile(file, index) {
this.fileList.splice(index, 1);
},
getDetail(){
let url;
let params={};
@ -150,7 +176,11 @@ export default {
confirmOpe(type){
if("yes"==type){
let url;
let params={id:this.id};
let fileStr = this.fileList.map(item=>item.url.replace(config.baseImageUrl,"")).join(",")
let params={
id:this.id,
image:fileStr
};
if("receive"==this.viewType) {
//
url = "/admin-api/repair/so/confirmGet"
@ -202,6 +232,14 @@ export default {
</script>
<style lang="less" scoped>
.popup-content {
@include flex;
align-items: center;
justify-content: center;
padding: 15px;
height: auto;
background-color: #fff;
}
.container {
height: 100%;
background: #F3F5F7;