|
|
@@ -1,30 +1,161 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
+ <div>
|
|
|
+ <div class="top_fixed">
|
|
|
+ <el-button type="primary" size="mini" @click="save">一键报工</el-button>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="top_fixed">
|
|
|
- <el-button type="primary" size="mini" @click="save"
|
|
|
- >一键报工</el-button
|
|
|
- >
|
|
|
+ <div class="warehousing_box">
|
|
|
+ <div v-for="(item, index) in List" :key="index" class="card_box">
|
|
|
+ <div class="title_box rx-bc">
|
|
|
+ <div class="name">工单信息 </div>
|
|
|
+ </div>
|
|
|
+ <workOrderBom :item="item" v-if="item"></workOrderBom>
|
|
|
+ {{clientEnvironmentId}}
|
|
|
+
|
|
|
|
|
|
- </div>
|
|
|
+
|
|
|
+ <div v-if="clientEnvironmentId == 3 ">
|
|
|
+ {{ item.toWarehouseList }}
|
|
|
|
|
|
- <div class="warehousing_box"></div>
|
|
|
|
|
|
- </div>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ <!-- <packingTgBom :list='it.extInfo.pickOutInList' :isWarehousing='true'></packingTgBom> -->
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import workOrderBom from '../feeding/components/workOrderBom.vue';
|
|
|
+ import packingTgBom from '../jobBooking/components/packingTgBom.vue'
|
|
|
+
|
|
|
+ import { getWarehouseList } from '@/api/produce/index.js';
|
|
|
+ import { listByIdsReport } from '@/api/produce/job';
|
|
|
+ import { listPcToWarehouseTG } from '@/api/produce/workOrder';
|
|
|
+
|
|
|
+
|
|
|
export default {
|
|
|
-
|
|
|
+ components: {
|
|
|
+ workOrderBom,
|
|
|
+ packingTgBom
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ workListIds: {
|
|
|
+ type: Array,
|
|
|
+ default() {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
- return {}
|
|
|
- }
|
|
|
- }
|
|
|
+ return {
|
|
|
+ isLoad: false,
|
|
|
+ List: [],
|
|
|
|
|
|
-</script>
|
|
|
+ idsList: [],
|
|
|
+ warehouseList: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ computed: {
|
|
|
+ taskObj() {
|
|
|
+ return this.$store.state.user.taskObj;
|
|
|
+ },
|
|
|
+
|
|
|
+ clientEnvironmentId() {
|
|
|
+ return this.$store.state.user.info.clientEnvironmentId;
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
|
|
|
+ watch: {
|
|
|
+ workListIds: {
|
|
|
+ handler(val) {
|
|
|
+ this.getList(val);
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ created() {
|
|
|
+ this.getWarehouseListFn();
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ getList(ids) {
|
|
|
+ this.idsList = ids || [];
|
|
|
+ let param = {
|
|
|
+ ids: ids,
|
|
|
+ taskId: this.taskObj.id,
|
|
|
+ type: 0
|
|
|
+ };
|
|
|
+ this.isLoad = false;
|
|
|
+ listByIdsReport(param)
|
|
|
+ .then((res) => {
|
|
|
+ this.List = res.map((obj) => {
|
|
|
+ obj.workReportInfo = {
|
|
|
+ formingNum: null,
|
|
|
+ formingWeight: null,
|
|
|
+ formedNum: null,
|
|
|
+ formedWeight: null,
|
|
|
+ taskId: this.taskObj.id
|
|
|
+ };
|
|
|
+
|
|
|
+ return {
|
|
|
+ ...obj
|
|
|
+ };
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.isLoad = true;
|
|
|
+
|
|
|
+ this.getTgWarehouse();
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ getTgWarehouse() {
|
|
|
+ const param = {
|
|
|
+ workOrderIds: this.idsList,
|
|
|
+ taskId: this.taskObj.id
|
|
|
+ };
|
|
|
+ listPcToWarehouseTG(param).then((res) => {
|
|
|
+ // 创建一个映射,以便快速查找
|
|
|
+ const workOrderMap = new Map(res.map(it => [it.workOrderId, it]));
|
|
|
+
|
|
|
+
|
|
|
+ // 更新List中的每个项目
|
|
|
+ this.List.forEach(item => {
|
|
|
+ if (workOrderMap.has(item.workOrderId)) {
|
|
|
+ // 直接从映射中获取数据,避免嵌套循环
|
|
|
+ this.$set(item, 'toWarehouseList', [workOrderMap.get(item.workOrderId)]);
|
|
|
+ } else {
|
|
|
+ this.$set(item, 'toWarehouseList', []);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+},
|
|
|
+
|
|
|
+ getWarehouseListFn() {
|
|
|
+ getWarehouseList().then((res) => {
|
|
|
+ this.warehouseList = res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ save() {}
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|
|
|
+
|
|
|
<style scoped lang="scss">
|
|
|
.top_fixed {
|
|
|
width: 100%;
|