@@ -135,7 +149,7 @@
{{ $t('receiveStockinAdd.submit') }}
- {{ $t('receiveStockinAdd.cancel') }}
+ {{ $t('receiveStockinAdd.cancel') }}
@@ -348,19 +362,8 @@ export default {
calculateTotal() {
this.totalQuantity = this.productList.reduce((sum, item) => sum + (item.quantity || 0), 0);
this.totalAmount = this.productList.reduce((sum, item) => sum + ((item.quantity || 0) * (item.price || 0)), 0);
-
- // 遍历产品列表,计算每个产品的重量
- this.productList.forEach(item => {
- // 计算总净重(单件净重×数量)
- item.totalNetWeight = (item.quantity || 0) * (item.spare2 || 0);
- // 净重等于总净重
- item.netWeight = item.totalNetWeight;
- // 毛重等于总净重
- item.grossWeight = item.totalNetWeight;
- });
-
// 计算表单总计
- this.totalNetWeight = this.productList.reduce((sum, item) => sum + (item.totalNetWeight || 0), 0);
+ this.totalNetWeight = this.productList.reduce((sum, item) => sum + ((item.quantity || 0) * (item.spare2 || 0)), 0);
this.netWeight = this.totalNetWeight;
this.grossWeight = this.totalNetWeight;
@@ -370,6 +373,24 @@ export default {
this.form.netWeight = this.netWeight;
this.form.grossWeight = this.grossWeight;
},
+ cancelPri(){
+ // 重置表单数据
+ this.form = {
+ warehouseId: undefined,
+ supplierId: undefined,
+ remark: undefined,
+ totalQuantity: 0,
+ totalAmount: 0,
+ };
+ // 清空物料列表
+ this.productList = [];
+ // 重置计数器
+ this.totalQuantity = 0;
+ this.totalAmount = 0;
+ // 重置表单校验结果
+ this.$refs["form"].resetFields();
+
+ },
/** 表单提交 */
submitForm() {
this.$refs["form"].validate(valid => {
@@ -415,20 +436,7 @@ export default {
addStockin(data).then(() => {
this.$modal.msgSuccess(this.$t('receiveStockinAdd.addSuccess'));
// 重置表单数据
- this.form = {
- warehouseId: undefined,
- supplierId: undefined,
- remark: undefined,
- totalQuantity: 0,
- totalAmount: 0,
- };
- // 清空物料列表
- this.productList = [];
- // 重置计数器
- this.totalQuantity = 0;
- this.totalAmount = 0;
- // 重置表单校验结果
- this.$refs["form"].resetFields();
+ cancelPri()
});
}
});
@@ -436,6 +444,7 @@ export default {
cancel() {
this.productSelectVisible = false;
},
+
/** 导入按钮操作 */
handleImport() {
this.upload.title = this.$t('receiveStockinAdd.uploadTitle')
@@ -454,7 +463,7 @@ export default {
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
- this.$alert("" + response.msg + "
", "导入结果", {dangerouslyUseHTMLString: true});
+ //this.$alert("" + response.msg + "
", "导入结果", {dangerouslyUseHTMLString: true});
if (response.code === 200) {
this.$modal.msgSuccess("导入成功");
this.productList.push(...response.data)
diff --git a/ruoyi-ui/src/views/in/receive/index.vue b/ruoyi-ui/src/views/in/receive/index.vue
index dea2b23..038c70c 100644
--- a/ruoyi-ui/src/views/in/receive/index.vue
+++ b/ruoyi-ui/src/views/in/receive/index.vue
@@ -108,18 +108,34 @@
@keyup.enter.native="handleQuery"
/>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/ruoyi-ui/src/views/in/stockIn/index.vue b/ruoyi-ui/src/views/in/stockIn/index.vue
index fe88fee..dee0f16 100644
--- a/ruoyi-ui/src/views/in/stockIn/index.vue
+++ b/ruoyi-ui/src/views/in/stockIn/index.vue
@@ -9,6 +9,22 @@
@keyup.enter.native="handleQuery"
/>
+
+
+
+
+
+