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

2
src/pages.json

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

73
src/pages/inLocation/addForm.vue

@ -2,10 +2,10 @@
<!-- 添加维修工单 --> <!-- 添加维修工单 -->
<view class="add-form-container"> <view class="add-form-container">
<u-form :model="form" ref="form1" label-width="160rpx"> <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-input v-model="form.number" placeholder="请输入批次号" />
</u-form-item> </u-form-item>
<u-form-item label="供应商" prop="supplierName" required> <u-form-item label="供应商" prop="supplierName">
<u-input v-model="form.supplierName" placeholder="请输入供应商" /> <u-input v-model="form.supplierName" placeholder="请输入供应商" />
</u-form-item> </u-form-item>
</u-form> </u-form>
@ -87,7 +87,7 @@
<u-form :model="form1" ref="form1" label-width="160rpx"> <u-form :model="form1" ref="form1" label-width="160rpx">
<u-form-item :label="`备件编号`" prop="itemNumber" required> <u-form-item :label="`备件编号`" prop="itemNumber" required>
<view class="select"> <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 class="right-button" @click="chickRightButton1">
扫描 扫描
</view> </view>
@ -99,7 +99,7 @@
</view> </view>
</u-form-item> </u-form-item>
<u-form-item label="库位" prop="locationNumber" required v-if="isShow"> <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 class="right-button" @click="chickRightButton">
扫描 扫描
</view> </view>
@ -113,7 +113,7 @@
<u-form-item label="入库数量" prop="qty" required> <u-form-item label="入库数量" prop="qty" required>
<u-input v-model="form1.qty" type="number" placeholder="请输入入库数量" /> <u-input v-model="form1.qty" type="number" placeholder="请输入入库数量" />
</u-form-item> </u-form-item>
<u-form-item label="描述" prop="qty" required> <u-form-item label="描述" prop="qty">
<u-input v-model="form1.describes" placeholder="请输入描述" /> <u-input v-model="form1.describes" placeholder="请输入描述" />
</u-form-item> </u-form-item>
</u-form> </u-form>
@ -154,7 +154,8 @@
qty: '' qty: ''
}, },
isShow: false, isShow: false,
isInAccount: 'FALSE' locationList: [], //
locationItem: '', //
} }
}, },
methods: { methods: {
@ -206,7 +207,7 @@
async getInLocationDetail() { async getInLocationDetail() {
await inLocationApi.getInLocationDetail(this.form.id).then(res => { await inLocationApi.getInLocationDetail(this.form.id).then(res => {
this.orderList = res.data this.orderList = res.data
}) }).catch((err) => {})
}, },
// //
open() { open() {
@ -219,7 +220,7 @@
qty: '' qty: ''
} }
this.isPopupShow = true this.isPopupShow = true
this.isShow= false this.isShow = false
}, },
// //
addSpare() { addSpare() {
@ -236,7 +237,7 @@
this.$modal.showToast('请选择库位') this.$modal.showToast('请选择库位')
return; return;
} }
if (this.isInAccount == 'FALSE') { if (!this.locationItem || this.locationItem.isInAccount === 'FALSE') {
this.$modal.showToast('该库位属于帐外库,请选择帐内库') this.$modal.showToast('该库位属于帐外库,请选择帐内库')
return; return;
} }
@ -259,8 +260,8 @@
this.$modal.showToast('该备件已添加') this.$modal.showToast('该备件已添加')
return; 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)) { if (!arr1 || (arr1 && arr1.length == 0)) {
this.$modal.showToast('订单信息没有该备件') this.$modal.showToast('订单信息没有该备件')
return; return;
} }
@ -275,14 +276,26 @@
}, },
getLocation() { getLocation() {
locationApi.getLocation(this.form1.locationNumber).then(res => { locationApi.getLocation(this.form1.locationNumber).then(res => {
if(!res.data){ if (!res.data) {
this.$modal.showToast('找不到该库位') this.$modal.showToast('找不到该库位')
return; return;
} }
this.form1.areaNumber = res.data.areaNumber; this.locationItem = res.data
this.isInAccount = res.data.isInAccount || '' this.form1.areaNumber = this.locationItem.areaNumber
this.itemNumber = res.data.itemNumber || '' 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() { blur() {
if (this.form1.locationNumber) { if (this.form1.locationNumber) {
@ -295,25 +308,37 @@
number: this.form1.itemNumber, number: this.form1.itemNumber,
id: this.form.id id: this.form.id
}).then(res => { }).then(res => {
if(!res.data){ if (!res.data) {
this.$modal.showToast('找不到该备件') this.$modal.showToast('找不到该备件')
this.itemNumber = '' this.itemNumber = ''
this.form1.areaNumber = '' this.form1.areaNumber = ''
this.form1.locationNumber = ''; this.form1.locationNumber = '';
this.isInAccount = ''
this.form1.itemName = '' this.form1.itemName = ''
return; return;
} }
this.itemNumber = '' 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.itemName = res.data.itemName
this.form1.deliveryQty = res.data.deliveryQty this.form1.deliveryQty = res.data.deliveryQty
this.form1.applyQty = res.data.applyQty 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 this.isShow = true
} }
}).catch((err) => {
this.itemNumber = ''
this.form1.areaNumber = ''
this.form1.itemName = ''
this.form1.applyQty = ''
this.form1.deliveryQty = ''
this.locationList = [];
}) })
}, },
blur1() { blur1() {
@ -329,9 +354,9 @@
if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option
.data)).id) { .data)).id) {
let form = JSON.parse(decodeURIComponent(option.data)) let form = JSON.parse(decodeURIComponent(option.data))
this.form.supplierName =form.supplierName this.form.supplierName = form.supplierName
this.form.number =form.number this.form.number = form.number
this.form.id =form.id this.form.id = form.id
} }
await this.getInLocationDetail() await this.getInLocationDetail()
} }

22
src/pages/outLocation/addForm.vue

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

6
src/pages/outLocation/index.vue

@ -1,9 +1,9 @@
<template> <template>
<!-- 领用入库 --> <!-- 领用入库 -->
<view class="container"> <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="领用入库"> title="领用入库">
</u-navbar> </u-navbar> -->
<!-- <Search @search='search' @screen='screen' /> --> <!-- <Search @search='search' @screen='screen' /> -->
<view class="list"> <view class="list">
<view class="item" v-for="(item,index) in list" :key="index" @click="openDetail(item)"> <view class="item" v-for="(item,index) in list" :key="index" @click="openDetail(item)">
@ -86,7 +86,7 @@
} else { } else {
this.status = 'nomore' this.status = 'nomore'
} }
}) }).catch((err) => {})
}, },
}, },

50
src/pages/sparePartsReturn/addForm.vue

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

1
src/utils/request.js

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

Loading…
Cancel
Save