bug修改
This commit is contained in:
parent
a243788a27
commit
e33be099d4
|
|
@ -5,56 +5,37 @@
|
||||||
<scroll-view style="width: 100%;height: calc(100vh - 80px);" scroll-y="true">
|
<scroll-view style="width: 100%;height: calc(100vh - 80px);" scroll-y="true">
|
||||||
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" style="margin-left: 20rpx;">
|
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" style="margin-left: 20rpx;">
|
||||||
<u-form-item label="出库单号:" labelWidth="180rpx" style="height: 6vh">
|
<u-form-item label="出库单号:" labelWidth="180rpx" style="height: 6vh">
|
||||||
<u--input
|
<u--input v-model.number="form.outCode" placeholder="自动生成" :disabled="true"
|
||||||
v-model.number="form.outCode"
|
type="number"></u--input>
|
||||||
placeholder="自动生成"
|
|
||||||
:disabled="true"
|
|
||||||
type="number"
|
|
||||||
></u--input>
|
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="所属区域" prop="areaId" required labelWidth="180rpx" style="height: 6vh">
|
<u-form-item label="所属区域" prop="areaId" required labelWidth="180rpx" style="height: 6vh">
|
||||||
<uni-data-select
|
<uni-data-select v-model="form.areaId" :localdata="selectors.areaId.options" placeholder="请选择所属区域"
|
||||||
v-model="form.areaId"
|
style="text-align: left;" @change="changeWarehouse"></uni-data-select>
|
||||||
:localdata="selectors.areaId.options"
|
|
||||||
placeholder="请选择所属区域"
|
|
||||||
style="text-align: left;"
|
|
||||||
@change="changeWarehouse"
|
|
||||||
></uni-data-select>
|
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="货品仓库" prop="warehouseId" required labelWidth="180rpx" style="height: 6vh">
|
<u-form-item label="货品仓库" prop="warehouseId" required labelWidth="180rpx" style="height: 6vh">
|
||||||
<uni-data-select
|
<uni-data-select v-model="form.warehouseId" :localdata="selectors.warehouseId.options"
|
||||||
v-model="form.warehouseId"
|
placeholder="请选择货品仓库" style="text-align: left;"></uni-data-select>
|
||||||
:localdata="selectors.warehouseId.options"
|
|
||||||
placeholder="请选择货品仓库"
|
|
||||||
style="text-align: left;"
|
|
||||||
></uni-data-select>
|
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="出库类型" prop="outType" required labelWidth="180rpx" style="height: 6vh">
|
<u-form-item label="出库类型" prop="outType" required labelWidth="180rpx" style="height: 6vh">
|
||||||
<uni-data-select
|
<uni-data-select v-model="form.outType" :localdata="selectors.outType.options" placeholder="请选择入库类型"
|
||||||
v-model="form.outType"
|
style="text-align: left;"></uni-data-select>
|
||||||
:localdata="selectors.outType.options"
|
|
||||||
placeholder="请选择入库类型"
|
|
||||||
style="text-align: left;"
|
|
||||||
></uni-data-select>
|
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="领料人" prop="fetchUserId" required labelWidth="180rpx" style="height: 6vh">
|
<u-form-item label="领料人" prop="fetchUserId" required labelWidth="180rpx" style="height: 6vh">
|
||||||
<uni-data-select
|
<uni-data-select v-model="form.fetchUserId" :localdata="selectors.fetchUserId.options"
|
||||||
v-model="form.fetchUserId"
|
placeholder="请选择入库人" style="text-align: left;"></uni-data-select>
|
||||||
:localdata="selectors.fetchUserId.options"
|
|
||||||
placeholder="请选择入库人"
|
|
||||||
style="text-align: left;"
|
|
||||||
></uni-data-select>
|
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="备注说明" prop="remark" labelWidth="180rpx" style="height: 200rpx">
|
<u-form-item label="备注说明" prop="remark" labelWidth="180rpx" style="height: 200rpx">
|
||||||
<uni-easyinput type="textarea" v-model="form.remark" placeholder="请输入备注" maxlength="100" />
|
<uni-easyinput type="textarea" v-model="form.remark" placeholder="请输入备注" maxlength="100" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item style="width: 100%; padding: 20rpx 0;">
|
<u-form-item style="width: 100%; padding: 20rpx 0;">
|
||||||
<view class="button-group">
|
<view class="button-group">
|
||||||
<view @click="selectGoods" class="action-button" style="background: linear-gradient( 270deg, #7D97FF 0%, #4367F5 100%);width: 200rpx;">
|
<view @click="selectGoods" class="action-button"
|
||||||
|
style="background: linear-gradient( 270deg, #7D97FF 0%, #4367F5 100%);width: 200rpx;">
|
||||||
<image src="/static/images/handheld/ic_select_goods.png" class="button-icon"></image>
|
<image src="/static/images/handheld/ic_select_goods.png" class="button-icon"></image>
|
||||||
<text class="button-text">选择货品</text>
|
<text class="button-text">选择货品</text>
|
||||||
</view>
|
</view>
|
||||||
<view @click="selectDocument" class="action-button" style="margin-left: 20rpx;background: linear-gradient( 270deg, #FFB679 0%, #EF882E 100%);width: 200rpx;">
|
<view @click="selectDocument" class="action-button"
|
||||||
|
style="margin-left: 20rpx;background: linear-gradient( 270deg, #FFB679 0%, #EF882E 100%);width: 200rpx;">
|
||||||
<image src="/static/images/handheld/ic_select_document.png" class="button-icon"></image>
|
<image src="/static/images/handheld/ic_select_document.png" class="button-icon"></image>
|
||||||
<text class="button-text">选择领料单</text>
|
<text class="button-text">选择领料单</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -75,7 +56,9 @@
|
||||||
<view style="width:90%;">
|
<view style="width:90%;">
|
||||||
<text style="margin-left: 10px;">{{ item.materialName }}</text>
|
<text style="margin-left: 10px;">{{ item.materialName }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view style="width:10%;display: flex;align-items: center;justify-content: center">{{ index + 1 }}
|
<view
|
||||||
|
style="width:10%;display: flex;align-items: center;justify-content: center">
|
||||||
|
{{ index + 1 }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -118,23 +101,17 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-button class="action-btn delete-btn" text="删除" @click="del"></u-button>
|
<u-button class="action-btn delete-btn" text="删除" @click="del"></u-button>
|
||||||
<u-button class="action-btn save-btn" text="保存" @click="handleSubmit"></u-button>
|
<u-button class="action-btn save-btn" text="保存" @click="handleSubmit" :throttle-time="1000"></u-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-action-sheet
|
<u-action-sheet v-if="currentSelector" :show="selectorVisible" :actions="getSelectorOptions(currentSelector)"
|
||||||
v-if="currentSelector"
|
:title="getSelectorTitle(currentSelector)" @close="hideSelector" style="max-height: 400px"
|
||||||
:show="selectorVisible"
|
|
||||||
:actions="getSelectorOptions(currentSelector)"
|
|
||||||
:title="getSelectorTitle(currentSelector)"
|
|
||||||
@close="hideSelector"
|
|
||||||
style="max-height: 400px"
|
|
||||||
@select="handleSelectorSelect"></u-action-sheet>
|
@select="handleSelectorSelect"></u-action-sheet>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addEnterRecord,
|
addEnterRecord,
|
||||||
addOutRecord,
|
addOutRecord,
|
||||||
|
|
@ -147,7 +124,10 @@ import UButton from '@/uni_modules/uview-ui/components/u-button/u-button.vue'
|
||||||
import URow from '@/uni_modules/uview-ui/components/u-row/u-row.vue'
|
import URow from '@/uni_modules/uview-ui/components/u-row/u-row.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { URow, UButton },
|
components: {
|
||||||
|
URow,
|
||||||
|
UButton
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
fontValue: uni.getStorageSync('fontSize') || 8,
|
fontValue: uni.getStorageSync('fontSize') || 8,
|
||||||
|
|
@ -157,17 +137,45 @@ export default {
|
||||||
totalMoney: 0.00,
|
totalMoney: 0.00,
|
||||||
totalNum: 0.00,
|
totalNum: 0.00,
|
||||||
selectors: {
|
selectors: {
|
||||||
areaId: { options: [], title: '请选择所属区域' },
|
areaId: {
|
||||||
warehouseId: { options: [], title: '请选择所属仓库' },
|
options: [],
|
||||||
fetchUserId: { options: [], title: '请选择领料人' },
|
title: '请选择所属区域'
|
||||||
supplierId: { options: [], title: '请选择供应商' },
|
},
|
||||||
|
warehouseId: {
|
||||||
|
options: [],
|
||||||
|
title: '请选择所属仓库'
|
||||||
|
},
|
||||||
|
fetchUserId: {
|
||||||
|
options: [],
|
||||||
|
title: '请选择领料人'
|
||||||
|
},
|
||||||
|
supplierId: {
|
||||||
|
options: [],
|
||||||
|
title: '请选择供应商'
|
||||||
|
},
|
||||||
outType: {
|
outType: {
|
||||||
options: [
|
options: [{
|
||||||
{ name: '领取出库', text: '领取出库', value: '1' },
|
name: '领取出库',
|
||||||
{ name: '报损出库', text: '报损出库', value: '2' },
|
text: '领取出库',
|
||||||
{ name: '退货出库', text: '退货出库', value: '3' },
|
value: '1'
|
||||||
{ name: '调拨出库', text: '调拨出库', value: '4' }
|
},
|
||||||
], title: '请选择出库类型'
|
{
|
||||||
|
name: '报损出库',
|
||||||
|
text: '报损出库',
|
||||||
|
value: '2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '退货出库',
|
||||||
|
text: '退货出库',
|
||||||
|
value: '3'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '调拨出库',
|
||||||
|
text: '调拨出库',
|
||||||
|
value: '4'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
title: '请选择出库类型'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
imsOutInventoryDetailAddList: [],
|
imsOutInventoryDetailAddList: [],
|
||||||
|
|
@ -194,7 +202,6 @@ export default {
|
||||||
supplierName: null
|
supplierName: null
|
||||||
},
|
},
|
||||||
currentDateOption: -1,
|
currentDateOption: -1,
|
||||||
isUploading: false,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
|
@ -328,7 +335,7 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/enterAndExit/exit/selectGoods?form=' + JSON.stringify(this.form)
|
url: '/pages/enterAndExit/exit/selectGoods?form=' + JSON.stringify(this.form) + '&selectList=' + encodeURIComponent(JSON.stringify(this.imsOutInventoryDetailAddList))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
selectDocument() {
|
selectDocument() {
|
||||||
|
|
@ -355,79 +362,49 @@ export default {
|
||||||
this.allChecked = false
|
this.allChecked = false
|
||||||
this.calculateTotal()
|
this.calculateTotal()
|
||||||
},
|
},
|
||||||
handleSubmit() {
|
async handleSubmit() {
|
||||||
if (this.isUploading) return
|
const requiredFields = [
|
||||||
this.isUploading = true
|
{ key: 'areaId', msg: '请选择所属区域' },
|
||||||
if (this.checkIsExist(this.form.areaId)) {
|
{ key: 'warehouseId', msg: '请选择货品仓库' },
|
||||||
this.isUploading = false
|
{ key: 'outType', msg: '请选择出库类型' },
|
||||||
uni.showToast({
|
{ key: 'fetchUserId', msg: '请选择领料人' }
|
||||||
title: '请选择所属区域',
|
]
|
||||||
icon: 'none'
|
for (const field of requiredFields) {
|
||||||
})
|
if (this.checkIsExist(this.form[field.key])) {
|
||||||
return
|
|
||||||
} else if (this.checkIsExist(this.form.warehouseId)) {
|
uni.showToast({ title: field.msg, icon: 'none' })
|
||||||
this.isUploading = false
|
|
||||||
uni.showToast({
|
|
||||||
title: '请选择货品仓库',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
} else if (this.checkIsExist(this.form.outType)) {
|
|
||||||
this.isUploading = false
|
|
||||||
uni.showToast({
|
|
||||||
title: '请选择出库类型',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
} else if (this.checkIsExist(this.form.fetchUserId)) {
|
|
||||||
this.isUploading = false
|
|
||||||
uni.showToast({
|
|
||||||
title: '请选择领料人',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
} else if (this.imsOutInventoryDetailAddList.length === 0) {
|
|
||||||
this.isUploading = false
|
|
||||||
uni.showToast({
|
|
||||||
title: '请选择出库货品',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var tf = false
|
}
|
||||||
this.imsOutInventoryDetailAddList.forEach(item => {
|
if (this.imsOutInventoryDetailAddList.length === 0) {
|
||||||
if (tf) {
|
|
||||||
this.isUploading = false
|
uni.showToast({ title: '请选择出库货品', icon: 'none' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const item of this.imsOutInventoryDetailAddList) {
|
||||||
if (this.checkIsExist(item.fetchNum)) {
|
if (this.checkIsExist(item.fetchNum)) {
|
||||||
this.isUploading = false
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请输入货品:【' + item.materialName + '】的数量',
|
title: `请输入货品:【${item.materialName}】的数量`,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
tf = true
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (item.materialNum && item.materialNum > 0 && item.fetchNum > item.materialNum) {
|
if (item.materialNum && item.materialNum > 0 && item.fetchNum > item.materialNum) {
|
||||||
this.isUploading = false
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '货品:【' + item.materialName + '】的出库数量不能大于库存数量【' + item.materialNum + '】',
|
title: `货品:【${item.materialName}】的出库数量不能大于库存数量【${item.materialNum}】`,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
tf = true
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
if (!tf) {
|
|
||||||
this.uploadDate()
|
|
||||||
}
|
}
|
||||||
|
await this.uploadDate()
|
||||||
},
|
},
|
||||||
async uploadDate() {
|
async uploadDate() {
|
||||||
var list = this.imsOutInventoryDetailAddList
|
var list = this.imsOutInventoryDetailAddList
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
const dateTime = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}`
|
const dateTime =
|
||||||
|
`${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}`
|
||||||
let param = {
|
let param = {
|
||||||
...this.form,
|
...this.form,
|
||||||
imsOutInventoryDetailAddList: list,
|
imsOutInventoryDetailAddList: list,
|
||||||
|
|
@ -435,15 +412,16 @@ export default {
|
||||||
outDate: dateTime
|
outDate: dateTime
|
||||||
}
|
}
|
||||||
const res = await addOutRecord(param)
|
const res = await addOutRecord(param)
|
||||||
console.log(res)
|
console.log("res===========",res)
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
console.log('出库成功=======', res)
|
||||||
uni.$u.toast('出库成功')
|
uni.$u.toast('出库成功')
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$tab.reLaunch('/pages/enterAndExit/exit/index')
|
this.$tab.reLaunch('/pages/enterAndExit/exit/index')
|
||||||
}, 1000)
|
}, 1000)
|
||||||
} else {
|
} else {
|
||||||
this.isUploading = false
|
const msg = res.code == 500 ? res.msg : '出库失败,请稍后再试'
|
||||||
uni.$u.toast('出库失败,请稍后再试')
|
uni.$u.toast(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
@ -474,10 +452,12 @@ page {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.u-form-item {
|
.u-form-item {
|
||||||
min-height: 80rpx !important;
|
min-height: 80rpx !important;
|
||||||
padding: 20rpx 0 !important;
|
padding: 20rpx 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-group {
|
.button-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
|
@ -504,6 +484,7 @@ page {
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.health-form {
|
.health-form {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|
@ -584,6 +565,7 @@ page {
|
||||||
background: linear-gradient(270deg, #FFB679 0%, #EF882E 100%) !important;
|
background: linear-gradient(270deg, #FFB679 0%, #EF882E 100%) !important;
|
||||||
color: white !important;
|
color: white !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchInput {
|
.searchInput {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@
|
||||||
@iconClick="search"
|
@iconClick="search"
|
||||||
@keyup.enter.native="search"></uni-easyinput>
|
@keyup.enter.native="search"></uni-easyinput>
|
||||||
</view>
|
</view>
|
||||||
<uni-table :th-style="{backgroundColor:'#3c94fd'}" type="selection" @selection-change="selectChange" border stripe empty-text="暂无更多数据">
|
<uni-table ref="uniTable" :th-style="{backgroundColor:'#3c94fd'}" type="selection"
|
||||||
|
@selection-change="selectChange" border stripe empty-text="暂无更多数据">
|
||||||
<view class="tableHeader">
|
<view class="tableHeader">
|
||||||
<uni-tr style="display:flex;width: 100%">
|
<uni-tr style="display:flex;width: 100%">
|
||||||
<uni-th align="center" style="width: 25vw">货品编码</uni-th>
|
<uni-th align="center" style="width: 25vw">货品编码</uni-th>
|
||||||
|
|
@ -69,6 +70,7 @@ export default {
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
console.log('options:', options)
|
console.log('options:', options)
|
||||||
this.form = options.form ? JSON.parse(decodeURIComponent(options.form)) : this.form
|
this.form = options.form ? JSON.parse(decodeURIComponent(options.form)) : this.form
|
||||||
|
this.selectList = options.selectList ? JSON.parse(decodeURIComponent(options.selectList)) : []
|
||||||
console.log('form:', this.form)
|
console.log('form:', this.form)
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
|
|
@ -114,9 +116,21 @@ export default {
|
||||||
this.tableList.map(item => {
|
this.tableList.map(item => {
|
||||||
if (item.materialId === selectItem.materialId) {
|
if (item.materialId === selectItem.materialId) {
|
||||||
item.checked = true
|
item.checked = true
|
||||||
|
item.fetchNum = selectItem.fetchNum
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.uniTable) {
|
||||||
|
this.tableList.forEach((item, index) => {
|
||||||
|
if (item.checked) {
|
||||||
|
this.$refs.uniTable.toggleRowSelection(index, true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.warn('uniTable未挂载或setSelection方法不存在')
|
||||||
|
}
|
||||||
|
})
|
||||||
this.status = this.total == this.tableList.length ? 'nomore' : 'loadmore'
|
this.status = this.total == this.tableList.length ? 'nomore' : 'loadmore'
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ export default {
|
||||||
searchValue: '',
|
searchValue: '',
|
||||||
tableList: [],
|
tableList: [],
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 100,
|
||||||
total: 0,
|
total: 0,
|
||||||
status: 'loadmore',
|
status: 'loadmore',
|
||||||
}
|
}
|
||||||
|
|
@ -85,8 +85,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleImage(item) {
|
handleImage(item) {
|
||||||
if (item.materialImage) {
|
if (item.imgUrl) {
|
||||||
return item.materialImage
|
return item.imgUrl
|
||||||
} else {
|
} else {
|
||||||
return '/static/images/handheld/ic_goods_img.jpg'
|
return '/static/images/handheld/ic_goods_img.jpg'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue