Compare commits

..

No commits in common. "78bb5006abd6796b29fc25b84aa1acd2ce68cccc" and "070df2478b2fadf0e6171aa447d867ce25c8ad04" have entirely different histories.

2 changed files with 63 additions and 125 deletions

View File

@ -69,15 +69,15 @@
</view> </view>
<view class="order-footer"> <view class="order-footer">
<template v-if="!queryParams.isBack && typeof queryParams.isBack === 'boolean'"> <template v-if="!queryParams.isBack && isShow">
<view @click="inOutWareHouse(item,true)" class="order-btn yes">通知领料</view> <view @click="inOutWareHouse(item,true)" class="order-btn yes">通知领料</view>
<!-- <view class="order-btn yes">采购</view>--> <!-- <view class="order-btn yes">采购</view>-->
</template> </template>
<template v-else-if="!queryParams.isBack && typeof queryParams.isBack === 'undefined'"> <template v-else-if="!queryParams.isBack && !isShow">
<view @click="inOutWareHouse(item,true)" class="order-btn yes">查看申请</view> <view @click="inOutWareHouse(item,true)" class="order-btn yes">查看申请</view>
<!-- <view class="order-btn yes">采购</view>--> <!-- <view class="order-btn yes">采购</view>-->
</template> </template>
<template v-else-if="queryParams.isBack"> <template v-else-if="queryParams.isBack && isShow">
<view @click="inOutWareHouse(item,false)" class="order-btn yes">通知退料</view> <view @click="inOutWareHouse(item,false)" class="order-btn yes">通知退料</view>
</template> </template>
</view> </view>
@ -160,8 +160,6 @@ export default {
noReadNum: 0, noReadNum: 0,
// //
noticeNum: 0, noticeNum: 0,
//
ifFirstLogin: true,
} }
}, },
onLoad() { onLoad() {
@ -195,7 +193,7 @@ export default {
url: '/pages-home/msg/message' url: '/pages-home/msg/message'
}) })
}, },
socketSuccess() { socketSuccess(){
this.getNoReadNum() this.getNoReadNum()
this.onRefresherrefresh() this.onRefresherrefresh()
console.log('通知并刷新成功') console.log('通知并刷新成功')
@ -205,33 +203,19 @@ export default {
*/ */
activeTab(index) { activeTab(index) {
this.active = index this.active = index
if (index === 0) { if (index == 1) {
this.queryParams.isBack = false
this.queryParams.isToBeReviewed = undefined
this.isShow = true
} else if (index === 1) {
this.queryParams.isBack = true this.queryParams.isBack = true
this.queryParams.isToBeReviewed = undefined this.queryParams.isToBeReviewed = undefined
this.isShow = true this.isShow = true
} else if (index === 2) { } else if (index == 2) {
this.isShow = false this.isShow = false
this.queryParams.isToBeReviewed = true this.queryParams.isToBeReviewed = true
this.queryParams.isBack = undefined this.queryParams.isBack = undefined
} else {
this.isShow = true
this.queryParams.isBack = undefined
this.queryParams.isToBeReviewed = undefined
} }
// this.active = index
// if (index == 1) {
// this.queryParams.isBack = false
// this.queryParams.isToBeReviewed = undefined
// this.isShow = true
// } else if (index == 2) {
// this.isShow = true
// this.queryParams.isToBeReviewed = true
// this.queryParams.isBack = undefined
// } else {
// this.isShow = true
// this.queryParams.isBack = undefined
// this.queryParams.isToBeReviewed = undefined
// }
this.onRefresherrefresh() this.onRefresherrefresh()
}, },
@ -393,11 +377,6 @@ export default {
if (res.code == 200) { if (res.code == 200) {
this.noReadNum = res.data > 99 ? 99 : res.data this.noReadNum = res.data > 99 ? 99 : res.data
} }
if (this.ifFirstLogin && this.noReadNum > 0) {
console.log("播放")
this.$refs.tarBar.dianyidain()
this.ifFirstLogin = false
}
}) })
}, },
/** /**

View File

@ -1,11 +1,11 @@
<template> <template>
<view class="container"> <view class="container">
<VNavigationBar background-color="#fff" title="单据处理" title-color="#333"></VNavigationBar> <VNavigationBar background-color="#fff" title="单据处理" title-color="#333"></VNavigationBar>
<!-- <view class="tabs">--> <!-- <view class="tabs">-->
<!-- <view v-for="(item, index) in tabs" :key="index" :class="{'active': item.value === active}" class="tab-item">--> <!-- <view v-for="(item, index) in tabs" :key="index" :class="{'active': item.value === active}" class="tab-item">-->
<!-- {{ item.name }}--> <!-- {{ item.name }}-->
<!-- </view>--> <!-- </view>-->
<!-- </view>--> <!-- </view>-->
<view class="listBox"> <view class="listBox">
<view class="list"> <view class="list">
<view v-for="(item, index) in wares" :key="index" class="listItem"> <view v-for="(item, index) in wares" :key="index" class="listItem">
@ -38,8 +38,8 @@
<view class="footer" v-if="isToBeReviewed"> <view class="footer" v-if="isToBeReviewed">
<text class="label"></text> <text class="label"></text>
<text class="repairNum"></text> <text class="repairNum"></text>
<view class="submit" @click="toPart">采购</view> <view class="submit" @click="toPart">采购</view>
<view class="submit" @click="submit">{{ isReceive ? '通知领料' : '通知退料' }}</view> <view class="submit" @click="submit">{{isReceive?'通知领料':'通知退料'}}</view>
</view> </view>
</view> </view>
</template> </template>
@ -48,28 +48,28 @@
import VNavigationBar from "@/components/VNavigationBar.vue"; import VNavigationBar from "@/components/VNavigationBar.vue";
import request from '@/utils/request'; import request from '@/utils/request';
import { import {
getJSONData, setJSONData getJSONData,setJSONData
} from '@/utils/auth' } from '@/utils/auth'
import {getDictTextByCodeAndValue, createUniqueCodeByHead} from "@/utils/utils"; import {getDictTextByCodeAndValue,createUniqueCodeByHead} from "@/utils/utils";
export default { export default {
components: {VNavigationBar}, components: {VNavigationBar},
data() { data() {
return { return {
//id //id
twId: '', twId:'',
// //
wares: [], wares:[],
//true false 退 //true false 退
isReceive: true, isReceive:true,
// //
formData: {}, formData:{},
active: '', active: '',
isToBeReviewed: true isToBeReviewed:true
}; };
}, },
onLoad(data) { onLoad(data) {
if (getJSONData("applyWaresForm")) { if(getJSONData("applyWaresForm")){
this.formData = getJSONData("applyWaresForm") this.formData = getJSONData("applyWaresForm")
this.isReceive = this.formData.isReceive this.isReceive = this.formData.isReceive
this.twId = this.formData.id this.twId = this.formData.id
@ -87,63 +87,41 @@ export default {
*/ */
init() { init() {
const params = { const params = {
twId: this.formData.id twId:this.formData.id
} }
request({ request({
url: '/admin-api/repair/twi/list', url: '/admin-api/repair/twi/list',
method: 'get', method: 'get',
params: params params: params
}).then((res) => { }).then((res)=>{
this.wares = res.data res.data.map((item)=>{
if (this.isToBeReviewed){ if(!item.waresAlreadyCount){
this.wares = this.wares.filter(item => item.waresStatus === '1') item.waresAlreadyCount = 0
this.wares = this.wares.filter(item => this.isReceive ? (item.waresCount > item.waresAlreadyCount) : (item.waresAlreadyCount > 0))
}
this.wares.forEach(item => {
if (!item.wares.stock){
item.wares.stock = 0
} }
if (this.isReceive) { if(!item.wares.stock){
item.wares.stock=0
}
if(this.isReceive){
//- //-
item.maxNum = parseInt(item.waresCount) - parseInt(item.waresAlreadyCount) item.maxNum = parseInt(item.waresCount) - parseInt(item.waresAlreadyCount)
if (item.maxNum > item.wares.stock) { if(item.maxNum >item.wares.stock){
item.maxNum = item.wares.stock item.maxNum = item.wares.stock
} }
item.thisNum = item.maxNum item.thisNum = item.maxNum
} else { }else{
//退0,0 //退0,0
item.maxNum = item.waresAlreadyCount item.maxNum = item.waresAlreadyCount
item.thisNum = 0 item.thisNum = 0
} }
}) })
// res.data.map((item)=>{ this.wares = res.data;
// if(!item.waresAlreadyCount){
// item.waresAlreadyCount = 0
// }
// if(!item.wares.stock){
// item.wares.stock=0
// }
// if(this.isReceive){
// //-
// item.maxNum = parseInt(item.waresCount) - parseInt(item.waresAlreadyCount)
// if(item.maxNum >item.wares.stock){
// item.maxNum = item.wares.stock
// }
// item.thisNum = item.maxNum
// }else{
// //退0,0
// item.maxNum = item.waresAlreadyCount
// item.thisNum = 0
// }
// })
// this.wares = res.data;
}) })
}, },
/** /**
* *
*/ */
addNum(repair) { addNum(repair) {
if ((repair.thisNum + 1) > repair.maxNum) { if((repair.thisNum+1) > repair.maxNum){
uni.showToast({ uni.showToast({
title: '超过库存数量或最大申请数量!', title: '超过库存数量或最大申请数量!',
icon: 'none' icon: 'none'
@ -151,16 +129,13 @@ export default {
return return
} }
this.$set(repair, 'thisNum', repair.thisNum + 1) this.$set(repair, 'thisNum', repair.thisNum + 1)
const findIndex = this.wares.findIndex(f => f.id === repair.id); const find = this.wares.find(f => f.id == repair.id)
if (findIndex !== -1) { if (find) {
this.$set(this.wares, findIndex, repair); find.thisNum = repair.thisNum
} else {
this.wares.push(JSON.parse(JSON.stringify(repair)))
} }
// const find = this.wares.find(f => f.id == repair.id) console.log('repair', repair)
// if (find) {
// find.thisNum = repair.thisNum
// } else {
// this.wares.push(JSON.parse(JSON.stringify(repair)))
// }
}, },
/** /**
* *
@ -171,46 +146,32 @@ export default {
return return
} }
this.$set(repair, 'thisNum', repair.thisNum - 1) this.$set(repair, 'thisNum', repair.thisNum - 1)
const findIndex = this.wares.findIndex(f => f.id === repair.id); const find = this.wares.find(f => f.id == repair.id)
if (findIndex !== -1) { if (find) {
this.$set(this.wares, findIndex, repair); find.thisNum = repair.thisNum
} else {
this.wares.push(JSON.parse(JSON.stringify(repair)))
} }
// const find = this.wares.find(f => f.id == repair.id)
// if (find) {
// find.thisNum = repair.thisNum
// } else {
// this.wares.push(JSON.parse(JSON.stringify(repair)))
// }
}, },
/** /**
* 出库 * 出库
*/ */
submit() { submit() {
this.formData.repairSo = { this.formData.repairSo = {
soType: this.isReceive ? '02' : '04', soType:this.isReceive?'02':'04',
soNo: createUniqueCodeByHead(this.isReceive ? 'LL' : 'TL'), soNo:createUniqueCodeByHead(this.isReceive?'LL':'TL'),
userId: this.formData.repairId, userId:this.formData.repairId,
userName: this.formData.repairName, userName:this.formData.repairName,
soStatus: this.isReceive ? '04' : '07' soStatus:this.isReceive?'04':'07'
} }
// thisNum0 this.formData.repairSois = [...this.wares.map(item =>{
const flag = this.wares.filter(item => item.thisNum > 0)
if (!flag || flag.length === 0){
uni.showToast({
title: '请设置配件数量!',
icon: 'none'
})
return
}
this.wares = flag
this.formData.repairSois = [...this.wares.map(item => {
return { return {
soiType: this.isReceive ? '02' : "04", soiType: this.isReceive ? '02' : "04",
goodsId: item.waresId, goodsId: item.waresId,
goodsCount: item.thisNum, goodsCount: item.thisNum,
} }
})] })]
if (this.isReceive) { if (this.isReceive){
this.formData.items = [...this.wares.map(item => { this.formData.items = [...this.wares.map(item => {
return { return {
id: item.id, id: item.id,
@ -220,16 +181,16 @@ export default {
request({ request({
url: '/admin-api/repair/tw/pass', url: '/admin-api/repair/tw/pass',
method: 'post', method: 'post',
data: this.formData data:this.formData
}).then((res) => { }).then((res)=>{
if (res.code === 200) { if (res.code === 200){
uni.showToast({ uni.showToast({
title: '通知成功!', title: '通知成功!',
icon: 'none' icon: 'none'
}) })
setTimeout(() => { setTimeout(()=>{
uni.navigateBack() uni.navigateBack()
}, 700) },700)
} }
}) })
}, },
@ -237,10 +198,10 @@ export default {
/** /**
* 跳转采购页面 * 跳转采购页面
*/ */
toPart() { toPart(){
const formData = this.formData; const formData = this.formData;
formData.items = this.wares; formData.items = this.wares;
setJSONData("applyWaresForm", formData) setJSONData("applyWaresForm",formData)
uni.navigateTo({ uni.navigateTo({
url: '/pages-warehouse/inOutWarehouse/part' url: '/pages-warehouse/inOutWarehouse/part'
}) })
@ -322,11 +283,9 @@ export default {
.listItem { .listItem {
padding: 30rpx 0; padding: 30rpx 0;
border-bottom: 2rpx solid #DDDDDD; border-bottom: 2rpx solid #DDDDDD;
&:last-child { &:last-child {
border-bottom: none; border-bottom: none;
} }
.repairName { .repairName {
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;