Browse Source

领料申请单

master
Yangzz 5 months ago
parent
commit
907ef55227
  1. 5
      src/api/orderIssure/soIssueNotify.js
  2. 330
      src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue

5
src/api/orderIssure/soIssueNotify.js

@ -6,8 +6,9 @@ export const createNotify = data => createAPI(`/orderIssure/issureNotify/createN
export const getNotifyNoDetail = data => createAPI(`/orderIssure/issureNotify/getNotifyNoDetail`,'post',data)
export const getSOScheduledRoutingListForIssure= data => createAPI(`/orderIssure/issureNotify/getSOScheduledRoutingListForIssure`,'post',data)
export const getSOSBOMForIssure= data => createAPI(`/orderIssure/issureNotify/getSOSBOMForIssure`,'post',data)
export const getSOScheduledRoutingListForIssure= data => createAPI(`/orderIssure/issureNotify/getSOScheduledRoutingListForIssure`,'post',data)
export const getSOScheduledRoutingListForIssureByPaging= data => createAPI(`/orderIssure/issureNotify/getSOScheduledRoutingListForIssureByPaging`,'post',data)
export const saveSOIssueNotifyOrderList= data => createAPI(`/orderIssure/issureNotify/saveSOIssueNotifyOrderList`,'post',data)
export const saveMaterialDetail= data => createAPI(`/orderIssure/issureNotify/saveMaterialDetail`,'post',data)
@ -29,6 +30,7 @@ export const searchSumNotifyMaterialList= data => createAPI(`/orderIssure/issure
export const updateNotifyBu= data => createAPI(`/orderIssure/issureNotify/updateNotifyBu`,'post',data)
export const getPartList= data => createAPI(`/orderIssure/issureNotify/getPartList`,'post',data)
export const getPartListByPaging= data => createAPI(`/orderIssure/issureNotify/getPartListByPaging`,'post',data)
export const checkPartStock= data => createAPI(`/orderIssure/issureNotify/checkPartStock`,'post',data)
export const deleteNotifySOSPlus= data => createAPI(`/orderIssure/issureNotify/deleteNotifySOSPlus`,'post',data)
export const updateNotifyStatus= data => createAPI(`/orderIssure/issureNotify/updateNotifyStatus`,'post',data)
@ -46,4 +48,5 @@ export const updateNotifyBatchConfirmStatus= data => createAPI(`/orderIssure/iss
export const getSiteAndBuByUserName = data => createAPI(`/orderIssure/issureNotify/getSiteAndBuByUserName`,'post',data)
export const getEamWorkShop = data => createAPI(`/orderIssure/issureNotify/getEamWorkShop`,'post',data)
export const saveIssueNoOrderDetail = data => createAPI(`/orderIssure/issureNotify/saveIssueNoOrderDetail`,'post',data)

330
src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue

@ -374,40 +374,38 @@
</el-dialog>
<!-- 选择物料模态框 -->
<el-dialog
width="600px"
<el-dialog width="1000px"
title="选择物料"
:close-on-click-modal="false"
:visible.sync="choosePartModalFlag">
<el-form :inline="true" label-position="top" label-width="100px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item style="margin-left: 0px" label="物料编码">
<el-form-item :label="'物料编码'" >
<el-input v-model="choosePartData.partNo"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item style="margin-left: 0px" label="物料名称">
<el-form-item :label="'物料名称'" >
<el-input v-model="choosePartData.partDesc"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item style="margin-left: 0px" label="规格型号">
<el-form-item :label="'规格型号'" >
<el-input v-model="choosePartData.spec"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" ">
<el-button type="primary" @click="searchPartModel">查询</el-button>
<el-form-item >
<el-button type="primary" @click="searchPartModel" style="margin-top: 5px" class="">查询</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table
height="450"
:height="400"
:data="choosePartList"
border
@row-dblclick="choosePart"
style="width: 100%;">
<el-table-column
prop="partNo"
@ -444,7 +442,26 @@
min-width="60"
label="计量单位">
</el-table-column>
<el-table-column
fixed="left"
header-align="center"
align="center"
width="60"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="choosePart(scope.row)">选择</a>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="pp_sizeChangeHandle"
@current-change="pp_currentChangeHandle"
:current-page="pp_pageIndex"
:page-sizes="[20, 50, 100, 1000]"
:page-size="pp_pageSize"
:total="pp_totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="choosePartModalFlag=false">关闭</el-button>
</el-footer>
@ -530,6 +547,15 @@
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="ss_sizeChangeHandle"
@current-change="ss_currentChangeHandle"
:current-page="ss_pageIndex"
:page-sizes="[20, 50, 100, 1000]"
:page-size="ss_pageSize"
:total="ss_totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="chooseSOSModalFlag = false">关闭</el-button>
</el-footer>
@ -545,7 +571,7 @@
</el-col>
<el-col :span="6">
<el-form-item :label="'工单状态'" >
<el-select v-model="chooseOrderData.statusList" multiple style="width: 100%" class="single-line-multi-select">
<el-select multiple collapse-tags v-model="chooseOrderData.statusList" style="width: 220px">
<el-option label="全部" value=""></el-option>
<el-option label="已停工" value="已停工"></el-option>
<el-option label="已开工" value="已开工"></el-option>
@ -620,7 +646,7 @@
</el-table-column>
</el-table>
<el-pagination
@size-change="co_SizeChangeHandle"
@size-change="co_sizeChangeHandle"
@current-change="co_currentChangeHandle"
:current-page="co_pageIndex"
:page-sizes="[20, 50, 100, 1000]"
@ -745,7 +771,7 @@
<!-- BOM物料和非BOM物料选择 -->
<el-row :gutter="20" style="margin-bottom: 15px;">
<el-col :span="24">
<el-form-item :label="'物料类型'">
<el-form-item :label="'物料类型'" style="display: none;">
<el-radio-group v-model="orderDetailData.materialType" @change="onMaterialTypeChange">
<el-radio label="BOM物料">BOM物料</el-radio>
<el-radio label="非BOM物料">非BOM物料</el-radio>
@ -776,8 +802,8 @@
<el-col :span="6">
<el-form-item>
<template slot="label">
<span v-if="!orderDetailData.orderNo" slot="label">工序名称</span>
<span v-else style="cursor: pointer" slot="label" @click="openChooseOperationModal"><a>工序名称</a></span>
<span v-if="orderDetailData.orderNo && !orderDetailData.seqNo" style="cursor: pointer" slot="label" @click="openChooseOperationModal"><a>工序名称</a></span>
<span v-else slot="label">工序名称</span>
</template>
<el-input v-model="orderDetailData.itemDesc" disabled placeholder="请选择工序"></el-input>
</el-form-item>
@ -785,8 +811,8 @@
<el-col :span="6">
<el-form-item>
<template slot="label">
<span v-if="!orderDetailData.orderNo" slot="label">机台</span>
<span v-else style="cursor: pointer" slot="label" @click="openChooseResourceModal"><a>机台</a></span>
<span v-if="orderDetailData.orderNo && !orderDetailData.seqNo" style="cursor: pointer" slot="label" @click="openChooseResourceModal"><a>机台</a></span>
<span v-else slot="label">机台</span>
</template>
<el-input v-model="orderDetailData.resourceDesc" disabled placeholder="请选择机台"></el-input>
</el-form-item>
@ -799,7 +825,7 @@
<span v-if="orderDetailData.materialType === 'BOM物料'" slot="label">物料编码</span>
<span v-else style="cursor: pointer" slot="label" @click="openChoosePartModal"><a>物料编码</a></span>
</template>
<el-input v-model="orderDetailData.partNo" :disabled="orderDetailData.materialType === 'BOM物料'"></el-input>
<el-input v-model="orderDetailData.partNo" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="18">
@ -834,7 +860,7 @@
</el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="saveOrderDetail()">保存</el-button>
<el-button type="primary" @click="saveIssueNoOrderDetail()">保存</el-button>
<el-button type="primary" @click="saveOrderDetailFlag=false">关闭</el-button>
</el-footer>
</el-dialog>
@ -857,8 +883,8 @@
, searchNotifyLogClose
, getSiteAndBuByUserName
, createNotify
, getSOScheduledRoutingListForIssure
, getPartList
, getSOScheduledRoutingListForIssureByPaging
, getPartListByPaging
} from "@/api/orderIssure/soIssueNotify.js"
import {
searchShopOrderByPaging
@ -872,6 +898,7 @@
getTableDefaultListLanguage,
getTableUserListLanguage,
} from "@/api/table.js"
import {saveIssueNoOrderDetail} from "../../../../api/orderIssure/soIssueNotify";
export default {
@ -928,6 +955,14 @@
co_pageIndex: 1,
co_pageSize: 100,
co_totalPage: 0,
//
ss_pageIndex: 1,
ss_pageSize: 100,
ss_totalPage: 0,
//BOM
pp_pageIndex: 1,
pp_pageSize: 100,
pp_totalPage: 0,
dataListLoading: false,
currentRow:'',
columnList1:[
@ -1822,6 +1857,8 @@
},
chooseSOSModalFlag: false,
chooseSOSData: {
page: 1,
limit: 100,
orderno: '',
seqno: '',
sResourceid: '',
@ -1857,6 +1894,8 @@
chooseSOSList: [],
choosePartModalFlag: false,
choosePartData: {
page: 1,
limit: 100,
site: '',
sourceBu: '',
partNo: '',
@ -2204,6 +2243,7 @@
this.getTableUserColumn(this.$route.meta.menuId+'table6',6)
},
methods: {
saveIssueNoOrderDetail,
//
async getTableUserColumn(tableId, columnId) {
let queryTableUser = {
@ -2554,11 +2594,11 @@
//
this.orderDetailData = {
orderno: '',
seqno: '',
orderNo: '',
seqNo: '',
operationNo: '',
locationNo: '',
qtyrequired: '',
qtyRequired: '',
issureQty: 0,
partDesc: '',
partNo: '',
@ -2573,6 +2613,7 @@
this.saveOrderDetailFlag = true
},
//
editOrderDetail(){
//
@ -2583,11 +2624,33 @@
return false
}
//
this.$message.warning('编辑功能待实现');
},
saveOrderDetail(){
saveIssueNoOrderDetail(){
//
// BOM
if (this.orderDetailData.materialType === 'BOM物料') {
if (!this.orderDetailData.orderNo ) {
this.$alert('请选择工单或者派工单!', '提示', {
confirmButtonText: '确定'
})
return false
}
if (!this.orderDetailData.itemNo) {
this.$alert('请选择工序!', '提示', {
confirmButtonText: '确定'
})
return false
}
//BOM
if (this.orderDetailData.issureQty > this.orderDetailData.qtyRequired){
this.$alert('领取数量不可大于工单/派工数量!', '提示', {
confirmButtonText: '确定'
})
return false
}
}
if (!this.orderDetailData.needDate) {
this.$alert('请选择要求发料时间!', '提示', {
confirmButtonText: '确定'
@ -2602,53 +2665,74 @@
return false
}
// API
let inData = {
site: this.currentRow.site,
bu: this.currentRow.bu,
notifyNo: this.currentRow.notifyNo,
orderno: this.orderDetailData.orderNo,
seqno: this.orderDetailData.seqNo,
operationNo: this.orderDetailData.operationNo,
locationNo: this.orderDetailData.locationNo,
qtyrequired: this.orderDetailData.qtyRequired,
materialType: this.orderDetailData.materialType,
sOOrderNo: this.orderDetailData.orderNo,
seqNo: this.orderDetailData.seqNo,
fGPartNo: this.orderDetailData.partNo,
opsItemNo: this.orderDetailData.itemNo,
issureQty: this.orderDetailData.issureQty,
needDate: this.orderDetailData.needDate,
outWorkOrderFlag: 'N',
username: this.$store.state.user.name,
//
itemDesc: this.orderDetailData.itemDesc,
partDesc: this.orderDetailData.partDesc,
partNo: this.orderDetailData.partNo,
resourceDesc: this.orderDetailData.resourceDesc,
resourceId: this.orderDetailData.resourceId,
itemDesc: this.orderDetailData.itemDesc,
itemNo: this.orderDetailData.itemNo,
workCenterNo: this.orderDetailData.workCenterNo,
needDate: this.orderDetailData.needDate,
username: this.$store.state.user.name,
qtyrequired: this.orderDetailData.qtyRequired
}
// API
// API
this.$message.success('保存成功')
this.saveOrderDetailFlag = false
// API
saveIssueNoOrderDetail(inData).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '保存成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
//
this.refreshCurrentTabTable()
//
this.saveOrderDetailFlag = false
//
this.orderDetailData = {
orderno: '',
seqno: '',
operationNo: '',
locationNo: '',
qtyrequired: '',
issureQty: 0,
partDesc: '',
partNo: '',
resourceId: '',
resourceDesc: '',
itemDesc: '',
itemNo: 0,
workCenterNo: '',
needDate: '',
materialType: 'BOM物料'
}
//
this.refreshCurrentTabTable()
//
this.orderDetailData = {
orderNo: '',
seqNo: '',
operationNo: '',
locationNo: '',
qtyRequired: '',
issureQty: 0,
partDesc: '',
partNo: '',
resourceId: '',
resourceDesc: '',
itemDesc: '',
itemNo: 0,
workCenterNo: '',
needDate: '',
materialType: 'BOM物料'
}
} else {
this.$alert(data.msg || '保存失败', '错误', {
confirmButtonText: '确定'
})
}
}).catch(error => {
console.error('保存派工单明细失败:', error)
this.$alert('保存失败,请稍后重试', '错误', {
confirmButtonText: '确定'
})
})
},
@ -2689,9 +2773,6 @@
return ''
},
onMaterialTypeChange(value) {
//
this.orderDetailData.orderNo = '';
@ -2709,27 +2790,7 @@
this.orderDetailData.issureQty = 0;
},
searchSOSRouting() {
// API
this.$message.warning('正在查询派工单信息...');
getSOScheduledRoutingListForIssure(this.chooseSOSData).then(({data}) => {
if (data.code === 0) {
this.chooseSOSList = data.rows;
if (this.chooseSOSList.length === 0) {
this.$message.warning('未查询到符合条件的派工单');
}
} else {
this.$message.error(data.msg || '查询失败');
}
}).catch(error => {
console.error('查询派工单失败:', error);
this.$message.error('查询失败,请稍后重试');
});
},
//
openChooseSOSModal() {
//
if (!this.currentRow || !this.currentRow.notifyNo) {
@ -2739,37 +2800,77 @@
return false
}
this.ss_totalPage= 0;
//
this.chooseSOSData = {
page: 1,
limit: 100,
site: this.currentRow.site,
bu: this.currentRow.bu,
orderno: '',
seqno: '',
orderNo: '',
seqNo: '',
sResourceid: '',
startDate: this.dayjs().format('YYYY-MM-DD'),
endDate: this.dayjs().format('YYYY-MM-DD'),
}
//
this.chooseSOSList = []
//
this.chooseSOSModalFlag = true
},
searchSOSRouting() {
this.chooseSOSData.limit = this.ss_pageSize
this.chooseSOSData.page = this.ss_pageIndex
// API
getSOScheduledRoutingListForIssureByPaging(this.chooseSOSData).then(({data}) => {
if (data.code === 0) {
this.chooseSOSList = data.page.list;
if (this.chooseSOSList.length === 0) {
this.$message.warning('未查询到符合条件的派工单');
}
this.ss_pageIndex = data.page.currPage
this.ss_pageSize = data.page.pageSize
this.ss_totalPage = data.page.totalCount
} else {
//
this.chooseSOSList = []
this.$message.error(data.msg || '查询失败');
}
}).catch(error => {
//
this.chooseSOSList = []
console.error('查询派工单失败:', error);
this.$message.error('查询失败,请稍后重试');
});
},
//
ss_sizeChangeHandle(val) {
this.ss_pageSize = val
this.ss_pageIndex = 1
this.searchSOSRouting()
},
//
ss_currentChangeHandle(val) {
this.ss_pageIndex = val
this.searchSOSRouting()
},
chooseSOS(row) {
//
this.chooseSOSModalFlag = false
//
this.orderDetailData.orderNo = row.orderno || row.orderNo || '';
this.orderDetailData.seqNo = row.seqno || row.seqNo || '';
this.orderDetailData.operationNo = row.operationNo || row.operation || '';
this.orderDetailData.locationNo = row.sResourceid || row.locationNo || '';
this.orderDetailData.qtyRequired = row.qtyrequired || row.qtyToIssue || '';
this.orderDetailData.orderNo = row.orderno || '';
this.orderDetailData.seqNo = row.seqno || '';
this.orderDetailData.itemNo = row.itemno || '';
this.orderDetailData.itemDesc = row.itemDesc || '';
this.orderDetailData.resourceId = row.sResourceid || '';
this.orderDetailData.resourceDesc = row.resourceDesc || '';
this.orderDetailData.qtyRequired = row.qtyrequired || '';
this.orderDetailData.partDesc = row.partDesc || '';
this.orderDetailData.partNo = row.partNo || row.fGPartNo || '';
this.orderDetailData.workCenterNo = row.workCenterNo || '';
this.orderDetailData.needDate = row.startDate || this.dayjs().format('YYYY-MM-DD HH:mm:ss');
this.orderDetailData.partNo = row.partNo || '';
this.orderDetailData.workCenterNo = row.sWorkcenterno || '';
this.orderDetailData.needDate = this.dayjs().format('YYYY-MM-DD HH:mm:ss');
//
if (row.issueType === '非BOM物料') {
@ -2792,7 +2893,7 @@
})
return false
}
this.co_totalPage= 0;
//
this.chooseOrderData = {
page: 1,
@ -2881,7 +2982,8 @@
//
this.chooseOperationList = []
//
this.searchOperation();
//
this.chooseOperationModalFlag = true
},
@ -2939,7 +3041,7 @@
//
this.chooseResourceList = []
this.searchResource();
//
this.chooseResourceModalFlag = true
},
@ -3000,26 +3102,46 @@
//
this.choosePartModalFlag = true
this.searchPartModel()
},
//
searchPartModel() {
this.choosePartData.limit = this.pp_pageSize
this.choosePartData.page = this.pp_pageIndex
// API
this.$message.warning('正在查询物料信息...');
getPartList(this.choosePartData).then(({data}) => {
getPartListByPaging(this.choosePartData).then(({data}) => {
if (data.code === 0) {
this.choosePartList = data.rows;
this.choosePartList = data.page.list;
if (this.choosePartList.length === 0) {
this.$message.warning('未查询到符合条件的物料');
}
this.pp_pageIndex = data.page.currPage
this.pp_pageSize = data.page.pageSize
this.pp_totalPage = data.page.totalCount
} else {
//
this.choosePartList = []
this.$message.error(data.msg || '查询失败');
}
}).catch(error => {
//
this.choosePartList = []
console.error('查询物料失败:', error);
this.$message.error('查询失败,请稍后重试');
});
},
//
pp_sizeChangeHandle(val) {
this.pp_pageSize = val
this.pp_pageIndex = 1
this.searchPartModel()
},
//
pp_currentChangeHandle(val) {
this.pp_pageIndex = val
this.searchPartModel()
},
//
choosePart(row) {
//

Loading…
Cancel
Save