Commit f9163cab by liangjianmin

js

parent 5bb99306
......@@ -231,20 +231,25 @@ export default {
this.request(API.addUnusualCheckIn, 'POST', this.form, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
title: '提交成功',
icon: 'success'
uni.showModal({
title: '提示',
content: '提交成功',
showCancel: false,
success: res => {
if (res.confirm) {
uni.switchTab({
url: '/pages/home/index'
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
setTimeout(() => {
uni.switchTab({
url: '/pages/home/index'
});
}, 2000);
} else {
uni.showModal({
title: '提示',
content: res.err_msg,
showCancel: false,
showCancel: false
});
}
});
......
......@@ -13,27 +13,27 @@
</view>
<view class="pp row verCenter">
<text class="t1">入仓号:</text>
<text class="t2">A123456</text>
<text class="t2">{{ form.checkIn.number }}</text>
</view>
<view class="pp row verCenter" v-if="flag">
<text class="t1">订单时间:</text>
<text class="t2">2020/07/20 15:12</text>
<text class="t2">{{ form.checkIn.orderDate }}</text>
</view>
<view class="pp row verCenter" v-if="flag">
<text class="t1">订单客户:</text>
<text class="t2">富开香港有限公司</text>
<text class="t2">{{ form.checkIn.customer }}</text>
</view>
<view class="pp row verCenter" v-if="flag">
<text class="t1">供应商:</text>
<text class="t2">SAMSUNG SDI CO., LTD</text>
<text class="t2">{{ form.checkIn.supplier }}</text>
</view>
<view class="pp row verCenter">
<text class="t1">送货方式:</text>
<text class="t2">快递物流</text>
<text class="t2">{{ form.checkIn.delivery }}</text>
</view>
<view class="pp row verCenter mb0">
<text class="t1">采购备注:</text>
<text class="t2">fedex:541717101556</text>
<text class="t2">--</text>
</view>
</view>
<view class="receiving-information">
......@@ -80,16 +80,16 @@
<view class="upload-box">
<view class="title row bothSide verCenter">
<text class="tt-l">收货图片上传(选填)</text>
<text class="tt-r">{{ attachAddress.length }}/4</text>
<text class="tt-r">{{ form.check_in_pic.length }}/4</text>
</view>
<view class="upload-list row verCenter">
<template v-if="attachAddress.length > 0">
<view class="pic-box" v-for="(v, index) in attachAddress" :key="index">
<image :src="v" mode="aspectFill" lazy-load="true" @click="previewChange(attachAddress, index)"></image>
<template v-if="form.check_in_pic.length > 0">
<view class="pic-box" v-for="(v, index) in form.check_in_pic" :key="index">
<image :src="v" mode="aspectFill" lazy-load="true" @click="previewChange(form.check_in_pic, index)"></image>
<view class="delete row rowCenter verCenter" @click="deletePic(index)"><text class="iconfont icon-shanchu"></text></view>
</view>
</template>
<view class="default row rowCenter verCenter" @click="chooseImageChange()" v-if="attachAddress.length < 4"><text class="iconfont icon-xingzhuangjiehe"></text></view>
<view class="default row rowCenter verCenter" @click="chooseImageChange()" v-if="form.check_in_pic.length < 4"><text class="iconfont icon-xingzhuangjiehe"></text></view>
</view>
<view class="textarea-box">
<textarea @input="inputChange()" maxlength="200" placeholder="请输入收货备注" placeholder-style="color:#6E767A;" v-model="form.check_in_remark"></textarea>
......@@ -108,7 +108,7 @@ import w_md5 from '../../js_sdk/zww-md5/w_md5.js';
export default {
data() {
return {
array: ['京东', '顺丰', '中通'],
array: ['FedEx', 'DHL', 'UPS', '顺丰', 'Air'],
textArr: ['物流', '送货', '上门取货'],
unitArr: ['件', '箱'],
index: -1,
......@@ -118,21 +118,20 @@ export default {
unitIndex: 0,
limitword: 0,
id: '',
attachAddress: [],
form: {
delivery_method: 1,
logistics_company: '',
logistics_number: '',
total_num: '',
unit: '',
check_in_pic: '',
check_in_remark: '',
delivery_method: 1, //来货方式1物流2送货3上门取货
logistics_company: '', //物流公司
logistics_number: '', //物流单号
total_num: '', //登记数量
unit: '', //单位
check_in_pic: [], //收货图片
check_in_remark: '', //收货备注
checkIn: ''
}
};
},
onLoad(options) {
//this.id = options.number;
this.id = options.number;
},
watch: {},
onShow() {
......@@ -142,7 +141,7 @@ export default {
getData() {
this.request(API.getCheckInList, 'POST', { number: this.id }, this.loading).then(res => {
if (res.err_code === 0) {
this.form.checkIn = JSON.stringify(res.data[0]);
this.form.checkIn = res.data[0];
} else {
uni.showToast({
title: res.err_msg,
......@@ -175,7 +174,7 @@ export default {
});
},
deletePic(index) {
this.attachAddress.splice(index, 1);
this.form.check_in_pic.splice(index, 1);
},
chooseImageChange() {
var self = this;
......@@ -188,7 +187,7 @@ export default {
title: '上传中...'
});
const tempFilePaths = chooseImageRes.tempFilePaths;
let maxNum = tempFilePaths.length * 1 + self.attachAddress.length * 1;
let maxNum = tempFilePaths.length * 1 + self.form.check_in_pic.length * 1;
if (maxNum > 4) {
uni.hideLoading();
uni.showToast({
......@@ -212,7 +211,7 @@ export default {
var data = JSON.parse(uploadFileRes.data);
console.log(data);
if (data.code === 200) {
self.attachAddress.push(data.data[0]);
self.form.check_in_pic.push(data.data[0]);
} else {
uni.showToast({
title: data.message,
......@@ -250,7 +249,16 @@ export default {
this.index = e.target.value;
this.form.logistics_company = this.array[e.target.value];
},
submit() {
submit() {
if (!this.form.total_num) {
uni.showModal({
title: '提示',
content: '输入登记数量',
showCancel: false
});
return false;
}
this.request(API.addCheckIn, 'POST', this.form, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
......@@ -258,9 +266,16 @@ export default {
icon: 'success'
});
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
uni.showModal({
title: '提示',
content: res.err_msg,
showCancel: false,
success: res => {
if (res.confirm) {
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
});
......
......@@ -62,7 +62,7 @@ export default {
page: 1,
limit: 100,
is_loading: false,
loading: false,
loading: true,
checkInList: [],
numberType: []
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment