|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
<template> |
|
|
|
|
<view> |
|
|
|
|
<view style="padding-bottom: 42rpx;"> |
|
|
|
|
<view class="selectContent" style="border:none;background-color: #fff;"> |
|
|
|
|
<picker @change="changeMode" mode="selector" range-key="text" :value="index" :range="modeList"> |
|
|
|
|
<u-field v-model="send_name" :disabled="true" label="发货模式" placeholder="请选择发货模式" |
|
|
|
@ -8,9 +8,10 @@ |
|
|
|
|
</picker> |
|
|
|
|
<u-field v-model="form.send_company" label="发货公司" placeholder="请输入发货公司"> |
|
|
|
|
</u-field> |
|
|
|
|
<u-field v-model="form.receiver" label="发货人" placeholder="请输入发货人名称"> |
|
|
|
|
<u-field v-model="form.sender" label="发货人" placeholder="请输入发货人名称"> |
|
|
|
|
</u-field> |
|
|
|
|
<u-field v-model="form.receiver_phone" type="number" maxlength="13" label="发货人电话" placeholder="请输入发货人手机号"> |
|
|
|
|
<u-field v-model="form.send_phone" type="number" @input="handleInput" maxlength="13" label="发货人电话" |
|
|
|
|
placeholder="请输入发货人手机号"> |
|
|
|
|
</u-field> |
|
|
|
|
<picker @change="changeOption" mode="selector" range-key="express_name" :value="index" :range="expressList"> |
|
|
|
|
<u-field v-model="express_name" :disabled="true" label="物流公司" placeholder="请选择物流公司" |
|
|
|
@ -30,8 +31,9 @@ |
|
|
|
|
<view class="recordTitle"> |
|
|
|
|
转账记录<text class="intro">最多上传6张</text> |
|
|
|
|
</view> |
|
|
|
|
<u-upload :action="action" :header="header" @on-uploaded="transferSuccess" name="file_path" |
|
|
|
|
width="180" height="180" :file-list="transferList" :custom-btn="true" max-count="6"> |
|
|
|
|
<u-upload :action="action" :header="header" @on-uploaded="transferSuccess" |
|
|
|
|
@on-remove="onRemoveTransfer" width="180" height="180" :file-list="transferList" |
|
|
|
|
:custom-btn="true" max-count="6"> |
|
|
|
|
<template v-slot:addBtn> |
|
|
|
|
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> |
|
|
|
|
<image src="/static/news/icon-upload.png"></image> |
|
|
|
@ -44,8 +46,8 @@ |
|
|
|
|
<view class="recordTitle"> |
|
|
|
|
聊天记录<text class="intro">最多上传6张</text> |
|
|
|
|
</view> |
|
|
|
|
<u-upload :action="action" :header="header" @on-uploaded="chatSuccess" name="file_path" width="180" |
|
|
|
|
height="180" :file-list="chatList" :custom-btn="true" max-count="6"> |
|
|
|
|
<u-upload :action="action" :header="header" @on-uploaded="chatSuccess" width="180" |
|
|
|
|
@on-remove="onRemoveChat" height="180" :file-list="chatList" :custom-btn="true" max-count="6"> |
|
|
|
|
<template v-slot:addBtn> |
|
|
|
|
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150"> |
|
|
|
|
<image src="/static/news/icon-upload.png"></image> |
|
|
|
@ -55,13 +57,10 @@ |
|
|
|
|
</u-upload> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="footerBtn" @click="onSubmit"> |
|
|
|
|
保存 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="footerBtn" @click="onSubmit"> |
|
|
|
|
保存 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -85,7 +84,9 @@ |
|
|
|
|
action: '', |
|
|
|
|
action: '', |
|
|
|
|
transferList: [], |
|
|
|
|
handleList: [], |
|
|
|
|
chatList: [], |
|
|
|
|
handChatList: [], |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(o) { |
|
|
|
@ -97,18 +98,17 @@ |
|
|
|
|
if (this.form.transfer_image_ids) { |
|
|
|
|
let list = this.form.transfer_image_ids |
|
|
|
|
list.forEach(item => { |
|
|
|
|
item.url = item.file_path |
|
|
|
|
item.url = item.file_path; |
|
|
|
|
}); |
|
|
|
|
this.transferList = list |
|
|
|
|
} |
|
|
|
|
if (this.form.chat_image_ids) { |
|
|
|
|
let list = this.form.chat_image_ids |
|
|
|
|
list.forEach(item => { |
|
|
|
|
item.url = item.file_path |
|
|
|
|
item.url = item.file_path; |
|
|
|
|
}); |
|
|
|
|
this.chatList = list |
|
|
|
|
} |
|
|
|
|
console.log(this.chatList, this.transferList) |
|
|
|
|
}, |
|
|
|
|
onReady() { |
|
|
|
|
this.action = (Config.get('apiUrl') + 'upload/image').replace("index.php?s=/", "") |
|
|
|
@ -120,9 +120,39 @@ |
|
|
|
|
this.getExpressAll() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
handleInput(e) { |
|
|
|
|
if (this.validatePhoneNumber(event.target.value)) { |
|
|
|
|
this.form.send_phone = event.target.value |
|
|
|
|
} else { |
|
|
|
|
this.form.send_phone = '' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
validatePhoneNumber(phone) { |
|
|
|
|
var regExp = /^1[3456789]\d{9}$/; |
|
|
|
|
if (regExp.test(phone)) { |
|
|
|
|
return true; |
|
|
|
|
} else { |
|
|
|
|
return this.$toast('手机号不合法') |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 提交信息 |
|
|
|
|
async onSubmit() { |
|
|
|
|
const that = this; |
|
|
|
|
// 转账记录 |
|
|
|
|
let trList = [] |
|
|
|
|
this.transferList = this.transferList.concat(this.handleList); |
|
|
|
|
this.transferList.forEach(item => { |
|
|
|
|
trList.push(item.file_id) |
|
|
|
|
}); |
|
|
|
|
this.form.transfer_image_id = trList.join(','); |
|
|
|
|
// 聊天记录 |
|
|
|
|
let atList = [] |
|
|
|
|
this.chatList = this.chatList.concat(this.handChatList); |
|
|
|
|
this.chatList.forEach(item => { |
|
|
|
|
atList.push(item.file_id) |
|
|
|
|
}); |
|
|
|
|
this.form.chat_image_id = atList.join(','); |
|
|
|
|
console.log(that.form) |
|
|
|
|
if (!that.send_name) { |
|
|
|
|
return that.$toast('请选择发货模式') |
|
|
|
@ -145,20 +175,32 @@ |
|
|
|
|
if (!that.form.transfer_image_id) { |
|
|
|
|
return that.$toast('请上传转账记录') |
|
|
|
|
} |
|
|
|
|
let parmes = { |
|
|
|
|
id: that.form.id, |
|
|
|
|
send_type: that.form.send_type, |
|
|
|
|
send_company: that.form.send_company, |
|
|
|
|
sender: that.form.sender, |
|
|
|
|
send_phone: that.form.send_phone, |
|
|
|
|
express_no: that.form.express_no, |
|
|
|
|
express_id: that.form.express_id, |
|
|
|
|
chat_image_id: that.form.chat_image_id, |
|
|
|
|
transfer_image_id: that.form.transfer_image_id, |
|
|
|
|
} |
|
|
|
|
let { |
|
|
|
|
status, |
|
|
|
|
message, |
|
|
|
|
data |
|
|
|
|
} = await newFunApi.editTransfer(that.form); |
|
|
|
|
} = await newFunApi.editTransfer(parmes); |
|
|
|
|
if (status == 200) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "录入成功" |
|
|
|
|
}) |
|
|
|
|
return |
|
|
|
|
uni.$emit('refreshData'); |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 |
|
|
|
|
}) |
|
|
|
|
setTimeout(function() { |
|
|
|
|
uni.$emit('refreshData'); |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 |
|
|
|
|
}) |
|
|
|
|
}, 2000); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
changeMode(e) { |
|
|
|
@ -194,32 +236,57 @@ |
|
|
|
|
url: "/pages/news3/LogisticsDetails?logisticsNum=" + this.form.express_no |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
onRemoveTransfer(index) { |
|
|
|
|
this.transferList.splice(index, 1) |
|
|
|
|
}, |
|
|
|
|
onRemoveChat(index) { |
|
|
|
|
this.chatList.splice(index, 1) |
|
|
|
|
}, |
|
|
|
|
//接受上传返回的数据 |
|
|
|
|
transferSuccess(list) { |
|
|
|
|
console.log(list) |
|
|
|
|
let nList = [] |
|
|
|
|
list.forEach(item => { |
|
|
|
|
if (item.response) { |
|
|
|
|
nList.push(item) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
list = nList |
|
|
|
|
if (list.length > 0) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "上传成功" |
|
|
|
|
}) |
|
|
|
|
let idList = [] |
|
|
|
|
list.forEach(item => { |
|
|
|
|
idList.push(item.response.data.fileInfo.file_id) |
|
|
|
|
}); |
|
|
|
|
this.form.transfer_image_id = idList.join(','); |
|
|
|
|
const { |
|
|
|
|
response |
|
|
|
|
} = list[0]; |
|
|
|
|
if (response.status == 200) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "上传成功" |
|
|
|
|
}) |
|
|
|
|
this.handleList = [] |
|
|
|
|
list.forEach(item => { |
|
|
|
|
this.handleList.push(item.response.data.fileInfo) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//接受上传返回的数据 |
|
|
|
|
chatSuccess(list) { |
|
|
|
|
let nList = [] |
|
|
|
|
list.forEach(item => { |
|
|
|
|
if (item.response) { |
|
|
|
|
nList.push(item) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
list = nList |
|
|
|
|
if (list.length > 0) { |
|
|
|
|
if (response) { |
|
|
|
|
const { |
|
|
|
|
response |
|
|
|
|
} = list[0]; |
|
|
|
|
if (response.status == 200) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "上传成功" |
|
|
|
|
}) |
|
|
|
|
let idList = [] |
|
|
|
|
this.handChatList = [] |
|
|
|
|
list.forEach(item => { |
|
|
|
|
idList.push(item.response.data.fileInfo.file_id) |
|
|
|
|
this.handChatList.push(item.response.data.fileInfo) |
|
|
|
|
}); |
|
|
|
|
this.form.chat_image_id = idList.join(','); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -237,7 +304,7 @@ |
|
|
|
|
.selectContent { |
|
|
|
|
border-top: 1px solid transparent; |
|
|
|
|
margin-top: 6upx; |
|
|
|
|
padding-bottom: 100upx; |
|
|
|
|
padding: 0 40upx !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::v-deep .u-border-bottom:after { |
|
|
|
@ -245,7 +312,7 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::v-deep .u-field { |
|
|
|
|
padding: 20upx 40upx !important; |
|
|
|
|
padding: 20upx 0 !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::v-deep .uni-input-wrapper { |
|
|
|
@ -259,6 +326,8 @@ |
|
|
|
|
::v-deep .u-flex-1 { |
|
|
|
|
width: 360upx !important; |
|
|
|
|
text-align: right !important; |
|
|
|
|
color: #B0B0B0 !important; |
|
|
|
|
margin: 0 !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.wuliu { |
|
|
|
@ -283,13 +352,13 @@ |
|
|
|
|
color: #F55349; |
|
|
|
|
line-height: 52upx; |
|
|
|
|
text-align: center; |
|
|
|
|
margin-right: 30upx; |
|
|
|
|
margin-left: 10upx; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.recordList { |
|
|
|
|
padding: 30upx; |
|
|
|
|
padding: 0 0 30upx 0; |
|
|
|
|
|
|
|
|
|
.recordItem { |
|
|
|
|
.recordTitle { |
|
|
|
@ -330,7 +399,7 @@ |
|
|
|
|
color: #FFFFFF; |
|
|
|
|
line-height: 88upx; |
|
|
|
|
text-align: center; |
|
|
|
|
margin: 96upx auto 0 auto; |
|
|
|
|
margin: 42upx auto 0 auto; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|