| | |
| | | <a-input |
| | | v-model="model.num" |
| | | placeholder="将由系统自动生成" |
| | | disabled |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | |
| | | }) |
| | | }, |
| | | created() { |
| | | this.initNum() |
| | | }, |
| | | methods: { |
| | | |
| | | initNum() { |
| | | getAction(this.url.getNum, { type: 'EquipmentScrap', length: '4' }).then((res) => { |
| | | if (res.success) { |
| | | this.model.num = res.message |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | //选择设备 |
| | | selectEquipmentList() { |
| | |
| | | if (this.model.id) { |
| | | let params = { equipmentChangeId: this.model.id } |
| | | this.requestSubTableData(this.url.equipmentScrapDetail.list, params, this.equipmentScrapDetailTable) |
| | | }else{ |
| | | getAction(this.url.getNum, { type: 'EquipmentScrap', length: '4' }).then((res) => { |
| | | if (res.success) { |
| | | this.model.num = res.message |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | //校验所有一对一子表表单 |
| | |
| | | target.removeRows(rowId) |
| | | }, |
| | | // 重写add 方法 默认不增加一行 |
| | | add(num = 0, forceScrollToBottom = false) { |
| | | if (num < 1) return |
| | | // let timestamp = new Date().getTime() |
| | | let rows = this.rows |
| | | let row |
| | | for (let i = 0; i < num; i++) { |
| | | rows = this.push({}, false, rows) |
| | | row = rows[rows.length - 1] |
| | | } |
| | | this.rows = rows |
| | | // add(num = 0, forceScrollToBottom = false) { |
| | | // if (num < 1) return |
| | | // // let timestamp = new Date().getTime() |
| | | // let rows = this.rows |
| | | // let row |
| | | // for (let i = 0; i < num; i++) { |
| | | // rows = this.push({}, false, rows) |
| | | // row = rows[rows.length - 1] |
| | | // } |
| | | // this.rows = rows |
| | | |
| | | this.$nextTick(() => { |
| | | this.updateFormValues() |
| | | }) |
| | | // 触发add事件 |
| | | this.$emit('added', { |
| | | row: (() => { |
| | | let r = Object.assign({}, row) |
| | | r.id = this.getCleanId(r.id) |
| | | return r |
| | | })(), |
| | | target: this |
| | | }) |
| | | // 设置滚动条位置 |
| | | let tbody = this.getElement('tbody') |
| | | let offsetHeight = tbody.offsetHeight |
| | | let realScrollTop = tbody.scrollTop + offsetHeight |
| | | if (forceScrollToBottom) { |
| | | this.$nextTick(() => { |
| | | this.resetScrollTop(this.$refs.scrollView.scrollHeight) |
| | | }) |
| | | } |
| | | } |
| | | // this.$nextTick(() => { |
| | | // this.updateFormValues() |
| | | // }) |
| | | // // 触发add事件 |
| | | // this.$emit('added', { |
| | | // row: (() => { |
| | | // let r = Object.assign({}, row) |
| | | // r.id = this.getCleanId(r.id) |
| | | // return r |
| | | // })(), |
| | | // target: this |
| | | // }) |
| | | // // 设置滚动条位置 |
| | | // let tbody = this.getElement('tbody') |
| | | // let offsetHeight = tbody.offsetHeight |
| | | // let realScrollTop = tbody.scrollTop + offsetHeight |
| | | // if (forceScrollToBottom) { |
| | | // this.$nextTick(() => { |
| | | // this.resetScrollTop(this.$refs.scrollView.scrollHeight) |
| | | // }) |
| | | // } |
| | | // } |
| | | |
| | | } |
| | | } |