|
|
|
@ -50,7 +50,7 @@ |
|
|
|
|
return { |
|
|
|
|
ProductID: null, |
|
|
|
|
|
|
|
|
|
CurrenLossType:0, |
|
|
|
|
CurrenLossType: 0, |
|
|
|
|
LossTypeList: [], //报损类型列表 |
|
|
|
|
LossTypePickerList: [], //报损类型选择列表 |
|
|
|
|
|
|
|
|
@ -106,7 +106,9 @@ |
|
|
|
|
async submitForm() { |
|
|
|
|
// 校验主表 |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
this.formData.lossType = this.LossTypeList[this.CurrenLossType].value |
|
|
|
|
console.log(this.formData) |
|
|
|
|
await this.$refs['formRef'].validate() |
|
|
|
|
const data = this.formData |
|
|
|
|
await LossApi.createLoss(data) |
|
|
|
@ -115,11 +117,11 @@ |
|
|
|
|
icon: 'success', |
|
|
|
|
duration: 2000, |
|
|
|
|
complete: function() { |
|
|
|
|
uni.setStorageSync( 'canRefresh', 'true'); |
|
|
|
|
setTimeout(function() { |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 |
|
|
|
|
}) |
|
|
|
|
uni.setStorageSync('canRefresh', 'true'); |
|
|
|
|
setTimeout(function() { |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 |
|
|
|
|
}) |
|
|
|
|
}, 2000); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -147,8 +149,12 @@ |
|
|
|
|
handlerInput(event, index) { |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
const num = parseFloat(event.target.value).toFixed(2) |
|
|
|
|
if (isNaN(num)) { |
|
|
|
|
this.formData.productLoss = undefined |
|
|
|
|
} else { |
|
|
|
|
this.formData.productLoss = num |
|
|
|
|
} |
|
|
|
|
this.$forceUpdate() |
|
|
|
|
this.formData.productLoss = num |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|