报工记录修改

yangwl
LAPTOP-R6EHHS26\86155 8 months ago
parent e2b4129452
commit 1fd4cc98e9

@ -1,63 +1,41 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="98px">
<el-form-item label="生产订单编码" prop="orderCode"> <el-form-item label="生产订单编码" prop="orderCode">
<el-input <el-input v-model="queryParams.orderCode" placeholder="请输入生产订单编码" clearable
v-model="queryParams.orderCode" @keyup.enter.native="handleQuery" />
placeholder="请输入生产订单编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="生产工单编码" prop="workorderCode"> <el-form-item label="生产工单编码" prop="workorderCode">
<el-input <el-input v-model="queryParams.workorderCode" placeholder="请输入生产工单编码" clearable
v-model="queryParams.workorderCode" @keyup.enter.native="handleQuery" />
placeholder="请输入生产工单编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="产品编码" prop="productCode"> <el-form-item label="产品编码" prop="productCode">
<el-input <el-input v-model="queryParams.productCode" placeholder="请输入产品编码" clearable
v-model="queryParams.productCode" @keyup.enter.native="handleQuery" />
placeholder="请输入产品编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
</el-form-item> </el-form-item>
<el-form-item label="产品名称" prop="productName"> <el-form-item label="产品名称" prop="productName">
<el-input <el-input v-model="queryParams.productName" placeholder="请输入产品名称" clearable
v-model="queryParams.productName" @keyup.enter.native="handleQuery" />
placeholder="请输入产品名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="生产时间" prop="feedbackTimeArray"> <el-form-item label="生产时间" prop="feedbackTimeArray">
<el-date-picker <el-date-picker v-model="queryParams.feedbackTimeArray" format="yyyy-MM-dd" type="datetimerange"
v-model="queryParams.feedbackTimeArray" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
format="yyyy-MM-dd"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="SAP报工结果" prop="uploadStatus"> <el-form-item label="SAP报工结果" prop="uploadStatus">
<el-select v-model="queryParams.uploadStatus" placeholder="请选择结果" clearable> <el-select v-model="queryParams.uploadStatus" placeholder="请选择结果" clearable>
<el-option <el-option v-for="item in uploadStatusList" :key="item.dictValue" :label="item.dictLabel"
v-for="item in uploadStatusList"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"> :value="item.dictValue">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item <el-button type="primary" icon="el-icon-search" size="mini"
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
@ -96,100 +74,49 @@
</el-col> </el-col>
--> -->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
type="success" @click="handleReportHz" v-hasPermi="['mes:reportWork:report']">报工信息维护</el-button>
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleReportHz"
v-hasPermi="['mes:reportWork:report']"
>报工信息维护</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="danger" plain icon="el-icon-s-release" size="mini" :disabled="single"
type="danger" @click="handleConsumeHz" v-hasPermi="['mes:reportWork:report']">报工损耗</el-button>
plain
icon="el-icon-s-release"
size="mini"
:disabled="single"
@click="handleConsumeHz"
v-hasPermi="['mes:reportWork:report']"
>报工损耗</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="primary" plain icon="el-icon-s-claim" size="mini" :disabled="single"
type="primary" @click="handleReport" v-hasPermi="['mes:reportWork:edit']">报工SAP</el-button>
plain
icon="el-icon-s-claim"
size="mini"
:disabled="single"
@click="handleReport"
v-hasPermi="['mes:reportWork:edit']"
>报工SAP</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="primary" plain icon="el-icon-s-claim" size="mini" :disabled="single"
type="primary" @click="handleReportCancel" v-hasPermi="['mes:reportWork:edit']">撤销报工SAP</el-button>
plain
icon="el-icon-s-claim"
size="mini"
:disabled="single"
@click="handleReportCancel"
v-hasPermi="['mes:reportWork:edit']"
>撤销报工SAP</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
type="warning" v-hasPermi="['mes:reportWork:export']">导出</el-button>
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:reportWork:export']"
>导出</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddSAP">SAP</el-button>
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAddSAP"
>SAP收货</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="success" plain :disabled="single" icon="el-icon-download" size="mini"
type="success" @click="showPrint">打印预览
plain
:disabled="single"
icon="el-icon-download"
size="mini"
@click="showPrint"
>打印预览
</el-button> </el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="reportWorkList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :ref="tableIndex" :data="reportWorkList"
@selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" /> <el-table-column type="selection" align="center" />
<el-table-column label="工单编码" align="center" prop="workorderCode" width="130"> <el-table-column label="工单编码" align="center" prop="workorderCode" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button type="text" @click="handleReportHz(scope.row)">{{ scope.row.workorderCode }}</el-button>
type="text"
@click="handleReportHz(scope.row)"
>{{scope.row.workorderCode}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单编码" align="center" prop="workorderCodeSap" width="130" <el-table-column label="订单编码" align="center" prop="workorderCodeSap" width="130"
:formatter="orderCodeFormate" :formatter="orderCodeFormate" />
/>
<el-table-column label="产品编码" align="center" prop="productCode" width="130" <el-table-column label="产品编码" align="center" prop="productCode" width="130"
:formatter="productCodeFormate" :formatter="productCodeFormate" />
/>
<el-table-column label="线体编码" align="center" prop="machineCode" /> <el-table-column label="线体编码" align="center" prop="machineCode" />
<el-table-column label="线体名称" align="center" prop="machineName" /> <el-table-column label="线体名称" align="center" prop="machineName" />
<el-table-column label="产品名称" align="center" prop="productName" width="220" :show-overflow-tooltip="true" /> <el-table-column label="产品名称" align="center" prop="productName" width="220" :show-overflow-tooltip="true" />
@ -201,23 +128,16 @@
<el-table-column label="生产时间" align="center" prop="productDate" width="100" /> <el-table-column label="生产时间" align="center" prop="productDate" width="100" />
<el-table-column label="SAP报工状态" align="center" prop="uploadStatus" width="150"> <el-table-column label="SAP报工状态" align="center" prop="uploadStatus" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag :options="dict.type.report_sap_status" :value="scope.row.uploadStatus" />
:options="dict.type.report_sap_status"
:value="scope.row.uploadStatus"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="SAP报工时间" align="center" prop="uploadTime" width="150" /> <el-table-column label="SAP报工时间" align="center" prop="uploadTime" width="150" />
<el-table-column label="SAP报工信息" align="center" prop="uploadMsg" width="150" :show-overflow-tooltip="true"/> <el-table-column label="SAP报工信息" align="center" prop="uploadMsg" width="150"
:show-overflow-tooltip="true" />
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
v-show="total>0" :limit.sync="queryParams.pageSize" @pagination="getList" />
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改报工报表对话框 --> <!-- 添加或修改报工报表对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
@ -234,7 +154,8 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item label="报工人员姓名" prop="nickName"> <el-form-item label="报工人员姓名" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入报工人员"> <el-input v-model="form.nickName" placeholder="请输入报工人员">
<el-button slot="append" @click="handleSelectUser" icon="el-icon-search"></el-button> <el-button slot="append" @click="handleSelectUser"
icon="el-icon-search"></el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -252,7 +173,8 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item label="生产工单编码" prop="workorderCode"> <el-form-item label="生产工单编码" prop="workorderCode">
<el-input v-model="form.workorderCode" placeholder="请选择生产工单"> <el-input v-model="form.workorderCode" placeholder="请选择生产工单">
<el-button slot="append" @click="handleSelectWorkOrder" icon="el-icon-search"></el-button> <el-button slot="append" @click="handleSelectWorkOrder"
icon="el-icon-search"></el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -261,22 +183,16 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item label="批次编码" prop="batch"> <el-form-item label="批次编码" prop="batch">
<el-select v-model="form.batch" class="selectItem" placeholder="请选择批次" clearable> <el-select v-model="form.batch" class="selectItem" placeholder="请选择批次" clearable>
<el-option v-for="(item,index) in batchList" <el-option v-for="(item, index) in batchList" :key="index"
:key="index" :label="item.batchCode" :value="item.batchCode">
:label="item.batchCode"
:value="item.batchCode">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="报工时间" prop="feedbackTime"> <el-form-item label="报工时间" prop="feedbackTime">
<el-date-picker clearable <el-date-picker clearable v-model="form.feedbackTime" type="date"
v-model="form.feedbackTime" value-format="yyyy-MM-dd" style="width: 180px" placeholder="请选择报工时间">
type="date"
value-format="yyyy-MM-dd"
style="width: 180px"
placeholder="请选择报工时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -291,7 +207,8 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item label="线体名称" prop="machineName"> <el-form-item label="线体名称" prop="machineName">
<el-input v-model="form.machineName" placeholder="请选择线体名称"> <el-input v-model="form.machineName" placeholder="请选择线体名称">
<el-button slot="append" @click="handleSelectEquip" icon="el-icon-search"></el-button> <el-button slot="append" @click="handleSelectEquip"
icon="el-icon-search"></el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="线体编码" prop="machineCode" v-if="false"> <el-form-item label="线体编码" prop="machineCode" v-if="false">
@ -302,17 +219,9 @@
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="工作中心" prop="workCenter"> <el-form-item label="工作中心" prop="workCenter">
<el-select <el-select v-model="form.workCenter" filterable placeholder="请选择">
v-model="form.workCenter" <el-option v-for="item in options1" :key="item.factoryCode"
filterable :label="item.factoryName" :value="item.factoryCode">
placeholder="请选择"
>
<el-option
v-for="item in options1"
:key="item.factoryCode"
:label="item.factoryName"
:value="item.factoryCode"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -349,32 +258,18 @@
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="报工数量(母)" prop="quantityFeedback"> <el-form-item label="报工数量(母)" prop="quantityFeedback">
<el-input-number <el-input-number :min="0" :step="1" v-model="form.quantityFeedback"
:min="0" style="width: 180px" />
:step="1"
v-model="form.quantityFeedback"
style="width: 180px"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="报工工时(母)" prop="workTime"> <el-form-item label="报工工时(母)" prop="workTime">
<el-input-number <el-input-number :min="0" :step="1" v-model="form.workTime" style="width: 180px" />
:min="0"
:step="1"
v-model="form.workTime"
style="width: 180px"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="报工用人(母)" prop="useMan"> <el-form-item label="报工用人(母)" prop="useMan">
<el-input-number <el-input-number :min="0" :step="1" v-model="form.useMan" style="width: 180px" />
:min="0"
:step="1"
v-model="form.useMan"
style="width: 180px"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -406,32 +301,18 @@
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="报工数量(子)" prop="quantityFeedbacks"> <el-form-item label="报工数量(子)" prop="quantityFeedbacks">
<el-input-number <el-input-number :min="0" :step="1" v-model="form.quantityFeedbacks"
:min="0" style="width: 180px" />
:step="1"
v-model="form.quantityFeedbacks"
style="width: 180px"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="报工工时(子)" prop="workTimes"> <el-form-item label="报工工时(子)" prop="workTimes">
<el-input-number <el-input-number :min="0" :step="1" v-model="form.workTimes" style="width: 180px" />
:min="0"
:step="1"
v-model="form.workTimes"
style="width: 180px"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="报工用人(子)" prop="useMans"> <el-form-item label="报工用人(子)" prop="useMans">
<el-input-number <el-input-number :min="0" :step="1" v-model="form.useMans" style="width: 180px" />
:min="0"
:step="1"
v-model="form.useMans"
style="width: 180px"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -446,10 +327,9 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="物料损耗" name="second"> <el-tab-pane label="物料损耗" name="second">
<div> <div>
<ReportWorkConsume ref="child" <ReportWorkConsume ref="child" :workorderCode="form.workorderCode"
:workorderCode="form.workorderCode" @onSelected="onSelectMaterial">
@onSelected="onSelectMaterial" </ReportWorkConsume>
></ReportWorkConsume>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -462,40 +342,37 @@
<!-- 报工信息详情 --> <!-- 报工信息详情 -->
<el-dialog :title="titleReport" :visible.sync="openReport" width="1200px"> <el-dialog :title="titleReport" :visible.sync="openReport" width="1200px">
<el-tabs v-model="activeNameR"> <el-tabs v-model="activeNameR">
<el-tab-pane <el-tab-pane v-for="(item, index) in libTabs" :key="index" :label="item.title" :name="item.libId">
v-for="(item, index) in libTabs" <el-table v-loading="loading" :data="item.libList" ref="myPOrderTable" @select="pReportSelection"
:key="index" @select-all="allReportSelection" :summary-method="getSummaries" show-summary>
:label="item.title"
:name="item.libId"
>
<el-table v-loading="loading" :data="item.libList" ref="myPOrderTable"
@select="pReportSelection"
@select-all="allReportSelection"
:summary-method="getSummaries"
show-summary
:ref = "tableIndex+index"
>
<el-table-column width="60" align="center" type="selection" /> <el-table-column width="60" align="center" type="selection" />
<el-table-column label="id" align="center" prop="id" v-if="false" /> <el-table-column label="id" align="center" prop="id" v-if="false" />
<el-table-column label="工单编码" width="130" align="left" prop="workorderCode" :show-overflow-tooltip="true" /> <el-table-column label="工单编码" width="130" align="left" prop="workorderCode"
<el-table-column label="订单编码" width="110" align="left" prop="workorderCodeSap" :show-overflow-tooltip="true" :show-overflow-tooltip="true" />
:formatter="orderCodeFormate"/> <el-table-column label="订单编码" width="110" align="left" prop="workorderCodeSap"
<el-table-column label="报工单号" width="110" align="left" prop="reportCode" :show-overflow-tooltip="true" /> :show-overflow-tooltip="true" :formatter="orderCodeFormate" />
<el-table-column label="批次" width="250" align="left" prop="batch" :show-overflow-tooltip="true" /> <el-table-column label="报工单号" width="110" align="left" prop="reportCode"
:show-overflow-tooltip="true" />
<el-table-column label="批次" width="250" align="left" prop="batch"
:show-overflow-tooltip="true" />
<el-table-column label="单位" align="center" prop="unit" /> <el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="报工数量" width="100" align="left" prop="quantityFeedback" :show-overflow-tooltip="true" > <el-table-column label="报工数量" width="100" align="left" prop="quantityFeedback"
:show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.quantityFeedback" @change="handleEdit(scope.$index,scope.row)"></el-input> <el-input type="number" size="small" v-model="scope.row.quantityFeedback"
@change="handleEdit(scope.$index, scope.row)"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="工时数" align="center" prop="workTime"> <el-table-column label="工时数" align="center" prop="workTime">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.workTime" @change="handleEdit(scope.$index,scope.row)"></el-input> <el-input type="number" size="small" v-model="scope.row.workTime"
@change="handleEdit(scope.$index, scope.row)"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="用人数" align="center" prop="useMan"> <el-table-column label="用人数" align="center" prop="useMan">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.useMan" @change="handleEdit(scope.$index,scope.row)"></el-input> <el-input type="number" size="small" v-model="scope.row.useMan"
@change="handleEdit(scope.$index, scope.row)"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="150" /> <el-table-column label="创建时间" align="center" prop="createTime" width="150" />
@ -503,8 +380,8 @@
<div class="demo-input-suffix"> <div class="demo-input-suffix">
<p>备注</p> <p>备注</p>
<el-input type="textarea" @blur ="addRemarksblur(item.libList,item.remark,index)" v-model="item.remark" <el-input type="textarea" @blur="addRemarksblur(item.libList, item.remark, index)"
placeholder="请输入内容(300个字内)" maxlength=300/> v-model="item.remark" placeholder="请输入内容(300个字内)" maxlength=300 />
</el-input> </el-input>
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -518,31 +395,28 @@
<!-- 报工损耗 --> <!-- 报工损耗 -->
<el-dialog :title="titleConsume" :visible.sync="openConsume" width="1200px"> <el-dialog :title="titleConsume" :visible.sync="openConsume" width="1200px">
<el-tabs v-model="activeNameC"> <el-tabs v-model="activeNameC">
<el-tab-pane <el-tab-pane v-for="(item, index) in libConsumeTabs" :key="index" :label="item.title"
v-for="(item, index) in libConsumeTabs" :name="item.libId">
:key="index"
:label="item.title"
:name="item.libId"
>
<el-table v-loading="loading" :data="item.libList" ref="mypConsumeTable" <el-table v-loading="loading" highlight-current-row :ref="tableIndex + index" :data="item.libList"
@select="pConsumeSelection" @select="pConsumeSelection" @select-all="allConsumeSelection">
@select-all="allConsumeSelection"
>
<el-table-column width="50" align="center" type="selection" /> <el-table-column width="50" align="center" type="selection" />
<el-table-column label="recordId" align="center" prop="recordId" v-if="false" /> <el-table-column label="recordId" align="center" prop="recordId" v-if="false" />
<el-table-column label="parentOrder" align="center" prop="parentOrder" v-if="false" /> <el-table-column label="parentOrder" align="center" prop="parentOrder" v-if="false" />
<el-table-column label="工单编码" width="140" align="left" prop="workorderCode" :show-overflow-tooltip="true" /> <el-table-column label="工单编码" width="140" align="left" prop="workorderCode"
<el-table-column label="订单编码" width="130" align="left" prop="workorderCodeSap" :show-overflow-tooltip="true" :show-overflow-tooltip="true" />
:formatter="orderCodeFormate"/> <el-table-column label="订单编码" width="130" align="left" prop="workorderCodeSap"
<el-table-column label="物料编码" width="130" align="left" prop="materialCode" :show-overflow-tooltip="true" :show-overflow-tooltip="true" :formatter="orderCodeFormate" />
:formatter="productCodeFormate" <el-table-column label="物料编码" width="130" align="left" prop="materialCode"
/> :show-overflow-tooltip="true" :formatter="productCodeFormate" />
<el-table-column label="物料名称" width="280" align="left" prop="materialName" :show-overflow-tooltip="true" /> <el-table-column label="物料名称" width="280" align="left" prop="materialName"
:show-overflow-tooltip="true" />
<el-table-column label="BOM组件用量" width="150" align="left" prop="planQuantity" /> <el-table-column label="BOM组件用量" width="150" align="left" prop="planQuantity" />
<el-table-column label="实际用量" width="150" align="left" prop="quantity" :show-overflow-tooltip="true" > <el-table-column label="实际用量" width="150" align="left" prop="quantity"
:show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.quantity" @change="handleEdit(scope.$index,scope.row)"></el-input> <el-input type="number" size="small" v-model="scope.row.quantity"
@change="handleEdit(scope.$index, scope.row)"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="单位" width="50" align="center" prop="unit" /> <el-table-column label="单位" width="50" align="center" prop="unit" />
@ -552,33 +426,25 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.warehouseCode" placeholder="请选择仓库" width="50%" <el-select v-model="scope.row.warehouseCode" placeholder="请选择仓库" width="50%"
@change="handleEdit(scope.$index, scope.row)" @change="handleEdit(scope.$index, scope.row)"
v-if="scope.row.workorderCodeSap == null||scope.row.attr1" v-if="scope.row.workorderCodeSap == null || scope.row.attr1" clearable>
clearable <el-option v-for="work in cwarehouseList" :key="work.warehouseCode"
> :label="work.warehouseName" :value="work.warehouseCode"></el-option>
<el-option
v-for="work in cwarehouseList"
:key="work.warehouseCode"
:label="work.warehouseName"
:value="work.warehouseCode"
></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="150" /> <el-table-column label="创建时间" align="center" prop="createTime" width="150" />
<el-table-column fixed="right" label="操作" width="90"> <el-table-column fixed="right" label="操作" width="90">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click.native.prevent="deleteBomRow(scope.$index, item.libList)" <el-button @click.native.prevent="deleteBomRow(scope.$index, item.libList)" size="small"
size="small" type="danger" plain type="danger" plain v-if="scope.row.workorderCodeSap == null || scope.row.attr1">
v-if="scope.row.workorderCodeSap == null||scope.row.attr1"
>
移除</el-button> 移除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="button-container"> <div class="button-container">
<el-button size="mini" type="primary" @click="addConsumeTableRow(item.libList,index)"></el-button> <el-button size="mini" type="primary"
@click="addConsumeTableRow(item.libList, index)">新增物料</el-button>
</div> </div>
</el-tab-pane> </el-tab-pane>
<!--工单产品bom参考 <!--工单产品bom参考
@ -615,31 +481,38 @@
<!-- SAP收货 --> <!-- SAP收货 -->
<el-dialog :title="titleReport" :visible.sync="openReportSAP" width="1200px"> <el-dialog :title="titleReport" :visible.sync="openReportSAP" width="1200px">
<el-select v-model="selectedWarehouse" placeholder="请选择仓库"> <el-select v-model="selectedWarehouse" placeholder="请选择仓库">
<el-option v-for="warehouse in warehouseList" :key="warehouse.warehouseCode" :label="warehouse.warehouseName" :value="warehouse.warehouseCode"></el-option> <el-option v-for="warehouse in warehouseList" :key="warehouse.warehouseCode"
:label="warehouse.warehouseName" :value="warehouse.warehouseCode"></el-option>
</el-select> </el-select>
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane label="母工单报工信息" name="pOrder"> <el-tab-pane label="母工单报工信息" name="pOrder">
<el-table v-loading="loading" :data="pOrderTableList" ref="myPOrderTable" @selection-change="pReportSelection" <el-table v-loading="loading" :data="pOrderTableList" ref="myPOrderTable"
:summary-method="getSummaries" @selection-change="pReportSelection" :summary-method="getSummaries" show-summary>
show-summary
>
<el-table-column width="50" align="center" type="selection" /> <el-table-column width="50" align="center" type="selection" />
<el-table-column label="id" align="center" prop="id" v-if="false" /> <el-table-column label="id" align="center" prop="id" v-if="false" />
<el-table-column label="SAP工单编码" width="250" align="left" prop="workorderCodeSap" :show-overflow-tooltip="true" /> <el-table-column label="SAP工单编码" width="250" align="left" prop="workorderCodeSap"
<el-table-column label="工单编码" width="150" align="left" prop="workorderCode" :show-overflow-tooltip="true" /> :show-overflow-tooltip="true" />
<el-table-column label="报工单号" width="150" align="left" prop="reportCode" :show-overflow-tooltip="true" /> <el-table-column label="工单编码" width="150" align="left" prop="workorderCode"
<el-table-column label="批次" width="250" align="left" prop="batch" :show-overflow-tooltip="true" /> :show-overflow-tooltip="true" />
<el-table-column label="报工单号" width="150" align="left" prop="reportCode"
:show-overflow-tooltip="true" />
<el-table-column label="批次" width="250" align="left" prop="batch"
:show-overflow-tooltip="true" />
<el-table-column label="产品编码" width="350" align="center" prop="productCode" /> <el-table-column label="产品编码" width="350" align="center" prop="productCode" />
<el-table-column label="产品名称" width="350" align="center" prop="productName" /> <el-table-column label="产品名称" width="350" align="center" prop="productName" />
<el-table-column label="单位" align="center" prop="unit" /> <el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="报工数量" width="100" align="left" prop="quantityFeedback" :show-overflow-tooltip="true" > <el-table-column label="报工数量" width="100" align="left" prop="quantityFeedback"
:show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.quantityFeedback" @change="handleEdit(scope.$index,scope.row)"></el-input> <el-input type="number" size="small" v-model="scope.row.quantityFeedback"
@change="handleEdit(scope.$index, scope.row)"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="入库数量" width="100" align="left" prop="quantityQualified" :show-overflow-tooltip="true" > <el-table-column label="入库数量" width="100" align="left" prop="quantityQualified"
:show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input type="number" size="small" v-model="scope.row.quantityQualified" @change="handleEdit(scope.$index,scope.row)"></el-input> <el-input type="number" size="small" v-model="scope.row.quantityQualified"
@change="handleEdit(scope.$index, scope.row)"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="用人数" align="center" prop="useMan">--> <!-- <el-table-column label="用人数" align="center" prop="useMan">-->
@ -650,7 +523,8 @@
<!-- <el-table-column label="计划日期" width="100" align="center" prop="productDate"/>--> <!-- <el-table-column label="计划日期" width="100" align="center" prop="productDate"/>-->
<el-table-column label="计划日期" width="180" align="center" prop="productDate"> <el-table-column label="计划日期" width="180" align="center" prop="productDate">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker v-model="scope.row.productDate" :value-format="'yyyy-MM-dd'" type="date" ></el-date-picker> <el-date-picker v-model="scope.row.productDate" :value-format="'yyyy-MM-dd'"
type="date"></el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="SAP过账状态" width="100" align="center" prop="sapstatus"> <el-table-column label="SAP过账状态" width="100" align="center" prop="sapstatus">
@ -673,32 +547,16 @@
</el-dialog> </el-dialog>
<!--母工单----> <!--母工单---->
<!--人员选择弹窗--> <!--人员选择弹窗-->
<ItemSelectUser <ItemSelectUser ref="itemSelectUser" @onSelected="onSelectUser"></ItemSelectUser>
ref="itemSelectUser"
@onSelected="onSelectUser"
></ItemSelectUser>
<!--工单选择弹窗--> <!--工单选择弹窗-->
<ItemSelectWorkOrder <ItemSelectWorkOrder ref="itemSelectWorkOrder" @onSelected="onSelectWorkOrder"></ItemSelectWorkOrder>
ref="itemSelectWorkOrder"
@onSelected="onSelectWorkOrder"
></ItemSelectWorkOrder>
<!--线体选择弹窗--> <!--线体选择弹窗-->
<ItemSelectEquip <ItemSelectEquip ref="itemSelectEquip" @onSelected="onSelectEquip"></ItemSelectEquip>
ref="itemSelectEquip"
@onSelected="onSelectEquip"
></ItemSelectEquip>
<!--最新领料单选择弹窗--> <!--最新领料单选择弹窗-->
<ItemSelectMaterial <ItemSelectMaterial ref="itemSelectNewPrepare" @onSelected="onSelectNewPrepare"></ItemSelectMaterial>
ref="itemSelectNewPrepare"
@onSelected="onSelectNewPrepare"
></ItemSelectMaterial>
<!--母工单----> <!--母工单---->
<!-- 打印预览弹出层 --> <!-- 打印预览弹出层 -->
<el-dialog <el-dialog title="生产订单确认入库" :visible.sync="printDialogVisible" width="1300px">
title="生产订单确认入库"
:visible.sync="printDialogVisible"
width="1300px"
>
<div id="printFrom" class="my-print-box"> <div id="printFrom" class="my-print-box">
<el-form :ref="formRef" :model="form"> <el-form :ref="formRef" :model="form">
<!-- 表头-工单信息 --> <!-- 表头-工单信息 -->
@ -724,7 +582,8 @@
<el-table v-if="refreshNewWorkerTable" v-loading="newWorkerLoading" class="my-print-table" <el-table v-if="refreshNewWorkerTable" v-loading="newWorkerLoading" class="my-print-table"
:data="printData.workTable" border style="width: 100%"> :data="printData.workTable" border style="width: 100%">
<el-table-column type="index" label="序号" width="50"></el-table-column> <el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column prop="workorderCodeSap" label="订单号" width="130" :formatter="orderCodeFormate"/> <el-table-column prop="workorderCodeSap" label="订单号" width="130"
:formatter="orderCodeFormate" />
<!--<el-table-column prop="workorderCode" label="生产工单号" width="150"></el-table-column>--> <!--<el-table-column prop="workorderCode" label="生产工单号" width="150"></el-table-column>-->
<el-table-column prop="productCode" label="物料编码" width="150" :formatter="productCodeFormate" /> <el-table-column prop="productCode" label="物料编码" width="150" :formatter="productCodeFormate" />
<el-table-column prop="productName" label="物料名称" width="300"></el-table-column> <el-table-column prop="productName" label="物料名称" width="300"></el-table-column>
@ -756,7 +615,8 @@
</template> </template>
<script> <script>
import { listReportWork, getReportWork, delReportWork, addReportWork, getWorkcenterList,getWarehouseList, import {
listReportWork, getReportWork, delReportWork, addReportWork, getWorkcenterList, getWarehouseList,
updateReportWork, reportSap, getBatchList, reportSapCancel, updateReportWork, reportSap, getBatchList, reportSapCancel,
getAllLevelReportList, deleteBomRowNow, getAllLevelReportList, deleteBomRowNow,
getReportSAPList, submitReportPS, submitReportPSSAP, getCKList, getReportSAPList, submitReportPS, submitReportPSSAP, getCKList,
@ -936,7 +796,9 @@ export default {
}, },
consumeList: [], consumeList: [],
cwarehouseList: [], cwarehouseList: [],
tableIndex: 'tableIndex' tableIndex: 'tableIndex',
//
pConsumeRowsall:[],
}; };
}, },
created() { created() {
@ -1419,8 +1281,9 @@ export default {
newPConsumeRows.push(item) newPConsumeRows.push(item)
} }
}) })
this.pConsumeRowsall = newPConsumeRows
this.pConsumeRows = newPConsumeRows; this.pConsumeRows = newPConsumeRows;
console.log('过滤后:', this.pConsumeRows); console.log('过滤后:', this.pConsumeRows,this.pConsumeRows);
} }
}, },
// all(zxl) // all(zxl)
@ -1439,22 +1302,22 @@ export default {
this.sConsumeRows = selection; this.sConsumeRows = selection;
}, },
submitConsume() { submitConsume() {
this.loading = true; // this.loading = true;
this.consumeRows = this.pConsumeRows; this.consumeRows = this.pConsumeRows;
console.log(this.consumeRows)
if (this.consumeRows == 0) { if (this.consumeRows == 0) {
this.$modal.msgError(`请选择要修改的物料数据!`); this.$modal.msgError(`请选择要修改的物料数据!`);
this.loading = false; this.loading = false;
return false; return false;
} }
submitConsumePS(this.consumeRows).then(response => { // submitConsumePS(this.consumeRows).then(response => {
this.$modal.msgSuccess("报工信息修改成功"); // this.$modal.msgSuccess("");
this.openConsume = false; // this.openConsume = false;
this.reset(); // this.reset();
this.getList(); // this.getList();
this.loading = false; // this.loading = false;
}); // });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
@ -1587,6 +1450,10 @@ export default {
}, },
//-- //--
onSelectNewPrepare(obj, tableIndx) { onSelectNewPrepare(obj, tableIndx) {
const _this = this
this.pConsumeRowsall = Array.from(new Set([...this.pConsumeRowsall, ...obj].map(JSON.stringify))).map(JSON.parse);
console.log(this.pConsumeRowsall,this.pConsumeRows,'111111')
debugger
let sr = this.selectRow[0] let sr = this.selectRow[0]
for (let i = 0; i < obj.length; i++) { for (let i = 0; i < obj.length; i++) {
if (this.pConsumeRows.length != 0) { if (this.pConsumeRows.length != 0) {
@ -1604,6 +1471,12 @@ export default {
parentOrder: sr.workorderCode parentOrder: sr.workorderCode
}; };
this.consumeList.push(row); this.consumeList.push(row);
this.$nextTick(() => {
let dynamicRef = 'tableIndex' + tableIndx;
console.log(this.consumeList, row, this.pConsumeRows,'22222')
_this.$refs[dynamicRef][0].toggleRowSelection(row);
});
} }
}) })
} else { } else {
@ -1617,15 +1490,15 @@ export default {
parentOrder: sr.workorderCode parentOrder: sr.workorderCode
}; };
this.consumeList.push(row); this.consumeList.push(row);
/**
// //
this.$nextTick(() => { this.$nextTick(() => {
let dynamicRef = 'tableIndex' + tableIndx; let dynamicRef = 'tableIndex' + tableIndx;
console.log(dynamicRef) console.log(this.consumeList, row, this.pConsumeRows,'333333')
this.$refs[dynamicRef].toggleRowSelection(row, true); _this.$refs[dynamicRef][0].toggleRowSelection(row);
}); });
**/
} }
} }
}, },
@ -1643,25 +1516,31 @@ export default {
margin-bottom: 15px; margin-bottom: 15px;
margin-left: 10px; margin-left: 10px;
} }
.center-text { .center-text {
text-align: center; text-align: center;
} }
.report-logo { .report-logo {
margin-top: 15px; margin-top: 15px;
margin-left: 15px; margin-left: 15px;
height: 38px; height: 38px;
} }
.button-container { .button-container {
text-align: right; text-align: right;
margin-top: 10px; margin-top: 10px;
margin-right: 10px; margin-right: 10px;
} }
.my-print-table { .my-print-table {
font-size: 20px; font-size: 20px;
} }
.my-print-nav { .my-print-nav {
font-size: 19px; font-size: 19px;
} }
.my-print-foot { .my-print-foot {
font-size: 19px; font-size: 19px;
} }

Loading…
Cancel
Save