Commit abe7a162 authored by chenzj's avatar chenzj

领料申请页面修改

parent 9287be0d
import request from '@/utils/request' import request from '@/utils/request'
// 查询领料申请列表 // 查询领料申请列表
export function listMaterialRequest(query) { export function listMaterialRequest(query) {
return request({ return request({
url: '/pro/materialRequest/list', url: '/pro/materialRequest/list',
...@@ -9,6 +9,16 @@ export function listMaterialRequest(query) { ...@@ -9,6 +9,16 @@ export function listMaterialRequest(query) {
}) })
} }
// 查询领料申请列表头
export function listMaterialRequests(query) {
return request({
url: '/pro/materialRequest/lists',
method: 'get',
params: query
})
}
// 查询领料申请详细 // 查询领料申请详细
export function getMaterialRequest(materialRequestId) { export function getMaterialRequest(materialRequestId) {
return request({ return request({
...@@ -53,9 +63,9 @@ export function delMaterialRequest(materialRequestId) { ...@@ -53,9 +63,9 @@ export function delMaterialRequest(materialRequestId) {
} }
// 确认补货按钮 // 确认补货按钮
export function confirmMaterialRequest(materialRequestId) { export function confirmMaterialRequest(applyNo) {
return request({ return request({
url: '/pro/materialRequest/confirm/' + materialRequestId, url: '/pro/materialRequest/confirm/' + applyNo,
method: 'get' method: 'get'
}) })
} }
\ No newline at end of file
...@@ -3,12 +3,13 @@ import request from '@/utils/request' ...@@ -3,12 +3,13 @@ import request from '@/utils/request'
// 查询过程检验单列表 // 查询过程检验单列表
export function listIpqc(query) { export function listIpqc(query) {
return request({ return request({
url: '/mes/qc/ipqc/list', url: '/mes/qc/ipqc/lists',
method: 'get', method: 'get',
params: query params: query
}) })
} }
// 查询过程检验单详细 // 查询过程检验单详细
export function getIpqc(ipqcId) { export function getIpqc(ipqcId) {
return request({ return request({
......
<template>
<el-dialog title="单号对应物料"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="80%"
>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="产品编号" prop="sapItemCode">
<el-input v-model="queryParams.sapItemCode" placeholder="请输入产品编号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="产品名称" prop="itemName">
<el-input v-model="queryParams.itemName" placeholder="请输入产品名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="领用数量" prop="applyNum">
<el-input v-model="queryParams.applyNum" 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>
<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="protaskList" @current-change="handleCurrent" @row-dblclick="handleRowDbClick">
<el-table-column label="产品编号" align="center" prop="sapItemCode" width="300" />
<el-table-column label="产品名称" align="center" prop="itemName" width="300" />
<el-table-column label="生产工单" align="center" prop="workorderCode" width="200" />
<el-table-column label="领用数量" align="center" prop="applyNum" width="200"/>
<el-table-column label="发料状态" align="center" prop="grantNumType">
<template slot-scope="scope">
<dict-tag :options="dict.type.pro_grant_num_type" :value="scope.row.grantNumType" />
</template>
</el-table-column>
<el-table-column label="已发放数量" align="center" prop="grantNum" width="150"/>
<el-table-column label="操作" width="150" align="center" class-name="small-padding fixed-width" fixed="right">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
v-hasPermi="['pro:materialRequest:view']">查看</el-button>
<!-- <el-button
size="mini"
type="text"
icon="el-icon-edit"
@click=" handleUpdate(scope.row)"
v-hasPermi="['pro:materialRequest:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['pro:materialRequest:remove']"
>删除</el-button> -->
</template>
</el-table-column>
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" :disabled="form.materialRequestId && optType != 'edit'"
label-width="100px">
<el-row>
<el-col :span="8">
<el-form-item label="申请号" prop="applyNo">
<el-input v-model="form.applyNo" placeholder="请输入申请号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="任务单号" prop="taskCode">
<el-input v-model="form.taskCode" placeholder="请输入任务单号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="编排单号" prop="arrangeCode">
<el-input v-model="form.arrangeCode" placeholder="请输入编排单号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="产品编号" prop="sapItemCode">
<el-input v-model="form.sapItemCode" placeholder="请输入任务单号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="产品名称" prop="itemName">
<el-input v-model="form.itemName" placeholder="请输入产品名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="申请数量" prop="applyNum">
<el-input v-model="form.applyNum" placeholder="请输入申请数量" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="工作中心" prop="workstationCode">
<el-input v-model="form.workstationCode" placeholder="请输入工作中心" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工作单元" prop="workunitCode">
<el-input v-model="form.workunitCode" placeholder="请输入工作单元" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建人" prop="createBy">
<el-input v-model="form.createBy" placeholder="请输入创始人" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="申请时间" prop="createTime">
<el-date-picker clearable v-model="form.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择申请时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="需求日期" prop="startTime">
<el-date-picker clearable v-model="form.startTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择需求日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel" v-if="optType == 'view'">返回</el-button>
<el-button type="primary" @click="submitForm" v-if="optType != 'view'">确 定</el-button>
<el-button @click="cancel" v-if="optType != 'view'">取 消</el-button>
</div>
</el-dialog>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div slot="footer" class="dialog-footer">
<el-button @click="cancels">返 回</el-button>
</div>
</el-dialog>
</template>
<script>
import {listMaterialRequest,getMaterialRequest } from "@/api/mes/pro/request";
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue"
export default {
name: "ProtaskSelect",
dicts: ['sys_yes_no','pro_grant_num_type'],
components: {WorkstationSelect},
props:{
applyNos: {
type: String,
default: null
},
},
watch: {
applyNos:{
handler(newVal, oldVal){
this.$nextTick(() =>{
if(this.applyNos !='' && this.applyNos!=null){
this.queryParams.applyNo=this.applyNos;
this.getList();
}
})
},
immediate: true,
deep: true
}
},
data() {
return {
showFlag: false,
selectedTaskId: undefined,
selectedRow: undefined,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 生产任务表格数据
protaskList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
applyNo: null,
itemId: null,
itemName: null,
taskId: null,
taskCode: null,
taskName: null,
arrangeCode: null,
createTime: null,
applyNum: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
workorderCode: null,
WorkunitName: null,
workstationId: null,
workstationCode: null,
workstationName: null,
materialType: null,
confirm: null,
windCase: null,
createBy: null,
grantNum: null,
startTime: null,
endTime: null,
},
// 表单参数
form: {},
};
},
created() {
this.getList();
},
methods: {
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
/** 查询生产任务列表 */
getList() {
this.loading = true;
listMaterialRequest(this.queryParams).then(response => {
this.protaskList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
handleCurrent(row){
if(row){
this.selectedRow = row;
}
},
//行双击选中
handleRowDbClick(row){
if(row){
console.log(row)
this.selectedRow = row;
this.$emit('onSelected',this.selectedRow);
this.showFlag = false;
}
},
// 查询明细按钮操作
handleView(row) {
this.reset();
console.log( row.materialRequestId);
const materialRequestId = row.materialRequestId;
getMaterialRequest(materialRequestId).then(response => {
this.form = response.data;
this.open = true;
this.title = "查看领料申请";
this.optType = "view";
});
},
// 取消按钮
cancels() {
this.showFlag=false
this.queryParams();
},
// 单选选中数据
handleRowChange(row) {
debugger;
if(row){
this.selectedRow = row;
}
},
// 表单重置
reset() {
this.form = {
materialRequestId: null,
applyNo: null,
itemId: null,
itemCode: null,
itemName: null,
taskId: null,
taskCode: null,
taskName: null,
applyNum: null,
arrangeCode: null,
workorderCode: null,
materialType: null,
WorkunitName: null,
workstationId: null,
workstationCode: null,
workstationName: null,
createTime: null,
remark: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
createBy: "admin",
createTime: null,
updateBy: null,
updateTime: null,
windCase: null,
grantNum: null,
startTime: null,
endTime: null,
};
this.resetForm("form");
},
//确定选中
confirmSelect(){
if(this.selectedTaskId ==null || this.selectedTaskId==0){
this.$notify({
title:'提示',
type:'warning',
message: '请至少选择一条数据!'
});
return;
}
this.$emit('onSelected',this.selectedRow);
this.showFlag = false;
}
}
};
</script>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="产品编号" prop="sapItemCode">
<el-input v-model="queryParams.sapItemCode" placeholder="请输入产品编号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="产品名称" prop="itemName">
<el-input v-model="queryParams.itemName" placeholder="请输入产品名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="编排单号" prop="arrangeCode"> <el-form-item label="编排单号" prop="arrangeCode">
<el-input v-model="queryParams.arrangeCode" placeholder="请输入编排单号" clearable @keyup.enter.native="handleQuery" /> <el-input v-model="queryParams.arrangeCode" placeholder="请输入编排单号" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="领用数量" prop="applyNum">
<el-input v-model="queryParams.applyNum" 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="createBy"> <el-form-item label="创建人" prop="createBy">
<el-input v-model="queryParams.createBy" placeholder="请输入创建人" clearable @keyup.enter.native="handleQuery" /> <el-input v-model="queryParams.createBy" placeholder="请输入创建人" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
...@@ -102,21 +90,24 @@ ...@@ -102,21 +90,24 @@
</el-col> --> </el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<requestItems ref="requestitemsref" key="requestitemsref" :applyNos="applyNos" ></requestItems>
<el-table v-loading="loading" :data="materialRequestList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="materialRequestList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="产品编号" align="center" prop="sapItemCode" width="150" /> <el-table-column label="申请单号" width="150" align="center" prop="applyNo" :show-overflow-tooltip="true">
<el-table-column label="产品名称" align="center" prop="itemName" width="100" /> <template slot-scope="scope">
<el-table-column label="生产工单" align="center" prop="workorderCode" width="150" /> <el-button size="mini" type="text" @click="showCombDetail(scope.row.applyNo)" >{{
scope.row.applyNo }}
</el-button>
</template>
</el-table-column>
<el-table-column label="工作单元" align="center" prop="workunitName" width="100" /> <el-table-column label="工作单元" align="center" prop="workunitName" width="100" />
<el-table-column label="申请单号" align="center" prop="applyNo" width="150" />
<el-table-column label="领料类型" align="center" prop="applyType"> <el-table-column label="领料类型" align="center" prop="applyType">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.pro_requisition_type" :value="scope.row.applyType" /> <dict-tag :options="dict.type.pro_requisition_type" :value="scope.row.applyType" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="编排单号" align="center" prop="arrangeCode" width="150" /> <el-table-column label="编排单号" align="center" prop="arrangeCode" width="150" />
<el-table-column label="领用数量" align="center" prop="applyNum" />
<el-table-column label="创建人" align="center" prop="createBy" /> <el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="领料方式" align="center" prop="materialType"> <el-table-column label="领料方式" align="center" prop="materialType">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -133,7 +124,6 @@ ...@@ -133,7 +124,6 @@
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.confirm" /> <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.confirm" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="已发放数量" align="center" prop="grantNum" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<!-- <template slot-scope="scope"> <!-- <template slot-scope="scope">
<span>{{ parseTime(scope.row.CreateTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.CreateTime, '{y}-{m}-{d}') }}</span>
...@@ -349,6 +339,8 @@ ...@@ -349,6 +339,8 @@
<el-button @click="cancels" v-if="optType != 'view'">取 消</el-button> <el-button @click="cancels" v-if="optType != 'view'">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<div style="overflow: hidden;width: 0;height: 0;"> <div style="overflow: hidden;width: 0;height: 0;">
<div id="productOrderDetail"> <div id="productOrderDetail">
<div v-for="(item, index) in printTable" :key="'printTable' + index"> <div v-for="(item, index) in printTable" :key="'printTable' + index">
...@@ -360,7 +352,7 @@ ...@@ -360,7 +352,7 @@
</template> </template>
<script> <script>
import {confirmMaterialRequest, listMaterialRequest, getMaterialRequest, delMaterialRequest, addMaterialRequest, updateMaterialRequest, materialRequestPrintInfo } from "@/api/mes/pro/request"; import {listMaterialRequests,confirmMaterialRequest, listMaterialRequest, getMaterialRequest, delMaterialRequest, addMaterialRequest, updateMaterialRequest, materialRequestPrintInfo } from "@/api/mes/pro/request";
import { genCode } from "@/api/system/autocode/rule"; import { genCode } from "@/api/system/autocode/rule";
import BrandSelect from "./components/taskSelect.vue"; import BrandSelect from "./components/taskSelect.vue";
import arangeSelect from "./components/arangeSelect.vue"; import arangeSelect from "./components/arangeSelect.vue";
...@@ -372,10 +364,11 @@ import print from 'vue-print-nb'; ...@@ -372,10 +364,11 @@ import print from 'vue-print-nb';
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue"; import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue";
import ItemSelect from "@/components/itemSelect/single.vue"; import ItemSelect from "@/components/itemSelect/single.vue";
import { listWorkunit} from "@/api/mes/md/workunit"; import { listWorkunit} from "@/api/mes/md/workunit";
import requestItems from "@/components/request/requestItem.vue";
export default { export default {
directives: { print }, directives: { print },
name: "MaterialRequest", name: "MaterialRequest",
components: { printTable, BrandSelect,WorkstationSelect,ItemSelect, arangeSelect, codeSelect ,requestIndex ,workorderSelect}, components: { printTable, BrandSelect,WorkstationSelect,ItemSelect, arangeSelect, codeSelect ,requestIndex ,workorderSelect,requestItems},
dicts: ['pro_requisition_type', 'pro_material_from', 'sys_yes_no'], dicts: ['pro_requisition_type', 'pro_material_from', 'sys_yes_no'],
data() { data() {
return { return {
...@@ -383,14 +376,23 @@ export default { ...@@ -383,14 +376,23 @@ export default {
loading: true, loading: true,
// 选中数组 // 选中数组
ids: [], ids: [],
applyno: [],
// 非单个禁用 // 非单个禁用
single: true, single: true,
combOpen: false,
// 非多个禁用 // 非多个禁用
multiple: true, multiple: true,
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: true,
// 总条数 // 总条数
total: 0, total: 0,
applyNos: null,
combinationCodes: [],
// 领料申请表格数据 // 领料申请表格数据
materialRequestList: [], materialRequestList: [],
...@@ -510,6 +512,11 @@ export default { ...@@ -510,6 +512,11 @@ export default {
this.printloading = false; this.printloading = false;
}) })
}, },
showCombDetail(applyNo) {
this.$refs.requestitemsref.showFlag = true;
this.applyNos= applyNo;
},
handleBrandSelect() { handleBrandSelect() {
this.$refs.brSelect.showFlag = true; this.$refs.brSelect.showFlag = true;
}, },
...@@ -548,6 +555,7 @@ export default { ...@@ -548,6 +555,7 @@ export default {
handleWorkstationSelect() { handleWorkstationSelect() {
console.log(workstationSelect);
this.$refs.workstationSelect.showFlag = true; this.$refs.workstationSelect.showFlag = true;
}, },
onWorkstationSelect(row, type) { onWorkstationSelect(row, type) {
...@@ -583,7 +591,7 @@ export default { ...@@ -583,7 +591,7 @@ export default {
this.queryParams.params["beginPurchaseDate"] = this.daterangePurchaseDate[0]; this.queryParams.params["beginPurchaseDate"] = this.daterangePurchaseDate[0];
this.queryParams.params["endPurchaseDate"] = this.daterangePurchaseDate[1]; this.queryParams.params["endPurchaseDate"] = this.daterangePurchaseDate[1];
} }
listMaterialRequest(this.queryParams).then(response => { listMaterialRequests(this.queryParams).then(response => {
this.materialRequestList = response.rows; this.materialRequestList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
...@@ -657,6 +665,7 @@ export default { ...@@ -657,6 +665,7 @@ export default {
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.materialRequestId) this.ids = selection.map(item => item.materialRequestId)
this.applyno = selection.map(item => item.applyNo)
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
...@@ -683,8 +692,8 @@ export default { ...@@ -683,8 +692,8 @@ export default {
/** 确认补货按钮 */ /** 确认补货按钮 */
confirmUpdate(row) { confirmUpdate(row) {
this.reset(); this.reset();
const materialRequestId = row.materialRequestId || this.ids const applyNo = row.applyNo || this.applyno;
confirmMaterialRequest(materialRequestId).then(response => { confirmMaterialRequest(applyNo).then(response => {
if(response.code===500){ if(response.code===500){
this.$modal.confirm(msg); this.$modal.confirm(msg);
} }
...@@ -695,14 +704,9 @@ export default { ...@@ -695,14 +704,9 @@ export default {
}, },
// 查询明细按钮操作 // 查询明细按钮操作
handleView(row) { handleView(row) {
this.reset(); const applyNo = row.applyNo || this.applyNo;
const materialRequestId = row.materialRequestId || this.ids; this.$refs.requestitemsref.showFlag = true;
getMaterialRequest(materialRequestId).then(response => { this.applyNos= applyNo;
this.form = response.data;
this.open = true;
this.title = "查看领料申请";
this.optType = "view";
});
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment