Commit a362a992 by LJM

bug

parent 0ed3f166
......@@ -82,6 +82,10 @@
font-size: 21rpx;
color: #9ca8ad;
}
.uni-input-box {
font-size: 24rpx;
color: #1e2021;
}
}
.tab {
.tab-panel {
......
......@@ -10,38 +10,36 @@
<view class="input-wrap row verCenter bothSide">
<view class="row verCenter">
<text class="arrow"></text>
<input type="text" @input="onInput()" v-model="form.erp_order_sn" class="uni-input" placeholder="请输入" placeholder-style="color:#404547;font-weight:bold;" />
<input type="text" @input="handleInput($event)" v-model="formParams.erp_order_sn" class="uni-input" placeholder="请输入" placeholder-style="color:#404547;font-weight:bold;" />
</view>
</view>
</view>
<navigator class="box row bothSide verCenter" url="/pages/tallyGoods/exceptionSelect" hover-class="none">
<navigator class="box row bothSide verCenter" :url="'/pages/tallyGoods/exceptionSelect?erp_order_sn='+formParams.erp_order_sn" hover-class="none">
<text class="label">异常类型(必填)</text>
<view class="input-wrap-width row bothSide verCenter">
<text class="text">请选择</text>
<text class="iconfont icon-sanjiaoxing2"></text>
</view>
</navigator>
<navigator class="box row bothSide verCenter" url="/pages/tallyGoods/exceptionSelect" hover-class="none">
<navigator class="box row bothSide verCenter" :url="'/pages/tallyGoods/exceptionSelect?erp_order_sn='+formParams.erp_order_sn" hover-class="none">
<text class="label">异常型号</text>
<view class="input-wrap-width row bothSide verCenter">
<text class="text">请选择</text>
<text class="iconfont icon-sanjiaoxing2"></text>
</view>
</navigator>
<navigator class="box row bothSide verCenter" url="/pages/tallyGoods/exceptionSelect" hover-class="none">
<view class="box row bothSide verCenter" url="/pages/tallyGoods/exceptionSelect" hover-class="none">
<text class="label">下单数据</text>
<view class="input-wrap-width row bothSide verCenter">
<text class="text">请选择</text>
<text class="iconfont icon-sanjiaoxing2"></text>
<view class="input-wrap-width row verCenter" style="text-align: right;">
<input type="text" class="uni-input-box" placeholder="不可编辑" placeholder-style="color:#919399" disabled="" />
</view>
</navigator>
<navigator class="box row bothSide verCenter" url="/pages/tallyGoods/exceptionSelect" hover-class="none">
</view>
<view class="box row bothSide verCenter" url="/pages/tallyGoods/exceptionSelect" hover-class="none">
<text class="label">仓库实到数据</text>
<view class="input-wrap-width row bothSide verCenter">
<text class="text">请选择</text>
<text class="iconfont icon-sanjiaoxing2"></text>
<view class="input-wrap-width row verCenter" style="text-align: right;">
<input type="text" class="uni-input-box" placeholder="请输入" placeholder-style="color:#919399" />
</view>
</view>
</navigator>
<view class="upload-box">
<view class="title row bothSide verCenter">
<view class="tt-l row verCenter">
......@@ -68,7 +66,7 @@
<script>
import { API } from '@/util/api.js';
import { titleCase } from '@/util/util.js';
import debounce from 'lodash/debounce';
export default {
data() {
......@@ -76,7 +74,7 @@
noexebshowFalg: true, //控制是否会触发生命周期
maxNum: 5, //最大上传图片数量
image_list: [], //图片列表
form: {
formParams: {
erp_order_sn: '', //入仓号
pur_pic: '' //采购单上传
}
......@@ -87,7 +85,7 @@
if (arr.length > 0) {
this.form.pur_pic = arr.join(',');
} else {
this.form.pur_pic = '';
this.formParams.pur_pic = '';
}
}
},
......@@ -99,6 +97,15 @@
},
methods: {
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
this.formParams.erp_order_sn = val;
}, 800),
/**
* 扫描二维码
*/
scanChange() {
......@@ -106,7 +113,7 @@
success: res => {
console.log(res);
if (res.errMsg == 'scanCode:ok') {
this.form.erp_order_sn = res.result;
this.formParams.erp_order_sn = res.result;
}
},
fail: function(res) {
......@@ -216,11 +223,32 @@
});
},
/**
* 重置
*/
resetChange() {
},
/**
* 获取入仓号对应的型号列表
*/
getErpOrderSnOrderGoodsSn() {
this.request(API.getErpOrderSnOrderGoodsSn, 'GET', { erp_order_sn: this.formParams.erp_order_sn }, true).then(res => {
if (res.err_code === 0) {
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* @param {Object}
* 提交
*/
submit() {
this.request(API.submitTallyGoods, 'POST', this.form, true).then(res => {
this.request(API.submitTallyGoods, 'POST', this.formParams, true).then(res => {
if (res.err_code === 0) {
uni.showModal({
title: '提示',
......
......@@ -11,8 +11,8 @@
<text class="t2">请选择异常类型</text>
</view>
<view class="pick-list row bothSide verCenter">
<picker @change="bindPickerChange($event, 1)" :value="index" :range="arr" style="width: 80%;">
<view class="uni-text">{{ arr[index] || '请选择异常类型' }}</view>
<picker @change="bindPickerChange($event, 1)" :value="allExceptionV2Index" :range="allExceptionV2" range-key='name' style="width: 80%;">
<view class="uni-text">{{ allExceptionV2[allExceptionV2Index].name || '请选择异常类型' }}</view>
</picker>
<text class="iconfont icon-sanjiaoxing1"></text>
</view>
......@@ -23,8 +23,8 @@
<text class="t2">请选择异常型号</text>
</view>
<view class="pick-list row bothSide verCenter">
<picker @change="bindPickerChange($event, 1)" :value="index" :range="arr" style="width: 80%;">
<view class="uni-text">{{ arr[index] || '请选择异常型号' }}</view>
<picker @change="bindPickerChange($event, 2)" :value="erpOrderSnOrderGoodsSnIndex" :range="erpOrderSnOrderGoodsSn" range-key='name' style="width: 80%;">
<view class="uni-text">{{ erpOrderSnOrderGoodsSn[erpOrderSnOrderGoodsSnIndex].name || '请选择异常型号' }}</view>
</picker>
<text class="iconfont icon-sanjiaoxing1"></text>
</view>
......@@ -36,40 +36,80 @@
<script>
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
export default {
data() {
return {
erp_order_sn: 'B1206',
erp_order_sn: '', //入仓号,携带过来的
index: 1,
allExceptionV2: [], //异常类型集合
allExceptionV2Index: -1,
erpOrderSnOrderGoodsSn: '', //异常型号集合
erpOrderSnOrderGoodsSnIndex: -1,
arr: ['型号异常', '品牌异常']
};
},
onLoad(options) {
this.erp_order_sn = options.erp_order_sn || '';
// 从本地缓存中获取数据
const dataFromSourcePage = uni.getStorageSync('paramsOrigin');
// 使用Object.assign()将dataFromSourcePage的属性合并到data中
Object.assign(this.$data, dataFromSourcePage);
},
onShow() {
this.getData();
if (!options.erp_order_sn) {
uni.showToast({
title: '请填写入仓单号',
icon: 'none'
});
setTimeout(() => {
uni.navigateBack({
delta: 1
});
}, 2000)
} else {
this.getAllExceptionV2();
this.getErpOrderSnOrderGoodsSn();
}
},
methods: {
bindPickerChange: function(e, type) {
console.log('picker发送选择改变,携带值为', e.target.value);
if (type == 1) {
this.index = e.target.value;
this.allExceptionV2Index = e.target.value;
} else if (type == 2) {
this.erpOrderSnOrderGoodsSnIndex = e.target.value;
}
},
getData() {
this.request(API.getTallyGoods, 'GET', { erp_order_sn: this.erp_order_sn }, true).then(res => {
/**
* 获取所有异常
*/
getAllExceptionV2() {
this.request(API.getAllExceptionV2, 'GET', {}, true).then(res => {
if (res.err_code === 0) {
// 将对象转换为期望的数组格式
this.allExceptionV2 = Object.entries(res.data).map(([key, value]) => ({
value: key,
name: value
}));
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 获取入仓号对应的型号列表
*/
getErpOrderSnOrderGoodsSn() {
this.request(API.getErpOrderSnOrderGoodsSn, 'GET', { erp_order_sn: this.erp_order_sn }, true).then(res => {
if (res.err_code === 0) {
// 将数组中的每个对象转换为指定格式
this.erpOrderSnOrderGoodsSn = res.data.map(item => ({
name: item.goods_type,
value: item.order_goods_id
}));
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
......
......@@ -216,7 +216,15 @@ const API = {
/**
* 问客列表
*/
askCustomerProblemListV2: API_BASE + '/supplywechatwms/askCustomerProblemListV2'
askCustomerProblemListV2: API_BASE + '/supplywechatwms/askCustomerProblemListV2',
/**
* 获取入仓号对应的型号列表
*/
getErpOrderSnOrderGoodsSn: API_BASE + '/supplywechatwms/getErpOrderSnOrderGoodsSn',
/**
* 获取所有异常
*/
getAllExceptionV2: API_BASE + '/supplywechatwms/getAllExceptionV2'
}
......
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