workReport.vue 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752
  1. <template>
  2. <div class="index_box">
  3. <el-drawer
  4. title=""
  5. :visible.sync="drawer"
  6. v-if="drawer"
  7. :before-close="handleClose"
  8. :custom-class="isFullscreen ? 'not-fullscreen' : 'is-fullscreen'"
  9. :with-header="false"
  10. append-to-body
  11. >
  12. <div>
  13. <div>
  14. <div class="seek-list" style="background-color: #157a2c">
  15. <div
  16. style="
  17. width: 100%;
  18. color: #fff;
  19. display: flex;
  20. justify-content: space-between;
  21. "
  22. >
  23. <div>
  24. <b style="margin-right: 50px; font-size: 14px"
  25. >当前工序:{{ title }}</b
  26. >
  27. <b style="font-size: 14px">下道工序:{{ title1 }}</b>
  28. </div>
  29. <div>
  30. <b style="font-size: 14px; margin-right: 10px; color: orange"
  31. >工艺路线:{{ workOrderInfo.produceRoutingName }}
  32. </b>
  33. <b style="font-weight: blod; font-size: 14px">
  34. 操作员:{{ info.name }}
  35. </b>
  36. </div>
  37. <div class="rx-ec">
  38. <el-button
  39. icon="el-icon-full-screen"
  40. type="text"
  41. style="color: #fff; font-size: 14px"
  42. @click="handleFull"
  43. >{{ isFullscreen ? '全屏' : '缩小' }}</el-button
  44. >
  45. <el-button
  46. icon="el-icon-circle-close"
  47. type="text"
  48. style="color: #fff; font-size: 14px"
  49. @click="handleClose"
  50. >关闭</el-button
  51. >
  52. </div>
  53. </div>
  54. </div>
  55. <div class="drawer_content">
  56. <el-steps
  57. class="process-route-steps"
  58. :active="activeIndex"
  59. space="20px"
  60. align-center
  61. >
  62. <el-step
  63. v-for="(item, index) in routeList"
  64. :key="index"
  65. @click.native="handIdx(index, item)"
  66. :description="desIndex == index ? '此处' : ''"
  67. :class="desIndex == index ? 'active' : ''"
  68. :status="errorIndex == index ? 'error' : ''"
  69. >
  70. <template slot="title">
  71. <div class="step-title">
  72. <div>{{ item.taskTypeName }}</div>
  73. <div v-if="showTaskTeamName(item)" class="step-team-name">
  74. {{ getTaskTeamName(item) }}
  75. </div>
  76. </div>
  77. </template>
  78. </el-step>
  79. </el-steps>
  80. </div>
  81. <el-tabs type="border-card" :key="drawerKey">
  82. <el-tab-pane label="基本信息">
  83. <ele-split-layout
  84. space="0px"
  85. width="26%"
  86. :resizable="true"
  87. :min-size="200"
  88. :max-size="-200"
  89. :left-style="{
  90. overflow: 'hidden',
  91. width: '100%'
  92. }"
  93. :right-style="{ overflow: 'hidden' }"
  94. :responsive="false"
  95. style="height: calc(100vh - 295px)"
  96. >
  97. <!-- 详细信息 -->
  98. <div class="left_main">
  99. <div class="top">
  100. <Info :workOrderInfo="workOrderInfo"></Info>
  101. </div>
  102. </div>
  103. <!-- //报工信息 -->
  104. <template v-slot:content>
  105. <div class="right_main">
  106. <!-- 领料 -->
  107. <!-- <div v-if="operationType == 'pick'"> -->
  108. <div v-if="operationType == 'pick'">
  109. <pickDetails
  110. ref="pickListRef"
  111. :workTaskId="workTaskId"
  112. :taskId="taskObj.id"
  113. @pickAdd="pickAdd"
  114. ></pickDetails>
  115. </div>
  116. <div v-if="operationType == 'feed'">
  117. <!-- 投料 -->
  118. <feeding
  119. v-if="isFinalCheckProduction"
  120. :workListIds="workListIds"
  121. :feedNeedEquipment="feedNeedEquipment"
  122. @feedSuccess="feedSuccess"
  123. ></feeding>
  124. </div>
  125. <div v-if="operationType == 'job'">
  126. <!-- // 报工列表 入库 -->
  127. <warehousing
  128. v-if="taskObj.id == -1"
  129. :workListIds="workListIds"
  130. ref="wareRef"
  131. @warehouseSuccess="warehouseSuccess"
  132. :workPlanType="workPlanType"
  133. ></warehousing>
  134. <jobBooking
  135. v-else-if="isFinalCheckProduction"
  136. :workListIds="workListIds"
  137. ref="jobRef"
  138. :reportNeedFeed="reportNeedFeed"
  139. @jobSuccess="jobSuccess"
  140. @reloadData="reloadData"
  141. :workPlanType="workPlanType"
  142. ></jobBooking>
  143. </div>
  144. <div v-if="operationType == 'workOrder'">
  145. <workOrderHandover
  146. :workListIds="workListIds"
  147. :workData="workOrderInfo"
  148. ref="workOrderHandoverRef"
  149. @cancel="closeWorkOrderHandover"
  150. @success="workOrderHandoverSuccess"
  151. ></workOrderHandover>
  152. </div>
  153. <!-- 工步 -->
  154. <div v-if="operationType == 'workStep'"> </div>
  155. <!-- 质检工序 -->
  156. <div v-if="operationType == 'inspection'">
  157. <inspection
  158. :workListIds="workListIds"
  159. ref="inspectionRef"
  160. ></inspection>
  161. </div>
  162. <!-- 委外 -->
  163. <div
  164. v-if="operationType == 'Outsourcing' && isType == '3'"
  165. class="right_main_box"
  166. >
  167. <outsourcingDetails
  168. ref="outsourcingListRef"
  169. @outsourcingAdd="outsourcingAdd"
  170. v-if="!isStep && !isOutsource && !isPleaseEntrust"
  171. :chooseType="chooseType"
  172. ></outsourcingDetails>
  173. <outsourcing
  174. :outsourceFormVal="outsourceForm"
  175. :taskObj="taskObj"
  176. :workListIds="workListIds[0]"
  177. :workData="workInfoList"
  178. @changePlugIn="changePlugIn"
  179. @changeCancel="changeCancel"
  180. :chooseType="chooseType"
  181. v-if="isStep"
  182. ></outsourcing>
  183. <outsourceList
  184. :workData="workInfoList"
  185. :taskObj="taskObj"
  186. :outsourceFormVal="outsourceForm"
  187. :chooseType="chooseType"
  188. @closeForm="closeForm"
  189. @outScucc="outScucc"
  190. v-if="isOutsource"
  191. ></outsourceList>
  192. <pleaseEntrust
  193. :outsourceFormVal="outObj"
  194. @closeForm="closeForm"
  195. @outScucc="outScucc"
  196. v-if="isPleaseEntrust"
  197. ></pleaseEntrust>
  198. </div>
  199. </div>
  200. </template>
  201. </ele-split-layout>
  202. <footBtn
  203. @footBtn="footBtn"
  204. :type="type"
  205. :singleReportInspection="singleReportInspection"
  206. :qualityInspectionDisabled="qualityInspectionDisabled"
  207. :qualityInspectionDisabledMsg="firstArticlePickFeedMsg"
  208. :activeName="activeName"
  209. style="background: rgba(223, 250, 222, 0.6); padding: 10px"
  210. ></footBtn>
  211. </el-tab-pane>
  212. <el-tab-pane label="投料详情">
  213. <feedDetails
  214. :routeObj="routeObj"
  215. :curTaskObj="curTaskObj"
  216. ></feedDetails
  217. ></el-tab-pane>
  218. <el-tab-pane label="报工详情">
  219. <jobDetails
  220. :routeObj="routeObj"
  221. :curTaskObj="curTaskObj"
  222. :newId="newId"
  223. ></jobDetails>
  224. </el-tab-pane>
  225. <el-tab-pane label="生产明细">
  226. <productionDetails
  227. :workOrderInfo="workOrderInfo"
  228. ></productionDetails>
  229. </el-tab-pane>
  230. <!-- <el-tab-pane label="退料详情"> </el-tab-pane> -->
  231. </el-tabs>
  232. </div>
  233. </div>
  234. <!--领料弹框 -->
  235. <picking
  236. v-if="pickingShow"
  237. @close="pickingClose"
  238. :workListIds="workListIds"
  239. ></picking>
  240. <!-- 工艺文件 -->
  241. <wokePopup ref="wokePopupRef"></wokePopup>
  242. <!-- 检验报工 -->
  243. <workPlan ref="jobRefs" @closeWorkPlan="closeWorkPlan"> </workPlan>
  244. <!-- <workes ref="jobRefs"> </workes> -->
  245. <!-- :workListIds="workListIds" :taskId="taskObj.id" -->
  246. <!-- 产前准备 、 过程控制 、产后检测 -->
  247. <prenatalExamination
  248. ref="prenatalExaminationRef"
  249. @close="closePrenatalExamination"
  250. />
  251. <!-- 工步 -->
  252. <workStep ref="workStepRef" />
  253. <!-- 任务 -->
  254. <TaskDialog ref="taskDialogRef" />
  255. <!-- 异常 -->
  256. <createError ref="createErrorRef" />
  257. <addPlease ref="addPleaseRef" @refresh="refreshPlease"></addPlease>
  258. <qualityInspection ref="qualityInspectionRef"></qualityInspection>
  259. <encodingDialog ref="encodingDialogRef" />
  260. </el-drawer>
  261. </div>
  262. </template>
  263. <script>
  264. import Info from './info.vue';
  265. import TaskDialog from '@/views/produce/components/taskDialog/index.vue';
  266. import Search from '@/views/produce/components/search.vue';
  267. import footBtn from '@/views/produce/components/footBtn.vue';
  268. import prenatalExamination from '@/views/produce/components/prenatalExamination/index.vue';
  269. import produceOrder from '@/views/produce/components/new_produceOrder.vue';
  270. import productionResource from '@/views/produce/components/productionResource/index.vue';
  271. import outsourcing from '@/views/produce/components/outsourcing/index.vue';
  272. import picking from '@/views/produce/components/picking/index.vue';
  273. import wokePopup from '@/views/produce/components/picking/wokePopup.vue';
  274. import inspection from '@/views/produce/components/inspection/newIndex.vue';
  275. import pickDetails from '@/views/produce/components/picking/details.vue';
  276. import AssetTree from '@/components/AssetTree/joobIndex.vue';
  277. import feeding from '@/views/produce/components/feeding/index.vue';
  278. import outsourcingDetails from '@/views/produce/components/outsourcing/details.vue';
  279. import jobBooking from '@/views/produce/components/jobBooking/index.vue';
  280. import workPlan from '@/views/produce/components/workPlan/index.vue';
  281. import warehousing from '@/views/produce/components/warehousing/index.vue';
  282. import outsourceList from '@/views/produce/components/outsourcing/new_outsourceList.vue';
  283. import pleaseEntrust from '@/views/produce/components/outsourcing/pleaseEntrust.vue';
  284. import workStep from '@/views/produce/components/workStep/index.vue';
  285. import createError from '@/views/produce/components/createError.vue';
  286. import productionDetails from '../workOrderList/components/productionDetails.vue';
  287. import { parameterGetByCode } from '@/api/system/dictionary-data';
  288. import {
  289. getByTaskId,
  290. pcCheckOutsource,
  291. getTaskInstanceById,
  292. checkOutsourceMaterial,
  293. listTask,
  294. factoryworkstationPage,
  295. nextTask,
  296. checkPleaseEntrust,
  297. checkRepeatPick,
  298. getTaskReport
  299. } from '@/api/produce/index';
  300. import { getTaskInstanceList } from '@/api/produce/job';
  301. import { workorderInfo } from '@/api/produceOrder/index.js';
  302. import feedDetails from '@/views/produce/components/feeding/details.vue';
  303. import jobDetails from '@/views/produce/components/jobBooking/details.vue';
  304. import addPlease from '@/views/produce/components/outsourcing/addPlease.vue';
  305. import qualityInspection from '@/views/produce/components/qualityInspection/index.vue';
  306. import workOrderHandover from '@/views/produce/components/workOrderHandover/index.vue';
  307. import { checkProductionResult } from '@/api/producetaskrulerecord/index.js';
  308. import { getPlanDotLine } from '@/api/produceOrder/index.js';
  309. import { checkFeedStatus } from '@/api/produce/feeding.js';
  310. import encodingDialog from '../produce/components/encodingDialog/index.vue';
  311. export default {
  312. components: {
  313. Search,
  314. footBtn,
  315. wokePopup,
  316. produceOrder,
  317. productionResource,
  318. outsourcing,
  319. picking,
  320. pickDetails,
  321. outsourceList,
  322. feeding,
  323. AssetTree,
  324. jobBooking,
  325. inspection,
  326. warehousing,
  327. workStep,
  328. workPlan,
  329. TaskDialog,
  330. createError,
  331. Info,
  332. feedDetails,
  333. jobDetails,
  334. productionDetails,
  335. outsourcingDetails,
  336. pleaseEntrust,
  337. addPlease,
  338. qualityInspection,
  339. prenatalExamination,
  340. workOrderHandover,
  341. encodingDialog
  342. },
  343. data() {
  344. return {
  345. name: '',
  346. activeName: '0',
  347. taskName: '',
  348. keyWord: '', //搜索
  349. title: '',
  350. type: '',
  351. loading: false,
  352. isLoading: null,
  353. operationType: null,
  354. popupType: '', // 弹窗
  355. workListIds: [],
  356. factoryworkstationList: [],
  357. title1: '',
  358. arr: [],
  359. arrTow: [],
  360. produceTaskList: [],
  361. isType: '',
  362. isStep: false,
  363. outsourceForm: {},
  364. outObj: {},
  365. pickingShow: false,
  366. wokePopup: false,
  367. workOrderInfo: {},
  368. routeList: [],
  369. activeIndex: 0,
  370. desIndex: 0,
  371. errorIndex: 10000,
  372. drawer: false,
  373. workData: {},
  374. isFullscreen: false,
  375. isOutsource: false,
  376. chooseType: '1',
  377. routeObj: {
  378. id: null
  379. },
  380. BomObj: {},
  381. defaultProps: {
  382. children: 'children',
  383. label: 'newName'
  384. },
  385. defaultPropsTow: {
  386. children: 'children',
  387. label: 'name',
  388. value: 'code'
  389. },
  390. feedNeedEquipment: 0, //投料是否要添加生产设备1是0否
  391. reportNeedFeed: 0, //生产质检是否需要处置再报工1是0否
  392. singleReportInspection: null, //获取选中的工单是单个还是批量
  393. workTaskId: null, //选中的工单工序id
  394. workStepQueryParam: {
  395. taskId: null,
  396. workOrderId: null,
  397. bomCategoryId: null
  398. },
  399. isFinalCheckProduction: true,
  400. newId: '',
  401. curTaskObj: null,
  402. produceList: [],
  403. workPlanType: '',
  404. isPleaseEntrust: false,
  405. workInfoList: {},
  406. drawerKey: 0,
  407. planDotLineEnabled: false,
  408. firstArticlePickFeedReady: true,
  409. firstArticlePickFeedMsg: '',
  410. firstArticlePickFeedCheckKey: ''
  411. };
  412. },
  413. computed: {
  414. taskObj() {
  415. return this.$store.state.user.taskObj;
  416. },
  417. info() {
  418. return this.$store.state.user.info;
  419. },
  420. hasFirstArticleInspectionTarget() {
  421. return this.activeName === '0' && this.workListIds.length > 0;
  422. },
  423. qualityInspectionDisabled() {
  424. return (
  425. this.info?.clientEnvironmentId == 9 &&
  426. this.hasFirstArticleInspectionTarget &&
  427. !this.firstArticlePickFeedReady
  428. );
  429. },
  430. rightShow() {
  431. return (type) => {};
  432. }
  433. },
  434. created() {
  435. this.init();
  436. this.getTaskList();
  437. this.getFactoryworkstationPageList();
  438. this.getPlanDotLineConfig();
  439. this.operationType = null;
  440. this.workListIds = [];
  441. },
  442. methods: {
  443. tabClickValue() {
  444. this.name = '';
  445. this.seekInput();
  446. },
  447. async getPlanDotLineConfig() {
  448. try {
  449. const res = await parameterGetByCode({
  450. code: 'plan_dot_line'
  451. });
  452. this.planDotLineEnabled = !!res && res.value == '1';
  453. } catch (error) {
  454. this.planDotLineEnabled = false;
  455. console.error('getPlanDotLineConfig error', error);
  456. }
  457. },
  458. async syncPlanDotLineRouteList() {
  459. if (!this.planDotLineEnabled) {
  460. return;
  461. }
  462. const productionPlanId = this.workOrderInfo?.productionPlanId;
  463. if (!productionPlanId) {
  464. return;
  465. }
  466. if (!Array.isArray(this.routeList) || this.routeList.length === 0) {
  467. return;
  468. }
  469. try {
  470. const res = await getPlanDotLine({
  471. planId: productionPlanId
  472. });
  473. const detailList = Array.isArray(res?.detailList)
  474. ? res.detailList
  475. : [];
  476. if (!detailList.length) {
  477. return;
  478. }
  479. console.log(detailList, 'detailList');
  480. const detailMap = detailList.reduce((map, item) => {
  481. const taskId = item?.taskId;
  482. if (taskId !== undefined && taskId !== null && taskId !== '') {
  483. map.set(String(taskId), item);
  484. }
  485. return map;
  486. }, new Map());
  487. this.routeList = this.routeList.map((item) => {
  488. const taskId = item?.taskId;
  489. if (taskId === undefined || taskId === null || taskId === '') {
  490. return item;
  491. }
  492. const detail = detailMap.get(String(taskId));
  493. if (!detail) {
  494. return item;
  495. }
  496. return {
  497. ...item,
  498. executionTeamName: detail.executionTeamName ?? '',
  499. executionTeamId: detail.executionTeamId ?? ''
  500. };
  501. });
  502. console.log(this.routeList, 'thisnewewewewrouteList');
  503. } catch (error) {
  504. console.error('syncPlanDotLineRouteList error', error);
  505. }
  506. },
  507. getUserTeamIds() {
  508. const teamId = this.$store?.state?.user?.info?.teamId;
  509. if (Array.isArray(teamId)) {
  510. return teamId
  511. .map((item) => String(item).trim())
  512. .filter((item) => item);
  513. }
  514. if (typeof teamId !== 'string' || !teamId) {
  515. return [];
  516. }
  517. return teamId
  518. .split(',')
  519. .map((item) => item.trim())
  520. .filter((item) => item);
  521. },
  522. getTaskTeamName(item) {
  523. if (!item || item.teamName === undefined || item.teamName === null) {
  524. return '';
  525. }
  526. return String(item.teamName).trim();
  527. },
  528. showTaskTeamName(item) {
  529. return (
  530. this.info?.clientEnvironmentId == 9 && !!this.getTaskTeamName(item)
  531. );
  532. },
  533. getCurrentRouteItem() {
  534. if (
  535. this.curTaskObj?.taskId !== undefined &&
  536. this.curTaskObj?.taskId !== null
  537. ) {
  538. return this.curTaskObj;
  539. }
  540. if (!Array.isArray(this.routeList) || this.routeList.length === 0) {
  541. return null;
  542. }
  543. const currentTaskId =
  544. this.taskId ??
  545. this.workOrderInfo?.taskId ??
  546. this.routeList[this.desIndex]?.taskId;
  547. if (
  548. currentTaskId === undefined ||
  549. currentTaskId === null ||
  550. currentTaskId === ''
  551. ) {
  552. return this.routeList[this.desIndex] || null;
  553. }
  554. return (
  555. this.routeList.find(
  556. (item) => String(item?.taskId) === String(currentTaskId)
  557. ) ||
  558. this.routeList[this.desIndex] ||
  559. null
  560. );
  561. },
  562. checkCurrentTaskTeamPermission(actionName) {
  563. const deny = (message) => {
  564. this.operationType = null;
  565. this.$message.warning(message);
  566. return false;
  567. };
  568. const currentTask = this.getCurrentRouteItem();
  569. if (!currentTask) {
  570. return deny(`未获取到当前工序,不能${actionName}`);
  571. }
  572. const executionTeamId = currentTask.executionTeamId;
  573. if (currentTask.taskId != -1) {
  574. if (
  575. executionTeamId === undefined ||
  576. executionTeamId === null ||
  577. executionTeamId === ''
  578. ) {
  579. return deny(`当前工序未配置执行班组,不能${actionName}`);
  580. }
  581. }
  582. const teamIds = this.getUserTeamIds();
  583. if (currentTask.taskId != -1) {
  584. if (!teamIds.length) {
  585. return deny(`当前用户未配置班组,不能${actionName}`);
  586. }
  587. }
  588. const executionTeamIdStr = String(executionTeamId).trim();
  589. if (currentTask.taskId != -1) {
  590. if (!executionTeamIdStr) {
  591. return deny(`当前工序未配置执行班组,不能${actionName}`);
  592. }
  593. if (!teamIds.includes(executionTeamIdStr)) {
  594. return deny(`当前用户班组无权限${actionName}`);
  595. }
  596. }
  597. return true;
  598. },
  599. // 前端筛选
  600. seekInput() {
  601. // console.log(activeName);
  602. if (this.activeName == '0') {
  603. if (!this.name) return (this.produceTaskList = this.arr);
  604. this.produceTaskList = this.produceTaskList.filter((item) => {
  605. return item.name.indexOf(this.name) > -1;
  606. });
  607. } else {
  608. if (!this.name) return (this.factoryworkstationList = this.arrTow);
  609. this.factoryworkstationList = this.factoryworkstationList.filter(
  610. (item) => {
  611. return item.name.indexOf(this.name) > -1;
  612. }
  613. );
  614. }
  615. },
  616. // 折叠悬浮中样式调整
  617. init() {
  618. this.$store.dispatch('theme/setCollapse', true);
  619. },
  620. async getTaskName(value) {
  621. let res = await nextTask({
  622. taskId: this.taskObj.id,
  623. workOrderIds: [value.id]
  624. });
  625. const title1 = res.data.map((item) => item.taskTypeName).toString();
  626. this.title1 = title1 ? title1 : '';
  627. },
  628. handleSearch() {
  629. let obj = {
  630. keyWord: this.keyWord,
  631. taskName: this.taskName
  632. };
  633. this.$refs.produceOrder.handleSearch(obj);
  634. //handleSearch(this.code);
  635. },
  636. handleNodeClickNew(info) {
  637. // this.current = info;
  638. let current = { id: info.id };
  639. this.$store.commit('user/currentObj', current);
  640. },
  641. setRootId(id) {
  642. this.rootId = id;
  643. },
  644. handleChoose(val) {
  645. console.log(val);
  646. },
  647. handleFull() {
  648. this.isFullscreen = !this.isFullscreen;
  649. this.$forceUpdate();
  650. },
  651. // 获取工序列表
  652. getTaskList() {
  653. listTask().then((res) => {
  654. res.map((v) => {
  655. v.newName = `${v.workCenterName}-${v.name}`;
  656. });
  657. this.produceTaskList = res;
  658. this.arr = JSON.parse(JSON.stringify(this.produceTaskList));
  659. });
  660. },
  661. // 获取工位
  662. getFactoryworkstationPageList() {
  663. factoryworkstationPage({ pageNum: 1, size: 99999999 }).then((res) => {
  664. this.factoryworkstationList = res.list;
  665. this.arrTow = JSON.parse(JSON.stringify(this.factoryworkstationList));
  666. // newName
  667. });
  668. },
  669. changeCancel(activeType) {
  670. this.isStep = false;
  671. this.chooseType = activeType;
  672. if (this.chooseType == '1') {
  673. this.$nextTick(() => {
  674. this.$refs.outsourcingListRef.getDataList(this.workData.code);
  675. });
  676. } else if (this.chooseType == '2') {
  677. this.$nextTick(() => {
  678. this.$refs.outsourcingListRef.getPleaseData(this.workData.code);
  679. });
  680. }
  681. },
  682. closeForm() {
  683. this.isOutsource = false;
  684. this.isPleaseEntrust = false;
  685. this.$nextTick(() => {
  686. this.$refs.outsourcingListRef.getDataList(this.workData.code);
  687. });
  688. },
  689. outScucc() {
  690. // this.operationType = null;
  691. this.isOutsource = false;
  692. this.isPleaseEntrust = false;
  693. this.$nextTick(() => {
  694. this.$refs.outsourcingListRef.getDataList(this.workData.code);
  695. });
  696. },
  697. async changePlugIn(e, index) {
  698. if (index == '1') {
  699. this.outObj = e;
  700. let req = {
  701. taskId: e.taskId,
  702. taskIds: e.taskIds,
  703. workOrderId: e.workOrderId,
  704. quantity: e.formedNumLast
  705. };
  706. const URL =
  707. index == '1' ? checkOutsourceMaterial : checkPleaseEntrust;
  708. const res = await URL(req);
  709. this.outObj = { ...res.data, ...this.outsourceForm, ...this.outObj };
  710. this.isStep = false;
  711. this.isOutsource = true;
  712. } else if (index == '2') {
  713. this.outObj = e;
  714. let req = {
  715. taskId: e.taskId,
  716. taskIds: e.taskIds,
  717. workOrderId: e.workOrderId,
  718. quantity: e.formedNumLast
  719. };
  720. const res = await checkPleaseEntrust(req);
  721. this.outObj = { ...res.data, ...this.outsourceForm, ...this.outObj };
  722. this.isStep = false;
  723. this.isPleaseEntrust = true;
  724. }
  725. },
  726. pickingWokeClose() {
  727. this.wokePopup = false;
  728. },
  729. async open(row) {
  730. this.drawerKey++;
  731. this.curTaskObj = null;
  732. this.workOrderInfo = row;
  733. this.routeObj.id = this.workOrderInfo.id;
  734. this.operationType = '';
  735. this.resetFirstArticlePickFeedStatus();
  736. await this.getPlanDotLineConfig();
  737. // this.getTaskFn();
  738. this.drawer = true;
  739. // this.getOrderData();
  740. await this.getOrderData();
  741. await this.getTaskFn();
  742. },
  743. async getOrderData() {
  744. await workorderInfo(this.workOrderInfo.id).then((res) => {
  745. this.workOrderInfo = res;
  746. this.workStepQueryParam.taskId = this.workOrderInfo.taskId;
  747. this.workStepQueryParam.workOrderId = this.workOrderInfo.id;
  748. this.workStepQueryParam.bomCategoryId =
  749. this.workOrderInfo.bomCategoryId;
  750. this.singleReportInspection = this.workOrderInfo.singleReport;
  751. });
  752. },
  753. handleClose() {
  754. this.drawer = false;
  755. },
  756. feedSuccess() {
  757. this.getOrderData();
  758. this.getTaskFn();
  759. this.refreshFirstArticlePickFeedStatus();
  760. },
  761. jobSuccess() {
  762. this.getOrderData();
  763. this.getTaskFn();
  764. },
  765. reloadData() {
  766. this.getOrderData();
  767. this.getTaskFn();
  768. },
  769. warehouseSuccess() {
  770. this.getOrderData();
  771. this.getTaskFn();
  772. },
  773. async getTaskFn() {
  774. const res = await getTaskInstanceList(this.workOrderInfo.id);
  775. this.routeList = Array.isArray(res) ? res : [];
  776. console.log(this.routeList, 'routeList');
  777. console.log(this.workOrderInfo, 'this.workOrderInfo');
  778. if (!this.routeList.length) {
  779. this.desIndex = 0;
  780. this.activeIndex = 0;
  781. this.newId = '';
  782. this.workData = this.workOrderInfo;
  783. return;
  784. }
  785. await this.syncPlanDotLineRouteList();
  786. const index = this.routeList.findIndex(
  787. (item) => item.taskId == this.workOrderInfo.taskId
  788. );
  789. const currentIndex = index > -1 ? index : 0;
  790. this.desIndex = currentIndex;
  791. console.log(this.routeList, '888888');
  792. this.newId = this.routeList[currentIndex]?.taskId || '';
  793. if (this.workOrderInfo.taskId != -2) {
  794. this.curTaskObj = JSON.parse(JSON.stringify(this.routeObj));
  795. } else {
  796. this.curTaskObj = JSON.parse(JSON.stringify(this.routeList[0] || {}));
  797. this.desIndex = 0;
  798. }
  799. this.activeIndex = currentIndex;
  800. this.workData = this.workOrderInfo;
  801. if (this.routeList[currentIndex]) {
  802. this.handIdx(this.activeIndex, this.routeList[currentIndex]);
  803. }
  804. },
  805. async getCodeData(req) {
  806. await parameterGetByCode({ code: 'enable_quality_plus' }).then(
  807. (res) => {
  808. if (res.value == '1') {
  809. this.$refs.jobRefs.open(req);
  810. }
  811. }
  812. );
  813. },
  814. getCraftFileProductCode(row) {
  815. return (
  816. row?.productCode ||
  817. row?.materialCode ||
  818. row?.categoryCode ||
  819. row?.productCategoryCode ||
  820. ''
  821. );
  822. },
  823. buildCraftFileReq(row, workOrderId) {
  824. return {
  825. taskId: this.taskObj.id,
  826. workOrderId:
  827. workOrderId || row?.workOrderId || row?.mesWorkOrderId || row?.id,
  828. productCode: this.getCraftFileProductCode(row)
  829. };
  830. },
  831. async openWorkFile(req) {
  832. const res = await parameterGetByCode({
  833. code: 'mes_craft_file_by_category_code'
  834. });
  835. const byCategory = res?.value === '1';
  836. if (byCategory) {
  837. this.$refs.wokePopupRef.openTwo(req);
  838. } else {
  839. this.$refs.wokePopupRef.open(req);
  840. }
  841. },
  842. async checkQualityResult() {
  843. if (
  844. this.taskObj &&
  845. this.workListIds.length > 0 &&
  846. this.taskObj.id != -1
  847. ) {
  848. // 判断是否要求先完成 产前准备等事项
  849. const result = await checkProductionResult({
  850. produceTaskId: this.taskObj.id,
  851. workOrderIds: this.workListIds
  852. });
  853. return result;
  854. }
  855. },
  856. getSelectedWorkOrderRows() {
  857. if (this.workOrderInfo && Object.keys(this.workOrderInfo).length) {
  858. return [this.workOrderInfo];
  859. }
  860. return this.workListIds.map((id) => ({ id }));
  861. },
  862. async validateTaskAssignBeforeWorkOrderJob() {
  863. if (this.info?.clientEnvironmentId != 9 || this.taskObj.id == -1) {
  864. return true;
  865. }
  866. const rows = this.getSelectedWorkOrderRows();
  867. try {
  868. const reportList = await Promise.all(
  869. rows.map(async (row) => {
  870. const workOrderId =
  871. row.id || row.workOrderId || row.mesWorkOrderId;
  872. const taskId = this.taskObj.id || this.workTaskId || row.taskId;
  873. const res = await getTaskReport({ workOrderId, taskId });
  874. return {
  875. row,
  876. data: res.data || {}
  877. };
  878. })
  879. );
  880. for (const { row, data } of reportList) {
  881. if (Object.keys(data).length == 0 || data.isAssign != 1) {
  882. continue;
  883. }
  884. if (data.reportCheck != 1) {
  885. this.$message.warning(
  886. `工单${
  887. row.code || row.workOrderCode || ''
  888. }未完成任务报工,不能报工`
  889. );
  890. return false;
  891. }
  892. }
  893. } catch (error) {
  894. this.$message.warning('任务派单校验失败,请稍后重试');
  895. return false;
  896. }
  897. return true;
  898. },
  899. resetFirstArticlePickFeedStatus() {
  900. this.firstArticlePickFeedReady = true;
  901. this.firstArticlePickFeedMsg = '';
  902. this.firstArticlePickFeedCheckKey = '';
  903. },
  904. getFirstArticleWorkOrderId(row = {}) {
  905. return row.id || row.workOrderId || row.mesWorkOrderId;
  906. },
  907. getFirstArticleInspectionRows() {
  908. if (this.workOrderInfo && Object.keys(this.workOrderInfo).length) {
  909. return [this.workOrderInfo];
  910. }
  911. return this.workListIds.map((id) => ({ id }));
  912. },
  913. async checkFirstArticlePickFeed(row) {
  914. const workOrderId = this.getFirstArticleWorkOrderId(row);
  915. const taskId = this.taskObj.id;
  916. if (!workOrderId || !taskId) {
  917. return true;
  918. }
  919. return checkFeedStatus({ taskId, workOrderId });
  920. },
  921. async refreshFirstArticlePickFeedStatus() {
  922. if (this.info?.clientEnvironmentId != 9 || this.activeName !== '0') {
  923. this.resetFirstArticlePickFeedStatus();
  924. return true;
  925. }
  926. if (!this.hasFirstArticleInspectionTarget) {
  927. this.resetFirstArticlePickFeedStatus();
  928. return true;
  929. }
  930. const rows = this.getFirstArticleInspectionRows();
  931. const checkKey = `${this.activeName}-${rows
  932. .map(
  933. (row) =>
  934. `${this.taskObj.id}-${this.getFirstArticleWorkOrderId(row)}`
  935. )
  936. .join(',')}`;
  937. this.firstArticlePickFeedCheckKey = checkKey;
  938. this.firstArticlePickFeedReady = false;
  939. this.firstArticlePickFeedMsg = '正在检查领料、投料状态';
  940. try {
  941. const needPromptList = await Promise.all(
  942. rows.map((row) => this.checkFirstArticlePickFeed(row))
  943. );
  944. if (this.firstArticlePickFeedCheckKey !== checkKey) {
  945. return this.firstArticlePickFeedReady;
  946. }
  947. const needPrompt = needPromptList.some(Boolean);
  948. this.firstArticlePickFeedReady = !needPrompt;
  949. this.firstArticlePickFeedMsg = needPrompt
  950. ? '请先完成领料、投料后再进行首件两检'
  951. : '';
  952. return this.firstArticlePickFeedReady;
  953. } catch (error) {
  954. if (this.firstArticlePickFeedCheckKey === checkKey) {
  955. this.firstArticlePickFeedReady = false;
  956. this.firstArticlePickFeedMsg = '领料、投料状态检查失败,请稍后重试';
  957. }
  958. return false;
  959. }
  960. },
  961. async validateFirstArticlePickFeedBeforeInspection() {
  962. const ready = await this.refreshFirstArticlePickFeedStatus();
  963. if (!ready) {
  964. this.$message.warning(
  965. this.firstArticlePickFeedMsg || '请先完成领料、投料后再进行首件两检'
  966. );
  967. }
  968. return ready;
  969. },
  970. async footBtn(t) {
  971. this.workPlanType = '';
  972. console.log('t', t);
  973. // this.operationType = t;
  974. // 新增判断 *** 出现弹窗的时候不然右边数据消失
  975. if (['work', 'workStep', 'task'].includes(t)) {
  976. this.popupType = t;
  977. } else if (t === 'workOrder') {
  978. if (this.workListIds.length == 0) {
  979. this.$message.warning('请选择工单');
  980. return false;
  981. }
  982. if (this.workListIds.length > 1) {
  983. this.$message.warning('工单交接只能选择一个工单');
  984. return false;
  985. }
  986. this.operationType = t;
  987. } else {
  988. this.operationType = t;
  989. }
  990. if (
  991. Object.keys(this.$store.state.user.taskObj).length === 0 &&
  992. this.$store.state.user.taskObj.constructor === Object
  993. ) {
  994. this.$message.warning('请选择工序');
  995. return true;
  996. }
  997. if (['pick', 'feed', 'job', 'work', 'workStep', 'task'].includes(t)) {
  998. this.isFinalCheckProduction = false;
  999. if (this.$store.state.user.info.clientEnvironmentId == 9) {
  1000. if (t == 'feed') {
  1001. if (!this.$store.state.user.info.workCenterIds) {
  1002. return this.$message.warning('该用户没有权限投料');
  1003. }
  1004. const isWorkCenter =
  1005. this.$store.state.user.info.workCenterIds.includes(
  1006. this.taskObj.workCenterId
  1007. );
  1008. if (!isWorkCenter) {
  1009. return this.$message.warning('该用户没有权限投料');
  1010. }
  1011. }
  1012. }
  1013. this.isFinalCheckProduction = true;
  1014. if (this.workListIds.length == 0) {
  1015. this.$message.warning('请选择工单列表');
  1016. return false;
  1017. }
  1018. if ((t === 'feed' || t === 'job') && this.planDotLineEnabled) {
  1019. const actionName = t === 'feed' ? '投料' : '报工';
  1020. if (!this.checkCurrentTaskTeamPermission(actionName)) {
  1021. return false;
  1022. }
  1023. }
  1024. }
  1025. // console.log('按钮被点击了.....', t);
  1026. if (t === 'job') {
  1027. let req = {
  1028. taskId: this.taskObj.id,
  1029. workOrderId: this.workListIds[0],
  1030. data: [this.workOrderInfo]
  1031. };
  1032. this.isFinalCheckProduction = false;
  1033. if (this.$store.state.user.info.clientEnvironmentId == 9) {
  1034. if (!this.$store.state.user.info.workCenterIds) {
  1035. return this.$message.warning('该用户没有权限报工');
  1036. }
  1037. const isWorkCenter =
  1038. this.$store.state.user.info.workCenterIds.includes(
  1039. this.taskObj.workCenterId
  1040. );
  1041. if (!isWorkCenter) {
  1042. return this.$message.warning('该用户没有权限报工');
  1043. }
  1044. }
  1045. if (!(await this.validateTaskAssignBeforeWorkOrderJob())) return;
  1046. if (this.taskObj.id != '-1') {
  1047. const result = await this.checkQualityResult();
  1048. if (!result) return;
  1049. const firstArticleResult =
  1050. result.firstArticleDualInspectionResult ?? true;
  1051. if (!firstArticleResult) {
  1052. this.$message.warning('请完成首件两检再报工!');
  1053. return;
  1054. }
  1055. }
  1056. this.isFinalCheckProduction = true;
  1057. // }
  1058. if (
  1059. this.taskObj.type == 2 ||
  1060. this.taskObj.type == 3 ||
  1061. this.taskObj.type == 6
  1062. ) {
  1063. // this.$refs.jobRefs.open(req);
  1064. this.getCodeData(req);
  1065. }
  1066. }
  1067. if (t == 'pick') {
  1068. this.$nextTick(() => {
  1069. this.$refs.pickListRef.getList(this.workListIds);
  1070. });
  1071. }
  1072. // 工步
  1073. if (t === 'workStep') {
  1074. if (this.workListIds.length > 1) {
  1075. return this.$message.warning('工步只能选择一个工单!');
  1076. }
  1077. this.$refs.workStepRef.open(this.workStepQueryParam);
  1078. }
  1079. if (t === 'task') {
  1080. if (this.workListIds.length > 1) {
  1081. return this.$message.warning('任务只能选择一个工单!');
  1082. }
  1083. this.$refs.taskDialogRef.open(
  1084. this.workStepQueryParam,
  1085. this.workOrderInfo
  1086. );
  1087. }
  1088. // this.$refs.prenatalExaminationRef.open(
  1089. // this.workData.list[0],
  1090. // this.produceTaskInfo,
  1091. // type
  1092. // );
  1093. if (t == 'prenatalExamination') {
  1094. if (this.workListIds.length > 1) {
  1095. return this.$message.warning('产前准备只能选择一个工单!');
  1096. }
  1097. this.$refs.prenatalExaminationRef.open(
  1098. this.workOrderInfo,
  1099. this.taskObj,
  1100. 1
  1101. );
  1102. }
  1103. if (t == 'postpartumExamination') {
  1104. if (this.workListIds.length > 1) {
  1105. return this.$message.warning('产后检查只能选择一个工单!');
  1106. }
  1107. this.$refs.prenatalExaminationRef.open(
  1108. this.workOrderInfo,
  1109. this.taskObj,
  1110. 3
  1111. );
  1112. }
  1113. if (t == 'processDetection') {
  1114. if (this.workListIds.length > 1) {
  1115. return this.$message.warning('过程控制只能选择一个工单!');
  1116. }
  1117. this.$refs.prenatalExaminationRef.open(
  1118. this.workOrderInfo,
  1119. this.taskObj,
  1120. 2
  1121. );
  1122. }
  1123. if (t === 'error') {
  1124. if (this.workListIds.length > 1) {
  1125. return this.$message.warning('异常只能选择一个工单!');
  1126. }
  1127. // console.log(this.workListIds, 'this.workListIds');
  1128. this.$refs.createErrorRef.open('add', this.workOrderInfo);
  1129. }
  1130. if (t === 'work') {
  1131. if (this.workListIds.length > 1) {
  1132. return this.$message.warning('工艺文件只能选择一个工单!');
  1133. }
  1134. const req = this.buildCraftFileReq(
  1135. this.workOrderInfo,
  1136. this.workListIds[0]
  1137. );
  1138. await this.openWorkFile(req);
  1139. }
  1140. if (t == 'feed') {
  1141. }
  1142. if (t == 'encoding') {
  1143. this.$refs.encodingDialogRef.open([this.workOrderInfo]);
  1144. }
  1145. // 委外
  1146. if (t == 'Outsourcing') {
  1147. if (this.workListIds.length > 1) {
  1148. return this.$message.warning('委外工序只能选择一个工单!');
  1149. } else if (this.workListIds.length < 1)
  1150. return this.$message.warning('请选择工单!');
  1151. else {
  1152. // /
  1153. this.handOutsource(this.workListIds[0]);
  1154. }
  1155. }
  1156. if (t == 'qualityInspection') {
  1157. if (this.workListIds.length < 1) {
  1158. return this.$message.warning('请选择工单!');
  1159. }
  1160. if (this.workListIds.length > 1) {
  1161. return this.$message.warning('首件两检只能选择一个工单!');
  1162. }
  1163. if (!(await this.validateFirstArticlePickFeedBeforeInspection())) {
  1164. return;
  1165. }
  1166. const req = this.buildCraftFileReq(
  1167. this.workOrderInfo,
  1168. this.workOrderInfo.id
  1169. );
  1170. this.$refs.qualityInspectionRef.open(
  1171. this.workOrderInfo,
  1172. this.taskObj,
  1173. '',
  1174. req
  1175. );
  1176. }
  1177. },
  1178. handIdx(index, item) {
  1179. console.log(this.routeList, 'routeList');
  1180. console.log(index, item, 'handIdx');
  1181. if (item.count > 0 || index == this.desIndex) {
  1182. this.taskId = item.taskId;
  1183. } else {
  1184. if (item.taskId != -2) {
  1185. this.$message.info('还未执行到此工序');
  1186. return;
  1187. }
  1188. }
  1189. this.curTaskObj = JSON.parse(JSON.stringify(item));
  1190. console.log(item, 'item');
  1191. this.feedNeedEquipment = item.feedNeedEquipment;
  1192. this.reportNeedFeed = item.reportNeedFeed;
  1193. let obj = {
  1194. 1: `${item.taskTypeName}(普通工序)`,
  1195. 3: `${item.taskTypeName}(质检工序)`,
  1196. 4: `${item.taskTypeName}(包装工序)`,
  1197. 5: `${item.taskTypeName}(入库工序)`,
  1198. 6: `${item.taskTypeName}(质检工序)`
  1199. };
  1200. this.title = obj[item.type] || '';
  1201. this.type = item.type;
  1202. let taskObj = {};
  1203. taskObj = this.routeList.find((e) => e.taskId === item.taskId);
  1204. taskObj.id = taskObj.sourceTaskId;
  1205. taskObj.isOrderListData = true;
  1206. if (taskObj.taskId != 2) {
  1207. this.$store.commit('user/setTaskObj', taskObj);
  1208. this.workListIds = [this.workOrderInfo.id];
  1209. }
  1210. if (item.taskId != -2) {
  1211. this.desIndex = index;
  1212. this.newId = this.routeList[this.desIndex].taskId || '';
  1213. this.getTaskName(this.workOrderInfo);
  1214. }
  1215. this.refreshFirstArticlePickFeedStatus();
  1216. },
  1217. outsourcingAdd(type, activeName) {
  1218. this.chooseType = activeName;
  1219. this.getTaskInstanceByIdFn(this.workListIds[0]);
  1220. // this.isStep = true;
  1221. this.workInfoList = { list: [] };
  1222. this.workInfoList.list.push(this.workData);
  1223. if (this.chooseType == '2') {
  1224. this.isStep = true;
  1225. } else {
  1226. this.isOutsource = true;
  1227. }
  1228. },
  1229. async handOutsource(workOrderId) {
  1230. this.isType = '';
  1231. // return
  1232. let param = {
  1233. taskId: this.taskObj.id,
  1234. workOrderId: workOrderId
  1235. };
  1236. await pcCheckOutsource(param).then((res) => {
  1237. this.outsourceForm = {
  1238. ...res.data
  1239. };
  1240. this.isStep = false;
  1241. this.isOutsource = false;
  1242. this.isPleaseEntrust = false;
  1243. // this.outsourceForm.name = this.taskObj.taskTypeName + '委外';
  1244. if (res.data.outsource) {
  1245. this.isType = '3';
  1246. // this.getTaskInstanceByIdFn(workOrderId);
  1247. if (!this.isStep && !this.isOutsource && !this.isPleaseEntrust) {
  1248. this.$nextTick(() => {
  1249. this.$refs.outsourcingListRef.getDataList(this.workData.code);
  1250. });
  1251. }
  1252. } else {
  1253. return this.$message.warning('此工序不能委外');
  1254. }
  1255. });
  1256. },
  1257. closeWorkPlan(type) {
  1258. this.workPlanType = type;
  1259. },
  1260. closeWorkOrderHandover() {
  1261. this.operationType = null;
  1262. },
  1263. async workOrderHandoverSuccess() {
  1264. this.closeWorkOrderHandover();
  1265. await this.getOrderData();
  1266. await this.getTaskFn();
  1267. },
  1268. refreshPlease() {
  1269. this.$nextTick(() => {
  1270. this.$refs.outsourcingListRef.getPleaseData(
  1271. this.workData.list[0].code
  1272. );
  1273. });
  1274. },
  1275. //获取工单列表
  1276. getTaskInstanceByIdFn(workOrderId) {
  1277. getTaskInstanceById(workOrderId).then((res) => {
  1278. let { data } = res;
  1279. if (data.length) {
  1280. data = data.filter(
  1281. (item) => item.taskId != -2 && item.taskId != -1
  1282. );
  1283. let arr = data.findIndex(
  1284. (item) => item.sourceTaskId == this.taskObj.id
  1285. );
  1286. if (arr != -1) {
  1287. data.splice(0, arr);
  1288. }
  1289. this.$set(this.outsourceForm, 'newStepsList', data);
  1290. }
  1291. });
  1292. },
  1293. pickAdd() {
  1294. this.checkPick();
  1295. // this.pickingShow = true;
  1296. },
  1297. closePrenatalExamination() {
  1298. // this.checkProductionResult();
  1299. },
  1300. async checkPick() {
  1301. await checkRepeatPick({
  1302. workOrderId: this.workListIds[0]
  1303. }).then((res) => {
  1304. if (res.data == 0) {
  1305. this.pickingShow = true;
  1306. } else {
  1307. this.$confirm('已经有领料是否继续重复领料?', '提示', {
  1308. confirmButtonText: '确定',
  1309. cancelButtonText: '取消',
  1310. type: 'warning'
  1311. })
  1312. .then(() => {
  1313. this.pickingShow = true;
  1314. })
  1315. .catch(() => {});
  1316. }
  1317. });
  1318. },
  1319. // 关闭领料弹窗
  1320. pickingClose(val) {
  1321. if (val) {
  1322. this.$nextTick(() => {
  1323. this.$refs.pickListRef.getList(this.workListIds);
  1324. });
  1325. this.refreshFirstArticlePickFeedStatus();
  1326. }
  1327. this.pickingShow = false;
  1328. },
  1329. rowClick(row, taskId) {
  1330. if (taskId) {
  1331. let params = {
  1332. categoryId: row.categoryId,
  1333. taskId: taskId
  1334. };
  1335. getByTaskId(params).then((res) => {
  1336. this.BomObj = res.data;
  1337. this.$forceUpdate();
  1338. });
  1339. }
  1340. }
  1341. },
  1342. mounted() {
  1343. this.$nextTick(() => {
  1344. const targetElements =
  1345. document.getElementsByClassName('ele-admin-tabs');
  1346. if (targetElements.length > 0) {
  1347. // 遍历所有具有 'ele-admin-tabs' 类的元素
  1348. Array.from(targetElements).forEach((element) => {
  1349. // 对每个元素添加 'new-ele-admin-tabs' 类
  1350. element.classList.add('new-ele-admin-tabs');
  1351. });
  1352. }
  1353. });
  1354. },
  1355. destroyed() {
  1356. this.$nextTick(() => {
  1357. const targetElements =
  1358. document.getElementsByClassName('ele-admin-tabs');
  1359. if (targetElements.length > 0) {
  1360. Array.from(targetElements).forEach((element) => {
  1361. element.classList.remove('new-ele-admin-tabs');
  1362. });
  1363. }
  1364. });
  1365. }
  1366. };
  1367. </script>
  1368. <style lang="scss" scoped>
  1369. .footBtn {
  1370. position: absolute;
  1371. bottom: 20px;
  1372. left: 0;
  1373. }
  1374. .new-ele-admin-tabs {
  1375. display: none !important;
  1376. }
  1377. .c_title {
  1378. color: #157a2c;
  1379. font-size: 16px;
  1380. font-weight: bold;
  1381. }
  1382. .tableZ_box {
  1383. border: 1px solid #e3e5e5;
  1384. margin: 6px 0;
  1385. &:last-child {
  1386. border-bottom: none;
  1387. }
  1388. .row {
  1389. width: 100%;
  1390. display: flex;
  1391. }
  1392. .col {
  1393. width: calc(100% / 5);
  1394. display: flex;
  1395. align-items: center;
  1396. min-width: 200px;
  1397. min-height: 32px;
  1398. border-bottom: 1px solid #e3e5e5;
  1399. border-right: 1px solid #e3e5e5;
  1400. &:last-child {
  1401. border-right: none;
  1402. }
  1403. .name {
  1404. display: flex;
  1405. align-items: center;
  1406. padding: 4px;
  1407. width: 80px;
  1408. height: 100%;
  1409. background-color: #d0e4d5;
  1410. color: #000;
  1411. }
  1412. .content {
  1413. padding: 4px 6px;
  1414. color: #000;
  1415. }
  1416. }
  1417. .pd6 {
  1418. padding: 0 6px;
  1419. }
  1420. }
  1421. </style>
  1422. <style lang="scss" scoped>
  1423. .seek-list {
  1424. display: flex;
  1425. height: 42px;
  1426. justify-content: space-between;
  1427. align-items: center;
  1428. padding: 10px 10px;
  1429. }
  1430. .right_main_box {
  1431. background-color: #fff;
  1432. height: 100%;
  1433. box-sizing: border-box;
  1434. }
  1435. .index_box {
  1436. padding: 10px;
  1437. padding-bottom: 0;
  1438. width: 100%;
  1439. box-sizing: border-box;
  1440. min-width: 1280px !important;
  1441. // height: calc(100vh - 60px);
  1442. // overflow-x: auto;
  1443. /* 当内容超出宽度时,允许水平滚动 */
  1444. white-space: nowrap;
  1445. /* 防止内部文本换行,确保所有内容都在一行显示 */
  1446. scrollbar-width: thin;
  1447. /* 设置滚动条宽度(浏览器兼容性可能有所不同) */
  1448. scrollbar-color: #40a9ff transparent;
  1449. /* 设置滚动条颜色和轨道颜色(同样,浏览器兼容性) */
  1450. }
  1451. .main {
  1452. width: 100%;
  1453. min-width: 1280px;
  1454. height: calc(100vh - 234px);
  1455. display: flex;
  1456. justify-content: space-between;
  1457. }
  1458. .left_main {
  1459. width: 100%;
  1460. height: 100%;
  1461. display: flex;
  1462. flex-direction: column;
  1463. justify-content: space-around;
  1464. // min-width: 640px;
  1465. .top {
  1466. width: 100%;
  1467. height: 100%;
  1468. overflow: auto;
  1469. }
  1470. // .bottom {
  1471. // width: 100%;
  1472. // min-height: calc((100vh - 70px - 50px - 80px - 20px) / 2);
  1473. // overflow: hidden;
  1474. // }
  1475. }
  1476. ::v-deep .el-tabs__item.is-active {
  1477. background-color: #dffade;
  1478. /* 蓝色背景 */
  1479. color: #333;
  1480. }
  1481. ::v-deep .is-active {
  1482. color: #dffade;
  1483. }
  1484. .right_main {
  1485. width: 100%;
  1486. padding-bottom: 12px;
  1487. height: 100%;
  1488. overflow: auto;
  1489. background: #f0f3f3;
  1490. border: 1px solid rgb(207, 215, 207);
  1491. }
  1492. .drawer_content {
  1493. margin: 5px 10px;
  1494. box-sizing: border-box;
  1495. .process-route-steps {
  1496. min-height: 120px;
  1497. padding: 18px 8px 22px;
  1498. box-sizing: border-box;
  1499. }
  1500. .taskTitle {
  1501. display: flex;
  1502. width: 100%;
  1503. align-items: center;
  1504. flex-direction: row;
  1505. justify-content: center;
  1506. font-size: 16px;
  1507. color: green;
  1508. margin-bottom: 5px;
  1509. font-weight: bold;
  1510. }
  1511. }
  1512. ::v-deep .is-fullscreen {
  1513. width: 100vw !important;
  1514. height: 100vh !important;
  1515. overflow: hidden !important; /* 隐藏滚动条 */
  1516. }
  1517. ::v-deep .not-fullscreen {
  1518. width: calc(100vw - 230px) !important;
  1519. height: 100vh !important;
  1520. overflow: hidden !important; /* 隐藏滚动条 */
  1521. }
  1522. ::v-deep .active .is-text {
  1523. background: #ffa929; /* 背景色 */
  1524. border-color: #ffa929;
  1525. color: #ffffff; /* 图标文字颜色 */
  1526. }
  1527. ::v-deep .process-route-steps {
  1528. .el-step__main {
  1529. padding-top: 10px;
  1530. }
  1531. .el-step__title {
  1532. font-size: 15px;
  1533. font-weight: 500;
  1534. line-height: 1.45;
  1535. }
  1536. .step-team-name {
  1537. margin-top: 4px;
  1538. color: #606266;
  1539. font-size: 13px;
  1540. font-weight: 400;
  1541. line-height: 1.2;
  1542. word-break: break-all;
  1543. }
  1544. .el-step__icon {
  1545. width: 32px;
  1546. height: 32px;
  1547. font-size: 18px;
  1548. }
  1549. }
  1550. ::v-deep .el-tabs__content {
  1551. padding: 1px !important;
  1552. }
  1553. </style>