Commit d69ef9fa authored by tanjunxin's avatar tanjunxin

fix; 库存盘点库存调拨测试问题修复

parent c500d158
......@@ -6,12 +6,14 @@ const install = (Vue, vm) => {
// 参数配置对象
const config = vm.vuex_config;
console.log(config);
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
vm.$u.api = {
// 基础服务:登录登出、身份信息、菜单授权、切换系统、字典数据等
login: (params = {}) => vm.$u.postJson(config.adminPath + '/login', params),
getExAccountInfoApi: (params = {}) => vm.$u.postJson(config.adminPath + '/common/getExAccountInfo', params),
// 上海环境
// getInfo: (params = {}) => vm.$u.get('http://192.168.1.128:8088' + '/getInfo'),
// 外网环境
......
......@@ -114,6 +114,7 @@ const install = (Vue, vm) => {
// 封装 post json 请求
vm.$u.postJson = (url, data = {}, header = {}) => {
console.log(url);
header['content-type'] = 'application/json';
return vm.$u.http.request({
url,
......
......@@ -180,19 +180,19 @@
"提交成功": "ส่งเรียบร้อยแล้ว",
"提交失败": "การส่งล้มเหลว",
"请勿重复提交": "ไม่ยื่นซ้ำซ้อน",
"请求参数有误": "พารามิเตอร์การร้องขอผิดพลาด",
"提交数据不能为空": "ข้อมูลที่ส่งมาไม่สามารถว่างเปล่าได้",
"库存盘点": "นับสินค้าคงคลัง",
"盘点作业": "นับงาน",
"盘点明细": "รายละเอียดการนับ",
"盘点产品号不能为空": "นับหมายเลขสินค้าไม่สามารถว่างได้",
"当前已经存在盘点产品": "ขณะนี้มีผลิตภัณฑ์นับอยู่แล้ว",
"该产品不存在": "ไม่มีสินค้า",
"请输入盘点产品号": "กรุณากรอกหมายเลขสินค้า",
"库房/储位": "คลังสินค้า / ที่เก็บของ",
"库存数": "จำนวนสต็อก",
"盘点数": "จำนวนนับ",
"请输入盘点数": "โปรดป้อนคะแนนดิสก์",
"盘点数不能大于库存数": "จำนวนนับต้องไม่เกินจำนวนสต็อก",
"盘点数量不能大于库存数量": "จำนวนนับต้องไม่เกินจำนวนสต็อก",
"新增库存": "เพิ่มสินค้าคงคลัง",
"新增数": "เพิ่มจำนวน",
"请输入新增数": "กรุณาใส่จำนวนที่เพิ่ม",
......@@ -201,6 +201,7 @@
"调拨数不能为空": "จำนวนการโทรไม่สามารถว่างได้",
"调入库存不能为空": "โอนเข้าสต็อกไม่สามารถว่างเปล่าได้",
"调入储位不能为空": "ปรับพื้นที่เก็บข้อมูลไม่สามารถว่างได้",
"该数据已存在": "มีข้อมูลนี้อยู่แล้ว",
"请输入储位": "กรุณาใส่ที่เก็บข้อมูล",
"库存调拨": "การโอนสินค้าคงคลัง",
"请输入调拨产品号": "กรุณากรอกหมายเลขผลิตภัณฑ์",
......
......@@ -180,19 +180,19 @@
"提交成功": "提交成功",
"提交失败": "提交失败",
"请勿重复提交": "请勿重复提交",
"请求参数有误": "请求参数有误",
"提交数据不能为空": "提交数据不能为空",
"库存盘点": "库存盘点",
"盘点作业": "盘点作业",
"盘点明细": "盘点明细",
"盘点产品号不能为空": "盘点产品号不能为空",
"当前已经存在盘点产品": "当前已经存在盘点产品",
"该产品不存在": "该产品不存在",
"请输入盘点产品号": "请输入盘点产品号",
"库房/储位": "库房/储位",
"库存数": "库存数",
"盘点数": "盘点数",
"请输入盘点数": "请输入盘点数",
"盘点数不能大于库存数": "盘点数不能大于库存数",
"盘点数量不能大于库存数量": "盘点数量不能大于库存数量",
"新增库存": "新增库存",
"新增数": "新增数",
"请输入新增数": "请输入新增数",
......@@ -201,6 +201,7 @@
"调拨数不能为空": "调拨数不能为空",
"调入库存不能为空": "调入库存不能为空",
"调入储位不能为空": "调入储位不能为空",
"该数据已存在": "该数据已存在",
"请输入储位": "请输入储位",
"库存调拨": "库存调拨",
"请输入调拨产品号": "请输入调拨产品号",
......
......@@ -9,7 +9,7 @@
<view class="card">
<uni-forms :modelValue="formData" :label-width="90" label-align="right">
<uni-forms-item :label="`${$t('新增数')}:`">
<uni-easyinput v-model="formData.stockQuantity" type="number" trim="all"
<uni-easyinput v-model="formData.physicalQuantity" type="number" trim="all"
:placeholder="$t('请输入新增数')" />
</uni-forms-item>
<uni-forms-item :label="`${$t('选择仓库')}:`">
......@@ -35,6 +35,7 @@
export default {
data() {
return {
list: [],
info: [],
warehouseRange: [],
storageRange: [],
......@@ -49,9 +50,9 @@
},
onLoad(option) {
this.getWarehouseList();
if (option.info) {
this.info = JSON.parse(decodeURIComponent(option.info));
console.log(this.info);
if (option.list) {
this.list = JSON.parse(decodeURIComponent(option.list));
this.info = this.list[0];
};
},
methods: {
......@@ -86,7 +87,7 @@
this.getStorageList();
},
handleSumbit() {
if (!this.formData.stockQuantity) {
if (!this.formData.physicalQuantity) {
return this.$u.toast(i18n.t('调拨数不能为空'));
}
if (!this.formData.warehouse) {
......@@ -95,15 +96,18 @@
if (!this.formData.location) {
return this.$u.toast(i18n.t('调入储位不能为空'));
}
if (this.list.some((item) => {
return item.warehouse == this.formData.warehouse && item.location == this.formData.location;
})) {
return this.$u.toast(i18n.t('该数据已存在'));
}
let pages = getCurrentPages();
// 2. 上一页面实例
// 注意是length长度,所以要想得到上一页面的实例需要 -2
// 若要返回上上页面的实例就 -3,以此类推
let prevPage = pages[pages.length - 2];
// 3. 给上一页面实例绑定getValue()方法和参数(注意是$vm)
prevPage.$vm.getAddValue(Object.assign(this.info, this.formData, {
physicalQuantity: this.formData.stockQuantity
}));
prevPage.$vm.getAddValue(Object.assign(this.info, this.formData));
// 4. 返回上一页面
uni.navigateBack({
delta: 1 // 返回的页面数
......@@ -154,7 +158,7 @@
position: fixed;
bottom: 0;
width: 100%;
height: 120rpx;
height: 150rpx;
padding: 24rpx;
background-color: #ffffff;
......
......@@ -12,7 +12,7 @@
{{$t('库房/储位')}}{{item.warehouse}}|{{item.location}}
</view>
<view class="item inventory-data">
{{$t('库存数')}}{{item.stockQuantity}}
{{$t('库存数')}}{{item.stockQuantity || 0}}
</view>
</view>
<view class="physical-inventory">
......@@ -47,18 +47,18 @@
},
methods: {
handleChange(e, row, index) {
if (index == 0) {
if(e > row.stockQuantity) {
this.$u.toast(i18n.t('盘点数不能大于库存数'));
}
} else {
row.stockQuantity = e;
}
// if (index == 0) {
// if(e > row.stockQuantity) {
// this.$u.toast(i18n.t('盘点数不能大于库存数'));
// }
// } else {
// row.stockQuantity = e;
// }
},
handleSumbit() {
if (this.list[0]['physicalQuantity'] > this.list[0]['stockQuantity']) {
return this.$u.toast(i18n.t('盘点数不能大于库存数'));
}
// if (this.list[0]['physicalQuantity'] > this.list[0]['stockQuantity']) {
// return this.$u.toast(i18n.t('盘点数量不能大于库存数量'));
// }
let pages = getCurrentPages();
// 2. 上一页面实例
// 注意是length长度,所以要想得到上一页面的实例需要 -2
......@@ -123,7 +123,7 @@
position: fixed;
bottom: 0;
width: 100%;
height: 120rpx;
height: 150rpx;
padding: 24rpx;
background-color: #ffffff;
......
......@@ -40,7 +40,7 @@
</view>
<view class="right">
<view class="text">
{{item.physicalQuantity}}ps/{{item.stockQuantity}}ps
{{item.physicalQuantity || 0}}ps/{{item.stockQuantity || 0}}ps
</view>
<u-icon v-if="item.isAppend" name="minus" size="32"
@click.native.stop="handleDelete(item, index)"></u-icon>
......@@ -91,11 +91,15 @@
getDetailValue(data) {
this.list = data;
},
handleReset() {
this.value = "";
this.warehouse = "";
this.list = [];
},
handleSearch() {
if (this.loadings) {
return this.$u.toast(i18n.t('请勿重复提交'))
}
this.loadings = true;
if (!this.value) {
return this.$u.toast(i18n.t('盘点产品号不能为空'));
}
......@@ -106,9 +110,11 @@
ml001: this.value,
ml002: this.warehouse
}
this.loadings = true;
this.$u.api.getforinvmlinfoApi(params)
.then(res => {
this.loadings = false;
if (res.success) {
if (res.data.length > 0) {
this.list = res.data.map((item) => {
return {
......@@ -116,7 +122,7 @@
isAppend: 0,
warehouse: item.ml002,
location: item.ml003,
physicalQuantity: 0,
physicalQuantity: item.ml005,
stockQuantity: item.ml005
}
});
......@@ -124,14 +130,15 @@
this.value = "";
this.warehouse = "";
}, 1000);
}
} else {
this.$u.toast(i18n.t('请求参数有误'));
this.$u.toast(res.errorMessage);
}
})
},
handleAdd() {
uni.navigateTo({
url: '/pages/stockCheck/add?info=' + encodeURIComponent(JSON.stringify(this.list[0]))
url: '/pages/stockCheck/add?list=' + encodeURIComponent(JSON.stringify(this.list))
});
},
handleDetail() {
......@@ -146,7 +153,7 @@
if (this.loading) {
return this.$u.toast(i18n.t('请勿重复提交'))
}
if(this.list.length == 0) {
if (this.list.length == 0) {
return this.$u.toast(i18n.t('提交数据不能为空'));
}
this.loading = true;
......@@ -169,10 +176,10 @@
if (res.success) {
this.$u.toast(i18n.t('提交成功'));
setTimeout(() => {
this.$router.go(0);
}, 3000);
this.handleReset();
}, 1000);
} else {
this.$u.toast(i18n.t('提交失败'));
this.$u.toast(res.errorMessage);
}
})
},
......@@ -206,6 +213,7 @@
height: 60rpx;
line-height: 60rpx;
margin-left: 12rpx;
font-size: 26rpx;
}
}
......@@ -313,7 +321,7 @@
position: fixed;
bottom: 0;
width: 100%;
height: 120rpx;
height: 150rpx;
padding: 24rpx;
background-color: #ffffff;
......
......@@ -66,6 +66,11 @@
})
this.list.splice(index, 1, data);
},
handleReset() {
this.value = "";
this.list = [];
this.numList = [];
},
handleSearch() {
if (this.loadings) {
return this.$u.toast(i18n.t('请勿重复提交'))
......@@ -79,19 +84,22 @@
return;
}
const params = {
ml001: this.value
ml001: this.value,
gtStock: 0
}
this.$u.api.getforinvmlinfoApi(params)
.then(res => {
this.loadings = false;
if (res.success) {
if (res.data.length > 0) {
this.list.push(res.data);
this.numList.push(this.value);
setTimeout(() => {
this.value = "";
}, 1000);
}
} else {
this.$u.toast(i18n.t('请求参数有误'));
this.$u.toast(res.errorMessage);
}
})
},
......@@ -156,10 +164,10 @@
if (res.success) {
this.$u.toast(i18n.t('提交成功'));
setTimeout(() => {
this.$router.go(0);
}, 3000);
this.handleReset();
}, 1000);
} else {
this.$u.toast(i18n.t('提交失败'));
this.$u.toast(res.errorMessage);
}
})
}
......@@ -193,6 +201,7 @@
height: 60rpx;
line-height: 60rpx;
margin-left: 12rpx;
font-size: 26rpx;
}
}
......@@ -273,7 +282,7 @@
position: fixed;
bottom: 0;
width: 100%;
height: 120rpx;
height: 150rpx;
padding: 24rpx;
background-color: #ffffff;
......
......@@ -92,7 +92,7 @@
position: fixed;
bottom: 0;
width: 100%;
height: 120rpx;
height: 150rpx;
padding: 24rpx;
background-color: #ffffff;
......
......@@ -4,7 +4,7 @@
<u-form ref="loginForm" :modelValue="loginForm" :rules="loginRules" class="login-form">
<u-form-item prop="username">
<zxz-uni-data-select :clear='false' class="item-select" filterable v-model="loginForm.company"
dataKey="label" dataValue="value" :localdata="factoryData"/>
dataKey="label" dataValue="value" :localdata="factoryData" @change="handleChange"/>
</u-form-item>
<u-form-item prop="username" class="under">
<input
......@@ -72,7 +72,24 @@ import {setLocal} from '@/lang'
factoryData: config.factoryData,
}
},
onLoad() {
this.getExAccountInfo();
},
methods: {
getExAccountInfo() {
this.$u.api.getExAccountInfoApi().then(res => {
this.factoryData = res.data.map((item) => {
return {
...item,
label: item.accountName,
value: item.id
}
});
})
},
handleChange(val) {
config.baseUrl = val.mesUrl;
},
submit(){
this.$refs.loginForm.validate().then(valid => {
if (valid) {
......
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 to comment