liuhairui 1 year ago
parent
commit
926eadb79f

+ 6 - 0
.env.development

@@ -2,9 +2,15 @@ ENV = 'development'
 VITE_CLI_PORT = 8080
 VITE_SERVER_PORT = 8888
 VITE_BASE_API = /api
+<<<<<<< HEAD
 VITE_FILE_API = /api
 //VITE_BASE_PATH = http://10.10.4.58
 VITE_BASE_PATH = http://20.0.16.174
+=======
+//VITE_FILE_API = /api
+VITE_BASE_PATH = http://10.10.4.58
+//VITE_BASE_PATH = http://20.0.16.174
+>>>>>>> 0f8b2571f92751c3c03626513b73ce1c2f3925aa
 //VITE_EDITOR = vscode
 // VITE_EDITOR = webstorm 如果使用webstorm开发且要使用dom定位到代码行功能 请先自定添加 webstorm到环境变量 再将VITE_EDITOR值修改为webstorm
 // 如果使用docker-compose开发模式,设置为下面的地址或本机主机IP

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

@@ -428,6 +428,14 @@ export const  productiondel= (params) => {
     params
   })
 }
+//同步
+export const  ProductionData= (params) => {
+  return service({
+    url:'/mes_server/Synchronization/ProductionData',
+    method: 'get',
+    params
+  })
+}
 //员工日工资
 //员工日工资查询侧边栏
 export const  dailygetTab= () => {

+ 32 - 30
src/view/job/rewards/rewards.vue

@@ -477,47 +477,49 @@
                   />
                   <el-input
                     v-model="detailData.JL_bh1"
-                    id="bh1"   @keyup.enter.native="GetYg($event, '1')" @keydown="ent($event, 'jt', 'bh1', 'bh2')"
+                    id="bh1"   @blur="GetYg($event, '2')" @keydown="ent($event, 'jt', 'bh1', 'bh2')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.JL_bh2"
-                    id="bh2"  @keydown="ent($event, 'bh1', 'bh2', 'bh3')" @keyup.enter.native="GetYg($event, '2')"
+                    id="bh2"  @keydown="ent($event, 'bh1', 'bh2', 'bh3')" @blur="GetYg($event, '3')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.JL_bh3"
-                    id="bh3"  @keydown="ent($event, 'bh2', 'bh3', 'bh4')" @keyup.enter.native="GetYg($event, '3')"
+                    id="bh3"  @keydown="ent($event, 'bh2', 'bh3', 'bh4')" @blur="GetYg($event, '4')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.JL_bh4"
-                    id="bh4"  @keydown="ent($event, 'bh3', 'bh4', 'bh5')" @keyup.enter.native="GetYg($event, '4')"
+                    id="bh4"  @keydown="ent($event, 'bh3', 'bh4', 'bh5')" @blur="GetYg($event, '5')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.JL_bh5"
-                    id="bh5"  @keydown="ent($event, 'bh4', 'bh5', 'bh6')" @keyup.enter.native="GetYg($event, '5')"
+                    id="bh5"  @keydown="ent($event, 'bh4', 'bh5', 'bh6')" @blur="GetYg($event, '6')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.JL_bh6"
-                    id="bh6"  @keydown="ent($event, 'bh5', 'bh6', 'bh7')" @keyup.enter.native="GetYg($event, '6')"
+                    id="bh6"  @keydown="ent($event, 'bh5', 'bh6', 'bh7')" @blur="GetYg($event, '7')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.JL_bh7"
-                    id="bh7"  @keydown="ent($event, 'bh6', 'bh7', 'bh8')" @keyup.enter.native="GetYg($event, '7')"
+                    id="bh7"  @keydown="ent($event, 'bh6', 'bh7', 'bh8')" @blur="GetYg($event, '8')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.JL_bh8"
-                    id="bh8"  @keydown="ent($event, 'bh7', 'bh8', 'bh9')" @keyup.enter.native="GetYg($event, '8')"
+                    id="bh8"  @keydown="ent($event, 'bh7', 'bh8', 'bh9')" @blur="GetYg($event, '9')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.JL_bh9"
-                    id="bh9"  @keydown="ent($event, 'bh8', 'bh9', 'name1')" @keyup.enter.native="GetYg($event, '9')"
+                    id="bh9"
+                    @keydown="ent($event, 'bh8', 'bh9', 'name1', '9')"
+                    @blur="GetYg($event, '10')"
                     style="width: 85px;"
                   />
                 </el-form-item>
@@ -714,47 +716,47 @@
                   />
                   <el-input
                     v-model="detailData.sczl_bh1"
-                    id="dh1"  @keydown="ent($event, 'jt2', 'dh1', 'dh2')" @keyup.enter.native="GetYg($event, '10')"
+                    id="dh1"  @keydown="ent($event, 'jt2', 'dh1', 'dh2')" @blur="GetYg($event, '13')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.sczl_bh2"
-                    id="dh2"  @keydown="ent($event, 'dh1', 'dh2', 'dh3')" @keyup.enter.native="GetYg($event, '11')"
+                    id="dh2"  @keydown="ent($event, 'dh1', 'dh2', 'dh3')" @blur="GetYg($event, '14')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.sczl_bh3"
-                   id="dh3"  @keydown="ent($event, 'dh2', 'dh3', 'dh4')" @keyup.enter.native="GetYg($event, '12')"
+                   id="dh3"  @keydown="ent($event, 'dh2', 'dh3', 'dh4')" @blur="GetYg($event, '15')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.sczl_bh4"
-                   id="dh4"  @keydown="ent($event, 'dh3', 'dh4', 'dh5')" @keyup.enter.native="GetYg($event, '13')"
+                   id="dh4"  @keydown="ent($event, 'dh3', 'dh4', 'dh5')" @blur="GetYg($event, '16')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.sczl_bh5"
-                    id="dh5"  @keydown="ent($event, 'dh4', 'dh5', 'dh6')" @keyup.enter.native="GetYg($event, '14')"
+                    id="dh5"  @keydown="ent($event, 'dh4', 'dh5', 'dh6')" @blur="GetYg($event, '17')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.sczl_bh6"
-                    id="dh6"  @keydown="ent($event, 'dh5', 'dh6', 'dh7')" @keyup.enter.native="GetYg($event, '15')"
+                    id="dh6"  @keydown="ent($event, 'dh5', 'dh6', 'dh7')" @blur="GetYg($event, '18')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.sczl_bh7"
-                    id="dh7"  @keydown="ent($event, 'dh6', 'dh7', 'dh8')" @keyup.enter.native="GetYg($event, '16')"
+                    id="dh7"  @keydown="ent($event, 'dh6', 'dh7', 'dh8')" @blur="GetYg($event, '19')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.sczl_bh8"
-                   id="dh8"  @keydown="ent($event, 'dh7', 'dh8', 'dh9')" @keyup.enter.native="GetYg($event, '17')"
+                   id="dh8"  @keydown="ent($event, 'dh7', 'dh8', 'dh9')" @blur="GetYg($event, '20')"
                     style="width: 85px;"
                   />
                   <el-input
                     v-model="detailData.sczl_bh9"
-                    id="dh9"  @keydown="ent($event, 'dh8', 'dh9', 'name2')" @keyup.enter.native="GetYg($event, '18')"
+                    id="dh9" @keydown="ent1($event)"  @blur="GetYg($event, '21')"
                     style="width: 85px;"
                   />
                 </el-form-item>
@@ -1226,18 +1228,18 @@ const getJtbhsubmit = (value) => {
 //获取员工信息
 const GetYg = (event, inputName) => {
   console.log(inputName);
-  // var num = parseInt(inputName) - 1;
-  // if (num >= 1 && num <= 9) {
-  //   getYg({ sczl_bh: detailData['JL_bh' + num] }).then(response => {
-  //     detailData['jlname' + num] = response.data.ygxm;
-  //     detailData['JL_bh' + num] = response.data.员工编号;
-  //   });
-  // } else if (num >= 9 && num <= 18) {
-  //   getYg({ sczl_bh: detailData['sczl_bh' + (num - 9)] }).then(response => {
-  //     detailData['zrname' + (num - 9)] = response.data.ygxm;
-  //     detailData['sczl_bh' + (num - 9)] = response.data.员工编号;
-  //   });
-  // }
+  var num = parseInt(inputName) - 1;
+  if (num >= 1 && num <= 10) {
+    getYg({ sczl_bh: detailData['JL_bh' + num] }).then(response => {
+      detailData['jlname' + num] = response.data.ygxm;
+      detailData['JL_bh' + num] = response.data.员工编号;
+    });
+  } else if (num >= 10 && num <= 21) {
+    getYg({ sczl_bh: detailData['sczl_bh' + (num - 11)] }).then(response => {
+      detailData['zrname' + (num - 11)] = response.data.ygxm;
+      detailData['sczl_bh' + (num - 11)] = response.data.员工编号;
+    });
+  }
 };
 // ============== 表格控制部分结束 ===============
 

+ 19 - 2
src/view/performance/Dayreports.vue

@@ -37,7 +37,8 @@
               <el-button type="primary" class="search" icon="search" @click="onSearch"></el-button>
 			  <el-button type="primary" class="bt" icon="plus" @click="onAdd">新增</el-button>
               <el-button type="primary" class="bt" icon="copy-document" @click="onCountByGdbh">切换显示方式</el-button>
-              <el-button type="primary" class="bt" icon="delete" @click="onDel">删除</el-button>
+              <el-button type="primary" class="bt" icon="delete" @click="onDel">删除</el-button>
+			  <el-button type="primary" class="bt"  @click="synchronous">同步</el-button>
               <div style="margin-left: auto;">
                 <el-button type="primary" class="bt" icon="download" @click="exportExcel">导出到Excel</el-button>
               </div>
@@ -469,7 +470,8 @@ import {
   productionadd,
   reportGetJtbh,
   dedhGetRate,
-  Export,
+  Export,
+  ProductionData
 } from '@/api/jixiaoguanli/jitairibaobiao'
 
 // 全量引入格式化工具 请按需保留
@@ -1574,6 +1576,21 @@ const Del = async () => {
 	})
   }
   getTableData()
+}
+//同步
+function synchronous() {
+	Synchronous()
+}
+//同步
+const Synchronous = async () => {
+  const response = await ProductionData();
+  if (response.code === 0) {
+	ElMessage({
+	  type: 'success',
+	  message: '同步成功',
+	})
+  }
+  getTableData()
 }
 const displayMod = ref('')
 // 按工单显示