Commit 4cdbe66d authored by Facius's avatar Facius

Merge branch 'test' of https://git.banshouhui.com/lijundan/self-support into test

parents 76700905 0ddeff05
...@@ -91,8 +91,8 @@ export default { ...@@ -91,8 +91,8 @@ export default {
methods: { methods: {
getWorkOrderParts() { getWorkOrderParts() {
// this.lists = JSON.parse(this.dataValue) || [] // this.lists = JSON.parse(this.dataValue) || []
console.log("this.dataValue", this.dataValue) const lists = this.dataValue ? JSON.parse(this.dataValue) : []
this.lists = this.dataValue ? JSON.parse(this.dataValue) : [] this.lists = lists.filter(v => v.name)
}, },
partsChange(val, index) { partsChange(val, index) {
this.$set(this.lists[index], 'quantity', val) this.$set(this.lists[index], 'quantity', val)
...@@ -114,6 +114,7 @@ export default { ...@@ -114,6 +114,7 @@ export default {
} }
}, },
valChange(val) { valChange(val) {
if (val) {
val.forEach((v) => { val.forEach((v) => {
const index = this.lists.findIndex((k) => k.part_id === v.part_id) const index = this.lists.findIndex((k) => k.part_id === v.part_id)
if (index < 0) { if (index < 0) {
...@@ -122,7 +123,10 @@ export default { ...@@ -122,7 +123,10 @@ export default {
this.$set(this.lists, index, v) this.$set(this.lists, index, v)
} }
}) })
this.valueChange(this.lists) } else {
this.lists = []
}
this.valueChange(JSON.stringify(val ? this.lists : [{}]))
}, },
toParts() { toParts() {
uni.navigateTo({ uni.navigateTo({
......
...@@ -82,6 +82,11 @@ export default { ...@@ -82,6 +82,11 @@ export default {
this.lists.forEach(v => { this.lists.forEach(v => {
this.$set(v, 'enable', v.id === val.id ? 1 : 0) this.$set(v, 'enable', v.id === val.id ? 1 : 0)
}) })
if (this.type === 'parts') {
let pages = getCurrentPages()
let prevPage = pages[pages.length - 2]
prevPage.$vm.loadAddress()
}
} }
}) })
}, },
...@@ -101,7 +106,7 @@ export default { ...@@ -101,7 +106,7 @@ export default {
} else { } else {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: res.data.message, title: res.message,
}) })
} }
}) })
......
...@@ -119,6 +119,9 @@ ...@@ -119,6 +119,9 @@
this.$u.route({ type: 'back' }) this.$u.route({ type: 'back' })
}, },
cancel() { cancel() {
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2]; //上一个页面
prevPage.$vm.$refs['fileChildParts'][0].valChange()
this.$u.route({ type: 'back' }) this.$u.route({ type: 'back' })
}, },
qnFile(src) { qnFile(src) {
......
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