Commit 6b4cf547 by liangjianmin

js

parent 0e8508e8
...@@ -140,6 +140,7 @@ ...@@ -140,6 +140,7 @@
padding-top: 23rpx; padding-top: 23rpx;
height: 80rpx; height: 80rpx;
textarea { textarea {
height: 100%;
font-size: 24rpx; font-size: 24rpx;
color: #6e767a; color: #6e767a;
} }
......
...@@ -9,29 +9,23 @@ ...@@ -9,29 +9,23 @@
</view> </view>
<view class="box row verCenter"> <view class="box row verCenter">
<text class="label">入仓号信息</text> <text class="label">入仓号信息</text>
<view class="uni-input-box row bothSide"> <view class="uni-input-box row bothSide"><input type="text" class="uni-input" placeholder="请输入(选填)" placeholder-style="color:#404547;font-weight:bold;" v-model="form.erp_order_sn" /></view>
<input type="text" class="uni-input" placeholder="请输入(选填)" placeholder-style="color:#404547;font-weight:bold;" />
</view>
</view> </view>
<view class="box row verCenter"> <view class="box row verCenter">
<text class="label">送货供应商</text> <text class="label">送货供应商</text>
<view class="uni-input-box row bothSide"> <view class="uni-input-box row bothSide"><input type="text" class="uni-input" placeholder="请输入(选填)" placeholder-style="color:#404547;font-weight:bold;" v-model="form.supplier_name" /></view>
<input type="text" class="uni-input" placeholder="请输入(选填)" placeholder-style="color:#404547;font-weight:bold;" />
</view>
</view> </view>
<view class="box row verCenter"> <view class="box row verCenter">
<text class="label">收货方式</text> <text class="label">收货方式</text>
<view class="tab row verCenter"> <view class="tab row verCenter">
<view class="tab-panel row rowCenter verCenter curr">物流</view> <view class="tab-panel row rowCenter verCenter" @click="change(index, 'delivery_method')" :class="{ curr: delivery_method_index == index }" v-for="(item, index) in delivery_method_arr" :key="index">{{ item }}</view>
<view class="tab-panel row rowCenter verCenter">送货</view>
<view class="tab-panel row rowCenter verCenter">上门取货</view>
</view> </view>
</view> </view>
<view class="box row verCenter"> <view class="box row verCenter">
<text class="label">物流信息</text> <text class="label">物流信息</text>
<view class="uni-input-box row bothSide"> <view class="uni-input-box row bothSide">
<input type="text" class="uni-input" placeholder="请扫描或者手动录入" placeholder-style="color:#404547;font-weight:bold;" /> <input type="text" class="uni-input" placeholder="请扫描或者手动录入" placeholder-style="color:#404547;font-weight:bold;" v-model="form.logistics_number" />
<view class="scan-view row verCenter"> <view class="scan-view row verCenter" @click="scanChange()">
<text class="iconfont icon-juxing6"></text> <text class="iconfont icon-juxing6"></text>
<text class="tt">扫描</text> <text class="tt">扫描</text>
</view> </view>
...@@ -41,83 +35,218 @@ ...@@ -41,83 +35,218 @@
<text class="label">物流公司</text> <text class="label">物流公司</text>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<text class="iconfont icon-sanjiaoxing1"></text> <text class="iconfont icon-sanjiaoxing1"></text>
<picker @change="bindPickerChange" :value="index" :range="array"> <picker @change="bindPickerChange" :value="logistics_company_index" :range="logistics_company_arr">
<view class="uni-input">{{ array[index] || '请选择物流公司' }}</view> <view class="uni-input">{{ logistics_company_arr[logistics_company_index] || '请选择物流公司' }}</view>
</picker> </picker>
</view> </view>
</view> </view>
<view class="box row verCenter"> <view class="box row verCenter">
<text class="label">收货数量</text> <text class="label">收货数量</text>
<view class="uni-input-box row bothSide"> <view class="uni-input-box row bothSide"><input type="text" class="uni-input" placeholder="请输入数量" placeholder-style="color:#404547;font-weight:bold;" v-model="form.unusual_num" /></view>
<input type="text" class="uni-input" placeholder="请输入数量" placeholder-style="color:#404547;font-weight:bold;" />
</view>
</view> </view>
<view class="box row verCenter"> <view class="box row verCenter">
<text class="label">收货单位</text> <text class="label">收货单位</text>
<view class="tab row verCenter"> <view class="tab row verCenter">
<view class="tab-panel row rowCenter verCenter curr"></view> <view class="tab-panel row rowCenter verCenter" @click="change(index, 'unit')" :class="{ curr: unit_index == index }" v-for="(item, index) in unit_arr" :key="index">{{ item }}</view>
<view class="tab-panel row rowCenter verCenter"></view>
</view> </view>
</view> </view>
<view class="box row verCenter"> <view class="box row verCenter">
<text class="label">异常原因</text> <text class="label">异常原因</text>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<text class="iconfont icon-sanjiaoxing1"></text> <text class="iconfont icon-sanjiaoxing1"></text>
<picker @change="bindPickerChange" :value="index" :range="array"> <picker @change="bindPickerReasonChange" :value="unusual_reason_index" :range="unusual_reason_arr">
<view class="uni-input">{{ array[index] || '请选择' }}</view> <view class="uni-input">{{ unusual_reason_arr[unusual_reason_index] || '请选择' }}</view>
</picker> </picker>
</view> </view>
</view> </view>
<view class="upload-box"> <view class="upload-box">
<view class="title row bothSide verCenter"> <view class="title row bothSide verCenter">
<text class="tt-l">货图片上传(必填)</text> <text class="tt-l">货图片上传(必填)</text>
<text class="tt-r">1/4</text> <text class="tt-r">{{ form.info_pic.length }}/4</text>
</view> </view>
<view class="upload-list row verCenter"> <view class="upload-list row verCenter">
<view class="pic-box"> <template v-if="form.info_pic.length > 0">
<image src="http://img.ichunt.com/images/ichunt/minProgram/scm/wms/202203/01/7778c9170eb7160d61dc5b10633f7865.png" mode="aspectFill"></image> <view class="pic-box" v-for="(v, index) in form.info_pic" :key="index">
<view class="delete row rowCenter verCenter"><text class="iconfont icon-shanchu"></text></view> <image :src="v" mode="aspectFill" lazy-load="true" @click="previewChange(form.info_pic, index)"></image>
</view> <view class="delete row rowCenter verCenter" @click="deletePic(index)"><text class="iconfont icon-shanchu"></text></view>
<view class="pic-box">
<image src="http://img.ichunt.com/images/ichunt/minProgram/scm/wms/202203/01/7778c9170eb7160d61dc5b10633f7865.png" mode="aspectFill"></image>
<view class="delete row rowCenter verCenter"><text class="iconfont icon-shanchu"></text></view>
</view> </view>
<view class="pic-box"> </template>
<image src="http://img.ichunt.com/images/ichunt/minProgram/scm/wms/202203/01/7778c9170eb7160d61dc5b10633f7865.png" mode="aspectFill"></image> <view class="default row rowCenter verCenter" @click="chooseImageChange()" v-if="form.info_pic.length < 4"><text class="iconfont icon-xingzhuangjiehe"></text></view>
<view class="delete row rowCenter verCenter"><text class="iconfont icon-shanchu"></text></view>
</view>
<view class="default row rowCenter verCenter"><text class="iconfont icon-xingzhuangjiehe"></text></view>
</view> </view>
<view class="textarea-box"> <view class="textarea-box">
<textarea placeholder="请输入异常备注" placeholder-style="color:#6E767A;"></textarea> <textarea @input="inputChange()" maxlength="200" placeholder="请输入异常备注" placeholder-style="color:#6E767A;" v-model="form.check_in_remark"></textarea>
<text class="text">0/200</text> <text class="text">{{ limitword }}/200</text>
</view> </view>
</view> </view>
</view> </view>
<view class="btn row rowCenter verCenter">提交登记</view> <view class="btn row rowCenter verCenter" @click="submit()">提交登记</view>
</view> </view>
</template> </template>
<script> <script>
import { API } from '@/util/api.js'; import { API } from '@/util/api.js';
import w_md5 from '../../js_sdk/zww-md5/w_md5.js';
export default { export default {
data() { data() {
return { return {
array: ['中国', '美国', '巴西', '日本'], logistics_company_arr: ['FedEx', 'DHL', 'UPS', '顺丰', 'Air'], //物流公司
index: -1 logistics_company_index: -1, //物流索引,
unusual_reason_arr: ['无入仓号信息', '来货外观破损', '其他'], //异常原因
unusual_reason_index: -1,
delivery_method_arr: ['物流', '送货', '上门取货'], //来货方式
delivery_method_index: 0, //来货方式索引
unit_arr: ['箱', '卡板'], //单位
unit_index: 0, //单位索引
limitword: 0, //备注文字限制,
form: {
delivery_method: 1, //来货方式1物流2送货3上门取货
logistics_company: '', //物流公司
logistics_number: '', //物流单号
info_pic: [], //收货图片
check_in_remark: '', //收货备注
erp_order_sn: '', //入仓号信息
supplier_name: '', //来货供应商
unusual_reason: '', //异常原因1.无入仓号信息2.来货外观破损3.其它
unusual_num: '', //登记数量
unit: '箱' //收货单位
}
}; };
}, },
onShow() {
this.getData();
},
methods: { methods: {
change(index, type) {
if (type == 'delivery_method') {
this.delivery_method_index = index;
this.form.delivery_method = index + 1;
} else if (type == 'unit') {
this.unit_index = index;
this.form.unit = this.unit_arr[index];
}
},
bindPickerChange: function(e) { bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.target.value); this.logistics_company_index = e.target.value;
this.index = e.target.value; this.form.logistics_company = this.logistics_company_arr[e.target.value];
},
bindPickerReasonChange: function(e) {
this.unusual_reason_index = e.target.value;
this.form.unusual_reasony = parseInt(e.target.value) + 1;
},
inputChange() {
if (this.form.check_in_remark.length <= 200) {
this.limitword = this.form.check_in_remark.length;
}
},
previewChange(img, index) {
uni.previewImage({
current: index,
urls: img
});
},
deletePic(index) {
this.form.info_pic.splice(index, 1);
}, },
getData() { scanChange() {
this.request(API.userInfo, 'POST', {}, false).then(res => {}); uni.scanCode({
success: function(res) {
console.log(res);
if (res.errMsg == 'scanCode:ok') {
this.form.logistics_number = res.result;
}
},
fail: function(res) {
console.log(res);
uni.showToast({
title: '扫码失败',
icon: 'error'
});
}
});
},
chooseImageChange() {
var self = this;
var time = parseInt(new Date().getTime() / 1000);
uni.chooseImage({
count: 4,
sourceType: ['album', 'camera'],
success: chooseImageRes => {
uni.showLoading({
title: '上传中...'
});
const tempFilePaths = chooseImageRes.tempFilePaths;
let maxNum = tempFilePaths.length * 1 + self.form.info_pic.length * 1;
if (maxNum > 4) {
uni.hideLoading();
uni.showToast({
title: '图片不超过4张'
});
return false;
}
for (let i = 0; i < tempFilePaths.length; i++) {
console.log(tempFilePaths[i]);
uni.uploadFile({
url: API.upload,
filePath: tempFilePaths[i],
name: 'upload',
formData: {
source: '1',
k1: time,
k2: w_md5.hex_md5_32(w_md5.hex_md5_32(String(time)) + 'fh6y5t4rr351d2c3bryi')
},
success: uploadFileRes => {
uni.hideLoading();
var data = JSON.parse(uploadFileRes.data);
console.log(data);
if (data.code === 200) {
self.form.info_pic.push(data.data[0]);
} else {
uni.showToast({
title: data.message
});
}
},
fail: error => {
uni.hideLoading();
console.log(error);
}
});
}
}
});
},
submit() {
if (this.form.info_pic.length <= 0) {
uni.showModal({
title: '提示',
content: '请上传收货图片',
showCancel: false,
success: res => {
if (res.confirm) {
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
return false;
}
this.request(API.addUnusualCheckIn, 'POST', this.form, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
title: '提交成功',
icon: 'success'
});
setTimeout(() => {
uni.switchTab({
url: '/pages/home/index'
});
}, 2000);
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
} }
} }
}; };
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<text class="t2" v-if="index == currentIndex">({{ total }})</text> <text class="t2" v-if="index == currentIndex">({{ total }})</text>
</view> </view>
</view> </view>
<template v-if="currentIndex === 0"> <template v-if="currentIndex == 0">
<view class="list" v-if="goodsArrangeData.length > 0 || !is_complete"> <view class="list" v-if="goodsArrangeData.length > 0 || !is_complete">
<navigator class="box row bothSide verCenter" :url="'/pages/goods/tallyDetail?number=' + item.number" hover-class="none" v-for="(item, index) in goodsArrangeData" :key="index"> <navigator class="box row bothSide verCenter" :url="'/pages/goods/tallyDetail?number=' + item.number" hover-class="none" v-for="(item, index) in goodsArrangeData" :key="index">
<view class="bill-number row rowCenter verCenter" :class="numberType[index] ? 'color1' : 'color2'">{{ item.number }}</view> <view class="bill-number row rowCenter verCenter" :class="numberType[index] ? 'color1' : 'color2'">{{ item.number }}</view>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</view> </view>
</template> </template>
</template> </template>
<template v-else-if="currentIndex === 1"> <template v-else-if="currentIndex == 1">
<view class="list" v-if="unusualCheckInList.length > 0 || !is_complete"> <view class="list" v-if="unusualCheckInList.length > 0 || !is_complete">
<navigator class="box row bothSide verCenter" :url="'/pages/goods/tallyExectionDetail?number=' + item.erp_order_sn" hover-class="none" v-for="(item, index) in unusualCheckInList" :key="index"> <navigator class="box row bothSide verCenter" :url="'/pages/goods/tallyExectionDetail?number=' + item.erp_order_sn" hover-class="none" v-for="(item, index) in unusualCheckInList" :key="index">
<view class="bill-number row rowCenter verCenter" :class="numberTypeUnusua[index] ? 'color1' : 'color2'">{{ item.erp_order_sn }}</view> <view class="bill-number row rowCenter verCenter" :class="numberTypeUnusua[index] ? 'color1' : 'color2'">{{ item.erp_order_sn }}</view>
...@@ -99,13 +99,18 @@ export default { ...@@ -99,13 +99,18 @@ export default {
goodsArrangeData: [], goodsArrangeData: [],
unusualCheckInList: [], unusualCheckInList: [],
numberType: [], numberType: [],
numberTypeUnusua:[] numberTypeUnusua: []
}; };
}, },
onLoad(options) {
if (options.currentIndex != undefined) {
this.currentIndex = options.currentIndex;
}
},
onShow() { onShow() {
if (this.currentIndex === 0) { if (this.currentIndex == 0) {
this.getData(); this.getData();
} else if (this.currentIndex === 1) { } else if (this.currentIndex == 1) {
this.getUnusualSortGoodsList(); this.getUnusualSortGoodsList();
} }
}, },
...@@ -142,7 +147,6 @@ export default { ...@@ -142,7 +147,6 @@ export default {
} }
} }
} }
} else { } else {
uni.showToast({ uni.showToast({
title: res.err_msg, title: res.err_msg,
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
</view> </view>
</view> </view>
</view> </view>
<navigator class="btn row rowCenter verCenter" :url="'/pages/goods/tallyQuestion?number=' + customerDetail.base.erp_order_sn">重新发起理货</navigator> <navigator class="btn row rowCenter verCenter" :url="'/pages/goods/tallyDetail?number=' + customerDetail.base.erp_order_sn">重新发起理货</navigator>
</view> </view>
</template> </template>
......
...@@ -295,7 +295,10 @@ export default { ...@@ -295,7 +295,10 @@ export default {
}, },
submit() { submit() {
this.noexebshowFalg = false; //不允许再次触发onshow这个生命周期 this.noexebshowFalg = false; //不允许再次触发onshow这个生命周期
uni.navigateTo({
url: '/pages/goods/tally?currentIndex=1'
});
return false;
//判断如有异常,是否填写实际 //判断如有异常,是否填写实际
var tempArr = []; var tempArr = [];
for (let i = 0; i < this.form.length; i++) { for (let i = 0; i < this.form.length; i++) {
...@@ -341,6 +344,15 @@ export default { ...@@ -341,6 +344,15 @@ export default {
this.request(API.addAskCustomer, 'POST', params, true).then(res => { this.request(API.addAskCustomer, 'POST', params, true).then(res => {
if (res.err_code === 0) { if (res.err_code === 0) {
uni.showToast({
title: '提交成功',
icon: 'success'
});
setTimeout(() => {
uni.navigateTo({
url: '/pages/goods/tally?currentIndex=1'
});
}, 2000);
} else { } else {
uni.showToast({ uni.showToast({
title: res.err_msg, title: res.err_msg,
......
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