index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904
  1. <template>
  2. <view v-if="isMaskShow" class="mask">
  3. </view>
  4. <view class="uni-column" style="height: 100%; background-color: #f5f5f5;">
  5. <view class="box-bg uni-row">
  6. <view class="input-view uni-row">
  7. <uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
  8. <input class="nav-bar-input" type="text" v-model="keywords" placeholder="请输入批次号/箱号" />
  9. </view>
  10. <view class="search" @click="handleSearch">
  11. 搜索
  12. </view>
  13. </view>
  14. <view class="list-title uni-row">
  15. <!-- <div class="list-title uni-row"> -->
  16. <text class="label">是否正常批次</text>
  17. <text>{{ normalStatus ? '是' : '否' }}</text>
  18. <switch class="switch" :checked="normalStatus" @change="switchChange" color="rgba(103, 195, 55, 1.0)" />
  19. <!-- <text>{{ }}</text> -->
  20. <!-- </div> -->
  21. <!-- <text class="label">是否正常批次</text><text>是</text>
  22. <switch class="switch" @change="switchChange" color="rgba(255,85,85,1)" />
  23. <text>否</text> -->
  24. </view>
  25. <view class="scroll-container" style="padding-bottom: 150rpx">
  26. <view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
  27. <text>暂无批次</text>
  28. </view>
  29. <!-- 批次列表 -->
  30. <view v-else v-for="(item, index) in listData" :key="index" class="list-item"
  31. @click="handleToreportingForWork(item)">
  32. <view class="title-container uni-row" style="justify-content: flex-start;">
  33. <view class="title uni-row">
  34. <text class="label">批次号:</text>
  35. <text class="label code">{{ item['lotCode'] }}</text>
  36. </view>
  37. <view class=" uni-row" style="margin-left: 16rpx;">
  38. <view v-if="item['status'] == 1" class="tag"><text class="label">进行中</text></view>
  39. <view v-else-if="item['status'] == 3" class="tag turnover "><text class="label">待领取</text>
  40. </view>
  41. <view v-else-if="item['status'] == 2" class="tag turnover "><text class="label">待周转</text>
  42. </view>
  43. <view v-else-if="item['status'] == 0" class="tag finished "><text class="label">未开始</text>
  44. </view>
  45. <view v-else-if="item['status'] == 4" type="default finished" class="tag finished"><text
  46. class="label">已完成</text></view>
  47. </view>
  48. </view>
  49. <view class="item-info uni-row">
  50. <text class="label">产品描述</text>
  51. <text class="label right">{{ curPlan['productDescription'] }}</text>
  52. </view>
  53. <view class="item-info uni-row">
  54. <text class="label">材质</text>
  55. <text
  56. class="label right">{{ item['furnaceNoInfo'] && item['furnaceNoInfo'].firstTechnicalRequirement != '' ? item['furnaceNoInfo'].firstTechnicalRequirement + ";" + item['furnaceNoInfo'].secondTechnicalRequirement : '-' }}</text>
  57. </view>
  58. <view class="item-info uni-row">
  59. <text class="label">箱号</text>
  60. <text class="label right">{{ item['carrierName'] ? item['carrierName'] : '-' }}</text>
  61. </view>
  62. <!-- <view class="item-info uni-row">
  63. <text class="label">总工时</text>
  64. <text class="label right">{{ item['totalWorkingHours']}}</text>
  65. </view> -->
  66. <view class="item-info uni-row">
  67. <text class="label">投入数</text>
  68. <text
  69. class="label right">{{ item.prevProcess == null ? item['productionQuantity'] : item['processQualifiedNum']}}</text>
  70. </view>
  71. <view class="item-info uni-row">
  72. <text class="label">上道工序</text>
  73. <text class="label right">{{ item.prevProcess ? item['prevProcess'].processAlias : '-'}}</text>
  74. </view>
  75. <view class="item-info uni-row">
  76. <text class="label">当前工序</text>
  77. <!-- <text
  78. class="label right">{{ item.currentProcess ? item.prevProcess && item['currentProcess'].processAlias == item['prevProcess'].processAlias ? '-' : item['currentProcess'].processAlias : '-'}}</text> -->
  79. <text
  80. class="label right">{{ item.currentProcess ? item['currentProcess'].processAlias : '-'}}</text>
  81. </view>
  82. <view class="item-info uni-row">
  83. <text class="label">下道工序</text>
  84. <view class="label right uni-row">
  85. {{ item.nextProcess ? item['nextProcess'].processAlias : '-' }}
  86. (<view style="color: #1684fc;" @click.stop="handleClickProcessList(item)">&nbsp;工艺列表&nbsp;
  87. </view>)
  88. </view>
  89. </view>
  90. <!-- <view class="item-info uni-row">
  91. <text class="label">设备</text>
  92. <text class="label right">{{ curPlan['equipmentName'] }}</text>
  93. </view> -->
  94. <view v-if="notPreProcess" class="item-info uni-row">
  95. <text class="label">所在区域</text>
  96. <text class="label right">{{ item['place'] ? item['place'] : '-' }}</text>
  97. </view>
  98. <view
  99. v-if="item['dayworkItemList'] && item['dayworkItemList'].length >0 && item['dayworkItemList'][0].status >3"
  100. class="item-info uni-row">
  101. <text class="label">目标工段</text>
  102. <text
  103. class="label right">{{ item['dayworkItemList'] && item['dayworkItemList'].length >0 && item['dayworkItemList'][0].status >3 ? item['dayworkItemList'][0].deptName : '-' }}</text>
  104. </view>
  105. <view
  106. v-if="item['dayworkItemList'] && item['dayworkItemList'].length >0 && item['dayworkItemList'][0].status >3"
  107. class="item-info uni-row">
  108. <text class="label">目标车间</text>
  109. <text class="label right">{{ item['workshopName']}}</text>
  110. </view>
  111. <view v-if="item.protemResourceGroupDetailList && item.protemResourceGroupDetailList.length>0"
  112. class="item-info uni-row">
  113. <text class="label">邀请者</text>
  114. <text
  115. class="label right">{{ item['protemResourceGroupDetailList'] && item['protemResourceGroupDetailList'].length>0 ? item['protemResourceGroupDetailList'][0].protemCreatorName : '-' }}</text>
  116. </view>
  117. <view v-if="item.protemResourceGroupDetailList&& item.protemResourceGroupDetailList.length>0"
  118. class="item-info uni-row">
  119. <text class="label">已完成数量</text>
  120. <text class="label right">{{ item['totalQuantity'] ? item['totalQuantity'] : 0 }}</text>
  121. </view>
  122. <view class="status-btn uni-row">
  123. <view v-if="item['status'] == 2" class=" uni-row">
  124. <button class="turnover-tag" size="mini"
  125. @click.stop="handleShowTurnoverApplication(item)">周转申请</button>
  126. <!-- <button class="reporting-tag" size="mini" @click="handleToreportingForWork">去报工</button> -->
  127. </view>
  128. <view v-else-if="item['status'] == 3" class=" uni-row">
  129. <button class="turnover-tag" size="mini" @click.stop="handleCancelTurnover(item)"
  130. style="background-color: rgba(255, 85, 85, 1);">取消周转</button>
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. <!-- 抽屉 -->
  136. <uni-drawer ref="showRight" mode="right" :mask-click="true">
  137. <view style="text-align: center; font-size: 48rpx; padding: 48rpx 0 24rpx 0;">工艺列表</view>
  138. <view style="font-size: 24rpx;text-align: center;color: red; margin-bottom: 16rpx;">
  139. 仅显示当前工序后面工艺
  140. </view>
  141. <scroll-view scroll-y="true" style="height: 82%;" @touchmove.stop>
  142. <view v-for="(item,index) in curProcessAfte" :key="index"
  143. style="padding: 8rpx 5% 8rpx 14%; border-top: 1px solid #cccccc">
  144. <text>{{ index + 1 }}.{{item.processAlias}}</text>
  145. </view>
  146. </scroll-view>
  147. <view><button v-if="!editStatus" class="view-end-btn" type="primary"
  148. @click="handleOpenDrawing">查看本工序图纸</button></view>
  149. </uni-drawer>
  150. <!-- <view v-if="bottomStatus" class="bottom uni-row">
  151. <button class="start-batch-btn" type="primary" @click="handleStartNewBatch">开始新批次</button>
  152. </view>
  153. <view v-if="!bottomStatus" class="bottom uni-row">
  154. <button class="start-batch-btn" type="primary" @click="handleScanCode">扫一扫开始新批次</button>
  155. </view> -->
  156. <view class="bottom uni-row">
  157. <button v-if="bottomStatus" class="start-batch-btn" style="margin-right: 10rpx;" type="primary"
  158. @click="handleStartNewBatch">开始新批次</button>
  159. <button class="start-batch-btn" style="margin-right: 10rpx;" type="primary"
  160. @click="handleScanCode">扫码开始批次</button>
  161. <button class="start-batch-btn" type="primary" @click="handleSearchCode">查箱号</button>
  162. </view>
  163. <dialog-lot ref="lotDialog" @submit="handleDoIt" />
  164. <dialog-turnoverApplication ref="turnoverApplicationDialog" @reflushDaywork="handleDoTurnoverAfter" />
  165. <dialog-selectProduction ref="selectProduction"></dialog-selectProduction>
  166. </view>
  167. </template>
  168. <script setup>
  169. import {
  170. normalizeProps,
  171. reactive,
  172. onMounted,
  173. ref
  174. } from 'vue'
  175. import {
  176. onLoad,
  177. onReady,
  178. onUnload,
  179. onShow
  180. } from '@dcloudio/uni-app'
  181. import {
  182. getDayWorkList,
  183. showDaywork,
  184. showDayworkSave,
  185. turnoverDelete
  186. } from '@/api/business/dayWork.js'
  187. import {
  188. isTakeStock
  189. } from '@/api/business/taksStackLot.js'
  190. import {
  191. getAbnormalityLot
  192. } from '@/api/business/lot.js'
  193. import {
  194. carrierFinishedCheck
  195. } from '@/api/business/carrier.js'
  196. import {
  197. store
  198. } from '@/store/index.js'
  199. import {
  200. toHHmmss
  201. } from '@/utils/common.js'
  202. import {
  203. onPullDownRefresh
  204. } from "@dcloudio/uni-app"
  205. const turnoverApplicationDialog = ref(null)
  206. const selectProduction = ref(null)
  207. const lotDialog = ref(null)
  208. const listData = ref([])
  209. const curPlan = ref(null)
  210. const bizDayworkObj = ref({})
  211. const bottomStatus = ref(false) // 底部按钮显示
  212. const paging = ref();
  213. const reqParam = ref(null);
  214. const normalStatus = ref(true)
  215. const isLoding = ref(false);
  216. const curDayworkItem = ref({}) // 当前报工记录,回显是否显示取消周转的状态
  217. const keywords = ref(null)
  218. const tempList = ref([])
  219. const wasteRecyclingList = ref([]) //废品回用批次
  220. // 在数据中定义一个变量来控制遮罩层的显示
  221. const isMaskShow = ref(false);
  222. //打开图纸
  223. //选中的daywork
  224. const currentDaywork = ref({})
  225. const editStatus = ref(false)
  226. const notPreProcess = ref(true)
  227. const curProcessAfte = ref([])
  228. const showRight = ref(null) // 抽屉
  229. onLoad((options) => {
  230. curPlan.value = store.planDetails;
  231. normalStatus.value = true;
  232. console.log(curPlan.value)
  233. if (options != null) {
  234. console.log(options)
  235. console.log("999")
  236. keywords.value = options.param1
  237. if (store.planDetails.isAmend == 1 || store.planDetails.isWasteRecycling == 1) {
  238. normalStatus.value = false;
  239. }
  240. }
  241. //废品回用的领料部门如果是当前工段,也要可以开始新批次
  242. //查找当前计划单下的批次废品回用是当前工段
  243. getAbnormalityLot({
  244. productionPlanDetailId: store.planDetails.id,
  245. requisitionDepartmentId: store.curDeptDetails.deptId
  246. }).then(res => {
  247. wasteRecyclingList.value = res.rows
  248. if (store.planDetails.requisitionDepartmentId == store.curDeptDetails.deptId ||
  249. wasteRecyclingList.value.length > 0) {
  250. bottomStatus.value = true;
  251. store.isPreProcess = true;
  252. } else {
  253. bottomStatus.value = false;
  254. store.isPreProcess = false;
  255. }
  256. })
  257. console.log(wasteRecyclingList.value.length)
  258. })
  259. // 页面下拉刷新操作
  260. onPullDownRefresh(() => {
  261. uni.stopPullDownRefresh();
  262. reflush();
  263. })
  264. onShow(() => {
  265. reflush();
  266. })
  267. ;
  268. function reflush() {
  269. init(store.planDetails.id);
  270. }
  271. function handleShowTurnoverApplication(data) {
  272. console.log(data)
  273. //如果这批废了,则不能周转申请
  274. if (data.isWaste == 1) {
  275. uni.showToast({
  276. icon: 'none',
  277. title: '此批已废,不能申请周转',
  278. duration: 2000
  279. })
  280. } else {
  281. isTakeStock().then(response => {
  282. if (response.data) {
  283. uni.showToast({
  284. icon: 'none',
  285. title: '正在盘点,不能申请周转',
  286. duration: 2000
  287. })
  288. } else {
  289. let _data = data ?? {}
  290. carrierFinishedCheck(data).then(res => {
  291. if (res.code === 200) {
  292. // 调用子组件中的方法
  293. turnoverApplicationDialog.value.open(_data)
  294. } else {
  295. uni.showToast({
  296. icon: 'none',
  297. title: res.msg
  298. })
  299. }
  300. })
  301. }
  302. })
  303. }
  304. }
  305. function handleStartNewBatch() {
  306. store.normalStatus = normalStatus.value;
  307. // console.log(normalStatus.value)
  308. uni.navigateTo({
  309. url: "/pages/addNewBatch/index"
  310. })
  311. }
  312. function init(id) {
  313. uni.showLoading({
  314. title: '加载中'
  315. });
  316. let reqData = {
  317. productionPlanDetailId: id,
  318. deptId: store.curDeptDetails.deptId,
  319. keywords: keywords.value
  320. };
  321. // console.log(normalStatus.value)
  322. getDayWorkList(reqData).then(res => {
  323. console.log(res.data)
  324. if (res.code == 200) {
  325. res.data.forEach(item => {
  326. let quantitySum = 0;
  327. item.dayworkItemList.forEach(info => {
  328. if (info.status < 4 && item.currentProcess.processStepNumber == info
  329. .processStepNumber) {
  330. quantitySum += info.qualifiedNum;
  331. }
  332. });
  333. item.totalQuantity = quantitySum;
  334. });
  335. tempList.value = res.data
  336. // console.log(res)
  337. if (normalStatus.value) {
  338. listData.value = res.data.filter(item => {
  339. return item.isWasteRecycling == 0 && item.isAmend == 0;
  340. });
  341. } else {
  342. listData.value = res.data.filter(item => {
  343. return item.isWasteRecycling == 1 || item.isAmend == 1;
  344. })
  345. }
  346. // 20240614 分批投产数量不按照上到序的完成数量来。
  347. // for (let i = 0; i < listData.value.length; i++) {
  348. // if (listData.value[i].prevProcess) {
  349. // let sum = 0;
  350. // for (let j = 0; j < listData.value[i].dayworkItemList.length; j++) {
  351. // if (listData.value[i].dayworkItemList[j].processId == listData.value[i]
  352. // .prevProcess
  353. // .id && (listData.value[i].dayworkItemList[j].status == 2 || listData
  354. // .value[i]
  355. // .dayworkItemList[j].status == 3)) {
  356. // sum += listData.value[i].dayworkItemList[j].qualifiedNum;
  357. // }
  358. // }
  359. // listData.value[i].processQualifiedNum = sum;
  360. // }
  361. // }
  362. }
  363. uni.hideLoading();
  364. })
  365. }
  366. function handleSearch() {
  367. init(store.planDetails.id);
  368. }
  369. function handleToreportingForWork(item) {
  370. store.dayworkInfo = item
  371. uni.navigateTo({
  372. url: "/pages/reportingForWork/index"
  373. })
  374. }
  375. function handleClickProcessList(item) {
  376. let curProcessAfterList = [];
  377. console.log("工序列表", item)
  378. currentDaywork.value = item
  379. editStatus.value = false
  380. // if (item.isWasteRecycling == 1 || item.isAmend == 1) {
  381. // editStatus.value = true
  382. // } else {
  383. // editStatus.value = false
  384. // }
  385. let nextIndex = 0;
  386. for (let i = 0; i < item.processSequence.length; i++) {
  387. if (item.nextProcess) {
  388. if (item.nextProcess.processStepNumber == item.processSequence[i].processStepNumber) {
  389. nextIndex = i;
  390. }
  391. } else {
  392. nextIndex = item.processSequence.length
  393. }
  394. }
  395. for (let i = 0; i < item.processSequence.length; i++) {
  396. if (i >= nextIndex) {
  397. curProcessAfterList.push(item.processSequence[i]);
  398. }
  399. }
  400. if (item.status == 3) {
  401. curProcessAfterList.splice(0, 1)
  402. }
  403. console.log(curProcessAfterList)
  404. curProcessAfte.value = curProcessAfterList;
  405. showRight.value.open();
  406. }
  407. function handleSearchCode() {
  408. // console.log(normalStatus.value)
  409. selectProduction.value.open(normalStatus.value);
  410. }
  411. function switchChange(event) {
  412. console.log(event)
  413. //异常批
  414. if (normalStatus.value) {
  415. listData.value = tempList.value.filter(item => {
  416. return item.isWasteRecycling == 1 || item.isAmend == 1;
  417. });
  418. normalStatus.value = false
  419. } else {
  420. listData.value = tempList.value.filter(item => {
  421. return item.isWasteRecycling == 0 && item.isAmend == 0;
  422. });
  423. normalStatus.value = true
  424. }
  425. }
  426. function handleScanCode() {
  427. // 引入原生插件
  428. const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
  429. if (mpaasScanModule) {
  430. // 调用插件的 mpaasScan 方法
  431. mpaasScanModule.mpaasScan({
  432. // 扫码识别类型,参数可多选,qrCode、barCode,
  433. // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
  434. scanType: ["qrCode", "barCode"],
  435. // 是否隐藏相册,默认false不隐藏
  436. hideAlbum: false,
  437. },
  438. (ret) => {
  439. console.log(ret);
  440. /* 原有代码,之前二维码中存的信息比较多,用一个JSON格式存储。
  441. let vehicleObj = JSON.parse(ret.resp_result);
  442. if (!vehicleObj.carrierId || vehicleObj.carrierId == "") {
  443. uni.showToast({
  444. icon: "none",
  445. title: "请扫载具码",
  446. duration: 1000
  447. })
  448. return;
  449. }
  450. */
  451. let vehicleObj = {
  452. carrierCode: ret.resp_result
  453. };
  454. if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
  455. uni.showToast({
  456. icon: "none",
  457. title: "请扫载具码",
  458. duration: 1000
  459. })
  460. return;
  461. }
  462. showDaywork({
  463. carrierId: '0', // 不传递箱子id
  464. carrierCode: vehicleObj.carrierCode,
  465. status: 7
  466. }).then(response => {
  467. if (response.code == 200) {
  468. console.log(response)
  469. console.log(response.data[0].productionPlanDetailId)
  470. console.log(store.planDetails.id)
  471. console.log(response.data[0].deptId !== store.curDeptDetails.deptId)
  472. if (response.data[0].deptId !== store.curDeptDetails.deptId) {
  473. uni.showToast({
  474. icon: 'none',
  475. title: '该批次不在当前工段',
  476. duration: 2000
  477. })
  478. return
  479. }
  480. if (response.data[0].productionPlanDetailId == store.planDetails.id) {
  481. console.log(response.data)
  482. lotDialog.value.open(response.data);
  483. } else {
  484. uni.showToast({
  485. icon: 'none',
  486. title: '该批次不在此计划单内',
  487. duration: 2000
  488. })
  489. }
  490. } else {
  491. uni.showToast({
  492. icon: 'none',
  493. title: response.msg,
  494. duration: 2000
  495. })
  496. }
  497. })
  498. }
  499. );
  500. } else {
  501. // 测试时用
  502. showDaywork({
  503. carrierId: '0',
  504. carrierCode: '100164',
  505. status: 7
  506. }).then(response => {
  507. if (response.code == 200) {
  508. console.log(response)
  509. console.log(response.data[0].productionPlanDetailId)
  510. console.log(store.planDetails.id)
  511. console.log(response.data[0].deptId !== store.curDeptDetails.deptId)
  512. if (response.data[0].deptId !== store.curDeptDetails.deptId) {
  513. uni.showToast({
  514. icon: 'none',
  515. title: '该批次已转至其他工段',
  516. duration: 2000
  517. })
  518. return
  519. }
  520. if (response.data[0].productionPlanDetailId == store.planDetails.id) {
  521. console.log(response.data)
  522. lotDialog.value.open(response.data);
  523. } else {
  524. uni.showToast({
  525. icon: 'none',
  526. title: '该批次不在此计划单内',
  527. duration: 2000
  528. })
  529. }
  530. } else {
  531. uni.showToast({
  532. icon: 'none',
  533. title: response.msg,
  534. duration: 2000
  535. })
  536. }
  537. })
  538. }
  539. }
  540. function handleAddDaywork(data) {
  541. console.log(data)
  542. let reqParam = [];
  543. for (var i = 0; i < data.length; i++) {
  544. reqParam.push(data[i].daywork)
  545. }
  546. console.log(data)
  547. data.forEach(item => {
  548. item.isSort = 0,
  549. item.tenantId = !store.tenantId ? store.userInfo.tenantId : store.tenantId
  550. })
  551. showDayworkSave(data).then(res => {
  552. console.log(res)
  553. init(store.planDetails.id);
  554. })
  555. }
  556. function handleDoIt(data) {
  557. handleAddDaywork(data);
  558. }
  559. function handleOpenDrawing() {
  560. console.log(currentDaywork.value, "444")
  561. var filteredProcess = currentDaywork.value.processSequence.filter(item => item.processStepNumber == currentDaywork
  562. .value.currentProcess.processStepNumber);
  563. // 检查 filteredProcess 是否有元素,并选择第一个元素
  564. if (filteredProcess.length > 0) {
  565. var firstMatch = filteredProcess[0]; // 获取第一个匹配的对象
  566. console.log("currentDaywork", currentDaywork.value)
  567. // 对 technologicalProcessDetailId 进行URL编码
  568. var encodedId = encodeURIComponent(currentDaywork.value.productId);
  569. var enTechnologicalProcessId = encodeURIComponent(currentDaywork.value.technologicalProcessId);
  570. var enprocessCode = encodeURIComponent(firstMatch.processCode);
  571. var encodeCode = encodeURIComponent(currentDaywork.value.lotCode);
  572. var enProcessAlias = encodeURIComponent(firstMatch.processAlias);
  573. var enIsWasteRecycling = encodeURIComponent(currentDaywork.value.isWasteRecycling);
  574. var enIsAmend = encodeURIComponent(currentDaywork.value.isAmend);
  575. // 构建查询参数字符串
  576. var queryParam =
  577. `param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}&param6=${enIsWasteRecycling}&param7=${enIsAmend}`;
  578. // 使用模板字符串构建完整的URL
  579. var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
  580. // 导航到指定页面
  581. uni.navigateTo({
  582. url: navigateUrl
  583. });
  584. } else {
  585. console.log('No process matched the current process step number.');
  586. }
  587. }
  588. function handleDoTurnoverAfter() {
  589. reflush();
  590. }
  591. function handleCancelTurnover(data) {
  592. isTakeStock().then(response => {
  593. if (response.data) {
  594. uni.showToast({
  595. icon: 'none',
  596. title: '正在盘点,不能取消周转',
  597. duration: 2000
  598. })
  599. } else {
  600. isMaskShow.value = true; // 显示遮罩层
  601. uni.showLoading({
  602. title: '加载中'
  603. });
  604. turnoverDelete(data).then(res => {
  605. isMaskShow.value = false
  606. if (res.code == 200) {
  607. uni.showToast({
  608. icon: "success",
  609. title: "取消成功",
  610. duration: 2000
  611. })
  612. isLoding.value = false;
  613. setTimeout(() => {
  614. init(store.planDetails.id);
  615. }, 1000);
  616. } else {
  617. uni.showToast({
  618. icon: "none",
  619. title: "取消失败",
  620. duration: 2000
  621. })
  622. isLoding.value = false;
  623. setTimeout(() => {
  624. init(store.planDetails.id);
  625. }, 1000);
  626. }
  627. })
  628. }
  629. })
  630. }
  631. </script>
  632. <style lang="scss">
  633. $nav-height: 60rpx;
  634. /* 遮罩层样式 */
  635. .mask {
  636. position: fixed;
  637. /* 固定定位,覆盖整个屏幕 */
  638. top: 0;
  639. left: 0;
  640. right: 0;
  641. bottom: 0;
  642. background-color: rgba(0, 0, 0, 0.3);
  643. /* 黑色背景,透明度30% */
  644. display: flex;
  645. justify-content: center;
  646. /* 水平居中 */
  647. align-items: center;
  648. /* 垂直居中 */
  649. z-index: 1000;
  650. /* 确保遮罩层在其他元素之上 */
  651. }
  652. .box-bg {
  653. width: 94%;
  654. background-color: #F5F5F5;
  655. padding: 5rpx 16rpx;
  656. justify-content: space-around;
  657. align-items: center;
  658. margin: 24rpx auto 0;
  659. .input-view {
  660. width: 100%;
  661. flex: 4;
  662. background-color: #f8f8f8;
  663. height: $nav-height;
  664. border: 1rpx solid #999;
  665. border-radius: 15rpx;
  666. padding: 0 15rpx;
  667. flex-wrap: nowrap;
  668. margin: 0 10rpx 0;
  669. line-height: $nav-height;
  670. .input-uni-icon {
  671. line-height: $nav-height;
  672. }
  673. .nav-bar-input {
  674. width: 80%;
  675. height: $nav-height;
  676. line-height: $nav-height;
  677. padding: 0 5rpx;
  678. background-color: #f8f8f8;
  679. }
  680. }
  681. .search {
  682. width: 20%;
  683. text-align: center;
  684. color: #808080;
  685. }
  686. }
  687. .list-title {
  688. width: 100%;
  689. margin-top: 16rpx;
  690. height: 64rpx;
  691. line-height: 64rpx;
  692. align-items: center;
  693. margin-left: 32rpx;
  694. .label {
  695. font-size: 32rpx;
  696. margin-right: 24rpx;
  697. }
  698. .icon-gear {
  699. font-size: 56rpx;
  700. }
  701. }
  702. .switch {
  703. margin-top: -8rpx;
  704. transform: scale(0.7);
  705. }
  706. .scroll-container {
  707. width: 92%;
  708. margin: 24rpx auto 0 auto;
  709. height: calc(90% - 100rpx);
  710. overflow: auto;
  711. }
  712. .list-item {
  713. background-color: #fff;
  714. position: relative;
  715. padding: 16rpx;
  716. padding-bottom: 24rpx;
  717. margin-bottom: 24rpx;
  718. border-radius: 24rpx;
  719. .title-container {
  720. margin-top: 8rpx;
  721. margin-bottom: 16rpx;
  722. .title {
  723. height: 48rpx;
  724. align-items: center;
  725. .label {
  726. font-size: 32rpx;
  727. font-weight: bold;
  728. &.code {
  729. margin-left: 8rpx;
  730. }
  731. }
  732. }
  733. .tag {
  734. border: 1px solid #1CE5B0;
  735. background-color: #F6FFFD;
  736. padding: 8rpx;
  737. border-radius: 8rpx;
  738. .label {
  739. color: #1CE5B0;
  740. font-size: 24rpx;
  741. }
  742. &.finished {
  743. border: 1px solid #BBBBBB;
  744. background-color: #F5F5F5;
  745. .label {
  746. color: #BBBBBB;
  747. }
  748. }
  749. &.turnover {
  750. border: 1px solid #FF7901;
  751. background-color: #F6FFFD;
  752. .label {
  753. color: #FF7901;
  754. }
  755. }
  756. }
  757. }
  758. .item-info {
  759. margin-bottom: 8rpx;
  760. .label {
  761. font-size: 28rpx;
  762. width: 220rpx;
  763. color: #808080;
  764. &.right {
  765. flex: 1;
  766. color: #000000;
  767. }
  768. }
  769. }
  770. .status-btn {
  771. justify-content: flex-end;
  772. align-items: center;
  773. .turnover-tag {
  774. padding-right: 12rpx;
  775. padding-left: 12rpx;
  776. border-radius: 8rpx;
  777. border: 1rpx solid #FF7901;
  778. background-color: #FF7901;
  779. font-size: 28rpx;
  780. color: #FFFFFF;
  781. }
  782. .reporting-tag {
  783. padding-right: 12rpx;
  784. padding-left: 12rpx;
  785. border-radius: 8rpx;
  786. margin-left: 16rpx;
  787. border: 1rpx solid #1684fc;
  788. background-color: #1684fc;
  789. font-size: 28rpx;
  790. color: #FFFFFF;
  791. }
  792. }
  793. }
  794. .bottom {
  795. height: 10%;
  796. position: fixed;
  797. right: 0;
  798. bottom: 0;
  799. left: 0;
  800. height: 100rpx;
  801. border-top: 1px solid #999999;
  802. padding: 16rpx 32rpx;
  803. align-items: center;
  804. background-color: #fff;
  805. justify-content: space-evenly;
  806. .start-batch-btn {
  807. flex: 1;
  808. height: 80rpx;
  809. line-height: 80rpx;
  810. border-radius: 8rpx;
  811. color: #FFFFFF;
  812. font-size: 28rpx;
  813. }
  814. .view-end-btn {
  815. flex: 1;
  816. height: 80rpx;
  817. line-height: 80rpx;
  818. border-radius: 8rpx;
  819. color: #FFFFFF;
  820. font-size: 28rpx;
  821. }
  822. }
  823. </style>