请详细分析下面代码:<template>
<div>
<a-form-model ref="formRef" :model="searchData" :rules="rules" >
<a-card style="margin-top: 20px" title="Applicant Information">
<a-row>
<a-col :span="12">
<a-form-model-item prop="caseNo" label="Case NO:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" :required='required'>
<a-input v-model="searchData.caseNo" :disabled="disabled" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="status" label="Status:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" :required='required'>
<a-input v-model="searchData.status" :disabled="disabled" />
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12" v-if="false">
<a-form-model-item prop="applicant" label="Applicant:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" :required='required'>
<a-input v-model="searchData.applicant" :disabled="disabled" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="applicantName" label="Applicant:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" :required='required'>
<a-textarea v-model="searchData.applicantName" :disabled="disabled" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="orgDescription" label="Org Description:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" :required='required'>
<a-textarea v-model="searchData.orgDescription" :disabled="disabled" />
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item prop="createTime" label="Create Date:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }"
:required='required'>
<a-input v-model="searchData.createTime" :disabled="disabled" />
</a-form-model-item>
</a-col>
</a-row>
</a-card>
<a-card style="margin-top: 20px" title="Base Information">
<a-row>
<a-col :span="12">
<a-form-model-item prop="caseType" label="Case Type:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 14, offset: 2 }" :required ='required'>
<a-radio-group v-model="searchData.caseType" @change="caseTypeChange" :disabled="signCaseVo.jyStatus!='Applicant'">
<a-radio :value="1">out</a-radio>
<a-radio :value="0">inner</a-radio>
</a-radio-group>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="realFabBu" label="Real Fab Bu:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" >
<a-select placeholder="请选择" v-model="searchData.realFabBu" style="width: 100%" :disabled="signCaseVo.jyStatus!='Applicant'">
<a-select-option v-for="item in fabList" :key="item">{{ item }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item prop="changeStatus" label="Change Status:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 14, offset: 2 }" :required ='required'>
<a-radio-group v-model="searchData.changeStatus" @change="changeStatusChange" :disabled="signCaseVo.jyStatus!='Applicant'">
<a-radio :value="1">yes</a-radio>
<a-radio :value="0">no</a-radio>
</a-radio-group>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="changeCode" label="Change Code:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" >
<a-select placeholder="请选择" v-model="searchData.changeCode" style="width: 100%" :disabled="signCaseVo.jyStatus!='Applicant'">
<a-select-option v-for="item in fabList" :key="item">{{ item }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item prop="flowType" label="Flow Type:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" :required='required'>
<a-select placeholder="请选择" v-model="searchData.flowType" style="width: 100%" :disabled="signCaseVo.jyStatus!='Applicant'">
<a-select-option :value="0">Normal</a-select-option>
<a-select-option :value="1">Urgent</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="equipmentType" label="Equipment Type:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" :required='required'>
<a-select placeholder="请选择" v-model="searchData.equipmentType" style="width: 100%" :disabled="signCaseVo.jyStatus!='Applicant'">
<a-select-option v-for="item in equipmentTypeList" :key="item">{{ item }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item prop="expectTime" label="Expect Time:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }"
:required='required'>
<a-date-picker type="date" valueFormat="YYYY-MM-DD HH:mm:ss" v-model="searchData.expectTime" :disabled="signCaseVo.jyStatus!='Applicant'"
:show-time="{ defaultValue: moment('00:00:00', 'HH:mm:ss') }"/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="expectUsageHours" label="Expect Usage Hours:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }"
:required='required'>
<a-input v-model="searchData.expectUsageHours" type="number" :disabled="signCaseVo.jyStatus!='Applicant'"/>
</a-form-model-item>
</a-col>
</a-row>
<a-row >
<a-col :span="12">
<a-form-model-item prop="purposeCode" label="Purpose Code:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }"
:required='required'>
<a-select placeholder="请选择" v-model="searchData.purposeCode" style="width: 100%" @change="actionChange" :disabled="signCaseVo.jyStatus!='Applicant'">
<a-select-option v-for="item in purposeCodeList" :key="item">{{ item }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<a-row v-if="isShow2">
<a-col :span="12">
<a-form-model-item prop="projectCode" label="Project Code:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }"
:required='required'>
<a-input v-model="searchData.projectCode" :disabled="signCaseVo.jyStatus!='Applicant'||disabled2"/>
<a-button @click="checkCode()" :disabled="signCaseVo.jyStatus!='Applicant'">check</a-button>
<a-button @click="resetCode()" :disabled="signCaseVo.jyStatus!='Applicant'">reset</a-button>
</a-form-model-item>
</a-col>
</a-row>
<a-row v-if="isShow2">
<a-col :span="12">
<a-form-model-item prop="projectName" label="project name" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }"
:required='required'>
<a-input v-model="searchData.projectName" :disabled="disabled" />
</a-form-model-item>
</a-col>
</a-row>
<a-row v-if="isShow">
<a-row v-for="(lot, index) in searchData.lotList" :key="index" >
<a-col :span="12">
<a-form-model-item :prop="`lotList.${index}.lotId`" label="lotId" :labelCol="{ span: 6 }" :wrapperCol="{span: 12,offset: 2 }"
:rules="[{ required: true, message: 'lotId is required', trigger: 'change' }]">
<a-input v-model="lot.lotId" :disabled="signCaseVo.jyStatus!='Applicant'"
type="String"
@blur="lotBlur(lot.lotId,index)"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="operation" :labelCol="{ span: 6 }" :wrapperCol="{span: 12,offset: 2 }">
<a-button @click="deleteItem(searchData.lotList, index)" :disabled="signCaseVo.jyStatus!='Applicant'" >Delete {{lot.lotId}}</a-button>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item :prop="`lotList.${index}.vendorId`" label="vendorId" :labelCol="{ span: 6 }" :wrapperCol="{span: 12,offset: 2 }">
<a-input v-model="lot.vendorId" type="String" :disabled="signCaseVo.jyStatus!='Applicant'" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item :prop="`lotList.${index}.waferId`" label="waferId" :labelCol="{ span: 6 }" :wrapperCol="{span: 16,offset: 2 }">
<a-input v-model="lot.waferId" :disabled="signCaseVo.jyStatus!='Applicant'" type="String" @click="cliWaferID(index)" @keydown.prevent />
</a-form-model-item>
</a-col>
</a-row>
<a-row class="form-row" >
<a-col :span="12">
<a-form-model-item :wrapperCol="{span: 12,offset: 8 }">
<a-button @click="addLotList(searchData.lotList)" :disabled="signCaseVo.jyStatus!='Applicant'">
AddLot
</a-button>
</a-form-model-item>
</a-col>
</a-row>
</a-row>
<a-row v-if="isShow">
<a-col :span="12">
<a-form-model-item prop="po" label="PO/Electronic/E-mail:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }">
<a-input v-model="searchData.po" :disabled="signCaseVo.jyStatus!='Applicant'"/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="customerRequester" label="Customer Requester:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }">
<a-input v-model="searchData.customerRequester" :disabled="signCaseVo.jyStatus!='Applicant'"/>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-model-item prop="borrowPurpose" label="Borrow Purpose:" :labelCol="{ span: 3 }" :wrapperCol="{ span: 6, offset: 1 }"
:required='required'>
<a-textarea v-model="searchData.borrowPurpose" placeholder="borrowPurpose" :rows="8" :disabled="signCaseVo.jyStatus!='Applicant'"/>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item prop="targetEquipmentId" label="Target Equipment ID:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }"
:required='required'>
<a-input v-model="searchData.targetEquipmentId" :disabled="signCaseVo.jyStatus!='Applicant'"/>
</a-form-model-item>
</a-col>
</a-row>
</a-card>
<a-card style="margin-top: 20px" title="Testing Plant Frame/MPC Confirm"
v-if="signCaseVo.jyStatus=='MPC'||signCaseVo.jyStatus=='LineSuper'||signCaseVo.jyStatus=='SuperClose'||signCaseVo.jyStatus=='Close'||signCaseVo.jyStatus=='Cancel'"
>
<a-row>
<a-col :span="12">
<a-form-model-item prop="executeTime" label="Permit Execute Time:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" :required ='required'>
<a-date-picker placeholder="具体借机时间" type="date" valueFormat="YYYY-MM-DD HH:mm:ss" v-model="searchData.executeTime" :disabled="signCaseVo.jyStatus!='MPC'"
:show-time="{ defaultValue: moment('00:00:00', 'HH:mm:ss') }"/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="executeHours" label="Permit Execute Hours:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" :required='required'>
<a-input placeholder="具体使用多久(整数)" v-model="searchData.executeHours" :disabled="signCaseVo.jyStatus!='MPC'"/>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item prop="planEquipmentId" label="Plan Equipment ID:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" :required='required'>
<a-input placeholder="计划借机机台号" v-model="searchData.planEquipmentId" :disabled="signCaseVo.jyStatus!='MPC'"/>
</a-form-model-item>
</a-col>
</a-row>
</a-card>
<a-card style="margin-top: 20px" title="Line Leader Plant Frame"
v-if="signCaseVo.jyStatus=='LineSuper'||signCaseVo.jyStatus=='SuperClose'||signCaseVo.jyStatus=='Close'||signCaseVo.jyStatus=='Cancel'"
>
<a-row>
<a-col :span="12">
<a-form-model-item prop="realEquipmentId" label="Real Equipment ID:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" :required ='required'>
<a-input placeholder="实际使用机台号" v-model="searchData.realEquipmentId" :disabled="signCaseVo.jyStatus!='LineSuper'"/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="setUpTime" label="Set Up Time:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" :required='required'>
<a-date-picker placeholder="开始时间" type="date" valueFormat="YYYY-MM-DD HH:mm:ss" v-model="searchData.setUpTime" :disabled="signCaseVo.jyStatus!='LineSuper'"
:show-time="{ defaultValue: moment('00:00:00', 'HH:mm:ss') }"/>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item prop="setOffTime" label="Set Off Time:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" >
<a-date-picker placeholder="结束时间" type="date" valueFormat="YYYY-MM-DD HH:mm:ss" v-model="searchData.setOffTime"
:show-time="{ defaultValue: moment('00:00:00', 'HH:mm:ss') }" :disabled="signCaseVo.jyStatus!='SuperClose'" @change="changeSetOffTime"/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="borrowHours" label="Machine Borrow Hours:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" >
<a-input placeholder="实际借用时间" v-model="searchData.borrowHours" :disabled="true" />
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item prop="checkStatus" label="TMPG Status/Check Items 1:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" >
<a-checkbox v-model="searchData.checkStatus" :disabled="signCaseVo.jyStatus!='SuperClose'">还机时机台/硬件MES状态正常</a-checkbox>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item prop="returnToTmpgStatus" label="TMPG Status/Check Items 2:" :labelCol="{ span: 6 }" :wrapperCol="{ span: 12, offset: 2 }" >
<a-checkbox v-model="searchData.returnToTmpgStatus" :disabled="signCaseVo.jyStatus!='SuperClose'">还机时机台内无物料</a-checkbox>
</a-form-model-item>
</a-col>
</a-row>
</a-card>
<a-card style="margin-top: 20px" title="File Information" v-if="this.$route.query.id">
<a-row>
<a-col :span="12" >
<a-upload
:show-upload-list="false"
:before-upload="(file) => beforeUpload2(file, text)"
>
<a-button :disabled="signCaseVo.jyStatus!='Applicant'"> 添加文件 </a-button>
</a-upload>
</a-col>
</a-row>
<a-table class="ttable" :columns="columns4" :data-source="fileLists" :pagination="false" :rowKey="
(record, index) => {
return index;
}
" :locale="{ emptyText: '暂无数据' }" @change="handleTableChange">
<span slot="delete" slot-scope="text" >
<a @click="deleteList(text)" :disabled="signCaseVo.jyStatus!='Applicant'">Delete</a>
</span>
<span slot="download" slot-scope="text">
<a @click="downloadList(text)">Download</a>
</span>
</a-table>
</a-card>
<a-card style="margin-top: 20px" title="Signoff">
<a-row>
<a-row>
<a-col :span="24">
<a-form-item
label="Comment"
:labelCol="{ span: 3 }"
:wrapperCol="{ span: 12, offset: 1 }"
>
<a-textarea
style="width: 100%; height: 160px"
:maxLength=500
v-model="signCaseVo.comment"
></a-textarea>
</a-form-item>
</a-col>
</a-row>
<a-row style="margin-top: 20px" justify="center" type="flex">
<template v-for="item of signCaseVo.actionNames">
<a-button
style="
margin-right: 80px;
border-radius: 8px;
font-weight: bolder;
"
:key="item"
@click="signOff"
v-bind:disabled="
signCaseVo.comment && signCaseVo.comment.trim() != ''
? false
: true
"
:data-type="item"
>
{{ item }}
</a-button>
</template>
</a-row>
</a-row>
</a-card>
<a-card style="margin-top: 20px" title="审批意见" class="colora">
<a-table
class="ttable"
:columns="columns1"
:data-source="signOffHistory"
:pagination="false"
:rowKey="
(record, index) => {
return index;
}
"
:locale="{ emptyText: ' ' }"
>
<span slot="creator" slot-scope="text, value">
<a @click="toAddressBook(text, value)">{{text}}</a>
</span>
</a-table>
</a-card>
</a-form-model>
<a-modal :width="900" v-model="WaferIDNumber" v-drag-modal title="Wafer List">
<a-input style="display: none;" v-model="this.indexFlag" />
<a-row>
<a-col :span="6">
<a-checkbox v-model="isChecked" value="all" @change="checkboxAll" style="color: black; font-weight: 600">all</a-checkbox>
</a-col>
</a-row>
<a-checkbox-group v-model="checkoutValue" :options="plainOption"></a-checkbox-group>
<template #footer>
<a-button type="primary" @click="isOk">OK</a-button>
<a-button type="primary" @click="isCancel">Cancel</a-button>
</template>
</a-modal>
</div>
</template>
<script>
import { getFabList,listPurposeCode,listEquipmentType,queryDetails,signOffOrder,listChangeCode,checkCode,deleteFile,uploadFile, getAllFile,getLotById} from '@/services/mlcs/myConfig'
import '@/theme/style.less'
import moment from "moment";
import { message } from 'ant-design-vue';
import axios from "axios";
import { MLCS } from "@/services/api";
const columns1 = [
{
title: "StepName",
width: "100px",
dataIndex: "stepName",
},
{
title: "Signer",
width: "100px",
dataIndex: "updateUser",
scopedSlots: { customRender: "creator" },
},
{
title: "Action",
width: "100px",
dataIndex: "action",
},
{
title: "comment",
width: "100px",
dataIndex: "comment",
},
{
title: "Time",
width: "100px",
dataIndex: "updateTime",
},
];
const columns4 = [
{
title: "File Name",
width: "",
dataIndex: "fileName",
},
{
title: "Delete",
width: "",
dataIndex: "",
scopedSlots: { customRender: "delete" },
},
{
title: "Download",
width: "",
dataIndex: "",
scopedSlots: { customRender: "download" },
},
];
const form= {
caseNo:"NA",
status:"Draft",
applicant:"",
orgDescription:"",
createTime:"",
caseType:1,
realFabBu:"",
changeStatus:0,
changeCode:"",
flowType:1,
equipmentType:"",
expectTime:"",
expectUsageHours:null,
purpose:"",
projectCode:"",
projectName:"",
po:"",
customerRequester:"",
borrowPurpose:"",
targetEquipmentId:"",
executeTime:"",
executeHours:"",
planEquipmentId:"",
realEquipmentId:"",
setUpTime:"",
setOffTime:"",
borrowHours:"",
returnToTmpgStatus:"",
checkStatus:""
};
export default {
name: 'process',
props: {
},
data() {
const checkRealFabBu = (rule, value, callback) => {
if (!value&&this.searchData.caseType == 1) {
return callback(new Error('realFabBu is required'));
}else{
return callback();
}
}
const checkChangeCode = (rule, value, callback) => {
if (!value&&this.searchData.changeStatus == 1) {
return callback(new Error('changeCode is required'));
}else{
return callback();
}
}
const checkExpectUsageHours = (rule, value, callback) => {
if (!value) {
return callback(new Error('ExpectUsageHours is required'));
}else if(this.searchData.expectUsageHours > 168||this.searchData.expectUsageHours <1){
return callback(new Error('number between 1-168 '));
}else{
return callback();
}
}
const checkExpectTime = (rule, value, callback) => {
if(this.signCaseVo.jyStatus=='Applicant'){
if (!value) {
return callback(new Error('ExpectTime is required'));
}else if(new Date(this.searchData.expectTime) <= new Date()){
return callback(new Error('ExpectTime need after now '));
}else{
return callback();
}
}else{
return callback();
}
}
const checkExecuteTime = (rule, value, callback) => {
if(this.signCaseVo.jyStatus=='MPC'){
if (!value) {
return callback(new Error('ExecuteTime is required'));
}else if(new Date(this.searchData.executeTime) <= new Date()){
return callback(new Error('ExecuteTime need after now '));
}else{
return callback();
}
}else{
return callback();
}
}
const checkExecuteHours = (rule, value, callback) => {
if(this.signCaseVo.jyStatus=='MPC'){
if (!value) {
return callback(new Error('executeHours is required'));
}else if(this.searchData.executeHours > 168||this.searchData.executeHours <1){
return callback(new Error('number between 1-168 '));
}else{
return callback();
}
}else{
return callback();
}
}
const checkSetUpTime = (rule, value, callback) => {
if(this.signCaseVo.jyStatus=='LineSuper'){
if (!value) {
return callback(new Error('SetUpTime is required'));
}else if(new Date(this.searchData.setUpTime) <= new Date()){
return callback(new Error('SetUpTime need after now '));
}else{
return callback();
}
}else{
return callback();
}
}
const checkSetOffTime = (rule, value, callback) => {
if(this.signCaseVo.jyStatus=='SuperClose'){
if (!value) {
return callback(new Error('SetOffTime is required'));
// }else if(new Date(this.searchData.setOffTime) <= new Date()){
// return callback(new Error('SetUpTime need after now '));
}else{
return callback();
}
}else{
return callback();
}
}
const checkBorrowHours = (rule, value, callback) => {
if(this.signCaseVo.jyStatus=='SuperClose'){
if (!value) {
return callback(new Error('BorrowHours is required'));
}else if(this.searchData.borrowHours > 168||this.searchData.borrowHours <1){
return callback(new Error('number between 1-168 '));
}else{
return callback();
}
}else{
return callback();
}
}
const checkCheckStatus = (rule, value, callback) => {
if(this.signCaseVo.jyStatus=='SuperClose'){
if (!value) {
return callback(new Error('CheckStatus is required'));
}else{
return callback();
}
}else{
return callback();
}
}
const checkReturnToTmpgStatus = (rule, value, callback) => {
if(this.signCaseVo.jyStatus=='SuperClose'){
if (!value) {
return callback(new Error('returnToTmpgStatus is required'));
}else{
return callback();
}
}else{
return callback();
}
}
return {
moment,
fabList: [""],
purposeCodeList:[""],
equipmentTypeList:[""],
disabled: true, //是否可编辑
disabled2: false, //是否可编辑
required: true,
isShow:false,
isShow2:false,
/********case信息 start*/
columns1,
signCaseVo: {
jyStatus:"",
actionNames: [],
comment: "",
},
signOffHistory: [],
signWorkOrderDTO: {
//这边还是的更新form的数据
workCaseId: 0,
caseNo: "",
tbMlcsFormData:{},
signWorkCaseVo: {
actionName: "",
jyongStatus: "",
comment: "",
},
},
/********case信息 end*/
searchData: {
fabBu:"",
caseNo:"",
status:"",
applicant:"",
orgDescription:"",
createTime:"",
caseType:"",
realFabBu:"",
changeStatus:"",
changeCode:"",
flowType:"",
equipmentType:"",
expectTime:"",
expectUsageHours:null,
purposeCode:"",
projectCode:"",
projectName:"",
po:"",
customerRequester:"",
borrowPurpose:"",
targetEquipmentId:"",
executeTime:"",
executeHours:"",
planEquipmentId:"",
realEquipmentId:"",
setUpTime:"",
setOffTime:"",
borrowHours:"",
returnToTmpgStatus:"",
checkStatus:""
},
fileLists:[],
checkoutValue: [],
columns4,
WaferIDNumber: false,
indexFlag:"",
isChecked: false,
plainOption: [
{ label: "01", value: "01", disabled: false },
{ label: "02", value: "02", disabled: false },
{ label: "03", value: "03", disabled: false },
{ label: "04", value: "04", disabled: false },
{ label: "05", value: "05", disabled: false },
{ label: "06", value: "06", disabled: false },
{ label: "07", value: "07", disabled: false },
{ label: "08", value: "08", disabled: false },
{ label: "09", value: "09", disabled: false },
{ label: "10", value: "10", disabled: false },
{ label: "11", value: "11", disabled: false },
{ label: "12", value: "12", disabled: false },
{ label: "13", value: "13", disabled: false },
{ label: "14", value: "14", disabled: false },
{ label: "15", value: "15", disabled: false },
{ label: "16", value: "16", disabled: false },
{ label: "17", value: "17", disabled: false },
{ label: "18", value: "18", disabled: false },
{ label: "19", value: "19", disabled: false },
{ label: "20", value: "20", disabled: false },
{ label: "21", value: "21", disabled: false },
{ label: "22", value: "22", disabled: false },
{ label: "23", value: "23", disabled: false },
{ label: "24", value: "24", disabled: false },
{ label: "25", value: "25", disabled: false },
],
rules: {
expectUsageHours: [{ validator:checkExpectUsageHours, trigger: "change" }],
borrowPurpose: [{ required: true, message: "Please Input this field ", trigger: "change" },
{max:500,message:"最大长度为500", trigger: "change" }
],
realFabBu:[{validator:checkRealFabBu,trigger: "change"}],
changeCode:[{validator:checkChangeCode,trigger: "change"}],
expectTime:[{validator:checkExpectTime,trigger: "change"}],
executeTime:[{validator:checkExecuteTime,trigger: "change"}],
executeHours:[{validator:checkExecuteHours,trigger: "change"}],
setUpTime:[{validator:checkSetUpTime,trigger: "change"}],
setOffTime:[{validator:checkSetOffTime,trigger: "change"}],
//borrowHours:[{validator:checkBorrowHours,trigger: "change"}],
checkStatus:[{validator:checkCheckStatus,trigger: "change"}],
returnToTmpgStatus:[{validator:checkReturnToTmpgStatus,trigger: "change"}],
targetEquipmentId:[{pattern: /^[a-zA-Z0-9]+$/,message: "Please Input a-z A-Z 0-9 ", trigger: "change"}],
planEquipmentId:[{pattern: /^[a-zA-Z0-9]+$/,message: "Please Input a-z A-Z 0-9 ", trigger: "change"}],
realEquipmentId:[{pattern: /^[a-zA-Z0-9]+$/,message: "Please Input a-z A-Z 0-9 ", trigger: "change"}]
},
}
},
computed: {},
activated() {
getFabList().then(res => {
const data = res.data.data
this.fabList=[""];
for (const i in data) {
this.fabList.push(data[i])
}
});
listPurposeCode(localStorage.getItem('fabName')).then(res => {
const data = res.data.data
this.purposeCodeList=[""];
for (const i in data) {
this.purposeCodeList.push(data[i])
}
});
listChangeCode(localStorage.getItem('fabName')).then(res => {
const data = res.data.data
this.changeCodeList=[""];
for (const i in data) {
this.changeCodeList.push(data[i])
}
});
listEquipmentType(localStorage.getItem('fabName')).then(res => {
const data = res.data.data
this.equipmentTypeList=[""];
for (const i in data) {
this.equipmentTypeList.push(data[i])
}
});
if (this.$route.query.id != undefined && this.$route.query.id != '') {
var params = {
id: this.$route.query.id
}
queryDetails(params).then((res) => {
if (res.data.code == 0) {
let data = res.data.data.signOffVo.tbMlcsFormData;
this.signCaseVo = res.data.data.signOffVo.signCaseVo;
this.signOffHistory = res.data.data.signOffVo.signOffHistory;
this.searchData = data;
this.signWorkOrderDTO.workCaseId = res.data.data.signOffVo.workCaseId;
this.signWorkOrderDTO.caseNo =res.data.data.signOffVo.tbMlcsFormData.caseNo;
this.fileLists=res.data.data.signOffVo.allFiles;
// if (this.searchData.purposeCode.includes('Customer borrow')) {
// this.isShow=true;
// }else{
// this.isShow=false;
// }
if (this.searchData.purposeCode.includes('Customer borrow')&&this.searchData.purposeCode.includes('(TSD)')) {
this.isShow=true;
this.isShow2=true;
}else if(this.searchData.purposeCode.includes('Customer borrow')&&this.searchData.purposeCode.includes('(TD2)')) {
this.isShow=true;
this.isShow2=true;
}else if(this.searchData.purposeCode.includes('Other borrow')&&this.searchData.purposeCode.includes('(TD2)')) {
this.isShow=false;
this.isShow2=true;
}else if(this.searchData.purposeCode.includes('Customer borrow')){
this.isShow=true;
this.isShow2=false;
}else if(this.searchData.purposeCode.includes('(TSD)')){
this.isShow=false;
this.isShow2=true;
}else{
this.isShow=false;
this.isShow2=false;
}
if(!this.searchData.planEquipmentId){
this.searchData.planEquipmentId=this.searchData.targetEquipmentId;
}
}
});
}
},
created() {},
beforeDestroy() {},
methods: {
actionChange(e) {
if (e.includes('Customer borrow')&&e.includes('(TSD)')) {
this.isShow=true;
this.isShow2=true;
}else if(e.includes('(TD2)')&&e.includes('Customer borrow')){
this.isShow=true;
this.isShow2=true;
}else if(e.includes('(TD2)')&&e.includes('Other borrow')){
this.isShow=true;
this.isShow2=true;
}else if(e.includes('Customer borrow')){
this.isShow=true;
this.isShow2=false;
}else if(e.includes('(TSD)')){
this.isShow=false;
this.isShow2=true;
}else{
this.isShow=false;
this.isShow2=false;
}
},
changeStatusChange(){
if(this.searchData.changeStatus==0){
this.searchData.changeCode="";
}
},
caseTypeChange(){
if(this.searchData.caseType==0){
this.searchData.realFabBu="";
}
},
changeSetOffTime(){
var dateBegin = new Date(this.searchData.setUpTime);
var dateEnd = new Date(this.searchData.setOffTime);
var dateDiff = dateEnd.getTime() - dateBegin.getTime(); //时间差的毫秒数
var hours = (dateDiff / (1000 * 60 * 60)).toFixed(2); //计算出小时数
this.searchData.borrowHours=hours;
},
toAddressBook(item) {
let name=item.substring(0,7);
window.open(
`http://mysjsemi/extend/addressBookMain.do?method=findLike&retrievalValue=${name}`
);
},
signOff: function (ev) {
const that = this;
this.signWorkOrderDTO.signWorkCaseVo.actionName =ev.target.dataset["type"];
this.signWorkOrderDTO.signWorkCaseVo.jyongStatus =this.signCaseVo.jyStatus;
this.signWorkOrderDTO.signWorkCaseVo.comment = this.signCaseVo.comment;
this.signWorkOrderDTO.tbMlcsFormData=this.searchData;
let signWorkOrderDTO = this.signWorkOrderDTO;
if(this.signWorkOrderDTO.signWorkCaseVo.actionName!='reject'){
this.$refs["formRef"].validate((valid) => {
if (valid) {
this.$confirm({
title: "确认提交吗?",
okText: "是",
cancelText: "否",
onOk: function () {
signOffOrder(signWorkOrderDTO).then((res) => {
if (res.data.code == 0) {
that.$message.success("已提交");
that.$closePage("/detail");
that.$router.push("/todo");
}
});
},
});
} else {
return false;
}
});
}else{
this.$confirm({
title: "确认reject吗?",
okText: "是",
cancelText: "否",
onOk: function () {
signOffOrder(signWorkOrderDTO).then((res) => {
if (res.data.code == 0) {
that.$message.success("已提交");
that.$closePage("/detail");
that.$router.push("/todo");
}
});
},
});
}
// this.$confirm({
// title: "确认签核吗?",
// okText: "是",
// cancelText: "否",
// onOk: function () {
// signOffOrder(signWorkOrderDTO).then((res) => {
// if (res.data.code == 0) {
// that.$message.success("已提交");
// that.$closePage("/detail");
// that.$router.push("/todo");
// }
// });
// },
// });
},
checkCode() {
this.searchData.projectName="";
checkCode({projectCode:this.searchData.projectCode}).then((res) => {
if (res.data.code == 0) {
if(!res.data.data.caseDto){
this.$message.warning("找不到对应子项目,请检查并更新子code后,重新提交");
}else{
if(!res.data.data.caseDto.projectName){
this.searchData.projectName="已通过校验,但是项目名为空"
}else{
this.searchData.projectName=res.data.data.caseDto.projectName
}
this.disabled2=true
}
}
});
},
resetCode() {
this.searchData.projectCode=""
this.searchData.projectName=""
this.disabled2=false
},
handleTableChange(pagination) {
// this.pagination = pagination;
// this.getPage();
},
// 删除文件
deleteList(file) {
let that = this;
that.$confirm({
title: "Are you sure to delete this data?",
okText: "YES",
okType: "danger",
cancelText: "NO",
onOk() {
deleteFile(file.id).then((res) => {
if (res.data.code == 0) {
message.success('Delete succeeded');
that.getAllFile(file.mlcsId);
}
})
},
onCancel() { },
});
},
// 下载文件
downloadList(file) {
let that = this;
that.$confirm({
title: "Are you sure to Download this data?",
okText: "YES",
okType: "danger",
cancelText: "NO",
onOk() {
axios({
url: `${MLCS}/file/download/${file.id}`,
method: "get",
responseType: "blob",
}).then((res) => {
const url = window.URL.createObjectURL(new Blob([res.data]));
const link = document.createElement('a');
link.href = url;
const contentDisposition = res.headers["content-disposition"];
const fileName = decodeURI(
contentDisposition.split("fileName=")[1] ||
contentDisposition.split("filename=")[1]
);
link.setAttribute('download', fileName);
document.body.appendChild(link);
link.click();
link.parentNode.removeChild(link);
window.URL.revokeObjectURL(url);
});
},
onCancel() { },
});
},
// 上传之前
beforeUpload2(file) {
const form = new FormData()
form.append("file", file)
form.append("mlcsId", this.searchData.id)
uploadFile(form).then((res) => {
if (res.data.code == 0) {
message.success('Upload succeeded');
this.getAllFile(this.searchData.id);
}
})
return false;
},
getAllFile(mlcsId) {
getAllFile(mlcsId).then((res) => {
this.fileLists = res.data.data
})
},
addLotList(addLotList) {
addLotList.push({lotId: '', vendorId: '',waferId: ''})
},
deleteItem(addLotList, index) {
if(addLotList.length>1){
addLotList.splice(index, 1);
} else {
this.$message.warning("至少保留一组Lot!")
}
},
cliWaferID(index) {
if(this.searchData.lotList[index].lotId&&this.searchData.lotList[index].lotId !='NA'){
let params = new FormData();
params.append("lotId", this.searchData.lotList[index].lotId);
getLotById(params).then((res) => {
if (res.data.code == 0) {
var i=0;
//this.searchData.lotList[index].waferId = res.data.data.waferId;
if (res.data.data.waferId != null) {
let list = res.data.data.waferId.split("#");
this.plainOption.forEach((item) => {
if (list.indexOf(item.label) == "-1") {
item.disabled = true;
}else{
item.disabled = false;
i++;
}
});
//this.searchData.lotList[index].waferId = null;
}
this.indexFlag=index;
if(i==(this.searchData.lotList[index].waferId? this.searchData.lotList[index].waferId.split(",").length : [].length)){
this.isChecked=true;
}else{
this.isChecked=false;
}
this.WaferIDNumber = true;
this.checkoutValue = this.searchData.lotList[index].waferId
? this.searchData.lotList[index].waferId.split(",") : [];
}
});
}
// if(this.indexFlag==index){
// this.WaferIDNumber = true;
// this.checkoutValue = this.searchData.lotList[index].waferId
// ? this.searchData.lotList[index].waferId.split(",") : [];
// }else{
// lotBlur(this.searchData.lotList[index].lotId,index);
// this.indexFlag=index;
// this.WaferIDNumber = true;
// this.checkoutValue = this.searchData.lotList[index].waferId
// ? this.searchData.lotList[index].waferId.split(",") : [];
// }
},
isOk() {
console.log(this.checkoutValue);
this.WaferIDNumber = false;
//this.lotList.waferId = this.checkoutValue.toString();
console.log("111111"+this.indexFlag);
this.searchData.lotList[this.indexFlag].waferId= this.checkoutValue.toString();
},
isCancel() {
this.WaferIDNumber = false;
},
lotBlur(e,index) {
const counts = {};
let flag=true;
this.searchData.lotList.forEach(lot => {
if (counts[lot.lotId]&&lot.lotId==e) {
this.searchData.lotList[index].lotId ="";
this.searchData.lotList[index].waferId = "";
this.searchData.lotList[index].vendorId = "";
flag=false;
this.$message.warning("LotID不可重复");
} else {
counts[lot.lotId] = 1;
}
});
if (e&&flag) {
this.searchData.lotList[index].lotId = "";
this.searchData.lotList[index].waferId = "";
this.searchData.lotList[index].vendorId = "";
if(e=="NA"){
this.searchData.lotList[index].vendorId ="NA";
return
}
this.$warning({
title: `System will get LotId:${e} data from MES`,
okText: "ok",
onOk: () => {
let params = new FormData();
params.append("lotId", e);
//params.append("system", "CP");
getLotById(params).then((res) => {
if (res.data.code == 0) {
this.searchData.lotList[index].lotId = res.data.data.lotId;
this.searchData.lotList[index].vendorId = res.data.data.vendorId;
this.searchData.lotList[index].waferId = res.data.data.waferId;
if (res.data.data.waferId != null) {
let list = res.data.data.waferId.split("#");
this.plainOption.forEach((item) => {
if (list.indexOf(item.label) == "-1") {
item.disabled = true;
}else{
item.disabled = false;
}
});
this.searchData.lotList[index].waferId = "";
}
}
});
},
});
}
},
checkboxAll(e) {
this.checkoutValue = [];
if (e.target.checked) {
this.plainOption.forEach((item) => {
if (item.disabled == false) {
this.checkoutValue.push(item.label);
}
});
} else {
this.checkoutValue = [];
}
},
}
}
</script>
<style scoped lang="less">
// /deep/ .ant-form-item label {
// white-space: normal;
// }
/deep/ .ant-form-item {
color: #000000;
// border: 1px solid #fff;
// border-left: 0px;
}
/deep/ .langName .ant-form-item-label {
line-height: 18px;
white-space: normal;
}
/deep/ .ant-form-item {
border: 1px solid #fff;
border-left: 0px;
}
/deep/ .ant-checkbox-group-item {
margin-right: 10px;
width: 10%;
color: black;
font-weight: 500;
}
.redColorTable {
color: red;
}
</style>