newPackingBomDetails.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053
  1. <template>
  2. <view>
  3. <view class="col userInp" style="display: flex; align-items: center">
  4. <text class="label lable150 rx-cc">规格选择:</text>
  5. <!-- multiple -->
  6. <view>{{ objData.packInfo ? objData.packInfo.specText : "" }}</view>
  7. </view>
  8. <view class="col userInp" style="display: flex; align-items: center">
  9. <text class="label lable150 rx-cc">包装选择:</text>
  10. <!-- multiple -->
  11. <zxz-uni-data-select
  12. :localdata="warehouseSpecTypeList"
  13. v-model="warehouseId"
  14. @change="changeWarehouseType"
  15. disabled
  16. ></zxz-uni-data-select>
  17. </view>
  18. <view v-if="warehouseId != 1">
  19. <view v-for="(item, i) in DispositionList" :key="i">
  20. <view class="title_box rx-bc">
  21. <!-- 最小包装单元 -->
  22. <view class="name">{{ item.titel }}</view>
  23. <!-- <view class="btn_box rx-bc" @click="handCancelPacking">
  24. 重置打包
  25. </view> -->
  26. </view>
  27. <view class="material">
  28. <view class="content_table">
  29. <view class="item">
  30. <view class="lable rx-cc">包装总数 </view>
  31. <view class="content content_num">
  32. <input
  33. class="uni-input"
  34. v-model="formedNumLast"
  35. type="number"
  36. disabled
  37. @input="changeinput"
  38. />
  39. <view class="unit">{{ item.packageUnit }}</view>
  40. </view>
  41. </view>
  42. <view class="item rx-sc">
  43. <view class="rx ww55">
  44. <view class="lable lable150 rx-cc">{{ item.titel }}单元</view>
  45. <view class="content content_num">
  46. <input
  47. class="uni-input"
  48. v-model="item.packageCell"
  49. disabled
  50. />
  51. <view style="max-width: 100rpx; font-size: 24rpx">{{
  52. item.packageUnit
  53. }}</view>
  54. </view>
  55. </view>
  56. <view class="rx ww45">
  57. <view class="rx-cc ww80">
  58. /<view style="max-width: 100rpx; font-size: 24rpx">{{
  59. item.conversionUnit
  60. }}</view>
  61. </view>
  62. <view class="content rx-sc">
  63. <!-- <zxz-uni-data-select :localdata="unitList" v-model="unit" dataValue='Key'
  64. format='{Value}' dataKey="Key" filterable :clear='false'></zxz-uni-data-select> -->
  65. <!-- <view class="penalize" @click="handleSplit">确认</view> -->
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="content_table2" v-if="item.splitList.length">
  71. <view class="head row rx-sc">
  72. <view class="item ww10">序号</view>
  73. <view class="item ww15">数量</view>
  74. <view class="item ww20">类型</view>
  75. <view class="item ww20">包装层级</view>
  76. <!-- <view class="item ww20">计量数</view> -->
  77. <view class="item ww40">包装编码</view>
  78. <!-- <view class="item ww10 jsColor" @click="calculation()" v-if="clientEnvironmentId != 3">计算</view>
  79. <view class="item ww10" v-if="clientEnvironmentId == 3"></view> -->
  80. </view>
  81. <view class="table">
  82. <u-list
  83. @scrolltolower="scrolltolower"
  84. class="z_list"
  85. style="height: 100% !important"
  86. >
  87. <view
  88. class="tr row rx-sc"
  89. v-for="(it, idx) in item.splitList"
  90. :key="idx"
  91. >
  92. <view class="item ww10 rx-cc">{{ idx + 1 }}</view>
  93. <view class="item ww15 rx-sc">
  94. <view> {{ it.feedQuantity }}</view>
  95. </view>
  96. <view class="item ww20 rx-sc">
  97. <view v-if="it.rootCategoryLevelId == 2">在制品</view>
  98. <view v-else-if="it.rootCategoryLevelId == 23">半成品</view>
  99. <view v-else-if="it.rootCategoryLevelId == 9">产品</view>
  100. <view v-else-if="it.rootCategoryLevelId == 28">废品</view>
  101. <view v-else>{{ "" }}</view>
  102. </view>
  103. <view class="item ww20 rx-cc">
  104. <view v-if="it.packingType == 4">外包装</view>
  105. <view v-else-if="it.packingType == 2">最小包装</view>
  106. <view v-else-if="it.packingType == 3">内包装</view>
  107. <view v-else>计量</view>
  108. </view>
  109. <view class="item ww40">
  110. {{ it.packingCode }}
  111. </view>
  112. </view>
  113. </u-list>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. <SearchPopup mode="center" v-if="show">
  120. <template v-slot:list>
  121. <view class="search_list">
  122. <u-form
  123. labelPosition="left"
  124. :model="formData"
  125. labelWidth="180"
  126. labelAlign="left"
  127. class="baseForm"
  128. >
  129. <u-form-item
  130. label="外包装数:"
  131. class="required-form"
  132. borderBottom
  133. prop="assetType"
  134. >
  135. <input
  136. class="uni-input"
  137. v-model="formData.wPackNum"
  138. style="width: 280rpx"
  139. placeholder="外包装数"
  140. />
  141. / {{ splitList[0].unit }}
  142. </u-form-item>
  143. </u-form>
  144. </view>
  145. </template>
  146. <template v-slot:operate>
  147. <view class="operate_box rx-bc">
  148. <u-button
  149. size="small"
  150. class="u-reset-button"
  151. @click="calculationClose()"
  152. >
  153. 取消
  154. </u-button>
  155. <u-button
  156. type="success"
  157. size="small"
  158. class="u-reset-button"
  159. @click="calculationReset()"
  160. >
  161. 重置
  162. </u-button>
  163. <u-button
  164. type="success"
  165. size="small"
  166. class="u-reset-button"
  167. @click="calculationSave()"
  168. >
  169. 确定
  170. </u-button>
  171. </view>
  172. </template>
  173. </SearchPopup>
  174. </view>
  175. </template>
  176. <script>
  177. import { getByCode } from "@/api/pda/common.js";
  178. import {
  179. cancelPacking,
  180. packingReport,
  181. getPackingReport,
  182. packingReportRepeat,
  183. packageDisposition,
  184. getPackingReportRepeat,
  185. getPackingList,
  186. } from "@/api/pda/workOrder.js";
  187. import SearchPopup from "../../components/searchPopup.vue";
  188. export default {
  189. components: {
  190. SearchPopup,
  191. },
  192. props: {
  193. categoryId: {
  194. type: String,
  195. default: "",
  196. },
  197. objData: {
  198. type: Object,
  199. default: () => {},
  200. },
  201. taskId: {
  202. type: String,
  203. default: "",
  204. },
  205. workOrderId: {
  206. type: String,
  207. default: "",
  208. },
  209. },
  210. data() {
  211. return {
  212. formedNumLast: 0,
  213. quantity: "",
  214. unit: "",
  215. Usertype: "", // 规格
  216. unitList: [],
  217. resObj: {},
  218. splitList: [],
  219. localdataList: [],
  220. newDispositionList: [],
  221. withinQuantity: "", //内包装数量
  222. withinUnit: "", //内包装单位
  223. outsideQuantity: "", //外包装数量
  224. outsideUnit: "", //外包装单位
  225. timeout: null,
  226. packUnit: null,
  227. temporaryNum: 0,
  228. temporaryCount: 0,
  229. temporaryList: [],
  230. packTwoList: [],
  231. DispositionList: [],
  232. selectList: [],
  233. text: "",
  234. value: "",
  235. minimumPackage: [], // 最小包装
  236. withinPackage: [], // 内包装
  237. minimumUnit: "",
  238. outsidePackage: [], //外包装
  239. newCategoryId: "",
  240. warehouseId: 2,
  241. warehouseSpecTypeList: [
  242. {
  243. text: "按计量",
  244. value: 1,
  245. },
  246. {
  247. text: "最小包装",
  248. value: 2,
  249. },
  250. {
  251. text: "内包装",
  252. value: 3,
  253. },
  254. {
  255. text: "外包装",
  256. value: 4,
  257. },
  258. ],
  259. show: false,
  260. formData: {
  261. wPackNum: null,
  262. },
  263. clientEnvironmentId:
  264. uni.getStorageSync("userInfo") &&
  265. uni.getStorageSync("userInfo").clientEnvironmentId,
  266. };
  267. },
  268. created() {
  269. // this.formedNumLast = this.objData.product[0].feedQuantity;
  270. console.log(this.objData, "我是阿打啥啊电话");
  271. // this.byCode();
  272. this.packageDispositionFn();
  273. if (this.objData.packInfo) {
  274. this.warehouseId = this.objData.packInfo.tier;
  275. this.DispositionList.push({
  276. titel: "最小包装",
  277. splitList: this.objData.packInfo.minimumPackage,
  278. packageCell: this.objData.packInfo.minimumPackageCell,
  279. packageUnit: this.objData.packInfo.minimumPackageUnit,
  280. conversionUnit: this.objData.packInfo.minimumConversionUnit,
  281. });
  282. this.formedNumLast = this.objData.packInfo.minimumPackage.reduce(
  283. (acc, pro) => {
  284. return pro.feedQuantity ? acc + Number(pro.feedQuantity) : acc;
  285. },
  286. 0
  287. );
  288. }
  289. // this.getPackingDetails()
  290. // this.getPackingDetailsTwo()
  291. },
  292. methods: {
  293. // 输入数量变化
  294. changeinput(e) {
  295. clearTimeout(this.timeout);
  296. // 设置新的定时器
  297. this.timeout = setTimeout(() => {
  298. this.formedNumLast = e.detail.value;
  299. this.initFn(this.selectList);
  300. }, 500); // 500毫秒后触发
  301. },
  302. changeUserType(e) {
  303. console.log(e);
  304. this.text = e.text;
  305. this.value = e.value;
  306. this.selectList = e.arr;
  307. this.initFn(e.arr);
  308. },
  309. groupBy(arr, key) {
  310. return arr.reduce((acc, obj) => {
  311. const groupKey = obj[key];
  312. if (!acc[groupKey]) {
  313. acc[groupKey] = [];
  314. }
  315. console.log();
  316. acc[groupKey].push(obj);
  317. return acc;
  318. }, {});
  319. },
  320. async packageDispositionFn() {
  321. console.log(this.categoryId, "555555555555");
  322. let that = this;
  323. const res = await packageDisposition(this.categoryId);
  324. if (res.length) {
  325. res.shift();
  326. let data = JSON.parse(JSON.stringify(res));
  327. let list = this.groupBy(data, "code");
  328. this.localdataList = [];
  329. Object.entries(list).forEach(([key, value]) => {
  330. let obj = {
  331. text: value[0].name,
  332. arr: value,
  333. value: key,
  334. };
  335. this.localdataList.push(obj);
  336. });
  337. this.Usertype = this.localdataList[0].value;
  338. this.text = this.localdataList[0].text;
  339. this.value = this.localdataList[0].value;
  340. // res.map((v) => {
  341. // v.splitList = [];
  342. // });
  343. // // this.newDispositionList = res;
  344. // if (this.warehouseId == 2) {
  345. // this.newDispositionList = [res[0]];
  346. // } else if (this.warehouseId == 3) {
  347. // this.newDispositionList = [res[1]];
  348. // } else if (this.warehouseId == 4) {
  349. // this.newDispositionList = [res[2]];
  350. // }
  351. // this.selectList = res;
  352. // this.initFn(this.localdataList[0].arr);
  353. // this.listFn(this.localdataList[0].arr);
  354. }
  355. },
  356. initFn(v) {
  357. if (v.length) {
  358. this.withinQuantity = v[1].packageCell; //内包装数量
  359. this.withinUnit = v[1].conversionUnit; //内包装单位
  360. this.outsideQuantity = v[2].packageCell; //外包装数量
  361. this.outsideUnit = v[2].conversionUnit; //外包装单位
  362. this.minimumUnit = v[0].conversionUnit;
  363. }
  364. console.log("几次", v);
  365. this.handleSplit(v[0]);
  366. },
  367. async listFn(res) {
  368. let {
  369. minimumPackage,
  370. withinQuantity,
  371. outsidePackage,
  372. outsideQuantity,
  373. withinPackage,
  374. } = res;
  375. // let textList = ["最小包装", "内包装", "外包装"];
  376. // let arr = [
  377. // { list: minimumPackage },
  378. // { list: withinPackage, num: withinQuantity },
  379. // { list: outsidePackage, num: outsideQuantity },
  380. // ];
  381. let textList = [];
  382. let arr = [];
  383. if (this.warehouseId == 2) {
  384. textList.push("最小包装");
  385. arr.push({ list: minimumPackage });
  386. } else if (this.warehouseId == 3) {
  387. textList.push("内包装");
  388. arr.push({ list: withinPackage, num: withinQuantity });
  389. } else if (this.warehouseId == 4) {
  390. textList.push("外包装");
  391. arr.push({ list: outsidePackage, num: outsideQuantity });
  392. }
  393. this.minimumPackage = minimumPackage; // 最小包装
  394. this.withinPackage = withinPackage; // 内包装
  395. this.outsidePackage = outsidePackage; //外包装
  396. // this.newDispositionList.map((v, i) => {
  397. // v.splitList = arr[i].list;
  398. // v.titel = textList[i];
  399. // if (i == 0) {
  400. // v.formedNumLast = this.formedNumLast;
  401. // } else {
  402. // v.formedNumLast = arr[i].num;
  403. // }
  404. // });
  405. this.newDispositionList.map((v, i) => {
  406. v.splitList = arr[0].list;
  407. v.titel = textList[0];
  408. if (i == 0) {
  409. v.formedNumLast = this.formedNumLast;
  410. } else {
  411. v.formedNumLast = arr.num;
  412. }
  413. });
  414. this.$nextTick(() => {
  415. console.log(this.DispositionList, "我是啥来着");
  416. this.$set(this, "DispositionList", this.newDispositionList);
  417. });
  418. },
  419. sunNum(v, i) {
  420. let _this = this;
  421. this.$nextTick(() => {
  422. switch (i) {
  423. case 0:
  424. console.log(_this.formedNumLast);
  425. return _this.formedNumLast;
  426. case 1:
  427. return v.splitList.length || 0;
  428. case 2:
  429. return v.splitList.length || 0;
  430. }
  431. });
  432. },
  433. byCode() {
  434. getByCode("packing_unit").then((res) => {
  435. this.unitList = [];
  436. res.forEach((obj, index) => {
  437. for (let key in obj) {
  438. if (obj.hasOwnProperty(key)) {
  439. // 确保key是对象自身的属性
  440. this.unitList.push({
  441. Key: `${key}`,
  442. Value: ` ${obj[key]}`,
  443. });
  444. }
  445. }
  446. });
  447. });
  448. },
  449. getPackingDetails() {
  450. let param = {
  451. workOrderId: this.workOrderId,
  452. taskId: this.taskId,
  453. tier: 1,
  454. };
  455. getPackingReport(param).then((res) => {
  456. this.splitList = res.detailList;
  457. this.formedNumLast = res.totalQuantity;
  458. this.quantity = res.quantity;
  459. this.unit = res.unit;
  460. });
  461. },
  462. handCancelPacking() {
  463. uni.showModal({
  464. title: `是否清空包装?`,
  465. content: "",
  466. confirmText: "确认",
  467. success: () => {
  468. let param = {
  469. workOrderId: this.workOrderId,
  470. taskId: this.taskId,
  471. };
  472. cancelPacking(param).then((res) => {
  473. this.getPackingDetails();
  474. this.getPackingDetailsTwo();
  475. });
  476. },
  477. });
  478. },
  479. // 第一次调用
  480. handleSplit(v) {
  481. if (this.splitList.length) {
  482. uni.showToast({
  483. title: "产品已分包",
  484. icon: "none",
  485. });
  486. return false;
  487. }
  488. // if (!this.formedNumLast) {
  489. // uni.showToast({
  490. // title: '包装总数数量不能为空',
  491. // icon: 'none'
  492. // })
  493. // return false
  494. // }
  495. if (!v.packageCell) {
  496. uni.showToast({
  497. title: "内包装单元数量不能为空",
  498. icon: "none",
  499. });
  500. return false;
  501. }
  502. if (!v.packageUnit) {
  503. uni.showToast({
  504. title: "请选择包装单位",
  505. icon: "none",
  506. });
  507. return false;
  508. }
  509. let param = {
  510. workOrderId: this.workOrderId, //工单id
  511. taskId: this.taskId,
  512. tier: this.warehouseId,
  513. totalQuantity: this.formedNumLast, //总数量
  514. quantity: v.packageCell, //数量
  515. unit: v.packageUnit, //单位
  516. minimumUnit: this.minimumUnit, //最小包装单位
  517. withinQuantity: this.withinQuantity, //内包装数量
  518. withinUnit: this.withinUnit, //内包装单位
  519. outsideQuantity: this.outsideQuantity, //外包装数量
  520. outsideUnit: this.outsideUnit, //外包装单位
  521. packageUnit: v.conversionUnit,
  522. };
  523. // packingReport(param).then((res) => {
  524. // this.listFn(res);
  525. // });
  526. if (this.warehouseId != 1) {
  527. getPackingList(param).then((res) => {
  528. this.listFn(res);
  529. });
  530. }
  531. // getPackingList(param).then((res) => {
  532. // this.listFn(res);
  533. // });
  534. },
  535. handleCheck(idx, it) {
  536. if (it.quantity <= 0) {
  537. uni.showToast({
  538. icon: "none",
  539. title: "数量为空不能勾选",
  540. });
  541. return false;
  542. }
  543. this.$set(this.splitList[idx], "check", it.check ? 0 : 1);
  544. this.temporaryList = [];
  545. this.temporaryList = this.splitList.filter((e) => {
  546. return e.check == 1;
  547. });
  548. this.temporaryNum = 0;
  549. this.temporaryCount = 0;
  550. if (this.temporaryList.length > 0) {
  551. this.temporaryList.forEach((e) => {
  552. this.temporaryNum = this.temporaryNum + 1;
  553. this.temporaryCount = this.temporaryCount + Number(e.quantity);
  554. });
  555. }
  556. },
  557. handclose(it) {
  558. this.splitList.forEach((f) => {
  559. if (f.computeSize == it.computeSize) {
  560. f.check = 0;
  561. }
  562. });
  563. this.temporaryList = [];
  564. this.temporaryList = this.splitList.filter((e) => {
  565. return e.check == 1;
  566. });
  567. },
  568. getPackingDetailsTwo(v) {
  569. console.log(v);
  570. let param = {
  571. totalQuantity: v.formedNumLast,
  572. quantity: v.packageCell,
  573. unit: v.conversionUnit,
  574. workOrderId: this.workOrderId,
  575. taskId: this.taskId,
  576. tier: 2,
  577. };
  578. getPackingReportRepeat(param).then((res) => {
  579. resolve(res.detailList);
  580. });
  581. },
  582. handlePack(v, s) {
  583. let _arr = [];
  584. _arr = s.map((m) => {
  585. return {
  586. ...m,
  587. isChecked: 1,
  588. };
  589. });
  590. console.log(_arr, "123");
  591. let param = {
  592. detailList: _arr,
  593. quantity: v.temporaryCount,
  594. totalQuantity: v.formedNumLast,
  595. unit: v.packageUnit,
  596. taskId: this.taskId,
  597. workOrderId: this.workOrderId,
  598. tier: 2,
  599. };
  600. return new Promise((resolve, reject) => {
  601. packingReportRepeat(param).then((res) => {
  602. console.log(res);
  603. // this.temporaryList = []
  604. this.getPackingDetails();
  605. // this.getPackingDetailsTwo()
  606. });
  607. });
  608. },
  609. scrolltolower() {},
  610. getData() {
  611. let _packingReportMarginList = [];
  612. _packingReportMarginList = this.splitList.filter((e) => {
  613. return !e.parentId;
  614. });
  615. console.log(this.DispositionList);
  616. // let packInfo = {
  617. // this.DispositionList[0]
  618. // specText: this.text,
  619. // specValue: this.value,
  620. // minimumPackage: this.minimumPackage, // 最小包装
  621. // minimumPackageCell: this.DispositionList[0].packageCell, // 最小包装
  622. // minimumPackageUnit: this.DispositionList[0].packageUnit, // 最小包装单位
  623. // minimumConversionUnit: this.DispositionList[0].conversionUnit, // 最小包装单位
  624. // minimumFormedNumLast: this.DispositionList[0].formedNumLast, // 总包装数量
  625. // withinPackage: this.withinPackage, // 内包装
  626. // withinPackageCell: this.DispositionList[1].packageCell, // 最小包装名称
  627. // withinPackageUnit: this.DispositionList[1].packageUnit, // 最小包装单位
  628. // withinConversionUnit: this.DispositionList[1].conversionUnit, // 最小包装单位
  629. // withinFormedNumLast: this.DispositionList[1].formedNumLast, // 总包装数量
  630. // // packingReportList: this.packTwoList,
  631. // // packingReportMarginList: _packingReportMarginList,
  632. // outsidePackage: this.outsidePackage, //外包装
  633. // outsidePackageCell: this.DispositionList[2].packageCell, // 最小包装名称
  634. // outsidePackageUnit: this.DispositionList[2].packageUnit, // 最小包装单位
  635. // outsideConversionUnit: this.DispositionList[2].conversionUnit, // 最小包装单位
  636. // outsideFormedNumLast: this.DispositionList[2].formedNumLast, // 总包装数量
  637. // };
  638. let packInfo = {};
  639. if (this.warehouseId == 2) {
  640. if (this.DispositionList && this.DispositionList.length != 0) {
  641. packInfo = {
  642. // this.DispositionList[0]
  643. specText: this.span,
  644. specValue: this.value,
  645. minimumPackage: this.minimumPackage, // 最小包装
  646. tier: this.warehouseId,
  647. minimumPackageCell: this.DispositionList[0].packageCell, // 最小包装
  648. minimumPackageUnit: this.DispositionList[0].packageUnit, // 最小包装单位
  649. minimumConversionUnit: this.DispositionList[0].conversionUnit, // 最小包装单位
  650. minimumFormedNumLast: this.DispositionList[0].formedNumLast, // 总包装数量
  651. };
  652. } else {
  653. packInfo = {};
  654. }
  655. } else if (this.warehouseId == 3) {
  656. if (this.DispositionList && this.DispositionList.length != 0) {
  657. packInfo = {
  658. withinPackage: this.withinPackage, // 内包装
  659. tier: this.warehouseId,
  660. withinPackageCell: this.DispositionList[0].packageCell, // 最小包装名称
  661. withinPackageUnit: this.DispositionList[0].packageUnit, // 最小包装单位
  662. withinConversionUnit: this.DispositionList[0].conversionUnit, // 最小包装单位
  663. withinFormedNumLast: this.DispositionList[0].formedNumLast,
  664. };
  665. } else {
  666. packInfo = {};
  667. } // 总包装数量
  668. } else if (this.warehouseId == 4) {
  669. if (this.DispositionList && this.DispositionList.length != 0) {
  670. packInfo = {
  671. outsidePackage: this.outsidePackage, //外包装
  672. tier: this.warehouseId,
  673. outsidePackageCell: this.DispositionList[0].packageCell, // 最小包装名称
  674. outsidePackageUnit: this.DispositionList[0].packageUnit, // 最小包装单位
  675. outsideConversionUnit: this.DispositionList[0].conversionUnit, // 最小包装单位
  676. outsideFormedNumLast: this.DispositionList[0].formedNumLast,
  677. }; // 总包装数量
  678. } else {
  679. packInfo = {};
  680. }
  681. }
  682. return packInfo;
  683. },
  684. calculation() {
  685. this.show = true;
  686. },
  687. calculationSave() {
  688. let count = this.splitList.filter((item) => item.isChecked != 1).length;
  689. if (this.formData.wPackNum <= count && count != 0) {
  690. for (let i = 0; i < this.formData.wPackNum; i++) {
  691. this.splitList[i].check = 1;
  692. }
  693. this.handleCheck(0, 0);
  694. this.calculationClose();
  695. } else {
  696. if (count != 0) {
  697. for (let i = 0; i < count; i++) {
  698. this.splitList[i].check = 1;
  699. }
  700. this.handleCheck(0, 0);
  701. this.calculationClose();
  702. }
  703. uni.showToast({
  704. icon: "none",
  705. title: "外包装数超出内包装条数",
  706. });
  707. }
  708. },
  709. calculationClose() {
  710. this.show = false;
  711. },
  712. calculationReset() {
  713. this.formData.wPackNum = null;
  714. this.splitList.forEach((f) => {
  715. f.check = null;
  716. });
  717. this.temporaryList = [];
  718. this.show = false;
  719. },
  720. changeWarehouseType() {
  721. this.packageDispositionFn();
  722. },
  723. },
  724. };
  725. </script>
  726. <style lang="scss" scoped>
  727. .title_box {
  728. margin-top: 20rpx;
  729. .ww20 {
  730. width: 20%;
  731. }
  732. .name {
  733. font-size: 28rpx;
  734. font-style: normal;
  735. font-weight: 400;
  736. color: $theme-color;
  737. padding-left: 20rpx;
  738. position: relative;
  739. &:before {
  740. position: absolute;
  741. content: "";
  742. left: 0rpx;
  743. top: 0rpx;
  744. bottom: 0rpx;
  745. width: 4rpx;
  746. height: 28rpx;
  747. background: $theme-color;
  748. margin: auto;
  749. }
  750. }
  751. .btn_box {
  752. color: $theme-color;
  753. }
  754. }
  755. .material {
  756. margin-top: 10rpx;
  757. .content_table {
  758. width: 100%;
  759. border: 2rpx solid $border-color;
  760. .item {
  761. display: flex;
  762. border-bottom: 2rpx solid $border-color;
  763. .lable {
  764. width: 132rpx;
  765. text-align: center;
  766. background-color: #f7f9fa;
  767. font-size: 26rpx;
  768. border-right: 2rpx solid $border-color;
  769. flex-shrink: 0;
  770. }
  771. .lable220 {
  772. width: 220rpx !important;
  773. font-size: 24rpx;
  774. }
  775. .lable150 {
  776. width: 156rpx !important;
  777. font-size: 24rpx;
  778. }
  779. .ww80 {
  780. width: 80rpx;
  781. }
  782. .content {
  783. width: 518rpx;
  784. min-height: 64rpx;
  785. font-size: 28rpx;
  786. line-height: 28rpx;
  787. font-style: normal;
  788. font-weight: 400;
  789. // padding: 18rpx 8rpx;
  790. box-sizing: border-box;
  791. word-wrap: break-word;
  792. flex-grow: 1 !important;
  793. .unit {
  794. padding: 0 4rpx;
  795. font-size: 24rpx;
  796. color: #404446;
  797. }
  798. }
  799. &:last-child {
  800. border-bottom: none;
  801. }
  802. }
  803. .ww55 {
  804. width: 55%;
  805. }
  806. .ww45 {
  807. width: 45%;
  808. }
  809. }
  810. }
  811. .content_table2 {
  812. width: 100%;
  813. margin-top: 16rpx;
  814. .row {
  815. width: 100%;
  816. .item {
  817. color: #404446;
  818. font-size: 28rpx;
  819. padding-left: 12rpx;
  820. }
  821. .color157 {
  822. color: $theme-color;
  823. }
  824. .ww30 {
  825. width: 30%;
  826. }
  827. .ww50 {
  828. width: 50%;
  829. }
  830. .ww90 {
  831. width: 90%;
  832. }
  833. .ww15 {
  834. width: 15%;
  835. }
  836. .ww10 {
  837. width: 10%;
  838. }
  839. .ww30 {
  840. width: 30%;
  841. }
  842. .ww20 {
  843. width: 20%;
  844. }
  845. .ww40 {
  846. width: 40%;
  847. }
  848. .jsColor {
  849. color: $theme-color;
  850. font-size: 20rpx;
  851. }
  852. }
  853. .head {
  854. height: 64rpx;
  855. background: #f7f9fa;
  856. border-top: 2rpx solid #e3e5e5;
  857. border-left: 2rpx solid #e3e5e5;
  858. .item {
  859. height: 64rpx;
  860. line-height: 64rpx;
  861. border-right: 2rpx solid #e3e5e5;
  862. box-sizing: border-box;
  863. }
  864. }
  865. .tr {
  866. border-top: 2rpx solid #e3e5e5;
  867. border-left: 2rpx solid #e3e5e5;
  868. .item {
  869. font-size: 24rpx;
  870. min-height: 64rpx;
  871. display: flex;
  872. align-items: center;
  873. border-right: 2rpx solid #e3e5e5;
  874. box-sizing: border-box;
  875. white-space: normal;
  876. word-break: break-all;
  877. }
  878. &:last-child {
  879. border-bottom: 2rpx solid #e3e5e5;
  880. }
  881. }
  882. }
  883. .label {
  884. display: flex;
  885. height: 70rpx;
  886. width: 86px !important;
  887. font-size: 13px;
  888. align-items: center;
  889. justify-content: center;
  890. background-color: #f7f9fa;
  891. }
  892. .content_num {
  893. display: flex;
  894. align-items: center;
  895. padding: 0 4rpx;
  896. /deep/ .uni-input-input {
  897. border: 2rpx solid #f0f8f2;
  898. background: #f0f8f2;
  899. color: $theme-color;
  900. }
  901. }
  902. .penalize {
  903. width: 86rpx;
  904. line-height: 60rpx;
  905. background: $theme-color;
  906. font-size: 24rpx;
  907. text-align: center;
  908. color: #fff;
  909. }
  910. .check {
  911. width: 30rpx;
  912. height: 30rpx;
  913. }
  914. .z_list {
  915. max-height: 500rpx;
  916. }
  917. .search_list {
  918. min-height: 100rpx;
  919. width: 80vw;
  920. /deep/ .baseForm {
  921. padding: 0 20rpx;
  922. }
  923. }
  924. .operate_box {
  925. padding: 10rpx 32rpx;
  926. /deep/ .u-button {
  927. width: 30%;
  928. }
  929. }
  930. </style>