bottomOperate.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159
  1. <template>
  2. <view class="bottom_box">
  3. <!-- 按钮组 -->
  4. <view class="nav_box rx-cc" @click="open">
  5. <image
  6. class="open_icon"
  7. :class="{ open_icon_reversal: isOperate }"
  8. src="~@/static/pda/open.svg"
  9. ></image>
  10. </view>
  11. <!-- // 弹出框 -->
  12. <view class="operate_list" v-show="isOperate">
  13. <view v-if="clientEnvironmentId == 2">
  14. <view
  15. v-for="(item, index) in btnList[btnState]"
  16. :key="index"
  17. class="list rx-bc"
  18. @click="operate(item.type, item)"
  19. >
  20. <view class="round">{{ index + 1 }}</view>
  21. <view class="name">{{ item.name }}</view>
  22. <image
  23. class="arrow_right"
  24. src="~@/static/pda/arrow_right.svg"
  25. ></image>
  26. </view>
  27. </view>
  28. <view v-else>
  29. <view
  30. v-for="(item, index) in btnListOne[btnState]"
  31. :key="index"
  32. class="list rx-bc"
  33. @click="operate(item.type, item)"
  34. >
  35. <view class="round">{{ index + 1 }}</view>
  36. <view class="name">{{ item.name }}</view>
  37. <image
  38. class="arrow_right"
  39. src="~@/static/pda/arrow_right.svg"
  40. ></image>
  41. </view>
  42. </view>
  43. <!--
  44. <view v-if='btnControlReportMethod == 2' class="list rx-bc">
  45. <view class="round">{{btnList[btnState].length + 1}}</view>
  46. <view class="name" @click="operate('skip', {})" >跳过(不报工)</view>
  47. <image class="arrow_right" src="~@/static/pda/arrow_right.svg"></image>
  48. </view>
  49. -->
  50. <view
  51. v-if="newTaskObj.existOutsource == 1"
  52. class="list rx-bc"
  53. @click="operate('outPicking', {})"
  54. >
  55. <view class="round">{{ btnList[btnState].length + 1 }}</view>
  56. <view class="name">委外领料</view>
  57. <image class="arrow_right" src="~@/static/pda/arrow_right.svg"></image>
  58. </view>
  59. <!-- <view v-if="newTaskObj.existOutsource == 1" class="list rx-bc"
  60. @click="operate('jobBooking', { isOutsource: 1 })">
  61. <view class="round">{{ btnList[btnState].length + 2 }}</view>
  62. <view class="name">委外报工</view>
  63. <image class="arrow_right" src="~@/static/pda/arrow_right.svg"></image>
  64. </view> -->
  65. </view>
  66. <view class="btn_box">
  67. <view class="btn" @click="handPause()">{{
  68. GDStatus == 9 ? "取消暂停" : "暂停"
  69. }}</view>
  70. <view class="btn" @click="handTerminate()">终止</view>
  71. <view class="btn">转派</view>
  72. <view
  73. class="btn"
  74. :style="newTaskObj.existOutsource == 1 ? 'background: #FFA929' : ''"
  75. @click="handOutsource()"
  76. >委外</view
  77. >
  78. <view class="btn" @click="handHandover">交接</view>
  79. <view class="btn" @click="handError">异常</view>
  80. </view>
  81. <!-- //委外弹窗 -->
  82. <SearchPopup mode="center" v-if="outsourceShow">
  83. <template v-slot:list>
  84. <view class="popup_list">
  85. <view class="title">【{{ taskObj.currentTaskName }}】是否委外</view>
  86. <u-form
  87. labelPosition="left"
  88. :model="outsourceForm"
  89. labelWidth="180"
  90. labelAlign="left"
  91. class=""
  92. >
  93. <u-form-item label="委外名称:" borderBottom prop="name">
  94. <input
  95. class="uni-input"
  96. v-model="outsourceForm.name"
  97. placeholder="请输入委外名称"
  98. />
  99. </u-form-item>
  100. <u-form-item label="委外类型:" borderBottom prop="">
  101. <zxz-uni-data-select
  102. :localdata="typeList"
  103. v-model="outsourceForm.type"
  104. dataValue="id"
  105. dataKey="name"
  106. filterable
  107. format="{name}"
  108. ></zxz-uni-data-select>
  109. </u-form-item>
  110. <u-form-item label="委外数量:" borderBottom prop="formedNumLast">
  111. <input
  112. class="uni-input content_num"
  113. v-model="outsourceForm.formedNumLast"
  114. type="number"
  115. />
  116. </u-form-item>
  117. <u-form-item label="委外到:" borderBottom prop="taskIds">
  118. <zxz-uni-data-select
  119. :localdata="newStepsList"
  120. style="font-size: 15px"
  121. v-model="outsourceForm.taskIds"
  122. dataValue="taskId"
  123. format="{taskTypeName}"
  124. dataKey="taskId"
  125. filterable
  126. :clear="true"
  127. @change="changeTaskId"
  128. ></zxz-uni-data-select>
  129. </u-form-item>
  130. <u-form-item label="委外场景:" borderBottom prop="taskIds">
  131. {{ sceneText }}
  132. </u-form-item>
  133. <u-form-item
  134. label="直接入库:"
  135. borderBottom
  136. prop="isInWarehouse"
  137. v-if="outsourceForm.isFirstTask != 1"
  138. >
  139. <!-- <u-checkbox-group v-model="isInWarehouse" size="15px" v-if="clientEnvironmentId != 2" >
  140. <u-checkbox labelSize="15px" iconSize="10px" activeColor="#157A2C" name="true"
  141. label="是" disabled></u-checkbox>
  142. </u-checkbox-group>
  143. <view style="font-size: 15px;" v-if="clientEnvironmentId == 2">是</view> -->
  144. <zxz-uni-data-select
  145. style="margin-left: 10px; font-size: 15px"
  146. v-if="clientEnvironmentId == 2 || isInWarehouse.length"
  147. :localdata="warehouseList"
  148. v-model="outsourceForm.warehouseId"
  149. dataValue="id"
  150. dataKey="name"
  151. filterable
  152. format="{name}"
  153. ></zxz-uni-data-select>
  154. </u-form-item>
  155. <u-form-item
  156. label="工艺路线:"
  157. borderBottom
  158. style="font-size: 15px"
  159. prop="produceRoutingId"
  160. v-if="
  161. clientEnvironmentId != 2 &&
  162. outsourceForm.isFirstTask != 1 &&
  163. isInWarehouse &&
  164. isInWarehouse.length == 0
  165. "
  166. >
  167. <zxz-uni-data-select
  168. :localdata="produceList"
  169. v-model="outsourceForm.produceRoutingId"
  170. dataValue="id"
  171. dataKey="name"
  172. filterable
  173. format="{name}"
  174. ></zxz-uni-data-select>
  175. </u-form-item>
  176. <u-form-item
  177. label="计划交期:"
  178. borderBottom
  179. prop="requireDeliveryTime"
  180. >
  181. <uni-datetime-picker
  182. type="datetime"
  183. v-model="outsourceForm.requireDeliveryTime"
  184. />
  185. </u-form-item>
  186. </u-form>
  187. </view>
  188. </template>
  189. <template v-slot:operate>
  190. <view class="operate_box rx-bc">
  191. <u-button size="small" class="u-reset-button" @click="outCancel">
  192. 取消
  193. </u-button>
  194. <u-button
  195. type="success"
  196. size="small"
  197. class="u-reset-button"
  198. @click="outsourceOk()"
  199. >
  200. 确定
  201. </u-button>
  202. <!-- <u-button type="success" size="small" class="u-reset-button" @click="outsourceOk(1)">
  203. 提交并发布
  204. </u-button> -->
  205. </view>
  206. </template>
  207. </SearchPopup>
  208. <!-- 异常弹窗 -->
  209. <SearchPopup mode="center" v-if="errorShow">
  210. <template v-slot:list>
  211. <view class="popup_list">
  212. <view class="title">异常信息</view>
  213. <u-form
  214. labelPosition="left"
  215. :model="errorForm"
  216. labelWidth="180"
  217. labelAlign="left"
  218. class=""
  219. >
  220. <u-form-item label="工单号:" borderBottom prop="code">
  221. <input
  222. class="uni-input content_num"
  223. v-model="info.code"
  224. disabled
  225. />
  226. </u-form-item>
  227. <u-form-item label="产品编码:" borderBottom prop="code">
  228. <input
  229. class="uni-input content_num"
  230. v-model="info.productCode"
  231. disabled
  232. />
  233. </u-form-item>
  234. <u-form-item label="产品名称:" borderBottom prop="code">
  235. <input
  236. class="uni-input content_num"
  237. v-model="info.productName"
  238. disabled
  239. />
  240. </u-form-item>
  241. <u-form-item label="异常类型:" borderBottom prop="type">
  242. <zxz-uni-data-select
  243. :localdata="errorTypeList"
  244. v-model="errorForm.type"
  245. dataValue="value"
  246. dataKey="label"
  247. filterable
  248. format="{label}"
  249. ></zxz-uni-data-select>
  250. </u-form-item>
  251. <u-form-item label="编码:" borderBottom prop="code">
  252. <input
  253. class="uni-input content_num"
  254. v-model="errorForm.code"
  255. disabled
  256. />
  257. </u-form-item>
  258. <u-form-item label="名称:" borderBottom prop="name">
  259. <input class="uni-input content_num" v-model="errorForm.name" />
  260. </u-form-item>
  261. <u-form-item label="异常描述:" borderBottom prop="name">
  262. <input
  263. type="textarea"
  264. class="content_num"
  265. v-model="errorForm.describes"
  266. />
  267. </u-form-item>
  268. </u-form>
  269. </view>
  270. <view class="photo_btn" @click="chooseImage">拍照</view>
  271. <view class="photo_list">
  272. <PreviewPhoto
  273. type="add"
  274. @imagedelete="imagedelete"
  275. :imageList="imageList"
  276. />
  277. </view>
  278. </template>
  279. <template v-slot:operate>
  280. <view class="operate_box rx-bc">
  281. <u-button size="small" class="u-reset-button" @click="errorCancel">
  282. 取消
  283. </u-button>
  284. <u-button
  285. type="success"
  286. size="small"
  287. class="u-reset-button"
  288. @click="errorOk()"
  289. >
  290. 确定
  291. </u-button>
  292. <!-- <u-button type="success" size="small" class="u-reset-button" @click="outsourceOk(1)">
  293. 提交并发布
  294. </u-button> -->
  295. </view>
  296. </template>
  297. </SearchPopup>
  298. <outsourceList ref="outsourceListRef" @close="outCancel()"></outsourceList>
  299. <handover ref="handoverRef"></handover>
  300. </view>
  301. </template>
  302. <script>
  303. import {
  304. getTwoTreeByPid,
  305. checkOutsource,
  306. applyoutsourceSave,
  307. producerouting,
  308. getWarehouseList,
  309. updateStatusPause,
  310. updateStatusPauseRecover,
  311. updateStatusTerminate,
  312. } from "@/api/pda/workOrder.js";
  313. import SearchPopup from "./searchPopup.vue";
  314. import outsourceList from "./outsourceList.vue";
  315. import handover from "./handover.vue";
  316. import { EventBus } from "@/utils/eventBus.js";
  317. import { getByCode } from "@/api/pda/common.js";
  318. import PreviewPhoto from "@/pages/maintenance/check/components/PreviewPhoto.vue";
  319. export default {
  320. components: {
  321. SearchPopup,
  322. outsourceList,
  323. handover,
  324. PreviewPhoto,
  325. },
  326. props: {
  327. state: String | Number,
  328. gdStatus: String | Number,
  329. taskObj: Object,
  330. info: {
  331. type: Object,
  332. default: {},
  333. },
  334. controlReportMethod: String | Number,
  335. stepsList: {
  336. type: Array,
  337. default: () => [],
  338. },
  339. },
  340. watch: {
  341. btns: {
  342. immediate: true,
  343. deep: true,
  344. handler(newVal) {
  345. this.btnsList = [];
  346. this.btnsList = newVal;
  347. },
  348. },
  349. state: {
  350. immediate: true,
  351. deep: true,
  352. handler(newVal) {
  353. this.btnState = newVal;
  354. },
  355. },
  356. gdStatus: {
  357. immediate: true,
  358. deep: true,
  359. handler(newVal) {
  360. this.GDStatus = newVal;
  361. },
  362. },
  363. controlReportMethod: {
  364. immediate: true,
  365. deep: true,
  366. handler(newVal) {
  367. this.btnControlReportMethod = newVal;
  368. },
  369. },
  370. taskObj: {
  371. immediate: true,
  372. deep: true,
  373. handler(newVal) {
  374. this.newTaskObj = newVal;
  375. },
  376. },
  377. stepsList: {
  378. immediate: true,
  379. deep: true,
  380. handler(newVal) {},
  381. },
  382. },
  383. data() {
  384. return {
  385. isOperate: false,
  386. sceneText: "",
  387. outsourceScene: null,
  388. btnsList: [],
  389. btnState: 1,
  390. GDStatus: null,
  391. btnControlReportMethod: null,
  392. btnList: {
  393. 1: [
  394. {
  395. name: "领料",
  396. type: "picking",
  397. },
  398. {
  399. name: "投料",
  400. type: "feeding",
  401. },
  402. {
  403. name: "更换周转车",
  404. type: "turnover",
  405. },
  406. {
  407. name: "报工",
  408. type: "jobBooking",
  409. isOutsource: 0,
  410. },
  411. // {
  412. // name: '多工单报工',
  413. // type: ''
  414. // }
  415. ],
  416. 2: [
  417. {
  418. name: "取样",
  419. type: "sample",
  420. },
  421. {
  422. name: "报工",
  423. type: "sampleJob",
  424. },
  425. ],
  426. 3: [
  427. {
  428. name: "更换周转车",
  429. type: "qualityTurnover",
  430. },
  431. {
  432. name: "质检",
  433. type: "inspection",
  434. },
  435. {
  436. name: "报工",
  437. type: "inspectionJob",
  438. },
  439. ],
  440. 4: [
  441. {
  442. name: "领料",
  443. type: "picking",
  444. },
  445. {
  446. name: "投料",
  447. type: "feeding",
  448. },
  449. {
  450. name: "报工",
  451. type: "jobBooking",
  452. },
  453. ],
  454. 5: [
  455. {
  456. name: "入库",
  457. type: "warehousing",
  458. },
  459. ],
  460. 6: [
  461. {
  462. name: "报工",
  463. type: "jobBooking",
  464. },
  465. ],
  466. },
  467. btnListOne: {
  468. 1: [
  469. {
  470. name: "领料",
  471. type: "picking",
  472. },
  473. {
  474. name: "投料",
  475. type: "feeding",
  476. },
  477. {
  478. name: "报工",
  479. type: "jobBooking",
  480. isOutsource: 0,
  481. },
  482. // {
  483. // name: '多工单报工',
  484. // type: ''
  485. // }
  486. ],
  487. 2: [
  488. {
  489. name: "取样",
  490. type: "sample",
  491. },
  492. {
  493. name: "报工",
  494. type: "sampleJob",
  495. },
  496. ],
  497. 3: [
  498. {
  499. name: "质检",
  500. type: "inspection",
  501. },
  502. {
  503. name: "报工",
  504. type: "inspectionJob",
  505. },
  506. ],
  507. 4: [
  508. {
  509. name: "领料",
  510. type: "picking",
  511. },
  512. {
  513. name: "投料",
  514. type: "feeding",
  515. },
  516. {
  517. name: "报工",
  518. type: "jobBooking",
  519. },
  520. ],
  521. 5: [
  522. {
  523. name: "入库",
  524. type: "warehousing",
  525. },
  526. ],
  527. 6: [
  528. {
  529. name: "报工",
  530. type: "jobBooking",
  531. },
  532. ],
  533. 99: [
  534. {
  535. name: "领料",
  536. type: "picking",
  537. },
  538. {
  539. name: "投料",
  540. type: "feeding",
  541. },
  542. {
  543. name: "报工",
  544. type: "jobBooking",
  545. isOutsource: 0,
  546. },
  547. ],
  548. },
  549. errorShow: false,
  550. sceneText: "",
  551. outsourceScene: null,
  552. newTaskObj: {},
  553. outsourceShow: false,
  554. outsourceForm: {},
  555. produceList: [],
  556. warehouseList: [],
  557. typeList: [
  558. {
  559. id: 4,
  560. name: "带料生产委外",
  561. },
  562. {
  563. id: 5,
  564. name: "不带料生产委外",
  565. },
  566. ],
  567. errorTypeList: [],
  568. errorForm: {},
  569. newStepsList: [],
  570. clientEnvironmentId:
  571. uni.getStorageSync("userInfo") &&
  572. uni.getStorageSync("userInfo").clientEnvironmentId, // *1 主环境-601环境 2 soll-索尔环境 3 tg-碳谷环境
  573. isInWarehouse: [1],
  574. imageList: [],
  575. };
  576. },
  577. created() {
  578. this.getTypeList("Exception_type");
  579. },
  580. methods: {
  581. imagedelete(index) {
  582. this.imageList.splice(index, 1);
  583. },
  584. getImageData() {
  585. return this.imageList || [];
  586. },
  587. // *** 新增拍照
  588. chooseImage() {
  589. const _this = this;
  590. if (_this.imageList.length >= 9) {
  591. _this.$refs.uToast.show({
  592. type: "warning",
  593. message: "最多上传9张照片",
  594. });
  595. return;
  596. }
  597. uni.chooseImage({
  598. count: 9, //默认9
  599. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  600. sourceType: ["camera"], //从相册选择
  601. success: function (res) {
  602. uni.showLoading({
  603. title: "上传中",
  604. });
  605. _this
  606. .uploadFile(res.tempFilePaths)
  607. .then((res) => {
  608. res.forEach((item) => {
  609. let fileNames = item.storePath.split("/");
  610. let url =
  611. _this.apiUrl +
  612. "/main/file/getFile?objectName=" +
  613. item.storePath +
  614. "&fullfilename=" +
  615. fileNames[fileNames.length - 1];
  616. let images = _this.imageList;
  617. // 不能存储超过 9 张
  618. if (images.length < 9) {
  619. _this.imageList.push(url);
  620. }
  621. });
  622. uni.hideLoading();
  623. })
  624. .catch((error) => {
  625. console.log(error, "errorerrorerror");
  626. uni.hideLoading();
  627. });
  628. },
  629. });
  630. },
  631. uploadFile(list) {
  632. let PromiseAll = [];
  633. const apiUrl = this.apiUrl;
  634. const token = uni.getStorageSync("token"); //取存本地的token
  635. list.forEach((item) => {
  636. PromiseAll.push(
  637. new Promise((resolve, reject) => {
  638. uni.uploadFile({
  639. url: apiUrl + "/main/file/upload",
  640. filePath: item,
  641. name: "multiPartFile",
  642. header: {
  643. authorization: token,
  644. },
  645. success: (uploadFileRes) => {
  646. if (uploadFileRes.statusCode == 500) {
  647. uni.hideLoading();
  648. return;
  649. }
  650. let data = JSON.parse(uploadFileRes.data);
  651. resolve(data.data);
  652. },
  653. fail: (err) => {
  654. console.log(err, "123456");
  655. // 上传请求本身失败(如网络问题等),直接 reject
  656. uni.hideLoading();
  657. reject(err);
  658. },
  659. });
  660. })
  661. );
  662. });
  663. return Promise.all(PromiseAll);
  664. },
  665. // 委外时间选择
  666. //委外到 类型选择
  667. changeTaskId(e) {
  668. console.log(this.outsourceForm, e);
  669. if (this.newStepsList.length) {
  670. const id = this.newStepsList[0].sourceTaskId;
  671. //isFirstTask 1是首工序 0不是
  672. if (this.outsourceForm.isFirstTask) {
  673. this.sceneText = "首工序";
  674. this.outsourceForm.outsourceScene = 1;
  675. if (e.sourceTaskId !== id) {
  676. this.sceneText = "首工序及多工序";
  677. this.outsourceForm.outsourceScene = 4;
  678. }
  679. } else {
  680. if (e.sourceTaskId === id) {
  681. // 单工序
  682. this.sceneText = "单工序";
  683. this.outsourceForm.outsourceScene = 2;
  684. } else {
  685. //多工序
  686. this.sceneText = "多工序";
  687. this.outsourceForm.outsourceScene = 3;
  688. }
  689. }
  690. } else {
  691. uni.showToast({
  692. title: "委外到工序为空",
  693. icon: "none",
  694. });
  695. }
  696. },
  697. async getTypeList(code) {
  698. const res = await getByCode(code);
  699. const list = [];
  700. if (res.length) {
  701. res.map((item, index) => {
  702. for (var key in res[index]) {
  703. list.push({
  704. label: res[index][key],
  705. value: key,
  706. });
  707. }
  708. });
  709. }
  710. this.errorTypeList = list;
  711. },
  712. open() {
  713. this.isOperate = !this.isOperate;
  714. },
  715. errorCancel() {
  716. this.errorShow = false;
  717. },
  718. errorOk() {
  719. if (!this.errorForm.type) {
  720. uni.showToast({
  721. title: "请选择异常类型",
  722. icon: "none",
  723. });
  724. return false;
  725. }
  726. if (!this.errorForm.name) {
  727. uni.showToast({
  728. title: "请输入名称",
  729. icon: "none",
  730. });
  731. return false;
  732. }
  733. this.errorShow = false;
  734. },
  735. operate(type, item) {
  736. this.$emit("operate", type, item);
  737. },
  738. handOutsource() {
  739. let param = {
  740. taskId: this.newTaskObj.currentTaskId,
  741. workOrderId: this.newTaskObj.workOrderId,
  742. };
  743. checkOutsource(param).then((res) => {
  744. this.outsourceForm = {
  745. ...res,
  746. };
  747. this.outsourceForm.name = this.taskObj.currentTaskName + "委外";
  748. if (res.outsource) {
  749. this.getNewSteps();
  750. this.outsourceShow = true;
  751. this.produceFn();
  752. this.getWarehouseFn();
  753. } else {
  754. uni.showToast({
  755. title: "此工序不能委外",
  756. icon: "none",
  757. });
  758. }
  759. });
  760. },
  761. handPause() {
  762. if (this.GDStatus == 9) {
  763. uni.showModal({
  764. title: "提示",
  765. content: "确定该工单取消暂停?",
  766. success: async (res) => {
  767. if (res.confirm) {
  768. updateStatusPauseRecover([this.newTaskObj.workOrderId]).then(
  769. (res) => {
  770. this.$emit("refresh");
  771. }
  772. );
  773. }
  774. },
  775. });
  776. } else {
  777. uni.showModal({
  778. title: "提示",
  779. content: "确定该工单暂停?",
  780. success: async (res) => {
  781. if (res.confirm) {
  782. updateStatusPause([this.newTaskObj.workOrderId]).then((res) => {
  783. this.$emit("refresh");
  784. });
  785. }
  786. },
  787. });
  788. }
  789. },
  790. handHandover() {
  791. this.$refs.handoverRef.open();
  792. },
  793. handTerminate() {
  794. uni.showModal({
  795. title: "提示",
  796. content: "确定该工单终止?",
  797. success: async (res) => {
  798. if (res.confirm) {
  799. updateStatusTerminate([this.newTaskObj.workOrderId]).then((res) => {
  800. this.$emit("refresh");
  801. });
  802. }
  803. },
  804. });
  805. },
  806. outCancel() {
  807. this.sceneText = ""; //委外场景
  808. this.outsourceForm.outsourceScene = null;
  809. this.outsourceShow = false;
  810. EventBus.$off("outEvent");
  811. },
  812. getNewSteps() {
  813. this.activeIndex = this.getIndexOfElementInArray(
  814. this.stepsList,
  815. this.newTaskObj.currentTaskId
  816. );
  817. this.newStepsList = [];
  818. this.stepsList.forEach((f, i) => {
  819. if (
  820. f.taskId != "-1" &&
  821. f.taskId != "-2" &&
  822. i > this.activeIndex &&
  823. (f.type == 1 || f.type == 4)
  824. ) {
  825. this.newStepsList.push(f);
  826. }
  827. });
  828. },
  829. getIndexOfElementInArray(array, target) {
  830. for (let i = 0; i < array.length; i++) {
  831. if (array[i].taskId === target) {
  832. return i; // 返回第一次出现target的索引位置
  833. }
  834. }
  835. return -1; // 未找到目标值时返回-1
  836. },
  837. // 工艺路线
  838. produceFn() {
  839. let param = {
  840. pageNum: 1,
  841. size: -1,
  842. routeType: 2,
  843. };
  844. producerouting(param).then((res) => {
  845. this.produceList = res.list;
  846. });
  847. },
  848. // 仓库
  849. getWarehouseFn() {
  850. getWarehouseList().then((res) => {
  851. this.warehouseList = res;
  852. });
  853. },
  854. handError() {
  855. console.log(this.info, "taskObj");
  856. this.errorShow = true;
  857. },
  858. outsourceOk() {
  859. if (!this.outsourceForm.name) {
  860. uni.showToast({
  861. title: "请输入委外名称",
  862. icon: "none",
  863. });
  864. return false;
  865. }
  866. if (!this.outsourceForm.type) {
  867. uni.showToast({
  868. title: "请选择委外类型",
  869. icon: "none",
  870. });
  871. return false;
  872. }
  873. if (!this.outsourceForm.requireDeliveryTime) {
  874. uni.showToast({
  875. title: "请选择委外完成时间",
  876. icon: "none",
  877. });
  878. return false;
  879. }
  880. if (this.clientEnvironmentId == 2) {
  881. this.outsourceForm.isInWarehouse = 1;
  882. } else {
  883. this.isInWarehouse.length > 0
  884. ? (this.outsourceForm.isInWarehouse = 1)
  885. : (this.outsourceForm.isInWarehouse = 0);
  886. }
  887. if (this.outsourceForm.requireDeliveryTime.indexOf("00:00:00") === -1) {
  888. this.outsourceForm.requireDeliveryTime =
  889. this.outsourceForm.requireDeliveryTime + "00:00:00";
  890. }
  891. let param = {
  892. ...this.outsourceForm,
  893. taskId: this.newTaskObj.currentTaskId,
  894. workOrderId: this.newTaskObj.workOrderId,
  895. };
  896. console.log(param);
  897. this.sceneText = ""; //委外场景
  898. this.outsourceForm.outsourceScene = null;
  899. this.$refs.outsourceListRef.open(param);
  900. // let param = {
  901. // ...this.outsourceForm,
  902. // taskId: this.newTaskObj.currentTaskId,
  903. // workOrderId: this.newTaskObj.workOrderId,
  904. // isRelease: isRelease
  905. // }
  906. // applyoutsourceSave(param).then(res => {
  907. // console.log(res)
  908. // this.outCancel()
  909. // })
  910. },
  911. },
  912. };
  913. </script>
  914. <style lang="scss" scoped>
  915. .bottom_box {
  916. background: #fff;
  917. }
  918. .nav_box {
  919. width: 750rpx;
  920. height: 40rpx;
  921. background: $theme-color;
  922. .open_icon {
  923. width: 48rpx;
  924. height: 48rpx;
  925. }
  926. .open_icon_reversal {
  927. transform: scaleY(-1);
  928. /* 垂直翻转 */
  929. }
  930. }
  931. .operate_list {
  932. margin: 0 32rpx;
  933. .list {
  934. border-radius: 8rpx;
  935. border: 1rpx solid $theme-color;
  936. background: #f0f8f2;
  937. height: 64rpx;
  938. padding: 0rpx 16rpx;
  939. margin-top: 16rpx;
  940. }
  941. .round {
  942. width: 32rpx;
  943. height: 32rpx;
  944. line-height: 32rpx;
  945. text-align: center;
  946. border-radius: 50%;
  947. background: $theme-color;
  948. font-size: 24rpx;
  949. font-style: normal;
  950. font-weight: 400;
  951. color: #fff;
  952. }
  953. .name {
  954. font-family: PingFang HK;
  955. font-size: 24rpx;
  956. font-style: normal;
  957. font-weight: 600;
  958. color: $theme-color;
  959. }
  960. .arrow_right {
  961. width: 32rpx;
  962. height: 32rpx;
  963. }
  964. }
  965. .btn_box {
  966. display: flex;
  967. padding: 16rpx 32rpx;
  968. align-items: flex-start;
  969. gap: 16rpx;
  970. align-self: stretch;
  971. .btn {
  972. width: 160rpx;
  973. height: 64rpx;
  974. line-height: 64rpx;
  975. background: $theme-color;
  976. text-align: center;
  977. border-radius: 8rpx;
  978. color: #fff;
  979. font-family: PingFang HK;
  980. font-size: 24rpx;
  981. font-style: normal;
  982. font-weight: 600;
  983. }
  984. }
  985. .operate_box {
  986. padding: 10rpx 20rpx;
  987. /deep/ .u-button {
  988. width: 180rpx;
  989. }
  990. }
  991. .popup_list {
  992. width: 78vw;
  993. min-height: 360rpx;
  994. padding: 0 32rpx;
  995. .title {
  996. color: #333;
  997. font-size: 32rpx;
  998. text-align: center;
  999. padding: 30rpx;
  1000. }
  1001. }
  1002. .list_item_btn {
  1003. width: 160rpx;
  1004. height: 54rpx;
  1005. line-height: 54rpx;
  1006. background: $theme-color;
  1007. text-align: center;
  1008. border-radius: 8rpx;
  1009. color: #fff;
  1010. font-family: PingFang HK;
  1011. font-size: 22rpx;
  1012. font-style: normal;
  1013. font-weight: 600;
  1014. }
  1015. .content_num {
  1016. display: flex;
  1017. align-items: center;
  1018. padding: 0 4rpx;
  1019. /deep/ .uni-input-input {
  1020. border: 2rpx solid #f0f8f2;
  1021. background: #f0f8f2;
  1022. color: $theme-color;
  1023. }
  1024. }
  1025. .photo_btn {
  1026. background-color: #157a2c;
  1027. width: 140rpx;
  1028. height: 60rpx;
  1029. line-height: 60rpx;
  1030. font-size: 24rpx;
  1031. color: #fff;
  1032. text-align: center;
  1033. border-radius: 8rpx;
  1034. margin-bottom: 12rpx;
  1035. display: inline-block;
  1036. }
  1037. </style>