| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265 |
- <!-- @desc:工艺流程工序弹窗 @auth:张潇木 @time:2023/1/5 9:35 -->
- <template>
- <div class="main-div" ref="node-modal-div" v-if="existsFlag">
- <DkModal
- :title="'工序 - '+nodeKindList.find(it => it.kindCode == nodeData.nodeKind)?.kindName"
- v-model="modalDisplay"
- :mask-closable="false"
- :loading="loading"
- draggable
- width="800"
- sticky
- @modalOk="modalOk"
- @modalCancel="modalCancel"
- @on-cancel="modalCancel"
- :saveFlag="isFromIndex">
- <DkTabs ref='tabs' :options="tabsOptions" v-model="currentTab" @on-click="changeTabs" style="margin: 10px 0;"/>
- <!-- {{ nodeData }}<br/>-->
- <!-- tab1 - 基本信息 -->
- <DkForm ref="formInline" v-if="currentTab =='tab1'" key="tab1" v-model="nodeData" :label-max-words="6" :colCount="2">
- <!-- 工序名称 -->
- <DkFormItem prop="nodeName" :required="true">
- <InputPop v-model="nodeData.nodeName" ref="nodeName"/>
- </DkFormItem>
- <!-- 显示顺序 -->
- <DkFormItem prop="displayNo" :required="true" :data-type="this.$config.dataType.number">
- <InputNumberPop v-model="nodeData.displayNo" ref="displayNo" :min="1" :digits="0"/>
- </DkFormItem>
- <!-- 流程类型 工艺工序-计件&&工序流程-结束,报损标识不可用(否)。其他可用) -->
- <DkFormItem prop="flowKind" key="flowKind" :required="true" v-if="nodeControl?.flowKind?.visible">
- <SelectPop ref="flowKind" v-model="nodeData.flowKind" label-key="kindName" value-key="kindCode"
- @on-select="handleSelectFlowKind"
- :multiple="false"
- :options="flowKindList.filter(it=>!(nodeControl?.flowKind?.invalidCode||[]).includes(it.kindCode))"/>
- </DkFormItem>
- <!-- 可判分级 -->
- <DkFormItem prop="judgeGradeIds" key="judgeGradeIds" :required="true" v-if="nodeControl?.judgeGradeIds?.visible" :data-type="$config.dataType.array">
- <MultiSelect v-model="nodeData.judgeGradeIds"
- main-field="defGradeId"
- main-field-text="【默认】"
- :mainFieldId="nodeData.defGradeId"
- @ok="chooseJudgeGradeIds"
- :default-value="judgeGradeDefaultValue"
- :check-auto-set-main-field="false"
- :type="$config.MagnifierType.judgeGrade"
- :other-condition="{flgValid: true,notInGradeKinds:[$config.gradeKind.damage],gradeTypes:[nodeData.nodeKind]}"/>
- </DkFormItem>
- <!-- 工号类型 -->
- <DkFormItem prop="userKind" key="userKind" :required="true" v-if="nodeControl?.userKind?.visible">
- <SelectPop ref="userKind" v-model="nodeData.userKind" label-key="kindName" value-key="kindCode"
- @on-select="changeUserKind"
- :multiple="false"
- :options="userKindList.filter(it=>!(nodeControl?.userKind?.invalidCode||[]).includes(it.kindCode))"/>
- </DkFormItem>
- <!-- 操作模式 -->
- <DkFormItem prop="opnKind" key="opnKind" :required="true" v-if="nodeControl?.opnKind?.visible">
- <SelectPop ref="opnKind" v-model="nodeData.opnKind" label-key="kindName" value-key="kindCode"
- @on-select="changeOpnKind"
- :multiple="false"
- :options="opnKindList.filter(it=>!(nodeControl?.opnKind?.invalidCode||[]).includes(it.kindCode))"/>
- </DkFormItem>
- <!-- 载具模式 -->
- <DkFormItem prop="carKind" key="carKind" :required="true" v-if="nodeControl?.carKind?.visible
- &&[$config.processType.dressKilnCar,$config.processType.exchangeKilnCar].includes(nodeData.opnKind)">
- <SelectPop ref="carKind" v-model="nodeData.carKind" label-key="kindName" value-key="kindCode" :multiple="false" :options="carKindList"/>
- </DkFormItem>
- <!-- 计件模式 -->
- <DkFormItem prop="pieceKind" key="pieceKind" :required="true" v-if="nodeControl?.pieceKind?.visible
- &&!([$config.nodeKind.outKiln,$config.nodeKind.inKiln].includes(nodeData.nodeKind)&&nodeData.opnKind==$config.processType.kilnCode)
- &&!($config.nodeKind.register==nodeData.nodeKind&&nodeData.opnKind!=$config.processType.productCode)">
- <SelectPop ref="pieceKind" v-model="nodeData.pieceKind" label-key="kindName" value-key="kindCode"
- :multiple="false"
- :options="pieceKindList.filter(it=>!(nodeControl?.pieceKind?.invalidCode||[]).includes(it.kindCode))"/>
- </DkFormItem>
- <!-- 回收到达 -->
- <DkFormItem prop="recycledKind" key="recycledKind" v-if="nodeControl?.recycledKind?.visible" :required="true">
- <SelectPop ref="recycledKind" v-model="nodeData.recycledKind" label-key="kindName" value-key="kindCode"
- :options="recycledKindList" :multiple="false" @on-select="changeRecycledKind"/>
- </DkFormItem>
- <!-- 回收分级 -->
- <DkFormItem prop="recycledGradeIds" key="recycledGradeIds" v-if="nodeControl?.recycledGradeIds?.visible">
- <SelectPop ref="recycledGradeIds" v-model="nodeData.recycledGradeIds" label-key="gradeName"
- value-key="gradeId" :multiple="true"
- :options="productGradeList.filter(it=>[$config.gradeKindType.decrease,$config.gradeKindType.inferior].includes(it.gradeKind))"/>
- </DkFormItem>
- <!-- 工序标签 -->
- <DkFormItem prop="nodeSysTags" key="nodeSysTags" v-if="nodeControl?.nodeSysTags?.visible">
- <SelectPop ref="nodeSysTags" v-model="nodeData.nodeSysTags" label-key="kindName" value-key="kindCode"
- :multiple="true"
- :options="nodeSysTagsList.filter(it=>!(nodeControl?.nodeSysTags?.invalidCode||[]).includes(it.kindCode))"/>
- </DkFormItem>
- <!-- 可用窑炉 -->
- <DkFormItem prop="kilnIds" key="kilnIds" v-if="nodeControl?.kilnIds?.visible">
- <SelectPop ref="kilnIds" v-model="nodeData.kilnIds" label-key="kilnName" value-key="uniqueId"
- :multiple="true" :options="kilnList"/>
- </DkFormItem>
- <!-- 生产车间 -->
- <DkFormItem prop="workShop" :data-type="$config.dataType.number">
- <SelectPop ref="workShop" v-model="nodeData.workShop" label-key="spaceName" value-key="spaceId"
- :multiple="false" :options="shopList"/>
- </DkFormItem>
- <!-- 备注 -->
- <DkFormItem prop="remarks" :span="24">
- <InputPop ref="remarks" v-model="nodeData.remarks"/>
- </DkFormItem>
- </DkForm>
- <!-- tab2 - 缺陷设置 -->
- <DkForm ref="formInline" v-if="currentTab =='tab2'" key="tab2" v-model="nodeData" :label-max-words="6" :colCount="2">
- <!-- 产生缺陷 -->
- <DkFormItem prop="flgJobDefect" key="flgJobDefect" v-if="nodeControl?.jobDefectTable?.visible">
- <DkSwitch ref="flgJobDefect" v-model="nodeData.flgJobDefect"
- @on-change="(e)=>{if(!e)nodeData.jobDefectList=undefined;}"></DkSwitch>
- </DkFormItem>
- </DkForm>
- <!-- tab3 - 高级属性 -->
- <DkForm ref="formInline" v-if="currentTab =='tab3'" key="tab3" v-model="nodeData" :label-max-words="6" :colCount="2">
- <!-- 工艺类别 -->
- <DkFormItem prop="techType" :data-type="$config.dataType.number">
- <SelectPop ref="techType" v-model="nodeData.techType" label-key="dataValue" value-key="dataId"
- :multiple="false" :options="techTypeList"/>
- </DkFormItem>
- <!-- 工序类别 -->
- <DkFormItem prop="nodeTypes" :data-type="$config.dataType.array">
- <SelectPop ref="nodeTypes" v-model="nodeData.nodeTypes" label-key="dataValue" value-key="dataId"
- :multiple="true" :options="nodeTypeList"/>
- </DkFormItem>
- <!-- 工序描述 -->
- <DkFormItem prop="nodeDesc">
- <InputPop v-model="nodeData.nodeDesc" ref="nodeDesc"/>
- </DkFormItem>
- <!-- 默认分级 -->
- <DkFormItem prop="defGradeId" key="defGradeId" v-if="nodeControl?.defGradeId?.visible" :data-type="$config.dataType.number">
- <SelectPop ref="defGradeId" v-model="nodeData.defGradeId" label-key="gradeName" value-key="gradeId"
- :multiple="false"
- :options="productGradeList.filter(it=>[$config.gradeKind.good,$config.gradeKind.fine].includes(it.gradeKind))"/>
- </DkFormItem>
- <!-- 报损标识 -->
- <DkFormItem prop="scrapFlg" key="scrapFlg"
- v-if="nodeControl?.flgScrap?.visible && !(nodeData.nodeKind==$config.nodeKind.register&&nodeData.flowKind==$config.flowKind.end)">
- <DkSwitch ref="flgScrap" v-model="nodeData.flgScrap"></DkSwitch>
- </DkFormItem>
- <!-- 撤销标识 -->
- <DkFormItem prop="flgUndo" key="flgUndo"
- v-if="nodeControl?.flgUndo?.visible && !(nodeData.nodeKind==$config.nodeKind.register&&nodeData.opnKind!=$config.processType.productCode)">
- <DkSwitch ref="flgUndo" v-model="nodeData.flgUndo"></DkSwitch>
- </DkFormItem>
- <!-- 验证标签 -->
- <DkFormItem prop="flgCheckLabel" key="flgCheckLabel"
- v-if="nodeControl?.flgCheckLabel?.visible && !(nodeData.nodeKind===$config.nodeKind.register&&nodeData.opnKind!==$config.processType.productCode)">
- <DkSwitch ref="flgCheckLabel" v-model="nodeData.flgCheckLabel"
- @on-change="(e)=>{if(!e) nodeData.pdtLabelKinds=undefined;this.$refs['formInline'].clearValidate()}"></DkSwitch>
- </DkFormItem>
- <!-- 标签类型 -->
- <DkFormItem prop="pdtLabelKinds" key="pdtLabelKinds" v-if="nodeControl?.pdtLabelKinds?.visible && nodeData.flgCheckLabel"
- :required="nodeData.flgCheckLabel"
- :data-type="$config.dataType.array">
- <SelectPop ref="pdtLabelKinds" v-model="nodeData.pdtLabelKinds" label-key="kindName" value-key="kindCode"
- :multiple="true" :options="pdtLabelKindsList"/>
- </DkFormItem>
- <!-- 独立检验 -->
- <DkFormItem prop="flgAloneJudge" key="flgAloneJudge"
- v-if="nodeControl?.flgAloneJudge?.visible && [$config.nodeKind.halfCheck,$config.nodeKind.finishCheck].includes(nodeData.nodeKind)&&nodeData.flowKind!=$config.flowKind.start">
- <DkSwitch ref="flgAloneJudge" v-model="nodeData.flgAloneJudge"
- @on-change="changeFlgAloneJudge"></DkSwitch>
- </DkFormItem>
- <!-- 返回分级 -->
- <DkFormItem prop="backGradeIds" key="backGradeIds"
- v-if="nodeControl?.backGradeIds?.visible && ([$config.nodeKind.halfCheck,$config.nodeKind.finishCheck].includes(nodeData.nodeKind)&&nodeData.flgAloneJudge)"
- :data-type="$config.dataType.array">
- <SelectPop ref="backGradeIds" v-model="nodeData.backGradeIds" label-key="gradeName" value-key="gradeId"
- :options="productGradeList.filter(it=>it.gradeKind!==$config.gradeKind.damage&&(it.gradeTypes?.length===0||it.gradeTypes.includes(nodeData.nodeKind)))"
- @on-select="changeBackGradeIds" />
- </DkFormItem>
- <!-- 入库仓库 -->
- <DkFormItem prop="whId" :label="$t('whCodeName')" key="whId"
- v-if="nodeTypeList.filter(it=>it.dataValue=='入库').length && nodeData.nodeTypes && nodeData.nodeTypes.length &&
- nodeData.nodeTypes.includes(nodeTypeList.filter(it=>it.dataValue=='入库')[0].dataId)"
- :data-type="$config.dataType.array">
- <SelectPop ref="whId" v-model="nodeData.whId" label-key="whName" value-key="whId"
- :multiple="false" :options="whList" />
- </DkFormItem>
- </DkForm>
- <!-- tab4 - 流程控制 -->
- <DkForm ref="formInline" v-if="currentTab =='tab4'" key="tab4" v-model="nodeData" :label-max-words="6" :colCount="2">
- <!-- 成型标签 -->
- <DkFormItem prop="moldlineTags" key="moldlineTags" v-if="nodeControl?.moldlineTags?.visible" :span="12" :info="$config.nodeInfo.moldlineTags">
- <SelectPop ref="moldlineTags" v-model="nodeData.moldlineTags" label-key="dataValue" value-key="dataId"
- :multiple="true" :options="moldlineTagsList"/>
- </DkFormItem>
- </DkForm>
- <!-- 表格 -->
- <div style="margin-bottom: 8px">
- <div v-if="currentTab =='tab1'" key="tableTab1">
- <Divider v-if="nodeControl?.userTable?.visible" key="divider1"/>
- <!-- 生产工号 -->
- <EditTable ref="productUserTable" key="productUserTable" :title='"生产工号"' :titleInfo='$config.nodeInfo.productUserTable'
- :data="productUserList"
- v-if="nodeControl?.userTable?.visible&&productUserTableFlag"
- :columns="userColumns"
- enabledRepeatId="userId"
- :height="200"
- controlId="userId"
- :enabledRepeat="false"
- :show-setting-flag="false"/>
- <!-- 操作工号 -->
- <EditTable ref="operateUserTable" key="operateUserTable" :title='"操作工号"' :titleInfo='$config.nodeInfo.operateUserTable'
- :data="operateUserList"
- v-if="nodeControl?.userTable?.visible&&operateUserTableFlag&&nodeData.userKind==$config.userKind.operate"
- :columns="userColumns"
- enabledRepeatId="userId"
- :height="200"
- controlId="userId"
- :enabledRepeat="false"
- :show-setting-flag="false"/>
- </div>
- <div v-if="currentTab =='tab2'" key="tableTab2">
- <Divider v-if="(nodeControl?.defectTable?.visible)||(nodeControl?.jobDefectTable?.visible&&nodeData.flgJobDefect)" key="divider2"/>
- <!-- 可检缺陷 -->
- <EditTable ref="defectTable" key="defectTable" :title='"可检缺陷"' :data="nodeData.defectList" :titleInfo='$config.nodeInfo.defectTable'
- v-if="nodeControl?.defectTable?.visible&&defectTableFlag"
- :columns="defectColumns"
- enabledRepeatId="defectId"
- :height="200"
- controlId="pdtDefectId"
- :enabledRepeat="false"
- :show-setting-flag="false"/>
- <!-- 工种缺陷 -->
- <EditTable ref="jobDefectTable" key="jobDefectTable" :title='"工种缺陷"' :data="nodeData.jobDefectList" :titleInfo='$config.nodeInfo.jobDefectTable'
- v-if="nodeControl?.jobDefectTable?.visible&&jobDefectTableFlag&&nodeData.flgJobDefect"
- :columns="jobDefectColumns"
- :enabledRepeatId="['pdtDefectId','jobId']"
- :height="200"
- controlId="pdtDefectId"
- :enabledRepeat="false"
- :show-setting-flag="false"/>
- </div>
- <div v-if="currentTab =='tab3'" key="tableTab3">
- <Divider v-if="(([$config.nodeKind.halfCheck,$config.nodeKind.finishCheck].includes(nodeData.nodeKind)&&nodeData.flgAloneJudge)
- ||$config.nodeKind.recover==nodeData.nodeKind)
- &&checkRecoverTableFlag" key="divider3"/>
- <!-- 回收/检验设置 -->
- <EditTable ref="checkRecoverTable" key="checkRecoverTable" :title='nodeData.nodeKind===$config.nodeKind.recover?"回收设置":"检验设置"'
- :data="checkRecoverRouterList"
- v-if="(([$config.nodeKind.halfCheck,$config.nodeKind.finishCheck].includes(nodeData.nodeKind)&&nodeData.flgAloneJudge)
- ||$config.nodeKind.recover==nodeData.nodeKind)
- &&checkRecoverTableFlag"
- :columns="([$config.nodeKind.halfCheck,$config.nodeKind.finishCheck].includes(nodeData.nodeKind)&&nodeData.flgAloneJudge)
- ||($config.nodeKind.recover==nodeData.nodeKind&&nodeData.recycledKind==$config.recycledKind.before)?checkRecoverColumns:checkRecoverColumns_noBack"
- :controlId="'node1Id'"
- :height="200"
- :enabledRepeatId="['node1Id','backNodeIds']"
- :enabledRepeat="false"
- :show-setting-flag="false"/>
- </div>
- <div v-if="currentTab =='tab4'" key="tableTab4">
- <Divider v-if="(nodeControl?.pdtTable?.visible)||(nodeControl?.routerTable?.visible&&nodeData.recycledKind!==$config.recycledKind.before)" key="divider4"/>
- <!-- 工序在制品 -->
- <EditTable ref="pdtTable" key="pdtTable" :title='"工序在制品"' :data="nodeData.pdtList"
- v-if="nodeControl?.pdtTable?.visible&&pdtTableFlag"
- :columns="pdtColumns"
- enabledRepeatId="modelId"
- controlId="pdtModelId"
- :height="200"
- :enabledRepeat="false"
- :show-setting-flag="false"/>
- <!-- 跨流程工序 -->
- <!-- {{nodeData.routeType}}-->
- <EditTable ref="routerTable" key="routerTable" :title='"跨流程工序"' :data="crossRouterList"
- v-if="nodeControl?.routerTable?.visible&&routerTableFlag&&nodeData.recycledKind!==$config.recycledKind.before"
- :columns="crossRouterColumns"
- :controlId="'node2Id'"
- :height="200"
- :enabledRepeatId="'nodeId'"
- :enabledRepeat="false"
- :show-setting-flag="false"/>
- </div>
- </div>
- <!-- {{ nodeControl }}<br/>-->
- <!-- {{ allNodes }}<br/>-->
- <!-- {{nodeData.routerList}}<br/>-->
- </DkModal>
- </div>
- </template>
- <script>
- import { mapState, mapMutations } from 'vuex'
- import Process from '@/view/process/process-flow/config/ProcessConfig'
- export default {
- name: 'NodeModal',
- props: {
- shopList: {
- type: Array,
- default: () => []
- },
- dictionaryDataList: {
- type: Array,
- default: () => []
- },
- jobList: {
- type: Array,
- default: () => []
- },
- kilnList: {
- type: Array,
- default: () => []
- },
- whList: {
- type: Array,
- default: () => []
- },
- dataKindList: {
- type: Array,
- default: () => []
- },
- productGradeList: {
- type: Array,
- default: () => []
- },
- flowFormData: {
- type: Object,
- default: undefined,
- },
- isFromIndex: {
- type: Boolean,
- default: false
- }
- },
- computed: {
- ...mapState(['process']),
- },
- data() {
- let self = this
- return {
- operateUserList:[],//操作工号集合
- productUserList:[],///生产工号集合
- crossRouterList:[],///生产工号集合
- checkRecoverRouterList:[],//检验回收集合
- currentTab: 'tab1',
- judgeGradeDefaultValue: '',
- loading: false,
- existsFlag: true,
- productUserTableFlag: true,
- operateUserTableFlag: true,
- defectTableFlag: true,
- jobDefectTableFlag: true,
- pdtTableFlag: true,
- routerTableFlag: true,
- checkRecoverTableFlag: true,//检验/回收table
- modalDisplay: false,//如不定义此变量,则进入modal无动画
- split: 0.5,
- tableHeight: null,
- allNodes: [],//所有工序
- graph: null,//图形对象
- nodeData: {},//工序数据
- nodeDataSocial: {},// 工序数据(原始)
- nodeControl: {},//工序控制
- //tabs选项
- tabsOptions: [
- { label: self.$t('basic_info'), name: 'tab1' },
- { label: self.$t('defect_setting'), name: 'tab2' },
- { label: self.$t('advanced_attribute'), name: 'tab3' },
- { label: self.$t('flow_control'), name: 'tab4' },
- ],
- // 不包括工号类型
- userColumns: [
- {
- field: 'userCode',
- type: 'tableSelect',
- controlId: 'userId',
- param: () => {
- return { userType: self.$config.userType.workTeam }
- },
- sortBoolean: false,
- dataType: self.$config.tableSelectType.user,
- fieldUpdate: self.$updateColumns.processNodeChooseUser,
- searchDetailFlag: true,
- width: 'auto',
- },
- { field: 'userName', type: 'disabled', width: 'auto' },
- { field: 'remarks', type: 'text', width: 'auto' },
- ],
- pdtColumns: [
- {
- field: 'pdtModelCode',
- selectField: 'modelCode',
- type: 'tableSelect',
- controlId: 'pdtModelId',
- param: () => {
- return {}
- },
- sortBoolean: false,
- dataType: self.$config.tableSelectType.product,
- fieldUpdate: self.$updateColumns.processNodeChooseProduct,
- searchDetailFlag: true,
- width: 'auto',
- },
- { field: 'pdtModelName', type: 'disabled', width: 'auto', title: '产品名称' },
- { field: 'categoryName', type: 'disabled', width: 'auto' },
- { field: 'remarks', type: 'text', width: 'auto' },
- ],
- carColumns: [
- {
- field: 'carModelCode',
- selectField: 'modelCode',
- type: 'tableSelect',
- controlId: 'carModelId',
- param: () => {
- return {}
- },
- sortBoolean: false,
- dataType: self.$config.tableSelectType.carrier,
- fieldUpdate: self.$updateColumns.processNodeChooseCarrier,
- searchDetailFlag: true,
- width: 'auto',
- },
- { field: 'carModelName', type: 'disabled', width: 'auto' },
- { field: 'remarks', type: 'text', width: 'auto' },
- ],
- defectColumns: [
- {
- field: 'defectCode',
- type: 'tableSelect',
- controlId: 'pdtDefectId',
- param: () => {
- return { defectKind: self.$config.defectKind.Defect }
- },
- sortBoolean: false,
- dataType: self.$config.tableSelectType.defect,
- fieldUpdate: self.$updateColumns.processNodeChooseDefect,
- searchDetailFlag: true,
- width: 'auto',
- },
- { field: 'defectName', type: 'disabled', width: 'auto' },
- { field: 'defectTypesName', type: 'disabled', width: 'auto' },
- { field: 'remarks', type: 'text', width: 'auto' },
- ],
- jobDefectColumns: [
- {
- field: 'defectCode',
- type: 'tableSelect',
- controlId: 'pdtDefectId',
- param: () => {
- return { defectKind: self.$config.defectKind.Defect }
- },
- sortBoolean: false,
- dataType: self.$config.tableSelectType.defect,
- fieldUpdate: self.$updateColumns.processNodeChooseDefect,
- searchDetailFlag: true,
- width: 'auto',
- },
- { field: 'defectName', type: 'disabled', width: 'auto' },
- { field: 'defectTypesName', type: 'disabled', width: 'auto' },
- {
- field: 'jobId',
- type: 'select',
- options: () => self.jobList,
- labelKey: 'jobName',
- valueKey: 'jobId',
- searchDetailFlag: true,
- width: 'auto'
- },
- { field: 'remarks', type: 'text', width: 'auto' },
- ],
- //router_type=2/3
- checkRecoverColumns: [
- {
- field: 'node1Id',
- type: 'select',
- controlId: 'node1Id',
- options: () => self.allNodes.filter(it => !it.flgAloneJudge && it.id != self.process.currentNodeId),
- labelKey: 'name',
- valueKey: 'id',
- width: 'auto'
- },
- {
- field: 'productGrade',
- type: 'select',
- options: () => self.nodeData.nodeKind === self.$config.nodeKind.recover ?
- self.productGradeList.filter(it => [self.$config.gradeKindType.decrease, self.$config.gradeKindType.inferior].includes(it.gradeKind))
- : self.productGradeList.filter(it => ![self.$config.gradeKindType.decrease, self.$config.gradeKindType.inferior].includes(it.gradeKind)),
- labelKey: 'gradeName',
- valueKey: 'gradeId',
- multiple: true,
- width: 'auto'
- },
- {
- field: 'moldlineTags',
- info:self.$config.nodeInfo.moldlineTags,
- type: 'select',
- options: () => self.moldlineTagsList,
- labelKey: 'dataValue',
- valueKey: 'dataId',
- multiple: true,
- width: 'auto'
- },
- {
- field: 'backNodeIds',
- type: 'select',
- options: () => self.allNodes.filter(it => !it.flgAloneJudge && it.id != self.process.currentNodeId),
- labelKey: 'name',
- valueKey: 'id',
- width: 'auto',
- multiple: true,
- info:'未设置时,默认为下一道工序'
- },
- { field: 'remarks', type: 'text', width: 'auto' },
- ],
- checkRecoverColumns_noBack: [
- {
- field: 'node1Id',
- type: 'select',
- controlId: 'node1Id',
- options: () => self.allNodes.filter(it => !it.flgAloneJudge && it.id != self.process.currentNodeId),
- labelKey: 'name',
- valueKey: 'id',
- width: 'auto'
- },
- {
- field: 'productGrade',
- type: 'select',
- options: () => self.nodeData.nodeKind === self.$config.nodeKind.recover ?
- self.productGradeList.filter(it => [self.$config.gradeKindType.decrease, self.$config.gradeKindType.inferior].includes(it.gradeKind))
- : self.productGradeList.filter(it => ![self.$config.gradeKindType.decrease, self.$config.gradeKindType.inferior].includes(it.gradeKind)),
- labelKey: 'gradeName',
- valueKey: 'gradeId',
- multiple: true,
- width: 'auto'
- },
- {
- field: 'moldlineTags',
- info:self.$config.nodeInfo.moldlineTags,
- type: 'select',
- options: () => self.moldlineTagsList,
- labelKey: 'dataValue',
- valueKey: 'dataId',
- multiple: true,
- width: 'auto'
- },
- { field: 'remarks', type: 'text', width: 'auto' },
- ],
- //router_type=4
- crossRouterColumns: [
- {
- field: 'node2IdName',
- selectField: 'nodeName',
- type: 'tableSelect',
- controlId: 'node2Id',
- param: () => {
- return {
- notInFlowId: [this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id)],
- // notInFlowKind:[this.$config.flowKind.start],
- notInNodeKind: [self.$config.nodeKind.inKiln, self.$config.nodeKind.outKiln, self.$config.nodeKind.uninstallKiln, self.$config.nodeKind.recover, self.$config.nodeKind.shaping],
- flgAloneJudge: false,
- }
- },
- sortBoolean: false,
- dataType: self.$config.tableSelectType.processNode,
- fieldUpdate: self.$updateColumns.processNodeChooseNode,
- searchDetailFlag: true,
- width: 'auto'
- },
- {
- field: 'productGrade',
- type: 'select',
- options: () => self.nodeData.nodeKind === self.$config.nodeKind.recover ?
- self.productGradeList.filter(it => [self.$config.gradeKindType.decrease, self.$config.gradeKindType.inferior].includes(it.gradeKind))
- : self.productGradeList.filter(it => ![self.$config.gradeKindType.decrease, self.$config.gradeKindType.inferior].includes(it.gradeKind)),
- labelKey: 'gradeName',
- valueKey: 'gradeId',
- multiple: true,
- width: 'auto'
- },
- {
- field: 'moldlineTags',
- info:self.$config.nodeInfo.moldlineTags,
- type: 'select',
- options: () => self.moldlineTagsList,
- labelKey: 'dataValue',
- valueKey: 'dataId',
- multiple: true,
- width: 'auto'
- },
- { field: 'remarks', type: 'text', width: 'auto' },
- ],
- nodeKindList: [],// 工艺流程类型
- flowKindList: [],// 流程种类
- userKindList: [],// 用户类型
- pieceKindList: [],// 计件模式
- opnKindList: [],// 操作模式
- carKindList:[],// 载具模式
- nodeSysTagsList: [],// 工序标签
- moldlineTagsList: [],// 成线标签
- recycledKindList: [],// 回收到达
- recycledKindListSocial: [],// 回收到达(记录原始数据)
- packKindList: [], // 组装方式
- pdtLabelKindsList: [],//验证标签
- nodeTypeList: [],//工序类别
- techTypeList: [],//工艺类别
- }
- },
- watch: {
- //监听返回分级,处理检验table
- // 'nodeData.backGradeIds'(n, o){
- // console.log('o',o)
- // console.log('n',n)
- // if(!n||!o||n.isEmptyArray()||o.isEmptyArray()){
- // this.checkRecoverRouterList = []
- // this.checkRecoverTableFlag=false
- // this.$nextTick(() => {
- // this.checkRecoverTableFlag=true
- // })
- // }
- // },
- },
- methods: {
- ...mapMutations(['setProcessNodeModalDisplay', 'setProcessNodeModalIndexDisplay','setCurrentNodeId']),
- /**
- * @desc : 处理可判定分级初始值
- * @author : 张潇木
- * @date : 2023/5/26 16:03
- */
- handleJudgeGradeDefaultValue() {
- if (!this.nodeData.judgeGradeIds) return
- let value = ''
- //先处理默认
- if (this.nodeData.defGradeId) {
- value += this.productGradeList.filter(it => this.nodeData.defGradeId == it.gradeId)[0].gradeName + '【默认】 | '
- }
- //再处理其他
- this.productGradeList.filter(it => this.nodeData.judgeGradeIds.includes(it.gradeId) && this.nodeData.defGradeId !== it.gradeId).forEach(it => {
- value += it.gradeName + ' | '
- })
- this.judgeGradeDefaultValue = value.substring(0, value.length - 2)
- },
- /**
- * @desc : 选择可判分级
- * @author : 张潇木
- * @date : 2023/5/26 16:00
- */
- chooseJudgeGradeIds({ rows }) {
- if (rows && rows.length > 0) {
- this.nodeData.judgeGradeIds = rows.map(it => {
- return it.gradeId
- })
- let defaultRow = rows.filter(it => it.defGradeId)
- if (defaultRow.length > 0) {
- this.$set(this.nodeData, 'defGradeId', defaultRow[0].gradeId)
- }
- } else {
- this.nodeData.judgeGradeIds = []
- this.nodeData.defGradeId = undefined
- }
- },
- /**
- * @desc : 改变返回分级事件
- * @author : 张潇木
- * @date : 2023/7/13 16:20
- */
- changeBackGradeIds(e){
- //如果清空了返回分级,清空检验设置table
- if(!e||e.isEmptyArray()){
- this.checkRecoverRouterList = []
- this.checkRecoverTableFlag=false
- this.$nextTick(() => {
- this.checkRecoverTableFlag=true
- this.$nextTick(() => {
- //重新渲染回收/检验设置table列名
- if (this.$refs.checkRecoverTable
- && [this.$config.nodeKind.recover, this.$config.nodeKind.halfCheck, this.$config.nodeKind.finishCheck].includes(this.nodeData.nodeKind)) {
- let columnTile = this.nodeData.nodeKind === this.$config.nodeKind.recover ? '报废前工序' : '可检验工序'
- console.log('columnTile',columnTile)
- this.$refs.checkRecoverTable.changeColumnTitle('node1Id', columnTile)
- }
- })
- })
- }
- },
- /**
- * @desc : 当前tab改变事件
- * @author : 张潇木
- * @date : 2023/5/29 14:50
- */
- changeTabs(e) {
- //清除校验
- this.$refs['formInline'].clearValidate()
- // region重新渲染各table
- this.productUserTableFlag = !this.productUserTableFlag
- this.operateUserTableFlag = !this.operateUserTableFlag
- this.$nextTick(() => {
- this.productUserTableFlag = !this.productUserTableFlag
- this.operateUserTableFlag = !this.operateUserTableFlag
- })
- this.defectTableFlag = !this.defectTableFlag
- this.$nextTick(() => {
- this.defectTableFlag = !this.defectTableFlag
- })
- this.jobDefectTableFlag = !this.jobDefectTableFlag
- this.$nextTick(() => {
- this.jobDefectTableFlag = !this.jobDefectTableFlag
- })
- this.pdtTableFlag = !this.pdtTableFlag
- this.$nextTick(() => {
- this.pdtTableFlag = !this.pdtTableFlag
- })
- this.routerTableFlag = !this.routerTableFlag
- this.$nextTick(() => {
- this.routerTableFlag = !this.routerTableFlag
- })
- this.checkRecoverTableFlag = !this.checkRecoverTableFlag
- this.$nextTick(() => {
- this.checkRecoverTableFlag = !this.checkRecoverTableFlag
- this.$nextTick(() => {
- //重新渲染回收/检验设置table列名
- if (e == 'tab3' &&this.$refs.checkRecoverTable
- && [this.$config.nodeKind.recover, this.$config.nodeKind.halfCheck, this.$config.nodeKind.finishCheck].includes(this.nodeData.nodeKind)) {
- let columnTile = this.nodeData.nodeKind === this.$config.nodeKind.recover ? '报废前工序' : '可检验工序'
- console.log('columnTile',columnTile)
- this.$refs.checkRecoverTable.changeColumnTitle('node1Id', columnTile)
- }
- })
- })
- //endregion
- //设置表单数据
- this.setTableData()
- },
- /**
- * @desc : 改变操作模式
- * @author : 张潇木
- * @date : 2023/5/24 16:05
- */
- changeOpnKind() {
- if (this.nodeData.nodeKind === this.$config.nodeKind.register && this.nodeData.opnKind !== this.$config.processType.productCode) {
- this.nodeData.packKind = undefined
- this.nodeData.flgCheckLabel = false
- this.nodeData.pdtLabelKinds = undefined
- }
- //联动处理计件模式
- if ([this.$config.nodeKind.outKiln, this.$config.nodeKind.inKiln, this.$config.nodeKind.register].includes(this.nodeData.nodeKind)) {
- this.nodeData.pieceKind = this.nodeData.opnKind == this.$config.processType.productCode ? this.$config.registerType.singleProduct : this.$config.registerType.special
- }
- //联动处理撤销标识
- if (this.$config.nodeKind.register == this.nodeData.nodeKind) {
- this.nodeData.flgUndo = this.nodeData.opnKind == this.$config.processType.productCode ? true : false
- }
- //联动处理载具模式
- if(![this.$config.processType.dressKilnCar,this.$config.processType.exchangeKilnCar].includes(this.nodeData.opnKind)){
- this.nodeData.carKind=undefined
- }
- this.$refs['formInline'].clearValidate()
- },
- /**
- * @desc : 改变独立检验
- * @author : 张潇木
- * @date : 2023/4/6 16:19
- */
- changeFlgAloneJudge(e) {
- if (!e) {
- this.nodeData.backGradeIds = undefined
- }
- this.checkRecoverRouterList = []
- this.$refs['formInline'].clearValidate()
- },
- /**
- * @desc : 改变回收后到达类型
- * @author : 张潇木
- * @date : 2023/4/4 13:12
- */
- changeRecycledKind(e) {
- this.checkRecoverRouterList = []
- this.nodeData.routerList=this.nodeData.routerList.filter(it=>it.routeType!=this.$config.routeType.recover)
- },
- /**
- * @desc : 选择流程工序
- * @author : 周兴
- * @date : 2023/3/15 16:25
- */
- handleSelectFlowKind() {
- // 工序类型是计件,流程类型是 结束,那么报损标识为false
- if (this.nodeData.nodeKind == this.$config.nodeKind.register) {
- this.nodeData.flgScrap = this.nodeData.flowKind == this.$config.flowKind.end ? false : true
- }
- // 半检、成检 开始工序时,独立检验标识为false
- if ([this.$config.nodeKind.halfCheck, this.$config.nodeKind.finishCheck].includes(this.nodeData.nodeKind)
- && this.nodeData.flowKind == this.$config.flowKind.start) {
- this.nodeData.flgAloneJudge = false
- this.nodeData.backGradeIds = null
- }
- // 回收时,结束工序,回收初始方式只能是后续流程
- if (this.$config.nodeKind.recover===this.nodeData.nodeKind&&this.nodeData.flowKind === this.$config.flowKind.end) {
- this.recycledKindList = this.recycledKindListSocial.filter(it => it.kindCode === this.$config.recycledKind.after)
- this.$nextTick(() => {
- this.nodeData.recycledKind = this.$config.recycledKind.after
- })
- } else {
- this.recycledKindList = this.recycledKindListSocial.copy()
- }
- this.$refs['formInline'].clearValidate()
- },
- /**
- * @desc : 修改用户类别
- * @author : 张潇木
- * @date : 2023/3/1 14:11
- */
- changeUserKind(e) {
- //当切换到生产工号时,删除userTable中设置的操作工号
- if (e == this.$config.userKind.product) {
- this.nodeData.userList =this.nodeData.userList?.filter(it=>it.userKind==this.$config.userKind.product)
- }
- },
- /**
- * @desc : 确定
- * @author : 张潇木
- * @date : 2023/1/5 10:38
- */
- modalOk() {
- //校验
- if (!this.validData()) return
- //设置业务数据
- this.setParams()
- if (!this.isFromIndex) {
- //清空选中
- this.clearSelection()
- //关闭modal
- this.setProcessNodeModalDisplay(null)
- //清空当前选中工序id
- this.setCurrentNodeId(undefined)
- }
- },
- /**
- * @desc : 取消
- * @author : 张潇木
- * @date : 2023/1/5 10:38
- */
- modalCancel() {
- //清空选中
- this.clearSelection()
- //还原工序数据
- let cell = this.graph.getCellById(this.process.currentNodeId)
- cell.setData(this.nodeDataSocial, { overwrite: true })
- //设置显示隐藏状态以及清空当前工序id
- if(this.isFromIndex){
- this.setProcessNodeModalIndexDisplay(null)
- }else{
- this.setProcessNodeModalDisplay(null)
- }
- //清空当前选中工序id
- this.setCurrentNodeId(undefined)
- },
- /**
- * @desc : 清空选中项目 - 解决modal关闭后会选中部分文字的bug
- * @author : 张潇木
- * @date : 2024/3/14 11:21
- */
- clearSelection(){
- let selection = window.getSelection();
- // 如果存在选中的文本范围,则移除选中
- if (selection.rangeCount > 0) {
- selection.removeAllRanges();
- }
- },
- /**
- * @desc : 设置提交数据格式
- * @author : 张潇木
- * @date : 2023/2/16 16:21
- */
- setParams() {
- // 设置表单数据
- this.setTableData()
- // region 设置图形业务数据
- //根据工序id获取工序数据
- let cell = this.graph.getCellById(this.process.currentNodeId)
- //移除非法连线
- this.removeInvalidEdge(cell)
- //设置工序数据
- cell.setData(this.nodeData, { overwrite: true })
- // endregion
- //region 如果是一览页面的编辑,直接提交保存
- if (this.isFromIndex) {
- this.flowFormData.flowLayout = this.graph.toJSON()
- //发送保存网络请求
- this.excute(this.$service.processService, this.$service.processService.processSetting, this.flowFormData).then(res => {
- if (res.code === this.$config.SUCCESS_CODE) {
- // 提示信息
- this.$Message.success(vm.$t('I_001', { 'param': vm.$v('edit') }))
- // 刷新一览明细
- this.$emit('node-modal-ok', { row: this.flowFormData })
- //关闭modal
- this.setProcessNodeModalIndexDisplay(null)
- //清空当前选中工序id
- this.setCurrentNodeId(undefined)
- } else {
- // 如果不成功就提示错误信息
- this.$Message.warning(res.message)
- }
- })
- }
- //endregion
- },
- /**
- * @desc : 设置表单数据 - 判断当前哪些table存在,不存在的table 不需要重新设置数据
- * @author : 张潇木
- * @date : 2023/5/30 17:19
- */
- setTableData(){
- //region操作工号
- if(this.$refs.operateUserTable){
- //将原操作工号删除
- this.nodeData.userList =this.nodeData?.userList?.filter(it=>it.userKind!==this.$config.userKind.operate)||[]
- //取新的操作工号
- this.operateUserList = this.$refs?.operateUserTable?.getTableDataFilter().map((it, index) => {
- return {
- flowId: this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id),
- nodeId: this.process.currentNodeId,
- userId: it.userId,
- userCode: it.userCode,
- userName: it.userName,
- userKind :this.$config.userKind.operate,
- displayNo: index + 1,
- remarks: it.remarks,
- ftyId: this.$store.state.user.ftyId
- }
- })||[]
- //增加到userList中
- this.nodeData.userList=[...this.nodeData.userList,...this.operateUserList]
- }
- //endregion
- //region生产工号
- if(this.$refs.productUserTable){
- //将原操作工号删除
- this.nodeData.userList =this.nodeData?.userList?.filter(it=>it.userKind!==this.$config.userKind.product)||[]
- //取新的生产工号
- this.productUserList = this.$refs?.productUserTable?.getTableDataFilter().map((it, index) => {
- return {
- flowId: this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id),
- nodeId: this.process.currentNodeId,
- userId: it.userId,
- userCode: it.userCode,
- userName: it.userName,
- userKind :this.$config.userKind.product,
- displayNo: index + 1,
- remarks: it.remarks,
- ftyId: this.$store.state.user.ftyId
- }
- })||[]
- //增加到userList中
- this.nodeData.userList=[...this.nodeData.userList,...this.productUserList]
- }
- //endregion
- //region工序在制品
- if(this.$refs.pdtTable){
- this.nodeData.pdtList = this.$refs?.pdtTable?.getTableDataFilter().map((it) => {
- return {
- flowId: this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id),
- nodeId: this.process.currentNodeId,
- pdtModelId: it.pdtModelId,
- pdtModelCode: it.pdtModelCode,
- pdtModelName: it.pdtModelName,
- categoryName: it.categoryName,
- remarks: it.remarks,
- ftyId: this.$store.state.user.ftyId
- }
- })
- this.nodeData.cntPdtModel = this.nodeData.pdtList?.length // 在制品型号数量
- }
- //endregion
- //region载具
- if(this.$refs.carTable){
- this.nodeData.carList = this.$refs?.carTable?.getTableDataFilter().map((it) => {
- return {
- flowId: this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id),
- nodeId: this.process.currentNodeId,
- carModelId: it.carModelId,
- carModelCode: it.carModelCode,
- carModelName: it.carModelName,
- remarks: it.remarks,
- ftyId: this.$store.state.user.ftyId
- }
- })
- this.nodeData.cntCarModel = this.nodeData.carList?.length // 可用载具数量
- }
- //endregion
- //region缺陷
- if(this.$refs.defectTable){
- this.nodeData.defectList = this.$refs?.defectTable?.getTableDataFilter().map((it) => {
- return {
- flowId: this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id),
- nodeId: this.process.currentNodeId,
- pdtDefectId: it.pdtDefectId,
- defectCode: it.defectCode,
- defectName: it.defectName,
- defectTypesName: it.defectTypesName,
- remarks: it.remarks,
- ftyId: this.$store.state.user.ftyId
- }
- })
- this.nodeData.cntQuyDefect = this.nodeData.defectList?.length // 可检缺陷数量
- }
- //endregion
- //region工种缺陷
- if(this.$refs.jobDefectTable) {
- this.nodeData.jobDefectList = this.$refs?.jobDefectTable?.getTableDataFilter().map((it) => {
- return {
- flowId: this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id),
- nodeId: this.process.currentNodeId,
- jobId: it.jobId,
- jobId_Name:it.jobId_Name,
- pdtDefectId: it.pdtDefectId,
- defectCode: it.defectCode,
- defectName: it.defectName,
- defectTypesName: it.defectTypesName,
- remarks: it.remarks,
- ftyId: this.$store.state.user.ftyId
- }
- })
- }
- this.nodeData.cntJobDefect = this.nodeData.flgJobDefect ? this.nodeData.jobDefectList?.length : -1 // 工种缺陷数量,产生缺陷为true时设置成 -1
- //endregion
- //region检验/回收设置
- if(this.$refs.checkRecoverTable) {
- //将原检验/回收设置删除
- this.nodeData.routerList =this?.nodeData?.routerList?.filter(it=>it.routeType==this.$config.routeType.cross)||[]
- //取新的检验/回收设置
- this.checkRecoverRouterList = this.$refs?.checkRecoverTable?.getTableDataFilter().map((it) => {
- return {
- routeType: this.nodeData.nodeKind===this.$config.nodeKind.recover?this.$config.routeType.recover:this.$config.routeType.check,
- flowId: this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id),
- nodeId: this.process.currentNodeId,
- node1Id: it.node1Id,
- node2Id: this.process.currentNodeId,
- backNodeIds: it.backNodeIds,
- productGrade: it.productGrade,
- moldlineTags: it.moldlineTags,
- remarks: it.remarks,
- ftyId: this.$store.state.user.ftyId
- }
- })||[]
- //增加到routerList中
- this.nodeData.routerList=[...this.nodeData.routerList,...this.checkRecoverRouterList]
- }
- //endregion
- //region跨流程工序
- if(this.$refs.routerTable) {
- //将原跨流程工序删除
- this.nodeData.routerList =this.nodeData?.routerList?.filter(it=>it.routeType!==this.$config.routeType.cross)||[]
- //取新的跨流程工序
- this.crossRouterList = this.$refs?.routerTable?.getTableDataFilter().map((it) => {
- return {
- routeType: this.$config.routeType.cross,
- flowId: this.isFromIndex ? this.flowFormData.flowId : parseInt(this.$route.params.id),
- nodeId: this.process.currentNodeId,
- node1Id: this.process.currentNodeId,
- node2Id: it.node2Id,
- node2IdName: it.node2IdName,
- productGrade: it.productGrade,
- moldlineTags: it.moldlineTags,
- remarks: it.remarks,
- ftyId: this.$store.state.user.ftyId
- }
- })||[]
- //增加到routerList中
- this.nodeData.routerList=[...this.nodeData.routerList,...this.crossRouterList]
- }
- //endregion
- },
- /**
- * @desc : 校验数据
- * @author : 张潇木
- * @date : 2023/2/27 11:12
- */
- validData() {
- if(!this.nodeData.nodeName||!this.nodeData.flowKind||!this.nodeData.userKind||!this.nodeData.opnKind||!this.nodeData.pieceKind
- ||([this.$config.processType.dressKilnCar,this.$config.processType.exchangeKilnCar].includes(this.nodeData.opnKind)&&!this.nodeData.carKind)
- ||(this.nodeControl?.recycledKind?.visible&&!this.nodeData.recycledKind)||(this.nodeControl?.judgeGradeIds?.visible&&!this.nodeData.judgeGradeIds)) {
- this.currentTab='tab1'
- this.$nextTick(() => {
- this.$refs['formInline'].validate()
- })
- return
- }
- if(this.nodeControl?.pdtLabelKinds?.visible&&this.nodeData.flgCheckLabel&&(!this.nodeData.pdtLabelKinds||this.nodeData.pdtLabelKinds.isEmptyArray())){
- this.currentTab='tab3'
- this.$nextTick(() => {
- this.$refs['formInline'].validate()
- })
- return
- }
- // 销毁提示弹窗
- this.$Message.destroy()
- // 通过校验标识
- this.nodeData.isValid = true
- return true
- },
- /**
- * @desc : 移除非法连线
- * @author : 张潇木
- * @date : 2023/3/1 13:29
- */
- removeInvalidEdge(cell) {
- // 开始工序不能作为终点
- if (this.nodeData?.flowKind == this.$config.flowKind.start) {
- this.graph.getIncomingEdges(cell)?.forEach(it => {
- this.graph.removeEdge(it.id)
- })
- }
- // 结束工序不能作为起点 特殊处理:(后续流程+回收)允许有出线
- if (this.nodeData?.flowKind == this.$config.flowKind.end) {
- this.graph.getOutgoingEdges(cell)?.forEach(it => {
- this.graph.removeEdge(it.id)
- })
- }
- // 回收工序不能作为终点
- if (this.nodeData?.nodeKind === this.$config.nodeKind.recover) {
- this.graph.getIncomingEdges(cell)?.forEach(it => {
- this.graph.removeEdge(it.id)
- })
- }
- // 回收工序只有回收方式为后续流程时,才可以有出线
- if (this.nodeData?.nodeKind === this.$config.nodeKind.recover && this.nodeData?.recycledKind != this.$config.recycledKind.after) {
- this.graph.getOutgoingEdges(cell)?.forEach(it => {
- this.graph.removeEdge(it.id)
- })
- }
- // 独立检验既不能作为开始也不能作为结束
- if (this.nodeData?.flgAloneJudge) {
- this.graph.getConnectedEdges(cell)?.forEach(it => {
- this.graph.removeEdge(it.id)
- })
- }
- },
- /**
- * @desc : 处理系统数据
- * @author : 周兴
- * @date : 2023/3/15 10:26
- */
- handleDataKindList() {
- // 工序
- this.nodeKindList = this.dataKindList.filter(it => it.kindType === this.$config.dataKind.nodeKind)
- // 流程种类
- this.flowKindList = this.dataKindList.filter(it => it.kindType === this.$config.dataKind.flowKind)
- // 用户类型
- this.userKindList = this.dataKindList.filter(it => it.kindType === this.$config.dataKind.userKind)
- // 计件模式
- this.pieceKindList = this.dataKindList.filter(it => it.kindType === this.$config.dataKind.pieceKind)
- // 操作模式
- this.opnKindList = this.dataKindList.filter(it => it.kindType === this.$config.dataKind.opnKind)
- // 载具模式
- this.carKindList = this.dataKindList.filter(it => it.kindType === this.$config.dataKind.carKind)
- // 工序标签
- this.nodeSysTagsList = this.dataKindList.filter(it => it.kindType === this.$config.dataKind.nodeSysTags)
- // 回收处理方式
- this.recycledKindList = this.dataKindList.filter(it => it.kindType === this.$config.dataKind.recover)
- this.recycledKindListSocial = this.recycledKindList?.copy()
- // 组装方式
- this.packKindList = this.dataKindList.filter(it => it.kindType === this.$config.dataKind.recycledKind)
- // 验证标签
- this.pdtLabelKindsList = this.dataKindList.filter(it => it.kindType === this.$config.dataKind.checkLabel)
- // 工序类别
- this.nodeTypeList = this.dictionaryDataList.filter(it => it.dictCode === this.$config.dictType.nodeType)
- // 工艺类别
- this.techTypeList = this.dictionaryDataList.filter(it => it.dictCode === this.$config.dictType.techType)
- // 成线标签
- this.moldlineTagsList = this.dictionaryDataList.filter(it => it.dictCode === this.$config.dictType.moldlineTag)
- },
- /**
- * @desc : 设置table初始值
- * @author : 张潇木
- * @date : 2023/5/31 10:06
- */
- handleTableDefaultValue() {
- //操作工号
- this.operateUserList=this.nodeData?.userList?.filter(it=>it.userKind==this.$config.userKind.operate)
- //生产工号
- this.productUserList=this.nodeData?.userList?.filter(it=>it.userKind==this.$config.userKind.product)
- //跨工序流程
- this.crossRouterList=this.nodeData?.routerList?.filter(it=>it.routeType==this.$config.routeType.cross)
- //检验/回收设置
- this.checkRecoverRouterList=this.nodeData?.routerList?.filter(it=>it.routeType!==this.$config.routeType.cross)
- }
- },
- created() {
- this.loading = true
- //获取图形对象
- if (this.graph == null) this.graph = Process.graph
- //获取业务数据
- this.nodeData = this.graph.getCellById(this.process.currentNodeId)?.data
- // //记录初始值
- this.nodeDataSocial = JSON.parse(JSON.stringify(this.nodeData))
- // //刷新工序属性控制
- this.nodeControl = this.dataKindList.find(it => it.kindCode === this.nodeData.nodeKind)?.kindTags
- // //处理跨流程工序类别
- // this.handleRouterType()
- // //过滤调工序组并将json解构成新结构数组
- this.allNodes = this.graph.getNodes().filter(it => it.shape == 'custom-image').map((it) => {
- return {
- id: it.id,
- name: it.data.nodeName,
- flowKind: it.data.flowKind,
- nodeKind: it.data.nodeKind,
- flgAloneJudge: it.data.flgAloneJudge
- }
- })
- //计算显示顺序
- if (!this.nodeData.displayNo) {
- this.nodeData.displayNo = this.allNodes.length
- }
- //设置系统基础数据初始值
- this.handleDataKindList()
- //设置table初始值
- this.handleTableDefaultValue()
- this.loading = false
- },
- mounted() {
- //处理可判定分级初始值
- this.handleJudgeGradeDefaultValue()
- this.modalDisplay = true
- },
- beforeDestroy() {
- this.existsFlag = null
- },
- }
- </script>
- <style scoped>
- .ivu-divider-horizontal {
- margin: 10px 0 2px !important;
- }
- .switch {
- height: 28px;
- display: flex;
- align-items: center;
- }
- /deep/ .vxe-select-slots {
- z-index: 5100 !important;
- }
- </style>
|