|
@@ -111,6 +111,7 @@
|
|
|
size="mini"
|
|
|
style="width: 100%"
|
|
|
placeholder="请输入税率"
|
|
|
+ :disabled="true"
|
|
|
@input="validateFloatInput($event, scope.row, 'taxRate', 0, 100)"
|
|
|
@blur="validateAndFormatFloatOnBlur(scope.row, 'taxRate', 0, 100); handleTaxRateChange(scope.row, scope.$index)"
|
|
|
/>
|
|
@@ -125,6 +126,7 @@
|
|
|
size="mini"
|
|
|
style="width: 100%"
|
|
|
placeholder="请输入税额"
|
|
|
+ :disabled="true"
|
|
|
@input="validateFloatInput($event, scope.row, 'taxAmount')"
|
|
|
@blur="validateAndFormatFloatOnBlur(scope.row, 'taxAmount'); handleTaxAmountChange(scope.row, scope.$index)"
|
|
|
/>
|
|
@@ -139,6 +141,7 @@
|
|
|
size="mini"
|
|
|
style="width: 100%"
|
|
|
placeholder="请输入总金额"
|
|
|
+ :disabled="true"
|
|
|
@input="validateFloatInput($event, scope.row, 'totalAmount')"
|
|
|
@blur="validateAndFormatFloatOnBlur(scope.row, 'totalAmount'); handleTotalAmountChange(scope.row, scope.$index)"
|
|
|
/>
|
|
@@ -601,27 +604,31 @@ export default {
|
|
|
this.$message.warning('请先选择要导入的物料')
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 查找选中的物料数据
|
|
|
const selectedMaterial = this.materialOptions.find(item => item.id === this.selectedMaterialId)
|
|
|
if (!selectedMaterial) {
|
|
|
this.$message.warning('未找到选中的物料数据')
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 检查是否已存在相同物料
|
|
|
const existingMaterial = this.materialDetails.find(item => item.itemCode === selectedMaterial.itemCode)
|
|
|
if (existingMaterial) {
|
|
|
this.$message.warning(`物料 ${selectedMaterial.itemName} 已存在,请勿重复导入`)
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 构造物料明细数据
|
|
|
- const materialDetail = this.prepareMaterialDetailData(selectedMaterial)
|
|
|
-
|
|
|
+ let materialDetail = this.prepareMaterialDetailData(selectedMaterial)
|
|
|
+
|
|
|
+ // 导入时自动计算金额
|
|
|
+ materialDetail = this.calculateAmounts(materialDetail)
|
|
|
+
|
|
|
// 触发导入事件
|
|
|
this.$emit(MATERIAL_DETAIL_EVENTS.MATERIAL_IMPORT, [materialDetail])
|
|
|
-
|
|
|
+ this.$emit(MATERIAL_DETAIL_EVENTS.REFRESH)
|
|
|
+
|
|
|
// 清空选择
|
|
|
this.selectedMaterialId = null
|
|
|
this.materialOptions = []
|
|
@@ -635,7 +642,6 @@ export default {
|
|
|
* @private
|
|
|
*/
|
|
|
prepareMaterialDetailData(material) {
|
|
|
- console.log('material', material)
|
|
|
return {
|
|
|
id: this.generateUniqueId(),
|
|
|
itemId: material.itemId,
|
|
@@ -1164,3 +1170,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
+
|