bottomOperate.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142
  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. },
  534. errorShow: false,
  535. sceneText: "",
  536. outsourceScene: null,
  537. newTaskObj: {},
  538. outsourceShow: false,
  539. outsourceForm: {},
  540. produceList: [],
  541. warehouseList: [],
  542. typeList: [
  543. {
  544. id: 4,
  545. name: "带料生产委外",
  546. },
  547. {
  548. id: 5,
  549. name: "不带料生产委外",
  550. },
  551. ],
  552. errorTypeList: [],
  553. errorForm: {},
  554. newStepsList: [],
  555. clientEnvironmentId:
  556. uni.getStorageSync("userInfo") &&
  557. uni.getStorageSync("userInfo").clientEnvironmentId, // *1 主环境-601环境 2 soll-索尔环境 3 tg-碳谷环境
  558. isInWarehouse: [1],
  559. imageList: [],
  560. };
  561. },
  562. created() {
  563. this.getTypeList("Exception_type");
  564. },
  565. methods: {
  566. imagedelete(index) {
  567. this.imageList.splice(index, 1);
  568. },
  569. getImageData() {
  570. return this.imageList || [];
  571. },
  572. // *** 新增拍照
  573. chooseImage() {
  574. const _this = this;
  575. if (_this.imageList.length >= 9) {
  576. _this.$refs.uToast.show({
  577. type: "warning",
  578. message: "最多上传9张照片",
  579. });
  580. return;
  581. }
  582. uni.chooseImage({
  583. count: 9, //默认9
  584. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  585. sourceType: ["camera"], //从相册选择
  586. success: function (res) {
  587. uni.showLoading({
  588. title: "上传中",
  589. });
  590. _this
  591. .uploadFile(res.tempFilePaths)
  592. .then((res) => {
  593. res.forEach((item) => {
  594. let fileNames = item.storePath.split("/");
  595. let url =
  596. _this.apiUrl +
  597. "/main/file/getFile?objectName=" +
  598. item.storePath +
  599. "&fullfilename=" +
  600. fileNames[fileNames.length - 1];
  601. let images = _this.imageList;
  602. // 不能存储超过 9 张
  603. if (images.length < 9) {
  604. _this.imageList.push(url);
  605. }
  606. });
  607. uni.hideLoading();
  608. })
  609. .catch((error) => {
  610. console.log(error, "errorerrorerror");
  611. uni.hideLoading();
  612. });
  613. },
  614. });
  615. },
  616. uploadFile(list) {
  617. let PromiseAll = [];
  618. const apiUrl = this.apiUrl;
  619. const token = uni.getStorageSync("token"); //取存本地的token
  620. list.forEach((item) => {
  621. PromiseAll.push(
  622. new Promise((resolve, reject) => {
  623. uni.uploadFile({
  624. url: apiUrl + "/main/file/upload",
  625. filePath: item,
  626. name: "multiPartFile",
  627. header: {
  628. authorization: token,
  629. },
  630. success: (uploadFileRes) => {
  631. if (uploadFileRes.statusCode == 500) {
  632. uni.hideLoading();
  633. return;
  634. }
  635. let data = JSON.parse(uploadFileRes.data);
  636. resolve(data.data);
  637. },
  638. fail: (err) => {
  639. console.log(err, "123456");
  640. // 上传请求本身失败(如网络问题等),直接 reject
  641. uni.hideLoading();
  642. reject(err);
  643. },
  644. });
  645. })
  646. );
  647. });
  648. return Promise.all(PromiseAll);
  649. },
  650. // 委外时间选择
  651. //委外到 类型选择
  652. changeTaskId(e) {
  653. console.log(this.outsourceForm, e);
  654. if (this.newStepsList.length) {
  655. const id = this.newStepsList[0].sourceTaskId;
  656. //isFirstTask 1是首工序 0不是
  657. if (this.outsourceForm.isFirstTask) {
  658. this.sceneText = "首工序";
  659. this.outsourceForm.outsourceScene = 1;
  660. if (e.sourceTaskId !== id) {
  661. this.sceneText = "首工序及多工序";
  662. this.outsourceForm.outsourceScene = 4;
  663. }
  664. } else {
  665. if (e.sourceTaskId === id) {
  666. // 单工序
  667. this.sceneText = "单工序";
  668. this.outsourceForm.outsourceScene = 2;
  669. } else {
  670. //多工序
  671. this.sceneText = "多工序";
  672. this.outsourceForm.outsourceScene = 3;
  673. }
  674. }
  675. } else {
  676. uni.showToast({
  677. title: "委外到工序为空",
  678. icon: "none",
  679. });
  680. }
  681. },
  682. async getTypeList(code) {
  683. const res = await getByCode(code);
  684. const list = [];
  685. if (res.length) {
  686. res.map((item, index) => {
  687. for (var key in res[index]) {
  688. list.push({
  689. label: res[index][key],
  690. value: key,
  691. });
  692. }
  693. });
  694. }
  695. this.errorTypeList = list;
  696. },
  697. open() {
  698. this.isOperate = !this.isOperate;
  699. },
  700. errorCancel() {
  701. this.errorShow = false;
  702. },
  703. errorOk() {
  704. if (!this.errorForm.type) {
  705. uni.showToast({
  706. title: "请选择异常类型",
  707. icon: "none",
  708. });
  709. return false;
  710. }
  711. if (!this.errorForm.name) {
  712. uni.showToast({
  713. title: "请输入名称",
  714. icon: "none",
  715. });
  716. return false;
  717. }
  718. this.errorShow = false;
  719. },
  720. operate(type, item) {
  721. this.$emit("operate", type, item);
  722. },
  723. handOutsource() {
  724. let param = {
  725. taskId: this.newTaskObj.currentTaskId,
  726. workOrderId: this.newTaskObj.workOrderId,
  727. };
  728. checkOutsource(param).then((res) => {
  729. this.outsourceForm = {
  730. ...res,
  731. };
  732. this.outsourceForm.name = this.taskObj.currentTaskName + "委外";
  733. if (res.outsource) {
  734. this.getNewSteps();
  735. this.outsourceShow = true;
  736. this.produceFn();
  737. this.getWarehouseFn();
  738. } else {
  739. uni.showToast({
  740. title: "此工序不能委外",
  741. icon: "none",
  742. });
  743. }
  744. });
  745. },
  746. handPause() {
  747. if (this.GDStatus == 9) {
  748. uni.showModal({
  749. title: "提示",
  750. content: "确定该工单取消暂停?",
  751. success: async (res) => {
  752. if (res.confirm) {
  753. updateStatusPauseRecover([this.newTaskObj.workOrderId]).then(
  754. (res) => {
  755. this.$emit("refresh");
  756. }
  757. );
  758. }
  759. },
  760. });
  761. } else {
  762. uni.showModal({
  763. title: "提示",
  764. content: "确定该工单暂停?",
  765. success: async (res) => {
  766. if (res.confirm) {
  767. updateStatusPause([this.newTaskObj.workOrderId]).then((res) => {
  768. this.$emit("refresh");
  769. });
  770. }
  771. },
  772. });
  773. }
  774. },
  775. handHandover() {
  776. this.$refs.handoverRef.open();
  777. },
  778. handTerminate() {
  779. uni.showModal({
  780. title: "提示",
  781. content: "确定该工单终止?",
  782. success: async (res) => {
  783. if (res.confirm) {
  784. updateStatusTerminate([this.newTaskObj.workOrderId]).then((res) => {
  785. this.$emit("refresh");
  786. });
  787. }
  788. },
  789. });
  790. },
  791. outCancel() {
  792. this.sceneText = ""; //委外场景
  793. this.outsourceForm.outsourceScene = null;
  794. this.outsourceShow = false;
  795. EventBus.$off("outEvent");
  796. },
  797. getNewSteps() {
  798. this.activeIndex = this.getIndexOfElementInArray(
  799. this.stepsList,
  800. this.newTaskObj.currentTaskId
  801. );
  802. this.newStepsList = [];
  803. this.stepsList.forEach((f, i) => {
  804. if (
  805. f.taskId != "-1" &&
  806. f.taskId != "-2" &&
  807. i > this.activeIndex &&
  808. (f.type == 1 || f.type == 4)
  809. ) {
  810. this.newStepsList.push(f);
  811. }
  812. });
  813. },
  814. getIndexOfElementInArray(array, target) {
  815. for (let i = 0; i < array.length; i++) {
  816. if (array[i].taskId === target) {
  817. return i; // 返回第一次出现target的索引位置
  818. }
  819. }
  820. return -1; // 未找到目标值时返回-1
  821. },
  822. // 工艺路线
  823. produceFn() {
  824. let param = {
  825. pageNum: 1,
  826. size: -1,
  827. routeType: 2,
  828. };
  829. producerouting(param).then((res) => {
  830. this.produceList = res.list;
  831. });
  832. },
  833. // 仓库
  834. getWarehouseFn() {
  835. getWarehouseList().then((res) => {
  836. this.warehouseList = res;
  837. });
  838. },
  839. handError() {
  840. console.log(this.info, "taskObj");
  841. this.errorShow = true;
  842. },
  843. outsourceOk() {
  844. if (!this.outsourceForm.name) {
  845. uni.showToast({
  846. title: "请输入委外名称",
  847. icon: "none",
  848. });
  849. return false;
  850. }
  851. if (!this.outsourceForm.type) {
  852. uni.showToast({
  853. title: "请选择委外类型",
  854. icon: "none",
  855. });
  856. return false;
  857. }
  858. if (!this.outsourceForm.requireDeliveryTime) {
  859. uni.showToast({
  860. title: "请选择委外完成时间",
  861. icon: "none",
  862. });
  863. return false;
  864. }
  865. if (this.clientEnvironmentId == 2) {
  866. this.outsourceForm.isInWarehouse = 1;
  867. } else {
  868. this.isInWarehouse.length > 0
  869. ? (this.outsourceForm.isInWarehouse = 1)
  870. : (this.outsourceForm.isInWarehouse = 0);
  871. }
  872. if (this.outsourceForm.requireDeliveryTime.indexOf("00:00:00") === -1) {
  873. this.outsourceForm.requireDeliveryTime =
  874. this.outsourceForm.requireDeliveryTime + "00:00:00";
  875. }
  876. let param = {
  877. ...this.outsourceForm,
  878. taskId: this.newTaskObj.currentTaskId,
  879. workOrderId: this.newTaskObj.workOrderId,
  880. };
  881. console.log(param);
  882. this.sceneText = ""; //委外场景
  883. this.outsourceForm.outsourceScene = null;
  884. this.$refs.outsourceListRef.open(param);
  885. // let param = {
  886. // ...this.outsourceForm,
  887. // taskId: this.newTaskObj.currentTaskId,
  888. // workOrderId: this.newTaskObj.workOrderId,
  889. // isRelease: isRelease
  890. // }
  891. // applyoutsourceSave(param).then(res => {
  892. // console.log(res)
  893. // this.outCancel()
  894. // })
  895. },
  896. },
  897. };
  898. </script>
  899. <style lang="scss" scoped>
  900. .bottom_box {
  901. background: #fff;
  902. }
  903. .nav_box {
  904. width: 750rpx;
  905. height: 40rpx;
  906. background: $theme-color;
  907. .open_icon {
  908. width: 48rpx;
  909. height: 48rpx;
  910. }
  911. .open_icon_reversal {
  912. transform: scaleY(-1);
  913. /* 垂直翻转 */
  914. }
  915. }
  916. .operate_list {
  917. margin: 0 32rpx;
  918. .list {
  919. border-radius: 8rpx;
  920. border: 1rpx solid $theme-color;
  921. background: #f0f8f2;
  922. height: 64rpx;
  923. padding: 0rpx 16rpx;
  924. margin-top: 16rpx;
  925. }
  926. .round {
  927. width: 32rpx;
  928. height: 32rpx;
  929. line-height: 32rpx;
  930. text-align: center;
  931. border-radius: 50%;
  932. background: $theme-color;
  933. font-size: 24rpx;
  934. font-style: normal;
  935. font-weight: 400;
  936. color: #fff;
  937. }
  938. .name {
  939. font-family: PingFang HK;
  940. font-size: 24rpx;
  941. font-style: normal;
  942. font-weight: 600;
  943. color: $theme-color;
  944. }
  945. .arrow_right {
  946. width: 32rpx;
  947. height: 32rpx;
  948. }
  949. }
  950. .btn_box {
  951. display: flex;
  952. padding: 16rpx 32rpx;
  953. align-items: flex-start;
  954. gap: 16rpx;
  955. align-self: stretch;
  956. .btn {
  957. width: 160rpx;
  958. height: 64rpx;
  959. line-height: 64rpx;
  960. background: $theme-color;
  961. text-align: center;
  962. border-radius: 8rpx;
  963. color: #fff;
  964. font-family: PingFang HK;
  965. font-size: 24rpx;
  966. font-style: normal;
  967. font-weight: 600;
  968. }
  969. }
  970. .operate_box {
  971. padding: 10rpx 20rpx;
  972. /deep/ .u-button {
  973. width: 180rpx;
  974. }
  975. }
  976. .popup_list {
  977. width: 78vw;
  978. min-height: 360rpx;
  979. padding: 0 32rpx;
  980. .title {
  981. color: #333;
  982. font-size: 32rpx;
  983. text-align: center;
  984. padding: 30rpx;
  985. }
  986. }
  987. .list_item_btn {
  988. width: 160rpx;
  989. height: 54rpx;
  990. line-height: 54rpx;
  991. background: $theme-color;
  992. text-align: center;
  993. border-radius: 8rpx;
  994. color: #fff;
  995. font-family: PingFang HK;
  996. font-size: 22rpx;
  997. font-style: normal;
  998. font-weight: 600;
  999. }
  1000. .content_num {
  1001. display: flex;
  1002. align-items: center;
  1003. padding: 0 4rpx;
  1004. /deep/ .uni-input-input {
  1005. border: 2rpx solid #f0f8f2;
  1006. background: #f0f8f2;
  1007. color: $theme-color;
  1008. }
  1009. }
  1010. .photo_btn {
  1011. background-color: #157a2c;
  1012. width: 140rpx;
  1013. height: 60rpx;
  1014. line-height: 60rpx;
  1015. font-size: 24rpx;
  1016. color: #fff;
  1017. text-align: center;
  1018. border-radius: 8rpx;
  1019. margin-bottom: 12rpx;
  1020. display: inline-block;
  1021. }
  1022. </style>