index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797
  1. <template>
  2. <view class='container'>
  3. <view class="content">
  4. <view>
  5. <text class='title'>批次号</text>
  6. <view class="batchNo uni-row">
  7. <view :class="{'batchNo-item':true, 'uni-row': true}" v-for="(item,index) in batchNoList"
  8. :key='index'>
  9. <!-- ,'batchNoCheck':batchNoCheck === item -->
  10. <!-- @click="handleCheckBatchNo(item)" -->
  11. {{ item.lotCode }}{{ item.isLast == 1 ? ' (尾批)': '' }}
  12. </view>
  13. </view>
  14. <view class="inpAndScan ">
  15. <uni-easyinput v-if="batchNoList.length > 0" class="inp" suffixIcon="checkmarkempty"
  16. v-model="inpValue" placeholder="可手动修正批次" @iconClick="iconClick"></uni-easyinput>
  17. <view class="uni-row" style="justify-content: space-between;">
  18. <view v-if="batchNoList.length > 0 && curDept" class="scanLotCode" @click="handleDoLastLot">
  19. <text>是否加工尾批</text>
  20. </view>
  21. <view v-if="batchNoList.length > 0" class="scanLotCode" @click="handleConfirmLotCode">
  22. <text>扫码修正批次</text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class='middle'>
  28. <view class='segment'></view>
  29. <uni-icons type="link" size="30" style="margin: 10rpx; transform: rotate(135deg);"></uni-icons>
  30. <view class='segment'></view>
  31. </view>
  32. <!-- <view>
  33. <text class='title'>扫码绑定载具</text>
  34. <view class="vehicleList uni-row">
  35. <view class="vehicleNo uni-row" v-for="(item,index) in vehicleList">
  36. <text>{{item.carrierCode}}</text>
  37. <text @click="handleDelVehicleNo(index)">×</text>
  38. </view>
  39. </view>
  40. <view>
  41. <button style='background-color: rgba(0, 226, 166,1);
  42. color: white;margin: 20rpx auto;
  43. width: 80%;' @click='handleScanCode'>扫码</button>
  44. </view>
  45. </view> -->
  46. <view class="selectedProcess">
  47. <uni-section title="请选择工序" type="square">
  48. <uni-data-select v-model="selectedProcess" :localdata="processList" :clear="false"
  49. @change="handleProcessChange">
  50. <template v-slot:option="{item }">
  51. <!-- 自定义下拉框每一项的显示内容 -->
  52. <span>{{ (item.index) + 1}}</span>
  53. <span>{{ item.text }}</span>
  54. </template></uni-data-select>
  55. </uni-section>
  56. </view>
  57. <view class='middle'>
  58. <view class='segment'></view>
  59. <uni-icons type="paperclip" size="30" style="margin: 10rpx;"></uni-icons>
  60. <view class='segment'></view>
  61. </view>
  62. <view>
  63. <text class='title' style="margin-bottom: 40rpx;">基础信息</text>
  64. <view class="uni-row info" style="align-items: center;">
  65. <label for="HeatNo">炉号:</label>
  66. <uni-data-select v-if="isWasteRecyclingFlag" id="incomingInfo" class="uni-input data-select"
  67. v-model="basicInfo" :localdata="furnaceNumberInfoList" :clear="false"
  68. @change="handleFurnaceNumberChange"></uni-data-select>
  69. <text id="incomingInfo" v-else class="uni-input">废品回用</text>
  70. </view>
  71. <!-- <view class='segment' style="width: 90%;margin: 20rpx auto;"></view> -->
  72. <view class="uni-row info">
  73. <label for="productionPlanNo">计划单号:</label>
  74. <text id="productionPlanNo"
  75. class="uni-input">{{ basicInfo.productionPlanNo ? basicInfo.productionPlanNo : '-'}}</text>
  76. </view>
  77. <!-- <view class='segment' style="width: 90%;margin: 20rpx auto;"></view> -->
  78. <view class="uni-row info">
  79. <label for="lineNumber">序号:</label>
  80. <text id="lineNumber"
  81. class="uni-input">{{ basicInfo.lineNumber ? basicInfo.lineNumber : '-'}}</text>
  82. </view>
  83. <!-- <view class='segment' style="width: 90%;margin: 20rpx auto;"></view> -->
  84. <view class="uni-row info">
  85. <label for="factory">厂家:</label>
  86. <text id="factory"
  87. class="material uni-input">{{ basicInfo.factory ? basicInfo.factory : '-'}}</text>
  88. </view>
  89. <view class="uni-row info">
  90. <label for="brandNumber">牌号:</label>
  91. <text id="brandNumber"
  92. class="material uni-input">{{ basicInfo.brandNumber ? basicInfo.brandNumber : '-' }}</text>
  93. </view>
  94. <view class="uni-row info">
  95. <label for="spec">规格:</label>
  96. <text id="spec" class="material uni-input">{{ basicInfo.spec ? basicInfo.spec : '-' }}</text>
  97. </view>
  98. <view class="uni-row info">
  99. <label for="shape">形状:</label>
  100. <text id="shape" class="material uni-input">{{ basicInfo.shape ? basicInfo.shape : '-'}}</text>
  101. </view>
  102. <view class="uni-row info">
  103. <label for="diameter">材料直径:</label>
  104. <text id="diameter"
  105. class="material uni-input">{{ basicInfo.diameter ? basicInfo.diameter : '-' }}</text>
  106. </view>
  107. <view class="uni-row info">
  108. <label for="rawMaterialCode">原料编码:</label>
  109. <text id="rawMaterialCode"
  110. class="material uni-input">{{ basicInfo.rawMaterialCode ? basicInfo.rawMaterialCode : '-' }}</text>
  111. </view>
  112. <view class="uni-row info">
  113. <label for="incomingDate">来料日期:</label>
  114. <text id="incomingDate"
  115. class="material uni-input">{{ basicInfo.incomingDate ? basicInfo.incomingDate : '-' }}</text>
  116. </view>
  117. <view class="uni-row info">
  118. <label for="firstTechnicalRequirement">材质1:</label>
  119. <text id="firstTechnicalRequirement"
  120. class="material uni-input">{{ basicInfo.firstTechnicalRequirement ? basicInfo.firstTechnicalRequirement : '-' }}</text>
  121. </view>
  122. <view class="uni-row info">
  123. <label for="secondTechnicalRequirement">材质2:</label>
  124. <text id="secondTechnicalRequirement"
  125. class="material uni-input">{{ basicInfo.secondTechnicalRequirement ? basicInfo.secondTechnicalRequirement : '-' }}</text>
  126. </view>
  127. </view>
  128. </view>
  129. <view class='bottom uni-row'>
  130. <button class='add' type=primary @click='handleAdd'>添加</button>
  131. </view>
  132. </view>
  133. </template>
  134. <script setup>
  135. import {
  136. ref
  137. } from 'vue'
  138. import {
  139. onLoad,
  140. onReady
  141. } from '@dcloudio/uni-app'
  142. import {
  143. getLotList,
  144. getAbnormalityLot,
  145. getProcessListByLot
  146. } from "@/api/business/lot.js"
  147. import {
  148. saveDayWork
  149. } from '@/api/business/dayWork.js'
  150. import {
  151. store
  152. } from '@/store/index.js'
  153. import {
  154. getCarrierById,
  155. checkCarrier
  156. } from '@/api/business/carrier.js'
  157. import {
  158. getFurnaceNoInfo
  159. } from '@/api/p2/furnaceNoInfo.js'
  160. import {
  161. getToken
  162. } from '@/utils/auth'
  163. import {
  164. getProcessList
  165. } from '@/api/business/deptProcess.js'
  166. import path from '@/api/base/path.js'
  167. const batchNoCheck = ref(null) // 批次号是否选中
  168. const batchNoList = ref([]) // 批次号列表
  169. const vehicleList = ref([])
  170. const basicInfo = ref({}) // 基础信息对象
  171. const dayWork = ref({})
  172. const furnaceInfo = ref({})
  173. const wasteRecyclingList = ref([]) //废品回用批次
  174. const curPlan = ref({})
  175. const furnaceNumberInfoList = ref([])
  176. const isWasteRecyclingFlag = ref(true)
  177. const emit = defineEmits(['batchReporting-addBatch']);
  178. const inpValue = ref('')
  179. const curDept = ref(false) //判断当前工段是否是该批次的领料部门
  180. const lotList = ref([])
  181. const selectedProcess = ref(null)
  182. const processList = ref([])
  183. onLoad(() => {
  184. // 处理特殊字符JSON解析失败报错
  185. curPlan.value = store.planDetails;
  186. dayWork.value = {
  187. productionPlanDetailId: curPlan.value.id,
  188. productionPlanId: curPlan.value.productionDetailId,
  189. technologicalProcessId: curPlan.value.technologicalProcessId,
  190. deptId: store.curDeptDetails.deptId
  191. }
  192. init();
  193. })
  194. function init() {
  195. let obj = {}
  196. obj.productionPlanDetailId = store.planDetails.id;
  197. //开始新批次,判断当前工段是否能开始这个批次(领料部门是当前工段的;批次的领料部门是当前工段的)
  198. //当前计划单的领料部门是当前工段
  199. if (store.normalStatus) {
  200. curDept.value = true
  201. //只查不是废品回用的批次
  202. getLotList(obj).then(res => {
  203. lotList.value = res.rows;
  204. if (res.rows.length > 0) {
  205. batchNoList.value = [res.rows[0]];
  206. dayWork.value.lotId = batchNoList.value[0].id;
  207. dayWork.value.lotCode = batchNoList.value[0].lotCode;
  208. dayWork.value.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
  209. store.planDetails.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
  210. getProcessInfo(batchNoList.value[0])
  211. getFurnaceInfo(batchNoList.value[0])
  212. } else {
  213. batchNoList.value = res.rows;
  214. }
  215. })
  216. } else {
  217. //废品回用的批次(领料部门是当前工段)
  218. getAbnormalityLot({
  219. productionPlanDetailId: store.planDetails.id,
  220. requisitionDepartmentId: store.curDeptDetails.deptId,
  221. flag: true
  222. }).then(res => {
  223. wasteRecyclingList.value = res.rows
  224. if (res.rows.length > 0) {
  225. //如果废品回用的批次领料部门是当前计划的领料部门,则加到lotList
  226. lotList.value = res.rows
  227. batchNoList.value = [res.rows[0]];
  228. isWasteRecyclingFlag.value = true
  229. if(batchNoList.value[0].isWasteRecycling == 0) {
  230. isWasteRecyclingFlag.value = false
  231. }
  232. dayWork.value.lotId = batchNoList.value[0].id;
  233. dayWork.value.lotCode = batchNoList.value[0].lotCode;
  234. dayWork.value.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
  235. store.planDetails.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
  236. getProcessInfo(batchNoList.value[0])
  237. //提示当前批次是废品回用
  238. if (batchNoList.value[0].isAmend == 1) {
  239. uni.showToast({
  240. icon: "none",
  241. title: "该批是单批单改",
  242. duration: 2000
  243. })
  244. } else if (batchNoList.value[0].isWasteRecycling == 1) {
  245. uni.showToast({
  246. icon: "none",
  247. title: "该批是废品回用",
  248. duration: 2000
  249. })
  250. }
  251. getFurnaceInfo(batchNoList.value[0])
  252. } else {
  253. uni.showToast({
  254. icon: "none",
  255. title: "没有废品回用或单批单改批次",
  256. duration: 2000
  257. })
  258. }
  259. })
  260. }
  261. }
  262. // function handleCheckBatchNo(item) {
  263. // batchNoCheck.value = item;
  264. // dayWork.value.lotId = item.id;
  265. // }
  266. // function handleDelVehicleNo(index) {
  267. // vehicleList.value.splice(index, 1);
  268. // }
  269. // function handleValidate() {
  270. // if (batchNoCheck.value && vehicleList.value) {
  271. // return true;
  272. // } else {
  273. // return false;
  274. // }
  275. // }
  276. function getFurnaceInfo(data) {
  277. if (data.isWasteRecycling == 0) {
  278. isWasteRecyclingFlag.value = true
  279. let token = 'Bearer ' + getToken();
  280. let header = {
  281. Authorization: token
  282. }
  283. uni.request({
  284. url: path.furnaceNoURL + '/business/furnaceNoInfo/getFurnaceNoInfo',
  285. data: {
  286. productionPlanNo: store.planDetails.productionPlanNo,
  287. lineNumber: store.planDetails.lineNumber
  288. },
  289. method: 'GET',
  290. header,
  291. sslVerify: false,
  292. success: (res) => {
  293. if (res.data.code == 200 && res.data.data.length > 0) {
  294. for (let i = 0; i < res.data.data.length; i++) {
  295. furnaceNumberInfoList.value[i] = {
  296. text: res.data.data[i].furnaceNumber,
  297. value: res.data.data[i]
  298. }
  299. }
  300. // basicInfo.value = res.data.data[0];
  301. // dayWork.value.furnaceNoInfo = basicInfo.value;
  302. }
  303. },
  304. fail: (err) => {
  305. console.log(err)
  306. }
  307. })
  308. } else {
  309. isWasteRecyclingFlag.value = false
  310. furnaceInfo.value.furnaceNumber = "废品回用"
  311. furnaceInfo.value.firstTechnicalRequirement = "废品回用"
  312. dayWork.value.furnaceNoInfo = furnaceInfo.value
  313. basicInfo.value = dayWork.value.furnaceNoInfo
  314. }
  315. }
  316. function iconClick() {
  317. checkLotCode(inpValue.value);
  318. }
  319. function checkLotCode(lotCode) {
  320. var lotCodes = lotList.value.map(obj => obj.lotCode)
  321. if (lotCodes.includes(lotCode)) {
  322. for (let i = 0; i < lotList.value.length; i++) {
  323. if (lotList.value[i].lotCode == lotCode) {
  324. batchNoList.value = [lotList.value[i]];
  325. dayWork.value.lotId = lotList.value[i].id;
  326. dayWork.value.lotCode = lotList.value[i].lotCode;
  327. dayWork.value.technologicalProcessId = lotList.value[i].technologicalProcessId;
  328. store.planDetails.technologicalProcessId = lotList.value[i].technologicalProcessId;
  329. if (batchNoList.value[0].isWasteRecycling == 1) {
  330. isWasteRecyclingFlag.value = false
  331. getFurnaceInfo(batchNoList.value[0])
  332. uni.showToast({
  333. icon: "none",
  334. title: "该批次号可用,该批是废品回用",
  335. duration: 2000
  336. })
  337. getProcessInfo(batchNoList.value[0])
  338. } else if (batchNoList.value[0].isAmend == 1) {
  339. isWasteRecyclingFlag.value = true
  340. getFurnaceInfo(batchNoList.value[0])
  341. uni.showToast({
  342. icon: "none",
  343. title: "该批次号可用,该批是单批单改",
  344. duration: 2000
  345. })
  346. getProcessInfo(batchNoList.value[0])
  347. } else {
  348. uni.showToast({
  349. icon: "none",
  350. title: "该批次号可用",
  351. duration: 2000
  352. })
  353. getProcessInfo(batchNoList.value[0])
  354. }
  355. return true;
  356. }
  357. }
  358. } else {
  359. getAbnormalList(lotCode);
  360. }
  361. }
  362. function getAbnormalList(lotCode) {
  363. if (store.normalStatus) {
  364. getAbnormalityLot({
  365. productionPlanDetailId: store.planDetails.id,
  366. requisitionDepartmentId: store.curDeptDetails.deptId,
  367. flag: true
  368. }).then(res => {
  369. if (res.rows.length > 0) {
  370. var abNormaLotCode = res.rows.map(obj => obj.lotCode)
  371. if (abNormaLotCode.includes(lotCode)) {
  372. uni.showToast({
  373. icon: "none",
  374. title: "该批次号是废品回用或单批单改",
  375. duration: 2000
  376. })
  377. return false;
  378. }
  379. } else {
  380. uni.showToast({
  381. icon: "none",
  382. title: "该批次号已被使用或不属于该产品",
  383. duration: 2000
  384. })
  385. return false;
  386. }
  387. })
  388. } else {
  389. getLotList({productionPlanDetailId: store.planDetails.id}).then(res => {
  390. if (res.rows.length > 0) {
  391. console.log(res.rows)
  392. var normaLotCode = res.rows.map(obj => obj.lotCode)
  393. if (normaLotCode.includes(lotCode)) {
  394. uni.showToast({
  395. icon: "none",
  396. title: "该批次号是正常批",
  397. duration: 2000
  398. })
  399. return false;
  400. }
  401. } else {
  402. uni.showToast({
  403. icon: "none",
  404. title: "该批次号已被使用或不属于该产品",
  405. duration: 2000
  406. })
  407. return false;
  408. }
  409. })
  410. }
  411. }
  412. function getProcessInfo(data) {
  413. getProcessList({
  414. deptId: store.curDeptDetails.deptId,
  415. }).then(res => {
  416. if (res.code == 200) {
  417. //过滤出工序交集
  418. //因为废品回用对工序进行单独的修改。所以重新查产品的工艺,如果该批不是废品回用,则查产品工序,如果是,则到
  419. //对应表查
  420. //通过批次号查
  421. getProcessListByLot(data).then(response => {
  422. let lotProcessList = response.data
  423. let filteredData = lotProcessList.filter((item1) =>
  424. res.data.some((item2) => item2.processCode === item1.processCode)
  425. );
  426. processList.value = filteredData.map((v, index) => ({
  427. text: v.processAlias,
  428. value: v.technologicalProcessDetailId ? v
  429. .technologicalProcessDetailId : v.id,
  430. processId: v.processId,
  431. processStepNumber: v.processStepNumber,
  432. index: index,
  433. technologicalProcessId:v.technologicalProcessId ? v
  434. .technologicalProcessId : v.lotTechnologicalProcessId
  435. }))
  436. selectedProcess.value = processList.value[0].value;
  437. dayWork.value.processId = processList.value[0].processId;
  438. dayWork.value.technologicalProcessId = processList.value[0].technologicalProcessId
  439. dayWork.value.technologicalProcessDetailId = selectedProcess.value
  440. dayWork.value.processStepNumber = processList.value.findIndex(v => v.value ===
  441. selectedProcess.value) >= 0 ?
  442. processList.value.find(v => v.value === selectedProcess.value).processStepNumber :
  443. null
  444. })
  445. }
  446. })
  447. }
  448. function handleDoLastLot() {
  449. uni.showModal({
  450. title: '提示',
  451. content: '确认是否加工尾批?',
  452. success: function(res) {
  453. if (res.confirm) {
  454. if (lotList.value.some(item => item.isLast == 1)) {
  455. for (let i = 0; i < lotList.value.length; i++) {
  456. if (lotList.value[i].isLast == 1) {
  457. batchNoList.value = [lotList.value[i]];
  458. dayWork.value.lotId = lotList.value[i].id;
  459. dayWork.value.lotCode = lotList.value[i].lotCode;
  460. dayWork.value.isLast = '1';
  461. return;
  462. }
  463. }
  464. } else {
  465. uni.showToast({
  466. icon: 'none',
  467. title: '当前计划尾批已被加工',
  468. duration: 2500
  469. })
  470. }
  471. } else if (res.cancel) {}
  472. }
  473. });
  474. }
  475. function handleConfirmLotCode() {
  476. // 引入原生插件
  477. const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
  478. // 调用插件的 mpaasScan 方法
  479. mpaasScanModule.mpaasScan({
  480. // 扫码识别类型,参数可多选,qrCode、barCode,
  481. // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
  482. scanType: ["qrCode", "barCode"],
  483. // 是否隐藏相册,默认false不隐藏
  484. hideAlbum: false,
  485. },
  486. (ret) => {
  487. console.log(ret);
  488. // uni.showModal({
  489. // title: "扫码结果",
  490. // // 返回值中,有三个参数 resp_code、resp_message、resp_result
  491. // // resp_code 表示返回结果值,10:用户取消,11:其他错误,1000:成功
  492. // // resp_message 表示返回结果信息
  493. // // resp_result 表示扫码结果,只有成功才会有返回
  494. // content: JSON.stringify(ret),
  495. // showCancel: false,
  496. // confirmText: "确定",
  497. // });
  498. if (ret.resp_result) {
  499. checkLotCode(ret.resp_result);
  500. }
  501. }
  502. );
  503. }
  504. function handleFurnaceNumberChange() {
  505. dayWork.value.furnaceNoInfo = basicInfo.value;
  506. }
  507. function handleProcessChange() {
  508. dayWork.value.technologicalProcessDetailId = selectedProcess.value;
  509. dayWork.value.processId = processList.value.findIndex(v => v.value === selectedProcess.value) >= 0 ? processList
  510. .value.find(v => v.value === selectedProcess.value).processId : null
  511. dayWork.value.processStepNumber = processList.value.findIndex(v => v.value === selectedProcess.value) >= 0 ?
  512. processList.value.find(v => v.value === selectedProcess.value).processStepNumber : null
  513. dayWork.value.technologicalProcessId = batchNoList.value[0].technologicalProcessId;
  514. }
  515. /*
  516. // function handleScanCode() {
  517. // uni.scanCode({
  518. // scanType: ['qrCode'],
  519. // onlyFromCamera: true, // 只允许相机扫码
  520. // autoZoom: false,
  521. // success: function(res) {
  522. // let vehicleObj = JSON.parse(res.result);
  523. // if (!vehicleObj.carrierId || vehicleObj.carrierId == "") {
  524. // uni.showToast({
  525. // icon: "error",
  526. // title: "请扫载具码",
  527. // duration: 1000
  528. // })
  529. // return;
  530. // }
  531. // for (let i = 0; i < vehicleList.value.length; i++) {
  532. // if (vehicleList.value[i].carrierId == vehicleObj.carrierId) {
  533. // uni.showToast({
  534. // icon: "error",
  535. // title: "载具已存在",
  536. // duration: 1000
  537. // })
  538. // return;
  539. // }
  540. // }
  541. // checkCarrier(vehicleObj.carrierId).then(response => {
  542. // if (response.code == 200) {
  543. // vehicleList.value.push(vehicleObj);
  544. // } else {
  545. // uni.showToast({
  546. // icon: 'none',
  547. // title: response.msg
  548. // })
  549. // return;
  550. // }
  551. // })
  552. // }
  553. // });
  554. // }
  555. */
  556. function handleAdd() {
  557. if (selectedProcess.value == null) {
  558. uni.showToast({
  559. icon: 'none',
  560. title: '请选择工序后再开始批次'
  561. })
  562. return;
  563. }
  564. if (dayWork.value.furnaceNoInfo == null) {
  565. uni.showToast({
  566. icon: 'none',
  567. title: '请选择炉号再开始批次'
  568. })
  569. return;
  570. }
  571. dayWork.value.isWasteRecycling = batchNoList.value[0].isWasteRecycling
  572. dayWork.value.isAmend = batchNoList.value[0].isAmend
  573. dayWork.value.fromId = batchNoList.value[0].fromId
  574. store.furnaceNumberInfo = basicInfo.value;
  575. if (checkLotCode(dayWork.value.lotCode)) {
  576. saveDayWork(dayWork.value).then(res => {
  577. console.log(res)
  578. if (res.code === 200) {
  579. uni.showToast({
  580. icon: 'success',
  581. title: '添加成功',
  582. duration: 2000
  583. });
  584. // uni.$emit('batchReporting-addBatch');
  585. // uni.$emit('dayworkItemUpdate');
  586. uni.navigateBack({
  587. url: '/pages/batchReporting/index'
  588. })
  589. } else {
  590. uni.showToast({
  591. icon: 'none',
  592. title: res.msg,
  593. duration: 2000
  594. });
  595. }
  596. })
  597. } else {
  598. uni.showToast({
  599. icon: "none",
  600. title: "该批次号已被使用或不属于该产品",
  601. duration: 2000
  602. })
  603. }
  604. }
  605. </script>
  606. <style lang="scss">
  607. .container {
  608. height: 90%;
  609. background-color: #f5f5f5;
  610. padding-bottom: 112rpx;
  611. }
  612. .bottom {
  613. background-color: white;
  614. width: 100%;
  615. position: fixed;
  616. bottom: 0;
  617. align-items: center;
  618. background-color: #ffffff;
  619. padding: 16rpx 0;
  620. .add {
  621. margin: 0 auto;
  622. width: 80%;
  623. height: 80rpx;
  624. }
  625. }
  626. .content {
  627. position: relative;
  628. width: auto;
  629. background-color: rgba(255, 255, 255, 1);
  630. margin: 32rpx;
  631. padding-bottom: 50rpx;
  632. padding-top: 20rpx;
  633. border-radius: 12rpx;
  634. height: 100%;
  635. overflow: auto;
  636. .title {
  637. width: auto;
  638. font-size: 36rpx;
  639. font-weight: bold;
  640. text-align: center;
  641. }
  642. }
  643. .inpAndScan {
  644. justify-content: space-between;
  645. width: calc(88% + 20rpx);
  646. margin: 0 auto;
  647. .inp {
  648. width: calc(100% - 16rpx);
  649. margin: 10rpx auto;
  650. height: 74rpx;
  651. }
  652. .scanLotCode {
  653. border-radius: 6rpx;
  654. border: 1rpx solid rgba(22, 132, 252, 1);
  655. height: 60rpx;
  656. margin: 10rpx;
  657. height: 72rpx;
  658. width: 46%;
  659. text-align: center;
  660. line-height: 72rpx;
  661. background-color: rgba(22, 132, 252, 1);
  662. color: white;
  663. }
  664. }
  665. .batchNo {
  666. // justify-content: flex-start;
  667. // flex-wrap: wrap;
  668. // width: auto;
  669. // height: 320rpx;
  670. // overflow: auto;
  671. // padding-left: calc(100% - 88% - 4rpx - 40rpx);
  672. // margin-bottom: 40rpx;
  673. // border-radius: 6rpx;
  674. justify-content: center;
  675. .batchNo-item {
  676. justify-content: center;
  677. align-items: center;
  678. width: 88%;
  679. margin: 10rpx;
  680. height: 72rpx;
  681. border: 1px solid rgba(213, 213, 213, 1);
  682. border-radius: 6rpx;
  683. }
  684. .batchNoCheck {
  685. color: #FFF;
  686. border: 1rpx solid rgba(22, 132, 252, 1);
  687. background-color: rgba(22, 132, 252, 1);
  688. }
  689. }
  690. .vehicleList {
  691. justify-content: flex-start;
  692. flex-wrap: wrap;
  693. width: auto;
  694. height: 120rpx;
  695. overflow: auto;
  696. padding: 0 80rpx;
  697. .vehicleNo {
  698. padding: 0 10rpx;
  699. margin: 10rpx;
  700. justify-content: space-between;
  701. align-items: center;
  702. width: 230rpx;
  703. height: 60rpx;
  704. border: 1px solid rgba(213, 213, 213, 1);
  705. border-radius: 6rpx;
  706. }
  707. }
  708. .middle {
  709. display: flex;
  710. flex-direction: row;
  711. align-items: center;
  712. justify-content: center
  713. }
  714. .segment {
  715. width: 280rpx;
  716. background-color: rgba(213, 213, 213, 1);
  717. border: 1rpx solid rgba(213, 213, 213, 1);
  718. }
  719. .info {
  720. width: 94%;
  721. justify-content: space-around;
  722. padding: 10rpx;
  723. margin: 0 auto;
  724. label {
  725. flex: 1;
  726. text-combine-upright: all;
  727. margin: 0 30rpx 0 20rpx;
  728. }
  729. text {
  730. flex: 3;
  731. // width: 80%;
  732. }
  733. .data-select {
  734. flex: 3;
  735. width: 80%;
  736. height: 60rpx;
  737. margin-right: 40rpx;
  738. border-radius: 18rpx;
  739. background-color: #FFF;
  740. .data-select-options {
  741. width: 200rpx;
  742. }
  743. }
  744. }
  745. .material {
  746. height: auto;
  747. width: 60%;
  748. }
  749. .selectedProcess {
  750. width: 88%;
  751. margin: 20rpx auto 40rpx;
  752. }
  753. </style>