index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  1. <template>
  2. <!-- 生产首页 -->
  3. <view class="content-box">
  4. <uni-nav-bar
  5. fixed="true"
  6. statusBar="true"
  7. left-icon="back"
  8. :title="title"
  9. background-color="#157A2C"
  10. color="#fff"
  11. @clickLeft="back"
  12. ></uni-nav-bar>
  13. <view class="top-wrapper cx">
  14. <stepsNav
  15. v-if="info.taskId && stepsList.length"
  16. :stepsList="stepsList"
  17. :taskId="info.taskId"
  18. @selectStep="selectStep"
  19. ></stepsNav>
  20. <view class="tab_box rx-sc">
  21. <view
  22. class="tab_item"
  23. :class="{ active: tabType == 1 }"
  24. @click="handTab(1)"
  25. >基本信息</view
  26. >
  27. <view
  28. class="tab_item"
  29. :class="{ active: tabType == 2 }"
  30. @click="handTab(2)"
  31. >生产明细</view
  32. >
  33. <view
  34. class="tab_item"
  35. :class="{ active: tabType == 3 }"
  36. @click="handTab(3)"
  37. >详情</view
  38. >
  39. </view>
  40. </view>
  41. <view class="list_box">
  42. <u-list @scrolltolower="scrolltolower" key="info" v-if="tabType == 1">
  43. <!-- 工单信息卡片 -->
  44. <view class="info-card">
  45. <view class="info-card__header">
  46. <view class="info-card__header-bar"></view>
  47. <text class="info-card__header-title">工单信息</text>
  48. </view>
  49. <view class="info-card__body">
  50. <view class="info-row full">
  51. <text class="info-label">生产工单号</text>
  52. <text class="info-value highlight">{{ info.code }}</text>
  53. </view>
  54. <view class="info-row full">
  55. <text class="info-label">计划编号</text>
  56. <text class="info-value">{{ info.productionPlanCode }}</text>
  57. </view>
  58. <view class="info-row full">
  59. <text class="info-label">工艺路线</text>
  60. <text class="info-value highlight">{{ info.produceRoutingName }}</text>
  61. </view>
  62. <view class="info-grid">
  63. <view class="info-row half">
  64. <text class="info-label">批次号</text>
  65. <text class="info-value highlight">{{ info.batchNo }}</text>
  66. </view>
  67. <view class="info-row half">
  68. <text class="info-label">委外状态</text>
  69. <text class="info-value">{{ info.outsourceStatus | outsourceStatusText }}</text>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <!-- 产品信息卡片 -->
  75. <view class="info-card">
  76. <view class="info-card__header">
  77. <view class="info-card__header-bar"></view>
  78. <text class="info-card__header-title">产品信息</text>
  79. </view>
  80. <view class="info-card__body">
  81. <view class="info-row full">
  82. <text class="info-label">编码</text>
  83. <text class="info-value">{{ info.productCode }}</text>
  84. </view>
  85. <view class="info-row full">
  86. <text class="info-label">名称</text>
  87. <text class="info-value">{{ info.productName }}</text>
  88. </view>
  89. <view class="info-grid">
  90. <view class="info-row half">
  91. <text class="info-label">牌号</text>
  92. <text class="info-value">{{ info.brandNo }}</text>
  93. </view>
  94. <view class="info-row half">
  95. <text class="info-label">规格</text>
  96. <text class="info-value">{{ info.specification }}</text>
  97. </view>
  98. </view>
  99. <view class="info-row full">
  100. <text class="info-label">型号</text>
  101. <text class="info-value">{{ info.model }}</text>
  102. </view>
  103. </view>
  104. </view>
  105. <!-- 生产信息卡片 -->
  106. <view class="info-card">
  107. <view class="info-card__header">
  108. <view class="info-card__header-bar"></view>
  109. <text class="info-card__header-title">生产信息</text>
  110. </view>
  111. <view class="info-card__body">
  112. <view class="info-grid">
  113. <view class="info-row half">
  114. <text class="info-label">要求数量</text>
  115. <text class="info-value">{{ info.formingNum }} {{ info.unit }}</text>
  116. </view>
  117. <view class="info-row half">
  118. <text class="info-label">要求重量</text>
  119. <text class="info-value">{{ info.formingWeight }} {{ info.weightUnit }}</text>
  120. </view>
  121. </view>
  122. <view class="info-grid">
  123. <view class="info-row half">
  124. <text class="info-label">已完成数量</text>
  125. <text class="info-value highlight">{{ info.formedNum }}</text>
  126. </view>
  127. <view class="info-row half">
  128. <text class="info-label">已完成重量</text>
  129. <text class="info-value highlight">{{ info.formedWeight }}</text>
  130. </view>
  131. </view>
  132. <view class="info-grid">
  133. <view class="info-row half">
  134. <text class="info-label">报工类型</text>
  135. <text class="info-value">{{ info.singleReport == 1 ? "单个报工" : "批量报工" }}</text>
  136. </view>
  137. <view class="info-row half">
  138. <text class="info-label">领料状态</text>
  139. <text class="info-value">{{ isPickingStatus }}</text>
  140. </view>
  141. </view>
  142. <view class="info-row full">
  143. <text class="info-label">投料状态</text>
  144. <text class="info-value">{{ isFeedStatus }}</text>
  145. </view>
  146. </view>
  147. </view>
  148. <!-- 计划时间卡片 -->
  149. <view class="info-card">
  150. <view class="info-card__header">
  151. <view class="info-card__header-bar"></view>
  152. <text class="info-card__header-title">计划时间</text>
  153. </view>
  154. <view class="info-card__body">
  155. <view class="info-row full">
  156. <text class="info-label">开始时间</text>
  157. <text class="info-value">{{ info.planStartTime }}</text>
  158. </view>
  159. <view class="info-row full">
  160. <text class="info-label">结束时间</text>
  161. <text class="info-value">{{ info.planCompleteTime }}</text>
  162. </view>
  163. </view>
  164. </view>
  165. <!-- 底部留白 -->
  166. <view style="height: 20rpx;"></view>
  167. </u-list>
  168. <u-list @scrolltolower="scrolltolower" key="detail" v-if="tabType == 2">
  169. <view
  170. v-for="(item, index) in produceList"
  171. :key="index"
  172. class="detail-list"
  173. >
  174. <view class="name"
  175. >{{ item.taskName }}
  176. <text v-if="index == 0" style="color: #157a2c; font-size: 32rpx">
  177. (首工序)</text
  178. >
  179. </view>
  180. <view class="list rx-bc" @click="handDetails(item)">
  181. <view class="title rx-sc">
  182. <image class="icon" src="~@/static/pda/layers.svg"></image>
  183. 待投料数量
  184. </view>
  185. <view class="rx-ec" v-if="item.firstTaskDetails.length > 0">
  186. <text style="color: #157a2c; font-size: 24rpx"> 明细</text>
  187. <image
  188. class="arrow_right2"
  189. src="~@/static/pda/arrow_right2.svg"
  190. ></image>
  191. </view>
  192. <view class="rx-ec" v-else>
  193. {{ item.waitFeedNum }}
  194. <image
  195. class="arrow_right2"
  196. src="~@/static/pda/arrow_right2.svg"
  197. ></image>
  198. </view>
  199. </view>
  200. <view class="list rx-bc" @click="handDetails(item)">
  201. <view class="title rx-sc">
  202. <image class="icon" src="~@/static/pda/check-square.svg"></image>
  203. 已投料数量
  204. </view>
  205. <view class="rx-ec" v-if="item.firstTaskDetails.length > 0">
  206. <text style="color: #157a2c; font-size: 24rpx"> 明细</text>
  207. <image
  208. class="arrow_right2"
  209. src="~@/static/pda/arrow_right2.svg"
  210. ></image>
  211. </view>
  212. <view class="rx-ec" v-else>
  213. {{ item.feedNum }}
  214. <image
  215. class="arrow_right2"
  216. src="~@/static/pda/arrow_right2.svg"
  217. ></image>
  218. </view>
  219. </view>
  220. <view class="list rx-bc">
  221. <view class="title rx-sc">
  222. <image class="icon" src="~@/static/pda/target.svg"></image>
  223. 已报工数量
  224. </view>
  225. <view class="rx-ec">
  226. {{ item.reportedNum }}
  227. <image
  228. class="arrow_right2"
  229. src="~@/static/pda/arrow_right2.svg"
  230. ></image>
  231. </view>
  232. </view>
  233. </view>
  234. </u-list>
  235. <u-list
  236. @scrolltolower="scrolltolower"
  237. key="btnDeatils"
  238. v-if="tabType == 3"
  239. >
  240. <view style="margin-top: 15px">
  241. <button class="search_btn" @click="handleDetails">报工详情</button>
  242. </view>
  243. <view style="margin-top: 15px">
  244. <button class="search_btn" @click="handleFeedDetails">
  245. 投料详情
  246. </button>
  247. </view>
  248. </u-list>
  249. </view>
  250. <!-- // 按钮组件 -->
  251. <view class="bottom-wrapper">
  252. <bottomOperate
  253. @operate="operate"
  254. @refresh="refresh"
  255. :taskObj="{
  256. currentTaskName: currentTaskName || info.taskName,
  257. currentTaskId: currentTaskId || info.taskId,
  258. workOrderId: id,
  259. existOutsource: existOutsource,
  260. }"
  261. :state="currentType"
  262. :gdStatus="info.status"
  263. :controlReportMethod="controlReportMethod"
  264. :stepsList="stepsList"
  265. :info="info"
  266. ></bottomOperate>
  267. </view>
  268. <productionDetailed ref="productionDetailedRef"> </productionDetailed>
  269. </view>
  270. </template>
  271. <script>
  272. import bottomOperate from "../../components/bottomOperate.vue";
  273. import stepsNav from "../../components/stepsNav.vue";
  274. import productionDetailed from "./productionDetailed.vue";
  275. import {
  276. getTaskInstanceList,
  277. workorderInfo,
  278. produceDetail,
  279. checkStatus,
  280. skipTask,
  281. } from "@/api/pda/workOrder.js";
  282. import { parameterGetByCode } from "@/api/mainData/index.js";
  283. export default {
  284. components: {
  285. bottomOperate,
  286. stepsNav,
  287. productionDetailed,
  288. },
  289. filters: {
  290. outsourceStatusText(v) {
  291. return v == 1 ? "未委外" : v == 2 ? "委外中" : v == 3 ? "完成委外" : "";
  292. },
  293. },
  294. computed: {
  295. isFeedStatus() {
  296. const currentStep = this.stepsList?.[this.currentStepIndex];
  297. // 投料状态 0未投料 1已投料 2已报工
  298. return (
  299. this.feedStatusOption.find(
  300. (item) => item.value === currentStep?.feedStatus,
  301. )?.label || ""
  302. );
  303. },
  304. isPickingStatus() {
  305. const currentStep = this.stepsList?.[this.currentStepIndex];
  306. // 领料状态 0未领料 1领料中2已出库3已驳回
  307. return (
  308. this.pickStatusOption.find(
  309. (item) => item.value === currentStep?.pickStatus,
  310. )?.label || ""
  311. );
  312. },
  313. },
  314. data() {
  315. return {
  316. title: "",
  317. tabType: 1,
  318. id: null,
  319. stepsList: [],
  320. info: {},
  321. taskId: null,
  322. singleReport: null, // 报工类型 1单个报工 2批量报工
  323. produceList: [],
  324. feedAllow: true,
  325. currentTaskId: null,
  326. currentTaskName: null,
  327. currentType: 1,
  328. existOutsource: 0,
  329. controlReportMethod: null,
  330. clientEnvironmentId:
  331. uni.getStorageSync("userInfo") &&
  332. uni.getStorageSync("userInfo").clientEnvironmentId, // *1 主环境-601环境 2 soll-索尔环境 3 tg-碳谷环境
  333. feedNeedEquipment: 1, //投料是否要添加生产设备1是0否
  334. currentStepIndex: 0, // 当前步骤索引
  335. pickStatusOption: [
  336. {
  337. label: "未领料",
  338. value: 0,
  339. },
  340. {
  341. label: "领料中",
  342. value: 1,
  343. },
  344. {
  345. label: "已出库",
  346. value: 2,
  347. },
  348. {
  349. label: "已驳回",
  350. value: 3,
  351. },
  352. ],
  353. feedStatusOption: [
  354. {
  355. label: "未投料",
  356. value: 0,
  357. },
  358. {
  359. label: "已投料",
  360. value: 1,
  361. },
  362. {
  363. label: "已报工",
  364. value: 2,
  365. },
  366. ],
  367. };
  368. },
  369. onLoad(options) {
  370. this.title = options.title;
  371. this.id = options.id;
  372. this.singleReport = options.singleReport; // 报工类型
  373. uni.$off("refreshProduceReportWork");
  374. uni.$on("refreshProduceReportWork", this.refreshProduceReportWork);
  375. uni.showLoading({
  376. title: "加载中",
  377. });
  378. },
  379. onUnload() {
  380. uni.$off("refreshProduceReportWork");
  381. },
  382. onShow() {
  383. this.getInfo();
  384. this.getSteps();
  385. this.produce(); // 生产明细
  386. },
  387. methods: {
  388. scrolltolower() {},
  389. refreshProduceReportWork() {
  390. this.getInfo();
  391. this.getSteps();
  392. this.produce();
  393. },
  394. handTab(type) {
  395. if (type != this.tabType) {
  396. this.tabType = type;
  397. }
  398. },
  399. getSteps() {
  400. getTaskInstanceList(this.id).then((res) => {
  401. // for(let i = 0; i < res.length; i++) {
  402. // if(res[i].taskTypeName == '自然干燥' ||res[i].taskTypeName == '升温干燥') {
  403. // res[i - 1].btns = [ { name: '更换周转车', type: 'turnover'}]
  404. // }
  405. // }
  406. this.stepsList = res;
  407. this.setTypeFn();
  408. });
  409. },
  410. refresh() {
  411. console.log(1);
  412. this.getInfo();
  413. },
  414. getInfo() {
  415. workorderInfo(this.id)
  416. .then((res) => {
  417. console.log(res, 99999999999);
  418. this.info = res;
  419. this.taskId = res.taskId;
  420. this.setTypeFn();
  421. this.feedStatus();
  422. uni.hideLoading();
  423. })
  424. .catch(() => {
  425. uni.hideLoading();
  426. });
  427. },
  428. setTypeFn() {
  429. this.stepsList.length &&
  430. this.stepsList.find((f) => {
  431. let id = this.currentTaskId || this.taskId;
  432. if (f.taskId == id) {
  433. ((this.currentType = f.type),
  434. (this.existOutsource = f.existOutsource));
  435. this.controlReportMethod = f.controlReportMethod;
  436. this.currentStepIndex = f.index;
  437. }
  438. });
  439. },
  440. feedStatus() {
  441. let taskId = this.currentTaskId || this.taskId;
  442. checkStatus(this.id, taskId).then((res) => {
  443. this.feedAllow = res;
  444. });
  445. },
  446. // 点击工序列表
  447. selectStep(item) {
  448. console.log("item", item);
  449. this.currentTaskId = item.taskId;
  450. this.currentTaskName = item.taskTypeName;
  451. this.existOutsource = item.existOutsource;
  452. this.currentType = item.type;
  453. this.controlReportMethod = item.controlReportMethod;
  454. this.feedNeedEquipment = item.feedNeedEquipment;
  455. this.currentStepIndex = item.index;
  456. this.feedStatus();
  457. },
  458. // 点击之后调用事件
  459. async operate(type, item) {
  460. console.log(4444, type, item);
  461. // if (this.info.outsourceStatus == 2) {
  462. // uni.showToast({
  463. // title: "工单在委外中",
  464. // icon: "none",
  465. // })
  466. // return false
  467. // }
  468. if (this.info.status == 9) {
  469. uni.showToast({
  470. title: "工单在暂停中",
  471. icon: "none",
  472. });
  473. return false;
  474. }
  475. if (this.info.status == 10) {
  476. uni.showToast({
  477. title: "工单已终止",
  478. icon: "none",
  479. });
  480. return false;
  481. }
  482. let url;
  483. let taskId = this.currentTaskId || this.taskId;
  484. let taskName = this.currentTaskName || this.info.taskName;
  485. if (type == "picking") {
  486. url = "/pages/pda/picking/details";
  487. let _arr = JSON.stringify([this.info.id]);
  488. url += `?arr=${encodeURIComponent(_arr)}&taskId=${taskId}`;
  489. uni.navigateTo({
  490. url,
  491. });
  492. }
  493. // 投料
  494. else if (type == "feeding") {
  495. // this.outsourceForm.isFirstTask
  496. // 碳谷走老逻辑 批量走 老逻辑
  497. if (this.clientEnvironmentId == 3 || this.info.singleReport !== 1) {
  498. url = "/pages/pda/feeding/details";
  499. let _arr = JSON.stringify([this.info.id]);
  500. url += `?arr=${encodeURIComponent(
  501. _arr,
  502. )}&taskId=${taskId}&taskName=${taskName}&type=${type}&feedNeedEquipment=${
  503. this.feedNeedEquipment
  504. }`;
  505. } else {
  506. // 单个投料
  507. let arr = this.stepsList.find((f) => f.taskId == this.info.taskId);
  508. // 首工序走老逻辑
  509. console.log(arr.isFirstTask, "11111");
  510. if (arr.isFirstTask == 1) {
  511. url = "/pages/pda/feeding/details";
  512. let _arr = JSON.stringify([this.info.id]);
  513. url += `?arr=${encodeURIComponent(
  514. _arr,
  515. )}&taskId=${taskId}&taskName=${taskName}&type=${type}&feedNeedEquipment=${
  516. this.feedNeedEquipment
  517. }&taskType=${this.currentType}`;
  518. } else {
  519. // 首工序
  520. url = "/pages/pda/feeding/details";
  521. let _arr = JSON.stringify([this.info.id]);
  522. url += `?arr=${encodeURIComponent(
  523. _arr,
  524. )}&taskId=${taskId}&taskName=${taskName}&type=${type}&feedNeedEquipment=${
  525. this.feedNeedEquipment
  526. }&taskType=${this.currentType}`;
  527. }
  528. }
  529. uni.navigateTo({
  530. url,
  531. });
  532. }
  533. // 报工
  534. else if (type == "jobBooking") {
  535. // if (!this.feedAllow || this.clientEnvironmentId == 3) {
  536. // } else {
  537. // uni.showToast({
  538. // title: "请先投料",
  539. // icon: "none",
  540. // })
  541. // }
  542. if ([3, 6].includes(Number(this.currentType))) {
  543. const qualityUrl = await this.getQualityWorkOrderUrl(taskId);
  544. if (qualityUrl) {
  545. uni.navigateTo({
  546. url: qualityUrl,
  547. });
  548. return;
  549. }
  550. }
  551. url = "/pages/pda/jobBooking/index/index";
  552. url += `?id=${this.info.id}&taskId=${taskId}&taskName=${taskName}
  553. &taskType=${this.currentType}&isOutsource=${item.isOutsource || 0}
  554. &categoryId=${this.info.categoryId}&singleReport=${this.info.singleReport}`;
  555. uni.navigateTo({
  556. url,
  557. });
  558. } else if (type == "turnover") {
  559. url = "/pages/pda/turnover/index/index";
  560. url += `?workOrderId=${this.info.id}&taskId=${taskId}&taskName=${taskName}`;
  561. uni.navigateTo({
  562. url,
  563. });
  564. } else if (type == "qualityTurnover") {
  565. url = "/pages/pda/turnover/index/quality";
  566. url += `?workOrderId=${this.info.id}&taskId=${taskId}&taskName=${taskName}`;
  567. uni.navigateTo({
  568. url,
  569. });
  570. } else if (type == "sample") {
  571. url = "/pages/pda/sample/index/index";
  572. url += `?workOrderId=${this.info.id}&taskId=${taskId}&taskName=${taskName}`;
  573. uni.navigateTo({
  574. url,
  575. });
  576. } else if (type == "sampleJob") {
  577. url = "/pages/pda/sample/index/jobBooking";
  578. url += `?workOrderId=${this.info.id}&taskId=${taskId}&taskName=${taskName}`;
  579. uni.navigateTo({
  580. url,
  581. });
  582. } else if (type == "inspection") {
  583. url = "/pages/pda/sample/inspection/index";
  584. url += `?workOrderId=${this.info.id}&taskId=${taskId}&taskName=${taskName}`;
  585. uni.navigateTo({
  586. url,
  587. });
  588. } else if (type == "inspectionJob") {
  589. url = await this.getQualityWorkOrderUrl(taskId);
  590. if (!url) {
  591. url = "/pages/pda/sample/inspection/job";
  592. url += `?workOrderId=${this.info.id}&taskId=${taskId}&taskName=${taskName}`;
  593. }
  594. uni.navigateTo({
  595. url,
  596. });
  597. } else if (type == "warehousing") {
  598. url = "/pages/pda/warehousing/index";
  599. url += `?workOrderId=${this.info.id}&taskId=${taskId}`;
  600. uni.navigateTo({
  601. url,
  602. });
  603. } else if (type == "skip") {
  604. uni.showModal({
  605. title: "提示",
  606. content: `是否跳过${taskName}工序!`,
  607. confirmText: "确认", //这块是确定按钮的文字
  608. success: (rr) => {
  609. if (rr.confirm) {
  610. let param = {
  611. taskId: this.currentTaskId || this.taskId,
  612. workOrderId: this.id,
  613. };
  614. skipTask(param).then((res) => {
  615. console.log(res);
  616. });
  617. } else {
  618. }
  619. },
  620. });
  621. } else if (type == "outPicking") {
  622. url = "/pages/pda/picking/details";
  623. let _arr = JSON.stringify([this.info.id]);
  624. url += `?arr=${encodeURIComponent(
  625. _arr,
  626. )}&taskId=${taskId}&isOutsource=1`;
  627. uni.navigateTo({
  628. url,
  629. });
  630. }
  631. },
  632. async getQualityWorkOrderUrl(taskId) {
  633. let config = {};
  634. try {
  635. config = await parameterGetByCode({ code: "enable_quality_plus" });
  636. } catch (err) {
  637. console.error("获取质检配置失败", err);
  638. }
  639. if (!config || config.value != "1") {
  640. return "";
  641. }
  642. const workOrderCode = this.info.code || this.info.workOrderCode || "";
  643. const produceSourceTaskId = this.getProduceSourceTaskId(taskId);
  644. return `/pages/qms/inspectionWork/index?produceSourceTaskId=${produceSourceTaskId}&workOrderCode=${encodeURIComponent(
  645. workOrderCode,
  646. )}&fromProduceReport=1`;
  647. },
  648. getProduceSourceTaskId(taskId) {
  649. const currentStep = this.stepsList.find((item) => item.taskId == taskId);
  650. return (
  651. (currentStep && (currentStep.sourceTaskId || currentStep.produceSourceTaskId || currentStep.id)) ||
  652. taskId
  653. );
  654. },
  655. produce() {
  656. produceDetail(this.id).then((res) => {
  657. this.produceList = res.produceDetail;
  658. });
  659. },
  660. handleDetails() {
  661. let taskId = this.currentTaskId || this.taskId;
  662. let taskName = this.currentTaskName || this.info.taskName;
  663. let url = "/pages/pda/workOrder/index/details";
  664. url += `?id=${this.info.id}&taskId=${taskId}&taskName=${taskName}&taskType=${this.currentType}`;
  665. uni.navigateTo({
  666. url,
  667. });
  668. },
  669. handleFeedDetails() {
  670. let taskId = this.currentTaskId || this.taskId;
  671. let url = "/pages/pda/feeding/bill/index";
  672. url += `?id=${this.info.id}&taskId=${taskId}`;
  673. uni.navigateTo({
  674. url,
  675. });
  676. },
  677. handDetails(item) {
  678. if (this.clientEnvironmentId == 2) {
  679. if (item.firstTaskDetails.length > 0) {
  680. this.$refs.productionDetailedRef.open(item);
  681. } else {
  682. uni.showToast({
  683. title: "暂无明细",
  684. icon: "none",
  685. });
  686. }
  687. }
  688. },
  689. },
  690. };
  691. </script>
  692. <style lang="scss" scoped>
  693. .content-box {
  694. height: 100vh;
  695. overflow: hidden;
  696. display: flex;
  697. flex-direction: column;
  698. background-color: $page-bg;
  699. }
  700. .top-wrapper {
  701. background-color: #fff;
  702. display: flex;
  703. width: 750rpx;
  704. background: #fff;
  705. align-items: center;
  706. }
  707. .tab_box {
  708. width: 100%;
  709. height: 68rpx;
  710. .tab_item {
  711. height: 68rpx;
  712. line-height: 68rpx;
  713. padding: 0 20rpx;
  714. font-size: 32rpx;
  715. color: #979c9e;
  716. }
  717. .active {
  718. box-sizing: border-box;
  719. border-bottom: 6rpx solid $theme-color;
  720. color: $theme-color;
  721. }
  722. }
  723. .list_box {
  724. flex: 1;
  725. overflow: hidden;
  726. padding: 4rpx 0;
  727. .u-list {
  728. height: 100% !important;
  729. }
  730. /* 基本信息 - 卡片样式 */
  731. .info-card {
  732. width: calc(100% - 48rpx);
  733. margin: 20rpx 24rpx 0;
  734. background: #ffffff;
  735. border-radius: 16rpx;
  736. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
  737. overflow: hidden;
  738. .info-card__header {
  739. display: flex;
  740. align-items: center;
  741. padding: 24rpx 28rpx;
  742. background: linear-gradient(135deg, rgba(21, 122, 44, 0.06) 0%, rgba(21, 122, 44, 0.02) 100%);
  743. border-bottom: 1rpx solid #f0f0f0;
  744. .info-card__header-bar {
  745. width: 6rpx;
  746. height: 32rpx;
  747. background: $theme-color;
  748. border-radius: 3rpx;
  749. margin-right: 16rpx;
  750. flex-shrink: 0;
  751. }
  752. .info-card__header-title {
  753. font-size: 30rpx;
  754. font-weight: 600;
  755. color: $uni-text-color;
  756. }
  757. }
  758. .info-card__body {
  759. padding: 16rpx 28rpx 8rpx;
  760. }
  761. }
  762. .info-grid {
  763. display: flex;
  764. flex-wrap: nowrap;
  765. }
  766. .info-row {
  767. display: flex;
  768. align-items: center;
  769. padding: 14rpx 0;
  770. box-sizing: border-box;
  771. overflow: hidden;
  772. &.half {
  773. width: 50%;
  774. &:nth-child(odd) {
  775. padding-right: 16rpx;
  776. }
  777. &:nth-child(even) {
  778. padding-left: 16rpx;
  779. }
  780. }
  781. &.full {
  782. width: 100%;
  783. }
  784. }
  785. .info-label {
  786. color: $uni-text-color-grey;
  787. font-size: 28rpx;
  788. flex-shrink: 0;
  789. margin-right: 8rpx;
  790. line-height: 40rpx;
  791. white-space: nowrap;
  792. &::after {
  793. content: ':';
  794. }
  795. }
  796. .info-value {
  797. color: $uni-text-color;
  798. font-size: 28rpx;
  799. flex: 1;
  800. line-height: 40rpx;
  801. min-width: 0;
  802. overflow: hidden;
  803. text-overflow: ellipsis;
  804. white-space: nowrap;
  805. &.highlight {
  806. color: $theme-color;
  807. }
  808. }
  809. .detail-list {
  810. line-height: 80rpx;
  811. .name {
  812. color: #090a0a;
  813. font-size: 32rpx;
  814. font-weight: 600;
  815. padding: 0 32rpx;
  816. box-sizing: border-box;
  817. border-bottom: 1rpx solid #e3e5e5;
  818. }
  819. .list {
  820. padding: 0 32rpx;
  821. box-sizing: border-box;
  822. border-bottom: 1rpx solid #e3e5e5;
  823. .title {
  824. font-weight: 400;
  825. color: #090a0a;
  826. }
  827. .icon {
  828. width: 36rpx;
  829. height: 36rpx;
  830. margin-right: 8rpx;
  831. }
  832. .arrow_right2 {
  833. width: 12rpx;
  834. height: 24rpx;
  835. margin-left: 8rpx;
  836. }
  837. }
  838. }
  839. }
  840. .bottom-wrapper {
  841. }
  842. .search_btn {
  843. width: 240rpx;
  844. height: 70rpx;
  845. line-height: 70rpx;
  846. padding: 0 24rpx;
  847. background: $theme-color;
  848. font-size: 32rpx;
  849. color: #fff;
  850. margin: 0;
  851. margin-left: 26rpx;
  852. }
  853. </style>