Commit c4ff3bea authored by chuan.liu's avatar chuan.liu

配额 非配额订单数据回显

parent 9a7007d3
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
</view> </view>
</view> </view>
</view> </view>
<component :style="componentHeight" :is="currentTabComponent" @click="changeComponent" @submit="submit"> <component :style="componentHeight" :is="currentTabComponent" :key="currentTabComponent"
:is-keep-data='isKeepData' @click="changeComponent" @submit="submit">
</component> </component>
</view> </view>
</view> </view>
...@@ -74,7 +75,8 @@ ...@@ -74,7 +75,8 @@
data() { data() {
return { return {
currentTabComponent: 'quotaOrder', currentTabComponent: 'quotaOrder',
topHeight: '' topHeight: '',
isKeepData: false
} }
}, },
computed: { computed: {
...@@ -144,7 +146,8 @@ ...@@ -144,7 +146,8 @@
return false return false
}, },
methods: { methods: {
changeComponent(com) { changeComponent(com, status = false) {
this.isKeepData = status
this.currentTabComponent = com; this.currentTabComponent = com;
}, },
submit() { submit() {
......
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
// this.$refs.files.upload() // this.$refs.files.upload()
}, },
preStep() { preStep() {
this.$emit('click', 'quotaOrder') this.$emit('click', 'quotaOrder', true)
}, },
...mapMutations(["$uStore"]), ...mapMutations(["$uStore"]),
} }
......
...@@ -104,6 +104,12 @@ ...@@ -104,6 +104,12 @@
} from 'vuex' } from 'vuex'
export default { export default {
props: {
isKeepData: {
type: Boolean,
default: false
}
},
data() { data() {
return { return {
scrollTop: 0, scrollTop: 0,
...@@ -186,12 +192,29 @@ ...@@ -186,12 +192,29 @@
ITEM ITEM
} = res } = res
this.selectedSalesCenterArr = YXDY this.selectedSalesCenterArr = YXDY
if (this.isKeepData) {
const {
INFO,
ITEM: ITEM2,
} = this.noQuotaOrder
this.HEADINFO = {
...HEAD,
...INFO
}
this.planinnerLists = ITEM2
this.salesCenterIndex = YXDY.findIndex((item) => {
return this.HEADINFO.ZZFLD000001 === item.KEY
})
return
}
this.planinnerLists[0] = { this.planinnerLists[0] = {
...this.planinnerLists[0], ...this.planinnerLists[0],
...ITEM[0] ...ITEM[0]
} }
this.HEADINFO = HEAD this.HEADINFO = HEAD
this.productInitInfo = ITEM[0] // this.productInitInfo = ITEM[0]
}, },
async updateNoQuotaData(productIndex, mode, product) { async updateNoQuotaData(productIndex, mode, product) {
console.log('updateNoQuotaData---entry', productIndex, mode, product) console.log('updateNoQuotaData---entry', productIndex, mode, product)
......
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
// this.$refs.files.upload() // this.$refs.files.upload()
}, },
preStep() { preStep() {
this.$emit('click', 'quotaOrder') this.$emit('click', 'quotaOrder', true)
}, },
...mapMutations(["$uStore"]), ...mapMutations(["$uStore"]),
} }
......
...@@ -168,6 +168,12 @@ ...@@ -168,6 +168,12 @@
} from 'vuex' } from 'vuex'
export default { export default {
props: {
isKeepData: {
type: Boolean,
default: false
}
},
data() { data() {
return { return {
scrollTop: 0, scrollTop: 0,
...@@ -204,6 +210,16 @@ ...@@ -204,6 +210,16 @@
return money return money
} }
}, },
// watch: {
// 'isKeepData': {
// handler(val) {
// if (val === false) {
// this.initQuotaData()
// }
// },
// immediate: true
// }
// },
created() { created() {
this.initQuotaData() this.initQuotaData()
}, },
...@@ -276,12 +292,30 @@ ...@@ -276,12 +292,30 @@
ITEM_INNER ITEM_INNER
} = res } = res
this.selectedSalesCenterArr = YXDY this.selectedSalesCenterArr = YXDY
if (this.isKeepData) {
const {
INFO,
ITEM_INNER: ITEM_INNER2,
ITEM_OUTER
} = this.quotaOrder
this.HEADINFO = {
...HEAD,
...INFO
}
this.planinnerLists = ITEM_INNER2
this.planoutLists = ITEM_OUTER
this.salesCenterIndex = YXDY.findIndex((item) => {
return this.HEADINFO.ZZFLD000001 === item.KEY
})
return
}
this.planinnerLists[0] = { this.planinnerLists[0] = {
...this.planinnerLists[0], ...this.planinnerLists[0],
...ITEM_INNER[0] ...ITEM_INNER[0]
} }
this.HEADINFO = HEAD this.HEADINFO = HEAD
this.productInitInfo = ITEM_INNER[0] // this.productInitInfo = ITEM_INNER[0]s
}, },
// 更新行项目信息 // 更新行项目信息
async updateQuotaData(productIndex, mode, product) { async updateQuotaData(productIndex, mode, product) {
...@@ -413,7 +447,7 @@ ...@@ -413,7 +447,7 @@
}, },
// 计算小计 // 计算小计
calcInnerTotal(e, item, i) { calcInnerTotal(e, item, i) {
console.log('sss', item, e) // console.log('sss', item, e)
let value = 0 let value = 0
if (e.target.value) { if (e.target.value) {
value = e.target.value value = e.target.value
......
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
</view> </view>
</view> </view>
</view> </view>
<component :style="componentHeight" :is="currentTabComponent" @click="changeComponent" @submit="submit"> <component :style="componentHeight" :is="currentTabComponent" :key="currentTabComponent"
:is-keep-data='isKeepData' @click="changeComponent" @submit="submit">
</component> </component>
</view> </view>
</view> </view>
...@@ -74,7 +75,8 @@ ...@@ -74,7 +75,8 @@
data() { data() {
return { return {
currentTabComponent: 'quotaOrder', currentTabComponent: 'quotaOrder',
topHeight: '' topHeight: '',
isKeepData: false
} }
}, },
computed: { computed: {
...@@ -145,7 +147,8 @@ ...@@ -145,7 +147,8 @@
return false return false
}, },
methods: { methods: {
changeComponent(com) { changeComponent(com, status = false) {
this.isKeepData = status
this.currentTabComponent = com; this.currentTabComponent = com;
}, },
submit() { submit() {
......
...@@ -263,7 +263,7 @@ ...@@ -263,7 +263,7 @@
this.getProduct(true) this.getProduct(true)
}, },
handleChecked(e, item, index) { handleChecked(e, item, index) {
console.log('当前索引:', e, index); // console.log('当前索引:', e, index);
this.lists.forEach((cur) => { this.lists.forEach((cur) => {
if (cur.PRODUCT_ID === item.PRODUCT_ID) { if (cur.PRODUCT_ID === item.PRODUCT_ID) {
cur.checked = !cur.checked cur.checked = !cur.checked
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment