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