import Magix from 'magix' import * as View from '../../../../view' Magix.applyStyle('@./batch-modify-premium.less') export default View.extend({ tmpl: '@batch-modify-premium.html', init (options) { this.options = options }, render () { // const loc = Magix.Router.parse() this.updater.digest({ type: '1', // 1:自定义溢价,2:提高或降低百分比溢价 premium: '5', // 溢价值 increaseReducePremium: '5', // 提高或降低的幅度百分比 increaseReduceType: '1' // 1:提高溢价百分比,2:降低溢价 }) }, 'cancel' (e) { this.options.dialog.close() }, 'confirm' (e) { if (!this.isValid()) { return } const { type, premium, increaseReducePremium, increaseReduceType } = this.updater.get() const data = { type } if (type == '1') { // 自定义溢价 data.value = premium } else { // 提高降低现有溢价 if (increaseReduceType == '1') { // 提高 data.value = increaseReducePremium } else { // 降低 data.value = `-${increaseReducePremium}` } } this.options.callback(data) this.options.dialog.close() } })