Selaa lähdekoodia

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-mes into dev

lucw 1 vuosi sitten
vanhempi
commit
141f1ac728
34 muutettua tiedostoa jossa 2428 lisäystä ja 763 poistoa
  1. 11 0
      src/api/produce/device.js
  2. 21 0
      src/api/produce/turnover.js
  3. 7 0
      src/api/warehouseManagement/warehouseDefinition.js
  4. 2 1
      src/components/addDoc/file-table-listTemplate.vue
  5. 128 127
      src/components/addDoc/main.vue
  6. 11 1
      src/components/addDoc/util.js
  7. 1 0
      src/enum/dict.js
  8. 16 1
      src/utils/util.js
  9. 65 60
      src/views/produce/components/device/components/addDialog.vue
  10. 66 35
      src/views/produce/components/device/components/detail.vue
  11. 32 14
      src/views/produce/components/device/components/edit.vue
  12. 2 2
      src/views/produce/components/device/components/link-msg.vue
  13. 66 28
      src/views/produce/components/device/index.vue
  14. 17 16
      src/views/produce/components/footBtn.vue
  15. 151 29
      src/views/produce/components/jobBooking/components/batchPackagingGrouping.vue
  16. 251 8
      src/views/produce/components/jobBooking/components/packingTgBom.vue
  17. 6 2
      src/views/produce/components/jobBooking/components/semiProductJobBom.vue
  18. 20 2
      src/views/produce/components/jobBooking/details.vue
  19. 21 1
      src/views/produce/components/jobBooking/index.vue
  20. 6 3
      src/views/produce/components/new_produceOrder.vue
  21. 27 3
      src/views/produce/components/picking/index.vue
  22. 914 0
      src/views/produce/components/picking/newPickingList.vue
  23. 20 20
      src/views/produce/components/taskDialog/index.vue
  24. 23 8
      src/views/produce/components/turnover/components/detail.vue
  25. 61 33
      src/views/produce/components/turnover/components/details.vue
  26. 30 17
      src/views/produce/components/turnover/components/edit.vue
  27. 62 30
      src/views/produce/components/turnover/index.vue
  28. 14 2
      src/views/produce/index.vue
  29. 164 144
      src/views/produceOrder/components/printSr.vue
  30. 158 144
      src/views/produceOrder/components/printTg.vue
  31. 2 0
      src/views/sample/detailList.vue
  32. 11 11
      src/views/taskList/components/Ddtails.vue
  33. 41 20
      src/views/taskList/index.vue
  34. 1 1
      src/views/unacceptedProduct/detail.vue

+ 11 - 0
src/api/produce/device.js

@@ -167,3 +167,14 @@ export async function listFactoryLine(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+//获取工序下所有的设备信息
+export async function getTaskDeviceList(taskId) {
+  const res = await request.get(
+    `/main/factoryworkstation/listBySourceTaskId/${taskId}`
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 21 - 0
src/api/produce/turnover.js

@@ -35,3 +35,24 @@ export async function getAssetNum(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+//获取工单下所有周转车数据
+export async function getTurnoverList(data) {
+  const res = await request.post(
+    `/main/asset/listTurnoverCarByWorkOrder`,
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//获取周转车的货位
+export async function categoryVehicleList(id) {
+  const res = await request.get(`/main/categoryvehicle/getByCategoryId/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 7 - 0
src/api/warehouseManagement/warehouseDefinition.js

@@ -150,5 +150,12 @@ export default {
     if (res.data.code == 0) {
       return res.data.data;
     }
+  },
+
+  eomContact: async (params) => {
+    const res = await request.get(`/eom/contact/page`, params);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
   }
 };

+ 2 - 1
src/components/addDoc/file-table-listTemplate.vue

@@ -30,6 +30,7 @@
 <script>
   import { filePageAPI } from './api';
   import browse from './browse.vue';
+  import { setFileUrl } from './util.js';
 
   export default {
     components: { browse },
@@ -189,7 +190,7 @@
       },
 
       browseOpen(row) {
-        this.$refs.browseRef.open(row);
+        window.open(setFileUrl(row));
       },
       getTableList() {
         return JSON.parse(JSON.stringify(this.selection));

+ 128 - 127
src/components/addDoc/main.vue

@@ -75,140 +75,141 @@
 </template>
 
 <script>
-import doc_template from './doc_template.vue';
-import fileEdit from './file-edit.vue';
-import browse from './browse.vue';
-import { queryIds } from './api';
+  import doc_template from './doc_template.vue';
+  import fileEdit from './file-edit.vue';
+  import browse from './browse.vue';
+  import { queryIds } from './api';
+  import { setFileUrl } from './util.js';
 
-export default {
-  components: { doc_template, fileEdit, browse },
+  export default {
+    components: { doc_template, fileEdit, browse },
 
-  data() {
-    return {
-      fileId: [],
-      fileShow: false,
-      showEditFlag: false,
-      tableList: [],
-      type: 'add',
-      columns: [
-        {
-          label: '编码',
-          prop: 'code',
-          width: 180,
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'name',
-          label: '文档名称',
-          align: 'center',
-          slot: 'name',
-          showOverflowTooltip: true,
-          minWidth: 200
-        },
-        {
-          prop: 'storagePath',
-          label: '文件名称',
-          align: 'center',
+    data() {
+      return {
+        fileId: [],
+        fileShow: false,
+        showEditFlag: false,
+        tableList: [],
+        type: 'add',
+        columns: [
+          {
+            label: '编码',
+            prop: 'code',
+            width: 180,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '文档名称',
+            align: 'center',
+            slot: 'name',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'storagePath',
+            label: '文件名称',
+            align: 'center',
 
-          showOverflowTooltip: true,
-          minWidth: 200,
-          formatter: (_row, _column, cellValue) => {
-            return cellValue && cellValue[0]?.name;
-          }
-        },
-        {
-          prop: 'version',
-          label: '版本',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
-
-        {
-          prop: 'createUserName',
-          label: '创建人',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 160
-        },
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue && cellValue[0]?.name;
+            }
+          },
+          {
+            prop: 'version',
+            label: '版本',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
 
-        {
-          prop: 'sizeUnit',
-          label: '文档大小',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100
-        },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 160
+          },
 
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 200,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ]
-    };
-  },
-  created() {},
+          {
+            prop: 'sizeUnit',
+            label: '文档大小',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
 
-  methods: {
-    open(fileId, type) {
-      //查看详情:view 新增:add
-      this.showEditFlag = true;
-      this.fileId = fileId || [];
-      if (type) {
-        this.type = type;
-      }
-      this.init();
-    },
-    fileEditOpen() {
-      this.$refs.fileEditRef.open();
-    },
-    remove(row) {
-      this.tableList = this.tableList.filter((item) => item.code != row.code);
-      this.fileId = this.tableList.map((item) => item.id);
-    },
-    async init() {
-      if (this.fileId.length > 0) {
-        this.tableList = await queryIds({ ids: "'" + this.fileId + "'" });
-      } else {
-        this.tableList = [];
-      }
-    },
-    done(id) {
-      this.fileId.push(...id);
-      this.init();
-    },
-    browseOpen(row) {
-      this.$refs.browseRef.open(row);
-    },
-    addFile() {
-      this.$emit(
-        'success',
-        this.tableList.map((item) => item.id)
-      );
-      this.showEditFlag = false;
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 200,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ]
+      };
     },
-    addTemplate() {
-      let list = this.$refs.doc_templateRef.getTableList();
-      this.fileShow = false;
-      if (list.length == 0) {
-        this.$message.error('请选择一条数据');
-        return;
+    created() {},
+
+    methods: {
+      open(fileId, type) {
+        //查看详情:view 新增:add
+        this.showEditFlag = true;
+        this.fileId = fileId || [];
+        if (type) {
+          this.type = type;
+        }
+        this.init();
+      },
+      fileEditOpen() {
+        this.$refs.fileEditRef.open();
+      },
+      remove(row) {
+        this.tableList = this.tableList.filter((item) => item.code != row.code);
+        this.fileId = this.tableList.map((item) => item.id);
+      },
+      async init() {
+        if (this.fileId.length > 0) {
+          this.tableList = await queryIds({ ids: "'" + this.fileId + "'" });
+        } else {
+          this.tableList = [];
+        }
+      },
+      done(id) {
+        this.fileId.push(...id);
+        this.init();
+      },
+      browseOpen(row) {
+        window.open(setFileUrl(row));
+      },
+      addFile() {
+        this.$emit(
+          'success',
+          this.tableList.map((item) => item.id)
+        );
+        this.showEditFlag = false;
+      },
+      addTemplate() {
+        let list = this.$refs.doc_templateRef.getTableList();
+        this.fileShow = false;
+        if (list.length == 0) {
+          this.$message.error('请选择一条数据');
+          return;
+        }
+        this.tableList.push(...list);
       }
-      this.tableList.push(...list);
     }
-  }
-};
+  };
 </script>

+ 11 - 1
src/components/addDoc/util.js

@@ -53,7 +53,17 @@ export function isPower(data = {}, power, selection = []) {
     return powerObj[power] == '1';
   }
 }
-
+export function setFileUrl(row) {
+  let file = row.storagePath[0];
+  let fileNames = file.storePath.split('/');
+  let url =
+    window.location.origin +
+    '/api/main/file/getFile?objectName=' +
+    file.storePath +
+    '&fullfilename=' +
+    fileNames[fileNames.length - 1];
+  return '/kkfile/onlinePreview?url=' + btoa(url);
+}
 export function setFolderList(data) {
   //递归过滤文件夹权限
   data.forEach((item) => {

+ 1 - 0
src/enum/dict.js

@@ -23,6 +23,7 @@ export default {
   异常类型: 'Exception_type',
   请托类型: 'entrust_type',
   退料场景: 'returnScenario',
+  精度等级: 'accuracy_level',
   质检计划类型: 'inspection_plan_type',
   处置状态: 'dispose_status',
   紧急程度: 'urgent_type',

+ 16 - 1
src/utils/util.js

@@ -65,7 +65,6 @@ export function reworkStatus(v) {
     case 3:
       status = '已完成';
       break;
-   
   }
   return status;
 }
@@ -87,3 +86,19 @@ export function hangingStatus(v) {
   }
   return status;
 }
+
+export function 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);
+}

+ 65 - 60
src/views/produce/components/device/components/addDialog.vue

@@ -17,12 +17,11 @@
         @setFullscreen="fullscreen = !fullscreen"
       ></modalTitle>
     </template>
-    <div class="dialog_top">
-      <!-- <div>报修记录编号:{{ addForm.repairsCode }}</div> -->
+    <!-- <div class="dialog_top">
       <el-button v-if="title === '新增'" type="primary" @click="selectEquipment"
         >选择设备</el-button
       >
-    </div>
+    </div> -->
     <div class="main_container">
       <el-form :model="addForm" :rules="addFormRules" label-width="130px">
         <el-row>
@@ -266,8 +265,8 @@
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import { getAssetInfo } from '@/api/produce/device.js';
   import CategoryDialog from '@/components/AssetDialog/categoryDialog';
-  // import DeptSelect from '@/components/CommomSelect/dept-select.vue';
-  // import PersonSelect from '@/components/CommomSelect/person-select.vue';
+  import DeptSelect from '@/components/CommomSelect/dept-select.vue';
+  import PersonSelect from '@/components/CommomSelect/person-select.vue';
   import { save, update, getRepairInfoById } from '@/api/produce/device.js';
   import { getUserPage } from '@/api/system/organization';
   export default {
@@ -283,9 +282,9 @@
     },
     components: {
       modalTitle,
-      CategoryDialog
-      // DeptSelect,
-      // PersonSelect
+      CategoryDialog,
+      DeptSelect,
+      PersonSelect
     },
     watch: {
       /**
@@ -397,14 +396,20 @@
       init(row) {
         this.addRepairNotesDialog = true;
         this.row = row;
-        if (row) {
-          this.title = '修改';
-          this.selectedEquipment(row.id);
-        } else {
-          this.title = '新增';
-          this.userList = [];
-        }
+        // if (row) {
+        //   this.title = '修改';
+        this.selectedEquipment(row.id);
+        // } else {
+        this.title = '新增';
+        // this.userList = [];
+        // this.getDeviceData();
+        // }
       },
+
+      // getDeviceData() {
+
+      // },
+
       handleClose() {
         this.initData = [];
         this.addRepairNotesDialog = false;
@@ -491,59 +496,59 @@
         if (!this.addForm.code) {
           return this.$message.warning('请选择报修设备!');
         }
-        // const params = {
-        //   deviceId: this.addForm.id,
-        //   expectedTime: new Date(this.addForm.expectedTime),
-        //   remark: this.addForm.remark,
-        //   repairDeptId: this.addForm.repairDeptId,
-        //   repairUserId: this.addForm.repairUserId,
-        //   status: 0,
-        //   sourceType: 1,
-        //   deviceCode: this.addForm.code,
-        //   deviceName: this.addForm.name,
-        //   repairUserName: this.addForm.repairUserName,
-        //   repairLeaderUserId: this.addForm.repairLeaderUserId,
-        //   repairLeaderUserName: this.addForm.repairLeaderUserName
-        // };
         const params = {
           deviceId: this.addForm.id,
           expectedTime: new Date(this.addForm.expectedTime),
           remark: this.addForm.remark,
-          deviceCode: this.addForm.code,
-          deviceName: this.addForm.name,
+          repairDeptId: this.addForm.repairDeptId,
+          repairUserId: this.addForm.repairUserId,
           status: 0,
           sourceType: 1,
-          leaderDeptId: this.addForm.leaderDeptId,
-          leaderUserId: this.addForm.leaderUserId,
-          leaderName: this.addForm.leaderName
+          deviceCode: this.addForm.code,
+          deviceName: this.addForm.name,
+          repairUserName: this.addForm.repairUserName,
+          repairGroupId: this.addForm.repairGroupId,
+          repairGroupName: this.addForm.repairGroupName
         };
+        // const params = {
+        //   deviceId: this.addForm.id,
+        //   expectedTime: new Date(this.addForm.expectedTime),
+        //   remark: this.addForm.remark,
+        //   deviceCode: this.addForm.code,
+        //   deviceName: this.addForm.name,
+        //   status: 0,
+        //   sourceType: 1,
+        //   leaderDeptId: this.addForm.leaderDeptId,
+        //   leaderUserId: this.addForm.leaderUserId,
+        //   leaderName: this.addForm.leaderName
+        // };
         this.loading = true;
-        if (this.row) {
-          params.id = this.row.id;
-          params.deviceId = this.addForm.deviceId;
-          params.code = this.row.code;
-          update(params)
-            .then((res) => {
-              this.$message.success('修改成功!');
-              this.$emit('refresh');
-              this.loading = false;
-              this.handleClose();
-            })
-            .catch((e) => {
-              this.loading = false;
-            });
-        } else {
-          save(params)
-            .then((res) => {
-              this.$message.success('新增成功!');
-              this.$emit('refresh');
-              this.loading = false;
-              this.handleClose();
-            })
-            .catch((e) => {
-              this.loading = false;
-            });
-        }
+        // if (this.row) {
+        //   params.id = this.row.id;
+        //   params.deviceId = this.addForm.deviceId;
+        //   params.code = this.row.code;
+        //   update(params)
+        //     .then((res) => {
+        //       this.$message.success('修改成功!');
+        //       this.$emit('refresh');
+        //       this.loading = false;
+        //       this.handleClose();
+        //     })
+        //     .catch((e) => {
+        //       this.loading = false;
+        //     });
+        // } else {
+        save(params)
+          .then((res) => {
+            this.$message.success('新增成功!');
+            this.$emit('refresh');
+            this.loading = false;
+            this.handleClose();
+          })
+          .catch((e) => {
+            this.loading = false;
+          });
+        // }
       }
     }
   };

+ 66 - 35
src/views/produce/components/device/components/detail.vue

@@ -1,52 +1,66 @@
 <template>
-  <div class="ele-body">
-    <el-card :body-style="{ padding: 0 }">
-      <!-- tab切换 -->
-      <div class="switch">
-        <div class="switch_left">
-          <ul>
-            <li
-              v-for="item in tabOptions"
-              :key="item.key"
-              :class="{ active: activeComp == item.key }"
-              @click="activeComp = item.key"
-            >
-              {{ item.name }}
-            </li>
-          </ul>
-        </div>
-        <!-- <div class="right" style="padding: 10px">
+  <el-dialog
+    :visible.sync="addRepairNotesDialog"
+    v-if="addRepairNotesDialog"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    width="90%"
+    :fullscreen="fullscreen"
+    class="fullscreen"
+    append-to-body
+  >
+    <!-- <template slot="title">
+      <modalTitle @setFullscreen="fullscreen = !fullscreen"></modalTitle>
+    </template> -->
+    <div class="ele-body">
+      <el-card :body-style="{ padding: 0 }">
+        <!-- tab切换 -->
+        <div class="switch">
+          <div class="switch_left">
+            <ul>
+              <li
+                v-for="item in tabOptions"
+                :key="item.key"
+                :class="{ active: activeComp == item.key }"
+                @click="activeComp = item.key"
+              >
+                {{ item.name }}
+              </li>
+            </ul>
+          </div>
+          <!-- <div class="right" style="padding: 10px">
           <el-button @click="$router.go(-1)">返回</el-button>
         </div> -->
-      </div>
-      <div class="page-title">
-        <el-page-header @back="$router.go(-1)">
+        </div>
+        <div class="page-title">
+          <!-- <el-page-header @back="$router.go(-1)">-->
           <div slot="content" class="pageContent">
             <span v-for="item in tabOptions" :key="item.key">
               {{ item.key == activeComp ? item.name + '详情' : '' }}
             </span>
           </div>
-        </el-page-header>
-      </div>
-      <div class="content-wrapper" style="margin-left: 10px">
-        <component
-          :is="activeComp"
-          :id="id"
-          :code="code"
-          :showTitle="false"
-        ></component>
-      </div>
-    </el-card>
-  </div>
+          <!-- </el-page-header> -->
+        </div>
+        <div class="content-wrapper" style="margin-left: 10px">
+          <component
+            :is="activeComp"
+            :id="id"
+            :code="code"
+            :showTitle="false"
+          ></component>
+        </div>
+      </el-card>
+    </div>
+  </el-dialog>
 </template>
 
 <script>
   import baseInfo from './edit.vue';
-  // import mould from '../components/details/mould.vue'
+  import modalTitle from '@/components/modalTitle.vue';
   import maintain from './maintain.vue';
   import repair from './repair.vue';
   import malfunction from './malfunction.vue';
-  // import InternetRecord from '../components/details/InternetRecord.vue'
   import inventory from './inventory.vue';
   import pointInspection from './point-inspection.vue';
   import internet from './InternetOther.vue';
@@ -62,7 +76,8 @@
       produceOrder,
       // InternetRecord,
       malfunction,
-      internet
+      internet,
+      modalTitle
     },
     data() {
       return {
@@ -70,6 +85,8 @@
         id: '',
         code: '',
         activeComp: 'baseInfo',
+        addRepairNotesDialog: false,
+        fullscreen: false,
         tabOptions: [
           { key: 'baseInfo', name: '设备信息' },
           { key: 'pointInspection', name: '巡点检记录' },
@@ -89,6 +106,20 @@
       this.id = this.$route.query.id;
       this.code = this.$route.query.code;
       console.log('routerouterouteroute', this.$route);
+    },
+
+    methods: {
+      open(code, id) {
+        this.addRepairNotesDialog = true;
+        console.log(code, id, 'code, id');
+        this.code = code;
+        this.id = id;
+      },
+
+      handleClose() {
+        this.$emit('refresh');
+        this.addRepairNotesDialog = false;
+      }
     }
   };
 </script>

+ 32 - 14
src/views/produce/components/device/components/edit.vue

@@ -166,6 +166,14 @@
       showTitle: {
         type: Boolean,
         default: true
+      },
+      id: {
+        type: String,
+        default: true
+      },
+      code: {
+        type: String,
+        default: true
       }
     },
     data() {
@@ -181,7 +189,7 @@
         pageType: 'add',
         btnLoading: false,
         // 设备主键id
-        id: '',
+        // id: '',
         form: {
           extInfoSelf: [],
           // 基本信息
@@ -210,7 +218,8 @@
           workshopName: '',
           // 请选择工厂
           factoryCode: '',
-          factoryName: ''
+          factoryName: '',
+          fullscreen: false
         },
         // 图片
         imageUrl: null,
@@ -255,7 +264,8 @@
         sourceDICT: '',
         // 网络状态
         networkStatus: '',
-        id: ''
+        // id: '',
+        addRepairNotesDialog: false
       };
     },
     watch: {},
@@ -274,17 +284,19 @@
       }
     },
     async created() {
-      if (this.$route.query.id) {
-        this.pageType = 'edit';
-        this.id = this.$route.query.id;
-        await this.getInfo();
-        this.title = '编辑设备信息';
-        // this.getgys();
-        // await this._getWarehouseChildren();
-      } else {
-        this.pageType = 'add';
-        this.title = '新增设备信息';
-      }
+      // if (this.$route.query.id) {
+      //   this.pageType = 'edit';
+      //   this.id = this.$route.query.id;
+      //   await this.getInfo();
+      //   this.title = '编辑设备信息';
+      //   // this.getgys();
+      //   // await this._getWarehouseChildren();
+      // } else {
+      //   this.pageType = 'add';
+      //   this.title = '新增设备信息';
+      // }
+      this.pageType = 'edit';
+      await this.getInfo();
     },
     methods: {
       handlwpbm() {
@@ -314,6 +326,12 @@
         this.form.code = data.code; //Date.now(); //res.data[0].onlyCode;
         this.initOtherMsg();
       },
+
+      open(code, id) {
+        this.addRepairNotesDialog = true;
+        console.log(code, id, 'code, id');
+      },
+
       // 计算过保时间
       setGbTime(basic, value, type) {
         basic = Date.parse(basic);

+ 2 - 2
src/views/produce/components/device/components/link-msg.vue

@@ -189,8 +189,8 @@
     },
     methods: {
       async getData() {
-        const data = await getBomRoutingList(this.id);
-
+        // const data = await getBomRoutingList(this.id);
+        const data = [];
         this.bomData = data?.bomList || [];
         this.pathData = data?.routingList || [];
       },

+ 66 - 28
src/views/produce/components/device/index.vue

@@ -42,31 +42,51 @@
         </div>
       </div>
 
-      <div class="device-list">
-        <div class="device-box" v-for="item in data" :key="item.id">
+      <div class="device-list" v-if="deviceList.length != 0">
+        <div class="device-box" v-for="item in deviceList" :key="item.id">
           <div class="status-box">
-            <p>空闲中</p>
+            <p v-if="item.runStatus == '0'">启动</p>
+            <p v-if="item.runStatus == '1'">空闲中</p>
+            <p v-if="item.runStatus == '2'">运行</p>
+            <p v-if="item.runStatus == '3'">故障</p>
+            <p v-if="item.runStatus == '4'">检修</p>
+            <p v-if="item.runStatus == '5'">停机</p>
+            <p v-if="item.runStatus == '6'">待料</p>
+            <p v-if="item.runStatus == '7'">占用</p>
           </div>
           <div class="title-box">
-            <span>切割机</span>
+            <span>{{ item.name }}</span>
           </div>
           <div class="image-box">
-            <img src="" alt="" />
+            <img
+              :src="
+                Object.keys(item.imageUrl).length != 0
+                  ? item.imageUrl
+                  : 'http://192.168.1.251:51001/eam/img/upload-placeholder.39eb69d1.svg'
+              "
+              alt=""
+              @click="checkDetail(item)"
+            />
           </div>
           <div class="info-box">
-            <p>分类:</p> <el-input disabled v-model="item.id"></el-input>
+            <p>分类:</p>
+            <el-input disabled v-model="item.rootCategoryLevelName"></el-input>
           </div>
           <div class="info-box">
-            <p>编码:</p> <el-input disabled v-model="item.id"></el-input>
+            <p>编码:</p> <el-input disabled v-model="item.code"></el-input>
           </div>
 
           <div class="btn-box">
-            <el-button type="primary" class="btn" @click="repairBtn"
+            <el-button type="primary" class="btn" @click="repairBtn(item)"
               >报修</el-button
             >
           </div>
         </div>
       </div>
+
+      <div v-else>
+        <el-empty description="暂无设备数据"></el-empty>
+      </div>
     </el-drawer>
 
     <!-- 新建或编辑弹窗 -->
@@ -77,58 +97,76 @@
       :infoData="infoData"
       @refresh="reload"
     />
+
+    <deviceDetail ref="deviceDetailRef" @refresh="reload"></deviceDetail>
   </div>
 </template>
 
 <script>
   import AddDialog from './components/addDialog.vue';
+  import { getAssetList, getTaskDeviceList } from '@/api/produce/device.js';
+  import { typeName } from '@/views/produce/components/common.js';
+  import deviceDetail from './components/detail.vue';
   export default {
     name: 'device',
 
     components: {
-      AddDialog
+      AddDialog,
+      deviceDetail
     },
 
     data() {
       return {
         isFullscreen: false,
         drawer: false,
-        data: [
-          { id: 1 },
-          { id: 2 },
-          { id: 3 },
-          { id: 4 },
-          { id: 5 },
-          { id: 6 },
-          { id: 7 },
-          { id: 8 },
-          { id: 9 },
-          { id: 10 }
-        ],
         addDialogTitle: '新增报修记录',
         deviceInfo: {},
-        infoData: {}
+        infoData: {},
+        deviceList: [],
+        typeName,
+        taskId: ''
       };
     },
 
     methods: {
-      open(data) {
-        console.log(data, 'this.workData.list');
+      open(taskId) {
+        console.log(taskId, 'this.workData.list');
+        this.taskId = taskId;
         this.drawer = true;
+        this.getDeviceList();
+      },
+
+      async getDeviceList() {
+        await getTaskDeviceList(this.taskId).then((res) => {
+          this.deviceList = res;
+          if (this.deviceList.length != 0) {
+            this.deviceList.forEach((item) => {
+              item.rootCategoryLevelName =
+                typeName[Number(item.rootCategoryLevelId)];
+            });
+          }
+        });
       },
 
       handleClose() {
         this.drawer = false;
       },
 
+      checkDetail(item) {
+        // console.log(this.$refs, 'this.$refs');
+        this.$refs.deviceDetailRef.open(item.code, item.id);
+      },
+
       handleFull() {
         this.isFullscreen = !this.isFullscreen;
         this.$forceUpdate();
       },
-      repairBtn(row) {
-        this.$refs.addDialogRef.init(row);
+      repairBtn(item) {
+        this.$refs.addDialogRef.init(item);
       },
-      reload() {}
+      reload() {
+        this.getDeviceList();
+      }
     }
   };
 </script>
@@ -205,7 +243,7 @@
 
       .image-box {
         margin: 0 auto;
-        border: 1px solid #333;
+        // border: 1px solid #333;
         width: 20rem;
         height: 20rem;
         margin-bottom: 1rem;

+ 17 - 16
src/views/produce/components/footBtn.vue

@@ -7,11 +7,7 @@
       :style="{ background: item.bjColor }"
       @click="footClick(item.type)"
     >
-      <img
-        src="@/assets/Frame.png"
-        class="Frame"
-        v-if="item.type !== 'turnover'"
-      />
+      <img src="../../../assets/Frame.png" class="Frame" />
       {{ item.name }}
     </div>
   </div>
@@ -87,20 +83,25 @@
             type: 'error',
             bjColor: '#cc0000'
           },
-          // {
-          //   name: 'BOM',
-          //   type: 'bom',
-          //   bjColor: '#BB5500'
-          // }
-          // {
-          //   name: '设备',
-          //   type: 'device',
-          //   bjColor: '#008866'
-          // },
           {
+            name: 'BOM',
+            type: 'bom',
+            bjColor: '#BB5500'
+          },
+          {
+            name: '设备',
+            type: 'device',
+            bjColor: '#008866'
+          },
+          {
+            name: '周转车',
             type: 'turnover',
-            bjColor: '#E6F7E7'
+            bjColor: '#660066'
           }
+          // {
+          //   type: 'turnover',
+          //   bjColor: '#E6F7E7'
+          // }
         ],
         btnList2: [
           // {

+ 151 - 29
src/views/produce/components/jobBooking/components/batchPackagingGrouping.vue

@@ -24,6 +24,14 @@
         "
         >否</span
       >
+
+      <!-- <el-button
+        type="primary"
+        size="mini"
+        style="margin-left: 40px"
+        @click="checkUnpack"
+        >拆包</el-button
+      > -->
     </div>
     <div v-if="objData.isUnpack == '1'">
       <div class="col userInp" style="display: flex; align-items: center">
@@ -198,6 +206,71 @@
         </div>
       </div>
     </div>
+
+    <div v-if="isNewUnpack">
+      <div class="col userInp" style="display: flex; align-items: center">
+        <div class="label lable150 rx-cc" style="width: 100px !important"
+          >规格选择:</div
+        >
+        <el-select
+          v-model="Usertype"
+          placeholder="请选择"
+          @change="changeUserType"
+        >
+          <el-option
+            v-for="item in localdataList"
+            :key="item.value"
+            :label="item.text"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+      </div>
+
+      <!-- <div class="material">
+        <div class="content_table">
+          <div class="item">
+            <div class="lable rx-cc">包装总数 </div>
+            <div class="content content_num">
+              <el-input
+                class="uni-el-input"
+                v-model="formedNumLast"
+                type="number"
+                v-if="i == 0"
+                @input="changeinput"
+                disabled
+                style="width: 200px"
+              ></el-input>
+              <el-input
+                class="uni-el-input"
+                v-model="item.formedNumLast"
+                type="number"
+                v-else
+                disabled
+                style="width: 200px"
+              ></el-input>
+              <div class="unit">{{ item.packageUnit }}</div>
+            </div>
+          </div>
+
+          <div class="item rx-sc">
+            <div class="rx ww55">
+              <div class="lable lable200 rx-cc">{{ item.titel }}单元</div>
+              <div class="content content_num">
+                <el-input
+                  class="uni-el-input"
+                  v-model="item.packageCell"
+                  disabled
+                  style="width: 200px"
+                ></el-input>
+                <div class="unit">{{ item.packageUnit }}</div
+                >/<div class="unit">{{ item.conversionUnit }}</div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div> -->
+    </div>
   </div>
 </template>
 
@@ -299,7 +372,8 @@
             textValue: ''
           }
         ],
-        cacheKeyUrlMin: 'cacheKeyUrlMin'
+        cacheKeyUrlMin: 'cacheKeyUrlMin',
+        isNewUnpack: false
         // clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo").clientEnvironmentId,
       };
     },
@@ -595,7 +669,6 @@
       },
 
       async packageDispositionFn() {
-        console.log();
         if (!this.newCategoryId) return;
 
         let that = this;
@@ -638,41 +711,14 @@
 
           this.warehouseSpecTypeList.forEach((item) => {
             if (item.value == 2) {
-              // const num = res[0].packageCell ? res[0].packageCell : '';
-              // const packageUnit = res[0].packageUnit ? res[0].packageUnit : '';
-              // const conversionUnit = res[0].conversionUnit
-              //   ? res[0].conversionUnit
-              //   : '';
-              // let packInfo = '';
-              // if (num) {
-              //   packInfo = num + '/' + packageUnit + '/' + conversionUnit;
-              // }
               item.textValue = item.text + `(${this.selectPackInfo(res[0])})`;
             }
 
             if (item.value == 3) {
-              // const num = res[1].packageCell ? res[1].packageCell : '';
-              // const packageUnit = res[1].packageUnit ? res[1].packageUnit : '';
-              // const conversionUnit = res[1].conversionUnit
-              //   ? res[1].conversionUnit
-              //   : '';
-              // let packInfo = '';
-              // if (num) {
-              //   packInfo = num + '/' + packageUnit + '/' + conversionUnit;
-              // }
               item.textValue = item.text + `(${this.selectPackInfo(res[1])})`;
             }
 
             if (item.value == 4) {
-              // const num = res[2].packageCell ? res[2].packageCell : '';
-              // const packageUnit = res[2].packageUnit ? res[2].packageUnit : '';
-              // const conversionUnit = res[2].conversionUnit
-              //   ? res[2].conversionUnit
-              //   : '';
-              // let packInfo = '';
-              // if (num) {
-              //   packInfo = num + '/' + packageUnit + '/' + conversionUnit;
-              // }
               item.textValue = item.text + `(${this.selectPackInfo(res[2])})`;
             }
           });
@@ -717,6 +763,9 @@
         } = res;
         let textList = [];
         let arr = [];
+        if (!this.isNewUnpack) {
+        }
+
         if (this.warehouseId == 2) {
           textList.push('最小包装');
           arr.push({ list: minimumPackage });
@@ -808,6 +857,79 @@
         });
       },
 
+      // checkUnpack() {
+      //   this.$confirm('此操作将进行拆包, 是否继续?', '提示', {
+      //     confirmButtonText: '确定',
+      //     cancelButtonText: '取消',
+      //     type: 'warning'
+      //   })
+      //     .then(() => {
+      //       this.checkUnpackProduction();
+      //     })
+      //     .catch(() => {});
+      // },
+
+      // checkUnpackProduction() {
+      //   this.isNewUnpack = true;
+      //   this.getPackingData();
+      // },
+
+      // async getPackingData() {
+      //   if (!this.newCategoryId) return;
+
+      //   let that = this;
+      //   const res = await packageDisposition(this.newCategoryId);
+
+      //   if (res.length) {
+      //     res.shift();
+      //     let data = JSON.parse(JSON.stringify(res));
+      //     let list = this.groupBy(data, 'code');
+      //     this.localdataList = [];
+      //     Object.entries(list).forEach(([key, value]) => {
+      //       let obj = {
+      //         text: value[0].name,
+      //         arr: value,
+      //         value: key
+      //       };
+      //       this.localdataList.push(obj);
+      //     });
+
+      //     this.Usertype = this.localdataList[0].value;
+      //     this.text = this.localdataList[0].text;
+      //     this.value = this.localdataList[0].value;
+      //     res.map((v) => {
+      //       v.splitList = [];
+      //     });
+
+      //     this.newDispositionList = res;
+      //     // if (this.warehouseId == 2) {
+      //     //   this.newDispositionList = [res[0]];
+      //     // } else if (this.warehouseId == 3) {
+      //     //   this.newDispositionList = [res[1]];
+      //     // } else if (this.warehouseId == 4) {
+      //     //   this.newDispositionList = [res[2]];
+      //     // }
+      //     this.selectList = res;
+      //     this.initData(this.localdataList[0].arr);
+
+      //     console.log(this.newDispositionList, 'this.newDispositionList');
+      //     // this.initFn(this.localdataList[0].arr);
+      //   }
+      // },
+
+      // initData(v) {
+      //   if (v.length) {
+      //     this.withinQuantity = v[1].packageCell; //内包装数量
+      //     this.withinUnit = v[1].conversionUnit; //内包装单位
+      //     this.outsideQuantity = v[2].packageCell; //外包装数量
+      //     this.outsideUnit = v[2].conversionUnit; //外包装单位
+      //     this.minimumUnit = v[0].conversionUnit;
+      //   }
+
+      //   console.log(v[0], 'v[0]');
+      //   // this.handleSplit(v[0]);
+      // },
+
       // 第一次调用
       handleSplit(v) {
         console.log(v, 99655);

+ 251 - 8
src/views/produce/components/jobBooking/components/packingTgBom.vue

@@ -7,7 +7,38 @@
         }})个
       </div>
 
-      <div class="rx-bc"> </div>
+      <div class="title_box rx-bc mt6">
+        <div
+          v-if="!isDetails && isEngrave"
+          class="rx-bc"
+          style="margin-left: 20px"
+        >
+          <el-button type="text" size="mini" @click="batchEngrave()"
+            >批量填写刻码</el-button
+          >
+        </div>
+
+        <div
+          v-if="!isDetails && isDisposal"
+          class="rx-bc"
+          style="margin-left: 20px"
+        >
+          <el-button type="text" size="mini" @click="batchDisposal()"
+            >批量处置</el-button
+          >
+        </div>
+
+        <!-- <div
+          class="rx-bc"
+          v-if="!isDetails && isChoose"
+          style="margin-left: 20px"
+          ><el-button type="text" size="mini" @click="batchDelete()"
+            >批量删除</el-button
+          >
+        </div> -->
+      </div>
+
+      <!-- <div class="rx-bc"> </div> -->
     </div>
 
     <el-table
@@ -26,13 +57,23 @@
         </template>
       </el-table-column>
 
-      <el-table-column label="编码" prop="code" minWidth="110">
+      <el-table-column
+        label="编码"
+        prop="code"
+        minWidth="110"
+        show-overflow-tooltip
+      >
         <template slot-scope="{ row, $index }">
           {{ row.code }}
         </template>
       </el-table-column>
 
-      <el-table-column label="名称" prop="name" minWidth="110">
+      <el-table-column
+        label="名称"
+        prop="name"
+        minWidth="110"
+        show-overflow-tooltip
+      >
         <template slot-scope="{ row, $index }">
           {{ row.name }}
         </template>
@@ -81,19 +122,19 @@
         </template>
       </el-table-column>
 
-      <el-table-column label="型号" prop="modelType">
+      <el-table-column label="型号" prop="modelType" show-overflow-tooltip>
         <template slot-scope="{ row, $index }">
           {{ row.modelType }}
         </template>
       </el-table-column>
 
-      <el-table-column label="规格" prop="specification">
+      <el-table-column label="规格" prop="specification" show-overflow-tooltip>
         <template slot-scope="{ row, $index }">
           {{ row.specification }}
         </template>
       </el-table-column>
 
-      <el-table-column label="牌号" prop="brandNum">
+      <el-table-column label="牌号" prop="brandNum" show-overflow-tooltip>
         <template slot-scope="{ row, $index }">
           {{ row.brandNum }}
         </template>
@@ -197,7 +238,7 @@
         </template>
       </el-table-column>
 
-      <el-table-column label="处置" prop="">
+      <el-table-column label="处置" prop="" width="120">
         <template slot-scope="{ row, $index }">
           <el-select
             size="mini"
@@ -205,6 +246,7 @@
             filterable
             v-model="row.extInfo.taskId"
             placeholder="请选择"
+            style="width: 100px"
           >
             <el-option
               v-for="item in stepsList"
@@ -234,11 +276,81 @@
         </template>
       </el-table-column>
     </el-table>
+
+    <el-dialog
+      title="刻码"
+      v-if="dialogEngrave"
+      :visible.sync="dialogEngrave"
+      width="30%"
+      :before-close="handleClose"
+      append-to-body
+    >
+      <el-form ref="form" :model="form" label-width="90px">
+        <el-form-item label="刻码区间">
+          <el-input
+            size="mini"
+            type="number"
+            v-model="form.minNumber"
+            placeholder="请输入刻码最小值"
+            prop="digit"
+            style="width: 180px"
+          />
+          -
+          <el-input
+            size="mini"
+            type="number"
+            v-model="form.maxNumber"
+            placeholder="请输入刻码最大值"
+            prop="digit"
+            style="width: 180px"
+          />
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogEngrave = false">取 消</el-button>
+        <el-button type="primary" @click="batchEngraveConfirm()"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+
+    <el-dialog
+      title="处置类型"
+      v-if="dialogVisible"
+      :visible.sync="dialogVisible"
+      width="30%"
+      :before-close="handleClose"
+      append-to-body
+    >
+      <el-form ref="form" :model="form" label-width="80px">
+        <el-form-item label="处置类型">
+          <el-select
+            size="mini"
+            filterable
+            v-model="form.taskId"
+            placeholder="请选择"
+          >
+            <el-option
+              v-for="item in stepsList"
+              :label="item.taskTypeName"
+              :value="item.taskId"
+              :key="item.taskId"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="batchConfirm()">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
   import { getTaskInstanceList } from '@/api/produce/job';
+
   export default {
     props: {
       item: {
@@ -258,17 +370,43 @@
       isWarehousing: {
         type: Boolean,
         default: false
+      },
+      isChoose: {
+        type: Boolean,
+        default: false
+      },
+      isEngrave: {
+        type: Boolean,
+        default: false
+      },
+      isDisposal: {
+        type: Boolean,
+        default: false
       }
     },
 
     data() {
       return {
-        stepsList: []
+        stepsList: [],
+        selection: [],
+        form: {
+          taskId: '',
+          minNumber: '',
+          maxNumber: ''
+        },
+        dialogVisible: false,
+        dialogEngrave: false,
+        batchVisible: false
       };
     },
 
     mounted() {
       this.getTaskFn();
+      if (this.list.length != 0) {
+        this.list.forEach((item) => {
+          item.extInfo.taskId = item.extInfo.taskId + '';
+        });
+      }
     },
 
     computed: {
@@ -285,6 +423,111 @@
             return item.taskId != -2;
           });
         });
+      },
+
+      batchDisposal() {
+        this.form.taskId = '';
+        this.dialogVisible = true;
+      },
+
+      batchEngrave() {
+        this.form.minNumber = '';
+        this.form.maxNumber = '';
+        this.dialogEngrave = true;
+      },
+
+      batchConfirm() {
+        if (!this.form.taskId) {
+          this.$message({ message: '请选择处置类型', type: 'warning' });
+          return false;
+        }
+
+        const data = this.stepsList.find((it) => it.taskId == this.form.taskId);
+
+        this.list.forEach((item, index) => {
+          this.$set(this.list[index].extInfo, 'taskId', this.form.taskId);
+          this.$set(this.list[index].extInfo, 'taskName', data.taskTypeName);
+        });
+
+        this.$forceUpdate();
+
+        this.dialogVisible = false;
+      },
+
+      handleClose() {
+        this.dialogVisible = false;
+        this.dialogEngrave = false;
+        this.batchVisible = false;
+      },
+
+      batchEngraveConfirm() {
+        if (!this.form.minNumber) {
+          this.$message({ message: '请输入最小刻码', type: 'warning' });
+          return false;
+        }
+
+        if (!this.form.maxNumber) {
+          this.$message({ message: '请输入最大刻码', type: 'warning' });
+          return false;
+        }
+
+        if (Number(this.form.minNumber) > Number(this.form.maxNumber)) {
+          this.$message({
+            message: '最小刻码不能大于最大刻码',
+            type: 'warning'
+          });
+          return false;
+        }
+
+        this.list.forEach((item, index) => {
+          this.$set(this.list[index].extInfo, 'engrave', '');
+        });
+
+        const engraveNumber =
+          Number(this.form.maxNumber) - Number(this.form.minNumber) + 1;
+
+        console.log(engraveNumber, '刻码数量');
+
+        for (let i = 0; i < engraveNumber; i++) {
+          if (this.list.length < i) return;
+
+          this.$set(
+            this.list[i].extInfo,
+            'engrave',
+            Number(this.form.minNumber) + i
+          );
+        }
+        this.$forceUpdate();
+        this.dialogEngrave = false;
+      },
+
+      batchDelete() {
+        if (!this.selection.length) {
+          this.$message.warning('请至少选择一条数据');
+          return;
+        }
+        let ids = this.selection.map((item) => item.id || item.instanceId);
+        this.$confirm('确定要删除选中的报工信息吗?', '提示', {
+          type: 'warning'
+        })
+          .then(() => {
+            // console.log(total, '总数------------------');
+            ids.forEach((sitem, sindex) => {
+              this.list.forEach((item, index) => {
+                let id = item.id || item.instanceId;
+                if (id == sitem) {
+                  this.list.splice(index, 1);
+                }
+              });
+            });
+          })
+          .then(() => {
+            if (this.list.length == 0) {
+              this.$set(this.item.workReportInfo, 'formedNum', 0);
+              this.$set(this.item.workReportInfo, 'notFormedNum', 0);
+            }
+          })
+          .catch(() => {});
       }
     }
   };

+ 6 - 2
src/views/produce/components/jobBooking/components/semiProductJobBom.vue

@@ -305,11 +305,15 @@
             ) &&
             Object.prototype.hasOwnProperty.call(
               row.extInfo.productionTimes,
-              item.currentTaskDiagram.taskId
+              item.currentTaskDiagram ? item.currentTaskDiagram.taskId : ''
             )
           "
         >
-          {{ row.extInfo.productionTimes[item.currentTaskDiagram.taskId] }}
+          {{
+            item.currentTaskDiagram
+              ? row.extInfo.productionTimes[item.currentTaskDiagram.taskId]
+              : ''
+          }}
         </div>
 
         <div class="tag_box" v-if="row.isCache">缓</div>

+ 20 - 2
src/views/produce/components/jobBooking/details.vue

@@ -113,7 +113,25 @@
             v-if="
               objData.semiProductList &&
               objData.semiProductList.length != 0 &&
-              objData.singleReport == 1
+              objData.singleReport == 1 &&
+              clientEnvironmentId != 3
+            "
+            :list="objData.semiProductList"
+            :item="objData"
+            :isDetails="true"
+            :singleReport="objData.singleReport"
+            :equipmentList="objData.equipmentList"
+          >
+          </semiProductJobBom>
+
+          <!-- 碳谷单件报工 -->
+          <semiProductJobBom
+            v-if="
+              objData.semiProductList &&
+              objData.semiProductList.length != 0 &&
+              objData.singleReport == 1 &&
+              clientEnvironmentId == 3 &&
+              taskType != 4
             "
             :list="objData.semiProductList"
             :item="objData"
@@ -259,7 +277,7 @@
             v-if="
               objData.packInfo &&
               objData.packInfo.pickOutInList &&
-              objData.packInfo.z == 1 &&
+              objData.singleReport == 1 &&
               taskType == 4 &&
               clientEnvironmentId == 3
             "

+ 21 - 1
src/views/produce/components/jobBooking/index.vue

@@ -234,6 +234,24 @@
           @chooseData="chooseData"
         ></batchSemiProductJobBom>
 
+        <!-- <batchSemiProductJobBom
+          :singleReport="item.singleReport"
+          v-if="
+            item.semiProductList &&
+            item.semiProductList.length != 0 &&
+            item.singleReport == 0 &&
+            clientEnvironmentId == 3 &&
+            taskObj.type == 4
+          "
+          :item="item"
+          :list="item.semiProductList"
+          :equipmentList="item.equipmentList"
+          :isChoose="isChoose"
+          :isEngrave="isEngrave"
+          :isDisposal="isDisposal"
+          @chooseData="chooseData"
+        ></batchSemiProductJobBom> -->
+
         <!-- <checkbox :tableData="item.semiProductList" ></checkbox> -->
         <!-- :itemData="item" @tableDataFn="tableDataFn" -->
         <!-- 碳谷批量报工 -->
@@ -242,7 +260,6 @@
           v-if="
             item.semiProductList &&
             item.semiProductList.length != 0 &&
-            taskObj.type != 4 &&
             taskObj.type != 6 &&
             item.singleReport == 0 &&
             clientEnvironmentId == 3
@@ -358,6 +375,9 @@
           "
           :list="item.semiProductList"
           :item="item"
+          :isChoose="isChoose"
+          :isEngrave="isEngrave"
+          :isDisposal="isDisposal"
         ></packingTgBom>
 
         <div

+ 6 - 3
src/views/produce/components/new_produceOrder.vue

@@ -134,7 +134,8 @@
           {
             prop: 'batchNo',
             label: '批次号',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
@@ -142,13 +143,15 @@
             slot: 'code',
             label: '生产工单号',
             align: 'center',
-            minWidth: '160'
+            minWidth: '160',
+            showOverflowTooltip: true
           },
           {
             prop: 'produceRoutingName',
             label: '工艺路线',
             align: 'center',
-            minWidth: '160'
+            minWidth: '160',
+            showOverflowTooltip: true
           },
 
           {

+ 27 - 3
src/views/produce/components/picking/index.vue

@@ -303,7 +303,7 @@
 </template>
 
 <script>
-  import pickingList from './pickingList.vue';
+  import pickingList from './newPickingList.vue';
   import {
     workorderList,
     getCode,
@@ -526,7 +526,6 @@
             idsList
           );
         }
-
       },
 
       detailData(data, dimension, index) {
@@ -651,6 +650,8 @@
             : item.warehouseLists;
         });
 
+        // console.log(list, '111111');
+
         // list.forEach((it) => {
         //   if (it.warehouseList.length != 0) {
         //     if (!it.warehouseIdList) {
@@ -662,12 +663,35 @@
 
         this.workList.forEach((e) => {
           if (e.id == id) {
-            e.pickList = list;
+            const newData = [];
+            if (list.length != 0) {
+              list.forEach((it) => {
+                newData.push(this.deepCopy(it));
+              });
+            }
+            // e.pickList = list;
+            e.pickList = newData;
             this.$forceUpdate();
           }
         });
       },
 
+      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);
+      },
+
       save() {
         if (this.workList.length > 0) {
           let bol;

+ 914 - 0
src/views/produce/components/picking/newPickingList.vue

@@ -0,0 +1,914 @@
+<template>
+  <el-dialog
+    :title="title"
+    :visible.sync="visible"
+    v-if="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="75%"
+  >
+    <el-card shadow="never">
+      <pickingListSearch @search="reload" ref="searchRef" />
+
+      <!-- <pickingSearch v-else @search="reload" ref="pickingRef" /> -->
+
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div class="ele-border-lighter split-layout-right-content">
+          <AssetTree
+            ref="assetTreeRef"
+            :treeIds="treeIds"
+            @handleNodeClick="handleNodeClick"
+            @setRootId="setRootId"
+          />
+        </div>
+        <!-- 表格 -->
+
+        <template v-slot:content>
+          <ele-pro-table
+            :initLoad="false"
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            :selection.sync="selection"
+            row-key="id"
+            height="calc(100vh - 350px)"
+            class="dict-table"
+            :cache-key="tableKey"
+            :row-style="rowStyle"
+            :row-click-checked="true"
+            :row-click-checked-intelligent="false"
+            @update:selection="handleSelectionChange"
+          >
+            <template v-slot:toolbar>
+              <el-alert
+                type="info"
+                :closable="false"
+                class="ele-alert-border"
+                style="width: 300px"
+              >
+                <i class="el-icon-info ele-text-info"></i>
+                <span class="ele-text">
+                  <span>
+                    已选择
+                    <b class="ele-text-info">{{ allSelection.length }}</b>
+                    项数据<em></em>
+                  </span>
+                </span>
+                <el-link type="primary" :underline="false" @click="clearChoose">
+                  清空
+                </el-link>
+              </el-alert>
+            </template>
+
+            <template v-slot:code="{ row }">
+              {{ row.rootCategoryLevelId == 4 ? row.codeNumber : row.code }}
+            </template>
+
+            <template v-slot:runStatus="{ row }">
+              {{ stateList[Number(row.runStatus)] }}
+            </template>
+
+            <template v-slot:vehicleLen="{ row }">
+              {{ row.extInfo.vehicleLen || '-' }}
+              {{ row.extInfo.wilde || '-' }} {{ row.extInfo.hight || '-' }}
+            </template>
+
+            <template v-slot:status="{ row }">
+              <span
+                :style="{ color: row.status == 0 ? '#157A2C' : '#FFA929' }"
+                >{{
+                  row.status == 0 ? '空闲' : row.status == 1 ? '占用' : ''
+                }}</span
+              >
+            </template>
+
+            <template v-slot:packingCountBase="{ row }">
+              {{ row.packingCountBase }} {{ row.minUnit }}
+            </template>
+
+            <template v-slot:availableCountBase="{ row }">
+              {{ row.availableCountBase }} {{ row.measuringUnit }}
+            </template>
+
+            <template v-slot:weight="{ row }">
+              {{ row.weight }} {{ row.weightUnit }}
+            </template>
+
+            <!-- 库存保质期 -->
+            <template v-slot:expirationDate="{ row }">
+              <span v-if="row.expirationDate">
+                {{ row.expirationDate ? row.expirationDate : '-' }}
+                {{
+                  row.expirationDateUnit == 'year'
+                    ? '年'
+                    : row.expirationDateUnit == 'month'
+                    ? '月'
+                    : '日'
+                }}
+              </span>
+            </template>
+            <!-- 质检状态 -->
+            <template v-slot:qualityStatus="{ row }">
+              <span v-if="row.qualityResult == 0 || row.qualityResult == 1"
+                >已检</span
+              >
+              <span v-else-if="row.qualityStatus == 1">已检</span>
+              <span v-else-if="row.qualityStatus == 0">未检</span>
+              <span v-else>-</span>
+            </template>
+            <!-- 质检结果 -->
+            <template v-slot:qualityResult="{ row }">
+              <span v-if="row.qualityResult == 0 || row.qualityResult == ''"
+                >合格</span
+              >
+              <span v-else-if="row.qualityResult == 1">不合格</span>
+              <span v-else-if="row.qualityResult == 3">让步接收</span>
+              <span v-else>-</span>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import AssetTree from '../../components/assetTree.vue';
+  import pickingListSearch from './pickingListSearch.vue';
+  import pickingSearch from './pickingSearch.vue';
+  import {
+    pageeLedgerMain,
+    assetPage,
+    listInProduct
+  } from '@/api/produce/workOrder';
+
+  // import { deepCopy } from '@/utils/util.js';
+
+  import { getOutindetailtwo } from '@/api/produce/picking';
+
+  export default {
+    components: { AssetTree, pickingListSearch, pickingSearch },
+    props: {
+      isType: {
+        type: String,
+        default: '',
+        required: true
+      }
+    },
+    data() {
+      return {
+        visible: false,
+
+        id: null,
+        treeIds: null,
+        categoryLevelId: null,
+        rootCategoryLevelId: null,
+        isCategory: true,
+
+        stateList: [
+          '启动',
+          '空闲',
+          '运行',
+          '故障',
+          '检修',
+          '停机',
+          '待料',
+          '占用'
+        ],
+
+        selection: [],
+
+        allSelection: [],
+        temporaryList: [],
+        cloumsAll: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            reserveSelection: true
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 50,
+            align: 'center'
+          },
+          {
+            prop: 'code',
+            label: '物品编码',
+            slot: 'code'
+          },
+          {
+            prop: 'codeNumber',
+            label: '编号',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '名称',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'modelType',
+            label: '型号',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center'
+          },
+          // {
+          //   prop: 'manualBatchNo',
+          //   label: '批次号',
+          //   align: 'center'
+          // },
+          {
+            prop: 'availableCountBase',
+            label: '计量库存数量',
+            sortable: 'custom',
+            slot: 'availableCountBase',
+            showOverflowTooltip: true,
+            width: 130,
+            align: 'center'
+          },
+
+          ...([1, 23, 8].includes(Number(this.rootCategoryLevelId))
+            ? [
+                {
+                  prop: 'packingCountBase',
+                  label: '包装库存',
+                  slot: 'packingCountBase',
+                  showOverflowTooltip: true
+                }
+              ]
+            : []),
+
+          {
+            prop: 'weight',
+            label: '重量',
+            showOverflowTooltip: true,
+            slot: 'weight'
+          },
+
+          {
+            prop: 'expirationDate',
+            slot: 'expirationDate',
+            label: '库存保质期',
+            width: 100
+          },
+          {
+            prop: 'expirationTime',
+            label: '周期倒计时',
+            showOverflowTooltip: true,
+            width: 100
+          },
+          {
+            prop: 'qualityResult',
+            slot: 'qualityResult',
+            label: '质检结果',
+            showOverflowTooltip: true,
+            width: 100
+          },
+          {
+            prop: 'qualityStatus',
+            slot: 'qualityStatus',
+            label: '质检状态',
+            showOverflowTooltip: true,
+            width: 100
+          },
+          {
+            prop: 'pathName',
+            width: 230,
+            label: '仓库',
+            showOverflowTooltip: true
+          },
+
+          ...(this.rootCategoryLevelId == '4'
+            ? [
+                {
+                  prop: 'workstationName',
+                  label: '工位',
+                  showOverflowTooltip: true
+                },
+
+                {
+                  prop: 'runStatus',
+                  label: '状态',
+                  slot: 'runStatus',
+                  showOverflowTooltip: true
+                }
+              ]
+            : []),
+
+          // ...(this.rootCategoryLevelId == '5'
+          //   ? [
+          //       {
+          //         prop: 'dieHoleNum',
+          //         label: '模孔数量',
+          //         showOverflowTooltip: true
+          //       },
+          //       {
+          //         prop: 'mandrelDiameter',
+          //         label: '芯棒直径',
+          //         showOverflowTooltip: true
+          //       },
+          //       {
+          //         prop: 'shrinkEffictive',
+          //         label: '收缩系数',
+          //         showOverflowTooltip: true
+          //       }
+          //     ]
+          //   : []),
+
+          // ...(this.rootCategoryLevelId == '7'
+          //   ? [
+          //       {
+          //         prop: 'materialQuality',
+          //         label: '材质',
+          //         showOverflowTooltip: true
+          //       },
+
+          //       {
+          //         prop: 'vehicleLen',
+          //         label: '长宽高',
+          //         slot: 'vehicleLen',
+          //         showOverflowTooltip: true
+          //       }
+          //     ]
+          //   : []),
+
+          ...(this.rootCategoryLevelId == '8'
+            ? [
+                {
+                  prop: 'extInfo.slotNum',
+                  label: '槽数',
+                  showOverflowTooltip: true
+                }
+              ]
+            : []),
+
+          ...(this.rootCategoryLevelId == '11'
+            ? [
+                {
+                  prop: 'status',
+                  label: '状态',
+                  slot: 'status',
+                  showOverflowTooltip: true
+                },
+
+                {
+                  prop: 'region',
+                  label: '位置',
+                  showOverflowTooltip: true
+                }
+              ]
+            : [])
+        ]
+      };
+    },
+
+    computed: {
+      tableKey() {
+        return `table-${this.rootCategoryLevelId}`;
+      },
+
+      // 表格列配置
+      columns() {
+        return this.cloumsAll;
+
+        // return [
+        //   {
+        //     width: 45,
+        //     type: 'selection',
+        //     columnKey: 'selection',
+        //     align: 'center',
+        //     reserveSelection: true
+        //   },
+        //   {
+        //     columnKey: 'index',
+        //     label: '序号',
+        //     type: 'index',
+        //     width: 50,
+        //     align: 'center'
+        //   },
+        //   {
+        //     prop: 'code',
+        //     label: '物品编码',
+        //     slot: 'code'
+        //   },
+        //   {
+        //     prop: 'codeNumber',
+        //     label: '编号',
+        //     showOverflowTooltip: true
+        //   },
+        //   {
+        //     prop: 'name',
+        //     label: '名称',
+        //     showOverflowTooltip: true
+        //   },
+        //   {
+        //     prop: 'brandNum',
+        //     label: '牌号',
+        //     showOverflowTooltip: true
+        //   },
+        //   {
+        //     prop: 'specification',
+        //     label: '规格',
+        //     showOverflowTooltip: true
+        //   },
+        //   {
+        //     prop: 'modelType',
+        //     label: '型号',
+        //     showOverflowTooltip: true
+        //   },
+
+        //   {
+        //     prop: 'batchNo',
+        //     label: '批次号',
+        //     align: 'center'
+        //   },
+        //   // {
+        //   //   prop: 'manualBatchNo',
+        //   //   label: '批次号',
+        //   //   align: 'center'
+        //   // },
+        //   {
+        //     prop: 'availableCountBase',
+        //     label: '计量库存数量',
+        //     sortable: 'custom',
+        //     slot: 'availableCountBase',
+        //     showOverflowTooltip: true,
+        //     width: 130,
+        //     align: 'center'
+        //   },
+
+        //   ...([1, 23, 8].includes(Number(this.rootCategoryLevelId))
+        //     ? [
+        //         {
+        //           prop: 'packingCountBase',
+        //           label: '包装库存',
+        //           slot: 'packingCountBase',
+        //           showOverflowTooltip: true
+        //         }
+        //       ]
+        //     : []),
+
+        //   {
+        //     prop: 'weight',
+        //     label: '重量',
+        //     showOverflowTooltip: true,
+        //     slot: 'weight'
+        //   },
+
+        //   {
+        //     prop: 'expirationDate',
+        //     slot: 'expirationDate',
+        //     label: '库存保质期',
+        //     width: 100
+        //   },
+        //   {
+        //     prop: 'expirationTime',
+        //     label: '周期倒计时',
+        //     showOverflowTooltip: true,
+        //     width: 100
+        //   },
+        //   {
+        //     prop: 'qualityResult',
+        //     slot: 'qualityResult',
+        //     label: '质检结果',
+        //     showOverflowTooltip: true,
+        //     width: 100
+        //   },
+        //   {
+        //     prop: 'qualityStatus',
+        //     slot: 'qualityStatus',
+        //     label: '质检状态',
+        //     showOverflowTooltip: true,
+        //     width: 100
+        //   },
+        //   {
+        //     prop: 'pathName',
+        //     width: 230,
+        //     label: '仓库',
+        //     showOverflowTooltip: true
+        //   },
+
+        //   ...(this.rootCategoryLevelId == '4'
+        //     ? [
+        //         {
+        //           prop: 'workstationName',
+        //           label: '工位',
+        //           showOverflowTooltip: true
+        //         },
+
+        //         {
+        //           prop: 'runStatus',
+        //           label: '状态',
+        //           slot: 'runStatus',
+        //           showOverflowTooltip: true
+        //         }
+        //       ]
+        //     : []),
+
+        //   // ...(this.rootCategoryLevelId == '5'
+        //   //   ? [
+        //   //       {
+        //   //         prop: 'dieHoleNum',
+        //   //         label: '模孔数量',
+        //   //         showOverflowTooltip: true
+        //   //       },
+        //   //       {
+        //   //         prop: 'mandrelDiameter',
+        //   //         label: '芯棒直径',
+        //   //         showOverflowTooltip: true
+        //   //       },
+        //   //       {
+        //   //         prop: 'shrinkEffictive',
+        //   //         label: '收缩系数',
+        //   //         showOverflowTooltip: true
+        //   //       }
+        //   //     ]
+        //   //   : []),
+
+        //   // ...(this.rootCategoryLevelId == '7'
+        //   //   ? [
+        //   //       {
+        //   //         prop: 'materialQuality',
+        //   //         label: '材质',
+        //   //         showOverflowTooltip: true
+        //   //       },
+
+        //   //       {
+        //   //         prop: 'vehicleLen',
+        //   //         label: '长宽高',
+        //   //         slot: 'vehicleLen',
+        //   //         showOverflowTooltip: true
+        //   //       }
+        //   //     ]
+        //   //   : []),
+
+        //   ...(this.rootCategoryLevelId == '8'
+        //     ? [
+        //         {
+        //           prop: 'extInfo.slotNum',
+        //           label: '槽数',
+        //           showOverflowTooltip: true
+        //         }
+        //       ]
+        //     : []),
+
+        //   ...(this.rootCategoryLevelId == '11'
+        //     ? [
+        //         {
+        //           prop: 'status',
+        //           label: '状态',
+        //           slot: 'status',
+        //           showOverflowTooltip: true
+        //         },
+
+        //         {
+        //           prop: 'region',
+        //           label: '位置',
+        //           showOverflowTooltip: true
+        //         }
+        //       ]
+        //     : [])
+        // ];
+      }
+    },
+    watch: {},
+    methods: {
+      /* 表格数据源 */
+      async datasource({ page, where, limit }) {
+        let URL;
+
+        let param = {
+          ...where,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryLevelId
+        };
+        if (this.isType == 'pick') {
+          param.dimension = 1;
+
+          // URL = pageeLedgerMain;
+          URL = getOutindetailtwo;
+        } else if (this.isType == 'feed') {
+          if ([4, 7, 14].includes(Number(this.rootCategoryLevelId))) {
+            URL = assetPage;
+          } else if (this.rootCategoryLevelId == 2) {
+            param.workOrderId = this.id;
+            delete param.taskId;
+            delete param.categoryLevelId;
+            URL = listInProduct;
+          } else if (
+            ![2, 4, 7, 14].includes(Number(this.rootCategoryLevelId))
+          ) {
+            URL = assetPage;
+          }
+        } else if (this.isType == 'job') {
+          URL = assetPage;
+        }
+
+        const res = await URL(param);
+        if (this.rootCategoryLevelId == '11') {
+          let _res = res;
+          console.log(res, 'res');
+          let _list = [];
+          _res.list.forEach((e) => {
+            if (e.aridRegionList && e.aridRegionList.length != 0) {
+              e.aridRegionList.map((i) => {
+                let obj = {
+                  name: e.name,
+                  region: e.extInfo.region,
+                  rootCategoryLevelId: e.rootCategoryLevelId,
+                  ...i,
+                  instanceId: i.id
+                };
+                _list.push(obj);
+              });
+            }
+          });
+          res.list = _list;
+          return res;
+        } else {
+          let _res = res;
+          let _list = [];
+
+          _list.push(
+            ..._res.list.map((i) => {
+              const warehouseId = i.pathIds && i.pathIds.split(',')[0];
+
+              return {
+                warehouseId,
+                ...i,
+                instanceId: i.id
+              };
+            })
+          );
+
+          res.list = _list;
+          // if (this.isType == 'pick') {
+          //   this.columns = this.cloumsPick;
+          // } else {
+          //   this.columns = this.cloumsAll
+          // }
+          return res;
+        }
+      },
+
+      handleSelectionChange(data) {
+        const selectionList = [];
+        this.allSelection.forEach((item) => {
+          if (item.warehouseIdList && item.warehouseIdList.length != 0) {
+            selectionList.push({
+              id: item.id,
+              ids: item.warehouseIdList
+            });
+          }
+        });
+        this.allSelection = data;
+
+        if (selectionList.length != 0) {
+          selectionList.forEach((item) => {
+            this.allSelection.forEach((it) => {
+              if (item.id == it.id) {
+                it.warehouseIdList = item.ids;
+              }
+            });
+          });
+        }
+
+        this.allSelection.forEach((it) => {
+          if (!it.warehouseIdList || it.warehouseIdList.length == 0) {
+            if (it.warehouseId) {
+              it.warehouseIdList = [];
+              it.warehouseIdList.push(it.warehouseId);
+            }
+          }
+        });
+
+        // this.allSelection.forEach((item) => {
+
+        // })
+        console.log(this.allSelection, 'this.allSelection22');
+      },
+
+      /* 清空选择 */
+      clearChoose() {
+        this.allSelection = [];
+        this.$refs.table.clearSelection();
+      },
+      rowStyle({ row }) {
+        return this.selection.includes(row) ? { background: '#e6f7ff' } : null;
+      },
+      handleNodeClick(data) {
+        console.log(data, 'handleNodeClick');
+        this.isCategory = true;
+        this.categoryLevelId = data.id;
+        this.rootCategoryLevelId = data.rootCategoryLevelId;
+        this.reload();
+      },
+
+      setRootId(data) {
+        this.categoryLevelId = data.id;
+        this.rootCategoryLevelId = data.rootCategoryLevelId;
+        this.reload();
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$nextTick(() => {
+          this.isCategory = false;
+          this.$refs.table.reload({ pageNum: 1, where: where });
+        });
+      },
+
+      onDone() {
+        this.$nextTick(() => {
+          this.allSelection.forEach((item) => {
+            this.$refs.table.toggleRowSelection(item, true);
+          });
+        });
+      },
+      open(id, item, t) {
+        this.id = id;
+
+        if (t) {
+          this.title = t;
+        } else {
+          this.title = '领料列表';
+        }
+
+        if (this.isType == 'pick') {
+          this.temporaryList = item.pickList || [];
+          this.allSelection = item.pickList || [];
+          this.visible = true;
+          this.$nextTick(() => {
+            this.allSelection.forEach((item) => {
+              this.$refs.table.toggleRowSelection(item, true);
+            });
+
+            console.log(this.allSelection, 'this.allSelection');
+          });
+        } else if (this.isType == 'feed') {
+          let feedList = [];
+          feedList = [
+            ...item.modelList,
+            ...item.equipmentList,
+            ...item.instanceList,
+            ...item.aridRegionList,
+            ...item.turnover,
+            ...item.palletList,
+            ...item.revolvingDiskList,
+            ...item.semiProductList
+          ];
+          this.temporaryList = feedList || [];
+          this.allSelection = feedList || [];
+          this.visible = true;
+
+          this.$nextTick(() => {
+            feedList.forEach((item) => {
+              this.$refs.table.toggleRowSelection(item, true);
+            });
+          });
+        } else if (this.isType == 'job') {
+          let feedList = [];
+          feedList = [...item.turnover, ...item.equipmentList];
+          this.temporaryList = feedList || [];
+          this.allSelection = feedList || [];
+          this.visible = true;
+
+          this.$nextTick(() => {
+            feedList.forEach((item) => {
+              this.$refs.table.toggleRowSelection(item, true);
+            });
+          });
+        }
+      },
+
+      handleClose() {
+        this.clearChoose();
+        this.temporaryList = [];
+        this.allSelection = [];
+        this.visible = false;
+      },
+      selected() {
+        if (this.allSelection.length == 0) {
+          this.$message.warning('请选择物料');
+          return false;
+        }
+
+        if (this.temporaryList.length > 0) {
+          // 使用Promise来“模拟”异步操作
+          new Promise((resolve) => {
+            if (this.temporaryList.length > 0) {
+              this.temporaryList.forEach((item) => {
+                this.allSelection.forEach((item2) => {
+                  if (item.id == item2.id && this.isType == 'pick') {
+                    this.$set(
+                      item2,
+                      'demandQuantity',
+                      item.demandQuantity || null
+                    );
+                  } else if (item.id == item2.id && this.isType == 'feed') {
+                    this.$set(item2, 'feedQuantity', item.feedQuantity || null);
+                  }
+                });
+              });
+            }
+            this.allSelection.sort(
+              (a, b) => a.rootCategoryLevelId - b.rootCategoryLevelId
+            );
+
+            resolve();
+          }).then(() => {
+            this.$emit('allSelection', this.id, this.allSelection);
+            this.handleClose();
+          });
+        } else {
+          console.log('456');
+          this.allSelection.sort(
+            (a, b) => a.rootCategoryLevelId - b.rootCategoryLevelId
+          );
+          this.$emit('allSelection', this.id, this.allSelection);
+          this.handleClose();
+        }
+      }
+    },
+
+    created() {
+      if (this.isType == 'pick') {
+        // this.treeIds = '1, 5, 7, 8, 10, 13, 14, 23, 26, 9, 28';
+        this.treeIds =
+          '9, 23, 2, 1, 4, 14, 5, 8, 16, 13, 15, 6, 10, 22, 1777158952502956034';
+        // this.treeIds = '9, 1, 14, 5, 8, 13, 15, 6, 10, 22';
+      } else if (this.isType == 'feed') {
+        this.treeIds = '1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 26, 9, 23,28';
+      } else if (this.isType == 'job') {
+        this.treeIds = '4, 7';
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+  }
+
+  .table_col {
+    padding-left: 10px;
+
+    ::v-deep .el-table th.el-table__cell {
+      background: #f2f2f2;
+    }
+  }
+
+  .pagination {
+    text-align: right;
+    padding: 10px 0;
+  }
+
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
+
+  .topsearch {
+    margin-bottom: 15px;
+  }
+
+  ::v-deep .is-checked {
+    background: #e6f7ff;
+  }
+</style>

+ 20 - 20
src/views/produce/components/taskDialog/index.vue

@@ -97,7 +97,7 @@
         </el-popconfirm> -->
         <el-popconfirm title="确认本次报工?" @confirm="saveData(row)">
           <template v-slot:reference>
-            <el-link  :underline="false" type="primary">报工 </el-link>
+            <el-link :underline="false" type="primary">报工 </el-link>
           </template>
         </el-popconfirm>
 
@@ -216,14 +216,14 @@
             align: 'center',
             showOverflowTooltip: true
           },
-          {
-            slot: 'qualifiedWeight',
-            label: '合格重量',
-            prop: 'qualifiedWeight',
-            width: 160,
-            align: 'center',
-            showOverflowTooltip: true
-          },
+          // {
+          //   slot: 'qualifiedWeight',
+          //   label: '合格重量',
+          //   prop: 'qualifiedWeight',
+          //   width: 160,
+          //   align: 'center',
+          //   showOverflowTooltip: true
+          // },
           {
             slot: 'unqualifiedQuantity',
             label: '不合格数量',
@@ -232,14 +232,14 @@
             align: 'center',
             showOverflowTooltip: true
           },
-          {
-            slot: 'unqualifiedWeight',
-            label: '不合格重量',
-            prop: 'unqualifiedWeight',
-            width: 160,
-            align: 'center',
-            showOverflowTooltip: true
-          },
+          // {
+          //   slot: 'unqualifiedWeight',
+          //   label: '不合格重量',
+          //   prop: 'unqualifiedWeight',
+          //   width: 160,
+          //   align: 'center',
+          //   showOverflowTooltip: true
+          // },
           {
             slot: 'assigneeRemark',
             label: '备注',
@@ -288,9 +288,9 @@
           remark: row.assigneeRemark,
           apsAssigneeId: row.id
         };
-        batchUpdateRealTimeConfirm(params).then((res)=>{
-          console.log(res,'res 1111')
-        })
+        batchUpdateRealTimeConfirm(params).then((res) => {
+          console.log(res, 'res 1111');
+        });
       },
       getData() {
         this.workList = [];

+ 23 - 8
src/views/produce/components/turnover/components/detail.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    title="周转车详情"
+    title="货位详情"
     :visible.sync="addRepairNotesDialog"
     v-if="addRepairNotesDialog"
     :before-close="handleClose"
@@ -10,14 +10,17 @@
     append-to-body
     width="70%"
   >
-    <el-empty description="暂无详情" v-if="dataList.length == 0"></el-empty>
+    <el-empty
+      description="暂无货位详情"
+      v-if="storageLocationList.length == 0"
+    ></el-empty>
     <div v-else class="detail-box">
-      <div v-for="item of dataList" :key="item.id">
-        <div v-if="item.status == 1" class="detail-sigle-box true">
+      <div v-for="item of storageLocationList" :key="item.id">
+        <div v-if="item.isOccupy == 0" class="detail-sigle-box true">
           <p>{{ item.code }}</p>
           <span>闲置</span>
         </div>
-        <div v-if="item.status == 2" class="detail-sigle-box false">
+        <div v-if="item.isOccupy == 1" class="detail-sigle-box false">
           <p>{{ item.code }}</p>
           <span>在用</span>
         </div>
@@ -159,7 +162,9 @@
             code: 13,
             status: 1
           }
-        ]
+        ],
+        // turnoverData: {},
+        storageLocationList: []
       };
     },
 
@@ -168,9 +173,19 @@
         this.addRepairNotesDialog = false;
       },
 
-      init() {
+      init(data) {
+        // this.turnoverData = data;
+        this.storageLocationList = data.extInfo.positionList;
+        console.log(this.storageLocationList, '1111');
+        // this.getStorageLocationList();
         this.addRepairNotesDialog = true;
       }
+
+      // async getStorageLocationList() {
+      //   await categoryVehicleList(this.turnoverData.categoryId).then((res) => {
+      //     console.log(res, '货位数据');
+      //   });
+      // }
     }
   };
 </script>
@@ -184,7 +199,7 @@
       flex-direction: row;
       flex-wrap: wrap;
       color: #333;
-      font-size: 1.2rem;
+      font-size: 1.1rem;
       overflow: auto;
 
       .detail-sigle-box {

+ 61 - 33
src/views/produce/components/turnover/components/details.vue

@@ -1,43 +1,55 @@
 <template>
-  <div class="ele-body">
-    <!-- tab切换 -->
-    <el-card :body-style="{ padding: 0 }">
-      <div class="switch">
-        <div class="switch_left">
-          <ul>
-            <li
-              v-for="item in tabOptions"
-              :key="item.key"
-              :class="{ active: activeComp == item.key }"
-              @click="activeComp = item.key"
-            >
-              {{ item.name }}
-            </li>
-          </ul>
-        </div>
-        <!-- <div class="right" style="padding: 10px">
+  <el-dialog
+    :visible.sync="addRepairNotesDialog"
+    v-if="addRepairNotesDialog"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    width="90%"
+    :fullscreen="fullscreen"
+    class="fullscreen"
+    append-to-body
+  >
+    <div class="ele-body">
+      <!-- tab切换 -->
+      <el-card :body-style="{ padding: 0 }">
+        <div class="switch">
+          <div class="switch_left">
+            <ul>
+              <li
+                v-for="item in tabOptions"
+                :key="item.key"
+                :class="{ active: activeComp == item.key }"
+                @click="activeComp = item.key"
+              >
+                {{ item.name }}
+              </li>
+            </ul>
+          </div>
+          <!-- <div class="right" style="padding: 10px">
           <el-button @click="$router.go(-1)">返回</el-button>
         </div> -->
-      </div>
-      <div class="page-title">
-        <el-page-header @back="$router.go(-1)">
+        </div>
+        <div class="page-title">
+          <!-- <el-page-header @back="$router.go(-1)"> -->
           <div slot="content" class="pageContent">
             <span v-for="item in tabOptions" :key="item.key">
               {{ item.key == activeComp ? item.name + '详情' : '' }}
             </span>
           </div>
-        </el-page-header>
-      </div>
-      <div class="content-wrapper">
-        <component
-          :is="activeComp"
-          :rowId="rowId"
-          :code="code"
-          :showTitle="false"
-        ></component>
-      </div>
-    </el-card>
-  </div>
+          <!-- </el-page-header> -->
+        </div>
+        <div class="content-wrapper">
+          <component
+            :is="activeComp"
+            :rowId="rowId"
+            :code="code"
+            :showTitle="false"
+          ></component>
+        </div>
+      </el-card>
+    </div>
+  </el-dialog>
 </template>
 
 <script>
@@ -76,13 +88,29 @@
           // // { key: "InternetRecord", name: "物联记录" },
         ],
         rowId: null,
-        code: null
+        code: null,
+        addRepairNotesDialog: false,
+        fullscreen: false
       };
     },
 
     created() {
       this.rowId = this.$route.query.id;
       this.code = this.$route.query.code;
+    },
+
+    methods: {
+      open(code, id) {
+        this.addRepairNotesDialog = true;
+        console.log(code, id, 'code, id');
+        this.code = code;
+        this.rowId = id;
+      },
+
+      handleClose() {
+        this.$emit('refresh');
+        this.addRepairNotesDialog = false;
+      }
     }
   };
 </script>

+ 30 - 17
src/views/produce/components/turnover/components/edit.vue

@@ -13,9 +13,9 @@
           >
         </div>
       </div>
-      <div v-if="pageType == 'add'">
+      <!-- <div v-if="pageType == 'add'">
         <el-button type="primary" plain @click="handlwpbm">选择物品</el-button>
-      </div>
+      </div> -->
       <el-form
         label-width="120px"
         :model="{ ...form, ...positionInfo }"
@@ -173,7 +173,7 @@
         pageType: 'add',
         btnLoading: false,
         // 周转车主键id
-        id: '',
+        // id: '',
         form: {
           extInfoSelf: [],
           // 基本信息
@@ -248,14 +248,24 @@
         // 生命周期
         sourceDICT: '',
         // 网络状态
-        networkStatus: '',
-        id: ''
+        networkStatus: ''
+        // id: ''
       };
     },
     props: {
       showTitle: {
         type: Boolean,
         default: true
+      },
+
+      code: {
+        type: String,
+        default: ''
+      },
+
+      rowId: {
+        type: String,
+        default: ''
       }
     },
     watch: {},
@@ -274,17 +284,20 @@
       }
     },
     async created() {
-      if (this.$route.query.id) {
-        this.pageType = 'edit';
-        this.id = this.$route.query.id;
-        await this.getInfo();
-        this.title = '编辑周转车信息';
-        // this.getgys();
-        // await this._getWarehouseChildren();
-      } else {
-        this.pageType = 'add';
-        this.title = '新增周转车信息';
-      }
+      // if (this.$route.query.id) {
+      //   this.pageType = 'edit';
+      //   this.id = this.$route.query.id;
+      //   await this.getInfo();
+      //   this.title = '编辑周转车信息';
+      //   // this.getgys();
+      //   // await this._getWarehouseChildren();
+      // } else {
+      //   this.pageType = 'add';
+      //   this.title = '新增周转车信息';
+      // }
+      console.log(this.code, this.rowId, '2222222');
+      this.pageType = 'edit';
+      await this.getInfo();
     },
     methods: {
       handlwpbm() {
@@ -460,7 +473,7 @@
       },
       // 获取周转车详情
       async getInfo() {
-        const data = await getAssetInfo(this.id);
+        const data = await getAssetInfo(this.rowId);
         // 扩展字段
         data.extInfoSelf = data.extInfoSelf || [];
         // 权属人相关信息

+ 62 - 30
src/views/produce/components/turnover/index.vue

@@ -42,69 +42,82 @@
         </div>
       </div>
 
-      <div class="device-list">
-        <div class="device-box" v-for="item in data" :key="item.id">
+      <div class="device-list" v-if="turnoverList.length != 0">
+        <div class="device-box" v-for="item in turnoverList" :key="item.id">
           <div class="status-box">
-            <p>空闲中</p>
+            <p v-if="item.runStatus == '0'">启动</p>
+            <p v-if="item.runStatus == '1'">空闲中</p>
+            <p v-if="item.runStatus == '2'">运行</p>
+            <p v-if="item.runStatus == '3'">故障</p>
+            <p v-if="item.runStatus == '4'">检修</p>
+            <p v-if="item.runStatus == '5'">停机</p>
+            <p v-if="item.runStatus == '6'">待料</p>
+            <p v-if="item.runStatus == '7'">占用</p>
           </div>
           <div class="title-box">
-            <span>切割机</span>
+            <span>{{ item.name }}</span>
           </div>
           <div class="image-box">
-            <img src="" alt="" />
+            <img
+              :src="
+                Object.keys(item.imageUrl).length != 0
+                  ? item.imageUrl
+                  : 'http://192.168.1.251:51001/eam/img/upload-placeholder.39eb69d1.svg'
+              "
+              alt=""
+              @click="checkDetail(item)"
+            />
           </div>
           <div class="info-box">
-            <p>分类:</p> <el-input disabled v-model="item.id"></el-input>
+            <p>分类:</p>
+            <el-input disabled v-model="item.rootCategoryLevelName"></el-input>
           </div>
           <div class="info-box">
-            <p>编码:</p> <el-input disabled v-model="item.id"></el-input>
+            <p>编码:</p> <el-input disabled v-model="item.code"></el-input>
           </div>
 
           <div class="btn-box">
-            <el-button type="primary" class="btn" @click="repairBtn"
+            <el-button type="primary" class="btn" @click="repairBtn(item)"
               >货位</el-button
             >
           </div>
         </div>
       </div>
+
+      <div v-else>
+        <el-empty description="暂无周转车数据"></el-empty>
+      </div>
     </el-drawer>
 
     <detail ref="detailRef"></detail>
+    <turnoverDeatail ref="turnoverDeatailRef"></turnoverDeatail>
   </div>
 </template>
 
 <script>
   import detail from './components/detail.vue';
+  import turnoverDeatail from './components/details.vue';
+  import { getTurnoverList } from '@/api/produce/turnover.js';
+  import { typeName } from '@/views/produce/components/common.js';
   export default {
     name: 'device',
 
-    components: { detail },
+    components: { detail, turnoverDeatail },
 
     data() {
       return {
         isFullscreen: false,
         drawer: false,
-        data: [
-          { id: 1 },
-          { id: 2 },
-          { id: 3 },
-          { id: 4 },
-          { id: 5 },
-          { id: 6 },
-          { id: 7 },
-          { id: 8 },
-          { id: 9 },
-          { id: 10 }
-        ],
-        addDialogTitle: '新增报修记录',
-        deviceInfo: {},
-        infoData: {}
+        codeList: [],
+        turnoverList: [],
+        typeName
       };
     },
 
     methods: {
-      open(data) {
-        console.log(data, 'this.workData.list');
+      open(idsList) {
+        this.codeList = idsList;
+        this.getTurnoverListData();
         this.drawer = true;
       },
 
@@ -112,14 +125,34 @@
         this.drawer = false;
       },
 
+      async getTurnoverListData() {
+        await getTurnoverList({ workOrderCodeList: this.codeList }).then(
+          (res) => {
+            this.turnoverList = res.data;
+            if (this.turnoverList.length != 0) {
+              this.turnoverList.forEach((item) => {
+                item.rootCategoryLevelName =
+                  typeName[Number(item.rootCategoryLevelId)];
+              });
+            }
+          }
+        );
+      },
+
       handleFull() {
         this.isFullscreen = !this.isFullscreen;
         this.$forceUpdate();
       },
-      repairBtn(row) {
-        this.$refs.detailRef.init();
+      repairBtn(data) {
+        this.$refs.detailRef.init(data);
       },
-      reload() {}
+      reload() {
+        this.getTurnoverListData();
+      },
+
+      checkDetail(item) {
+        this.$refs.turnoverDeatailRef.open(item.code, item.id);
+      }
     }
   };
 </script>
@@ -196,7 +229,6 @@
 
       .image-box {
         margin: 0 auto;
-        border: 1px solid #333;
         width: 20rem;
         height: 20rem;
         margin-bottom: 1rem;

+ 14 - 2
src/views/produce/index.vue

@@ -850,11 +850,23 @@
         }
 
         if (t == 'device') {
-          this.$refs.deviceRef.open();
+          if (this.taskObj.id) {
+            this.$refs.deviceRef.open(this.taskObj.id);
+          } else {
+            this.$message.warning('请选择工序');
+          }
         }
 
         if (t == 'turnover') {
-          this.$refs.turnoverRef.open();
+          if (this.workListIds.length < 1) {
+            return this.$message.warning('请选择工单!');
+          } else {
+            const codeListData = [];
+            this.workData.list.forEach((it) => {
+              codeListData.push(it.code);
+            });
+            this.$refs.turnoverRef.open(codeListData);
+          }
         }
 
         if (t == 'bom') {

+ 164 - 144
src/views/produceOrder/components/printSr.vue

@@ -1,164 +1,184 @@
 <template>
-    <ele-modal title="二维码" :visible.sync="QRvisible" v-if="QRvisible" width="800px" :maxable="true">
-
-        <div id="printSection">
-
-
-            <div v-for="(item, index) in codeList" :key="index"
-                style="width: 100%; height: 100%; display: flex;   align-items: center; justify-content: center;  ">
-                <div style="width: 160px; height: 160px; margin-right: 10px; padding-left: 0px;">
-                    <img :src="item.qrcode" alt="QR Code" style=" width: 160px; height: 160px;">
-                </div>
-                <div
-                    style="width: 640px; display: flex;  flex-direction: column;  flex-wrap: wrap; justify-content: space-between; align-items:flex-start;">
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">产品编码:</span>
-                        <span style="color: #000;">{{ item.productCode }}</span>
-                    </div>
-
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">名称:</span>
-                        <span style="color: #000;">{{ item.productName }}</span>
-                    </div>
-
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">牌号:</span>
-                        <span style="color: #000;">{{ item.brandNo }}</span>
-                    </div>
-
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">型号:</span>
-                        <span style="color: #000;">{{ item.model }}</span>
-                    </div>
-
-
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">生产数量:</span>
-                        <span style="color: #000;">{{ item.formingNum }} {{ item.unit }}</span>
-                    </div>
-
-
-
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">生产重量:</span>
-                        <span style="color: #000;">{{ item.formingWeight }} {{ item.weightUnit }}</span>
-                    </div>
-
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">状态:</span>
-                        <span style="color: #000;">{{ statusList[item.status] }}</span>
-                    </div>
-
-
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">工艺路线:</span>
-                        <span style="color: #000;">{{ item.produceRoutingName }} </span>
-                    </div>
-
-
-                </div>
-
-            </div>
+  <ele-modal
+    title="二维码"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="800px"
+    :maxable="true"
+  >
+    <div id="printSection">
+      <div
+        v-for="(item, index) in codeList"
+        :key="index"
+        style="
+          width: 100%;
+          height: 100%;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        "
+      >
+        <div
+          style="
+            width: 160px;
+            height: 160px;
+            margin-right: 10px;
+            padding-left: 0px;
+          "
+        >
+          <img
+            :src="item.qrcode"
+            alt="QR Code"
+            style="width: 160px; height: 160px"
+          />
         </div>
-
-
-        <div slot="footer">
-            <el-button @click="print">打印预览</el-button>
-            <el-button @click="close">关闭</el-button>
+        <div
+          style="
+            width: 640px;
+            display: flex;
+            flex-direction: column;
+            flex-wrap: wrap;
+            justify-content: space-between;
+            align-items: flex-start;
+          "
+        >
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">产品编码:</span>
+            <span style="color: #000">{{ item.productCode }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">名称:</span>
+            <span style="color: #000">{{ item.productName }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">牌号:</span>
+            <span style="color: #000">{{ item.brandNo }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">型号:</span>
+            <span style="color: #000">{{ item.model }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">规格:</span>
+            <span style="color: #000">{{ item.specification }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">生产数量:</span>
+            <span style="color: #000"
+              >{{ item.formingNum }} {{ item.unit }}</span
+            >
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">生产重量:</span>
+            <span style="color: #000"
+              >{{ item.formingWeight }} {{ item.weightUnit }}</span
+            >
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">状态:</span>
+            <span style="color: #000">{{ statusList[item.status] }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">工艺路线:</span>
+            <span style="color: #000">{{ item.produceRoutingName }} </span>
+          </div>
         </div>
-    </ele-modal>
+      </div>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
 </template>
 
 <script>
-import QRCode from 'qrcode'
-import {
-    queryPrint
-} from '@/api/produceOrder/index.js';
-export default {
-  name: 'print',
+  import QRCode from 'qrcode';
+  import { queryPrint } from '@/api/produceOrder/index.js';
+  export default {
+    name: 'print',
     data() {
-        return {
-            QRvisible: false,
-
-            codeList: [],
-            statusList: {
-                4: '待生产',
-                5: '生产中',
-                6: '已完成',
-                7: '已延期',
-                8: '待下达'
-            }
+      return {
+        QRvisible: false,
+
+        codeList: [],
+        statusList: {
+          4: '待生产',
+          5: '生产中',
+          6: '已完成',
+          7: '已延期',
+          8: '待下达'
         }
+      };
     },
 
-
     methods: {
-
-        open(ids) {
-            queryPrint({ ids }).then(res => {
-                this.codeList = res;
-                this.QRvisible = true
-
-
-                this.$nextTick(() => {
-                    this.generateQRCodes()
-                })
-
-
-            })
-
-        },
-
-        generateQRCodes() {
-            this.codeList.forEach(item => {
-                QRCode.toDataURL(item.id)
-                    .then(url => {
-                        item.qrcode = url
-                        this.$forceUpdate()
-                    })
-                    .catch(err => {
-                        console.error(err)
-                    })
+      open(ids) {
+        queryPrint({ ids }).then((res) => {
+          this.codeList = res;
+          this.QRvisible = true;
+
+          this.$nextTick(() => {
+            this.generateQRCodes();
+          });
+        });
+      },
+
+      generateQRCodes() {
+        this.codeList.forEach((item) => {
+          QRCode.toDataURL(item.id)
+            .then((url) => {
+              item.qrcode = url;
+              this.$forceUpdate();
             })
-        },
-
-        close() {
-            this.QRvisible = false
-        },
-
-
-        print() {
-
-            const printSection = document.getElementById('printSection');
-            // 创建打印任务
-            const printWindow = window.open('', '_blank');
-            printWindow.document.open();
-            printWindow.document.write('<html><head><title>打印预览</title>');
-            printWindow.document.write('<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />');
-            printWindow.document.write('</head><body>');
-            printWindow.document.write(printSection.innerHTML);
-            printWindow.document.write('</body></html>');
-            printWindow.document.close();
-            printWindow.onload = function () {
-                printWindow.print();
-            };
-        }
-
+            .catch((err) => {
+              console.error(err);
+            });
+        });
+      },
+
+      close() {
+        this.QRvisible = false;
+      },
+
+      print() {
+        const printSection = document.getElementById('printSection');
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      }
     }
-}
+  };
 </script>
 
 <style lang="scss" scoped>
-@media print {
-
+  @media print {
     #printSection {
-        font-size: 34px;
-
-        span {
-            font-size: 34px;
-        }
+      font-size: 34px;
 
+      span {
+        font-size: 34px;
+      }
     }
-
-}
+  }
 </style>

+ 158 - 144
src/views/produceOrder/components/printTg.vue

@@ -1,164 +1,178 @@
 <template>
-    <ele-modal title="二维码" :visible.sync="QRvisible" v-if="QRvisible" width="800px" :maxable="true">
-
-        <div id="printSection">
-
-
-            <div v-for="(item, index) in codeList" :key="index"
-                style=" display: flex;width: 100%; height: 100%; align-items: center; justify-content: center; margin: auto;">
-                <div style="width: 200px; height: 200px; margin-right: 18px;">
-                    <img :src="item.qrcode" alt="QR Code" style=" width: 200px; height: 200px;">
-                </div>
-                <div
-                    style="width: 520px; display: flex;  flex-direction: column;  flex-wrap: wrap; justify-content: space-between; align-items:flex-start;">
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">产品编码:</span>
-                        <span style="color: #000;">{{ item.productCode }}</span>
-                    </div>
-
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">名称:</span>
-                        <span style="color: #000;">{{ item.productName }}</span>
-                    </div>
-
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">牌号:</span>
-                        <span style="color: #000;">{{ item.brandNo }}</span>
-                    </div>
-
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">型号:</span>
-                        <span style="color: #000;">{{ item.model }}</span>
-                    </div>
-
-
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">生产数量:</span>
-                        <span style="color: #000;">{{ item.formingNum }} {{ item.unit }}</span>
-                    </div>
-
-
-
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">生产重量:</span>
-                        <span style="color: #000;">{{ item.formingWeight }} {{ item.weightUnit }}</span>
-                    </div>
-
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">状态:</span>
-                        <span style="color: #000;">{{ statusList[item.status] }}</span>
-                    </div>
-
-
-                    <div style="text-align: left;   font-size: 20px; ">
-                        <span style="display: inline-block;  ">工艺路线:</span>
-                        <span style="color: #000;">{{ item.produceRoutingName }} </span>
-                    </div>
-
-
-                </div>
-
-            </div>
+  <ele-modal
+    title="二维码"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="800px"
+    :maxable="true"
+  >
+    <div id="printSection">
+      <div
+        v-for="(item, index) in codeList"
+        :key="index"
+        style="
+          display: flex;
+          width: 100%;
+          height: 100%;
+          align-items: center;
+          justify-content: center;
+          margin: auto;
+        "
+      >
+        <div style="width: 200px; height: 200px; margin-right: 18px">
+          <img
+            :src="item.qrcode"
+            alt="QR Code"
+            style="width: 200px; height: 200px"
+          />
         </div>
-
-
-        <div slot="footer">
-            <el-button @click="print">打印预览</el-button>
-            <el-button @click="close">关闭</el-button>
+        <div
+          style="
+            width: 520px;
+            display: flex;
+            flex-direction: column;
+            flex-wrap: wrap;
+            justify-content: space-between;
+            align-items: flex-start;
+          "
+        >
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">产品编码:</span>
+            <span style="color: #000">{{ item.productCode }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">名称:</span>
+            <span style="color: #000">{{ item.productName }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">牌号:</span>
+            <span style="color: #000">{{ item.brandNo }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">型号:</span>
+            <span style="color: #000">{{ item.model }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">规格:</span>
+            <span style="color: #000">{{ item.specification }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">生产数量:</span>
+            <span style="color: #000"
+              >{{ item.formingNum }} {{ item.unit }}</span
+            >
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">生产重量:</span>
+            <span style="color: #000"
+              >{{ item.formingWeight }} {{ item.weightUnit }}</span
+            >
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">状态:</span>
+            <span style="color: #000">{{ statusList[item.status] }}</span>
+          </div>
+
+          <div style="text-align: left; font-size: 20px">
+            <span style="display: inline-block">工艺路线:</span>
+            <span style="color: #000">{{ item.produceRoutingName }} </span>
+          </div>
         </div>
-    </ele-modal>
+      </div>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
 </template>
 
 <script>
-import QRCode from 'qrcode'
-import {
-    queryPrint
-} from '@/api/produceOrder/index.js';
-export default {
-  name: 'print',
+  import QRCode from 'qrcode';
+  import { queryPrint } from '@/api/produceOrder/index.js';
+  export default {
+    name: 'print',
     data() {
-        return {
-            QRvisible: false,
-
-            codeList: [],
-            statusList: {
-                4: '待生产',
-                5: '生产中',
-                6: '已完成',
-                7: '已延期',
-                8: '待下达'
-            }
+      return {
+        QRvisible: false,
+
+        codeList: [],
+        statusList: {
+          4: '待生产',
+          5: '生产中',
+          6: '已完成',
+          7: '已延期',
+          8: '待下达'
         }
+      };
     },
 
-
     methods: {
-
-        open(ids) {
-            queryPrint({ ids }).then(res => {
-                this.codeList = res;
-                this.QRvisible = true
-
-
-                this.$nextTick(() => {
-                    this.generateQRCodes()
-                })
-
-
-            })
-
-        },
-
-        generateQRCodes() {
-            this.codeList.forEach(item => {
-                QRCode.toDataURL(item.id)
-                    .then(url => {
-                        item.qrcode = url
-                        this.$forceUpdate()
-                    })
-                    .catch(err => {
-                        console.error(err)
-                    })
+      open(ids) {
+        queryPrint({ ids }).then((res) => {
+          this.codeList = res;
+          this.QRvisible = true;
+
+          this.$nextTick(() => {
+            this.generateQRCodes();
+          });
+        });
+      },
+
+      generateQRCodes() {
+        this.codeList.forEach((item) => {
+          QRCode.toDataURL(item.id)
+            .then((url) => {
+              item.qrcode = url;
+              this.$forceUpdate();
             })
-        },
-
-        close() {
-            this.QRvisible = false
-        },
-
-
-        print() {
-
-            const printSection = document.getElementById('printSection');
-            // 创建打印任务
-            const printWindow = window.open('', '_blank');
-            printWindow.document.open();
-            printWindow.document.write('<html><head><title>打印预览</title>');
-            printWindow.document.write('<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />');
-            printWindow.document.write('</head><body>');
-            printWindow.document.write(printSection.innerHTML);
-            printWindow.document.write('</body></html>');
-            printWindow.document.close();
-            printWindow.onload = function () {
-                printWindow.print();
-            };
-        }
-
+            .catch((err) => {
+              console.error(err);
+            });
+        });
+      },
+
+      close() {
+        this.QRvisible = false;
+      },
+
+      print() {
+        const printSection = document.getElementById('printSection');
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      }
     }
-}
+  };
 </script>
 
 <style lang="scss" scoped>
-@media print {
-
+  @media print {
     #printSection {
-        font-size: 34px;
-
-        span {
-            font-size: 34px;
-        }
+      font-size: 34px;
 
+      span {
+        font-size: 34px;
+      }
     }
-
-}
+  }
 </style>

+ 2 - 0
src/views/sample/detailList.vue

@@ -251,6 +251,8 @@
         all: false,
         qualityType: null,
         sampleTypeList: [
+          { value: 1, label: '返工' },
+          { value: 2, label: '返修' },
           { value: 6, label: '留样' },
           { value: 8, label: '归批/回用' },
           { value: 3, label: '报废' },

+ 11 - 11
src/views/taskList/components/Ddtails.vue

@@ -337,7 +337,7 @@
         }
         // 更新绑定值
         this.form[type] = value;
-        this.calculateWeight(type);
+        // this.calculateWeight(type);
       },
       //计算重量
       calculateWeight(type) {
@@ -382,16 +382,16 @@
               `合格数量加不合格数量要等于任务数量${this.current.quantity}`
             );
           }
-          if (
-            this.form.qualifiedWeight -
-              0 +
-              (this.form.unqualifiedWeight - 0) !==
-            this.current.weight
-          ) {
-            return this.$message.warning(
-              `合格重量加不合格重量要等于任务重量${this.current.weight}`
-            );
-          }
+          // if (
+          //   this.form.qualifiedWeight -
+          //     0 +
+          //     (this.form.unqualifiedWeight - 0) !==
+          //   this.current.weight
+          // ) {
+          //   return this.$message.warning(
+          //     `合格重量加不合格重量要等于任务重量${this.current.weight}`
+          //   );
+          // }
           let data = {
             ...this.form,
             apsAssigneeId: this.current.apsAssigneeId

+ 41 - 20
src/views/taskList/index.vue

@@ -4,11 +4,7 @@
       <task-search @search="reload"></task-search>
       <!-- <taskDialog-search></taskDialog-search> -->
       <el-tabs v-model="tabValue" type="card" @tab-click="handleTabClick">
-        <el-tab-pane
-          label="我的任务"
-          name="1"
-          v-if="$hasPermission('mes:taskreport:myorder')"
-        ></el-tab-pane>
+        <el-tab-pane label="我的任务" name="1"></el-tab-pane>
         <el-tab-pane
           label="全部任务"
           name="2"
@@ -448,20 +444,18 @@
     },
     created() {},
     mounted() {
-      if (this.$hasPermission('mes:taskreport:allorder')) {
-        this.tabValue = '2';
-      }
-
-      if (this.$hasPermission('mes:taskreport:myorder')) {
-        this.tabValue = '1';
-      }
-
-      if (
-        !this.$hasPermission('mes:taskreport:myorder') &&
-        !this.$hasPermission('mes:taskreport:allorder')
-      ) {
-        this.tabValue = '';
-      }
+      // if (this.$hasPermission('mes:taskreport:allorder')) {
+      //   this.tabValue = '2';
+      // }
+      // if (this.$hasPermission('mes:taskreport:myorder')) {
+      //   this.tabValue = '1';
+      // }
+      // if (
+      //   !this.$hasPermission('mes:taskreport:myorder') &&
+      //   !this.$hasPermission('mes:taskreport:allorder')
+      // ) {
+      //   this.tabValue = '';
+      // }
     },
     methods: {
       handleTabClick(e) {
@@ -470,7 +464,6 @@
       },
       /* 表格数据源 */
       datasource({ page, limit, where }) {
-        // console.log(this.tabValue, 'this.tabValue');
         if (this.tabValue && this.tabValue != 0) {
           let api =
             this.tabValue === '1' ? pageByCurrentUser : pageByCurrentUserLeader;
@@ -482,6 +475,34 @@
         } else {
           return [];
         }
+
+        // if (
+        //   (this.$hasPermission('mes:taskreport:myorder') &&
+        //     this.$hasPermission('mes:taskreport:allorder')) ||
+        //   (this.$hasPermission('mes:taskreport:myorder') &&
+        //     !this.$hasPermission('mes:taskreport:allorder'))
+        // ) {
+        //   let api = pageByCurrentUser;
+        //   return api({
+        //     ...where,
+        //     pageNum: page,
+        //     size: limit
+        //   });
+        // } else if (
+        //   this.$hasPermission('mes:taskreport:myorder') &&
+        //   !this.$hasPermission('mes:taskreport:allorder')
+        // ) {
+        //   let api = pageByCurrentUserLeader;
+        //   return api({
+        //     ...where,
+        //     pageNum: page,
+        //     size: limit
+        //   });
+        // } else {
+        //   return [];
+        // }
+
+        // if()
       },
 
       async chooseUser() {

+ 1 - 1
src/views/unacceptedProduct/detail.vue

@@ -609,7 +609,7 @@
             let params = {
               disposeType: this.disposeForm.disposeType,
               poList: [],
-              refluxTask: {}
+              refluxTask: null
             };
             if (this.all) {
               params.poList = this.selection.map((item) => {