适用班组数
This commit is contained in:
parent
ecb13c6052
commit
a0c3a937f4
|
|
@ -132,6 +132,16 @@
|
||||||
rows="2"
|
rows="2"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="适用班组数" prop="fitNum">
|
||||||
|
<el-input
|
||||||
|
v-model="maForm.fitNum"
|
||||||
|
placeholder="请输入适用班组数"
|
||||||
|
maxlength="10"
|
||||||
|
type="number"
|
||||||
|
style="width: 240px"
|
||||||
|
@blur="fitNumChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
|
|
@ -270,8 +280,10 @@ export default {
|
||||||
remark: '',
|
remark: '',
|
||||||
purchaseNumber: '',
|
purchaseNumber: '',
|
||||||
standardConfig: undefined,
|
standardConfig: undefined,
|
||||||
bmFileInfos: []
|
bmFileInfos: [],
|
||||||
|
fitNum: 1,
|
||||||
},
|
},
|
||||||
|
lastFitNum: 1,
|
||||||
standardConfigList: [],
|
standardConfigList: [],
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
|
|
@ -340,6 +352,9 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.getBmTeam()
|
this.getBmTeam()
|
||||||
}
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.fitNum = this.maForm.fitNum
|
||||||
|
}, 500);
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
maForm: {
|
maForm: {
|
||||||
|
|
@ -354,8 +369,21 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
fitNumChange() {
|
||||||
|
const newVal = Math.min(5, Math.max(1, parseInt(this.maForm.fitNum) || 1))
|
||||||
|
const ratio = newVal / this.lastFitNum
|
||||||
|
this.equipmentList.forEach((item) => {
|
||||||
|
if (typeof item.preNum === 'number') {
|
||||||
|
item.preNum = Math.max(1, Math.floor(item.preNum * ratio)) // 向下取整,且至少为1
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
this.lastFitNum = newVal
|
||||||
|
this.maForm.fitNum = newVal
|
||||||
|
},
|
||||||
// 获取协议id
|
// 获取协议id
|
||||||
getAgreementId() {
|
getAgreementId() {
|
||||||
|
if (!this.maForm.teamId || !this.maForm.projectId) return
|
||||||
getAgreement({
|
getAgreement({
|
||||||
teamId: this.maForm.teamId,
|
teamId: this.maForm.teamId,
|
||||||
projectId: this.maForm.projectId
|
projectId: this.maForm.projectId
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue