修复采购订单编辑失败的问题

master
toesbieya 6 years ago
parent 3c1eb4bd79
commit 8432312e29
  1. 16
      vue/src/component/AbstractForm/FormAnchor.vue
  2. 3
      vue/src/mixin/docDetailMixin.js
  3. 2
      vue/src/view/purchase/inbound/detail.vue
  4. 4
      vue/src/view/purchase/order/detail.vue
  5. 2
      vue/src/view/sell/outbound/detail.vue
  6. 14
      vue/src/view/system/user/index.vue

@ -21,8 +21,8 @@ export default {
props: {
reference: Function,
data: {type: Array, default: () => []},
offsetTop: Number,
bounds: Number,
offsetTop: {type: Number, default: 15},
bounds: {type: Number, default: 0},
getContainer: {
type: Function,
default: () => document.querySelector('#app .app-main>.el-scrollbar>.el-scrollbar__wrap')
@ -32,13 +32,13 @@ export default {
data: () => ({cur: null}),
methods: {
getCur(offsetTop = 0, bounds = 5) {
getCur(offsetTop, bounds) {
const sections = []
const container = this.getContainer()
this.data.forEach(({ref}) => {
const target = this.getDomFromRef(ref)
const top = getOffsetTop(target, container)
if (top < offsetTop + bounds) {
if (top <= offsetTop + bounds) {
sections.push({ref, top})
}
})
@ -58,22 +58,20 @@ export default {
click(ref) {
if (!ref || this.animating || !this.reference) return
this.cur = ref
const {offsetTop, getContainer, targetOffset} = this
const {offsetTop, getContainer} = this
const container = getContainer()
const scrollTop = getScroll(container, true)
const targetElement = this.getDomFromRef(ref)
if (!targetElement) return
const eleOffsetTop = getOffsetTop(targetElement, container)
let y = scrollTop + eleOffsetTop
y -= targetOffset !== undefined ? targetOffset : offsetTop || 0
const y = scrollTop + eleOffsetTop - offsetTop
this.animating = true
scrollTo(y, {callback: () => this.animating = false, getContainer})
},
scroll() {
if (this.animating || !this.reference) return
const {offsetTop, bounds, targetOffset} = this
this.cur = this.getCur(targetOffset !== undefined ? targetOffset : offsetTop || 0, bounds)
this.cur = this.getCur(this.offsetTop, this.bounds)
}
},

@ -209,11 +209,12 @@ export default {
this.api.getById(id)
.then(data => {
if (!data || id !== data.id) return Promise.reject()
this.modifyDataBeforeMerge && this.modifyDataBeforeMerge(data)
return Promise.resolve(mergeObj(this.form, data))
})
.then(() => this.afterInit ? this.afterInit() : Promise.resolve())
.catch(e => {
console.log(e)
console.error(e)
return elAlert(`获取${this.docName}数据失败,请重试`, this.close)
})
.finally(() => this.loading = false)

@ -143,7 +143,7 @@ export default {
methods: {
afterInit() {
if (this.type !== 'edit') return
if (this.type !== 'edit') return Promise.resolve()
return getParentSubById(this.form.pid).then(data => this.parentSubList = data)
},
selectParent(id, sub) {

@ -244,8 +244,8 @@ export default {
}
return null
},
afterInit() {
this.form.data.forEach(item => item.__editable = false)
modifyDataBeforeMerge(data) {
data.data.forEach(item => item._editable = false)
}
}
}

@ -165,7 +165,7 @@ export default {
methods: {
afterInit() {
if (this.type === 'add') return
if (this.type === 'add') return Promise.resolve()
const ids = this.form.data.map(i => i.sid).join(',')
return Promise.all([
getParentSubById(this.form.pid),

@ -86,25 +86,23 @@
</template>
<script>
import tableMixin from '@/mixin/tablePageMixin'
import EditDialog from './component/EditDialog'
import RoleSelector from './component/RoleSelector'
import SearchForm from "@/component/SearchForm"
import SearchFormItem from "@/component/SearchForm/SearchFormItem"
import RoleSelector from './component/RoleSelector'
import EditDialog from './component/EditDialog'
import {delUser, getUsers, kick, resetUserPwd} from "@/api/system/user"
import {baseUrl, delUser, getUsers, kick, resetUserPwd} from "@/api/system/user"
import {isEmpty} from '@/util'
import {auth} from "@/util/auth"
import {autoCompleteUrl} from "@/util/file"
import {elConfirm, elError, elSuccess} from "@/util/message"
import {auth} from "@/util/auth"
import tableMixin from '@/mixin/tablePageMixin'
const baseUrl = '/system/user'
export default {
name: "userManagement",
mixins: [tableMixin],
components: {SearchForm, SearchFormItem, RoleSelector, EditDialog},
components: {EditDialog, RoleSelector, SearchForm, SearchFormItem},
data() {
return {

Loading…
Cancel
Save