功能优化
This commit is contained in:
@@ -21,11 +21,11 @@
|
||||
<!-- 工具区域 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" v-hasPermi="['business:wmblankrecord:add']" icon="el-icon-plus" size="mini" @click="handleAdd(1)">增加库存</el-button>
|
||||
<el-button type="success" v-hasPermi="['business:wmblankrecord:add']" icon="el-icon-edit" size="mini" @click="handleAdd(1)">库存变动</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="danger" v-hasPermi="['business:wmblankrecord:add']" icon="el-icon-minus" size="mini" @click="handleAdd(2)">减少库存</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<!-- 数据区域 -->
|
||||
<el-table :data="dataList" v-loading="loading" ref="table" border highlight-current-row>
|
||||
@@ -74,15 +74,28 @@
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="变动类别" prop="type">
|
||||
<el-tag v-if="formAdd.type === 1" type="primary">毛坯</el-tag>
|
||||
<el-tag v-if="formAdd.type === 2" type="warning">返工件</el-tag>
|
||||
<el-tag v-if="formAdd.type === 1" type="primary">毛坯</el-tag>
|
||||
<el-tag v-if="formAdd.type === 2" type="warning">返工件</el-tag>
|
||||
<span style="margin-right: 10px;"></span>
|
||||
<el-tag v-if="formAdd.actionType === 1" type="success">增加库存</el-tag>
|
||||
<el-tag v-if="formAdd.actionType === 2" type="danger">减少库存</el-tag>
|
||||
<el-tag v-if="formAdd.actionType === 1" type="success">增加库存</el-tag>
|
||||
<el-tag v-if="formAdd.actionType === 2" type="danger">减少库存</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="变动数量" prop="changeQuantity">
|
||||
<el-form-item label="库存操作" prop="quantity">
|
||||
<el-select v-model="formAdd.actionType">
|
||||
<el-option label="增加" :value="1"></el-option>
|
||||
<el-option label="减少" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="库存数量" prop="quantity">
|
||||
<el-input :readonly="true" v-model.number="formAdd.quantity" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label="formAdd.actionType === 1?'增加数':'减少数'" prop="changeQuantity">
|
||||
<el-input v-model.number="formAdd.changeQuantity" placeholder="请输入变动数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -110,6 +123,9 @@
|
||||
addInventoryNum,
|
||||
reduceInventoryNum
|
||||
} from '@/api/wmsManagement/wmBlankRecord.js';
|
||||
import {
|
||||
getWmBlankInventory,
|
||||
} from '@/api/wmsManagement/wmBlankInventory.js';
|
||||
export default {
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
@@ -169,6 +185,23 @@
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
initData() {
|
||||
this.formAdd.fkBlankInventoryId = this.ItemData.id;
|
||||
this.formAdd.description = this.ItemData.description ?? "";
|
||||
this.formAdd.specification = this.ItemData.specification ?? "";
|
||||
this.formAdd.blankNum = this.ItemData.blankNum ?? "";
|
||||
this.formAdd.type = this.ItemData.type;
|
||||
this.formAdd.changeQuantity = 0;
|
||||
this.formAdd.remark = "";
|
||||
// 库存值更新
|
||||
getWmBlankInventory(this.ItemData.id).then((res) => {
|
||||
const { code, data } = res;
|
||||
if (code == 200) {
|
||||
this.formAdd.quantity = data.quantity;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 查询数据
|
||||
getList() {
|
||||
this.loading = true;
|
||||
@@ -204,21 +237,17 @@
|
||||
this.getList();
|
||||
},
|
||||
handleAdd(type = 0) {
|
||||
if (type === 1) {
|
||||
this.addDialogTitle = "增加库存";
|
||||
} else {
|
||||
this.addDialogTitle = "减少库存";
|
||||
}
|
||||
this.formAdd.fkBlankInventoryId = this.ItemData.id;
|
||||
this.formAdd.blankNum = this.ItemData.blankNum;
|
||||
this.formAdd.description = this.ItemData.description;
|
||||
this.formAdd.specification = this.ItemData.specification;
|
||||
this.formAdd.type = this.ItemData.type;
|
||||
// if (type === 1) {
|
||||
// this.addDialogTitle = "增加库存";
|
||||
// } else {
|
||||
// this.addDialogTitle = "减少库存";
|
||||
// }
|
||||
this.addDialogTitle = "修改库存";
|
||||
this.formAdd.actionType = type;
|
||||
this.formAdd.changeQuantity = 0;
|
||||
this.formAdd.remark = "";
|
||||
this.initData();
|
||||
this.addDialogOpen = true;
|
||||
},
|
||||
|
||||
handelConfirm() {
|
||||
this.$refs['elForm'].validate(valid => {
|
||||
if (!valid) return
|
||||
@@ -237,6 +266,7 @@
|
||||
this.$message.success("手动添加记录成功!");
|
||||
this.getList();
|
||||
this.emitRefresh();
|
||||
this.initData();
|
||||
this.addDialogOpen = false;
|
||||
}
|
||||
})
|
||||
@@ -251,6 +281,7 @@
|
||||
this.$message.success("手动添加记录成功!");
|
||||
this.getList();
|
||||
this.emitRefresh();
|
||||
this.initData();
|
||||
this.addDialogOpen = false;
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user