1
This commit is contained in:
parent
a46dc789c0
commit
981f1834cf
@ -41,21 +41,6 @@
|
||||
服务顾问:{{ order.counselorName }}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 作废modal框-->
|
||||
<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">
|
||||
项目派工
|
||||
@ -140,7 +125,6 @@ export default {
|
||||
//当前用户
|
||||
userInfo:{},
|
||||
ifLeader:false,
|
||||
takeOrderId:'',
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
@ -163,32 +147,6 @@ 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) {
|
||||
@ -197,34 +155,7 @@ export default {
|
||||
return '#999'
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 接单
|
||||
*/
|
||||
receiveOrder(){
|
||||
let fileStr = this.fileList.map(item=>item.url.replace(config.baseImageUrl,"")).join(",")
|
||||
request({
|
||||
url: '/admin-api/repair/tickets/take',
|
||||
method: 'get',
|
||||
params:{
|
||||
id:this.takeOrderId,
|
||||
image:fileStr
|
||||
}
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '接单成功,请尽快处理!'
|
||||
})
|
||||
this.$emit('childEvent');
|
||||
}else{
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: res.message
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 开始施工
|
||||
*/
|
||||
@ -244,12 +175,7 @@ export default {
|
||||
* 作废
|
||||
*/
|
||||
doVoid(row){
|
||||
this.show = true
|
||||
this.voidData = {
|
||||
id : row.id,
|
||||
remark : '',
|
||||
ticketsStatus : '03'
|
||||
}
|
||||
this.$emit('doVoid',row);
|
||||
},
|
||||
/**
|
||||
* 添加项目
|
||||
@ -257,29 +183,11 @@ export default {
|
||||
addProj(order){
|
||||
this.$emit('addProj',order);
|
||||
},
|
||||
|
||||
/**
|
||||
* 作废请求后台方法
|
||||
* 接单
|
||||
*/
|
||||
doVoidConfirm(){
|
||||
request({
|
||||
url: '/admin-api/repair/tickets/void',
|
||||
method: 'POST',
|
||||
data:this.voidData
|
||||
}).then((res) => {
|
||||
if (res.code == 200){
|
||||
uni.showToast({
|
||||
title: "操作成功",
|
||||
icon: "success",
|
||||
})
|
||||
}
|
||||
this.doVoidCancel()
|
||||
this.$emit('childEvent')
|
||||
})
|
||||
},
|
||||
|
||||
doVoidCancel(){
|
||||
this.show = false
|
||||
openFile(orderId){
|
||||
this.$emit('getOrder',orderId);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -96,7 +96,7 @@
|
||||
<view class="todoList">
|
||||
<scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus"
|
||||
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
|
||||
<order-card v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @startWork="startWork" @addProj="addProj"></order-card>
|
||||
<order-card v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @doVoid="doVoidReq" @getOrder="openFile" @startWork="startWork" @addProj="addProj"></order-card>
|
||||
<view style="text-align: center" v-if="orderList.length==0">
|
||||
<image class="" src="@/static/images/nothing.png" ></image>
|
||||
</view>
|
||||
@ -116,6 +116,21 @@
|
||||
<uni-popup-dialog ref="inputClose" mode="input" title="线下告知" value=""
|
||||
placeholder="请填入告知方式!" @confirm="dialogInputConfirm"></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
<!-- 作废modal框-->
|
||||
<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>
|
||||
</template>
|
||||
|
||||
@ -124,9 +139,10 @@ import tabBarVue from '@/components/tabBar/tabBar.vue'
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||
import OrderCard from "@/components/orderCard.vue";
|
||||
import ProjectPicker from "@/components/projectPicker.vue";
|
||||
import config from '@/config'
|
||||
import request from '@/utils/request';
|
||||
import {formatTimestamp,getOrderStatusText,builderOrder,saveTicketsRecords} from "@/utils/utils";
|
||||
import config from "@/config";
|
||||
import upload from "@/utils/upload";
|
||||
import {
|
||||
getToken,
|
||||
getUserInfo,
|
||||
@ -145,6 +161,13 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//上传的图片数组
|
||||
fileList: [],
|
||||
sizeType:['compressed'],
|
||||
show:false,
|
||||
title:'作废',
|
||||
voidData:{},
|
||||
takeOrderId:'',
|
||||
imgUrlPrex:config.baseImageUrl,
|
||||
userInfo: {
|
||||
avatar: undefined,
|
||||
@ -238,6 +261,93 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 作废
|
||||
*/
|
||||
doVoidReq(row){
|
||||
this.show = true
|
||||
this.voidData = {
|
||||
id : row.id,
|
||||
remark : '',
|
||||
ticketsStatus : '03'
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 作废请求后台方法
|
||||
*/
|
||||
doVoidConfirm(){
|
||||
request({
|
||||
url: '/admin-api/repair/tickets/void',
|
||||
method: 'POST',
|
||||
data:this.voidData
|
||||
}).then((res) => {
|
||||
if (res.code == 200){
|
||||
uni.showToast({
|
||||
title: "操作成功",
|
||||
icon: "success",
|
||||
})
|
||||
}
|
||||
this.doVoidCancel()
|
||||
this.onRefresherrefresh()
|
||||
})
|
||||
},
|
||||
|
||||
doVoidCancel(){
|
||||
this.show = false
|
||||
},
|
||||
/**
|
||||
* 接单上传附件
|
||||
*/
|
||||
openFile(id){
|
||||
this.takeOrderId = id
|
||||
this.$refs.popup.open("bottom")
|
||||
},
|
||||
/**
|
||||
* 接单
|
||||
*/
|
||||
receiveOrder(){
|
||||
let fileStr = this.fileList.map(item=>item.url.replace(config.baseImageUrl,"")).join(",")
|
||||
request({
|
||||
url: '/admin-api/repair/tickets/take',
|
||||
method: 'get',
|
||||
params:{
|
||||
id:this.takeOrderId,
|
||||
image:fileStr
|
||||
}
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.$refs.popup.close()
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '接单成功,请尽快处理!'
|
||||
})
|
||||
this.onRefresherrefresh()
|
||||
}else{
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: res.message
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
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);
|
||||
},
|
||||
/**
|
||||
* 保存当前项目
|
||||
*/
|
||||
@ -581,6 +691,14 @@ export default {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
@include flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 30rpx;
|
||||
height: auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
.container {
|
||||
height: 100%;
|
||||
//background: linear-gradient(180deg, #0174F6 0%, rgba(1, 116, 246, 0) 100%);
|
||||
|
@ -207,18 +207,18 @@
|
||||
<text class="label">定损费</text>
|
||||
<input type="text" style="text-align: left" v-model="formData.confirmFaultMoney" placeholder="请填写定损费"/>
|
||||
</view>
|
||||
<view class="infoItem" style="flex: 1">
|
||||
<view class="infoItem" style="flex: 1" v-if="repairTypes && repairTypes.length>0">
|
||||
<text class="label">维修类型</text>
|
||||
<picker @change="repairTypeChange" :value="repairTypeIndex" :range="repairTypes" range-key="label" v-if="repairTypes">
|
||||
<picker @change="repairTypeChange" :value="repairTypeIndex" :range="repairTypes" range-key="label" >
|
||||
<view class="uni-input">{{ repairTypes[repairTypeIndex].label}}</view>
|
||||
</picker>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;align-items: center">
|
||||
<view class="infoItem" style="flex: 1">
|
||||
<view class="infoItem" style="flex: 1" v-if="partDisposals && partDisposals.length>0">
|
||||
<text class="label">旧件处置方式</text>
|
||||
<picker @change="partDisposalChange" :value="partDisposalIndex" :range="partDisposals" range-key="label" v-if="partDisposals">
|
||||
<picker @change="partDisposalChange" :value="partDisposalIndex" :range="partDisposals" range-key="label" >
|
||||
<view class="uni-input">{{ partDisposals[partDisposalIndex].label}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
@ -334,7 +334,8 @@ export default {
|
||||
this.phone = data.phone
|
||||
this.listUserInfo()
|
||||
}
|
||||
this.initDict()
|
||||
this.initDict("repair_type")
|
||||
this.initDict("repair_part_disposal")
|
||||
},
|
||||
onShow() {
|
||||
if (this.phone != '') {
|
||||
@ -367,27 +368,38 @@ export default {
|
||||
},
|
||||
|
||||
|
||||
initDict(){
|
||||
let dictArray = getStorageWithExpiry('repair_type');
|
||||
async initDict(dictCode){
|
||||
let dictArray = getStorageWithExpiry(dictCode);
|
||||
console.log(dictArray,"partDisposals")
|
||||
if(null==dictArray || undefined==dictArray){
|
||||
request({
|
||||
url: '/admin-api/system/dict-data/type',
|
||||
method: 'get',
|
||||
params:{type:'repair_type'}
|
||||
params:{type:dictCode}
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
setStorageWithExpiry('repair_type',res.data,3600)
|
||||
this.repairTypes = dictArray
|
||||
this.buildRepairType()
|
||||
setStorageWithExpiry(dictCode,res.data,3600)
|
||||
this.$nextTick(()=>{
|
||||
if("repair_type"==dictCode){
|
||||
this.repairTypes = res.data
|
||||
this.buildRepairType()
|
||||
}else{
|
||||
this.partDisposals = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.repairTypes = dictArray
|
||||
this.buildRepairType()
|
||||
this.$nextTick(()=>{
|
||||
if("repair_type"==dictCode){
|
||||
this.repairTypes = dictArray
|
||||
this.buildRepairType()
|
||||
}else{
|
||||
this.partDisposals = dictArray
|
||||
}
|
||||
})
|
||||
}
|
||||
this.partDisposals = getDictByCode('repair_part_disposal')
|
||||
console.log(this.pageData.repairType,"this.pageData.repairType")
|
||||
},
|
||||
buildRepairType(){
|
||||
if(this.pageData.repairType){
|
||||
|
Loading…
Reference in New Issue
Block a user