|
|
@@ -7,11 +7,15 @@
|
|
|
<u-list @scrolltolower="scrolltolower">
|
|
|
<view v-for="(item,index) in List" :key="index" class="card_box">
|
|
|
<workOrderBom :item='item' @handleScan='handleScan'></workOrderBom>
|
|
|
- <deviceBom :item.workOrderId='item.workOrderId' :list='item.device' @scanIt='scanIt'></deviceBom>
|
|
|
- <view class="operate_box rx-sc">
|
|
|
- <u-button size="small" class="u-reset-button" type="success" @click="handAdd(item.workOrderId)" >手动添加</u-button>
|
|
|
- <u-button size="small" class="u-reset-button" type="success" @click="scanIt(item.workOrderId)">扫一扫</u-button>
|
|
|
- </view>
|
|
|
+
|
|
|
+ <deviceBom v-if='item.device.length != 0' :workOrderId='item.workOrderId' :list='item.device'
|
|
|
+ @scanIt='scanIt'></deviceBom>
|
|
|
+ <view class="operate_box rx-sc">
|
|
|
+ <u-button size="small" class="u-reset-button" type="success"
|
|
|
+ @click="handAdd(item.workOrderId)">手动添加</u-button>
|
|
|
+ <u-button size="small" class="u-reset-button" type="success"
|
|
|
+ @click="scanIt(item.workOrderId)">扫一扫</u-button>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</u-list>
|
|
|
|
|
|
@@ -118,13 +122,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
handleScan(id, type) {
|
|
|
console.log(id)
|
|
|
console.log(type)
|
|
|
|
|
|
- this.scanData('SCJHGD2024011700222', type, id)
|
|
|
+ this.scanData('SCJHGD20240117002', type, id)
|
|
|
return false
|
|
|
|
|
|
// let _this = this
|
|
|
@@ -142,70 +146,72 @@
|
|
|
let isFals = this.List.some(m => m.code == result)
|
|
|
if (isFals) {
|
|
|
uni.showToast({
|
|
|
- title: '工单已存在',
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- return false
|
|
|
- }
|
|
|
+ title: '工单已存在',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
|
|
|
- getByCode(result).then(res => {
|
|
|
- let _arr = this.List
|
|
|
- _arr.forEach((e, index) => {
|
|
|
- if (e.workOrderId == id) {
|
|
|
- _arr[index] = res
|
|
|
- }
|
|
|
- })
|
|
|
+ getByCode(result).then(res => {
|
|
|
+ let _arr = this.List
|
|
|
+ _arr.forEach((e, index) => {
|
|
|
+ if (e.workOrderId == id && res) {
|
|
|
+ _arr[index] = res
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- this.List = _arr
|
|
|
- this.$forceUpdate()
|
|
|
+ this.List = _arr
|
|
|
+ this.$forceUpdate()
|
|
|
|
|
|
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ scanIt(id) {
|
|
|
+ console.log(id)
|
|
|
+
|
|
|
+ this.scanItData('CX-EQ-YLSJL-016', id)
|
|
|
+ return false
|
|
|
+
|
|
|
+ let _this = this
|
|
|
+ uni.scanCode({
|
|
|
+ success: function(res) {
|
|
|
+ _this.scanItData(res.result, id)
|
|
|
}
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
- },
|
|
|
- scanIt(id) {
|
|
|
- console.log(id)
|
|
|
-
|
|
|
- this.scanItData('CX-EQ-YLSJL-016', id)
|
|
|
- return false
|
|
|
-
|
|
|
- let _this = this
|
|
|
- uni.scanCode({
|
|
|
- success: function(res) {
|
|
|
- _this.scanItData(res.result, id)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- scanItData(result,id) {
|
|
|
- scanLedger(result).then(res => {
|
|
|
- console.log(res)
|
|
|
- let _arr = []
|
|
|
- if(res.rootCategoryLevelId == 4) { // 设备
|
|
|
+ scanItData(result, id) {
|
|
|
+ scanLedger(result).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ let _arr = []
|
|
|
+ if (res.rootCategoryLevelId == 4) { // 设备
|
|
|
_arr = this.List
|
|
|
- _arr.forEach((e, index) => {
|
|
|
- if (e.workOrderId == id) {
|
|
|
- _arr[index].device = [res]
|
|
|
- }
|
|
|
- })
|
|
|
- this.List = _arr
|
|
|
- console.log(this.List)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- handAdd(id, list) {
|
|
|
- const storageKey = Date.now() + "";
|
|
|
- uni.setStorageSync(storageKey, list || []);
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}`
|
|
|
- })
|
|
|
- },
|
|
|
+ _arr.forEach((e, index) => {
|
|
|
+ if (e.workOrderId == id) {
|
|
|
+ _arr[index].device = [res]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.List = _arr
|
|
|
+
|
|
|
+ } else if (res.rootCategoryLevelId == 5) {
|
|
|
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
- }
|
|
|
+ handAdd(id, list) {
|
|
|
+ const storageKey = Date.now() + "";
|
|
|
+ uni.setStorageSync(storageKey, list || []);
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}&isType=feed`
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
@@ -251,11 +257,12 @@
|
|
|
color: #fff;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- .operate_box{
|
|
|
- padding: 10rpx 32rpx;
|
|
|
- /deep/ .u-button{
|
|
|
- width: 40%;
|
|
|
- }
|
|
|
+
|
|
|
+ .operate_box {
|
|
|
+ padding: 10rpx 160rpx;
|
|
|
+
|
|
|
+ /deep/ .u-button {
|
|
|
+ width: 140rpx;
|
|
|
}
|
|
|
+ }
|
|
|
</style>
|