外协发料和外协入库
This commit is contained in:
parent
b56400ec0e
commit
1d9b54e957
44
src/api/mes/wm/oursourcerecptline.js
Normal file
44
src/api/mes/wm/oursourcerecptline.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询外协入库单行列表
|
||||||
|
export function listOursourcerecptline(query) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/oursourcerecptline/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询外协入库单行详细
|
||||||
|
export function getOursourcerecptline(lineId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/oursourcerecptline/' + lineId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增外协入库单行
|
||||||
|
export function addOursourcerecptline(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/oursourcerecptline',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改外协入库单行
|
||||||
|
export function updateOursourcerecptline(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/oursourcerecptline',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除外协入库单行
|
||||||
|
export function delOursourcerecptline(lineId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/oursourcerecptline/' + lineId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
52
src/api/mes/wm/outsourceissue.js
Normal file
52
src/api/mes/wm/outsourceissue.js
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询外协领料单头列表
|
||||||
|
export function listOutsourceissue(query) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourceissue/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询外协领料单头详细
|
||||||
|
export function getOutsourceissue(issueId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourceissue/' + issueId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增外协领料单头
|
||||||
|
export function addOutsourceissue(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourceissue',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改外协领料单头
|
||||||
|
export function updateOutsourceissue(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourceissue',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除外协领料单头
|
||||||
|
export function delOutsourceissue(issueId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourceissue/' + issueId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//执行发料
|
||||||
|
export function execute(issueId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourceissue/' + issueId,
|
||||||
|
method: 'put'
|
||||||
|
})
|
||||||
|
}
|
44
src/api/mes/wm/outsourceissueline.js
Normal file
44
src/api/mes/wm/outsourceissueline.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询外协领料单行列表
|
||||||
|
export function listOutsourceissueline(query) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourceissueline/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询外协领料单行详细
|
||||||
|
export function getOutsourceissueline(lineId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourceissueline/' + lineId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增外协领料单行
|
||||||
|
export function addOutsourceissueline(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourceissueline',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改外协领料单行
|
||||||
|
export function updateOutsourceissueline(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourceissueline',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除外协领料单行
|
||||||
|
export function delOutsourceissueline(lineId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourceissueline/' + lineId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
44
src/api/mes/wm/outsourcerecpt.js
Normal file
44
src/api/mes/wm/outsourcerecpt.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询外协入库单列表
|
||||||
|
export function listOutsourcerecpt(query) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourcerecpt/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询外协入库单详细
|
||||||
|
export function getOutsourcerecpt(recptId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourcerecpt/' + recptId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增外协入库单
|
||||||
|
export function addOutsourcerecpt(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourcerecpt',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改外协入库单
|
||||||
|
export function updateOutsourcerecpt(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourcerecpt',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除外协入库单
|
||||||
|
export function delOutsourcerecpt(recptId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/wm/outsourcerecpt/' + recptId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
507
src/views/mes/wm/outsourceissue/index.vue
Normal file
507
src/views/mes/wm/outsourceissue/index.vue
Normal file
@ -0,0 +1,507 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||||
|
<el-form-item label="发料单编号" prop="issueCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.issueCode"
|
||||||
|
placeholder="请输入发料单编号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="外协工单编码" prop="workorderCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.workorderCode"
|
||||||
|
placeholder="请输入外协工单编码"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="供应商名称" prop="vendorName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.vendorName"
|
||||||
|
placeholder="请输入供应商名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="发料日期" prop="issueDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="queryParams.issueDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择发料日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</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-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['mes:wm:outsourceissue:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['mes:wm:outsourceissue:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['mes:wm:outsourceissue:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="outsourceissueList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="发料单编号" align="center" prop="issueCode" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
@click="handleView(scope.row)"
|
||||||
|
v-hasPermi="['mes:wm:outsourceissue:query']"
|
||||||
|
>{{scope.row.issueCode}}</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="发料单名称" align="center" prop="issueName" />
|
||||||
|
<el-table-column label="生产工单编码" align="center" prop="workorderCode" />
|
||||||
|
<el-table-column label="供应商名称" align="center" prop="vendorName" />
|
||||||
|
<el-table-column label="发料日期" align="center" prop="issueDate" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.issueDate, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="单据状态" align="center" prop="status">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.mes_order_status" :value="scope.row.status"/>
|
||||||
|
</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-video-play"
|
||||||
|
v-if="scope.row.status =='PREPARE'"
|
||||||
|
@click="handleExecute(scope.row)"
|
||||||
|
v-hasPermi="['mes:wm:outsourceissue:edit']"
|
||||||
|
>执行发料</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['mes:wm:outsourceissue:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['mes:wm:outsourceissue:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改外协领料单头对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="发料单编号" prop="issueCode">
|
||||||
|
<el-input v-model="form.issueCode" placeholder="请输入发料单编号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<el-form-item label-width="80">
|
||||||
|
<el-switch v-model="autoGenFlag"
|
||||||
|
active-color="#13ce66"
|
||||||
|
active-text="自动生成"
|
||||||
|
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view' && form.status =='PREPARE'">
|
||||||
|
</el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="发料单名称" prop="issueName">
|
||||||
|
<el-input v-model="form.issueName" placeholder="请输入发料单名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="发料日期" prop="issueDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.issueDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择发料日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="发料仓库">
|
||||||
|
<el-cascader v-model="warehouseInfo"
|
||||||
|
:options="warehouseOptions"
|
||||||
|
:props="warehouseProps"
|
||||||
|
@change="handleWarehouseChanged"
|
||||||
|
>
|
||||||
|
</el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="单据状态" prop="status">
|
||||||
|
<el-select v-model="form.status" disabled>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.mes_order_status"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="外协工单" prop="workorderCode">
|
||||||
|
<el-input v-model="form.workorderCode" placeholder="请选择外协工单" >
|
||||||
|
<el-button slot="append" icon="el-icon-search" @click="handleWorkorderSelect"></el-button>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<WorkorderSelect ref="woSelect" :workorder="workorder" @onSelected="onWorkorderSelected"></WorkorderSelect>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="供应商" prop="vendorCode">
|
||||||
|
<el-input v-model="form.vendorCode" readonly="readonly">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="供应商名称" >
|
||||||
|
<el-input v-model="form.vendorName" placeholder="请选择外协工单" >
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<el-divider v-if="form.issueId !=null" content-position="center">物料信息</el-divider>
|
||||||
|
<el-card shadow="always" v-if="form.issueId !=null" class="box-card">
|
||||||
|
<Issueline ref="line" :issueId="form.issueId" :warehouseId="form.warehouseId" :locationId="form.locationId" :areaId="form.areaId" :optType="optType"></Issueline>
|
||||||
|
</el-card>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE' ">返回</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm" v-if="form.status =='PREPARE' && optType !='view' ">保 存</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listOutsourceissue, getOutsourceissue, delOutsourceissue, addOutsourceissue, updateOutsourceissue, execute } from "@/api/mes/wm/outsourceissue";
|
||||||
|
import WorkorderSelect from "@/components/workorderSelect/single.vue"
|
||||||
|
import {getTreeList} from "@/api/mes/wm/warehouse"
|
||||||
|
import {genCode} from "@/api/system/autocode/rule"
|
||||||
|
import Issueline from "./line.vue";
|
||||||
|
export default {
|
||||||
|
name: "Outsourceissue",
|
||||||
|
dicts: ['mes_order_status'],
|
||||||
|
components: {Issueline,WorkorderSelect},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
autoGenFlag:false,
|
||||||
|
optType: undefined,
|
||||||
|
warehouseInfo:[],
|
||||||
|
warehouseOptions:[],
|
||||||
|
warehouseProps:{
|
||||||
|
multiple: false,
|
||||||
|
value: 'pId',
|
||||||
|
label: 'pName',
|
||||||
|
},
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 外协领料单头表格数据
|
||||||
|
outsourceissueList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
//工单弹出框结果过滤参数
|
||||||
|
workorder: { workorderType: 'OUTSOURCE'},
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
issueCode: null,
|
||||||
|
issueName: null,
|
||||||
|
workorderId: null,
|
||||||
|
workorderCode: null, vendorId: null, vendorCode: null, vendorName: null, vendorNick: null, warehouseId: null, warehouseCode: null, warehouseName: null, locationId: null, locationCode: null, locationName: null, areaId: null, areaCode: null, areaName: null, issueDate: null, status: null, },
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
issueCode: [
|
||||||
|
{ required: true, message: "发料单编号不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
issueName: [
|
||||||
|
{ required: true, message: "发料单名称不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
workorderCode: [
|
||||||
|
{ required: true, message: "请选择外协工单", trigger: "blur" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.getWarehouseList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询外协领料单头列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listOutsourceissue(this.queryParams).then(response => {
|
||||||
|
this.outsourceissueList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getWarehouseList(){
|
||||||
|
getTreeList().then( response =>{
|
||||||
|
if(response.data){
|
||||||
|
this.warehouseOptions = response.data.filter((el) =>{
|
||||||
|
return el.warehouseCode.indexOf('VIR') == -1;
|
||||||
|
});;
|
||||||
|
}
|
||||||
|
this.warehouseOptions.map(w =>{
|
||||||
|
w.children.map(l =>{
|
||||||
|
let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName');
|
||||||
|
l.children = JSON.parse(lstr);
|
||||||
|
});
|
||||||
|
|
||||||
|
let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName');
|
||||||
|
w.children = JSON.parse(wstr);
|
||||||
|
|
||||||
|
});
|
||||||
|
let ostr=JSON.stringify(this.warehouseOptions).replace(/warehouseId/g,'pId').replace(/warehouseName/g, 'pName');
|
||||||
|
this.warehouseOptions = JSON.parse(ostr);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
issueId: null,
|
||||||
|
issueCode: null,
|
||||||
|
issueName: null,
|
||||||
|
workorderId: null,
|
||||||
|
workorderCode: null,
|
||||||
|
vendorId: null,
|
||||||
|
vendorCode: null,
|
||||||
|
vendorName: null,
|
||||||
|
vendorNick: null,
|
||||||
|
warehouseId: null,
|
||||||
|
warehouseCode: null,
|
||||||
|
warehouseName: null,
|
||||||
|
locationId: null,
|
||||||
|
locationCode: null,
|
||||||
|
locationName: null,
|
||||||
|
areaId: null,
|
||||||
|
areaCode: null,
|
||||||
|
areaName: null,
|
||||||
|
issueDate: new Date(),
|
||||||
|
status: "PREPARE",
|
||||||
|
remark: null,
|
||||||
|
attr1: null,
|
||||||
|
attr2: null,
|
||||||
|
attr3: null,
|
||||||
|
attr4: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null
|
||||||
|
};
|
||||||
|
this.autoGenFlag = false;
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.issueId)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加外协发料单头";
|
||||||
|
this.optType = "add";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const issueId = row.issueId || this.ids
|
||||||
|
getOutsourceissue(issueId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改外协发料单头";
|
||||||
|
this.optType = "edit";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.issueId != null) {
|
||||||
|
updateOutsourceissue(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addOutsourceissue(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const issueIds = row.issueId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除外协发料单头编号为"' + issueIds + '"的数据项?').then(function() {
|
||||||
|
return delOutsourceissue(issueIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
// 查询明细按钮操作
|
||||||
|
handleView(row){
|
||||||
|
this.reset();
|
||||||
|
const issueIds = row.issueId
|
||||||
|
getOutsourceissue(issueIds).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.warehouseInfo[0] = response.data.warehouseId;
|
||||||
|
this.warehouseInfo[1] = response.data.locationId;
|
||||||
|
this.warehouseInfo[2] = response.data.areaId;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "查看外协发料单信息";
|
||||||
|
this.optType = "view";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//执行发料
|
||||||
|
handleExecute(row){
|
||||||
|
const issueIds = row.issueId || this.ids;
|
||||||
|
this.$modal.confirm('确认执行发料?').then(function() {
|
||||||
|
return execute(issueIds)
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("出库成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
//选择生产工单
|
||||||
|
handleWorkorderSelect(){
|
||||||
|
this.$refs.woSelect.showFlag = true;
|
||||||
|
},
|
||||||
|
onWorkorderSelected(row){
|
||||||
|
if(row != undefined && row != null){
|
||||||
|
this.form.workorderId = row.workorderId;
|
||||||
|
this.form.workorderCode = row.workorderCode;
|
||||||
|
this.form.workorderName = row.workorderName;
|
||||||
|
this.form.vendorId = row.vendorId;
|
||||||
|
this.form.vendorCode = row.vendorCode;
|
||||||
|
this.form.vendorName = row.vendorName;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//供应商选择
|
||||||
|
handleSelectVendor(){
|
||||||
|
this.$refs.vendorSelect.showFlag = true;
|
||||||
|
},
|
||||||
|
//供应商选择弹出框
|
||||||
|
onVendorSelected(obj){
|
||||||
|
if(obj != undefined && obj != null){
|
||||||
|
this.form.vendorId = obj.vendorId;
|
||||||
|
this.form.vendorCode = obj.vendorCode;
|
||||||
|
this.form.vendorName = obj.vendorName;
|
||||||
|
this.form.vendorNick = obj.vendorNick;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//自动生成编码
|
||||||
|
handleAutoGenChange(autoGenFlag){
|
||||||
|
if(autoGenFlag){
|
||||||
|
genCode('OUTSOURCE_ISSUE_CODE').then(response =>{
|
||||||
|
this.form.issueCode = response;
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
this.form.issueCode = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
368
src/views/mes/wm/outsourceissue/line.vue
Normal file
368
src/views/mes/wm/outsourceissue/line.vue
Normal file
@ -0,0 +1,368 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row v-if="optType != 'view'" :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['mes:wm:outsourceissue:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['mes:wm:outsourceissue:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['mes:wm:outsourceissue:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="outsourceissuelineList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="产品物料编码" width="120px" align="center" prop="itemCode" />
|
||||||
|
<el-table-column label="产品物料名称" width="120px" align="center" prop="itemName" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column label="规格型号" align="center" prop="specification" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
|
||||||
|
<el-table-column label="领料数量" align="center" prop="quantityIssued" />
|
||||||
|
<el-table-column label="批次号" align="center" prop="batchCode" />
|
||||||
|
<el-table-column label="仓库名称" align="center" prop="warehouseName" />
|
||||||
|
<el-table-column label="库区名称" align="center" prop="locationName" />
|
||||||
|
<el-table-column label="库位名称" align="center" prop="areaName" />
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column label="操作" align="center" v-if="optType != 'view'" width="100px" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-if="optType != 'view'"
|
||||||
|
v-hasPermi="['mes:wm:issueheader:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-if="optType != 'view'"
|
||||||
|
v-hasPermi="['mes:wm:issueheader:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改生产领料单行对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="产品物料编码" prop="itemCode">
|
||||||
|
<el-input v-model="form.itemCode" readonly="readonly" placeholder="请选择产品物料编码" >
|
||||||
|
<el-button slot="append" @click="handleSelectStock" icon="el-icon-search"></el-button>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<StockSelect ref="stockSelect" :batchCode="form.batchCode" :vendorId="form.vendorId" @onSelected="onStockSelected"></StockSelect>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="产品物料名称" prop="itemName">
|
||||||
|
<el-input v-model="form.itemName" readonly="readonly" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="领料数量" prop="quantityIssued">
|
||||||
|
<el-input-number :max="form.quantityMax" v-model="form.quantityIssued" placeholder="请输入领料数量" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="规格型号" prop="specification">
|
||||||
|
<el-input v-model="form.specification" readonly="readonly" type="textarea" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="单位" prop="unitOfMeasure">
|
||||||
|
<el-input v-model="form.unitOfMeasure" readonly="readonly" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="批次号" prop="batchCode">
|
||||||
|
<el-input v-model="form.batchCode" readonly="readonly" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="仓库" prop="warehouseName">
|
||||||
|
<el-input v-model="form.warehouseName" readonly="readonly" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="库区" prop="locationName">
|
||||||
|
<el-input v-model="form.locationName" readonly="readonly" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="库位" prop="areaName">
|
||||||
|
<el-input v-model="form.areaName" readonly="readonly" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listOutsourceissueline, getOutsourceissueline, delOutsourceissueline, addOutsourceissueline, updateOutsourceissueline } from "@/api/mes/wm/outsourceissueline";
|
||||||
|
import StockSelect from "@/components/stockSelect/single.vue"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Outsourceissueline",
|
||||||
|
components:{StockSelect},
|
||||||
|
props:{
|
||||||
|
optType: null,
|
||||||
|
issueId: null,
|
||||||
|
warehouseId: null,
|
||||||
|
locationId: null,
|
||||||
|
areaId: null
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 外协领料单行表格数据
|
||||||
|
outsourceissuelineList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
issueId: this.issueId,
|
||||||
|
itemId: null,
|
||||||
|
itemCode: null,
|
||||||
|
itemName: null,
|
||||||
|
specification: null,
|
||||||
|
unitOfMeasure: null,
|
||||||
|
quantityIssued: null,
|
||||||
|
batchCode: null,
|
||||||
|
warehouseId: null,
|
||||||
|
warehouseCode: null,
|
||||||
|
warehouseName: null,
|
||||||
|
locationId: null,
|
||||||
|
locationCode: null,
|
||||||
|
locationName: null,
|
||||||
|
areaId: null,
|
||||||
|
areaCode: null,
|
||||||
|
areaName: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
itemId: [
|
||||||
|
{ required: true, message: "产品物料不能为空", trigger: "blur" }
|
||||||
|
], quantityIssued: [
|
||||||
|
{ required: true, message: "领料数量不能为空", trigger: "blur" }
|
||||||
|
], }
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询外协领料单行列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listOutsourceissueline(this.queryParams).then(response => {
|
||||||
|
this.outsourceissuelineList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
lineId: null,
|
||||||
|
issueId: this.issueId,
|
||||||
|
itemId: null,
|
||||||
|
itemCode: null,
|
||||||
|
itemName: null,
|
||||||
|
specification: null,
|
||||||
|
unitOfMeasure: null,
|
||||||
|
quantityIssued: null,
|
||||||
|
batchCode: null,
|
||||||
|
warehouseId: null,
|
||||||
|
warehouseCode: null,
|
||||||
|
warehouseName: null,
|
||||||
|
locationId: null,
|
||||||
|
locationCode: null,
|
||||||
|
locationName: null,
|
||||||
|
areaId: null,
|
||||||
|
areaCode: null,
|
||||||
|
areaName: null,
|
||||||
|
remark: null,
|
||||||
|
attr1: null,
|
||||||
|
attr2: null,
|
||||||
|
attr3: null,
|
||||||
|
attr4: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.lineId)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加外协发料单行";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const lineId = row.lineId || this.ids
|
||||||
|
getOutsourceissueline(lineId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改外协发料单行";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.lineId != null) {
|
||||||
|
updateOutsourceissueline(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addOutsourceissueline(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const lineIds = row.lineId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除外协发料单行编号为"' + lineIds + '"的数据项?').then(function() {
|
||||||
|
return delOutsourceissueline(lineIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
handleSelectStock(){
|
||||||
|
this.$refs.stockSelect.showFlag = true;
|
||||||
|
this.$refs.stockSelect.getList();
|
||||||
|
},
|
||||||
|
//物料选择弹出框
|
||||||
|
onStockSelected(obj){
|
||||||
|
if(obj != undefined && obj != null){
|
||||||
|
this.form.materialStockId = obj.materialStockId;
|
||||||
|
this.form.itemId = obj.itemId;
|
||||||
|
this.form.itemCode = obj.itemCode;
|
||||||
|
this.form.itemName = obj.itemName;
|
||||||
|
this.form.specification = obj.specification;
|
||||||
|
this.form.unitOfMeasure = obj.unitOfMeasure;
|
||||||
|
this.form.batchCode = obj.batchCode;
|
||||||
|
this.form.warehouseId = obj.warehouseId;
|
||||||
|
this.form.warehouseCode = obj.warehouseCode;
|
||||||
|
this.form.warehouseName = obj.warehouseName;
|
||||||
|
this.form.locationId = obj.locationId;
|
||||||
|
this.form.locationCode = obj.locationCode;
|
||||||
|
this.form.locationName = obj.locationName;
|
||||||
|
this.form.areaId = obj.areaId;
|
||||||
|
this.form.areaCode = obj.areaCode;
|
||||||
|
this.form.areaName = obj.areaName;
|
||||||
|
this.form.quantityIssued = obj.quantityOnhand;
|
||||||
|
this.form.quantityMax = obj.quantityOnhand;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
456
src/views/mes/wm/outsourcerecpt/index.vue
Normal file
456
src/views/mes/wm/outsourcerecpt/index.vue
Normal file
@ -0,0 +1,456 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||||
|
<el-form-item label="入库单编号" prop="recptCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.recptCode"
|
||||||
|
placeholder="请输入入库单编号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="外协工单编号" prop="workorderCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.workorderCode"
|
||||||
|
placeholder="请输入外协工单编号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="供应商名称" prop="vendorName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.vendorName"
|
||||||
|
placeholder="请输入供应商名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="入库日期" prop="recptDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="queryParams.recptDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择入库日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</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-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['mes:wm:outsourcerecpt:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['mes:wm:outsourcerecpt:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['mes:wm:outsourcerecpt:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="outsourcerecptList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="入库单编号" align="center" prop="recptCode" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
@click="handleView(scope.row)"
|
||||||
|
v-hasPermi="['mes:wm:outsourcerecpt:query']"
|
||||||
|
>{{scope.row.recptCode}}</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="入库单名称" align="center" prop="recptName" />
|
||||||
|
<el-table-column label="外协工单编号" align="center" prop="workorderCode" />
|
||||||
|
<el-table-column label="供应商编码" align="center" prop="vendorCode" />
|
||||||
|
<el-table-column label="供应商名称" align="center" prop="vendorName" />
|
||||||
|
<el-table-column label="入库日期" align="center" prop="recptDate" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.recptDate, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="单据状态" align="center" prop="status">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.mes_order_status" :value="scope.row.status"/>
|
||||||
|
</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-video-play"
|
||||||
|
v-if="scope.row.status =='PREPARE'"
|
||||||
|
@click="handleExecute(scope.row)"
|
||||||
|
v-hasPermi="['mes:wm:outsourcerecpt:edit']"
|
||||||
|
>执行入库</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['mes:wm:outsourcerecpt:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['mes:wm:outsourcerecpt:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改外协入库单对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="入库单编号" prop="recptCode">
|
||||||
|
<el-input v-model="form.recptCode" placeholder="请输入入库单编号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<el-form-item label-width="80">
|
||||||
|
<el-switch v-model="autoGenFlag"
|
||||||
|
active-color="#13ce66"
|
||||||
|
active-text="自动生成"
|
||||||
|
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view' && form.status =='PREPARE'">
|
||||||
|
</el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="入库单名称" prop="recptName">
|
||||||
|
<el-input v-model="form.recptName" placeholder="请输入入库单名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="入库日期" prop="recptDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.recptDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择入库日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="外协工单" prop="workorderCode">
|
||||||
|
<el-input v-model="form.workorderCode" placeholder="请选择外协工单" >
|
||||||
|
<el-button slot="append" icon="el-icon-search" @click="handleWorkorderSelect"></el-button>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<WorkorderSelect ref="woSelect" :workorder="workorder" @onSelected="onWorkorderSelected"></WorkorderSelect>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="单据状态" prop="status">
|
||||||
|
<el-select v-model="form.status" disabled placeholder="请选择单据状态">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.mes_order_status"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="采购订单号" prop="poCode">
|
||||||
|
<el-input v-model="form.poCode" placeholder="请输入采购订单号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="供应商" prop="vendorName">
|
||||||
|
<el-input v-model="form.vendorName" readonly="readonly">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="入库仓库">
|
||||||
|
<el-cascader v-model="warehouseInfo"
|
||||||
|
:options="warehouseOptions"
|
||||||
|
:props="warehouseProps"
|
||||||
|
@change="handleWarehouseChanged"
|
||||||
|
>
|
||||||
|
</el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<el-divider v-if="form.recptId !=null" content-position="center">物料信息</el-divider>
|
||||||
|
<el-card shadow="always" v-if="form.recptId !=null" class="box-card">
|
||||||
|
<Itemrecptline ref=line :recptId="form.recptId" :warehouseId="form.warehouseId" :locationId="form.locationId" :areaId="form.areaId" :optType="optType"></Itemrecptline>
|
||||||
|
</el-card>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE' ">返回</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm" v-if="form.status =='PREPARE' && optType !='view' ">保 存</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listOutsourcerecpt, getOutsourcerecpt, delOutsourcerecpt, addOutsourcerecpt, updateOutsourcerecpt } from "@/api/mes/wm/outsourcerecpt";
|
||||||
|
import {getTreeList} from "@/api/mes/wm/warehouse"
|
||||||
|
import {genCode} from "@/api/system/autocode/rule"
|
||||||
|
import WorkorderSelect from "@/components/workorderSelect/single.vue"
|
||||||
|
import IqcSelect from "@/components/iqcSelect/single.vue";
|
||||||
|
import Itemrecptline from "./line.vue";
|
||||||
|
export default {
|
||||||
|
name: "Outsourcerecpt",
|
||||||
|
dicts:['mes_order_status'],
|
||||||
|
components :{WorkorderSelect,IqcSelect,Itemrecptline},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
//自动生成编码
|
||||||
|
autoGenFlag:false,
|
||||||
|
optType: undefined,
|
||||||
|
warehouseInfo:[],
|
||||||
|
warehouseOptions:[],
|
||||||
|
warehouseProps:{
|
||||||
|
multiple: false,
|
||||||
|
value: 'pId',
|
||||||
|
label: 'pName',
|
||||||
|
},
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 外协入库单表格数据
|
||||||
|
outsourcerecptList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
//工单弹出框结果过滤参数
|
||||||
|
workorder: { workorderType: 'OUTSOURCE'},
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
recptCode: null, recptName: null, iqcId: null, iqcCode: null, workorderId: null, workorderCode: null, vendorId: null, vendorCode: null, vendorName: null, vendorNick: null, warehouseId: null, warehouseCode: null, warehouseName: null, locationId: null, locationCode: null, locationName: null, areaId: null, areaCode: null, areaName: null, recptDate: null, status: null, },
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
recptCode: [
|
||||||
|
{ required: true, message: "入库单编号不能为空", trigger: "blur" }
|
||||||
|
], recptName: [
|
||||||
|
{ required: true, message: "入库单名称不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
workorderCode: [
|
||||||
|
{ required: true, message: "请选择外协工单", trigger: "blur" }
|
||||||
|
], }
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询外协入库单列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listOutsourcerecpt(this.queryParams).then(response => {
|
||||||
|
this.outsourcerecptList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
recptId: null,
|
||||||
|
recptCode: null,
|
||||||
|
recptName: null,
|
||||||
|
iqcId: null,
|
||||||
|
iqcCode: null,
|
||||||
|
workorderId: null,
|
||||||
|
workorderCode: null,
|
||||||
|
vendorId: null,
|
||||||
|
vendorCode: null,
|
||||||
|
vendorName: null,
|
||||||
|
vendorNick: null,
|
||||||
|
warehouseId: null,
|
||||||
|
warehouseCode: null,
|
||||||
|
warehouseName: null,
|
||||||
|
locationId: null,
|
||||||
|
locationCode: null,
|
||||||
|
locationName: null,
|
||||||
|
areaId: null, areaCode: null, areaName: null, recptDate: new Date(),
|
||||||
|
status: "PREPARE", remark: null, attr1: null, attr2: null, attr3: null, attr4: null, createBy: null, createTime: null, updateBy: null, updateTime: null
|
||||||
|
};
|
||||||
|
this.autoGenFlag = false;
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.recptId)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加外协入库单";
|
||||||
|
this.optType = "add";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const recptId = row.recptId || this.ids
|
||||||
|
getOutsourcerecpt(recptId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改外协入库单";
|
||||||
|
this.optType = "edit";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.recptId != null) {
|
||||||
|
updateOutsourcerecpt(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addOutsourcerecpt(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const recptIds = row.recptId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除外协入库单编号为"' + recptIds + '"的数据项?').then(function() {
|
||||||
|
return delOutsourcerecpt(recptIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
// 查询明细按钮操作
|
||||||
|
handleView(row){
|
||||||
|
this.reset();
|
||||||
|
const recptIds = row.recptId
|
||||||
|
getOutsourcerecpt(recptIds).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.warehouseInfo[0] = response.data.warehouseId;
|
||||||
|
this.warehouseInfo[1] = response.data.locationId;
|
||||||
|
this.warehouseInfo[2] = response.data.areaId;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "查看外协入库单信息";
|
||||||
|
this.optType = "view";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//选择生产工单
|
||||||
|
handleWorkorderSelect(){
|
||||||
|
this.$refs.woSelect.showFlag = true;
|
||||||
|
},
|
||||||
|
onWorkorderSelected(row){
|
||||||
|
if(row != undefined && row != null){
|
||||||
|
this.form.workorderId = row.workorderId;
|
||||||
|
this.form.workorderCode = row.workorderCode;
|
||||||
|
this.form.workorderName = row.workorderName;
|
||||||
|
this.form.poCode = row.sourceCode;
|
||||||
|
this.form.vendorId = row.vendorId;
|
||||||
|
this.form.vendorCode = row.vendorCode;
|
||||||
|
this.form.vendorName = row.vendorName;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//自动生成编码
|
||||||
|
handleAutoGenChange(autoGenFlag){
|
||||||
|
if(autoGenFlag){
|
||||||
|
genCode('OUTSOURCE_RECPT_CODE').then(response =>{
|
||||||
|
this.form.recptCode = response;
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
this.form.recptCode = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
442
src/views/mes/wm/outsourcerecpt/line.vue
Normal file
442
src/views/mes/wm/outsourcerecpt/line.vue
Normal file
@ -0,0 +1,442 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row v-if="optType !='view'" :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['mes:wm:oursourcerecpt:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['mes:wm:oursourcerecpt:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['mes:wm:oursourcerecpt:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="oursourcerecptlineList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="产品物料编码" width="120" align="center" prop="itemCode" />
|
||||||
|
<el-table-column label="产品物料名称" width="150" align="center" prop="itemName" />
|
||||||
|
<el-table-column label="规格型号" align="center" prop="specification" />
|
||||||
|
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
|
||||||
|
<el-table-column label="入库数量" align="center" prop="quantityRecived" />
|
||||||
|
<el-table-column label="批次号" width="100" align="center" prop="batchCode" />
|
||||||
|
<el-table-column label="仓库" width="100" align="center" prop="warehouseName" />
|
||||||
|
<el-table-column label="库区" width="100" align="center" prop="locationName" />
|
||||||
|
<el-table-column label="库位" align="center" prop="areaName" />
|
||||||
|
<el-table-column label="有效期" align="center" prop="expireDate" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.expireDate, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="是否检验" align="center" prop="iqcCheck">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.iqcCheck"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检验单编号" width="120" align="center" prop="iqcCode" />
|
||||||
|
<el-table-column label="操作" width="100" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['mes:wm:oursourcerecpt:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['mes:wm:oursourcerecpt:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改外协入库单行对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="物料编码" prop="itemCode">
|
||||||
|
<el-input v-model="form.itemCode" readonly="readonly" placeholder="请选择物料编码" >
|
||||||
|
<el-button slot="append" @click="handleSelectProduct" icon="el-icon-search"></el-button>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<ItemSelect ref="itemSelect" @onSelected="onItemSelected" > </ItemSelect>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="物料名称" prop="itemName">
|
||||||
|
<el-input v-model="form.itemName" readonly="readonly" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="单位" prop="unitOfMeasure">
|
||||||
|
<el-input v-model="form.unitOfMeasure" readonly="readonly" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="入库数量" prop="quantityRecived">
|
||||||
|
<el-input-number :min="0.01" v-model="form.quantityRecived" placeholder="请输入入库数量" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="入库批次号" prop="batchCode">
|
||||||
|
<el-input v-model="form.batchCode" placeholder="请输入入库批次号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="有效期" prop="expireDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.expireDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择有效期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="入库仓库" prop="warehouseId">
|
||||||
|
<el-cascader v-model="warehouseInfo"
|
||||||
|
:options="warehouseOptions"
|
||||||
|
:props="warehouseProps"
|
||||||
|
@change="handleWarehouseChanged"
|
||||||
|
>
|
||||||
|
</el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="是否检验">
|
||||||
|
<el-radio-group v-model="form.iqcCheck" disabled v-if="optType=='view'">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in dict.type.sys_yes_no"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>{{dict.label}}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
|
||||||
|
<el-radio-group v-model="form.iqcCheck" v-else>
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in dict.type.sys_yes_no"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>{{dict.label}}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span ="8">
|
||||||
|
<el-form-item v-if="form.iqcCheck == 'Y'" label="来料检验单" prop="iqcCode">
|
||||||
|
<el-input v-model="form.iqcCode" readonly="readonly" placeholder="请选择来料检验单" >
|
||||||
|
<el-button slot="append" @click="handleSelectIqc" icon="el-icon-search"></el-button>
|
||||||
|
</el-input>
|
||||||
|
<IqcSelect ref="iqcSelect" @onSelected="onIqcSelected"></IqcSelect>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listOursourcerecptline, getOursourcerecptline, delOursourcerecptline, addOursourcerecptline, updateOursourcerecptline } from "@/api/mes/wm/oursourcerecptline";
|
||||||
|
import ItemSelect from "@/components/itemSelect/single.vue";
|
||||||
|
import IqcSelect from "@/components/iqcSelect/single.vue";
|
||||||
|
import {getTreeList} from "@/api/mes/wm/warehouse"
|
||||||
|
export default {
|
||||||
|
name: "Oursourcerecptline",
|
||||||
|
dicts: ['sys_yes_no'],
|
||||||
|
components :{ItemSelect,IqcSelect},
|
||||||
|
props:{
|
||||||
|
recptId: null,
|
||||||
|
optType: null,
|
||||||
|
warehouseId: null,
|
||||||
|
locationId: null,
|
||||||
|
areaId: null
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
warehouseInfo:[],
|
||||||
|
warehouseOptions:[],
|
||||||
|
warehouseProps:{
|
||||||
|
multiple: false,
|
||||||
|
value: 'pId',
|
||||||
|
label: 'pName',
|
||||||
|
},
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 外协入库单行表格数据
|
||||||
|
oursourcerecptlineList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
recptId: this.recptId,
|
||||||
|
itemId: null,
|
||||||
|
itemCode: null,
|
||||||
|
itemName: null,
|
||||||
|
specification: null,
|
||||||
|
unitOfMeasure: null,
|
||||||
|
quantityRecived: null,
|
||||||
|
batchCode: null,
|
||||||
|
warehouseId: null,
|
||||||
|
warehouseCode: null,
|
||||||
|
warehouseName: null,
|
||||||
|
locationId: null,
|
||||||
|
locationCode: null,
|
||||||
|
locationName: null,
|
||||||
|
areaId: null,
|
||||||
|
areaCode: null,
|
||||||
|
areaName: null,
|
||||||
|
expireDate: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
itemCode: [
|
||||||
|
{ required: true, message: "产品物料不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
quantityRecived: [
|
||||||
|
{ required: true, message: "入库数量不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
warehouseId:[
|
||||||
|
{ required: true, message: "请选择入库的仓库" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.getWarehouseList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询外协入库单行列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listOursourcerecptline(this.queryParams).then(response => {
|
||||||
|
this.oursourcerecptlineList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getWarehouseList(){
|
||||||
|
getTreeList().then( response =>{
|
||||||
|
if(response.data){
|
||||||
|
this.warehouseOptions = response.data.filter((el) =>{
|
||||||
|
return el.warehouseCode.indexOf('VIR') == -1;
|
||||||
|
});;
|
||||||
|
}
|
||||||
|
this.warehouseOptions.map(w =>{
|
||||||
|
debugger;
|
||||||
|
w.children.map(l =>{
|
||||||
|
let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName');
|
||||||
|
l.children = JSON.parse(lstr);
|
||||||
|
});
|
||||||
|
|
||||||
|
let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName');
|
||||||
|
w.children = JSON.parse(wstr);
|
||||||
|
|
||||||
|
});
|
||||||
|
let ostr=JSON.stringify(this.warehouseOptions).replace(/warehouseId/g,'pId').replace(/warehouseName/g, 'pName');
|
||||||
|
this.warehouseOptions = JSON.parse(ostr);
|
||||||
|
debugger;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//选择仓库、库区、库位
|
||||||
|
handleWarehouseChanged(obj){
|
||||||
|
if(obj !=null){
|
||||||
|
this.form.warehouseId = obj[0];
|
||||||
|
this.form.locationId = obj[1];
|
||||||
|
this.form.areaId = obj[2];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
lineId: null,
|
||||||
|
recptId: this.recptId,
|
||||||
|
itemId: null,
|
||||||
|
itemCode: null,
|
||||||
|
itemName: null,
|
||||||
|
specification: null,
|
||||||
|
unitOfMeasure: null,
|
||||||
|
quantityRecived: null,
|
||||||
|
batchCode: null,
|
||||||
|
warehouseId: this.warehouseId,
|
||||||
|
warehouseCode: null,
|
||||||
|
warehouseName: null,
|
||||||
|
locationId: this.locationId,
|
||||||
|
locationCode: null,
|
||||||
|
locationName: null,
|
||||||
|
areaId: this.areaId,
|
||||||
|
areaCode: null,
|
||||||
|
areaName: null,
|
||||||
|
expireDate: null,
|
||||||
|
iqcCheck: 'N',
|
||||||
|
iqcId: null,
|
||||||
|
iqcCode: null,
|
||||||
|
remark: null,
|
||||||
|
attr1: null, attr2: null, attr3: null, attr4: null, createBy: null, createTime: null, updateBy: null, updateTime: null };
|
||||||
|
|
||||||
|
|
||||||
|
this.resetForm("form");
|
||||||
|
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.lineId)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加外协入库单行";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const lineId = row.lineId || this.ids
|
||||||
|
getOursourcerecptline(lineId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改外协入库单行";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.lineId != null) {
|
||||||
|
updateOursourcerecptline(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addOursourcerecptline(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const lineIds = row.lineId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除外协入库单行编号为"' + lineIds + '"的数据项?').then(function() {
|
||||||
|
return delOursourcerecptline(lineIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
handleSelectProduct(){
|
||||||
|
this.$refs.itemSelect.showFlag = true;
|
||||||
|
},
|
||||||
|
//物料选择弹出框
|
||||||
|
onItemSelected(obj){
|
||||||
|
debugger;
|
||||||
|
if(obj != undefined && obj != null){
|
||||||
|
this.form.itemId = obj.itemId;
|
||||||
|
this.form.itemCode = obj.itemCode;
|
||||||
|
this.form.itemName = obj.itemName;
|
||||||
|
this.form.specification = obj.specification;
|
||||||
|
this.form.unitOfMeasure = obj.unitOfMeasure;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//IQC检验单选择
|
||||||
|
handleSelectIqc(){
|
||||||
|
this.$refs.iqcSelect.showFlag = true;
|
||||||
|
},
|
||||||
|
//IQC检验单选择弹出框
|
||||||
|
onIqcSelected(obj){
|
||||||
|
if(obj != undefined && obj != null){
|
||||||
|
this.form.iqcId = obj.iqcId;
|
||||||
|
this.form.iqcCode = obj.iqcCode;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in New Issue
Block a user