batchNumEdit.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" :title="`批次号信息`">
  4. <template slot="left">
  5. <u-button
  6. size="small"
  7. class="u-reset-button"
  8. @click="cancel"
  9. text="取消"
  10. ></u-button
  11. ></template>
  12. <!--右菜单-->
  13. <template slot="right">
  14. <u-button
  15. type="success"
  16. size="small"
  17. class="u-reset-button"
  18. @click="handleSave"
  19. text="保存"
  20. ></u-button>
  21. </template>
  22. </uni-nav-bar>
  23. <view class="wrapper">
  24. <u-form
  25. labelPosition="left"
  26. :model="warehousingMaterialList[curIndex]"
  27. ref="lisrFormRef"
  28. labelWidth="350"
  29. :rules="rules"
  30. errorType="none"
  31. labelAlign="left"
  32. :labelStyle="{
  33. fontSize: '24rpx',
  34. }"
  35. >
  36. <view class="title"
  37. >{{ baseInfo.assetName }}&nbsp;&nbsp;{{ baseInfo.assetCode }}</view
  38. >
  39. <view class="cell">
  40. <u-form-item
  41. style="width: 100%"
  42. required
  43. label="包装数量"
  44. prop="outInNum"
  45. >
  46. <u-input
  47. disableColor="#ffffff"
  48. type="number"
  49. @change="unpdateMaterialCode"
  50. placeholder="请输入"
  51. v-model="warehousingMaterialList[curIndex].outInNum"
  52. /></u-form-item>
  53. </view>
  54. <view class="cell">
  55. <u-form-item
  56. style="width: 100%"
  57. required
  58. label="批次号"
  59. prop="batchNum"
  60. >
  61. <u-input
  62. @change="unpdateMaterialCode"
  63. disableColor="#ffffff"
  64. type="text"
  65. placeholder="请输入"
  66. v-model="warehousingMaterialList[curIndex].batchNum"
  67. /></u-form-item>
  68. </view>
  69. <view class="cell">
  70. <u-form-item
  71. required
  72. style="width: 100%"
  73. label="最小单元"
  74. prop="measurementUnit"
  75. >
  76. <u-input
  77. disableColor="#ffffff"
  78. @change="unpdateMaterialCode"
  79. type="number"
  80. placeholder="请输入"
  81. v-model="warehousingMaterialList[curIndex].measurementUnit"
  82. >
  83. <template slot="suffix"
  84. >{{ baseInfo.unit }} /{{ baseInfo.minPackUnit }}</template
  85. ></u-input
  86. ></u-form-item
  87. >
  88. </view>
  89. <view class="cell" v-if="assetType == 3">
  90. <u-form-item style="width: 100%" label="质检单">
  91. <UploadFileNew
  92. v-model="warehousingMaterialList[curIndex].contentImage"
  93. fileMediatype="image"
  94. mode="grid"
  95. disable-preview
  96. limit="1"
  97. :imageStyles="{
  98. width: 80,
  99. height: 40,
  100. border: 'none',
  101. }"
  102. >
  103. 上传图片
  104. </UploadFileNew></u-form-item
  105. >
  106. </view>
  107. <view
  108. class="cell"
  109. :key="warehousingMaterialList[curIndex].cargoSpaceCode"
  110. >
  111. <u-form-item
  112. required
  113. style="width: 100%"
  114. label="货位"
  115. labelWidth="250"
  116. prop="cargoSpaceCode"
  117. :key="forceUpdate"
  118. >
  119. <view
  120. class="cargoSpaceCode text-primary"
  121. @click="handleWarehouseChoose"
  122. :key="warehousingMaterialList[curIndex].cargoSpaceCode"
  123. >{{
  124. warehousingMaterialList[curIndex].cargoSpaceCode
  125. ? `${warehousingMaterialList[curIndex].warehouseName}-${warehousingMaterialList[curIndex].areaName}-${warehousingMaterialList[curIndex].shelfCode}-${warehousingMaterialList[curIndex].cargoSpaceCode}`
  126. : "仓库-库位-货架-货位"
  127. }}</view
  128. >
  129. </u-form-item>
  130. </view>
  131. </u-form>
  132. <view class="bucket-wrapper" :key="forceUpdate">
  133. <view class="operation">
  134. <!-- <u-button type="success" size="small" @click="getMaterialCode"
  135. >生成明细</u-button
  136. > -->
  137. <text class="text-primary" @click="chooseAssets" v-if="bizScene == 5"
  138. >选择资产编号</text
  139. >
  140. <text
  141. class="text-primary"
  142. @click="setDate"
  143. v-if="
  144. bizScene != 5 &&
  145. warehousingMaterialList[curIndex].warehouseLedgerDetails &&
  146. warehousingMaterialList[curIndex].warehouseLedgerDetails.length
  147. "
  148. >批量设置日期</text
  149. >
  150. </view>
  151. <view class="self-table">
  152. <view class="self-tr">
  153. <view class="th check" v-if="bizScene != 5"
  154. ><checkbox
  155. @click="checkAll = !checkAll"
  156. :checked="checkAll"
  157. ></checkbox
  158. ></view>
  159. <view class="th code"
  160. >{{ getDictValue("物品类型", baseInfo.assetType) }}编码</view
  161. >
  162. <view class="th num">包装编码</view>
  163. <view class="th date-picker"
  164. ><uni-data-select
  165. style="width: 100rpx"
  166. :localdata="[
  167. { value: 'manufactureTime', text: '生产日期' },
  168. { value: 'procurementTime', text: '采购日期' },
  169. ]"
  170. :clear="false"
  171. :disabled="bizScene == 5"
  172. v-model="curDateType"
  173. /></view>
  174. </view>
  175. <checkbox-group @change="selectionChange" v-if="!showLoading">
  176. <view
  177. class="self-tr bg"
  178. v-for="(item, index) in (
  179. warehousingMaterialList[curIndex].warehouseLedgerDetails || []
  180. ).slice(0, page * 15)"
  181. :key="index"
  182. >
  183. <view class="th check" v-if="bizScene != 5"
  184. ><checkbox
  185. :value="index + ''"
  186. :checked="selection.find((i) => i == index) !== undefined"
  187. ></checkbox
  188. ></view>
  189. <view class="th code">{{ item.onlyCode }}</view>
  190. <view class="th num">{{ item.num }}</view>
  191. <view class="th date-picker"
  192. ><template v-if="bizScene == 5">
  193. {{ item[curDateType] }}
  194. </template>
  195. <uni-datetime-picker
  196. v-else
  197. type="datetime"
  198. :key="forceUpdate"
  199. v-model="item[curDateType]"
  200. @change="() => handleDateChange(item)"
  201. /></view>
  202. </view>
  203. <u-loadmore
  204. fontSize="32"
  205. iconSize="36"
  206. v-if="warehousingMaterialList[curIndex].warehouseLedgerDetails"
  207. :status="loadingMore"
  208. />
  209. </checkbox-group>
  210. <u-loading-icon text="更新中" textSize="30" v-else></u-loading-icon>
  211. </view>
  212. </view>
  213. </view>
  214. <u-popup :show="popupShow" mode="center">
  215. <view class="time-container">
  216. <view class="title">选择时间</view>
  217. <uni-datetime-picker type="datetime" v-model="batchTime" />
  218. </view>
  219. <view class="time-footer">
  220. <u-button @click="popupShow = false">取消</u-button>
  221. <u-button type="success" @click="confirm">确认</u-button>
  222. </view>
  223. </u-popup>
  224. <WarehouseChoose ref="warehouseChooseRef" />
  225. <ReturnSelect ref="returnSelectRef" />
  226. </view>
  227. </template>
  228. <script>
  229. import ReturnSelect from "./components/ReturnSelect";
  230. import WarehouseChoose from "@/components/WarehouseChoose";
  231. import { warehousingType, tableContentData } from "../enum.js";
  232. import UploadFileNew from "@/components/UploadFileNew";
  233. import { post, postJ, get } from "@/utils/api.js";
  234. import dictMixins from "@/mixins/dictMixins";
  235. let timer = null;
  236. let lastNum = 0;
  237. export default {
  238. mixins: [dictMixins],
  239. components: {
  240. WarehouseChoose,
  241. ReturnSelect,
  242. UploadFileNew,
  243. },
  244. data() {
  245. return {
  246. popupShow: false,
  247. forceUpdate: false,
  248. batchTime: "",
  249. curDateType: "manufactureTime",
  250. baseInfo: {},
  251. bizScene: "",
  252. assetType: "",
  253. curIndex: "",
  254. rules: {
  255. cargoSpaceCode: {
  256. type: "string",
  257. required: true,
  258. trigger: ["blur", "change"],
  259. },
  260. measurementUnit: {
  261. type: "string",
  262. required: true,
  263. trigger: ["blur", "change"],
  264. },
  265. outInNum: {
  266. type: "string",
  267. required: true,
  268. trigger: ["blur", "change"],
  269. },
  270. batchNum: {
  271. type: "string",
  272. required: true,
  273. trigger: ["blur", "change"],
  274. },
  275. },
  276. selection: [],
  277. isScan: false,
  278. showLoading: false,
  279. page: 1,
  280. };
  281. },
  282. //加载更多
  283. onReachBottom() {
  284. console.log("onReachBottom");
  285. this.page++;
  286. },
  287. //选择的列表长度
  288. computed: {
  289. loadingMore() {
  290. return this.page * 15 <
  291. this.warehousingMaterialList[this.curIndex].warehouseLedgerDetails
  292. .length
  293. ? "loading"
  294. : "nomore";
  295. },
  296. checkAll: {
  297. set(val) {
  298. if (val) {
  299. this.selection =
  300. this.warehousingMaterialList[
  301. this.curIndex
  302. ]?.warehouseLedgerDetails?.map((i, index) => index + "") || [];
  303. } else {
  304. this.selection = [];
  305. }
  306. },
  307. get() {
  308. return !!(
  309. this.selection.length &&
  310. this.selection.length ==
  311. this.warehousingMaterialList[this.curIndex]?.warehouseLedgerDetails
  312. ?.length
  313. );
  314. },
  315. },
  316. },
  317. onUnload() {
  318. clearTimeout(timer);
  319. },
  320. onLoad({ bizScene, assetType, index, isScan }) {
  321. this.requestDict("物品类型");
  322. lastNum = 0;
  323. this.bizScene = bizScene;
  324. this.isScan = isScan === "true";
  325. if (this.isScan) {
  326. this.bizScene = 5;
  327. }
  328. this.assetType = assetType;
  329. this.curIndex = index;
  330. this.baseInfo = uni.getStorageSync("inputData") || {};
  331. this.warehousingMaterialList =
  332. uni.getStorageSync("warehousingMaterialList") || [];
  333. if (
  334. this.warehousingMaterialList[this.curIndex]?.warehouseLedgerDetails
  335. ?.length
  336. ) {
  337. this.curDateType = this.warehousingMaterialList[this.curIndex]
  338. ?.warehouseLedgerDetails[0].procurementTime
  339. ? "procurementTime"
  340. : "manufactureTime";
  341. }
  342. },
  343. methods: {
  344. handleDateChange(item) {
  345. // 组件补时分秒
  346. this.$nextTick(() => {
  347. if (item[this.curDateType] && item[this.curDateType].length < 19) {
  348. item[this.curDateType] =
  349. item[this.curDateType].split(" ")[0] + " 00:00:00";
  350. }
  351. console.log(item, item[this.curDateType]);
  352. this.forceUpdate = !this.forceUpdate;
  353. });
  354. },
  355. cancel() {
  356. if (this.isScan) {
  357. // 扫码取消删除
  358. this.warehousingMaterialList.splice(this.curIndex, 1);
  359. } else {
  360. this.warehousingMaterialList[this.curIndex].warehouseLedgerDetails = [];
  361. }
  362. uni.navigateBack({
  363. delta: 1,
  364. });
  365. },
  366. handleSave() {
  367. if (
  368. !this.warehousingMaterialList[this.curIndex]?.warehouseLedgerDetails
  369. ?.length
  370. ) {
  371. uni.showToast({
  372. title: "请完善必填信息",
  373. icon: "none",
  374. });
  375. return;
  376. }
  377. const fileds = [`cargoSpaceCode`, `batchNum`];
  378. if (this.bizScene != 5) {
  379. fileds.push(...[`outInNum`, `measurementUnit`]);
  380. } else if (
  381. this.warehousingMaterialList.some(
  382. (i) => !i.selfWarehouseLedgerDetails?.length
  383. )
  384. ) {
  385. uni.showToast({
  386. title: "请选择资产编号!",
  387. icon: "none",
  388. });
  389. return;
  390. }
  391. Promise.all(
  392. fileds.map(
  393. (item) =>
  394. new Promise(async (resolve, rej) => {
  395. this.$refs.lisrFormRef.validateField(item, (err) => {
  396. if (err?.length) {
  397. rej(err);
  398. } else {
  399. resolve();
  400. }
  401. });
  402. })
  403. )
  404. )
  405. .then(async (res) => {
  406. uni.showLoading({
  407. mask: true,
  408. });
  409. // 清空另一个时间
  410. this.warehousingMaterialList[
  411. this.curIndex
  412. ].warehouseLedgerDetails.map((item) => {
  413. item[
  414. this.curDateType == "manufactureTime"
  415. ? "procurementTime"
  416. : "manufactureTime"
  417. ] = "";
  418. });
  419. uni.hideLoading();
  420. uni.$emit("batchNumBack", this.warehousingMaterialList);
  421. uni.navigateBack({
  422. delta: 1,
  423. });
  424. })
  425. .catch((err) => {
  426. uni.showToast({
  427. icon: "error",
  428. title: "请完善必填项!",
  429. });
  430. });
  431. },
  432. // 选择资产编号
  433. chooseAssets() {
  434. const row = this.warehousingMaterialList[this.curIndex];
  435. this.$refs.returnSelectRef.open(row, (res) => {
  436. this.unpdateMaterialCode();
  437. row.outInNum = res.length;
  438. this.$set(
  439. row,
  440. "selfWarehouseLedgerDetails",
  441. res.map((i) => {
  442. delete i.updateTime;
  443. delete i.createTime;
  444. return i;
  445. })
  446. );
  447. });
  448. },
  449. confirm() {
  450. if (!this.batchTime) {
  451. uni.showToast({
  452. title: "请选择时间",
  453. icon: "none",
  454. });
  455. return;
  456. }
  457. this.warehousingMaterialList[
  458. this.curIndex
  459. ]?.warehouseLedgerDetails.forEach((item, index) => {
  460. if (!!this.selection.find((i) => i == index)) {
  461. if (this.batchTime && this.batchTime.length < 19) {
  462. this.batchTime = this.batchTime.split(" ")[0] + " 00:00:00";
  463. }
  464. item[this.curDateType] = this.batchTime;
  465. }
  466. });
  467. this.popupShow = false;
  468. },
  469. setDate() {
  470. if (!this.selection.length) {
  471. uni.showToast({
  472. title: "请选择明细",
  473. icon: "none",
  474. });
  475. return;
  476. }
  477. this.popupShow = true;
  478. },
  479. selectionChange(val) {
  480. console.log(val.detail.value);
  481. this.selection = val.detail.value;
  482. },
  483. //获取仓库信息
  484. handleWarehouseChoose() {
  485. this.$refs.warehouseChooseRef.open(null, (res) => {
  486. for (const key in res) {
  487. this.$set(this.warehousingMaterialList[this.curIndex], key, res[key]);
  488. }
  489. this.unpdateMaterialCode();
  490. this.forceUpdate = !this.forceUpdate;
  491. });
  492. },
  493. //跳转回添加页面
  494. jumpAdd() {
  495. uni.$emit(
  496. "setSelectList",
  497. this.listData.filter((item) => item.checked)
  498. );
  499. uni.navigateBack();
  500. },
  501. //返回添加页
  502. backAdd() {
  503. uni.navigateBack();
  504. },
  505. // 更新条码信息
  506. unpdateMaterialCode() {
  507. console.log("unpdateMaterialCode");
  508. clearTimeout(timer);
  509. timer = setTimeout(() => {
  510. this.getMaterialCode();
  511. }, 500);
  512. },
  513. // 入库明细生成条码信息
  514. async getMaterialCode() {
  515. console.log("getMaterialCode");
  516. const fileds = [`cargoSpaceCode`, `batchNum`];
  517. if (this.bizScene != 5) {
  518. fileds.push(...[`outInNum`, `measurementUnit`]);
  519. } else if (
  520. this.warehousingMaterialList.some(
  521. (i) => !i.selfWarehouseLedgerDetails?.length
  522. )
  523. ) {
  524. // uni.showToast({
  525. // title: '请选择资产编号!',
  526. // icon: 'none'
  527. // })
  528. return;
  529. }
  530. Promise.all(
  531. fileds.map(
  532. (item) =>
  533. new Promise(async (resolve, rej) => {
  534. this.$refs.lisrFormRef.validateField(item, (err) => {
  535. if (err?.length) {
  536. rej(err);
  537. } else {
  538. resolve();
  539. }
  540. });
  541. })
  542. )
  543. )
  544. .then(async (res) => {
  545. this.showLoading = true;
  546. lastNum++;
  547. this.$set(
  548. this.warehousingMaterialList[this.curIndex],
  549. "isSave",
  550. true
  551. );
  552. if (this.bizScene != 5) {
  553. await this.createMaterialCode(
  554. this.warehousingMaterialList[this.curIndex],
  555. lastNum
  556. );
  557. } else {
  558. // 退还
  559. await this.createMaterialCodeReturn(
  560. this.warehousingMaterialList[this.curIndex],
  561. lastNum
  562. );
  563. }
  564. this.showLoading = false;
  565. })
  566. .catch((err) => {
  567. // uni.showToast({
  568. // icon: 'error',
  569. // title: '请填入必填项!'
  570. // })
  571. });
  572. },
  573. // 入库明细生成条码信息
  574. async createMaterialCode(row, curNum) {
  575. // 添加相同物品重新更新明细 原料编码
  576. const list = this.warehousingMaterialList.filter(
  577. (i) =>
  578. i.assetCode === row.assetCode &&
  579. i.batchNum === row.batchNum &&
  580. i.isSave
  581. );
  582. const num = list.reduce((num, pre, index) => {
  583. num += row.isUnpack ? pre.outInNum * pre.measurementUnit : pre.outInNum;
  584. return num;
  585. }, 0);
  586. const res = await postJ(this.apiUrl + "/outInWarehouse/getAssetNum", {
  587. batchNum: row.batchNum,
  588. assetCode: row.assetCode,
  589. num,
  590. });
  591. if (res?.success && lastNum === curNum) {
  592. list.forEach((item) => {
  593. let len = item.isUnpack
  594. ? item.outInNum * item.measurementUnit
  595. : +item.outInNum;
  596. this.$set(
  597. item,
  598. "warehouseLedgerDetails",
  599. Array.from(new Array(len), (val, idx) => {
  600. return {
  601. ...item,
  602. onlyCode: res.data.shift().onlyCode,
  603. bizStatus: 1,
  604. contentImage: [],
  605. };
  606. })
  607. );
  608. });
  609. }
  610. // 添加相同物品,重复批次号 重新更新明细 包装编码
  611. const batchList = this.warehousingMaterialList.filter(
  612. (i) => i.batchNum == row.batchNum && i.isSave
  613. );
  614. if (batchList.length) {
  615. const num = batchList.reduce((num, pre) => {
  616. num += +pre.outInNum;
  617. return num;
  618. }, 0);
  619. const res1 = await postJ(this.apiUrl + "/outInWarehouse/getAssetNum", {
  620. batchNum: row.batchNum,
  621. num,
  622. });
  623. if (res1?.success && lastNum === curNum) {
  624. batchList.forEach((item) => {
  625. let num = res1.data.shift()?.num;
  626. let measurementUnit = item.measurementUnit;
  627. if (item.warehouseLedgerDetails?.length) {
  628. item.warehouseLedgerDetails.forEach((i, index) => {
  629. this.$set(i, "num", num);
  630. if (!item.isUnpack) {
  631. if (index < item.warehouseLedgerDetails.length - 1) {
  632. num = res1.data.shift()?.num;
  633. }
  634. } else {
  635. // 拆包的包装编码一致
  636. measurementUnit--;
  637. if (
  638. measurementUnit === 0 &&
  639. index < item.warehouseLedgerDetails.length - 1
  640. ) {
  641. measurementUnit = item.measurementUnit;
  642. num = res1.data.shift()?.num;
  643. }
  644. }
  645. });
  646. }
  647. });
  648. }
  649. }
  650. this.page = 1;
  651. this.forceUpdate = !this.forceUpdate;
  652. },
  653. // 入库明细生成条码信息 退还
  654. async createMaterialCodeReturn(row, curNum) {
  655. // 添加相同物品重新更新明细 原料编码
  656. const list = this.warehousingMaterialList.filter(
  657. (i) => i.assetCode === row.assetCode && i.batchNum === row.batchNum
  658. );
  659. // 退还
  660. const res = await postJ(this.apiUrl + "/outInWarehouse/getAssetNum", {
  661. batchNum: row.batchNum,
  662. num: list.reduce((num, pre) => {
  663. num += pre.selfWarehouseLedgerDetails.length;
  664. return num;
  665. }, 0),
  666. });
  667. if (res?.success && lastNum === curNum) {
  668. list.forEach((item) => {
  669. let num = res.data.shift().num;
  670. let measurementUnit = item.measurementUnit;
  671. if (item.warehouseLedgerDetails?.length) {
  672. item.warehouseLedgerDetails.forEach((i) => {
  673. Object.assign(i, {
  674. num,
  675. batchNum: item.batchNum,
  676. cargoSpaceCode: item.cargoSpaceCode, //货位编码
  677. cargoSpaceId: item.cargoSpaceId, //货位id
  678. shelfId: item.shelfId, //货架id
  679. shelfCode: item.shelfCode, //货架名称
  680. areaId: item.areaId, //库区id
  681. areaName: item.areaName, //库区名称
  682. warehouseId: item.warehouseId, //仓库id
  683. warehouseName: item.warehouseName, //仓库名称
  684. });
  685. if (!item.isUnpack) {
  686. // 拆包的包装编码一致
  687. num = res.data.shift()?.num;
  688. } else {
  689. measurementUnit--;
  690. if (measurementUnit === 0) {
  691. measurementUnit = item.measurementUnit;
  692. num = res1.data.shift()?.num;
  693. }
  694. }
  695. });
  696. } else {
  697. this.$set(
  698. item,
  699. "warehouseLedgerDetails",
  700. item.selfWarehouseLedgerDetails.map((val, idx) => {
  701. let obj = {
  702. ...val,
  703. bizStatus: 1,
  704. batchNum: item.batchNum,
  705. measurementUnit: item.measurementUnit,
  706. cargoSpaceCode: item.cargoSpaceCode, //货位编码
  707. cargoSpaceId: item.cargoSpaceId, //货位id
  708. shelfId: item.shelfId, //货架id
  709. shelfCode: item.shelfCode, //货架名称
  710. areaId: item.areaId, //库区id
  711. areaName: item.areaName, //库区名称
  712. warehouseId: item.warehouseId, //仓库id
  713. warehouseName: item.warehouseName, //仓库名称
  714. materialId: item.materialId,
  715. num,
  716. };
  717. if (!item.isUnpack) {
  718. // 拆包的包装编码一致
  719. num = res.data.shift()?.num;
  720. } else {
  721. measurementUnit--;
  722. if (measurementUnit === 0) {
  723. measurementUnit = item.measurementUnit;
  724. num = res1.data.shift()?.num;
  725. }
  726. }
  727. return obj;
  728. })
  729. );
  730. }
  731. });
  732. this.forceUpdate = !this.forceUpdate;
  733. }
  734. },
  735. },
  736. };
  737. </script>
  738. <style lang="scss" scoped>
  739. .mainBox {
  740. .time-container {
  741. padding: 20rpx 60rpx 40rpx;
  742. margin-bottom: 60rpx;
  743. .title {
  744. font-size: 32rpx;
  745. text-align: center;
  746. margin-bottom: 30rpx;
  747. }
  748. }
  749. .time-footer {
  750. display: flex;
  751. justify-content: space-between;
  752. }
  753. .wrapper {
  754. padding-top: 10px;
  755. position: relative;
  756. .operation {
  757. display: flex;
  758. justify-content: flex-end;
  759. padding: 0 10rpx;
  760. text {
  761. padding: 10rpx;
  762. }
  763. .u-button {
  764. width: 200rpx;
  765. margin: 0 !important;
  766. }
  767. }
  768. .self-table {
  769. width: 100%;
  770. .self-tr {
  771. width: 100%;
  772. display: flex;
  773. justify-content: space-between;
  774. align-items: center;
  775. padding: 10rpx 10rpx;
  776. font-size: 28rpx;
  777. box-sizing: border-box;
  778. min-height: 100rpx;
  779. &.bg {
  780. background-color: rgba(245, 245, 245, 1);
  781. border-bottom: 1rpx solid rgba(0, 0, 0, 0.2);
  782. }
  783. .check {
  784. width: 80rpx;
  785. text-align: center;
  786. }
  787. .code {
  788. width: 28%;
  789. word-break: break-all;
  790. }
  791. .num {
  792. width: 18%;
  793. text-align: center;
  794. }
  795. .date-picker {
  796. flex: 1;
  797. /deep/.uni-date,
  798. .uni-stat__select {
  799. width: 100% !important;
  800. .uni-icons {
  801. display: none;
  802. }
  803. .uni-date-x {
  804. padding: 0 10rpx !important;
  805. }
  806. .uni-date__x-input {
  807. font-size: 28rpx;
  808. padding: 0 !important;
  809. }
  810. }
  811. }
  812. }
  813. }
  814. .title {
  815. padding-left: 20rpx;
  816. margin-bottom: 20rpx;
  817. }
  818. .cell {
  819. display: flex;
  820. padding: 0 20rpx;
  821. justify-content: space-between;
  822. align-items: center;
  823. margin-bottom: 10rpx;
  824. .label {
  825. font-size: 28rpx;
  826. font-weight: bold;
  827. }
  828. .cargoSpaceCode {
  829. width: 100%;
  830. padding: 10rpx 0;
  831. text-align: right;
  832. }
  833. .uni-easyinput {
  834. border: 1rpx solid #ccc;
  835. }
  836. /deep/.u-form-item {
  837. .u-form-item__body__left {
  838. font-weight: bold;
  839. color: #333;
  840. }
  841. .u-form-item__body__left__content__label {
  842. font-size: 28rpx !important;
  843. }
  844. .u-form-item__body {
  845. padding: 0 !important;
  846. }
  847. }
  848. .u-input {
  849. border: 1rpx solid rgba(222, 222, 222, 1) !important;
  850. }
  851. }
  852. .bucket-col {
  853. display: flex;
  854. padding: 20rpx 20rpx;
  855. background-color: #f5f5f5;
  856. justify-content: space-between;
  857. align-items: center;
  858. font-size: 28rpx;
  859. /deep/.date {
  860. color: #aaaaaa;
  861. display: flex;
  862. align-items: center;
  863. .name {
  864. margin-right: 20rpx;
  865. }
  866. .uni-date__x-input {
  867. height: 60rpx;
  868. width: 180rpx;
  869. }
  870. }
  871. }
  872. }
  873. }
  874. </style>