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

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
<Navbar title="选择采购订单" :showRightText="false" :isBack="false" /> <Navbar title="选择采购订单" :showRightText="false" :isBack="false" />
<view style="width: 100%;height: 100%;"> <view style="width: 100%;height: 100%;">
<view class="search-form"> <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" @iconClick="search"
@keyup.enter.native="search"></uni-easyinput> @keyup.enter.native="search"></uni-easyinput>
</view> </view>
@ -150,10 +150,13 @@ export default {
item.supplierId = this.selectList[0].supplierId item.supplierId = this.selectList[0].supplierId
this.form.remark = this.form.remark || '' this.form.remark = this.form.remark || ''
}) })
url += '?selectList=' + encodeURIComponent(JSON.stringify(orderGoodsDetailList)) + '&form=' + JSON.stringify(this.form) let pages = getCurrentPages();
uni.navigateTo({ let prePage = pages[pages.length - 2]; //
url 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-th align="center" style="width: 25vw;text-overflow: ellipsis;white-space: nowrap; overflow: hidden;">计量单位</uni-th>
</uni-tr> </uni-tr>
</view> </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"> @scrolltolower="onScrollTolower">
<uni-tr style="height: 64rpx;width: 100%;max-width: 100vw;" <uni-tr style="height: 64rpx;width: 100%;max-width: 100vw;"
:style="{display: 'flex',flexDirection: 'row',justifyContent: 'space-between'}" :style="{display: 'flex',flexDirection: 'row',justifyContent: 'space-between'}"
@ -60,7 +60,7 @@ export default {
allChecked: false, allChecked: false,
searchValue: '', searchValue: '',
pageNum: 1, pageNum: 1,
pageSize: 30, pageSize: 20,
total: 0, total: 0,
status: 'loadmore', status: 'loadmore',
form: '', form: '',
@ -112,6 +112,8 @@ export default {
} else { } else {
this.tableList.push(...res.rows) this.tableList.push(...res.rows)
} }
console.log('?? ~ getList ~ :', this.total)
console.log('?? ~ getList ~ restableList:', this.tableList.length)
this.tableList.map(item => { this.tableList.map(item => {
item.checked = false item.checked = false
}) })
@ -157,11 +159,15 @@ export default {
this.selectList.forEach(item => { this.selectList.forEach(item => {
item.unitPrice = item.unitPrice / 100 item.unitPrice = item.unitPrice / 100
}) })
url += '?selectList=' + encodeURIComponent(JSON.stringify(this.selectList)) + '&form=' + JSON.stringify(this.form) // url += '?selectList=' + encodeURIComponent(JSON.stringify(this.selectList)) + '&form=' + JSON.stringify(this.form)
uni.navigateTo({ let pages = getCurrentPages();
url let prePage = pages[pages.length - 2]; //
}) prePage.$vm["getGoodData"]({
} selectList: encodeURIComponent(JSON.stringify(this.selectList)),
form: JSON.stringify(this.form)
});
uni.navigateBack(-1)
},
} }
} }
</script> </script>

View File

@ -163,16 +163,6 @@
name: '报损出库', name: '报损出库',
text: '报损出库', text: '报损出库',
value: '2' value: '2'
},
{
name: '退货出库',
text: '退货出库',
value: '3'
},
{
name: '调拨出库',
text: '调拨出库',
value: '4'
} }
], ],
title: '请选择出库类型' title: '请选择出库类型'
@ -222,6 +212,18 @@
this.getSupplierControlList() this.getSupplierControlList()
}, },
methods: { 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() { async getAreaControlList() {
const res = await getAreaApi() const res = await getAreaApi()
this.selectors.areaId.options = res.data[0].children.map(item => ({ this.selectors.areaId.options = res.data[0].children.map(item => ({
@ -242,13 +244,13 @@
}, },
async getFetchUserIdControlList() { async getFetchUserIdControlList() {
// API // API
const res = await getPersonApi(124) // API const res = await getPersonApi() // API
this.selectors.fetchUserId.options = res.rows.map(item => ({ this.selectors.fetchUserId.options = res.rows.map(item => ({
name: item.userName, name: item.userName,
text: item.userName, text: item.userName,
value: item.userId value: item.userId
})) }))
console.log(res, '入库人列表') console.log('入库人列表',res)
}, },
async getSupplierControlList() { async getSupplierControlList() {
// API // API

View File

@ -2,7 +2,7 @@
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta> <page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<view class="content"> <view class="content">
<view class="search-form"> <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> v-model="searchValue" @keyup.enter.native="search"></uni-easyinput>
</view> </view>
<scroll-view class="chronic-science" scroll-y="true" @scrolltolower="onScrollTolower"> <scroll-view class="chronic-science" scroll-y="true" @scrolltolower="onScrollTolower">
@ -119,7 +119,7 @@ export default {
let params = { let params = {
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: this.pageSize, pageSize: this.pageSize,
searchValue: this.searchValue outCode: this.searchValue
} }
try { try {
const res = await getWarehouseOutRecordApi(params) const res = await getWarehouseOutRecordApi(params)

View File

@ -3,7 +3,7 @@
<Navbar title="选择领料单" :showRightText="false" :isBack="false" /> <Navbar title="选择领料单" :showRightText="false" :isBack="false" />
<view style="width: 100%;height: 100%;"> <view style="width: 100%;height: 100%;">
<view class="search-form"> <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" @iconClick="search"
@keyup.enter.native="search"></uni-easyinput> @keyup.enter.native="search"></uni-easyinput>
</view> </view>
@ -142,10 +142,13 @@ export default {
item.materialNum = item.fetchNum item.materialNum = item.fetchNum
this.form.remark = this.form.remark || '' this.form.remark = this.form.remark || ''
}) })
url += '?selectList=' + encodeURIComponent(JSON.stringify(orderGoodsDetailList)) + '&form=' + JSON.stringify(this.form) let pages = getCurrentPages();
uni.navigateTo({ let prePage = pages[pages.length - 2]; //
url 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-th align="center" style="width: 25vw">计量单位</uni-th>
</uni-tr> </uni-tr>
</view> </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"> @scrolltolower="onScrollTolower">
<uni-tr style="height: 64rpx;width: 100%;max-width: 100vw;" <uni-tr style="height: 64rpx;width: 100%;max-width: 100vw;"
:style="{display: 'flex',flexDirection: 'row',justifyContent: 'space-between'}" :style="{display: 'flex',flexDirection: 'row',justifyContent: 'space-between'}"
@ -60,7 +60,7 @@ export default {
allChecked: false, allChecked: false,
searchValue: '', searchValue: '',
pageNum: 1, pageNum: 1,
pageSize: 30, pageSize: 20,
total: 0, total: 0,
status: 'loadmore', status: 'loadmore',
form: '', form: '',
@ -148,10 +148,13 @@ export default {
}) })
}, },
navigateTo(url) { navigateTo(url) {
url += '?selectList=' + encodeURIComponent(JSON.stringify(this.selectList)) + '&form=' + JSON.stringify(this.form) let pages = getCurrentPages();
uni.navigateTo({ let prePage = pages[pages.length - 2]; //
url 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> <page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<view class="content"> <view class="content">
<view class="search-form"> <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> </view>
<scroll-view class="chronic-science" scroll-y="true" @scrolltolower="onScrollTolower" > <scroll-view class="chronic-science" scroll-y="true" @scrolltolower="onScrollTolower" >
<view class="scroll-view-item" v-for="(item,index) in tableList" :key="index"> <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%;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: 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.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.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 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> </view>
@ -68,7 +69,7 @@ export default {
let params = { let params = {
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: this.pageSize, pageSize: this.pageSize,
searchValue: this.searchValue, materialName: this.searchValue,
} }
try { try {
const res = await getInventoryOfGoodsApi(params) const res = await getInventoryOfGoodsApi(params)