LAPTOP-16IUEB3P\Lenovo 2 лет назад
Родитель
Сommit
5ce4b2f20b

+ 11 - 0
src/api/produceOrder/index.js

@@ -134,3 +134,14 @@ export async function getDeviceByTaskId (params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 获取槽数 
+export async function getSoltNum (id) {
+  const res = await request.get(
+    `/main/categorypallet/getByCategoryId/${id}`
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 5 - 2
src/components/EquipmentDailog/equipment-dailog.vue

@@ -100,7 +100,7 @@
           }
         ];
 
-        if (!this.isSingle) {
+        if (this.isSingle) {
           list.push({
             slot: 'select',
             prop: 'select',
@@ -127,8 +127,11 @@
         this.visible = true;
         this._getList();
       },
-      openSingle (list = [], callback) {
+      openSingle (list, callback) {
         this.memoList = list;
+		if(list.length){
+			this.radio = list[0].deviceId
+		}
         this.callback = callback;
         this.isSingle = true;
         this.visible = true;

+ 25 - 10
src/views/operationControl/index.vue

@@ -7,6 +7,7 @@
 		    label-width="0"
 		    :show-message="false"
 		    ref="formRef"
+			:rules="rules"
 		  >
 		    <el-descriptions title="" :column="1" border>
 		      <el-descriptions-item
@@ -24,10 +25,9 @@
 					</el-form-item>
 		      </el-descriptions-item>
 		      <el-descriptions-item
-		        label=""
 				v-if="formData.dateType==2"
 		      >
-		        <span slot="label" class="label-required"></span>
+		        <span slot="label" class="label-required"><i>*</i> 指定日期</span>
 		        <el-form-item prop="appointTime" class="w100">
 		          <el-date-picker
 		            class="w100"
@@ -95,7 +95,10 @@
 			  appointTime:''
 		  },
 		  fnType:1,
-		  saveLoading:false
+		  saveLoading:false,
+		  rules:{
+			  appointTime: [{ required: true, message: '请选择指定日期', trigger: 'change' }]
+		  }
       };
     },
     computed: {
@@ -124,13 +127,19 @@
 			if(this.formData.dateType==1){
 				delete this.formData.appointTime
 			}
-			this.saveLoading = true
-			saveOrUpdate(this.formData).then(res=>{
-				this.$message.success(res)
-				this.saveLoading = false
-				this.getInfoData()
-			}).catch(()=>{
-				this.saveLoading = false
+			 this.$refs.formRef.validate((valid) => {
+			  if (valid) {
+				this.saveLoading = true
+				saveOrUpdate(this.formData).then(res=>{
+					this.$message.success(res)
+					this.saveLoading = false
+					this.getInfoData()
+				}).catch(()=>{
+					this.saveLoading = false
+				})
+			  } else {
+				return false;
+			  }
 			})
 		}
      
@@ -155,5 +164,11 @@
 			align-items: center;
 			justify-content: flex-end;
 		}
+		.label-required{
+			i{
+				color: red;
+				font-style: normal;
+			}
+		}
 	}
 </style>

+ 14 - 1
src/views/produceOrder/components/report/Common.vue

@@ -49,6 +49,7 @@
             type="datetime"
             format="yyyy-MM-dd HH:mm:ss"
             placeholder="请选择"
+			:disabled="formData.dateType==2"
           ></el-date-picker
         ></el-form-item>
       </div>
@@ -238,7 +239,11 @@
       taskInfo: {
         type: Object,
         default: () => ({})
-      }
+      },
+	  formData: {
+	    type: Object,
+	    default: () => ({})
+	  }
     },
     data () {
       return {
@@ -291,6 +296,14 @@
           }
         }
       },
+	  formData: {
+	    immediate: true,
+	    handler () {
+	      if (this.formData.dateType==2) {
+	        this.$set(this.workReport,'executeTime',this.formData.appointTime);
+	      }
+	    }
+	  },
       infoData: {
         immediate: true,
         handler () {

+ 16 - 2
src/views/produceOrder/components/report/Drying.vue

@@ -50,6 +50,7 @@
             type="datetime"
             format="yyyy-MM-dd HH:mm:ss"
             placeholder="请选择"
+			:disabled="formData.dateType==2"
           ></el-date-picker
         ></el-form-item>
       </div>
@@ -255,7 +256,11 @@
       taskInfo: {
         type: Object,
         default: () => ({})
-      }
+      },
+		formData: {
+		  type: Object,
+		  default: () => ({})
+		}
     },
     data () {
       return {
@@ -314,7 +319,16 @@
       this.workReport.executorId = this.$store.state.user.info?.userId;
       this.workReport.executorJobNum = this.$store.state.user.info?.jobNumber;
     },
-    watch: {},
+    watch: {
+			formData: {
+			  immediate: true,
+			  handler () {
+			    if (this.formData.dateType==2) {
+			      this.$set(this.workReport,'executeTime',this.formData.appointTime);
+			    }
+			  }
+			}
+		},
     methods: {
       getCategory (id, memo) {
         this.$refs.catogaryDialogRef.open(id, this[memo], (res) => {

+ 22 - 3
src/views/produceOrder/components/report/Extrusion.vue

@@ -45,6 +45,7 @@
             type="datetime"
             format="yyyy-MM-dd HH:mm:ss"
             placeholder="请选择"
+			:disabled="formData.dateType==2"
           ></el-date-picker
         ></el-form-item>
       </div>
@@ -255,7 +256,7 @@
         <el-descriptions-item label="规格">{{
           boatMsg.specification
         }}</el-descriptions-item>
-        <el-descriptions-item label="槽数"></el-descriptions-item>
+        <el-descriptions-item label="槽数">{{slotNum}}</el-descriptions-item>
         <el-descriptions-item label="数量"
           ><el-input
             placeholder="请输入"
@@ -283,7 +284,7 @@
   import equipmentDailog from '@/components/EquipmentDailog/report-equipment';
   import materialDialog from '../materialDialog.vue';
   import catogaryDialog from '../catogaryDialog.vue';
-  import { reportCount } from '@/api/produceOrder';
+  import { reportCount , getSoltNum } from '@/api/produceOrder';
   import dayjs from 'dayjs';
   export default {
     components: {
@@ -296,6 +297,10 @@
       infoData: {
         type: Object,
         default: () => ({})
+      },
+	  formData: {
+        type: Object,
+        default: () => ({})
       },
       taskInfo: {
         type: Object,
@@ -362,7 +367,8 @@
             num: ''
           }
         },
-        batchList: []
+        batchList: [],
+		slotNum:''
       };
     },
     watch: {
@@ -373,6 +379,14 @@
             this.getReportCount();
           }
         }
+      },
+	  formData: {
+        immediate: true,
+        handler () {
+          if (this.formData.dateType==2) {
+            this.$set(this.workReport,'executeTime',this.formData.appointTime);
+          }
+        }
       },
       infoData: {
         immediate: true,
@@ -403,6 +417,11 @@
     methods: {
       getCategory (id, memo) {
         this.$refs.catogaryDialogRef.open(id, this[memo], (res) => {
+			if(id=='8'){
+				getSoltNum(res.id).then(r=>{
+					this.slotNum = r.slotNum
+				})
+			}
           this[memo].rootCategoryLevelId = res.categoryLevelId;
           this[memo].code = res.code;
           this[memo].name = res.name;

+ 14 - 1
src/views/produceOrder/components/report/Furnace.vue

@@ -39,6 +39,7 @@
             type="datetime"
             format="yyyy-MM-dd HH:mm:ss"
             placeholder="请选择"
+			:disabled="formData.dateType==2"
           ></el-date-picker
         ></el-form-item>
       </div>
@@ -99,7 +100,11 @@
       taskInfo: {
         type: Object,
         default: () => ({})
-      }
+      },
+	  formData: {
+	    type: Object,
+	    default: () => ({})
+	  }
     },
     data () {
       return {
@@ -144,6 +149,14 @@
           }
         }
       },
+	  formData: {
+	    immediate: true,
+	    handler () {
+	      if (this.formData.dateType==2) {
+	        this.$set(this.workReport,'executeTime',this.formData.appointTime);
+	      }
+	    }
+	  },
       infoData: {
         immediate: true,
         handler () {

+ 15 - 2
src/views/produceOrder/components/report/HalfAdded.vue

@@ -49,6 +49,7 @@
             type="datetime"
             format="yyyy-MM-dd HH:mm:ss"
             placeholder="请选择"
+			:disabled="formData.dateType==2"
           ></el-date-picker
         ></el-form-item>
       </div>
@@ -252,7 +253,11 @@
       taskInfo: {
         type: Object,
         default: () => ({})
-      }
+      },
+	  formData: {
+	    type: Object,
+	    default: () => ({})
+	  }
     },
     data () {
       return {
@@ -333,7 +338,15 @@
             );
           }
         }
-      }
+      },
+		formData: {
+		  immediate: true,
+		  handler () {
+			if (this.formData.dateType==2) {
+			  this.$set(this.workReport,'executeTime',this.formData.appointTime);
+			}
+		  }
+		}
     },
     created () {
       this.workReport.executorId = this.$store.state.user.info?.userId;

+ 15 - 2
src/views/produceOrder/components/report/Heating.vue

@@ -49,6 +49,7 @@
             type="datetime"
             format="yyyy-MM-dd HH:mm:ss"
             placeholder="请选择"
+			:disabled="formData.dateType==2"
           ></el-date-picker
         ></el-form-item>
       </div>
@@ -259,7 +260,11 @@
       taskInfo: {
         type: Object,
         default: () => ({})
-      }
+      },
+		formData: {
+		  type: Object,
+		  default: () => ({})
+		}
     },
     data () {
       return {
@@ -343,7 +348,15 @@
             );
           }
         }
-      }
+      },
+		formData: {
+		  immediate: true,
+		  handler () {
+			if (this.formData.dateType==2) {
+			  this.$set(this.workReport,'executeTime',this.formData.appointTime);
+			}
+		  }
+		}
     },
     created () {
       this.workReport.executorId = this.$store.state.user.info?.userId;

+ 16 - 2
src/views/produceOrder/components/report/Package.vue

@@ -48,6 +48,7 @@
             type="datetime"
             format="yyyy-MM-dd HH:mm:ss"
             placeholder="请选择"
+			:disabled="formData.dateType==2"
           ></el-date-picker
         ></el-form-item>
       </div>
@@ -174,7 +175,12 @@
       taskInfo: {
         type: Object,
         default: () => ({})
-      }
+      },
+	  formData: {
+	  	  type: Object,
+	  	  default: () => ({})
+	  	}
+	  
     },
     data () {
       return {
@@ -283,7 +289,15 @@
             this._getPackageList();
           }
         }
-      }
+      },
+		formData: {
+		  immediate: true,
+		  handler () {
+				if (this.formData.dateType==2) {
+					this.$set(this.workReport,'executeTime',this.formData.appointTime);
+				}
+		  }
+		}
     },
     created () {
       this.workReport.executorId = this.$store.state.user.info?.userId;

+ 5 - 1
src/views/produceOrder/components/report/Sinter.vue

@@ -94,7 +94,11 @@
       taskInfo: {
         type: Object,
         default: () => ({})
-      }
+      },
+		formData: {
+		  type: Object,
+		  default: () => ({})
+		}
     },
     data () {
       return {

+ 15 - 2
src/views/produceOrder/components/report/Warehousing.vue

@@ -39,6 +39,7 @@
             type="datetime"
             format="yyyy-MM-dd HH:mm:ss"
             placeholder="请选择"
+			:disabled="formData.dateType==2"
           ></el-date-picker
         ></el-form-item>
       </div>
@@ -127,7 +128,11 @@
       taskInfo: {
         type: Object,
         default: () => ({})
-      }
+      },
+		formData: {
+		  type: Object,
+		  default: () => ({})
+		}
     },
     data () {
       return {
@@ -166,7 +171,15 @@
             this.getReportCount();
           }
         }
-      }
+      },
+	  formData: {
+	    immediate: true,
+	    handler () {
+	  		if (this.formData.dateType==2) {
+	  			this.$set(this.workReport,'executeTime',this.formData.appointTime);
+	  		}
+	    }
+	  }
     },
     created () {
       this.workReport.executorId = this.$store.state.user.info?.userId;

+ 2 - 2
src/views/produceOrder/detail.vue

@@ -183,7 +183,7 @@
                 {{ countMsg.packProductTotalNum }}PCS
               </li>
             </ul>
-            <ul v-else-if="['库'].includes(chooseItem)">
+            <ul v-else-if="['库'].includes(chooseItem)">
               <li>
                 <span class="label">累计交接数量</span>
                 {{ countMsg.joinTotalNum }}PCS
@@ -964,7 +964,7 @@
               slot: 'action'
             }
           ],
-          库: [
+          库: [
             {
               label: '序号',
               type: 'index',

+ 14 - 3
src/views/produceOrder/report.vue

@@ -122,6 +122,7 @@
         :is="componentName"
         :key="activeName + isUpdate"
         :infoData="infoData"
+		:formData="formData"
         :taskInfo="{
           ...tabList[activeName],
           lastTaskCode:
@@ -138,6 +139,7 @@
 <script>
   import { getById, report } from '@/api/produceOrder/index.js';
   import { getTaskListById } from '@/api/mainData/index.js';
+  import { getInfo } from '@/api/operationControl/index.js';
   import Extrusion from './components/report/Extrusion';
   import Drying from './components/report/Drying';
   import Heating from './components/report/Heating';
@@ -187,7 +189,8 @@
           深加工: 'Common',
           包装: 'Package',
           入库: 'Warehousing'
-        }
+        },
+		formData:{}
       };
     },
     computed: {
@@ -197,7 +200,6 @@
         if (name.includes('半加')) {
           return 'HalfAdded';
         }
-
         return (
           this.componentsList[this.tabList[this.activeName].name] || 'Common'
         );
@@ -205,6 +207,7 @@
     },
     created () {
       this.init();
+	  this.getInfoData()
     },
     methods: {
       handleReport () {
@@ -259,7 +262,15 @@
 			code: "999999"
 		})
         this.activeName = '0';
-      }
+      },
+	  async getInfoData(){
+	  	const res = await getInfo()
+	  	if(typeof res != 'string'){
+	  		this.formData = res
+	  	}else{
+			this.formData = {}
+		}
+	  },
     }
   };
 </script>