You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3486 lines
153 KiB
3486 lines
153 KiB
<template>
|
|
<div class="mod-config">
|
|
<!-- 查询条件 -->
|
|
<el-form :inline="true" label-position="top" :model="searchData">
|
|
<el-form-item label="序列号">
|
|
<el-input v-model="searchData.referenceNo" clearable style="width: 120px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="单据状态">
|
|
<el-select v-model="searchData.status" clearable style="width: 120px">
|
|
<el-option label="草稿" value="草稿"></el-option>
|
|
<el-option label="审批中" value="审批中"></el-option>
|
|
<el-option label="已完成" value="已完成"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="节点审批人">
|
|
<el-input v-model="searchData.currentApprover" clearable style="width: 120px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="当前节点">
|
|
<el-select v-model="searchData.nodeId" placeholder="请选择节点" clearable style="width: 120px">
|
|
<el-option
|
|
v-for="option in nodeOptions"
|
|
:key="option.id"
|
|
:label="option.name"
|
|
:value="option.id">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item :label="' '">
|
|
<el-button v-if="authSearch" @click="getDataList">查询</el-button>
|
|
<el-button v-if="authUpdate" @click="addOrUpdateHandle()">新增</el-button>
|
|
<el-button v-if="authDelete" type="danger" @click="deleteHandle()">删除</el-button>
|
|
<download-excel
|
|
v-if="authSearch"
|
|
:fields="exportFieldMap"
|
|
:data="exportData"
|
|
type="xls"
|
|
:name="exportName"
|
|
:header="exportHeader"
|
|
:footer="exportFooter"
|
|
:fetch="createExportData"
|
|
:before-generate="startDownload"
|
|
:before-finish="finishDownload"
|
|
worksheet="导出信息"
|
|
:class="['el-button', 'el-button--primary', 'el-button--medium', {'is-loading': exportLoading}]">
|
|
<i v-if="exportLoading" class="el-icon-loading"></i>
|
|
<span>{{ "导出" }}</span>
|
|
</download-excel>
|
|
<el-button v-if="authSearch" @click="searchHandle()">搜索</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
|
|
<!-- 列表 -->
|
|
<el-table
|
|
ref="rohsTable"
|
|
:height="height"
|
|
:data="dataList"
|
|
border
|
|
:row-style="rowStyle"
|
|
@row-click="changeClickRow"
|
|
@current-change="currentChange"
|
|
@selection-change="dataListSelectionChange"
|
|
v-loading="dataListLoading"
|
|
style="width: 100%;">
|
|
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
|
<el-table-column prop="referenceNo" header-align="center" align="center" label="序列号" width="165"></el-table-column>
|
|
<el-table-column prop="status" header-align="center" align="center" label="单据状态" width="120"></el-table-column>
|
|
<el-table-column prop="nodeId" header-align="center" align="center" label="当前节点ID" width="130"></el-table-column>
|
|
<el-table-column prop="nodeName" header-align="center" align="center" label="当前节点" width="150"></el-table-column>
|
|
<el-table-column prop="currentApprover" header-align="center" align="center" label="当前节点审批人" width="170"></el-table-column>
|
|
<el-table-column prop="applicant" header-align="center" align="center" label="申请人编码" width="130"></el-table-column>
|
|
<el-table-column prop="applicantName" header-align="center" align="center" label="申请人名称" width="150"></el-table-column>
|
|
<el-table-column prop="pm" header-align="center" align="center" label="PM编码" width="130"></el-table-column>
|
|
<el-table-column prop="pmName" header-align="center" align="center" label="PM名称" width="150"></el-table-column>
|
|
<el-table-column prop="applicationDate" header-align="center" align="center" label="申请日期" width="165"></el-table-column>
|
|
<el-table-column prop="plannedMassProductionDate" header-align="center" align="center" label="计划转量产时间" width="165">
|
|
<template slot-scope="scope">
|
|
<span>{{ normalizeDateOnly(scope.row.plannedMassProductionDate) }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="process" header-align="center" align="center" label="工艺" width="120"></el-table-column>
|
|
<el-table-column prop="color" header-align="center" align="center" label="颜色" width="120"></el-table-column>
|
|
<el-table-column prop="vendorCode" header-align="center" align="center" label="供应商" width="160"></el-table-column>
|
|
<el-table-column prop="vendorMaterialCode" header-align="center" align="center" label="供应商材料编码" width="200" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="materialClassify" header-align="center" align="center" label="材料分类" width="200" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="otherMaterialClassify" header-align="center" align="center" label="其他材料分类" width="210" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="materialUseFor" header-align="center" align="center" label="辅材用途" width="180" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="endCustomer" header-align="center" align="center" label="最终客户编码" width="160"></el-table-column>
|
|
<el-table-column prop="endCustomerName" header-align="center" align="center" label="最终客户名称" width="180"></el-table-column>
|
|
<el-table-column prop="projectId" header-align="center" align="center" label="项目编码" width="140"></el-table-column>
|
|
<el-table-column prop="projectName" header-align="center" align="center" label="项目名称" width="180"></el-table-column>
|
|
<el-table-column prop="commGroup1" header-align="center" align="center" label="商品组1编码" width="170"></el-table-column>
|
|
<el-table-column prop="commGroup1Desc" header-align="center" align="center" label="商品组1名称" width="170"></el-table-column>
|
|
<el-table-column prop="commGroup2" header-align="center" align="center" label="商品组2编码" width="170"></el-table-column>
|
|
<el-table-column prop="commGroup2Desc" header-align="center" align="center" label="商品组2名称" width="170"></el-table-column>
|
|
<el-table-column prop="commGroup3" header-align="center" align="center" label="商品组3编码" width="170"></el-table-column>
|
|
<el-table-column prop="commGroup3Desc" header-align="center" align="center" label="商品组3名称" width="170"></el-table-column>
|
|
<el-table-column prop="needCreateNumber" header-align="center" align="center" label="需创建内部编号" width="200"></el-table-column>
|
|
<el-table-column prop="npdEngineer" header-align="center" align="center" label="NPD工程师编码" width="170"></el-table-column>
|
|
<el-table-column prop="npdEngineerName" header-align="center" align="center" label="NPD工程师名称" width="170"></el-table-column>
|
|
<el-table-column prop="materialValidityTime" header-align="center" align="center" label="材料有效期" width="200"></el-table-column>
|
|
<el-table-column prop="needDeviation" header-align="center" align="center" label="是否需偏差许可" width="190"></el-table-column>
|
|
<el-table-column prop="technicalPlan" header-align="center" align="center" label="技术计划编码" width="170"></el-table-column>
|
|
<el-table-column prop="technicalPlanName" header-align="center" align="center" label="技术计划名称" width="170"></el-table-column>
|
|
<el-table-column prop="buyer" header-align="center" align="center" label="采购编码" width="130"></el-table-column>
|
|
<el-table-column prop="buyerName" header-align="center" align="center" label="采购名称" width="130"></el-table-column>
|
|
<el-table-column prop="expectReportTime" header-align="center" align="center" label="预计提供报告时间(一个月内)" width="200">
|
|
<template slot-scope="scope">
|
|
<span>{{ normalizeDateOnly(scope.row.expectReportTime) }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="sgsReportNumber" header-align="center" align="center" label="SGS报告编号" width="190" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="expiredDate" header-align="center" align="center" label="报告日期" width="165"></el-table-column>
|
|
<el-table-column prop="validUntilDisplay" header-align="center" align="center" label="有效期" width="170" :show-overflow-tooltip="true">
|
|
<template slot-scope="scope">
|
|
<span>{{ getValidUntilDisplay(scope.row.validUntilValue, scope.row.validUntil) }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="isMeetRohsRequirement" header-align="center" align="center" label="符合RoHS" width="170"></el-table-column>
|
|
<el-table-column prop="isAhGrade" header-align="center" align="center" label="AH属性" width="140"></el-table-column>
|
|
<el-table-column prop="hsfSupplierClassification" header-align="center" align="center" label="HSF供应商等级" width="220"></el-table-column>
|
|
<el-table-column prop="hsfApproverName" header-align="center" align="center" label="HSF审批人" width="240" :show-overflow-tooltip="true">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.hsfApproverName || scope.row.hsfApprover || '' }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="relatedPeopleName" header-align="center" align="center" label="Inform Related people" width="200" :show-overflow-tooltip="true">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.relatedPeopleName || scope.row.relatedPeople || '' }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="isSameMaterialDiffSize" header-align="center" align="center" label="同材不同规格" width="220"></el-table-column>
|
|
<el-table-column prop="ifsPartNo" header-align="center" align="center" label="IFS编号" width="150"></el-table-column>
|
|
<el-table-column prop="remark" header-align="center" align="center" label="备注" width="220" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column fixed="right" header-align="center" align="center" width="130" label="操作">
|
|
<template slot-scope="scope">
|
|
<el-link v-if="authUpdate && scope.row.status !== '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">编辑</el-link>
|
|
<el-link v-if="authUpdate && scope.row.status === '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">详情</el-link>
|
|
<el-link v-if="authIssue && scope.row.status === '草稿'" style="cursor: pointer; margin-left: 10px;" @click="issueModal(scope.row)">下达</el-link>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
|
|
<!-- 分页 -->
|
|
<el-pagination style="margin-top: 0px"
|
|
@size-change="sizeChangeHandle"
|
|
@current-change="currentChangeHandle"
|
|
:current-page="pageIndex"
|
|
:page-sizes="[20, 50, 100, 200, 500]"
|
|
:page-size="pageSize"
|
|
:total="totalPage"
|
|
layout="total, sizes, prev, pager, next, jumper">
|
|
</el-pagination>
|
|
|
|
<!-- 编辑模态框 -->
|
|
<el-dialog
|
|
:title="modalTitle"
|
|
:visible.sync="modalFlag"
|
|
width="1010px"
|
|
top="10vh"
|
|
v-drag
|
|
:close-on-click-modal="false"
|
|
:showClose="false">
|
|
|
|
<el-tabs tab-position="left" type="border-card" v-model="activeName" style="width: 100%;height: 650px;">
|
|
<!-- 基本信息 -->
|
|
<el-tab-pane label="基本信息" name="basicInfo">
|
|
<div style="height: 635px">
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
|
|
<el-form-item>
|
|
<span style="cursor: pointer" v-if="!isRohsFieldDisabled('applicant')" slot="label" @click="getBaseList(103, 1)"><a herf="#">申请人</a></span>
|
|
<span v-else slot="label">申请人</span>
|
|
<el-input v-model="modalData.applicant" @blur="applicantBlur(103)" :disabled="isRohsFieldDisabled('applicant')" style="width: 100px"></el-input>
|
|
<el-input v-model="modalData.applicantName" disabled style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="申请日期">
|
|
<el-date-picker v-model="modalData.applicationDate" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('applicationDate')" style="width: 150px" :editable=false></el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item label="Site">
|
|
<el-input v-model="modalData.site" disabled style="width: 95px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="工艺">
|
|
<dict-data-select v-model="modalData.process" clearable @change="handleProcessChange" :disabled="isProcessFieldDisabled()" style="width: 121px" dict-type="rohs_process"></dict-data-select>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item>
|
|
<span slot="label" v-if="!modalData.endCustomerFlag && !isRohsFieldDisabled('endCustomer')" @click="getBaseList(102, 1)"><a herf="#">最终客户</a></span>
|
|
<span slot="label" v-else>最终客户</span>
|
|
<el-input :disabled="modalData.endCustomerFlag || isRohsFieldDisabled('endCustomer')" readonly v-model="modalData.endCustomer" @blur="handleQueryCustomer" style="width: 100px"></el-input>
|
|
<el-input disabled v-model="modalData.endCustomerName" style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<span slot="label" v-if="!modalData.projectIdFlag && !isRohsFieldDisabled('projectId')" @click="chooseProjectListFlag = true"><a herf="#">项目编码</a></span>
|
|
<span slot="label" v-else>项目编码</span>
|
|
<el-input :disabled="modalData.projectIdFlag || isRohsFieldDisabled('projectId')" readonly v-model="modalData.projectId" @blur="handleQueryProjectByCustomer" style="width: 100px"></el-input>
|
|
<el-input disabled v-model="modalData.projectName" style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="WM所需求规格">
|
|
<el-input v-model="modalData.wmRequiredSpec" :disabled="isRohsFieldDisabled('wmRequiredSpec')" style="width: 260px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item label="供应商">
|
|
<el-input v-model="modalData.vendorCode" :disabled="isRohsFieldDisabled('vendorCode')" style="width: 396px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="供应商材料编码">
|
|
<el-input v-model="modalData.vendorMaterialCode" :disabled="isRohsFieldDisabled('vendorMaterialCode')" style="width: 396px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item label="材料分类">
|
|
<dict-data-select class="rohs-multiple-ellipsis" v-model="modalData.materialClassifyList" multiple :title="getMultipleSelectTitle(modalData.materialClassifyList)" :disabled="isRohsFieldDisabled('materialClassify')" style="width: 668px" dict-type="rohs_material_classify"></dict-data-select>
|
|
</el-form-item>
|
|
<el-form-item label="其他分类" v-if="modalData.materialClassifyList && modalData.materialClassifyList.includes('Other其他')">
|
|
<el-input v-model="modalData.otherMaterialClassify" :disabled="isRohsFieldDisabled('otherMaterialClassify')" style="width: 123px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item label="辅材用途">
|
|
<el-input v-model="modalData.materialUseFor" :disabled="isRohsFieldDisabled('materialUseFor')" style="width: 396px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<span style="cursor: pointer" v-if="!isRohsFieldDisabled('technicalPlan')" slot="label" @click="getBaseList(2001, 4)"><a herf="#">技术计划/TP</a></span>
|
|
<span v-else slot="label">技术计划/TP</span>
|
|
<el-input v-model="modalData.technicalPlan" @blur="technicalPlanBlur(2001)" :disabled="isRohsFieldDisabled('technicalPlan')" style="width: 100px"></el-input>
|
|
<el-input v-model="modalData.technicalPlanName" disabled style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item label="颜色">
|
|
<el-input v-model="modalData.color" :disabled="isRohsFieldDisabled('color')" style="width: 396px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<span style="cursor: pointer" v-if="!isRohsFieldDisabled('pm')" slot="label" @click="getBaseList(2054, 5)"><a herf="#">PM人员/PM</a></span>
|
|
<span v-else slot="label">PM人员/PM</span>
|
|
<el-input v-model="modalData.pm" @blur="pmBlur(2054)" :disabled="isRohsFieldDisabled('pm')" style="width: 100px"></el-input>
|
|
<el-input v-model="modalData.pmName" disabled style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="计划转量产时间">
|
|
<el-date-picker v-model="modalData.plannedMassProductionDate" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('plannedMassProductionDate')" style="width: 123px" :editable=false></el-date-picker>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item>
|
|
<span style="cursor: pointer" v-if="!isRohsFieldDisabled('commGroup1')" slot="label" @click="getBaseList(110)"><a herf="#">商品组1</a></span>
|
|
<span v-else slot="label">商品组1</span>
|
|
<el-input v-model="modalData.commGroup1" @change="commGroup1Blur(110)" :disabled="isRohsFieldDisabled('commGroup1')" style="width: 100px"></el-input>
|
|
<el-input v-model="modalData.commGroup1Desc" disabled style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<span style="cursor: pointer" v-if="!isRohsFieldDisabled('commGroup2')" slot="label" @click="getBaseList(111)"><a herf="#">商品组2</a></span>
|
|
<span v-else slot="label">商品组2</span>
|
|
<el-input v-model="modalData.commGroup2" @change="commGroup2Blur(111)" :disabled="isRohsFieldDisabled('commGroup2')" style="width: 100px"></el-input>
|
|
<el-input v-model="modalData.commGroup2Desc" disabled style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<span style="cursor: pointer" v-if="!isRohsFieldDisabled('commGroup3')" slot="label" @click="getBaseList(130)"><a herf="#">商品组3</a></span>
|
|
<span v-else slot="label">商品组3</span>
|
|
<el-input v-model="modalData.commGroup3" @change="commGroup3Blur(130)" :disabled="isRohsFieldDisabled('commGroup3')" style="width: 100px"></el-input>
|
|
<el-input v-model="modalData.commGroup3Desc" disabled style="width: 156px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item label="是否Fiber材料">
|
|
<el-radio-group v-model="modalData.isFiberMaterial" :disabled="isRohsFieldDisabled('isFiberMaterial')" style="width: 191px">
|
|
<el-radio label="Y" @click.native.prevent="radioClick('isFiberMaterial', 'Y')">是</el-radio>
|
|
<el-radio label="N" @click.native.prevent="radioClick('isFiberMaterial', 'N')">否</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
<el-form-item label="是否需要创建300/700/900号">
|
|
<el-radio-group v-model="modalData.needCreateNumber" :disabled="isRohsFieldDisabled('needCreateNumber')" style="width: 191px">
|
|
<el-radio label="Y" @click.native.prevent="radioClick('needCreateNumber', 'Y')">是</el-radio>
|
|
<el-radio label="N" @click.native.prevent="radioClick('needCreateNumber', 'N')">否</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
<el-form-item label="材料厚度">
|
|
<el-input v-model="modalData.materialThickness" :disabled="isRohsFieldDisabled('materialThickness')" style="width: 396px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item>
|
|
<span style="cursor: pointer" v-if="!isRohsFieldDisabled('npdEngineer')" slot="label" @click="getBaseList(2001, 3)"><a herf="#">NPD工程师</a></span>
|
|
<span v-else slot="label">NPD工程师</span>
|
|
<el-input v-model="modalData.npdEngineer" @blur="npdEngineerBlur(2001)" :disabled="isRohsFieldDisabled('npdEngineer')" style="width: 100px"></el-input>
|
|
<el-input v-model="modalData.npdEngineerName" disabled style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="材料有效期">
|
|
<dict-data-select v-model="modalData.materialValidityTime" clearable :disabled="isRohsFieldDisabled('materialValidityTime')" style="width: 100px" dict-type="rohs_material_validity_time"></dict-data-select>
|
|
</el-form-item>
|
|
<el-form-item label="是否需要Deviation" style="margin-left: 25px">
|
|
<el-radio-group v-model="modalData.needDeviation" :disabled="isRohsFieldDisabled('needDeviation')" style="width: 120px">
|
|
<el-radio label="Y" @click.native.prevent="radioClick('needDeviation', 'Y')">是</el-radio>
|
|
<el-radio label="N" @click.native.prevent="radioClick('needDeviation', 'N')">否</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
<el-form-item label="预计提供报告时间(一个月内)">
|
|
<el-date-picker v-model="modalData.expectReportTime" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('expectReportTime')" style="width: 260px" :editable=false></el-date-picker>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item label="有效期备注">
|
|
<el-input v-model="modalData.materialValidityComments" :disabled="isRohsFieldDisabled('materialValidityComments')" style="width: 532px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<span style="cursor: pointer" v-if="!isRohsFieldDisabled('buyer')" slot="label" @click="getBaseList(2000, 2)"><a herf="#">采购</a></span>
|
|
<span v-else slot="label">采购</span>
|
|
<el-input v-model="modalData.buyer" @blur="buyerBlur(2000)" :disabled="isRohsFieldDisabled('buyer')" style="width: 100px"></el-input>
|
|
<el-input v-model="modalData.buyerName" disabled style="width: 156px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item label="所需审批文件" >
|
|
<dict-data-select class="rohs-multiple-ellipsis" v-model="modalData.qualificationDocumentsNeededList" multiple :title="getMultipleSelectTitle(modalData.qualificationDocumentsNeededList)" :disabled="isRohsFieldDisabled('qualificationDocumentsNeeded')" style="width: 804px" dict-type="rohs_qualification_docs"></dict-data-select>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item label="测试报告必测项">
|
|
<dict-data-select class="rohs-multiple-ellipsis" v-model="modalData.testReportIncludingItemsList" multiple :title="getMultipleSelectTitle(modalData.testReportIncludingItemsList)" :disabled="isRohsFieldDisabled('testReportIncludingItems')" style="width: 804px" dict-type="rohs_test_report_items"></dict-data-select>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item style="display: block;">
|
|
<template slot="label">
|
|
<span>备注说明</span>
|
|
<el-button
|
|
v-if="authDataEntry"
|
|
style="margin-left: 2px;width: 83px;line-height: 0.5;font-size: 10px;"
|
|
type="primary"
|
|
@click="openRohsRemarkDialog">备注</el-button>
|
|
</template>
|
|
<el-input type="textarea" :rows="3" v-model="modalData.remark" :disabled="isRohsFieldDisabled('remark')" resize="none" style="width: 804px;height: 30px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
</el-tab-pane>
|
|
|
|
<!-- NPD 信息 -->
|
|
<el-tab-pane label="NPD 信息" name="npdInfo">
|
|
<div style="height: 635px; overflow-y: auto;">
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
|
|
<el-form-item label="现有材料不同规格/Same Material Diff Size">
|
|
<el-radio-group v-model="modalData.isSameMaterialDiffSize" :disabled="isRohsFieldDisabled('isSameMaterialDiffSize')" style="width: 190px">
|
|
<el-radio label="Y" @click.native.prevent="radioClick('isSameMaterialDiffSize', 'Y')">是</el-radio>
|
|
<el-radio label="N" @click.native.prevent="radioClick('isSameMaterialDiffSize', 'N')">否</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item label="材料描述/Material Desc." style="display: block;">
|
|
<el-input type="textarea" :rows="3" v-model="modalData.materialDesc" :disabled="isRohsFieldDisabled('materialDesc')" resize="none" style="width: 804px;height: 30px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 50px">
|
|
<el-form-item label="备注说明/NPD Remark" style="display: block;">
|
|
<el-input type="textarea" :rows="3" v-model="modalData.npdRemark" :disabled="isRohsFieldDisabled('npdRemark')" resize="none" style="width: 804px;height: 30px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 50px">
|
|
<el-form-item label="TDS属性/TDS Property" style="display: block;">
|
|
<oss-components
|
|
ref="modalTdsOss"
|
|
:save-visible="authFileSave"
|
|
:download-visible="authFileDownLoad"
|
|
:remove-visible="authFileRemove"
|
|
:preview-visible="authFilePreview"
|
|
:disabled="showModalFlag || modalData.status === '已完成'"
|
|
:enable-upgrade="!showModalFlag && modalData.status !== '已完成'"
|
|
:require-file-no-rev="true"
|
|
:auto-file-no="true"
|
|
:single-upload="true"
|
|
:row-click-select="true"
|
|
:show-order-ref2="false"
|
|
label="序列号"
|
|
:height="350"
|
|
style="margin-top: 2px"
|
|
:columns="tdsFileColumnList"
|
|
:order-ref1="modalData.site || ''"
|
|
:order-ref2="modalData.referenceNo || ''"
|
|
order-ref3="tdsProperty">
|
|
</oss-components>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
</el-tab-pane>
|
|
|
|
<!-- HSF 填写信息 -->
|
|
<el-tab-pane label="HSF 填写信息" name="hsfInfo">
|
|
<div style="height: 635px">
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
|
|
<el-form-item label="SGS报告编号/SGS Report Number">
|
|
<el-input v-model="modalData.sgsReportNumber" :disabled="isRohsFieldDisabled('sgsReportNumber')" style="width: 190px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="状态/Status">
|
|
<el-select v-model="modalData.rohsStatus" clearable :disabled="isRohsFieldDisabled('rohsStatus')" style="width: 190px">
|
|
<el-option label="Active" value="Active"></el-option>
|
|
<el-option label="Dead" value="Dead"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item label="报告日期/Expired Date">
|
|
<el-date-picker v-model="modalData.expiredDate" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('expiredDate')" style="width: 190px" :editable=false></el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item label="有效期数值/Valid Until Value">
|
|
<el-input-number
|
|
v-model="modalData.validUntilValue"
|
|
:controls="false"
|
|
:min="0"
|
|
:step="1"
|
|
:precision="0"
|
|
:disabled="isValidUntilValueDisabled()"
|
|
style="width: 190px">
|
|
</el-input-number>
|
|
</el-form-item>
|
|
<el-form-item label="有效期单位/Valid Until Unit">
|
|
<dict-data-select v-model="modalData.validUntil" clearable :disabled="isValidUntilUnitDisabled()" style="width: 190px" dict-type="rohs_valid_until"></dict-data-select>
|
|
</el-form-item>
|
|
<el-form-item label="失效日期/Expiry Date">
|
|
<el-date-picker v-model="modalData.expiryDate" type="date" value-format="yyyy-MM-dd" disabled style="width: 192px" :editable=false></el-date-picker>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item label="是否符合RoHS/Meet RoHS Req">
|
|
<el-radio-group v-model="modalData.isMeetRohsRequirement" :disabled="isRohsFieldDisabled('isMeetRohsRequirement')" style="width: 190px">
|
|
<el-radio label="Y" @click.native.prevent="radioClick('isMeetRohsRequirement', 'Y')">是</el-radio>
|
|
<el-radio label="N" @click.native.prevent="radioClick('isMeetRohsRequirement', 'N')">否</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
<el-form-item label=" ">
|
|
<el-checkbox
|
|
v-model="modalData.isAhGrade"
|
|
true-label="Y"
|
|
false-label="N"
|
|
:disabled="isRohsFieldDisabled('isAhGrade')"
|
|
style="width: 190px">材料属性是否是AH/Is AH Grade</el-checkbox>
|
|
</el-form-item>
|
|
<el-form-item label="HSF供应商等级/Supplier Class">
|
|
<el-radio-group v-model="modalData.hsfSupplierClassification" :disabled="isRohsFieldDisabled('hsfSupplierClassification')" style="width: 200px">
|
|
<el-radio label="A类" @click.native.prevent="radioClick('hsfSupplierClassification', 'A类')">A类</el-radio>
|
|
<el-radio label="B类" @click.native.prevent="radioClick('hsfSupplierClassification', 'B类')">B类</el-radio>
|
|
<el-radio label="C类" @click.native.prevent="radioClick('hsfSupplierClassification', 'C类')">C类</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData">
|
|
<el-form-item label="Fiber报告信息/Fiber Information" style="display: block;">
|
|
<el-input type="textarea" :rows="3" v-model="modalData.fiberInformation" :disabled="isRohsFieldDisabled('fiberInformation')" resize="none" style="width: 804px;height: 30px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 45px">
|
|
<el-form-item>
|
|
<span style="cursor: pointer" v-if="!isRohsFieldDisabled('hsfApprover')" slot="label" @click="openHsfApproverChooseModal"><a herf="#">HSF审批人/HSF Approver</a></span>
|
|
<span v-else slot="label">HSF审批人/HSF Approver</span>
|
|
<el-input
|
|
v-model="modalData.hsfApproverName"
|
|
readonly
|
|
:disabled="isRohsFieldDisabled('hsfApprover')"
|
|
style="width: 396px"
|
|
placeholder="请选择人员"
|
|
@focus="openHsfApproverChooseModal">
|
|
<span slot="suffix" v-show="modalData.hsfApproverName && !isRohsFieldDisabled('hsfApprover')" @click.stop="clearHsfApproverSelection">
|
|
<i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i>
|
|
</span>
|
|
</el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<span style="cursor: pointer" v-if="!isRohsFieldDisabled('relatedPeople')" slot="label" @click="openRelatedPeopleChooseModal"><a herf="#">Inform Related people</a></span>
|
|
<span v-else slot="label">Inform Related people</span>
|
|
<el-input
|
|
v-model="modalData.relatedPeopleName"
|
|
readonly
|
|
:disabled="isRohsFieldDisabled('relatedPeople')"
|
|
style="width: 396px"
|
|
placeholder="请从HSF审批人中选择"
|
|
@focus="openRelatedPeopleChooseModal">
|
|
<span slot="suffix" v-show="modalData.relatedPeopleName && !isRohsFieldDisabled('relatedPeople')" @click.stop="clearRelatedPeopleSelection">
|
|
<i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i>
|
|
</span>
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form v-if="shouldShowHsfStandard(modalData.endCustomer)" :inline="true" label-position="top" :model="modalData" style="margin-top: 0px">
|
|
<el-form-item label="HSF标准/HSF Standard" style="display: block;">
|
|
<el-input type="textarea" :rows="3" v-model="modalData.hsfStandard" :disabled="isRohsFieldDisabled('hsfStandard')" resize="none" style="width: 804px;height: 30px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
</el-tab-pane>
|
|
|
|
<!-- 材料信息 -->
|
|
<el-tab-pane label="材料信息" name="materialInfo">
|
|
<div style="height: 635px">
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -15px;">
|
|
<el-form-item label=" ">
|
|
<el-button type="primary" v-if="!showModalFlag && canEditRohsMaterial()" @click="openProjectMaterialDialog">新增材料</el-button>
|
|
<el-button type="danger" v-if="!showModalFlag && canEditRohsMaterial()" @click="removeSelectedMaterialRows">删除材料</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-table
|
|
ref="rohsMaterialTable"
|
|
class="rohs-material-table"
|
|
border
|
|
:data="modalData.materialList"
|
|
@selection-change="materialSelectionChange"
|
|
:header-cell-style="materialDialogHeaderCellStyle"
|
|
:height="585"
|
|
style="width: 100%">
|
|
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
|
<el-table-column type="index" label="序号" width="50" header-align="center" align="center"></el-table-column>
|
|
<el-table-column prop="finalPartNo" label="IFS物料编码/Final Part No." min-width="150" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="partDesc" label="描述/Part Desc." min-width="250" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="partStatus" label="状态/Part Status" min-width="100" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
|
|
</el-table>
|
|
</div>
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane label="附件信息" name="attachmentInfo">
|
|
<div style="height: 635px">
|
|
<oss-components
|
|
ref="modalAttachmentOss"
|
|
:save-visible="authFileSave"
|
|
:download-visible="authFileDownLoad"
|
|
:remove-visible="authFileRemove"
|
|
:preview-visible="authFilePreview"
|
|
:row-click-select="true"
|
|
:disabled="modalData.status === '已完成'"
|
|
label="序列号"
|
|
:height="560"
|
|
style="margin-top: 2px"
|
|
:columns="fileColumnList"
|
|
:order-ref1="modalData.site || ''"
|
|
:order-ref2="modalData.referenceNo || ''"
|
|
order-ref3="rohsAttachment">
|
|
</oss-components>
|
|
</div>
|
|
</el-tab-pane>
|
|
</el-tabs>
|
|
|
|
<el-footer style="height:35px;margin-top: 15px;text-align:center">
|
|
<el-button type="primary" v-if="canSaveAction()" @click="dataFormSubmit()">保存</el-button>
|
|
<el-button type="primary" @click="handleModalClose">关闭</el-button>
|
|
<el-button type="primary" v-if="canAgreeAction()" :loading="submitLoading" @click="agreeSubmit">同意</el-button>
|
|
<el-button type="primary" v-if="canRejectAction()" :loading="submitLoading" @click="openRejectModal">驳回</el-button>
|
|
</el-footer>
|
|
</el-dialog>
|
|
|
|
<!--选择项目模态框-->
|
|
<el-dialog title="选择-项目" :close-on-click-modal="false" @close="closeProjectInfoDialog"
|
|
@open="searchProjectInfoList" :visible.sync="chooseProjectListFlag" width="35%">
|
|
<el-form label-position="top" :model="searchProjectData" ref="closeProjectInfoForm">
|
|
<el-row :gutter="10">
|
|
<el-col :span="6">
|
|
<el-form-item label="项目号">
|
|
<el-input v-model="searchProjectData.projectId"></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label="项目名称">
|
|
<el-input v-model="searchProjectData.projectName"></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-form-item label=" ">
|
|
<el-button type="primary" @click="searchProjectInfoList">查询</el-button>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-table :height="223"
|
|
:data="projectList"
|
|
border
|
|
@row-click="projectClickRow">
|
|
<el-table-column label="项目号" prop="projectId"/>
|
|
<el-table-column label="项目名称" prop="projectName"/>
|
|
</el-table>
|
|
</el-form>
|
|
<el-footer style="height:35px;margin-top: 10px;text-align:center">
|
|
<el-button type="primary" @click="chooseProjectListFlag = false">关闭</el-button>
|
|
</el-footer>
|
|
</el-dialog>
|
|
|
|
<el-dialog title="选择物料" top="15vh" width="50%" :close-on-click-modal="false" v-drag :visible.sync="projectMaterialDialogFlag">
|
|
<el-form :inline="true" label-position="top" :model="projectMaterialSearchData">
|
|
<el-form-item label="IFS物料编码/Final Part No.">
|
|
<el-input v-model="projectMaterialSearchData.finalPartNo" clearable style="width: 150px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="描述/Part Desc">
|
|
<el-input v-model="projectMaterialSearchData.partDesc" clearable style="width: 200px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="状态/Part Status">
|
|
<el-input v-model="projectMaterialSearchData.partStatus" clearable style="width: 100px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label=" ">
|
|
<el-button type="primary" @click="searchProjectMaterialList">查询</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-table
|
|
ref="projectMaterialTable"
|
|
class="rohs-material-table"
|
|
border
|
|
v-loading="projectMaterialLoading"
|
|
:data="projectMaterialList"
|
|
@selection-change="projectMaterialSelectionChange"
|
|
:header-cell-style="materialDialogHeaderCellStyle"
|
|
:height="320"
|
|
style="width: 100%">
|
|
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
|
<el-table-column prop="finalPartNo" label="IFS物料编码/Final Part No." min-width="120" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="partDesc" label="描述/Part Desc." min-width="250" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="partStatus" label="状态/Part Status" min-width="80" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
|
|
</el-table>
|
|
<el-pagination
|
|
style="margin-top: 10px"
|
|
@size-change="projectMaterialSizeChangeHandle"
|
|
@current-change="projectMaterialCurrentChangeHandle"
|
|
:current-page="projectMaterialPageIndex"
|
|
:page-sizes="[20, 50, 100]"
|
|
:page-size="projectMaterialPageSize"
|
|
:total="projectMaterialTotal"
|
|
layout="total, sizes, prev, pager, next, jumper">
|
|
</el-pagination>
|
|
<el-footer style="height:35px;margin-top: 10px;text-align:center">
|
|
<el-button type="primary" @click="confirmProjectMaterialSelection">确定</el-button>
|
|
<el-button type="primary" @click="projectMaterialDialogFlag = false">关闭</el-button>
|
|
</el-footer>
|
|
</el-dialog>
|
|
|
|
<el-dialog title="人员选择" @open="openHsfApproverDialog" @close="closeHsfApproverDialog" v-drag
|
|
:visible.sync="hsfApproverFlag" width="40vw" :close-on-click-modal="false">
|
|
<el-form :inline="true" label-position="top" :model="hsfApproverSearchData">
|
|
<el-form-item label="编码">
|
|
<el-input v-model="hsfApproverSearchData.operatorId" clearable style="width: 120px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="名称">
|
|
<el-input v-model="hsfApproverSearchData.operatorName" clearable style="width: 120px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label=" ">
|
|
<el-button type="primary" @click="filterHsfApproverOptions">查询</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-table v-if="hsfApproverFlag"
|
|
:height="300"
|
|
:data="hsfApproverDisplayList"
|
|
@selection-change="handleHsfApproverSelectionChange"
|
|
@row-click="(row,column,event) => handleHsfApproverTableClick(row,column,event,'hsfApproverTable')"
|
|
ref="hsfApproverTable"
|
|
border row-key="operatorId"
|
|
style="width: 100%;">
|
|
<el-table-column
|
|
type="selection"
|
|
header-align="center"
|
|
align="center"
|
|
:reserve-selection="true"
|
|
width="50">
|
|
</el-table-column>
|
|
<el-table-column label="编码" property="operatorId" align="left" header-align="center"/>
|
|
<el-table-column label="名称" property="operatorName" align="left" header-align="center"/>
|
|
</el-table>
|
|
<el-footer style="height:40px;margin-top: 20px;text-align:center">
|
|
<el-button type="primary" @click="saveHsfApproverChooseModal">确定</el-button>
|
|
<el-button type="primary" @click="hsfApproverFlag = false">关闭</el-button>
|
|
</el-footer>
|
|
</el-dialog>
|
|
|
|
<el-dialog title="人员选择" @open="openRelatedPeopleDialog" @close="closeRelatedPeopleDialog" v-drag
|
|
:visible.sync="relatedPeopleFlag" width="40vw" :close-on-click-modal="false">
|
|
<el-form :inline="true" label-position="top" :model="relatedPeopleSearchData">
|
|
<el-form-item label="编码">
|
|
<el-input v-model="relatedPeopleSearchData.operatorId" clearable style="width: 120px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="名称">
|
|
<el-input v-model="relatedPeopleSearchData.operatorName" clearable style="width: 120px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label=" ">
|
|
<el-button type="primary" @click="filterRelatedPeopleOptions">查询</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-table v-if="relatedPeopleFlag"
|
|
:height="300"
|
|
:data="relatedPeopleDisplayList"
|
|
highlight-current-row
|
|
@current-change="handleRelatedPeopleCurrentChange"
|
|
@row-click="handleRelatedPeopleTableClick"
|
|
ref="relatedPeopleTable"
|
|
border
|
|
style="width: 100%;">
|
|
<el-table-column label="编码" property="operatorId" align="left" header-align="center"/>
|
|
<el-table-column label="名称" property="operatorName" align="left" header-align="center"/>
|
|
</el-table>
|
|
<el-footer style="height:40px;margin-top: 20px;text-align:center">
|
|
<el-button type="primary" @click="saveRelatedPeopleChooseModal">确定</el-button>
|
|
<el-button type="primary" @click="relatedPeopleFlag = false">关闭</el-button>
|
|
</el-footer>
|
|
</el-dialog>
|
|
|
|
<el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="submitModalFlag" width="500px">
|
|
<el-form label-position="top">
|
|
<el-form-item label="驳回意见/Reject Opinion">
|
|
<el-input type="textarea" v-model="rejectOpinion" :rows="3" resize="none" show-word-limit style="width: 479px;height: 30px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-footer style="height:35px;margin-top:50px;text-align:center">
|
|
<el-button type="primary" :loading="submitLoading" @click="rejectSubmit">确定</el-button>
|
|
<el-button type="primary" @click="submitModalFlag = false">取消</el-button>
|
|
</el-footer>
|
|
</el-dialog>
|
|
|
|
<el-dialog width="700px" title="备注" :close-on-click-modal="false" :visible.sync="rohsRemarkFlag" v-drag>
|
|
<el-form label-position="top">
|
|
<el-form-item label="备注说明">
|
|
<el-input
|
|
type="textarea"
|
|
v-model="rohsRemarkForm.remark"
|
|
:rows="6"
|
|
maxlength="255"
|
|
show-word-limit
|
|
resize="none">
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-footer style="height:35px;margin-top:110px;text-align:center">
|
|
<el-button type="primary" @click="refreshRohsRemark">刷新</el-button>
|
|
<el-button type="primary" @click="saveRohsRemark">保存</el-button>
|
|
<el-button type="primary" @click="rohsRemarkFlag = false">取消</el-button>
|
|
</el-footer>
|
|
</el-dialog>
|
|
|
|
<!-- 底部附件页签 -->
|
|
<el-tabs v-model="activeTable" style="width: 100%; height: 100%;" type="border-card" @tab-click="refreshCurrentTabTable" class="customer-tab">
|
|
<el-tab-pane label="基本信息" name="basicInfo">
|
|
<div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item>
|
|
<span slot="label">申请人</span>
|
|
<el-input :value="currentRow.applicant || ''" disabled style="width: 100px"></el-input>
|
|
<el-input :value="currentRow.applicantName || ''" disabled style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="申请日期">
|
|
<el-date-picker :value="currentRow.applicationDate" disabled type="date" value-format="yyyy-MM-dd" style="width: 150px"></el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item label="Site">
|
|
<el-input :value="currentRow.site || ''" disabled style="width: 95px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="工艺">
|
|
<el-input :value="currentRow.process || ''" disabled style="width: 121px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item>
|
|
<span slot="label">最终客户</span>
|
|
<el-input :value="currentRow.endCustomer || ''" disabled style="width: 100px"></el-input>
|
|
<el-input :value="currentRow.endCustomerName || ''" disabled style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<span slot="label">项目编码</span>
|
|
<el-input :value="currentRow.projectId || ''" disabled style="width: 100px"></el-input>
|
|
<el-input :value="currentRow.projectName || ''" disabled style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="WM所需求规格">
|
|
<el-input :value="currentRow.wmRequiredSpec || ''" disabled style="width: 260px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="供应商">
|
|
<el-input :value="currentRow.vendorCode || ''" disabled style="width: 396px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="供应商材料编码">
|
|
<el-input :value="currentRow.vendorMaterialCode || ''" disabled style="width: 396px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="材料分类">
|
|
<el-input :value="currentRow.materialClassify || ''" disabled style="width: 668px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="其他分类" v-if="currentRow.materialClassify && currentRow.materialClassify.includes('Other其他')">
|
|
<el-input :value="currentRow.otherMaterialClassify || ''" disabled style="width: 123px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="辅材用途">
|
|
<el-input :value="currentRow.materialUseFor || ''" disabled style="width: 396px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<span slot="label">技术计划/TP</span>
|
|
<el-input :value="currentRow.technicalPlan || ''" disabled style="width: 100px"></el-input>
|
|
<el-input :value="currentRow.technicalPlanName || ''" disabled style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="颜色">
|
|
<el-input :value="currentRow.color || ''" disabled style="width: 396px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<span slot="label">PM人员/PM</span>
|
|
<el-input :value="currentRow.pm || ''" disabled style="width: 100px"></el-input>
|
|
<el-input :value="currentRow.pmName || ''" disabled style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="计划转量产时间">
|
|
<el-date-picker :value="normalizeDateOnly(currentRow.plannedMassProductionDate)" disabled type="date" value-format="yyyy-MM-dd" style="width: 123px"></el-date-picker>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item>
|
|
<span slot="label">商品组1</span>
|
|
<el-input :value="currentRow.commGroup1 || ''" disabled style="width: 100px"></el-input>
|
|
<el-input :value="currentRow.commGroup1Desc || ''" disabled style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<span slot="label">商品组2</span>
|
|
<el-input :value="currentRow.commGroup2 || ''" disabled style="width: 100px"></el-input>
|
|
<el-input :value="currentRow.commGroup2Desc || ''" disabled style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<span slot="label">商品组3</span>
|
|
<el-input :value="currentRow.commGroup3 || ''" disabled style="width: 100px"></el-input>
|
|
<el-input :value="currentRow.commGroup3Desc || ''" disabled style="width: 156px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="是否Fiber材料">
|
|
<el-radio-group :value="currentRow.isFiberMaterial" disabled style="width: 191px">
|
|
<el-radio label="Y">是</el-radio>
|
|
<el-radio label="N">否</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
<el-form-item label="是否需要创建300/700/900号">
|
|
<el-radio-group :value="currentRow.needCreateNumber" disabled style="width: 191px">
|
|
<el-radio label="Y">是</el-radio>
|
|
<el-radio label="N">否</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
<el-form-item label="材料厚度">
|
|
<el-input :value="currentRow.materialThickness || ''" disabled style="width: 396px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item>
|
|
<span slot="label">NPD工程师</span>
|
|
<el-input :value="currentRow.npdEngineer || ''" disabled style="width: 100px"></el-input>
|
|
<el-input :value="currentRow.npdEngineerName || ''" disabled style="width: 155px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="材料有效期">
|
|
<dict-data-select :value="currentRow.materialValidityTime || ''" :use-default-value="false" disabled style="width: 100px" dict-type="rohs_material_validity_time"></dict-data-select>
|
|
</el-form-item>
|
|
<el-form-item label="是否需要Deviation" style="margin-left: 25px">
|
|
<el-radio-group :value="currentRow.needDeviation" disabled style="width: 120px">
|
|
<el-radio label="Y">是</el-radio>
|
|
<el-radio label="N">否</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
<el-form-item label="预计提供报告时间(一个月内)">
|
|
<el-date-picker :value="normalizeDateOnly(currentRow.expectReportTime)" disabled type="date" value-format="yyyy-MM-dd" style="width: 260px"></el-date-picker>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="有效期备注">
|
|
<el-input :value="currentRow.materialValidityComments || ''" disabled style="width: 532px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<span slot="label">采购</span>
|
|
<el-input :value="currentRow.buyer || ''" disabled style="width: 100px"></el-input>
|
|
<el-input :value="currentRow.buyerName || ''" disabled style="width: 156px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="所需审批文件">
|
|
<el-input :value="currentRow.qualificationDocumentsNeeded || ''" disabled style="width: 804px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="测试报告必测项">
|
|
<el-input :value="currentRow.testReportIncludingItems || ''" disabled style="width: 804px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="备注说明" style="display: block;">
|
|
<el-input type="textarea" :rows="3" :value="currentRow.remark || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane label="NPD 信息" name="npdInfo">
|
|
<div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="现有材料不同规格/Same Material Diff Size">
|
|
<el-radio-group :value="currentRow.isSameMaterialDiffSize" disabled style="width: 190px">
|
|
<el-radio label="Y">是</el-radio>
|
|
<el-radio label="N">否</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="材料描述/Material Desc." style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.materialDesc || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input></el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 50px">
|
|
<el-form-item label="备注说明/NPD Remark" style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.npdRemark || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input></el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 50px">
|
|
<el-form-item label="TDS属性/TDS Property" style="display: block;">
|
|
<oss-components
|
|
ref="bottomTdsOss"
|
|
:save-visible="authFileSave"
|
|
:download-visible="authFileDownLoad"
|
|
:remove-visible="authFileRemove"
|
|
:preview-visible="authFilePreview"
|
|
:disabled="true"
|
|
label="序列号"
|
|
:height="180"
|
|
style="margin-top: 2px"
|
|
:columns="tdsFileColumnList"
|
|
:order-ref1="currentRow.site || ''"
|
|
:order-ref2="currentRow.referenceNo || ''"
|
|
order-ref3="tdsProperty">
|
|
</oss-components>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane label="HSF 填写信息" name="hsfInfo">
|
|
<div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="SGS报告编号/SGS Report Number">
|
|
<el-input :value="currentRow.sgsReportNumber || ''" disabled style="width: 252px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="状态/Status">
|
|
<el-input :value="currentRow.rohsStatus || ''" disabled style="width: 180px"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="报告日期/Expired Date">
|
|
<el-date-picker :value="currentRow.expiredDate" disabled type="date" value-format="yyyy-MM-dd" style="width: 180px"></el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item label="有效期数值/Valid Until Value">
|
|
<el-input :value="currentRow.validUntilValue || ''" disabled style="width: 150px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="有效期单位/Valid Until Unit">
|
|
<el-input :value="currentRow.validUntil || ''" disabled style="width: 180px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="失效日期/Expiry Date">
|
|
<el-date-picker :value="currentRow.expiryDate" disabled type="date" value-format="yyyy-MM-dd" style="width: 180px"></el-date-picker>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="是否符合RoHS/Meet RoHS Req">
|
|
<el-radio-group :value="currentRow.isMeetRohsRequirement" disabled style="width: 252px">
|
|
<el-radio label="Y">是</el-radio>
|
|
<el-radio label="N">否</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
<el-form-item label=" ">
|
|
<el-checkbox
|
|
:value="currentRow.isAhGrade"
|
|
true-label="Y"
|
|
false-label="N"
|
|
disabled
|
|
style="width: 200px">材料属性是否是AH/Is AH Grade</el-checkbox>
|
|
</el-form-item>
|
|
<el-form-item label="HSF供应商等级/Supplier Class">
|
|
<el-radio-group :value="currentRow.hsfSupplierClassification" disabled style="width: 200px">
|
|
<el-radio label="A类">A类</el-radio>
|
|
<el-radio label="B类">B类</el-radio>
|
|
<el-radio label="C类">C类</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow">
|
|
<el-form-item label="Fiber报告信息/Fiber Information" style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.fiberInformation || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input></el-form-item>
|
|
</el-form>
|
|
<el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 45px">
|
|
<el-form-item label="HSF审批人/HSF Approver"><el-input :value="currentRow.hsfApproverName || currentRow.hsfApprover || ''" disabled style="width: 396px"></el-input></el-form-item>
|
|
<el-form-item label="Inform Related people"><el-input :value="currentRow.relatedPeopleName || currentRow.relatedPeople || ''" disabled style="width: 396px"></el-input></el-form-item>
|
|
</el-form>
|
|
<el-form v-if="shouldShowHsfStandard(currentRow.endCustomer)" :inline="true" label-position="top" :model="currentRow" style="margin-top: 0px">
|
|
<el-form-item label="HSF标准/HSF Standard" style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.hsfStandard || ''" disabled resize="none" style="width: 804px;height: 30px"></el-input></el-form-item>
|
|
</el-form>
|
|
</div>
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane label="材料信息" name="materialInfo">
|
|
<div :style="{height: secondHeight + 'px'}" style="overflow-y: auto;">
|
|
<el-table
|
|
class="rohs-material-table"
|
|
border
|
|
:data="currentRow.materialList || []"
|
|
:height="secondHeight"
|
|
style="width: 100%">
|
|
<el-table-column type="index" label="序号" width="50" header-align="center" align="center"></el-table-column>
|
|
<el-table-column prop="finalPartNo" label="IFS物料编码/Final Part No." min-width="150" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="partDesc" label="描述/Part Desc." min-width="250" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="partStatus" label="状态/Part Status" min-width="100" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
|
|
</el-table>
|
|
</div>
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane label="附件信息" name="attachment">
|
|
<oss-components
|
|
ref="bottomAttachmentOss"
|
|
:save-visible="authFileSave"
|
|
:download-visible="authFileDownLoad"
|
|
:remove-visible="authFileRemove"
|
|
:preview-visible="authFilePreview"
|
|
:disabled="currentRow.status === '已完成'"
|
|
label="序列号"
|
|
:height="secondHeight - 25"
|
|
style="margin-top: 2px"
|
|
:columns="fileColumnList"
|
|
:order-ref1="currentRow.site"
|
|
:order-ref2="currentRow.referenceNo"
|
|
order-ref3="rohsAttachment">
|
|
</oss-components>
|
|
</el-tab-pane>
|
|
<el-tab-pane label="审批信息" name="approvalInformation">
|
|
<approval-information v-model:data-list="approvalList" :height="secondHeight"></approval-information>
|
|
</el-tab-pane>
|
|
</el-tabs>
|
|
<ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import * as api from '@/api/rohs/rohs'
|
|
import { checkSuperAdmin } from "@/api/changeManagement/changeManagement"
|
|
import { verifyData } from "@/api/chooselist/chooselist.js"
|
|
import { searchProjectInfoList } from "@/api/quotation/quotationInformation.js"
|
|
import { queryCustomer } from "@/api/customer/customerInformation"
|
|
import { queryProjectByCustomer } from "@/api/project/project"
|
|
import uploadFileList from '../common/uploadFileList'
|
|
import ossComponents from '../oss/ossComponents.vue'
|
|
import ChooseList from '@/views/modules/common/Chooselist'
|
|
import DictDataSelect from "../sys/dict-data-select.vue"
|
|
import ApprovalInformation from "../changeManagement/approvalInformation.vue"
|
|
|
|
export default {
|
|
components: {
|
|
uploadFileList,
|
|
ossComponents,
|
|
ChooseList,
|
|
DictDataSelect,
|
|
ApprovalInformation
|
|
},
|
|
data () {
|
|
return {
|
|
searchData: {
|
|
site: this.$store.state.user.site,
|
|
referenceNo: '',
|
|
status: '',
|
|
currentApprover: '',
|
|
nodeId: ''
|
|
},
|
|
exportLoading: false,
|
|
exportData: [],
|
|
exportFieldMap: {},
|
|
exportName: '',
|
|
exportHeader: ['RoHs记录'],
|
|
exportFooter: [],
|
|
resultList: [],
|
|
dataList: [],
|
|
pageIndex: 1,
|
|
pageSize: 20,
|
|
totalPage: 0,
|
|
dataListLoading: false,
|
|
|
|
activeTable: 'basicInfo',
|
|
menuId: '108006', // 暂定ROHS菜单ID
|
|
authSearch: false,
|
|
authUpdate: false,
|
|
authIssue: false,
|
|
authSubmit: false,
|
|
authReject: false,
|
|
authFileSave: false,
|
|
authFileDownLoad: false,
|
|
authFileRemove: false,
|
|
authFilePreview: false,
|
|
authDataEntry: false,
|
|
authDelete: false,
|
|
superAdmin: false,
|
|
createBy2: this.$store.state.user.name,
|
|
height: 400,
|
|
secondHeight: 200,
|
|
currentRow: {},
|
|
fileColumnList: [
|
|
{
|
|
columnProp: 'fileName',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '文件名称',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 140
|
|
},
|
|
{
|
|
columnProp: 'fileRemark',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '备注',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 200
|
|
},
|
|
{
|
|
columnProp: 'createDate',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '上传时间',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 150
|
|
},
|
|
{
|
|
columnProp: 'createBy',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '上传人',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
}
|
|
],
|
|
tdsFileColumnList: [
|
|
{
|
|
columnProp: 'fileNo',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '文件编码',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 130
|
|
},
|
|
{
|
|
columnProp: 'rev',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '版本号',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 90
|
|
},
|
|
{
|
|
columnProp: 'fileName',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '文件名称',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 160
|
|
},
|
|
{
|
|
columnProp: 'fileRemark',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '备注',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 180
|
|
},
|
|
{
|
|
columnProp: 'createDate',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '上传时间',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 150
|
|
},
|
|
{
|
|
columnProp: 'invalidationTime',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '失效时间',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 150
|
|
},
|
|
{
|
|
columnProp: 'createBy',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '上传人',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
}
|
|
],
|
|
|
|
modalFlag: false,
|
|
chooseProjectListFlag: false,
|
|
projectMaterialDialogFlag: false,
|
|
searchProjectData: {
|
|
site: '',
|
|
projectId: undefined,
|
|
projectName: undefined,
|
|
customerId: undefined,
|
|
},
|
|
projectMaterialSearchData: {
|
|
finalPartNo: '',
|
|
partDesc: '',
|
|
partStatus: ''
|
|
},
|
|
projectMaterialList: [],
|
|
projectMaterialSelections: [],
|
|
dataListSelections: [],
|
|
materialSelections: [],
|
|
projectMaterialPageIndex: 1,
|
|
projectMaterialPageSize: 20,
|
|
projectMaterialTotal: 0,
|
|
projectMaterialLoading: false,
|
|
nodeOptions: [],
|
|
projectList: [],
|
|
hsfApproverOptionList: [],
|
|
hsfApproverDisplayList: [],
|
|
hsfApproverSelectionCache: [],
|
|
hsfApproverFlag: false,
|
|
hsfApproverSearchData: {
|
|
operatorId: '',
|
|
operatorName: ''
|
|
},
|
|
relatedPeopleOptionList: [],
|
|
relatedPeopleDisplayList: [],
|
|
relatedPeopleSelection: null,
|
|
relatedPeopleFlag: false,
|
|
relatedPeopleSearchData: {
|
|
operatorId: '',
|
|
operatorName: ''
|
|
},
|
|
approvalList: [],
|
|
plmRohsAuthorityArr: [],
|
|
nodeAuthorityLoaded: false,
|
|
isEditMode: false,
|
|
modalTitle: 'RoHS 新增',
|
|
activeName: 'basicInfo',
|
|
showModalFlag: false,
|
|
submitModalFlag: false,
|
|
rohsRemarkFlag: false,
|
|
rejectOpinion: '',
|
|
submitLoading: false,
|
|
rohsRemarkForm: {
|
|
remark: ''
|
|
},
|
|
hsfStandardDefaultText: 'With the follow environmental specification: Macallan regulated Substances specification(069-0135) /Macallan sustainable fiber specification(099-00532)',
|
|
modalData: {
|
|
site: 'DEFAULT',
|
|
referenceNo: '',
|
|
applicant: '',
|
|
pm: '',
|
|
pmName: '',
|
|
applicationDate: '',
|
|
process: '',
|
|
plannedMassProductionDate: '',
|
|
color: '',
|
|
vendorCode: '',
|
|
vendorMaterialCode: '',
|
|
materialClassify: '',
|
|
otherMaterialClassify: '',
|
|
materialUseFor: '',
|
|
endCustomer: '',
|
|
projectId: '',
|
|
commGroup1: '',
|
|
commGroup1Desc: '',
|
|
commGroup2: '',
|
|
commGroup2Desc: '',
|
|
commGroup3: '',
|
|
commGroup3Desc: '',
|
|
needCreateNumber: '',
|
|
npdEngineer: '',
|
|
materialValidityTime: '',
|
|
materialValidityComments: '',
|
|
needDeviation: '',
|
|
technicalPlan: '',
|
|
wmRequiredSpec: '',
|
|
isFiberMaterial: '',
|
|
materialThickness: '',
|
|
buyer: '',
|
|
expectReportTime: '',
|
|
qualificationDocumentsNeeded: '',
|
|
qualificationDocumentsNeededList: [],
|
|
testReportIncludingItems: '',
|
|
testReportIncludingItemsList: [],
|
|
remark: '',
|
|
status: '',
|
|
sgsReportNumber: '',
|
|
rohsStatus: 'Active',
|
|
expiredDate: '',
|
|
expiryDate: '',
|
|
fiberInformation: '',
|
|
hsfStandard: '',
|
|
hsfApprover: '',
|
|
hsfApproverName: '',
|
|
hsfApproverCodeList: [],
|
|
relatedPeople: '',
|
|
relatedPeopleName: '',
|
|
buNo: '',
|
|
validUntilValue: 0,
|
|
validUntil: '',
|
|
isMeetRohsRequirement: '',
|
|
isAhGrade: 'N',
|
|
hsfSupplierClassification: '',
|
|
materialDesc: '',
|
|
npdRemark: '',
|
|
isSameMaterialDiffSize: '',
|
|
ifsPartNo: '',
|
|
materialList: [],
|
|
stepId: null,
|
|
rejectFlag: '',
|
|
rejectStepId: null,
|
|
createBy2: '',
|
|
isReject: 'Y',
|
|
tpProcessControl: 'N',
|
|
csProcessControl: 'N'
|
|
}
|
|
}
|
|
},
|
|
created () {
|
|
this.menuId = this.$route.meta.menuId
|
|
this.getButtonAuthData()
|
|
this.checkSuperAdmin()
|
|
},
|
|
mounted () {
|
|
this.fetchNodeOptions()
|
|
if (this.authSearch) {
|
|
this.getDataList()
|
|
}
|
|
this.$nextTick(() => {
|
|
this.height = window.innerHeight / 2 - 30
|
|
/*第二个表格高度的动态调整*/
|
|
this.secondHeight = window.innerHeight / 2 - 186
|
|
})
|
|
},
|
|
watch: {
|
|
activeName (val) {
|
|
if (val === 'attachmentInfo' || val === 'npdInfo') {
|
|
this.$nextTick(() => {
|
|
if (val === 'attachmentInfo') {
|
|
this.refreshOssRef('modalAttachmentOss')
|
|
}
|
|
if (val === 'npdInfo') {
|
|
this.refreshOssRef('modalTdsOss')
|
|
}
|
|
})
|
|
}
|
|
},
|
|
'modalData.expiredDate' () {
|
|
this.syncExpiryDateByRule()
|
|
},
|
|
'modalData.validUntilValue' () {
|
|
this.syncExpiryDateByRule()
|
|
},
|
|
'modalData.validUntil' () {
|
|
this.syncExpiryDateByRule()
|
|
},
|
|
'modalData.endCustomer' () {
|
|
this.applyHsfStandardDefaultByCustomer(this.modalData)
|
|
}
|
|
},
|
|
methods: {
|
|
fetchNodeOptions () {
|
|
if (!this.searchData.site || !this.menuId) {
|
|
this.nodeOptions = []
|
|
return
|
|
}
|
|
let params = {
|
|
site: this.searchData.site,
|
|
menuId: this.menuId
|
|
}
|
|
api.getNodeList(params).then(({data}) => {
|
|
if (data && data.code === 0 && Array.isArray(data.rows)) {
|
|
this.nodeOptions = data.rows
|
|
.filter(item => item && item.nodeId)
|
|
.map(item => ({
|
|
id: item.nodeId,
|
|
name: item.nodeName
|
|
}))
|
|
} else {
|
|
this.nodeOptions = []
|
|
}
|
|
}).catch(() => {
|
|
this.nodeOptions = []
|
|
})
|
|
},
|
|
loadNodeAuthority (site, stepId) {
|
|
if (!site || stepId === null || stepId === undefined || !this.menuId) {
|
|
this.plmRohsAuthorityArr = []
|
|
this.nodeAuthorityLoaded = true
|
|
return Promise.resolve()
|
|
}
|
|
this.nodeAuthorityLoaded = false
|
|
let params = {
|
|
site: site,
|
|
stepId: stepId,
|
|
menuId: this.menuId
|
|
}
|
|
return api.getRohsNodeAuthority(params).then(({data}) => {
|
|
if (data && data.code === 0 && data.rows) {
|
|
this.plmRohsAuthorityArr = data.rows.plm_rohs || []
|
|
} else {
|
|
this.plmRohsAuthorityArr = []
|
|
}
|
|
this.nodeAuthorityLoaded = true
|
|
}).catch(() => {
|
|
this.plmRohsAuthorityArr = []
|
|
this.nodeAuthorityLoaded = true
|
|
})
|
|
},
|
|
rohsFieldFlag (fieldId) {
|
|
if (!this.plmRohsAuthorityArr || this.plmRohsAuthorityArr.length === 0) {
|
|
return 'N'
|
|
}
|
|
let target = this.plmRohsAuthorityArr.find(item => item.fieldId === fieldId)
|
|
return target ? target.updateFlag : 'N'
|
|
},
|
|
isRohsFieldDisabled (fieldId) {
|
|
if (this.showModalFlag) {
|
|
return true
|
|
}
|
|
if (!this.isEditMode) {
|
|
return false
|
|
}
|
|
return this.rohsFieldFlag(fieldId) === 'N'
|
|
},
|
|
isProcessFieldDisabled () {
|
|
if (this.isEditMode) {
|
|
return true
|
|
}
|
|
return this.isRohsFieldDisabled('process')
|
|
},
|
|
handleProcessChange (value) {
|
|
const processValue = String(value || '').trim()
|
|
this.$set(this.modalData, 'process', processValue)
|
|
this.$set(this.modalData, 'buNo', processValue)
|
|
if (this.isEditMode) {
|
|
return
|
|
}
|
|
this.clearHsfApproverFields(false)
|
|
if (!processValue) {
|
|
return
|
|
}
|
|
this.loadHsfApproverByCurrentProcess(true)
|
|
},
|
|
isRohsFieldDisabledWithFallback (primaryFieldId, fallbackFieldId) {
|
|
if (this.showModalFlag) {
|
|
return true
|
|
}
|
|
if (!this.isEditMode) {
|
|
return false
|
|
}
|
|
const primaryDisabled = this.rohsFieldFlag(primaryFieldId) === 'N'
|
|
if (!primaryDisabled) {
|
|
return false
|
|
}
|
|
return this.rohsFieldFlag(fallbackFieldId) === 'N'
|
|
},
|
|
isValidUntilValueDisabled () {
|
|
return this.isRohsFieldDisabledWithFallback('validUntilValue', 'validUntil')
|
|
},
|
|
isValidUntilUnitDisabled () {
|
|
return this.isRohsFieldDisabledWithFallback('validUntil', 'validUntilValue')
|
|
},
|
|
canEditRohsMaterial () {
|
|
return !this.showModalFlag
|
|
},
|
|
normalizeDateOnly (value) {
|
|
if (value === null || value === undefined || value === '') {
|
|
return ''
|
|
}
|
|
if (value instanceof Date && !Number.isNaN(value.getTime())) {
|
|
const year = value.getFullYear()
|
|
const month = String(value.getMonth() + 1).padStart(2, '0')
|
|
const day = String(value.getDate()).padStart(2, '0')
|
|
return year + '-' + month + '-' + day
|
|
}
|
|
const text = String(value).trim()
|
|
if (!text) {
|
|
return ''
|
|
}
|
|
if (text.includes('T')) {
|
|
return text.split('T')[0]
|
|
}
|
|
return text.length >= 10 ? text.substring(0, 10) : text
|
|
},
|
|
parseDateOnly (value) {
|
|
const text = this.normalizeDateOnly(value)
|
|
if (!text) {
|
|
return null
|
|
}
|
|
const parts = text.split('-')
|
|
if (parts.length !== 3) {
|
|
return null
|
|
}
|
|
const year = Number.parseInt(parts[0], 10)
|
|
const month = Number.parseInt(parts[1], 10)
|
|
const day = Number.parseInt(parts[2], 10)
|
|
if (Number.isNaN(year) || Number.isNaN(month) || Number.isNaN(day)) {
|
|
return null
|
|
}
|
|
const date = new Date(year, month - 1, day)
|
|
if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {
|
|
return null
|
|
}
|
|
return date
|
|
},
|
|
normalizeValidUntilUnitType (unitValue) {
|
|
const text = String(unitValue || '').trim().toLowerCase()
|
|
if (!text) {
|
|
return ''
|
|
}
|
|
if (text === 'd' || text === 'day' || text === 'days' || text.includes('日')) {
|
|
return 'day'
|
|
}
|
|
if (text === 'w' || text === 'week' || text === 'weeks' || text.includes('周')) {
|
|
return 'week'
|
|
}
|
|
if (text === 'm' || text === 'month' || text === 'months' || text.includes('月')) {
|
|
return 'month'
|
|
}
|
|
if (text === 'y' || text === 'year' || text === 'years' || text.includes('年')) {
|
|
return 'year'
|
|
}
|
|
return ''
|
|
},
|
|
addMonthsKeepDay (baseDate, monthDelta) {
|
|
const year = baseDate.getFullYear()
|
|
const month = baseDate.getMonth()
|
|
const day = baseDate.getDate()
|
|
const targetFirstDay = new Date(year, month + monthDelta, 1)
|
|
const targetYear = targetFirstDay.getFullYear()
|
|
const targetMonth = targetFirstDay.getMonth()
|
|
const lastDay = new Date(targetYear, targetMonth + 1, 0).getDate()
|
|
return new Date(targetYear, targetMonth, Math.min(day, lastDay))
|
|
},
|
|
addYearsKeepDay (baseDate, yearDelta) {
|
|
const targetYear = baseDate.getFullYear() + yearDelta
|
|
const month = baseDate.getMonth()
|
|
const day = baseDate.getDate()
|
|
const lastDay = new Date(targetYear, month + 1, 0).getDate()
|
|
return new Date(targetYear, month, Math.min(day, lastDay))
|
|
},
|
|
calculateExpiryDateByRule (reportDate, validUntilValue, validUntilUnit) {
|
|
const baseDate = this.parseDateOnly(reportDate)
|
|
const durationValue = this.normalizeValidUntilValue(validUntilValue)
|
|
const unitType = this.normalizeValidUntilUnitType(validUntilUnit)
|
|
if (!baseDate || !durationValue || !unitType) {
|
|
return ''
|
|
}
|
|
let resultDate = new Date(baseDate.getTime())
|
|
if (unitType === 'day') {
|
|
resultDate.setDate(resultDate.getDate() + durationValue)
|
|
} else if (unitType === 'week') {
|
|
resultDate.setDate(resultDate.getDate() + durationValue * 7)
|
|
} else if (unitType === 'month') {
|
|
resultDate = this.addMonthsKeepDay(baseDate, durationValue)
|
|
} else if (unitType === 'year') {
|
|
resultDate = this.addYearsKeepDay(baseDate, durationValue)
|
|
} else {
|
|
return ''
|
|
}
|
|
return this.normalizeDateOnly(resultDate)
|
|
},
|
|
syncExpiryDateByRule () {
|
|
if (!this.modalData) {
|
|
return ''
|
|
}
|
|
const expiryDate = this.calculateExpiryDateByRule(this.modalData.expiredDate, this.modalData.validUntilValue, this.modalData.validUntil)
|
|
this.$set(this.modalData, 'expiryDate', expiryDate)
|
|
return expiryDate
|
|
},
|
|
getCurrentDateString () {
|
|
return this.normalizeDateOnly(new Date())
|
|
},
|
|
normalizeCheckboxFlag (value) {
|
|
return String(value || '').trim().toUpperCase() === 'Y' ? 'Y' : 'N'
|
|
},
|
|
normalizeValidUntilValue (value) {
|
|
if (value === null || value === undefined || value === '') {
|
|
return null
|
|
}
|
|
const parsed = Number.parseInt(value, 10)
|
|
if (Number.isNaN(parsed) || parsed <= 0) {
|
|
return null
|
|
}
|
|
return parsed
|
|
},
|
|
getValidUntilDisplay (value, unit) {
|
|
const normalizedValue = this.normalizeValidUntilValue(value)
|
|
const normalizedUnit = String(unit || '').trim()
|
|
if (normalizedValue && normalizedUnit) {
|
|
return normalizedValue + normalizedUnit
|
|
}
|
|
if (normalizedValue) {
|
|
return String(normalizedValue)
|
|
}
|
|
return normalizedUnit
|
|
},
|
|
getRohsSubmitFieldValue (fieldId) {
|
|
const fieldMapping = {
|
|
materialClassify: 'materialClassifyList',
|
|
qualificationDocumentsNeeded: 'qualificationDocumentsNeededList',
|
|
testReportIncludingItems: 'testReportIncludingItemsList',
|
|
hsfApprover: 'hsfApproverCodeList'
|
|
}
|
|
const mappedField = fieldMapping[fieldId]
|
|
if (mappedField) {
|
|
return this.modalData[mappedField]
|
|
}
|
|
return this.modalData[fieldId]
|
|
},
|
|
isSubmitFieldEmpty (value) {
|
|
if (Array.isArray(value)) {
|
|
return value.length === 0
|
|
}
|
|
if (typeof value === 'string') {
|
|
return value.trim() === ''
|
|
}
|
|
return !value
|
|
},
|
|
validateSubmitRequiredFields () {
|
|
if (this.plmRohsAuthorityArr && this.plmRohsAuthorityArr.length > 0) {
|
|
let validUntilPairRequiredChecked = false
|
|
for (let i = 0; i < this.plmRohsAuthorityArr.length; i++) {
|
|
const fieldConfig = this.plmRohsAuthorityArr[i]
|
|
if (fieldConfig.required !== 'Y') {
|
|
continue
|
|
}
|
|
if (fieldConfig.fieldId === 'hsfStandard' && !this.shouldShowHsfStandard(this.modalData.endCustomer)) {
|
|
continue
|
|
}
|
|
if (fieldConfig.fieldId === 'validUntil' || fieldConfig.fieldId === 'validUntilValue') {
|
|
if (validUntilPairRequiredChecked) {
|
|
continue
|
|
}
|
|
const validUntilValue = this.normalizeValidUntilValue(this.modalData.validUntilValue)
|
|
this.$set(this.modalData, 'validUntilValue', validUntilValue)
|
|
if (this.isSubmitFieldEmpty(validUntilValue) || this.isSubmitFieldEmpty(this.modalData.validUntil)) {
|
|
this.$message.warning('有效期数值/单位不能为空!')
|
|
return false
|
|
}
|
|
validUntilPairRequiredChecked = true
|
|
continue
|
|
}
|
|
const value = this.getRohsSubmitFieldValue(fieldConfig.fieldId)
|
|
if (this.isSubmitFieldEmpty(value)) {
|
|
this.$message.warning((fieldConfig.fieldName || fieldConfig.fieldId) + '不能为空!')
|
|
return false
|
|
}
|
|
}
|
|
}
|
|
|
|
return true
|
|
},
|
|
validateValidUntilPair () {
|
|
const validUntilValue = this.normalizeValidUntilValue(this.modalData.validUntilValue)
|
|
const validUntilUnit = String(this.modalData.validUntil || '').trim()
|
|
this.$set(this.modalData, 'validUntilValue', validUntilValue)
|
|
this.$set(this.modalData, 'validUntil', validUntilUnit)
|
|
if (!validUntilValue && !validUntilUnit) {
|
|
return true
|
|
}
|
|
if (!validUntilValue) {
|
|
this.$message.warning('请填写有效期数值')
|
|
return false
|
|
}
|
|
if (!validUntilUnit) {
|
|
this.$message.warning('请选择有效期单位')
|
|
return false
|
|
}
|
|
return true
|
|
},
|
|
materialDialogHeaderCellStyle () {
|
|
return {
|
|
whiteSpace: 'nowrap',
|
|
wordBreak: 'keep-all'
|
|
}
|
|
},
|
|
displayYesNo (value) {
|
|
if (value === 'Y') {
|
|
return '是'
|
|
}
|
|
if (value === 'N') {
|
|
return '否'
|
|
}
|
|
return value || ''
|
|
},
|
|
getMultipleSelectTitle (value) {
|
|
if (!Array.isArray(value)) {
|
|
return ''
|
|
}
|
|
return value
|
|
.filter(item => item !== null && item !== undefined && String(item).trim() !== '')
|
|
.map(item => String(item).trim())
|
|
.join(';')
|
|
},
|
|
shouldShowHsfStandard (customerCode) {
|
|
return String(customerCode || '').trim().toUpperCase() === 'C00052'
|
|
},
|
|
applyHsfStandardDefaultByCustomer (formData) {
|
|
if (!formData || !this.shouldShowHsfStandard(formData.endCustomer)) {
|
|
return
|
|
}
|
|
const currentValue = String(formData.hsfStandard || '').trim()
|
|
if (!currentValue) {
|
|
this.$set(formData, 'hsfStandard', this.hsfStandardDefaultText)
|
|
}
|
|
},
|
|
normalizeHsfStandardByCustomer (formData) {
|
|
if (!formData) {
|
|
return
|
|
}
|
|
if (!this.shouldShowHsfStandard(formData.endCustomer)) {
|
|
this.$set(formData, 'hsfStandard', '')
|
|
return
|
|
}
|
|
this.applyHsfStandardDefaultByCustomer(formData)
|
|
},
|
|
resolveOperatorNameById (operatorId) {
|
|
const normalizedId = String(operatorId || '').trim()
|
|
if (!normalizedId) {
|
|
return ''
|
|
}
|
|
const option = (this.hsfApproverOptionList || []).find(item => String(item.operatorId || '').trim() === normalizedId) ||
|
|
(this.relatedPeopleOptionList || []).find(item => String(item.operatorId || '').trim() === normalizedId)
|
|
return option ? String(option.operatorName || '').trim() : normalizedId
|
|
},
|
|
resolveOperatorIdByCodeOrName (operatorValue) {
|
|
const normalizedValue = String(operatorValue || '').trim()
|
|
if (!normalizedValue) {
|
|
return ''
|
|
}
|
|
const option = (this.hsfApproverOptionList || []).find(item => String(item.operatorId || '').trim() === normalizedValue) ||
|
|
(this.hsfApproverOptionList || []).find(item => String(item.operatorName || '').trim() === normalizedValue) ||
|
|
(this.relatedPeopleOptionList || []).find(item => String(item.operatorId || '').trim() === normalizedValue) ||
|
|
(this.relatedPeopleOptionList || []).find(item => String(item.operatorName || '').trim() === normalizedValue)
|
|
return option ? String(option.operatorId || '').trim() : normalizedValue
|
|
},
|
|
syncHsfApproverFields () {
|
|
const sourceList = Array.isArray(this.modalData.hsfApproverCodeList)
|
|
? this.modalData.hsfApproverCodeList
|
|
: []
|
|
const uniqueCodeList = []
|
|
const seen = new Set()
|
|
sourceList.forEach(item => {
|
|
const value = this.resolveOperatorIdByCodeOrName(item)
|
|
if (!value || seen.has(value)) {
|
|
return
|
|
}
|
|
seen.add(value)
|
|
uniqueCodeList.push(value)
|
|
})
|
|
this.$set(this.modalData, 'hsfApproverCodeList', uniqueCodeList)
|
|
this.$set(this.modalData, 'hsfApprover', uniqueCodeList.join(';'))
|
|
this.$set(this.modalData, 'hsfApproverName', uniqueCodeList.map(item => this.resolveOperatorNameById(item)).join(';'))
|
|
this.buildRelatedPeopleOptions(uniqueCodeList)
|
|
|
|
const relatedPeopleCode = this.resolveOperatorIdByCodeOrName(this.modalData.relatedPeople)
|
|
if (relatedPeopleCode && !uniqueCodeList.includes(relatedPeopleCode)) {
|
|
this.$set(this.modalData, 'relatedPeople', '')
|
|
this.$set(this.modalData, 'relatedPeopleName', '')
|
|
return
|
|
}
|
|
if (relatedPeopleCode) {
|
|
this.$set(this.modalData, 'relatedPeople', relatedPeopleCode)
|
|
this.$set(this.modalData, 'relatedPeopleName', this.resolveOperatorNameById(relatedPeopleCode))
|
|
}
|
|
},
|
|
buildRelatedPeopleOptions (selectedOperatorIds) {
|
|
const normalizedIds = (Array.isArray(selectedOperatorIds) ? selectedOperatorIds : (this.modalData.hsfApproverCodeList || []))
|
|
.map(item => this.resolveOperatorIdByCodeOrName(item))
|
|
.filter(item => !!item)
|
|
const selectedSet = new Set(normalizedIds)
|
|
let optionList = (this.hsfApproverOptionList || [])
|
|
.filter(item => selectedSet.has(String(item.operatorId || '').trim()))
|
|
.map(item => ({
|
|
operatorId: item.operatorId,
|
|
operatorName: item.operatorName
|
|
}))
|
|
const existingIdSet = new Set(optionList.map(item => String(item.operatorId || '').trim()))
|
|
normalizedIds.forEach(operatorId => {
|
|
if (existingIdSet.has(operatorId)) {
|
|
return
|
|
}
|
|
optionList.push({
|
|
operatorId: operatorId,
|
|
operatorName: this.resolveOperatorNameById(operatorId)
|
|
})
|
|
existingIdSet.add(operatorId)
|
|
})
|
|
this.relatedPeopleOptionList = optionList
|
|
this.filterRelatedPeopleOptions()
|
|
const selectedRelatedPeopleCode = this.resolveOperatorIdByCodeOrName(this.modalData.relatedPeople)
|
|
const selectedRelatedPeopleRow = optionList.find(item => String(item.operatorId || '').trim() === selectedRelatedPeopleCode)
|
|
if (!selectedRelatedPeopleRow) {
|
|
this.$set(this.modalData, 'relatedPeople', '')
|
|
this.$set(this.modalData, 'relatedPeopleName', '')
|
|
} else {
|
|
this.$set(this.modalData, 'relatedPeople', selectedRelatedPeopleCode)
|
|
this.$set(this.modalData, 'relatedPeopleName', String(selectedRelatedPeopleRow.operatorName || '').trim())
|
|
}
|
|
},
|
|
normalizeHsfApproverOptionList (rows) {
|
|
if (!Array.isArray(rows)) {
|
|
return []
|
|
}
|
|
return rows
|
|
.map(item => {
|
|
const operatorId = String(item.operatorId || item.operator_id || item.username || item.userName || '').trim()
|
|
const operatorName = String(item.operatorName || item.operator_name || item.userDisplay || item.user_display || '').trim()
|
|
if (!operatorId || !operatorName) {
|
|
return null
|
|
}
|
|
return {
|
|
operatorId,
|
|
operatorName
|
|
}
|
|
})
|
|
.filter(item => !!item)
|
|
},
|
|
filterHsfApproverOptions () {
|
|
const operatorIdKeyword = String(this.hsfApproverSearchData.operatorId || '').trim().toUpperCase()
|
|
const operatorNameKeyword = String(this.hsfApproverSearchData.operatorName || '').trim().toUpperCase()
|
|
this.hsfApproverDisplayList = (this.hsfApproverOptionList || []).filter(item => {
|
|
const operatorId = String(item.operatorId || '').toUpperCase()
|
|
const operatorName = String(item.operatorName || '').toUpperCase()
|
|
const matchOperatorId = !operatorIdKeyword || operatorId.includes(operatorIdKeyword)
|
|
const matchOperatorName = !operatorNameKeyword || operatorName.includes(operatorNameKeyword)
|
|
return matchOperatorId && matchOperatorName
|
|
})
|
|
},
|
|
filterRelatedPeopleOptions () {
|
|
const operatorIdKeyword = String(this.relatedPeopleSearchData.operatorId || '').trim().toUpperCase()
|
|
const operatorNameKeyword = String(this.relatedPeopleSearchData.operatorName || '').trim().toUpperCase()
|
|
this.relatedPeopleDisplayList = (this.relatedPeopleOptionList || []).filter(item => {
|
|
const operatorId = String(item.operatorId || '').toUpperCase()
|
|
const operatorName = String(item.operatorName || '').toUpperCase()
|
|
const matchOperatorId = !operatorIdKeyword || operatorId.includes(operatorIdKeyword)
|
|
const matchOperatorName = !operatorNameKeyword || operatorName.includes(operatorNameKeyword)
|
|
return matchOperatorId && matchOperatorName
|
|
})
|
|
},
|
|
openHsfApproverChooseModal () {
|
|
if (this.isRohsFieldDisabled('hsfApprover')) {
|
|
return
|
|
}
|
|
if (!this.modalData || !String(this.modalData.process || '').trim()) {
|
|
this.$message.warning('请先选择工艺')
|
|
return
|
|
}
|
|
this.loadHsfApproverByCurrentProcess(false).then(() => {
|
|
if (!this.hsfApproverOptionList || this.hsfApproverOptionList.length === 0) {
|
|
this.$message.warning('未查询到可选HSF审批人')
|
|
return
|
|
}
|
|
this.hsfApproverFlag = true
|
|
})
|
|
},
|
|
openHsfApproverDialog () {
|
|
this.hsfApproverSearchData = {
|
|
operatorId: '',
|
|
operatorName: ''
|
|
}
|
|
this.filterHsfApproverOptions()
|
|
const selectedOperatorSet = new Set(
|
|
(this.modalData.hsfApproverCodeList || [])
|
|
.map(item => String(item || '').trim())
|
|
.filter(item => !!item)
|
|
)
|
|
const selectedRows = (this.hsfApproverOptionList || []).filter(item => selectedOperatorSet.has(String(item.operatorId || '').trim()))
|
|
this.hsfApproverSelectionCache = JSON.parse(JSON.stringify(selectedRows))
|
|
this.$nextTick(() => {
|
|
if (!this.$refs.hsfApproverTable) {
|
|
return
|
|
}
|
|
this.$refs.hsfApproverTable.clearSelection()
|
|
selectedRows.forEach(item => {
|
|
this.$refs.hsfApproverTable.toggleRowSelection(item, true)
|
|
})
|
|
})
|
|
},
|
|
closeHsfApproverDialog () {
|
|
this.hsfApproverSelectionCache = []
|
|
},
|
|
handleHsfApproverSelectionChange (rows) {
|
|
this.hsfApproverSelectionCache = rows || []
|
|
},
|
|
handleHsfApproverTableClick (row, column, event, tableRef) {
|
|
if (this.$refs[tableRef]) {
|
|
this.$refs[tableRef].toggleRowSelection(row)
|
|
}
|
|
},
|
|
saveHsfApproverChooseModal () {
|
|
const selectedCodes = (this.hsfApproverSelectionCache || [])
|
|
.map(item => String(item.operatorId || '').trim())
|
|
.filter(item => !!item)
|
|
this.$set(this.modalData, 'hsfApproverCodeList', selectedCodes)
|
|
this.syncHsfApproverFields()
|
|
this.hsfApproverFlag = false
|
|
},
|
|
clearHsfApproverSelection () {
|
|
this.$set(this.modalData, 'hsfApproverCodeList', [])
|
|
this.syncHsfApproverFields()
|
|
},
|
|
openRelatedPeopleChooseModal () {
|
|
if (this.isRohsFieldDisabled('relatedPeople')) {
|
|
return
|
|
}
|
|
if (!this.modalData || !Array.isArray(this.modalData.hsfApproverCodeList) || this.modalData.hsfApproverCodeList.length === 0) {
|
|
this.$message.warning('请先选择HSF审批人')
|
|
return
|
|
}
|
|
this.buildRelatedPeopleOptions(this.modalData.hsfApproverCodeList)
|
|
if (!this.relatedPeopleOptionList || this.relatedPeopleOptionList.length === 0) {
|
|
this.$message.warning('未查询到可选Inform Related people')
|
|
return
|
|
}
|
|
this.relatedPeopleFlag = true
|
|
},
|
|
openRelatedPeopleDialog () {
|
|
this.relatedPeopleSearchData = {
|
|
operatorId: '',
|
|
operatorName: ''
|
|
}
|
|
this.filterRelatedPeopleOptions()
|
|
const relatedPeopleCode = String(this.modalData.relatedPeople || '').trim()
|
|
const selectedRow = (this.relatedPeopleOptionList || []).find(item => String(item.operatorId || '').trim() === relatedPeopleCode) || null
|
|
this.relatedPeopleSelection = selectedRow
|
|
this.$nextTick(() => {
|
|
if (!this.$refs.relatedPeopleTable) {
|
|
return
|
|
}
|
|
this.$refs.relatedPeopleTable.setCurrentRow(selectedRow || null)
|
|
})
|
|
},
|
|
closeRelatedPeopleDialog () {
|
|
this.relatedPeopleSelection = null
|
|
},
|
|
handleRelatedPeopleCurrentChange (row) {
|
|
this.relatedPeopleSelection = row || null
|
|
},
|
|
handleRelatedPeopleTableClick (row) {
|
|
this.relatedPeopleSelection = row || null
|
|
if (this.$refs.relatedPeopleTable) {
|
|
this.$refs.relatedPeopleTable.setCurrentRow(row)
|
|
}
|
|
},
|
|
saveRelatedPeopleChooseModal () {
|
|
const selectedCode = this.relatedPeopleSelection ? String(this.relatedPeopleSelection.operatorId || '').trim() : ''
|
|
const selectedName = this.relatedPeopleSelection ? String(this.relatedPeopleSelection.operatorName || '').trim() : ''
|
|
this.$set(this.modalData, 'relatedPeople', selectedCode)
|
|
this.$set(this.modalData, 'relatedPeopleName', selectedName)
|
|
this.relatedPeopleFlag = false
|
|
},
|
|
clearRelatedPeopleSelection () {
|
|
this.$set(this.modalData, 'relatedPeople', '')
|
|
this.$set(this.modalData, 'relatedPeopleName', '')
|
|
this.relatedPeopleSelection = null
|
|
if (this.$refs.relatedPeopleTable) {
|
|
this.$refs.relatedPeopleTable.setCurrentRow(null)
|
|
}
|
|
},
|
|
clearHsfApproverFields (clearBuNo = false) {
|
|
if (clearBuNo) {
|
|
this.$set(this.modalData, 'buNo', '')
|
|
}
|
|
this.hsfApproverOptionList = []
|
|
this.hsfApproverDisplayList = []
|
|
this.hsfApproverSelectionCache = []
|
|
this.relatedPeopleOptionList = []
|
|
this.relatedPeopleDisplayList = []
|
|
this.relatedPeopleSelection = null
|
|
this.relatedPeopleFlag = false
|
|
this.hsfApproverSearchData = {
|
|
operatorId: '',
|
|
operatorName: ''
|
|
}
|
|
this.relatedPeopleSearchData = {
|
|
operatorId: '',
|
|
operatorName: ''
|
|
}
|
|
this.$set(this.modalData, 'hsfApproverCodeList', [])
|
|
this.$set(this.modalData, 'hsfApprover', '')
|
|
this.$set(this.modalData, 'hsfApproverName', '')
|
|
this.$set(this.modalData, 'relatedPeople', '')
|
|
this.$set(this.modalData, 'relatedPeopleName', '')
|
|
},
|
|
loadHsfApproverByCurrentProcess (forceSelectAll = false) {
|
|
if (!this.modalData || !this.modalData.site) {
|
|
this.hsfApproverOptionList = []
|
|
this.hsfApproverDisplayList = []
|
|
this.hsfApproverSelectionCache = []
|
|
if (forceSelectAll) {
|
|
this.clearHsfApproverFields(false)
|
|
}
|
|
return Promise.resolve()
|
|
}
|
|
const buNo = String(this.modalData.process || '').trim()
|
|
if (!buNo) {
|
|
if (forceSelectAll) {
|
|
this.$message.warning('请先选择工艺')
|
|
this.clearHsfApproverFields(false)
|
|
}
|
|
this.hsfApproverOptionList = []
|
|
this.hsfApproverDisplayList = []
|
|
this.hsfApproverSelectionCache = []
|
|
return Promise.resolve()
|
|
}
|
|
const params = {
|
|
site: this.modalData.site,
|
|
buNo: buNo,
|
|
roleNo: 'R015'
|
|
}
|
|
return api.searchBmUser(params).then(({data}) => {
|
|
if (data && data.code === 0 && Array.isArray(data.rows)) {
|
|
this.hsfApproverOptionList = this.normalizeHsfApproverOptionList(data.rows)
|
|
this.filterHsfApproverOptions()
|
|
this.hsfApproverSelectionCache = []
|
|
if (forceSelectAll) {
|
|
const defaultSelectedCodes = this.hsfApproverOptionList.map(item => item.operatorId).filter(item => item)
|
|
this.$set(this.modalData, 'hsfApproverCodeList', defaultSelectedCodes)
|
|
}
|
|
this.syncHsfApproverFields()
|
|
} else {
|
|
this.hsfApproverOptionList = []
|
|
this.hsfApproverDisplayList = []
|
|
this.hsfApproverSelectionCache = []
|
|
if (forceSelectAll) {
|
|
this.clearHsfApproverFields(false)
|
|
}
|
|
}
|
|
}).catch(() => {
|
|
this.hsfApproverOptionList = []
|
|
this.hsfApproverDisplayList = []
|
|
this.hsfApproverSelectionCache = []
|
|
if (forceSelectAll) {
|
|
this.clearHsfApproverFields(false)
|
|
}
|
|
})
|
|
},
|
|
isCurrentApprover () {
|
|
return this.superAdmin || (this.modalData.createBy2 && this.modalData.createBy2.split(';').includes(this.createBy2))
|
|
},
|
|
canSaveAction () {
|
|
return !this.showModalFlag && (this.modalData.status === '草稿' || (this.modalData.status === '审批中' && this.isCurrentApprover()))
|
|
},
|
|
canAgreeAction () {
|
|
return this.authSubmit && this.isCurrentApprover() && this.modalData.status === '审批中' && this.modalData.tpProcessControl !== 'Y' && this.modalData.csProcessControl !== 'Y'
|
|
},
|
|
canRejectAction () {
|
|
return this.authReject && this.isCurrentApprover() && this.modalData.status === '审批中' && this.modalData.isReject === 'Y'
|
|
},
|
|
hasPersistedRohsRecord () {
|
|
return !!(this.modalData && this.modalData.site && this.modalData.referenceNo && !String(this.modalData.referenceNo).startsWith('TEMP-'))
|
|
},
|
|
openRohsRemarkDialog () {
|
|
this.$set(this.rohsRemarkForm, 'remark', this.modalData.remark || '')
|
|
this.rohsRemarkFlag = true
|
|
},
|
|
refreshRohsRemark () {
|
|
if (!this.hasPersistedRohsRecord()) {
|
|
this.$set(this.rohsRemarkForm, 'remark', this.modalData.remark || '')
|
|
return
|
|
}
|
|
api.getRohsDetail(this.modalData.site, this.modalData.referenceNo).then(({data}) => {
|
|
if (data && data.code === 0 && data.data) {
|
|
this.$set(this.rohsRemarkForm, 'remark', data.data.remark || '')
|
|
} else {
|
|
this.$message.error((data && data.msg) || '刷新失败')
|
|
}
|
|
}).catch(() => {
|
|
this.$message.error('刷新失败')
|
|
})
|
|
},
|
|
saveRohsRemark () {
|
|
const remark = this.rohsRemarkForm.remark || ''
|
|
if (!this.hasPersistedRohsRecord()) {
|
|
this.$set(this.modalData, 'remark', remark)
|
|
this.rohsRemarkFlag = false
|
|
this.$message.success('暂存成功,保存单据后写入数据库')
|
|
return
|
|
}
|
|
const params = {
|
|
site: this.modalData.site,
|
|
referenceNo: this.modalData.referenceNo,
|
|
remark: remark
|
|
}
|
|
api.updateRohsRemark(params).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.$set(this.modalData, 'remark', remark)
|
|
if (this.currentRow && this.currentRow.site === this.modalData.site && this.currentRow.referenceNo === this.modalData.referenceNo) {
|
|
this.$set(this.currentRow, 'remark', remark)
|
|
}
|
|
const target = (this.dataList || []).find(item => item.site === this.modalData.site && item.referenceNo === this.modalData.referenceNo)
|
|
if (target) {
|
|
this.$set(target, 'remark', remark)
|
|
}
|
|
this.rohsRemarkFlag = false
|
|
this.$message.success('操作成功')
|
|
} else {
|
|
this.$message.error((data && data.msg) || '保存失败')
|
|
}
|
|
}).catch(() => {
|
|
this.$message.error('保存失败')
|
|
})
|
|
},
|
|
loadModalButtonCondition () {
|
|
if (!this.modalData.site || !this.modalData.referenceNo || this.modalData.status !== '审批中') {
|
|
this.$set(this.modalData, 'createBy2', '')
|
|
this.$set(this.modalData, 'isReject', 'Y')
|
|
this.$set(this.modalData, 'tpProcessControl', 'N')
|
|
this.$set(this.modalData, 'csProcessControl', 'N')
|
|
return
|
|
}
|
|
let params = {
|
|
site: this.modalData.site,
|
|
referenceNo: this.modalData.referenceNo
|
|
}
|
|
api.getRohsButtonCondition(params).then(({data}) => {
|
|
if (data && data.code === 0 && data.data) {
|
|
this.$set(this.modalData, 'createBy2', data.data.createBy2 || '')
|
|
this.$set(this.modalData, 'isReject', data.data.isReject || 'Y')
|
|
this.$set(this.modalData, 'tpProcessControl', data.data.tpProcessControl || 'N')
|
|
this.$set(this.modalData, 'csProcessControl', data.data.csProcessControl || 'N')
|
|
} else {
|
|
this.$set(this.modalData, 'createBy2', '')
|
|
this.$set(this.modalData, 'isReject', 'Y')
|
|
this.$set(this.modalData, 'tpProcessControl', 'N')
|
|
this.$set(this.modalData, 'csProcessControl', 'N')
|
|
}
|
|
}).catch(() => {
|
|
this.$set(this.modalData, 'createBy2', '')
|
|
this.$set(this.modalData, 'isReject', 'Y')
|
|
this.$set(this.modalData, 'tpProcessControl', 'N')
|
|
this.$set(this.modalData, 'csProcessControl', 'N')
|
|
})
|
|
},
|
|
// 列表行选中变色
|
|
rowStyle ({row}) {
|
|
if (this.currentRow && this.currentRow.referenceNo === row.referenceNo) {
|
|
return { 'background-color': '#E8F7F6', cursor: 'pointer' }
|
|
}
|
|
},
|
|
// 获取按钮的权限数据
|
|
getButtonAuthData () {
|
|
this.authSearch = this.isAuth(this.menuId+":search")
|
|
this.authUpdate = this.isAuth(this.menuId+":update")
|
|
this.authIssue = this.isAuth(this.menuId+":issue")
|
|
this.authSubmit = this.isAuth(this.menuId+":submit")
|
|
this.authReject = this.isAuth(this.menuId+":reject")
|
|
this.authFileSave = this.isAuth(this.menuId+":fileSave")
|
|
this.authFileDownLoad = this.isAuth(this.menuId+":fileDownLoad")
|
|
this.authFileRemove = this.isAuth(this.menuId+":fileRemove")
|
|
this.authFilePreview = this.isAuth(this.menuId+":filePreview")
|
|
this.authDataEntry = this.isAuth(this.menuId+":dataEntry")
|
|
this.authDelete = this.isAuth(this.menuId+":delete")
|
|
},
|
|
// 校验是否为超级管理员
|
|
checkSuperAdmin () {
|
|
checkSuperAdmin().then(({data}) => {
|
|
this.superAdmin = data.superAdmin
|
|
})
|
|
},
|
|
changeClickRow (row, column, event) {
|
|
this.loadCurrentRowFromServer(row, row || {})
|
|
},
|
|
currentChange (val) {
|
|
if (val) {
|
|
this.loadCurrentRowFromServer(val, val || {})
|
|
} else {
|
|
this.currentRow = {}
|
|
this.approvalList = []
|
|
}
|
|
},
|
|
dataListSelectionChange (rows) {
|
|
this.dataListSelections = rows || []
|
|
},
|
|
applyCurrentRowData (detailData, fallbackData = {}) {
|
|
this.currentRow = detailData || {}
|
|
if (!Array.isArray(this.currentRow.materialList)) {
|
|
this.$set(this.currentRow, 'materialList', [])
|
|
}
|
|
this.fillDisplayFields(this.currentRow, fallbackData || {})
|
|
this.syncDataListRow(this.currentRow)
|
|
this.refreshCurrentTabTable()
|
|
},
|
|
syncDataListRow (rowData) {
|
|
if (!rowData || !rowData.site || !rowData.referenceNo || !Array.isArray(this.dataList)) {
|
|
return
|
|
}
|
|
const targetIndex = this.dataList.findIndex(item => item.site === rowData.site && item.referenceNo === rowData.referenceNo)
|
|
if (targetIndex < 0) {
|
|
return
|
|
}
|
|
const mergedRow = {
|
|
...this.dataList[targetIndex],
|
|
...rowData
|
|
}
|
|
this.fillDisplayFields(mergedRow, this.dataList[targetIndex] || {})
|
|
this.$set(this.dataList, targetIndex, mergedRow)
|
|
},
|
|
loadCurrentRowFromServer (row, fallbackData = {}) {
|
|
if (!row || !row.site || !row.referenceNo) {
|
|
this.applyCurrentRowData(row || {}, fallbackData || {})
|
|
return Promise.resolve()
|
|
}
|
|
return api.getRohsDetail(row.site, row.referenceNo).then(({data}) => {
|
|
if (data && data.code === 0 && data.data) {
|
|
this.applyCurrentRowData(data.data, fallbackData || row)
|
|
} else {
|
|
this.applyCurrentRowData(row || {}, fallbackData || {})
|
|
}
|
|
}).catch(() => {
|
|
this.applyCurrentRowData(row || {}, fallbackData || {})
|
|
})
|
|
},
|
|
refreshCurrentRowFromServer (site, referenceNo) {
|
|
const querySite = site || (this.currentRow && this.currentRow.site)
|
|
const queryReferenceNo = referenceNo || (this.currentRow && this.currentRow.referenceNo)
|
|
if (!querySite || !queryReferenceNo || String(queryReferenceNo).startsWith('TEMP-')) {
|
|
return Promise.resolve()
|
|
}
|
|
return this.loadCurrentRowFromServer({
|
|
site: querySite,
|
|
referenceNo: queryReferenceNo
|
|
}, this.currentRow || {})
|
|
},
|
|
refreshOssRef (refName) {
|
|
const ref = this.$refs[refName]
|
|
if (!ref) {
|
|
return
|
|
}
|
|
const refList = Array.isArray(ref) ? ref : [ref]
|
|
refList.forEach(item => {
|
|
if (item && typeof item.handleQuery === 'function') {
|
|
item.handleQuery()
|
|
}
|
|
})
|
|
},
|
|
refreshAttachmentPanels () {
|
|
this.refreshOssRef('modalAttachmentOss')
|
|
this.refreshOssRef('modalTdsOss')
|
|
this.refreshOssRef('bottomAttachmentOss')
|
|
this.refreshOssRef('bottomTdsOss')
|
|
},
|
|
handleModalClose () {
|
|
const site = this.modalData.site
|
|
const referenceNo = this.modalData.referenceNo
|
|
this.modalFlag = false
|
|
this.$nextTick(() => {
|
|
this.refreshAttachmentPanels()
|
|
})
|
|
this.refreshCurrentRowFromServer(site, referenceNo)
|
|
},
|
|
fillDisplayFields (target, fallbackData = {}) {
|
|
if (!target) {
|
|
return
|
|
}
|
|
const fields = ['nodeId', 'nodeName', 'currentApprover', 'applicantName', 'pmName', 'npdEngineerName', 'technicalPlanName', 'buyerName', 'endCustomerName', 'projectName', 'commGroup1Desc', 'commGroup2Desc', 'commGroup3Desc', 'hsfApproverName', 'relatedPeopleName']
|
|
fields.forEach(field => {
|
|
const value = target[field] || fallbackData[field] || ''
|
|
this.$set(target, field, value)
|
|
})
|
|
this.$set(target, 'endCustomerFlag', !!target.endCustomerFlag)
|
|
this.$set(target, 'projectIdFlag', !!target.projectIdFlag)
|
|
const validUntilValue = target.validUntilValue !== undefined && target.validUntilValue !== null && target.validUntilValue !== ''
|
|
? target.validUntilValue
|
|
: fallbackData.validUntilValue
|
|
this.$set(target, 'validUntilValue', this.normalizeValidUntilValue(validUntilValue))
|
|
const applicationDate = target.applicationDate || fallbackData.applicationDate || ''
|
|
const plannedMassProductionDate = target.plannedMassProductionDate || fallbackData.plannedMassProductionDate || ''
|
|
const expiredDate = target.expiredDate || fallbackData.expiredDate || ''
|
|
const normalizedExpiredDate = this.normalizeDateOnly(expiredDate)
|
|
this.$set(target, 'applicationDate', this.normalizeDateOnly(applicationDate))
|
|
this.$set(target, 'plannedMassProductionDate', this.normalizeDateOnly(plannedMassProductionDate))
|
|
this.$set(target, 'expiredDate', normalizedExpiredDate)
|
|
this.$set(target, 'expiryDate', this.calculateExpiryDateByRule(normalizedExpiredDate, target.validUntilValue, target.validUntil))
|
|
},
|
|
refreshCurrentTabTable () {
|
|
if (this.activeTable === 'approvalInformation') {
|
|
this.getApprovalList()
|
|
return
|
|
}
|
|
if (this.activeTable === 'attachment') {
|
|
this.refreshOssRef('bottomAttachmentOss')
|
|
return
|
|
}
|
|
if (this.activeTable === 'npdInfo') {
|
|
this.refreshOssRef('bottomTdsOss')
|
|
}
|
|
},
|
|
getApprovalList () {
|
|
if (!this.currentRow || !this.currentRow.site || !this.currentRow.referenceNo) {
|
|
this.approvalList = []
|
|
return
|
|
}
|
|
let params = {
|
|
site: this.currentRow.site,
|
|
menuId: this.menuId,
|
|
documentNo: this.currentRow.referenceNo
|
|
}
|
|
api.getRohsApprovalList(params).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.approvalList = data.rows || []
|
|
} else {
|
|
this.approvalList = []
|
|
}
|
|
}).catch(() => {
|
|
this.approvalList = []
|
|
})
|
|
},
|
|
|
|
// 获取列表
|
|
getDataList () {
|
|
if (!this.authSearch) {
|
|
this.dataList = []
|
|
this.dataListSelections = []
|
|
this.totalPage = 0
|
|
this.currentRow = {}
|
|
this.approvalList = []
|
|
return
|
|
}
|
|
this.dataListLoading = true
|
|
let params = {
|
|
page: this.pageIndex,
|
|
limit: this.pageSize,
|
|
site: this.$store.state.user.site,
|
|
menuId: this.menuId,
|
|
referenceNo: this.searchData.referenceNo,
|
|
status: this.searchData.status,
|
|
currentApprover: this.searchData.currentApprover,
|
|
nodeId: this.searchData.nodeId
|
|
}
|
|
api.getRohsList(params).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
const list = data.page.list || []
|
|
this.dataList = list.map(item => {
|
|
return {
|
|
applicantName: '',
|
|
pmName: '',
|
|
npdEngineerName: '',
|
|
technicalPlanName: '',
|
|
buyerName: '',
|
|
endCustomerName: '',
|
|
projectName: '',
|
|
nodeId: '',
|
|
nodeName: '',
|
|
currentApprover: '',
|
|
commGroup1Desc: '',
|
|
commGroup2Desc: '',
|
|
commGroup3Desc: '',
|
|
hsfApproverName: '',
|
|
relatedPeopleName: '',
|
|
...item
|
|
}
|
|
})
|
|
this.dataListSelections = []
|
|
this.totalPage = data.page.totalCount
|
|
this.$nextTick(() => {
|
|
if (this.$refs.rohsTable) {
|
|
this.$refs.rohsTable.clearSelection()
|
|
}
|
|
if (this.$refs.rohsTable && this.dataList.length > 0) {
|
|
this.$refs.rohsTable.setCurrentRow(this.dataList[0])
|
|
} else if (this.$refs.rohsTable) {
|
|
this.$refs.rohsTable.setCurrentRow()
|
|
}
|
|
})
|
|
} else {
|
|
this.dataList = []
|
|
this.dataListSelections = []
|
|
this.totalPage = 0
|
|
this.currentRow = {}
|
|
this.approvalList = []
|
|
}
|
|
this.dataListLoading = false
|
|
}).catch(() => {
|
|
this.dataListSelections = []
|
|
this.currentRow = {}
|
|
this.approvalList = []
|
|
this.dataListLoading = false
|
|
})
|
|
},
|
|
// 分页
|
|
sizeChangeHandle (val) {
|
|
this.pageSize = val
|
|
this.pageIndex = 1
|
|
this.getDataList()
|
|
},
|
|
currentChangeHandle (val) {
|
|
this.pageIndex = val
|
|
this.getDataList()
|
|
},
|
|
// 搜索条件点击
|
|
searchHandle () {
|
|
if (!this.authSearch) {
|
|
return
|
|
}
|
|
this.pageIndex = 1
|
|
this.getDataList()
|
|
},
|
|
buildExportName () {
|
|
const now = new Date()
|
|
const year = String(now.getFullYear())
|
|
const month = String(now.getMonth() + 1).padStart(2, '0')
|
|
const day = String(now.getDate()).padStart(2, '0')
|
|
const hour = String(now.getHours()).padStart(2, '0')
|
|
const minute = String(now.getMinutes()).padStart(2, '0')
|
|
const second = String(now.getSeconds()).padStart(2, '0')
|
|
return 'RoHs记录' + year + month + day + hour + minute + second
|
|
},
|
|
async createExportData () {
|
|
const params = {
|
|
...this.searchData,
|
|
site: this.$store.state.user.site,
|
|
menuId: this.menuId,
|
|
page: 1,
|
|
limit: -1
|
|
}
|
|
this.resultList = []
|
|
await api.getRohsList(params).then(({data}) => {
|
|
if (data && data.code === 0 && data.page && Array.isArray(data.page.list)) {
|
|
this.resultList = (data.page.list || []).map(item => {
|
|
const row = {
|
|
...item
|
|
}
|
|
row.applicationDate = this.normalizeDateOnly(row.applicationDate)
|
|
row.plannedMassProductionDate = this.normalizeDateOnly(row.plannedMassProductionDate)
|
|
row.expectReportTime = this.normalizeDateOnly(row.expectReportTime)
|
|
row.expiredDate = this.normalizeDateOnly(row.expiredDate)
|
|
row.expiryDate = this.normalizeDateOnly(row.expiryDate)
|
|
row.validUntilDisplay = this.getValidUntilDisplay(row.validUntilValue, row.validUntil)
|
|
row.hsfApproverName = row.hsfApproverName || row.hsfApprover || ''
|
|
row.relatedPeopleName = row.relatedPeopleName || row.relatedPeople || ''
|
|
return row
|
|
})
|
|
} else {
|
|
this.$message.warning((data && data.msg) || '导出数据获取失败')
|
|
}
|
|
}).catch(() => {
|
|
this.$message.error('导出数据获取失败')
|
|
})
|
|
return this.resultList
|
|
},
|
|
startDownload () {
|
|
this.exportName = this.buildExportName()
|
|
this.exportFieldMap = this.buildExportFields()
|
|
if (!this.exportFieldMap || Object.keys(this.exportFieldMap).length === 0) {
|
|
this.$message.warning('未获取到可导出的列,请稍后重试')
|
|
}
|
|
this.exportLoading = true
|
|
},
|
|
finishDownload () {
|
|
this.exportLoading = false
|
|
},
|
|
buildExportFields () {
|
|
const tableRef = this.$refs.rohsTable
|
|
if (!tableRef || !Array.isArray(tableRef.columns)) {
|
|
return {}
|
|
}
|
|
const fields = {}
|
|
tableRef.columns.forEach(column => {
|
|
const label = column && column.label ? String(column.label).trim() : ''
|
|
const property = column && column.property ? String(column.property).trim() : ''
|
|
if (!label || !property || label === '操作') {
|
|
return
|
|
}
|
|
fields[label] = property
|
|
})
|
|
return fields
|
|
},
|
|
// 单选可取消
|
|
radioClick (field, value) {
|
|
if (this.modalData[field] === value) {
|
|
this.modalData[field] = ''
|
|
} else {
|
|
this.modalData[field] = value
|
|
}
|
|
},
|
|
// 新增 / 修改
|
|
addOrUpdateHandle (row) {
|
|
if (!row && !this.authUpdate) {
|
|
this.$message.warning('没有新增权限')
|
|
return
|
|
}
|
|
if (row && !this.authUpdate && !this.authDataEntry) {
|
|
this.$message.warning('没有编辑权限')
|
|
return
|
|
}
|
|
this.modalFlag = true
|
|
this.activeName = 'basicInfo'
|
|
this.submitModalFlag = false
|
|
this.rohsRemarkFlag = false
|
|
this.rejectOpinion = ''
|
|
this.rohsRemarkForm = {
|
|
remark: ''
|
|
}
|
|
this.projectMaterialDialogFlag = false
|
|
this.projectMaterialSelections = []
|
|
this.materialSelections = []
|
|
this.hsfApproverOptionList = []
|
|
this.hsfApproverDisplayList = []
|
|
this.hsfApproverSelectionCache = []
|
|
this.hsfApproverSearchData = {
|
|
operatorId: '',
|
|
operatorName: ''
|
|
}
|
|
this.hsfApproverFlag = false
|
|
this.relatedPeopleOptionList = []
|
|
this.relatedPeopleDisplayList = []
|
|
this.relatedPeopleSelection = null
|
|
this.relatedPeopleSearchData = {
|
|
operatorId: '',
|
|
operatorName: ''
|
|
}
|
|
this.relatedPeopleFlag = false
|
|
this.plmRohsAuthorityArr = []
|
|
this.nodeAuthorityLoaded = !row
|
|
this.isEditMode = !!row
|
|
this.projectMaterialPageIndex = 1
|
|
this.projectMaterialTotal = 0
|
|
this.projectMaterialList = []
|
|
this.projectMaterialSearchData = {
|
|
finalPartNo: '',
|
|
partDesc: '',
|
|
partStatus: ''
|
|
}
|
|
this.showModalFlag = !!(row && (row.status === '已完成' || !this.authUpdate))
|
|
|
|
if (row) {
|
|
this.modalTitle = 'RoHS 编辑'
|
|
api.getRohsDetail(row.site, row.referenceNo).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.modalData = data.data || {}
|
|
this.$set(this.modalData, 'qualificationDocumentsNeededList', this.modalData.qualificationDocumentsNeeded ? this.modalData.qualificationDocumentsNeeded.split(';').filter(item => item) : [])
|
|
this.$set(this.modalData, 'testReportIncludingItemsList', this.modalData.testReportIncludingItems ? this.modalData.testReportIncludingItems.split(';').filter(item => item) : [])
|
|
this.$set(this.modalData, 'materialClassifyList', this.modalData.materialClassify ? this.modalData.materialClassify.split(';').filter(item => item) : [])
|
|
this.$set(this.modalData, 'materialList', Array.isArray(this.modalData.materialList) ? this.modalData.materialList : [])
|
|
this.$set(this.modalData, 'hsfApproverCodeList', this.modalData.hsfApprover ? this.modalData.hsfApprover.split(';').filter(item => item) : [])
|
|
this.$set(this.modalData, 'buNo', this.modalData.process || '')
|
|
this.$set(this.modalData, 'isAhGrade', this.normalizeCheckboxFlag(this.modalData.isAhGrade))
|
|
this.$set(this.modalData, 'validUntilValue', this.normalizeValidUntilValue(this.modalData.validUntilValue))
|
|
this.syncHsfApproverFields()
|
|
this.fillDisplayFields(this.modalData, row || {})
|
|
this.applyHsfStandardDefaultByCustomer(this.modalData)
|
|
// 编辑时不允许修改最终客户和项目编码
|
|
this.$set(this.modalData, 'endCustomerFlag', true)
|
|
this.$set(this.modalData, 'projectIdFlag', true)
|
|
this.$set(this.modalData, 'createBy2', '')
|
|
this.$set(this.modalData, 'isReject', 'Y')
|
|
this.$set(this.modalData, 'tpProcessControl', 'N')
|
|
this.$set(this.modalData, 'csProcessControl', 'N')
|
|
this.loadModalButtonCondition()
|
|
this.loadHsfApproverByCurrentProcess(false)
|
|
this.loadNodeAuthority(this.modalData.site || row.site, this.modalData.stepId !== null && this.modalData.stepId !== undefined ? this.modalData.stepId : (row.stepId !== null && row.stepId !== undefined ? row.stepId : 10))
|
|
}
|
|
}).catch(() => {
|
|
this.loadNodeAuthority(row.site, row.stepId !== null && row.stepId !== undefined ? row.stepId : 10)
|
|
})
|
|
} else {
|
|
this.modalTitle = 'RoHS 新增'
|
|
this.showModalFlag = false
|
|
// 生成一个临时ID用于附件上传绑定
|
|
const tempReferenceNo = 'TEMP-' + new Date().getTime() + '-' + Math.floor(Math.random() * 1000)
|
|
this.modalData = {
|
|
site: this.$store.state.user.site,
|
|
referenceNo: tempReferenceNo,
|
|
applicant: this.$store.state.user.name || '',
|
|
applicantName: this.$store.state.user.userDisplay || this.$store.state.user.user_display || '',
|
|
pm: '',
|
|
pmName: '',
|
|
applicationDate: this.getCurrentDateString(),
|
|
process: '',
|
|
plannedMassProductionDate: '',
|
|
color: '',
|
|
vendorCode: '',
|
|
vendorMaterialCode: '',
|
|
materialClassify: '',
|
|
materialClassifyList: [],
|
|
otherMaterialClassify: '',
|
|
materialUseFor: '',
|
|
endCustomer: '',
|
|
endCustomerName: '',
|
|
endCustomerFlag: false,
|
|
projectId: '',
|
|
projectName: '',
|
|
projectIdFlag: true,
|
|
commGroup1: '',
|
|
commGroup1Desc: '',
|
|
commGroup2: '',
|
|
commGroup2Desc: '',
|
|
commGroup3: '',
|
|
commGroup3Desc: '',
|
|
needCreateNumber: '',
|
|
npdEngineer: '',
|
|
npdEngineerName: '',
|
|
materialValidityTime: '',
|
|
materialValidityComments: '',
|
|
needDeviation: '',
|
|
technicalPlan: '',
|
|
wmRequiredSpec: '',
|
|
isFiberMaterial: '',
|
|
materialThickness: '',
|
|
buyer: '',
|
|
buyerName: '',
|
|
expectReportTime: '',
|
|
qualificationDocumentsNeeded: '',
|
|
qualificationDocumentsNeededList: [],
|
|
testReportIncludingItems: '',
|
|
testReportIncludingItemsList: [],
|
|
remark: '',
|
|
status: '草稿',
|
|
sgsReportNumber: '',
|
|
rohsStatus: 'Active',
|
|
expiredDate: '',
|
|
expiryDate: '',
|
|
fiberInformation: '',
|
|
hsfStandard: '',
|
|
hsfApprover: '',
|
|
hsfApproverName: '',
|
|
hsfApproverCodeList: [],
|
|
relatedPeople: '',
|
|
relatedPeopleName: '',
|
|
buNo: '',
|
|
validUntilValue: 0,
|
|
validUntil: '',
|
|
isMeetRohsRequirement: '',
|
|
isAhGrade: 'N',
|
|
hsfSupplierClassification: '',
|
|
materialDesc: '',
|
|
npdRemark: '',
|
|
isSameMaterialDiffSize: '',
|
|
ifsPartNo: '',
|
|
materialList: [],
|
|
stepId: 10,
|
|
rejectFlag: 'N',
|
|
rejectStepId: null,
|
|
createBy2: '',
|
|
isReject: 'Y',
|
|
tpProcessControl: 'N',
|
|
csProcessControl: 'N'
|
|
}
|
|
this.nodeAuthorityLoaded = true
|
|
}
|
|
},
|
|
// 表单提交
|
|
dataFormSubmit () {
|
|
if (!this.canSaveAction()) {
|
|
this.$message.warning('当前状态不允许保存')
|
|
return
|
|
}
|
|
this.$set(this.modalData, 'isAhGrade', this.normalizeCheckboxFlag(this.modalData.isAhGrade))
|
|
this.normalizeHsfStandardByCustomer(this.modalData)
|
|
this.syncHsfApproverFields()
|
|
if (!this.validateValidUntilPair()) {
|
|
return
|
|
}
|
|
this.syncExpiryDateByRule()
|
|
this.modalData.qualificationDocumentsNeeded = this.modalData.qualificationDocumentsNeededList.join(';')
|
|
this.modalData.testReportIncludingItems = this.modalData.testReportIncludingItemsList.join(';')
|
|
this.modalData.materialClassify = this.modalData.materialClassifyList.join(';')
|
|
this.modalData.materialList = (this.modalData.materialList || []).map((item, index) => {
|
|
return {
|
|
...item,
|
|
lineNo: index + 1,
|
|
projectId: this.modalData.projectId
|
|
}
|
|
})
|
|
|
|
const submitMethod = this.modalTitle === 'RoHS 新增' ? api.saveRohs : api.updateRohs
|
|
submitMethod(this.modalData).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.$message.success('操作成功')
|
|
this.modalFlag = false
|
|
this.getDataList()
|
|
} else {
|
|
this.$message.error(data.msg || '操作失败')
|
|
}
|
|
})
|
|
},
|
|
// 同意
|
|
agreeSubmit () {
|
|
if (!this.canAgreeAction()) {
|
|
this.$message.warning('当前状态不允许同意')
|
|
return
|
|
}
|
|
this.$confirm('确认同意该申请单?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
this.submitRohs('Y')
|
|
})
|
|
},
|
|
openRejectModal () {
|
|
if (!this.canRejectAction()) {
|
|
this.$message.warning('当前状态不允许驳回')
|
|
return
|
|
}
|
|
this.rejectOpinion = ''
|
|
this.submitModalFlag = true
|
|
},
|
|
// 驳回
|
|
rejectSubmit () {
|
|
if (!this.rejectOpinion || !this.rejectOpinion.trim()) {
|
|
this.$message.warning('请填写驳回意见')
|
|
return
|
|
}
|
|
this.submitRohs('N')
|
|
},
|
|
submitRohs (nodeConclusion) {
|
|
if (nodeConclusion === 'Y' && !this.canAgreeAction()) {
|
|
this.$message.warning('当前状态不允许同意')
|
|
return
|
|
}
|
|
if (nodeConclusion === 'N' && !this.canRejectAction()) {
|
|
this.$message.warning('当前状态不允许驳回')
|
|
return
|
|
}
|
|
if (!this.modalData.site || !this.modalData.referenceNo) {
|
|
this.$message.warning('单据主键信息缺失,无法提交审批')
|
|
return
|
|
}
|
|
this.$set(this.modalData, 'isAhGrade', this.normalizeCheckboxFlag(this.modalData.isAhGrade))
|
|
this.normalizeHsfStandardByCustomer(this.modalData)
|
|
this.syncHsfApproverFields()
|
|
if (!this.validateValidUntilPair()) {
|
|
return
|
|
}
|
|
this.syncExpiryDateByRule()
|
|
if (!this.nodeAuthorityLoaded) {
|
|
this.$message.warning('节点权限加载中,请稍后重试')
|
|
return
|
|
}
|
|
if (!this.validateSubmitRequiredFields()) {
|
|
return
|
|
}
|
|
const submitMaterialList = this.normalizeMaterialListForSave(this.modalData.materialList || [])
|
|
this.submitLoading = true
|
|
let params = {
|
|
...this.modalData,
|
|
site: this.modalData.site,
|
|
referenceNo: this.modalData.referenceNo,
|
|
materialClassify: (this.modalData.materialClassifyList || []).join(';'),
|
|
qualificationDocumentsNeeded: (this.modalData.qualificationDocumentsNeededList || []).join(';'),
|
|
testReportIncludingItems: (this.modalData.testReportIncludingItemsList || []).join(';'),
|
|
materialList: submitMaterialList,
|
|
nodeConclusion: nodeConclusion,
|
|
rejectOpinion: nodeConclusion === 'N' ? this.rejectOpinion : '',
|
|
menuId: this.menuId,
|
|
documentNo: this.modalData.referenceNo
|
|
}
|
|
api.submitRohs(params).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.$message.success(nodeConclusion === 'Y' ? '同意成功' : '驳回成功')
|
|
this.submitModalFlag = false
|
|
this.modalFlag = false
|
|
this.getDataList()
|
|
} else {
|
|
this.$message.error(data.msg || '提交失败')
|
|
}
|
|
this.submitLoading = false
|
|
}).catch(() => {
|
|
this.submitLoading = false
|
|
})
|
|
},
|
|
// 下达
|
|
issueModal (row) {
|
|
if (!this.authIssue) {
|
|
this.$message.warning('没有下达权限')
|
|
return
|
|
}
|
|
this.$confirm('确认下达该申请单?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
let params = {
|
|
site: row.site,
|
|
referenceNo: row.referenceNo,
|
|
menuId: this.menuId
|
|
}
|
|
api.issueRohs(params).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.$message.success('下达成功')
|
|
if (this.modalFlag && this.modalData.referenceNo === row.referenceNo) {
|
|
this.modalData.status = '审批中'
|
|
}
|
|
this.getDataList()
|
|
} else {
|
|
this.$message.error(data.msg || '下达失败')
|
|
}
|
|
})
|
|
})
|
|
},
|
|
deleteHandle () {
|
|
if (!this.authDelete) {
|
|
this.$message.warning('没有删除权限')
|
|
return
|
|
}
|
|
const selectedRows = (this.dataListSelections || []).filter(item => item && item.site && item.referenceNo)
|
|
if (!selectedRows.length) {
|
|
this.$message.warning('请先勾选要删除的单据')
|
|
return
|
|
}
|
|
const nonDraftRows = selectedRows.filter(item => item.status !== '草稿')
|
|
if (nonDraftRows.length) {
|
|
const previewText = nonDraftRows.slice(0, 3).map(item => item.referenceNo).join('、')
|
|
const suffix = nonDraftRows.length > 3 ? (' 等' + nonDraftRows.length + '条') : ''
|
|
this.$message.warning('仅草稿状态的单据允许删除,当前勾选包含非草稿单据:' + previewText + suffix)
|
|
return
|
|
}
|
|
this.$confirm('确认删除选中的' + selectedRows.length + '条RoHS单据?删除后会同步删除材料和附件数据。', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
const deleteTasks = selectedRows.map(item => {
|
|
return api.deleteRohs({
|
|
site: item.site,
|
|
referenceNo: item.referenceNo
|
|
}).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
return {
|
|
success: true,
|
|
referenceNo: item.referenceNo
|
|
}
|
|
}
|
|
return {
|
|
success: false,
|
|
referenceNo: item.referenceNo,
|
|
msg: (data && data.msg) || '删除失败'
|
|
}
|
|
}).catch(() => {
|
|
return {
|
|
success: false,
|
|
referenceNo: item.referenceNo,
|
|
msg: '删除失败'
|
|
}
|
|
})
|
|
})
|
|
Promise.all(deleteTasks).then(results => {
|
|
const successRows = results.filter(item => item.success)
|
|
const failRows = results.filter(item => !item.success)
|
|
if (this.modalFlag && successRows.some(item => item.referenceNo === this.modalData.referenceNo)) {
|
|
this.modalFlag = false
|
|
}
|
|
if (!failRows.length) {
|
|
this.$message.success('删除成功,共' + successRows.length + '条')
|
|
} else if (!successRows.length) {
|
|
this.$message.error(failRows[0].msg || '删除失败')
|
|
} else {
|
|
this.$message.warning('已删除' + successRows.length + '条,失败' + failRows.length + '条')
|
|
}
|
|
this.getDataList()
|
|
})
|
|
}).catch(() => {})
|
|
},
|
|
openProjectMaterialDialog () {
|
|
if (!this.canEditRohsMaterial()) {
|
|
this.$message.warning('当前状态不允许编辑材料')
|
|
return
|
|
}
|
|
this.projectMaterialDialogFlag = true
|
|
this.projectMaterialPageIndex = 1
|
|
this.searchProjectMaterialList()
|
|
},
|
|
searchProjectMaterialList () {
|
|
this.projectMaterialLoading = true
|
|
const params = {
|
|
page: this.projectMaterialPageIndex,
|
|
limit: this.projectMaterialPageSize,
|
|
site: this.$store.state.user.site,
|
|
partDesc: this.projectMaterialSearchData.partDesc,
|
|
finalPartNo: this.projectMaterialSearchData.finalPartNo,
|
|
partStatus: this.projectMaterialSearchData.partStatus
|
|
}
|
|
api.getRohsProjectMaterialList(params).then(({data}) => {
|
|
if (data && data.code === 0 && data.page) {
|
|
this.projectMaterialList = data.page.list || []
|
|
this.projectMaterialTotal = data.page.totalCount || 0
|
|
this.$nextTick(() => {
|
|
if (this.$refs.projectMaterialTable) {
|
|
this.$refs.projectMaterialTable.clearSelection()
|
|
}
|
|
})
|
|
} else {
|
|
this.projectMaterialList = []
|
|
this.projectMaterialTotal = 0
|
|
this.$message.error(data.msg || '物料查询失败')
|
|
}
|
|
this.projectMaterialLoading = false
|
|
}).catch(() => {
|
|
this.projectMaterialList = []
|
|
this.projectMaterialTotal = 0
|
|
this.projectMaterialLoading = false
|
|
})
|
|
},
|
|
projectMaterialSelectionChange (rows) {
|
|
this.projectMaterialSelections = rows || []
|
|
},
|
|
projectMaterialSizeChangeHandle (val) {
|
|
this.projectMaterialPageSize = val
|
|
this.projectMaterialPageIndex = 1
|
|
this.searchProjectMaterialList()
|
|
},
|
|
projectMaterialCurrentChangeHandle (val) {
|
|
this.projectMaterialPageIndex = val
|
|
this.searchProjectMaterialList()
|
|
},
|
|
confirmProjectMaterialSelection () {
|
|
if (!this.canEditRohsMaterial()) {
|
|
this.$message.warning('当前状态不允许编辑材料')
|
|
return
|
|
}
|
|
if (!this.projectMaterialSelections || this.projectMaterialSelections.length === 0) {
|
|
this.$message.warning('请至少选择一条物料')
|
|
return
|
|
}
|
|
const appendResult = this.appendMaterialRows(this.projectMaterialSelections)
|
|
if (!appendResult.appendedCount) {
|
|
this.$message.warning('所选物料已存在,未新增数据')
|
|
return
|
|
}
|
|
if (!this.shouldPersistMaterialsImmediately()) {
|
|
this.$set(this.modalData, 'materialList', appendResult.materialList)
|
|
this.projectMaterialDialogFlag = false
|
|
this.$message.success('已加入材料列表,保存单据后写入数据库')
|
|
return
|
|
}
|
|
this.$confirm('确认新增选中材料?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
this.persistMaterialList(appendResult.materialList, '新增材料成功', () => {
|
|
this.projectMaterialDialogFlag = false
|
|
this.projectMaterialSelections = []
|
|
if (this.$refs.projectMaterialTable) {
|
|
this.$refs.projectMaterialTable.clearSelection()
|
|
}
|
|
})
|
|
}).catch(() => {})
|
|
},
|
|
appendMaterialRows (rows) {
|
|
const materialList = Array.isArray(this.modalData.materialList) ? [...this.modalData.materialList] : []
|
|
const exists = new Set(materialList.map(item => item.testPartNo))
|
|
let appendedCount = 0
|
|
rows.forEach(row => {
|
|
const testPartNo = row.testPartNo || row.test_part_no
|
|
if (!testPartNo || exists.has(testPartNo)) {
|
|
return
|
|
}
|
|
exists.add(testPartNo)
|
|
appendedCount++
|
|
materialList.push({
|
|
site: this.modalData.site,
|
|
referenceNo: this.modalData.referenceNo,
|
|
projectId: this.modalData.projectId,
|
|
testPartNo: testPartNo,
|
|
finalPartNo: row.finalPartNo || row.final_part_no || '',
|
|
partDesc: row.partDesc || row.part_desc || '',
|
|
partStatus: row.partStatus || row.part_status || ''
|
|
})
|
|
})
|
|
return {
|
|
materialList,
|
|
appendedCount
|
|
}
|
|
},
|
|
materialSelectionChange (rows) {
|
|
this.materialSelections = rows || []
|
|
},
|
|
shouldPersistMaterialsImmediately () {
|
|
return this.modalTitle === 'RoHS 编辑' && this.modalData && this.modalData.referenceNo && !String(this.modalData.referenceNo).startsWith('TEMP-')
|
|
},
|
|
normalizeMaterialListForSave (materialList) {
|
|
return (materialList || []).map((item, index) => {
|
|
return {
|
|
site: item.site || this.modalData.site || '',
|
|
referenceNo: item.referenceNo || this.modalData.referenceNo || '',
|
|
projectId: item.projectId || this.modalData.projectId || '',
|
|
testPartNo: item.testPartNo || item.test_part_no || '',
|
|
finalPartNo: item.finalPartNo || item.final_part_no || '',
|
|
partDesc: item.partDesc || item.part_desc || '',
|
|
partStatus: item.partStatus || item.part_status || '',
|
|
lineNo: index + 1
|
|
}
|
|
}).filter(item => item.testPartNo)
|
|
},
|
|
persistMaterialList (materialList, successMsg, successCallback) {
|
|
const normalizedList = this.normalizeMaterialListForSave(materialList)
|
|
const payload = {
|
|
site: this.modalData.site,
|
|
referenceNo: this.modalData.referenceNo,
|
|
projectId: this.modalData.projectId,
|
|
materialList: normalizedList
|
|
}
|
|
api.updateRohsMaterials(payload).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.$set(this.modalData, 'materialList', normalizedList)
|
|
this.materialSelections = []
|
|
if (this.currentRow && this.currentRow.referenceNo === this.modalData.referenceNo) {
|
|
this.$set(this.currentRow, 'materialList', normalizedList)
|
|
}
|
|
this.$message.success(successMsg || '保存成功')
|
|
if (typeof successCallback === 'function') {
|
|
successCallback()
|
|
}
|
|
} else {
|
|
this.$message.error((data && data.msg) || '保存失败')
|
|
}
|
|
}).catch(() => {
|
|
this.$message.error('保存失败')
|
|
})
|
|
},
|
|
removeSelectedMaterialRows () {
|
|
if (!this.canEditRohsMaterial()) {
|
|
this.$message.warning('当前状态不允许编辑材料')
|
|
return
|
|
}
|
|
if (!this.materialSelections || this.materialSelections.length === 0) {
|
|
this.$message.warning('请先选择要删除的材料')
|
|
return
|
|
}
|
|
const removeSet = new Set(this.materialSelections.map(item => item.testPartNo))
|
|
const materialList = (this.modalData.materialList || []).filter(item => !removeSet.has(item.testPartNo))
|
|
if (!this.shouldPersistMaterialsImmediately()) {
|
|
this.$set(this.modalData, 'materialList', materialList)
|
|
this.materialSelections = []
|
|
this.$message.success('已删除材料,保存单据后写入数据库')
|
|
return
|
|
}
|
|
this.$confirm('确认删除选中材料?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
this.persistMaterialList(materialList, '删除材料成功')
|
|
}).catch(() => {})
|
|
},
|
|
// ======== chooseList相关方法 ========
|
|
// 获取基础数据列表
|
|
getBaseList (val, type) {
|
|
this.tagNo = val
|
|
this.tagNo1 = type
|
|
this.$nextTick(() => {
|
|
let strVal = ''
|
|
let conSql = ''
|
|
if (val === 102) {
|
|
if (type === 1) {
|
|
strVal = this.modalData.endCustomer
|
|
}
|
|
}
|
|
if (val === 103 || val === 2001 || val === 2054) {
|
|
if (type === 1) {
|
|
strVal = this.modalData.applicant
|
|
} else if (type === 3) {
|
|
strVal = this.modalData.npdEngineer
|
|
} else if (type === 4) {
|
|
strVal = this.modalData.technicalPlan
|
|
} else if (type === 5) {
|
|
strVal = this.modalData.pm
|
|
}
|
|
conSql = " and b.site = '" + this.$store.state.user.site + "'"
|
|
}
|
|
if (val === 2000) {
|
|
strVal = this.modalData.buyer
|
|
conSql = " and b.site = '" + this.$store.state.user.site + "'"
|
|
}
|
|
if (val === 110) {
|
|
strVal = this.modalData.commGroup1
|
|
}
|
|
if (val === 111) {
|
|
strVal = this.modalData.commGroup2
|
|
}
|
|
if (val === 130) {
|
|
strVal = this.modalData.commGroup3
|
|
}
|
|
this.$refs.baseList.init(val, strVal, conSql)
|
|
})
|
|
},
|
|
// 列表方法的回调
|
|
getBaseData (val) {
|
|
if (this.tagNo === 102) {
|
|
if (this.tagNo1 === 1) {
|
|
if (val.Customer_no === this.modalData.endCustomer) {
|
|
return
|
|
}
|
|
if (this.modalData.projectIdFlag) {
|
|
this.modalData.projectIdFlag = false
|
|
}
|
|
this.modalData.endCustomer = val.Customer_no
|
|
this.modalData.endCustomerName = val.Customer_desc
|
|
this.modalData.projectId = ''
|
|
this.modalData.projectName = ''
|
|
this.$set(this.modalData, 'materialList', [])
|
|
}
|
|
}
|
|
if (this.tagNo === 103 || this.tagNo === 2001 || this.tagNo === 2054) {
|
|
if (this.tagNo1 === 1) {
|
|
this.modalData.applicant = val.username
|
|
this.modalData.applicantName = val.user_display
|
|
} else if (this.tagNo1 === 3) {
|
|
this.modalData.npdEngineer = val.username
|
|
this.modalData.npdEngineerName = val.user_display
|
|
} else if (this.tagNo1 === 4) {
|
|
this.modalData.technicalPlan = val.username
|
|
this.modalData.technicalPlanName = val.user_display
|
|
} else if (this.tagNo1 === 5) {
|
|
this.modalData.pm = val.username
|
|
this.modalData.pmName = val.user_display
|
|
}
|
|
}
|
|
if (this.tagNo === 110) {
|
|
this.modalData.commGroup1 = val.product_group_id
|
|
this.modalData.commGroup1Desc = val.product_group_name
|
|
}
|
|
if (this.tagNo === 111) {
|
|
this.modalData.commGroup2 = val.product_group_id
|
|
this.modalData.commGroup2Desc = val.product_group_name
|
|
}
|
|
if (this.tagNo === 130) {
|
|
this.modalData.commGroup3 = val.product_group_id
|
|
this.modalData.commGroup3Desc = val.product_group_name
|
|
}
|
|
if (this.tagNo === 2000) {
|
|
this.modalData.buyer = val.username
|
|
this.modalData.buyerName = val.user_display
|
|
}
|
|
},
|
|
handleQueryCustomer() {
|
|
if (!this.modalData.endCustomer) {
|
|
this.modalData.endCustomerName = ''
|
|
this.modalData.projectId = ''
|
|
this.modalData.projectName = ''
|
|
this.modalData.projectIdFlag = true
|
|
this.$set(this.modalData, 'materialList', [])
|
|
return
|
|
}
|
|
let params = {
|
|
site: this.$store.state.user.site,
|
|
customerNo: this.modalData.endCustomer
|
|
}
|
|
queryCustomer(params).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
if (data.rows && data.rows.length === 1) {
|
|
const customer = data.rows[0]
|
|
this.modalData.endCustomerName = customer.customerDesc || customer.Customer_desc || customer.customerName || ''
|
|
this.modalData.projectIdFlag = !!this.modalData.endCustomerFlag
|
|
} else {
|
|
this.modalData.endCustomerName = ''
|
|
this.modalData.projectId = ''
|
|
this.modalData.projectName = ''
|
|
this.modalData.projectIdFlag = true
|
|
this.$set(this.modalData, 'materialList', [])
|
|
}
|
|
} else {
|
|
this.modalData.endCustomerName = ''
|
|
this.modalData.projectId = ''
|
|
this.modalData.projectName = ''
|
|
this.modalData.projectIdFlag = true
|
|
this.$set(this.modalData, 'materialList', [])
|
|
}
|
|
}).catch((error) => {
|
|
this.modalData.endCustomerName = ''
|
|
this.modalData.projectId = ''
|
|
this.modalData.projectName = ''
|
|
this.modalData.projectIdFlag = true
|
|
this.$set(this.modalData, 'materialList', [])
|
|
})
|
|
},
|
|
handleQueryProjectByCustomer() {
|
|
if (!this.modalData.projectId) {
|
|
this.modalData.projectName = ''
|
|
return
|
|
}
|
|
let params = {
|
|
site: this.$store.state.user.site,
|
|
projectId: this.modalData.projectId
|
|
}
|
|
if (this.modalData.endCustomer) {
|
|
params.customerId = this.modalData.endCustomer
|
|
}
|
|
queryProjectByCustomer(params).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
if (data.rows && data.rows.length === 1) {
|
|
const project = data.rows[0]
|
|
this.modalData.projectName = project.projectName || project.Project_name || ''
|
|
} else {
|
|
this.modalData.projectName = ''
|
|
}
|
|
} else {
|
|
this.modalData.projectName = ''
|
|
}
|
|
}).catch((error) => {
|
|
this.modalData.projectName = ''
|
|
})
|
|
},
|
|
projectClickRow(row) {
|
|
const oldProjectId = this.modalData.projectId
|
|
this.modalData.projectId = row.projectId
|
|
this.modalData.projectName = row.projectName
|
|
if (this.modalData.endCustomer && this.modalData.endCustomer !== '') {
|
|
// do nothing
|
|
} else {
|
|
this.modalData.endCustomer = row.customerId
|
|
this.modalData.endCustomerName = row.customerName
|
|
}
|
|
if (oldProjectId && oldProjectId !== row.projectId) {
|
|
this.$set(this.modalData, 'materialList', [])
|
|
}
|
|
this.chooseProjectListFlag = false
|
|
},
|
|
searchProjectInfoList() {
|
|
this.projectList = [];
|
|
if (this.modalData.endCustomer && this.modalData.endCustomer !== '') {
|
|
this.searchProjectData.customerId = this.modalData.endCustomer
|
|
} else {
|
|
this.searchProjectData.customerId = undefined
|
|
}
|
|
this.searchProjectData.site = this.$store.state.user.site
|
|
searchProjectInfoList(this.searchProjectData).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
const rows = data.rows || []
|
|
this.projectList = rows
|
|
if ((!this.modalData.endCustomer || this.modalData.endCustomer === '') && rows.length > 0) {
|
|
this.modalData.projectId = rows[0].projectId
|
|
this.modalData.projectName = rows[0].projectName
|
|
this.modalData.endCustomer = rows[0].customerId
|
|
this.modalData.endCustomerName = rows[0].customerName
|
|
}
|
|
} else {
|
|
this.projectList = []
|
|
}
|
|
}).catch((error) => {
|
|
this.$message.error('查询项目信息失败')
|
|
})
|
|
},
|
|
closeProjectInfoDialog() {
|
|
if(this.$refs.closeProjectInfoForm) {
|
|
this.$refs.closeProjectInfoForm.resetFields();
|
|
}
|
|
this.searchProjectData = {
|
|
site: this.$store.state.user.site,
|
|
projectId: undefined,
|
|
projectName: undefined,
|
|
customerId: undefined,
|
|
}
|
|
},
|
|
// 申请人输入校验
|
|
applicantBlur (tagNo) {
|
|
if (this.modalData.applicant != null && this.modalData.applicant !== '') {
|
|
let tempData = {
|
|
tagno: tagNo,
|
|
conditionSql: " and a.username = '" + this.modalData.applicant + "'" + " and b.site = '" + this.$store.state.user.site + "'"
|
|
}
|
|
verifyData(tempData).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
if (data.baseListData.length > 0) {
|
|
this.modalData.applicant = data.baseListData[0].username
|
|
this.modalData.applicantName = data.baseListData[0].user_display
|
|
return
|
|
}
|
|
}
|
|
this.modalData.applicantName = ''
|
|
})
|
|
} else {
|
|
this.modalData.applicantName = ''
|
|
}
|
|
},
|
|
// PM输入校验
|
|
pmBlur (tagNo) {
|
|
if (this.modalData.pm != null && this.modalData.pm !== '') {
|
|
let tempData = {
|
|
tagno: tagNo,
|
|
conditionSql: " and a.username = '" + this.modalData.pm + "'" + " and b.site = '" + this.$store.state.user.site + "'"
|
|
}
|
|
verifyData(tempData).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
if (data.baseListData.length > 0) {
|
|
this.modalData.pm = data.baseListData[0].username
|
|
this.modalData.pmName = data.baseListData[0].user_display
|
|
return
|
|
}
|
|
}
|
|
this.modalData.pmName = ''
|
|
})
|
|
} else {
|
|
this.modalData.pmName = ''
|
|
}
|
|
},
|
|
// NPD工程师输入校验
|
|
npdEngineerBlur (tagNo) {
|
|
if (this.modalData.npdEngineer != null && this.modalData.npdEngineer !== '') {
|
|
let tempData = {
|
|
tagno: tagNo,
|
|
conditionSql: " and a.username = '" + this.modalData.npdEngineer + "'" + " and b.site = '" + this.$store.state.user.site + "'"
|
|
}
|
|
verifyData(tempData).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
if (data.baseListData.length > 0) {
|
|
this.modalData.npdEngineer = data.baseListData[0].username
|
|
this.modalData.npdEngineerName = data.baseListData[0].user_display
|
|
return
|
|
}
|
|
}
|
|
this.modalData.npdEngineerName = ''
|
|
})
|
|
} else {
|
|
this.modalData.npdEngineerName = ''
|
|
}
|
|
},
|
|
// 技术计划输入校验
|
|
technicalPlanBlur (tagNo) {
|
|
if (this.modalData.technicalPlan != null && this.modalData.technicalPlan !== '') {
|
|
let tempData = {
|
|
tagno: tagNo,
|
|
conditionSql: " and a.username = '" + this.modalData.technicalPlan + "'" + " and b.site = '" + this.$store.state.user.site + "'"
|
|
}
|
|
verifyData(tempData).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
if (data.baseListData.length > 0) {
|
|
this.modalData.technicalPlan = data.baseListData[0].username
|
|
this.modalData.technicalPlanName = data.baseListData[0].user_display
|
|
return
|
|
}
|
|
}
|
|
this.modalData.technicalPlanName = ''
|
|
})
|
|
} else {
|
|
this.modalData.technicalPlanName = ''
|
|
}
|
|
},
|
|
// 采购输入校验
|
|
buyerBlur (tagNo) {
|
|
if (this.modalData.buyer != null && this.modalData.buyer !== '') {
|
|
let tempData = {
|
|
tagno: tagNo,
|
|
conditionSql: " and a.username = '" + this.modalData.buyer + "'" + " and b.site = '" + this.$store.state.user.site + "'"
|
|
}
|
|
verifyData(tempData).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
if (data.baseListData.length > 0) {
|
|
this.modalData.buyer = data.baseListData[0].username
|
|
this.modalData.buyerName = data.baseListData[0].user_display
|
|
return
|
|
}
|
|
}
|
|
this.modalData.buyerName = ''
|
|
})
|
|
} else {
|
|
this.modalData.buyerName = ''
|
|
}
|
|
},
|
|
// 商品组1输入校验
|
|
commGroup1Blur (tagNo) {
|
|
if (this.modalData.commGroup1 != null && this.modalData.commGroup1 !== '') {
|
|
let tempData = {
|
|
tagno: tagNo,
|
|
conditionSql: " and product_group_id = '" + this.modalData.commGroup1 + "'" + " and site = '" + this.$store.state.user.site + "'"
|
|
}
|
|
verifyData(tempData).then(({data}) => {
|
|
if (data && data.code === 0 && data.baseListData.length > 0) {
|
|
this.modalData.commGroup1 = data.baseListData[0].product_group_id
|
|
this.modalData.commGroup1Desc = data.baseListData[0].product_group_name
|
|
} else {
|
|
this.modalData.commGroup1Desc = ''
|
|
}
|
|
})
|
|
} else {
|
|
this.modalData.commGroup1Desc = ''
|
|
}
|
|
},
|
|
// 商品组2输入校验
|
|
commGroup2Blur (tagNo) {
|
|
if (this.modalData.commGroup2 != null && this.modalData.commGroup2 !== '') {
|
|
let tempData = {
|
|
tagno: tagNo,
|
|
conditionSql: " and product_group_id = '" + this.modalData.commGroup2 + "'" + " and site = '" + this.$store.state.user.site + "'"
|
|
}
|
|
verifyData(tempData).then(({data}) => {
|
|
if (data && data.code === 0 && data.baseListData.length > 0) {
|
|
this.modalData.commGroup2 = data.baseListData[0].product_group_id
|
|
this.modalData.commGroup2Desc = data.baseListData[0].product_group_name
|
|
} else {
|
|
this.modalData.commGroup2Desc = ''
|
|
}
|
|
})
|
|
} else {
|
|
this.modalData.commGroup2Desc = ''
|
|
}
|
|
},
|
|
// 商品组3输入校验
|
|
commGroup3Blur (tagNo) {
|
|
if (this.modalData.commGroup3 != null && this.modalData.commGroup3 !== '') {
|
|
let tempData = {
|
|
tagno: tagNo,
|
|
conditionSql: " and product_group_id = '" + this.modalData.commGroup3 + "'" + " and site = '" + this.$store.state.user.site + "'"
|
|
}
|
|
verifyData(tempData).then(({data}) => {
|
|
if (data && data.code === 0 && data.baseListData.length > 0) {
|
|
this.modalData.commGroup3 = data.baseListData[0].product_group_id
|
|
this.modalData.commGroup3Desc = data.baseListData[0].product_group_name
|
|
} else {
|
|
this.modalData.commGroup3Desc = ''
|
|
}
|
|
})
|
|
} else {
|
|
this.modalData.commGroup3Desc = ''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
/deep/ .customer-tab .el-tabs__content {
|
|
padding: 0 !important;
|
|
}
|
|
|
|
/deep/ .rohs-material-table .el-table__header-wrapper th > .cell {
|
|
white-space: nowrap;
|
|
word-break: keep-all;
|
|
}
|
|
|
|
/deep/ .rohs-multiple-ellipsis.el-select .el-select__tags,
|
|
/deep/ .rohs-multiple-ellipsis .el-select .el-select__tags {
|
|
max-width: calc(100% - 34px) !important;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/deep/ .rohs-multiple-ellipsis.el-select .el-select__tags > span,
|
|
/deep/ .rohs-multiple-ellipsis .el-select .el-select__tags > span {
|
|
display: block;
|
|
max-width: 100%;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
/deep/ .rohs-multiple-ellipsis.el-select .el-select__tags .el-tag,
|
|
/deep/ .rohs-multiple-ellipsis .el-select .el-select__tags .el-tag {
|
|
display: inline-flex;
|
|
max-width: 120px;
|
|
margin-right: 4px;
|
|
overflow: hidden;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
/deep/ .rohs-multiple-ellipsis.el-select .el-select__tags .el-tag .el-select__tags-text,
|
|
/deep/ .rohs-multiple-ellipsis .el-select .el-select__tags .el-tag .el-select__tags-text {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
</style>
|