ruanqi 1 year ago
parent
commit
d813b2b12b
  1. 13
      src/api/orderIssure/soIssueNotify.js
  2. 334
      src/views/modules/orderIssure/soIssueNotify/newSoIssueNotify.vue
  3. 816
      src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue

13
src/api/orderIssure/soIssueNotify.js

@ -10,3 +10,16 @@ export const getSOScheduledRoutingListForIssure= data => createAPI(`/orderIssure
export const getSOSBOMForIssure= data => createAPI(`/orderIssure/issureNotify/getSOSBOMForIssure`,'post',data) export const getSOSBOMForIssure= data => createAPI(`/orderIssure/issureNotify/getSOSBOMForIssure`,'post',data)
export const saveSOIssueNotifyOrderList= data => createAPI(`/orderIssure/issureNotify/saveSOIssueNotifyOrderList`,'post',data) export const saveSOIssueNotifyOrderList= data => createAPI(`/orderIssure/issureNotify/saveSOIssueNotifyOrderList`,'post',data)
export const saveMaterialDetail= data => createAPI(`/orderIssure/issureNotify/saveMaterialDetail`,'post',data) export const saveMaterialDetail= data => createAPI(`/orderIssure/issureNotify/saveMaterialDetail`,'post',data)
export const deleteNotifySOS= data => createAPI(`/orderIssure/issureNotify/deleteNotifySOS`,'post',data)
export const deleteNotify= data => createAPI(`/orderIssure/issureNotify/deleteNotify`,'post',data)
export const xiadaNotify= data => createAPI(`/orderIssure/issureNotify/xiadaNotify`,'post',data)
export const searchNotifyHeader= data => createAPI(`/orderIssure/issureNotify/searchNotifyHeader`,'post',data)
export const searchNotifyOrderList= data => createAPI(`/orderIssure/issureNotify/searchNotifyOrderList`,'post',data)
export const searchNotifyMaterialList= data => createAPI(`/orderIssure/issureNotify/searchNotifyMaterialList`,'post',data)

334
src/views/modules/orderIssure/soIssueNotify/newSoIssueNotify.vue

@ -5,8 +5,8 @@
<el-col :span="20"> <el-col :span="20">
<el-button v-if="notifyNo===''" @click="addNotify()" class="yzzButtonAn">新建申请单</el-button> <el-button v-if="notifyNo===''" @click="addNotify()" class="yzzButtonAn">新建申请单</el-button>
<el-button v-if="notifyNo!=''" type="primary" @click="chooseSOSModal()" class="yzzButtonAn">选择派工单</el-button> <el-button v-if="notifyNo!=''" type="primary" @click="chooseSOSModal()" class="yzzButtonAn">选择派工单</el-button>
<el-button v-if="notifyNo!=''" type="primary" @click="addModal()" class="yzzButtonAn">下达申请单</el-button>
<el-button v-if="notifyNo!=''" type="primary" @click="addModal()" class="yzzButtonAn">删除申请单</el-button>
<el-button v-if="notifyNo!=''" type="primary" @click="xiadaNotify()" class="yzzButtonAn">下达申请单</el-button>
<el-button v-if="notifyNo!=''" type="primary" @click="deleteNotify()" class="yzzButtonAn">删除申请单</el-button>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<span @click="favoriteFunction()"> <span @click="favoriteFunction()">
@ -52,6 +52,16 @@
<el-input v-model="notifyData.enteredDate" disabled ></el-input> <el-input v-model="notifyData.enteredDate" disabled ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4">
<el-form-item :label="'要求发料日期'" >
<el-date-picker
v-model="notifyData.planIssueDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row :gutter="20" v-if="notifyNo!=''"> <el-row :gutter="20" v-if="notifyNo!=''">
<el-col :span="24"> <el-col :span="24">
@ -96,7 +106,7 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a type="text" size="small" @click="enterSOSDetail(scope.row)">选择</a> <a type="text" size="small" @click="enterSOSDetail(scope.row)">选择</a>
<a type="text" size="small" @click="deleteGroup(scope.row)">删除</a>
<a type="text" size="small" @click="deleteNotifySOS(scope.row)">删除</a>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -181,15 +191,61 @@
width="60" width="60"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a type="text" size="small" @click="saveSOS(scope.row)">选择</a>
<a type="text" size="small" @click="chooseSOS(scope.row)">选择</a>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-footer style="height:40px;margin-top: 10px;text-align:center"> <el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="saveData()">保存</el-button>
<el-button type="primary" @click="seqNoModalFlag = false">关闭</el-button> <el-button type="primary" @click="seqNoModalFlag = false">关闭</el-button>
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<el-dialog title="保存派工单" :close-on-click-modal="false" v-drag :visible.sync="saveSeqNoModalFlag" width="800px">
<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 :label="'生产订单'" >
<el-input v-model="notifyOrderData.orderno" disabled ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'派工单号'" >
<el-input v-model="notifyOrderData.seqno" disabled ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'机台'" >
<el-input v-model="notifyOrderData.sResourceid" disabled ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'派工数量'" >
<el-input v-model="notifyOrderData.qtyrequired" disabled ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item :label="'物料'" >
<el-input v-model="notifyOrderData.orderno" disabled ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'物料名称'" >
<el-input v-model="notifyOrderData.seqno" disabled ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'此次领料数量'" >
<el-input v-model="notifyOrderData.issureQty" type="number" ></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="saveSOS()">保存</el-button>
<el-button type="primary" @click="saveSeqNoModalFlag=false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="申请明细" :close-on-click-modal="false" v-drag :visible.sync="materialModalFlag" width="800px"> <el-dialog title="申请明细" :close-on-click-modal="false" v-drag :visible.sync="materialModalFlag" width="800px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
@ -211,6 +267,7 @@
:height="400" :height="400"
:data="sobomList" :data="sobomList"
border border
v-loading="bomLoadFlag"
style="width: 100%;"> style="width: 100%;">
<el-table-column <el-table-column
v-for="(item,index) in columnList3" :key="index" v-for="(item,index) in columnList3" :key="index"
@ -249,9 +306,7 @@
<script> <script>
import { import {
eamGroupSearch, eamGroupSearch,
eamGroupSave,
eamGroupEdit,
eamGroupDelete,
getSiteAndBuByUserName getSiteAndBuByUserName
} from "@/api/eam/eam.js" } from "@/api/eam/eam.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
@ -266,6 +321,10 @@
getSOSBOMForIssure, getSOSBOMForIssure,
saveSOIssueNotifyOrderList, saveSOIssueNotifyOrderList,
saveMaterialDetail, saveMaterialDetail,
deleteNotifySOS,
deleteNotify,
xiadaNotify,
}from "@/api/orderIssure/soIssueNotify.js" }from "@/api/orderIssure/soIssueNotify.js"
export default { export default {
watch: { watch: {
@ -293,6 +352,7 @@
userName:'', userName:'',
userDisplay:'', userDisplay:'',
remark:'', remark:'',
planIssueDate:'',
}, },
// //
favorite: false, favorite: false,
@ -317,6 +377,16 @@
orderno:'', orderno:'',
seqno:'', seqno:'',
}, },
notifyOrderData:{
partNo:'',
orderno:'',
itemno:'',
seqno:'',
partDesc:'',
qtyrequired:'',
sResourceid:'',
issureQty:'',
},
seqNoData:{ seqNoData:{
site: this.$store.state.user.site, site: this.$store.state.user.site,
orderno:'', orderno:'',
@ -337,6 +407,8 @@
seqNoModalFlag:false, seqNoModalFlag:false,
materialModalFlag:false, materialModalFlag:false,
modalDisableFlag:false, modalDisableFlag:false,
saveSeqNoModalFlag:false,
bomLoadFlag:false,
modalData:{ modalData:{
flag:'', flag:'',
bu: '', bu: '',
@ -559,7 +631,7 @@
columnProp: 'qtyrequired', columnProp: 'qtyrequired',
headerAlign: "center", headerAlign: "center",
align: "right", align: "right",
columnLabel: '派工数量',
columnLabel: '派工数量',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
@ -577,7 +649,7 @@
columnProp: 'qtyreported', columnProp: 'qtyreported',
headerAlign: "center", headerAlign: "center",
align: "right", align: "right",
columnLabel: '报工数量',
columnLabel: '报工数量',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
@ -753,13 +825,13 @@
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 701001002, functionId: 701001002,
serialNumber: '701001002Table3QtyRequired',
serialNumber: '701001002Table3QtyOnHand',
tableId: "701001002Table3", tableId: "701001002Table3",
tableName: "领料申请BOM子表", tableName: "领料申请BOM子表",
columnProp: 'qtyRequired',
columnProp: 'qtyOnHand',
headerAlign: "center", headerAlign: "center",
align: "right", align: "right",
columnLabel: '已发数量',
columnLabel: '现场库存数量',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
@ -857,9 +929,15 @@
} }
getUserNotifyNo(inData).then(({data})=>{ getUserNotifyNo(inData).then(({data})=>{
if (data.code === 0) { if (data.code === 0) {
this.notifyNo = data.row.notifyNo
this.notifyData=data.row
this.getNotifyNoDetail();
if(data.row!=null){
this.notifyNo = data.row.notifyNo
this.notifyData=data.row
this.getNotifyNoDetail();
}else {
this.notifyNo =''
this.notifyData=null
this.dataList=[]
}
}else { }else {
this.notifyNo ='' this.notifyNo =''
this.notifyData=null this.notifyData=null
@ -895,7 +973,7 @@
} }
}) })
}, },
saveSOS(row){
chooseSOS(row){
if(this.dataList.length>0){ if(this.dataList.length>0){
let stop=false let stop=false
for (let i = 0; i < this.dataList.length; i++) { for (let i = 0; i < this.dataList.length; i++) {
@ -904,7 +982,39 @@
} }
} }
if(stop){ if(stop){
this.$message.warning('已经选择过此派工单,请返回点击明细直接操作!')
this.$alert('已经选择过此派工单,请返回点击明细直接操作!!', '提示', {
confirmButtonText: '确定'
})
return false
}
}
this.notifyOrderData.partNo=row.partNo
this.notifyOrderData.orderno=row.orderno
this.notifyOrderData.itemno=row.itemno
this.notifyOrderData.seqno=row.seqno
this.notifyOrderData.partDesc=row.partDesc
this.notifyOrderData.qtyrequired=row.qtyrequired
this.notifyOrderData.sResourceid=row.sResourceid
this.notifyOrderData.issureQty=''
this.saveSeqNoModalFlag=true
},
saveSOS(){
if(this.notifyOrderData.issureQty==null||this.notifyOrderData.issureQty==''||this.notifyOrderData.issureQty<=0){
this.$message.warning('请填写领取数量!')
return false
}
let row=this.notifyOrderData
if(this.dataList.length>0){
let stop=false
for (let i = 0; i < this.dataList.length; i++) {
if(this.dataList[i].seqNo==row.seqno){
stop=true
}
}
if(stop){
this.$alert('已经选择过此派工单,请返回点击明细直接操作!!', '提示', {
confirmButtonText: '确定'
})
return false return false
} }
} }
@ -920,10 +1030,12 @@
sOOrderNo:row.orderno, sOOrderNo:row.orderno,
opsItemNo:row.itemno, opsItemNo:row.itemno,
seqNo:row.seqno, seqNo:row.seqno,
issureQty:row.issureQty,
outWorkOrderFlag:'N', outWorkOrderFlag:'N',
} }
saveSOIssueNotifyOrderList(inData).then(({data})=>{ saveSOIssueNotifyOrderList(inData).then(({data})=>{
if (data.code === 0) { if (data.code === 0) {
this.saveSeqNoModalFlag=false
this.getNotifyNoDetail() this.getNotifyNoDetail()
this.enterSOS(row); this.enterSOS(row);
}else { }else {
@ -946,6 +1058,14 @@
this.enterSOS(rows) this.enterSOS(rows)
}, },
enterSOS(row){ enterSOS(row){
this.seqNoModalFlag = false
this.materialModalFlag=true
this.sobomList = []
this.sobomData={
orderno:row.orderno,
seqno:row.seqno,
}
this.bomLoadFlag=true
let inData={ let inData={
site:this.$store.state.user.site, site:this.$store.state.user.site,
notifyNo:this.notifyNo, notifyNo:this.notifyNo,
@ -955,14 +1075,10 @@
itemno:row.itemno, itemno:row.itemno,
} }
getSOSBOMForIssure(inData).then(({data})=>{ getSOSBOMForIssure(inData).then(({data})=>{
this.bomLoadFlag=false
if (data.code === 0) { if (data.code === 0) {
this.sobomList = data.rows this.sobomList = data.rows
this.sobomData={
orderno:row.orderno,
seqno:row.seqno,
}
this.seqNoModalFlag = false
this.materialModalFlag=true
} }
}) })
}, },
@ -998,7 +1114,9 @@
} }
let materialList=this.sobomList.filter(item => item.qtyToIssue > 0) let materialList=this.sobomList.filter(item => item.qtyToIssue > 0)
if(materialList.length==0){ if(materialList.length==0){
this.$message.warning('没有需要保存的内容!')
this.$alert('没有需要保存的内容!', '提示', {
confirmButtonText: '确定'
})
return false return false
} }
saveMaterialDetail(materialList).then(({data})=>{ saveMaterialDetail(materialList).then(({data})=>{
@ -1087,70 +1205,82 @@
return s return s
}, },
//
getDataList () {
eamGroupSearch(this.searchData).then(({data}) => {
// //
// getDataList () {
// eamGroupSearch(this.searchData).then(({data}) => {
// if (data.code === 0) {
// this.dataList = data.page.list
// }
// })
// },
//
// sizeChangeHandle (val) {
// this.pageSize = val
// this.pageIndex = 1
// this.getDataList()
// },
// //
// currentChangeHandle (val) {
// this.pageIndex = val
// this.getDataList()
// },
xiadaNotify() {
if(this.dataList.length==0){
this.$alert('没有明细记录无法下达!!', '提示', {
confirmButtonText: '确定'
})
return false
}
if(this.notifyData.planIssueDate==null||this.notifyData.planIssueDate==''){
this.$alert('请选择要求发料日期!!', '提示', {
confirmButtonText: '确定'
})
return false
}
xiadaNotify(this.notifyData).then(({data})=>{
if (data.code === 0) { if (data.code === 0) {
this.dataList = data.page.list
this.getUserNotifyNo()
this.$message.success( '操作成功')
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
} }
}) })
}, },
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
addModal () {
this.modalData = {
flag: '1',
bu: this.userBuList[0].buNo,
site: this.$store.state.user.site,
groupID: '',
groupDesc: '',
active: 'Y',
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name,
deleteNotify() {
if(this.dataList.length>0){
this.$alert('请先删除已经申请的明细记录!!', '提示', {
confirmButtonText: '确定'
})
return false
} }
this.modalDisableFlag = false
this.seqNoModalFlag = true
deleteNotify(this.notifyData).then(({data})=>{
if (data.code === 0) {
this.getUserNotifyNo()
this.$message.success( '操作成功')
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}, },
updateModal (row) {
this.modalData = {
flag: '2',
site: row.site,
bu: row.site + '_' + row.buNo,
groupID: row.groupID,
groupDesc: row.groupDesc,
active: row.active,
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.seqNoModalFlag = true
},
// //
deleteGroup (row) {
this.$confirm(`是否删除这个分组?`, '提示', {
deleteNotifySOS (row) {
this.$confirm(`是否删除这个派工单的申请信息?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
eamGroupDelete(row).then(({data}) => {
if (data && data.code === '0') {
this.getDataList()
deleteNotifySOS(row).then(({data}) => {
if (data && data.code === 0) {
this.getNotifyNoDetail()
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
@ -1167,59 +1297,7 @@
}) })
}, },
saveData () {
if (this.modalData.bu === '' || this.modalData.bu == null) {
this.$message.warning('请选择BU!')
return
}
if (this.modalData.groupID === '' || this.modalData.groupID == null) {
this.$message.warning('请输入分组编码!')
return
}
if (this.modalData.groupDesc === '' || this.modalData.groupDesc == null) {
this.$message.warning('请输入分组名称!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('选择是否在用!')
return
}
if (this.modalData.flag === '1') {
eamGroupSave(this.modalData).then(({data}) => {
if (data && data.code === '0') {
this.getDataList()
this.seqNoModalFlag=false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
} else {
eamGroupEdit(this.modalData).then(({data}) => {
if (data && data.code === '0') {
this.getDataList()
this.seqNoModalFlag=false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
},
// //
async getTableUserColumn(tableId, columnId) { async getTableUserColumn(tableId, columnId) {

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

@ -0,0 +1,816 @@
<template>
<div class="mod-config">
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
<el-form :inline="true" label-position="top" style="margin-top: 0px">
<el-form-item :label="'申请单号'">
<el-input v-model="searchData.notifyNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'申请账号'">
<el-input v-model="searchData.userName" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'申请单日期'">
<el-date-picker
style="width: 120px"
v-model="searchData.startDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item style="margin-top: 23px;">
<label style="margin-left: 0px;font-size: 19px">&#10142</label>
</el-form-item>
<el-form-item :label="' '">
<el-date-picker
style="width: 120px"
v-model="searchData.endDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="' '">
<el-button type="primary" @click="searchTable()">查询</el-button>
<download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ '导出' }}
</download-excel>
</el-form-item>
</el-form>
</el-form>
<el-table
:data="dataList"
@row-click="changeData"
:height="height"
border
highlight-current-row
ref="mainTable"
v-loading="dataListLoading"
style="width: 100%; ">
<el-table-column
v-for="(item,index) in columnList1" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- width="150"-->
<!-- fixed="left"-->
<!-- label="操作">-->
<!-- <template slot-scope="scope">-->
<!-- <a type="text" size="small" @click="updateModel(scope.row)">编辑</a>-->
<!-- <a type="text" size="small" @click="deleteData(scope.row)">删除</a>-->
<!-- <a type="text" size="small" @click="scanRoll(scope.row)">扫描</a>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 1000]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick">
<el-tab-pane label="派工单明细" name="detail">
<el-table
:data="dataList2"
:height="height"
border
v-loading="dataListLoading"
style="width: 100%; ">
<el-table-column
v-for="(item,index) in columnList2" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="材料明细" name="sub">
<el-table
:data="dataList3"
:height="height"
border
v-loading="dataListLoading"
style="width: 100%; ">
<el-table-column
header-align="center"
align="center"
width="80"
fixed="left"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="printLabel(scope.row)">打印标签</a>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in columnList3" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
searchNotifyHeader
,searchNotifyOrderList
,searchNotifyMaterialList
}from "@/api/orderIssure/soIssueNotify.js"
import Chooselist from '@/views/modules/common/Chooselist'
export default {
components: {
Chooselist
},
data() {
return {
height:200,
modelFlag:false,
activeName: 'detail',
dataList: [],
dataList2: [],
dataList3: [],
addOrUpdateVisible:false,
searchData: {
page: 1,
limit: 100,
site:this.$store.state.user.site,
userName: '',
notifyNo: '',
startDate: '',
endDate: '',
},
exportList:[],
pageIndex: 1,
pageSize: 100,
totalPage: 0,
dataListLoading: false,
currentRow:'',
headerData:'',
columnList1:[
{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table1NotifyNo',
tableId: "701002Table1",
tableName: "领料申请主表",
columnProp: "notifyNo",
headerAlign: "center",
align: "center",
columnLabel: "发料单号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table1NotifyDate',
tableId: "701002Table1",
tableName: "领料申请主表",
columnProp: "notifyDate",
headerAlign: "center",
align: "center",
columnLabel: "申请时间",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table1UserName',
tableId: "701002Table1",
tableName: "领料申请主表",
columnProp: "userName",
headerAlign: "center",
align: "left",
columnLabel: "申请账号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table1UserName',
tableId: "701002Table1",
tableName: "领料申请主表",
columnProp: "userDisplay",
headerAlign: "center",
align: "left",
columnLabel: "申请人姓名",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table1IssueFlag',
tableId: "701002Table1",
tableName: "领料申请主表",
columnProp: "issueFlag",
headerAlign: "center",
align: "center",
columnLabel: "是否领料",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table1IssueResult',
tableId: "701002Table1",
tableName: "领料申请主表",
columnProp: "issueResult",
headerAlign: "center",
align: "left",
columnLabel: "领料结果",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table1PlanIssueDate',
tableId: "701002Table1",
tableName: "领料申请主表",
columnProp: "planIssueDate",
headerAlign: "center",
align: "left",
columnLabel: "计划领料日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table1RealIssueDate',
tableId: "701002Table1",
tableName: "领料申请主表",
columnProp: "realIssueDate",
headerAlign: "center",
align: "left",
columnLabel: "实际领料日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table1Status',
tableId: "701002Table1",
tableName: "领料申请主表",
columnProp: "status",
headerAlign: "center",
align: "left",
columnLabel: "状态",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table1Remark',
tableId: "701002Table1",
tableName: "领料申请主表",
columnProp: "remark",
headerAlign: "center",
align: "left",
columnLabel: "备注",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200
},
],
columnList2:[
{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table2ItemNo',
tableId: "701002Table2",
tableName: "申请单派工单明细表",
columnProp: "itemNo",
headerAlign: "center",
align: "right",
columnLabel: "申请单序号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table2SOOrderNo',
tableId: "701002Table2",
tableName: "申请单派工单明细表",
columnProp: "sOOrderNo",
headerAlign: "center",
align: "left",
columnLabel: "生产订单",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table2OpsItemNo',
tableId: "701002Table2",
tableName: "申请单派工单明细表",
columnProp: "opsItemNo",
headerAlign: "center",
align: "right",
columnLabel: "工序",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table2ItemDesc',
tableId: "701002Table2",
tableName: "申请单派工单明细表",
columnProp: "itemDesc",
headerAlign: "center",
align: "left",
columnLabel: "工序名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table2SeqNo',
tableId: "701002Table2",
tableName: "申请单派工单明细表",
columnProp: "seqNo",
headerAlign: "center",
align: "left",
columnLabel: "派工单号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150
}, {
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table2FGPartNo',
tableId: "701002Table2",
tableName: "申请单派工单明细表",
columnProp: "fGPartNo",
headerAlign: "center",
align: "left",
columnLabel: "派工单物料",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
}, {
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table2PartDesc',
tableId: "701002Table2",
tableName: "申请单派工单明细表",
columnProp: "partDesc",
headerAlign: "center",
align: "left",
columnLabel: "物料名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
}, {
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table2IssureQty',
tableId: "701002Table2",
tableName: "申请单派工单明细表",
columnProp: "issureQty",
headerAlign: "center",
align: "right",
columnLabel: "发料数量",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
],
columnList3:[
{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table3ItemNo',
tableId: "701002Table3",
tableName: "申请单材料明细表",
columnProp: "itemNo",
headerAlign: "center",
align: "right",
columnLabel: "申请单序号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table3SOOrderNo',
tableId: "701002Table3",
tableName: "申请单材料明细表",
columnProp: "orderNo",
headerAlign: "center",
align: "left",
columnLabel: "生产订单",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table3OpsItemNo',
tableId: "701002Table3",
tableName: "申请单材料明细表",
columnProp: "opsItemNo",
headerAlign: "center",
align: "right",
columnLabel: "工序",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table3SeqNo',
tableId: "701002Table3",
tableName: "申请单材料明细表",
columnProp: "seqNo",
headerAlign: "center",
align: "left",
columnLabel: "派工单号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table3BOMItemNo',
tableId: "701002Table3",
tableName: "申请单材料明细表",
columnProp: "bOMItemNo",
headerAlign: "center",
align: "right",
columnLabel: "BOM序号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table3ComponentPartNo',
tableId: "701002Table3",
tableName: "申请单材料明细表",
columnProp: "componentPartNo",
headerAlign: "center",
align: "center",
columnLabel: "材料编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table3PartDesc',
tableId: "701002Table3",
tableName: "申请单材料明细表",
columnProp: "partDesc",
headerAlign: "center",
align: "left",
columnLabel: "材料名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 130
},{
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: '701002Table3QtyToIssue',
tableId: "701002Table3",
tableName: "申请单材料明细表",
columnProp: "qtyToIssue",
headerAlign: "center",
align: "right",
columnLabel: "申请数量",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
],
dataRole: {
partTypeDesc: [
{
required: true,
message: ' ',
trigger: 'change'
}
],
partName: [
{
required: true,
message: ' ',
trigger: 'change'
}
],
},
// start
exportData: [],
exportName: '发料申请单'+this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ["发料申请单"],
exportFooter: [],
// end
}
},
mounted () {
this.$nextTick(() => {
this.height = (window.innerHeight- 260) / 2
})
},
methods: {
// S
getBaseList (val, type) {
this.tagNo = val
this.tagNo1 = type
this.$nextTick(() => {
let strVal = ''
if (val === 1013) {
if(type==23) {
strVal = this.modelData.supplierId
}
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData (val) {
if (this.tagNo === 23) {
if(this.tagNo1==1) {
this.modelData.supplierId = val.SupplierID
this.modelData.supplierName = val.SupplierName
}
}
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.searchTable()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.searchTable()
},
tabClick (tab, event) {
//
this.refreshCurrentTabTable()
},
changeData(row){
this.currentRow = JSON.parse(JSON.stringify(row));
this.headerData=row;
this.refreshCurrentTabTable ();
},
refreshCurrentTabTable(){
if(this.currentRow===''||this.currentRow===null){
this.currentRow={site:'',notifyNo:''}
}
if(this.activeName==='detail'){
searchNotifyOrderList(this.currentRow).then(({data}) => {
//
if (data && data.code == 0) {
this.dataList2 = data.rows
} else {
this.dataList2 = [];
}
});
}else {
searchNotifyMaterialList(this.currentRow).then(({data}) => {
//
if (data && data.code == 0) {
this.dataList3 = data.rows
} else {
this.dataList3 = [];
}
});
}
},
searchTable(){
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
searchNotifyHeader(this.searchData).then(({data}) => {
//
if (data && data.code == 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
if(this.dataList.length>0){
this.$refs.mainTable.setCurrentRow(this.dataList[0]);
this.changeData(this.dataList[0])
}else {
this.changeData(null)
}
} else {
this.dataList = [];
}
});
},
//excel
//excel
async createExportData() {
this.searchData.limit = -1
this.searchData.page = 1
await searchNotifyHeader(this.searchData).then(({data}) => {
this.exportList= data.page.list;
})
return this.exportList;
},
startDownload() {
// this.exportData = this.dataList
},
finishDownload() {
},
fields() {
let json = "{"
this.columnList1.forEach((item, index) => {
if (index == this.columnList1.length - 1) {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
} else {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
}
})
json += "}"
let s = eval("(" + json + ")")
return s
},
},
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save