|
|
@@ -1,163 +1,100 @@
|
|
|
<template>
|
|
|
-
|
|
|
- <view>
|
|
|
- <view>
|
|
|
- <view class="title_box rx-bc">
|
|
|
- <view class="name">周转车</view>
|
|
|
- </view>
|
|
|
|
|
|
- <view v-for="(item, index) in newList" :key='index'>
|
|
|
+ <view>
|
|
|
+ <view>
|
|
|
<view class="title_box rx-bc">
|
|
|
- <view class="btn_box rx-bc" @click="handleTrade(index)" >
|
|
|
- 工单换周转车
|
|
|
- </view>
|
|
|
+ <view class="name">周转车</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="content_table">
|
|
|
- <view class="item rx-sc">
|
|
|
- <view class="rx ww50 ">
|
|
|
- <view class="lable ww80 rx-cc ">编号</view>
|
|
|
- <view class="content rx-sc">
|
|
|
- <view>{{item.code}}</view>
|
|
|
- </view>
|
|
|
+ <view v-for="(item, index) in newList" :key='index'>
|
|
|
+ <view class="title_box rx-bc">
|
|
|
+ <view class="btn_box rx-bc" @click="handleTrade(index)" v-if='item.isOld == 1'>
|
|
|
+ 工单换周转车
|
|
|
</view>
|
|
|
-
|
|
|
- <view class="rx ww50">
|
|
|
- <view class="lable rx-cc ww80">名称</view>
|
|
|
- <view class="content rx-sc">
|
|
|
- <view>{{item.name}}</view>
|
|
|
- </view>
|
|
|
+
|
|
|
+ <view class='title_des' v-if='item.isOld == 0'>
|
|
|
+ 转换后周转车详
|
|
|
</view>
|
|
|
-
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
-
|
|
|
- <view class="content_table2">
|
|
|
- <view class="head row rx-sc">
|
|
|
- <view class="item ww10">货位</view>
|
|
|
- <view class="item ww30">工单编号</view>
|
|
|
- <view class="item ww30">产品编码</view>
|
|
|
- <view class="item ww15">数量</view>
|
|
|
- <view class="item ww15"></view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="table">
|
|
|
- <view class="tr row rx-sc" v-for="(it, idx) in item.extInfo.positionList" :key='idx'>
|
|
|
- <view class="item ww10">{{it.code}}</view>
|
|
|
- <view class="item ww30" :class="{'color157': it.workOrderCode === wordItem.code}">
|
|
|
- {{ it.workOrderCode }}
|
|
|
- </view>
|
|
|
- <view class="item ww30" :class="{'color157': it.categoryCode === wordItem.productCode}">
|
|
|
- {{it.categoryCode}}
|
|
|
- </view>
|
|
|
- <view class="item ww15 ">
|
|
|
- <text :class="{ 'isend': it.isend }">{{it.newQuantity}}</text>
|
|
|
+ <view class="content_table">
|
|
|
+ <view class="item rx-sc">
|
|
|
+ <view class="rx ww50 ">
|
|
|
+ <view class="lable ww80 rx-cc ">编号</view>
|
|
|
+ <view class="content rx-sc">
|
|
|
+ <view>{{item.code}}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="item ww15 rx-cc " v-if='!it.isend ' @click="handleCheck(index, idx, it)">
|
|
|
-
|
|
|
- <image class="check" v-if='it.check' src='@/static/check.png'></image>
|
|
|
- <image class="check" v-else src='@/static/check_no.png'></image>
|
|
|
+ <view class="rx ww50">
|
|
|
+ <view class="lable rx-cc ww80">名称</view>
|
|
|
+ <view class="content rx-sc">
|
|
|
+ <view>{{item.name}}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+
|
|
|
</view>
|
|
|
+ </view>
|
|
|
|
|
|
|
|
|
+ <view class="content_table2">
|
|
|
+ <view class="head row rx-sc">
|
|
|
+ <view class="item ww10">货位</view>
|
|
|
+ <view class="item ww30">工单编号</view>
|
|
|
+ <view class="item ww30">产品编码</view>
|
|
|
+ <view class="item ww15">数量</view>
|
|
|
+ <view class="item ww15"></view>
|
|
|
+ </view>
|
|
|
|
|
|
+ <view class="table">
|
|
|
+ <view class="tr row rx-sc" v-for="(it, idx) in item.extInfo.positionList" :key='idx'>
|
|
|
+ <view class="item ww10">{{it.code}}</view>
|
|
|
+ <view class="item ww30" :class="{'color157': it.workOrderCode === wordItem.code}">
|
|
|
+ {{ it.workOrderCode }}
|
|
|
+ </view>
|
|
|
+ <view class="item ww30" :class="{'color157': it.categoryCode === wordItem.productCode}">
|
|
|
+ {{it.categoryCode}}
|
|
|
+ </view>
|
|
|
+ <view class="item ww15 ">
|
|
|
+ <text :class="{ 'isend': it.isend }">{{it.newQuantity}}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="item ww15 rx-cc " v-if='!it.isend ' @click="handleCheck(index, idx, it)">
|
|
|
+
|
|
|
+ <image class="check" v-if='item.isOld != 0 && it.check' src='@/static/check.png'></image>
|
|
|
+ <image class="check" v-if='item.isOld != 0 && !it.check' src='@/static/check_no.png'></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
|
|
|
|
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
|
|
- </view>
|
|
|
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view>
|
|
|
- <view class="title_box rx-bc">
|
|
|
- <view class="name">更换后周转车</view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view v-for="(item, index) in newTurnover" :key='index'>
|
|
|
- <view class="title_box rx-bc">
|
|
|
- <view class="left rx-ss" @click="getDelete(index)" >
|
|
|
- <uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
|
|
|
- </view>
|
|
|
-
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="content_table">
|
|
|
- <view class="item rx-sc">
|
|
|
- <view class="rx ww50 ">
|
|
|
- <view class="lable ww80 rx-cc ">编号</view>
|
|
|
- <view class="content rx-sc">
|
|
|
- <view>{{item.code}}</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="rx ww50">
|
|
|
- <view class="lable rx-cc ww80">名称</view>
|
|
|
- <view class="content rx-sc">
|
|
|
- <view>{{item.name}}</view>
|
|
|
- </view>
|
|
|
</view>
|
|
|
-
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
-
|
|
|
- <view class="content_table2">
|
|
|
- <view class="head row rx-sc">
|
|
|
- <view class="item ww10">货位</view>
|
|
|
- <view class="item ww30">工单编号</view>
|
|
|
- <view class="item ww35">产品编码</view>
|
|
|
- <view class="item ww25">数量</view>
|
|
|
-
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="table">
|
|
|
- <view class="tr row rx-sc" v-for="(it, idx) in item.extInfo.positionList" :key='idx'>
|
|
|
- <view class="item ww10">{{it.code}}</view>
|
|
|
- <view class="item ww30" :class="{'color157': it.workOrderCode === wordItem.code}">
|
|
|
- {{ it.workOrderCode }}
|
|
|
- </view>
|
|
|
- <view class="item ww35" :class="{'color157': it.categoryCode === wordItem.productCode}">
|
|
|
- {{it.categoryCode}}
|
|
|
- </view>
|
|
|
- <view class="item ww25 content_num">
|
|
|
- <input class="uni-input" v-if='it.isFull == 0' @input="quantInt(index, idx, it)"
|
|
|
- v-model="it.quantity" type="digit" ></input>
|
|
|
- <text v-else>{{it.quantity}}</text>
|
|
|
- </view>
|
|
|
-
|
|
|
-
|
|
|
- </view>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
</view>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
- </view>
|
|
|
+
|
|
|
+ <turnoverPopup ref='turnoverRef' @saveTurn='saveTurn'></turnoverPopup>
|
|
|
+
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
-
|
|
|
- scanLedger,
|
|
|
-
|
|
|
-
|
|
|
+ transferVehicle,
|
|
|
} from '@/api/pda/workOrder.js'
|
|
|
+
|
|
|
+ import turnoverPopup from './turnoverPopup.vue'
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ turnoverPopup
|
|
|
+ },
|
|
|
props: {
|
|
|
list: {
|
|
|
type: Array,
|
|
|
@@ -169,11 +106,11 @@
|
|
|
},
|
|
|
|
|
|
|
|
|
- newTurnover: {
|
|
|
+ newTurnover: {
|
|
|
type: Array,
|
|
|
default: () => []
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
|
|
|
|
|
|
@@ -193,7 +130,7 @@
|
|
|
return {
|
|
|
recycleQuantity: '',
|
|
|
newList: [],
|
|
|
-
|
|
|
+
|
|
|
wordInfo: {
|
|
|
workOrderCode: null,
|
|
|
categoryCode: null,
|
|
|
@@ -203,20 +140,8 @@
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
- quantInt(index, idx, it) {
|
|
|
- if (it.quantity >= 1) {
|
|
|
- this.$set(this.newTurnover[index].extInfo.positionList[idx], 'workOrderCode', this.wordInfo.workOrderCode )
|
|
|
- this.$set(this.newTurnover[index].extInfo.positionList[idx], 'categoryCode', this.wordInfo.categoryCode)
|
|
|
-
|
|
|
- } else {
|
|
|
- this.$set(this.newTurnover[index].extInfo.positionList[idx], 'workOrderCode', '')
|
|
|
- this.$set(this.newTurnover[index].extInfo.positionList[idx], 'categoryCode', '')
|
|
|
- this.$set(this.newTurnover[index].extInfo.positionList[idx], 'quantity', 0)
|
|
|
- }
|
|
|
|
|
|
|
|
|
- },
|
|
|
-
|
|
|
handleCheck(index, idx, it) {
|
|
|
|
|
|
|
|
|
@@ -241,9 +166,6 @@
|
|
|
|
|
|
if (flag) {
|
|
|
this.$set(this.newList[index].extInfo.positionList[idx], 'check', !it.check)
|
|
|
- if(it.check) {
|
|
|
- this.$set(this.newList[index].extInfo.positionList[idx], 'quantity', 0)
|
|
|
- }
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
@@ -256,61 +178,62 @@
|
|
|
},
|
|
|
|
|
|
handleTrade(index) {
|
|
|
-
|
|
|
+
|
|
|
let arr = this.newList[index].extInfo.positionList.filter(e => {
|
|
|
return e.check
|
|
|
})
|
|
|
- if(arr.length == 0) {
|
|
|
+ if (arr.length == 0) {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
title: '请先勾选需要转移的工单'
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
return false
|
|
|
}
|
|
|
-
|
|
|
- arr.forEach(f => {
|
|
|
- f.isend = true
|
|
|
- })
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
this.wordInfo.workOrderCode = arr[0].workOrderCode
|
|
|
this.wordInfo.categoryCode = arr[0].categoryCode
|
|
|
-
|
|
|
- // 周转车
|
|
|
- this.scanData('w0300000004195005')
|
|
|
+
|
|
|
+
|
|
|
+ this.$refs.turnoverRef.open('w0300000004195005', this.wordInfo, this.newList, this.wordItem, index)
|
|
|
return false
|
|
|
-
|
|
|
+
|
|
|
let _this = this
|
|
|
uni.scanCode({
|
|
|
success: function(res) {
|
|
|
- _this.scanData(res.result)
|
|
|
+
|
|
|
+ _this.$refs.turnoverRef.open(res.result, this.wordInfo, this.newList, this.wordItem,
|
|
|
+ index)
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
- scanData(result) {
|
|
|
- let _turnover = [...this.newList, ...this.newTurnover]
|
|
|
- let isFals = _turnover.some(m => m.code == result)
|
|
|
- if (isFals) {
|
|
|
- uni.showToast({
|
|
|
- title: '周转车已存在',
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- return false
|
|
|
- }
|
|
|
-
|
|
|
- scanLedger(result).then(res => {
|
|
|
-
|
|
|
- this.newTurnover.push(res[0])
|
|
|
- console.log( this.newTurnover)
|
|
|
+
|
|
|
+ saveTurn(index, newTurnover) {
|
|
|
+ let arr = this.newList[index].extInfo.positionList.filter(e => {
|
|
|
+ return e.check
|
|
|
})
|
|
|
- },
|
|
|
+
|
|
|
+ arr.forEach(f => {
|
|
|
+ f.isend = true
|
|
|
+ f.quantity = 0
|
|
|
+ })
|
|
|
+
|
|
|
+ let turnoverArr = []
|
|
|
+ newTurnover[0].isOld = 0 // 新的
|
|
|
+ newTurnover[0].id = null
|
|
|
+ this.newList[index].isOld = 1 // 老的
|
|
|
+ turnoverArr = [this.newList[index], ...newTurnover]
|
|
|
|
|
|
- getDelete(index) {
|
|
|
- this.newTurnover.splice(index, 1)
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
+ transferVehicle(turnoverArr).then(res => {
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
@@ -452,14 +375,15 @@
|
|
|
width: 35%;
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.ww15 {
|
|
|
width: 15%;
|
|
|
}
|
|
|
+
|
|
|
.ww25 {
|
|
|
width: 25%;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
.ww30 {
|
|
|
width: 30%;
|
|
|
@@ -533,7 +457,13 @@
|
|
|
width: 40rpx;
|
|
|
height: 40rpx;
|
|
|
}
|
|
|
- .isend{
|
|
|
- text-decoration:line-through;
|
|
|
+
|
|
|
+ .isend {
|
|
|
+ text-decoration: line-through;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title_des{
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #FFA929;
|
|
|
}
|
|
|
</style>
|