|
|
<template> <div class="mod-config yzzInput"> <el-form :inline="true" label-position="top" style="margin-top: -0px"> <el-row :gutter="20"> <el-col :span="20"> <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="xiadaNotifyModel()" class="yzzButtonAn">下达申请单</el-button> <el-button v-if="notifyNo!=''" type="primary" @click="deleteNotify()" class="yzzButtonAn">删除申请单</el-button> <el-button v-if="notifyNo!=''" type="primary" @click="updateBuModel()" class="yzzButtonAn">修改BU</el-button> <el-button v-if="notifyNo!=''" type="primary" @click="noBomModel()" class="yzzButtonAn">非BOM物料</el-button> <el-button v-if="notifyNo!=''" type="primary" @click="noControlModel()" class="yzzButtonAn">不管控物料</el-button> </el-col> <el-col :span="4"> <span @click="favoriteFunction()"> <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg> </span> </el-col> </el-row> <el-row :gutter="20" v-if="notifyNo!=''"> <el-col :span="2"> <el-form-item :label="'工厂编码'" > <el-input v-model="notifyData.site" disabled ></el-input> </el-form-item> </el-col> <el-col :span="2"> <el-form-item :label="'BU'" > <el-input v-model="notifyData.bu" disabled ></el-input> </el-form-item> </el-col> <el-col :span="2"> <el-form-item :label="'申请单号'" > <el-input v-model="notifyData.notifyNo" disabled ></el-input> </el-form-item> </el-col> <el-col :span="2"> <el-form-item :label="'申请账号'" > <el-input v-model="notifyData.userName" disabled ></el-input> </el-form-item> </el-col> <el-col :span="3"> <el-form-item :label="'申请时间'" > <el-input v-model="notifyData.enteredDate" disabled ></el-input> </el-form-item> </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 :gutter="20" v-if="notifyNo!=''"> <el-col :span="11"> <el-form-item :label="'备注'" > <el-input v-model="notifyData.remark" ></el-input> </el-form-item> </el-col> </el-row>
</el-form>
<el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" v-if="notifyNo!=''" type="border-card" > <el-tab-pane label="已申请派工单" name="sos"> <el-table :height="height" :data="dataList" border style="width: 100%;"> <el-table-column v-for="(item,index) in columnList" :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 fixed="right" header-align="center" align="center" width="100" label="操作"> <template slot-scope="scope"> <a type="text" size="small" @click="enterSOSDetail(scope.row)">物料</a> <a type="text" size="small" @click="deleteNotifySOS(scope.row)">删除</a> </template> </el-table-column> </el-table> </el-tab-pane> <el-tab-pane label="非BOM物料" name="noBom"> <el-table :data="dataList2" :height="height" border
style="width: 100%; "> <el-table-column v-for="(item,index) in columnList4" :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="noControl"> <el-table :data="dataList3" :height="height" border
style="width: 100%; "> <el-table-column v-for="(item,index) in columnList4" :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><!-- <el-pagination--><!-- @size-change="sizeChangeHandle"--><!-- @current-change="currentChangeHandle"--><!-- :current-page="pageIndex"--><!-- :page-sizes="[20, 50, 100, 200, 500]"--><!-- :page-size="pageSize"--><!-- :total="totalPage"--><!-- layout="total, sizes, prev, pager, next, jumper">--><!-- </el-pagination>-->
<el-dialog title="选择派工单" :close-on-click-modal="false" v-drag :visible.sync="seqNoModalFlag" width="1000px"> <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> <el-row :gutter="20"> <el-col :span="4"> <el-form-item :label="'生产订单'" > <el-input v-model="seqNoData.orderno" ></el-input> </el-form-item> </el-col> <el-col :span="4"> <el-form-item :label="'派工单号'" > <el-input v-model="seqNoData.seqno" ></el-input> </el-form-item> </el-col> <el-col :span="4"> <el-form-item > <span slot="label" style="" @click="getBaseList(515)"><a herf="#">机台</a></span>
<el-input v-model="seqNoData.sResourceid" ></el-input> </el-form-item> </el-col> <el-col :span="4"> <el-form-item > <span slot="label" style="" @click="getBaseList(216)"><a herf="#">加工中心</a></span> <el-input v-model="seqNoData.sWorkcenterno" ></el-input> </el-form-item> </el-col> <el-col :span="4"> <el-form-item :label="'派工日期'" > <el-date-picker style="width: 100%" v-model="seqNoData.startDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"> </el-date-picker> </el-form-item> </el-col> <el-col :span="4"> <el-form-item :label="'到'" > <el-date-picker style="width: 100%" v-model="seqNoData.endDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"> </el-date-picker> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="6"> <el-form-item > <el-button type="primary" @click="searchSOSRouting()" style="margin-top: 5px" class="">查询</el-button>
</el-form-item> </el-col> </el-row> </el-form> <el-table :height="400" :data="seqNoList" border 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-column fixed="left" header-align="center" align="center" width="60" label="操作"> <template slot-scope="scope"> <a type="text" size="small" @click="chooseSOS(scope.row)">选择</a> </template> </el-table-column> </el-table> <el-footer style="height:40px;margin-top: 10px;text-align:center"> <el-button type="primary" @click="seqNoModalFlag = false">关闭</el-button> </el-footer> </el-dialog> <el-dialog title="保存派工单" :close-on-click-modal="false" v-drag :visible.sync="saveSeqNoModalFlag" width="750px"> <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="18"> <el-form-item :label="'物料名称'" > <el-input v-model="notifyOrderData.seqno" disabled ></el-input> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="6"> <el-form-item :label="'要求发料时间'" > <el-date-picker style="width: 165px" v-model="notifyOrderData.needDate" type="datetime" value-format="yyyy-MM-dd HH:mm" placeholder="选择日期"> </el-date-picker> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="机台"><!-- <span slot="label" style="" @click="getBaseList(215)"><a herf="#">机台</a></span>--> <el-input v-model="notifyOrderData.locationNo" disabled ></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="'此次领料数量'" > <el-input-number v-model="notifyOrderData.issureQty" style="padding: 0;width: 100%" :controls="false" :step="0" :min="0" ></el-input-number> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="' '" > <el-button type="primary" @click="qtyAllForSeqNo()">全数领料</el-button> </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="变更BU" :close-on-click-modal="false" v-drag :visible.sync="changeBuFlag" width="350px"> <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> <el-row :gutter="20"> <el-col :span="12"> <el-form-item :label="'工厂编码'" > <el-input v-model="notifyData.site" disabled ></el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item :label="'申请单号'" > <el-input v-model="notifyData.notifyNo" disabled ></el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item :label="'BU'" > <el-select v-model="newBu" placeholder="请选择" style="width: 100%"> <el-option v-for = "i in buList" :key = "i.buNo" :label = "i.buNo+' - '+i.buDesc" :value = "i.buNo"> </el-option> </el-select> </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="saveNewBu()">保存</el-button> <!-- <el-button type="primary" @click="ToSOS()">重新选择派工单</el-button>--> <el-button type="primary" @click="changeBuFlag=false">关闭</el-button> </el-footer> </el-dialog> <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-row :gutter="20"> <el-col :span="6"> <el-form-item :label="'生产订单'" > <el-input v-model="sobomData.orderno" readonly ></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="'派工单号'" > <el-input v-model="sobomData.seqno" readonly ></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="'产品编码'" > <el-input v-model="sobomData.partNo" readonly ></el-input> </el-form-item> </el-col> </el-row> </el-form> <div class="yzzTable"> <el-table :height="400" :data="sobomList" border v-loading="bomLoadFlag" style="width: 100%;"> <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"> <div v-if="item.columnProp !== 'qtyToIssue'"> <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> </div> <div v-else> <el-input-number v-model="scope.row.qtyToIssue" style="padding: 0;width: 100%" :step="0" :min="0" :controls="false"></el-input-number>
</div> </template> </el-table-column> <el-table-column prop="" header-align="center" align="center" min-width="50" label="操作"> <template slot-scope="scope"> <el-button type="primary" @click="qtyAllForBom(scope.row)" style="width: 100%">全数领料</el-button> </template> </el-table-column>
</el-table> </div> <el-footer style="height:40px;margin-top: 10px;text-align:center"> <el-button type="primary" @click="saveMaterialDetail()">保存</el-button><!-- <el-button type="primary" @click="ToSOS()">重新选择派工单</el-button>--> <el-button type="primary" @click="materialModalFlag=false">关闭</el-button> </el-footer> </el-dialog>
<el-dialog width="600px" title="选择非BOM物料" :close-on-click-modal="false" :visible.sync="partModelFlag"> <el-form :inline="true" label-position="top" label-width="100px" > <el-row :gutter="20"> <el-col :span="6"> <el-form-item style="margin-left: 0px" label="物料编码"> <el-input v-model="partSearch.partNo" ></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item style="margin-left: 0px" label="物料名称"> <el-input v-model="partSearch.partDesc" ></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item style="margin-left: 0px" label="规格型号"> <el-input v-model="partSearch.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-col> </el-row> </el-form> <el-table height="450" :data="partList" border @row-dblclick="chooseNoBomPartNo" style="width: 100%;"> <el-table-column prop="partNo" header-align="center" align="left" min-width="80" style="font-size: 20px" label="物料编码"> </el-table-column> <el-table-column prop="partDesc" header-align="center" align="left" min-width="120" style="font-size: 20px" label="物料描述"> </el-table-column> <el-table-column prop="spec" header-align="center" align="left" min-width="120" style="font-size: 20px" label="规格型号"> </el-table-column> <el-table-column prop="sku" header-align="center" align="left" min-width="80" label="SKU"> </el-table-column> <el-table-column prop="umid" header-align="center" align="left" min-width="60" label="计量单位"> </el-table-column> </el-table> </el-dialog> <el-dialog width="600px" title="选择不管控物料" :close-on-click-modal="false" :visible.sync="noControlPartModelFlag"> <el-form :inline="true" label-position="top" label-width="100px" > <el-row :gutter="20"> <el-col :span="6"> <el-form-item style="margin-left: 0px" label="物料编码"> <el-input v-model="partSearch.partNo" ></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item style="margin-left: 0px" label="物料名称"> <el-input v-model="partSearch.partDesc" ></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item style="margin-left: 0px" label="规格型号"> <el-input v-model="partSearch.spec" ></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label=" "> <el-button type="primary" @click="searchNoControlPartModel()">{{'查询'}}</el-button> </el-form-item> </el-col> </el-row> </el-form> <el-table height="450" :data="partList2" border @row-dblclick="chooseNoControlPartNo" style="width: 100%;"> <el-table-column prop="partNo" header-align="center" align="left" min-width="80" style="font-size: 20px" label="物料编码"> </el-table-column> <el-table-column prop="partDesc" header-align="center" align="left" min-width="120" style="font-size: 20px" label="物料描述"> </el-table-column> <el-table-column prop="spec" header-align="center" align="left" min-width="120" style="font-size: 20px" label="规格型号"> </el-table-column> <el-table-column prop="sku" header-align="center" align="left" min-width="80" label="SKU"> </el-table-column> <el-table-column prop="umid" header-align="center" align="left" min-width="60" label="计量单位"> </el-table-column> </el-table> </el-dialog> <el-dialog width="500px" title="物料库存 VS 需求数量" :close-on-click-modal="false" :visible.sync="xiadaModelFlag"> <div class="board666"> <el-table height="300" :data="xiadaList" border :row-class-name="tableRowClassName" style="width: 100%;"> <el-table-column prop="componentPartNo" header-align="center" align="left" min-width="80" style="font-size: 20px" label="物料编码"> </el-table-column> <el-table-column prop="partDesc" header-align="center" align="left" min-width="120" style="font-size: 20px" label="物料描述"> </el-table-column> <el-table-column prop="qtyToIssue" header-align="center" align="right" min-width="80" style="font-size: 20px" label="发料数量"> </el-table-column> <el-table-column prop="qtyOnHand" header-align="center" align="right" min-width="80" label="库存数量"> </el-table-column> <el-table-column prop="qtyAvailable" header-align="center" align="right" min-width="80" label="可用数量"> </el-table-column> </el-table> </div> <el-footer style="height:40px;margin-top: 10px;text-align:center"> <el-button type="primary" @click="xiadaNotify()">确定下达</el-button> <!-- <el-button type="primary" @click="ToSOS()">重新选择派工单</el-button>--> <el-button type="primary" @click="xiadaModelFlag=false">取消</el-button> </el-footer> </el-dialog>
<el-dialog title="保存物料" :close-on-click-modal="false" v-drag :visible.sync="saveOtherPartModalFlag" width="600px"> <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="otherPartData.componentPartNo" disabled ></el-input> </el-form-item> </el-col> <el-col :span="18"> <el-form-item :label="'物料描述'" > <el-input v-model="otherPartData.partDesc" 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="otherPartData.umid" disabled ></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="'需求数量'" ><!-- <el-input v-model="otherPartData.qtyToIssue" ></el-input>--> <el-input-number v-model="otherPartData.qtyToIssue" style="padding: 0;width: 100%" :step="0" :min="0" :controls="false"></el-input-number>
</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="saveOtherPart()">保存</el-button> <el-button type="primary" @click="saveOtherPartModalFlag=false">关闭</el-button> </el-footer> </el-dialog> <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> </div></template>
<script> import { eamGroupSearch,
getSiteAndBuByUserName } from "@/api/eam/eam.js" import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' import { getTableDefaultListLanguage, getTableUserListLanguage, } from "@/api/table.js" import { getUserNotifyNo,createNotify, getNotifyNoDetail, getSOScheduledRoutingListForIssure, getSOSBOMForIssure, saveSOIssueNotifyOrderList, saveMaterialDetail, deleteNotifySOS, deleteNotify, xiadaNotify, updateNotifyBu, getBuByUserNameSite, getPartList, checkPartStock, saveOtherPart, getNoControlPartList, searchOtherPart, }from "@/api/orderIssure/soIssueNotify.js" import Chooselist from '@/views/modules/common/Chooselist_eam' export default { components: { Chooselist }, watch: { // notifyOrderData: {
// deep: true,
// handler: function (newV, oldV) {
// this.notifyOrderData.locationNo = this.notifyOrderData.locationNo.toUpperCase()
// }
// },
}, data () { return { activeName:'sos', noControlPartModelFlag: false, buList:[], partList:[], partList2:[], notifyNo:'', notifyData:{ site:'', bu:'', notifyNo:'', notifyDate:'', enteredDate:'', userName:'', userDisplay:'', remark:'', planIssueDate:'', }, dataList2:[], dataList3:[], // 是否收藏
favorite: false, changeBuFlag: false, partModelFlag: false, newBu:'', // 导出 start
exportData: [], exportName: "设备分组" + this.dayjs().format('YYYYMMDDHHmmss'), exportHeader: ["设备分组"], exportFooter: [], exportList:[], // 导出 end
searchData: { site: this.$store.state.user.site, userName: this.$store.state.user.name, groupID: '', groupDesc: '', buDesc: '', active: 'Y', page: 1, limit: 10, }, sobomData:{ orderno:'', seqno:'', partNo:'', }, //申请单序号
itemNo:'', notifyOrderData:{ partNo:'', orderno:'', itemno:'', seqno:'', partDesc:'', qtyrequired:'', sResourceid:'', issureQty:'', locationNo:'', needDate:'', }, seqNoData:{ site: this.$store.state.user.site, bu:'', orderno:'', seqno:'', sResourceid:'', sWorkcenterno:'', operatorId:'', sShiftno:'', startDate:'', endDate:'', }, seqNoList:[], height: 200, pageIndex: 1, pageSize: 20, totalPage: 0, dataList: [], sobomList: [], dataListSelections: [], seqNoModalFlag:false, materialModalFlag:false, modalDisableFlag:false, saveSeqNoModalFlag:false, bomLoadFlag:false, xiadaList:[], columnList4:[ {
userId: this.$store.state.user.name, functionId: 701001, serialNumber: '701001Table4ComponentPartNo', tableId: "701001Table4", 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: 701001, serialNumber: '701001Table4PartDesc', tableId: "701001Table4", 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: 701001, serialNumber: '701001Table4QtyToIssue', tableId: "701001Table4", tableName: "申请单材料明细表", columnProp: "qtyToIssue", headerAlign: "center", align: "right", columnLabel: "申请数量", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, ], modalData:{ flag:'', bu: '', site: this.$store.state.user.site, groupID:'', groupDesc:'', active:'', createBy: this.$store.state.user.name, updateBy: this.$store.state.user.name, }, // 展示列集
columnList: [ { userId: this.$store.state.user.name, functionId: 701001002, serialNumber: '701001002Table1ItemNo', tableId: "701001002Table1", tableName: "领料申请派工单子表", columnProp: 'itemNo', 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: 701001002, serialNumber: '701001002Table1SeqNo', tableId: "701001002Table1", tableName: "领料申请派工单子表", columnProp: 'seqNo', headerAlign: "center", align: "center", columnLabel: '派工单号', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 150, }, { userId: this.$store.state.user.name, functionId: 701001002, serialNumber: '701001002Table1SOOrderNo', tableId: "701001002Table1", tableName: "领料申请派工单子表", columnProp: 'sOOrderNo', headerAlign: "center", align: "center", columnLabel: '生产订单', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 701001002, serialNumber: '701001002Table1OpsItemNo', tableId: "701001002Table1", tableName: "领料申请派工单子表", columnProp: 'opsItemNo', 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: 701001002, serialNumber: '701001002Table1ItemDesc', tableId: "701001002Table1", tableName: "领料申请派工单子表", columnProp: 'itemDesc', 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: 701001002, serialNumber: '701001002Table1LocationNo', tableId: "701001002Table1", tableName: "领料申请派工单子表", columnProp: 'locationNo', 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: 701001002, serialNumber: '701001002Table1NeedDate', tableId: "701001002Table1", tableName: "领料申请派工单子表", columnProp: 'needDate', 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: 701001002, serialNumber: '701001002Table1IssureQty', tableId: "701001002Table1", tableName: "领料申请派工单子表", columnProp: 'issureQty', headerAlign: "center", align: "right", columnLabel: '发料数量', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80,
}, ], columnList2: [ { userId: this.$store.state.user.name, functionId: 701001002, serialNumber: '701001002Table2Orderno', tableId: "701001002Table2", tableName: "查询派工单", columnProp: 'orderno', headerAlign: "center", align: "center", columnLabel: '生产订单', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 701001002, serialNumber: '701001002Table2Itemno', tableId: "701001002Table2", tableName: "查询派工单", columnProp: 'itemno', 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: 701001002, serialNumber: '701001002Table2ItemDesc', tableId: "701001002Table2", tableName: "查询派工单", columnProp: 'itemDesc', 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: 701001002, serialNumber: '701001002Table2Seqno', tableId: "701001002Table2", tableName: "查询派工单", columnProp: 'seqno', headerAlign: "center", align: "center", columnLabel: '派工单号', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 150, }, { userId: this.$store.state.user.name, functionId: 701001002, serialNumber: '701001002Table2PartNo', tableId: "701001002Table2", tableName: "查询派工单", columnProp: 'partNo', 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: 701001002, serialNumber: '701001002Table2Qtyrequired', tableId: "701001002Table2", tableName: "查询派工单", columnProp: 'qtyrequired', 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: 701001002, serialNumber: '701001002Table2Qtyreported', tableId: "701001002Table2", tableName: "查询派工单", columnProp: 'qtyreported', headerAlign: "center", align: "right", columnLabel: '报工数量', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 701001002, serialNumber: '701001002Table2SScheduleddate', tableId: "701001002Table2", tableName: "查询派工单", columnProp: 'sScheduleddate', 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: 701001002, serialNumber: '701001002Table2SWorkcenterno', tableId: "701001002Table2", tableName: "查询派工单", columnProp: 'sWorkcenterno', 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: 701001002, serialNumber: '701001002Table2WorkCenterDesc', tableId: "701001002Table2", tableName: "查询派工单", columnProp: 'workCenterDesc', 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: 701001002, serialNumber: '701001002Table2SResourceid', tableId: "701001002Table2", tableName: "查询派工单", columnProp: 'sResourceid', headerAlign: "center", align: "left", columnLabel: '机台编码', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 60, }, { userId: this.$store.state.user.name, functionId: 701001002, serialNumber: '701001002Table2ResourceDesc', tableId: "701001002Table2", tableName: "查询派工单", columnProp: 'resourceDesc', 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: 701001002, serialNumber: '701001002Table2OperatorDesc', tableId: "701001002Table2", tableName: "查询派工单", columnProp: 'operatorDesc', headerAlign: "center", align: "left", columnLabel: '操作员', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, ], columnList3: [ { userId: this.$store.state.user.name, functionId: 701001002, serialNumber: '701001002Table3ComponentPartNo', tableId: "701001002Table3", tableName: "领料申请BOM子表", columnProp: 'componentPartNo', headerAlign: "center", align: "left", columnLabel: '物料编码', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 50, }, { userId: this.$store.state.user.name, functionId: 701001002, serialNumber: '701001002Table3PartDesc', tableId: "701001002Table3", tableName: "领料申请BOM子表", columnProp: 'partDesc', headerAlign: "center", align: "left", columnLabel: '物料描述', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 220, }, { userId: this.$store.state.user.name, functionId: 701001002, serialNumber: '701001002Table3QtyRequired', tableId: "701001002Table3", tableName: "领料申请BOM子表", columnProp: 'qtyRequired', 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: 701001002, serialNumber: '701001002Table3QtyOnHand', tableId: "701001002Table3", tableName: "领料申请BOM子表", columnProp: 'qtyOnHand', 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: 701001002, serialNumber: '701001002Table3QtyToIssue', tableId: "701001002Table3", tableName: "领料申请BOM子表", columnProp: 'qtyToIssue', headerAlign: "center", align: "right", columnLabel: '本次申请数量', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 60, }, ], rules:{ groupIdType:[ { required: true, message: ' ', trigger: ['blur','change'] } ], groupDescType:[ { required: true, message: ' ', trigger: ['blur','change'] } ], activeType:[ { required: true, message: ' ', trigger: ['blur','change'] } ], bu:[ { required: true, message: ' ', trigger: ['blur','change'] } ] }, userBuList: [], authSearch: false, authSave: false, authUpdate: false, authDelete: false, menuId: this.$route.meta.menuId, partSearch:{ site:'', sourceBu:'', partNo:'', partDesc:'', spec:'', }, xiadaModelFlag:false, saveOtherPartModalFlag:false, otherPartData:{ site:'', notifyNo:'', itemNo:'', bOMItemNo:'', componentPartNo:'', qtyToIssue:'', issueType:'', partDesc:'', umid:'', }, } },
mounted () { this.$nextTick(() => { this.height = window.innerHeight - 300 }) },
created () { // 按钮控制
// this.getButtonAuthData()
// 获取用户的 site 和 bu
// this.getSiteAndBuByUserName()
// 校验用户是否收藏
this.favoriteIsOk()
this.getUserNotifyNo() // 动态列
// this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
// if (!this.authSearch) {
// // 获取数据列表
// this.getDataList()
// }
},
methods: { getBaseList (val,type) { this.tagNo = val let conSql='' this.$nextTick(() => { let strVal = ''
if (val === 515) { strVal = this.seqNoData.sResourceid conSql = " and site = '" + this.notifyData.site + "'" + " and bu_no = '" + this.notifyData.bu + "'" this.$refs.baseList.init(val, strVal,conSql) } if (val === 216) { strVal = this.seqNoData.sWorkcenterno conSql = " and site = '" + this.notifyData.site + "'" + " and bu_no = '" + this.notifyData.bu + "'" this.$refs.baseList.init(val, strVal,conSql) } if (val === 215) { strVal = this.notifyOrderData.locationNo this.$refs.baseList.init(val, strVal) }
}) }, chooseNoBomPartNo(row){ this.otherPartData={ site:this.notifyData.site, notifyNo:this.notifyData.notifyNo, itemNo:998, bOMItemNo:'', componentPartNo:row.partNo, qtyToIssue:'', issueType:'非BOM物料', partDesc:row.partDesc, umid:row.umid, } this.saveOtherPartModalFlag=true }, chooseNoControlPartNo(row){ this.otherPartData={ site:this.notifyData.site, notifyNo:this.notifyData.notifyNo, itemNo:999, bOMItemNo:'', componentPartNo:row.partNo, qtyToIssue:'', issueType:'不管控物料', partDesc:row.partDesc, umid:row.umid, } this.saveOtherPartModalFlag=true }, tableRowClassName ({row, rowIndex}) { if(row.qtyToIssue>row.qtyAvailable){
return 'error-row'
}
return '' }, // 列表方法的回调
getBaseData (val) { if (this.tagNo === 515) { this.seqNoData.sResourceid = val.resource_id } if (this.tagNo === 215) { this.notifyOrderData.locationNo = val.location_id } if (this.tagNo === 216) { this.seqNoData.sWorkcenterno = val.work_center_no }
}, getUserNotifyNo(){ let inData={ site:this.$store.state.user.site, userName:this.$store.state.user.name, } getUserNotifyNo(inData).then(({data})=>{ if (data.code === 0) { if(data.row!=null){ this.notifyNo = data.row.notifyNo this.notifyData=data.row this.getNotifyNoDetail(); this.searchOtherPart('非BOM物料') this.searchOtherPart('不管控物料') }else { this.notifyNo ='' this.notifyData={ site:'', bu:'', notifyNo:'', notifyDate:'', enteredDate:'', userName:'', userDisplay:'', remark:'', planIssueDate:'', } this.dataList=[] } }else { this.notifyNo ='' this.notifyData={ site:'', bu:'', notifyNo:'', notifyDate:'', enteredDate:'', userName:'', userDisplay:'', remark:'', planIssueDate:'', } this.dataList=[] } }) }, getNotifyNoDetail(){ let inData={ site:this.$store.state.user.site, notifyNo:this.notifyNo, } getNotifyNoDetail(inData).then(({data})=>{ if (data.code === 0) { this.dataList = data.rows } }) }, addNotify(){ let inData={ site:this.$store.state.user.site, userName:this.$store.state.user.name, } createNotify(inData).then(({data})=>{ if (data.code === 0) { this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} }) this.getUserNotifyNo() }else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) }, chooseSOS(row){ 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 } } 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.notifyOrderData.needDate=this.dayjs().format("YYYY-MM-DD hh:mm") this.notifyOrderData.locationNo=row.sResourceid; this.saveSeqNoModalFlag=true }, saveSOS(){ if(this.notifyOrderData.needDate==null||this.notifyOrderData.needDate==''){ this.$message.warning('请选择时间!') return false } // if(this.notifyOrderData.locationNo==null||this.notifyOrderData.locationNo==''){
// this.$message.warning('请输入机台!')
// return false
// }
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 } } this.$confirm('确定选择派工单'+row.seqno+'?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { let inData={ site:this.$store.state.user.site, notifyNo:this.notifyNo, fGPartNo:row.partNo, sOOrderNo:row.orderno, opsItemNo:row.itemno, seqNo:row.seqno, locationNo:row.locationNo, needDate:row.needDate, issureQty:row.issureQty, outWorkOrderFlag:'N', } saveSOIssueNotifyOrderList(inData).then(({data})=>{ if (data.code === 0) { this.saveSeqNoModalFlag=false this.getNotifyNoDetail() this.enterSOS(row); this.itemNo=data.itemNo }else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) }) }, qtyAllForSeqNo(){ this.notifyOrderData.issureQty=this.notifyOrderData.qtyrequired }, qtyAllForBom(row){ row.qtyToIssue=row.qtyRequired }, enterSOSDetail(row){ let rows={ site:this.$store.state.user.site, notifyNo:this.notifyNo, orderno:row.sOOrderNo, seqno:row.seqNo, partNo:row.fGPartNo, itemno:row.opsItemNo, } this.itemNo=row.itemNo this.enterSOS(rows) }, enterSOS(row){ this.seqNoModalFlag = false this.materialModalFlag=true this.sobomList = [] this.sobomData={ orderno:row.orderno, seqno:row.seqno, partNo:row.partNo, } this.bomLoadFlag=true let inData={ site:this.$store.state.user.site, notifyNo:this.notifyNo, orderno:row.orderno, seqno:row.seqno, partNo:row.partNo, itemno:row.itemno, } getSOSBOMForIssure(inData).then(({data})=>{ this.bomLoadFlag=false if (data.code === 0) { this.sobomList = data.rows
} }) }, ToSOS(){ this.seqNoModalFlag = true this.materialModalFlag=false }, chooseSOSModal(){ this.seqNoData={ site: this.$store.state.user.site, bu:this.notifyData.bu, orderno:'', seqno:'', sResourceid:'', sWorkcenterno:'', operatorId:'', sShiftno:'', startDate: this.dayjs().format('YYYY-MM-DD'), endDate: this.dayjs().format('YYYY-MM-DD'), } this.searchSOSRouting() this.seqNoModalFlag=true; }, searchSOSRouting(){ getSOScheduledRoutingListForIssure(this.seqNoData).then(({data})=>{ if (data.code === 0) { this.seqNoList = data.rows } }) }, saveMaterialDetail(){ for (let i = 0; i < this.sobomList.length; i++) { if (this.sobomList[i].applyQty===''||this.sobomList[i].applyQty==null){ this.sobomList[i].applyQty=0 } } let materialList=this.sobomList.filter(item => item.qtyToIssue > 0) if(materialList.length==0){ this.$alert('没有需要保存的内容!', '提示', { confirmButtonText: '确定' }) return false } saveMaterialDetail(materialList).then(({data})=>{ if (data.code === 0) { this.materialModalFlag=false this.chooseSOSModal(); this.$message.success( '操作成功') }else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } })
}, //获取用户的bu
getSiteAndBuByUserName () { let tempData = { username: this.$store.state.user.name, } getSiteAndBuByUserName(tempData).then(({data}) => { if (data.code === 0 && data.row !=null) { this.userBuList = data.rows } }) }, // 校验用户是否收藏
favoriteIsOk () { let userFavorite = { userId: this.$store.state.user.id, languageCode: this.$i18n.locale } userFavoriteList(userFavorite).then(({data}) => { for (let i = 0; i < data.list.length; i++) { if (this.$route.meta.menuId === data.list[i].menuId) { this.favorite = true } } }) },
// 收藏 OR 取消收藏
favoriteFunction () { let userFavorite = { userId: this.$store.state.user.id, functionId: this.$route.meta.menuId, } if (this.favorite) { removeUserFavorite(userFavorite).then(({data}) => { this.$message.success(data.msg) this.favorite = false }) } else { // 收藏
saveUserFavorite(userFavorite).then(({data}) => { this.$message.success(data.msg) this.favorite = true }) } },
//导出excel
async createExportData () { this.searchData.limit = -1 this.searchData.page = 1 await eamGroupSearch(this.searchData).then(({data}) => { this.exportList = data.page.list }) return this.exportList },
startDownload () {},
finishDownload () {},
fields () { let json = "{" this.columnList.forEach((item, index) => { if (index == this.columnList.length - 1) { json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" } else { json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," } }) json += "}" let s = eval("(" + json + ")") return s },
// // 获取数据列表
// 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()
// },
noBomModel(){ this.partSearch={ site:this.notifyData.site, sourceBu:this.notifyData.bu, partNo:'', partDesc:'', spec:'', } this.partModelFlag=true this. searchPartModel() }, noControlModel(){ this.partSearch={ site:this.notifyData.site, sourceBu:this.notifyData.bu, partNo:'', partDesc:'', spec:'', } this.noControlPartModelFlag=true this. searchNoControlPartModel() }, searchPartModel(){ getPartList(this.partSearch).then(({data})=>{ if (data.code === 0) { this.partList=data.rows } }) }, searchNoControlPartModel(){ getNoControlPartList(this.partSearch).then(({data})=>{ if (data.code === 0) { this.partList2=data.rows } }) }, xiadaNotifyModel(){ if(this.dataList.length==0&&this.dataList2.length==0&&this.dataList3.length==0){ this.$alert('没有明细记录无法下达!!', '提示', { confirmButtonText: '确定' }) return false } checkPartStock(this.notifyData).then(({data})=>{ if (data.code === 0) { this.xiadaList=data.rows } }) this.xiadaModelFlag=true }, xiadaNotify() {
// if(this.notifyData.planIssueDate==null||this.notifyData.planIssueDate==''){
// this.$alert('请选择要求发料时间!!', '提示', {
// confirmButtonText: '确定'
// })
// return false
// }
xiadaNotify(this.notifyData).then(({data})=>{ if (data.code === 0) { this.xiadaModelFlag=false this.getUserNotifyNo() this.$message.success( '操作成功') }else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) }, saveOtherPart(){ if(this.otherPartData.qtyToIssue==null||this.otherPartData.qtyToIssue==''||this.otherPartData.qtyToIssue<=0){ this.$message.warning('请填写领取数量!') return false } this.$confirm('确定保存'+'?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { saveOtherPart(this.otherPartData).then(({data})=>{ if (data.code === 0) { this.saveOtherPartModalFlag=false if(this.otherPartData.issueType==='非BOM物料'){ this.partModelFlag=false this.activeName='noBom' this.searchOtherPart('非BOM物料') } if(this.otherPartData.issueType==='不管控物料'){ this.noControlPartModelFlag=false this.activeName='noControl' this.searchOtherPart('不管控物料') } this.$message.success( '操作成功') }else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } })
}) }, deleteNotify() { if(this.dataList.length>0){ this.$alert('请先删除已经申请的明细记录!!', '提示', { confirmButtonText: '确定' }) return false } deleteNotify(this.notifyData).then(({data})=>{ if (data.code === 0) { this.getUserNotifyNo() this.$message.success( '操作成功') }else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) }, updateBuModel(){ if(this.dataList.length>0){ this.$alert('已经选择了派工单,无法切换BU,请删除已选派工单!', '错误', { confirmButtonText: '确定' }) } let inData={ site:this.notifyData.site, username:this.$store.state.user.name, } getBuByUserNameSite(inData).then(({data}) =>{ if (data && data.code === 0) { this.buList=data.rows } }) this.newBu=this.notifyData.bu this.changeBuFlag=true }, saveNewBu(){ let inData={ bu:this.newBu, site:this.notifyData.site, notifyNo:this.notifyData.notifyNo, } updateNotifyBu(inData).then(({data}) => { if (data && data.code === 0) { this.notifyData.bu=this.newBu this.changeBuFlag=false this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} }) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) }, searchOtherPart(type){ let inData={ site:this.notifyData.site, notifyNo:this.notifyData.notifyNo, issueType:type } searchOtherPart(inData).then(({data}) =>{ if (data && data.code === 0) { if(type==='非BOM物料'){ this.dataList2=data.rows } if(type==='不管控物料'){ this.dataList3=data.rows } } }) }, // 删除
deleteNotifySOS (row) { this.$confirm(`是否删除这个派工单的申请信息?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { deleteNotifySOS(row).then(({data}) => { if (data && data.code === 0) { this.getNotifyNoDetail() this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} }) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) }).catch(() => { }) },
// 动态列开始 获取 用户保存的 格式列
async getTableUserColumn(tableId, columnId) { let queryTableUser = { userId: this.$store.state.user.name, functionId: this.$route.meta.menuId, tableId: tableId, status: true, languageCode: this.$i18n.locale } await getTableUserListLanguage(queryTableUser).then(({data}) => { if (data.rows.length > 0) { //this.columnList1 = []
switch (columnId) { case 1: this.columnList = data.rows break; // case 2:
// this.detailColumnList = data.rows
// break;
// case 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
} } else { this.getColumnList(tableId, columnId) } }) },
// 获取 tableDefault 列
async getColumnList (tableId, columnId) { let queryTable= { functionId: this.$route.meta.menuId, tableId: tableId, languageCode: this.$i18n.locale } await getTableDefaultListLanguage(queryTable).then(({data}) => { if (!data.rows.length == 0) { switch (columnId) { case 1: this.columnList = data.rows break; // case 2:
// this.detailColumnList = data.rows
// break;
// case 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
} } else { // this.showDefault = true.
} }) }, //获取按钮的权限数据
getButtonAuthData () { let searchFlag = this.isAuth(this.menuId+":search") let saveFlag = this.isAuth(this.menuId+":save") let updateFlag = this.isAuth(this.menuId+":update") let deleteFlag = this.isAuth(this.menuId+":delete") //处理页面的权限数据
this.authSearch = !searchFlag this.authSave = !saveFlag this.authUpdate = !updateFlag this.authDelete = !deleteFlag }, } }</script><style > .board666 .el-table .error-row { background: #f86868; }</style>
|