|
|
|
@ -2,56 +2,61 @@ |
|
|
|
|
<view> |
|
|
|
|
<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="form.setGoodsMode" :disabled="true" label="发货模式" placeholder="请选择" |
|
|
|
|
<u-field v-model="send_name" :disabled="true" label="发货模式" placeholder="请选择发货模式" |
|
|
|
|
right-icon="arrow-right"> |
|
|
|
|
</u-field> |
|
|
|
|
</picker> |
|
|
|
|
<u-field v-model="form.company" label="发货公司" placeholder="请输入"> |
|
|
|
|
<u-field v-model="form.send_company" label="发货公司" placeholder="请输入发货公司"> |
|
|
|
|
</u-field> |
|
|
|
|
<u-field v-model="form.name" label="发货人" placeholder="请输入"> |
|
|
|
|
<u-field v-model="form.receiver" label="发货人" placeholder="请输入发货人名称"> |
|
|
|
|
</u-field> |
|
|
|
|
<u-field v-model="form.phone" label="发货人电话" placeholder="请输入"> |
|
|
|
|
<u-field v-model="form.receiver_phone" type="number" maxlength="13" label="发货人电话" placeholder="请输入发货人手机号"> |
|
|
|
|
</u-field> |
|
|
|
|
<picker @change="changeOption" mode="selector" range-key="express_name" :value="index" :range="expressList"> |
|
|
|
|
<u-field v-model="form.logisticsName" :disabled="true" label="物流公司" placeholder="请选择物流公司" |
|
|
|
|
<u-field v-model="express_name" :disabled="true" label="物流公司" placeholder="请选择物流公司" |
|
|
|
|
right-icon="arrow-right"> |
|
|
|
|
</u-field> |
|
|
|
|
</picker> |
|
|
|
|
<u-action-sheet :list="kuaidiList" v-model="goodsShow"></u-action-sheet> |
|
|
|
|
<view class="wuliu"> |
|
|
|
|
<u-field style="flex: 1;padding:30upx 0 30upx 30upx" v-model="form.logisticsNo" label="物流单号" |
|
|
|
|
placeholder="请填写物流单号"> |
|
|
|
|
<u-field class='fanfan' style="flex: 1;padding:30upx 0 30upx 30upx" v-model="form.express_no" |
|
|
|
|
label="物流单号" placeholder="请填写物流单号"> |
|
|
|
|
</u-field> |
|
|
|
|
<view class="getWuliu" @click="onLogistics"> |
|
|
|
|
查看物流 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="recordList"> |
|
|
|
|
<view class="recordItem"> |
|
|
|
|
<view class="recordItem c"> |
|
|
|
|
<view class="recordTitle"> |
|
|
|
|
转账记录 |
|
|
|
|
</view> |
|
|
|
|
<view class="picList"> |
|
|
|
|
<image :src="$picUrl+'/static/news3/filter.png'" mode="aspectFit"></image> |
|
|
|
|
<image :src="$picUrl+'/static/news3/filter.png'" mode="aspectFit"></image> |
|
|
|
|
<image :src="$picUrl+'/static/news3/filter.png'" mode="aspectFit"></image> |
|
|
|
|
<image :src="$picUrl+'/static/news3/filter.png'" mode="aspectFit"></image> |
|
|
|
|
转账记录<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"> |
|
|
|
|
<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> |
|
|
|
|
<view class="1">上传图片</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
</u-upload> |
|
|
|
|
</view> |
|
|
|
|
<view class="recordItem"> |
|
|
|
|
<view class="recordItem c"> |
|
|
|
|
<view class="recordTitle"> |
|
|
|
|
聊天记录 |
|
|
|
|
</view> |
|
|
|
|
<view class="picList"> |
|
|
|
|
<image :src="$picUrl+'/static/news3/filter.png'" mode="aspectFit"></image> |
|
|
|
|
<image :src="$picUrl+'/static/news3/filter.png'" mode="aspectFit"></image> |
|
|
|
|
<image :src="$picUrl+'/static/news3/filter.png'" mode="aspectFit"></image> |
|
|
|
|
<image :src="$picUrl+'/static/news3/filter.png'" mode="aspectFit"></image> |
|
|
|
|
聊天记录<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"> |
|
|
|
|
<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> |
|
|
|
|
<view class="1">上传图片</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
</u-upload> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="footerBtn"> |
|
|
|
|
<view class="footerBtn" @click="onSubmit"> |
|
|
|
|
保存 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -62,38 +67,107 @@ |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import * as newFunApi from '@/api/newFun' |
|
|
|
|
import Config from '@/core/config' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
form: { |
|
|
|
|
setGoodsMode: '', |
|
|
|
|
company: '', |
|
|
|
|
name: '', |
|
|
|
|
phone: '', |
|
|
|
|
kuaidi: '', |
|
|
|
|
logisticsName: '', |
|
|
|
|
logisticsNo: '', |
|
|
|
|
logisticsId:'', |
|
|
|
|
}, |
|
|
|
|
send_name: '', |
|
|
|
|
express_name: '', |
|
|
|
|
form: {}, |
|
|
|
|
modeList: [{ |
|
|
|
|
text: '店内现货', |
|
|
|
|
id: 0, |
|
|
|
|
}, { |
|
|
|
|
text: '仓库发货', |
|
|
|
|
id: 1, |
|
|
|
|
}], |
|
|
|
|
expressList: [], |
|
|
|
|
modeShow: false, |
|
|
|
|
goodsShow: false, |
|
|
|
|
action: '', |
|
|
|
|
action: '', |
|
|
|
|
transferList: [], |
|
|
|
|
chatList: [], |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(o) { |
|
|
|
|
this.form = JSON.parse(o.item) |
|
|
|
|
this.send_name = this.modeList[this.form.send_type].text; |
|
|
|
|
this.transferList = this.form.transfer_image_ids; |
|
|
|
|
this.chatList = this.form.chat_image_ids; |
|
|
|
|
console.log(this.form) |
|
|
|
|
if (this.form.transfer_image_ids) { |
|
|
|
|
let list = this.form.transfer_image_ids |
|
|
|
|
list.forEach(item => { |
|
|
|
|
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 |
|
|
|
|
}); |
|
|
|
|
this.chatList = list |
|
|
|
|
} |
|
|
|
|
console.log(this.chatList, this.transferList) |
|
|
|
|
}, |
|
|
|
|
onReady() { |
|
|
|
|
this.action = (Config.get('apiUrl') + 'upload/image').replace("index.php?s=/", "") |
|
|
|
|
this.header = { |
|
|
|
|
'Storeid': uni.getStorageSync('Store').storeInfo.store_id, |
|
|
|
|
'Access-Token': uni.getStorageSync('AccessToken'), |
|
|
|
|
'platform': "MP-WEIXIN", |
|
|
|
|
} |
|
|
|
|
this.getExpressAll() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 提交信息 |
|
|
|
|
async onSubmit() { |
|
|
|
|
const that = this; |
|
|
|
|
console.log(that.form) |
|
|
|
|
if (!that.send_name) { |
|
|
|
|
return that.$toast('请选择发货模式') |
|
|
|
|
} |
|
|
|
|
if (!that.form.send_company) { |
|
|
|
|
return that.$toast('请输入发货公司') |
|
|
|
|
} |
|
|
|
|
if (!that.form.sender) { |
|
|
|
|
return that.$toast('请输入发货人') |
|
|
|
|
} |
|
|
|
|
if (!that.form.send_phone) { |
|
|
|
|
return that.$toast('请输入发货手机号') |
|
|
|
|
} |
|
|
|
|
if (!that.express_name) { |
|
|
|
|
return that.$toast('请选择物流公司') |
|
|
|
|
} |
|
|
|
|
if (!that.form.express_no) { |
|
|
|
|
return that.$toast('请输入物流单号') |
|
|
|
|
} |
|
|
|
|
if (!that.form.transfer_image_id) { |
|
|
|
|
return that.$toast('请上传转账记录') |
|
|
|
|
} |
|
|
|
|
let { |
|
|
|
|
status, |
|
|
|
|
message, |
|
|
|
|
data |
|
|
|
|
} = await newFunApi.editTransfer(that.form); |
|
|
|
|
if (status == 200) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "录入成功" |
|
|
|
|
}) |
|
|
|
|
return |
|
|
|
|
uni.$emit('refreshData'); |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
changeMode(e) { |
|
|
|
|
this.form.setGoodsMode = this.modeList[e.detail.value].text; |
|
|
|
|
}, |
|
|
|
|
// 选择物流 |
|
|
|
|
changeOption(e) { |
|
|
|
|
this.form.logisticsName = this.expressList[e.detail.value].express_name; |
|
|
|
|
this.form.logisticsId = this.expressList[e.detail.value].express_id |
|
|
|
|
this.express_name = this.expressList[e.detail.value].express_name; |
|
|
|
|
this.form.express_id = this.expressList[e.detail.value].express_id |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* 物流 |
|
|
|
@ -106,14 +180,49 @@ |
|
|
|
|
} = await newFunApi.expressAll(); |
|
|
|
|
if (status == 200) { |
|
|
|
|
this.expressList = data.list; |
|
|
|
|
this.express_name = this.findNameById(this.expressList, this.form.express_id) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 通过ID查找名称 |
|
|
|
|
findNameById(array, express_id) { |
|
|
|
|
const result = array.find((item) => item.express_id === express_id); |
|
|
|
|
return result.express_name; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
onLogistics() { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: "/pages/news3/LogisticsDetails?logisticsNum=" + this.form.logisticsNo |
|
|
|
|
url: "/pages/news3/LogisticsDetails?logisticsNum=" + this.form.express_no |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//接受上传返回的数据 |
|
|
|
|
transferSuccess(list) { |
|
|
|
|
console.log(list) |
|
|
|
|
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(','); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//接受上传返回的数据 |
|
|
|
|
chatSuccess(list) { |
|
|
|
|
if (list.length > 0) { |
|
|
|
|
if (response) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "上传成功" |
|
|
|
|
}) |
|
|
|
|
let idList = [] |
|
|
|
|
list.forEach(item => { |
|
|
|
|
idList.push(item.response.data.fileInfo.file_id) |
|
|
|
|
}); |
|
|
|
|
this.form.chat_image_id = idList.join(','); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
@ -136,7 +245,7 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::v-deep .u-field { |
|
|
|
|
padding: 30upx; |
|
|
|
|
padding: 20upx 40upx !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::v-deep .uni-input-wrapper { |
|
|
|
@ -147,10 +256,19 @@ |
|
|
|
|
flex: auto !important |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::v-deep .u-flex-1 { |
|
|
|
|
width: 360upx !important; |
|
|
|
|
text-align: right !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.wuliu { |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
|
|
.fanfan { |
|
|
|
|
padding-right: 0 !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.getWuliu { |
|
|
|
|
width: 130upx; |
|
|
|
|
height: 56upx; |
|
|
|
@ -175,7 +293,7 @@ |
|
|
|
|
|
|
|
|
|
.recordItem { |
|
|
|
|
.recordTitle { |
|
|
|
|
|
|
|
|
|
margin-bottom: 10upx; |
|
|
|
|
font-size: 28upx; |
|
|
|
|
font-family: PingFang SC, PingFang SC; |
|
|
|
|
font-weight: 400; |
|
|
|
@ -215,4 +333,33 @@ |
|
|
|
|
margin: 96upx auto 0 auto; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.c { |
|
|
|
|
padding-top: 20rpx; |
|
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
|
|
.slot-btn { |
|
|
|
|
width: 180rpx; |
|
|
|
|
height: 180rpx; |
|
|
|
|
background: #F6F6F6; |
|
|
|
|
border-radius: 10rpx; |
|
|
|
|
border: 1px solid #C0C0C0; |
|
|
|
|
text-align: center; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
font-weight: 500; |
|
|
|
|
color: #6D6D6D; |
|
|
|
|
|
|
|
|
|
.l { |
|
|
|
|
line-height: 30rpx; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
image { |
|
|
|
|
width: 50rpx; |
|
|
|
|
height: 50rpx; |
|
|
|
|
display: block; |
|
|
|
|
margin: 0 auto; |
|
|
|
|
margin-top: 30rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|