index.vue 24 KB

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