|
|
@@ -8,7 +8,7 @@
|
|
|
</view>
|
|
|
|
|
|
<view v-for="(item, index) in newList">
|
|
|
- <!-- <view class="title_box rx-bc">
|
|
|
+ <!-- <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>
|
|
|
@@ -59,8 +59,8 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="item ww20">
|
|
|
- <input class="uni-input content_num" v-model="it.reuseNum" type="digit" @input="handleCompute"
|
|
|
- ></input>
|
|
|
+ <input class="uni-input content_num" v-model="it.reuseNum" type="digit"
|
|
|
+ @input="handleCompute"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-list>
|
|
|
@@ -89,7 +89,11 @@
|
|
|
type: Object,
|
|
|
default: () => {}
|
|
|
},
|
|
|
-
|
|
|
+ sampleList: {
|
|
|
+ type: Array,
|
|
|
+ default: () => []
|
|
|
+ },
|
|
|
+
|
|
|
reuseNum: {
|
|
|
type: [String, Number],
|
|
|
default: ''
|
|
|
@@ -108,17 +112,34 @@
|
|
|
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
reuseNum: {
|
|
|
immediate: true,
|
|
|
deep: true,
|
|
|
handler(val) {
|
|
|
-
|
|
|
this.newReuseNum = val
|
|
|
this.$forceUpdate()
|
|
|
-
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ wordItem: {
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ handler(val) {
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ sampleList: {
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ handler(newList, oldList) {
|
|
|
+ this.reuseTurn(newList)
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
|
|
|
|
|
|
@@ -133,32 +154,53 @@
|
|
|
},
|
|
|
methods: {
|
|
|
scrolltolower() {},
|
|
|
-
|
|
|
+
|
|
|
handleCompute() {
|
|
|
let _count = 0
|
|
|
this.newList.forEach(f => {
|
|
|
- if(f.extInfo && f.extInfo.positionList && f.extInfo.positionList.length > 0) {
|
|
|
- f.extInfo.positionList.forEach(o => {
|
|
|
- if (Object.prototype.hasOwnProperty.call(o, 'reuseNum')) {
|
|
|
- _count = _count + Number(o.reuseNum)
|
|
|
-
|
|
|
+ if (f.extInfo && f.extInfo.positionList && f.extInfo.positionList.length > 0) {
|
|
|
+ f.extInfo.positionList.forEach(o => {
|
|
|
+ if (Object.prototype.hasOwnProperty.call(o, 'reuseNum')) {
|
|
|
+ _count = _count + Number(o.reuseNum)
|
|
|
+
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
- if(this.newReuseNum != _count) {
|
|
|
- uni.showToast({
|
|
|
- title: `还余 (${this.newReuseNum - _count})未回用`,
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
-
|
|
|
+
|
|
|
+ if (this.newReuseNum != _count) {
|
|
|
+ uni.showToast({
|
|
|
+ title: `还余 (${this.newReuseNum - _count})未回用`,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ reuseTurn(list) {
|
|
|
+
|
|
|
+ list.forEach(a => {
|
|
|
+ if (Object.prototype.hasOwnProperty.call(a, 'selectType') && a.selectType == 1 && !a.isSel) {
|
|
|
+ console.log(this.newList)
|
|
|
+ this.newList.forEach(f => {
|
|
|
+ if (f.extInfo && f.extInfo.positionList && f.extInfo.positionList.length > 0) {
|
|
|
+ f.extInfo.positionList.forEach(o => {
|
|
|
+ if (a.selectType == 1 && a.code == o.code) {
|
|
|
+ a.isSel = 1
|
|
|
+ o.reuseNum = Number(o.reuseNum) + 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|