更新
This commit is contained in:
parent
387fa2db59
commit
39c2befe0d
@ -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);
|
||||
})
|
||||
},
|
||||
|
||||
// 提交
|
||||
|
@ -103,7 +103,8 @@
|
||||
<text style="width:30%;box-sizing: border-box;padding-left: 5px;"> {{ item.title }}</text>
|
||||
<text class="times">{{ item.createTime }}</text>
|
||||
<text class="times">施工人员:
|
||||
{{ item.nickname }}</text>
|
||||
{{ item.nickname }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view class="">
|
||||
@ -168,9 +169,9 @@
|
||||
<text>{{ item.text }}</text>
|
||||
</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_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 }}
|
||||
</view>
|
||||
</view>
|
||||
@ -223,7 +224,8 @@
|
||||
<text>备注:</text>
|
||||
|
||||
</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;">
|
||||
@ -236,7 +238,8 @@
|
||||
keyName="label"></u-picker>
|
||||
|
||||
<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>
|
||||
</uni-popup>
|
||||
</view>
|
||||
@ -285,7 +288,7 @@
|
||||
shelist: [],
|
||||
isPass: "1",
|
||||
remark: '',
|
||||
csId: '',
|
||||
csId: [],
|
||||
sfou: [{
|
||||
text: '合格',
|
||||
value: "1"
|
||||
@ -296,7 +299,10 @@
|
||||
},
|
||||
],
|
||||
cstb: [{
|
||||
text: '重审',
|
||||
text: '重检',
|
||||
value: "2"
|
||||
}, {
|
||||
text: '复检',
|
||||
value: "1"
|
||||
},
|
||||
{
|
||||
@ -360,17 +366,17 @@
|
||||
}).then(res => {
|
||||
this.selectProject = res.data
|
||||
//查询当前是否是第一个节点或最后一个节点
|
||||
let data = {
|
||||
inspectionId: this.inspectionId,
|
||||
workNodeId: this.workNodeId
|
||||
}
|
||||
request({
|
||||
url: '/system/info/orImages',
|
||||
method: 'get',
|
||||
params: data
|
||||
}).then(res => {
|
||||
this.orImages = res.data
|
||||
})
|
||||
// let data = {
|
||||
// inspectionId: this.inspectionId,
|
||||
// workNodeId: this.workNodeId
|
||||
// }
|
||||
// request({
|
||||
// url: '/system/info/orImages',
|
||||
// method: 'get',
|
||||
// params: data
|
||||
// }).then(res => {
|
||||
// this.orImages = res.data
|
||||
// })
|
||||
})
|
||||
},
|
||||
jisuan() {
|
||||
@ -415,41 +421,49 @@
|
||||
});
|
||||
},
|
||||
async submit() {
|
||||
let inspectionInfo = {
|
||||
inspectionInfoId: this.inspectionInfoId,
|
||||
isPass: this.isPass,
|
||||
id: this.workNodeId,
|
||||
remark: this.remark,
|
||||
dealImages: this.fileList2.join(","),
|
||||
}
|
||||
let status = 0
|
||||
if (this.isPass == '1') {
|
||||
status = 3
|
||||
} else if (this.tbindex == 1 && this.isRetrial == 1) {
|
||||
if (this.csId == '' || this.csId == undefined) {
|
||||
uni.showToast({
|
||||
title: '请选择要返回的节点',
|
||||
title: '请选择要复检的项目',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.workNodeId = this.csId
|
||||
status = 2
|
||||
const workNodes = []
|
||||
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) {
|
||||
status = 1
|
||||
}
|
||||
//判断当前节点是否需要上传图片
|
||||
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(","),
|
||||
}
|
||||
inspectionInfo.selectType = status
|
||||
|
||||
let res = await request({
|
||||
// url: '/partnerOwn/partner/stopInspection',
|
||||
url: '/system/info/controls',
|
||||
@ -504,7 +518,15 @@
|
||||
}
|
||||
},
|
||||
clickProject(data) {
|
||||
this.csId = data.id
|
||||
//判断当前id是否存在csId数组里面
|
||||
let index = this.csId.indexOf(data.id)
|
||||
if (index !== -1) {
|
||||
// 如果存在,则从数组中删除
|
||||
this.csId.splice(index, 1);
|
||||
} else {
|
||||
// 如果不存在,则添加到数组中
|
||||
this.csId.push(data.id);
|
||||
}
|
||||
},
|
||||
async getindex() {
|
||||
|
||||
@ -516,7 +538,6 @@
|
||||
}
|
||||
})
|
||||
this.detailData = res.data
|
||||
console.log('this.detailData',this.detailData)
|
||||
this.detailData.stepInfos.forEach(item => {
|
||||
// 检查 item.images 是否为有效的字符串
|
||||
if (typeof item.images === 'string' && item.images.trim() !== '') {
|
||||
@ -535,7 +556,6 @@
|
||||
|
||||
// 输出最终结果
|
||||
});
|
||||
console.log('图片', this.detailData);
|
||||
|
||||
|
||||
this.inspectionId = res.data.inspectionId
|
||||
@ -822,7 +842,8 @@
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.box {}
|
||||
.box {
|
||||
}
|
||||
|
||||
.box-dis {
|
||||
box-sizing: border-box;
|
||||
|
@ -248,6 +248,7 @@ export default {
|
||||
tapqh(index) {
|
||||
this.tapindex = index
|
||||
this.infoDatas = []
|
||||
this.pageNum = 1
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user