成品库添加移库,毛坯仓库添加操作时间
This commit is contained in:
@@ -94,3 +94,16 @@ export function dictWmGoodsNowProduction(query) {
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量修改成品库仓库编码
|
||||
* @param data
|
||||
*/
|
||||
export function BatchUpdateGoodsNowProductionLocationCode(data) {
|
||||
return request({
|
||||
url: '/mes/wm/WmGoodsNowProduction/batchUpdateGoodsNowProductionLocationCode',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
// 毛坯数据详情
|
||||
// 毛坯数据详情-库存记录
|
||||
handleDetail(row) {
|
||||
console.log(row);
|
||||
this.detailData = row;
|
||||
|
||||
@@ -44,6 +44,12 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" :disabled="multiple" v-hasPermi="['wmsManagement:wmgoodsnowproduction:delete']" plain icon="el-icon-delete" size="mini" @click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" :disabled="multiple" v-hasPermi="['wmsManagement:wmgoodsnowproduction:edit']" plain icon="el-icon-edit" size="mini" @click="handleUpdateLocationCode1">移入呆滞品仓库</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" :disabled="multiple" v-hasPermi="['wmsManagement:wmgoodsnowproduction:edit']" plain icon="el-icon-edit" size="mini" @click="handleUpdateLocationCode2">批量移库</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
@@ -117,6 +123,23 @@
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 批量移库 -->
|
||||
<el-dialog title="批量移库" :lock-scroll="false" :visible.sync="open2" :close-on-click-modal="false" width="500px">
|
||||
<el-form :label-width="formLabelWidth">
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="24">
|
||||
<el-form-item label="库位编号" prop="partnumber">
|
||||
<el-input v-model="locationCode" placeholder="请输入库位编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="open2 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleUpdateLocationCode">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -126,7 +149,8 @@
|
||||
delWmGoodsNowProduction,
|
||||
updateWmGoodsNowProduction,
|
||||
getWmGoodsNowProduction,
|
||||
dictWmGoodsNowProduction
|
||||
dictWmGoodsNowProduction,
|
||||
BatchUpdateGoodsNowProductionLocationCode
|
||||
} from '@/api/wmsManagement/wmGoodsNowProduction.js'
|
||||
|
||||
export default {
|
||||
@@ -169,6 +193,7 @@
|
||||
opertype: 0,
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
open2: false,
|
||||
// 表单参数
|
||||
form: {},
|
||||
columns: [
|
||||
@@ -199,6 +224,8 @@
|
||||
packageCodeClient: [{ required: true, message: '批次号不能为空', trigger: 'blur' }],
|
||||
locationCode: [{ required: true, message: '库位编号不能为空', trigger: 'blur' }],
|
||||
},
|
||||
// 批量移库
|
||||
locationCode: '',
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -316,8 +343,6 @@
|
||||
submitForm: function () {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(JSON.stringify(this.form))
|
||||
|
||||
if (this.form.id != undefined && this.opertype === 2) {
|
||||
updateWmGoodsNowProduction(this.form)
|
||||
.then((res) => {
|
||||
@@ -342,6 +367,48 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 移入呆滞品仓库操作 */
|
||||
handleUpdateLocationCode() {
|
||||
const ids = this.ids;
|
||||
const locationCode = this.locationCode;
|
||||
this.$confirm(`是否确认所选${ids.length}箱移入${locationCode}?`)
|
||||
.then((res) => {
|
||||
const data = {
|
||||
ids,
|
||||
locationCode
|
||||
}
|
||||
BatchUpdateGoodsNowProductionLocationCode(data).then(res => {
|
||||
const { code, data } = res;
|
||||
if (code === 200) {
|
||||
this.handleQuery()
|
||||
this.msgSuccess('移库成功!')
|
||||
this.open2 = false;
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
handleUpdateLocationCode1() {
|
||||
const ids = this.ids;
|
||||
this.$confirm(`是否确认所选${ids.length}箱移入呆滞品仓库?`)
|
||||
.then((res) => {
|
||||
const data = {
|
||||
ids,
|
||||
locationCode: 'Z1-01'
|
||||
}
|
||||
BatchUpdateGoodsNowProductionLocationCode(data).then(res => {
|
||||
const { code, data } = res;
|
||||
if (code === 200) {
|
||||
this.handleQuery()
|
||||
this.msgSuccess('移入呆滞品仓库成功')
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
handleUpdateLocationCode2() {
|
||||
this.open2 = true;
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -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