Commit d69ef9fa authored by tanjunxin's avatar tanjunxin

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

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