|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="content-box">
|
|
<view class="content-box">
|
|
|
<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" background-color="#F7F9FA"
|
|
<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" background-color="#F7F9FA"
|
|
|
- color="#000" @clickLeft="back">
|
|
|
|
|
|
|
+ color="#000" @clickLeft="back" right-icon="scan" @clickRight="HandlScanCode">
|
|
|
</uni-nav-bar>
|
|
</uni-nav-bar>
|
|
|
<view class="list_box">
|
|
<view class="list_box">
|
|
|
<u-list @scrolltolower="scrolltolower">
|
|
<u-list @scrolltolower="scrolltolower">
|
|
@@ -9,7 +9,20 @@
|
|
|
|
|
|
|
|
<workOrderBom :item='item' v-if='item' @handleScan='handleWordScan'></workOrderBom>
|
|
<workOrderBom :item='item' v-if='item' @handleScan='handleWordScan'></workOrderBom>
|
|
|
|
|
|
|
|
- <sampleBom :item='item.quality' v-if='item.quality' :isDetails='false'></sampleBom>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <turnoverBom v-if='item.turnover.length != 0' :list='item.turnover' :wordItem='item' pattern='job'
|
|
|
|
|
+ @handleScan='handleScan'>
|
|
|
|
|
+ </turnoverBom>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <sampleBom :item='item.quality' v-if='item.quality' :isDetails='false' :turnoverList='item.turnover'></sampleBom>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="operate_box rx-sc">
|
|
|
|
|
+ <u-button size="small" class="u-reset-button" type="success" @click="handAdd">手动添加</u-button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</u-list>
|
|
</u-list>
|
|
@@ -27,19 +40,22 @@
|
|
|
<script>
|
|
<script>
|
|
|
import {
|
|
import {
|
|
|
workorderList,
|
|
workorderList,
|
|
|
-
|
|
|
|
|
|
|
+ scanLedger,
|
|
|
|
|
+ sampleTurnoverReview
|
|
|
} from '@/api/pda/workOrder.js'
|
|
} from '@/api/pda/workOrder.js'
|
|
|
|
|
|
|
|
|
|
|
|
|
import workOrderBom from '../../feeding/components/workOrderBom.vue'
|
|
import workOrderBom from '../../feeding/components/workOrderBom.vue'
|
|
|
import sampleBom from '../components/sampleBom.vue'
|
|
import sampleBom from '../components/sampleBom.vue'
|
|
|
|
|
+ import turnoverBom from '../components/turnoverBom.vue'
|
|
|
import {
|
|
import {
|
|
|
batchSave
|
|
batchSave
|
|
|
} from '@/api/pda/feeding.js'
|
|
} from '@/api/pda/feeding.js'
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
workOrderBom,
|
|
workOrderBom,
|
|
|
- sampleBom
|
|
|
|
|
|
|
+ sampleBom,
|
|
|
|
|
+ turnoverBom
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -58,6 +74,27 @@
|
|
|
this.id = options.workOrderId
|
|
this.id = options.workOrderId
|
|
|
this.taskId = options.taskId
|
|
this.taskId = options.taskId
|
|
|
this.getList()
|
|
this.getList()
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ onShow() {
|
|
|
|
|
+ uni.$off("setSelectList");
|
|
|
|
|
+ uni.$on("setSelectList", (selectList, id) => {
|
|
|
|
|
+
|
|
|
|
|
+ let turnover = [] //周转车
|
|
|
|
|
+ selectList.forEach(f => {
|
|
|
|
|
+ if (f.rootCategoryLevelId == 7) {
|
|
|
|
|
+ turnover = turnover.concat(f)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ this.$set(this.List[0], 'turnover', turnover)
|
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
getList() {
|
|
getList() {
|
|
@@ -66,8 +103,7 @@
|
|
|
taskId: this.taskId
|
|
taskId: this.taskId
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
|
|
|
|
|
- console.log(11)
|
|
|
|
|
- console.log(res)
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
this.List = res.map(m => {
|
|
this.List = res.map(m => {
|
|
|
m.workOrderId = m.id
|
|
m.workOrderId = m.id
|
|
@@ -77,6 +113,12 @@
|
|
|
this.isLastJob = false
|
|
this.isLastJob = false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (Object.prototype.hasOwnProperty.call(m, 'turnover')) {
|
|
|
|
|
+ m['turnover'] = []
|
|
|
|
|
+ this.getSampleTurnover()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
m.feedType = 2
|
|
m.feedType = 2
|
|
|
delete m.id
|
|
delete m.id
|
|
|
return {
|
|
return {
|
|
@@ -85,6 +127,16 @@
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ getSampleTurnover(){
|
|
|
|
|
+ let param = {
|
|
|
|
|
+ workOrderId: this.id,
|
|
|
|
|
+ taskId: this.taskId
|
|
|
|
|
+ }
|
|
|
|
|
+ sampleTurnoverReview(param).then(res => {
|
|
|
|
|
+ this.List[0].turnover = res
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
scrolltolower() {},
|
|
scrolltolower() {},
|
|
|
|
|
|
|
@@ -95,6 +147,44 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ // 相机扫码
|
|
|
|
|
+ HandlScanCode() {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ this.scanItAllData('w0300000003574001')
|
|
|
|
|
+ return false
|
|
|
|
|
+
|
|
|
|
|
+ let _this = this
|
|
|
|
|
+ uni.scanCode({
|
|
|
|
|
+ success: function(res) {
|
|
|
|
|
+ _this.scanItAllData(res.result)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ scanItAllData(result) {
|
|
|
|
|
+ scanLedger(result).then(res => {
|
|
|
|
|
+ if (res.length == 1 && res[0].rootCategoryLevelId == 7) { // 周转车
|
|
|
|
|
+
|
|
|
|
|
+ let isFals = this.List[0].turnover.some(m => m.code == result)
|
|
|
|
|
+ if (isFals) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '周转车已存在',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ })
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ this.List[0].turnover.push(res[0])
|
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
save() {
|
|
save() {
|
|
|
|
|
|
|
|
|
|
|
|
@@ -131,6 +221,19 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ handAdd() {
|
|
|
|
|
+ let param = {
|
|
|
|
|
+ turnover: this.List[0].turnover
|
|
|
|
|
+ }
|
|
|
|
|
+ const storageKey = Date.now() + "";
|
|
|
|
|
+
|
|
|
|
|
+ uni.setStorageSync(storageKey, param || {});
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: `/pages/pda/workOrder/search/index?storageKey=${storageKey}&isType=job&taskId=${this.taskId}`
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|