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);
})
},
//

View File

@ -97,30 +97,31 @@
<view class="x-box">
<view class="h-title" style="display: flex;align-items: center;justify-content: space-between;">
<view style="width: 10%;">
<view class="qiu_">{{index +1}}</view>
<view class="qiu_">{{ index + 1 }}</view>
</view>
<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.nickname }}</text>
{{ item.nickname }}
</text>
</view>
<view class="">
<view style="margin-bottom: 5px; box-sizing: border-box;padding-left: 10%">{{ item.content }}</view>
<view style="display: flex" v-if="item.images" >
<!-- <view v-for="it in item.images.split(',')">-->
<view style="display: flex" v-if="item.images">
<!-- <view v-for="it in item.images.split(',')">-->
<!-- <image :src="baseImageUrl+'/'+it" style="width: 28vw; height: 12vh; margin-right: 1vw; " ></image>-->
<!-- <image :src="baseImageUrl+'/'+it" style="width: 28vw; height: 12vh; margin-right: 1vw; " ></image>-->
<!-- </view>-->
<!-- </view>-->
<u-album :urls="item.imageList" style="padding-left: 40px"></u-album>
</view>
</view>
<view style="display: flex;align-items: center;">
<view class="xb_" v-if="index != detailData.stepInfos.length - 1 "> </view>
<view class="xb_" v-if="index != detailData.stepInfos.length - 1 "></view>
</view>
@ -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,18 +238,19 @@
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>
</template>
<script>
import config from '@/config'
import request from '../../utils/request';
import upload from '@/utils/upload.js'
import config from '@/config'
import request from '../../utils/request';
import upload from '@/utils/upload.js'
export default {
export default {
data() {
return {
baseImageUrl: this.$baseImageUrl,
@ -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
} else if (this.tbindex == 0 && this.isRetrial == 0) {
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
//idcsId
let index = this.csId.indexOf(data.id)
if (index !== -1) {
//
this.csId.splice(index, 1);
} else {
//
this.csId.push(data.id);
}
},
async getindex() {
@ -516,14 +538,13 @@
}
})
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() !== '') {
// images
item.images = item.images.split(',');
// 使map
item.images = item.images.map(image => this.baseImageUrl + "/"+image);
item.images = item.images.map(image => this.baseImageUrl + "/" + image);
// imageList
item.imageList = item.images;
@ -535,7 +556,6 @@
//
});
console.log('图片', this.detailData);
this.inspectionId = res.data.inspectionId
@ -639,21 +659,21 @@
this[`fileList${event.name}`].splice(event.index, 1)
},
}
}
}
</script>
<style scoped lang="scss">
image {
image {
width: 100%;
height: 100%;
}
}
.lantong {
.lantong {
background-color: #0D2E8D !important;
color: white;
}
}
.lan-box {
.lan-box {
font-size: 14px;
margin: 5px 10px;
padding: 5px;
@ -661,25 +681,25 @@
background-color: #F4F4F4;
border-radius: 4px;
}
}
.warp-box {
.warp-box {
width: 100%;
display: flex;
align-items: center;
flex-wrap: wrap;
}
}
.content {
.content {
box-sizing: border-box;
width: 100%;
height: 100%;
background: #fff;
}
}
.top-heder {
.top-heder {
width: 100%;
// height: 46px;
background: white;
@ -691,24 +711,24 @@
padding-top: 45px;
padding-bottom: 15px;
margin-bottom: 10px;
}
}
.t-title {
.t-title {
font-size: 17px;
font-weight: bold;
color: #333333;
}
}
.t-left {
.t-left {
width: 10%;
}
}
.t-you {
.t-you {
height: 100%;
width: 10%;
}
}
.x-box {
.x-box {
width: 95%;
margin: 10px auto;
background: #FFFFFF;
@ -724,9 +744,9 @@
// display: flex;
// align-items: center;
// justify-content: center;
}
}
.bottomx {
.bottomx {
margin: 0 auto;
width: 225px;
height: 46px;
@ -737,9 +757,9 @@
align-items: center;
justify-content: center;
color: #0D2E8D;
}
}
.bottomxx {
.bottomxx {
position: fixed;
right: 10px;
bottom: 150px;
@ -753,18 +773,18 @@
align-items: center;
justify-content: center;
color: white;
}
}
.touxiang {
.touxiang {
width: 50px;
height: 50px;
border-radius: 50%;
overflow: hidden;
margin: 10px auto;
}
}
.sanniu {
.sanniu {
width: 105px;
height: 35px;
background: #0D2E8D;
@ -777,9 +797,9 @@
color: #FFFFFF;
line-height: 15px;
margin: 0 auto;
}
}
.xiamxia {
.xiamxia {
width: 30%;
height: 30px;
background: linear-gradient(180deg, #3F61C0 0%, #0D2E8D 100%);
@ -792,9 +812,9 @@
color: #FFFFFF;
line-height: 15px;
margin: 15px auto;
}
}
.annniu {
.annniu {
width: 90%;
height: 45px;
background: linear-gradient(180deg, #3F61C0 0%, #0D2E8D 100%);
@ -807,9 +827,9 @@
color: #FFFFFF;
line-height: 15px;
margin: 15px auto;
}
}
.banniu {
.banniu {
width: 20%;
height: 30px;
background: linear-gradient(180deg, #3F61C0 0%, #0D2E8D 100%);
@ -820,27 +840,28 @@
font-size: 15px;
font-weight: 400;
color: #FFFFFF;
}
}
.box {}
.box {
}
.box-dis {
.box-dis {
box-sizing: border-box;
padding: 15px;
// border-bottom: 1px solid #EEEEEE;
display: flex;
align-items: center;
}
}
.shop-img {
.shop-img {
width: 125px;
height: 125px;
border-radius: 8px;
overflow: hidden;
margin-right: 10px;
}
}
.dis-hui {
.dis-hui {
width: 100%;
display: flex;
align-items: center;
@ -848,24 +869,24 @@
font-weight: 400;
color: #999999;
margin-bottom: 5px;
}
}
.times {
.times {
width: 30%;
font-size: 14px;
font-weight: 600;
color: #999999;
margin-left: 25px;
}
}
.h-title {
.h-title {
font-size: 16px;
font-weight: bold;
color: #333333;
margin-bottom: 5px;
}
}
.box-top {
.box-top {
box-sizing: border-box;
padding: 15px;
border-bottom: 1px solid #EEEEEE;
@ -873,9 +894,9 @@
display: flex;
align-items: center;
justify-content: space-around;
}
}
.t-input {
.t-input {
width: 90%;
margin: 20px auto;
border: 1px solid #0D2E8D;
@ -883,61 +904,61 @@
box-sizing: border-box;
padding: 2px 5px;
}
}
.on-input {
.on-input {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin: 15px auto;
}
}
.on-inputx {
.on-inputx {
width: 100%;
display: flex;
align-items: center;
margin: 15px auto;
}
}
.bottom-input {
.bottom-input {
border-top: 1px solid #F4F4F4;
box-sizing: border-box;
padding-top: 20px;
display: flex;
justify-content: space-between;
width: 100%;
}
}
.o-left {
.o-left {
font-size: 15px;
font-weight: 400;
color: #666666;
}
}
.o-right {
.o-right {
font-size: 15px;
font-weight: 400;
color: #333333;
}
}
.o-zui {
.o-zui {
font-size: 20px;
font-weight: 500;
color: #333333;
}
}
.popup-box {
.popup-box {
overflow: hidden;
border-radius: 8px;
box-sizing: border-box;
padding: 15px;
width: 100%;
background-color: white;
}
}
.sousuo {
.sousuo {
width: 95%;
margin: 0 auto;
margin-left: 0px;
@ -954,24 +975,24 @@
input {
width: 80%;
}
}
}
.list-box {
.list-box {
width: 100%;
height: 300px;
overflow: hidden;
box-sizing: border-box;
}
}
.list_scroll {
.list_scroll {
height: 100%; //
display: flex;
flex-direction: column;
}
}
.list-qiu {
.list-qiu {
width: 95%;
border-bottom: 1px solid #EEEEEE;
box-sizing: border-box;
@ -979,16 +1000,16 @@
display: flex;
justify-content: space-between;
align-items: center;
}
}
.tel {
.tel {
margin-left: 5px;
font-size: 15px;
font-weight: 400;
color: #666666;
}
}
.bd-tel {
.bd-tel {
width: 100%;
border-top: 1px solid #EEEEEE;
box-sizing: border-box;
@ -998,17 +1019,17 @@
justify-content: center;
color: #0D2E8D;
}
}
.imgs-warp {
.imgs-warp {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 10px;
}
}
.imgss {
.imgss {
width: 32%;
height: 110px;
overflow: hidden;
@ -1018,9 +1039,9 @@
height: 100%;
}
}
}
.anniu {
.anniu {
box-sizing: border-box;
padding: 2px 10px;
margin: 0px 10px;
@ -1032,9 +1053,9 @@
display: flex;
align-items: center;
justify-content: center;
}
}
.an {
.an {
box-sizing: border-box;
padding: 2px 10px;
margin: 0px 10px;
@ -1046,15 +1067,15 @@
display: flex;
align-items: center;
justify-content: center;
}
}
.box_ {
.box_ {
width: 100%;
display: flex;
flex-wrap: wrap;
}
}
.box_button {
.box_button {
border-radius: 6px;
border: 1px solid #999;
display: flex;
@ -1065,9 +1086,9 @@
padding: 5px 10px;
margin-right: 5px;
margin-bottom: 5px;
}
}
.box_button_x {
.box_button_x {
border-radius: 6px;
border: 1px solid #0D2E8D;
display: flex;
@ -1080,9 +1101,9 @@
margin-bottom: 5px;
background: #0D2E8D;
color: #fff;
}
}
.qiu_ {
.qiu_ {
width: 35px;
height: 35px;
display: flex;
@ -1091,9 +1112,9 @@
border-radius: 50%;
color: #fff;
background: #0D2E8D;
}
}
.xb_ {
.xb_ {
width: 13%;
height: 35px;
@ -1104,5 +1125,5 @@
color: #0D2E8D;
font-size: 40px;
font-weight: bold;
}
}
</style>

View File

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