|  |  |  | 
|---|
|  |  |  | if (!from.qualified && !from.undesirable) { | 
|---|
|  |  |  | return Toast('良品数与不良数不能同时为空') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (from.qualified && from.qualified <= 0) { | 
|---|
|  |  |  | return Toast('良品数必须大于0') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (from.undesirable && from.undesirable <= 0) { | 
|---|
|  |  |  | return Toast('不良品数必须大于0') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // if (!from.qualified) return Toast('良品数不能为空') | 
|---|
|  |  |  | // 有不良数 | 
|---|
|  |  |  | if (from.undesirable > 0) { | 
|---|
|  |  |  | 
|---|
|  |  |  | getDeviceByCondition({ procedureId: res.procedureId }) | 
|---|
|  |  |  | .then(res1 => { | 
|---|
|  |  |  | if (res1.code === 200) { | 
|---|
|  |  |  | if (res1.data && res1.data.length > 0) | 
|---|
|  |  |  | deviceId.value = res1.data[0].id | 
|---|
|  |  |  | from.deviceId = res1.data[0].id | 
|---|
|  |  |  | from.deviceName = res1.data[0].name | 
|---|