| | |
| | | <template>
|
| | | <div>
|
| | | <div class="body" style="padding-top: 10px;" :style="{height:mainHeight+'px'}">
|
| | |
|
| | | <div style="position: absolute;right:36px;z-index: 2;top: 13px">
|
| | | <el-button
|
| | | v-if="activeName==='生产列表'&&tableData.length>0"
|
| | | v-waves
|
| | | icon="el-icon-thumb"
|
| | | type="primary"
|
| | | :disabled="radioSelected===''"
|
| | | @click="report()"
|
| | | >报工
|
| | | </el-button>
|
| | | <el-button
|
| | | v-if="activeName==='外协发料'&&tableData.length>0"
|
| | | v-waves
|
| | | type="primary"
|
| | | icon="el-icon-thumb"
|
| | | :disabled="radioSelected===''"
|
| | | @click="sendOut()"
|
| | | >发料
|
| | | </el-button>
|
| | | <el-button
|
| | | v-if="activeName==='外协收料'&&tableData.length>0"
|
| | | v-waves
|
| | | type="primary"
|
| | | icon="el-icon-thumb"
|
| | | :disabled="radioSelected===''"
|
| | | @click="takeIn()"
|
| | | >收料
|
| | | </el-button>
|
| | | <el-button
|
| | | v-if="activeName==='不良待处理'&&tableData.length>0"
|
| | | v-waves
|
| | | type="primary"
|
| | | icon="el-icon-thumb"
|
| | | :disabled="radioSelected===''"
|
| | | @click="handleBad()"
|
| | | >处理
|
| | | </el-button>
|
| | | </div>
|
| | |
|
| | | <div v-if="form.wocode" style="position: absolute;left: 460px;z-index: 2;top: 23px;font-weight: bolder">
|
| | | 当前工单号为:{{ form.wocode }}
|
| | | </div>
|
| | |
|
| | | <el-tabs
|
| | | ref="elTabs"
|
| | | v-model="activeName"
|
| | | type="border-card"
|
| | | @tab-click="tabClick"
|
| | | >
|
| | |
|
| | | <el-tab-pane
|
| | | v-for="item in elTabsArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :name="item.name"
|
| | | >
|
| | |
|
| | | <div class="bodyTopFormGroup">
|
| | | <el-form
|
| | | ref="form"
|
| | | :model="form"
|
| | | label-width="100px"
|
| | | inline
|
| | | style="display: flex;"
|
| | | >
|
| | | <div class="elForm">
|
| | |
|
| | | <el-form-item label="工单号" style=" display: flex;">
|
| | | <el-input
|
| | | v-model="workOrderCurrentValue"
|
| | | :name="'produceCode'+item.code"
|
| | | placeholder="请扫描或输入"
|
| | | style="width: 300px"
|
| | |
|
| | | @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="产品编码" style=" display: flex;">
|
| | | <el-input
|
| | | v-model="form.partcode"
|
| | | placeholder="请输入"
|
| | | style="width: 200px"
|
| | |
|
| | | @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="产品名称" style=" display: flex;">
|
| | | <el-input
|
| | | v-model="form.partname"
|
| | | placeholder="请输入"
|
| | |
|
| | | style="width: 200px"
|
| | | @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="车间名称" style=" display: flex;">
|
| | | <el-select
|
| | | v-model="form.wkshopcode"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | style="width: 200px"
|
| | |
|
| | | placeholder="请选择"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in wkshopcodeArr"
|
| | | :key="item.torg_code"
|
| | | :label="item.torg_name"
|
| | | :value="item.torg_code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | |
|
| | | <!-- <el-form-item label="规格型号" style=" display: flex;">-->
|
| | | <!-- <el-input v-model="form.partspec" placeholder="请输入" style="width: 200px" />-->
|
| | | <!-- </el-form-item>-->
|
| | |
|
| | | </div>
|
| | | <div
|
| | | class="bodySearchReset"
|
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
|
| | | >
|
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="search">查询</el-button>
|
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
|
| | | </div>
|
| | | </el-form>
|
| | | <div
|
| | | class="bodyTopFormExpand"
|
| | | style="height:5px"
|
| | | >
|
| | | <!-- <svg-icon-->
|
| | | <!-- v-show="mouseHoverType==='mouseout'"-->
|
| | | <!-- style="cursor: pointer"-->
|
| | | <!-- :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"-->
|
| | | <!-- @mouseenter="mouseHoverType=$event.type"-->
|
| | | <!-- />-->
|
| | | <!-- <svg-icon-->
|
| | | <!-- v-show="mouseHoverType==='mouseenter'"-->
|
| | | <!-- style="cursor: pointer"-->
|
| | | <!-- :icon-class="!isExpandForm?'doubleDown':'doubleUp'"-->
|
| | | <!-- @click="isExpandForm=!isExpandForm"-->
|
| | | <!-- @mouseout="mouseHoverType=$event.type"-->
|
| | | <!-- />-->
|
| | | </div>
|
| | | </div>
|
| | |
|
| | | <div class="elTableDiv">
|
| | | <el-table
|
| | | ref="tableDataRef"
|
| | | :key="'tableDataRef'+item.code"
|
| | | class="tableFixed"
|
| | | :data="tableData"
|
| | | :height="tableHeight+50"
|
| | | border
|
| | | row-class-name="custom-row"
|
| | | :style="{width: 100+'%',height:tableHeight+'px'}"
|
| | | highlight-current-row
|
| | | :header-cell-style="headerCellStyle()"
|
| | | :cell-style="cellStyle()"
|
| | | @sort-change="sortChange"
|
| | | @row-click="rowClick"
|
| | | >
|
| | | <el-table-column
|
| | | width="50"
|
| | | fixed
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-radio
|
| | | v-model="radioSelected"
|
| | | :label="row.id"
|
| | | style="color: transparent;padding-left: 10px;"
|
| | | />
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="rowNum"
|
| | | width="50"
|
| | | label="序号"
|
| | | fixed
|
| | | />
|
| | | <el-table-column
|
| | | v-if="activeName!=='不良待处理'"
|
| | | prop="status"
|
| | | show-tooltip-when-overflow
|
| | | label="状态"
|
| | | sortable="custom"
|
| | | width="80"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.status==='NEW'">新订单</div>
|
| | | <div v-if="row.status==='ALLO'">已派发</div>
|
| | | <div v-if="row.status==='START'">开工</div>
|
| | | <div v-if="row.status==='CLOSED'">完工</div>
|
| | | <div v-if="row.status==='NOSCHED'">待排程</div>
|
| | | <div v-if="row.status==='SCHED'">已排程</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="wo_code"
|
| | | label="工单号"
|
| | | min-width="160"
|
| | | show-tooltip-when-overflow
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="partcode"
|
| | | label="产品编码"
|
| | | min-width="110"
|
| | | sortable="custom"
|
| | | show-tooltip-when-overflow
|
| | | />
|
| | | <el-table-column
|
| | | prop="partname"
|
| | | min-width="110"
|
| | | show-tooltip-when-overflow
|
| | | label="产品名称"
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="partspec"
|
| | | min-width="110"
|
| | | show-tooltip-when-overflow
|
| | | label="规格型号"
|
| | | sortable="custom"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | {{ row.partspec ? row.partspec : '/' }}
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="wkshp_name"
|
| | | min-width="110"
|
| | | show-tooltip-when-overflow
|
| | | label="车间名称"
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="stepname"
|
| | | label="工序名称"
|
| | | show-tooltip-when-overflow
|
| | | width="120"
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="plan_qty"
|
| | | label="任务数量"
|
| | | width="110"
|
| | | sortable="custom"
|
| | | show-tooltip-when-overflow
|
| | | />
|
| | | <el-table-column
|
| | | v-if="activeName==='外协发料'||activeName==='外协收料'"
|
| | | prop="fqty"
|
| | | show-tooltip-when-overflow
|
| | | label="已发料数量"
|
| | | sortable="custom"
|
| | | width="120"
|
| | | />
|
| | | <el-table-column
|
| | | prop="good_qty"
|
| | | show-tooltip-when-overflow
|
| | | :label="activeName==='外协发料'||activeName==='外协收料'?'已收料数量':'合格数量'"
|
| | | sortable="custom"
|
| | | width="120"
|
| | | />
|
| | | <el-table-column
|
| | | prop="ng_qty"
|
| | | label="不良数量"
|
| | | show-tooltip-when-overflow
|
| | | width="120"
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="laborbad_qty"
|
| | | label="工废数量"
|
| | | width="120"
|
| | | show-tooltip-when-overflow
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="materielbad_qty"
|
| | | label="料废数量"
|
| | | width="120"
|
| | | show-tooltip-when-overflow
|
| | | sortable="custom"
|
| | | />
|
| | |
|
| | | <el-table-column
|
| | | label="操作"
|
| | | width="120"
|
| | | fixed="right"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div class="operationClass">
|
| | | <el-button v-if="activeName==='生产列表'" v-waves icon="el-icon-thumb" type="text" @click="report(row)">
|
| | | 报工
|
| | | </el-button>
|
| | | <el-button
|
| | | v-if="activeName==='外协发料'"
|
| | | v-waves
|
| | | icon="el-icon-thumb"
|
| | | type="text"
|
| | | @click="sendOut(row)"
|
| | | >发料
|
| | | </el-button>
|
| | | <el-button v-if="activeName==='外协收料'" v-waves icon="el-icon-thumb" type="text" @click="takeIn(row)">
|
| | | 收料
|
| | | </el-button>
|
| | | <el-button
|
| | | v-if="activeName==='不良待处理'"
|
| | | v-waves
|
| | | icon="el-icon-thumb"
|
| | | type="text"
|
| | | @click="handleBad(row)"
|
| | | >处理
|
| | | </el-button>
|
| | | </div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | </div>
|
| | | <!--分页-->
|
| | | <pagination
|
| | | :total="total"
|
| | | :page.sync="form.page"
|
| | | :limit.sync="form.rows"
|
| | | align="right"
|
| | | layout="total,prev, pager, next,sizes"
|
| | | popper-class="select_bottom"
|
| | | @pagination="search"
|
| | | />
|
| | | </el-tab-pane>
|
| | |
|
| | | </el-tabs>
|
| | |
|
| | | </div>
|
| | |
|
| | | <!-- 开报工、外协、不良处理-->
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | :title="dialogTitle"
|
| | | :visible.sync="dialogVisible"
|
| | | width="1160px"
|
| | | :close-on-click-modal="false"
|
| | | :top="activeName==='生产列表'||activeName==='外协收料'? '6vh':'15vh'"
|
| | | @closed="handleClose"
|
| | | @close="handleClose"
|
| | | >
|
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="110px">
|
| | | <!-- <el-divider v-if="activeName==='生产列表'||activeName==='外协收料'||activeName==='不良待处理'" content-position="left">基本信息</el-divider>-->
|
| | | <el-divider v-if="activeName==='生产列表'" content-position="left">报工信息</el-divider>
|
| | | <el-divider v-if="activeName==='外协收料'" content-position="left">收料信息</el-divider>
|
| | | <el-divider v-if="activeName==='不良待处理'" content-position="left">待处理信息</el-divider>
|
| | | <el-form-item label="工单编号" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.wo_code }}</div>
|
| | | </el-form-item>
|
| | | <el-form-item label="产品编码" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.partnumber }}</div>
|
| | | </el-form-item>
|
| | | <el-form-item label="产品名称" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.partname }}</div>
|
| | | </el-form-item>
|
| | | <el-form-item label="规格型号" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.partspec ? dialogForm.partspec : '/' }}</div>
|
| | | </el-form-item>
|
| | | <el-form-item label="当前工序" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.stepname }}</div>
|
| | | </el-form-item>
|
| | | <el-form-item label="下道工序" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.nextstepname ? dialogForm.nextstepname : '/' }}</div>
|
| | | </el-form-item>
|
| | | <el-form-item label="任务数量" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.planqty }}</div>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item v-if="activeName==='不良待处理'" label="合格数量" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.noreportqty }}</div>
|
| | | </el-form-item>
|
| | | <el-form-item v-if="activeName==='不良待处理'" label="不良数量" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.noputqty }}</div>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item
|
| | | v-if="activeName!=='不良待处理'"
|
| | | :label="activeName==='生产列表'? '未报/已报':(activeName==='外协发料'?'未发/已发':'未收/已收')"
|
| | | class="dialogFormItem"
|
| | | >
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.noreportqty + '/' + dialogForm.reportqty }}</div>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item v-if="activeName==='生产列表'||activeName==='外协收料'" label="不良数量" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv" style="color:red;">{{ dialogForm.noputqty }}</div>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item v-if="activeName==='生产列表'" label="报工设备" class="dialogFormItem">
|
| | | <el-select
|
| | | v-model="dialogForm.eqpcode"
|
| | | style="width:200px"
|
| | | placeholder="请选择"
|
| | | filterable
|
| | | clearable
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in eqpArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item v-if="activeName==='生产列表'" label="计件方式" class="dialogFormItem">
|
| | | <el-radio-group
|
| | | v-model="dialogForm.reckway"
|
| | | style="width: 200px;"
|
| | | @change="reckwayChange"
|
| | | >
|
| | | <el-radio label="person">个人</el-radio>
|
| | | <el-radio label="group">班组</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item
|
| | | v-if="activeName==='生产列表'"
|
| | | :prop="dialogForm.reckway==='group'?'usergroupcode':''"
|
| | | label="报工班组"
|
| | | class="dialogFormItem"
|
| | | >
|
| | | <el-select
|
| | | v-model="dialogForm.usergroupcode"
|
| | | style="width:200px"
|
| | | placeholder="请选择"
|
| | | filterable
|
| | | :disabled="dialogForm.reckway!=='group'"
|
| | | :popper-append-to-body="false"
|
| | | @change="usergroupChange"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in usergroupArr"
|
| | | :key="item.usergroupcode"
|
| | | :label="item.usergroupname"
|
| | | :value="item.usergroupcode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item v-if="activeName==='生产列表'" prop="reportuser" label="报工人员" class="dialogFormItem">
|
| | | <el-select
|
| | | v-model="dialogForm.reportuser"
|
| | | style="width:200px"
|
| | | placeholder="请选择"
|
| | | filterable
|
| | | multiple
|
| | | collapse-tags
|
| | | :multiple-limit="dialogForm.reckway==='group'?0:1"
|
| | | :disabled="dialogForm.reckway==='group'&&dialogForm.usergroupcode===''"
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in reportuserArr"
|
| | | :key="item.usercode"
|
| | | :label="item.username"
|
| | | :value="item.usercode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item v-if="activeName==='生产列表'" prop="startqty" label="合格数量" class="dialogFormItem">
|
| | | <el-input v-model="dialogForm.startqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" />
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item v-if="activeName==='外协发料'||activeName==='外协收料'" prop="wxcode" label="外协供方" class="dialogFormItem">
|
| | | <el-select
|
| | | v-model="dialogForm.wxcode"
|
| | | style="width:200px"
|
| | | placeholder="请选择"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in wxArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item v-if="activeName==='外协发料'" prop="outuser" label="发料人员" class="dialogFormItem">
|
| | | <el-select
|
| | | v-model="dialogForm.outuser"
|
| | | style="width:200px"
|
| | | placeholder="请选择"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in reportuserArr"
|
| | | :key="item.usercode"
|
| | | :label="item.username"
|
| | | :value="item.usercode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item v-if="activeName==='外协发料'" prop="fqty" label="发料数量" class="dialogFormItem">
|
| | | <el-input v-model="dialogForm.fqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" />
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item v-if="activeName==='外协收料'" prop="inuser" label="收料人员" class="dialogFormItem">
|
| | | <el-select
|
| | | v-model="dialogForm.inuser"
|
| | | style="width:200px"
|
| | | placeholder="请选择"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in reportuserArr"
|
| | | :key="item.usercode"
|
| | | :label="item.username"
|
| | | :value="item.usercode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item v-if="activeName==='外协收料'" prop="sqty" label="收料数量" class="dialogFormItem">
|
| | | <el-input v-model="dialogForm.sqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" />
|
| | | </el-form-item>
|
| | |
|
| | | <el-divider v-if="activeName==='生产列表'||activeName==='外协收料'" content-position="left">不良明细信息</el-divider>
|
| | | <el-button
|
| | | v-if="activeName==='生产列表'||activeName==='外协收料'"
|
| | | v-waves
|
| | | type="primary"
|
| | | icon="el-icon-circle-plus-outline"
|
| | | @click="addDefect"
|
| | | >新增
|
| | | </el-button>
|
| | | <el-table
|
| | | v-if="activeName==='生产列表'||activeName==='外协收料'"
|
| | | ref="defectTableDataRef"
|
| | | key="defectTableDataKey"
|
| | | :data="defectTableData"
|
| | | border
|
| | | row-class-name="custom-row"
|
| | | height="200"
|
| | | style="width: 100%;margin-top: 15px;"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | >
|
| | | <el-table-column
|
| | | type="index"
|
| | | label="序号"
|
| | | align="center"
|
| | | width="50"
|
| | | />
|
| | | <el-table-column
|
| | | prop="stepcode"
|
| | | label="缺陷编码/名称"
|
| | | align="center"
|
| | | min-width="450"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-select
|
| | | v-model="row.code"
|
| | | style="width: 100%"
|
| | | placeholder="请选择"
|
| | | multiple
|
| | | filterable
|
| | | >
|
| | | <!-- collapse-tags-->
|
| | | <el-option
|
| | | v-for="item in defectArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <el-table-column
|
| | | prop="badqty"
|
| | | label="不良数量"
|
| | | align="center"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-input
|
| | | v-model="row.badqty"
|
| | | placeholder="请输入数量"
|
| | | oninput="value=value.replace(/[^0-9]/g,'')"
|
| | | style="width: 100%"
|
| | | @click.stop=""
|
| | | @change="badqtyChange"
|
| | | />
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | label="操作"
|
| | | width="50"
|
| | | align="center"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div class="operationClass">
|
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top">
|
| | | <i
|
| | | class="el-icon-delete"
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | style="margin-left: 7px;"
|
| | | @click="defectDel(row)"
|
| | | />
|
| | | </el-tooltip>
|
| | | </div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <el-divider v-if="activeName==='外协收料'" content-position="left">可收料供应商</el-divider>
|
| | | <div
|
| | | v-for="(item,index) in dialogForm.list"
|
| | | v-if="item.fqty>0"
|
| | | :key="item.name"
|
| | | style="display: flex;line-height: 26px;height: 26px;margin-left:30px;align-items: center"
|
| | | >
|
| | | <div
|
| | | style="color: #fff;width: 22px;height: 22px;display: flex;justify-content: center;align-items: center;border-radius: 50%"
|
| | | :style="{backgroundColor:$store.state.settings.theme}"
|
| | | >{{ index + 1 }}
|
| | | </div>
|
| | | <div style="margin-left:30px;width: 160px;" class="ellipsis">
|
| | | {{ item.tp }}
|
| | | </div>
|
| | | <div style="margin-left:30px;">
|
| | | 可收数量:{{ item.acceptQty }}
|
| | | </div>
|
| | | </div>
|
| | |
|
| | | <el-divider v-if="activeName==='不良待处理'" content-position="left">不良信息明细</el-divider>
|
| | | <el-table
|
| | | v-if="activeName==='不良待处理'"
|
| | | ref="badTableDataDataRef"
|
| | | key="badTableDataDataKey"
|
| | | :data="badTableData"
|
| | | border
|
| | | row-class-name="custom-row"
|
| | | height="300"
|
| | | style="width: 100%;margin-top: 15px;"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | >
|
| | | <el-table-column
|
| | | type="index"
|
| | | label="序号"
|
| | | align="center"
|
| | | width="50"
|
| | | />
|
| | | <!-- <el-table-column-->
|
| | | <!-- prop="step_code"-->
|
| | | <!-- label="工序编码"-->
|
| | | <!-- show-tooltip-when-overflow-->
|
| | | <!-- align="center"-->
|
| | | <!-- />-->
|
| | | <el-table-column
|
| | | prop="stepname"
|
| | | label="工序名称"
|
| | | show-tooltip-when-overflow
|
| | | align="center"
|
| | | />
|
| | | <el-table-column
|
| | | prop="plan_qty"
|
| | | label="任务数量"
|
| | | show-tooltip-when-overflow
|
| | | align="center"
|
| | | />
|
| | | <el-table-column
|
| | | prop="report_qty"
|
| | | label="合格数量"
|
| | | show-tooltip-when-overflow
|
| | | align="center"
|
| | | />
|
| | | <el-table-column
|
| | | prop="ng_qty"
|
| | | label="不良数量"
|
| | | show-tooltip-when-overflow
|
| | | align="center"
|
| | | />
|
| | | <el-table-column
|
| | | prop="defect_name"
|
| | | label="不良原因"
|
| | | show-tooltip-when-overflow
|
| | | align="center"
|
| | | />
|
| | | <el-table-column
|
| | | prop="repair_qty"
|
| | | label="维修合格数量"
|
| | | align="center"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-input
|
| | | v-model="row.repair_qty"
|
| | | placeholder="请输入数量"
|
| | | oninput="value=value.replace(/[^0-9]/g,'')"
|
| | | style="width: 100%"
|
| | | @click.stop=""
|
| | | />
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="laborbad_qty"
|
| | | label="工废数量"
|
| | | align="center"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-input
|
| | | v-model="row.laborbad_qty"
|
| | | placeholder="请输入数量"
|
| | | oninput="value=value.replace(/[^0-9]/g,'')"
|
| | | style="width: 100%"
|
| | | @click.stop=""
|
| | | />
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="materielbad_qty"
|
| | | label="料废数量"
|
| | | align="center"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-input
|
| | | v-model="row.materielbad_qty"
|
| | | placeholder="请输入数量"
|
| | | oninput="value=value.replace(/[^0-9]/g,'')"
|
| | | style="width: 100%"
|
| | | @click.stop=""
|
| | | />
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <!-- <el-table-column-->
|
| | | <!-- prop="badqty"-->
|
| | | <!-- label="不良数量"-->
|
| | | <!-- show-tooltip-when-overflow-->
|
| | | <!-- align="center"-->
|
| | | <!-- >-->
|
| | | <!-- <template slot-scope="{row}">-->
|
| | | <!-- <el-input-->
|
| | | <!-- v-model="row.badqty"-->
|
| | | <!-- placeholder="请输入数量"-->
|
| | | <!-- oninput="value=value.replace(/[^0-9]/g,'')"-->
|
| | | <!-- style="width: 100%"-->
|
| | | <!-- @click.stop=""-->
|
| | | <!-- @change="badqtyChange"-->
|
| | | <!-- />-->
|
| | | <!-- </template>-->
|
| | | <!-- </el-table-column>-->
|
| | |
|
| | | <!-- <el-table-column-->
|
| | | <!-- label="操作"-->
|
| | | <!-- width="50"-->
|
| | | <!-- align="center"-->
|
| | | <!-- >-->
|
| | | <!-- <template slot-scope="{row}">-->
|
| | | <!-- <div class="operationClass">-->
|
| | | <!-- <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top">-->
|
| | | <!-- <i-->
|
| | | <!-- class="el-icon-delete"-->
|
| | | <!-- :style="{color:$store.state.settings.theme}"-->
|
| | | <!-- style="margin-left: 7px;"-->
|
| | | <!-- @click="defectDel(row)"-->
|
| | | <!-- />-->
|
| | | <!-- </el-tooltip>-->
|
| | | <!-- </div>-->
|
| | | <!-- </template>-->
|
| | | <!-- </el-table-column>-->
|
| | |
|
| | | </el-table>
|
| | | </el-form>
|
| | |
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="dialogVisibleCancel">取 消</el-button>
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | :loading="$store.state.app.buttonIsDisabled"
|
| | | :disabled="$store.state.app.buttonIsDisabled"
|
| | | @click="dialogVisibleConfirm"
|
| | | >确 定</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | <!-- 流转小标签打印-->
|
| | | <!--打印预览页面 小标签-->
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | title="预览"
|
| | | :visible.sync="dialogVisible2"
|
| | | width="1140"
|
| | | top="10vh"
|
| | | :close-on-click-modal="false"
|
| | | @close="dialogVisible2Close"
|
| | | >
|
| | | <!-- 要打印的区域 -->
|
| | | <div id="printMe2" style="padding: 30px;">
|
| | | <div
|
| | | style="display: flex;width: 280px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
|
| | | >
|
| | |
|
| | | <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000">
|
| | | <div
|
| | | style="display: flex;height: 90px;border-bottom:1px solid #000;
|
| | | justify-content: center;align-items: center;position: relative"
|
| | | >
|
| | | <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
|
| | | </div>
|
| | | <div
|
| | | style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center"
|
| | | >
|
| | | <div style="margin-left: 5px;width: 28px">数量:</div>
|
| | | {{ qrForm.startqty }}
|
| | | </div>
|
| | | <div style="display: flex;height: 30px;justify-content: flex-start;align-items: center">
|
| | | <div style="margin-left: 5px;width: 42px">处理人:</div>
|
| | | {{ qrForm.operator }}
|
| | | </div>
|
| | | </div>
|
| | |
|
| | | <div style="width:190px;display: flex;flex-direction: column">
|
| | | <div
|
| | | style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"
|
| | | >
|
| | | <div style="width: 60px;margin-left: 5px;">工单编号:</div>
|
| | | <div>{{ qrForm.wo_code }}</div>
|
| | | </div>
|
| | | <div
|
| | | style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left"
|
| | | >
|
| | | <div style="width: 60px;margin-left: 5px;">产品编码:</div>
|
| | | <div>{{ qrForm.partcode }}</div>
|
| | | </div>
|
| | | <div
|
| | | style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
|
| | | >
|
| | | <div style="width:60px;margin-left: 5px;">产品名称:</div>
|
| | | <div>{{ qrForm.partname }}</div>
|
| | | </div>
|
| | | <div
|
| | | style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
|
| | | >
|
| | | <div style="width:60px;margin-left: 5px;">{{ qrForm.nextstepname?'下道工序':'产品规格' }}:</div>
|
| | | <div>{{ qrForm.nextstepname?qrForm.nextstepname:qrForm.partspec?qrForm.partspec:'/' }}</div>
|
| | | </div>
|
| | | <div style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left">
|
| | | <div style="width: 60px;margin-left: 5px;">处理时间:</div>
|
| | | <div>{{ qrForm.operatorTime }}</div>
|
| | | </div>
|
| | |
|
| | | </div>
|
| | |
|
| | | </div>
|
| | | </div>
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="dialogVisible2 = false">取 消</el-button>
|
| | | <el-button v-waves v-print="printObj2" type="primary">确 定</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import Pagination from '@/components/Pagination'
|
| | | import $ from 'jquery'
|
| | | import elDragDialog from '@/directive/el-drag-dialog'
|
| | | import waves from '@/directive/waves'
|
| | | import {
|
| | | EditOrderNgStepSeave,
|
| | | MesOrderNgStepSearch,
|
| | | MesOrderNgSubStepSearch,
|
| | | MesOrderStepSearch, MesOrderStepStart,
|
| | | MesOrderWxStepSearch, SavaMesOrderStepIn, SavaMesOrderStepOut, SavaMesOrderStepReport
|
| | | } from '@/api/WorkOrder'
|
| | | import {
|
| | | CustomerPermissions,
|
| | | DefectPermissions,
|
| | | EqpPermissions,
|
| | | GroupsPermissions,
|
| | | GroupsPersonPermissions,
|
| | | PersonPermissions, PrentOrganizationNoCompany
|
| | | } from '@/api/GeneralBasicData'
|
| | | import { nanoid } from 'nanoid'
|
| | | import { LabelBarCode } from '@/api/systemSetting'
|
| | | import { getCookie } from '@/utils/auth'
|
| | | import { handleDatetime2 } from '@/utils/global'
|
| | | import QRCode from 'qrcodejs2'
|
| | | export default {
|
| | | name: 'StepReport',
|
| | | components: {
|
| | | Pagination
|
| | | },
|
| | | directives: { elDragDialog, waves },
|
| | | data() {
|
| | | return {
|
| | | mainHeight: 0,
|
| | | tableHeight: 0,
|
| | | form: {
|
| | | wkshopcode: '',
|
| | | wocode: '', // 工单号
|
| | | partcode: '', // 产品编码
|
| | | partname: '', // 产品名称
|
| | | partspec: '', // 产品规格
|
| | | prop: 'lm_date', // 排序字段
|
| | | order: 'desc', // 排序字段
|
| | | page: 1, // 第几页
|
| | | rows: 20 // 每页多少条
|
| | | },
|
| | | wkshopcodeArr: [],
|
| | | total: 10,
|
| | | tableData: [],
|
| | | activeName: '生产列表',
|
| | | elTabsArr: [
|
| | | { code: 'ZZ', name: '生产列表' },
|
| | | { code: 'OUT', name: '外协发料' },
|
| | | { code: 'IN', name: '外协收料' },
|
| | | { code: 'BAD', name: '不良待处理' }
|
| | | ],
|
| | |
|
| | | radioSelected: '', // 多选框选中值
|
| | |
|
| | | dialogVisible: false,
|
| | | dialogTitle: '', // 对话框小标题
|
| | |
|
| | | dialogForm: {
|
| | | 'wo_code': '',
|
| | | 'partnumber': '',
|
| | | 'partname': '',
|
| | | 'partspec': '',
|
| | | 'seq': '',
|
| | | 'stepcode': '',
|
| | | 'stepname': '',
|
| | | 'stepprice': '', // 工序单价
|
| | | 'nextstepcode': '',
|
| | | 'nextstepname': '',
|
| | | 'nextstepprice': '',
|
| | | 'stepdesc': '',
|
| | | 'planqty': 0,
|
| | | 'startqty': 0, //
|
| | | 'noreportqty': 0, // 未报数量
|
| | | 'reportqty': 0, // 已报数量
|
| | | 'noputqty': 0, // 不良数量
|
| | | 'wkshopcode': '',
|
| | | 'wkshopname': '',
|
| | | 'eqpcode': '',
|
| | | 'eqpname': '',
|
| | |
|
| | | remarks: '', // 备注
|
| | | inbarcode: '', // 入库条码
|
| | | defectlist: '', // 不良汇总
|
| | | reckway: 'person', // 计件方式(班组:group、个人:person)
|
| | | usergroupcode: '', // 班组编码
|
| | | reportuser: [], // 报工人员
|
| | |
|
| | | wxcode: '',
|
| | | outuser: '',
|
| | | fqty: '',
|
| | | inuser: '',
|
| | | sqty: '',
|
| | | list: ''
|
| | |
|
| | | },
|
| | | dialogFormRules: {
|
| | | eqpcode: [
|
| | | { required: true, message: '请选择报工设备', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | usergroupcode: [
|
| | | { required: true, message: '请选择报工班组', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | reportuser: [
|
| | | { required: true, message: '请选择报工人员', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | startqty: [
|
| | | { required: true, message: '请输入合格数量', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | wxcode: [
|
| | | { required: true, message: '请选择外协供方', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | outuser: [
|
| | | { required: true, message: '请选择发料人员', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | inuser: [
|
| | | { required: true, message: '请选择收料人员', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | fqty: [
|
| | | { required: true, message: '请输入发料数量', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | sqty: [
|
| | | { required: true, message: '请输入收料数量', trigger: ['blur', 'change'] }
|
| | | ]
|
| | |
|
| | | },
|
| | | reckwayArr: [// 报工类型
|
| | | { code: 'group', name: '班组' },
|
| | | { code: 'person', name: '个人' }
|
| | | ],
|
| | | reportuserArr: [], // 报工人员
|
| | | usergroupArr: [], // 报工班组
|
| | | eqpArr: [], // 报工设备
|
| | | defectArr: [], // 不良缺陷
|
| | | wxArr: [], // 往来单位下拉
|
| | |
|
| | | defectTableData: [],
|
| | | badTableData: [],
|
| | | workOrderCurrentValue: '',
|
| | |
|
| | | dialogVisible2: false, //
|
| | | qrForm: { // 打印内容
|
| | | qrvalue: '',
|
| | | startqty: '',
|
| | | wo_code: '',
|
| | | partcode: '',
|
| | | partname: '',
|
| | | partspec: '',
|
| | | nextstepname: '',
|
| | | operator: '', // 操作人
|
| | | operatorTime: ''// 操作时间
|
| | | },
|
| | | printObj2: {
|
| | | id: 'printMe2',
|
| | | popTitle: '打印模板',
|
| | | preview: false,
|
| | | extraHead: '<meta http-equiv="Content-Language" content="zh-cn"/>',
|
| | | closeCallback(vue) { // 关闭打印的回调事件(无法确定点击的是确认还是取消)
|
| | | console.log('11212', vue)
|
| | | // vue.dialogVisible = false
|
| | | vue.dialogVisible2 = false
|
| | | vue.dialogVisible = false
|
| | | },
|
| | | beforeOpenCallback(vue) {
|
| | | vue.printLoading = true
|
| | | console.log('打开之前')
|
| | | },
|
| | | openCallback(vue) {
|
| | | vue.printLoading = false
|
| | | console.log('执行了打印')
|
| | | }
|
| | | },
|
| | | xx: ''
|
| | | }
|
| | | },
|
| | | activated() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
},
created() {
|
| | |
|
| | | },
|
| | | mounted() {
|
| | | window.addEventListener('resize', this.getHeight)
|
| | | this.getHeight()
|
| | |
|
| | | this.tabClick()
|
| | |
|
| | | this.getAllSelectArr()
|
| | | },
|
| | | methods: {
|
| | |
|
| | | async getAllSelectArr() {
|
| | | const { data: res1 } = await GroupsPermissions()// 班组
|
| | | this.usergroupArr = res1
|
| | |
|
| | | const { data: res2 } = await PersonPermissions() // 人员
|
| | | this.reportuserArr = res2
|
| | |
|
| | | const { data: res3 } = await DefectPermissions() // 缺陷
|
| | | this.defectArr = res3
|
| | |
|
| | | const { data: res4 } = await EqpPermissions() // 设备
|
| | | this.eqpArr = res4
|
| | |
|
| | | const { data: res5 } = await CustomerPermissions() // 往来单位
|
| | | this.wxArr = res5
|
| | |
|
| | | const { data: res6 } = await PrentOrganizationNoCompany()// 无公司的组织下拉
|
| | | this.wkshopcodeArr = res6
|
| | | },
|
| | | tabClick() {
|
| | | let belong
|
| | | switch (this.activeName) {
|
| | | case '生产列表':
|
| | | belong = 'produceCodeZZ'
|
| | | this.dialogTitle = '报工'
|
| | | break
|
| | | case '外协发料':
|
| | | belong = 'produceCodeOUT'
|
| | | this.dialogTitle = '发料'
|
| | | break
|
| | | case '外协收料':
|
| | | belong = 'produceCodeIN'
|
| | | this.dialogTitle = '收料'
|
| | | break
|
| | | case '不良待处理':
|
| | | belong = 'produceCodeBAD'
|
| | | this.dialogTitle = '不良处理'
|
| | | break
|
| | | }
|
| | | this.enterNative(this.form.wocode, belong)
|
| | |
|
| | | this.radioSelected = ''
|
| | | },
|
| | | enterNative(val, belong) {
|
| | | if (belong === 'produceCodeZZ') {
|
| | | this.$nextTick(() => {
|
| | | $('input[name=\'produceCodeZZ\']')[0].focus()
|
| | | })
|
| | | }
|
| | | if (belong === 'produceCodeOUT') {
|
| | | this.$nextTick(() => {
|
| | | $('input[name=\'produceCodeOUT\']')[0].focus()
|
| | | })
|
| | | }
|
| | | if (belong === 'produceCodeIN') {
|
| | | this.$nextTick(() => {
|
| | | $('input[name=\'produceCodeIN\']')[0].focus()
|
| | | })
|
| | | }
|
| | | if (belong === 'produceCodeBAD') {
|
| | | this.$nextTick(() => {
|
| | | $('input[name=\'produceCodeBAD\']')[0].focus()
|
| | | })
|
| | | }
|
| | | this.search()
|
| | | },
|
| | | // 排序改变时
|
| | | sortChange({ column, prop, order }) {
|
| | | if (order === 'descending') {
|
| | | order = 'desc'
|
| | | } else if (order === 'ascending') {
|
| | | order = 'asc'
|
| | | } else {
|
| | | order = 'desc'
|
| | | }
|
| | | this.form.order = order
|
| | | this.form.prop = prop
|
| | | this.search()
|
| | | },
|
| | | // 查询
|
| | | async search() {
|
| | | this.form.wocode = this.workOrderCurrentValue
|
| | | this.workOrderCurrentValue = ''
|
| | | if (this.activeName === '生产列表') {
|
| | | const res = await MesOrderStepSearch(this.form)
|
| | | this.tableData = res.data
|
| | | this.total = res.count
|
| | | }
|
| | | if (this.activeName === '外协发料' || this.activeName === '外协收料') {
|
| | | const res = await MesOrderWxStepSearch(this.form)
|
| | | this.tableData = res.data
|
| | | this.total = res.count
|
| | | }
|
| | |
|
| | | if (this.activeName === '不良待处理') {
|
| | | const res = await MesOrderNgStepSearch(this.form)
|
| | | this.tableData = res.data
|
| | | this.total = res.count
|
| | | }
|
| | | },
|
| | | // 报工
|
| | | report(row) {
|
| | | if (row) {
|
| | | this.getMesOrderStepStart('ZZ', '', row.wo_code, row.stepcode)
|
| | | } else {
|
| | | const temp = this.tableData.find(i => i.id === this.radioSelected)
|
| | | this.getMesOrderStepStart('ZZ', '', temp.wo_code, temp.stepcode)
|
| | | }
|
| | | },
|
| | | // 发料
|
| | | sendOut(row) {
|
| | | if (row) {
|
| | | this.getMesOrderStepStart('WX', 'OUT', row.wo_code, row.stepcode)
|
| | | } else {
|
| | | const temp = this.tableData.find(i => i.id === this.radioSelected)
|
| | | this.getMesOrderStepStart('WX', 'OUT', temp.wo_code, temp.stepcode)
|
| | | }
|
| | | },
|
| | | // 收料
|
| | | takeIn(row) {
|
| | | if (row) {
|
| | | this.getMesOrderStepStart('WX', 'IN', row.wo_code, row.stepcode)
|
| | | } else {
|
| | | const temp = this.tableData.find(i => i.id === this.radioSelected)
|
| | | this.getMesOrderStepStart('WX', 'IN', temp.wo_code, temp.stepcode)
|
| | | }
|
| | | },
|
| | | // 不良处理 生产开报工扫码获取工单对应工序任务(不良明细)
|
| | | async handleBad(row) {
|
| | | const data = {
|
| | | wocode: row ? row.wo_code : this.tableData.find(i => i.id === this.radioSelected).wo_code,
|
| | | stepcode: row ? row.stepcode : this.tableData.find(i => i.id === this.radioSelected).stepcode
|
| | | }
|
| | | let res = await MesOrderNgSubStepSearch(data)
|
| | | if (res.code === '200') {
|
| | | res = res.data
|
| | | this.dialogForm.wo_code = res.data1.wo_code
|
| | | this.dialogForm.partnumber = res.data1.partnumber
|
| | | this.dialogForm.partname = res.data1.partname
|
| | | this.dialogForm.partspec = res.data1.partspec
|
| | | this.dialogForm.seq = res.data1.seq
|
| | | this.dialogForm.stepcode = res.data1.stepcode
|
| | | this.dialogForm.stepname = res.data1.stepname
|
| | | this.dialogForm.stepprice = res.data1.stepprice
|
| | | this.dialogForm.nextstepcode = res.data1.nextstepcode
|
| | | this.dialogForm.nextstepname = res.data1.nextstepname
|
| | | this.dialogForm.nextstepprice = res.data1.nextstepprice
|
| | | this.dialogForm.stepdesc = res.data1.stepdesc
|
| | | this.dialogForm.planqty = res.data1.planqty
|
| | | this.dialogForm.startqty = res.data1.startqty
|
| | | this.dialogForm.noreportqty = res.data1.noreportqty // 合格数量
|
| | | this.dialogForm.reportqty = res.data1.reportqty
|
| | | this.dialogForm.noputqty = res.data1.noputqty // 不良数量
|
| | | this.dialogForm.wkshopcode = res.data1.wkshopcode
|
| | | this.dialogForm.wkshopname = res.data1.wkshopname
|
| | | this.dialogForm.eqpcode = res.data1.eqpcode
|
| | | this.dialogForm.eqpname = res.data1.eqpname
|
| | |
|
| | | res.data2.forEach(item => {
|
| | | item.repair_qty = 0
|
| | | item.laborbad_qty = 0
|
| | | item.materielbad_qty = 0
|
| | | })
|
| | |
|
| | | this.badTableData = res.data2
|
| | |
|
| | | this.dialogVisible = true
|
| | | }
|
| | | },
|
| | | // 生产开报工:报工/外协(发料/收料)时条件判断及数据返回接口
|
| | | async getMesOrderStepStart(OperType, SelectType, wocode, stepcode) {
|
| | | const data = {
|
| | | OperType, SelectType, wocode, stepcode
|
| | | }
|
| | | let res = await MesOrderStepStart(data)
|
| | | if (res.code === '200') {
|
| | | res = res.data
|
| | | this.dialogForm.wo_code = res.wo_code
|
| | | this.dialogForm.partnumber = res.partnumber
|
| | | this.dialogForm.partname = res.partname
|
| | | this.dialogForm.partspec = res.partspec
|
| | | this.dialogForm.seq = res.seq
|
| | | this.dialogForm.stepcode = res.stepcode
|
| | | this.dialogForm.stepname = res.stepname
|
| | | this.dialogForm.stepprice = res.stepprice
|
| | | this.dialogForm.nextstepcode = res.nextstepcode
|
| | | this.dialogForm.nextstepname = res.nextstepname
|
| | | this.dialogForm.nextstepprice = res.nextstepprice
|
| | | this.dialogForm.stepdesc = res.stepdesc
|
| | | this.dialogForm.planqty = res.planqty
|
| | | this.dialogForm.startqty = res.startqty
|
| | | this.dialogForm.noreportqty = res.noreportqty// 未报数量
|
| | | this.dialogForm.reportqty = res.reportqty // 已报数量
|
| | | this.dialogForm.noputqty = res.noputqty
|
| | | this.dialogForm.wkshopcode = res.wkshopcode
|
| | | this.dialogForm.wkshopname = res.wkshopname
|
| | | this.dialogForm.eqpcode = res.eqpcode
|
| | | this.dialogForm.eqpname = res.eqpname
|
| | |
|
| | | if (this.activeName === '外协收料') {
|
| | | this.dialogForm.list = []
|
| | | res.list.forEach(i => {
|
| | | i.acceptQty = parseFloat(i.fqty) - parseFloat(i.sqty) - parseFloat(i.ng_qty) - parseFloat(i.laborbad_qty) - parseFloat(i.materielbad_qty)
|
| | | if (i.acceptQty > 0) {
|
| | | this.dialogForm.list.push(i)
|
| | | }
|
| | | })
|
| | | }
|
| | |
|
| | | // this.dialogForm.list = res.list
|
| | |
|
| | | this.dialogVisible = true
|
| | | }
|
| | | },
|
| | | // 对话框关闭事件
|
| | | handleClose() {
|
| | | this.dialogForm = {
|
| | | 'wo_code': '',
|
| | | 'partnumber': '',
|
| | | 'partname': '',
|
| | | 'partspec': '',
|
| | | 'seq': '',
|
| | | 'stepcode': '',
|
| | | 'stepname': '',
|
| | | 'stepprice': '', // 工序单价
|
| | | 'nextstepcode': '',
|
| | | 'nextstepname': '',
|
| | | 'nextstepprice': '',
|
| | | 'stepdesc': '',
|
| | | 'planqty': 0,
|
| | | 'startqty': 0, //
|
| | | 'noreportqty': 0, // 未报数量
|
| | | 'reportqty': 0, // 已报数量
|
| | | 'noputqty': 0, // 不良数量
|
| | | 'wkshopcode': '',
|
| | | 'wkshopname': '',
|
| | | 'eqpcode': '',
|
| | | 'eqpname': '',
|
| | |
|
| | | wxcode: '',
|
| | | outuser: '',
|
| | | fqty: '',
|
| | | inuser: '',
|
| | | sqty: '',
|
| | | list: '',
|
| | |
|
| | | remarks: '', // 备注
|
| | | inbarcode: '', // 入库条码
|
| | | defectlist: '', // 不良汇总
|
| | | reckway: 'person', // 计件方式(班组:group、个人:person)
|
| | | usergroupcode: '', // 班组编码
|
| | | reportuser: [] // 报工人员
|
| | |
|
| | | }
|
| | |
|
| | | this.defectTableData = []
|
| | | this.badTableData = []
|
| | |
|
| | | this.$refs.dialogForm.clearValidate()
|
| | | },
|
| | | // 对话框取消
|
| | | dialogVisibleCancel() {
|
| | | this.dialogVisible = false
|
| | | this.tabClick()
|
| | | },
|
| | | // 对话框确认
|
| | | dialogVisibleConfirm() {
|
| | | this.$refs.dialogForm.validate(async valid => {
|
| | | if (valid) {
|
| | | if (this.activeName === '生产列表') {
|
| | | if (this.defectTableData.find(i => i.code.length === 0)) {
|
| | | return this.$message.info('缺陷编码/名称不能为空!')
|
| | | }
|
| | | if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) {
|
| | | return this.$message.info('不良数量不能为空或为零!')
|
| | | }
|
| | |
|
| | | if (parseFloat(this.dialogForm.noreportqty) < parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.noputqty)) {
|
| | | return this.$message.info('合格数量加不良数量不能大于了未报数量!')
|
| | | }
|
| | | let inbarcode = ''
|
| | | if (this.tableData.find(i => i.id === this.radioSelected).isend === 'Y') {
|
| | | const data1 = {
|
| | | rightcode: getCookie('ruleCode'),
|
| | | partcode: this.dialogForm.partnumber,
|
| | | qty: this.dialogForm.startqty,
|
| | | onelabqty: this.dialogForm.startqty
|
| | | }
|
| | |
|
| | | const res1 = await LabelBarCode(data1)
|
| | | inbarcode = res1.data[0].labcode
|
| | | }
|
| | |
|
| | | const defectlist = []
|
| | | this.defectTableData.forEach(i => {
|
| | | defectlist.push({
|
| | | defect_code: i.code.join(','),
|
| | | badqty: i.badqty
|
| | | })
|
| | | })
|
| | | const data = {
|
| | | mesordercode: this.dialogForm.wo_code,
|
| | | partcode: this.dialogForm.partnumber,
|
| | | stepseq: this.dialogForm.seq,
|
| | | stepcode: this.dialogForm.stepcode,
|
| | | stepprice: this.dialogForm.stepprice,
|
| | | eqpcode: this.dialogForm.eqpcode,
|
| | | inbarcode,
|
| | | reckway: this.dialogForm.reckway,
|
| | | usergroupcode: this.dialogForm.usergroupcode,
|
| | | reportuser: this.dialogForm.reportuser.join(','),
|
| | | taskqty: this.dialogForm.planqty,
|
| | | // startqty: this.dialogForm.startqty,
|
| | | // reportqty: this.dialogForm.reportqty,
|
| | |
|
| | | startqty: this.dialogForm.startqty,
|
| | | reportqty: this.dialogForm.startqty, // 报工数量
|
| | |
|
| | | defectlist,
|
| | | remarks: ''
|
| | | }
|
| | | // console.log(JSON.parse(JSON.stringify(this.defectTableData)))
|
| | | // console.log(JSON.parse(JSON.stringify(data)))
|
| | |
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | const res = await SavaMesOrderStepReport(data)
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('报工成功!')
|
| | | // await this.search()
|
| | | await this.tabClick()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.dialogVisible = false
|
| | |
|
| | | // 自制报工打印标签口子已开好
|
| | | // if (JSON.parse(localStorage.getItem('mesSetting')).every) {
|
| | | // this.dialogVisible2 = true
|
| | | // this.ZZprint2(localStorage.getItem('username'))
|
| | | // }
|
| | | } else {
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.$notify.error('报工失败!')
|
| | | }
|
| | | }
|
| | |
|
| | | if (this.activeName === '外协发料') {
|
| | | if (parseFloat(this.dialogForm.fqty) < 1) {
|
| | | return this.$message.info('发料数量不能为零!')
|
| | | }
|
| | | if (parseFloat(this.dialogForm.fqty) > parseFloat(this.dialogForm.noreportqty)) {
|
| | | return this.$message.info('发料数量不能大于未发数量!')
|
| | | }
|
| | | const data = {
|
| | | mesordercode: this.dialogForm.wo_code,
|
| | | partcode: this.dialogForm.partnumber,
|
| | | stepseq: this.dialogForm.seq,
|
| | | stepcode: this.dialogForm.stepcode,
|
| | |
|
| | | wxcode: this.dialogForm.wxcode,
|
| | | outuser: this.dialogForm.outuser,
|
| | | taskqty: this.dialogForm.planqty,
|
| | | fqty: this.dialogForm.fqty
|
| | | }
|
| | | // console.log(JSON.stringify(data))
|
| | |
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | const res = await SavaMesOrderStepOut(data)
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('发料成功!')
|
| | | // await this.search()
|
| | | await this.tabClick()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.dialogVisible = false
|
| | | } else {
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.$notify.error('发料失败!')
|
| | | }
|
| | | }
|
| | |
|
| | | if (this.activeName === '外协收料') {
|
| | | if (this.defectTableData.find(i => i.code.length === 0)) {
|
| | | return this.$message.info('缺陷编码/名称不能为空!')
|
| | | }
|
| | | if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) {
|
| | | return this.$message.info('不良数量不能为空或为零!')
|
| | | }
|
| | |
|
| | | if (parseFloat(this.dialogForm.noreportqty) < parseFloat(this.dialogForm.sqty) + parseFloat(this.dialogForm.noputqty)) {
|
| | | return this.$message.info('收料数量加不良数量不能大于了可收数量!')
|
| | | }
|
| | |
|
| | | if (this.dialogForm.list.find(i => i.Name === this.dialogForm.wxcode)) {
|
| | | if (this.dialogForm.list.find(i => i.Name === this.dialogForm.wxcode).acceptQty < parseFloat(this.dialogForm.sqty) + parseFloat(this.dialogForm.noputqty)) {
|
| | | return this.$message.info('收料数量加不良数量不能大于该供应商可收数量!')
|
| | | }
|
| | | } else {
|
| | | return this.$message.info('此供应商无可收数量!')
|
| | | }
|
| | |
|
| | | let inbarcode = ''
|
| | | if (this.tableData.find(i => i.id === this.radioSelected).isend === 'Y') {
|
| | | const data1 = {
|
| | | rightcode: getCookie('ruleCode'),
|
| | | partcode: this.dialogForm.partnumber,
|
| | | qty: this.dialogForm.startqty,
|
| | | onelabqty: this.dialogForm.startqty
|
| | | }
|
| | |
|
| | | const res1 = await LabelBarCode(data1)
|
| | | inbarcode = res1.data[0].labcode
|
| | | }
|
| | | const defectlist = []
|
| | | this.defectTableData.forEach(i => {
|
| | | defectlist.push({
|
| | | defect_code: i.code.join(','),
|
| | | badqty: i.badqty
|
| | | })
|
| | | })
|
| | |
|
| | | const data = {
|
| | | mesordercode: this.dialogForm.wo_code,
|
| | | partcode: this.dialogForm.partnumber,
|
| | | stepseq: this.dialogForm.seq,
|
| | | stepcode: this.dialogForm.stepcode,
|
| | |
|
| | | wxcode: this.dialogForm.wxcode,
|
| | | inbarcode,
|
| | | inuser: this.dialogForm.inuser,
|
| | | taskqty: this.dialogForm.planqty,
|
| | | sqty: this.dialogForm.sqty,
|
| | | defectlist,
|
| | | remarks: ''
|
| | | }
|
| | | // console.log(JSON.parse(JSON.stringify(data)), 1)
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | const res = await SavaMesOrderStepIn(data)
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('收料成功!')
|
| | | // await this.search()
|
| | | await this.tabClick()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.dialogVisible = false
|
| | | } else {
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.$notify.error('收料失败!')
|
| | | }
|
| | | }
|
| | |
|
| | | if (this.activeName === '不良待处理') {
|
| | | let flag = false
|
| | | this.badTableData.forEach(i => {
|
| | | if (parseFloat(i.repair_qty) + parseFloat(i.laborbad_qty) + parseFloat(i.materielbad_qty) > parseFloat(i.ng_qty)) {
|
| | | flag = true
|
| | | }
|
| | | })
|
| | | if (flag) {
|
| | | return this.$message.info('维修合格数量+工废数量+料废数量不能大于不良数量!')
|
| | | }
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | const res = await EditOrderNgStepSeave({ Data: this.badTableData })
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('提交成功!')
|
| | | // await this.search()
|
| | | await this.tabClick()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.dialogVisible = false
|
| | | } else {
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.$notify.error('提交失败!')
|
| | | }
|
| | | }
|
| | | }
|
| | | })
|
| | | },
|
| | |
|
| | | dialogVisible2Close() {
|
| | | this.qrForm.qrvalue = ''
|
| | | this.qrForm.startqty = ''
|
| | | this.qrForm.wo_code = ''
|
| | | this.qrForm.partcode = ''
|
| | | this.qrForm.partname = ''
|
| | | this.qrForm.partspec = ''
|
| | | this.qrForm.nextstepname = ''
|
| | | this.qrForm.operator = ''
|
| | | this.qrForm.operatorTime = ''
|
| | | // this.$refs.qrCodeDiv2 = ''
|
| | | },
|
| | |
|
| | | ZZprint2(username) {
|
| | | if (this.dialogForm.nextstepcode !== '') {
|
| | | this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
|
| | | } else {
|
| | | this.qrForm.qrvalue = this.dialogForm.inbarcode
|
| | | }
|
| | |
|
| | | this.qrForm.startqty = this.dialogForm.startqty
|
| | | this.qrForm.wo_code = this.dialogForm.wo_code
|
| | | this.qrForm.partcode = this.dialogForm.partnumber
|
| | | this.qrForm.partname = this.dialogForm.partname
|
| | | this.qrForm.nextstepname = this.dialogForm.nextstepname
|
| | | this.qrForm.operator = username
|
| | | this.qrForm.operatorTime = handleDatetime2(new Date())
|
| | | this.$nextTick(() => {
|
| | | this.bindQRCode(this.qrForm.qrvalue)
|
| | | })
|
| | | },
|
| | | // 生成二维码
|
| | | bindQRCode(text) {
|
| | | new QRCode(this.$refs.qrCodeDiv2, {
|
| | | text: text,
|
| | | // width: 50,
|
| | | width: 60,
|
| | | // height: 50,
|
| | | height: 60,
|
| | | colorDark: '#000', // 二维码颜色
|
| | | colorLight: '#ffffff', // 二维码背景色
|
| | | correctLevel: QRCode.CorrectLevel.L// 容错率,L/M/H
|
| | | })
|
| | | },
|
| | | // 缺陷新增
|
| | | addDefect() {
|
| | | if (this.defectTableData.find(i => i.code.length === 0)) {
|
| | | return this.$message.info('缺陷编码/名称不能为空!')
|
| | | }
|
| | | if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) {
|
| | | return this.$message.info('不良数量不能为空或为零!')
|
| | | }
|
| | |
|
| | | this.defectTableData.push({
|
| | | uuid: nanoid(), code: [], badqty: ''
|
| | | })
|
| | | },
|
| | | // 缺陷删除
|
| | | defectDel(row) {
|
| | | this.defectTableData = this.defectTableData.filter(i => i.uuid !== row.uuid)
|
| | |
|
| | | this.dialogForm.noputqty = 0
|
| | | this.defectTableData.forEach(i => {
|
| | | this.dialogForm.noputqty += parseFloat(i.badqty)
|
| | | })
|
| | | },
|
| | | badqtyChange(val) {
|
| | | this.dialogForm.noputqty = 0
|
| | | this.defectTableData.forEach(i => {
|
| | | this.dialogForm.noputqty += parseFloat(i.badqty)
|
| | | })
|
| | | },
|
| | | reckwayChange(val) {
|
| | | // console.log(val)
|
| | | this.dialogForm.usergroupcode = ''
|
| | | this.dialogForm.reportuser = []
|
| | | },
|
| | | async usergroupChange(val) {
|
| | | const { data: res } = await GroupsPersonPermissions({ groupcode: val })
|
| | | this.dialogForm.reportuser = res[0].usercode_list ? res[0].usercode_list.split(',') : []
|
| | | },
|
| | | rowClick(row, event, column) {
|
| | | this.radioSelected = row.id
|
| | | },
|
| | | // 获取页面高度
|
| | | getHeight() {
|
| | | this.$nextTick(() => {
|
| | | this.mainHeight = window.innerHeight - 85
|
| | | this.tableHeight = this.mainHeight - 275
|
| | | // this.$refs.tableDataRef.doLayout()
|
| | | })
|
| | | },
|
| | | reset() {
|
| | | this.form.wkshopcode = ''
|
| | | this.form.wocode = ''
|
| | | this.form.workOrderCurrentValue = ''
|
| | | this.form.partcode = ''
|
| | | this.form.partname = ''
|
| | | this.form.partspec = ''
|
| | | this.search()
|
| | | },
|
| | |
|
| | | headerCellStyle() {
|
| | | return this.$headerCellStyle
|
| | | },
|
| | | cellStyle() {
|
| | | return this.$cellStyle
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | | <style lang="scss" scoped>
|
| | |
|
| | | ::v-deep .elTableDiv .el-radio__label {
|
| | | display: none !important;
|
| | | }
|
| | |
|
| | | .dialogFormItem {
|
| | | margin: 0 10px 0 0;
|
| | | }
|
| | |
|
| | | .dialogFormItemDiv {
|
| | | width: 200px;
|
| | | }
|
| | |
|
| | | ::v-deep .el-select__caret {
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | }
|
| | |
|
| | | ::v-deep .el-dialog .el-form-item__label {
|
| | | font-weight: lighter !important;
|
| | | }
|
| | |
|
| | | ::v-deep .el-dialog .el-divider__text {
|
| | | font-weight: bolder !important;
|
| | | }
|
| | |
|
| | | </style>
|
| | | <template> |
| | | <div> |
| | | <div class="body" style="padding-top: 10px;" :style="{height:mainHeight+'px'}"> |
| | | |
| | | <div style="position: absolute;right:36px;z-index: 2;top: 13px"> |
| | | <el-button |
| | | v-if="activeName==='生产列表'&&tableData.length>0" |
| | | v-waves |
| | | icon="el-icon-thumb" |
| | | type="primary" |
| | | :disabled="radioSelected===''" |
| | | @click="report()" |
| | | >报工 |
| | | </el-button> |
| | | <el-button |
| | | v-if="activeName==='外协发料'&&tableData.length>0" |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-thumb" |
| | | :disabled="radioSelected===''" |
| | | @click="sendOut()" |
| | | >发料 |
| | | </el-button> |
| | | <el-button |
| | | v-if="activeName==='外协收料'&&tableData.length>0" |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-thumb" |
| | | :disabled="radioSelected===''" |
| | | @click="takeIn()" |
| | | >收料 |
| | | </el-button> |
| | | <el-button |
| | | v-if="activeName==='不良待处理'&&tableData.length>0" |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-thumb" |
| | | :disabled="radioSelected===''" |
| | | @click="handleBad()" |
| | | >处理 |
| | | </el-button> |
| | | </div> |
| | | |
| | | <div v-if="form.wocode" style="position: absolute;left: 460px;z-index: 2;top: 23px;font-weight: bolder"> |
| | | 当前工单号为:{{ form.wocode }} |
| | | </div> |
| | | |
| | | <el-tabs |
| | | ref="elTabs" |
| | | v-model="activeName" |
| | | type="border-card" |
| | | @tab-click="tabClick" |
| | | > |
| | | |
| | | <el-tab-pane |
| | | v-for="item in elTabsArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :name="item.name" |
| | | > |
| | | |
| | | <div class="bodyTopFormGroup"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | label-width="100px" |
| | | inline |
| | | style="display: flex;" |
| | | > |
| | | <div class="elForm"> |
| | | |
| | | <el-form-item label="工单号" style=" display: flex;"> |
| | | <el-input |
| | | v-model="workOrderCurrentValue" |
| | | :name="'produceCode'+item.code" |
| | | placeholder="请扫描或输入" |
| | | style="width: 300px" |
| | | |
| | | @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="产品编码" style=" display: flex;"> |
| | | <el-input |
| | | v-model="form.partcode" |
| | | placeholder="请输入" |
| | | style="width: 200px" |
| | | |
| | | @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="产品名称" style=" display: flex;"> |
| | | <el-input |
| | | v-model="form.partname" |
| | | placeholder="请输入" |
| | | |
| | | style="width: 200px" |
| | | @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="车间名称" style=" display: flex;"> |
| | | <el-select |
| | | v-model="form.wkshopcode" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in wkshopcodeArr" |
| | | :key="item.torg_code" |
| | | :label="item.torg_name" |
| | | :value="item.torg_code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <!-- <el-form-item label="规格型号" style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.partspec" placeholder="请输入" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | |
| | | </div> |
| | | <div |
| | | class="bodySearchReset" |
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}" |
| | | > |
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="search">查询</el-button> |
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button> |
| | | </div> |
| | | </el-form> |
| | | <div |
| | | class="bodyTopFormExpand" |
| | | style="height:5px" |
| | | > |
| | | <!-- <svg-icon--> |
| | | <!-- v-show="mouseHoverType==='mouseout'"--> |
| | | <!-- style="cursor: pointer"--> |
| | | <!-- :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"--> |
| | | <!-- @mouseenter="mouseHoverType=$event.type"--> |
| | | <!-- />--> |
| | | <!-- <svg-icon--> |
| | | <!-- v-show="mouseHoverType==='mouseenter'"--> |
| | | <!-- style="cursor: pointer"--> |
| | | <!-- :icon-class="!isExpandForm?'doubleDown':'doubleUp'"--> |
| | | <!-- @click="isExpandForm=!isExpandForm"--> |
| | | <!-- @mouseout="mouseHoverType=$event.type"--> |
| | | <!-- />--> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | :key="'tableDataRef'+item.code" |
| | | class="tableFixed" |
| | | :data="tableData" |
| | | :height="tableHeight+50" |
| | | border |
| | | row-class-name="custom-row" |
| | | :style="{width: 100+'%',height:tableHeight+'px'}" |
| | | highlight-current-row |
| | | :header-cell-style="headerCellStyle()" |
| | | :cell-style="cellStyle()" |
| | | @sort-change="sortChange" |
| | | @row-click="rowClick" |
| | | > |
| | | <el-table-column |
| | | width="50" |
| | | fixed |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-radio |
| | | v-model="radioSelected" |
| | | :label="row.id" |
| | | style="color: transparent;padding-left: 10px;" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="rowNum" |
| | | width="50" |
| | | label="序号" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | v-if="activeName!=='不良待处理'" |
| | | prop="status" |
| | | show-tooltip-when-overflow |
| | | label="状态" |
| | | sortable="custom" |
| | | width="80" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.status==='NEW'">新订单</div> |
| | | <div v-if="row.status==='ALLO'">已派发</div> |
| | | <div v-if="row.status==='START'">开工</div> |
| | | <div v-if="row.status==='CLOSED'">完工</div> |
| | | <div v-if="row.status==='NOSCHED'">待排程</div> |
| | | <div v-if="row.status==='SCHED'">已排程</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="wo_code" |
| | | label="工单号" |
| | | min-width="160" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partcode" |
| | | label="产品编码" |
| | | min-width="110" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | prop="partname" |
| | | min-width="110" |
| | | show-tooltip-when-overflow |
| | | label="产品名称" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partspec" |
| | | min-width="110" |
| | | show-tooltip-when-overflow |
| | | label="规格型号" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.partspec ? row.partspec : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="wkshp_name" |
| | | min-width="110" |
| | | show-tooltip-when-overflow |
| | | label="车间名称" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="stepname" |
| | | label="工序名称" |
| | | show-tooltip-when-overflow |
| | | width="120" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="plan_qty" |
| | | label="任务数量" |
| | | width="110" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | v-if="activeName==='外协发料'||activeName==='外协收料'" |
| | | prop="fqty" |
| | | show-tooltip-when-overflow |
| | | label="已发料数量" |
| | | sortable="custom" |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="good_qty" |
| | | show-tooltip-when-overflow |
| | | :label="activeName==='外协发料'||activeName==='外协收料'?'已收料数量':'合格数量'" |
| | | sortable="custom" |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="ng_qty" |
| | | label="不良数量" |
| | | show-tooltip-when-overflow |
| | | width="120" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="laborbad_qty" |
| | | label="工废数量" |
| | | width="120" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="materielbad_qty" |
| | | label="料废数量" |
| | | width="120" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | /> |
| | | |
| | | <el-table-column |
| | | label="操作" |
| | | width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-button v-if="activeName==='生产列表'" v-waves icon="el-icon-thumb" type="text" @click="report(row)"> |
| | | 报工 |
| | | </el-button> |
| | | <el-button |
| | | v-if="activeName==='外协发料'" |
| | | v-waves |
| | | icon="el-icon-thumb" |
| | | type="text" |
| | | @click="sendOut(row)" |
| | | >发料 |
| | | </el-button> |
| | | <el-button v-if="activeName==='外协收料'" v-waves icon="el-icon-thumb" type="text" @click="takeIn(row)"> |
| | | 收料 |
| | | </el-button> |
| | | <el-button |
| | | v-if="activeName==='不良待处理'" |
| | | v-waves |
| | | icon="el-icon-thumb" |
| | | type="text" |
| | | @click="handleBad(row)" |
| | | >处理 |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!--分页--> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes" |
| | | popper-class="select_bottom" |
| | | @pagination="search" |
| | | /> |
| | | </el-tab-pane> |
| | | |
| | | </el-tabs> |
| | | |
| | | </div> |
| | | |
| | | <!-- 开报工、外协、不良处理--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="dialogTitle" |
| | | :visible.sync="dialogVisible" |
| | | width="1160px" |
| | | :close-on-click-modal="false" |
| | | :top="activeName==='生产列表'||activeName==='外协收料'? '6vh':'15vh'" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="110px"> |
| | | <!-- <el-divider v-if="activeName==='生产列表'||activeName==='外协收料'||activeName==='不良待处理'" content-position="left">基本信息</el-divider>--> |
| | | <el-divider v-if="activeName==='生产列表'" content-position="left">报工信息</el-divider> |
| | | <el-divider v-if="activeName==='外协收料'" content-position="left">收料信息</el-divider> |
| | | <el-divider v-if="activeName==='不良待处理'" content-position="left">待处理信息</el-divider> |
| | | <el-form-item label="工单编号" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.wo_code }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="产品编码" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.partnumber }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="产品名称" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.partname }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="规格型号" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.partspec ? dialogForm.partspec : '/' }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="当前工序" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.stepname }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="下道工序" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.nextstepname ? dialogForm.nextstepname : '/' }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="任务数量" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.planqty }}</div> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="activeName==='不良待处理'" label="合格数量" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.noreportqty }}</div> |
| | | </el-form-item> |
| | | <el-form-item v-if="activeName==='不良待处理'" label="不良数量" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.noputqty }}</div> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | v-if="activeName!=='不良待处理'" |
| | | :label="activeName==='生产列表'? '未报/已报':(activeName==='外协发料'?'未发/已发':'未收/已收')" |
| | | class="dialogFormItem" |
| | | > |
| | | <div class="dialogFormItemDiv">{{ dialogForm.noreportqty + '/' + dialogForm.reportqty }}</div> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="activeName==='生产列表'||activeName==='外协收料'" label="不良数量" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv" style="color:red;">{{ dialogForm.noputqty }}</div> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="activeName==='生产列表'" label="报工设备" class="dialogFormItem"> |
| | | <el-select |
| | | v-model="dialogForm.eqpcode" |
| | | style="width:200px" |
| | | placeholder="请选择" |
| | | filterable |
| | | clearable |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in eqpArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="activeName==='生产列表'" label="计件方式" class="dialogFormItem"> |
| | | <el-radio-group |
| | | v-model="dialogForm.reckway" |
| | | style="width: 200px;" |
| | | @change="reckwayChange" |
| | | > |
| | | <el-radio label="person">个人</el-radio> |
| | | <el-radio label="group">班组</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | v-if="activeName==='生产列表'" |
| | | :prop="dialogForm.reckway==='group'?'usergroupcode':''" |
| | | label="报工班组" |
| | | class="dialogFormItem" |
| | | > |
| | | <el-select |
| | | v-model="dialogForm.usergroupcode" |
| | | style="width:200px" |
| | | placeholder="请选择" |
| | | filterable |
| | | :disabled="dialogForm.reckway!=='group'" |
| | | :popper-append-to-body="false" |
| | | @change="usergroupChange" |
| | | > |
| | | <el-option |
| | | v-for="item in usergroupArr" |
| | | :key="item.usergroupcode" |
| | | :label="item.usergroupname" |
| | | :value="item.usergroupcode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="activeName==='生产列表'" prop="reportuser" label="报工人员" class="dialogFormItem"> |
| | | <el-select |
| | | v-model="dialogForm.reportuser" |
| | | style="width:200px" |
| | | placeholder="请选择" |
| | | filterable |
| | | multiple |
| | | collapse-tags |
| | | :multiple-limit="dialogForm.reckway==='group'?0:1" |
| | | :disabled="dialogForm.reckway==='group'&&dialogForm.usergroupcode===''" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in reportuserArr" |
| | | :key="item.usercode" |
| | | :label="item.username" |
| | | :value="item.usercode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="activeName==='生产列表'" prop="startqty" label="合格数量" class="dialogFormItem"> |
| | | <el-input v-model="dialogForm.startqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="activeName==='外协发料'||activeName==='外协收料'" prop="wxcode" label="外协供方" class="dialogFormItem"> |
| | | <el-select |
| | | v-model="dialogForm.wxcode" |
| | | style="width:200px" |
| | | placeholder="请选择" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in wxArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="activeName==='外协发料'" prop="outuser" label="发料人员" class="dialogFormItem"> |
| | | <el-select |
| | | v-model="dialogForm.outuser" |
| | | style="width:200px" |
| | | placeholder="请选择" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in reportuserArr" |
| | | :key="item.usercode" |
| | | :label="item.username" |
| | | :value="item.usercode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="activeName==='外协发料'" prop="fqty" label="发料数量" class="dialogFormItem"> |
| | | <el-input v-model="dialogForm.fqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="activeName==='外协收料'" prop="inuser" label="收料人员" class="dialogFormItem"> |
| | | <el-select |
| | | v-model="dialogForm.inuser" |
| | | style="width:200px" |
| | | placeholder="请选择" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in reportuserArr" |
| | | :key="item.usercode" |
| | | :label="item.username" |
| | | :value="item.usercode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="activeName==='外协收料'" prop="sqty" label="收料数量" class="dialogFormItem"> |
| | | <el-input v-model="dialogForm.sqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" /> |
| | | </el-form-item> |
| | | |
| | | <el-divider v-if="activeName==='生产列表'||activeName==='外协收料'" content-position="left">不良明细信息</el-divider> |
| | | <el-button |
| | | v-if="activeName==='生产列表'||activeName==='外协收料'" |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-circle-plus-outline" |
| | | @click="addDefect" |
| | | >新增 |
| | | </el-button> |
| | | <el-table |
| | | v-if="activeName==='生产列表'||activeName==='外协收料'" |
| | | ref="defectTableDataRef" |
| | | key="defectTableDataKey" |
| | | :data="defectTableData" |
| | | border |
| | | row-class-name="custom-row" |
| | | height="200" |
| | | style="width: 100%;margin-top: 15px;" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="序号" |
| | | align="center" |
| | | width="50" |
| | | /> |
| | | <el-table-column |
| | | prop="stepcode" |
| | | label="缺陷编码/名称" |
| | | align="center" |
| | | min-width="450" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-select |
| | | v-model="row.code" |
| | | style="width: 100%" |
| | | placeholder="请选择" |
| | | multiple |
| | | filterable |
| | | > |
| | | <!-- collapse-tags--> |
| | | <el-option |
| | | v-for="item in defectArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="badqty" |
| | | label="不良数量" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input |
| | | v-model="row.badqty" |
| | | placeholder="请输入数量" |
| | | oninput="value=value.replace(/[^0-9]/g,'')" |
| | | style="width: 100%" |
| | | @click.stop="" |
| | | @change="badqtyChange" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="操作" |
| | | width="50" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top"> |
| | | <i |
| | | class="el-icon-delete" |
| | | :style="{color:$store.state.settings.theme}" |
| | | style="margin-left: 7px;" |
| | | @click="defectDel(row)" |
| | | /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <el-divider v-if="activeName==='外协收料'" content-position="left">可收料供应商</el-divider> |
| | | <div |
| | | v-for="(item,index) in dialogForm.list" |
| | | v-if="item.fqty>0" |
| | | :key="item.name" |
| | | style="display: flex;line-height: 26px;height: 26px;margin-left:30px;align-items: center" |
| | | > |
| | | <div |
| | | style="color: #fff;width: 22px;height: 22px;display: flex;justify-content: center;align-items: center;border-radius: 50%" |
| | | :style="{backgroundColor:$store.state.settings.theme}" |
| | | >{{ index + 1 }} |
| | | </div> |
| | | <div style="margin-left:30px;width: 160px;" class="ellipsis"> |
| | | {{ item.tp }} |
| | | </div> |
| | | <div style="margin-left:30px;"> |
| | | 可收数量:{{ item.acceptQty }} |
| | | </div> |
| | | </div> |
| | | |
| | | <el-divider v-if="activeName==='不良待处理'" content-position="left">不良信息明细</el-divider> |
| | | <el-table |
| | | v-if="activeName==='不良待处理'" |
| | | ref="badTableDataDataRef" |
| | | key="badTableDataDataKey" |
| | | :data="badTableData" |
| | | border |
| | | row-class-name="custom-row" |
| | | height="300" |
| | | style="width: 100%;margin-top: 15px;" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="序号" |
| | | align="center" |
| | | width="50" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="step_code"--> |
| | | <!-- label="工序编码"--> |
| | | <!-- show-tooltip-when-overflow--> |
| | | <!-- align="center"--> |
| | | <!-- />--> |
| | | <el-table-column |
| | | prop="stepname" |
| | | label="工序名称" |
| | | show-tooltip-when-overflow |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="plan_qty" |
| | | label="任务数量" |
| | | show-tooltip-when-overflow |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="report_qty" |
| | | label="合格数量" |
| | | show-tooltip-when-overflow |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="ng_qty" |
| | | label="不良数量" |
| | | show-tooltip-when-overflow |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="defect_name" |
| | | label="不良原因" |
| | | show-tooltip-when-overflow |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="repair_qty" |
| | | label="维修合格数量" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input |
| | | v-model="row.repair_qty" |
| | | placeholder="请输入数量" |
| | | oninput="value=value.replace(/[^0-9]/g,'')" |
| | | style="width: 100%" |
| | | @click.stop="" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="laborbad_qty" |
| | | label="工废数量" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input |
| | | v-model="row.laborbad_qty" |
| | | placeholder="请输入数量" |
| | | oninput="value=value.replace(/[^0-9]/g,'')" |
| | | style="width: 100%" |
| | | @click.stop="" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="materielbad_qty" |
| | | label="料废数量" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input |
| | | v-model="row.materielbad_qty" |
| | | placeholder="请输入数量" |
| | | oninput="value=value.replace(/[^0-9]/g,'')" |
| | | style="width: 100%" |
| | | @click.stop="" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <!-- <el-table-column--> |
| | | <!-- prop="badqty"--> |
| | | <!-- label="不良数量"--> |
| | | <!-- show-tooltip-when-overflow--> |
| | | <!-- align="center"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="row.badqty"--> |
| | | <!-- placeholder="请输入数量"--> |
| | | <!-- oninput="value=value.replace(/[^0-9]/g,'')"--> |
| | | <!-- style="width: 100%"--> |
| | | <!-- @click.stop=""--> |
| | | <!-- @change="badqtyChange"--> |
| | | <!-- />--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | |
| | | <!-- <el-table-column--> |
| | | <!-- label="操作"--> |
| | | <!-- width="50"--> |
| | | <!-- align="center"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div class="operationClass">--> |
| | | <!-- <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top">--> |
| | | <!-- <i--> |
| | | <!-- class="el-icon-delete"--> |
| | | <!-- :style="{color:$store.state.settings.theme}"--> |
| | | <!-- style="margin-left: 7px;"--> |
| | | <!-- @click="defectDel(row)"--> |
| | | <!-- />--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | |
| | | </el-table> |
| | | </el-form> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleCancel">取 消</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="dialogVisibleConfirm" |
| | | >确 定</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 流转小标签打印--> |
| | | <!--打印预览页面 小标签--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | title="预览" |
| | | :visible.sync="dialogVisible2" |
| | | width="1140" |
| | | top="10vh" |
| | | :close-on-click-modal="false" |
| | | @close="dialogVisible2Close" |
| | | > |
| | | <!-- 要打印的区域 --> |
| | | <div id="printMe2" style="padding: 30px;"> |
| | | <div |
| | | style="display: flex;width: 280px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;" |
| | | > |
| | | |
| | | <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000"> |
| | | <div |
| | | style="display: flex;height: 90px;border-bottom:1px solid #000; |
| | | justify-content: center;align-items: center;position: relative" |
| | | > |
| | | <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" /> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center" |
| | | > |
| | | <div style="margin-left: 5px;width: 28px">数量:</div> |
| | | {{ qrForm.startqty }} |
| | | </div> |
| | | <div style="display: flex;height: 30px;justify-content: flex-start;align-items: center"> |
| | | <div style="margin-left: 5px;width: 42px">处理人:</div> |
| | | {{ qrForm.operator }} |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="width:190px;display: flex;flex-direction: column"> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width: 60px;margin-left: 5px;">工单编号:</div> |
| | | <div>{{ qrForm.wo_code }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left" |
| | | > |
| | | <div style="width: 60px;margin-left: 5px;">产品编码:</div> |
| | | <div>{{ qrForm.partcode }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width:60px;margin-left: 5px;">产品名称:</div> |
| | | <div>{{ qrForm.partname }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width:60px;margin-left: 5px;">{{ qrForm.nextstepname?'下道工序':'产品规格' }}:</div> |
| | | <div>{{ qrForm.nextstepname?qrForm.nextstepname:qrForm.partspec?qrForm.partspec:'/' }}</div> |
| | | </div> |
| | | <div style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left"> |
| | | <div style="width: 60px;margin-left: 5px;">处理时间:</div> |
| | | <div>{{ qrForm.operatorTime }}</div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisible2 = false">取 消</el-button> |
| | | <el-button v-waves v-print="printObj2" type="primary">确 定</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import $ from 'jquery' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | import { |
| | | EditOrderNgStepSeave, |
| | | MesOrderNgStepSearch, |
| | | MesOrderNgSubStepSearch, |
| | | MesOrderStepSearch, MesOrderStepStart, |
| | | MesOrderWxStepSearch, SavaMesOrderStepIn, SavaMesOrderStepOut, SavaMesOrderStepReport |
| | | } from '@/api/WorkOrder' |
| | | import { |
| | | CustomerPermissions, |
| | | DefectPermissions, |
| | | EqpPermissions, |
| | | GroupsPermissions, |
| | | GroupsPersonPermissions, |
| | | PersonPermissions, PrentOrganizationNoCompany |
| | | } from '@/api/GeneralBasicData' |
| | | import { nanoid } from 'nanoid' |
| | | import { LabelBarCode } from '@/api/systemSetting' |
| | | import { getCookie } from '@/utils/auth' |
| | | import { handleDatetime2 } from '@/utils/global' |
| | | import QRCode from 'qrcodejs2' |
| | | export default { |
| | | name: 'StepReport', |
| | | components: { |
| | | Pagination |
| | | }, |
| | | directives: { elDragDialog, waves }, |
| | | data() { |
| | | return { |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | | wkshopcode: '', |
| | | wocode: '', // 工单号 |
| | | partcode: '', // 产品编码 |
| | | partname: '', // 产品名称 |
| | | partspec: '', // 产品规格 |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc', // 排序字段 |
| | | page: 1, // 第几页 |
| | | rows: 20 // 每页多少条 |
| | | }, |
| | | wkshopcodeArr: [], |
| | | total: 10, |
| | | tableData: [], |
| | | activeName: '生产列表', |
| | | elTabsArr: [ |
| | | { code: 'ZZ', name: '生产列表' }, |
| | | { code: 'OUT', name: '外协发料' }, |
| | | { code: 'IN', name: '外协收料' }, |
| | | { code: 'BAD', name: '不良待处理' } |
| | | ], |
| | | |
| | | radioSelected: '', // 多选框选中值 |
| | | |
| | | dialogVisible: false, |
| | | dialogTitle: '', // 对话框小标题 |
| | | |
| | | dialogForm: { |
| | | 'wo_code': '', |
| | | 'partnumber': '', |
| | | 'partname': '', |
| | | 'partspec': '', |
| | | 'seq': '', |
| | | 'stepcode': '', |
| | | 'stepname': '', |
| | | 'stepprice': '', // 工序单价 |
| | | 'nextstepcode': '', |
| | | 'nextstepname': '', |
| | | 'nextstepprice': '', |
| | | 'stepdesc': '', |
| | | 'planqty': 0, |
| | | 'startqty': 0, // |
| | | 'noreportqty': 0, // 未报数量 |
| | | 'reportqty': 0, // 已报数量 |
| | | 'noputqty': 0, // 不良数量 |
| | | 'wkshopcode': '', |
| | | 'wkshopname': '', |
| | | 'eqpcode': '', |
| | | 'eqpname': '', |
| | | |
| | | remarks: '', // 备注 |
| | | inbarcode: '', // 入库条码 |
| | | defectlist: '', // 不良汇总 |
| | | reckway: 'person', // 计件方式(班组:group、个人:person) |
| | | usergroupcode: '', // 班组编码 |
| | | reportuser: [], // 报工人员 |
| | | |
| | | wxcode: '', |
| | | outuser: '', |
| | | fqty: '', |
| | | inuser: '', |
| | | sqty: '', |
| | | list: '' |
| | | |
| | | }, |
| | | dialogFormRules: { |
| | | eqpcode: [ |
| | | { required: true, message: '请选择报工设备', trigger: ['blur', 'change'] } |
| | | ], |
| | | usergroupcode: [ |
| | | { required: true, message: '请选择报工班组', trigger: ['blur', 'change'] } |
| | | ], |
| | | reportuser: [ |
| | | { required: true, message: '请选择报工人员', trigger: ['blur', 'change'] } |
| | | ], |
| | | startqty: [ |
| | | { required: true, message: '请输入合格数量', trigger: ['blur', 'change'] } |
| | | ], |
| | | wxcode: [ |
| | | { required: true, message: '请选择外协供方', trigger: ['blur', 'change'] } |
| | | ], |
| | | outuser: [ |
| | | { required: true, message: '请选择发料人员', trigger: ['blur', 'change'] } |
| | | ], |
| | | inuser: [ |
| | | { required: true, message: '请选择收料人员', trigger: ['blur', 'change'] } |
| | | ], |
| | | fqty: [ |
| | | { required: true, message: '请输入发料数量', trigger: ['blur', 'change'] } |
| | | ], |
| | | sqty: [ |
| | | { required: true, message: '请输入收料数量', trigger: ['blur', 'change'] } |
| | | ] |
| | | |
| | | }, |
| | | reckwayArr: [// 报工类型 |
| | | { code: 'group', name: '班组' }, |
| | | { code: 'person', name: '个人' } |
| | | ], |
| | | reportuserArr: [], // 报工人员 |
| | | usergroupArr: [], // 报工班组 |
| | | eqpArr: [], // 报工设备 |
| | | defectArr: [], // 不良缺陷 |
| | | wxArr: [], // 往来单位下拉 |
| | | |
| | | defectTableData: [], |
| | | badTableData: [], |
| | | workOrderCurrentValue: '', |
| | | |
| | | dialogVisible2: false, // |
| | | qrForm: { // 打印内容 |
| | | qrvalue: '', |
| | | startqty: '', |
| | | wo_code: '', |
| | | partcode: '', |
| | | partname: '', |
| | | partspec: '', |
| | | nextstepname: '', |
| | | operator: '', // 操作人 |
| | | operatorTime: ''// 操作时间 |
| | | }, |
| | | printObj2: { |
| | | id: 'printMe2', |
| | | popTitle: '打印模板', |
| | | preview: false, |
| | | extraHead: '<meta http-equiv="Content-Language" content="zh-cn"/>', |
| | | closeCallback(vue) { // 关闭打印的回调事件(无法确定点击的是确认还是取消) |
| | | console.log('11212', vue) |
| | | // vue.dialogVisible = false |
| | | vue.dialogVisible2 = false |
| | | vue.dialogVisible = false |
| | | }, |
| | | beforeOpenCallback(vue) { |
| | | vue.printLoading = true |
| | | console.log('打开之前') |
| | | }, |
| | | openCallback(vue) { |
| | | vue.printLoading = false |
| | | console.log('执行了打印') |
| | | } |
| | | }, |
| | | xx: '' |
| | | } |
| | | }, |
| | | activated() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | |
| | | this.tabClick() |
| | | |
| | | this.getAllSelectArr() |
| | | }, |
| | | methods: { |
| | | |
| | | async getAllSelectArr() { |
| | | const { data: res1 } = await GroupsPermissions()// 班组 |
| | | this.usergroupArr = res1 |
| | | |
| | | const { data: res2 } = await PersonPermissions() // 人员 |
| | | this.reportuserArr = res2 |
| | | |
| | | const { data: res3 } = await DefectPermissions() // 缺陷 |
| | | this.defectArr = res3 |
| | | |
| | | const { data: res4 } = await EqpPermissions() // 设备 |
| | | this.eqpArr = res4 |
| | | |
| | | const { data: res5 } = await CustomerPermissions() // 往来单位 |
| | | this.wxArr = res5 |
| | | |
| | | const { data: res6 } = await PrentOrganizationNoCompany()// 无公司的组织下拉 |
| | | this.wkshopcodeArr = res6 |
| | | }, |
| | | tabClick() { |
| | | let belong |
| | | switch (this.activeName) { |
| | | case '生产列表': |
| | | belong = 'produceCodeZZ' |
| | | this.dialogTitle = '报工' |
| | | break |
| | | case '外协发料': |
| | | belong = 'produceCodeOUT' |
| | | this.dialogTitle = '发料' |
| | | break |
| | | case '外协收料': |
| | | belong = 'produceCodeIN' |
| | | this.dialogTitle = '收料' |
| | | break |
| | | case '不良待处理': |
| | | belong = 'produceCodeBAD' |
| | | this.dialogTitle = '不良处理' |
| | | break |
| | | } |
| | | this.enterNative(this.form.wocode, belong) |
| | | |
| | | this.radioSelected = '' |
| | | }, |
| | | enterNative(val, belong) { |
| | | if (belong === 'produceCodeZZ') { |
| | | this.$nextTick(() => { |
| | | $('input[name=\'produceCodeZZ\']')[0].focus() |
| | | }) |
| | | } |
| | | if (belong === 'produceCodeOUT') { |
| | | this.$nextTick(() => { |
| | | $('input[name=\'produceCodeOUT\']')[0].focus() |
| | | }) |
| | | } |
| | | if (belong === 'produceCodeIN') { |
| | | this.$nextTick(() => { |
| | | $('input[name=\'produceCodeIN\']')[0].focus() |
| | | }) |
| | | } |
| | | if (belong === 'produceCodeBAD') { |
| | | this.$nextTick(() => { |
| | | $('input[name=\'produceCodeBAD\']')[0].focus() |
| | | }) |
| | | } |
| | | this.search() |
| | | }, |
| | | // 排序改变时 |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.search() |
| | | }, |
| | | // 查询 |
| | | async search() { |
| | | this.form.wocode = this.workOrderCurrentValue |
| | | this.workOrderCurrentValue = '' |
| | | if (this.activeName === '生产列表') { |
| | | const res = await MesOrderStepSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | } |
| | | if (this.activeName === '外协发料' || this.activeName === '外协收料') { |
| | | const res = await MesOrderWxStepSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | } |
| | | |
| | | if (this.activeName === '不良待处理') { |
| | | const res = await MesOrderNgStepSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | } |
| | | }, |
| | | // 报工 |
| | | report(row) { |
| | | if (row) { |
| | | this.getMesOrderStepStart('ZZ', '', row.wo_code, row.stepcode) |
| | | } else { |
| | | const temp = this.tableData.find(i => i.id === this.radioSelected) |
| | | this.getMesOrderStepStart('ZZ', '', temp.wo_code, temp.stepcode) |
| | | } |
| | | }, |
| | | // 发料 |
| | | sendOut(row) { |
| | | if (row) { |
| | | this.getMesOrderStepStart('WX', 'OUT', row.wo_code, row.stepcode) |
| | | } else { |
| | | const temp = this.tableData.find(i => i.id === this.radioSelected) |
| | | this.getMesOrderStepStart('WX', 'OUT', temp.wo_code, temp.stepcode) |
| | | } |
| | | }, |
| | | // 收料 |
| | | takeIn(row) { |
| | | if (row) { |
| | | this.getMesOrderStepStart('WX', 'IN', row.wo_code, row.stepcode) |
| | | } else { |
| | | const temp = this.tableData.find(i => i.id === this.radioSelected) |
| | | this.getMesOrderStepStart('WX', 'IN', temp.wo_code, temp.stepcode) |
| | | } |
| | | }, |
| | | // 不良处理 生产开报工扫码获取工单对应工序任务(不良明细) |
| | | async handleBad(row) { |
| | | const data = { |
| | | wocode: row ? row.wo_code : this.tableData.find(i => i.id === this.radioSelected).wo_code, |
| | | stepcode: row ? row.stepcode : this.tableData.find(i => i.id === this.radioSelected).stepcode |
| | | } |
| | | let res = await MesOrderNgSubStepSearch(data) |
| | | if (res.code === '200') { |
| | | res = res.data |
| | | this.dialogForm.wo_code = res.data1.wo_code |
| | | this.dialogForm.partnumber = res.data1.partnumber |
| | | this.dialogForm.partname = res.data1.partname |
| | | this.dialogForm.partspec = res.data1.partspec |
| | | this.dialogForm.seq = res.data1.seq |
| | | this.dialogForm.stepcode = res.data1.stepcode |
| | | this.dialogForm.stepname = res.data1.stepname |
| | | this.dialogForm.stepprice = res.data1.stepprice |
| | | this.dialogForm.nextstepcode = res.data1.nextstepcode |
| | | this.dialogForm.nextstepname = res.data1.nextstepname |
| | | this.dialogForm.nextstepprice = res.data1.nextstepprice |
| | | this.dialogForm.stepdesc = res.data1.stepdesc |
| | | this.dialogForm.planqty = res.data1.planqty |
| | | this.dialogForm.startqty = res.data1.startqty |
| | | this.dialogForm.noreportqty = res.data1.noreportqty // 合格数量 |
| | | this.dialogForm.reportqty = res.data1.reportqty |
| | | this.dialogForm.noputqty = res.data1.noputqty // 不良数量 |
| | | this.dialogForm.wkshopcode = res.data1.wkshopcode |
| | | this.dialogForm.wkshopname = res.data1.wkshopname |
| | | this.dialogForm.eqpcode = res.data1.eqpcode |
| | | this.dialogForm.eqpname = res.data1.eqpname |
| | | |
| | | res.data2.forEach(item => { |
| | | item.repair_qty = 0 |
| | | item.laborbad_qty = 0 |
| | | item.materielbad_qty = 0 |
| | | }) |
| | | |
| | | this.badTableData = res.data2 |
| | | |
| | | this.dialogVisible = true |
| | | } |
| | | }, |
| | | // 生产开报工:报工/外协(发料/收料)时条件判断及数据返回接口 |
| | | async getMesOrderStepStart(OperType, SelectType, wocode, stepcode) { |
| | | const data = { |
| | | OperType, SelectType, wocode, stepcode |
| | | } |
| | | let res = await MesOrderStepStart(data) |
| | | if (res.code === '200') { |
| | | res = res.data |
| | | this.dialogForm.wo_code = res.wo_code |
| | | this.dialogForm.partnumber = res.partnumber |
| | | this.dialogForm.partname = res.partname |
| | | this.dialogForm.partspec = res.partspec |
| | | this.dialogForm.seq = res.seq |
| | | this.dialogForm.stepcode = res.stepcode |
| | | this.dialogForm.stepname = res.stepname |
| | | this.dialogForm.stepprice = res.stepprice |
| | | this.dialogForm.nextstepcode = res.nextstepcode |
| | | this.dialogForm.nextstepname = res.nextstepname |
| | | this.dialogForm.nextstepprice = res.nextstepprice |
| | | this.dialogForm.stepdesc = res.stepdesc |
| | | this.dialogForm.planqty = res.planqty |
| | | this.dialogForm.startqty = res.startqty |
| | | this.dialogForm.noreportqty = res.noreportqty// 未报数量 |
| | | this.dialogForm.reportqty = res.reportqty // 已报数量 |
| | | this.dialogForm.noputqty = res.noputqty |
| | | this.dialogForm.wkshopcode = res.wkshopcode |
| | | this.dialogForm.wkshopname = res.wkshopname |
| | | this.dialogForm.eqpcode = res.eqpcode |
| | | this.dialogForm.eqpname = res.eqpname |
| | | |
| | | if (this.activeName === '外协收料') { |
| | | this.dialogForm.list = [] |
| | | res.list.forEach(i => { |
| | | i.acceptQty = parseFloat(i.fqty) - parseFloat(i.sqty) - parseFloat(i.ng_qty) - parseFloat(i.laborbad_qty) - parseFloat(i.materielbad_qty) |
| | | if (i.acceptQty > 0) { |
| | | this.dialogForm.list.push(i) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // this.dialogForm.list = res.list |
| | | |
| | | this.dialogVisible = true |
| | | } |
| | | }, |
| | | // 对话框关闭事件 |
| | | handleClose() { |
| | | this.dialogForm = { |
| | | 'wo_code': '', |
| | | 'partnumber': '', |
| | | 'partname': '', |
| | | 'partspec': '', |
| | | 'seq': '', |
| | | 'stepcode': '', |
| | | 'stepname': '', |
| | | 'stepprice': '', // 工序单价 |
| | | 'nextstepcode': '', |
| | | 'nextstepname': '', |
| | | 'nextstepprice': '', |
| | | 'stepdesc': '', |
| | | 'planqty': 0, |
| | | 'startqty': 0, // |
| | | 'noreportqty': 0, // 未报数量 |
| | | 'reportqty': 0, // 已报数量 |
| | | 'noputqty': 0, // 不良数量 |
| | | 'wkshopcode': '', |
| | | 'wkshopname': '', |
| | | 'eqpcode': '', |
| | | 'eqpname': '', |
| | | |
| | | wxcode: '', |
| | | outuser: '', |
| | | fqty: '', |
| | | inuser: '', |
| | | sqty: '', |
| | | list: '', |
| | | |
| | | remarks: '', // 备注 |
| | | inbarcode: '', // 入库条码 |
| | | defectlist: '', // 不良汇总 |
| | | reckway: 'person', // 计件方式(班组:group、个人:person) |
| | | usergroupcode: '', // 班组编码 |
| | | reportuser: [] // 报工人员 |
| | | |
| | | } |
| | | |
| | | this.defectTableData = [] |
| | | this.badTableData = [] |
| | | |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // 对话框取消 |
| | | dialogVisibleCancel() { |
| | | this.dialogVisible = false |
| | | this.tabClick() |
| | | }, |
| | | // 对话框确认 |
| | | dialogVisibleConfirm() { |
| | | this.$refs.dialogForm.validate(async valid => { |
| | | if (valid) { |
| | | if (this.activeName === '生产列表') { |
| | | if (this.defectTableData.find(i => i.code.length === 0)) { |
| | | return this.$message.info('缺陷编码/名称不能为空!') |
| | | } |
| | | if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) { |
| | | return this.$message.info('不良数量不能为空或为零!') |
| | | } |
| | | |
| | | if (parseFloat(this.dialogForm.noreportqty) < parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | return this.$message.info('合格数量加不良数量不能大于了未报数量!') |
| | | } |
| | | |
| | | if (parseFloat(this.dialogForm.startqty) === 0 && this.defectTableData.length === 0) { |
| | | return this.$message.info('合格数量不能为零!') |
| | | } |
| | | |
| | | let inbarcode = '' |
| | | if (this.tableData.find(i => i.id === this.radioSelected).isend === 'Y') { |
| | | const data1 = { |
| | | rightcode: getCookie('ruleCode'), |
| | | partcode: this.dialogForm.partnumber, |
| | | qty: this.dialogForm.startqty, |
| | | onelabqty: this.dialogForm.startqty |
| | | } |
| | | |
| | | const res1 = await LabelBarCode(data1) |
| | | inbarcode = res1.data[0].labcode |
| | | } |
| | | |
| | | const defectlist = [] |
| | | this.defectTableData.forEach(i => { |
| | | defectlist.push({ |
| | | defect_code: i.code.join(','), |
| | | badqty: i.badqty |
| | | }) |
| | | }) |
| | | const data = { |
| | | mesordercode: this.dialogForm.wo_code, |
| | | partcode: this.dialogForm.partnumber, |
| | | stepseq: this.dialogForm.seq, |
| | | stepcode: this.dialogForm.stepcode, |
| | | stepprice: this.dialogForm.stepprice, |
| | | eqpcode: this.dialogForm.eqpcode, |
| | | inbarcode, |
| | | reckway: this.dialogForm.reckway, |
| | | usergroupcode: this.dialogForm.usergroupcode, |
| | | reportuser: this.dialogForm.reportuser.join(','), |
| | | taskqty: this.dialogForm.planqty, |
| | | // startqty: this.dialogForm.startqty, |
| | | // reportqty: this.dialogForm.reportqty, |
| | | |
| | | startqty: this.dialogForm.startqty, |
| | | reportqty: this.dialogForm.startqty, // 报工数量 |
| | | |
| | | defectlist, |
| | | remarks: '' |
| | | } |
| | | // console.log(JSON.parse(JSON.stringify(this.defectTableData))) |
| | | // console.log(JSON.parse(JSON.stringify(data))) |
| | | |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const res = await SavaMesOrderStepReport(data) |
| | | if (res.code === '200') { |
| | | this.$notify.success('报工成功!') |
| | | // await this.search() |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.dialogVisible = false |
| | | |
| | | // 自制报工打印标签口子已开好 |
| | | // if (JSON.parse(localStorage.getItem('mesSetting')).every) { |
| | | // this.dialogVisible2 = true |
| | | // this.ZZprint2(localStorage.getItem('username')) |
| | | // } |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error('报工失败!') |
| | | } |
| | | } |
| | | |
| | | if (this.activeName === '外协发料') { |
| | | if (parseFloat(this.dialogForm.fqty) < 1) { |
| | | return this.$message.info('发料数量不能为零!') |
| | | } |
| | | if (parseFloat(this.dialogForm.fqty) > parseFloat(this.dialogForm.noreportqty)) { |
| | | return this.$message.info('发料数量不能大于未发数量!') |
| | | } |
| | | const data = { |
| | | mesordercode: this.dialogForm.wo_code, |
| | | partcode: this.dialogForm.partnumber, |
| | | stepseq: this.dialogForm.seq, |
| | | stepcode: this.dialogForm.stepcode, |
| | | |
| | | wxcode: this.dialogForm.wxcode, |
| | | outuser: this.dialogForm.outuser, |
| | | taskqty: this.dialogForm.planqty, |
| | | fqty: this.dialogForm.fqty |
| | | } |
| | | // console.log(JSON.stringify(data)) |
| | | |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const res = await SavaMesOrderStepOut(data) |
| | | if (res.code === '200') { |
| | | this.$notify.success('发料成功!') |
| | | // await this.search() |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.dialogVisible = false |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error('发料失败!') |
| | | } |
| | | } |
| | | |
| | | if (this.activeName === '外协收料') { |
| | | if (this.defectTableData.find(i => i.code.length === 0)) { |
| | | return this.$message.info('缺陷编码/名称不能为空!') |
| | | } |
| | | if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) { |
| | | return this.$message.info('不良数量不能为空或为零!') |
| | | } |
| | | |
| | | if (parseFloat(this.dialogForm.noreportqty) < parseFloat(this.dialogForm.sqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | return this.$message.info('收料数量加不良数量不能大于了可收数量!') |
| | | } |
| | | |
| | | if (this.dialogForm.list.find(i => i.Name === this.dialogForm.wxcode)) { |
| | | if (this.dialogForm.list.find(i => i.Name === this.dialogForm.wxcode).acceptQty < parseFloat(this.dialogForm.sqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | return this.$message.info('收料数量加不良数量不能大于该供应商可收数量!') |
| | | } |
| | | } else { |
| | | return this.$message.info('此供应商无可收数量!') |
| | | } |
| | | |
| | | let inbarcode = '' |
| | | if (this.tableData.find(i => i.id === this.radioSelected).isend === 'Y') { |
| | | const data1 = { |
| | | rightcode: getCookie('ruleCode'), |
| | | partcode: this.dialogForm.partnumber, |
| | | qty: this.dialogForm.startqty, |
| | | onelabqty: this.dialogForm.startqty |
| | | } |
| | | |
| | | const res1 = await LabelBarCode(data1) |
| | | inbarcode = res1.data[0].labcode |
| | | } |
| | | const defectlist = [] |
| | | this.defectTableData.forEach(i => { |
| | | defectlist.push({ |
| | | defect_code: i.code.join(','), |
| | | badqty: i.badqty |
| | | }) |
| | | }) |
| | | |
| | | const data = { |
| | | mesordercode: this.dialogForm.wo_code, |
| | | partcode: this.dialogForm.partnumber, |
| | | stepseq: this.dialogForm.seq, |
| | | stepcode: this.dialogForm.stepcode, |
| | | |
| | | wxcode: this.dialogForm.wxcode, |
| | | inbarcode, |
| | | inuser: this.dialogForm.inuser, |
| | | taskqty: this.dialogForm.planqty, |
| | | sqty: this.dialogForm.sqty, |
| | | defectlist, |
| | | remarks: '' |
| | | } |
| | | // console.log(JSON.parse(JSON.stringify(data)), 1) |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const res = await SavaMesOrderStepIn(data) |
| | | if (res.code === '200') { |
| | | this.$notify.success('收料成功!') |
| | | // await this.search() |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.dialogVisible = false |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error('收料失败!') |
| | | } |
| | | } |
| | | |
| | | if (this.activeName === '不良待处理') { |
| | | let flag = false |
| | | this.badTableData.forEach(i => { |
| | | if (parseFloat(i.repair_qty) + parseFloat(i.laborbad_qty) + parseFloat(i.materielbad_qty) > parseFloat(i.ng_qty)) { |
| | | flag = true |
| | | } |
| | | }) |
| | | if (flag) { |
| | | return this.$message.info('维修合格数量+工废数量+料废数量不能大于不良数量!') |
| | | } |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const res = await EditOrderNgStepSeave({ Data: this.badTableData }) |
| | | if (res.code === '200') { |
| | | this.$notify.success('提交成功!') |
| | | // await this.search() |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.dialogVisible = false |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error('提交失败!') |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | dialogVisible2Close() { |
| | | this.qrForm.qrvalue = '' |
| | | this.qrForm.startqty = '' |
| | | this.qrForm.wo_code = '' |
| | | this.qrForm.partcode = '' |
| | | this.qrForm.partname = '' |
| | | this.qrForm.partspec = '' |
| | | this.qrForm.nextstepname = '' |
| | | this.qrForm.operator = '' |
| | | this.qrForm.operatorTime = '' |
| | | // this.$refs.qrCodeDiv2 = '' |
| | | }, |
| | | |
| | | ZZprint2(username) { |
| | | if (this.dialogForm.nextstepcode !== '') { |
| | | this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode |
| | | } else { |
| | | this.qrForm.qrvalue = this.dialogForm.inbarcode |
| | | } |
| | | |
| | | this.qrForm.startqty = this.dialogForm.startqty |
| | | this.qrForm.wo_code = this.dialogForm.wo_code |
| | | this.qrForm.partcode = this.dialogForm.partnumber |
| | | this.qrForm.partname = this.dialogForm.partname |
| | | this.qrForm.nextstepname = this.dialogForm.nextstepname |
| | | this.qrForm.operator = username |
| | | this.qrForm.operatorTime = handleDatetime2(new Date()) |
| | | this.$nextTick(() => { |
| | | this.bindQRCode(this.qrForm.qrvalue) |
| | | }) |
| | | }, |
| | | // 生成二维码 |
| | | bindQRCode(text) { |
| | | new QRCode(this.$refs.qrCodeDiv2, { |
| | | text: text, |
| | | // width: 50, |
| | | width: 60, |
| | | // height: 50, |
| | | height: 60, |
| | | colorDark: '#000', // 二维码颜色 |
| | | colorLight: '#ffffff', // 二维码背景色 |
| | | correctLevel: QRCode.CorrectLevel.L// 容错率,L/M/H |
| | | }) |
| | | }, |
| | | // 缺陷新增 |
| | | addDefect() { |
| | | if (this.defectTableData.find(i => i.code.length === 0)) { |
| | | return this.$message.info('缺陷编码/名称不能为空!') |
| | | } |
| | | if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) { |
| | | return this.$message.info('不良数量不能为空或为零!') |
| | | } |
| | | |
| | | this.defectTableData.push({ |
| | | uuid: nanoid(), code: [], badqty: '' |
| | | }) |
| | | }, |
| | | // 缺陷删除 |
| | | defectDel(row) { |
| | | this.defectTableData = this.defectTableData.filter(i => i.uuid !== row.uuid) |
| | | |
| | | this.dialogForm.noputqty = 0 |
| | | this.defectTableData.forEach(i => { |
| | | this.dialogForm.noputqty += parseFloat(i.badqty) |
| | | }) |
| | | }, |
| | | badqtyChange(val) { |
| | | this.dialogForm.noputqty = 0 |
| | | this.defectTableData.forEach(i => { |
| | | this.dialogForm.noputqty += parseFloat(i.badqty) |
| | | }) |
| | | }, |
| | | reckwayChange(val) { |
| | | // console.log(val) |
| | | this.dialogForm.usergroupcode = '' |
| | | this.dialogForm.reportuser = [] |
| | | }, |
| | | async usergroupChange(val) { |
| | | const { data: res } = await GroupsPersonPermissions({ groupcode: val }) |
| | | this.dialogForm.reportuser = res[0].usercode_list ? res[0].usercode_list.split(',') : [] |
| | | }, |
| | | rowClick(row, event, column) { |
| | | this.radioSelected = row.id |
| | | }, |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 275 |
| | | // this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | }, |
| | | reset() { |
| | | this.form.wkshopcode = '' |
| | | this.form.wocode = '' |
| | | this.form.workOrderCurrentValue = '' |
| | | this.form.partcode = '' |
| | | this.form.partname = '' |
| | | this.form.partspec = '' |
| | | this.search() |
| | | }, |
| | | |
| | | headerCellStyle() { |
| | | return this.$headerCellStyle |
| | | }, |
| | | cellStyle() { |
| | | return this.$cellStyle |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | |
| | | ::v-deep .elTableDiv .el-radio__label { |
| | | display: none !important; |
| | | } |
| | | |
| | | .dialogFormItem { |
| | | margin: 0 10px 0 0; |
| | | } |
| | | |
| | | .dialogFormItemDiv { |
| | | width: 200px; |
| | | } |
| | | |
| | | ::v-deep .el-select__caret { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | ::v-deep .el-dialog .el-form-item__label { |
| | | font-weight: lighter !important; |
| | | } |
| | | |
| | | ::v-deep .el-dialog .el-divider__text { |
| | | font-weight: bolder !important; |
| | | } |
| | | |
| | | </style> |