|
@ -1,6 +1,6 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view style=" "> |
|
|
<view style=" "> |
|
|
<uni-drawer ref="showRight" mode="left" :mask-click="true" :width="330"> |
|
|
<u-popup v-model="show" mode="left" : :width="330"> |
|
|
<view style="height:100vh;display:flex;flex-direction:column;"> |
|
|
<view style="height:100vh;display:flex;flex-direction:column;"> |
|
|
<view class="uni-flex" style="justify-content: center; |
|
|
<view class="uni-flex" style="justify-content: center; |
|
|
background-color:#007AFF ; |
|
|
background-color:#007AFF ; |
|
@ -16,8 +16,8 @@ |
|
|
物料号: |
|
|
物料号: |
|
|
</view> |
|
|
</view> |
|
|
<view style=" margin: 10rpx; display: flex; align-items: center;"> |
|
|
<view style=" margin: 10rpx; display: flex; align-items: center;"> |
|
|
<uni-easyinput class="uni-mt-5" prefixIcon="search" v-model="itemCode" placeholder="请输入物料号" |
|
|
<u-input class="uni-mt-5" prefixIcon="search" v-model="itemCode" placeholder="请输入物料号" |
|
|
@clear="clearItemCode" @confirm="onConfirmItemCode"></uni-easyinput> |
|
|
@clear="clearItemCode" @confirm="onConfirmItemCode"></u-input> |
|
|
<!-- <view>查询</view> --> |
|
|
<!-- <view>查询</view> --> |
|
|
<!-- <button style="height: 80rpx; align-items: center; text-align: center;" type="primary" size="mini" >查询</button> --> |
|
|
<!-- <button style="height: 80rpx; align-items: center; text-align: center;" type="primary" size="mini" >查询</button> --> |
|
|
</view> |
|
|
</view> |
|
@ -43,23 +43,23 @@ |
|
|
style="width: 330px; display: flex; align-items: center; justify-content: center; "> |
|
|
style="width: 330px; display: flex; align-items: center; justify-content: center; "> |
|
|
<view |
|
|
<view |
|
|
style="width: 330px; display: flex;justify-content: center; background-color: #fff; padding-bottom: 150rpx;"> |
|
|
style="width: 330px; display: flex;justify-content: center; background-color: #fff; padding-bottom: 150rpx;"> |
|
|
<uni-table border stripe emptyText="暂无更多数据"> |
|
|
<u-table border stripe emptyText="暂无更多数据"> |
|
|
<!-- 表头行 --> |
|
|
<!-- 表头行 --> |
|
|
<uni-tr> |
|
|
<u-tr> |
|
|
<uni-th width="60" align="left">批次</uni-th> |
|
|
<u-th width="60" align="left">批次</u-th> |
|
|
<uni-th width="100" align="left">库位</uni-th> |
|
|
<u-th width="100" align="left">库位</u-th> |
|
|
<uni-th width="60" align="left">状态</uni-th> |
|
|
<u-th width="60" align="left">状态</u-th> |
|
|
<uni-th width="120" align="left">数量</uni-th> |
|
|
<u-th width="120" align="left">数量</u-th> |
|
|
</uni-tr> |
|
|
</u-tr> |
|
|
<!-- 表格数据行 --> |
|
|
<!-- 表格数据行 --> |
|
|
<uni-tr v-for="(item, index) in tableData" :key="index"> |
|
|
<u-tr v-for="(item, index) in tableData" :key="index"> |
|
|
<uni-td>{{item.batch}}</uni-td> |
|
|
<u-td>{{item.batch}}</u-td> |
|
|
<uni-td>{{item.locationCode}}</uni-td> |
|
|
<u-td>{{item.locationCode}}</u-td> |
|
|
<uni-td>{{statusDesc(item.inventoryStatus)}}</uni-td> |
|
|
<u-td>{{statusDesc(item.inventoryStatus)}}</u-td> |
|
|
<uni-td>{{item.totalQty}}</uni-td> |
|
|
<u-td>{{item.totalQty}}</u-td> |
|
|
</uni-tr> |
|
|
</u-tr> |
|
|
|
|
|
|
|
|
</uni-table> |
|
|
</u-table> |
|
|
<!-- <view class="uni-flex" style=" flex-direction: column; position: fixed; bottom: 0; margin-bottom: 100rpx; background-color: #fff; width: 100%; align-items: center;" > |
|
|
<!-- <view class="uni-flex" style=" flex-direction: column; position: fixed; bottom: 0; margin-bottom: 100rpx; background-color: #fff; width: 100%; align-items: center;" > |
|
|
<view class="" style="width: 100%; display: flex; justify-content: center; font-size: 32rpx;margin-top: 10rpx;margin-bottom: 10rpx;"> |
|
|
<view class="" style="width: 100%; display: flex; justify-content: center; font-size: 32rpx;margin-top: 10rpx;margin-bottom: 10rpx;"> |
|
|
<view class="" >当前页:{{ current }},总数:{{ total }}条,每页:{{ pageSize }} |
|
|
<view class="" >当前页:{{ current }},总数:{{ total }}条,每页:{{ pageSize }} |
|
@ -79,12 +79,12 @@ |
|
|
<button @click="closeDrawer" type="primary" style="padding-left: 20rpx; width: 100%;">关闭</button> |
|
|
<button @click="closeDrawer" type="primary" style="padding-left: 20rpx; width: 100%;">关闭</button> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
</uni-drawer> |
|
|
</u-popup> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script setup> |
|
|
import { |
|
|
import { |
|
|
getBasicItemByCodeSenior, |
|
|
getBasicItemByCodeSenior, |
|
|
getBalanceByBusinessType |
|
|
getBalanceByBusinessType |
|
@ -95,116 +95,110 @@ |
|
|
getInventoryStatusName |
|
|
getInventoryStatusName |
|
|
} from '@/common/directory.js'; |
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
|
export default { |
|
|
import { ref } from 'vue'; |
|
|
components: {}, |
|
|
import { onLoad } from '@dcloudio/uni-app'; // 引入 uni-app 的 onLoad 钩子 |
|
|
|
|
|
|
|
|
data() { |
|
|
const props = defineProps({ |
|
|
return { |
|
|
|
|
|
itemCode: "", |
|
|
|
|
|
itemCodeResult: [], |
|
|
|
|
|
current: 1, |
|
|
|
|
|
total: 18, |
|
|
|
|
|
tableData: [] |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
props: { |
|
|
|
|
|
// detail: { |
|
|
|
|
|
// type: Object, |
|
|
|
|
|
// default: {} |
|
|
|
|
|
// }, |
|
|
|
|
|
businessTypeCode: { |
|
|
businessTypeCode: { |
|
|
type: String, |
|
|
type: String, |
|
|
default: "" |
|
|
default: "" |
|
|
} |
|
|
} |
|
|
}, |
|
|
}); |
|
|
watch: { |
|
|
|
|
|
|
|
|
const comMessage = ref(null); |
|
|
|
|
|
|
|
|
|
|
|
const itemCode = ref(""); |
|
|
|
|
|
const itemCodeResult = ref([]); |
|
|
|
|
|
const current = ref(1); |
|
|
|
|
|
const total = ref(18); |
|
|
|
|
|
const tableData = ref([]); |
|
|
|
|
|
|
|
|
}, |
|
|
const statusStyle = (val) => { |
|
|
methods: { |
|
|
|
|
|
statusStyle: function(val) { |
|
|
|
|
|
return getInventoryStatusStyle(val); |
|
|
return getInventoryStatusStyle(val); |
|
|
}, |
|
|
}; |
|
|
statusDesc(value) { |
|
|
|
|
|
return getInventoryStatusName(value) |
|
|
const statusDesc = (value) => { |
|
|
}, |
|
|
return getInventoryStatusName(value); |
|
|
change() { |
|
|
}; |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
showErrorMessage(message) { |
|
|
|
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
|
|
|
if (res) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const change = () => { |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const showErrorMessage = (message) => { |
|
|
|
|
|
comMessage.value.showErrorMessage(message, (res) => { |
|
|
|
|
|
if (res) { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}; |
|
|
selectItemCode(item) { |
|
|
|
|
|
this.itemCode = item.code |
|
|
const selectItemCode = (item) => { |
|
|
this.itemCodeResult = [] |
|
|
itemCode.value = item.code; |
|
|
this.getBalanceByBusiness(this.itemCode, this.businessTypeCode) |
|
|
itemCodeResult.value = []; |
|
|
}, |
|
|
getBalanceByBusiness(itemCode.value, props.businessTypeCode); |
|
|
clearItemCode() { |
|
|
}; |
|
|
this.itemCode = "" |
|
|
|
|
|
this.itemCodeResult = [] |
|
|
const clearItemCode = () => { |
|
|
this.tableData =[] |
|
|
itemCode.value = ""; |
|
|
}, |
|
|
itemCodeResult.value = []; |
|
|
onConfirmItemCode() { |
|
|
tableData.value = []; |
|
|
if (!this.itemCode) { |
|
|
}; |
|
|
this.showErrorMessage("物料号为空,请先输入物料号") |
|
|
|
|
|
|
|
|
const onConfirmItemCode = () => { |
|
|
|
|
|
if (!itemCode.value) { |
|
|
|
|
|
showErrorMessage("物料号为空,请先输入物料号"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
this.tableData=[] |
|
|
tableData.value = []; |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "加载中", |
|
|
title: "加载中", |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}); |
|
|
|
|
|
|
|
|
getBasicItemByCodeSenior(this.itemCode).then(res => { |
|
|
getBasicItemByCodeSenior(itemCode.value).then((res) => { |
|
|
if (res.data && res.data.list.length > 0) { |
|
|
if (res.data && res.data.list.length > 0) { |
|
|
if (res.data.list.length == 1) { |
|
|
if (res.data.list.length === 1) { |
|
|
this.itemCode = res.data.list[0].code |
|
|
itemCode.value = res.data.list[0].code; |
|
|
this.getBalanceByBusiness(this.itemCode, this.businessTypeCode) |
|
|
getBalanceByBusiness(itemCode.value, props.businessTypeCode); |
|
|
} else { |
|
|
} else { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading(); |
|
|
this.itemCodeResult = res.data.list |
|
|
itemCodeResult.value = res.data.list; |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading(); |
|
|
this.showErrorMessage("未查找到物料[" + this.itemCode + "]") |
|
|
showErrorMessage("未查找到物料[" + itemCode.value + "]"); |
|
|
} |
|
|
} |
|
|
|
|
|
}).catch((error) => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
showErrorMessage(error); |
|
|
|
|
|
}); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
const getBalanceByBusiness = (itemCode, businessType) => { |
|
|
uni.hideLoading() |
|
|
const params = { |
|
|
this.showErrorMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
getBalanceByBusiness(itemCode, businessType) { |
|
|
|
|
|
var params = { |
|
|
|
|
|
itemCode: itemCode, |
|
|
itemCode: itemCode, |
|
|
businessType: businessType, |
|
|
businessType: businessType, |
|
|
inOrOut: "out" |
|
|
inOrOut: "out" |
|
|
} |
|
|
}; |
|
|
getBalanceByBusinessType(params).then(res => { |
|
|
getBalanceByBusinessType(params).then((res) => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading(); |
|
|
if (res.data && res.data.length > 0) { |
|
|
if (res.data && res.data.length > 0) { |
|
|
this.tableData = res.data |
|
|
tableData.value = res.data; |
|
|
} else { |
|
|
} else { |
|
|
this.showErrorMessage("系统异常:按"+res.msg+"未查找到库存") |
|
|
showErrorMessage("系统异常:按" + res.msg + "未查找到库存"); |
|
|
} |
|
|
} |
|
|
|
|
|
}).catch((error) => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
showErrorMessage(error); |
|
|
|
|
|
}); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
const showDrawer = () => { |
|
|
uni.hideLoading() |
|
|
show.value = true |
|
|
this.showErrorMessage(error) |
|
|
}; |
|
|
}) |
|
|
|
|
|
}, |
|
|
const closeDrawer = () => { |
|
|
|
|
|
show.value = false |
|
|
showDrawer() { |
|
|
}; |
|
|
this.$refs.showRight.open(); |
|
|
|
|
|
}, |
|
|
|
|
|
closeDrawer() { |
|
|
|
|
|
this.$refs.showRight.close(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style> |
|
|
<style> |
|
|