| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607 |
- <template>
- <div class="index_box">
- <!-- <div class="menu-container">
- <div
- v-for="(item, index) in menuItems"
- :key="item.label"
- class="menu-item"
- :class="{ active: isOpen }"
- :style="getItemStyle(index)"
- @click="handleItemClick(item)"
- >
- {{ item.label }}
- </div>
- <button class="toggle-btn" @click="toggleMenu">
- {{ isOpen ? 'X' : '≡' }}
- </button>
- </div> -->
- <div class="content_box">
- <!-- @tab-click="handleClick" -->
- <!-- 工序名称 -->
- <!-- <Search></Search> -->
- <div class="content_box_tab">
- <el-input
- style="width: 160px"
- clearable
- v-model="name"
- placeholder="请输入筛选项"
- @input="seekInput"
- />
- <el-button type="text" @click="updataTaskList">刷新</el-button>
- <el-tabs
- v-model="activeName"
- type="card"
- stretch
- @tab-click="tabClickValue"
- >
- <!-- :render-content="renderContent"-->
- <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>
- <!--
- v-loading="treeLoading"
- :node-key="nodeKey"
- ref="tree"
- :highlight-current="true"
- :expand-on-click-node="false"
- @node-click="handleNodeClick"
- v-bind="$attrs"
- :default-expand-all="defaultExpandAll" -->
- </el-tab-pane>
- <!-- <el-tab-pane label="工位" name="second"> -->
- <!-- <AssetTree @handleNodeClick="handleNodeClickNew" @setRootId="setRootId" id="0" :paramsType="'type'"
- ref="treeList" eqDevice="sb" /> -->
- <!-- <el-tree
- :data="factoryworkstationList"
- :props="defaultPropsTow"
- node-key="id"
- :highlight-current="true"
- @node-click="handleNodeClick"
- >
- </el-tree>
- </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-input style="width: 180px" clearable v-model="taskName" placeholder="请输入工序进度" /> -->
- <!-- -->
- <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-button slot="reference">hover 激活</el-button> -->
- </el-popover></template
- >
- <!--
- <span>支持工单编码,产品编码,产品名称,产品规格,牌号,型号,批次号查询</span
- > -->
- </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%'
- }"
- :right-style="{ overflow: 'hidden' }"
- :responsive="false"
- style="height: calc(100vh - 70px - 50px - 90px)"
- >
- <!-- 左侧 工单列表 -->
- <div class="left_main">
- <div class="top">
- <!-- /工单列表 -->
- <produceOrder
- v-if="produceTaskList.length != 0"
- @workSelect="workSelect"
- @rowClick="rowClick"
- ref="produceOrder"
- @getTaskName="getTaskName"
- :produceTaskInfo="produceTaskInfo"
- >
- </produceOrder>
- </div>
- <!-- <div class="bottom">
- <productionResource :BomObj="BomObj"></productionResource>
- </div> -->
- </div>
- <!-- 右侧 详情 -->
- <template v-slot:content>
- <div class="right_main">
- <!-- 领料 -->
- <!-- <div v-if="operationType == 'pick'"> -->
- <div v-if="operationType == 'pick'">
- <pickDetails
- ref="pickListRef"
- :workTaskId="workTaskId"
- :taskId="taskObj.id"
- @pickAdd="pickAdd"
- ></pickDetails>
- </div>
- <div v-if="operationType == 'feed'">
- <!-- 投料 -->
- <feeding
- :workListIds="workListIds"
- :feedNeedEquipment="feedNeedEquipment"
- @reload="reloadFeeding"
- ></feeding>
- </div>
- <div v-if="operationType == 'job'">
- <!-- // 报工列表 入库 -->
- <warehousing
- v-if="taskObj.id == -1"
- :workListIds="workListIds"
- ref="wareRef"
- :workPlanType="workPlanType"
- ></warehousing>
- <!-- // 设备 入库 -->
- <!-- 普通报工 -->
- <!-- <jobBooking
- v-else
- :workListIds="workListIds"
- ref="jobRef"
- :reportNeedFeed="reportNeedFeed"
- ></jobBooking> -->
- <jobBooking
- v-else
- :workListIds="workListIds"
- ref="jobRef"
- :reportNeedFeed="reportNeedFeed"
- :workPlanType="workPlanType"
- ></jobBooking>
- <!-- <workPlan
- style="width: 100%"
- v-else
- :workListIds="workListIds"
- ref="jobRef"
- :reportNeedFeed="reportNeedFeed"
- >
- </workPlan> -->
- </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"
- :taskName="taskObj.name"
- @changePlugIn="changePlugIn"
- @changeCancel="changeCancel"
- :chooseType="chooseType"
- v-if="isStep"
- ></outsourcing>
- <!-- -->
- <outsourceList
- :outsourceFormVal="outObj"
- @closeForm="closeForm"
- @outScucc="outScucc"
- v-if="isOutsource"
- ></outsourceList>
- <pleaseEntrust
- :outsourceFormVal="outObj"
- @closeForm="closeForm"
- @outScucc="outScucc"
- v-if="isPleaseEntrust"
- ></pleaseEntrust>
- </div>
- <!-- <div class="menu-container">
- <div class="main-btn" @click="toggleMenu">
- <span>+</span>
- </div>
- <transition-group name="fan" tag="div">
- <div
- v-for="(btn, index) in buttons"
- :key="btn.label"
- class="sub-btn"
- :style="getBtnStyle(index)"
- v-show="isOpen"
- >
- {{ btn.label }}
- </div>
- </transition-group>
- </div> -->
- </div>
- </template>
- </ele-split-layout>
- <footBtn
- @footBtn="footBtn"
- :type="type"
- :singleReportInspection="singleReportInspection"
- style="background: rgba(223, 250, 222, 0.6); padding: 10px"
- :isPreProductionResult="isPreProductionResult"
- ></footBtn>
- <!-- <div class="box"> -->
- <!-- </div> -->
- </div>
- <!-- <footBtn @footBtn="footBtn"></footBtn> -->
- </div>
- <!--领料弹框 -->
- <picking
- v-if="pickingShow"
- @close="pickingClose"
- :workListIds="workListIds"
- ></picking>
- <!-- 工艺文件 -->
- <wokePopup ref="wokePopupRef"></wokePopup>
- <!-- 检验报工 -->
- <workPlan ref="jobRefs" @closeWorkPlan="closeWorkPlan"> </workPlan>
- <!-- <workes ref="jobRefs"> </workes> -->
- <!-- :workListIds="workListIds" :taskId="taskObj.id" -->
- <!-- 工步 -->
- <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>
- </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 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
- } from '@/api/produce/index';
- import prenatalExamination from './components/prenatalExamination/index.vue';
- import { workorderPage2 } from '@/api/produce/workOrder.js';
- import { checkProductionResult } from '@/api/producetaskrulerecord/index.js';
- 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
- },
- 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
- },
- 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'
- };
- },
- computed: {
- taskObj() {
- return this.$store.state.user.taskObj;
- },
- info() {
- return this.$store.state.user.info;
- },
- rightShow() {
- return (type) => {};
- }
- },
- created() {
- this.init();
- this.getTaskList();
- this.getFactoryworkstationPageList();
- this.operationType = null;
- this.workListIds = [];
- },
- methods: {
- tabClickValue() {
- 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;
- // const angle =
- // -180 +
- // ((index / (this.menuItems.length - 1)) * Math.PI) / 2 -
- // Math.PI / 4;
- // const radius = 120;
- // const tx = radius * Math.cos(angle);
- // const ty = -radius * Math.sin(angle);
- return {
- '--tx': `${tx}px`,
- '--ty': `${ty}px`,
- 'transition-delay': `${index * 0.05}s`
- };
- },
- // 前端筛选
- 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);
- //handleSearch(this.code);
- },
- handleNodeClickNew(info) {
- // this.current = 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;
- // 重置按钮 禁用
- if (this.produceTaskInfo && this.produceTaskInfo.id != data.id) {
- this.isPreProductionResult = null;
- }
- console.log(data, 'handleNodeClick');
- 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() {
- // console.log(
- // localStorage.getItem('singleUserInfo'),
- // 'localStorage.getItem'
- // );
- // console.log(this.$store.state.user, 'this.$store.state.user.allInfo');
- 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];
- }
- this.getTaskWorkNumber();
- });
- }
- },
- //获取工序下所有的工单集合
- async getTaskWorkNumber() {
- 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();
- },
- // 获取工位
- 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.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();
- },
- 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 footBtn(t) {
- this.workPlanType = '';
- // this.operationType = t;
- // 新增判断 *** 出现弹窗的时候不然右边数据消失
- if ((t == 'work' || t == 'workStep', t === 'task')) {
- this.popupType = t;
- } else {
- this.operationType = t;
- }
- if (
- Object.keys(this.$store.state.user.taskObj).length === 0 &&
- this.$store.state.user.taskObj.constructor === Object
- ) {
- this.$message.warning('请选择工序');
- return true;
- }
- if (['pick', 'feed', 'job', 'work', 'workStep', 'task'].includes(t)) {
- if (this.workListIds.length == 0) {
- this.$message.warning('请选择工单列表');
- return false;
- }
- }
- if (t === 'job') {
- let req = {
- taskId: this.taskObj.id,
- workOrderId: this.workListIds[0],
- data: this.workData.list
- };
- if (
- this.taskObj.type == 2 ||
- this.taskObj.type == 3 ||
- this.taskObj.type == 6
- ) {
- this.getCodeData(req);
- }
- }
- if (t == 'pick') {
- this.$nextTick(() => {
- console.log(this.taskObj);
- this.$refs.pickListRef.getList(this.workListIds);
- });
- }
- // 工步
- if (t === 'workStep') {
- if (this.workListIds.length > 1) {
- return this.$message.warning('工步只能选择一个工单!');
- }
- this.$refs.workStepRef.open(this.workStepQueryParam);
- // let req = {
- // taskId: this.taskObj.id,
- // workOrderId: this.workListIds[0]
- // };
- // this.$refs.wokePopupRef.open(req);
- }
- if (t === 'task') {
- if (this.workListIds.length > 1) {
- return this.$message.warning('任务只能选择一个工单!');
- }
- this.$refs.taskDialogRef.open(
- this.workStepQueryParam,
- this.workData.list[0]
- );
- }
- if (t === 'error') {
- if (this.workListIds.length > 1) {
- return this.$message.warning('异常只能选择一个工单!');
- } else if (this.workListIds.length < 1) {
- return this.$message.warning('请选择工单!');
- }
- // console.log(this.workListIds, 'this.workListIds');
- this.$refs.createErrorRef.open('add', this.workData.list[0]);
- }
- // 工艺路线 *** 修改 判断只能选择一个
- // if (t === 'work') {
- // let req = {
- // taskId: this.taskObj.id,
- // workOrderId: this.workListIds[0]
- // };
- // this.$refs.wokePopupRef.open(req);
- // }
- if (t === 'work') {
- if (this.workListIds.length > 1) {
- return this.$message.warning('工艺文件只能选择一个工单!');
- } else if (this.workListIds.length < 1) {
- return this.$message.warning('请选择工单!');
- }
- await parameterGetByCode({
- code: 'mes_craft_file_by_category_code'
- }).then((res) => {
- // if (res.value == '1') {
- // this.$refs.jobRefs.open(req);
- // }
- console.log(this.workData.list, 'this.workData.list');
- if (res.value == '1') {
- let req = {
- taskId: this.taskObj.id,
- workOrderId: this.workListIds[0],
- productCode: this.workData.list[0].productCode
- };
- this.$refs.wokePopupRef.openTwo(req);
- } else {
- let req = {
- taskId: this.taskObj.id,
- workOrderId: this.workListIds[0]
- };
- this.$refs.wokePopupRef.open(req);
- }
- });
- }
- if (t == 'feed') {
- }
- if (t == 'device') {
- if (this.taskObj.id) {
- this.$refs.deviceRef.open(this.taskObj.id);
- } else {
- this.$message.warning('请选择工序');
- }
- }
- if (t == 'turnover') {
- if (this.workListIds.length < 1) {
- return this.$message.warning('请选择工单!');
- } else {
- const codeListData = [];
- this.workData.list.forEach((it) => {
- codeListData.push(it.code);
- });
- this.$refs.turnoverRef.open(codeListData);
- }
- }
- if (t == 'bom') {
- if (this.workListIds.length > 1) {
- return this.$message.warning('查看BOM详情只能选择一个工单!');
- } else if (this.workListIds.length < 1)
- return this.$message.warning('请选择工单!');
- else {
- console.log(this.workData);
- const row = this.workData.list[0];
- let rowData = {
- categoryId: row.categoryId,
- categoryName: row.bomCategoryName,
- code: row.code,
- versions: row.bomCategoryVersions,
- rootPathIdParent: row.categoryLevelPathIdParent || '',
- isProduct: true,
- bomType: Number(row.bomType),
- isTemp: 0
- };
- this.$refs.bomDrawer.open(rowData);
- // /
- // console.log(this.workData.list, 'this.workData.list');
- }
- // let rowData = {
- // categoryId: row.id,
- // categoryName: row.name,
- // code: row.code,
- // rootPathIdParent: row.categoryLevelPathIdParent,
- // isProduct: row.isProduct == 1
- // };
- }
- // 委外
- if (t == 'Outsourcing') {
- if (this.workListIds.length > 1) {
- return this.$message.warning('委外请托工序只能选择一个工单!');
- } else if (this.workListIds.length < 1) {
- return this.$message.warning('请选择工单!');
- } else {
- console.log(this.workData, 'this.workData');
- // /
- this.handOutsource(this.workListIds[0]);
- }
- }
- // 产前准备 过程控制 产后检查
- if (
- t == 'prenatalExamination' ||
- t == 'processDetection' ||
- t == 'postpartumExamination'
- ) {
- if (this.workListIds.length > 1) {
- if (t == 'prenatalExamination') {
- return this.$message.warning('产前准备只能选择一个工单!');
- }
- if (t == 'processDetection') {
- return this.$message.warning('过程控制只能选择一个工单!');
- }
- return this.$message.warning('产后检查只能选择一个工单!');
- }
- if (this.workListIds.length < 1) {
- return this.$message.warning('请选择工单!');
- }
- let reportWorkType = 1;
- console.log('this.workListIds', this.workListIds, t);
- switch (t) {
- case 'prenatalExamination':
- reportWorkType = 1;
- break;
- case 'processDetection':
- reportWorkType = 2;
- break;
- default:
- reportWorkType = 3;
- break;
- }
- // 产前准备
- console.log('this.produceTaskInfo', this.produceTaskInfo);
- this.$refs.prenatalExaminationRef.open(
- this.workData.list[0],
- this.produceTaskInfo,
- // 报工类型,参考字典项:record_rules_report_work_type,1-产前准备,2-过程控制,3-产后检查
- reportWorkType
- );
- }
- },
- outsourcingAdd(type, activeName) {
- this.getTaskInstanceByIdFn(this.workListIds[0]);
- this.chooseType = activeName;
- if (this.chooseType == 1) {
- this.isStep = true;
- } else {
- this.$refs.addPleaseRef.open(
- this.workListIds[0],
- this.workData,
- this.taskObj
- );
- }
- },
- 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('此工序不能委外/请托');
- }
- });
- },
- //获取工单列表
- 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);
- }
- });
- },
- pickAdd() {
- if (this.workListIds.length > 1) {
- return this.$message.warning('领料只能选择一个工单!');
- } else if (this.workListIds.length < 1) {
- return this.$message.warning('请选择工单!');
- }
- 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.pickingShow = false;
- },
- rowClick(row, taskId) {
- 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();
- }
- },
- 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;
- }
- .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-left: 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>
|