This commit is contained in:
许允枞 2024-11-15 17:48:16 +08:00
parent 387fa2db59
commit 39c2befe0d
3 changed files with 1184 additions and 1010 deletions

View File

@ -7,7 +7,7 @@
<uni-icons type="left" size="18"></uni-icons> <uni-icons type="left" size="18"></uni-icons>
</view> </view>
<view class="t-title"> <view class="t-title">
<text>新增线下订单</text> <text>{{title}}</text>
</view> </view>
<view class="t-you"></view> <view class="t-you"></view>
</view> </view>
@ -84,7 +84,7 @@
</view> </view>
<view class="list-box"> <view class="list-box">
<view class="l-left" @click="showgoods = true"> <view class="l-left" @click="handleClick">
<text style="color: red;font-weight: bold;text-align: center;">*</text> <text style="color: red;font-weight: bold;text-align: center;">*</text>
商品选择 商品选择
<text class="xixi">点击选择</text> <text class="xixi">点击选择</text>
@ -128,7 +128,7 @@
</view> </view>
<view class="list-box" @click="toSelectProject()"> <view class="list-box" @click="toSelectProject()" v-if="isInsert">
<view class="l-left">检测流程</view> <view class="l-left">检测流程</view>
<view class="l-right"> <view class="l-right">
@ -138,22 +138,25 @@
</view> </view>
<view class="dlanniu" @click="getgoodes()"> <view class="dlanniu" @click="getgoodes()" v-if="isInsert">
<text>开始检测</text> <text>开始检测</text>
</view> </view>
<u-picker :show="show" :columns="columns" @confirm="confirms" @cancel="cancels" keyName="label"></u-picker> <view class="dlanniu" @click="edit()" v-else>
<text>确认修改</text>
</view>
<u-picker :show="show" :columns="columns" :defaultIndex="kehuDefaultIndex" @confirm="confirms" @cancel="cancels" keyName="label"></u-picker>
<u-picker :show="showgoods" ref="uPicker" :columns="goodsone" @confirm="confirmgoods" @cancel="cancelgoods" <u-picker :show="showgoods" ref="uPicker" :columns="goodsone" :defaultIndex="goodsDefaultIndex" @confirm="confirmgoods" @cancel="cancelgoods"
@change="changeHandler" keyName="label"></u-picker> @change="changeHandler" keyName="label"></u-picker>
<u-picker :show="shownature" :columns="nature" @confirm="confirmsnature" @cancel="cancelsnature" <u-picker :show="shownature" :columns="nature" @confirm="confirmsnature" @cancel="cancelsnature"
keyName="label"></u-picker> keyName="label"></u-picker>
<u-picker :show="showxin" :columns="xinlist" @confirm="confirmxin" @cancel="cancelxin" <u-picker :show="showxin" :columns="xinlist" :defaultIndex="xinDefaultIndex" @confirm="confirmxin" @cancel="cancelxin"
keyName="label"></u-picker> keyName="label"></u-picker>
<u-picker :show="showzhi" :columns="zhilist" @confirm="confirmzhi" @cancel="cancelzhi" <u-picker :show="showzhi" :columns="zhilist" @confirm="confirmzhi" @cancel="cancelzhi"
keyName="label"></u-picker> keyName="label"></u-picker>
<u-picker :show="showLeadMan" :columns="leadManList" @confirm="confirmLeadMan" @cancel="cancelLeadMan" <u-picker :show="showLeadMan" :columns="leadManList" :defaultIndex="defaultIndex" @confirm="confirmLeadMan" @cancel="cancelLeadMan"
keyName="nickname"></u-picker> keyName="nickname"></u-picker>
</view> </view>
</view> </view>
@ -175,6 +178,7 @@ export default {
return { return {
imagePath: '', imagePath: '',
fileList: [], fileList: [],
title: '新增线下订单',
customerSource: '', customerSource: '',
buyName: '', buyName: '',
nickname:'', nickname:'',
@ -193,6 +197,9 @@ export default {
showLeadMan: false, showLeadMan: false,
skuId: 0, skuId: 0,
inspectionWorkNodes: [], inspectionWorkNodes: [],
defaultIndex:[0],
kehuDefaultIndex:[0],
goodsDefaultIndex:[0,0],
columns: [], columns: [],
options: [], options: [],
nature: [], nature: [],
@ -217,10 +224,13 @@ export default {
customerData: [], customerData: [],
inspectionWorkNodeStr: "", inspectionWorkNodeStr: "",
leadManId:undefined, leadManId:undefined,
leadManList: [] leadManList: [],
isInsert:true,
inspectionId: undefined,
xinDefaultIndex:[0]
} }
}, },
onLoad() { onLoad(options) {
this.getinitialize() this.getinitialize()
this.getLeadeMan() this.getLeadeMan()
uni.$on('selectProject', (data) => { uni.$on('selectProject', (data) => {
@ -229,15 +239,29 @@ export default {
this.inspectionWorkNodeStr = this.inspectionWorkNodeStr + this.inspectionWorkNodes[i].projectName + " " this.inspectionWorkNodeStr = this.inspectionWorkNodeStr + this.inspectionWorkNodes[i].projectName + " "
this.inspectionWorkNodes[i].orderNum = i + 1 this.inspectionWorkNodes[i].orderNum = i + 1
} }
}); });
if (options.inspectionInfoId){
this.isInsert = false
this.inspectionId = options.inspectionInfoId
this.title = '修改线下订单'
this.getInspectionInfo()
}
}, },
onShow() { onShow() {
}, },
methods: { methods: {
handleClick() {
if (this.isInsert) {
this.showgoods = true;
} else {
uni.showToast({
title: '不可修改商品',
icon: 'none'
})
}
},
changeHandler(e) { changeHandler(e) {
const { const {
columnIndex, columnIndex,
@ -393,8 +417,136 @@ export default {
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 2000); }, 2000);
},
async edit() {
if (this.carNum == '' || this.customerSource == "" || this.leadManId == undefined) {
uni.showToast({
title: '车牌号 客户来源 引车员 必填!',
icon: 'none'
})
return
}
let data = {
partnerId: uni.getStorageSync('partnerId'),
id: this.inspectionId,
buyName: this.buyName,
buyPhone: this.buyPhone,
userAddress: this.userAddress,
unitName: this.unitName,
carNum: this.carNum,
carModel: this.carModel,
carStatus: this.carStatus,
carIdNo: this.carIdNo,
customerSource: this.customerSource,
skuId: this.skuId,
carNature: this.carNature,
inspectionWorkNodes: this.inspectionWorkNodes,
leadManId: this.leadManId
}
let res = await request({
url: '/system/info/update',
method: 'post',
data: data
})
if (res.code == 200) {
uni.showToast({
title: "修改成功"
})
let resp = await request({
url: '/system/info/getWeorkNodesById',
method: 'get',
params: {
inspectionId: this.inspectionId
}
})
//
let res = await request({
url: '/system/info/recheck',
method: 'post',
data: {
inspectionInfoId: this.inspectionId,
workNodes: resp.data
}
})
}
setTimeout(() => {
uni.navigateTo({
url: '/pages/staff/staff'
})
}, 2000);
},
/*根据工单Id查询工单详情*/
getInspectionInfo(){
request({
url: '/system/info/' + this.inspectionId,
method: 'get'
}).then(res => {
this.shoplist = res.data
this.buyName = res.data.buyName
this.buyPhone = res.data.buyPhone
this.userAddress = res.data.userAddress
this.unitName = res.data.unitName
this.carNum = res.data.carNum
this.carModel = res.data.carModel
this.carStatus = res.data.carStatus
this.carIdNo = res.data.carIdNo
this.customerSource = res.data.customerSource
this.skuId = res.data.skuId
this.carNature = res.data.carNature
this.leadManId = res.data.leadManId
setTimeout(() => {
let result = this.leadManList
.map((subArray, subArrayIndex) => {
const index = subArray.findIndex(item => item.id === res.data.leadManId);
if (index !== -1) {
//
return { subArrayIndex, itemIndex: index };
} else {
// null undefined
return null;
}
})
.filter(item => item !== null); //
let index = result[0].itemIndex
let subArrayIndex = result[0].subArrayIndex
this.defaultIndex = [index]
this.nickname = this.leadManList[subArrayIndex][index].nickname
//
let kehuResult = this.columns
.map((subArray, subArrayIndex) => {
const index = subArray.findIndex(item => item.label === res.data.customerSource);
if (index !== -1) {
//
return { subArrayIndex, itemIndex: index };
} else {
// null undefined
return null;
}
})
.filter(item => item !== null); //
this.kehuDefaultIndex = [kehuResult[0].itemIndex]
//
//
let xinResult = this.xinlist
.map((subArray, subArrayIndex) => {
const index = subArray.findIndex(item => item.label === res.data.carStatus);
if (index !== -1) {
//
return { subArrayIndex, itemIndex: index };
} else {
// null undefined
return null;
}
})
.filter(item => item !== null); //
let a = [kehuResult[0]]
this.xinDefaultIndex = [a.itemIndex]
}, 1000);
})
}, },
// //

View File

@ -103,7 +103,8 @@
<text style="width:30%;box-sizing: border-box;padding-left: 5px;"> {{ item.title }}</text> <text style="width:30%;box-sizing: border-box;padding-left: 5px;"> {{ item.title }}</text>
<text class="times">{{ item.createTime }}</text> <text class="times">{{ item.createTime }}</text>
<text class="times">施工人员: <text class="times">施工人员:
{{ item.nickname }}</text> {{ item.nickname }}
</text>
</view> </view>
<view class=""> <view class="">
@ -168,9 +169,9 @@
<text>{{ item.text }}</text> <text>{{ item.text }}</text>
</view> </view>
</view> </view>
<view class="t-title" v-if="tbindex == 1 && isRetrial == 1 && isPass != '1'">选择重审后回到的节点</view> <view class="t-title" v-if="tbindex == 1 && isRetrial == 1 && isPass != '1'">选择复检的项目</view>
<view class="box_ on-inputx" v-if="tbindex == 1 && isRetrial == 1 && isPass != '1'"> <view class="box_ on-inputx" v-if="tbindex == 1 && isRetrial == 1 && isPass != '1'">
<view class="box_button " :class="{ 'box_button_x' :csId == item.id }" <view class="box_button " :class="{ 'box_button_x' :csId.includes(item.id) }"
v-for="item in selectProject" @click="clickProject(item)">{{ item.projectName }} v-for="item in selectProject" @click="clickProject(item)">{{ item.projectName }}
</view> </view>
</view> </view>
@ -223,7 +224,8 @@
<text>备注</text> <text>备注</text>
</view> </view>
<u--textarea v-model="payRemark" placeholder="如果存在组合付款方式,请在备注中描述清楚" border="bottom"></u--textarea> <u--textarea v-model="payRemark" placeholder="如果存在组合付款方式,请在备注中描述清楚"
border="bottom"></u--textarea>
<view class="bottomx" @click="tiijiao()" style="margin-top: 10px;"> <view class="bottomx" @click="tiijiao()" style="margin-top: 10px;">
@ -236,7 +238,8 @@
keyName="label"></u-picker> keyName="label"></u-picker>
<uni-popup ref="alertDialog" type="dialog"> <uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog cancelText="关闭" confirmText="确定" title="通知" content="您确定制证完成吗" @confirm="dialogConfirm" <uni-popup-dialog cancelText="关闭" confirmText="确定" title="通知" content="您确定制证完成吗"
@confirm="dialogConfirm"
@close="dialogClose"></uni-popup-dialog> @close="dialogClose"></uni-popup-dialog>
</uni-popup> </uni-popup>
</view> </view>
@ -285,7 +288,7 @@
shelist: [], shelist: [],
isPass: "1", isPass: "1",
remark: '', remark: '',
csId: '', csId: [],
sfou: [{ sfou: [{
text: '合格', text: '合格',
value: "1" value: "1"
@ -296,7 +299,10 @@
}, },
], ],
cstb: [{ cstb: [{
text: '重审', text: '重检',
value: "2"
}, {
text: '复检',
value: "1" value: "1"
}, },
{ {
@ -360,17 +366,17 @@
}).then(res => { }).then(res => {
this.selectProject = res.data this.selectProject = res.data
// //
let data = { // let data = {
inspectionId: this.inspectionId, // inspectionId: this.inspectionId,
workNodeId: this.workNodeId // workNodeId: this.workNodeId
} // }
request({ // request({
url: '/system/info/orImages', // url: '/system/info/orImages',
method: 'get', // method: 'get',
params: data // params: data
}).then(res => { // }).then(res => {
this.orImages = res.data // this.orImages = res.data
}) // })
}) })
}, },
jisuan() { jisuan() {
@ -415,41 +421,49 @@
}); });
}, },
async submit() { async submit() {
let inspectionInfo = {
inspectionInfoId: this.inspectionInfoId,
isPass: this.isPass,
id: this.workNodeId,
remark: this.remark,
dealImages: this.fileList2.join(","),
}
let status = 0 let status = 0
if (this.isPass == '1') { if (this.isPass == '1') {
status = 3 status = 3
} else if (this.tbindex == 1 && this.isRetrial == 1) { } else if (this.tbindex == 1 && this.isRetrial == 1) {
if (this.csId == '' || this.csId == undefined) { if (this.csId == '' || this.csId == undefined) {
uni.showToast({ uni.showToast({
title: '请选择要返回的节点', title: '请选择要复检的项目',
icon: 'none' icon: 'none'
}) })
return return
} }
this.workNodeId = this.csId const workNodes = []
status = 2 this.csId.forEach(item => {
let a = {
id: item
}
workNodes.push(a)
})
inspectionInfo.workNodes = workNodes
await request({
url: '/system/info/recheck',
method: 'post',
data: inspectionInfo
})
return
} else if (this.tbindex == 2 && this.isRetrial == 2) {
//
uni.navigateTo({
url: '/pages/index/Neworder?inspectionInfoId=' + this.inspectionInfoId
})
return
}else if (this.tbindex == 0 && this.isRetrial == 0) { }else if (this.tbindex == 0 && this.isRetrial == 0) {
status = 1 status = 1
} }
// inspectionInfo.selectType = status
if (this.orImages) {
//
if (this.fileList2.length == 0) {
uni.showToast({
title: '请上传图片',
icon: 'none'
})
return
}
}
let inspectionInfo = {
inspectionInfoId: this.inspectionInfoId,
isPass: this.isPass,
id: this.workNodeId,
selectType: status,
remark: this.remark,
dealImages: this.fileList2.join(","),
}
let res = await request({ let res = await request({
// url: '/partnerOwn/partner/stopInspection', // url: '/partnerOwn/partner/stopInspection',
url: '/system/info/controls', url: '/system/info/controls',
@ -504,7 +518,15 @@
} }
}, },
clickProject(data) { clickProject(data) {
this.csId = data.id //idcsId
let index = this.csId.indexOf(data.id)
if (index !== -1) {
//
this.csId.splice(index, 1);
} else {
//
this.csId.push(data.id);
}
}, },
async getindex() { async getindex() {
@ -516,7 +538,6 @@
} }
}) })
this.detailData = res.data this.detailData = res.data
console.log('this.detailData',this.detailData)
this.detailData.stepInfos.forEach(item => { this.detailData.stepInfos.forEach(item => {
// item.images // item.images
if (typeof item.images === 'string' && item.images.trim() !== '') { if (typeof item.images === 'string' && item.images.trim() !== '') {
@ -535,7 +556,6 @@
// //
}); });
console.log('图片', this.detailData);
this.inspectionId = res.data.inspectionId this.inspectionId = res.data.inspectionId
@ -822,7 +842,8 @@
color: #FFFFFF; color: #FFFFFF;
} }
.box {} .box {
}
.box-dis { .box-dis {
box-sizing: border-box; box-sizing: border-box;

View File

@ -248,6 +248,7 @@ export default {
tapqh(index) { tapqh(index) {
this.tapindex = index this.tapindex = index
this.infoDatas = [] this.infoDatas = []
this.pageNum = 1
this.getList() this.getList()
} }
} }