成品库添加移库,毛坯仓库添加操作时间
This commit is contained in:
@@ -22,10 +22,13 @@
|
||||
<span style="font-weight: 700;">{{scope.row.type === 1? scope.row.changeQuantity : scope.row.changeQuantity * -1}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actionTime" label="入库/出库时间" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="type" label="类别" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag effect="plain" v-if="scope.row.type === 1" type="success">增加</el-tag>
|
||||
<el-tag effect="plain" v-if="scope.row.type === 2" type="danger">减少</el-tag>
|
||||
<el-tag effect="plain" v-if="scope.row.type === 1" type="success">入库</el-tag>
|
||||
<el-tag effect="plain" v-if="scope.row.type === 2" type="danger">出库</el-tag>
|
||||
<el-tag effect="plain" v-if="scope.row.type === 3" type="danger">PDA上料出库</el-tag>
|
||||
<el-tag effect="plain" v-if="scope.row.type === 4" type="warnging">盘点</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注原因" align="center" :show-overflow-tooltip="true" />
|
||||
|
||||
@@ -24,23 +24,26 @@
|
||||
<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-button type="danger" v-hasPermi="['business:wmblankrecord:add']" icon="el-icon-minus" size="mini" @click="handleAdd(2)">减少库存</el-button>
|
||||
<el-button type="danger" v-hasPermi="['business:wmblankrecord:add']" icon="el-icon-minus" size="mini" @click="handleAdd(2)">出库库存</el-button>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<!-- 数据区域 -->
|
||||
<el-table :data="dataList" v-loading="loading" ref="table" border highlight-current-row>
|
||||
<el-table-column prop="blankNum" label="毛坯号" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="description" label="产品描述" align="center" width="280" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="description" label="产品描述" align="center" width="200" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="specification" label="规格" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="changeQuantity" label="变动数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span style="font-weight: 700;">{{scope.row.type === 1? scope.row.changeQuantity : scope.row.changeQuantity * -1}}</span>
|
||||
<span style="font-weight: 700;">{{scope.row.type === 1? `+ ${scope.row.changeQuantity}` : `- ${scope.row.changeQuantity}`}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actionTime" label="入库/出库时间" align="center" min-width="160" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="type" label="类别" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag effect="plain" v-if="scope.row.type === 1" type="success">增加</el-tag>
|
||||
<el-tag effect="plain" v-if="scope.row.type === 2" type="danger">减少</el-tag>
|
||||
<el-tag effect="plain" v-if="scope.row.type === 1" type="success">入库</el-tag>
|
||||
<el-tag effect="plain" v-if="scope.row.type === 2" type="danger">出库</el-tag>
|
||||
<el-tag effect="plain" v-if="scope.row.type === 3" type="danger">PDA上料出库</el-tag>
|
||||
<el-tag effect="plain" v-if="scope.row.type === 4" type="warnging">盘点</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注原因" align="center" :show-overflow-tooltip="true" />
|
||||
@@ -59,7 +62,7 @@
|
||||
<el-button type="primary" @click="handelConfirm">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :title="addDialogTitle" :lock-scroll="false" :visible.sync="addDialogOpen">
|
||||
<el-dialog :title="addDialogTitle" :lock-scroll="false" @opened="updateQuantity" :visible.sync="addDialogOpen">
|
||||
<el-form ref="form" :model="formAdd" :rules="addDialogRules" :label-width="formLabelWidth">
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="12">
|
||||
@@ -77,15 +80,17 @@
|
||||
<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-tag v-if="formAdd.actionType === 4" type="warning">盘点</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<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-option label="入库" :value="1"></el-option>
|
||||
<el-option label="出库" :value="2"></el-option>
|
||||
<el-option label="盘点" :value="4" disabled></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -94,12 +99,22 @@
|
||||
<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-col :lg="12" v-if="formAdd.actionType === 4">
|
||||
<el-form-item label="盘点结果" prop="changeQuantity">
|
||||
<el-input v-model.number="formAdd.changeQuantity" placeholder="请输入变动数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12" v-if="formAdd.actionType != 4">
|
||||
<el-form-item :label="formAdd.actionType === 1?'入库数':'出库数'" prop="changeQuantity">
|
||||
<el-input v-model.number="formAdd.changeQuantity" placeholder="请输入变动数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="实际时间" prop="actionTime">
|
||||
<el-date-picker v-model="formAdd.actionTime" type="datetime" :clearable="false" placeholder="选择日期时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input :autosize="{ minRows: 2, maxRows: 6}" type="textarea" maxlength="240" v-model="formAdd.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
@@ -155,6 +170,7 @@
|
||||
type: 0,
|
||||
actionType: 1,
|
||||
changeQuantity: 0,
|
||||
actionTime: null,
|
||||
remark: ""
|
||||
},
|
||||
addDialogRules: {
|
||||
@@ -173,8 +189,9 @@
|
||||
},
|
||||
rules: {},
|
||||
typeOptions: [
|
||||
{ dictLabel: '增加', dictValue: 1 },
|
||||
{ dictLabel: '减少', dictValue: 2 },
|
||||
{ dictLabel: '入库', dictValue: 1 },
|
||||
{ dictLabel: '出库', dictValue: 2 },
|
||||
{ dictLabel: '盘点', dictValue: 4 },
|
||||
],
|
||||
}
|
||||
},
|
||||
@@ -193,14 +210,9 @@
|
||||
this.formAdd.blankNum = this.ItemData.blankNum ?? "";
|
||||
this.formAdd.type = this.ItemData.type;
|
||||
this.formAdd.changeQuantity = 0;
|
||||
this.formAdd.actionTime = new Date();
|
||||
this.formAdd.remark = "";
|
||||
// 库存值更新
|
||||
getWmBlankInventory(this.ItemData.id).then((res) => {
|
||||
const { code, data } = res;
|
||||
if (code == 200) {
|
||||
this.formAdd.quantity = data.quantity;
|
||||
}
|
||||
});
|
||||
// this.updateQuantity();
|
||||
},
|
||||
// 查询数据
|
||||
getList() {
|
||||
@@ -219,9 +231,22 @@
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
updateQuantity(){
|
||||
// 库存值更新
|
||||
getWmBlankInventory(this.ItemData.id).then((res) => {
|
||||
const { code, data } = res;
|
||||
if (code === 200) {
|
||||
this.$nextTick(() => {
|
||||
this.formAdd.quantity = data.quantity;
|
||||
console.log(this.formAdd.quantity);
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
onOpen() {
|
||||
this.dataList = [];
|
||||
this.getList();
|
||||
this.updateQuantity();
|
||||
},
|
||||
onClose() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
@@ -238,10 +263,11 @@
|
||||
},
|
||||
handleAdd(type = 0) {
|
||||
// if (type === 1) {
|
||||
// this.addDialogTitle = "增加库存";
|
||||
// this.addDialogTitle = "入库库存";
|
||||
// } else {
|
||||
// this.addDialogTitle = "减少库存";
|
||||
// this.addDialogTitle = "出库库存";
|
||||
// }
|
||||
|
||||
this.addDialogTitle = "修改库存";
|
||||
this.formAdd.actionType = type;
|
||||
this.initData();
|
||||
@@ -260,7 +286,7 @@
|
||||
submitForm() {
|
||||
const data = this.formAdd;
|
||||
if (this.formAdd.actionType === 1) {
|
||||
// 增加
|
||||
// 入库
|
||||
addInventoryNum(data).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success("手动添加记录成功!");
|
||||
@@ -271,7 +297,7 @@
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// 减少
|
||||
// 出库
|
||||
reduceInventoryNum(data).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.data != 1) {
|
||||
|
||||
Reference in New Issue
Block a user