695593266@qq.com 9 месяцев назад
Родитель
Сommit
a59f92dbc9

+ 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;
+    }
   }
 };

+ 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);

+ 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: '#409EFF'
           }
+          // {
+          //   type: 'turnover',
+          //   bjColor: '#E6F7E7'
+          // }
         ],
         btnList2: [
           // {

+ 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
             "

+ 5 - 3
src/views/produce/components/jobBooking/index.vue

@@ -234,7 +234,7 @@
           @chooseData="chooseData"
         ></batchSemiProductJobBom>
 
-        <batchSemiProductJobBom
+        <!-- <batchSemiProductJobBom
           :singleReport="item.singleReport"
           v-if="
             item.semiProductList &&
@@ -250,7 +250,7 @@
           :isEngrave="isEngrave"
           :isDisposal="isDisposal"
           @chooseData="chooseData"
-        ></batchSemiProductJobBom>
+        ></batchSemiProductJobBom> -->
 
         <!-- <checkbox :tableData="item.semiProductList" ></checkbox> -->
         <!-- :itemData="item" @tableDataFn="tableDataFn" -->
@@ -260,7 +260,6 @@
           v-if="
             item.semiProductList &&
             item.semiProductList.length != 0 &&
-            taskObj.type != 4 &&
             taskObj.type != 6 &&
             item.singleReport == 0 &&
             clientEnvironmentId == 3
@@ -376,6 +375,9 @@
           "
           :list="item.semiProductList"
           :item="item"
+          :isChoose="isChoose"
+          :isEngrave="isEngrave"
+          :isDisposal="isDisposal"
         ></packingTgBom>
 
         <div

+ 22 - 7
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>

+ 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

@@ -843,11 +843,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') {

+ 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: '报废' },

+ 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) => {