Browse Source

fix: bug

master
zhang_li 8 months ago
parent
commit
c8a72fc733
  1. 2
      .env.development
  2. 10
      src/pages/inLocation/addForm.vue
  3. 2
      src/pages/inLocation/index.vue
  4. 18
      src/pages/index.vue
  5. 9
      src/pages/outLocation/addForm.vue
  6. 21
      src/pages/sparePartsReturn/addForm.vue

2
.env.development

@ -1,3 +1,3 @@
VITE_BASE_URL=http://localhost:12080/admin-api
VITE_BASE_URL=http://192.168.0.106:12080/admin-api
VITE_BASE_URL_IMAGE=http://localhost:12080/admin-api

10
src/pages/inLocation/addForm.vue

@ -93,11 +93,11 @@
</u-form-item>
<u-form-item :label="`备件名称`" prop="itemName" required class="disabled">
<view class="select">
<u-input v-model="form1.itemName" placeholder="请选择备件" disabled />
<u-input v-model="form1.itemName" placeholder="根据备件编号获取" disabled />
</view>
</u-form-item>
<u-form-item label="库位" prop="locationNumber" required v-if="isShow">
<u-input v-model="form1.locationNumber" placeholder="请选择库位" @blur='blur()'
<u-input v-model="form1.locationNumber" placeholder="请输入库位" @blur='blur()'
@confirm="handelScanMsg" />
</u-form-item>
@ -159,6 +159,7 @@
const locationList = ref([])//
const locationItem = ref('')//
const isFocus = ref(false)
const msg = ref('')
function submit() {
console.log(form.value)
if (form.value.itemNumbers.length === 0) {
@ -220,7 +221,7 @@
return;
}
if (!form1.value.itemName) {
proxy.$modal.showToast('找不到该备件')
proxy.$modal.showToast(msg.value)
return;
}
if (!form1.value.locationNumber) {
@ -265,7 +266,8 @@
function getLocation() {
locationApi.getLocation(form1.value.locationNumber).then(res => {
if (!res.data) {
proxy.$modal.showToast('找不到该库位')
msg.value = res.msg
proxy.$modal.showToast(res.msg)
return;
}
locationItem.value = res.data

2
src/pages/inLocation/index.vue

@ -19,7 +19,7 @@
采购人:<span>{{item.purchaser}}</span>
</view>
<view class="dec">
采购时间:<span>{{item.date}}</span>
采购时间:<span>{{`${item.date[0]}-${item.date[1]>=10?item.date[1]:'0'+item.date[1]}-${item.date[2]>=10?item.date[2]:'0'+item.date[2]}`}}</span>
</view>
<view class="bottom">
<view class="status">

18
src/pages/index.vue

@ -14,8 +14,10 @@
</view>
<view class="user-info">
<view class="name">{{store.name}} <span v-if="store.post">{{store.post.name}}</span></view>
<view class="tips">{{store.dept.name}}</view>
<view class="name">{{store.name}}
<!-- <span v-if="store.post">{{store.post.name}}</span> -->
</view>
<!-- <view class="tips">{{store.dept.name}}</view> -->
</view>
</view>
</view>
@ -32,6 +34,17 @@
</view>
</view>
<view class="box">
<view class="">
<view class="title">扫码</view>
<u-row gutter="16" style="padding:0px 20rpx ;">
<u-col span="3">
<view class="icon-item" @click="open('/pages/inLocation/index')">
<image src="../static/images/icon1.png" mode=""></image>
<view>扫码</view>
</view>
</u-col>
</u-row>
</view>
<view class="" v-if="menus1&&menus1.length>0">
<view class="title">采购入库</view>
<u-row gutter="16" style="padding:0px 20rpx ;">
@ -50,7 +63,6 @@
</u-col>
</block>
</u-row>
</view>
<view class="" v-if="menus2&&menus2.length>0">

9
src/pages/outLocation/addForm.vue

@ -89,7 +89,7 @@
<view class="popup">
<u-form :model="form1" ref="form1Ref" label-width="160rpx">
<u-form-item label="库位" prop="locationNumber" required>
<u-input v-model="form1.locationNumber" placeholder="请选择库位" @blur="blur()"
<u-input v-model="form1.locationNumber" placeholder="请输入库位" @blur="blur()"
@confirm="handelScanMsg" :focus='isFocus' />
</u-form-item>
@ -159,6 +159,7 @@
const isInAccount = ref('FALSE')
const isFocus = ref(false)
const msg = ref('')
//
function submit() {
if (form.value.itemNumbers.length === 0) {
@ -227,7 +228,7 @@
return;
}
if (!form1.value.itemNumber) {
proxy.$modal.showToast('库位没有对应的备件,请重新选择')
proxy.$modal.showToast(msg.value)
return;
}
@ -268,6 +269,7 @@
id: form.value.id,
}).then(res => {
if (!res.data) {
msg.value = res.msg
return;
}
form1.value.areaNumber = res.data.areaNumber;
@ -278,7 +280,8 @@
form1.value.stockQty = res.data.qty || 0;
isInAccount.value = res.data.isInAccount || ''
// this.itemNumber = res.data.itemNumber || ''
}).catch(() => {
}).catch((error) => {
msg.value = error.msg
form1.value.areaNumber = '';
form1.value.itemName = '';
form1.value.itemNumber = '';

21
src/pages/sparePartsReturn/addForm.vue

@ -58,16 +58,16 @@
<u-form :model="form1" ref="form1Ref" label-width="160rpx">
<u-form-item :label="`备件编号`" prop="itemNumber" required>
<view class="select">
<u-input v-model="form1.itemNumber" placeholder="请选择备件" @blur='blur1()' @confirm="handelScanMsg1" :focus='isFocus'/>
<u-input v-model="form1.itemNumber" placeholder="请输入备件" @blur='blur1()' @confirm="handelScanMsg1" :focus='isFocus'/>
</view>
</u-form-item>
<u-form-item :label="`备件名称`" prop="itemNumber" required class="disabled">
<view class="select">
<u-input v-model="form1.itemName" placeholder="请选择备件" disabled />
<u-input v-model="form1.itemName" placeholder="根据备件编号获取" disabled />
</view>
</u-form-item>
<u-form-item label="库位" prop="locationNumber" required v-if="isShow">
<u-input v-model="form1.locationNumber" placeholder="请选择库位" @blur="blur()" @confirm="handelScanMsg"/>
<u-input v-model="form1.locationNumber" placeholder="请输入库位" @blur="blur()" @confirm="handelScanMsg"/>
<view class="right-button" @click="chickRightButton">
扫描
</view>
@ -130,6 +130,7 @@ const singleColumnShow = ref(false)
const choosesingleColumnItem = ref()
const itemNumber = ref()
const msg = ref()
//
function submit() {
@ -170,7 +171,8 @@ const singleColumnShow = ref(false)
form.value.reverterId = '';
form.value.itemNumbers = []
} else {
form.value = {}
form.value.reverterId = '';
form.value.itemNumbers = []
}
}
@ -228,7 +230,7 @@ const singleColumnShow = ref(false)
return;
}
if (!form1.value.itemName) {
proxy.$modal.showToast('找不到该备件')
proxy.$modal.showToast(msg.value)
return;
}
if (!form1.value.locationNumber) {
@ -240,7 +242,7 @@ const singleColumnShow = ref(false)
return;
}
if (itemNumber.value) {
proxy.$modal.showToast('该库位已绑定过备件')
proxy.$modal.showToast(msg.value)
return;
}
if (!form1.value.qty) {
@ -265,7 +267,8 @@ const singleColumnShow = ref(false)
function getLocation() {
locationApi.getLocation(form1.value.locationNumber).then(res => {
if(!res.data){
proxy.$modal.showToast('找不到该库位')
proxy.$modal.showToast(res.msg)
msg.value = res.msg
return;
}
locationItem.value = res.data
@ -300,7 +303,8 @@ const singleColumnShow = ref(false)
number: form1.value.itemNumber,
}).then(res => {
if(!res.data){
proxy.$modal.showToast('找不到该备件')
proxy.$modal.showToast(res.msg)
msg.value = res.msg
itemNumber.value = ''
form1.value.areaNumber = ''
form1.value.locationNumber = '';
@ -323,6 +327,7 @@ const singleColumnShow = ref(false)
isShow.value =true
}
}).catch((err)=>{
msg.value = res.msg
itemNumber.value = ''
form1.value.areaNumber = ''
form1.value.itemName = ''

Loading…
Cancel
Save