bug修改

This commit is contained in:
jjLv 2025-09-10 13:17:57 +08:00
parent aaa9ce2ba6
commit 39f1cd99f2
11 changed files with 145 additions and 69 deletions

View File

@ -5,9 +5,9 @@ import request from '@/utils/request';
*/
export function getInventoryOfGoodsApi(data) {
return request({
url: '/smart-canteen/api/v1/drpinventory/list?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize,
method: 'post',
data
url: '/smart-canteen/api/v1/drpinventory/list',
method: 'get',
params:data
})
}
/**
@ -44,9 +44,9 @@ export function getGoodsApi(data,param) {
*/
export function getInBoundGoodsApi(data) {
return request({
url: '/smart-canteen/api/v1/drpinventory/list?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize,
method: 'POST',
data
url: '/smart-canteen/api/v1/drpinventory/list',
method: 'get',
params:data
})
}
@ -101,9 +101,9 @@ export function getWarehouseApi(areaId) {
* @data 获取人员
* @returns {Promise | Promise<unknown>}
*/
export function getPersonApi(roleId) {
export function getPersonApi() {
return request({
url: '/system/user/list?pageNum=1&pageSize=1000&roleIds=' + roleId,
url: '/system/user/list?pageNum=1&pageSize=1000&roleIds=' + 130,
method: 'get',
})
}

View File

@ -218,7 +218,7 @@ export default {
intoType: { options: [
{ name: '采购入库', text: '采购入库', value: '1' },
{ name: '退料入库', text: '退料入库', value: '2' },
{ name: '调拨入库', text: '调拨入库', value: '3'
{ name: '即入即出', text: '即入即出', value: '3'
}], title: '请选择入库了类型'
}
},
@ -255,8 +255,16 @@ export default {
isUploading: false,
}
},
onLoad(options) {
if (options.selectList) {
onLoad() {
this.getGoodData()
this.getAreaControlList()
this.getWarehouseControlList()
this.getPersonEnterControlList()
this.getSupplierControlList()
},
methods: {
getGoodData(options){
if (!options || !options.selectList) return
this.imsIntoInventoryDetailVOList = JSON.parse(decodeURIComponent(options.selectList))
console.log('选中的货品列表:', this.imsIntoInventoryDetailVOList)
this.imsIntoInventoryDetailVOList.forEach(item => {
@ -266,13 +274,7 @@ export default {
console.log('form------',this.form)
this.areaControlName = this.getDisplayName('areaId', this.form.areaId)
this.calculateTotal()
}
this.getAreaControlList()
this.getWarehouseControlList()
this.getPersonEnterControlList()
this.getSupplierControlList()
},
methods: {
},
async getAreaControlList() {
const res = await getAreaApi()
this.selectors.areaId.options = res.data[0].children.map(item => ({
@ -397,17 +399,38 @@ export default {
},
selectGoods() {
if (!this.form.areaId) {
uni.showToast({
title: '请先选择所属区域',
icon: 'none'
})
return
uni.showToast({
title: '请先选择所属区域',
icon: 'none'
})
return
}
if (!this.form.warehouseId) {
uni.showToast({
title: '请先选择所属仓库',
icon: 'none'
})
return
}
uni.navigateTo({
url: '/pages/enterAndExit/enter/selectGoods?form=' + JSON.stringify(this.form) + '&selectList=' + encodeURIComponent(JSON.stringify(this.imsIntoInventoryDetailVOList))
})
},
selectDocument() {
if (!this.form.areaId) {
uni.showToast({
title: '请先选择所属区域',
icon: 'none'
})
return
}
if (!this.form.warehouseId) {
uni.showToast({
title: '请先选择所属仓库',
icon: 'none'
})
return
}
uni.navigateTo({
url: '/pages/enterAndExit/enter/selectDocument?form=' + JSON.stringify(this.form)
})
@ -472,6 +495,24 @@ export default {
tf = true
return
}
if (this.checkIsExist(item.unitPrice)) {
this.isUploading = false
uni.showToast({
title: '请输入货品:【' + item.materialName + '】的单价',
icon: 'none'
})
tf = true
return
}
if (item.unitPrice < 0) {
this.isUploading = false
uni.showToast({
title: '货品:【' + item.materialName + '】的单价必须大于等于0',
icon: 'none'
})
tf = true
return
}
if (this.checkIsExist(item.purNum)) {
this.isUploading = false
uni.showToast({
@ -481,6 +522,15 @@ export default {
tf = true
return
}
if (item.purNum <= 0) {
this.isUploading = false
uni.showToast({
title: '货品:【' + item.materialName + '】的数量必须大于0',
icon: 'none'
})
tf = true
return
}
if (item.orderNum && item.orderNum > 0 && item.purNum > item.orderNum) {
this.isUploading = false
uni.showToast({
@ -539,10 +589,16 @@ export default {
console.log(res)
if (res.code == 200) {
// this.$modal.msgError("")
uni.$u.toast('入库成功')
setTimeout(() => {
this.$tab.reLaunch('/pages/enterAndExit/enter/index')
}, 1000)
if(res.msg == '操作成功'){
uni.$u.toast('入库成功')
setTimeout(() => {
this.$tab.reLaunch('/pages/enterAndExit/enter/index')
}, 1000)
}else{
uni.$u.toast(res.msg)
this.isUploading = false
}
}else {
this.isUploading = false
uni.$u.toast('入库失败,请稍后再试')
@ -590,10 +646,12 @@ export default {
this.showExpireCalendar = false
},
openProductCalendar(item) {
this.hideKeyboard()
this.showProductCalendar = true
this.selectedItem = item //
},
openExpireCalendar(item) {
this.hideKeyboard()
this.showExpireCalendar = true
this.selectedItem = item //
},

View File

@ -2,7 +2,7 @@
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<view class="content">
<view class="search-form">
<uni-easyinput class="searchInput" suffixIcon="search" @iconClick="search" placeholder="输入入库单号/仓库"
<uni-easyinput class="searchInput" suffixIcon="search" @iconClick="search" placeholder="输入入库单号"
v-model="searchValue" @keyup.enter.native="search"></uni-easyinput>
</view>
<scroll-view class="chronic-science" scroll-y="true" @scrolltolower="onScrollTolower">
@ -119,7 +119,7 @@ export default {
let params = {
pageNum: this.pageNum,
pageSize: this.pageSize,
searchValue: this.searchValue
intoCode: this.searchValue
}
try {
const res = await getWarehouseEntryRecordApi(params)

View File

@ -82,7 +82,7 @@
<view style="width: 100%;display:flex;height: 30px">
<view style="width: 50%;display: flex;align-items: center">
<view class="scroll_title">单价()</view>
<view class="scroll_content">{{ item.unitPrice / 100 }}</view>
<view class="scroll_content">{{ item.unitPrice }}</view>
</view>
<view style="width: 50%;display: flex;align-items: center">
<view class="scroll_title">供应商</view>

View File

@ -3,7 +3,7 @@
<Navbar title="选择采购订单" :showRightText="false" :isBack="false" />
<view style="width: 100%;height: 100%;">
<view class="search-form">
<uni-easyinput class="searchInput" placeholder="输入采购订单编号/名称" v-model="searchValue" suffixIcon="search"
<uni-easyinput class="searchInput" placeholder="输入名称" v-model="searchValue" suffixIcon="search"
@iconClick="search"
@keyup.enter.native="search"></uni-easyinput>
</view>
@ -150,10 +150,13 @@ export default {
item.supplierId = this.selectList[0].supplierId
this.form.remark = this.form.remark || ''
})
url += '?selectList=' + encodeURIComponent(JSON.stringify(orderGoodsDetailList)) + '&form=' + JSON.stringify(this.form)
uni.navigateTo({
url
})
let pages = getCurrentPages();
let prePage = pages[pages.length - 2]; //
prePage.$vm["getGoodData"]({
selectList: encodeURIComponent(JSON.stringify(orderGoodsDetailList)),
form: JSON.stringify(this.form)
});
uni.navigateBack(-1)
}
}
}

View File

@ -18,7 +18,7 @@
<uni-th align="center" style="width: 25vw;text-overflow: ellipsis;white-space: nowrap; overflow: hidden;">计量单位</uni-th>
</uni-tr>
</view>
<scroll-view class="chronic-science" style="margin-top: 44px;overflow-y: auto;" scroll-y="true"
<scroll-view class="chronic-science" style="margin-top: 44px;overflow-y: auto;height: 68vh;" scroll-y="true"
@scrolltolower="onScrollTolower">
<uni-tr style="height: 64rpx;width: 100%;max-width: 100vw;"
:style="{display: 'flex',flexDirection: 'row',justifyContent: 'space-between'}"
@ -60,7 +60,7 @@ export default {
allChecked: false,
searchValue: '',
pageNum: 1,
pageSize: 30,
pageSize: 20,
total: 0,
status: 'loadmore',
form: '',
@ -112,6 +112,8 @@ export default {
} else {
this.tableList.push(...res.rows)
}
console.log('?? ~ getList ~ :', this.total)
console.log('?? ~ getList ~ restableList:', this.tableList.length)
this.tableList.map(item => {
item.checked = false
})
@ -157,11 +159,15 @@ export default {
this.selectList.forEach(item => {
item.unitPrice = item.unitPrice / 100
})
url += '?selectList=' + encodeURIComponent(JSON.stringify(this.selectList)) + '&form=' + JSON.stringify(this.form)
uni.navigateTo({
url
})
}
// url += '?selectList=' + encodeURIComponent(JSON.stringify(this.selectList)) + '&form=' + JSON.stringify(this.form)
let pages = getCurrentPages();
let prePage = pages[pages.length - 2]; //
prePage.$vm["getGoodData"]({
selectList: encodeURIComponent(JSON.stringify(this.selectList)),
form: JSON.stringify(this.form)
});
uni.navigateBack(-1)
},
}
}
</script>

View File

@ -163,16 +163,6 @@
name: '报损出库',
text: '报损出库',
value: '2'
},
{
name: '退货出库',
text: '退货出库',
value: '3'
},
{
name: '调拨出库',
text: '调拨出库',
value: '4'
}
],
title: '请选择出库类型'
@ -222,6 +212,18 @@
this.getSupplierControlList()
},
methods: {
getGoodData(options){
if (!options || !options.selectList) return
this.imsOutInventoryDetailAddList = JSON.parse(decodeURIComponent(options.selectList))
console.log('选中的货品列表:', this.imsOutInventoryDetailAddList)
this.imsOutInventoryDetailAddList.forEach(item => {
item.checked = false //
})
this.form = options.form ? JSON.parse(decodeURIComponent(options.form)) : this.form
console.log('form------',this.form)
this.areaControlName = this.getDisplayName('areaId', this.form.areaId)
this.calculateTotal()
},
async getAreaControlList() {
const res = await getAreaApi()
this.selectors.areaId.options = res.data[0].children.map(item => ({
@ -242,13 +244,13 @@
},
async getFetchUserIdControlList() {
// API
const res = await getPersonApi(124) // API
const res = await getPersonApi() // API
this.selectors.fetchUserId.options = res.rows.map(item => ({
name: item.userName,
text: item.userName,
value: item.userId
}))
console.log(res, '入库人列表')
console.log('入库人列表',res)
},
async getSupplierControlList() {
// API

View File

@ -2,7 +2,7 @@
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<view class="content">
<view class="search-form">
<uni-easyinput class="searchInput" suffixIcon="search" @iconClick="search" placeholder="输入入库单号/仓库"
<uni-easyinput class="searchInput" suffixIcon="search" @iconClick="search" placeholder="输入出库单号"
v-model="searchValue" @keyup.enter.native="search"></uni-easyinput>
</view>
<scroll-view class="chronic-science" scroll-y="true" @scrolltolower="onScrollTolower">
@ -119,7 +119,7 @@ export default {
let params = {
pageNum: this.pageNum,
pageSize: this.pageSize,
searchValue: this.searchValue
outCode: this.searchValue
}
try {
const res = await getWarehouseOutRecordApi(params)

View File

@ -3,7 +3,7 @@
<Navbar title="选择领料单" :showRightText="false" :isBack="false" />
<view style="width: 100%;height: 100%;">
<view class="search-form">
<uni-easyinput class="searchInput" placeholder="输入领料单编号/名称" v-model="searchValue" suffixIcon="search"
<uni-easyinput class="searchInput" placeholder="输入名称" v-model="searchValue" suffixIcon="search"
@iconClick="search"
@keyup.enter.native="search"></uni-easyinput>
</view>
@ -142,10 +142,13 @@ export default {
item.materialNum = item.fetchNum
this.form.remark = this.form.remark || ''
})
url += '?selectList=' + encodeURIComponent(JSON.stringify(orderGoodsDetailList)) + '&form=' + JSON.stringify(this.form)
uni.navigateTo({
url
})
let pages = getCurrentPages();
let prePage = pages[pages.length - 2]; //
prePage.$vm["getGoodData"]({
selectList: encodeURIComponent(JSON.stringify(orderGoodsDetailList)),
form: JSON.stringify(this.form)
});
uni.navigateBack(-1)
}
}
}

View File

@ -18,7 +18,7 @@
<uni-th align="center" style="width: 25vw">计量单位</uni-th>
</uni-tr>
</view>
<scroll-view class="chronic-science" style="margin-top: 44px;" scroll-y="true"
<scroll-view class="chronic-science" style="margin-top: 44px;overflow-y: auto;height: 68vh;" scroll-y="true"
@scrolltolower="onScrollTolower">
<uni-tr style="height: 64rpx;width: 100%;max-width: 100vw;"
:style="{display: 'flex',flexDirection: 'row',justifyContent: 'space-between'}"
@ -60,7 +60,7 @@ export default {
allChecked: false,
searchValue: '',
pageNum: 1,
pageSize: 30,
pageSize: 20,
total: 0,
status: 'loadmore',
form: '',
@ -148,10 +148,13 @@ export default {
})
},
navigateTo(url) {
url += '?selectList=' + encodeURIComponent(JSON.stringify(this.selectList)) + '&form=' + JSON.stringify(this.form)
uni.navigateTo({
url
})
let pages = getCurrentPages();
let prePage = pages[pages.length - 2]; //
prePage.$vm["getGoodData"]({
selectList: encodeURIComponent(JSON.stringify(this.selectList)),
form: JSON.stringify(this.form)
});
uni.navigateBack(-1)
}
}
}

View File

@ -2,7 +2,7 @@
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<view class="content">
<view class="search-form">
<uni-easyinput class="searchInput" placeholder="输入货品名称/编码" v-model="searchValue" suffixIcon="search" @iconClick="search" @keyup.enter.native="search"></uni-easyinput>
<uni-easyinput class="searchInput" placeholder="输入货品名称" v-model="searchValue" suffixIcon="search" @iconClick="search" @keyup.enter.native="search"></uni-easyinput>
</view>
<scroll-view class="chronic-science" scroll-y="true" @scrolltolower="onScrollTolower" >
<view class="scroll-view-item" v-for="(item,index) in tableList" :key="index">
@ -15,6 +15,7 @@
<view style="width: 100%;height: 1px;background: #00000010"></view>
<view style="width: 100%;font-size:26rpx;color: #86817B;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;height: 40px;margin-top: 15rpx;">货品编码{{item.materialCode}}</view>
<view style="width: 100%;font-size:26rpx;color: #86817B;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;height: 40px;margin-top: 8rpx;">货品类别{{item.materialTypeName}}</view>
<view style="width: 100%;font-size:26rpx;color: #86817B;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;height: 40px;margin-top: 8rpx;">货品仓库{{item.warehouseName }}</view>
<view style="width: 100%;font-size:26rpx;color: #86817B;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;height: 40px;margin-top: 8rpx;">计量单位{{item.unitName}}</view>
<view style="width: 100%;font-size:26rpx;color: #86817B;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;height: 40px;margin-top: 8rpx;">库存数量{{item.materialNum}}</view>
</view>
@ -68,7 +69,7 @@ export default {
let params = {
pageNum: this.pageNum,
pageSize: this.pageSize,
searchValue: this.searchValue,
materialName: this.searchValue,
}
try {
const res = await getInventoryOfGoodsApi(params)