packingBom.vue 27 KB

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