|  |  |  | 
|---|
|  |  |  | <div class="tl_list_item"> | 
|---|
|  |  |  | <div class="tl_list_item_label">投料数量{{ item.unitAttribute }}</div> | 
|---|
|  |  |  | <div class="tl_list_item_go"> | 
|---|
|  |  |  | <input type="text"  @blur="changeNumber(item.num, index, item.unitAttribute)" | 
|---|
|  |  |  | <input type="text" @blur="changeNumber(item.num, index, item.unitAttribute)" | 
|---|
|  |  |  | v-model="item.num" /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | unitAttribute: '' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeNumber(num, index, unitAttribute) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | changeNumber(num, index, unitAttribute) { | 
|---|
|  |  |  | if (unitAttribute === 0 && num !== '') { | 
|---|
|  |  |  | if (!positiveInteger.test(num)) { | 
|---|
|  |  |  | uni.$u.toast('只能输入正整数') | 
|---|
|  |  |  | uni.$u.toast({ | 
|---|
|  |  |  | message: '只能输入正整数' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.materialList[index].num = '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if (unitAttribute === 1 && num !== '') { | 
|---|
|  |  |  | if (!number.test(num)) { | 
|---|
|  |  |  | uni.$u.toast('只能输入正整数或小数(最多四位)') | 
|---|
|  |  |  | uni.$u.toast({ | 
|---|
|  |  |  | message: '只能输入正整数或小数(最多四位)' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.materialList[index].num = '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (num <= 0) { | 
|---|
|  |  |  | uni.$u.toast('投料数量不能小于等于0') | 
|---|
|  |  |  | uni.$u.toast({ | 
|---|
|  |  |  | message: '投料数量不能小于等于0' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.materialList[index].num = '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getValue(item) { | 
|---|
|  |  |  | for (let i = 0; i < this.materialList.length; i++) { | 
|---|
|  |  |  | if (item.id === this.materialList[i].id) { | 
|---|
|  |  |  | uni.$u.toast('不能重复选择相同物料') | 
|---|
|  |  |  | uni.$u.toast({ | 
|---|
|  |  |  | message: '不能重复选择相同物料' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|