Procházet zdrojové kódy

工序报工修改问题

longfenglin před 1 rokem
rodič
revize
daf60d5d25

+ 0 - 1
src/api/produce/workOrder.js

@@ -119,7 +119,6 @@ export async function znworkorderList(data) {
 
 
 
-
 // pda报工保存
 
 export async function jobSave(data) {

+ 6 - 1
src/views/produce/components/feeding/components/semiProductBom.vue

@@ -24,9 +24,14 @@
 
       <el-table-column label="编码" type="code" minWidth="110">
         <template slot-scope="{ row, $index }">
-          {{ row.code }}
+          {{ row.categoryCode }}
         </template>
       </el-table-column>
+      <!-- <el-table-column label="批次号" type="code" minWidth="110">
+        <template slot-scope="{ row, $index }">
+          {{ row.code }}
+        </template>
+      </el-table-column> -->
       <el-table-column label="序列号" type="productSequence" minWidth="110">
         <template slot-scope="{ row, $index }">
           {{ row.extInfo.productSequence }}

+ 1 - 1
src/views/produce/components/feeding/details.vue

@@ -5,7 +5,7 @@
         <div class="rx-bc">
           <div class="item_box rx-bc">
             <div class="round">{{ index + 1 }}</div>
-            <div class="time">投料时间:{{ item.createTime }} </div>
+             <div class="time">投料时间:{{ item.executorTime }} </div>
           </div>
 
           <div class="item_box rx-bc">

+ 26 - 6
src/views/produce/components/feeding/index.vue

@@ -137,6 +137,9 @@ export default {
       default() {
         return [];
       }
+    },
+    feedNeedEquipment:{
+      
     }
   },
 
@@ -153,6 +156,7 @@ export default {
     workListIds: {
       handler(val) {
         this.getList(val);
+        console.log('1111122222',val)
       },
       deep: true,
       immediate: true
@@ -167,6 +171,8 @@ export default {
       isShow: true,
     };
   },
+  mounted(){
+  },
 
   methods: {
     handleCreate(e) {
@@ -197,7 +203,7 @@ export default {
             m.paramDetailList = [];
 
             m.instanceList = []; // 物料
-            m.equipmentList = []; // 设备
+            // m.equipmentList = []; // 设备
             m.modelList = []; // 模具
             m.aridRegionList = []; // 干燥区
             m.packingList = []; // 包装
@@ -351,7 +357,12 @@ export default {
  
 
     async save(type, index) {
+      let arr = this.List.filter((L) => L.executorTime)
+      if (!arr.length) {
+        return this.$message.warning('请选择投料时间');
+      }
 
+      let deviceIs=false
       this.List.forEach((f) => {
         f.instanceList.forEach((e) => {
           if (Object.prototype.hasOwnProperty.call(e, 'type')) {
@@ -359,18 +370,27 @@ export default {
           }
           e.extInfo['isConsumable'] = e.isConsumable;
         });
+
+        if(this.feedNeedEquipment==1 && f.equipmentList.length == 0){
+          deviceIs=true
+          setTimeout(() => {
+            this.$message.warning({
+              message: '请工单编号:' +f.code+ '添加设备',
+              key: f.code // 使用当前时间作为key,确保唯一性
+            });
+          },500)
+        }
       });
+      //判断投料是否要添加设备
+      if(deviceIs){
+        return;
+      }
 
       const isCache = await this.checkCache(type);
 
       if (!isCache) {
         return false;
       }
-      let arr = this.List.filter((L) => L.executorTime)
-
-      if (!arr.length) {
-        return this.$message.warning('请选择执行时间');
-      }
       batchSave(this.List).then((res) => {
         this.$message.success('投料成功');
         this.getList(this.idsList);

+ 62 - 27
src/views/produce/components/jobBooking/components/semiProductJobBomPL.vue

@@ -36,8 +36,8 @@
                   <div class="item ww30"
                     >报工总重量 /{{ row.extInfo.weightUnit }}
                   </div>
-                  <div class="item ww30">设备</div>
-                  <div class="item ww30">炉次号</div>
+                  <div class="item ww30" v-if="deviceList.length > 0 && clientEnvironmentId==3">设备</div>
+                  <div class="item ww30" v-if="deviceList.length > 0 && clientEnvironmentId==3">炉次号</div>
                   <div class="item ww30">处置</div>
                   <div class="item ww10">操作</div>
                 </div>
@@ -72,7 +72,8 @@
                       ></el-input>
                     </div>
 <!-- 1 -->
-                    <div class="item ww30">
+                    <div class="item ww30" v-if="deviceList.length > 0 && clientEnvironmentId==3">
+                      <div v-if="isDetails">{{ it.deviceName }}</div>
                       <el-select
                         class="content_num"
                         v-model="it.deviceId"
@@ -80,7 +81,7 @@
                         placeholder="请选择"
                         @change="(e) => selectValBatch(e, row, $index, yyIdx)"
                         size="mini"
-                        :disabled="isDetails"
+                        v-else
                        >
                      <el-option
                        v-for="item in deviceList"
@@ -92,13 +93,15 @@
                     </el-select>
                     </div>
 
-                    <div class="item ww30">
+                    <div class="item ww30" v-if="deviceList.length > 0 && clientEnvironmentId==3">
+                      <div v-if="isDetails">{{ it.heatNumber }}</div>
                       <el-input
                        size="mini"
                        class="content_num"
                        v-model="it.heatNumber"
                        placeholder="请输入炉次号"
                       :disabled="isDetails"
+                      v-else
                     />
                     </div>
 <!-- 2 -->
@@ -152,8 +155,8 @@
                   <div class="item ww20"
                     >类型
                   </div>
-                  <div class="item ww30">设备</div>
-                  <div class="item ww30">炉次号</div>
+                  <div class="item ww30" v-if="deviceList.length > 0 && clientEnvironmentId==3">设备</div>
+                  <div class="item ww30" v-if="deviceList.length > 0 && clientEnvironmentId==3">炉次号</div>
                   <div class="item ww30">处置/原因</div>
                   <div class="item ww10">操作</div>
                 </div>
@@ -211,7 +214,8 @@
                     </div>
 
 <!-- 1 -->
-                    <div class="item ww30">
+                    <div class="item ww30" v-if="deviceList.length > 0 && clientEnvironmentId==3">
+                      <div v-if="isDetails">{{ it.deviceName }}</div>
                       <el-select
                         class="content_num"
                         v-model="it.deviceId"
@@ -220,6 +224,7 @@
                         @change="(e) => selectValNoBatch(e, row, $index, yyIdx)"
                         size="mini"
                         :disabled="isDetails"
+                        v-else
                        >
                      <el-option
                        v-for="item in deviceList"
@@ -231,12 +236,14 @@
                     </el-select>
                     </div>
 
-                    <div class="item ww30">
+                    <div class="item ww30" v-if="deviceList.length > 0 && clientEnvironmentId==3">
+                      <div v-if="isDetails">{{ it.heatNumber }}</div>
                       <el-input
                        size="mini"
                        class="content_num"
                        v-model="it.heatNumber"
                        placeholder="请输入炉次号"
+                       v-else
                       :disabled="isDetails"
                     />
                     </div>
@@ -356,7 +363,7 @@
       </el-table-column>
 
       <!-- <el-table-column
-        v-if="deviceList.length > 0"
+        v-if="deviceList.length > 0 && clientEnvironmentId!=3"
         width="140"
         label="设备"
         prop="deviceId"
@@ -384,7 +391,7 @@
       </el-table-column>
 
       <el-table-column
-        v-if="deviceList.length > 0"
+        v-if="deviceList.length > 0 && clientEnvironmentId!=3"
         label="炉次号"
         width="90"
         prop="heatNumber"
@@ -459,18 +466,26 @@
         immediate: true,
         deep: true,
         handler(newVal) {
-          console.log('cccccc',newVal)
-          
           //设备下拉框数据来源
           let newData=JSON.parse(JSON.stringify(newVal))
-          // this.deviceList = newData;
-          this.deviceArr(newData)
+          
+          if(this.isDetails){
+            this.deviceList = newData;
+          }else{
+            this.deviceArr(newData)
+          }
+          // 
 
           this.changeHeatNumber();
         }
       }
     },
-
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+     
     data() {
       return {
         deviceList: [],
@@ -502,8 +517,25 @@
 
       };
     },
-
+    mounted(){
+     this.theFirst()
+    },
     methods: {
+      theFirst(){
+        if(this.deviceList.length>0){
+          let obj = this.deviceList[0];
+         
+         this.list.map((item,index)=>{
+           this.$set(this.list[index].extInfo.batchReportInfo[0],'deviceName',obj.name)
+           this.$set(this.list[index].extInfo.batchReportInfo[0], 'heatNumber',obj.extInfo.heatNumber)
+           this.$set(this.list[index].extInfo.batchReportInfo[0],'deviceId',obj.instanceId)
+           this.$set(this.list[index].extInfo.notBatchReportInfo[0],'deviceName',obj.name)
+           this.$set(this.list[index].extInfo.notBatchReportInfo[0], 'heatNumber',obj.extInfo.heatNumber)
+           this.$set(this.list[index].extInfo.notBatchReportInfo[0],'deviceId',obj.instanceId)
+         
+         })
+        }
+      },
       getTaskFn() {
         getTaskInstanceList(this.item.workOrderId).then((res) => {
           this.stepsList = res;
@@ -523,8 +555,11 @@
           obj.extInfo.heatNumber
         );
       },
+      //碳谷
       selectValBatch(e, item, idx,bidx){
          let obj = this.deviceList.find((f) => f.id||f.instanceId == e);
+         console.log('aaa',e, item, idx,bidx)
+         console.log('cccc',obj)
          //设备名称
          this.$set(this.list[idx].extInfo.batchReportInfo[bidx],'deviceName',obj.name)
          //炉次号
@@ -549,10 +584,11 @@
         })
 
         this.deviceList = data;
-        if (this.deviceList.length > 0) {
+        console.log('1111',this.deviceList)
+        if (this.deviceList.length == 0) {
             this.list.forEach((o,index) => {
            
-              //合格分批设备炉次号
+              //碳谷合格分批设备炉次号
               o.extInfo.batchReportInfo.map((report,ridx)=>{
                 this.$set(this.list[index].extInfo.batchReportInfo[ridx],'deviceName',this.deviceList[0].name)
                 this.$set(this.list[index].extInfo.batchReportInfo[ridx],'deviceId',this.deviceList[0].id||this.deviceList[0].instanceId)
@@ -561,7 +597,7 @@
                 this.$set(this.list[index].extInfo.notBatchReportInfo[noidx],'deviceName',this.deviceList[0].name)
                 this.$set(this.list[index].extInfo.notBatchReportInfo[noidx],'deviceId',this.deviceList[0].id||this.deviceList[0].instanceId)
               })
-              //合格分批设备炉次号
+              //碳谷合格分批设备炉次号
               this.$forceUpdate();
             
             })
@@ -579,7 +615,7 @@
               // o.extInfo.heatNumber = f.extInfo.heatNumber;
               this.$set(this.list[index].extInfo,'heatNumber',f.extInfo.heatNumber)
 
-              //合格分批设备炉次号
+              //碳谷合格分批设备炉次号
               o.extInfo.batchReportInfo.map((report,ridx)=>{
                 if(report.deviceId==f.instanceId){
                    this.$set(this.list[index].extInfo.batchReportInfo[ridx],'heatNumber',f.extInfo.heatNumber)
@@ -590,23 +626,22 @@
                    this.$set(this.list[index].extInfo.notBatchReportInfo[noidx],'heatNumber',f.extInfo.heatNumber)
                 }
               })
-              //合格分批设备炉次号
               this.$forceUpdate();
               
             } else if (this.deviceList.length == 1) {
-              o['deviceId'] = this.deviceList[0].id;
+              // o['deviceId'] = this.deviceList[0].instanceId;
               // o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
               this.$set(this.list[index].extInfo,'heatNumber',this.deviceList[0].extInfo.heatNumber)
               
-               //合格分批设备炉次号
+               //碳谷合格分批设备炉次号
               o.extInfo.batchReportInfo.map((report,ridx)=>{
-                this.$set(this.list[index].extInfo.batchReportInfo[ridx],'deviceId',this.deviceList[0].id)
+                this.$set(this.list[index].extInfo.batchReportInfo[ridx],'deviceId',this.deviceList[0].instanceId)
                 this.$set(this.list[index].extInfo.batchReportInfo[ridx],'heatNumber',this.deviceList[0].extInfo.heatNumber)
                 this.$set(this.list[index].extInfo.batchReportInfo[ridx],'deviceName',this.deviceList[0].extInfo.name)
               })
-              //合格分批设备炉次号
+              //碳谷合格分批设备炉次号
               o.extInfo.notBatchReportInfo.map((noReport,noidx)=>{
-                this.$set(this.list[index].extInfo.notBatchReportInfo[noidx],'deviceId',this.deviceList[0].id)
+                this.$set(this.list[index].extInfo.notBatchReportInfo[noidx],'deviceId',this.deviceList[0].instanceId)
                 this.$set(this.list[index].extInfo.notBatchReportInfo[noidx],'heatNumber',this.deviceList[0].extInfo.heatNumber)
                 this.$set(this.list[index].extInfo.notBatchReportInfo[noidx],'deviceName',this.deviceList[0].extInfo.name)
               })

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

@@ -7,7 +7,7 @@
         <div class="rx-bc">
           <div class="item_box rx-bc">
             <div class="round">{{ index + 1 }}</div>
-            <div class="time">报工时间:{{ objData.createTime }} </div>
+            <div class="time">报工时间:{{ objData.workReportInfo.executorTime }} </div>
           </div>
 
           <div class="item_box rx-bc">
@@ -63,7 +63,7 @@
             objData.semiProductList &&
             (objData.semiProductList.length != 0) && (taskType != 6) &&
             objData.singleReport == 0
-          " :list="objData.semiProductList" :item="objData" :isDetails="true" :singleReport="objData.singleReport">
+          " :list="objData.semiProductList" :item="objData" :equipmentList="objData.equipmentList" :isDetails="true" :singleReport="objData.singleReport">
           </semiProductJobBomPL>
 
           <!-- <oneJobQualityBom v-if="

+ 14 - 8
src/views/produce/components/jobBooking/index.vue

@@ -387,6 +387,13 @@ export default {
             if (obj.semiProductList.length > 0) {
               // 预制体报工
               obj.workReportInfo.formedNum = obj.semiProductList.length;
+              let numCot=0
+              if(obj.semiProductList.length>0){
+                obj.semiProductList.map((fitem)=>{
+                  numCot= numCot + fitem.feedQuantity || 1
+                })
+                obj.workReportInfo.formedNum = numCot
+              }
             }
 
             obj.workReportInfo.formingNum = obj.formingNum;
@@ -450,14 +457,18 @@ export default {
 
     async save(type) {
 
-
-
       this.loading = this.$loading({
         lock: true,
         text: '加载中',
         background: 'rgba(0, 0, 0, 0.7)'
       });
 
+      let arr = this.List.filter((L) => L.workReportInfo.executorTime)
+      if (!arr.length) {
+        this.loading.close();
+        return this.$message.warning('请选择执行时间');
+      }
+
       let bol2;
       bol2 = this.List.every((e) => {
         return (
@@ -595,12 +606,7 @@ console.log('4444444444',this.List)
         return
       }
 
-      let arr = this.List.filter((L) => L.workReportInfo.executorTime)
-
-      if (!arr.length) {
-        this.loading.close();
-        return this.$message.warning('请选择执行时间');
-      }
+      
 
 
       console.log(this.List, 'this.List');

+ 113 - 10
src/views/produce/components/outsourcing/outsourceList.vue

@@ -17,13 +17,11 @@
 		<el-tabs v-model="activeName">
 			<el-tab-pane label="物品清单" name="0">
 				<div class="materialList">
-					<div class="u-reset" style="display: flex;" v-if="clientEnvironmentId != 2">
+					<!--  <div class="u-reset" style="display: flex;" v-if="clientEnvironmentId != 2">
 						<el-checkbox color="#fff" v-model="checkedAll" :checked="seletedAll" @change="_seletedAll">全选
 						</el-checkbox>
 						<div class="gxList">勾选:<span style="color: #157A2C">{{ checkListLen || 0 }}个</span></div>
 					</div>
-					<!--  -->
-					<!-- <el-checkbox-group  v-model="checkList"> -->
 						<div v-for="(item, index) in pickOutInList" :key="index">
 							<div class="listBox rx-bs">
 								
@@ -107,10 +105,106 @@
 
 								</div>
 							</div>
-						</div>
-					<!-- </el-checkbox-group> -->
-				</div>
-
+						</div> -->
+				 
+
+				<el-table
+				    ref="pickOutRef"
+					class="table_content"
+					:max-height="600"
+					:data="pickOutInList"
+					tooltip-effect="dark"
+					style="width: 100%;margin-top: 10px;"
+					stripe
+					border
+					 @selection-change="selectionPickOut"
+					>
+					<el-table-column
+					     align="center"
+						type="selection"
+						width="55">
+					</el-table-column>
+					<el-table-column label="序号" type="index" width="55">
+						<template slot-scope="{ row, $index }">
+						{{ $index + 1 }}
+						</template>
+					</el-table-column>
+
+					<el-table-column label="编码" type="code" minWidth="110">
+						<template slot-scope="{ row, $index }">
+						{{ row.categoryCode }}
+						</template>
+					</el-table-column>
+					<el-table-column label="名称" type="name" minWidth="110">
+						<template slot-scope="{ row, $index }">
+						{{ row.name }} 
+						<!-- ({{
+							row.rootCategoryLevelId == 2
+							? '在制品'
+							: row.rootCategoryLevelId == 23
+							? '半成品'
+							: row.rootCategoryLevelId == 9
+							? '产品'
+							: item.rootCategoryLevelId == 28
+							? '废品'
+							: ''
+						}}) -->
+						</template>
+					</el-table-column>
+
+					<el-table-column label="型号" type="modelType">
+						<template slot-scope="{ row, $index }">
+						{{ row.modelType }}
+						</template>
+					</el-table-column>
+
+					<el-table-column label="规格" type="specification">
+						<template slot-scope="{ row, $index }">
+						{{ row.specification }}
+						</template>
+					</el-table-column>
+
+					<el-table-column label="牌号" type="brandNum">
+						<template slot-scope="{ row, $index }">
+						{{ row.brandNum }}
+						</template>
+					</el-table-column>
+					<el-table-column
+						label="重量"
+						type="weightUnit"
+						width="120"
+					>
+						<template slot-scope="{ row, $index }">
+						   {{ row.weight || 0 }} {{ row.weightUnit }}
+						</template>
+					</el-table-column>
+					<el-table-column 
+					    label="刻码" type="engrave">
+						<template slot-scope="{ row, $index }">
+						{{ row.extInfo.engrave }}
+						</template>
+					</el-table-column>
+
+					<el-table-column
+						label="物料代号"
+						type="materielCode"
+					>
+						<template slot-scope="{ row, $index }">
+						{{ row.extInfo.materielCode }}
+						</template>
+					</el-table-column>
+                    <el-table-column
+						label="客户代号"
+						type="clientCode"
+					>
+						<template slot-scope="{ row, $index }">
+						{{ row.extInfo.clientCode }}
+						</template>
+					</el-table-column>
+
+					
+				</el-table>
+            </div>
 			</el-tab-pane>
 			<el-tab-pane label="带料清单" name="1">
 				<div class="materialList">
@@ -308,7 +402,8 @@ export default {
 			seletedAll: false, //全选状态
 			checkListLen: 0,
 			
-			warehouseList: []
+			warehouseList: [],
+			pickOutInListSelect:[]
 		}
 	},
 
@@ -436,6 +531,9 @@ export default {
 			// 	this.standardOutputList = res.standardOutputList
 			// 	this.$forceUpdate()
 			// })
+			this.$nextTick(()=>{
+			  this.$refs.pickOutRef.toggleAllSelection();
+			})
 		},
 
 
@@ -508,7 +606,10 @@ export default {
 			}
 			this.checkListLen = this.pickOutInList.filter(f => f.checked == true).length
 		},
+		selectionPickOut(val){
+		  this.pickOutInListSelect=val
 
+		},
 
 
 		scrolltolower() { },
@@ -550,7 +651,8 @@ export default {
 			if (this.clientEnvironmentId == 2) {
 				_pickOutInList = this.pickOutInList
 			} else {
-				_pickOutInList = this.pickOutInList.filter(f => f.checked == true)
+				// _pickOutInList = this.pickOutInList.filter(f => f.checked == true)
+				_pickOutInList = this.pickOutInListSelect
 			}
 
 
@@ -563,8 +665,9 @@ export default {
 				materialList: this.materialList,
 				standardOutputList: this.standardOutputList,
 			}
-			
+
 			applyoutsourceSave(param).then(res => {
+				this.$emit('outScucc')
 				return this.$message({
 					message: "提交成功",
 					type: "scuccess"

+ 21 - 4
src/views/produce/components/picking/index.vue

@@ -242,6 +242,7 @@ export default {
         let arr = res.map((e) => {
           e.bomDetailDTOS.map((d) => {
             e.warehouseId = d.warehouseList.length >0 ? d.warehouseList[0].id : ''
+            // this.getInventoryTotalFn([d.categoryCode])
           })
           e.pickList = [...e.bomDetailDTOS];
           e.bomDetailDTOS = [];
@@ -260,6 +261,8 @@ export default {
 
 
         this.getOrderCode();
+
+        this.getInventoryTotalFn()
         this.$forceUpdate();
       });
       }
@@ -267,11 +270,25 @@ export default {
     },
 
     async getInventoryTotalFn(id) {
-      return new Promise(async (solid, reject) => {
-        const res = await getInventoryTotal(id);
-        solid(res)
-        
+      let ids=[]
+      this.workList.map(item=>{
+        item.pickList.map(pitem=>{
+          ids.push(pitem.categoryCode)
+        })
+      })
+      const res = await getInventoryTotal(ids);
+      res.map(ritem=>{
+        this.workList.map(item=>{
+          item.pickList.map(pitem=>{
+            if(pitem.categoryCode==ritem.code){
+              pitem.availableCountBase=ritem.availableCountBase
+            }
+
+          })
+        })
       })
+      console.log('cashasisasa',res)
+        
     },
 
 

+ 9 - 5
src/views/produce/index.vue

@@ -84,7 +84,7 @@
 
               <div v-if="operationType == 'feed'">
                 <!-- 投料 -->
-                <feeding :workListIds="workListIds"></feeding>
+                <feeding :workListIds="workListIds" :feedNeedEquipment="feedNeedEquipment"></feeding>
               </div>
 
               <div v-if="operationType == 'job'">
@@ -113,7 +113,7 @@
                 <outsourcing :outsourceFormVal="outsourceForm" @changePlugIn="changePlugIn" v-if="isStep"></outsourcing>
 
                 <!--   -->
-                <outsourceList :outsourceFormVal="outObj" @closeForm="closeForm" v-else></outsourceList>
+                <outsourceList :outsourceFormVal="outObj" @closeForm="closeForm" @outScucc="outScucc" v-else></outsourceList>
 
               </div>
 
@@ -206,7 +206,8 @@ export default {
         children: 'children',
         label: 'name',
         value: 'code'
-      }
+      },
+      feedNeedEquipment:0,//投料是否要添加生产设备1是0否
     };
   },
 
@@ -295,8 +296,8 @@ export default {
     },
     // 点击工序
     handleNodeClick(data) {
-      console.log(data);
-
+      console.log(data,'11111sassasgasg');
+      this.feedNeedEquipment=data.feedNeedEquipment
 
       let obj = {
         '1': `${data.workCenterName}-${data.name}(普通工序)`,
@@ -347,6 +348,9 @@ export default {
     closeForm() {
       this.isStep = true;
     },
+    outScucc(){
+      this.operationType=null
+    },
 
     // 切换组件
     async changePlugIn(e) {