parent
e66705b1a4
commit
21732d35a9
@ -0,0 +1,380 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="派工单号">
|
||||
<el-input v-model="form.planCode" disabled style="width:360px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细编号">
|
||||
<el-input v-model="form.planDetailCode" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库">
|
||||
<el-select v-model="form.warehouseId" placeholder="请选择仓库" style="width:360px">
|
||||
<el-option v-for="item in warehouseList" :key="item.warehouseId" :label="item.warehouseName"
|
||||
:value="item.warehouseId"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="退库类型" prop="taskType">
|
||||
<el-select v-model="form.taskType" placeholder="请选择退库类型">
|
||||
<el-option :label="i.label" :key="i.value" :value="i.value"
|
||||
v-for="i in dict.type.wms_raw_return_task_type"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="退库原因">
|
||||
<el-input v-model="form.applyReason" type="textarea"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
<el-divider content-position="center">物料信息</el-divider>
|
||||
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="130px">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleSelectMaterial">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:cell-style="{textAlign:'center'}"
|
||||
:data="wmsRawReturnList"
|
||||
:header-cell-style="{textAlign:'center'}"
|
||||
max-height="19.13vw"
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-table-column
|
||||
label="物料编号"
|
||||
prop="materialCode"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="物料名称"
|
||||
prop="materialName"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="物料规格"
|
||||
prop="materialSpec"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="退库数量"
|
||||
prop="planAmount"
|
||||
width="120"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.planAmount"
|
||||
controls-position="right"
|
||||
:max="maxPlanAmount"
|
||||
style="width: 100%"
|
||||
>
|
||||
</el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDeleteMaterial(scope.row)"
|
||||
>删除
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<!-- 选择信息对话框 -->
|
||||
<el-dialog title="选择物料信息" :visible.sync="materialOpen" append-to-body>
|
||||
<select-material ref="materialRef" v-if="materialOpen"></select-material>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitMaterialForm">确 定</el-button>
|
||||
<el-button @click="materialOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<div style="text-align: center;margin-top: 30px">
|
||||
<el-button type="primary" :loading="submitLoading" @click="submitForm">申请</el-button>
|
||||
<el-button type="info" @click="closeParentDialog">关闭</el-button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getWarehouses, getMaterialInfoByMaterialId, applyRawReturn, assignTask} from "@/api/board";
|
||||
import selectMaterial from '@//views/board/common/selectMaterial.vue';
|
||||
|
||||
export default {
|
||||
name: "Materialinfo",
|
||||
props: {
|
||||
defineData: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'select-material': selectMaterial,
|
||||
},
|
||||
|
||||
dicts: ['mes_safe_flag', 'mes_material_accessories_flag','wms_raw_return_task_type'],
|
||||
inject: ['closeRawReturnDialog'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
//保存遮罩层
|
||||
submitLoading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 物料信息表格数据
|
||||
warehouseList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
maxPlanAmount: 100000000,
|
||||
returnFlag: '',
|
||||
taskType: '',
|
||||
|
||||
// 是否显示物料弹出层
|
||||
materialOpen: false,
|
||||
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
erpId: null,
|
||||
materialCode: null,
|
||||
oldMaterialCode: null,
|
||||
materialName: null,
|
||||
materialCategories: null,
|
||||
materialSubclass: null,
|
||||
materialTypeId: null,
|
||||
batchFlag: null,
|
||||
materialUnitId: null,
|
||||
materialUnit: null,
|
||||
materialMatkl: null,
|
||||
materialSpec: null,
|
||||
netWeight: null,
|
||||
grossWeight: null,
|
||||
factoryId: null,
|
||||
createOrgId: null,
|
||||
useOrgId: null,
|
||||
prodlineId: null,
|
||||
activeFlag: null,
|
||||
deletedFlag: null,
|
||||
approveDate: null,
|
||||
erpModifyDate: null,
|
||||
accessoriesFlag: '0'
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
RETURN_FLAG: {//返库标识
|
||||
YES: '1',//是
|
||||
},
|
||||
rules: {
|
||||
taskType: [
|
||||
{required: true, message: "退库类型不能为空", trigger: "blur"}
|
||||
],
|
||||
},
|
||||
wmsRawReturnList: [],
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getData();
|
||||
this.getMaterialInfoByMaterialId();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
if (this.defineData.planCode) {
|
||||
this.form = {
|
||||
warehouseId: '',
|
||||
planId: this.defineData?.planId,
|
||||
planCode: this.defineData?.planCode,
|
||||
dispatchCode: this.defineData?.dispatchCode,
|
||||
planDetailCode: this.defineData?.planDetailCode,
|
||||
saleOrderId: this.defineData?.saleOrderId,
|
||||
productId: this.defineData?.productId,
|
||||
materialBomId: this.defineData?.materialBomId,
|
||||
applyReason: '',
|
||||
taskType: this.defineData?.taskType,
|
||||
stationId: this.defineData?.stationId,
|
||||
endStationCode: this.defineData?.stationCode,
|
||||
returnFlag: this.defineData?.returnFlag,
|
||||
mesAreaType: this.defineData?.mesAreaType,
|
||||
warehouseFloor: this.defineData?.warehouseFloor,
|
||||
wmsRawReturnList: []
|
||||
}
|
||||
|
||||
}
|
||||
if (this.defineData.maxPlanAmount) {
|
||||
this.maxPlanAmount = this.defineData.maxPlanAmount
|
||||
}
|
||||
if (this.defineData.returnFlag) {
|
||||
this.returnFlag = this.defineData.returnFlag;
|
||||
}
|
||||
},
|
||||
|
||||
getMaterialInfoByMaterialId() {
|
||||
getMaterialInfoByMaterialId(this.defineData.productId).then(e => {
|
||||
this.queryParams.materialClassfication = e.data.materialClassfication;
|
||||
this.getWarehouses();
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
getWarehouses() {
|
||||
// 获取仓库信息
|
||||
getWarehouses({
|
||||
warehouseFloor: this.defineData.warehouseFloor,
|
||||
returnFlag: this.defineData.returnFlag,
|
||||
mesAreaType: this.defineData.mesAreaType,
|
||||
}).then(e => {
|
||||
this.warehouseList = e.data
|
||||
this.form.warehouseId = e.data[0]?.warehouseId
|
||||
// this.searchMaterial();
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
handleSelectMaterial() {
|
||||
this.materialOpen = true;
|
||||
},
|
||||
|
||||
|
||||
/** 提交物料信息按钮 */
|
||||
submitMaterialForm() {
|
||||
let selectedRow = this.$refs.materialRef.selectedRow;
|
||||
let rawReturnObj = {
|
||||
"warehouseId":this.form.warehouseId,
|
||||
"planCode":this.form.planCode,
|
||||
"planDetailCode":this.form.planDetailCode,
|
||||
"productId":this.form.productId,
|
||||
"endStationCode":this.form.endStationCode,
|
||||
"applyReason":"",
|
||||
"taskType":"",
|
||||
"materialId":selectedRow.materialId,
|
||||
"materialCode":selectedRow.materialCode,
|
||||
"materialName":selectedRow.materialName,
|
||||
"materialSpec":selectedRow.materialSpec,
|
||||
"planAmount":null
|
||||
};
|
||||
this.wmsRawReturnList.push(rawReturnObj);
|
||||
this.materialOpen = false;
|
||||
},
|
||||
|
||||
handleDeleteMaterial(row){
|
||||
|
||||
},
|
||||
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
materialId: null,
|
||||
erpId: null,
|
||||
materialCode: null,
|
||||
oldMaterialCode: null,
|
||||
materialName: null,
|
||||
materialCategories: null,
|
||||
materialSubclass: null,
|
||||
materialTypeId: null,
|
||||
batchFlag: null,
|
||||
materialUnitId: null,
|
||||
materialUnit: null,
|
||||
materialMatkl: null,
|
||||
materialSpec: null,
|
||||
netWeight: null,
|
||||
grossWeight: null,
|
||||
factoryId: null,
|
||||
createOrgId: null,
|
||||
useOrgId: null,
|
||||
prodlineId: null,
|
||||
activeFlag: null,
|
||||
deletedFlag: null,
|
||||
remark: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
approveDate: null,
|
||||
erpModifyDate: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.wmsRawReturnList.length <= 0) {
|
||||
this.$modal.msgWarning("请选择要退库的物料");
|
||||
return;
|
||||
}
|
||||
|
||||
for (const wmsRawReturn of this.wmsRawReturnList) {
|
||||
if(wmsRawReturn.planAmount <=0){
|
||||
this.$modal.msgWarning("退库数量需大于0");
|
||||
return;
|
||||
}
|
||||
wmsRawReturn.applyReason = this.form.applyReason;
|
||||
wmsRawReturn.taskType = this.form.taskType;
|
||||
}
|
||||
|
||||
this.submitloading = true;
|
||||
applyRawReturn(this.wmsRawReturnList).then(e => {
|
||||
this.$modal.msgSuccess("申请成功");
|
||||
}).finally(e => {
|
||||
this.submitloading = false;
|
||||
this.closeParentDialog();
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
closeParentDialog() {
|
||||
this.closeRawReturnDialog()
|
||||
},
|
||||
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
|
||||
|
||||
.el-table {
|
||||
background-color: #fff0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
|
||||
.roundBorder {
|
||||
position: absolute;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
|
||||
</style>
|
@ -0,0 +1,188 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="物料编码" prop="materialCode">
|
||||
<el-input
|
||||
v-model="queryParams.materialCode"
|
||||
placeholder="请输入物料编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
auto-complete="on"
|
||||
id="historyMaterialCode"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料名称" prop="materialName">
|
||||
<el-input
|
||||
v-model="queryParams.materialName"
|
||||
placeholder="请输入物料名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
auto-complete="on"
|
||||
id="historyMaterialName"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料规格" prop="materialSpec">
|
||||
<el-input
|
||||
v-model="queryParams.materialSpec"
|
||||
placeholder="请输入物料规格"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
auto-complete="on"
|
||||
id="historyMaterialSpec"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次标识" prop="batchFlag">
|
||||
<el-select v-model="queryParams.batchFlag" placeholder="请选择批次标识" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.active_flag"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
|
||||
<el-table v-loading="loading" :data="materialinfoList" @selection-change="handleSelectionChange"
|
||||
@row-click="handleRowClick"
|
||||
highlight-current-row>
|
||||
<el-table-column type="selection" width="55" align="center" v-if="false" />
|
||||
<el-table-column label="物料ID" align="center" prop="materialId" v-if="false"/>
|
||||
<el-table-column label="物料编码" align="center" prop="materialCode"/>
|
||||
<el-table-column label="物料名称" align="center" prop="materialName"/>
|
||||
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
|
||||
<el-table-column label="常备物料" align="center" prop="bindFlag">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_material_bind_flag" :value="scope.row.bindFlag"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次标识" align="center" prop="batchFlag">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.active_flag" :value="scope.row.batchFlag"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次数量" align="center" prop="batchAmount"/>
|
||||
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getMaterialInfoList} from "@/api/board";
|
||||
|
||||
export default {
|
||||
name: "Materialinfo",
|
||||
dicts: ['active_flag', 'material_categories','mes_material_bind_flag'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 物料类型信息树选项
|
||||
baseMaterialTypeOptions: [],
|
||||
// 物料信息表格数据
|
||||
materialinfoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
erpId: null,
|
||||
materialCode: null,
|
||||
oldMaterialCode: null,
|
||||
materialName: null,
|
||||
materialCategories: null,
|
||||
materialSubclass: null,
|
||||
materialTypeId: null,
|
||||
batchFlag: null,
|
||||
materialUnitId: null,
|
||||
materialUnit: null,
|
||||
materialMatkl: null,
|
||||
materialSpec: null,
|
||||
netWeight: null,
|
||||
grossWeight: null,
|
||||
factoryId: null,
|
||||
createOrgId: null,
|
||||
useOrgId: null,
|
||||
prodlineId: null,
|
||||
activeFlag: '1',
|
||||
deletedFlag: null,
|
||||
approveDate: null,
|
||||
erpModifyDate: null,
|
||||
materialClassfication:"1",
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询物料信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
getMaterialInfoList(this.queryParams).then(response => {
|
||||
this.materialinfoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.materialId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
|
||||
//选中列赋值
|
||||
handleRowClick(row) {
|
||||
this.selectedRow = row
|
||||
},
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue