zhang_li 9 months ago
parent
commit
acbe7864e2
  1. 2
      src/pages.json
  2. 59
      src/pages/inLocation/addForm.vue
  3. 20
      src/pages/outLocation/addForm.vue
  4. 6
      src/pages/outLocation/index.vue
  5. 48
      src/pages/sparePartsReturn/addForm.vue
  6. 1
      src/utils/request.js

2
src/pages.json

@ -34,7 +34,7 @@
},{
"path": "pages/outLocation/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "领用出库",
"navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white"
}

59
src/pages/inLocation/addForm.vue

@ -2,10 +2,10 @@
<!-- 添加维修工单 -->
<view class="add-form-container">
<u-form :model="form" ref="form1" label-width="160rpx">
<u-form-item label="批次号" prop="number" required>
<u-form-item label="批次号" prop="number">
<u-input v-model="form.number" placeholder="请输入批次号" />
</u-form-item>
<u-form-item label="供应商" prop="supplierName" required>
<u-form-item label="供应商" prop="supplierName">
<u-input v-model="form.supplierName" placeholder="请输入供应商" />
</u-form-item>
</u-form>
@ -87,7 +87,7 @@
<u-form :model="form1" ref="form1" label-width="160rpx">
<u-form-item :label="`备件编号`" prop="itemNumber" required>
<view class="select">
<u-input v-model="form1.itemNumber" placeholder="请选择备件" disabled />
<u-input v-model="form1.itemNumber" placeholder="请选择备件" @blur="blur1()" />
<view class="right-button" @click="chickRightButton1">
扫描
</view>
@ -99,7 +99,7 @@
</view>
</u-form-item>
<u-form-item label="库位" prop="locationNumber" required v-if="isShow">
<u-input v-model="form1.locationNumber" placeholder="请选择库位" disabled/>
<u-input v-model="form1.locationNumber" placeholder="请选择库位" @blur='blur()' />
<view class="right-button" @click="chickRightButton">
扫描
</view>
@ -113,7 +113,7 @@
<u-form-item label="入库数量" prop="qty" required>
<u-input v-model="form1.qty" type="number" placeholder="请输入入库数量" />
</u-form-item>
<u-form-item label="描述" prop="qty" required>
<u-form-item label="描述" prop="qty">
<u-input v-model="form1.describes" placeholder="请输入描述" />
</u-form-item>
</u-form>
@ -154,7 +154,8 @@
qty: ''
},
isShow: false,
isInAccount: 'FALSE'
locationList: [], //
locationItem: '', //
}
},
methods: {
@ -206,7 +207,7 @@
async getInLocationDetail() {
await inLocationApi.getInLocationDetail(this.form.id).then(res => {
this.orderList = res.data
})
}).catch((err) => {})
},
//
open() {
@ -236,7 +237,7 @@
this.$modal.showToast('请选择库位')
return;
}
if (this.isInAccount == 'FALSE') {
if (!this.locationItem || this.locationItem.isInAccount === 'FALSE') {
this.$modal.showToast('该库位属于帐外库,请选择帐内库')
return;
}
@ -259,7 +260,7 @@
this.$modal.showToast('该备件已添加')
return;
}
let arr1 = orderList.filter(item => item.itemNumber == this.form1.itemNumber)
let arr1 = this.orderList.filter(item => item.itemNumber == this.form1.itemNumber)
if (!arr1 || (arr1 && arr1.length == 0)) {
this.$modal.showToast('订单信息没有该备件')
return;
@ -279,10 +280,22 @@
this.$modal.showToast('找不到该库位')
return;
}
this.form1.areaNumber = res.data.areaNumber;
this.isInAccount = res.data.isInAccount || ''
this.locationItem = res.data
this.form1.areaNumber = this.locationItem.areaNumber
this.itemNumber = res.data.itemNumber || ''
})
//
if (this.form.itemNumbers && this.form.itemNumbers.length > 0) {
let arr = this.form.itemNumbers.filter(item => item.locationNumber == this.form1
.locationNumber)
if (arr && arr.length > 0) {
this.itemNumber = 1
} else {
this.itemNumber = res.data.itemNumber || ''
}
} else {
this.itemNumber = res.data.itemNumber || ''
}
}).catch((err) => {})
},
blur() {
if (this.form1.locationNumber) {
@ -300,20 +313,32 @@
this.itemNumber = ''
this.form1.areaNumber = ''
this.form1.locationNumber = '';
this.isInAccount = ''
this.form1.itemName = ''
return;
}
this.itemNumber = ''
this.form1.areaNumber = res.data.areaNumber || ''
this.form1.locationNumber = res.data.locationNumber;
this.isInAccount = res.data.isInAccount|| ''
this.form1.itemName = res.data.itemName
this.form1.deliveryQty = res.data.deliveryQty
this.form1.applyQty = res.data.applyQty
if (!this.form1.locationNumber) {
//
this.locationItem = res.data.list.filter(item => item.isInAccount === 'TRUE')[0]
if (this.locationItem) {
this.form1.areaNumber = this.locationItem.areaNumber
this.form1.locationNumber = this.locationItem.locationNumber
this.isShow = false
} else {
this.form1.areaNumber = ''
this.form1.locationNumber = ''
this.isShow = true
}
}).catch((err) => {
this.itemNumber = ''
this.form1.areaNumber = ''
this.form1.itemName = ''
this.form1.applyQty = ''
this.form1.deliveryQty = ''
this.locationList = [];
})
},
blur1() {

20
src/pages/outLocation/addForm.vue

@ -89,7 +89,7 @@
<view class="popup">
<u-form :model="form1" ref="form1" label-width="160rpx">
<u-form-item label="库位" prop="locationNumber" required>
<u-input v-model="form1.locationNumber" placeholder="请选择库位" disabled />
<u-input v-model="form1.locationNumber" placeholder="请选择库位" @blur="blur()" />
<view class="right-button" @click="chickRightButton">
扫描
</view>
@ -111,7 +111,7 @@
<u-form-item label="出库数量" prop="qty" required>
<u-input v-model="form1.qty" type="number" placeholder="请输入出库数量" />
</u-form-item>
<u-form-item label="描述" prop="qty" required>
<u-form-item label="描述" prop="qty">
<u-input v-model="form1.describes" placeholder="请输入描述" />
</u-form-item>
</u-form>
@ -212,7 +212,7 @@
this.form.approveName = res.data.approveName
this.form.applyDeptName = res.data.applyDeptName
this.form.subList = res.data.subList
})
}).catch(() => {})
},
//
open() {
@ -284,11 +284,19 @@
this.form1.areaNumber = res.data.areaNumber;
this.form1.itemName = res.data.itemName;
this.form1.itemNumber = res.data.itemNumber;
this.form1.receiveQty = res.data.receiveQty;
this.form1.applyQty = res.data.applyQty;
this.form1.stockQty = res.data.qty;
this.form1.receiveQty = res.data.receiveQty||0;
this.form1.applyQty = res.data.applyQty||0;
this.form1.stockQty = res.data.qty||0;
this.isInAccount = res.data.isInAccount || ''
// this.itemNumber = res.data.itemNumber || ''
}).catch(() => {
this.form1.areaNumber = '';
this.form1.itemName = '';
this.form1.itemNumber = '';
this.form1.receiveQty = '';
this.form1.applyQty = '';
this.form1.stockQty = '';
this.isInAccount = '';
})
},
blur() {

6
src/pages/outLocation/index.vue

@ -1,9 +1,9 @@
<template>
<!-- 领用入库 -->
<view class="container">
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
<!-- <u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="领用入库">
</u-navbar>
</u-navbar> -->
<!-- <Search @search='search' @screen='screen' /> -->
<view class="list">
<view class="item" v-for="(item,index) in list" :key="index" @click="openDetail(item)">
@ -86,7 +86,7 @@
} else {
this.status = 'nomore'
}
})
}).catch((err) => {})
},
},

48
src/pages/sparePartsReturn/addForm.vue

@ -58,7 +58,7 @@
<u-form :model="form1" ref="form1" label-width="160rpx">
<u-form-item :label="`备件编号`" prop="itemNumber" required>
<view class="select">
<u-input v-model="form1.itemNumber" placeholder="请选择备件" disabled/>
<u-input v-model="form1.itemNumber" placeholder="请选择备件" @blur="blur1()"/>
<view class="right-button" @click="chickRightButton1">
扫描
</view>
@ -70,7 +70,7 @@
</view>
</u-form-item>
<u-form-item label="库位" prop="locationNumber" required v-if="isShow">
<u-input v-model="form1.locationNumber" placeholder="请选择库位" disabled/>
<u-input v-model="form1.locationNumber" placeholder="请选择库位" @blur="blur()"/>
<view class="right-button" @click="chickRightButton">
扫描
</view>
@ -124,7 +124,8 @@
qty: ''
},
isShow: false,
isInAccount: 'FALSE'
locationList:[],//
locationItem:'',//
}
},
methods: {
@ -234,7 +235,7 @@ if(this.field == 'reverterId'){
this.$modal.showToast('请选择库位')
return;
}
if (this.isInAccount == 'TRUE') {
if (!this.locationItem || this.locationItem.isInAccount === 'TRUE') {
this.$modal.showToast('该库位属于帐内库,请选择帐外库')
return;
}
@ -267,9 +268,21 @@ if(this.field == 'reverterId'){
this.$modal.showToast('找不到该库位')
return;
}
this.form1.areaNumber = res.data.areaNumber;
this.isInAccount = res.data.isInAccount || ''
this.locationItem = res.data
this.form1.areaNumber = this.locationItem.areaNumber
//
if (this.form.itemNumbers && this.form.itemNumbers.length > 0) {
let arr = this.form.itemNumbers.filter(item => item.locationNumber == this.form1.locationNumber)
if (arr && arr.length > 0) {
this.itemNumber = 1
}else{
this.itemNumber = res.data.itemNumber || ''
}
}else{
this.itemNumber = res.data.itemNumber || ''
}
}).catch(()=>{
})
},
blur() {
@ -287,18 +300,31 @@ if(this.field == 'reverterId'){
this.itemNumber = ''
this.form1.areaNumber = ''
this.form1.locationNumber = '';
this.isInAccount = ''
this.form1.itemName = ''
return;
}
this.itemNumber = ''
this.form1.areaNumber = res.data.areaNumber || ''
this.form1.locationNumber = res.data.locationNumber;
this.isInAccount = res.data.isInAccount|| ''
this.form1.itemName = res.data.itemName
if (!this.form1.locationNumber) {
this.form1.deliveryQty = res.data.deliveryQty
this.form1.applyQty = res.data.applyQty
//
this.locationItem = res.data.list.filter(item=>item.isInAccount==='FALSE')[0]
if(this.locationItem){
this.form1.areaNumber = this.locationItem.areaNumber
this.form1.locationNumber = this.locationItem.locationNumber
this.isShow =false
}else{
this.form1.areaNumber = ''
this.form1.locationNumber = ''
this.isShow =true
}
}).catch((err)=>{
this.itemNumber = ''
this.form1.areaNumber = ''
this.form1.itemName = ''
this.form1.applyQty = ''
this.form1.deliveryQty = ''
this.locationList = [];
})
},
blur1() {

1
src/utils/request.js

@ -59,6 +59,7 @@ const request = config => {
resolve(res.data)
})
.catch(error => {
console.log('error',error)
let { message } = error
if (message === 'Network Error') {
message = '后端接口连接异常'

Loading…
Cancel
Save