|
|
|
@ -26,11 +26,11 @@ |
|
|
|
<el-dialog title="街道目标数设定" :visible.sync="dialogFormVisible" width="30%" center> |
|
|
|
<el-form :model="dataForm"> |
|
|
|
<el-form-item label="目标比例" label-width="120px"> |
|
|
|
<el-input v-model="goalProportion" style="width: 300px;"></el-input> |
|
|
|
<span>%</span> |
|
|
|
<el-input-number v-model="goalProportion" :min="0" v-on:change="watchGoalProportion(goalProportion)"></el-input-number> |
|
|
|
<span style="margin-left: 10px;">%</span> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="目标人数" label-width="120px"> |
|
|
|
<el-input v-model="goalNumber" style="width: 300px;"></el-input> |
|
|
|
<el-input-number v-model="goalNumber" :min="0" v-on:change="watchGoalNumbern(goalNumber)"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
@ -75,17 +75,23 @@ export default { |
|
|
|
this.getStreetName() |
|
|
|
this.getStreetGoalScore() |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
// 根据目标比例 计算 目标数 |
|
|
|
goalProportion: function (val) { |
|
|
|
if (val.length === 0) { |
|
|
|
this.goalProportion = '' |
|
|
|
methods: { |
|
|
|
// 数据监听1 |
|
|
|
watchGoalProportion (goalProportion) { |
|
|
|
if (this.goalProportion === 0) { |
|
|
|
this.goalNumber = 0 |
|
|
|
} else { |
|
|
|
this.goalNumber = Math.round(this.personBasicNumber * (this.goalProportion / 100)) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 数据监听2 |
|
|
|
watchGoalNumbern (goalNumber) { |
|
|
|
if (this.goalNumber === 0) { |
|
|
|
this.goalProportion = 0 |
|
|
|
} else { |
|
|
|
this.goalProportion = Math.round(this.goalNumber / this.personBasicNumber * 100) |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 获取街道目标表的街道名称 |
|
|
|
getStreetName () { |
|
|
|
this.$http |
|
|
|
@ -121,6 +127,9 @@ export default { |
|
|
|
if (column.property === undefined || column.property === '') { |
|
|
|
return false |
|
|
|
} |
|
|
|
if (row.isDisabled === '0') { |
|
|
|
return false |
|
|
|
} |
|
|
|
this.dialogFormVisible = true |
|
|
|
this.dataForm.streetId = columnId // 这里的街道ID格式为:1202869594882400257-PartyGoalNum |
|
|
|
// this.personBasicNumber = row[columnId] // 获取单元格的值 |
|
|
|
|