适用班组数

This commit is contained in:
bb_pan 2025-07-02 17:56:40 +08:00
parent ecb13c6052
commit a0c3a937f4
1 changed files with 29 additions and 1 deletions

View File

@ -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