| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211 |
- <template>
- <view class="content-box">
- <uni-nav-bar
- fixed="true"
- statusBar="true"
- left-icon="back"
- title="领料"
- background-color="#F7F9FA"
- color="#404446"
- @clickLeft="back"
- ></uni-nav-bar>
- <u-button
- type="success"
- size="small"
- class="u-reset-button-ii"
- v-if="clientEnvironmentId == 21"
- @click="undatePicking()"
- text="刷新库存"
- ></u-button>
- <view class="list_box">
- <u-list @scrolltolower="scrolltolower">
- <view v-for="(item, index) in List" :key="index" class="card_box">
- <view class="title_box rx-bc">
- <view class="left rx-sc">
- <view class="round">{{ index + 1 }}</view>
- <view class="code">工单编号:{{ item.code }}</view>
- </view>
- <view class="right_box rx-ec" v-if="clientEnvironmentId !== 9">
- <u-button
- type="success"
- size="small"
- class="u-reset-button"
- v-if="isOutsource == 0"
- @click="addPicking(item.workOrderId, item)"
- text="添加物料"
- ></u-button>
- </view>
- </view>
- <view style="display: flex; justify-items: start">
- <view
- class="select"
- @click="selectAll(item.bomList)"
- style="width: 64px"
- >全选/取消</view
- >
- <!-- <view
- class="select"
- @click="warehouseShowFn(item.id)"
- style="width: 85px; margin-left: 10px"
- >
- 一键选择仓库</view
- > -->
- </view>
- <view
- class="material rx-ss"
- v-for="(mate, idx) in item.pickList"
- :key="idx"
- >
- <view class="left rx-ss" @click="mate.checked = !mate.checked">
- <view
- class="zdy_check rx-cc"
- :class="{ check_active: mate.checked }"
- >
- <u-icon
- size="28"
- v-if="mate.checked"
- name="checkbox-mark"
- ></u-icon>
- </view>
- </view>
- <view class="content_table">
- <view class="item">
- <view class="lable rx-cc">物料编码</view>
- <view class="content ellipsis">
- {{ mate.categoryCode }}
- </view>
- </view>
- <view class="item">
- <view class="lable rx-cc">名称</view>
- <view class="content ellipsis">{{ mate.categoryName }}</view>
- </view>
- <view class="item rx-sc">
- <view class="rx ww55">
- <view class="lable rx-cc">型号</view>
- <view class="content ellipsis">{{ mate.modelType }}</view>
- </view>
- <view class="rx ww45">
- <view class="lable rx-cc ww80">规格</view>
- <view class="content ellipsis">{{ mate.specification }}</view>
- </view>
- </view>
- <view class="item rx-sc">
- <view class="rx ww55">
- <view class="lable rx-cc">类型</view>
- <view class="content">{{
- typeName[Number(mate.rootCategoryLevelId)]
- }}</view>
- </view>
- <view class="rx ww45">
- <view class="lable rx-cc ww80">数量</view>
- <view class="content content_num">
- <input
- class="uni-input"
- v-model="mate.demandQuantity"
- type="digit"
- :disabled="clientEnvironmentId == 9"
- @input="changeInput(mate, idx, index)"
- />
- <view class="unit">{{ mate.unit }}</view>
- </view>
- </view>
- </view>
- <view class="item">
- <view class="lable rx-cc">计量库存数量</view>
- <view class="content pd4">
- <view v-for="it of mate.warehouseList">
- <view
- v-if="it.availableCountBase != '0'"
- class="content"
- @click="chooseInventoryData(mate, it, idx)"
- style="cursor: pointer"
- >{{ it.name ? it.name : it.warehouse_name }}库存数:<span
- style="color: green"
- >{{ it.availableCountBase }}</span
- >{{ mate.measuringUnit }}</view
- >
- </view>
- <!-- <view class="content"
- >{{ mate.availableCountBase }} {{ mate.unit }}</view
- > -->
- </view>
- </view>
- <view class="item">
- <view class="lable rx-cc">领料仓库</view>
- <view class="content pd4">
- <zxz-uni-data-select
- :localdata="mate.warehouseList"
- v-model="mate.warehouseIdList"
- dataValue="warehouse_id"
- format="{warehouse_name}"
- dataKey="warehouse_name"
- :clear="false"
- multiple
- ></zxz-uni-data-select>
- </view>
- </view>
- <view class="item" v-if="clientEnvironmentId == 21">
- <view class="lable rx-cc">库存可用量</view>
- <view class="content">{{ mate.waitOutInWeight }}</view>
- </view>
- </view>
- </view>
- <view>
- <instanceBom
- :list="item.instanceList2"
- :warehouseList="warehouseList"
- ></instanceBom>
- <modelBom
- :workOrderId="item.workOrderId"
- :modelList="item.modelList"
- :warehouseList="warehouseList"
- :modelList2="item.modelList2"
- :code="item.code"
- @hendDel="hendDel"
- >
- </modelBom>
- <boatBom
- :palletList="item.palletList"
- :palletList2="item.palletList2"
- :code="item.code"
- :warehouseList="warehouseList"
- :resObj="item"
- @hendDel="hendDel"
- >
- </boatBom>
- <packingBom
- :list="item.packingList2"
- :warehouseList="warehouseList"
- ></packingBom>
- <semiProductBom
- :warehouseList="warehouseList"
- :list="[
- ...item.semiProductList2,
- ...item.productList2,
- ...item.junkProductList2,
- ]"
- >
- </semiProductBom>
- <view style="height: 80rpx"></view>
- <view class="flex_btn" v-if="isPick" @click="openDetails"
- >已有领料单</view
- >
- </view>
- </view>
- <view class="out_box" v-if="isOutsource == 1">
- <view class="out_text" @click="getListOutsource()"
- >重新获取委外领料单</view
- >
- </view>
- </u-list>
- </view>
- <u-popup
- :show="warehouseShow"
- mode="center"
- v-if="warehouseShow"
- :closeOnClickOverlay="false"
- >
- <view class="popup_list">
- <view class="lable rx-cc">领料仓库</view>
- <view class="content pd4">
- <zxz-uni-data-select
- :localdata="warehouseList"
- v-model="warehouseId"
- dataValue="id"
- format="{name}"
- dataKey="name"
- filterable
- :clear="false"
- ></zxz-uni-data-select>
- </view>
- </view>
- <view class="operate_box rx-bc">
- <u-button
- size="small"
- class="u-reset-button"
- @click="warehouseShow = fasle"
- >
- 取消
- </u-button>
- <u-button
- type="success"
- size="small"
- class="u-reset-button"
- @click="handOK"
- >
- 确认
- </u-button>
- </view>
- </u-popup>
- <view class="bottom-wrapper">
- <view class="btn_box" @click="save">{{ submitText }}</view>
- </view>
- <outsourceOrder
- ref="outsourceRef"
- @outsourceEmit="outsourceFn"
- ></outsourceOrder>
- </view>
- </template>
- <script>
- import instanceBom from "./components/instanceBom.vue";
- import modelBom from "./components/modelBom.vue";
- import boatBom from "./components/boatBom.vue";
- import packingBom from "./components/packingBom";
- import semiProductBom from "./components/semiProductBom";
- import outsourceOrder from "./components/outsourceOrder";
- import { typeName } from "./components/common.js";
- import {
- znPdaPage,
- workorderList,
- listOutsourceInWarehouse,
- listOutsource,
- currentStockQuery,
- getInventoryTotal,
- } from "@/api/pda/workOrder.js";
- import { VirtualPagination } from "@/utils/pages.js";
- import {
- batchSave,
- pickDetails,
- findVoucherList,
- batchPcSave,
- getCode,
- } from "@/api/pda/picking.js";
- import { getWarehouseList } from "@/api/warehouseManagement";
- import { forIn } from "lodash";
- export default {
- components: {
- instanceBom,
- modelBom,
- boatBom,
- packingBom,
- semiProductBom,
- outsourceOrder,
- },
- data() {
- return {
- isType: true,
- warehouseShow: false,
- warehouseId: "",
- warehouseList: [],
- idsList: [],
- List: [],
- currentId: "",
- pagination: {},
- classificationList: [], //分类数据
- newListOne: [],
- taskId: null,
- isPick: false,
- isOutsource: 0,
- clientEnvironmentId:
- uni.getStorageSync("userInfo") &&
- uni.getStorageSync("userInfo").clientEnvironmentId, // *1 主环境-601环境 2 soll-索尔环境 3 tg-碳谷环境
- submitText: "提交",
- pickName: "",
- pickCode: "",
- typeName,
- };
- },
- onLoad(options) {
- console.log(options, "1111111111");
- let queryArray = decodeURIComponent(options.arr);
- getWarehouseList().then((res) => {
- this.warehouseList = res.data;
- });
- this.idsList = JSON.parse(queryArray);
- this.isOutsource = Number(options.isOutsource) || 0;
- this.taskId = options.taskId;
- console.log(this.clientEnvironmentId, "this.clientEnvironmentId");
- if (this.clientEnvironmentId == 21) {
- this.getZnList();
- } else {
- this.getList();
- }
- if (this.idsList.length == 1) {
- this.getPick();
- }
- if (this.isOutsource == 1) {
- this.getListOutsource();
- }
- },
- onShow() {
- uni.$off("setSelectList");
- uni.$on("setSelectList", (selectList, id) => {
- selectList.forEach((item) => {
- item.warehouseList = item.warehouseList
- ? item.warehouseList
- : item.warehouseLists;
- });
- // list.forEach((it) => {
- // if (it.warehouseList.length != 0) {
- // if (!it.warehouseIdList) {
- // it.warehouseIdList = [];
- // it.warehouseIdList.push(it.warehouseList[0].warehouse_id);
- // }
- // }
- // });
- this.List.forEach((e) => {
- if (e.id == id) {
- e.pickList = [...e.pickList, ...selectList];
- this.$forceUpdate();
- }
- });
- // this.List.forEach((m) => {
- // if (m.workOrderId == id) {
- // let instanceList2 = []; // 投料
- // let modelList2 = []; // 模具
- // let palletList2 = [];
- // let packingList2 = []; // 包装
- // let semiProductList2 = []; //半成品
- // let productList2 = []; // 产品
- // let junkProductList2 = []; //废品
- // selectList.forEach((f) => {
- // if (![5, 8, 13, 23, 9, 28].includes(f.rootCategoryLevelId)) {
- // f.automatic = 1;
- // instanceList2 = instanceList2.concat(f);
- // } else if (f.rootCategoryLevelId == 5) {
- // // 模具
- // f.automatic = 1;
- // modelList2 = modelList2.concat(f);
- // } else if (f.rootCategoryLevelId == 8) {
- // // 舟皿
- // f.automatic = 1;
- // palletList2 = palletList2.concat(f);
- // } else if (f.rootCategoryLevelId == 13) {
- // f.automatic = 1;
- // packingList2 = packingList2.concat(f);
- // } else if (f.rootCategoryLevelId == 23) {
- // f.automatic = 1;
- // semiProductList2 = semiProductList2.concat(f);
- // } else if (f.rootCategoryLevelId == 9) {
- // f.automatic = 1;
- // productList2 = productList2.concat(f);
- // } else if (f.rootCategoryLevelId == 28) {
- // f.automatic = 1;
- // junkProductList2 = junkProductList2.concat(f);
- // }
- // });
- // this.$set(m, "instanceList2", instanceList2);
- // this.$set(m, "modelList2", modelList2);
- // this.$set(m, "palletList2", palletList2);
- // this.$set(m, "packingList2", packingList2);
- // this.$set(m, "semiProductList2", semiProductList2);
- // this.$set(m, "productList2", productList2);
- // this.$set(m, "junkProductList2", junkProductList2);
- // }
- // });
- });
- },
- methods: {
- selectAll(list) {
- if (Array.isArray(list) && list.length) {
- // let a = list.some(v=>v.checked = true)
- // ture 就是取消 false 就是选中
- if (this.isType) {
- list.map((d) => {
- d.checked = false;
- });
- this.isType = false;
- } else {
- list.map((d) => {
- d.checked = true;
- });
- this.isType = true;
- }
- }
- console.log(list, "list");
- },
- //刷新库存
- async undatePicking() {
- uni.showLoading({
- title: "加载中...",
- });
- const res = await currentStockQuery(this.idsList[0]);
- uni.hideLoading();
- this.getZnList();
- },
- warehouseShowFn(tiemId) {
- this.warehouseShow = true;
- this.currentId = tiemId;
- },
- handOK() {
- let index = this.List.findIndex((item) => item.id == this.currentId);
- // this.$set(this.List[index], 'warehouseId', this.warehouseId)
- console.log(this.List[index], "this.List[index]");
- for (let key in this.List[index]) {
- if (
- [
- "instanceList2",
- "modelList2",
- "palletList2",
- "packingList2",
- "semiProductList2",
- "productList2",
- "junkProductList2",
- "bomList",
- "pickList",
- ].includes(key)
- ) {
- this.List[index][key].forEach((item, i) => {
- this.$set(
- this.List[index][key][i],
- "warehouseId",
- this.warehouseId
- );
- });
- }
- }
- this.warehouseShow = false;
- this.currentId = "";
- },
- scrolltolower() {
- let arr = this.pagination ? this.pagination.nextPage() : [];
- if (arr.length) {
- this.List[0].bomList = [...this.List[0].bomList, ...arr];
- }
- },
- save() {
- // let _arr = [];
- // console.log(this.newList, "m");
- // if (this.clientEnvironmentId !== 21) {
- // _arr = this.List.map((m) => {
- // console.log(m, "m");
- // if (m.bomList.length > 0) {
- // let bomList = m.bomList.filter((f) => f.checked);
- // m["bomDetailDTOSList"] = [
- // ...bomList,
- // ...m.modelList,
- // ...m.palletList,
- // ];
- // }
- // m.instanceList = [
- // ...m.instanceList2,
- // ...m.modelList2,
- // ...m.palletList2,
- // ...m.packingList2,
- // ...m.semiProductList2,
- // ...m.productList2,
- // ...m.junkProductList2,
- // ];
- // m.isOutsource = this.isOutsource;
- // return {
- // ...m,
- // };
- // });
- // }
- // if (this.clientEnvironmentId == 21) {
- // this.submitText = "领料中";
- // findVoucherList({
- // workOrderId: this.idsList[0],
- // }).then((res) => {
- // // uni.navigateTo({
- // // url: `/pages/pda/picking/index/index?pickStatus=1`,
- // // });
- // uni.showToast({
- // title: "领料成功",
- // mask: true,
- // duration: 1500,
- // });
- // uni.navigateBack({
- // delta: 1,
- // });
- // });
- // } else {
- // batchSave(_arr).then((res) => {
- // uni.navigateTo({
- // url: `/pages/pda/picking/index/index?pickStatus=1`,
- // });
- // });
- // }
- if (this.List.length > 0) {
- let bol;
- let _i;
- bol = this.List.every((e, i) => {
- _i = i;
- return (
- Object.prototype.hasOwnProperty.call(e, "pickList") &&
- e.pickList.length > 0
- );
- });
- if (!bol) {
- // this.$message.warning(
- // `生成工单${this.workList[_i].code}领料不能为空`
- // );
- uni.showToast({
- title: `生成工单${this.List[_i].code}领料不能为空`,
- icon: "none",
- });
- return false;
- }
- }
- if (this.List.length > 0) {
- let name;
- let bol2;
- let _i;
- this.List.forEach((e, i) => {
- _i = i;
- console.log(e.pickList);
- bol2 = e.pickList.every((y) => {
- name = y.name;
- return (
- Object.prototype.hasOwnProperty.call(y, "demandQuantity") &&
- Number(y.demandQuantity) > 0
- );
- });
- });
- if (!bol2) {
- // this.$message.warning(
- // `${this.workList[_i].code}的${name}数量不能为空`
- // );
- uni.showToast({
- title: `${this.List[_i].code}的${name}数量不能为空`,
- icon: "none",
- });
- return false;
- }
- }
- let _arr = [];
- _arr = this.List.map((m) => {
- m.instanceList = [];
- m.bomDetailDTOSList = [];
- m.pickList.forEach((e) => {
- if (
- Object.prototype.hasOwnProperty.call(e, "isBom") &&
- e.isBom == 1
- ) {
- m.bomDetailDTOSList.push(e);
- } else {
- m.instanceList.push(e);
- }
- });
- m.workOrderId = m.id;
- return {
- ...m,
- };
- });
- // this.loadingBtn = true;
- // _arr.forEach((item) => {
- // item.pickList.forEach((it) => {
- // const warehousePick = [];
- // if (it.warehouseIdList.length != 0) {
- // it.warehouseIdList.forEach((i) => {
- // const data = it.warehouseList.find((ii) => ii.id == i);
- // if (data) {
- // warehousePick.push({
- // availableCountBase: data.availableCountBase,
- // demandQuantity: data.demandQuantity,
- // warehouseId: data.id
- // });
- // }
- // });
- // }
- // it.warehousePick = warehousePick;
- // });
- // });
- // console.log(_arr, "_arr");
- // return;
- // if (this.clientEnvironmentId == 21) {
- // let param = {
- // workOrderId: this.workListIds[0],
- // pickingCode: this.pickCode
- // };
- // znfindVoucherList(param).then((res) => {
- // this.loadingBtn = false;
- // this.$message.success('领料成功');
- // });
- // }
- let param = {
- allPickList: _arr,
- pickName: this.pickName,
- pickCode: this.pickCode,
- };
- batchPcSave(param)
- .then((res) => {
- uni.navigateTo({
- url: `/pages/pda/picking/index/index?pickStatus=1`,
- });
- // this.loadingBtn = false;
- // this.$message.success("领料成功");
- // this.$emit("close", true);
- })
- .catch((err) => {
- // this.loadingBtn = false;
- });
- // batchPcSave
- },
- // 中赢保存
- getZnList() {
- znPdaPage({
- // ids: ,
- workId: this.idsList[0],
- }).then((res) => {
- if (res?.length) {
- let List = res.map((m) => {
- m.workOrderId = m.id;
- let modelList = [];
- let palletList = [];
- // let bomList = []
- // m.bomDetailDTOS.forEach((f, i) => {
- // if (f.rootCategoryLevelId == 5) {
- // f.automatic = 2
- // modelList = modelList.concat(f)
- // }
- // if (f.rootCategoryLevelId == 8) {
- // f.automatic = 2
- // palletList = palletList.concat(f)
- // }
- // if (f.rootCategoryLevelId != 5 && f.rootCategoryLevelId != 8) {
- // f.automatic = 2
- // bomList = bomList.concat(f)
- // }
- // })
- m["modelList"] = modelList;
- m["palletList"] = palletList;
- // m['bomList'] = bomList
- m["modelList2"] = [];
- m["instanceList2"] = [];
- m["palletList2"] = [];
- m["packingList2"] = [];
- m["semiProductList2"] = [];
- m["productList2"] = [];
- m["junkProductList2"] = [];
- delete m.id;
- return {
- ...m,
- };
- });
- this.newListOne = JSON.parse(JSON.stringify(List));
- this.pagination = new VirtualPagination(List[0].bomList, 10);
- List[0].bomList = this.pagination.getCurrentPageData();
- this.List = List;
- }
- });
- },
- deepCopy(obj, hash = new WeakMap()) {
- if (obj === null) return null;
- if (obj instanceof Date) return new Date(obj);
- if (obj instanceof RegExp) return new RegExp(obj);
- if (typeof obj !== "object" && typeof obj !== "function") return obj;
- if (hash.has(obj)) return hash.get(obj);
- const result = Array.isArray(obj) ? [] : {};
- hash.set(obj, result);
- return Object.keys(obj).reduce((acc, key) => {
- acc[key] = this.deepCopy(obj[key], hash);
- return acc;
- }, result);
- },
- changeInput(item, idx, index) {
- if (Number(item.demandQuantity) >= Number(item.availableCountBase)) {
- this.$set(
- this.List[index].pickList[idx],
- "demandQuantity",
- Number(item.availableCountBase)
- );
- const idsList = [];
- item.warehouseList.forEach((it) => {
- idsList.push(it.warehouse_id);
- });
- this.$set(this.List[index].pickList[idx], "warehouseIdList", idsList);
- this.$forceUpdate();
- } else if (!Number(item.demandQuantity)) {
- this.$set(this.List[index].pickList[idx], "warehouseIdList", []);
- this.$forceUpdate();
- } else {
- const idsList = [];
- let totalNum = 0;
- for (let i = 0; i < item.warehouseList.length; i++) {
- totalNum += Number(item.warehouseList[i].availableCountBase);
- if (Number(item.demandQuantity) > totalNum) {
- idsList.push(item.warehouseList[i].warehouse_id);
- } else {
- idsList.push(item.warehouseList[i].warehouse_id);
- break;
- }
- }
- this.$set(this.List[index].pickList[idx], "warehouseIdList", idsList);
- this.$forceUpdate();
- }
- },
- getList() {
- workorderList({
- ids: this.idsList,
- taskId: this.taskId,
- }).then((res) => {
- console.log("领料列表", res);
- this.List = res.map((m) => {
- m.workOrderId = m.id;
- let modelList = [];
- let palletList = [];
- let bomList = [];
- m.bomDetailDTOS.forEach((f, i) => {
- if (f.rootCategoryLevelId == 5) {
- f.automatic = 2;
- modelList = modelList.concat(f);
- }
- if (f.rootCategoryLevelId == 8) {
- f.automatic = 2;
- palletList = palletList.concat(f);
- }
- if (f.rootCategoryLevelId != 5 && f.rootCategoryLevelId != 8) {
- f.automatic = 2;
- bomList = bomList.concat(f);
- }
- });
- m["modelList"] = modelList;
- m["palletList"] = palletList;
- m["pickList"] = bomList;
- m["modelList2"] = [];
- m["instanceList2"] = [];
- m["palletList2"] = [];
- m["packingList2"] = [];
- m["semiProductList2"] = [];
- m["productList2"] = [];
- m["junkProductList2"] = [];
- m.pickList.forEach((it) => {
- it.warehouseIdList = [];
- it.warehouseIdList.push(it.warehouseId);
- it.warehouseList.forEach((i) => {
- i.warehouse_name = i.name;
- i.warehouse_id = i.id;
- });
- });
- console.log(m, "mmmm");
- // delete m.id;
- return {
- ...m,
- };
- });
- this.pickName = res[0].productName + "领料";
- this.getOrderCode();
- // this.getInventoryTotalFn();
- });
- },
- //计量库存数量
- getInventoryTotalFn() {
- let ids = [];
- this.List.map((item) => {
- item.bomList.map((pitem) => {
- ids.push(pitem.categoryCode);
- });
- });
- if (ids.length == 0) {
- return;
- }
- getInventoryTotal(ids).then((res) => {
- res.map((ritem) => {
- this.List.map((item) => {
- item.bomList.map((pitem) => {
- if (pitem.categoryCode == ritem.code) {
- pitem.availableCountBase = ritem.availableCountBase;
- }
- });
- });
- });
- });
- },
- async getOrderCode() {
- this.pickCode = await getCode("pick_order_code");
- },
- hendDel(type, code, list) {
- if (type == "modelBom") {
- console.log(list.length);
- if (list.length == 0) {
- }
- this.List.forEach((f) => {
- if (f.code == code) {
- if (list.length == 0) {
- f.modelList2 = [];
- f.modelList = [];
- return false;
- }
- f.modelList2 = list.filter((t) => t.automatic == 1);
- f.modelList = list.filter((t) => t.automatic == 2);
- }
- });
- }
- if (type == "boatBom") {
- this.List.forEach((f) => {
- if (f.code == code) {
- if (list.length == 0) {
- f.palletList2 = [];
- f.palletList = [];
- return false;
- }
- f.palletList2 = list.filter((t) => t.automatic == 1);
- f.palletList = list.filter((t) => t.automatic == 2);
- }
- });
- }
- this.$forceUpdate();
- },
- getListOutsource(list) {
- let param = {
- workOrderId: this.idsList,
- taskId: this.taskId,
- };
- listOutsource(param).then((res) => {
- if (res) {
- this.$refs.outsourceRef.open(res);
- } else {
- uni.showToast({
- title: "暂无委外申请单",
- icon: "none",
- });
- }
- });
- },
- outsourceFn(list) {
- this.outsourceInWarehouseFn(list);
- },
- addPicking(id, item) {
- const storageKey = Date.now() + "";
- let arr = [
- ...item.instanceList2,
- ...item.modelList2,
- ...item.palletList2,
- ...item.packingList2,
- ...item.semiProductList2,
- ...item.productList2,
- ...item.junkProductList2,
- ];
- uni.setStorageSync(storageKey, arr);
- uni.navigateTo({
- url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}&isType=pick&taskId=${this.taskId}`,
- });
- },
- getPick() {
- pickDetails(this.idsList).then((res) => {
- if (res && res.length > 0) {
- this.isPick = true;
- }
- });
- },
- outsourceInWarehouseFn(list) {
- let param = {
- outsourceOrder: list || [],
- workOrderId: this.idsList[0],
- taskId: this.taskId,
- };
- listOutsourceInWarehouse(param).then((res) => {
- res.list.map((m) => {
- m.isOut = 1;
- return {
- ...m,
- };
- });
- let _arr = [...this.List[0].instanceList2, ...res.list];
- this.$set(this.List[0], "instanceList2", _arr);
- this.$forceUpdate();
- });
- },
- openDetails() {
- let url = `/pages/pda/picking/bill/index?id=${this.idsList[0]}`;
- uni.navigateTo({
- url,
- });
- },
- },
- beforeDestroy() {
- uni.hideLoading();
- },
- };
- </script>
- <style lang="scss" scoped>
- .select {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 5rpx 0;
- width: 150rpx;
- background-color: #157a2c;
- color: #fff;
- font-size: 24rpx;
- border-radius: 5rpx;
- }
- .u-reset-button-ii {
- position: relative;
- right: -251rpx;
- width: 200rpx;
- }
- .content-box {
- height: 100vh;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- }
- .list_box {
- flex: 1;
- overflow: hidden;
- padding: 4rpx 0;
- .u-list {
- height: 100% !important;
- }
- .card_box {
- padding: 16rpx 24rpx;
- }
- .title_box {
- .round {
- width: 32rpx;
- height: 32rpx;
- line-height: 32rpx;
- border-radius: 50%;
- background: $theme-color;
- color: #fff;
- text-align: center;
- font-size: 20rpx;
- }
- .code {
- margin-left: 16rpx;
- font-family: PingFang SC;
- font-size: 28rpx;
- font-style: normal;
- font-weight: 400;
- color: $theme-color;
- }
- }
- .material {
- margin-top: 10rpx;
- .left {
- width: 40rpx;
- }
- .zdy_check {
- width: 30rpx;
- height: 30rpx;
- border: 2rpx solid #c8c9cc;
- border-radius: 4rpx;
- }
- .check_active {
- background: $theme-color;
- border: 2rpx solid $theme-color;
- /deep/ .u-icon__icon {
- color: #fff !important;
- }
- }
- .content_table {
- width: 652rpx;
- border: 2rpx solid $border-color;
- .item {
- display: flex;
- border-bottom: 2rpx solid $border-color;
- .lable {
- width: 132rpx;
- text-align: center;
- background-color: #f7f9fa;
- font-size: 26rpx;
- border-right: 2rpx solid $border-color;
- flex-shrink: 0;
- }
- .ww80 {
- width: 80rpx;
- }
- .content {
- width: 518rpx;
- min-height: 64rpx;
- font-size: 28rpx;
- line-height: 28rpx;
- font-style: normal;
- font-weight: 400;
- padding: 18rpx 8rpx;
- box-sizing: border-box;
- word-wrap: break-word;
- flex-grow: 1 !important;
- }
- .content_num {
- display: flex;
- align-items: center;
- padding: 0 4rpx;
- /deep/ .uni-input-input {
- border: 2rpx solid #f0f8f2;
- background: #f0f8f2;
- color: $theme-color;
- }
- .unit {
- width: 90rpx;
- text-align: center;
- font-size: 24rpx;
- color: #404446;
- }
- }
- .pd4 {
- padding: 4rpx 8rpx;
- }
- &:last-child {
- border-bottom: none;
- }
- }
- .ww55 {
- width: 55%;
- }
- .ww45 {
- width: 45%;
- }
- }
- }
- }
- .ellipsis {
- white-space: nowrap; /* 强制不换行 */
- overflow: hidden; /* 超出部分隐藏 */
- text-overflow: ellipsis; /* 显示省略号 */
- }
- .bottom-wrapper {
- .btn_box {
- width: 750rpx;
- height: 88rpx;
- line-height: 88rpx;
- background: $theme-color;
- text-align: center;
- font-size: 36rpx;
- font-style: normal;
- font-weight: 400;
- color: #fff;
- }
- }
- .flex_btn {
- position: fixed;
- right: 0;
- bottom: 160rpx;
- width: 140rpx;
- height: 66rpx;
- line-height: 66rpx;
- border-radius: 22rpx 0 0 22rpx;
- background: $theme-color;
- text-align: center;
- font-size: 22rpx;
- font-style: normal;
- font-weight: 400;
- color: #fff;
- }
- .out_box {
- margin: 20rpx;
- display: flex;
- justify-content: center;
- color: $theme-color;
- font-size: 28rpx;
- }
- .popup_list {
- width: 400rpx;
- height: 400rpx;
- }
- </style>
|