| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580 |
- <template>
- <div class="index_box">
- <div class="content_box">
- <div class="content_box_tab">
- <div class="task-toolbar">
- <el-input
- class="task-filter-input"
- clearable
- v-model="name"
- placeholder="请输入筛选项"
- @input="seekInput"
- />
- <div class="task-toolbar-actions">
- <el-button type="text" @click="updataTaskList">刷新</el-button>
- <el-button type="text" @click="sortTaskList">排序</el-button>
- </div>
- </div>
- <el-tabs
- v-model="activeName"
- type="card"
- stretch
- @tab-click="tabClickValue"
- >
- <el-tab-pane label="工单" name="0">
- <div class="custom-tree-node">
- <el-tree
- :data="produceTaskList"
- :props="defaultProps"
- node-key="id"
- :highlight-current="true"
- @node-click="handleNodeClick"
- ref="taskListRef"
- :key="treeKey"
- >
- <span class="custom-tree-node" slot-scope="{ node, data }">
- <span>{{ node.label }}</span>
- <span
- style="color: red; font-weight: 700"
- v-if="data.number != '0' && data.number"
- >({{ data.number >= 100 ? '99+' : data.number }})</span
- >
- </span>
- </el-tree>
- </div>
- </el-tab-pane>
- <el-tab-pane label="任务" name="1">
- <div class="custom-tree-node">
- <el-tree
- :data="produceTaskList"
- :props="defaultProps"
- node-key="id"
- :highlight-current="true"
- @node-click="handleNodeClick"
- ref="taskListRef"
- :key="treeKey"
- >
- <span class="custom-tree-node" slot-scope="{ node, data }">
- <span>{{ node.label }}</span>
- <span
- style="color: red; font-weight: 700"
- v-if="data.number != '0' && data.number"
- >({{ data.number >= 100 ? '99+' : data.number }})</span
- >
- </span>
- </el-tree>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- <div style="width: calc(100% - 220px)">
- <div class="seek-list" style="background-color: #157a2c">
- <div>
- <el-input
- style="width: 180px; margin-right: 5px"
- clearable
- v-model="keyWord"
- placeholder="请输入关键字"
- @clear="handleSearch"
- />
- <el-button
- size="mini"
- type="primary"
- style="margin: 0 5px"
- @click="handleSearch"
- >查询</el-button
- >
- <template>
- <el-popover
- placement="top-start"
- width="200"
- trigger="hover"
- content="支持工单编码,产品编码,产品名称,产品规格,牌号,型号,批次号查询。"
- >
- <i
- class="el-icon-question"
- slot="reference"
- style="color: #40a9ff; font-size: 14px"
- ></i> </el-popover
- ></template>
- </div>
- <div
- style="
- width: 55%;
- color: #fff;
- display: flex;
- justify-content: space-between;
- "
- >
- <div>
- <b style="margin-right: 50px">当前工序:{{ title }}</b>
- <b>下道工序:{{ title1 }}</b>
- </div>
- <div> 操作员:{{ info.name }} </div>
- </div>
- </div>
- <ele-split-layout
- space="0px"
- width="45%"
- :resizable="true"
- :min-size="200"
- :max-size="-200"
- :left-style="{
- overflow: 'hidden',
- width: '100%'
- }"
- :responsive="false"
- style="height: calc(100vh - 70px - 50px - 90px)"
- >
- <!-- 左侧 工单列表 -->
- <div class="left_main">
- <div class="top">
- <!-- /工单列表 -->
- <produceOrder
- v-if="produceTaskList.length != 0 && activeName == '0'"
- @workSelect="workSelect"
- @rowClick="rowClick"
- ref="produceOrder"
- @getTaskName="getTaskName"
- :produceTaskInfo="produceTaskInfo"
- >
- </produceOrder>
- <!-- 任务列表 -->
- <task-work-list
- v-if="produceTaskList.length != 0 && activeName == '1'"
- @taskSelect="taskSelect"
- @rowTaskClick="rowTaskClick"
- ref="produceOrder"
- @getTaskName="getTaskName"
- :produceTaskInfo="produceTaskInfo"
- >
- </task-work-list>
- </div>
- </div>
- <!-- 右侧 详情 -->
- <template v-slot:content>
- <div class="right_main">
- <work-order-detail-preview
- v-if="showWorkOrderDetailPreview"
- :key="previewWorkOrderDetailKey"
- :work-order-info="previewWorkOrderInfo"
- />
- <template v-else>
- <!-- 领料 -->
- <div v-if="operationType == 'pick' && activeName == '0'">
- <pickDetails
- ref="pickListRef"
- :workTaskId="workTaskId"
- :taskId="taskObj.id"
- @pickAdd="pickAdd"
- ></pickDetails>
- </div>
- <div v-if="operationType == 'feed' && activeName == '0'">
- <!-- 投料 -->
- <feeding
- :workListIds="workListIds"
- :feedNeedEquipment="feedNeedEquipment"
- @reload="reloadFeeding"
- ></feeding>
- </div>
- <div v-if="operationType == 'job'">
- <!-- // 报工列表 入库 -->
- <warehousing
- v-if="taskObj.id == -1 && activeName == '0'"
- :workListIds="workListIds"
- ref="wareRef"
- :workPlanType="workPlanType"
- ></warehousing>
- <jobBooking
- v-else-if="isFinalCheckProduction && activeName == '0'"
- :workListIds="workListIds"
- ref="jobRef"
- :reportNeedFeed="reportNeedFeed"
- :workPlanType="workPlanType"
- ></jobBooking>
- <task-report
- ref="taskReportRef"
- v-if="activeName == '1' && isFinalCheckProduction"
- style="background: #fff"
- @success="successTask"
- />
- </div>
- <div v-if="operationType == 'workOrder'">
- <workOrderHandover
- :workListIds="workListIds"
- :workData="workData"
- ref="workOrderHandoverRef"
- @cancel="closeWorkOrderHandover"
- ></workOrderHandover>
- </div>
- <!-- 工步 -->
- <div v-if="operationType == 'workStep'"> </div>
- <!-- 质检工序 -->
- <div v-if="operationType == 'inspection'">
- <inspection
- :workListIds="workListIds"
- ref="inspectionRef"
- ></inspection>
- </div>
- <!-- 委外 -->
- <div
- v-if="operationType == 'Outsourcing' && isType == '3'"
- class="right_main_box"
- >
- <outsourcingDetails
- ref="outsourcingListRef"
- @outsourcingAdd="outsourcingAdd"
- v-if="!isStep && !isOutsource && !isPleaseEntrust"
- :chooseType="chooseType"
- ></outsourcingDetails>
- <outsourcing
- :outsourceFormVal="outsourceForm"
- :taskObj="taskObj"
- :workListIds="workListIds[0]"
- :workData="workData"
- @changePlugIn="changePlugIn"
- @changeCancel="changeCancel"
- :chooseType="chooseType"
- v-if="isStep"
- ></outsourcing>
- <!-- -->
- <outsourceList
- :workData="workData"
- :taskObj="taskObj"
- :outsourceFormVal="outsourceForm"
- :chooseType="chooseType"
- @closeForm="closeForm"
- @outScucc="outScucc"
- v-if="isOutsource"
- ></outsourceList>
- <pleaseEntrust
- :outsourceFormVal="outObj"
- @closeForm="closeForm"
- @outScucc="outScucc"
- v-if="isPleaseEntrust"
- ></pleaseEntrust>
- </div>
- </template>
- </div>
- </template>
- </ele-split-layout>
- <footBtn
- @footBtn="footBtn"
- :type="type"
- :singleReportInspection="singleReportInspection"
- style="background: rgba(223, 250, 222, 0.6); padding: 10px"
- :isPreProductionResult="isPreProductionResult"
- :qualityInspectionDisabled="qualityInspectionDisabled"
- :qualityInspectionDisabledMsg="firstArticlePickFeedMsg"
- :activeName="activeName"
- ></footBtn>
- </div>
- </div>
- <!--领料弹框 -->
- <picking
- v-if="pickingShow"
- @close="pickingClose"
- :workListIds="workListIds"
- ></picking>
- <!-- 工艺文件 -->
- <wokePopup ref="wokePopupRef"></wokePopup>
- <!-- 检验报工 -->
- <workPlan ref="jobRefs" @closeWorkPlan="closeWorkPlan"> </workPlan>
- <!-- 工步 -->
- <workStep ref="workStepRef" />
- <!-- 任务 -->
- <TaskDialog ref="taskDialogRef" />
- <!-- 异常 -->
- <createError ref="createErrorRef" />
- <!-- 设备列表 -->
- <device ref="deviceRef" />
- <!-- 周转车列表 -->
- <turnover ref="turnoverRef" />
- <!-- BOM详情 -->
- <BomDetailsPop ref="bomDrawer"></BomDetailsPop>
- <!-- 产前准备 、 过程控制 、产后检测 -->
- <prenatalExamination
- ref="prenatalExaminationRef"
- @close="closePrenatalExamination"
- />
- <!-- 新增请托 -->
- <addPlease ref="addPleaseRef" @refresh="refreshPlease"></addPlease>
- <qualityInspection ref="qualityInspectionRef"></qualityInspection>
- <!-- 手动质检过程记录 -->
- <select-release-rules
- ref="qualityRecordTemplateRef"
- :not-produce-task-config="true"
- @chooseRules="chooseQualityRecordTemplate"
- />
- <quality-record-dialog
- ref="qualityRecordDialogRef"
- :isTempRecord="1"
- @reload="handleQualityRecordSaved"
- />
- <!-- 打码 -->
- <encodingDialog ref="encodingDialogRef" />
- <encodingDialog80x40 ref="encodingDialog80x40Ref" />
- <!-- 打码纸张尺寸选择 -->
- <el-dialog
- title="选择打印纸尺寸"
- :visible.sync="paperSizeDialogVisible"
- width="360px"
- append-to-body
- >
- <el-radio-group
- v-model="selectedPaperSize"
- style="display: flex; flex-direction: column; gap: 10px"
- >
- <el-radio
- v-for="opt in paperSizeOptions"
- :key="opt.value"
- :label="opt.value"
- >{{ opt.label }}</el-radio
- >
- </el-radio-group>
- <div slot="footer">
- <el-button size="small" @click="paperSizeDialogVisible = false"
- >取消</el-button
- >
- <el-button size="small" type="primary" @click="confirmPaperSize"
- >确定</el-button
- >
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import TaskDialog from '@/views/produce/components/taskDialog/index.vue';
- import Search from './components/search.vue';
- import footBtn from './components/footBtn.vue';
- // import produceOrder from './components/produceOrder.vue';
- import produceOrder from './components/new_produceOrder.vue';
- import productionResource from './components/productionResource/index.vue';
- import outsourcing from './components/outsourcing/index.vue';
- import picking from './components/picking/index.vue';
- import wokePopup from './components/picking/wokePopup.vue';
- import inspection from './components/inspection/newIndex.vue';
- // import inspection from './components/inspection/index.vue';
- import pickDetails from './components/picking/details.vue';
- import AssetTree from '@/components/AssetTree/joobIndex.vue';
- import feeding from './components/feeding/index.vue';
- import jobBooking from './components/jobBooking/index.vue';
- import workPlan from './components/workPlan/index.vue';
- import workes from './components/workPlan/components/work.vue';
- import warehousing from './components/warehousing/index.vue';
- // import outsourceList from './components/outsourcing/outsourceList.vue';
- import outsourceList from './components/outsourcing/new_outsourceList.vue';
- import pleaseEntrust from './components/outsourcing/pleaseEntrust.vue';
- import workStep from './components/workStep/index.vue';
- import createError from './components/createError.vue';
- import device from './components/device/index.vue';
- import turnover from './components/turnover/index.vue';
- import outsourcingDetails from './components/outsourcing/details.vue';
- import BomDetailsPop from './components/bom/detailsPop.vue';
- import { parameterGetByCode } from '@/api/system/dictionary-data';
- import addPlease from './components/outsourcing/addPlease.vue';
- import {
- getByTaskId,
- pcCheckOutsource,
- getTaskInstanceById,
- checkOutsourceMaterial,
- listTask,
- factoryworkstationPage,
- nextTask,
- singleListTask,
- pleaseEntrustManagement,
- checkPleaseEntrust,
- checkRepeatPick,
- checkRepeatFeed
- } from '@/api/produce/index';
- import prenatalExamination from './components/prenatalExamination/index.vue';
- import { workorderPage2 } from '@/api/produce/workOrder.js';
- import {
- checkProductionResult,
- getProduceTaskInstanceId
- } from '@/api/producetaskrulerecord/index.js';
- import qualityInspection from './components/qualityInspection/index.vue';
- import selectReleaseRules from '@/components/selectReleaseRules/select-release-rules.vue';
- import qualityRecordDialog from './components/prenatalExamination/releaseRulesDialog.vue';
- import encodingDialog from './components/encodingDialog/index.vue';
- import encodingDialog80x40 from './components/encodingDialog/index80x40.vue';
- import { pageByCurrentUser } from '@/api/workOrderList';
- import taskWorkList from './components/taskWorkList.vue';
- import taskReport from './components/taskReport.vue';
- import { getProduceTaskList } from '@/api/aps';
- import workOrderHandover from './components/workOrderHandover/index.vue';
- import workOrderDetailPreview from './components/workOrderDetailPreview.vue';
- export default {
- components: {
- Search,
- footBtn,
- wokePopup,
- produceOrder,
- productionResource,
- outsourcing,
- picking,
- pickDetails,
- outsourceList,
- feeding,
- AssetTree,
- jobBooking,
- inspection,
- warehousing,
- workStep,
- workPlan,
- TaskDialog,
- createError,
- device,
- turnover,
- outsourcingDetails,
- BomDetailsPop,
- prenatalExamination,
- pleaseEntrust,
- addPlease,
- qualityInspection,
- selectReleaseRules,
- qualityRecordDialog,
- taskWorkList,
- taskReport,
- workOrderHandover,
- workOrderDetailPreview,
- encodingDialog,
- encodingDialog80x40
- },
- data() {
- return {
- name: '',
- activeName: '0',
- taskName: '',
- keyWord: '', //搜索
- title: '',
- type: '',
- loading: false,
- operationType: null,
- popupType: '', // 弹窗
- workListIds: [],
- factoryworkstationList: [],
- title1: '',
- arr: [],
- arrTow: [],
- produceTaskList: [],
- taskDataList: [],
- produceTaskInfo: null,
- isType: '',
- isStep: false,
- outsourceForm: {},
- outObj: {},
- pickingShow: false,
- wokePopup: false,
- workPlanType: '',
- isOutsource: false,
- isPleaseEntrust: false,
- BomObj: {},
- defaultProps: {
- children: 'children',
- label: 'newName'
- },
- defaultPropsTow: {
- children: 'children',
- label: 'name',
- value: 'code'
- },
- feedNeedEquipment: 0, //投料是否要添加生产设备1是0否
- reportNeedFeed: 0, //生产质检是否需要处置再报工1是0否
- singleReportInspection: null, //获取选中的工单是单个还是批量
- workTaskId: null, //选中的工单工序id
- workStepQueryParam: {
- taskId: null,
- workOrderId: null,
- bomCategoryId: null
- },
- isFinalCheckProduction: true,
- isOpen: false,
- buttons: [
- { label: '按钮1' },
- { label: '按钮2' },
- { label: '按钮3' },
- { label: '按钮4' }
- ],
- radius: 120, // 按钮展开的半径
- isOpen: false,
- lastClicked: '无',
- menuItems: [
- { label: 'BOM', action: 'Add' },
- { label: '周转车', action: 'Bold' },
- { label: '设备', action: 'Copy' },
- { label: '产前准备', action: 'Delete' },
- { label: '过程检测', action: 'Edit' },
- { label: '产后检查', action: 'Favorite' }
- ],
- isPreProductionResult: null,
- chooseType: '1',
- isUpdataTask: false,
- treeKey: '1',
- taskData: null,
- taskRequestController: null,
- firstArticlePickFeedReady: true,
- firstArticlePickFeedMsg: '',
- firstArticlePickFeedCheckKey: '',
- /** 底部按钮点击后隐藏右侧工单详情预览(含 type 为空的按钮,如暂停启动) */
- workOrderDetailPreviewSuppressed: false,
- paperSizeDialogVisible: false,
- selectedPaperSize: '100x80',
- paperSizeOptions: [
- { label: '100mm × 80mm', value: '100x80', width: 100, height: 80 },
- { label: '80mm × 40mm', value: '80x40', width: 80, height: 40 }
- ]
- };
- },
- computed: {
- /** 勾选工单/任务且未进入底部按钮业务区时,右侧展示工单详情 */
- showWorkOrderDetailPreview() {
- if (this.workOrderDetailPreviewSuppressed) return false;
- if (this.operationType) return false;
- if (this.activeName === '0') {
- return this.workListIds.length > 0;
- }
- return !!this.taskData;
- },
- /** 与当前勾选 id 对齐,避免仅用 list[0] 在取消再选后仍为旧行引用 */
- previewWorkOrderInfo() {
- if (this.activeName === '0') {
- const list = this.workData?.list;
- if (!list || !list.length) return {};
- const primaryId = this.workListIds[0];
- const row =
- primaryId != null ? list.find((r) => r.id == primaryId) : null;
- const resolved = row || list[0];
- return resolved ? { ...resolved } : {};
- }
- const built = this.buildWorkOrderInfoFromTaskRow(this.taskData);
- return built && Object.keys(built).length ? { ...built } : {};
- },
- previewWorkOrderDetailKey() {
- if (this.activeName === '0') {
- return this.workListIds.length
- ? `wo-${this.workListIds.join(',')}`
- : 'wo-empty';
- }
- return this.taskData?.id != null
- ? `task-${this.taskData.id}`
- : 'task-empty';
- },
- taskObj() {
- return this.$store.state.user.taskObj;
- },
- info() {
- return this.$store.state.user.info;
- },
- hasFirstArticleInspectionTarget() {
- return this.activeName === '0' && this.workListIds.length > 0;
- },
- qualityInspectionDisabled() {
- return (
- this.info?.clientEnvironmentId == 9 &&
- this.hasFirstArticleInspectionTarget &&
- !this.firstArticlePickFeedReady
- );
- },
- rightShow() {
- return (type) => {};
- },
- actionMap() {
- return {
- job: this.handleJob,
- pick: this.handlePick,
- workStep: this.handleWorkStep,
- task: this.handleTask,
- work: this.handleWork,
- device: this.handleDevice,
- bom: this.handleBom,
- error: this.handleError,
- encoding: this.handleEncoding,
- Outsourcing: this.handleOutsourcing,
- qualityRecord: this.handleQualityRecord,
- qualityInspection: this.handleQualityInspection,
- workOrder: this.handleWorkOrder,
- prenatalExamination: () => this.handleInspection(1),
- processDetection: () => this.handleInspection(2),
- postpartumExamination: () => this.handleInspection(3)
- };
- }
- },
- created() {
- this.init();
- this.getTaskList();
- this.getFactoryworkstationPageList();
- this.operationType = null;
- this.workListIds = [];
- },
- methods: {
- tabClickValue() {
- this.abortTaskRequest();
- this.isFinalCheckProduction = false;
- this.operationType = '';
- this.workOrderDetailPreviewSuppressed = false;
- this.resetFirstArticlePickFeedStatus();
- this.getTaskList();
- this.name = '';
- this.seekInput();
- },
- toggleMenu() {
- this.isOpen = !this.isOpen;
- },
- handleItemClick(item) {
- this.lastClicked = item.action;
- // console.log(`Clicked: ${item.label} - ${item.action}`);
- },
- getItemStyle(index) {
- if (!this.isOpen) {
- return {};
- }
- const radius = 120;
- let angle = -180 + (120 / (this.menuItems.length - 1)) * index;
- let rad = (angle * Math.PI) / 180;
- let tx = Math.cos(rad) * radius;
- let ty = Math.sin(rad) * radius;
- return {
- '--tx': `${tx}px`,
- '--ty': `${ty}px`,
- 'transition-delay': `${index * 0.05}s`
- };
- },
- abortTaskRequest() {
- if (this.taskRequestController) {
- this.taskRequestController.abort();
- this.taskRequestController = null;
- }
- },
- isSingleUserTaskMode() {
- return localStorage.getItem('singleUserInfo') == '1';
- },
- getSelectedUserInfo() {
- return JSON.parse(localStorage.getItem('chooseUserInfo'));
- },
- getTaskListRequest() {
- return this.isSingleUserTaskMode()
- ? singleListTask(this.getSelectedUserInfo())
- : listTask();
- },
- syncCurrentTask(list = this.produceTaskList) {
- if (!list?.length) return;
- const currentTask = list[0];
- this.$store.commit('user/setTaskObj', currentTask);
- this.produceTaskInfo = currentTask;
- this.$nextTick(() => {
- this.$refs.taskListRef?.setCurrentKey(currentTask.id);
- });
- },
- async refreshTaskWorkCountByActiveTab() {
- if (this.activeName === '0') {
- await this.getTaskWorkNumber();
- } else if (this.activeName === '1') {
- await this.getTaskWorkList();
- }
- },
- async loadTaskList(options = {}) {
- const {
- withCount = !this.isSingleUserTaskMode(),
- sorted = false,
- abort = false
- } = options;
- if (abort) {
- this.abortTaskRequest();
- }
- const res = await this.getTaskListRequest();
- this.handleTaskList(res);
- if (withCount) {
- await this.refreshTaskWorkCountByActiveTab();
- }
- if (sorted) {
- this.applySortedTaskList();
- }
- },
- // 前端筛选
- seekInput() {
- // console.log(activeName);
- if (this.activeName == '0') {
- if (!this.name) return (this.produceTaskList = this.arr);
- this.produceTaskList = this.produceTaskList.filter((item) => {
- return item.name.indexOf(this.name) > -1;
- });
- } else {
- if (!this.name) return (this.factoryworkstationList = this.arrTow);
- this.factoryworkstationList = this.factoryworkstationList.filter(
- (item) => {
- return item.name.indexOf(this.name) > -1;
- }
- );
- }
- },
- // 折叠悬浮中样式调整
- init() {
- this.$store.dispatch('theme/setCollapse', true);
- },
- async getTaskName(value) {
- if (value.length > 0) {
- let res = await nextTask({
- taskId: this.taskObj.id,
- workOrderIds: value.map((item) => item.id)
- });
- this.title1 = res.data.map((item) => item.taskTypeName).toString();
- } else {
- this.title1 = '';
- }
- },
- handleSearch() {
- let obj = {
- keyWord: this.keyWord,
- taskName: this.taskName
- };
- this.$refs.produceOrder.handleSearch(obj);
- },
- handleNodeClickNew(info) {
- let current = { id: info.id };
- this.$store.commit('user/currentObj', current);
- },
- setRootId(id) {
- this.rootId = id;
- },
- // 点击工序
- handleNodeClick(data) {
- this.feedNeedEquipment = data.feedNeedEquipment;
- this.reportNeedFeed = data.reportNeedFeed;
- this.produceTaskInfo = data;
- this.resetFirstArticlePickFeedStatus();
- // 重置按钮 禁用
- if (this.produceTaskInfo && this.produceTaskInfo.id != data.id) {
- this.isPreProductionResult = null;
- }
- let obj = {
- 1: `${data.workCenterName}-${data.name}(普通工序)`,
- 3: `${data.workCenterName}-${data.name}(质检工序)`,
- 4: `${data.workCenterName}-${data.name}(包装工序)`,
- 5: `${data.workCenterName}-${data.name}(入库工序)`,
- 6: `${data.workCenterName}-${data.name}(质检工序)`
- };
- this.title = obj[data.type] || '';
- this.type = data.type;
- let taskObj = {};
- taskObj = this.produceTaskList.find((item) => item.id === data.id);
- taskObj.isOrderListData = false;
- this.$store.commit('user/setTaskObj', taskObj);
- },
- handleChoose(val) {
- console.log(val);
- },
- // 获取工序列表
- getTaskList() {
- return this.loadTaskList();
- // if (localStorage.getItem('singleUserInfo') == '1') {
- // singleListTask(
- // JSON.parse(localStorage.getItem('chooseUserInfo'))
- // ).then((res) => {
- // res.map((v) => {
- // v.newName = `${v.workCenterName}-${v.name}`;
- // });
- // this.produceTaskList = res;
- // this.arr = JSON.parse(JSON.stringify(this.produceTaskList));
- // if (this.produceTaskList?.length) {
- // this.$store.commit('user/setTaskObj', this.produceTaskList[0]);
- // this.$nextTick(() => {
- // this.$refs.taskListRef?.setCurrentKey(
- // this.produceTaskList[0].id
- // );
- // });
- // this.produceTaskInfo = this.produceTaskList[0];
- // }
- // });
- // } else {
- // listTask().then((res) => {
- // res.map((v) => {
- // v.newName = `${v.workCenterName}-${v.name}`;
- // });
- // this.produceTaskList = res;
- // this.taskDataList = res;
- // this.arr = JSON.parse(JSON.stringify(this.produceTaskList));
- // if (this.produceTaskList?.length) {
- // this.$store.commit('user/setTaskObj', this.produceTaskList[0]);
- // this.$nextTick(() => {
- // this.$refs.taskListRef?.setCurrentKey(
- // this.produceTaskList[0].id
- // );
- // });
- // this.produceTaskInfo = this.produceTaskList[0];
- // }
- // if (this.activeName == '0') {
- // this.getTaskWorkNumber();
- // } else if (this.activeName == '1') {
- // this.getTaskWorkList();
- // }
- // });
- // }
- },
- handleTaskList(res) {
- res.forEach((v) => {
- v.newName = `${v.workCenterName}-${v.name}`;
- });
- this.produceTaskList = res;
- this.taskDataList = res;
- this.arr = JSON.parse(JSON.stringify(res));
- // 默认选中第一个
- this.syncCurrentTask(res);
- },
- getTaskNumber(item) {
- const number = Number(item?.number);
- return Number.isFinite(number) ? number : 0;
- },
- sortTaskListByNumber(list) {
- return [...list]
- .map((item, index) => ({ item, index }))
- .sort((a, b) => {
- const aNumber = this.getTaskNumber(a.item);
- const bNumber = this.getTaskNumber(b.item);
- const aHasNumber = aNumber > 0;
- const bHasNumber = bNumber > 0;
- if (aHasNumber !== bHasNumber) {
- return aHasNumber ? -1 : 1;
- }
- if (aHasNumber && aNumber !== bNumber) {
- return bNumber - aNumber;
- }
- return a.index - b.index;
- })
- .map(({ item }) => item);
- },
- applySortedTaskList() {
- this.taskDataList = this.sortTaskListByNumber(this.taskDataList);
- this.produceTaskList = this.taskDataList;
- this.arr = JSON.parse(JSON.stringify(this.taskDataList));
- this.treeKey = Date.now();
- this.syncCurrentTask();
- },
- async sortTaskList() {
- await this.loadTaskList({
- withCount: true,
- sorted: true,
- abort: true
- });
- },
- async fetchTaskWorkCount(apiFn) {
- this.taskRequestController = new AbortController();
- const signal = this.taskRequestController.signal;
- try {
- const requests = this.taskDataList.map((item) =>
- apiFn(
- {
- pageNum: 1,
- size: 5000,
- taskId: item.id
- },
- { signal }
- )
- );
- const results = await Promise.all(requests);
- this.taskDataList = this.taskDataList.map((item, index) => ({
- ...item,
- number: results[index]?.count || 0
- }));
- this.produceTaskList = this.taskDataList;
- this.treeKey = Date.now();
- } catch (err) {
- if (err?.name == 'CanceledError' || err?.name == 'AbortError') {
- return;
- }
- console.error(err);
- }
- },
- //获取工序下所有的工单集合
- async getTaskWorkNumber() {
- await this.fetchTaskWorkCount(workorderPage2);
- // for (const [index, item] of this.taskDataList.entries()) {
- // await workorderPage2({
- // pageNum: 1,
- // size: 5000,
- // taskId: item.id
- // }).then((res) => {
- // this.taskDataList[index].number = res.count;
- // });
- // }
- // this.produceTaskList = this.taskDataList;
- // this.treeKey = Date.now();
- },
- //获取工序下所有的任务集合
- async getTaskWorkList() {
- await this.fetchTaskWorkCount(pageByCurrentUser);
- // for (const [index, item] of this.taskDataList.entries()) {
- // await pageByCurrentUser({
- // pageNum: 1,
- // size: 5000,
- // taskId: item.id
- // }).then((res) => {
- // this.taskDataList[index].number = res.count;
- // });
- // }
- // this.produceTaskList = this.taskDataList;
- // this.treeKey = Date.now();
- },
- // 获取工位
- getFactoryworkstationPageList() {
- factoryworkstationPage({ pageNum: 1, size: 99999999 }).then((res) => {
- this.factoryworkstationList = res.list;
- this.arrTow = JSON.parse(JSON.stringify(this.factoryworkstationList));
- // newName
- });
- },
- changeCancel(activeType) {
- this.isStep = false;
- this.chooseType = activeType;
- // this.$nextTick(() => {
- // this.$refs.outsourcingListRef.getDataList(this.workData.list[0].code);
- // });
- if (this.chooseType == '1') {
- this.$nextTick(() => {
- this.$refs.outsourcingListRef.getDataList(
- this.workData.list[0].code
- );
- });
- } else if (this.chooseType == '2') {
- this.$nextTick(() => {
- this.$refs.outsourcingListRef.getPleaseData(
- this.workData.list[0].code
- );
- });
- }
- },
- closeForm() {
- this.isOutsource = false;
- this.isPleaseEntrust = false;
- this.$nextTick(() => {
- this.$refs.outsourcingListRef.getDataList(this.workData.list[0].code);
- });
- },
- outScucc() {
- // this.operationType = null;
- this.isOutsource = false;
- this.isPleaseEntrust = false;
- this.$nextTick(() => {
- this.$refs.outsourcingListRef.getDataList(this.workData.list[0].code);
- });
- },
- updataTaskList() {
- this.isUpdataTask = true;
- this.getTaskList();
- },
- // 切换组件
- async changePlugIn(e, index) {
- if (index == '1') {
- this.outObj = e;
- let req = {
- taskId: e.taskId,
- taskIds: e.taskIds,
- workOrderId: e.workOrderId,
- quantity: e.formedNumLast
- };
- const URL =
- index == '1' ? checkOutsourceMaterial : checkPleaseEntrust;
- const res = await URL(req);
- this.outObj = { ...res.data, ...this.outsourceForm, ...this.outObj };
- this.isStep = false;
- this.isOutsource = true;
- } else if (index == '2') {
- this.outObj = e;
- let req = {
- taskId: e.taskId,
- taskIds: e.taskIds,
- workOrderId: e.workOrderId,
- quantity: e.formedNumLast
- };
- const res = await checkPleaseEntrust(req);
- this.outObj = { ...res.data, ...this.outsourceForm, ...this.outObj };
- this.isStep = false;
- this.isPleaseEntrust = true;
- // this.isOutsource = true;
- console.log(res, '请托的结果');
- }
- },
- renderContent(h, { node, data, store }) {
- // Use createElement syntax instead of JSX
- return h('span', { class: 'custom-tree-node' }, [
- // h('span', node.label),
- h(
- 'el-badge',
- {
- props: {
- value: data.number != '0' ? data.number : '',
- max: 99
- },
- class: 'item'
- },
- [h('span', node.label)]
- )
- ]);
- },
- workSelect(data) {
- this.workOrderDetailPreviewSuppressed = false;
- this.workTaskId = data.list.length > 0 ? data.list[0].taskId : null;
- this.workStepQueryParam.taskId =
- data.list.length > 0 ? data.list[0].taskId : null;
- this.workStepQueryParam.workOrderId =
- data.list.length > 0 ? data.list[0].id : null;
- this.workStepQueryParam.bomCategoryId =
- data.list.length > 0 ? data.list[0].bomCategoryId : null;
- this.singleReportInspection =
- data.list.length > 0 ? data.list[0].singleReport : null; //获取选中的工单是单个还是批量
- this.isStep = false;
- this.operationType = null;
- this.workListIds = data.ids;
- this.workData = data;
- this.checkProductionResult();
- // this.refreshFirstArticlePickFeedStatus();
- },
- taskSelect(data) {
- this.workOrderDetailPreviewSuppressed = false;
- this.taskData = data.list && data.list.length > 0 ? data.list[0] : null;
- this.resetFirstArticlePickFeedStatus();
- },
- buildWorkOrderInfoFromTaskRow(row) {
- if (!row) return {};
- return {
- id: row.workOrderId || row.mesWorkOrderId,
- singleReport: row.singleReport,
- code: row.mesWorkOrderCode,
- apsWorkOrderCode: row.workOrderCode || row.apsWorkOrderCode,
- productionPlanCode: row.productionPlanCode,
- productCode: row.productCode,
- productName: row.productName,
- specification: row.specification,
- model: row.model,
- brandNo: row.brandNo,
- batchNo: row.batchNo,
- formingNum: row.quantity ?? row.formingNum,
- unit: row.measuringUnit ?? row.unit,
- formingWeight: row.weight ?? row.formingWeight,
- weightUnit: row.newWeightUnit ?? row.weightUnit,
- formedNum: row.formedNum,
- formedWeight: row.formedWeight,
- productionCodes: row.productionCodes,
- outsourceStatus: row.outsourceStatus,
- entrustStatus: row.entrustStatus,
- colorKey: row.colorKey,
- modelKey: row.modelKey,
- planStartTime: row.planStartTime,
- planCompleteTime: row.planCompleteTime,
- startTime: row.startTime ?? row.realStartTime,
- completeTime: row.endTime ?? row.realEndTime ?? row.completeTime,
- createTime: row.createTime,
- produceRoutingName: row.produceRoutingName,
- productionPlanId: row.productionPlanId,
- taskId: row.taskId
- };
- },
- pickingWokeClose() {
- this.wokePopup = false;
- },
- async getCodeData(req) {
- await parameterGetByCode({ code: 'enable_quality_plus' }).then(
- (res) => {
- if (res.value == '1') {
- this.$refs.jobRefs.open(req);
- }
- }
- );
- },
- closeWorkPlan(type) {
- this.workPlanType = type;
- },
- async checkQualityResult() {
- if (
- this.produceTaskInfo &&
- this.workListIds.length > 0 &&
- this.produceTaskInfo.id != -1
- ) {
- // 判断是否要求先完成 产前准备等事项
- const result = await checkProductionResult({
- produceTaskId: this.produceTaskInfo.id,
- workOrderIds: this.workListIds
- });
- return result;
- }
- },
- /** 投料前首件两检校验(与报工逻辑一致) */
- async validateFeedFirstArticle() {
- if (this.activeName === '1') {
- const row = this.taskData;
- if (!row) {
- this.$message.warning('请选择一条任务单进行投料');
- return false;
- }
- if (
- this.taskObj.id != '-1' &&
- row.hasFirstArticleDualInspection == '1' &&
- row.totalFirstArticleDualInspectionStatus != '2'
- ) {
- this.$message.warning('请先完成首件两检再投料');
- return false;
- }
- return true;
- }
- if (!this.checkWorkOrder({ min: 1 })) return false;
- if (this.taskObj.id != '-1') {
- const result = await this.checkQualityResult();
- if (!result?.firstArticleDualInspectionResult) {
- this.$message.warning('请完成首件两检再投料!');
- return false;
- }
- }
- return true;
- },
- async footBtn(t) {
- this.workPlanType = '';
- if (['work', 'workStep', 'task'].includes(t)) {
- this.popupType = t;
- } else if (t == 'workOrder') {
- console.log(this.workData, 'workData');
- if (this.workListIds.length == 0) {
- this.$message.warning('请选择工单');
- return;
- }
- if (this.workListIds.length > 1) {
- this.$message.warning('工单交接只能选择一个工单');
- return;
- }
- this.operationType = t;
- } else if (t !== 'feed') {
- this.operationType = t;
- }
- if (!this.checkTaskSelected()) return;
- if (t === 'feed') {
- if (!(await this.validateFeedFirstArticle())) return;
- this.operationType = 'feed';
- }
- this.workOrderDetailPreviewSuppressed = true;
- const handler = this.actionMap[t];
- if (handler) {
- await handler.call(this);
- }
- },
- checkTaskSelected() {
- const taskObj = this.$store.state.user.taskObj;
- if (!taskObj || Object.keys(taskObj).length === 0) {
- this.$message.warning('请选择工序');
- return false;
- }
- return true;
- },
- checkWorkOrder({ min = 1, max = Infinity, msg = {} }) {
- const len = this.workListIds.length;
- if (len < min) {
- this.$message.warning(msg.min || '请选择工单!');
- return false;
- }
- if (len > max) {
- this.$message.warning(msg.max || '只能选择一个工单!');
- return false;
- }
- return true;
- },
- resetFirstArticlePickFeedStatus() {
- this.firstArticlePickFeedReady = true;
- this.firstArticlePickFeedMsg = '';
- this.firstArticlePickFeedCheckKey = '';
- },
- getFirstArticleWorkOrderId(row = {}) {
- return row.workOrderId || row.mesWorkOrderId || row.id;
- },
- getFirstArticleInspectionRows() {
- const selectedIds = new Set(this.workListIds.map((id) => String(id)));
- const rows = this.workData?.list || [];
- const selectedRows = rows.filter((row) =>
- selectedIds.has(String(this.getFirstArticleWorkOrderId(row)))
- );
- return selectedRows.length
- ? selectedRows
- : this.workListIds.map((id) => ({ id }));
- },
- hasNonZeroCheckData(data, keys) {
- if (Array.isArray(data)) {
- return data.some((item) => this.hasNonZeroCheckData(item, keys));
- }
- if (data && typeof data === 'object') {
- const values = keys?.length
- ? keys.map((key) => data[key])
- : Object.values(data);
- return values.some((value) => this.hasNonZeroCheckData(value));
- }
- const num = Number(data);
- if (!Number.isNaN(num)) {
- return num !== 0;
- }
- return Boolean(data);
- },
- async checkFirstArticlePickFeed(row) {
- const workOrderId = this.getFirstArticleWorkOrderId(row);
- if (!workOrderId) {
- return { pickDone: false, feedDone: false };
- }
- const [pickRes, feedRes] = await Promise.all([
- checkRepeatPick({ workOrderId }),
- checkRepeatFeed([
- {
- currentTaskDiagram: row.currentTaskDiagram,
- workOrderId
- }
- ])
- ]);
- return {
- pickDone: this.hasNonZeroCheckData(pickRes?.data),
- feedDone: this.hasNonZeroCheckData(feedRes?.data, [
- 'feedFormed',
- 'feedQuantity',
- 'allFeedQuantity'
- ])
- };
- },
- getFirstArticlePickFeedMsg(results) {
- const needPick = results.some((item) => !item.pickDone);
- const needFeed = results.some((item) => !item.feedDone);
- if (needPick && needFeed) {
- return '请先完成领料、投料后再进行首件两检';
- }
- if (needPick) {
- return '请先完成领料后再进行首件两检';
- }
- if (needFeed) {
- return '请先完成投料后再进行首件两检';
- }
- return '';
- },
- async refreshFirstArticlePickFeedStatus() {
- if (this.info?.clientEnvironmentId != 9 || this.activeName !== '0') {
- this.resetFirstArticlePickFeedStatus();
- return true;
- }
- if (!this.hasFirstArticleInspectionTarget) {
- this.resetFirstArticlePickFeedStatus();
- return true;
- }
- const rows = this.getFirstArticleInspectionRows();
- const checkKey = `${this.activeName}-${rows
- .map((row) => this.getFirstArticleWorkOrderId(row))
- .join(',')}`;
- this.firstArticlePickFeedCheckKey = checkKey;
- this.firstArticlePickFeedReady = false;
- this.firstArticlePickFeedMsg = '正在检查领料、投料状态';
- try {
- const results = await Promise.all(
- rows.map((row) => this.checkFirstArticlePickFeed(row))
- );
- if (this.firstArticlePickFeedCheckKey !== checkKey) {
- return this.firstArticlePickFeedReady;
- }
- const msg = this.getFirstArticlePickFeedMsg(results);
- this.firstArticlePickFeedReady = !msg;
- this.firstArticlePickFeedMsg = msg;
- return this.firstArticlePickFeedReady;
- } catch (error) {
- if (this.firstArticlePickFeedCheckKey === checkKey) {
- this.firstArticlePickFeedReady = false;
- this.firstArticlePickFeedMsg =
- '领料、投料状态检查失败,请稍后重试';
- }
- return false;
- }
- },
- async validateFirstArticlePickFeedBeforeInspection() {
- const ready = await this.refreshFirstArticlePickFeedStatus();
- if (!ready) {
- this.$message.warning(
- this.firstArticlePickFeedMsg ||
- '请先完成领料、投料后再进行首件两检'
- );
- }
- return ready;
- },
- async getFirstArticleConfig() {
- const res = await parameterGetByCode({
- code: 'first_article_dual_inspection_for_report'
- });
- return res.value;
- },
- /* ================== job ================== */
- async handleJob() {
- if (this.activeName == '1') {
- return this.handleTaskJob();
- }
- return this.handleWorkOrderJob();
- },
- async handleTaskJob() {
- this.isFinalCheckProduction = false;
- const row = this.taskData;
- // if (row.disposalStatus == '0') {
- // return this.$message.warning('请先接收任务才能进行报工!');
- // }
- // if (row.disposalStatus == '2') {
- // return this.$message.warning('该任务单已被拒绝接收不能进行报工!');
- // }
- if (!this.checkTaskJob(row)) return;
- this.isFinalCheckProduction = true;
- const currentRow = this.buildCurrentRow(row);
- const form = this.buildForm(row);
- this.$nextTick(() => {
- this.$refs.taskReportRef.open('report', currentRow, form);
- });
- },
- checkTaskJob(row) {
- if (!row) {
- this.$message.warning('请选择一条任务单进行报工');
- return false;
- }
- // 任务状态校验
- const statusMessageMap = {
- 0: '请先接收任务再报工',
- 2: '该任务单已被拒绝'
- };
- if (statusMessageMap[row.disposalStatus]) {
- this.$message.warning(statusMessageMap[row.disposalStatus]);
- return false;
- }
- // 首件两检校验
- if (
- this.taskObj.id != '-1' &&
- row.hasFirstArticleDualInspection == '1' &&
- row.totalFirstArticleDualInspectionStatus != '2'
- ) {
- this.$message.warning('请先完成首件两检再报工');
- return false;
- }
- return true;
- },
- buildCurrentRow(row) {
- return {
- assignCode: row.assignCode,
- mesWorkOrderCode: row.mesWorkOrderCode,
- workOrderCode: row.workOrderCode,
- productionPlanCode: row.productionPlanCode,
- produceRoutingName: row.produceRoutingName,
- formingNum: row.formingNum,
- assignTeamName: row.assignTeamName,
- formingWeight: row.formingWeight,
- planStartTime: row.planStartTime,
- planCompleteTime: row.planCompleteTime,
- startTime: row.startTime,
- endTime: row.endTime,
- firstTaskId: row.firstTaskId,
- taskName: row.taskName,
- firstTaskName: row.firstTaskName,
- assigneeType: row.assigneeType?.desc || '',
- assigneeName: row.assigneeName,
- weight: row.weight,
- quantity: row.quantity,
- durationText: row.durationText,
- apsAssigneeId: row.id,
- batchNo: row.batchNo,
- productCode: row.productCode,
- productName: row.productName,
- specification: row.specification,
- newWeightUnit: row.newWeightUnit,
- measuringUnit: row.measuringUnit,
- reportQuantityReported: row.reportQuantity || 0,
- lossQuantityReported: row.lossQuantity || 0
- };
- },
- buildForm(row) {
- console.log();
- const actualQuantity = this.add(
- row.reportQuantity ? row.reportQuantity : 0,
- row.lossQuantity ? row.lossQuantity : 0
- );
- const remainingQuantity = Math.max(
- this.sub(row.quantity || 0, actualQuantity),
- 0
- );
- return {
- realStartTime: row.realStartTime,
- realEndTime: row.realEndTime,
- qualifiedQuantity: row.qualifiedQuantity,
- qualifiedWeight: row.qualifiedWeight,
- unqualifiedQuantity: row.unqualifiedQuantity,
- unqualifiedWeight: row.unqualifiedWeight,
- reportQuantity: remainingQuantity,
- lossQuantity: 0,
- remark: row.assigneeRemark
- };
- },
- async handleWorkOrderJob() {
- if (!this.checkWorkOrder({ min: 1 })) return;
- this.isFinalCheckProduction = false;
- if (this.taskObj.id != '-1') {
- const result = await this.checkQualityResult();
- console.log(result, 'result');
- if (!result?.firstArticleDualInspectionResult) {
- return this.$message.warning('请完成首件两检再报工!');
- }
- }
- this.isFinalCheckProduction = true;
- if ([2, 3, 6].includes(this.taskObj.type)) {
- this.getCodeData({
- taskId: this.taskObj.id,
- workOrderId: this.workListIds[0],
- data: this.workData.list
- });
- }
- },
- /* ================== pick ================== */
- handlePick() {
- if (this.activeName != '0') return;
- if (!this.checkWorkOrder({ min: 1 })) return;
- this.$nextTick(() => {
- this.$refs.pickListRef.getList(this.workListIds);
- });
- },
- /* ================== workStep ================== */
- handleWorkStep() {
- if (this.activeName != '0') return;
- if (
- !this.checkWorkOrder({
- min: 1,
- max: 1,
- msg: { max: '工步只能选择一个工单!' }
- })
- )
- return;
- this.$refs.workStepRef.open(this.workStepQueryParam);
- },
- /* ================== task ================== */
- handleTask() {
- if (this.activeName != '0') return;
- if (
- !this.checkWorkOrder({
- min: 1,
- max: 1,
- msg: { max: '任务只能选择一个工单!' }
- })
- )
- return;
- this.$refs.taskDialogRef.open(
- this.workStepQueryParam,
- this.workData.list[0]
- );
- },
- /* ================== work ================== */
- async handleWork() {
- const req =
- this.activeName === '0'
- ? this.getWorkOrderForWork()
- : this.getTaskForWork();
- if (!req) return;
- await this.openWorkFile(req);
- },
- getWorkOrderForWork() {
- const valid = this.checkWorkOrder({
- min: 1,
- max: 1,
- msg: { max: '工艺文件只能选择一个工单!' }
- });
- if (!valid) return null;
- const row = this.workData?.list?.[0];
- if (!row) return null;
- return this.buildCraftFileReq(row, this.workListIds[0]);
- },
- getTaskForWork() {
- if (!this.taskData) {
- this.$message.warning('请选择一条任务单');
- return null;
- }
- return this.buildCraftFileReq(this.taskData, this.taskData.workOrderId);
- },
- getCraftFileProductCode(row) {
- return (
- row?.productCode ||
- row?.materialCode ||
- row?.categoryCode ||
- row?.productCategoryCode ||
- ''
- );
- },
- buildCraftFileReq(row, workOrderId) {
- return {
- taskId: this.taskObj.id,
- workOrderId:
- workOrderId || row?.workOrderId || row?.mesWorkOrderId || row?.id,
- productCode: this.getCraftFileProductCode(row)
- };
- },
- async openWorkFile(req) {
- const res = await parameterGetByCode({
- code: 'mes_craft_file_by_category_code'
- });
- const byCategory = res?.value === '1';
- if (byCategory) {
- this.$refs.wokePopupRef.openTwo(req);
- } else {
- this.$refs.wokePopupRef.open(req);
- }
- },
- /* ================== device ================== */
- handleDevice() {
- // if (this.activeName != '0') return;
- if (!this.taskObj.id) {
- return this.$message.warning('请选择工序');
- }
- this.$refs.deviceRef.open(this.taskObj.id);
- },
- /* ================== encoding ================== */
- handleEncoding() {
- if (this.activeName != '0') return;
- if (
- !this.checkWorkOrder({
- min: 1,
- msg: { min: '请选择工单!' }
- })
- )
- return;
- this.selectPaperSizeAndOpenEncoding();
- },
- selectPaperSizeAndOpenEncoding() {
- this.selectedPaperSize = '100x80';
- this.paperSizeDialogVisible = true;
- },
- confirmPaperSize() {
- const size = this.selectedPaperSize;
- this.paperSizeDialogVisible = false;
- this.$nextTick(() => {
- if (size === '80x40') {
- this.$refs.encodingDialog80x40Ref.open(this.workData.list);
- } else {
- this.$refs.encodingDialogRef.open(this.workData.list);
- }
- });
- },
- /* ================== bom ================== */
- handleBom() {
- const isWorkOrder = this.activeName === '0';
- const row = isWorkOrder ? this.getWorkOrderRow() : this.getTaskRow();
- if (!row) return;
- this.openBomDrawer(row);
- },
- getWorkOrderRow() {
- const valid = this.checkWorkOrder({
- min: 1,
- max: 1,
- msg: { max: '查看BOM详情只能选择一个工单!' }
- });
- if (!valid) return null;
- return this.workData?.list?.[0] || null;
- },
- getTaskRow() {
- if (!this.taskData) {
- this.$message.warning('请选择一条任务单');
- return null;
- }
- return this.taskData;
- },
- openBomDrawer(row) {
- this.$refs.bomDrawer.open({
- categoryId: row.categoryId,
- categoryName: row.bomCategoryName,
- code: row.code || '',
- versions: row.bomCategoryVersions,
- rootPathIdParent: row.categoryLevelPathIdParent || '',
- isProduct: true,
- bomType: Number(row.bomType),
- isTemp: 0
- });
- },
- /* ================== Outsourcing ================== */
- handleOutsourcing() {
- if (this.activeName != '0') return;
- if (
- !this.checkWorkOrder({
- min: 1,
- max: 1,
- msg: { max: '委外请托工序只能选择一个工单!' }
- })
- )
- return;
- this.handOutsource(this.workListIds[0]);
- },
- /* ================== 产前 / 过程 / 产后 ================== */
- handleInspection(type) {
- if (this.activeName != '0') return;
- if (
- !this.checkWorkOrder({
- min: 1,
- max: 1
- })
- )
- return;
- this.$refs.prenatalExaminationRef.open(
- this.workData.list[0],
- this.produceTaskInfo,
- type
- );
- },
- /* ================== 手动质检过程记录 ================== */
- handleQualityRecord() {
- if (this.activeName != '0') return;
- if (
- !this.checkWorkOrder({
- min: 1,
- max: 1,
- msg: { max: '质检记录只能选择一个工单!' }
- })
- )
- return;
- if (!this.produceTaskInfo || !this.produceTaskInfo.id) {
- return this.$message.warning('请选择工序');
- }
- this.$refs.qualityRecordTemplateRef.open(2, this.produceTaskInfo.id);
- },
- async chooseQualityRecordTemplate(rule) {
- const workOrderInfo = this.workData?.list?.[0];
- if (!rule || !workOrderInfo || !this.produceTaskInfo) return;
- const produceTaskInstanceInfo = await getProduceTaskInstanceId(
- workOrderInfo.id,
- this.produceTaskInfo.id
- );
- const productionInfo = this.buildQualityRecordInfo(
- rule,
- produceTaskInstanceInfo
- );
- this.$refs.qualityRecordDialogRef.open(productionInfo, workOrderInfo);
- },
- buildQualityRecordInfo(rule, produceTaskInstanceInfo = {}) {
- return {
- recordId: null,
- executeStatus: 0,
- executeMethod: rule.executeMethod || 0,
- itemType: 2,
- produceTaskConfigId: rule.produceTaskConfigId || null,
- produceTaskId: this.produceTaskInfo.id,
- produceTaskName:
- produceTaskInstanceInfo.name ||
- this.produceTaskInfo.name ||
- this.produceTaskInfo.taskTypeName ||
- '',
- produceTaskInstanceId: produceTaskInstanceInfo.id || null,
- reportWorkType: 2,
- brandNo:
- rule.brandNo ||
- this.workData?.list?.[0]?.brandNo ||
- this.workData?.list?.[0]?.brandNum ||
- '',
- recordRulesExecuteMethodId:
- rule.executeMethodId || rule.recordRulesExecuteMethodId || null,
- recordRulesExecuteMethodName:
- rule.executeMethodName || rule.recordRulesExecuteMethodName || '',
- ruleId: rule.id,
- ruleName: rule.name,
- details: []
- };
- },
- handleQualityRecordSaved() {
- this.$refs.produceOrder?.reload?.();
- },
- /* ================== error ================== */
- handleError() {
- if (this.activeName == '0') {
- if (this.workListIds.length !== 1) {
- return this.$message.warning('异常只能选择一个工单!');
- }
- this.$refs.createErrorRef.open('add', this.workData.list[0]);
- }
- },
- /* ================== 首件两检 ================== */
- async handleQualityInspection() {
- if (this.activeName == '0') {
- if (
- !this.checkWorkOrder({
- min: 1,
- max: 1,
- msg: { max: '首件两检只能选择一个工单!' }
- })
- )
- return;
- const item = this.workData?.list?.[0];
- if (!item) return null;
- if (!(await this.validateFirstArticlePickFeedBeforeInspection())) {
- return;
- }
- const req = this.buildCraftFileReq(item, this.workListIds[0]);
- this.$refs.qualityInspectionRef.open(
- this.workData.list[0],
- this.produceTaskInfo,
- '',
- req
- );
- } else {
- console.log(this.taskData, 'this.taskData');
- if (!this.taskData) {
- return this.$message.warning('请选择一条任务单进行首件两检');
- }
- if (this.taskData.disposalStatus == '0') {
- return this.$message.warning('请先接收任务再做首件两检');
- }
- if (this.taskData.disposalStatus == '2') {
- return this.$message.warning('该任务单已被拒绝');
- }
- this.selfRequest(this.taskData);
- }
- },
- /* ================== workOrder ================== */
- handleWorkOrder() {},
- closeWorkOrderHandover() {
- this.operationType = null;
- this.workOrderDetailPreviewSuppressed = false;
- },
- successTask() {
- this.isFinalCheckProduction = false;
- this.$nextTick(() => {
- this.$refs.produceOrder && this.$refs.produceOrder.reload();
- });
- },
- async selfRequest(row) {
- let params = {
- routingId: row.produceRoutingId,
- pageNum: 1,
- size: -1,
- isDetail: true
- };
- const result = await getProduceTaskList(params);
- const taskData = result.list.find(
- (item) => item.sourceTaskId === row.taskId
- );
- // const item = this.workData?.list?.[0];
- // console.log(item, 'item1111');
- // if (!item) return null;
- const req = this.buildCraftFileReq(
- row,
- row.workOrderId || row.mesWorkOrderId || this.workListIds[0]
- );
- this.$refs.qualityInspectionRef.open(row, taskData, 1, req);
- },
- outsourcingAdd(type, activeName) {
- this.chooseType = activeName;
- this.getTaskInstanceByIdFn(this.workListIds[0]);
- if (this.chooseType == '2') {
- this.isStep = true;
- } else {
- this.isOutsource = true;
- }
- },
- refreshPlease() {
- this.$nextTick(() => {
- this.$refs.outsourcingListRef.getPleaseData(
- this.workData.list[0].code
- );
- });
- },
- handOutsource(workOrderId) {
- this.isType = '';
- // return
- let param = {
- taskId: this.taskObj.id,
- workOrderId: workOrderId
- };
- pcCheckOutsource(param).then((res) => {
- this.outsourceForm = {
- ...res.data
- };
- // this.outsourceForm.name = this.taskObj.name + '委外';
- this.isStep = false;
- this.isOutsource = false;
- this.isPleaseEntrust = false;
- if (res.data.outsource) {
- this.isType = '3';
- if (!this.isStep && !this.isOutsource && !this.isPleaseEntrust) {
- this.$nextTick(() => {
- this.$refs.outsourcingListRef.getDataList(
- this.workData.list[0].code
- );
- });
- }
- // this.getTaskInstanceByIdFn(workOrderId);
- // this.$refs.outsourceListRef.getList(workOrderId);
- // console.log(this.workData[0].list, 'this.workData.list');
- } else {
- return this.$message.warning('此工序不能委外/请托');
- }
- });
- },
- getDecimalLength(num) {
- return (num.toString().split('.')[1] || '').length;
- },
- toInteger(num) {
- const len = this.getDecimalLength(num);
- return {
- int: Math.round(num * Math.pow(10, len)),
- factor: Math.pow(10, len)
- };
- },
- add(a, b) {
- const { int: aInt, factor: aFactor } = this.toInteger(a);
- const { int: bInt, factor: bFactor } = this.toInteger(b);
- const maxFactor = Math.max(aFactor, bFactor);
- return (
- (aInt * (maxFactor / aFactor) + bInt * (maxFactor / bFactor)) /
- maxFactor
- );
- },
- sub(a, b) {
- const { int: aInt, factor: aFactor } = this.toInteger(a);
- const { int: bInt, factor: bFactor } = this.toInteger(b);
- const maxFactor = Math.max(aFactor, bFactor);
- return (
- (aInt * (maxFactor / aFactor) - bInt * (maxFactor / bFactor)) /
- maxFactor
- );
- },
- //获取工单列表
- getTaskInstanceByIdFn(workOrderId) {
- getTaskInstanceById(workOrderId).then((res) => {
- let { data } = res;
- if (data.length) {
- data = data.filter((item) => item.taskId != -2);
- let arr = data.findIndex(
- (item) => item.sourceTaskId == this.taskObj.id
- );
- if (arr != -1) {
- data.splice(0, arr);
- }
- this.$set(this.outsourceForm, 'newStepsList', data);
- }
- });
- },
- async pickAdd(type, dataList) {
- if (this.workListIds.length > 1) {
- return this.$message.warning('领料只能选择一个工单!');
- } else if (this.workListIds.length < 1) {
- return this.$message.warning('请选择工单!');
- }
- if (dataList.length == 0) {
- this.pickingShow = true;
- } else {
- const res = await parameterGetByCode({
- code: 'only_one_picking_order'
- });
- if (res.value == '1') {
- return this.$message.warning('已有领料,不能重复领料!');
- } else {
- this.checkPick();
- }
- }
- // this.checkPick();
- // this.pickingShow = true;
- },
- async checkPick() {
- await checkRepeatPick({
- workOrderId: this.workListIds[0]
- }).then((res) => {
- if (res.data == 0) {
- this.pickingShow = true;
- } else {
- this.$confirm('已经有领料是否继续重复领料?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(() => {
- this.pickingShow = true;
- })
- .catch(() => {});
- }
- });
- },
- // 关闭领料弹窗
- pickingClose(val) {
- if (val) {
- this.$nextTick(() => {
- this.$refs.pickListRef.getList(this.workListIds);
- });
- this.refreshFirstArticlePickFeedStatus();
- }
- this.pickingShow = false;
- },
- rowClick(row, taskId) {
- if (taskId) {
- let params = {
- categoryId: row.categoryId,
- taskId: taskId
- };
- getByTaskId(params).then((res) => {
- this.BomObj = res.data;
- this.$forceUpdate();
- });
- }
- },
- rowTaskClick() {
- if (taskId) {
- let params = {
- categoryId: row.categoryId,
- taskId: taskId
- };
- getByTaskId(params).then((res) => {
- this.BomObj = res.data;
- this.$forceUpdate();
- });
- }
- },
- closePrenatalExamination() {
- this.checkProductionResult();
- },
- //是否完成 产前准备 限制按钮
- async checkProductionResult() {
- if (
- this.produceTaskInfo &&
- this.workListIds.length > 0 &&
- this.produceTaskInfo.id != -1
- ) {
- // 判断是否要求先完成 产前准备等事项
- const result = await checkProductionResult({
- produceTaskId: this.produceTaskInfo.id,
- workOrderIds: this.workListIds
- });
- this.isPreProductionResult = result;
- }
- },
- // 投料后 重新检测按钮状态
- reloadFeeding() {
- this.checkProductionResult();
- this.refreshFirstArticlePickFeedStatus();
- }
- },
- mounted() {
- this.$nextTick(() => {
- const targetElements =
- document.getElementsByClassName('ele-admin-tabs');
- if (targetElements.length > 0) {
- // 遍历所有具有 'ele-admin-tabs' 类的元素
- Array.from(targetElements).forEach((element) => {
- // 对每个元素添加 'new-ele-admin-tabs' 类
- element.classList.add('new-ele-admin-tabs');
- });
- }
- });
- },
- destroyed() {
- this.$nextTick(() => {
- const targetElements =
- document.getElementsByClassName('ele-admin-tabs');
- if (targetElements.length > 0) {
- Array.from(targetElements).forEach((element) => {
- element.classList.remove('new-ele-admin-tabs');
- });
- }
- });
- }
- };
- </script>
- <style lang="scss">
- .content_box {
- display: flex;
- }
- .content_box_tab {
- width: 220px;
- padding: 5px;
- height: calc(100vh - 73px);
- background-color: #fff;
- overflow-y: auto;
- }
- .footBtn {
- position: absolute;
- bottom: 20px;
- left: 0;
- }
- .new-ele-admin-tabs {
- display: none !important;
- }
- .c_title {
- color: #157a2c;
- font-size: 16px;
- font-weight: bold;
- }
- .tableZ_box {
- border: 1px solid #e3e5e5;
- margin: 6px 0;
- &:last-child {
- border-bottom: none;
- }
- .row {
- width: 100%;
- display: flex;
- }
- .col {
- width: calc(100% / 5);
- display: flex;
- align-items: center;
- // min-width: 200px;
- min-height: 32px;
- border-bottom: 1px solid #e3e5e5;
- border-right: 1px solid #e3e5e5;
- &:last-child {
- border-right: none;
- }
- .name {
- display: flex;
- align-items: center;
- padding: 4px;
- width: 60px;
- height: 100%;
- background-color: #d0e4d5;
- color: #000;
- }
- .content {
- padding: 4px 6px;
- color: #000;
- }
- }
- .pd6 {
- padding: 0 6px;
- }
- }
- </style>
- <style lang="scss" scoped>
- .seek-list {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 10px 10px;
- }
- .task-toolbar {
- display: flex;
- align-items: center;
- width: 100%;
- margin-bottom: 2px;
- }
- .task-filter-input {
- flex: 1;
- min-width: 0;
- ::v-deep .el-input__inner {
- padding-left: 10px;
- padding-right: 24px;
- }
- }
- .task-toolbar-actions {
- display: flex;
- align-items: center;
- flex-shrink: 0;
- margin-left: 2px;
- .el-button {
- padding: 0;
- min-width: auto;
- margin-left: 2px;
- &:first-child {
- margin-left: 0;
- }
- }
- }
- .right_main_box {
- background-color: #fff;
- height: 100%;
- box-sizing: border-box;
- }
- .index_box {
- position: relative;
- padding: 10px;
- padding-bottom: 0;
- width: 100%;
- box-sizing: border-box;
- min-width: 1280px !important;
- height: calc(100vh - 60px);
- // overflow-x: auto;
- /* 当内容超出宽度时,允许水平滚动 */
- white-space: nowrap;
- /* 防止内部文本换行,确保所有内容都在一行显示 */
- scrollbar-width: thin;
- /* 设置滚动条宽度(浏览器兼容性可能有所不同) */
- scrollbar-color: #40a9ff transparent;
- /* 设置滚动条颜色和轨道颜色(同样,浏览器兼容性) */
- }
- .main {
- width: 100%;
- min-width: 1280px;
- height: calc(100vh - 70px - 50px - 80px);
- display: flex;
- justify-content: space-between;
- }
- .left_main {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- min-width: 640px;
- .top {
- width: 100%;
- height: 100%;
- overflow: hidden;
- }
- // .bottom {
- // width: 100%;
- // min-height: calc((100vh - 70px - 50px - 80px - 20px) / 2);
- // overflow: hidden;
- // }
- }
- ::v-deep .el-tabs__item.is-active {
- background-color: #dffade;
- /* 蓝色背景 */
- color: #333;
- }
- ::v-deep .is-active {
- color: #dffade;
- }
- .right_main {
- min-width: 640px;
- padding-bottom: 12px;
- height: calc((100vh - 70px - 50px - 80px - 12px));
- background: #f0f3f3;
- }
- ::v-deep .el-tree-node__content > .el-tree-node__expand-icon {
- padding: 0 !important;
- }
- // .menu-container {
- // position: relative;
- // width: 200px;
- // height: 200px;
- // margin: 100px;
- // }
- /* 主按钮 */
- // .main-btn {
- // width: 60px;
- // height: 60px;
- // background: #3498db;
- // border-radius: 50%;
- // color: #fff;
- // font-size: 30px;
- // text-align: center;
- // line-height: 60px;
- // cursor: pointer;
- // position: absolute;
- // left: 0;
- // bottom: 0;
- // box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
- // transition: transform 0.3s;
- // }
- // .main-btn:hover {
- // transform: rotate(90deg);
- // }
- /* 子按钮 */
- // .sub-btn {
- // width: 40px;
- // height: 40px;
- // background: #e74c3c;
- // border-radius: 50%;
- // color: #fff;
- // font-size: 14px;
- // text-align: center;
- // line-height: 50px;
- // position: absolute;
- // left: 5px;
- // bottom: 5px;
- // box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
- // transform: translate(0, 0);
- // transition: all 0.4s ease;
- // opacity: 1;
- // }
- /* 动画进入/离开 */
- // .fan-enter-active,
- // .fan-leave-active {
- // transition: all 0.4s ease;
- // }
- // .fan-enter,
- // .fan-leave-to {
- // opacity: 0;
- // transform: translate(0, 0);
- // }
- // .box {
- // position: relative;
- // }
- .menu-container {
- position: fixed;
- right: 0;
- margin-top: 42.5%;
- width: 235px;
- height: 100px;
- display: flex;
- justify-content: center;
- align-items: center;
- z-index: 999;
- }
- .toggle-btn {
- position: absolute;
- width: 55px;
- height: 55px;
- background: #2196f3;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- color: white;
- font-size: 30px;
- font-weight: bold;
- cursor: pointer;
- box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
- z-index: 100;
- transition: all 0.3s ease;
- border: none;
- left: 60%;
- top: 60%;
- transform: translate(-50%, -50%);
- }
- .toggle-btn:hover {
- transform: translate(-50%, -50%) scale(1.05);
- box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
- }
- .toggle-btn:active {
- transform: translate(-50%, -50%) scale(0.95);
- }
- .menu-item {
- position: absolute;
- width: 50px;
- height: 50px;
- background: #4caf50;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- color: white;
- font-size: 12px;
- font-weight: bold;
- box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
- transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
- transform: translate(-50%, -50%) scale(0);
- opacity: 0;
- pointer-events: none;
- z-index: 90;
- left: 55%;
- top: 60%;
- }
- .menu-item.active {
- opacity: 1;
- pointer-events: auto;
- transform: translate(var(--tx), var(--ty)) scale(1);
- }
- .menu-item:hover {
- transform: translate(var(--tx), var(--ty)) scale(1.15) !important;
- box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
- background: #66bb6a;
- cursor: pointer;
- }
- .instructions {
- margin-top: 2rem;
- color: white;
- text-align: center;
- background: rgba(255, 255, 255, 0.1);
- padding: 1rem;
- border-radius: 10px;
- max-width: 500px;
- backdrop-filter: blur(5px);
- }
- .custom-tree-node {
- // position: absolute;
- // flex: 1;
- // display: flex;
- // align-items: center;
- // justify-content: space-between;
- font-size: 14px;
- padding-right: 8px;
- }
- .item {
- margin-top: 10px;
- margin-right: 40px;
- }
- </style>
|