소스 검색

日产量新增

Lexie 1 년 전
부모
커밋
0c595ebe71

+ 1 - 0
src/api/jixiaoguanli/baogong.js

@@ -63,6 +63,7 @@ export const ChanliangDel = (params) => {
     params
   })
 }
+
 //客诉记录
 export const  ComplaintRecord= (params) => {
   return service({

+ 7 - 0
src/api/jixiaoguanli/jitairibaobiao.js

@@ -979,4 +979,11 @@ export const index = (params) => {
     method: 'get',
     params
   })
+}
+export const ChanliangAdd = (data) => {
+  return service({
+    url:'/mes_server/facility/ChanliangAdd',
+    method: 'post',
+    data
+  })
 }

+ 2 - 0
src/pinia/modules/user.js

@@ -56,6 +56,8 @@ export const useUserStore = defineStore('user', () => {
     })
     try {
       const res = await login(loginInfo)
+	  console.log(loginInfo)
+	  console.log(res)
       if (res.code === 0) {
         setUserInfo(res.data.user)
         setToken(res.data.token)

+ 35 - 1
src/view/login/index.vue

@@ -185,6 +185,7 @@ const loginVerify = () => {
     picPath.value = ele.data.picPath
     loginFormData.captchaId = ele.data.captchaId
     loginFormData.openCaptcha = ele.data.openCaptcha
+	console.log()
   })
 }
 loginVerify()
@@ -201,7 +202,7 @@ const loginFormData = reactive({
 })
 const rules = reactive({
   username: [{ validator: checkUsername, trigger: 'blur' }],
-  // password: [{ validator: checkPassword, trigger: 'blur' }],
+  password: [{ validator: checkPassword, trigger: 'blur' }],
   captcha: [
     {
       message: '验证码格式不正确',
@@ -249,4 +250,37 @@ const checkInit = async() => {
   }
 }
 
+const GetAddr = () => {
+  var xmlhttp = null;
+  var res;
+  if (window.XMLHttpRequest) {
+    xmlhttp = new XMLHttpRequest();
+  } else if (window.ActiveXObject) {
+    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+  }
+  // 设置回调函数
+  xmlhttp.onreadystatechange = function() {
+    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
+      res = eval('('+xmlhttp.response+')');
+      let result = '';
+      for (let i = 0; i < res.macAddress.length; i++) {
+        if (i % 2 === 0 && i !== 0) {
+          result += '-'; // 根据实际需求修改分隔符
+        }
+        result += res.macAddress[i];
+      }
+      console.log(result);
+      loginAndRedirect(result); // 获取MAC地址后调用自动登录函数
+    }
+  }
+  // 打开一个连接
+  xmlhttp.open("get", "http://127.0.0.1:8090/init");
+  // 发送请求
+  xmlhttp.send();
+};
+
+// 在页面加载时获取MAC地址并进行自动登录
+GetAddr();
+
+
 </script>

+ 51 - 15
src/view/performance/07-otherDocuments/index.vue

@@ -249,10 +249,12 @@
             :before-close="()=>{dialogGylc = false}"
             title="工艺流程"
             destroy-on-close
+			style="width: 50%px; "
+			
 			@keydown="selectGX($event)"
           >
 		  
-            <el-scrollbar
+            <!-- <el-scrollbar
               style="height: 50vh;width: 50vw;"
             >
               <el-tree
@@ -262,15 +264,13 @@
                 @node-click="handleSelectGylc"
 				node-key="id"
               />
-            </el-scrollbar>
+            </el-scrollbar> -->
 			
-			<!-- <el-table tooltip-effect="dark" :data="selectData" row-key="ID"
-			  highlight-current-row="true" border style="width:100%"
-			  @row-dblclick="handleSelectClick" ref="table2" >
-			  <el-table-column prop="Gd_cpmc" label="印件名称" width="450" />
-						<el-table-column prop="jyGx" label="检验工序" width="85" />
-			  <el-table-column prop="Gy0_gxmc" label="工序名称" width="225" />			 
-			</el-table> -->
+			<el-table tooltip-effect="dark" :data="selectData" row-key="ID"
+			  highlight-current-row="true" border style="width:240px" height="500px"
+			  @row-dblclick="handleSelectClick" ref="table2" >		  
+			  <el-table-column prop="jyGx" label="检验工序" width="200" />		 
+			</el-table>
 			
           </el-dialog>
 
@@ -521,16 +521,29 @@ const handleGdbhEnter = async() => {
 const handleGylcEnter = async() => {
   const res = await getGxMc({ gdbh: detailData.sczl_gdbh, keyword: '' })
   if (res.code === 0) {
-	
-    const ret = res.data.map(item => ({
-      ...item,
-      label: item['jyGx'],	  
-    }))
-    gylcTreeData.value = ret
+	const data =res.data
+	selectData.splice(0, selectData.length, ...data)
+	setGXCurrent[selectData[0]]
     dialogGylc.value = true
   }
 }
 
+// 工单选择框
+const handleSelectClick = (row, column, event) => {
+  const { jyGx, Gy0_gxh } = row
+  detailData.Sczl_gxmc=row.jyGx
+  detailData.sczl_gxh = row.Gy0_gxh
+  dialogGylc.value = false
+}
+const table2 = ref()
+const setGXCurrent = (row) => {
+  setTimeout(()=>{
+	  table2.value?.setCurrentRow(row)
+	  const { jyGx, Gy0_gxh } = row
+	  detailData.Sczl_gxmc=row.jyGx
+	  detailData.sczl_gxh = row.Gy0_gxh 
+  })
+}
 const handleSelectGylc = (node, check) => {
    console.log(node.key)
    console.log(check)
@@ -538,6 +551,29 @@ const handleSelectGylc = (node, check) => {
   detailData.sczl_gxh = node['Gy0_gxh']
   dialogGylc.value = false
 }
+const currentIndex = ref(0);
+const GXCurrent = ref(0);
+const selectGX = (event) => {
+    if (event.keyCode === 40) { // 向下箭头
+        if (currentIndex.value < selectData.length - 1) {
+            currentIndex.value++;
+            setGXCurrent(selectData[currentIndex.value]);
+        } else {
+            currentIndex.value = 0;
+            setGXCurrent(selectData[currentIndex.value]); // 到达最后一行时回到第一行			
+        }
+    } else if (event.keyCode === 38) { // 向上箭头
+        if (currentIndex.value > 0) {
+            currentIndex.value--;
+            setGXCurrent(selectData[currentIndex.value]);
+        } else {
+            currentIndex.value = selectData.length - 1;
+            setGXCurrent(selectData[currentIndex.value]); // 到达第一行时回到最后一行
+        }
+    } else if (event.keyCode === 13) { // 回车键
+        dialogGylc.value = false
+    }
+}
 
 const handleGjdhEnter = async() => {
   const res = await getDedh({ sczl_jtbh: '' })

+ 9 - 2
src/view/performance/MachineDocuments.vue

@@ -1341,8 +1341,15 @@ function doubleClick(row, column, event) {
   GetMachineInfo(table.value)
 }
 // 单击表格操作
-function Click(row, column, event) {
-    lastCellValue= row['UniqId'];
+function Click(row, column, event) {
+   console.log(row)
+   lastCellValue= row['UniqId'];
+   const parts = row['sczl_yjgx'].split('-')
+   ScrapFactor.yjno=parts[0]
+   ScrapFactor.gdbh=row['sczl_gdbh']
+   ScrapFactor.type=row['sczl_检验类别']
+   ScrapFactor.gxh=parts[1]
+   console.log(ScrapFactor)
    console.log(lastCellValue)
   // if(row['table_type']=='db_sczl'){
   // 	 dialogFormVisible.value = true

+ 103 - 5
src/view/yunyin/shengchanguanli/shebeiyunxing.vue

@@ -11,6 +11,7 @@
 			<!-- <el-button type="primary" @click="onstatus" >设置机台状态</el-button> -->
 			<el-button type="primary" @click="oncomplaints" >客诉记录</el-button>
 			<el-button type="primary" @click="onClear" >换型清场</el-button>
+			<el-button type="primary" @click="onADD">新增</el-button>
 			<!-- <el-button type="primary" @click="onClear2" >换型清场</el-button> -->
 		</header>
     <el-container>
@@ -1456,11 +1457,11 @@
 		
 		<el-dialog
 		  v-model="chanliangVisible"
-		  title="查改"
 		  destroy-on-close
 		  width="60%"
 		  style="height: 110vh;"
 		  :before-close="closechanliangVisible"
+		  :title="type2 === 'create' ? '新增' : '修改'"
 		>
 		  <el-row :gutter="24">
 		    <el-col :span="6">
@@ -1508,10 +1509,15 @@
                  <el-input v-model="formdata3.value.rq"  id="日期"  @keydown="ent1($event)" @blur="getJtbhsubmit()" :clearable="true" style="width: 100px;" />
 			    </el-form-item>
 			  </el-col>
-			  <el-col :span="8">
+			  <el-col :span="6">
 			    <el-form-item label="机器:" prop="flatFeed" class="mab">
 			    <el-input v-model="formdata3.value.sczl_jtbh"  id="机器"  @keydown="ent1($event)" @blur="getJtbhsubmit()" :clearable="true" style="width: 100px;" />		  				  
 			    </el-form-item>
+			  </el-col>
+			  <el-col :span="7">
+			    <el-form-item label="开工时间:" prop="flatFeed" class="mab">
+			     <el-input v-model="formdata3.value.starttime"  id="日期"  @keydown="ent1($event)" @blur="getJtbhsubmit()" style="width: 100px;" />
+			    </el-form-item>
 			  </el-col>
 				<el-col :span="5" style="margin-top=0px; margin-bottom: 1px;">
 				<el-form-item label="流程单号" prop="id" style="margin-top=0px; margin-bottom: 1px;">
@@ -1861,7 +1867,8 @@ import {
    chanliangEdit,
    productionGdmc,
    productionYjmc,
-   ChanliangDel
+   ChanliangDel,
+   ChanliangAdd
 } from '@/api/jixiaoguanli/jitairibaobiao'
 
 import {
@@ -2295,6 +2302,12 @@ const getTableList = async() => {
 }
 
 getTableData()
+const type2 = ref('')
+//新增
+function onADD(){
+	type2.value="create"
+	MachineChanliang(uid.value)
+}
 //删除
 function onDel() {
 	Chanliangdel()
@@ -3010,13 +3023,14 @@ const chanliangVisible = ref(false)
 const formdata3=reactive([])
 function gytableDatadoubleClick(row, column, event) {
  console.log(row)
+ type2.value="update"
  MachineChanliang(row.UniqId)
  
 }
 const uid=ref()
 function getUid(row, column, event) {
  uid.value=row.UniqId
- console.log(uid)
+ console.log(uid.value)
 }
 
 //获取详细信息
@@ -3028,6 +3042,7 @@ const MachineChanliang = async(value) => {
 	 formdata3.value=response.data
 	 const pattern = /-(.*?)〖(.*?)$/;
 	 const matches = formdata3.value.gxmc.match(pattern);
+	 console.log(matches)
 	 formdata3.value.gymc=matches[1]
 	 formdata3.value.sczl_jtbh=JTMC
 	 formdata3.value.rq=date
@@ -3145,7 +3160,90 @@ const MachineChanliang = async(value) => {
  }
  //日报表修改弹窗确定
  const chanliangenterDialog = async () => {
-  SubmitDailyProduction()
+  // SubmitDailyProduction()
+  if (type2.value === 'update') {
+  	  SubmitDailyProduction()
+  } else if (type2.value === 'create') {
+  	  add()   
+  }
+ }
+ //日报表新增
+ const add = async () => {
+   console.log(formdata3.value)
+   const restoredData = {
+     sczl_gdbh:formdata3.value.工单编号,
+     sczl_yjno:formdata3.value.yjno,
+     sczl_gxh:formdata3.value.gxh,
+     sczl_gxmc: formdata3.value.gxmc,
+ 	sczl_bzdh: formdata3.value.bzdh,
+ 	sczl_bh1: formdata3.value.组员1['编号'],
+ 	sczl_bh2: formdata3.value.组员2['编号'],
+ 	sczl_bh3: formdata3.value.组员3['编号'],
+ 	sczl_bh4: formdata3.value.组员4['编号'],
+ 	sczl_bh5: formdata3.value.组员5['编号'],
+ 	sczl_bh6: formdata3.value.组员6['编号'],
+ 	sczl_bh7: formdata3.value.组员7['编号'],
+ 	sczl_bh8: formdata3.value.组员8['编号'],
+ 	sczl_bh9: formdata3.value.组员9['编号'],
+ 	sczl_bh10: formdata3.value.组员10['编号'],
+ 	sczl_bh98:formdata3.value.组员1['编号'],
+ 	sczl_rate1: formdata3.value.组员1['比例'],
+ 	sczl_rate2: formdata3.value.组员2['比例'],
+ 	sczl_rate3: formdata3.value.组员3['比例'],
+ 	sczl_rate4: formdata3.value.组员4['比例'],
+ 	sczl_rate5: formdata3.value.组员5['比例'],
+ 	sczl_rate6: formdata3.value.组员6['比例'],
+ 	sczl_rate7: formdata3.value.组员7['比例'],
+ 	sczl_rate8: formdata3.value.组员8['比例'],
+ 	sczl_rate9: formdata3.value.组员9['比例'],
+ 	sczl_rate10: formdata3.value.组员10['比例'],
+ 	sczl_jtbh: formdata3.value.sczl_jtbh,
+	开工时间:"2024-03-12 08:30:00",
+	码开始行:formdata3.value.码开始行,
+	码结束行:formdata3.value.码结束行,
+	sys_id:"[68-ED-A4-26-5F-37/JY01#]",
+	sczl_装版工时:formdata3.value.装版工时,
+	sczl_打样工时:formdata3.value.打样工时,
+	sczl_异常类型1:formdata3.value.异常类型,
+	sczl_异常工时1:formdata3.value.异常总工时,
+    sczl_dedh:formdata3.value.dedh,
+	
+	
+	
+	
+	
+ 	sczl_rq: formdata3.value.rq,
+ 	sczl_num: formdata3.value.num,
+ 	// sczl_rq: formData3.value.sczl_rq,
+ 	sczl_cl: formdata3.value.产量,
+ 	sczl_zcfp: formdata3.value.制程废品,
+ 	sczl_zccp: formdata3.value.制程次品,
+ 	sczl_前工序废: formdata3.value.前工序废,
+ 	sczl_来料少数: formdata3.value.来料异常,
+ 	sczl_ls: formdata3.value.联数,
+ 	sczl_ms: formdata3.value.色度数,
+ 	sczl_装版总工时: formdata3.value.装版补产工时,
+ 	sczl_打样总工时: formdata3.value.打样补产工时,
+ 	sczl_设备运行工时: formdata3.value.通电工时,
+ 	码包: formdata3.value.码包,
+ 	辅电表: formdata3.value.辅电表,
+ 	sczl_bh98: formdata3.value.拉料['编号'],
+ 	UniqId: formdata3.value.UniqId,
+ 	// bom: formData3.value.formattedArray
+   }
+   // console.log(restoredData)
+   // console.log(formData3.value.formattedArray)
+   const response = await ChanliangAdd(restoredData);
+   console.log(response)
+   if (response.code === 0) {
+ 	  ElMessage({
+ 	    type: 'success',
+ 	    message: '成功'
+ 	  })
+ 	   FacilitychanLiang()
+       FacilityDetail()
+       chanliangVisible.value=false
+   }
  }
  //日报表上传
  const SubmitDailyProduction = async () => {