plm前端
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.
 
 
 
 

3969 lines
136 KiB

<template>
<div class="mod-config">
<!-- 查询条件 -->
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item :label="'测试编码'">
<el-input v-model="searchData.testNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'客户编码'">
<el-input v-model="searchData.customerNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'客户名称'">
<el-input v-model="searchData.customerDesc" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'Artwork'">
<el-input v-model="searchData.trackerName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'TP工程师'">
<el-input v-model="searchData.engineerName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'PLM物料编码'">
<el-input v-model="searchData.testPartNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'物料名称'">
<el-input v-model="searchData.partName" clearable style="width: 120px"></el-input>
</el-form-item>
<!-- <el-form-item :label="'要求交付日期'">-->
<!-- <el-date-picker-->
<!-- style="width: 120px"-->
<!-- v-model="searchData.startDate"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="开始日期">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item :label="' '">-->
<!-- <el-date-picker-->
<!-- style="width: 120px"-->
<!-- v-model="searchData.endDate"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="结束日期">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item label="节点审批人">
<el-input v-model="searchData.approvalUsername" 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>
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item label="BU">
<bu-select v-model="searchData.buNo" style="width: 120px"></bu-select>
</el-form-item>
<el-form-item :label="'项目号'">
<el-input v-model="searchData.projectId" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'项目名称'">
<el-input v-model="searchData.projectName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'优先等级'">
<dict-data-select v-model="searchData.priorityLevel" clearable style="width: 120px" :use-default-value="false" dict-type="priority_Level"/>
</el-form-item>
<el-form-item :label="'IFS物料编码'">
<el-input v-model="searchData.finalPartNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'客户物料编码'">
<el-input v-model="searchData.customerPartNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'So Number'">
<el-input v-model="searchData.soNumber" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'状态'" v-if="false">
<el-select v-model="searchData.testResultStatus" style="width: 120px">
<el-option label="全部" value=""></el-option>
<el-option label="草稿" value="B"></el-option>
<el-option label="已下达" value="C"></el-option>
<el-option label="已完成测试" value="E"></el-option>
<el-option label="已提交测试" value="S"></el-option>
<el-option label="客户已反馈" value="R"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="'状态'">
<el-select v-model="searchData.testStatus" style="width: 120px">
<el-option label="全部" value=""></el-option>
<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-button @click="getDataList()">查询</el-button>
<el-button type="primary" @click="addModal()" v-if="isAuth('107001:save')">新增</el-button>
<el-button type="primary" @click="delModal()" v-if="isAuth('107001:remove')">删除</el-button>
<download-excel
v-if="isAuth('107001:export')"
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ "导出" }}
</download-excel>
<el-button @click="filterVisible = true">搜索</el-button>
</el-form-item>
</el-form>
<!-- 测试列表 -->
<el-table
:height="height"
:data="dataList"
border
:row-style="rowStyle"
ref="testTable"
@row-click="testClickRow"
@selection-change="selectionTest"
@current-change="changeCurrentRow"
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
:selectable="selectFlag"
width="50">
</el-table-column>
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed === ''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<div>
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</div>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="120"
label="操作">
<template slot-scope="scope">
<a type="text" style="cursor:pointer;" @click="handleClickBM(scope.row)">BM</a>
<template v-if="isAuth('107001:update')">
<a type="text" size="small" style="cursor:pointer;" v-if="scope.row.testStatus !== '已完成'"
@click="updateModal(scope.row)">编辑</a>
</template>
<template v-if="isAuth('107001:issued')">
<a type="text" size="small" style="cursor:pointer;" v-if="scope.row.testStatus === '草稿'"
@click="updateModalStatus(scope.row,'C')">下达</a>
</template>
<template v-if="isAuth('107001:detail')">
<a type="text" size="small" style="cursor:pointer;" v-if="scope.row.testStatus === '已完成'"
@click="handleDetail(scope.row)">详情</a>
</template>
</template>
</el-table-column>
</el-table>
<selectDiv ref="selectDiv"></selectDiv>
<!-- 分页插件 -->
<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="modalData.title" @close="closeModalDiaLog" :close-on-click-modal="false" v-drag
:visible.sync="modalFlag" top="10vh" width="60%">
<el-form label-position="top" ref="modalForm" :model="modalData" :rules="rules">
<el-row :gutter="15">
<el-col :span="8">
<el-row :gutter="10">
<el-col :span="10">
<el-form-item prop="customerNo" label="客户编码">
<span slot="label" v-if="!modalData.customerNoFlag" @click="getBaseList(102,1)"><a herf="#">客户编码</a></span>
<el-input :disabled="modalData.customerNoFlag" readonly v-model="modalData.customerNo"
@blur="handleQueryCustomer"></el-input>
</el-form-item>
</el-col>
<el-col :span="14">
<el-form-item label=" ">
<el-input disabled v-model="modalData.customerDesc"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="4">
<el-form-item label="测试数量" prop="testNumber">
<div class="right">
<el-input type="number" class="inlineNumber"
:disabled="(testInformationFlag('testNumber') === 'N' && modalData.flag === '2') || detailFlag"
v-model="modalData.testNumber"
@input="modalData.testNumber = modalData.testNumber.replace(/^(0+)|[^\d]+/g, '')"></el-input>
</div>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="优先等级">
<dict-data-select v-if="modalFlag"
:disabled="(testInformationFlag('priorityLevel') === 'N' && modalData.flag === '2') || detailFlag"
v-model="modalData.priorityLevel" dict-type="priority_Level"></dict-data-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="要求交付日期" prop="requiredDeliveryDate">
<el-date-picker v-model="modalData.requiredDeliveryDate"
:disabled="(testInformationFlag('requiredDeliveryDate') === 'N' && modalData.flag === '2') || detailFlag"
style="width: 100%" type="date" value-format="yyyy-MM-dd"
placeholder="选择日期"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="印刷方式" prop="printType">
<dict-data-select v-if="modalFlag"
:disabled="(testInformationFlag('printType') === 'N' && modalData.flag === '2') || detailFlag"
clearable v-model="modalData.printType" dict-type="print_type"></dict-data-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="8">
<el-row :gutter="10">
<el-col :span="10">
<el-form-item prop="projectId" label="项目号">
<span slot="label" v-if="!modalData.projectIdFlag"
@click="chooseProjectListFlag = true"><a herf="#">项目号</a></span>
<el-input :disabled="modalData.projectIdFlag" readonly v-model="modalData.projectId"
@blur="handleQueryProjectByCustomer"></el-input>
</el-form-item>
</el-col>
<el-col :span="14">
<el-form-item label=" ">
<el-input disabled v-model="modalData.projectName"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="8">
<el-form-item label="标签名称" prop="productName">
<el-input :disabled="(testInformationFlag('productName') === 'N' && modalData.flag === '2') || detailFlag"
v-model="modalData.productName"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="So Number" prop="soNumber">
<el-input :disabled="(testInformationFlag('soNumber') === 'N' && modalData.flag === '2') || detailFlag"
v-model="modalData.soNumber"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="申请人" prop="createBy">
<el-input :disabled="(testInformationFlag('createBy') === 'N' && modalData.flag === '2') || detailFlag"
v-model="modalData.createBy"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="8">
<el-row :gutter="10">
<el-col :span="10">
<!-- <el-form-item prop="testPartNo" label="物料编码">-->
<!-- <span slot="label" v-if="modalData.projectId && modalData.flag === '1'"-->
<!-- @click="projectPartModelFlag = true"><a herf="#">物料编码</a></span>-->
<!-- <el-input :disabled="!modalData.projectId || modalData.flag !== '1'" v-model="modalData.testPartNo"-->
<!-- @blur="handleQueryProjectPart"></el-input>-->
<!-- </el-form-item>-->
<el-form-item prop="testPartNo" label="物料编码">
<span slot="label"
@click="projectPartModelFlag = true" v-if="!modalData.testPartNoFlag"><a herf="#">物料编码</a></span>
<el-input v-model="modalData.testPartNo" readonly :disabled="modalData.testPartNoFlag"
@blur="handleQueryProjectPart"></el-input>
</el-form-item>
</el-col>
<el-col :span="14">
<el-form-item label=" ">
<el-input disabled v-model="modalData.partName"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="4">
<el-form-item>
<!-- <el-form-item prop="trackerName">-->
<span v-if="(testInformationFlag('tracker') === 'N' && modalData.flag === '2') || detailFlag"
slot="label">Artwork</span>
<span v-else style="cursor: pointer" slot="label" @click="getBaseList(2041)"><a
herf="#">Artwork</a></span>
<el-input :disabled="(testInformationFlag('tracker') === 'N' && modalData.flag === '2') || detailFlag"
v-model="modalData.trackerName" readonly>
<span slot="suffix" v-show="modalData.trackerName && !detailFlag" @click="clearModalData('tracker')"><i
class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i></span>
</el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item prop="engineerName">
<span v-if="(testInformationFlag('engineer') === 'N' && modalData.flag === '2') || detailFlag"
slot="label">TP工程师</span>
<span v-else slot="label" @click="getBaseList(2042)"><a herf="#">TP工程师</a></span>
<el-input :disabled="(testInformationFlag('engineer') === 'N' && modalData.flag === '2') || detailFlag"
v-model="modalData.engineerName" readonly>
<span slot="suffix" v-show="modalData.engineerName && !detailFlag"
@click="clearModalData('engineer')"><i class="el-icon-circle-close"
style="margin-left: 5px;cursor: pointer;"></i></span>
</el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="CQC">
<span v-if="(testInformationFlag('artwork') === 'N' && modalData.flag === '2') || detailFlag"
slot="label">CQC</span>
<span v-else slot="label"><a herf="#" @click="getBaseList(2007)">CQC</a></span>
<el-input :disabled="(testInformationFlag('artwork') === 'N' && modalData.flag === '2') || detailFlag"
v-model="modalData.artworkName">
<span slot="suffix" v-show="modalData.artworkName && !detailFlag" @click="clearModalData('artwork')"><i
class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i></span>
</el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="FAI">
<span v-if="(testInformationFlag('planner') === 'N' && modalData.flag === '2') || detailFlag"
slot="label">FAI</span>
<span v-else slot="label"><a herf="#" @click="getBaseList(2008)">FAI</a></span>
<el-input :disabled="(testInformationFlag('planner') === 'N' && modalData.flag === '2') || detailFlag"
v-model="modalData.plannerName">
<span slot="suffix" v-show="modalData.plannerName && !detailFlag" @click="clearModalData('planner')"><i
class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i></span>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="24">
<el-form-item label="备注" style="height: 90px">
<el-input type="textarea"
:disabled="(testInformationFlag('technicalConsiderations') === 'N' && modalData.flag === '2') || detailFlag"
v-model="modalData.technicalConsiderations" :rows="3" resize='none' show-word-limit></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="rq">
<el-button v-if="!modalData.testNo" @click="saveData" plain type="primary" style="position:absolute;margin-top: 10px;margin-right: 10px;right: 0;z-index: 1">下一步
</el-button>
<el-tabs v-model="activeTab" @tab-click="dialogTabClick">
<el-tab-pane label="基本信息" :disabled="!activeTabList.includes('attribute')" name="attribute" v-if="modalData.testNo">
<test-properties v-if="modalFlag" :disabled="detailFlag" v-model:data-list="testPropertiesList" height="32vh" ref="dialogTestAttribute" :test-no="modalData.testNo"></test-properties>
</el-tab-pane>
<el-tab-pane label="基本信息" :disabled="!activeTabList.includes('attribute')" name="attribute" v-else>
<test-properties v-if="modalFlag" :disabled="detailFlag" v-model:data-list="copyTestPropertiesList" height="32vh" ref="dialogTestAttribute" :test-no="modalData.testNo"></test-properties>
</el-tab-pane>
<el-tab-pane label="物料属性" :disabled="!activeTabList.includes('partAttribute')" name="partAttribute">
<el-table
:data="partItemList1"
height="35vh"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnItemList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</div>
<div v-else>
{{ scope.row.textValue ? scope.row.textValue : scope.row.numValue }}
</div>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="材料信息" :disabled="!activeTabList.includes('product')" name="product">
<test-table v-if="clickTestRow" :disabled="detailFlag" :test-number="modalData.testNumber" height="32vh" ref="dialogSoBom" v-model:data-list="testSoBomList" :test-no="modalData.testNo"></test-table>
</el-tab-pane>
<el-tab-pane label="制程信息" :disabled="!activeTabList.includes('process')" name="process">
<test-routing-table v-if="clickTestRow" :disabled="detailFlag" ref="dialogSoRouting" height="32vh" v-model:data-list="testSoRoutingList" :test-no="modalData.testNo"></test-routing-table>
</el-tab-pane>
<el-tab-pane label="附件信息" :disabled="!activeTabList.includes('file')" name="file">
<!-- <oss-components ref="ossRef1" v-if="clickTestRow" :disabled="detailFlag" label="测试单号" height="32vh"-->
<!-- :columns="fileColumnList" :order-ref2="modalData.testNo"-->
<!-- :order-ref1="modalData.site"></oss-components>-->
<oss-components ref="ossRef1" v-if="fileContentLoaded" :disabled="detailFlag" label="测试单号" height="32vh" :columns="fileColumnList" :order-ref2="modalData.testNo" :order-ref1="modalData.site"></oss-components>
</el-tab-pane>
</el-tabs>
</div>
<el-footer style="height:30px;text-align:center;margin-top: 8px">
<template v-if="modalData.testStatus === '草稿' || (modalData.testStatus === '审批中' && ((modalData.approvalUsername && modalData.approvalUsername.split(';').includes($store.state.user.name)) || superAdmin))">
<el-button type="primary" @click="saveData()" v-if="modalData.flag !== '1' && !detailFlag">保存</el-button>
</template>
<el-button type="primary" @click="closeDialog">关闭</el-button>
<template v-if="isAuth('107001:submit')">
<template v-if="superAdmin || (modalData.approvalUsername && modalData.approvalUsername.split(';').includes($store.state.user.name))">
<el-button v-if="modalData.testStatus === '审批中' && !detailFlag" type="primary" @click="agreeSubmit">同意</el-button>
</template>
</template>
<template v-if="isAuth('107001:rejected')">
<template v-if="superAdmin || (modalData.approvalUsername && modalData.approvalUsername.split(';').includes($store.state.user.name))">
<el-button v-if="modalData.testStatus === '审批中' && modalData.isReject === 'Y' && !detailFlag" @click="rejectVisible = true" type="primary">驳回</el-button>
</template>
</template>
</el-footer>
</el-dialog>
<el-dialog title="物料信息" :visible.sync="projectPartModelFlag" :close-on-click-modal="false">
<el-form label-position="top" :model="projectPartData">
<el-row :gutter="20">
<el-col :span="4">
<el-form-item label="PLM物料编码">
<el-input v-model="projectPartData.testPartNo" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="物料名称">
<el-input v-model="projectPartData.partName" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="IFS物料编码">
<el-input v-model="projectPartData.finalPartNo" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="客户料号">
<el-input v-model="projectPartData.customerPartNo" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label=" ">
<el-button type="primary" @click="getProjectPartList">查询</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table
:height="300"
:data="projectPartList"
ref="projectPartTable"
@row-dblclick="partClickRow"
header-cell-class-name="cellClass"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in projectPartDetailList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed===''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
<el-pagination style="margin-top: 0"
@size-change="partPageSizeChange"
@current-change="partPageCurrentChange"
:current-page="partPageNo"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="partPageSize"
:total="partPageTotal"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-dialog>
<!-- 录入测试结果模态框 -->
<el-dialog title="录入测试结果" :close-on-click-modal="false" v-drag :visible.sync="enterResultModalFlag"
width="785px">
<el-form :inline="true" label-position="top" :model="enterResultData" :rules="enterResultRules"
style="margin-left: 0px;margin-top: 10px;">
<el-form-item label="实际交付日期" prop="actualityDeliveryDate" :rules="enterResultRules.actualityDeliveryDate">
<el-date-picker v-model="enterResultData.actualityDeliveryDate" type="date" value-format="yyyy-MM-dd"
placeholder="请选择日期" style="width: 200px"></el-date-picker>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="enterResultData" :rules="enterResultRules"
style="margin-left:0px;margin-top: 5px;">
<el-form-item label="测试结果信息" prop="testResultInformation" :rules="enterResultRules.testResultInformation">
<el-input type="textarea" v-model="enterResultData.testResultInformation" :rows="3" resize='none'
show-word-limit style="width: 500px;height: 30px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="enterResultData" style="margin-left: 0px;margin-top: 50px;">
<el-form :inline="true" label-position="top" style="margin-top: 5px">
<el-button type="primary" @click="uploadFile()">上传文件</el-button>
</el-form>
<el-table
:height="200"
:data="fileContentList"
border
v-loading="dataListLoading"
style="width: 100%">
<el-table-column
v-for="(item,index) in fileColumnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed===''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="100"
label="操作">
<template slot-scope="scope">
<a @click="deleteFile(scope.row)">删除</a>
</template>
</el-table-column>
</el-table>
</el-form>
<el-footer style="height:35px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="saveTestResult()">保存</el-button>
<el-button type="primary" @click="enterResultModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 录入送样信息模态框 -->
<el-dialog title="录入送样信息" :close-on-click-modal="false" v-drag :visible.sync="submitResultModalFlag"
width="620px">
<el-form :inline="true" label-position="top" :model="submitResultData" :rules="submitResultRules"
style="margin-left: 0px;margin-top: 10px;">
<el-form-item label="实际送样日期" prop="actualitySendSamplesDate"
:rules="submitResultRules.actualitySendSamplesDate">
<el-date-picker v-model="submitResultData.actualitySendSamplesDate" type="date" value-format="yyyy-MM-dd"
placeholder="请选择日期" style="width: 200px"></el-date-picker>
</el-form-item>
<el-form-item label="送样方式" prop="sendSamplesMethod" :rules="submitResultRules.sendSamplesMethod">
<el-select v-model="submitResultData.sendSamplesMethod" style="width: 221px">
<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="submitResultData.deliverGoodsInformation" style="width: 221px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="submitResultData" style="margin-left:0px;margin-top: 5px;">
<el-form-item label="送货备注">
<el-input type="textarea" v-model="submitResultData.deliverGoodsRemark" :rows="3" resize='none'
show-word-limit style="width: 456px;height: 30px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:35px;margin-top: 50px;text-align:center">
<el-button type="primary" @click="saveSubmitResult()">保存</el-button>
<el-button type="primary" @click="submitResultModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 客户回复模态框 -->
<el-dialog title="客户回复" :close-on-click-modal="false" v-drag :visible.sync="customerResponseModalFlag"
width="620px">
<el-form :inline="true" label-position="top" :model="customerResponseData" :rules="customerResponseRules"
style="margin-left: 0px;margin-top: 10px;">
<el-form-item label="实际回复日期" prop="actualityReplyDate" :rules="customerResponseRules.actualityReplyDate">
<el-date-picker v-model="customerResponseData.actualityReplyDate" type="date" value-format="yyyy-MM-dd"
placeholder="请选择日期" style="width: 185px"></el-date-picker>
</el-form-item>
<el-form-item label="客户确认结果" prop="confirmResults" :rules="customerResponseRules.confirmResults">
<el-select v-model="customerResponseData.confirmResults" style="width: 185px">
<el-option label="接受" value="接受"></el-option>
<el-option label="不接受" value="不接受"></el-option>
</el-select>
</el-form-item>
<el-form-item label="客户确认人" prop="confirmBy" :rules="customerResponseRules.confirmBy">
<el-input v-model="customerResponseData.confirmBy" style="width: 185px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="customerResponseData"
style="margin-left:0px;margin-top: 5px;">
<el-form-item label="客户回复信息">
<el-input type="textarea" v-model="customerResponseData.confirmInformation" :rows="3" resize='none'
show-word-limit style="width: 595px;height: 30px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:35px;margin-top: 50px;text-align:center">
<el-button type="primary" @click="saveCustomerResponse()">保存</el-button>
<el-button type="primary" @click="customerResponseModalFlag = false">关闭</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-dialog>
<!-- 页签 -->
<el-tabs v-model="activeTable" style="margin-top: 0px; width: 100%; min-height: 500px;" type="border-card" @tab-click="tabClick" class="customer-tab">
<el-tab-pane label="基本信息" name="attribute">
<test-properties
ref="tabProperties"
v-model:data-list="testPropertiesList"
:test-no="testCurrentRow.testNo"
:disabled="testCurrentRow.testStatus === '已完成'"
:approval-username="testCurrentRow.approvalUsername"
:test-status="testCurrentRow.testStatus"
:super-admin="superAdmin"
height="45vh">
</test-properties>
</el-tab-pane>
<el-tab-pane label="物料属性" name="test_attribute" style="padding: 5px">
<el-table
:data="partItemList2"
:height="500"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnItemList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</div>
<div v-else>
{{ scope.row.textValue ? scope.row.textValue : scope.row.numValue }}
</div>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="材料信息" name="test_so_bom" style="padding: 5px">
<test-table ref="tabSoBom" :test-number="testCurrentRow.testNumber"
:disabled="testCurrentRow.testStatus === '已完成'" :test-no="testCurrentRow.testNo" height="45vh"
v-model:data-list="testSoBomList"></test-table>
</el-tab-pane>
<el-tab-pane label="制程信息" name="test_so_routing" style="padding: 5px">
<test-routing-table ref="tabSoRouting" :test-no="testCurrentRow.testNo" v-model:data-list="testSoRoutingList"
:disabled="testCurrentRow.testStatus === '已完成'" height="45vh"></test-routing-table>
</el-tab-pane>
<el-tab-pane label="附件信息" name="file">
<oss-components style="margin-top: 5px"
ref="ossRef2"
:save-visible="isAuth('107001:tab5:save')"
:download-visible="isAuth('107001:tab5:download')"
:remove-visible="isAuth('107001:tab5:remove')"
:preview-visible="isAuth('107001:tab5:preview')"
:disabled="testCurrentRow.testStatus === '已完成'"
label="测试单号"
height="45vh"
:columns="fileColumnList"
:order-ref2="testCurrentRow.testNo"
:order-ref1="testCurrentRow.site"
></oss-components>
</el-tab-pane>
<!-- 项目信息页签 -->
<el-tab-pane label="项目信息" name="project_information">
<el-form label-position="top" :model="projectInformationData"
style="margin-left: 10px;margin-top: 5px;margin-right: 10px">
<el-row :gutter="20">
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="项目号">
<el-input v-model="projectInformationData.projectId" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="项目名称">
<el-input v-model="projectInformationData.projectName" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="项目类型">
<el-input v-model="projectInformationData.projectType" readonly></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="客户来源">
<el-input v-model="projectInformationData.projectSourceDesc" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="优先级">
<el-input v-model="projectInformationData.priorityDesc" readonly></el-input>
</el-form-item>
</div>
</el-col>
<!-- <el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="终端客户">
<el-input v-model="projectInformationData.finalCustomerName" readonly></el-input>
</el-form-item>
</div>
</el-col>-->
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="项目经理">
<el-input v-model="projectInformationData.projectManagerName" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="项目负责人">
<el-input v-model="projectInformationData.projectOwnerName" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="8">
<div class="grid-content bg-purple">
<el-form-item label="项目权限">
<el-input v-model="projectInformationData.userRoleName" readonly></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<div class="grid-content bg-purple">
<el-form-item label="创建时间">
<el-input v-model="projectInformationData.createDate" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="6">
<div class="grid-content bg-purple">
<el-form-item label="创建人">
<el-input v-model="projectInformationData.createBy" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="6">
<div class="grid-content bg-purple">
<el-form-item label="更新时间">
<el-input v-model="projectInformationData.updateDate" readonly></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="6">
<div class="grid-content bg-purple">
<el-form-item label="更新人">
<el-input v-model="projectInformationData.updateBy" readonly></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<div class="grid-content bg-purple">
<el-form-item label="项目描述">
<el-input v-model="projectInformationData.projectDesc" readonly></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<div class="grid-content bg-purple">
<el-form-item label="其它特殊要求">
<el-input v-model="projectInformationData.remark" readonly></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
<!-- 客户信息页签 -->
<el-tab-pane label="客户信息" name="customer_information">
<customer-info :project="testCurrentRow"></customer-info>
</el-tab-pane>
<!-- 审批信息 -->
<el-tab-pane label="审批信息" name="approvalInformation">
<approval-information ref="approvalTable" v-model:data-list="approvalList" height="46vh"
style="margin-top: 5px"></approval-information>
</el-tab-pane>
</el-tabs>
<!-- chooseList模态框 -->
<choose-list ref="baseList" @getBaseData="getBaseData"></choose-list>
<!-- 客户地址 -->
<el-dialog title="联系地址清单" :close-on-click-modal="false" v-drag :visible.sync="addressModelFlag" width="520px">
<el-table
:height="300"
:data="addressList"
@row-dblclick="getAddressData"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnAddressList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="addressModelFlag=false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 联系人 -->
<el-dialog title="收货人清单" :close-on-click-modal="false" v-drag :visible.sync="contactModelFlag" width="520px">
<el-table
:height="300"
:data="contactList"
@row-dblclick="getContactData"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnContactList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="contactModelFlag=false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="rejectVisible" width="500px">
<el-form label-position="top">
<el-form-item label="驳回意见" class="auto">
<el-input type="textarea" v-model="rejectOpinion" :rows="3"></el-input>
</el-form-item>
</el-form>
<el-footer style="text-align:center;height: 30px;line-height: 30px;">
<el-button type="primary" @click="rejectSubmit">确定</el-button>
<el-button type="primary" @click="rejectVisible = false">取消</el-button>
</el-footer>
</el-dialog>
<!-- 上传文件的modal -->
<test-upload-file ref="testUploadFile" @refreshPageTables="getFileContentData()" v-drag></test-upload-file>
<filter-search :visible.sync="filterVisible" @search="searchByAnyField"></filter-search>
</div>
</template>
<script>
import {
testInformationSearch, // 测试信息列表查询
testInformationSave, // 测试信息新增
testInformationEdit, // 测试信息编辑
testInformationDelete, // 测试信息删除
getFileContentList, // 获取测试单附件列表
testResultSearch, // 获取测试结果对象
deleteTestFile, // 文件删除
saveTestResult, // 保存测试结果
saveSubmitResult, // 保存送样结果
saveCustomerResponse, // 保存客户回复
getProjectPartList, // 获取产品列表
getProjectInformation, // 获取项目信息
getCustomerInformation, // 获取客户信息
submitChange, // 提交
testInformationEditStatus, // 下达
} from '@/api/test/testInformation.js'
import {
getNodeAuthority, // 获取节点权限
checkSuperAdmin, // 校验是否为超级管理员
} from '@/api/changeManagement/changeManagement.js'
import {
downLoadQuotationFile, // 文件下载
searchProjectInfoList
} from '@/api/quotation/quotationInformation.js'
import {
customerAddressSearch, // 客户联系地址列表查询
} from '@/api/customer/customerAddress.js'
import {
customerContactSearch, // 客户联系人列表查询
} from '@/api/customer/customerContact.js'
import {
getNodeList
} from "@/api/sampleManagement/technicalSpecificationList.js"
import ChooseList from '@/views/modules/common/Chooselist'
import TestUploadFile from "./test_upload_file"
import DictDataSelect from "../sys/dict-data-select.vue";
import {selectTestSoBom,} from "../../../api/test/testSoBom";
import TestTable from "./testSoBom/testTable.vue";
import TestRoutingTable from "./testSoRouting/testRoutingTable.vue";
import {selectTestSoRoutingList} from "../../../api/test/testSoRouting";
import TestAttribute from "./testSoAttribute/testAttribute.vue";
import {partPropertiesList, getPartItemWithPartNo} from "@/api/base/properties.js";
import TestProperties from "./testAttribute/testProperties.vue";
import {getTestPropertiesList, searchTestPropertiesItem} from "../../../api/test/testProperties";
import TestFile from "./file/testFile.vue";
import ApprovalInformation from "../changeManagement/approvalInformation.vue";
import {queryCustomer} from "../../../api/customer/customerInformation";
import {queryProjectByCustomer, queryProjectPart} from "../../../api/project/project";
import OssComponents from "../oss/ossComponents.vue";
import BuSelect from "../base/BuSelect.vue";
import {getApprovalList} from "../../../api/changeManagement/changeManagement";
import CustomerInfo from "../quotation/sellForQuotation/customerInfo.vue";
import FilterSearch from "../../common/filterSearch.vue";
import {quotationInformationSearchByAnyField} from "../../../api/quotation/quotationInformation";
import {testInformationSearchAny} from "../../../api/test/testInformation";
import PriceCheckProperties from "../quotation/priceCheckProperties.vue";
export default {
computed: {
testInformationFlag() {
return (value) => {
if (!this.plmTestInformationArr) {
return 'N'
}
let arr = this.plmTestInformationArr.filter(a => a.fieldId === value)
if (arr.length > 0) {
return arr[0].updateFlag
}
return 'N'
}
},
},
name: "test",
components: {
PriceCheckProperties,
FilterSearch,
CustomerInfo,
BuSelect,
OssComponents,
TestFile,
TestProperties,
TestAttribute,
TestRoutingTable,
TestTable,
DictDataSelect,
ChooseList,
TestUploadFile,
ApprovalInformation
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.customerNo = this.searchData.customerNo.toUpperCase()
this.searchData.projectId = this.searchData.projectId.toUpperCase()
}
},
modalData: {
deep: true,
handler: function (newV, oldV) {
this.modalData.customerNo = this.modalData.customerNo.toUpperCase()
this.modalData.projectId = this.modalData.projectId.toUpperCase()
this.modalData.testNo = this.modalData.testNo.toUpperCase()
}
},
'modalData.customerNo'(newV, oldV) {
if (oldV) {
if (!newV) {
this.modalData.customerDesc = ''
}
if (!this.modalData.projectId){
this.modalData.projectId = ''
}
this.modalData.consignee = ''
this.modalData.consigneeContact = ''
this.modalData.sendSamplesAddress = ''
}
},
'modalData.projectId'(newV, oldV) {
if (oldV) {
if (!newV) {
this.modalData.projectName = ''
}
if (!this.modalData.testPartNo){
this.modalData.testPartNo = ''
}
if (!this.modalData.customerNo){
this.modalData.customerNo = ''
}
}
},
'modalData.testPartNo'(newV, oldV) {
if (oldV) {
if (!newV) {
this.modalData.partName = ''
this.dialogProperties = [];
}
if (!this.modalData.projectId){
this.modalData.projectId = ''
}
}
},
'modalData.tracker'(newV, oldV) {
if (newV === '' || newV === undefined || newV === null) {
this.modalData.trackerName = ''
}
},
'modalData.engineer'(newV, oldV) {
if (newV === '' || newV === undefined || newV === null) {
this.modalData.engineerName = ''
}
},
'modalData.artwork'(newV, oldV) {
if (newV === '' || newV === undefined || newV === null) {
this.modalData.artworkName = ''
}
},
'modalData.planner'(newV, oldV) {
if (newV === '' || newV === undefined || newV === null) {
this.modalData.plannerName = ''
}
},
modalFlag(newVal, oldVal) {
if (newVal === false) {
this.detailFlag = false
}
this.modalData.customerNoFlag = false
this.modalData.projectIdFlag = true
this.modalData.testPartNoFlag = false
this.projectPartData.projectId = ''
this.searchProjectData.customerId = ''
this.searchProjectData.testPartNo = ''
},
rejectVisible(newVal, oldVal) {
if (newVal === false) {
this.rejectOpinion = ''
}
},
projectPartModelFlag(newVal, oldVal) {
if (newVal === false) {
this.projectPartData.finalPartNo = ''
this.projectPartData.customerPartNo = ''
this.partPageNo = 1
this.partPageSize = 20
} else {
this.getProjectPartList()
}
}
},
data() {
return {
approvalList: [],
detailFlag: false,
partItemList1: [],
partItemList2: [],
testFileList: [],
dialogProperties: [],
attributeList: [],
testSoRoutingList: [],
testSoBomList: [],
testPropertiesList: [],
copyTestPropertiesList: [],
activeTab: 'attribute',
activeTabList: ['attribute'],
clickTestRow: false,
filterVisible: false,
isFilterSearch: false,
filterSearchData: {},
// 导出
exportData: [],
exportName: '设备分类' + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ['设备分类'],
exportFooter: [],
resultList: [],
// ======== 行高 ========
height: 200,
secondHeight: 200,
// ======== 分页 ========
pageIndex: 1,
pageSize: 50,
totalPage: 0,
selectedDataNum: 0,
// 条件查询
searchData: {
site: this.$store.state.user.site,
customerNo: '',
customerDesc: '',
trackerName: '',
testPartNo: '',
partName: '',
testStatus: '',
startDate: '',
endDate: '',
projectId: '',
projectName: '',
engineerName: '',
priorityLevel: '',
customerPartNo: '',
finalPartNo: '',
page: 1,
limit: 10,
menuId: this.$route.meta.menuId,
testNo: '',
buNo: '',
nodeId: '',
approvalUsername: '',
soNumber: ''
},
fileContentLoaded: false,
// 其它
dataListLoading: false,
// 初始页签
activeTable: 'attribute',
// ======== 数据对象 ========
modalData: {
flag: '1',
title: '测试申请',
site: this.$store.state.user.site,
testNo: '',
customerNo: '',
customerDesc: '',
projectId: '',
projectName: '',
tracker: '',
trackerName: '',
testPartNo: '',
partName: '',
engineer: '',
engineerName: '',
priorityLevel: '',
testNumber: 1,
doesNeedArtwork: '',
artwork: '',
artworkName: '',
doesNeedPlanner: '',
planner: '',
plannerName: '',
requiredDeliveryDate: '',
remark: '',
technicalConsiderations: '',
isNeedToSendSamples: '',
sendSamplesAddress: '',
consignee: '',
consigneeContact: '',
actualityDeliveryDate: '',
testResultInformation: '',
actualitySendSamplesDate: '',
sendSamplesMethod: '',
deliverGoodsInformation: '',
deliverGoodsRemark: '',
actualityReplyDate: '',
confirmResults: '',
confirmBy: '',
confirmInformation: '',
testStatus: '草稿',
testResultStatus: 'B',
nextToDo: '',
createDate: '',
createBy: this.$store.state.user.name,
updateDate: '',
updateBy: '',
printType: '',
productName: '',
nodeConclusion: '',
stepId: '',
rejectFlag: '',
rejectStepId: '',
isReject: '',
nodeId: '',
soNumber: '',
customerNoFlag: false,
projectIdFlag: true,
testPartNoFlag: false,
},
testDetailData: {
technicalConsiderations: '',
isNeedToSendSamples: '',
sendSamplesAddress: '',
consignee: '',
consigneeContact: ''
},
testResultData: {
testResultStatus: '',
actualityDeliveryDate: '',
isNeedToSendSamples: '',
testResultInformation: '',
actualitySendSamplesDate: '',
sendSamplesMethod: '',
deliverGoodsInformation: '',
deliverGoodsRemark: '',
confirmResults: '',
actualityReplyDate: '',
confirmBy: '',
confirmInformation: ''
},
enterResultData: {
site: this.$store.state.user.site,
testNo: '',
actualityDeliveryDate: '',
testResultInformation: '',
updateBy: this.$store.state.user.name,
testResultStatus: '',
fileContentList: []
},
submitResultData: {
site: this.$store.state.user.site,
testNo: '',
actualitySendSamplesDate: '',
sendSamplesMethod: '',
deliverGoodsInformation: '',
deliverGoodsRemark: '',
updateBy: this.$store.state.user.name,
testResultStatus: ''
},
customerResponseData: {
site: this.$store.state.user.site,
testNo: '',
actualityReplyDate: '',
confirmResults: '',
confirmBy: '',
confirmInformation: '',
updateBy: this.$store.state.user.name,
testResultStatus: ''
},
projectPartData: {
site: this.$store.state.user.site,
testPartNo: '',
finalPartNo: '',
customerPartNo: '',
partName: ''
},
projectInformationData: {
projectId: '',
projectName: '',
projectType: '',
projectSourceDesc: '',
priorityDesc: '',
status: '',
projectDesc: '',
projectManagerName: '',
projectOwnerName: '',
userRoleName: '',
remark: ''
},
customerInformationData: {
customerNo: '',
customerDesc: '',
importantCustomer: '',
customerCurrency: '',
turnoverOfYear: '',
potentialRevenueOfYear: '',
customerStatus: '',
customerIndustry: '',
companyName: '',
jobDescription: '',
customerDescription: '',
contactName: '',
contactPhoneNumber1: '',
position: '',
addressName: '',
addressType: '',
createDate: '',
createBy: '',
updateDate: '',
updateBy: ''
},
// ======== 数据列表 ========
dataList: [],
fileContentList: [],
projectPartList: [],
addressList: [],
contactList: [],
plmTestInformationArr: [],
nodeOptions: [],
// ======== 列表表头 ========
columnList: [
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1BuDesc',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'buDesc',
headerAlign: 'center',
align: 'center',
columnLabel: 'BU',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
}, {
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1TestNo',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'testNo',
headerAlign: 'center',
align: 'center',
columnLabel: '测试单号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1CustomerNo',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'customerNo',
headerAlign: 'center',
align: 'center',
columnLabel: '客户编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1CustomerDesc',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'customerDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '客户名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1ProjectId',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'projectId',
headerAlign: 'center',
align: 'left',
columnLabel: '项目号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 110
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1ProjectName',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'projectName',
headerAlign: 'center',
align: 'left',
columnLabel: '项目名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1TestPartNo',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'testPartNo',
headerAlign: 'center',
align: 'left',
columnLabel: 'PLM物料编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1FinalPartNo',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'finalPartNo',
headerAlign: 'center',
align: 'left',
columnLabel: 'IFS物料编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1PartName',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'partName',
headerAlign: 'center',
align: 'left',
columnLabel: '物料名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1CustomerPartNo',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'customerPartNo',
headerAlign: 'center',
align: 'left',
columnLabel: '客户物料编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1TrackerName',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'trackerName',
headerAlign: 'center',
align: 'left',
columnLabel: 'Artwork',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1EngineerName',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'engineerName',
headerAlign: 'center',
align: 'left',
columnLabel: 'TP工程师',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1ArtworkName',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'artworkName',
headerAlign: 'center',
align: 'left',
columnLabel: 'CQC',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001TablePlannerName',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'plannerName',
headerAlign: 'center',
align: 'left',
columnLabel: 'FAI',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1PriorityLevel',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'priorityLevel',
headerAlign: 'center',
align: 'center',
columnLabel: '优先等级',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1TestNumber',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'testNumber',
headerAlign: 'center',
align: 'right',
columnLabel: '测试数量',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1RequiredDeliveryDate',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'requiredDeliveryDate',
headerAlign: 'center',
align: 'center',
columnLabel: '要求交付日期',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 160
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1TestStatus',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'testStatus',
headerAlign: 'center',
align: 'center',
columnLabel: '状态',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1NodeName',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'nodeName',
headerAlign: 'center',
align: 'center',
columnLabel: '当前节点',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1ApprovalUsername',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'approvalUsername',
headerAlign: 'center',
align: 'left',
columnLabel: '当前节点审批人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1CreateDate',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '申请时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 160
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1CreateBy',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'createBy',
headerAlign: 'center',
align: 'center',
columnLabel: '申请人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1UpdateDate',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'updateDate',
headerAlign: 'center',
align: 'center',
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 160
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table1UpdateBy',
tableId: '103001Table1',
tableName: '测试信息表',
columnProp: 'updateBy',
headerAlign: 'center',
align: 'center',
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
}
],
fileColumnList: [
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table2FileName',
tableId: '103001Table2',
tableName: '文件信息表',
columnProp: 'fileName',
headerAlign: 'center',
align: 'center',
columnLabel: '文件名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table2FileRemark',
tableId: '103001Table2',
tableName: '文件信息表',
columnProp: 'fileRemark',
headerAlign: 'center',
align: 'center',
columnLabel: '备注',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 240
},
// {
// userId: this.$store.state.user.name,
// functionId: 103001,
// serialNumber: '103001Table2OrderRef3',
// tableId: '103001Table2',
// tableName: '文件信息表',
// columnProp: 'orderRef3',
// headerAlign: 'center',
// align: 'center',
// columnLabel: '文件描述',
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: '',
// columnWidth: 120
// },
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table2CreateDate',
tableId: '103001Table2',
tableName: '文件信息表',
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '上传时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table2CreatedBy',
tableId: '103001Table2',
tableName: '文件信息表',
columnProp: 'createBy',
headerAlign: 'center',
align: 'center',
columnLabel: '上传人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140
}
],
projectPartDetailList: [
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table3TestPartNo',
tableId: '103001Table3',
tableName: '项目物料表',
columnProp: 'testPartNo',
headerAlign: 'center',
align: 'left',
columnLabel: 'PLM物料编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table3FinalPartNo',
tableId: '103001Table3',
tableName: '项目物料表',
columnProp: 'finalPartNo',
headerAlign: 'center',
align: 'left',
columnLabel: 'IFS物料编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table3PartDesc',
tableId: '103001Table3',
tableName: '项目物料表',
columnProp: 'partDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '物料名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table3CustomerPartNo',
tableId: '103001Table3',
tableName: '项目物料表',
columnProp: 'customerPartNo',
headerAlign: 'center',
align: 'left',
columnLabel: '客户料号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table3PartSpec',
tableId: '103001Table3',
tableName: '项目物料表',
columnProp: 'partSpec',
headerAlign: 'center',
align: 'center',
columnLabel: '物料规格',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
}, {
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table3PartTypeDesc',
tableId: '103001Table3',
tableName: '项目物料表',
columnProp: 'partTypeDesc',
headerAlign: 'center',
align: 'center',
columnLabel: '物料类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140
},
{
userId: this.$store.state.user.name,
functionId: 102001,
serialNumber: '102001Table3Type',
tableId: '102001Table3',
tableName: '项目物料表',
columnProp: 'type',
headerAlign: 'center',
align: 'center',
columnLabel: '制造类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 102001,
serialNumber: '102001Table3UmId',
tableId: '102001Table3',
tableName: '项目物料表',
columnProp: 'umId',
headerAlign: 'center',
align: 'center',
columnLabel: '单位',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
columnAddressList: [
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table4AddressName',
tableId: '103001Table4',
tableName: '联系地址表',
columnProp: 'addressName',
headerAlign: 'center',
align: 'center',
columnLabel: '联系地址',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table4ContactStatus',
tableId: '103001Table4',
tableName: '联系地址表',
columnProp: 'addressStatus',
headerAlign: 'center',
align: 'center',
columnLabel: '地址状态',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
},
],
columnContactList: [
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table5ContactName',
tableId: '103001Table5',
tableName: '客户联系人表',
columnProp: 'contactName',
headerAlign: 'center',
align: 'center',
columnLabel: '客户负责人',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table5ContactPhoneNumber1',
tableId: '103001Table5',
tableName: '客户联系人表',
columnProp: 'contactPhoneNumber1',
headerAlign: 'center',
align: 'center',
columnLabel: '联系方式',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table5PrimaryContact',
tableId: '103001Table5',
tableName: '客户联系人表',
columnProp: 'primaryContact',
headerAlign: 'center',
align: 'center',
columnLabel: '默认联系人',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table5ContactStatus',
tableId: '103001Table5',
tableName: '客户联系人表',
columnProp: 'contactStatus',
headerAlign: 'center',
align: 'center',
columnLabel: '人员状态',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
},
],
// ======== 必填规则 ========
rules: {
customerNo: [
{
required: true,
message: ' ',
trigger: ['change', 'blur']
}
],
trackerName: [
{
required: true,
message: ' ',
trigger: ['change', 'blur']
}
],
testNumber: [
{
required: true,
message: ' ',
trigger: ['change', 'blur']
}
],
projectId: [
{
required: true,
message: ' ',
trigger: ['change', 'blur']
}
],
engineerName: [
{
required: true,
message: ' ',
trigger: ['change', 'blur']
}
],
partName: [
{
required: true,
message: ' ',
trigger: ['change', 'blur']
}
],
priorityLevel: [
{
required: true,
message: ' ',
trigger: ['change', 'blur']
}
],
requiredDeliveryDate: [
{
required: true,
message: ' ',
trigger: ['change', 'blur']
}
],
testPartNo: [
{
required: true,
message: ' ',
trigger: ['change', 'blur']
}
]
},
enterResultRules: {
actualityDeliveryDate: [
{
required: true,
message: ' ',
trigger: 'change'
}
],
testResultInformation: [
{
required: true,
message: ' ',
trigger: 'change'
}
]
},
submitResultRules: {
actualitySendSamplesDate: [
{
required: true,
message: ' ',
trigger: 'change'
}
],
sendSamplesMethod: [
{
required: true,
message: ' ',
trigger: 'change'
}
]
},
customerResponseRules: {
actualityReplyDate: [
{
required: true,
message: ' ',
trigger: 'change'
}
],
confirmResults: [
{
required: true,
message: ' ',
trigger: 'change'
}
],
confirmBy: [
{
required: true,
message: ' ',
trigger: 'change'
}
]
},
// ======== 复选数据集 ========
testSelections: [],
projectPartListSelections: [],
// ======== 选中的当前行数据 ========
testCurrentRow: {},
// ======== 模态框开关控制 ========
modalFlag: false,
modalDisableFlag: false,
enterResultModalFlag: false,
submitResultModalFlag: false,
customerResponseModalFlag: false,
projectPartModelFlag: false,
// 选择项目弹框开关
chooseProjectListFlag: false,
//项目搜索条件
searchProjectData: {
site: this.$store.state.user.site,
projectId: undefined,
projectName: undefined,
testPartNo: undefined,
customerId: undefined,
},
// 项目集合
projectList: [],
addressModelFlag: false,
contactModelFlag: false,
columnItemList: [
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table2PropertiesItemID',
tableId: "103001Table2",
tableName: "物料属性表",
columnProp: 'propertiesItemNo',
headerAlign: "center",
align: "center",
columnLabel: '属性编码',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table2PropertiesItemDesc',
tableId: "103001Table2",
tableName: "物料属性表",
columnProp: 'itemDesc',
headerAlign: "center",
align: "left",
columnLabel: '属性名称',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 120,
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table2ValueType',
tableId: "103001Table2",
tableName: "物料属性表",
columnProp: 'valueType',
headerAlign: "center",
align: "center",
columnLabel: '属性类型',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 103001,
serialNumber: '103001Table2ValueChooseFlag',
tableId: "103001Table2",
tableName: "物料属性表",
columnProp: 'textValue',
headerAlign: "center",
align: "left",
columnLabel: '属性值',
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 100,
},
],
rejectVisible: false,
rejectOpinion: "",
partPageNo: 1,
partPageSize: 20,
partPageTotal: 0,
superAdmin: false,
}
},
mounted() {
this.$nextTick(() => {
// this.height = window.innerHeight / 2 - 240;
// /*第二个表格高度的动态调整*/
// this.secondHeight = window.innerHeight / 2 - 206;
this.height = window.innerHeight / 2 - 30
/*第二个表格高度的动态调整*/
this.secondHeight = window.innerHeight / 2 - 186
})
this.fetchNodeOptions()
},
created() {
this.handleRouteQuery()
this.checkSuperAdmin()
},
activated() {
this.handleRouteQuery()
},
methods: {
fetchNodeOptions() {
getNodeList(this.searchData).then(({ data }) => {
if (data && data.code === 0) {
this.nodeOptions = data.rows.map(item => ({
id: item.nodeId,
name: item.nodeName
}));
} else {
this.$message.error('获取节点列表失败');
}
}).catch(error => {
this.$message.error('请求失败:' + error);
});
},
// 校验是否为超级管理员
checkSuperAdmin () {
checkSuperAdmin().then(({data}) => {
this.superAdmin = data.superAdmin
})
},
handleRouteQuery() {
if (this.$route.params.type === 'tokenLogin') {
if (this.$route.params.docNo) {
this.searchData.testNo = this.$route.params.docNo
}
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
let params = {
...this.searchData,
createBy: this.$store.state.user.name,
}
testInformationSearch(params).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
this.$refs.selectDiv.setLengthAll(this.dataList.length)
// 判断是否全部存在数据
if (this.totalPage > 0) {
//设置选中行
this.$refs.testTable.setCurrentRow(this.dataList[0])
// 加载当前的页签的table
this.refreshCurrentTabTable()
this.testClickRow(this.dataList[0])
this.updateModal(this.dataList[0])
} else {
//设置选中行
this.$refs.testTable.setCurrentRow({})
// 加载当前的页签的table
this.refreshCurrentTabTable()
this.testClickRow({})
}
}
})
} else if (this.$route.params.testNo) {
this.searchData.testNo = this.$route.params.testNo
this.getDataList()
setTimeout(() => {
this.searchData.testNo = ''
}, 200)
} else {
this.getDataList();
}
},
searchTestPropertiesItem() {
let params = {
site: this.$store.state.user.site,
}
this.copyTestPropertiesList = [];
searchTestPropertiesItem(params).then(({data}) => {
if (data && data.code === 0) {
this.copyTestPropertiesList = data.rows;
} else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error(error)
})
},
// ======== 分页相关方法 ========
/**
* 每页数
* @param val
*/
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
if ( this.isFilterSearch === false){
this.getDataList()
} else {
this.searchByAnyField(this.filterSearchData)
}
},
/**
* 当前页
* @param val
*/
currentChangeHandle(val) {
this.pageIndex = val
if ( this.isFilterSearch === false){
this.getDataList()
} else {
this.searchByAnyField(this.filterSearchData)
}
},
// ======== 复选框操作相关方法 ========
/**
* 选中一行
* @param row
*/
projectPartClickRow(row) {
if (this.modalData.flag === '1' && this.activeTabList.length === 1) {
this.$refs.projectPartTable.clearSelection();
this.$refs.projectPartTable.toggleRowSelection(row);
this.confirmProjectPart();
}
},
/**
* 多选
* @param val
*/
selectionProjectPart(val) {
this.projectPartListSelections = val
},
/**
* 获取唯一值,一般都为 id
* @param row
* @returns {*}
*/
getRowKeys(row) {
return row.testPartNo;
},
// 勾选多选框
selectTestPart(selection, row) {
this.$refs.projectPartTable.clearSelection();
this.$refs.projectPartTable.toggleRowSelection(row, true)
},
selectAllTestPart(selection) {
this.$refs.projectPartTable.clearSelection();
},
/**
* 未知
* @returns {boolean}
*/
selectFlag() {
return true
},
// ======== 页签切换相关方法 ========
/**
* 列表表格选择替换
* @param tab
* @param event
*/
tabClick(tab, event) {
// 刷新列表数据
this.refreshCurrentTabTable()
},
dialogTabClick(tab) {
// if (this.activeTab === 'partAttribute') {
// this.getPartItem(this.modalData.site, this.modalData.testPartNo, 1);
// }
if (tab.name === 'partAttribute') {
this.getPartItem(this.modalData.site, this.modalData.testPartNo, 1);
} else if (tab.name === 'file') {
// 新增:当用户点击“附件信息”页签时触发
this.fileContentLoaded = true;
this.$nextTick(() => {
if (this.$refs.ossRef1 && this.$refs.ossRef1.handleQuery) {
this.$refs.ossRef1.handleQuery();
}
});
}
},
/**
* 当前值发生变化的时候修改
* @param row
* @param oldRow
*/
changeCurrentRow(row, oldRow) {
// 判断是否是获取焦点的事件
if (row) {
this.testCurrentRow = JSON.parse(JSON.stringify(row))
// 刷新当前页表
this.refreshCurrentTabTable()
}
},
getFileContentList() {
let params = {
orderRef1: this.$store.state.user.site,
orderRef2: this.testCurrentRow.testNo
}
getFileContentList(params).then(({data}) => {
if (data && data.code === 0) {
this.testFileList = data.rows;
} else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error(error)
})
},
/**
* 刷新页签的table数据
*/
refreshCurrentTabTable() {
if (this.activeTable === 'test_result') {
this.getTestResult()
} else if (this.activeTable === 'project_information') {
this.getProjectInformation()
} else if (this.activeTable === 'customer_information') {
this.getCustomerInformation()
} else if (this.activeTable === 'test_attribute') {
this.getPartItem(this.testCurrentRow.site, this.testCurrentRow.testPartNo, 2);
}
},
// ======== 列表数据刷新方法 ========
/**
* 获取数据列表
*/
getDataList() {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
let params = {
...this.searchData,
createBy: this.$store.state.user.name,
}
testInformationSearch(params).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
this.$refs.selectDiv.setLengthAll(this.dataList.length)
// 判断是否全部存在数据
if (this.totalPage > 0) {
//设置选中行
this.$refs.testTable.setCurrentRow(this.dataList[0])
// 加载当前的页签的table
this.refreshCurrentTabTable()
this.testClickRow(this.dataList[0])
} else {
//设置选中行
this.$refs.testTable.setCurrentRow({})
// 加载当前的页签的table
this.refreshCurrentTabTable()
this.testClickRow({})
}
}
this.isFilterSearch = false
this.dataListLoading = false
})
},
/**
* 获取测试结果列表
*/
getTestResult() {
let tempData = {
site: this.$store.state.user.site,
testNo: this.testCurrentRow.testNo
}
// 测试结果对象
testResultSearch(tempData).then(({data}) => {
if (data && data.code === 0) {
this.testResultData = data.rows[0]
} else {
this.testResultData = {}
}
})
// 附件列表
this.getFileContentData()
},
/**
* 获取项目信息
*/
getProjectInformation() {
let tempData = {
site: this.$store.state.user.site,
projectId: this.testCurrentRow.projectId
}
// 报价结果对象
getProjectInformation(tempData).then(({data}) => {
if (data && data.code === 0) {
this.projectInformationData = data.rows[0]
} else {
this.projectInformationData = {}
}
})
},
/**
* 获取客户信息
*/
getCustomerInformation() {
let tempData = {
site: this.$store.state.user.site,
customerNo: this.testCurrentRow.customerNo
}
// 报价结果对象
getCustomerInformation(tempData).then(({data}) => {
if (data && data.code === 0) {
this.customerInformationData = data.rows[0]
} else {
this.customerInformationData = {}
}
})
},
// ======== 新增/编辑模态框 ========
/**
* 报价信息新增模态框
*/
addModal() {
this.searchTestPropertiesItem();
this.modalData.customerNoFlag = false
this.modalData.projectIdFlag = true
this.modalData.testPartNoFlag = false
this.projectPartData.projectId = ''
this.searchProjectData.customerId = ''
this.searchProjectData.testPartNo = ''
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* 报价信息编辑模态框
* @param row
*/
async updateModal(row) {
await this.getNodeAuthority(row)
this.modalData = {
flag: '2',
title: '测试申请-' + row.testNo,
site: row.site,
testNo: row.testNo,
customerNo: row.customerNo,
customerDesc: row.customerDesc,
projectId: row.projectId,
projectName: row.projectName,
tracker: row.tracker,
doesNeedArtwork: row.doesNeedArtwork,
artwork: row.artwork,
artworkName: row.artworkName,
doesNeedPlanner: row.doesNeedPlanner,
planner: row.planner,
plannerName: row.plannerName,
trackerName: row.trackerName,
testPartNo: row.testPartNo,
partName: row.partName,
engineer: row.engineer,
printType: row.printType,
productName: row.productName,
engineerName: row.engineerName,
priorityLevel: row.priorityLevel,
testNumber: row.testNumber,
requiredDeliveryDate: row.requiredDeliveryDate,
remark: row.remark,
technicalConsiderations: row.technicalConsiderations,
isNeedToSendSamples: row.isNeedToSendSamples,
sendSamplesAddress: row.sendSamplesAddress,
consignee: row.consignee,
consigneeContact: row.consigneeContact,
actualityDeliveryDate: row.actualityDeliveryDate,
testResultInformation: row.testResultInformation,
actualitySendSamplesDate: row.actualitySendSamplesDate,
sendSamplesMethod: row.sendSamplesMethod,
deliverGoodsInformation: row.deliverGoodsInformation,
deliverGoodsRemark: row.deliverGoodsRemark,
actualityReplyDate: row.actualityReplyDate,
confirmResults: row.confirmResults,
confirmBy: row.confirmBy,
confirmInformation: row.confirmInformation,
testStatus: row.testStatus,
testResultStatus: row.testResultStatus,
nextToDo: row.nextToDo,
updateBy: this.$store.state.user.name,
nodeConclusion: '',
stepId: row.stepId,
rejectFlag: row.rejectFlag,
rejectStepId: row.rejectStepId,
isReject: row.isReject,
nodeId: row.nodeId,
approvalUsername: row.approvalUsername,
soNumber: row.soNumber,
createBy: row.createBy,
}
this.activeTabList = ['product', 'process', 'attribute', 'partAttribute', 'file']
// this.$refs.dialogSoBom.clearTable();
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== 新增/编辑/删除方法 ========
/**
* 获取项目物料列表
*/
getProjectPartList() {
// if (!this.modalData.projectId) {
// this.projectPartList = [];
// return
// }
// 先清空缓存选中
// this.$nextTick(() => this.$refs.projectPartTable.clearSelection())
// 拿到选中的产品编号
let projectPartList = this.modalData.testPartNo.split(';')
if (this.modalData.projectId&&this.modalData.projectId!=='') {
this.projectPartData.projectId = this.modalData.projectId;
}
let params = {
...this.projectPartData,
no: this.partPageNo,
size: this.partPageSize,
}
// 查询所有项目物料
getProjectPartList(params).then(({data}) => {
if (data && data.code === 0) {
this.projectPartList = data.rows
this.partPageTotal = data.total;
this.projectPartList.forEach(val => {
// 回显选中的项目物料
if (projectPartList.includes(val.testPartNo)) {
this.$nextTick(() => this.$refs.projectPartTable.toggleRowSelection(val, true))
}
})
// this.projectPartModelFlag = true
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
/**
* 确认多选项目物料
*/
confirmProjectPart() {
this.modalData.testPartNo = ''
this.modalData.partName = ''
for (let i = 0; i < this.projectPartListSelections.length; i++) {
this.modalData.testPartNo = this.modalData.testPartNo + ";" + this.projectPartListSelections[i].testPartNo
this.modalData.partName = this.modalData.partName + ";" + this.projectPartListSelections[i].partName
}
this.modalData.testPartNo = this.modalData.testPartNo.substring(1)
this.modalData.partName = this.modalData.partName.substring(1)
this.projectPartModelFlag = false
},
/**
* 客户信息新增/编辑
*/
saveData() {
this.$refs.modalForm.validate((valid) => {
if (!valid) {
this.validateDataValue()
} else {
// if (this.projectPartListSelections.length <= 0){
// this.$message.warning('请选择项目料号')
// return
// }
// this.confirmProjectPart();
if (this.modalData.flag === '1') {
this.testSoRoutingList = []
this.testSoBomList = []
this.testFileList = [];
this.testPropertiesList = [];
this.saveTest()
} else {
this.updateTest()
}
}
})
},
validateDataValue() {
if (this.modalData.customerNo === '' || this.modalData.customerNo == null) {
this.$message.warning('请选择客户编码!')
return
}
if (this.modalData.customerDesc === '' || this.modalData.customerDesc == null) {
this.$message.warning('请选择客户名称!')
return
}
// if (this.modalData.tracker === '' || this.modalData.tracker == null) {
// this.$message.warning('请选择Artwork!')
// return
// }
// if (this.modalData.trackerName === '' || this.modalData.trackerName == null) {
// this.$message.warning('请选择Artwork!')
// return
// }
if (this.modalData.projectId === '' || this.modalData.projectId == null) {
this.$message.warning('请选择项目编码!')
return
}
if (this.modalData.projectName === '' || this.modalData.projectName == null) {
this.$message.warning('请选择项目名称!')
return
}
if (this.modalData.engineer === '' || this.modalData.engineer == null) {
this.$message.warning('请选择TP工程师!')
return
}
if (this.modalData.engineerName === '' || this.modalData.engineerName == null) {
this.$message.warning('请选择TP工程师!')
return
}
if (this.modalData.testPartNo === '' || this.modalData.testPartNo == null) {
this.$message.warning('请选择项目料号!')
return
}
if (this.modalData.partName === '' || this.modalData.partName == null) {
this.$message.warning('请选择物料名称!')
return
}
if (this.modalData.priorityLevel === '' || this.modalData.priorityLevel == null) {
this.$message.warning('请选择优先等级!')
return
}
if (!this.modalData.testNumber) {
this.$message.warning('请输入正确的测试数量!')
return
}
if (this.modalData.requiredDeliveryDate === '' || this.modalData.requiredDeliveryDate == null) {
this.$message.warning('请输入要求交付日期!')
return
}
},
saveTest() {
testInformationSave(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.searchData.testNo = data.testNo
this.modalData.testNo = data.testNo;
this.getDataList();
this.activeTabList = ['product', 'process', 'attribute', 'partAttribute', 'file']
this.activeTab = 'attribute'
// this.modalFlag = false
this.getTestProperties();
this.$message.success("操作成功")
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
updateTest() {
testInformationEdit(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
/**
* 测试信息删除
*/
delModal() {
if (this.testSelections.length === 0) {
this.$message.warning('请勾选要删除的测试信息!')
return
}
for (let i = 0; i < this.testSelections.length; i++) {
let row = this.testSelections[i]
if (row.testStatus !== '草稿') {
this.$message.warning(row.testNo + "不是草稿状态,不能删除!")
return
}
}
this.$confirm(`是否删除这 ` + this.testSelections.length + ` 条测试信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let tempData = {
informationList: this.testSelections
}
testInformationDelete(tempData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.testSelections = []
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
// ======== 列表操作方法 ========
/**
* 单机选中测试信息
* @param row
*/
testClickRow(row) {
// this.$refs.testTable.toggleRowSelection(row)
this.testCurrentRow = JSON.parse(JSON.stringify(row))
this.testDetailData = JSON.parse(JSON.stringify(row))
// 刷新组件
this.clickTestRow = false;
this.clickTestRow = true;
if (row) {
this.selectTestSoBom()
this.selectTestSoRoutingList()
this.getPartPropertiesList();
this.getTestProperties();
this.getFileContentList()
}
this.getApprovalList()
},
/**
* 复选报价信息
* @param val
*/
selectionTest(val) {
this.testSelections = val
this.$refs.selectDiv.setLengthselected(this.testSelections.length)
},
// ======== 报价结果相关方法 ========
/**
* 封装录入方法
*/
packTestResultModal() {
// 重置对象
this.enterResultData = {
site: this.$store.state.user.site,
testNo: '',
actualityDeliveryDate: new Date(),
testResultInformation: '',
testResultStatus: 'E',
fileContentList: [],
updateBy: this.$store.state.user.name
}
this.enterResultData.testNo = this.testCurrentRow.testNo
// // 获得这些测试号的全部附件
// this.getFileContentList()
this.enterResultModalFlag = true
},
/**
* 录入测试结果
*/
testResultModal() {
this.packTestResultModal()
},
/**
* 保存测试结果
*/
saveTestResult() {
if (this.enterResultData.actualityDeliveryDate === '' || this.enterResultData.actualityDeliveryDate == null) {
this.$message.warning('请选择实际交付日期!')
return
}
if (this.enterResultData.testResultInformation === '' || this.enterResultData.testResultInformation == null) {
this.$message.warning('请填写测试结果信息!')
return
}
saveTestResult(this.enterResultData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.enterResultModalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
/**
* 封装送样方法
*/
packSubmitTestModal() {
this.submitResultData = {
site: this.$store.state.user.site,
testNo: '',
actualitySendSamplesDate: new Date(),
sendSamplesMethod: '',
deliverGoodsInformation: '',
deliverGoodsRemark: '',
testResultStatus: 'S',
updateBy: this.$store.state.user.name,
}
// 获得选中的测试号
this.submitResultData.testNo = this.testCurrentRow.testNo
this.submitResultModalFlag = true
},
/**
* 提交送样信息
*/
submitTestModal() {
this.packSubmitTestModal()
},
/**
* 保存送样结果
*/
saveSubmitResult() {
if (this.submitResultData.actualitySendSamplesDate === '' || this.submitResultData.actualitySendSamplesDate == null) {
this.$message.warning('请选择实际送样日期!')
return
}
if (this.submitResultData.sendSamplesMethod === '' || this.submitResultData.sendSamplesMethod == null) {
this.$message.warning('请选择送样方式!')
return
}
saveSubmitResult(this.submitResultData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.submitResultModalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
/**
* 封装回复方法
*/
packCustomerResponseModal() {
this.customerResponseData = {
site: this.$store.state.user.site,
testNo: '',
actualityReplyDate: new Date(),
confirmResults: '接受',
confirmBy: '',
confirmInformation: '',
testResultStatus: 'R',
updateBy: this.$store.state.user.name
}
// 获得选中的测试号
this.customerResponseData.testNo = this.testCurrentRow.testNo
this.customerResponseModalFlag = true
},
/**
* 客户回复
*/
customerResponseModal() {
this.packCustomerResponseModal()
},
/**
* 保存客户回复
*/
saveCustomerResponse() {
if (this.customerResponseData.actualityReplyDate === '' || this.customerResponseData.actualityReplyDate == null) {
this.$message.warning('请选择实际回复日期!')
return
}
if (this.customerResponseData.confirmResults === '' || this.customerResponseData.confirmResults == null) {
this.$message.warning('请选择客户确认结果!')
return
}
if (this.customerResponseData.confirmBy === '' || this.customerResponseData.confirmBy == null) {
this.$message.warning('请填写客户确认人!')
return
}
saveCustomerResponse(this.customerResponseData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.customerResponseModalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
// ======== 报价单附件的相关方法 ========
/**
* 获取报价单附件列表
*/
getFileContentData() {
let currentData = {
orderRef1: this.$store.state.user.site,
orderRef2: this.testCurrentRow.testNo
}
getFileContentList(currentData).then(({data}) => {
if (data && data.code === 0) {
this.fileContentList = data.rows
} else {
this.fileContentList = []
}
})
},
/**
* 上传文件
*/
uploadFile() {
let currentData = {
titleCon: '测试附件上传',
site: this.$store.state.user.site,
createBy: this.$store.state.user.name,
testNo: this.enterResultData.testNo,
fileRemark: '',
folder: 'testFile'
}
//打开组件 去做新增业务
this.$nextTick(() => {
this.$refs.testUploadFile.init(currentData)
})
},
/**
* 文件删除
* @param row
*/
deleteFile(row) {
this.$confirm('确定要删除此文件?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteTestFile(row).then(({data}) => {
if (data && data.code === 0) {
this.getFileContentList()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
/**
* 文件下载
* @param row
*/
downloadFile(row) {
downLoadQuotationFile(row).then(({data}) => {
// 不限制文件下载类型
const blob = new Blob([data], {type: 'application/octet-stream;charset=utf-8'})
// 下载文件名称
const fileName = row.fileName
// a标签下载
const linkNode = document.createElement('a')
linkNode.download = fileName // a标签的download属性规定下载文件的名称
linkNode.style.display = 'none'
linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
document.body.appendChild(linkNode)
linkNode.click() // 模拟在按钮上的一次鼠标单击
URL.revokeObjectURL(linkNode.href) // 释放URL 对象
document.body.removeChild(linkNode)
})
},
/**
* 获取该客户的客户地址
*/
getCustomerAddressList() {
let tempData = {
site: this.$store.state.user.site,
customerNo: this.modalData.customerNo,
addressType: 'A'
}
customerAddressSearch(tempData).then(({data}) => {
if (data && data.code === 0) {
this.addressList = data.rows
this.addressModelFlag = true
} else {
this.addressList = []
}
})
},
// 双击选择负责人
getAddressData(row) {
this.modalData.sendSamplesAddress = row.addressName
this.addressModelFlag = false
},
/**
* 获取该客户的客户负责人
*/
getCustomerContactList() {
let tempData = {
site: this.$store.state.user.site,
customerNo: this.modalData.customerNo
}
customerContactSearch(tempData).then(({data}) => {
if (data && data.code === 0) {
this.contactList = data.rows
this.contactModelFlag = true
} else {
this.contactList = []
}
})
},
// 双击选择负责人
getContactData(row) {
this.modalData.consignee = row.contactName
this.modalData.consigneeContact = row.contactPhoneNumber1
this.contactModelFlag = false
},
// ======== chooseList相关方法 ========
/**
* 获取基础数据列表S
* @param val
* @param type
*/
getBaseList(val, type) {
this.tagNo = val
this.tagNo1 = type
this.$nextTick(() => {
let strVal = ''
let conSql = ''
if (val === 102) {
if (type === 1) {
strVal = this.modalData.customerNo
}
}
// if (val === 103) {
// if(type === 1) {
// strVal = this.modalData.tracker
// }
// if(type === 2) {
// strVal = this.modalData.engineer
// }
// }
if (val === 104) {
if (type === 1) {
strVal = this.modalData.projectId
}
}
if (val === 2041) {
strVal = this.modalData.trackerName
conSql = " and b.site = '" + this.$store.state.user.site + "'"
}
if (val === 2042) {
strVal = this.modalData.engineerName
conSql = " and b.site = '" + this.$store.state.user.site + "'"
}
if (val === 2007) {
strVal = this.modalData.artworkName
conSql = " and b.site = '" + this.$store.state.user.site + "'"
}
if (val === 2008) {
strVal = this.modalData.plannerName
conSql = " and b.site = '" + this.$store.state.user.site + "'"
}
this.$refs.baseList.init(val, strVal, conSql)
})
},
/**
* 列表方法的回调
* @param val
*/
getBaseData(val) {
if (this.tagNo === 102) {
if (this.tagNo1 === 1) {
if (val.Customer_no === this.modalData.customerNo) {
return
}
if (this.modalData.projectIdFlag&&!this.modalData.testPartNoFlag){
// 料号、项目、客户都没选时选客户
this.modalData.testPartNoFlag = true
this.modalData.projectIdFlag = false
} else if (!this.modalData.projectIdFlag&&this.modalData.testPartNoFlag){
// 选了客户没选项目和料号时选客户
} else if (!this.modalData.projectIdFlag&&!this.modalData.testPartNoFlag){
// 选了客户和料号时选客户
}
this.modalData.customerNo = val.Customer_no
this.modalData.customerDesc = val.Customer_desc
this.modalData.projectId = ''
this.modalData.projectName = ''
this.projectPartList = [];
}
}
// if (this.tagNo === 103) {
// if(this.tagNo1 === 1) {
// this.modalData.tracker = val.username
// this.modalData.trackerName = val.user_display
// }
// if(this.tagNo1 === 2) {
// this.modalData.engineer = val.username
// this.modalData.engineerName = val.user_display
// }
// }
if (this.tagNo === 104) {
if (this.tagNo1 === 1) {
this.modalData.projectId = val.project_id
this.modalData.projectName = val.project_name
this.getProjectPartList();
}
}
if (this.tagNo === 2041) {
this.modalData.tracker = val.username
this.modalData.trackerName = val.user_display
}
if (this.tagNo === 2042) {
this.modalData.engineer = val.username
this.modalData.engineerName = val.user_display
}
if (this.tagNo === 2007) {
this.modalData.artwork = val.username;
this.modalData.artworkName = val.user_display;
}
if (this.tagNo === 2008) {
this.modalData.planner = val.username;
this.modalData.plannerName = val.user_display;
}
},
// ======== 导出相关方法 ========
/**
* 导出excel
*/
async createExportData() {
this.searchData.limit = -1
this.searchData.page = 1
await testInformationSearch(this.searchData).then(({data}) => {
this.resultList = data.page.list
})
return this.resultList
},
startDownload() {
},
finishDownload() {
},
fields() {
let json = '{'
this.columnList.forEach((item, index) => {
if (index == this.columnList.length - 1) {
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
} else {
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
}
})
json += '}'
let s = eval('(' + json + ')')
return s
},
closeModalDiaLog() {
this.$refs.modalForm.resetFields();
this.modalData = {
flag: '1',
title: '测试申请',
site: this.$store.state.user.site,
testNo: '',
customerNo: '',
customerDesc: '',
projectId: '',
doesNeedArtwork: '',
artwork: '',
artworkName: '',
doesNeedPlanner: '',
planner: '',
plannerName: '',
projectName: '',
tracker: '',
trackerName: '',
testPartNo: '',
partName: '',
engineer: '',
engineerName: '',
printType: '',
productName: '',
priorityLevel: '',
testNumber: 1,
requiredDeliveryDate: '',
remark: '',
technicalConsiderations: '',
isNeedToSendSamples: '',
sendSamplesAddress: '',
consignee: '',
consigneeContact: '',
actualityDeliveryDate: '',
testResultInformation: '',
actualitySendSamplesDate: '',
sendSamplesMethod: '',
deliverGoodsInformation: '',
deliverGoodsRemark: '',
actualityReplyDate: '',
confirmResults: '',
confirmBy: '',
confirmInformation: '',
testStatus: '草稿',
testResultStatus: 'B',
nextToDo: '',
createDate: '',
createBy: this.$store.state.user.name,
updateDate: '',
updateBy: '',
nodeId: ''
}
this.activeTab = 'attribute';
this.activeTabList = ['attribute']
this.dialogProperties = [];
// this.testPropertiesList = this.copyTestPropertiesList;
this.copyTestPropertiesList = [];
this.$refs.ossRef2.handleQuery()
},
closeDialog() {
this.modalFlag = false
this.$refs.ossRef2.handleQuery()
},
checkSelectable(row, index) {
if (this.modalData.flag === '1' && this.activeTabList.length === 1) {
return true
} else {
return false
}
},
projectClickRow(row) {
this.modalData.projectId = row.projectId
this.modalData.projectName = row.projectName
if (this.modalData.testPartNoFlag&&!this.modalData.customerNoFlag){
// 选了客户没选项目时选项目
this.modalData.testPartNoFlag = false
} else if (!this.modalData.testPartNoFlag&&!this.modalData.customerNoFlag){
// 选了客户选了项目时选项目
// this.modalData.testPartNoFlag = false
} else if (!this.modalData.testPartNoFlag&&this.modalData.customerNoFlag){
// 选了料号没选客户时选项目
this.modalData.customerNoFlag = false
}
if (this.modalData.customerNo&&this.modalData.customerNo!==''){
this.getProjectPartList()
} else {
this.modalData.customerNo = row.customerId
this.modalData.customerDesc = row.customerName
}
this.chooseProjectListFlag = false
},
// 查询searchProjectInfoList
searchProjectInfoList() {
this.projectList = [];
if (this.modalData.customerNo&&this.modalData.customerNo!==''){
this.searchProjectData.customerId = this.modalData.customerNo
} else {
this.searchProjectData.testPartNo = this.modalData.testPartNo
}
searchProjectInfoList(this.searchProjectData).then(({data}) => {
if (data && data.code === 0) {
this.projectList = data.rows
if (!this.modalData.customerNo||this.modalData.customerNo===''){
this.modalData.projectId = data.rows[0].projectId
this.modalData.projectName = data.rows[0].projectName
this.modalData.customerNo = data.rows[0].customerId
this.modalData.customerDesc = data.rows[0].customerName
}
} else {
this.projectList = []
}
}).catch((error) => {
this.$message.error('查询项目信息失败')
})
},
closeProjectInfoDialog() {
this.$refs.closeProjectInfoForm.resetFields();
this.searchProjectData = {
site: this.$store.state.user.site,
projectId: undefined,
projectName: undefined,
customerId: undefined,
}
},
rowStyle({row}) {
if (this.testCurrentRow.testNo === row.testNo) {
return {'background-color': '#E8F7F6', cursor: 'pointer'};
}
},
selectTestSoBom() {
if (!this.modalData.testNo && !this.testCurrentRow.testNo) {
this.testSoBomList = []
return
}
let params = {
testNo: this.modalData.testNo ? this.modalData.testNo : this.testCurrentRow.testNo,
site: this.$store.state.user.site
}
selectTestSoBom(params).then(({data}) => {
if (data && data.code === 0) {
this.testSoBomList = data.rows
}
})
},
selectTestSoRoutingList() {
if (!this.modalData.testNo && !this.testCurrentRow.testNo) {
this.testSoRoutingList = []
return
}
let params = {
site: this.$store.state.user.site,
testNo: this.modalData.testNo ? this.modalData.testNo : this.testCurrentRow.testNo,
}
selectTestSoRoutingList(params).then(({data}) => {
if (data && data.code === 0) {
this.testSoRoutingList = data.rows
}
})
},
getTestProperties() {
let params = {
site: this.$store.state.user.site,
testNo: this.testCurrentRow.testNo
}
getTestPropertiesList(params).then(({data}) => {
if (data && data.code === 0) {
this.testPropertiesList = data.rows;
if (this.modalFlag) {
this.copyTestPropertiesList = data.rows;
}
} else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error(error)
})
},
getPartPropertiesList() {
let params = {
site: this.$store.state.user.site,
testPartNo: this.testCurrentRow.testPartNo
}
this.dialogProperties = [];
partPropertiesList(params).then(({data}) => {
if (data && data.code === 0) {
if (this.modalData.flag !== '1') {
this.dialogProperties = data.rows
}
this.attributeList = data.rows
} else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error(error)
})
},
updateModalStatus(row, status) {
this.$confirm(`是否确认下达?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = JSON.parse(JSON.stringify(row))
params.testResultStatus = status
params.testStatus = '下达'
params.userName = this.$store.state.user.name
params.menuId = this.$route.meta.menuId
testInformationEditStatus(params).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.$message.success('测试单已下达')
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
})
},
partClickRow(row) {
this.modalData.testPartNo = row.testPartNo
this.modalData.partName = row.partDesc
this.dialogProperties = [];
let params = {
site: this.$store.state.user.site,
testPartNo: this.modalData.testPartNo
}
partPropertiesList(params).then(({data}) => {
if (data && data.code === 0) {
this.dialogProperties = data.rows
if (this.modalData.projectIdFlag&&!this.modalData.customerNoFlag){
// 料号、客户、项目都没选时选料号
this.modalData.customerNoFlag = false
this.modalData.projectIdFlag = false
this.searchProjectInfoList()
} else if (!this.modalData.projectIdFlag&&this.modalData.customerNoFlag){
// 选了料号没选项目和客户时选料号
} else if (!this.modalData.projectIdFlag&&!this.modalData.customerNoFlag){
// 客户和项目都选了时选料号
}
} else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error(error)
})
this.projectPartModelFlag = false
},
// 同意提交
agreeSubmit() {
this.$confirm(`是否确认提交?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.modalData.nodeConclusion = 'Y'
this.submitData()
})
},
// 驳回提交
rejectSubmit() {
this.$confirm(`是否确认驳回?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.modalData.rejectOpinion = this.rejectOpinion
this.modalData.nodeConclusion = 'N'
this.submitData()
})
},
// 提交
submitData() {
if (this.plmTestInformationArr) {
for (let i = 0; i < this.plmTestInformationArr.length; i++) {
if (!this.modalData[this.plmTestInformationArr[i].fieldId] && this.plmTestInformationArr[i].required === 'Y') {
this.$message.warning(this.plmTestInformationArr[i].fieldName + '不能为空!')
return
}
}
}
this.modalData.userName = this.$store.state.user.name
this.modalData.menuId = this.$route.meta.menuId
submitChange(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.$message({message: '操作成功', type: 'success'})
this.rejectVisible = false
this.submitModalFlag = false
this.modalFlag = false
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
// 获取流程的配置权限
async getNodeAuthority(row) {
let tempData = {
site: row.site,
stepId: row.stepId,
menuId: this.$route.meta.menuId
}
await getNodeAuthority(tempData).then(({data}) => {
if (data && data.code === 0) {
this.plmTestInformationArr = data.rows.plm_test_information
}
})
},
getPartItem(site, partNo, type) {
let tempData = {
site: site,
partNo: partNo,
recordType: 'IP'
}
getPartItemWithPartNo(tempData).then(({data}) => {
if (data && data.code === 0) {
if (type == 1) {
this.partItemList1 = data.rows
} else {
this.partItemList2 = data.rows
}
} else {
if (type == 1) {
this.partItemList1 = []
} else {
this.partItemList2 = []
}
}
})
},
handleQueryCustomer() {
let params = {
site: this.$store.state.user.site,
customerNo: this.modalData.customerNo
}
queryCustomer(params).then(({data}) => {
if (data && data.code === 0) {
if (data.rows && data.rows.length === 1) {
this.modalData.customerDesc = data.rows[0].customerDesc
} else {
this.modalData.customerDesc = ''
}
} else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error(error)
})
},
handleQueryProjectByCustomer() {
let params = {
site: this.$store.state.user.site,
customerId: this.modalData.customerNo,
projectId: this.modalData.projectId
}
queryProjectByCustomer(params).then(({data}) => {
if (data && data.code === 0) {
if (data.rows && data.rows.length === 1) {
this.modalData.projectName = data.rows[0].projectName
} else {
this.modalData.projectName = ''
}
} else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error(error)
})
},
handleQueryProjectPart() {
let params = {
site: this.$store.state.user.site,
projectId: this.modalData.projectId,
testPartNo: this.modalData.testPartNo
}
queryProjectPart(params).then(({data}) => {
if (data && data.code === 0) {
if (data.rows && data.rows.length === 1) {
this.modalData.partName = data.rows[0].partDesc
} else {
this.modalData.partName = ''
}
} else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error(error)
})
},
handleDetail(row) {
this.detailFlag = true
this.updateModal(row)
},
// 查询审批信息
getApprovalList() {
let tempData = {
site: this.$store.state.user.site,
menuId: this.$route.meta.menuId,
documentNo: this.testCurrentRow.testNo,
}
getApprovalList(tempData).then(({data}) => {
if (data && data.code === 0) {
this.approvalList = data.rows
} else {
this.approvalList = []
}
})
},
clearModalData(field) {
this.modalData[field] = ''
},
partPageSizeChange(val) {
this.partPageSize = val
this.getProjectPartList();
},
partPageCurrentChange(val) {
this.partPageNo = val
this.getProjectPartList();
},
handleClickBM(row) {
if (this.$router.resolve('sampleManagement-technicalSpecificationList').resolved.name === '404') {
this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
} else {
this.$emit('close')
let params = {
name: "sampleManagement-technicalSpecificationList",
params: {
type: 'test',
testPartNo: row.testPartNo,
buNo: row.buNo
}
}
this.$router.push(params)
}
},
searchByAnyField(params){
params.site = this.$store.state.user.site
params.menuId = '107001'
params.no = this.pageIndex
params.size = this.pageSize
params.userId = this.$store.state.user.id.toString()
params.userName = this.$store.state.user.name
testInformationSearchAny(params).then(({data})=>{
if (data && data.code === 0){
this.dataList = data.page.list
this.totalPage = data.page.totalCount
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
this.filterSearchData = params
this.isFilterSearch = true
this.filterVisible = false
},
},
}
</script>
<style scoped lang="scss">
/deep/ .customer-tab .el-tabs__content {
padding: 0px !important;
height: 459px;
}
.right /deep/ .el-input__inner {
text-align: right;
}
/deep/ .inlineNumber input::-webkit-outer-spin-button,
/deep/ .inlineNumber input::-webkit-inner-spin-button {
-webkit-appearance: none;
}
/deep/ .inlineNumber input[type="number"] {
-moz-appearance: textfield;
padding-right: 5px !important;
}
/deep/ .el-table .cellClass .cell .el-checkbox__inner {
display: none;
position: relative;
}
/deep/ .el-table .cellClass .cell:before {
content: "";
position: absolute;
}
.auto /deep/ .el-form-item__content {
height: auto;
line-height: 1.5;
}
</style>