d第一次提交
This commit is contained in:
97
Enter/pages/expenses/index.scss
Normal file
97
Enter/pages/expenses/index.scss
Normal file
@@ -0,0 +1,97 @@
|
||||
.expenses-body {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: #f1f2f7;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx 0;
|
||||
.expenses-footer {
|
||||
margin: 20rpx 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
.cancel {
|
||||
width: 194rpx;
|
||||
height: 88rpx;
|
||||
background: rgba(0, 125, 255, 0.5);
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
opacity: 1;
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
.submit {
|
||||
width: 194rpx;
|
||||
height: 88rpx;
|
||||
background: #007dff;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
opacity: 1;
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
.upload-container {
|
||||
.upload-tip {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 5rpx 5rpx 5rpx 5rpx;
|
||||
opacity: 1;
|
||||
// border: 1rpx solid #999999;
|
||||
text {
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
.upload-item {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin-right: 20rpx;
|
||||
position: relative;
|
||||
.colse {
|
||||
position: absolute;
|
||||
background-color: #e0e0e0;
|
||||
top: -15rpx;
|
||||
right: -15rpx;
|
||||
height: 35rpx;
|
||||
width: 35rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
.expenses-form {
|
||||
width: 690rpx;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(132, 132, 132, 0.05);
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
opacity: 1;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
.expenses-form-item {
|
||||
padding-bottom: 30rpx;
|
||||
border-bottom: solid 1rpx #f3f5f7;
|
||||
margin-top: 40rpx;
|
||||
.expenses-form-item-value {
|
||||
font-size: 28rpx;
|
||||
position: relative;
|
||||
}
|
||||
.expenses-form-item-label {
|
||||
width: 249rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
.expenses-form-title {
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.noFormBorder {
|
||||
border-bottom: 0 !important;
|
||||
}
|
||||
167
Enter/pages/expenses/index.vue
Normal file
167
Enter/pages/expenses/index.vue
Normal file
@@ -0,0 +1,167 @@
|
||||
<template>
|
||||
<view class="expenses-body flex column">
|
||||
<view style="overflow: auto;" class="oneflex">
|
||||
<order-item v-if="orderData" :order-data='orderData' type="card"></order-item>
|
||||
<view class="expenses-form">
|
||||
<view class="expenses-form-title">支出费用:</view>
|
||||
<view v-for="(item,index) in submitData.orderFieldDtos" :key="index">
|
||||
<view class="expenses-form-item flex ac noFormBorder">
|
||||
<view class="expenses-form-item-label"><text
|
||||
style="color: red;"></text>{{item.orderOutlay.label}}</view>
|
||||
<view class="expenses-form-item-value oneflex">
|
||||
<input v-model="item.orderOutlay.expense" :placeholder=" `请输入${item.orderOutlay.label}` " />
|
||||
</view>
|
||||
</view>
|
||||
<view class="expenses-form-item flex ac">
|
||||
<view class="expenses-form-item-label">
|
||||
<text style="color: red;"></text> 单据图片
|
||||
</view>
|
||||
<view class="expenses-form-item-value oneflex">
|
||||
<view class="upload-container flex warp ">
|
||||
<view class="upload-item" :key='imagesIndex'
|
||||
v-for="(images,imagesIndex) in item.orderProofs">
|
||||
<view @click="imageRemove(item.orderProofs,imagesIndex)" class="colse">
|
||||
<uni-icons type="closeempty" size="15" color="#686868"></uni-icons>
|
||||
</view>
|
||||
<image style="width: 100%; height: 100%;"
|
||||
@click="previewImage(item.orderProofs,imagesIndex)" :src="images.imageUrl">
|
||||
</image>
|
||||
</view>
|
||||
<view v-if="item.orderProofs.length<3" @click="uploadImagesFn(item.orderProofs)"
|
||||
class="upload-tip flex ac jc column">
|
||||
<uni-icons type="camera" size="20" color=""></uni-icons>
|
||||
<text> 最多三张</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="expenses-footer flex around">
|
||||
<view @click="back" class="cancel flex jc ac">返回</view>
|
||||
<view @click="submit" class="submit flex jc ac">提交</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import orderApi from '@/api/order.js'
|
||||
import orderItem from "@/components/orderItem/orderItem.vue";
|
||||
export default {
|
||||
components: {
|
||||
orderItem
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataMark: uni.getStorageSync('dataMark') || null,
|
||||
submitData: {
|
||||
"id": "",
|
||||
orderFieldDtos:[]
|
||||
},
|
||||
orderData: null,
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
if (e.orderData) {
|
||||
this.orderData = JSON.parse(decodeURIComponent(e.orderData));
|
||||
({
|
||||
id: this.submitData.id = ""
|
||||
} = this.orderData);
|
||||
}
|
||||
if (this.dataMark && this.dataMark?.ORDER_EXPENSES) {
|
||||
this.dataMarkHandle()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
blur(e){
|
||||
|
||||
},
|
||||
focus(e){
|
||||
},
|
||||
back(){
|
||||
uni.navigateBack()
|
||||
},
|
||||
dataMarkHandle() {
|
||||
this.submitData.orderFieldDtos = this.tool.dataMarkHandle(this.dataMark, 'ORDER_EXPENSES');
|
||||
console.log(this.submitData.orderFieldDtos)
|
||||
},
|
||||
submit() {
|
||||
let chenkResult = {
|
||||
result: true
|
||||
}
|
||||
// try {
|
||||
// this.submitData.orderFieldDtos.forEach(item => {
|
||||
// let result = this.tool.checkFn(item.orderOutlay, [], {
|
||||
// expense: {
|
||||
// tacitly: '',
|
||||
// WrongText: `${item.orderOutlay.label}不能为空`
|
||||
// }
|
||||
// });
|
||||
// if (!result.result) {
|
||||
// chenkResult = result;
|
||||
// throw chenkResult.WrongText
|
||||
// }
|
||||
// let result2 = this.tool.checkFn(item, [], {
|
||||
// orderProofs: {
|
||||
// minLength: 1,
|
||||
// WrongText: `${item.orderOutlay.label}图片不能为空`
|
||||
// }
|
||||
// });
|
||||
// if (!result2.result) {
|
||||
// chenkResult = result2;
|
||||
// throw chenkResult.WrongText
|
||||
// }
|
||||
// });
|
||||
// } catch (e) {
|
||||
// uni.showToast({
|
||||
// title:e,
|
||||
// icon:'error'
|
||||
// })
|
||||
// }
|
||||
if (chenkResult.result) {
|
||||
console.log(this.submitData,'this.submitData')
|
||||
orderApi.uploadExpenses(this.submitData).then(res=>{
|
||||
if(res.code==20000){
|
||||
uni.showToast({
|
||||
icon:"success",
|
||||
title:"操作成功"
|
||||
})
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack()
|
||||
},1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
imageRemove(uploadImages = [], index) {
|
||||
uploadImages.splice(index, 1);
|
||||
},
|
||||
previewImage(uploadImages = [], index = undefined) {
|
||||
if (index !== undefined && uploadImages[index] !== undefined) {
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
urls: uploadImages.map(item => item.imageUrl),
|
||||
longPressActions: {
|
||||
success: function(data) {},
|
||||
fail: function(err) {}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log('数据错误=>', ...arguments)
|
||||
}
|
||||
},
|
||||
uploadImagesFn(uploadImages) {
|
||||
this.tool.chooseImage((imageUrl) => {
|
||||
uploadImages.push({
|
||||
imageUrl
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import 'index.scss';
|
||||
</style>
|
||||
86
Enter/pages/receive/index.scss
Normal file
86
Enter/pages/receive/index.scss
Normal file
@@ -0,0 +1,86 @@
|
||||
.receive-body {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: #f1f2f7;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
.receive-footer {
|
||||
margin-bottom: 20rpx;
|
||||
.cancel {
|
||||
width: 194rpx;
|
||||
height: 88rpx;
|
||||
background: rgba(0, 125, 255, 0.5);
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
opacity: 1;
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
.submit {
|
||||
width: 194rpx;
|
||||
height: 88rpx;
|
||||
background: #007dff;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
opacity: 1;
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
.upload-container {
|
||||
.upload-tip {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 5rpx 5rpx 5rpx 5rpx;
|
||||
opacity: 1;
|
||||
// border: 1rpx solid #999999;
|
||||
text {
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
.upload-item {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin-right: 20rpx;
|
||||
position: relative;
|
||||
.colse {
|
||||
position: absolute;
|
||||
background-color: #e0e0e0;
|
||||
top: -15rpx;
|
||||
right: -15rpx;
|
||||
height: 35rpx;
|
||||
width: 35rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
.receive-form {
|
||||
width: 690rpx;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(132, 132, 132, 0.05);
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
opacity: 1;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
.receive-form-item {
|
||||
padding-bottom: 30rpx;
|
||||
border-bottom: solid 1rpx #f3f5f7;
|
||||
margin-top: 40rpx;
|
||||
.receive-form-item-value {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.receive-form-item-label {
|
||||
width: 249rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
.receive-form-title {
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
163
Enter/pages/receive/index.vue
Normal file
163
Enter/pages/receive/index.vue
Normal file
@@ -0,0 +1,163 @@
|
||||
<template>
|
||||
<view class="receive-body flex column">
|
||||
<order-item v-if="orderData" :order-data='orderData' type="card"></order-item>
|
||||
<view class="oneflex">
|
||||
<view class="receive-form">
|
||||
<view class="receive-form-title">信息录入:</view>
|
||||
<view class="receive-form-item flex ac">
|
||||
<view class="receive-form-item-label"><text style="color: red;">*</text>卸货日期</view>
|
||||
<view class="receive-form-item-value oneflex">
|
||||
<uni-datetime-picker v-model="submitData.unloadingDate">
|
||||
{{submitData.unloadingDate||'选择卸货日期'}}
|
||||
</uni-datetime-picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="receive-form-item flex ac">
|
||||
<view class="receive-form-item-label">
|
||||
<text style="color: red;">*</text> 卸货单
|
||||
</view>
|
||||
<view class="receive-form-item-value oneflex">
|
||||
<view class="upload-container flex warp ">
|
||||
<view class="upload-item" :key='index' v-for="(item,index) in submitData.proofsList">
|
||||
<view @click="imageRemove(submitData.proofsList,index)" class="colse">
|
||||
<uni-icons type="closeempty" size="15" color="#686868"></uni-icons>
|
||||
</view>
|
||||
<image style="width: 100%; height: 100%;" @click="previewImage(submitData.proofsList,index)"
|
||||
:src="item.imageUrl"> </image>
|
||||
</view>
|
||||
<view v-if="submitData.proofsList.length<3" @click="uploadImagesFn"
|
||||
class="upload-tip flex ac jc column">
|
||||
<uni-icons type="camera" size="20" color=""></uni-icons>
|
||||
<text> 最多三张</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="receive-footer flex around">
|
||||
<view @click="back" class="cancel flex jc ac">返回</view>
|
||||
<view @click="submit" class="submit flex jc ac">提交</view>
|
||||
</view>
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import orderApi from '@/api/order.js'
|
||||
import orderItem from "@/components/orderItem/orderItem.vue";
|
||||
export default {
|
||||
components: {
|
||||
orderItem
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
checkPage: {
|
||||
unloadingDate: {
|
||||
tacitly: '',
|
||||
WrongText: '卸货时间不能为空'
|
||||
},
|
||||
proofsList:{
|
||||
minLength:1,
|
||||
WrongText: '图片不能为空'
|
||||
}
|
||||
},
|
||||
submitData: {
|
||||
"id": "",
|
||||
"motion":'2',
|
||||
"unloadingDate": "",
|
||||
"proofsList": []
|
||||
},
|
||||
orderData: null,
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
if (e.orderData){
|
||||
this.orderData = JSON.parse(decodeURIComponent(e.orderData));
|
||||
({id:this.submitData.id=""}=this.orderData);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
back(){
|
||||
uni.navigateBack()
|
||||
},
|
||||
submit() {
|
||||
let chenkResult = this.tool.checkFn(this.submitData,[],this.checkPage);
|
||||
if(chenkResult.result){
|
||||
orderApi.cargoMotion(this.submitData).then(res=>{
|
||||
if(res.code==20000){
|
||||
uni.showToast({
|
||||
icon:"success",
|
||||
title:"操作成功"
|
||||
})
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack()
|
||||
},1000)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.$refs.uToast.show({
|
||||
type: 'error',
|
||||
icon: false,
|
||||
title: 'error',
|
||||
message: chenkResult.WrongText,
|
||||
})
|
||||
}
|
||||
},
|
||||
imageRemove(uploadImages = this.submitData.proofsList, index) {
|
||||
this.submitData.proofsList.splice(index, 1);
|
||||
},
|
||||
previewImage(uploadImages = this.submitData.proofsList, index = undefined) {
|
||||
if (index !== undefined && uploadImages[index] !== undefined) {
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
urls:uploadImages.map(item=>item.imageUrl),
|
||||
longPressActions: {
|
||||
success: function(data) { },
|
||||
fail: function(err) { }
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log('数据错误=>', ...arguments)
|
||||
}
|
||||
},
|
||||
uploadImagesFn() {
|
||||
this.tool.chooseImage((imageUrl) => {
|
||||
this.submitData.proofsList.push({
|
||||
imageUrl
|
||||
});
|
||||
})
|
||||
},
|
||||
handleAgreePrivacyAuthorization() {
|
||||
|
||||
},
|
||||
// 获取上传状态
|
||||
select(e) {
|
||||
console.log('选择文件:', e)
|
||||
},
|
||||
// 获取上传进度
|
||||
progress(e) {
|
||||
console.log('上传进度:', e)
|
||||
},
|
||||
|
||||
// 上传成功
|
||||
success(e) {
|
||||
console.log('上传成功')
|
||||
},
|
||||
|
||||
// 上传失败
|
||||
fail(e) {
|
||||
console.log('上传失败:', e)
|
||||
},
|
||||
upload() {
|
||||
wx.openPrivacyContract()
|
||||
// this.$refs.files.upload()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import 'index.scss';
|
||||
</style>
|
||||
86
Enter/pages/send/index.scss
Normal file
86
Enter/pages/send/index.scss
Normal file
@@ -0,0 +1,86 @@
|
||||
.send-body {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: #f1f2f7;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
.send-footer {
|
||||
margin-bottom: 20rpx;
|
||||
.cancel {
|
||||
width: 194rpx;
|
||||
height: 88rpx;
|
||||
background: rgba(0, 125, 255, 0.5);
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
opacity: 1;
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
.submit {
|
||||
width: 194rpx;
|
||||
height: 88rpx;
|
||||
background: #007dff;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
opacity: 1;
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
.upload-container {
|
||||
.upload-tip {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 5rpx 5rpx 5rpx 5rpx;
|
||||
opacity: 1;
|
||||
// border: 1rpx solid #999999;
|
||||
text {
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
.upload-item {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin-right: 20rpx;
|
||||
position: relative;
|
||||
.colse {
|
||||
position: absolute;
|
||||
background-color: #e0e0e0;
|
||||
top: -15rpx;
|
||||
right: -15rpx;
|
||||
height: 35rpx;
|
||||
width: 35rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
.send-form {
|
||||
width: 690rpx;
|
||||
background: #ffffff;
|
||||
box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(132, 132, 132, 0.05);
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
opacity: 1;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
.send-form-item {
|
||||
padding-bottom: 30rpx;
|
||||
border-bottom: solid 1rpx #f3f5f7;
|
||||
margin-top: 40rpx;
|
||||
.send-form-item-value {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.send-form-item-label {
|
||||
width: 249rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
.send-form-title {
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
161
Enter/pages/send/index.vue
Normal file
161
Enter/pages/send/index.vue
Normal file
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<view class="send-body flex column">
|
||||
<order-item v-if="orderData" :order-data='orderData' type="card"></order-item>
|
||||
<view class="oneflex">
|
||||
<view class="send-form">
|
||||
<view class="send-form-title">信息录入:</view>
|
||||
<view class="send-form-item flex ac">
|
||||
<view class="send-form-item-label"><text style="color: red;">*</text>发货日期</view>
|
||||
<view class="send-form-item-value oneflex">
|
||||
<uni-datetime-picker v-model="submitData.departureDate">
|
||||
{{submitData.departureDate||'选择发货日期'}}
|
||||
</uni-datetime-picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="send-form-item flex ac">
|
||||
<view class="send-form-item-label"><text style="color: red;">*</text>货物重量(吨)</view>
|
||||
<view class="send-form-item-value oneflex">
|
||||
<input v-model="submitData.weight" placeholder="请输入货物重量" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="send-form-item flex ac">
|
||||
<view class="send-form-item-label"> <text style="color: red;">*</text> 发货单</view>
|
||||
<view class="send-form-item-value oneflex">
|
||||
<view class="upload-container flex warp ">
|
||||
<view class="upload-item" :key='index' v-for="(item,index) in submitData.proofsList">
|
||||
<view @click="imageRemove(submitData.proofsList,index)" class="colse">
|
||||
<uni-icons type="closeempty" size="15" color="#686868"></uni-icons>
|
||||
</view>
|
||||
<image style="width: 100%; height: 100%;" @click="previewImage(submitData.proofsList,index)"
|
||||
:src="item.imageUrl"> </image>
|
||||
</view>
|
||||
<view v-if="submitData.proofsList.length<3" @click="uploadImagesFn"
|
||||
class="upload-tip flex ac jc column">
|
||||
<uni-icons type="camera" size="20" color=""></uni-icons>
|
||||
<text> 最多三张</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="send-footer flex around">
|
||||
<view @click="cancel" class="cancel flex jc ac">撤单</view>
|
||||
<view @click="submit" class="submit flex jc ac">提交</view>
|
||||
</view>
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import orderApi from '@/api/order.js'
|
||||
import orderItem from "@/components/orderItem/orderItem.vue";
|
||||
export default {
|
||||
components: {
|
||||
orderItem
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
checkPage: {
|
||||
departureDate: {
|
||||
tacitly: '',
|
||||
WrongText: '发货时间不能为空'
|
||||
},
|
||||
weight:{
|
||||
tacitly: '',
|
||||
custom:/^\d+(?=\.{0,1}\d+$|$)/,
|
||||
WrongText: '重量不能为空且必须为数字'
|
||||
},
|
||||
proofsList:{
|
||||
minLength:1,
|
||||
WrongText: '图片不能为空'
|
||||
}
|
||||
},
|
||||
submitData: {
|
||||
"id": "",
|
||||
"motion":'1',
|
||||
"departureDate": "",
|
||||
"unloadingDate": "",
|
||||
"weight":"",
|
||||
"proofsList": []
|
||||
},
|
||||
orderData: null,
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
if (e.orderData){
|
||||
this.orderData = JSON.parse(decodeURIComponent(e.orderData));
|
||||
({id:this.submitData.id=""}=this.orderData);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancel(){
|
||||
orderApi.cancelOrder({
|
||||
"id": this.submitData.id
|
||||
}).then(res=>{
|
||||
if(res.code==20000){
|
||||
uni.showToast({
|
||||
title:'操作成功',
|
||||
icon:"success"
|
||||
});
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack()
|
||||
},1000)
|
||||
}
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
let chenkResult = this.tool.checkFn(this.submitData,[],this.checkPage);
|
||||
if(chenkResult.result){
|
||||
orderApi.cargoMotion(this.submitData).then(res=>{
|
||||
if(res.code==20000){
|
||||
uni.showToast({
|
||||
icon:"success",
|
||||
title:"操作成功"
|
||||
})
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack()
|
||||
},1000)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.$refs.uToast.show({
|
||||
type: 'error',
|
||||
icon: false,
|
||||
title: 'error',
|
||||
message: chenkResult.WrongText,
|
||||
})
|
||||
}
|
||||
},
|
||||
imageRemove(uploadImages = this.submitData.proofsList, index) {
|
||||
this.submitData.proofsList.splice(index, 1);
|
||||
},
|
||||
previewImage(uploadImages = this.submitData.proofsList, index = undefined) {
|
||||
if (index !== undefined && uploadImages[index] !== undefined) {
|
||||
uni.previewImage({
|
||||
current: index,
|
||||
urls:uploadImages.map(item=>item.imageUrl),
|
||||
longPressActions: {
|
||||
success: function(data) { },
|
||||
fail: function(err) { }
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log('数据错误=>', ...arguments)
|
||||
}
|
||||
},
|
||||
uploadImagesFn() {
|
||||
this.tool.chooseImage((imageUrl) => {
|
||||
this.submitData.proofsList.push({
|
||||
imageUrl
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import 'index.scss';
|
||||
</style>
|
||||
Reference in New Issue
Block a user