dialog-end-work.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749
  1. <template>
  2. <view class="mask" v-if="isLoading"></view>
  3. <dialog-base ref="baseDialog" title="结束报工">
  4. <view class="list-container">
  5. <view class="list-title uni-row">
  6. <text class="label">合格量</text>
  7. <input class="input" @input="handleInputQualifiedNum" style="width: 70%;"
  8. v-model="workInfo.qualifiedNum" placeholder="请输入合格量" />
  9. </view>
  10. <view class="list-title uni-row">
  11. <text class="label">废品信息</text>
  12. <view class="uni-row" style="justify-content: flex-end;"><text class="label" style="color: blue;"
  13. @click="handleAddWasteInfo">+添加</text></view>
  14. </view>
  15. <view class="list-title uni-row" v-for="(item, index) in wasteInfo">
  16. <input class="input" @input="handleInputRejectNum(item)" style="width: 20%;" v-model="item.rejectNum"
  17. placeholder="废品量" />
  18. <uni-data-select style="margin-left: 40rpx;width: 70%;" v-model="item.reason" :localdata="reasonList"
  19. @change="handleReasonChange(item)"></uni-data-select>
  20. <uni-icons class="icon-gear" type="close" size="40" color="red"
  21. @click="handleDeleteWasteInfo(index)"></uni-icons>
  22. </view>
  23. <view class="list-title uni-row">
  24. <text class="label">当前序是否完成</text><text>否</text>
  25. <switch class="switch" @change="switchChange" color="rgba(103, 195, 55, 1.0)" />
  26. <text>是</text>
  27. </view>
  28. <view class="list-title uni-row" v-if="workInfo.status == 3">
  29. <text class="label">废品损失率</text>
  30. <view class="uni-row" style="justify-content: flex-end;"><text class="label">{{rejectRatio}}</text>
  31. </view>
  32. </view>
  33. <view v-if="showCarrierList && !store.isPreProcess" class="confirmCarrier">
  34. <text class="label">确认载具</text>
  35. <view class="vehicleList uni-row">
  36. <view v-for="(item,index) in bindList" :key="index"
  37. :class="{ 'vehicleNo': true, 'uni-row': true, 'blueBorder': item.flag }">
  38. <text>{{item.carrierCode}}</text>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view v-if="store.isPreProcess" class="add-btn-container uni-row">
  44. <button type="default" class="btn" @click="handlePreFinishReporting">结束报工</button>
  45. </view>
  46. <view v-if="!store.isPreProcess" class="add-btn-container uni-row">
  47. <button v-if="showCarrierList" type="primary" class="btnScan" @click="handleScanCode">扫码确认载具</button>
  48. <button type="default" class="btn" @click="handleFinishReporting">结束报工</button>
  49. </view>
  50. </dialog-base>
  51. </template>
  52. <script setup>
  53. import {
  54. ref,
  55. getCurrentInstance
  56. } from 'vue'
  57. import {
  58. onLoad
  59. } from '@dcloudio/uni-app'
  60. import {
  61. updateDayWorkItem,
  62. saveDayWorkItem
  63. } from "@/api/business/dayWorkItem.js"
  64. import {
  65. getDayworkCarrierList
  66. } from '@/api/business/dayworkCarrier.js'
  67. import {
  68. store
  69. } from '@/store/index.js'
  70. import {
  71. timestampToTime,
  72. toHHmmss
  73. } from '@/utils/common.js'
  74. import {
  75. getSpecialDeptProcessList
  76. } from '@/api/business/deptProcess.js'
  77. import {
  78. getDictInfoByType
  79. } from '@/api/dict/dict.js'
  80. import {
  81. debounce
  82. } from '@/utils/common.js'
  83. import {
  84. getDayWorkItemList,
  85. listItem,
  86. getIsFirstOrder,
  87. } from '@/api/business/dayWorkItem.js'
  88. import {
  89. Decimal
  90. } from 'decimal.js'
  91. const baseDialog = ref(null)
  92. const workInfo = ref({})
  93. const wasteInfo = ref([])
  94. const reasonList = ref([])
  95. const qualifiedNumRatio = ref(1)
  96. const rejectRatio = ref(0)
  97. const emit = defineEmits(['resflushItem'])
  98. const showCarrierList = ref(false) // 工序是否完成显示载具列表
  99. const bindList = ref([])
  100. const confirmCarrierList = ref([])
  101. const isFirstOrder = ref(true); //是否为首序
  102. const isLoading = ref(false);
  103. const endFlag = ref(0)
  104. const specialDeptProcessList = ref([])
  105. const temp = ref(0) // 保存workInfo.value.qualifiedNum的值(还原用)
  106. const lotPreSumReject = ref(0)
  107. const lotPreSumQualifiedNum = ref(0)
  108. const remainingQualifiedNum = ref(0) // 当前的合格量还能最大添加多少(剩余数量)
  109. onLoad(() => {})
  110. function open(data, itemListData) {
  111. console.log(store.isPreProcess)
  112. console.log("777")
  113. resetPage();
  114. workInfo.value = {
  115. ...data,
  116. };
  117. console.log("数据data", workInfo);
  118. //获取报工数量限制
  119. getReportLimit()
  120. //查看是否为首序
  121. getIsFirst(store.dayworkInfo.id);
  122. workInfo.value.qualifiedNum = 0;
  123. Promise.all([getSpecialDeptProcessList(), listItem({
  124. dayworkId: store.dayworkInfo.id,
  125. status: 2
  126. }), ], )
  127. .then(([res, response]) => {
  128. if (res.code == 200 && response.code == 200) {
  129. for (let i = 0; i < res.data.length; i++) {
  130. specialDeptProcessList.value[i] = res.data[i].processId;
  131. }
  132. for (let i = 0; i < response.rows.length; i++) {
  133. if (response.rows[i].processStepNumber == workInfo.value.processStepNumber) {
  134. lotPreSumReject.value += response.rows[i].rejectSum;
  135. lotPreSumQualifiedNum.value += response.rows[i].qualifiedNum;
  136. }
  137. }
  138. }
  139. if (specialDeptProcessList.value.includes(workInfo.value.processId)) {
  140. workInfo.value.qualifiedNum = store.dayworkInfo.prevProcess != null ?
  141. Math.max(0, store.dayworkInfo.processQualifiedNum - lotPreSumQualifiedNum.value -
  142. lotPreSumReject.value) :
  143. Math.max(0, store.dayworkInfo.productionQuantity - lotPreSumQualifiedNum.value -
  144. lotPreSumReject
  145. .value);
  146. // temp.value = workInfo.value.qualifiedNum;
  147. } else {
  148. workInfo.value.qualifiedNum = 0;
  149. }
  150. }).catch(err => {
  151. console.log('146 err')
  152. });
  153. init();
  154. baseDialog.value.open()
  155. }
  156. function close() {
  157. baseDialog.value.close()
  158. }
  159. function getReportLimit() {
  160. getDictInfoByType("report_up_limit").then(res => {
  161. if (res.data && res.data.length > 0) {
  162. qualifiedNumRatio.value = parseInt(res.data[0].dictValue)
  163. }
  164. }).catch(err => {
  165. console.log(err)
  166. console.log('369 err')
  167. })
  168. }
  169. function getIsFirst(dayworkId) {
  170. getIsFirstOrder(dayworkId).then(res => {
  171. if (res.code == 200) {
  172. isFirstOrder.value = res.data.isFirstOrder;
  173. }
  174. }).catch(err => {
  175. console.log(err)
  176. })
  177. }
  178. function resetPage() {
  179. workInfo.value.qualifiedNum = null;
  180. workInfo.value = {};
  181. wasteInfo.value = [];
  182. reasonList.value = [];
  183. showCarrierList.value = false;
  184. bindList.value = [];
  185. confirmCarrierList.value = [];
  186. endFlag.value = 0;
  187. lotPreSumReject.value = 0;
  188. lotPreSumQualifiedNum.value = 0;
  189. remainingQualifiedNum.value = 0;
  190. }
  191. function init() {
  192. getDictInfoByType("waste_causes").then(res => {
  193. for (let i = 0; i < res.data.length; i++) {
  194. reasonList.value[i] = {
  195. value: res.data[i].dictValue,
  196. text: res.data[i].dictLabel
  197. }
  198. }
  199. }).catch(err => {
  200. console.log('189 err')
  201. })
  202. getDayworkCarrierList({
  203. dayworkId: store.dayworkInfo.id,
  204. isChanged: 0,
  205. processInspectionId: 0
  206. }).then(res => {
  207. console.log(res)
  208. if (res.code == 200) {
  209. bindList.value = res.rows;
  210. for (let i = 0; i < bindList.value.length; i++) {
  211. bindList.value[i].flag = false;
  212. }
  213. }
  214. }).catch(err => {
  215. console.log('203 err')
  216. })
  217. }
  218. function switchChange(event) {
  219. if (event.detail.value) {
  220. workInfo.value.status = "3"
  221. } else {
  222. workInfo.value.status = "2"
  223. }
  224. console.log(event.detail.value, !store.isPreProcess)
  225. showCarrierList.value = event.detail.value;
  226. }
  227. function handleInputQualifiedNum() {
  228. workInfo.value.qualifiedNum = workInfo.value.qualifiedNum.replace(/^-+|[^\d]/g, '');
  229. let temQualifiedNum = workInfo.value.qualifiedNum
  230. if (workInfo.value.qualifiedNum === null || workInfo.value.qualifiedNum === '') {
  231. temQualifiedNum = 0
  232. }
  233. //计算损失率
  234. let sunm = parseInt(temQualifiedNum) + lotPreSumQualifiedNum.value; //计算总合格数
  235. rejectRatio.value = (((parseInt(workInfo.value.prodNum) - sunm) / parseInt(workInfo.value.prodNum)) *
  236. 100).toFixed(2) + '%';
  237. console.log(((parseInt(temQualifiedNum) - sunm) / parseInt(temQualifiedNum)) *
  238. 100)
  239. }
  240. function handleInputRejectNum(item) {
  241. item.rejectNum = item.rejectNum.replace(/^0+|^-|[^\d]/g, '');
  242. // 合格数随着投产数
  243. //let sumRejectNum = 0;
  244. // for (let i = 0; i < wasteInfo.value.length; i++) {
  245. // wasteInfo.value[i].rejectNum = wasteInfo.value[i].rejectNum.replace(/^0+|^-|[^\d]/g, '');
  246. // // sumRejectNum += Number(wasteInfo.value[i].rejectNum);
  247. // }
  248. // if (temp.value > 0) {
  249. // debounce(function() {
  250. // workInfo.value.qualifiedNum = temp.value;
  251. // workInfo.value.qualifiedNum -= sumRejectNum;
  252. // }, 500)
  253. // }
  254. }
  255. /*
  256. function handleScanCode() {
  257. // 引入原生插件
  258. const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
  259. if (mpaasScanModule) {
  260. //调用插件的 mpaasScan 方法
  261. mpaasScanModule.mpaasScan({
  262. // 扫码识别类型,参数可多选,qrCode、barCode,
  263. // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
  264. scanType: ["qrCode", "barCode"],
  265. // 是否隐藏相册,默认false不隐藏
  266. hideAlbum: false,
  267. },
  268. (ret) => {
  269. let vehicleObj = JSON.parse(ret.resp_result);
  270. let hasInFlag = false
  271. for (let i = 0; i < bindList.value.length; i++) {
  272. if (vehicleObj.carrierCode == bindList.value[i].carrierCode) {
  273. hasInFlag = true
  274. if (!bindList.value[i].flag) {
  275. endFlag.value += 1;
  276. }
  277. bindList.value[i].flag = true;
  278. }
  279. }
  280. if(!hasInFlag) {
  281. uni.showToast({
  282. icon: 'none',
  283. title: '该批次没有绑定此箱',
  284. duration: 2000
  285. })
  286. }
  287. if (endFlag.value < bindList.value.length && hasInFlag) {
  288. setTimeout(() => {
  289. handleScanCode();
  290. }, 700);
  291. }
  292. }
  293. );
  294. }
  295. }
  296. */
  297. function handleScanCode() {
  298. // 引入原生插件
  299. const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
  300. if (mpaasScanModule) {
  301. //调用插件的 mpaasScan 方法
  302. mpaasScanModule.mpaasScan({
  303. // 扫码识别类型,参数可多选,qrCode、barCode,
  304. // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
  305. scanType: ["qrCode", "barCode"],
  306. // 是否隐藏相册,默认false不隐藏
  307. hideAlbum: false,
  308. },
  309. (ret) => {
  310. let vehicleObj = {
  311. carrierCode: ret.resp_result
  312. };
  313. let hasInFlag = false
  314. for (let i = 0; i < bindList.value.length; i++) {
  315. if (vehicleObj.carrierCode == bindList.value[i].carrierCode) {
  316. hasInFlag = true
  317. if (!bindList.value[i].flag) {
  318. endFlag.value += 1;
  319. }
  320. bindList.value[i].flag = true;
  321. }
  322. }
  323. if (!hasInFlag) {
  324. uni.showToast({
  325. icon: 'none',
  326. title: '该批次没有绑定此箱',
  327. duration: 2000
  328. })
  329. }
  330. if (endFlag.value < bindList.value.length && hasInFlag) {
  331. setTimeout(() => {
  332. handleScanCode();
  333. }, 700);
  334. }
  335. }
  336. );
  337. } else {
  338. let vehicleObj = {
  339. carrierCode: '000643'
  340. };
  341. let hasInFlag = false
  342. for (let i = 0; i < bindList.value.length; i++) {
  343. if (vehicleObj.carrierCode == bindList.value[i].carrierCode) {
  344. hasInFlag = true
  345. if (!bindList.value[i].flag) {
  346. endFlag.value += 1;
  347. }
  348. bindList.value[i].flag = true;
  349. }
  350. }
  351. if (!hasInFlag) {
  352. uni.showToast({
  353. icon: 'none',
  354. title: '该批次没有绑定此箱',
  355. duration: 2000
  356. })
  357. }
  358. if (endFlag.value < bindList.value.length && hasInFlag) {
  359. setTimeout(() => {
  360. handleScanCode();
  361. }, 700);
  362. }
  363. }
  364. }
  365. function handlePreFinishReporting() {
  366. //投产数
  367. let number = store.dayworkInfo.prevProcess == null ? store.dayworkInfo.productionQuantity : store.dayworkInfo
  368. .processQualifiedNum;
  369. workInfo.value.prodNum = number
  370. let max = parseInt(number * (qualifiedNumRatio.value / 100));
  371. let sunm = parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value; //计算总合格数
  372. let percent = new Decimal(sunm).div(number).mul(100); // 使用 Decimal.js 计算
  373. // 保留两位小数
  374. percent = percent.toDecimalPlaces(2, Decimal.ROUND_DOWN).toString();
  375. console.log("合格量", percent)
  376. // let percent = (((parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value) / number) * 100).toFixed(2);
  377. let num = qualifiedNumRatio.value;
  378. // 填入数大于剩余量情况
  379. if (parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value - number > 0) {
  380. // 判断当前是否为首序
  381. if (isFirstOrder.value) {
  382. uni.showModal({
  383. title: '提示',
  384. content: `合格数总量超出投入量${percent}%,是否继续保存?`,
  385. success: function(res) {
  386. if (res.confirm) {
  387. handleSave();
  388. } else if (res.cancel) {}
  389. }
  390. })
  391. } else {
  392. if (percent > num) {
  393. console.log("999")
  394. uni.showToast({
  395. icon: 'none',
  396. title: '合格数总量为投产量的' + percent + "%,请重新输入!"
  397. })
  398. return;
  399. } else {
  400. handleSave();
  401. }
  402. }
  403. } else {
  404. //判断当前序合格总数为0 ,不允许保存
  405. console.log(parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value == 0)
  406. if (workInfo.value.status == "3" && parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value == 0) {
  407. uni.showToast({
  408. icon: 'none',
  409. title: '当前序合格总数不能为0',
  410. duration: 2000
  411. })
  412. } else {
  413. handleSave();
  414. }
  415. }
  416. }
  417. function handleFinishReporting() {
  418. console.log(store.isPreProcess)
  419. //投产数
  420. let number = workInfo.value.prodNum;
  421. let percent = (((parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value) / number) * 100).toFixed(
  422. 2);
  423. let num = qualifiedNumRatio.value;
  424. //lotPreSumQualifiedNum当前序的所有合格数
  425. if (parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value - number > 0) {
  426. if (isFirstOrder.value) {
  427. if (percent == qualifiedNumRatio.value) {
  428. percent = qualifiedNumRatio.value
  429. }
  430. uni.showModal({
  431. title: '提示',
  432. content: `合格数总量超出投入量${percent}%,是否继续保存?`,
  433. success: function(res) {
  434. if (res.confirm) {
  435. if (showCarrierList.value) {
  436. if (endFlag.value >= bindList.value.length) {
  437. handleSave();
  438. } else {
  439. uni.showToast({
  440. icon: "none",
  441. title: "请先扫码确认载具",
  442. duration: 2000
  443. })
  444. return;
  445. }
  446. } else {
  447. handleSave();
  448. }
  449. } else if (res.cancel) {}
  450. }
  451. })
  452. } else {
  453. if (percent == num) {
  454. percent = qualifiedNumRatio.value
  455. }
  456. if (percent > num) {
  457. console.log("888")
  458. uni.showToast({
  459. icon: 'none',
  460. title: '合格数总量为投产量的' + percent + "%,请重新输入!"
  461. })
  462. return;
  463. } else {
  464. handleSave();
  465. }
  466. }
  467. } else {
  468. //判断当前序合格总数为0 ,不允许保存
  469. if (workInfo.value.status == "3" && parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value == 0) {
  470. uni.showToast({
  471. icon: 'none',
  472. title: '当前序合格总数不能为0'
  473. })
  474. return;
  475. }
  476. if (showCarrierList.value) {
  477. if (endFlag.value >= bindList.value.length) {
  478. handleSave();
  479. } else {
  480. uni.showToast({
  481. icon: "none",
  482. title: "请先扫码确认载具",
  483. duration: 2000
  484. })
  485. return;
  486. }
  487. } else {
  488. handleSave();
  489. }
  490. }
  491. }
  492. function handleSave() {
  493. console.log(workInfo.value.qualifiedNum)
  494. if (workInfo.value.qualifiedNum === null || workInfo.value.qualifiedNum === '') {
  495. uni.showToast({
  496. icon: "none",
  497. title: "请输入合格数",
  498. duration: 2000
  499. })
  500. return;
  501. }
  502. let rejectSum = 0
  503. console.log(rejectSum);
  504. for (let i = 0; i < wasteInfo.value.length; i++) {
  505. if ((!wasteInfo.value[i].rejectNum && wasteInfo.value[i].reason) ||
  506. (wasteInfo.value[i].rejectNum && !wasteInfo.value[i].reason) ||
  507. (!wasteInfo.value[i].rejectNum && !wasteInfo.value[i].reason)) {
  508. uni.showToast({
  509. icon: 'none',
  510. title: "请输入废弃数或废弃原因",
  511. duration: 2000
  512. })
  513. return;
  514. }
  515. rejectSum += Number(wasteInfo.value[i].rejectNum);
  516. }
  517. if (rejectSum > workInfo.value.prodNum) {
  518. uni.showToast({
  519. icon: 'none',
  520. title: '废品数不能大于投产数',
  521. duration: 2000
  522. })
  523. return;
  524. }
  525. if (workInfo.value.status != '3') {
  526. workInfo.value.status = '2';
  527. }
  528. isLoading.value = true; // 显示遮罩层
  529. workInfo.value.endTime = timestampToTime(new Date());
  530. uni.showLoading({
  531. title: '加载中'
  532. });
  533. workInfo.value.rejectList = wasteInfo.value;
  534. workInfo.value.isPreProcess = store.isPreProcess;
  535. workInfo.value.processStepNumber = store.dayworkInfo.currentProcess.processStepNumber
  536. saveDayWorkItem(workInfo.value).then(res => {
  537. isLoading.value = false; // 隐藏遮罩层
  538. uni.hideLoading();
  539. if (res.code === 200) {
  540. uni.showToast({
  541. icon: 'success',
  542. title: '操作成功',
  543. });
  544. emit('resflushItem');
  545. close();
  546. } else {
  547. uni.showToast({
  548. icon: 'none',
  549. title: res.msg
  550. });
  551. }
  552. })
  553. }
  554. function handleAddWasteInfo() {
  555. if (wasteInfo.value.length > 0) {
  556. if (wasteInfo.value.some(item => item.rejectNum == '' || item.reason == '')) {
  557. uni.showToast({
  558. icon: 'none',
  559. title: '请填写废品量或废品原因再点击添加'
  560. })
  561. } else {
  562. wasteInfo.value.push({
  563. rejectNum: '',
  564. reason: ''
  565. })
  566. }
  567. } else {
  568. wasteInfo.value.push({
  569. rejectNum: store.dayworkInfo.processQualifiedNum > 0 ? store.dayworkInfo
  570. .processQualifiedNum - lotPreSumQualifiedNum.value - lotPreSumReject.value - workInfo.value
  571. .qualifiedNum > 0 ? store.dayworkInfo
  572. .processQualifiedNum - lotPreSumQualifiedNum.value - lotPreSumReject.value - workInfo.value
  573. .qualifiedNum : 1 : store.dayworkInfo.isLast == 1 ?
  574. store.dayworkInfo.lastLotQuantity - lotPreSumQualifiedNum.value - lotPreSumReject.value -
  575. workInfo.value.qualifiedNum > 0 ?
  576. store.dayworkInfo.lastLotQuantity - lotPreSumQualifiedNum.value - lotPreSumReject.value -
  577. workInfo.value.qualifiedNum : 1 : store.dayworkInfo.oneLotQuantity - lotPreSumQualifiedNum
  578. .value - lotPreSumReject.value -
  579. workInfo.value.qualifiedNum > 0 ?
  580. store.dayworkInfo.oneLotQuantity - lotPreSumQualifiedNum.value - lotPreSumReject.value -
  581. workInfo.value.qualifiedNum : 1,
  582. reason: ''
  583. })
  584. }
  585. }
  586. function handleDeleteWasteInfo(index) {
  587. wasteInfo.value.splice(index, 1);
  588. }
  589. function handleReasonChange(item) {
  590. if (wasteInfo.value.filter(waste => waste.reason == item.reason).length > 1) {
  591. wasteInfo.value.splice(wasteInfo.value.indexOf(item), 1);
  592. uni.showToast({
  593. icon: 'none',
  594. title: '请勿重复选择废品原因',
  595. duration: 2000
  596. })
  597. }
  598. }
  599. defineExpose({
  600. open
  601. })
  602. </script>
  603. <style lang="scss">
  604. .dialog-body {
  605. .list-container {
  606. width: 100%;
  607. display: flex;
  608. align-items: flex-start;
  609. padding: 0 4rpx;
  610. .list-title {
  611. width: 100%;
  612. margin-top: 16rpx;
  613. height: 64rpx;
  614. line-height: 64rpx;
  615. align-items: center;
  616. .label {
  617. flex: 1;
  618. font-size: 32rpx;
  619. }
  620. .input {
  621. width: 40%;
  622. height: 66rpx;
  623. padding-left: 10rpx;
  624. font-size: 22rpx;
  625. border: 1rpx solid #e1e1e1;
  626. border-radius: 8rpx;
  627. }
  628. .icon-gear {
  629. font-size: 56rpx;
  630. }
  631. }
  632. .switch {
  633. margin-top: -8rpx;
  634. align-items: center;
  635. transform: scale(0.7);
  636. }
  637. .confirmCarrier {
  638. .label {
  639. padding-top: 20rpx;
  640. font-size: 32rpx;
  641. }
  642. .vehicleList {
  643. justify-content: baseline;
  644. align-content: flex-start;
  645. flex-wrap: wrap;
  646. width: 100%;
  647. height: 120rpx;
  648. overflow: auto;
  649. .vehicleNo {
  650. padding: 0 10rpx;
  651. margin: 10rpx 20rpx 0 0;
  652. justify-content: space-between;
  653. align-items: center;
  654. width: auto;
  655. height: 60rpx;
  656. border: 2rpx solid rgba(213, 213, 213, 1);
  657. border-radius: 6rpx;
  658. }
  659. .blueBorder {
  660. background-color: #1684fc;
  661. color: #FFFFFF;
  662. }
  663. }
  664. }
  665. }
  666. .add-btn-container {
  667. margin-top: 32rpx;
  668. .btn {
  669. flex: 1;
  670. background-color: rgba(255, 85, 85, 1);
  671. color: #FFFFFF;
  672. margin-left: 5rpx;
  673. padding: 0;
  674. }
  675. .btnScan {
  676. flex: 1;
  677. color: #FFFFFF;
  678. margin-right: 5rpx;
  679. padding: 0;
  680. }
  681. }
  682. }
  683. .mask {
  684. position: fixed;
  685. top: 0;
  686. left: 0;
  687. right: 0;
  688. bottom: 0;
  689. background-color: rgba(0, 0, 0, 0.5);
  690. z-index: 2000;
  691. display: flex;
  692. justify-content: center;
  693. align-items: center;
  694. }
  695. .mask .loading-text {
  696. color: #fff;
  697. font-size: 36rpx;
  698. }
  699. </style>