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>
</view>
<view class="t-title">
<text>新增线下订单</text>
<text>{{title}}</text>
</view>
<view class="t-you"></view>
</view>
@ -84,7 +84,7 @@
</view>
<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 class="xixi">点击选择</text>
@ -128,7 +128,7 @@
</view>
<view class="list-box" @click="toSelectProject()">
<view class="list-box" @click="toSelectProject()" v-if="isInsert">
<view class="l-left">检测流程</view>
<view class="l-right">
@ -138,22 +138,25 @@
</view>
<view class="dlanniu" @click="getgoodes()">
<view class="dlanniu" @click="getgoodes()" v-if="isInsert">
<text>开始检测</text>
</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>
<u-picker :show="shownature" :columns="nature" @confirm="confirmsnature" @cancel="cancelsnature"
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>
<u-picker :show="showzhi" :columns="zhilist" @confirm="confirmzhi" @cancel="cancelzhi"
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>
</view>
</view>
@ -175,6 +178,7 @@ export default {
return {
imagePath: '',
fileList: [],
title: '新增线下订单',
customerSource: '',
buyName: '',
nickname:'',
@ -193,6 +197,9 @@ export default {
showLeadMan: false,
skuId: 0,
inspectionWorkNodes: [],
defaultIndex:[0],
kehuDefaultIndex:[0],
goodsDefaultIndex:[0,0],
columns: [],
options: [],
nature: [],
@ -217,10 +224,13 @@ export default {
customerData: [],
inspectionWorkNodeStr: "",
leadManId:undefined,
leadManList: []
leadManList: [],
isInsert:true,
inspectionId: undefined,
xinDefaultIndex:[0]
}
},
onLoad() {
onLoad(options) {
this.getinitialize()
this.getLeadeMan()
uni.$on('selectProject', (data) => {
@ -229,15 +239,29 @@ export default {
this.inspectionWorkNodeStr = this.inspectionWorkNodeStr + this.inspectionWorkNodes[i].projectName + " "
this.inspectionWorkNodes[i].orderNum = i + 1
}
});
if (options.inspectionInfoId){
this.isInsert = false
this.inspectionId = options.inspectionInfoId
this.title = '修改线下订单'
this.getInspectionInfo()
}
},
onShow() {
},
methods: {
handleClick() {
if (this.isInsert) {
this.showgoods = true;
} else {
uni.showToast({
title: '不可修改商品',
icon: 'none'
})
}
},
changeHandler(e) {
const {
columnIndex,
@ -393,8 +417,136 @@ export default {
setTimeout(() => {
uni.navigateBack()
}, 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);
})
},
//

File diff suppressed because it is too large Load Diff

View File

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