|
@@ -8,6 +8,13 @@
|
|
|
|
|
|
|
|
<view v-for="(item,index) in List" :key="index" class="card_box">
|
|
<view v-for="(item,index) in List" :key="index" class="card_box">
|
|
|
<workOrderBom :item='item' @handleScan='handleScan'></workOrderBom>
|
|
<workOrderBom :item='item' @handleScan='handleScan'></workOrderBom>
|
|
|
|
|
+
|
|
|
|
|
+ <deviceBom :item='item'></deviceBom>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="operate_box rx-sc">
|
|
|
|
|
+ <u-button size="small" class="u-reset-button" type="success" >手动添加</u-button>
|
|
|
|
|
+ <u-button size="small" class="u-reset-button" type="success" >扫一扫</u-button>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</u-list>
|
|
</u-list>
|
|
|
|
|
|
|
@@ -25,6 +32,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import workOrderBom from './components/workOrderBom.vue'
|
|
import workOrderBom from './components/workOrderBom.vue'
|
|
|
|
|
+ import deviceBom from './components/deviceBom.vue'
|
|
|
import {
|
|
import {
|
|
|
workorderList,
|
|
workorderList,
|
|
|
getByCode
|
|
getByCode
|
|
@@ -36,7 +44,8 @@
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
- workOrderBom
|
|
|
|
|
|
|
+ workOrderBom,
|
|
|
|
|
+ deviceBom
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -122,6 +131,9 @@
|
|
|
console.log(id)
|
|
console.log(id)
|
|
|
console.log(type)
|
|
console.log(type)
|
|
|
|
|
|
|
|
|
|
+ // this.scanData('SCJHGD20240117002', type, id)
|
|
|
|
|
+ // return false
|
|
|
|
|
+
|
|
|
let _this = this
|
|
let _this = this
|
|
|
uni.scanCode({
|
|
uni.scanCode({
|
|
|
success: function(res) {
|
|
success: function(res) {
|
|
@@ -133,15 +145,37 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
scanData(result, type, id) {
|
|
scanData(result, type, id) {
|
|
|
- console.log(444)
|
|
|
|
|
- getByCode(result).then(res => {
|
|
|
|
|
- console.log(res)
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ if (type == 'wordOrder') {
|
|
|
|
|
+ let isFals = this.List.some(m => m.code == result)
|
|
|
|
|
+ if (isFals) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '工单已存在',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ })
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ getByCode(result).then(res => {
|
|
|
|
|
+ let _arr = this.List
|
|
|
|
|
+ _arr.forEach((e, index) => {
|
|
|
|
|
+ if (e.workOrderId == id) {
|
|
|
|
|
+ _arr[index] = res
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ this.List = _arr
|
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -187,4 +221,11 @@
|
|
|
color: #fff;
|
|
color: #fff;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .operate_box{
|
|
|
|
|
+ padding: 10rpx 32rpx;
|
|
|
|
|
+ /deep/ .u-button{
|
|
|
|
|
+ width: 40%;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|