Эх сурвалжийг харах

Merge branch 'master' of https://git.7in6.com/Minong/mes-admin-backend-ui

曹鹤洋 1 жил өмнө
parent
commit
9f8646176c

+ 2 - 1
jsconfig.json

@@ -3,7 +3,8 @@
       "baseUrl": "./",
       "paths": {
         "@/*": ["src/*"],
-      }
+      },
+      "types": ["element-plus/global"]
     },
     "exclude": ["node_modules", "dist"],
     "include": ["src/**/*"]

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

@@ -0,0 +1,37 @@
+import service from '@/utils/request'
+
+export const ProcessInspectionRecordsItemAdd = (data) => {
+  return service({
+    url:'/mes_server/facility/ProcessInspectionRecordsItemAdd',
+    method: 'post',
+    data
+  })
+}
+export const AdditionalInspectionRecordAdd = (data) => {
+  return service({
+    url:'/mes_server/facility/AdditionalInspectionRecordAdd',
+    method: 'post',
+    data
+  })
+}
+export const getMac = (data) => {
+  return service({
+    url: 'http://127.0.0.1:8090/init',
+    method: 'get',
+    data
+  })
+}
+export const remodelGetTab = (data) => {
+  return service({
+    url: '/mes_server/facility/remodelGetTab',
+    method: 'get',
+    data
+  })
+}
+export const setMachineTeam = (data) => {
+  return service({
+    url:'/mes_server/Facility/setMachineTeam',
+    method: 'post',
+    data
+  })
+}

+ 1 - 0
src/api/mes/job.js

@@ -130,6 +130,7 @@ export const getRewardTabByGd = (params) => {
   })
 }
 
+
 export const getDocumentData = (params) => {
   return service({
     url: '/mes_server/process_document/getData',

+ 36 - 7
src/api/mes_api_gty/otherDocuments.js

@@ -29,22 +29,51 @@ export const getInfo = (params) => {
   })
 }
 
-// 获取拉料计件产量维护其他信息
-export const getOtherInfo = (params) => {
+// 查询员工名称
+export const getYg = (params) => {
   return service({
-    url: '/mes_server/other_count_document/getOtherInfo',
+    url: '/mes_server/packaging_count_document/getYg',
     method: 'get',
     params
   })
 }
-// 获取员工姓名
-export const getYg = (params) => {
+
+// 获取工单名称
+export const getGdmc = (params) => {
   return service({
-    url: '/mes_server/packaging_count_document/getYg',
+    url: '/mes_server/machine_production_report/getGdmc',
     method: 'get',
     params
   })
 }
+
+// 查询印件工序及产品名称
+export const getGxMc = (params) => {
+  return service({
+    url: '/mes_server/other_count_document/getGxMc',
+    method: 'get',
+    params
+  })
+}
+
+// 获取定额代号
+export const getDedh = (params) => {
+  return service({
+    url: '/mes_server/machine_production_report/getDedh',
+    method: 'get',
+    params
+  })
+}
+
+// 获取拉料计件产量维护其他信息
+export const getOtherInfo = (params) => {
+  return service({
+    url: '/mes_server/other_count_document/getOtherInfo',
+    method: 'get',
+    params
+  })
+}
+
 // 拉料计件产量维护修改
 export const updateData = (data) => {
   return service({
@@ -61,4 +90,4 @@ export const add = (data) => {
     method: 'post',
     data
   })
-}
+}

+ 9 - 0
src/api/mes_api_gty/timesheet.js

@@ -66,3 +66,12 @@ export const deleteData = (params) => {
     params
   })
 }
+
+// 查询员工名称
+export const getYg = (params) => {
+  return service({
+    url: '/mes_server/packaging_count_document/getYg',
+    method: 'get',
+    params
+  })
+}

+ 2 - 0
src/view/job/rewards/rewards.vue

@@ -1002,7 +1002,9 @@ const handleCurrentChange = (val) => {
 const detailData = reactive({})
 const handleDoubleClick = async(row) => {
   const { UniqId } = row
+  console.log(UniqId)
   const res = await getRewardDetail({ UniqId })
+  console.log(res)
   if (res.code === 0) {
     console.log(res)
     Object.assign(detailData, res.data[0])

+ 41 - 17
src/view/job/sampling/sampling.vue

@@ -208,7 +208,7 @@
           <el-dialog
             v-model="dialogFormVisible"
             :before-close="closeDialog"
-            :title="type==='create'?'添加':'修改'"
+            :title="type"
             destroy-on-close
             width="800"
           >
@@ -228,6 +228,7 @@
                 <el-input
                   v-model="detailData.Sczl_bh"
                   :clearable="true"
+				  @keyup.enter="handleGetYg"
                 />
               </el-form-item>
               <el-form-item prop="image">
@@ -250,11 +251,17 @@
                 label="班组:"
                 prop="address"
               >
-                <el-input
+                <!-- <el-input
                   v-model="detailData.sczl_bzdh"
                   :clearable="true"
                   placeholder="请输入班组"
-                />
+                /> -->
+				<el-select v-model="detailData.sczl_bzdh" placeholder="" style="width: 70px"
+				           
+				>
+				  <el-option label="A班" value="A班"></el-option>
+				  <el-option label="B班" value="B班"></el-option>
+				</el-select>
               </el-form-item>
               <el-form-item
                 label="日期:"
@@ -461,6 +468,7 @@
 <script setup>
 import { getSpotList, getSpotTab, getSpotLocal, getSpotInfo, updateSpotData,add } from '@/api/mes/job'
 import { createCompany, deleteCompany, deleteCompanyByIds, findCompany, updateCompany } from '@/api/company'
+import{getYg}from '@/api/mes_api_gty/myapi'
 // 全量引入格式化工具 请按需保留
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { reactive, ref } from 'vue'
@@ -503,6 +511,16 @@ const formData = ref({
   image: '',
   name: '',
 })
+const handleGetYg = async() => {
+  try {
+    const res = await getYg({ sczl_bh: detailData.Sczl_bh })
+    if (res.code === 0) {
+      detailData.name = res.data.ygxm
+    }
+  } catch (e) {
+    console.log(e)
+  }
+}
 
 // 验证规则
 const rule = reactive({
@@ -539,7 +557,7 @@ const params = {
   search: '',
   type: '',
 }
-
+const minUniqId = ref('')
 // 获取表格数据
 const getTableData = async() => {
   const { date, sys_id } = params
@@ -548,6 +566,7 @@ const getTableData = async() => {
   if (res.code === 0) {
     tableData.splice(0, tableData.length, ...res.data.rows)
     total.value = res.data.total
+	minUniqId.value= Math.min(...tableData.map(row => row.UniqId));
   }
 }
 
@@ -600,20 +619,25 @@ const handlerSearch = () => {
 }
 // 新增数据
 const handleShowAdd = async () => {
-  
-    type.value='add'
-	console.log(currentRow.value)
-   const res = await getSpotInfo({ UniqId:currentRow.value })
-   if (res.code === 0) {
-     Object.assign(detailData, res.data[0])
-     detailData.UniqId = currentRow.value
-     dialogFormVisible.value = true
-   }
+  type.value = '新增';
+  console.log(currentRow.value);
+
+  const res = await getSpotInfo({ UniqId: minUniqId.value });
+
+  if (res.code === 0) {
+	  let sczl_rq = new Date();
+	  sczl_rq.setDate(sczl_rq.getDate() - 0); // 今天的前N天的日期,N自定义
+	  res.data[0].Sczl_rq = `${sczl_rq.getFullYear()}-${sczl_rq.getMonth() + 1}-${sczl_rq.getDate()}`;
+    Object.assign(detailData, res.data[0]);
+    detailData.UniqId = currentRow.value;
+    dialogFormVisible.value = true
+  }
+};
 	// type.value='add'
  //    Object.assign(detailData);
 	// dialogFormVisible.value = true
   
-};
+// };
 // ============== 详情展示 ===============
 const detailData = reactive({})
 
@@ -621,7 +645,7 @@ const detailData = reactive({})
 const getDetailData = async(row) => {
   console.log(row.UniqId)
   const { UniqId } = row
-  type.value='update'
+  type.value='查改'
   const res = await getSpotInfo({ UniqId })
   if (res.code === 0) {
     Object.assign(detailData, res.data[0])
@@ -638,9 +662,9 @@ const handleSelectChange = (row, column, event) => {
 const enterDialog = async() => {
   // const obj = { ...detailData }
    console.log(type.value)
-   if (type.value === 'update') {
+   if (type.value === '查改') {
   	   updateDetailData()
-  	 } else if (type.value === 'add') {
+  	 } else if (type.value === '新增') {
   	   addDetailData()
   	 }else {
 		 console.log(type)

+ 290 - 217
src/view/performance/06-packingDocuments/index.vue

@@ -1,113 +1,52 @@
 <template>
   <div>
-    <el-container>
-      <!-- 左侧树形结构 -->
-      <el-scrollbar max-height="75vh">
-        <el-aside>
-          <div class="JKWTree-tree">
-            <h3>包装计件单据维护</h3>
-            <el-scrollbar
-              height="70vh"
-            >
-              <el-tree
-                :data="treeData"
-                highlight-current
-                @node-click="handleNodeClick"
-              />
-            </el-scrollbar>
-          </div>
-        </el-aside>
-      </el-scrollbar>
-
-      <el-container>
-        <el-main>
-          <div class="gva-table-box">
-            <!-- 按钮区域 -->
-            <div class="gva-btn-list">
-              <el-row :span="6">
-                <el-input
-                  v-model="searchInfo"
-                  style="width: 150px;"
-                  placeholder="输入工单编号"
-                />
-              </el-row>
-              <el-button
-                type="primary"
-                :icon="Search"
-                @click="handleSearch"
-              >定位
-              </el-button>
-              <el-button
-                type="primary"
-                :icon="Search"
-                @click="handleShowDetail"
-              >查改
-              </el-button>
-              <el-button
-                type="primary"
-                :icon="Search"
-                @click="handleShowAdd"
-              >新增
-              </el-button>
-              <el-button
-                type="primary"
-                :icon="Delete"
-                @click="handleDelete"
-              >删除
-              </el-button>
-              <div style="margin-left: auto;">
-                <el-button
-                  type="primary"
-                  :icon="Download"
-                  @click="handleExportExcel"
-                >导出到Excel
-                </el-button>
-              </div>
-            </div>
-            <!-- 数据展示 -->
-            <el-table
-              ref="multipleTable"
-              style="width: 100%"
-              :data="tableData"
-              row-key="ID"
-              highlight-current-row
-              border
-              show-overflow-tooltip="true"
-              :row-style="{ height: '20px' }"
-              :cell-style="{ padding: '0px' }"
-              :header-row-style="{ height: '20px' }"
-              :header-cell-style="{ padding: '0px' }"
-              @selection-change="handleSelectionChange"
-              @row-dblclick="handleShowDetail"
-              @row-click="currentRow = $event"
-            >
-              <el-table-column
-                type="selection"
-                width="55"
-              />
-              <!-- 循环渲染列 -->
-              <el-table-column
-                v-for=" column in tableColumns "
-                :key="column.prop"
-                :prop="column.prop"
-                :label="column.label"
-                :width="column.width"
-              />
-            </el-table>
-            <!-- 分页 -->
-            <div class="gva-pagination">
-              <el-pagination
-                v-model:current-page="page"
-                v-model:page-size="limit"
-                layout="total, sizes, prev, pager, next, jumper"
-                :page-sizes="[10, 30, 50, 100]"
-                :total="total"
-                @current-change="handleCurrentChange"
-                @size-change="handleSizeChange"
-              />
-            </div>
-          </div>
-          <!-- 弹出框 -->
+    <layout>
+      <layout-header>
+        <!-- 按钮 -->
+        <el-form inline>
+          <el-form-item>
+            <el-input
+              v-model="searchInfo"
+              placeholder="搜索产品编号或产品名称"
+              clearable
+              style="width: 180px;"
+            />
+            <el-button
+              type="primary"
+              icon="Search"
+              class="search"
+              @click="handleSearch"
+            />
+
+            <el-button
+              type="primary"
+              icon="edit"
+              class="bt"
+              @click="handleShowDetail"
+            ><i class="el-icon-edit" />查改
+            </el-button>
+
+            <el-button
+              type="primary"
+              icon="edit"
+              class="bt"
+              @click="handleShowAdd"
+            >新增
+            </el-button>
+
+            <el-button
+              type="primary"
+              icon="delete"
+              class="bt"
+              @click="handleDelete"
+            >删除
+            </el-button>
+
+          </el-form-item>
+        </el-form>
+
+        <!-- 弹出框 -->
+        <div>
           <el-dialog
             v-model="dialogFormVisible"
             :title="type"
@@ -116,10 +55,11 @@
           >
 
             <el-form
-              ref="elFormRef"
+              id="detail-form"
               :model="detailData"
               inline
               label-position="left"
+              @keyup="moveFocus"
             >
               <el-form-item
                 label="日期"
@@ -131,7 +71,6 @@
               </el-form-item>
               <el-form-item
                 label="员工编号"
-                @keyup.enter="handleGetYg"
               >
                 <el-input
                   v-model="detailData.sczl_bh"
@@ -144,17 +83,21 @@
                 />
               </el-form-item>
               <el-form-item label="组别">
-                <!-- <el-input
+                <el-select
                   v-model="detailData.sczl_bzdh"
-                  style="width: 50px;"
-                /> -->
-				<el-select v-model="detailData.sczl_bzdh" placeholder="" style="width: 70px" 
-				           
-				>
-				  <el-option label="A班" value="A班"></el-option>
-				  <el-option label="B班" value="B班"></el-option>
-				</el-select>
-              </el-form-item>
+                  placeholder=" "
+                  style="width: 80px"
+                >
+                  <el-option
+                    label="A班"
+                    value="A班"
+                  />
+                  <el-option
+                    label="B班"
+                    value="B班"
+                  />
+
+                </el-select></el-form-item>
               <br>
               <el-form-item
                 label="计时时数"
@@ -166,16 +109,21 @@
                 />
               </el-form-item>
               <el-form-item label="冲月定额">
-                <!-- <el-input
+                <el-select
                   v-model="detailData.sczl_冲定额"
-                  style="width: 50px;"
-                /> -->
-				<el-select v-model="detailData.sczl_冲定额" placeholder="" style="width: 70px"
-				           
-				>
-				  <el-option label="" value=""></el-option>
-				  <el-option label="是" value="B班"></el-option>
-				</el-select>
+                  placeholder=" "
+                  style="width: 100px"
+                >
+                  <el-option
+                    label=""
+                    value=""
+                  />
+                  <el-option
+                    label="是"
+                    value="是"
+                  />
+
+                </el-select>
               </el-form-item>
 
               <el-table
@@ -274,7 +222,10 @@
                   width="100"
                 >
                   <template #default="{ row }">
-                    <el-input v-model="row.sczl_dedh" @keyup.enter.native="getDedhsubmit" />
+                    <el-input
+                      v-model="row.sczl_dedh"
+                      @keyup.enter.native="getDedhsubmit"
+                    />
                   </template>
                 </el-table-column>
               </el-table>
@@ -333,26 +284,93 @@
               />
             </el-table>
           </el-dialog>
+        </div>
+
+      </layout-header>
+
+      <layout>
+        <!--    左侧树侧形结构-->
+        <layout-sider
+          :resize-directions="['right']"
+          :width="220"
+          style="margin-right: 10px;"
+        >
+          <div
+            class="JKWTree-tree"
+            style="height: 70vh;"
+          >
+            <h3>包装计件单据维护</h3>
+            <el-tree
+              :data="treeData"
+              highlight-current
+              @node-click="handleNodeClick"
+            />
+          </div>
+        </layout-sider>
 
-        </el-main>
-      </el-container>
-    </el-container>
+        <layout-content>
+          <!-- 数据展示 -->
+          <div class="gva-table-box">
+            <el-table
+              ref="table"
+              style="width: 100%"
+              :data="tableData"
+              row-key="ID"
+              highlight-current-row
+              border
+              show-overflow-tooltip
+              :row-style="{ height: '20px' }"
+              :cell-style="{ padding: '0px' }"
+              :header-row-style="{ height: '20px' }"
+              :header-cell-style="{ padding: '0px' }"
+              @row-dblclick="handleShowDetail"
+              @current-change="(row, oldRow) => { currentRow = row}"
+            >
+              <el-table-column
+                type="selection"
+                width="55"
+              />
+              <!-- 循环渲染列 -->
+              <el-table-column
+                v-for=" column in tableColumns "
+                :key="column.prop"
+                :prop="column.prop"
+                :label="column.label"
+                :width="column.width"
+              />
+            </el-table>
+            <!-- 分页 -->
+            <div class="gva-pagination">
+              <el-pagination
+                v-model:current-page="page"
+                v-model:page-size="limit"
+                layout="total, sizes, prev, pager, next, jumper"
+                :page-sizes="[10, 30, 50, 100]"
+                :total="total"
+                @current-change="handleCurrentChange"
+                @size-change="handleSizeChange"
+              />
+            </div>
+          </div>
+        </layout-content>
+      </layout>
+    </layout>
 
   </div>
 </template>
 
 <script setup>
-
-import { ElMessage, ElMessageBox } from 'element-plus'
-import { Download, Search, Delete } from '@element-plus/icons-vue'
+import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
+import { ElMessage, ElMessageBox, dayjs } from 'element-plus'
+// import { Download, Search, Delete } from '@element-plus/icons-vue'
 import { reactive, ref } from 'vue'
-import { getGxMc, getInfo, getLocate, getPackingSideTable, getPackingTable, updatePackingTable, getYg, DeletePackingTable, addPackingTable,getDedh } from '@/api/mes_api_gty/myapi'
+import { getGxMc, getInfo, getLocate, getPackingSideTable, getPackingTable, updatePackingTable, getYg, DeletePackingTable, addPackingTable, getDedh } from '@/api/mes_api_gty/myapi'
 
 defineOptions({
   name: '06PackingDocuments',
 })
 
-// region 侧边栏功能
+// 侧边栏功能
 const treeData = reactive([])
 const getSideData = async() => {
   try {
@@ -375,9 +393,8 @@ const getSideData = async() => {
   }
 }
 getSideData()
-// endregion
 
-// region 表格功能
+// 表格功能
 const tableColumns = [
   { label: '员工编号', prop: 'sczl_bh', width: '100' },
   { label: '员工姓名', prop: 'name', width: '100' },
@@ -407,8 +424,8 @@ const limit = ref(10)
 const type = ref('')
 const searchInfo = ref('')
 const currentRow = ref({})
-const multipleSelection = ref([])
-const minUniqId = ref('')
+// const multipleSelection = ref([])
+
 // 获取列表数据
 const getTableData = async() => {
   try {
@@ -416,18 +433,11 @@ const getTableData = async() => {
       date: params.date, sys_id: params.sys_id,
       page: page.value.toString(), limit: limit.value.toString(),
     })
-   if (response.code === 0) {
-         total.value = response.data.total;
-         // 清空原有数据并填充新数据
-         tableData.splice(0, tableData.length, ...response.data.rows);
-   
-         // 获取最大的 UniqId
-        minUniqId.value= Math.min(...tableData.map(row => row.UniqId));
-         console.log('最小的 UniqId:', minUniqId.value);
-       } else {
-         console.error('获取数据失败:', response.msg);
-       }
-	
+    if (response.code === 0) {
+      total.value = response.data.total
+      tableData.splice(0, tableData.length, ...response.data.rows)
+      setCurrent(tableData[0])
+    }
   } catch (e) {
     console.log(e)
   }
@@ -517,8 +527,8 @@ const handleDelete = () => {
       })
     })
 }
-
 // 分页
+// #region
 const handleSizeChange = () => {
   switch (params.type) {
     case 'getTableData':
@@ -543,9 +553,9 @@ const handleCurrentChange = () => {
       break
   }
 }
-// endregion
+// #endregion
 
-// region 详情界面
+// 详情界面
 const detailData = reactive({
   UniqId: '',
   selectIndex: 0,
@@ -559,11 +569,16 @@ const detailData = reactive({
   table: [],
 })
 const selectData = reactive([])
+const table = ref()
 
 // 弹窗控制标记
 const dialogFormVisible = ref(false)
 const dialogSelectVisible = ref(false)
 
+const setCurrent = (row) => {
+  table.value?.setCurrentRow(row)
+}
+
 // 获取详细信息
 const getTableInfo = async(id) => {
   try {
@@ -591,6 +606,12 @@ const getTableInfo = async(id) => {
         // .filter(item => item.sczl_gdbh !== '') // 过滤掉空的工单编号
       detailData.UniqId = id
       dialogFormVisible.value = true
+
+      // 在 setTimeout 中获取元素,确保在 DOM 渲染完毕后执行
+      setTimeout(() => {
+        formElements = document.getElementById('detail-form').elements
+        formElements[0].focus()
+      }, 0)
     }
   } catch (e) {
     console.log(e)
@@ -654,46 +675,12 @@ const updateDetailData = async() => {
 }
 
 // 新增数据
-const handleShowAdd = () => {
+const handleShowAdd = async() => {
   type.value = '新增'
-  getTableInfo2(minUniqId.value)
-}
-// 获取详细信息
-const getTableInfo2 = async(id) => {
-  try {
-    const response = await getInfo({ UniqId: id })
-    if (response.code === 0) {
-      const { sczl_bh, name, sczl_bzdh, sczl_jsss, sczl_冲定额, sczl_desc, ...rest } = response.data
-      // 直接赋值基础属性
-	  let sczl_rq = new Date();
-	  console.log(sczl_rq);
-	  sczl_rq.setDate(sczl_rq.getDate() - 1); // 今天的前N天的日期,N自定义
-	  sczl_rq = sczl_rq.getFullYear() + '-' + (sczl_rq.getMonth() + 1) + '-' + sczl_rq.getDate();
-	  console.log(sczl_rq);
-      Object.assign(detailData, { sczl_rq, sczl_bh, name, sczl_bzdh, sczl_jsss, sczl_冲定额, sczl_desc })
-      // 生成表格数据
-      detailData.table = Array.from({ length: 6 }, (_, i) => i + 1) // 创建一个长度为6的数组 [1, 2, 3, 4, 5, 6]
-        .map(num => {
-          return {
-            sczl_gdbh: rest[`sczl_gdbh${num}`],
-            sczl_yjGx: rest[`sczl_yjGx${num}`],
-            sczl_gxmc: rest[`sczl_gxmc${num}`],
-            Gd_cpmc: rest[`Gd_cpmc${num}`],
-            sczl_cl: rest[`sczl_cl${num}`],
-            sczl_返工产量: rest[`sczl_返工产量${num}`],
-            sczl_PgCl: rest[`sczl_PgCl${num}`],
-            sczl_计产系数: rest[`sczl_计产系数${num}`],
-            sczl_Jtbh1: rest[`sczl_Jtbh${num}`],
-            sczl_dedh: rest[`sczl_dedh${num}`],
-          }
-        })
-        // .filter(item => item.sczl_gdbh !== '') // 过滤掉空的工单编号
-      detailData.UniqId = id
-      dialogFormVisible.value = true
-    }
-  } catch (e) {
-    console.log(e)
-  }
+  await getTableInfo(currentRow.value?.UniqId)
+  // 默认日期为前一天的日期
+  const date = dayjs().subtract(1, 'day').format('YYYY-MM-DD')
+  detailData.sczl_rq = date
 }
 const addDetailData = async() => {
   const restoredData = {
@@ -728,8 +715,8 @@ const addDetailData = async() => {
       message: '新增成功',
     })
     dialogFormVisible.value = false
-	getTableData()
-	getSideData()
+    getTableData()
+    getSideData()
   }
 }
 
@@ -738,6 +725,8 @@ const handleGetYg = async() => {
     const res = await getYg({ sczl_bh: detailData.sczl_bh })
     if (res.code === 0) {
       detailData.name = res.data.ygxm
+    } else {
+      detailData.name = ''
     }
   } catch (e) {
     console.log(e)
@@ -773,37 +762,84 @@ const enterDialog = () => {
     addDetailData()
   }
 }
-//定额代号回车事件
-const getDedhsubmit = () => {
-
-	 GetDedh()
-}
-//获取定额代号
-const GetDedh = async (value) => {
-  const response = await getDedh();
+// 定额代号回车事件
+const getDedhsubmit = () => {}
+
+let formElements
+const moveFocus = (event) => {
+  const index = Array.from(formElements).indexOf(event.target)
+  const key = event.key
+  event.preventDefault()
+  switch (index) {
+    case 0:
+      if (key === 'ArrowDown') {
+        formElements[1].focus()
+      } else if (key === 'ArrowUp') {
+        formElements[formElements.length - 1].focus()
+      } else if (key === 'Enter') {
+        formElements[1].focus()
+      }
+      break
 
-  if(response.code==0){
-	  
- }
+    case 1:
+      if (key === 'ArrowDown') {
+        formElements[3].focus()
+        handleGetYg()
+      } else if (key === 'ArrowUp') {
+        formElements[0].focus()
+        handleGetYg()
+      } else if (key === 'Enter') {
+        formElements[3].focus()
+        handleGetYg()
+      }
+      break
 
-}
-// 导出excel
-function handleExportExcel() {
-  console.log('导出到excel')
-}
+    case 3:
+      if (key === 'ArrowDown') {
+        formElements[4].focus()
+      } else if (key === 'ArrowUp') {
+        formElements[1].focus()
+      } else if (key === 'Enter') {
+        formElements[4].focus()
+      }
+      break
 
-// 生命周期钩子
+    case formElements.length - 1 :
+      if (key === 'ArrowDown') {
+        formElements[0].focus()
+      } else if (key === 'ArrowUp') {
+        formElements[index - 1].focus()
+      } else if (key === 'Enter') {
+        formElements[0].focus()
+      }
+      break
 
+    default:
+      if (key === 'ArrowDown') {
+        formElements[index + 1].focus()
+      } else if (key === 'ArrowUp') {
+        formElements[index - 1].focus()
+      } else if (key === 'Enter') {
+        formElements[index + 1].focus()
+      }
+      break
+  }
+}
 </script>
 
 <style scoped>
+:deep(.plan-usage-low div) {
+  color: red !important;
+}
+
 .JKWTree-container {
   display: flex;
 }
 
 .JKWTree-tree {
-  width: 300px;
+  width: 100%;
   background-color: #fff;
+  /*background-color: rgba(241, 224, 224, 0.99);*/
   padding: 10px;
   margin-right: 20px;
 }
@@ -818,12 +854,49 @@ function handleExportExcel() {
   flex: 1;
 }
 
+:deep(.el-table__body .warning-row) {
+  background: #FFFF80 !important;
+}
+
 /* 选中某行时的背景色 */
 :deep(.el-table__body tr.current-row) > td {
   background: #ff80ff !important;
 }
 
+:deep(.el-table .bg-yellow) {
+  background: yellow;
+}
+
+</style>
+<style scoped>
 :deep(.el-table td .cell) {
-  line-height: 30px !important;
+  line-height: 25px !important;
+}
+
+:deep(.el-tabs__header) {
+  margin-bottom: 0;
+}
+
+.search {
+  margin-left: 0px !important;
+  margin-right: 10px !important;
+}
+
+.bt {
+  margin-left: 2px !important;
+  padding: 3px !important;
+  font-size: 12px;
+}
+
+.el-tabs__header {
+  margin: 0px !important;
+}
+
+.gva-table-box {
+  padding: 0px !important;
+}
+
+.mab {
+  margin-bottom: 5px;
 }
 </style>

+ 420 - 286
src/view/performance/07-otherDocuments/index.vue

@@ -1,105 +1,45 @@
 <template>
   <div>
-    <el-container>
-      <!-- 左侧树形结构 -->
-      <el-scrollbar max-height="75vh">
-        <el-aside>
-          <div class="JKWTree-tree">
-            <h3>其他计件单据维护</h3>
-            <el-tree
-              :data="treeData"
-              highlight-current
-              @node-click="handleNodeClick"
+    <layout>
+      <layout-header>
+        <!-- 按钮 -->
+        <el-form inline>
+          <el-form-item>
+            <el-input
+              v-model="searchInfo"
+              placeholder="搜索产品编号或产品名称"
+              clearable
+              style="width: 180px;"
+            />
+            <el-button
+              type="primary"
+              icon="Search"
+              class="search"
+              @click="handleSearch"
             />
-          </div>
-        </el-aside>
-      </el-scrollbar>
-
-      <el-container>
-        <el-main>
-          <!-- 按钮区域 -->
-          <div class="gva-table-box">
-            <div class="gva-btn-list">
-              <el-row :span="6">
-                <el-input
-                  v-model="searchInfo"
-                  placeholder="输入工单编号"
-                  style="width: 200px"
-                />
-              </el-row>
-              <el-button
-                type="primary"
-                :icon="Search"
-                @click="onSearch"
-              >定位</el-button>
-
-              <el-button
-                type="primary"
-                :icon="Search"
-                @click="handleShowDetail"
-              >查改</el-button>
-
-              <el-button
-                type="primary"
-                :icon="Search"
-                @click="handleShowAdd"
-              >新增</el-button>
-
-              <div style="margin-left: auto;">
-                <el-button
-                  type="primary"
-                  :icon="Download"
-                  @click="exportExcel"
-                >导出到Excel</el-button>
-              </div>
-            </div>
-            <!-- 数据展示 -->
-            <el-table
-              ref="multipleTable"
-              style="width: 100%"
-              tooltip-effect="dark"
-              :data="tableData"
-              row-key="ID"
-              highlight-current-row
-              border
-              show-overflow-tooltip="true"
-              :row-style="{ height: '20px' }"
-              :cell-style="{ padding: '0px' }"
-              :header-row-style="{ height: '20px' }"
-              :header-cell-style="{ padding: '0px' }"
-              @selection-change="handleSelectionChange"
-              @row-click="currentRow = $event"
-              @row-dblclick="handleShowDetail"
-            >
-              <el-table-column
-                type="selection"
-                width="55"
-              />
-
-              <!-- 循环渲染列 -->
-              <el-table-column
-                v-for=" column in tableColumns "
-                :key="column.prop"
-                :prop="column.prop"
-                :label="column.label"
-                :width="column.width"
-              />
 
-            </el-table>
-            <!-- 分页 -->
-            <div class="gva-pagination">
-              <el-pagination
-                v-model:current-page="page"
-                v-model:page-size="limit"
-                layout="total, sizes, prev, pager, next, jumper"
-                :page-sizes="[10, 30, 50, 100]"
-                :total="total"
-                @current-change="handleCurrentChange"
-                @size-change="handleSizeChange"
-              />
-            </div>
-          </div>
-          <!-- 弹出框 -->
+            <el-button
+              type="primary"
+              icon="edit"
+              class="bt"
+              @click="handleShowDetail"
+            ><i class="el-icon-edit" />查改
+            </el-button>
+
+            <el-button
+              type="primary"
+              icon="edit"
+              class="bt"
+              @click="handleShowAdd"
+            >新增
+            </el-button>
+
+          </el-form-item>
+        </el-form>
+
+        <!-- 弹出框 -->
+        <div>
+          <!-- 详情页 -->
           <el-dialog
             v-model="dialogFormVisible"
             :before-close="closeDialog"
@@ -109,11 +49,12 @@
           >
             <!-- <el-scrollbar height="500px"> -->
             <el-form
+              id="detail-form"
               ref="elFormRef"
               :model="detailData"
-              :rules="rule"
               label-position="left"
               inline
+              @keyup="moveFocus"
             >
               <el-form-item
                 label="员工编号"
@@ -135,19 +76,29 @@
               <el-form-item
                 label="工序类别"
               >
-                <!-- <el-input
+                <el-select
                   v-model="detailData.sczl_Type"
                   style="width: 150px"
-                /> -->
-				<el-select v-model="detailData.sczl_Type" placeholder="" style="width: 180px"
-				           
-				>
-				  <el-option label="拆片" value="拆片"></el-option>
-				  <el-option label="包装" value="包装"></el-option>
-				  <el-option label="打包" value="打包"></el-option>
-				  <el-option label="拉料" value="拉料"></el-option>
-				  <
-				</el-select>
+                >
+                  <el-option
+                    label="拆片"
+                    value="拆片"
+                  />
+                  <el-option
+                    label="包装"
+                    value="包装"
+                  />
+                  <el-option
+                    label="打包"
+                    value="打包"
+                  />
+                  <el-option
+                    label="拉料"
+                    value="拉料"
+                  />
+
+                </el-select>
+
               </el-form-item>
 
               <el-form-item
@@ -177,39 +128,57 @@
               <el-form-item
                 label="工艺流程"
               >
-               <!-- <el-input
-                  v-model="detailData.image"
+                <el-input
+                  v-model="detailData.Sczl_gxmc"
                   style="width: 300px"
-                /> -->
-				<el-select v-model="detailData.image" placeholder="" style="width: 180px"
-				           
-				>
-				  <el-option label="01-01-光边" value="01-01-光边"></el-option>
-				  <el-option label="01-02-胶印" value="01-02-胶印"></el-option>
-				  <el-option label="01-04-圆+五角星" value="01-04-圆+五角星"></el-option>
-				  <el-option label="01-05-磨砂" value="01-05-磨砂"></el-option>
-				  <el-option label="01-06-凹切" value="01-06-凹切"></el-option>
-				  <el-option label="01-30-拆片" value="01-30-拆片"></el-option>
-				  <el-option label="01-31-未机检前" value="01-31-未机检前"></el-option>
-				  <el-option label="01-35-机检(初检)" value="01-35-机检(初检)"></el-option>
-				  <el-option label="01-36-首次机检后" value="01-36-首次机检后"></el-option>
-				  <el-option label="01-37-次品检" value="01-37-次品检"></el-option>
-				  <el-option label="01-41-二次机检" value="01-41-二次机检"></el-option>
-				  <el-option label="01-45-二次机检后" value="01-45-二次机检后"></el-option>
-				  <el-option label="01-51-废挑正" value="01-51-废挑正"></el-option>
-				  <el-option label="01-61-抽检" value="01-61-抽检"></el-option>
-				  <el-option label="01-65-核检" value="01-65-核检"></el-option>
-				  <el-option label="01-71-包装" value="01-71-包装"></el-option>
-				</el-select>
+                  @keyup.enter="handleGylcEnter"
+                />
                 <el-input
-                  v-model="detailData.image"
+                  v-model="detailData.sczl_gxh"
                   style="width: 100px; margin-left: 5px"
+                  readonly
+                />
+              </el-form-item>
+              <br>
+
+              <el-form-item
+                v-if="type === '新增'"
+                label=""
+                style="margin-left: 67px;"
+              >
+                <el-input
+                  v-model="leftData"
+                  style="width: 100px"
+                />
+              </el-form-item>
+
+              <el-form-item
+                v-if="type === '新增'"
+                label="X"
+              >
+                <el-input
+                  v-model="rightData"
+                  style="width: 100px;margin-left: 12px;"
+                  @keyup.enter="()=>{detailData.Sczl_cl = (leftData * rightData).toString()}"
+                  @keyup.down="()=>{detailData.Sczl_cl = (leftData * rightData).toString()}"
+                />
+              </el-form-item>
+
+              <el-form-item
+                v-if="type === '新增'"
+                label="计件产量"
+                style="margin-left: 30px;"
+              >
+                <el-input
+                  v-model="detailData.Sczl_cl"
+                  style="width: 100px"
                 />
               </el-form-item>
 
               <el-form-item
+                v-if="type === '查改'"
                 label="计件产量"
-                style="margin-left: 300px"
+                style="margin-left: 400px;"
               >
                 <el-input
                   v-model="detailData.Sczl_cl"
@@ -254,29 +223,128 @@
             </template>
           </el-dialog>
 
-        </el-main>
-      </el-container>
-    </el-container>
+          <!-- 工价代号弹窗 -->
+          <el-dialog
+            v-model="dialogDedh"
+            :before-close="()=>{dialogDedh = false}"
+            title="工价代号"
+            destroy-on-close
+          >
+
+            <el-scrollbar
+              style="height: 50vh;width: 50vw;"
+            >
+              <el-tree
+                :data="dedhTreeData"
+                highlight-current
+                style="width: 90%;"
+                @node-click="handleSelectDjdh"
+              />
+            </el-scrollbar>
+          </el-dialog>
+
+          <!-- 工艺流程弹窗 -->
+          <el-dialog
+            v-model="dialogGylc"
+            :before-close="()=>{dialogGylc = false}"
+            title="工艺流程"
+            destroy-on-close
+          >
+
+            <el-scrollbar
+              style="height: 50vh;width: 50vw;"
+            >
+              <el-tree
+                :data="gylcTreeData"
+                highlight-current
+                style="width: 90%;"
+                @node-click="handleSelectGylc"
+              />
+            </el-scrollbar>
+          </el-dialog>
+
+        </div>
+
+      </layout-header>
+
+      <layout>
+        <!--    左侧树侧形结构-->
+        <layout-sider
+          :resize-directions="['right']"
+          :width="220"
+          style="margin-right: 10px;"
+        >
+          <div
+            class="JKWTree-tree"
+            style="height: 70vh;"
+          >
+            <h3>其他计件单据维护</h3>
+            <el-tree
+              :data="treeData"
+              highlight-current
+              @node-click="handleNodeClick"
+            />
+          </div>
+        </layout-sider>
+
+        <layout-content>
+          <!-- 数据展示 -->
+          <el-table
+            ref="table"
+            style="width: 100%"
+            tooltip-effect="dark"
+            :data="tableData"
+            row-key="ID"
+            highlight-current-row
+            border
+            show-overflow-tooltip="true"
+            :row-style="{ height: '20px' }"
+            :cell-style="{ padding: '0px' }"
+            :header-row-style="{ height: '20px' }"
+            :header-cell-style="{ padding: '0px' }"
+            @selection-change="handleSelectionChange"
+            @row-dblclick="handleShowDetail"
+            @current-change="(row, oldRow) => { currentRow = row}"
+          >
+            <el-table-column
+              type="selection"
+              width="55"
+            />
+
+            <!-- 循环渲染列 -->
+            <el-table-column
+              v-for=" column in tableColumns "
+              :key="column.prop"
+              :prop="column.prop"
+              :label="column.label"
+              :width="column.width"
+            />
+
+          </el-table>
+          <!-- 分页 -->
+          <div class="gva-pagination">
+            <el-pagination
+              v-model:current-page="page"
+              v-model:page-size="limit"
+              layout="total, sizes, prev, pager, next, jumper"
+              :page-sizes="[10, 30, 50, 100]"
+              :total="total"
+              @current-change="handleCurrentChange"
+              @size-change="handleSizeChange"
+            />
+          </div>
+        </layout-content>
+      </layout>
+    </layout>
 
   </div>
 </template>
 
 <script setup>
-import {
-  createCompany,
-  deleteCompany,
-  deleteCompanyByIds,
-  updateCompany,
-  findCompany,
-  getCompanyList
-} from '@/api/company'
-
-// 全量引入格式化工具 请按需保留
-import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
-import { ElMessage, ElMessageBox } from 'element-plus'
-import { Search, Refresh, Download } from '@element-plus/icons-vue'
-import { ref, reactive, onMounted, onBeforeMount } from 'vue'
-import { getSide, getTable, getInfo, getOtherInfo, updateData,add,getYg } from '@/api/mes_api_gty/otherDocuments'
+import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
+import { ElMessage, dayjs } from 'element-plus'
+import { ref, reactive } from 'vue'
+import { getSide, getTable, getYg, getGdmc, getDedh, getGxMc, updateData, add } from '@/api/mes_api_gty/otherDocuments'
 
 defineOptions({
   name: '07OtherDocuments'
@@ -303,7 +371,6 @@ const getSideData = async() => {
 getSideData()
 
 const elFormRef = ref()
-const elSearchFormRef = ref()
 
 // ============== 表格页面 ==============
 const tableColumns = [
@@ -315,7 +382,7 @@ const tableColumns = [
   { prop: 'Gd_cpmc', label: '产品名称', width: '300' },
   { prop: 'Sczl_cl', label: '产量', width: '100' },
   { prop: '', label: '千件工价', width: '100' }, // prop 属性值需要补充
-  { prop: '', label: '工价备注', width: '200' }, // prop 属性值需要补充
+  { prop: 'sys_mc', label: '工价备注', width: '200' }, // prop 属性值需要补充
   { prop: 'Sczl_desc', label: '备注', width: '100' },
   { prop: 'Sczl_gxmc', label: '工序名称', width: '100' },
   { prop: 'sczl_yjno', label: '印件号', width: '100' },
@@ -326,7 +393,7 @@ const tableColumns = [
   { prop: 'UniqId', label: 'UNIQID', width: '100' }
 ]
 const tableData = reactive([])
-const currentRow = ref({})
+const currentRow = ref()
 const type = ref('')
 
 const page = ref(1)
@@ -340,26 +407,21 @@ const params = {
   page: page.value.toString(),
   limit: limit.value.toString(),
 }
-const minUniqId = ref('')
+
+const table = ref()
+const setCurrent = (row) => {
+  table.value?.setCurrentRow(row)
+}
+
 // 获取表格数据
 const getTableData = async() => {
-  try {
-    const response = await getTable(params)
-    if (response.code === 0) {
-           total.value = response.data.total;
-           // 清空原有数据并填充新数据
-           tableData.splice(0, tableData.length, ...response.data.rows);
-     
-           // 获取最大的 UniqId
-          minUniqId.value= Math.min(...tableData.map(row => row.UniqId));
-           console.log('最小的 UniqId:', minUniqId.value);
-         } else {
-           console.error('获取数据失败:', response.msg);
-         }
-    	
-    } catch (e) {
-      console.log(e)
-    }
+  // try {
+  const response = await getTable(params)
+  if (response.code === 0) {
+    total.value = response.data.total
+    tableData.splice(0, tableData.length, ...response.data.rows)
+    setCurrent(tableData[0])
+  }
 }
 
 // 分页设置
@@ -386,7 +448,7 @@ const handleNodeClick = (node, check) => {
 }
 
 // 搜索
-function onSearch() {
+function handleSearch() {
   params.order = searchInfo.value
   params.date = ''
   params.Sczl_bh1 = ''
@@ -396,57 +458,121 @@ function onSearch() {
 
 // ============== 详情页面 ==============
 const detailData = reactive({})
+const leftData = ref(0)
+const rightData = ref(0)
+const dedhTreeData = ref()
+const gylcTreeData = ref()
 
 // 弹窗控制标记
 const dialogFormVisible = ref(false)
+const dialogDedh = ref(false)
+const dialogGylc = ref(false)
 // 新增数据
 const handleShowAdd = () => {
-    type.value = '新增'
-	Object.assign(detailData, currentRow.value)
-	dialogFormVisible.value = true
+  if (!currentRow.value) {
+    ElMessage({
+      type: 'info',
+      message: '请选择一条数据'
+    })
+    return
+  }
+  type.value = '新增'
+  Object.assign(detailData, currentRow.value)
+  // dialogFormVisible.value = true
+  const date = dayjs().format('YYYY-MM-DD')
+  detailData.Sczl_rq = date
+  showDialog()
 }
 // 查改
 const handleShowDetail = () => {
   type.value = '查改'
   Object.assign(detailData, currentRow.value)
-  console.log(detailData)
-  console.log(currentRow.value)
-  dialogFormVisible.value = true
+  // dialogFormVisible.value = true
+  showDialog()
 }
 const handleYgbhEnter = async() => {
   const res = await getYg({ sczl_bh: detailData.Sczl_bh1 })
-  console.log(detailData.Sczl_bh1)
   if (res.code === 0) {
     detailData.name = res.data.ygxm
   }
 }
 
 const handleGdbhEnter = async() => {
-  const res = await getOtherInfo({ Sczl_gdbh: detailData.sczl_gdbh })
+  const res = await getGdmc({ gdbh: detailData.sczl_gdbh })
   if (res.code === 0) {
-    detailData.Gd_cpmc = res.data.name
+    detailData.Gd_cpmc = res.data.Gd_cpmc
   }
 }
 
+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
+    dialogGylc.value = true
+  }
+}
+
+const handleSelectGylc = (node, check) => {
+  detailData.Sczl_gxmc = node['jyGx']
+  detailData.sczl_gxh = node['Gy0_gxh']
+  dialogGylc.value = false
+}
+
 const handleGjdhEnter = async() => {
-  const res = await getOtherInfo({ Sczl_dedh: detailData.Sczl_dedh })
+  const res = await getDedh({ sczl_jtbh: '' })
   if (res.code === 0) {
-    detailData.aaaa = res.data.name
+    const { data } = res
+
+    const transformData = (data) => {
+      if (Array.isArray(data)) {
+        return data.map((item) => transformData(item))
+      } else if (typeof data === 'object') {
+        const { Key_, sys_bh, sys_mc, bh_mc } = data
+        const label = `${sys_bh}【${sys_mc}】`
+        const node = { Key_, sys_bh, sys_mc, label }
+
+        if (bh_mc) {
+          node.children = transformData(bh_mc)
+        }
+
+        return node
+      } else {
+        return data
+      }
+    }
+
+    const temp = []
+    temp[0] = transformData(data)
+    dedhTreeData.value = temp
+    console.log(temp)
+    dialogDedh.value = true
+  }
+}
+
+const handleSelectDjdh = (node, check) => {
+  if (!node['children']) {
+    console.log(node)
+    const { sys_bh, sys_mc } = node
+    detailData.sys_bh = sys_bh
+    detailData.sys_mc = sys_mc
+    dialogDedh.value = false
   }
 }
 
 // 弹窗确定
 const enterDialog = async() => {
-	
-	if (type.value === '查改') {
-	  updateDetailData()
-	} else if (type.value === '新增') {
-	  addDetailData()
-	}
-}
-//新增
+  if (type.value === '查改') {
+    updateDetailData()
+  } else if (type.value === '新增') {
+    addDetailData()
+  }
+}
+// 新增
 const addDetailData = async() => {
-	
   const restoredData = {
     Sys_id: '[1009/李美芬]',
     Sczl_bh1: detailData.Sczl_bh1,
@@ -456,9 +582,9 @@ const addDetailData = async() => {
     Sczl_gdbh: detailData.sczl_gdbh,
     Sczl_gxmc: detailData.Sczl_gxmc,
     sczl_gxh: detailData.sczl_gxh,
-	Sczl_cl: detailData.Sczl_cl,
-	Sczl_dedh: detailData.sys_bh,
-	Sczl_desc: detailData.Sczl_desc,
+    Sczl_cl: detailData.Sczl_cl,
+    Sczl_dedh: detailData.sys_bh,
+    Sczl_desc: detailData.Sczl_desc,
   }
   console.log(restoredData)
   const res = await add(restoredData)
@@ -471,112 +597,87 @@ const addDetailData = async() => {
     })
     dialogFormVisible.value = false
   }
+  getSideData()
 }
-//修改
+// 修改
 const updateDetailData = async() => {
-	const params = {
-	  UniqId: detailData.UniqId,
-	  Sczl_bh1: detailData.Sczl_bh1,
-	  sczl_Type: detailData.sczl_Type,
-	  Sczl_rq: detailData.Sczl_rq,
-	  Sczl_gdbh: detailData.sczl_gdbh,
-	  Sczl_gxmc: '',
-	  sczl_gxh: detailData.sczl_gxh,
-	  Sczl_cl: detailData.Sczl_cl,
-	  Sczl_dedh: '',
-	  Sczl_desc: detailData.Sczl_desc,
-	}
-	const res = await updateData(params)
-	if (res.code === 0) {
-	  ElMessage({
-	    type: 'success',
-	    message: '更新成功',
-	  })
-	  dialogFormVisible.value = false
-	  params.order = ''
-	  // page.value = 1
-	  handleCurrentChange()
-	}
-}
-// 获取需要的字典 可能为空 按需保留
-const setOptions = async() => {
-}
-
-// 获取需要的字典 可能为空 按需保留
-setOptions()
-
-// 多选数据
-const multipleSelection = ref([])
-// 多选
-const handleSelectionChange = (val) => {
-  multipleSelection.value = val
-}
-
-// 批量删除控制标记
-const deleteVisible = ref(false)
-
-// 多选删除
-const onDelete = async() => {
-  const ids = []
-  if (multipleSelection.value.length === 0) {
-    ElMessage({
-      type: 'warning',
-      message: '请选择要删除的数据'
-    })
-    return
+  const params = {
+    UniqId: detailData.UniqId,
+    Sczl_bh1: detailData.Sczl_bh1,
+    sczl_Type: detailData.sczl_Type,
+    Sczl_rq: detailData.Sczl_rq,
+    Sczl_gdbh: detailData.sczl_gdbh,
+    Sczl_gxmc: detailData.Sczl_gxmc,
+    sczl_gxh: detailData.sczl_gxh,
+    Sczl_cl: detailData.Sczl_cl,
+    Sczl_dedh: '',
+    Sczl_desc: detailData.Sczl_desc,
   }
-  multipleSelection.value &&
-    multipleSelection.value.map(item => {
-      ids.push(item.ID)
-    })
-  const res = await deleteCompanyByIds({ ids })
+  const res = await updateData(params)
   if (res.code === 0) {
     ElMessage({
       type: 'success',
-      message: '删除成功'
+      message: '更新成功',
     })
-    if (tableData.value.length === ids.length && page.value > 1) {
-      page.value--
-    }
-    deleteVisible.value = false
-    getTableData()
-  }
-}
-
-// 更新行
-const updateCompanyFunc = async(row) => {
-  const res = await findCompany({ ID: row.ID })
-  type.value = 'update'
-  if (res.code === 0) {
-    detailData.value = res.data.recompany
-    dialogFormVisible.value = true
+    dialogFormVisible.value = false
+    params.order = ''
+    // page.value = 1
+    handleCurrentChange()
   }
 }
 
-// 打开弹窗
-const openDialog = () => {
-  type.value = 'create'
+// 开启弹窗
+const showDialog = () => {
   dialogFormVisible.value = true
+  // 在 setTimeout 中获取元素,确保在 DOM 渲染完毕后执行
+  setTimeout(() => {
+    formElements = document.getElementById('detail-form').elements
+    formElements[0].focus()
+  }, 0)
 }
 
 // 关闭弹窗
 const closeDialog = () => {
   dialogFormVisible.value = false
-  detailData.value = {
-    address: '',
-    image: '',
-    name: '',
-  }
 }
 
-// 导出excel
-function exportExcel() {
-  console.log('导出到excel')
+let formElements
+const moveFocus = (event) => {
+  const index = Array.from(formElements).indexOf(event.target)
+  const key = event.key
+  event.preventDefault()
+  switch (index) {
+    case 0:
+      if (key === 'ArrowDown') {
+        formElements[1].focus()
+      } else if (key === 'ArrowUp') {
+        formElements[formElements.length - 1].focus()
+      } else if (key === 'Enter') {
+        formElements[1].focus()
+      }
+      break
+
+    case formElements.length - 1 :
+      if (key === 'ArrowDown') {
+        formElements[0].focus()
+      } else if (key === 'ArrowUp') {
+        formElements[index - 1].focus()
+      } else if (key === 'Enter') {
+        formElements[0].focus()
+      }
+      break
+
+    default:
+      if (key === 'ArrowDown') {
+        formElements[index + 1].focus()
+      } else if (key === 'ArrowUp') {
+        formElements[index - 1].focus()
+      } else if (key === 'Enter') {
+        formElements[index + 1].focus()
+      }
+      break
+  }
 }
-
-// 生命周期钩子
-onMounted(() => {
-})
 </script>
 
 <style scoped>
@@ -585,7 +686,7 @@ onMounted(() => {
 }
 
 .JKWTree-tree {
-  width: 300px;
+  width: 100%;
   background-color: #fff;
   padding: 10px;
   margin-right: 20px;
@@ -606,3 +707,36 @@ onMounted(() => {
   background: #ff80ff !important;
 }
 </style>
+
+<style scoped>
+:deep(.el-table td .cell) {
+  line-height: 25px !important;
+}
+
+:deep(.el-tabs__header) {
+  margin-bottom: 0;
+}
+
+.search {
+  margin-left: 0px !important;
+  margin-right: 10px !important;
+}
+
+.bt {
+  margin-left: 2px !important;
+  padding: 3px !important;
+  font-size: 12px;
+}
+
+.el-tabs__header {
+  margin: 0px !important;
+}
+
+.gva-table-box {
+  padding: 0px !important;
+}
+
+.mab {
+  margin-bottom: 5px;
+}
+</style>

+ 377 - 303
src/view/performance/08-timesheet/index.vue

@@ -1,114 +1,59 @@
 <template>
   <div>
-    <el-container>
-
-      <!-- 左侧树形结构 -->
-      <el-scrollbar max-height="75vh">
-        <el-aside>
-          <div class="JKWTree-tree">
-            <h3>计件工计时单维护</h3>
-            <el-tree
-              :data="treeData"
-              :props="defaultProps"
-              highlight-current="true"
-              @node-click="handleNodeClick"
+    <layout>
+      <layout-header>
+        <!-- 按钮 -->
+        <el-form inline>
+          <el-form-item>
+            <el-input
+              v-model="searchInfo"
+              placeholder="搜索产品编号或产品名称"
+              clearable
+              style="width: 180px;"
             />
-          </div>
-        </el-aside>
-      </el-scrollbar>
-
-      <el-container>
-        <el-main>
-          <!-- 按钮区域 -->
-          <div class="gva-table-box">
-            <div class="gva-btn-list">
-              <el-row :span="6">
-                <el-input
-                  v-model="searchInfo"
-                  placeholder="输入员工编号"
-                />
-              </el-row>
-              <el-button
-                type="primary"
-                :icon="Search"
-                @click="onSearch"
-              >搜索</el-button>
-			  <el-button
-			    type="primary"
-			    :icon="Search"
-			    @click="handleShowAdd"
-			  >新增</el-button>
-              <el-button
-                type="primary"
-                :icon="Refresh"
-              >重置</el-button>
-              <div style="margin-left: auto;">
-                <el-button
-                  type="primary"
-                  :icon="Download"
-                  @click="exportExcel"
-                >导出到Excel</el-button>
-              </div>
-            </div>
-            <!-- 数据展示 -->
-            <el-table
-              ref="multipleTable"
-              style="width: 100%"
-              tooltip-effect="dark"
-              :data="tableData"
-              row-key="ID"
-              highlight-current-row
-              border
-              show-overflow-tooltip="true"
-              :row-style="{ height: '20px' }"
-              :cell-style="{ padding: '0px' }"
-              :header-row-style="{ height: '20px' }"
-              :header-cell-style="{ padding: '0px' }"
-              @selection-change="handleSelectionChange"
-              @row-dblclick="doubleClick"
-			  @row-click="Click"
-            >
-              <el-table-column
-                type="selection"
-                width="55"
-              />
-              <!-- 循环渲染列 -->
-              <el-table-column
-                v-for=" column in tableColumns "
-                :key="column.prop"
-                :prop="column.prop"
-                :label="column.label"
-                :width="column.width"
-              />
-
-            </el-table>
-            <!-- 分页 -->
-            <div class="gva-pagination">
-              <el-pagination
-                v-model:current-page="page"
-                v-model:page-size="limit"
-                layout="total, sizes, prev, pager, next, jumper"
-                :page-sizes="[10, 30, 50, 100]"
-                :total="total"
-                @current-change="handleCurrentChange"
-                @size-change="handleSizeChange"
-              />
-            </div>
-          </div>
+            <el-button
+              type="primary"
+              icon="Search"
+              class="search"
+              @click="handleSearch"
+            />
+
+            <el-button
+              type="primary"
+              icon="edit"
+              class="bt"
+              @click="handleShowDetail"
+            ><i class="el-icon-edit" />查改
+            </el-button>
+
+            <el-button
+              type="primary"
+              icon="edit"
+              class="bt"
+              @click="handleShowAdd"
+            >新增
+            </el-button>
+
+          </el-form-item>
+        </el-form>
+
+        <!-- 弹出框 -->
+        <div>
           <!-- 弹出框 -->
           <el-dialog
             v-model="dialogFormVisible"
             :before-close="closeDialog"
-            title="计件工计时单维护"
+            :title="type === 'add' ? '新增' : '修改'"
             destroy-on-close
             width="800px"
           >
             <!-- <el-scrollbar height="500px"> -->
             <el-form
+              id="detail-form"
               ref="elFormRef"
               :model="detailData"
               label-position="left"
-              :rules="rule"
+              @keyup="moveFocus"
             >
 
               <!-- 日期 -->
@@ -119,7 +64,6 @@
                 >
                   <el-input
                     v-model="detailData.wgjs_rq"
-                    :clearable="true"
                     style="width: 100px;"
                   />
                 </el-form-item>
@@ -152,32 +96,43 @@
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.wgjs_bh1"
-                    :clearable="true"
+                    :formatter="val => val.toUpperCase()"
                   />
                 </el-col>
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.name1"
-                    :clearable="true"
+                    readonly
                   />
                 </el-col>
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.wgjs_js1"
-                    :clearable="true"
                   />
                 </el-col>
                 <el-col :span="12">
                   <el-input
                     v-model="detailData.wgjs_yy1"
-                    :clearable="true"
                   />
                 </el-col>
                 <el-col :span="3">
-                  <el-input
+                  <!-- <el-input
                     v-model="detailData.wgjs_冲定额1"
-                    :clearable="true"
-                  />
+
+                  /> -->
+                  <el-select
+                    v-model="detailData.wgjs_冲定额1"
+                    placeholder=" "
+                  >
+                    <el-option
+                      label=""
+                      value=""
+                    />
+                    <el-option
+                      label="是"
+                      value="是"
+                    />
+                  </el-select>
                 </el-col>
               </el-row>
 
@@ -189,32 +144,39 @@
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.wgjs_bh2"
-                    :clearable="true"
+                    :formatter="val => val.toUpperCase()"
                   />
                 </el-col>
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.name2"
-                    :clearable="true"
+                    readonly
                   />
                 </el-col>
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.wgjs_js2"
-                    :clearable="true"
                   />
                 </el-col>
                 <el-col :span="12">
                   <el-input
                     v-model="detailData.wgjs_yy2"
-                    :clearable="true"
                   />
                 </el-col>
                 <el-col :span="3">
-                  <el-input
+                  <el-select
                     v-model="detailData.wgjs_冲定额2"
-                    :clearable="true"
-                  />
+                    placeholder=" "
+                  >
+                    <el-option
+                      label=""
+                      value=""
+                    />
+                    <el-option
+                      label="是"
+                      value="是"
+                    />
+                  </el-select>
                 </el-col>
               </el-row>
 
@@ -226,32 +188,39 @@
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.wgjs_bh3"
-                    :clearable="true"
+                    :formatter="val => val.toUpperCase()"
                   />
                 </el-col>
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.name3"
-                    :clearable="true"
+                    readonly
                   />
                 </el-col>
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.wgjs_js3"
-                    :clearable="true"
                   />
                 </el-col>
                 <el-col :span="12">
                   <el-input
                     v-model="detailData.wgjs_yy3"
-                    :clearable="true"
                   />
                 </el-col>
                 <el-col :span="3">
-                  <el-input
+                  <el-select
                     v-model="detailData.wgjs_冲定额3"
-                    :clearable="true"
-                  />
+                    placeholder=" "
+                  >
+                    <el-option
+                      label=""
+                      value=""
+                    />
+                    <el-option
+                      label="是"
+                      value="是"
+                    />
+                  </el-select>
                 </el-col>
               </el-row>
 
@@ -263,32 +232,39 @@
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.wgjs_bh4"
-                    :clearable="true"
+                    :formatter="val => val.toUpperCase()"
                   />
                 </el-col>
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.name4"
-                    :clearable="true"
+                    readonly
                   />
                 </el-col>
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.wgjs_js4"
-                    :clearable="true"
                   />
                 </el-col>
                 <el-col :span="12">
                   <el-input
                     v-model="detailData.wgjs_yy4"
-                    :clearable="true"
                   />
                 </el-col>
                 <el-col :span="3">
-                  <el-input
+                  <el-select
                     v-model="detailData.wgjs_冲定额4"
-                    :clearable="true"
-                  />
+                    placeholder=" "
+                  >
+                    <el-option
+                      label=""
+                      value=""
+                    />
+                    <el-option
+                      label="是"
+                      value="是"
+                    />
+                  </el-select>
                 </el-col>
               </el-row>
 
@@ -300,32 +276,39 @@
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.wgjs_bh5"
-                    :clearable="true"
+                    :formatter="val => val.toUpperCase()"
                   />
                 </el-col>
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.name5"
-                    :clearable="true"
+                    readonly
                   />
                 </el-col>
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.wgjs_js5"
-                    :clearable="true"
                   />
                 </el-col>
                 <el-col :span="12">
                   <el-input
                     v-model="detailData.wgjs_yy5"
-                    :clearable="true"
                   />
                 </el-col>
                 <el-col :span="3">
-                  <el-input
+                  <el-select
                     v-model="detailData.wgjs_冲定额5"
-                    :clearable="true"
-                  />
+                    placeholder=" "
+                  >
+                    <el-option
+                      label=""
+                      value=""
+                    />
+                    <el-option
+                      label="是"
+                      value="是"
+                    />
+                  </el-select>
                 </el-col>
               </el-row>
 
@@ -337,32 +320,39 @@
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.wgjs_bh6"
-                    :clearable="true"
+                    :formatter="val => val.toUpperCase()"
                   />
                 </el-col>
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.name6"
-                    :clearable="true"
+                    readonly
                   />
                 </el-col>
                 <el-col :span="3">
                   <el-input
                     v-model="detailData.wgjs_js6"
-                    :clearable="true"
                   />
                 </el-col>
                 <el-col :span="12">
                   <el-input
                     v-model="detailData.wgjs_yy6"
-                    :clearable="true"
                   />
                 </el-col>
                 <el-col :span="3">
-                  <el-input
+                  <el-select
                     v-model="detailData.wgjs_冲定额6"
-                    :clearable="true"
-                  />
+                    placeholder=" "
+                  >
+                    <el-option
+                      label=""
+                      value=""
+                    />
+                    <el-option
+                      label="是"
+                      value="是"
+                    />
+                  </el-select>
                 </el-col>
               </el-row>
 
@@ -379,29 +369,91 @@
             </template>
           </el-dialog>
 
-        </el-main>
-      </el-container>
-    </el-container>
+        </div>
+
+      </layout-header>
+
+      <layout>
+        <!--    左侧树侧形结构-->
+        <layout-sider
+          :resize-directions="['right']"
+          :width="220"
+          style="margin-right: 10px;"
+        >
+          <div
+            class="JKWTree-tree"
+            style="height: 70vh;"
+          >
+            <h3>计件工计时单维护</h3>
+            <el-tree
+              :data="treeData"
+              highlight-current="true"
+              @node-click="handleNodeClick"
+            />
+          </div>
+
+        </layout-sider>
+
+        <layout-content>
+          <!-- 数据展示 -->
+          <el-table
+            ref="table"
+            style="width: 100%"
+            tooltip-effect="dark"
+            :data="tableData"
+            row-key="ID"
+            highlight-current-row
+            border
+            show-overflow-tooltip="true"
+            :row-style="{ height: '20px' }"
+            :cell-style="{ padding: '0px' }"
+            :header-row-style="{ height: '20px' }"
+            :header-cell-style="{ padding: '0px' }"
+            @selection-change="handleSelectionChange"
+            @row-dblclick="handleShowDetail"
+            @row-click="Click"
+            @current-change="(row, oldRow) => { currentRow = row}"
+          >
+            <el-table-column
+              type="selection"
+              width="55"
+            />
+            <!-- 循环渲染列 -->
+            <el-table-column
+              v-for=" column in tableColumns "
+              :key="column.prop"
+              :prop="column.prop"
+              :label="column.label"
+              :width="column.width"
+            />
+
+          </el-table>
+          <!-- 分页 -->
+          <div class="gva-pagination">
+            <el-pagination
+              v-model:current-page="page"
+              v-model:page-size="limit"
+              layout="total, sizes, prev, pager, next, jumper"
+              :page-sizes="[10, 30, 50, 100]"
+              :total="total"
+              @current-change="handleCurrentChange"
+              @size-change="handleSizeChange"
+            />
+          </div>
+
+        </layout-content>
+      </layout>
+    </layout>
 
   </div>
 </template>
 
 <script setup>
-import {
-  createCompany,
-  deleteCompany,
-  deleteCompanyByIds,
-  updateCompany,
-  findCompany,
-  getCompanyList
-} from '@/api/company'
-
 // 全量引入格式化工具 请按需保留
-import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
-import { ElMessage, ElMessageBox } from 'element-plus'
-import { Search, Refresh, Download } from '@element-plus/icons-vue'
-import { ref, reactive, onMounted, onBeforeMount } from 'vue'
-import { getSide, getTable, getDetail, updateData, getLocate ,createData} from '@/api/mes_api_gty/timesheet'
+import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
+import { ElMessage, dayjs } from 'element-plus'
+import { ref, reactive } from 'vue'
+import { getSide, getTable, getDetail, updateData, getLocate, createData, getYg } from '@/api/mes_api_gty/timesheet'
 
 defineOptions({
   name: '08Timesheet'
@@ -423,12 +475,8 @@ const getSideData = async() => {
 }
 getSideData()
 
-// 验证规则
-const rule = reactive({
-})
-
 const elFormRef = ref()
-const elSearchFormRef = ref()
+// const elSearchFormRef = ref()
 
 // ============== 表格页面 ==============
 const tableColumns = [
@@ -459,6 +507,7 @@ const tableColumns = [
   { prop: 'wgjs_js6', label: '计时6', width: 100 },
   { prop: 'wgjs_yy6', label: '原因6', width: 100 },
 ]
+const table = ref(null)
 const tableData = reactive([])
 const page = ref(1)
 const total = ref(0)
@@ -475,6 +524,7 @@ const getTableData = async(params) => {
   if (response.code === 0) {
     total.value = response.data.total
     tableData.splice(0, tableData.length, ...response.data.rows)
+    table.value?.setCurrentRow(tableData[0])
   }
 }
 
@@ -484,6 +534,7 @@ const getLocateData = async(params) => {
   if (res.code === 0) {
     total.value = res.data.total
     tableData.splice(0, tableData.length, ...res.data.rows)
+    table.value?.setCurrentRow(tableData[0])
   }
 }
 
@@ -529,17 +580,9 @@ const handleNodeClick = (node, check) => {
     handleCurrentChange()
   }
 }
-// 新增数据
-const handleShowAdd = async () => {
-  const res = await getDetail({ wgjs_rq: value1.value, wgjs_bh1: value2.value });
-  if (res.code === 0) {
-	type.value='add'
-    Object.assign(detailData, res.data);
-	dialogFormVisible.value = true
-  }
-};
+
 // 搜索
-function onSearch() {
+function handleSearch() {
   params.search = searchInfo.value
   params.type = 'getLocateData'
   page.value = 1
@@ -548,81 +591,81 @@ function onSearch() {
 
 // ============== 详情页面 ==============
 const detailData = reactive({})
+const currentRow = ref()
 
 // 行为控制标记(弹窗内部需要增还是改)
 const type = ref('')
 // 弹窗控制标记
 const dialogFormVisible = ref(false)
 
-// 双击表格操作
-async function doubleClick(row, column, event) {
+// 查改
+const handleShowDetail = async() => {
   type.value = 'update'
-  const { wgjs_rq, wgjs_bh1 } = row
+  const { wgjs_rq, wgjs_bh1 } = currentRow.value
   const res = await getDetail({ wgjs_rq, wgjs_bh1 })
   if (res.code === 0) {
     Object.assign(detailData, res.data)
-    dialogFormVisible.value = true
+    // dialogFormVisible.value = true
+    showDialog()
   }
 }
-const value1=ref()
-const value2=ref()
-// 单击表格操作
-async function Click(row, column, event) {
-  const { wgjs_rq, wgjs_bh1 } = row
-  value1.value=wgjs_rq
-  value2.value=wgjs_bh1
-  // console.log(wgjs_rq)
-  // console.log(wgjs_bh1)
-  // const res = await getDetail({ wgjs_rq, wgjs_bh1 })
-  // if (res.code === 0) {
-  //   Object.assign(detailData, res.data)
-  //   dialogFormVisible.value = true
-  // }
+
+// 新增数据
+const handleShowAdd = async() => {
+  const { wgjs_rq, wgjs_bh1 } = currentRow.value
+  const res = await getDetail({ wgjs_rq, wgjs_bh1 })
+  if (res.code === 0) {
+    type.value = 'add'
+    Object.assign(detailData, res.data)
+
+    detailData['wgjs_rq'] = dayjs().format('YYYY-MM-DD')
+
+    // dialogFormVisible.value = true
+    showDialog()
+  }
 }
+
 // 更新数据
 const enterDialog = async() => {
-	
-	if (type.value === 'update') {
-	  updateDetailData()
-	} else if (type.value === 'add') {
-	  addDetailData()
-	}
-	
-  
+  if (type.value === 'update') {
+    updateDetailData()
+  } else if (type.value === 'add') {
+    addDetailData()
+  }
 }
-//新增
+// 新增
 const addDetailData = async() => {
   const restoredData = {
     wgjs_rq: detailData.wgjs_rq,
-	wgjs_bh1:detailData.wgjs_bh1,
-	wgjs_js1:detailData.wgjs_js1,
-	wgjs_yy1:detailData.wgjs_yy1,
-	wgjs_冲定额1:detailData.wgjs_冲定额1,
-	
-	wgjs_bh2:detailData.wgjs_bh2,
-	wgjs_js2:detailData.wgjs_js2,
-	wgjs_yy2:detailData.wgjs_yy2,
-	wgjs_冲定额2:detailData.wgjs_冲定额2,
-	
-	wgjs_bh3:detailData.wgjs_bh3,
-	wgjs_js3:detailData.wgjs_js3,
-	wgjs_yy3:detailData.wgjs_yy3,
-	wgjs_冲定额3:detailData.wgjs_冲定额3,
-	
-	wgjs_bh4:detailData.wgjs_bh4,
-	wgjs_js4:detailData.wgjs_js4,
-	wgjs_yy4:detailData.wgjs_yy4,
-	wgjs_冲定额4:detailData.wgjs_冲定额4,
-	
-	wgjs_bh5:detailData.wgjs_bh5,
-	wgjs_js5:detailData.wgjs_js5,
-	wgjs_yy5:detailData.wgjs_yy5,
-	wgjs_冲定额5:detailData.wgjs_冲定额5,
-	
-	wgjs_bh6:detailData.wgjs_bh6,
-	wgjs_js6:detailData.wgjs_js6,
-	wgjs_yy6:detailData.wgjs_yy6,
-	wgjs_冲定额6:detailData.wgjs_冲定额6,
+    wgjs_bh1: detailData.wgjs_bh1,
+    wgjs_js1: detailData.wgjs_js1,
+    wgjs_yy1: detailData.wgjs_yy1,
+    wgjs_冲定额1: detailData.wgjs_冲定额1,
+
+    wgjs_bh2: detailData.wgjs_bh2,
+    wgjs_js2: detailData.wgjs_js2,
+    wgjs_yy2: detailData.wgjs_yy2,
+    wgjs_冲定额2: detailData.wgjs_冲定额2,
+
+    wgjs_bh3: detailData.wgjs_bh3,
+    wgjs_js3: detailData.wgjs_js3,
+    wgjs_yy3: detailData.wgjs_yy3,
+    wgjs_冲定额3: detailData.wgjs_冲定额3,
+
+    wgjs_bh4: detailData.wgjs_bh4,
+    wgjs_js4: detailData.wgjs_js4,
+    wgjs_yy4: detailData.wgjs_yy4,
+    wgjs_冲定额4: detailData.wgjs_冲定额4,
+
+    wgjs_bh5: detailData.wgjs_bh5,
+    wgjs_js5: detailData.wgjs_js5,
+    wgjs_yy5: detailData.wgjs_yy5,
+    wgjs_冲定额5: detailData.wgjs_冲定额5,
+
+    wgjs_bh6: detailData.wgjs_bh6,
+    wgjs_js6: detailData.wgjs_js6,
+    wgjs_yy6: detailData.wgjs_yy6,
+    wgjs_冲定额6: detailData.wgjs_冲定额6,
   }
   console.log(restoredData)
   const res = await createData(restoredData)
@@ -636,84 +679,39 @@ const addDetailData = async() => {
     dialogFormVisible.value = false
   }
 }
-//修改
+// 修改
 const updateDetailData = async() => {
-	const obj = detailData
-	for (let i = 1; i <= 6; i++) {
-	  delete obj[`name${i}`]
-	}
-	const res = await updateData(obj)
-	if (res.code === 0) {
-	  ElMessage({
-	    type: 'success',
-	    message: '更新成功'
-	  })
-	  params.type = 'getTableData'
-	  // page.value = 1
-	  handleCurrentChange()
-	  // if(response.code==0){
-	  // 		 ElMessage({
-	  // 		   type: 'success',
-	  // 		   message: '更新成功',
-	  // 		 })
-	  // }
-	  dialogFormVisible.value = false
-	}
-}
-
-// 获取需要的字典 可能为空 按需保留
-const setOptions = async() => {
-}
-
-// 获取需要的字典 可能为空 按需保留
-setOptions()
-
-// 多选数据
-const multipleSelection = ref([])
-// 多选
-const handleSelectionChange = (val) => {
-  multipleSelection.value = val
-}
-
-// 批量删除控制标记
-const deleteVisible = ref(false)
-
-// 多选删除
-const onDelete = async() => {
-  const ids = []
-  if (multipleSelection.value.length === 0) {
-    ElMessage({
-      type: 'warning',
-      message: '请选择要删除的数据'
-    })
-    return
+  const obj = detailData
+  for (let i = 1; i <= 6; i++) {
+    delete obj[`name${i}`]
   }
-  multipleSelection.value &&
-    multipleSelection.value.map(item => {
-      ids.push(item.ID)
-    })
-  const res = await deleteCompanyByIds({ ids })
+  const res = await updateData(obj)
   if (res.code === 0) {
     ElMessage({
       type: 'success',
-      message: '删除成功'
+      message: '更新成功'
     })
-    if (tableData.value.length === ids.length && page.value > 1) {
-      page.value--
-    }
-    deleteVisible.value = false
-    getTableData()
+    params.type = 'getTableData'
+    // page.value = 1
+    handleCurrentChange()
+    // if(response.code==0){
+    // 		 ElMessage({
+    // 		   type: 'success',
+    // 		   message: '更新成功',
+    // 		 })
+    // }
+    dialogFormVisible.value = false
   }
 }
 
-// 更新行
-const updateCompanyFunc = async(row) => {
-  const res = await findCompany({ ID: row.ID })
-  type.value = 'update'
-  if (res.code === 0) {
-    detailData.value = res.data.recompany
-    dialogFormVisible.value = true
-  }
+// 开启弹窗
+const showDialog = () => {
+  dialogFormVisible.value = true
+  // 在 setTimeout 中获取元素,确保在 DOM 渲染完毕后执行
+  setTimeout(() => {
+    formElements = document.getElementById('detail-form').elements
+    formElements[0].focus()
+  }, 0)
 }
 
 // 关闭弹窗
@@ -721,14 +719,57 @@ const closeDialog = () => {
   dialogFormVisible.value = false
 }
 
-// 导出excel
-function exportExcel() {
-  console.log('导出到excel')
+let formElements
+const moveFocus = async(event) => {
+  console.log(event)
+  const index = Array.from(formElements).indexOf(event.target)
+  const key = event.key
+  event.preventDefault()
+
+  // 切换焦点
+  const focusNext = (step) => {
+    const nextIndex = (index + step + formElements.length) % formElements.length
+    formElements[nextIndex].focus()
+  }
+
+  switch (index) {
+    case 1:
+    case 6:
+    case 11:
+    case 16:
+    case 21:
+    case 26:
+      if (key === 'ArrowDown') {
+        formElements[index + 1].focus()
+      } else if (key === 'ArrowUp') {
+        formElements[index - 1].focus()
+      } else if (key === 'Enter') {
+        formElements[index + 1].focus()
+        const sczl_bh = formElements[index]?.value
+        if (sczl_bh === '') {
+          detailData[`name${(index - 1) / 5 + 1}`] = ''
+          break
+        }
+        const res = await getYg({ sczl_bh })
+        if (res.code === 0) {
+          const { data: { ygxm }} = res
+          detailData[`name${(index - 1) / 5 + 1}`] = ygxm
+        }
+      }
+      break
+
+    default:
+      if (key === 'ArrowDown') {
+        focusNext(1)
+      } else if (key === 'ArrowUp') {
+        focusNext(-1)
+      } else if (key === 'Enter') {
+        focusNext(1)
+      }
+      break
+  }
 }
 
-// 生命周期钩子
-onMounted(() => {
-})
 </script>
 
 <style scoped>
@@ -737,7 +778,7 @@ onMounted(() => {
 }
 
 .JKWTree-tree {
-  width: 300px;
+  width: 100%;
   background-color: #fff;
   padding: 10px;
   margin-right: 20px;
@@ -758,3 +799,36 @@ onMounted(() => {
   background: #ff80ff !important;
 }
 </style>
+
+<style scoped>
+:deep(.el-table td .cell) {
+  line-height: 25px !important;
+}
+
+:deep(.el-tabs__header) {
+  margin-bottom: 0;
+}
+
+.search {
+  margin-left: 0px !important;
+  margin-right: 10px !important;
+}
+
+.bt {
+  margin-left: 2px !important;
+  padding: 3px !important;
+  font-size: 12px;
+}
+
+.el-tabs__header {
+  margin: 0px !important;
+}
+
+.gva-table-box {
+  padding: 0px !important;
+}
+
+.mab {
+  margin-bottom: 5px;
+}
+</style>

+ 87 - 17
src/view/performance/09-workOrderVerification/index.vue

@@ -106,7 +106,7 @@
           <el-dialog
             v-model="dialogFormVisible"
             :before-close="closeDialog"
-            :title="type === 'create' ? '添加' : '修改'"
+            :title="type"
             destroy-on-close
             width="70%"
             style="position: fixed; top: 35%; left: 50%; transform: translate(-50%, -50%);"
@@ -191,6 +191,7 @@
                 <el-input
                   v-model="detailData.qczl_gxmc"
                   style="width: 200px;"
+				  @keyup.enter.native="getgxsubmit"
                 />
               </el-form-item>
               <el-form-item
@@ -301,8 +302,7 @@
                   >
                     <template #default="{ row }">
                       <el-input
-                        v-model="row.fp_gxmc"
-                        readonly
+                        v-model="row.fp_gxmc"                       
                       />
                     </template>
                   </el-table-column>
@@ -323,8 +323,7 @@
                   >
                     <template #default="{ row }">
                       <el-input
-                        v-model="row.fp_bh"
-                        readonly
+                        v-model="row.fp_bh"                       
                       />
                     </template>
                   </el-table-column>
@@ -339,7 +338,6 @@
                       />
                     </template>
                   </el-table-column>
-
                 </el-table>
 
               </el-scrollbar>
@@ -398,6 +396,39 @@
               />
             </el-table>
           </el-dialog>
+		  
+		  <el-dialog
+		    v-model="GetjtbhVisible"
+		    title="选择"
+		    destroy-on-close
+		    width="600px"
+		  			>
+		    <el-table
+		      tooltip-effect="dark"
+		      :data="JTBHselectData"
+		      row-key="ID"
+		      highlight-current-row="true"
+		      border
+		      style="width:100%"
+		      @row-dblclick="JTBHSelectClick"
+		    >
+		      <el-table-column
+		        prop="gxh"
+		        label="工序号"
+		        width="70"
+		      />
+			  <el-table-column
+				prop="gxmc"
+				label="工序名称"
+				width="150"
+			  />
+			  <el-table-column
+				prop="addGxmc"
+				label="工序名称"
+				width="150"
+			  />
+		    </el-table>
+		  </el-dialog>
 
           <!-- 废品日统计 -->
           <Meirihejiantongji
@@ -440,7 +471,7 @@ import {
 import { ElMessage } from 'element-plus'
 import { Search, Refresh, Download } from '@element-plus/icons-vue'
 import { ref, reactive } from 'vue'
-import { getSide, getTable, getOneWorkOrder, getOrderInfo, getGxAndLeader, getWastInfo, updateData, add } from '@/api/mes_api_gty/workOrderVerification'
+import { getSide, getTable, getOneWorkOrder, getOrderInfo, getGxAndLeader, getYjInfo,getWastInfo, updateData, add } from '@/api/mes_api_gty/workOrderVerification'
 import Meirihejiantongji from '@/view/performance/09-workOrderVerification/componets/meirihejiantongji.vue'
 import Gongdanzhijianfeipintongji from '@/view/performance/09-workOrderVerification/componets/gongdanzhijianfeipintongji.vue'
 import Shebeizhuangtai from '@/view/performance/09-workOrderVerification/componets/shebeizhuangtai.vue'
@@ -506,11 +537,11 @@ const tableColumns = [
   { label: '创建用户', prop: 'sys_id', width: '200' }
 ]
 const tableData = reactive([])
-
+const GetjtbhVisible = ref(false)
 const total = ref(0)
 const page = ref(1)
 const limit = ref(10)
-
+const JTBHselectData = reactive([])
 const searchInfo = ref('')
 const params = {
   date: '',
@@ -519,17 +550,53 @@ const params = {
   page: page.value.toString(),
   limit: limit.value.toString(),
 }
-
+//获取工序
+const getgxsubmit = () => {
+	 GetJtbh()
+}
+const GetJtbh = async () => {
+  try {
+    const response = await getYjInfo({ order: '2312185', yj_no: '1' });
+    if (response.code === 0) {
+      const data = response.data;
+      if (data) {
+        const tableData = data.gx_data.map(item => ({
+          gxh: item.Gy0_gxh,
+          gxmc: item.Gy0_gxmc+'-'+item.Add_gxmc,
+          // addGxmc: item.Add_gxmc
+        }));
+        console.log(tableData);
+        JTBHselectData.splice(0, JTBHselectData.length, ...tableData);
+        GetjtbhVisible.value = true;
+        // Now you can use the tableData to populate your table
+      } else {
+        console.log('No data found');
+      }
+    } else {
+      console.log('Error: ', response.msg);
+    }
+  } catch (error) {
+    console.error('Error fetching data: ', error);
+  }
+};
+const JTBHSelectClick = (row, column, event) => {
+  const { gxh, gxmc } = row
+  detailData.qczl_gxmc=gxh+'-'+gxmc
+  detailData.qczl_gxh=gxh
+  GetjtbhVisible.value = false
+}
 // 批量删除控制标记
 const deleteVisible = ref(false)
 const multipleSelection = ref([])
-
+const minUniqId = ref('')
 const getTableData = async() => {
   const response = await getTable(params)
   if (response.code === 0) {
     total.value = response.data.total
     // Object.assign(tableData, response.data.rows)
+	 
     tableData.splice(0, tableData.length, ...response.data.rows)
+	minUniqId.value= Math.min(...tableData.map(row => row.UniqId));
   }
 }
 
@@ -568,7 +635,8 @@ const handleCurrentChange = () => {
 const detailData = reactive({})
 const selectData = reactive([])
 const selectColumns = [
-  { label: '', prop: 'sczl_gxmc', width: '600' },
+  { label: '', prop: 'sczl_gxmc', width: '500' },
+  { label: '', prop: 'sczl_jtbh', width: '100' },
   { label: '', prop: 'sczl_bzdh', width: '100' },
   { label: '', prop: 'name', width: '100' },
 ]
@@ -729,7 +797,7 @@ const handleFpslEnter = async(index, row) => {
 
 // 双击表格操作
 function doubleClick(row, column, event) {
-  type.value = 'update'
+  type.value = '查改'
   getDetailData(row.UniqId)
 }
 
@@ -746,9 +814,9 @@ const handleSelectClick = (row, column, event) => {
 
 // 弹窗确定
 const enterDialog = async() => {
-  if (type.value === 'update') {
+  if (type.value === '查改') {
 	  updateDetailData()
-  } else if (type.value === 'add') {
+  } else if (type.value === '新增') {
 	  addDetailData()
   }
 }
@@ -904,8 +972,10 @@ const handleSelectChange = (row, column, event) => {
 
 // 新增数据
 const handleShowAdd = async() => {
-  type.value = 'add'
-  getDetailData(currentRow.value)
+  type.value = '新增'
+  // console.log()
+  getDetailData(minUniqId.value)
+  
   // type.value='add'
   //    Object.assign(detailData);
   // dialogFormVisible.value = true

+ 52 - 52
src/view/performance/12-orderAccounting/index.vue

@@ -73,51 +73,52 @@
             </el-form-item>
           </el-form>
 
-          <!--按钮弹窗部分-->
-
-          <!-- 查改 -->
-          <Detail
-            v-if="dialogDetail"
-            v-model="dialogDetail"
-            :gdbh="gdbh"
-          />
-
-          <!-- 工单超节损统计 -->
-          <el-dialog
-            v-model="dialogGdcjstj"
-            title="工单超节损统计"
-            destroy-on-close
-          >
-            <Gdcjstj :gdbh="gdbh" />
-          </el-dialog>
-
-          <!-- 修正工单印件质量考核设置 -->
-          <Khsz
-            v-if="dialogKhsz"
-            v-model="dialogKhsz"
-            :gdbh="gdbh"
-          />
-
-          <!-- 修正工单投料 -->
-          <Xzgdtl
-            v-if="dialogXzgdtl"
-            v-model="dialogXzgdtl"
-            :date="date"
-          />
-
-          <!-- 工序产量核查 -->
-          <Gxclhc
-            v-if="dialogGxclhc"
-            v-model="dialogGxclhc"
-            :gdbh="gdbh"
-          />
-
-          <!-- 工单质检废品统计 -->
-          <Gongdanzhijianfeipintongji
-            v-if="dialogGdzjfptj"
-            v-model="dialogGdzjfptj"
-            :val="gdbh"
-          />
+          <!-- 弹窗 -->
+          <div>
+            <!-- 查改 -->
+            <Detail
+              v-if="dialogDetail"
+              v-model="dialogDetail"
+              :gdbh="gdbh"
+            />
+
+            <!-- 工单超节损统计 -->
+            <el-dialog
+              v-model="dialogGdcjstj"
+              title="工单超节损统计"
+              destroy-on-close
+            >
+              <Gdcjstj :gdbh="gdbh" />
+            </el-dialog>
+
+            <!-- 修正工单印件质量考核设置 -->
+            <Khsz
+              v-if="dialogKhsz"
+              v-model="dialogKhsz"
+              :gdbh="gdbh"
+            />
+
+            <!-- 修正工单投料 -->
+            <Xzgdtl
+              v-if="dialogXzgdtl"
+              v-model="dialogXzgdtl"
+              :date="date"
+            />
+
+            <!-- 工序产量核查 -->
+            <Gxclhc
+              v-if="dialogGxclhc"
+              v-model="dialogGxclhc"
+              :gdbh="gdbh"
+            />
+
+            <!-- 工单质检废品统计 -->
+            <Gongdanzhijianfeipintongji
+              v-if="dialogGdzjfptj"
+              v-model="dialogGdzjfptj"
+              :val="gdbh"
+            />
+          </div>
 
         </div>
       </layout-header>
@@ -131,12 +132,12 @@
         >
           <div
             class="JKWTree-tree"
-            style="height: 200px"
+            style="height: 70vh;"
           >
             <h3> 产品管理</h3>
             <el-tree
               :data="treeData"
-              style="width: 100vw;"
+              highlight-current
               @node-click="handleNodeClick"
             />
           </div>
@@ -159,7 +160,6 @@
               :header-row-style="{ height: '20px' }"
               :header-cell-style="{ padding: '0px' }"
               @row-click="showOrderSuperLossGy"
-              @row-dblclick=""
               @current-change="(row, oldRow) => { currentRow = row}"
             >
               <el-table-column
@@ -211,10 +211,9 @@
   </div>
 </template>
 <script setup>
-// 全量引入格式化工具 请按需保留
 import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
 import { ref, watch } from 'vue'
-import { getOrderGy, getOrderSuperLossGy, getSide, getTable, updateOrderGy } from '@/api/mes_api_gty/orderAccounting'
+import { getOrderSuperLossGy, getSide, getTable } from '@/api/mes_api_gty/orderAccounting'
 import Gdcjstj from '@/view/performance/12-orderAccounting/componets/gdcjstj.vue'
 import Khsz from '@/view/performance/12-orderAccounting/componets/khsz.vue'
 import Xzgdtl from '@/view/performance/12-orderAccounting/componets/xzgdtl.vue'
@@ -268,7 +267,7 @@ const tableCols1 = [
   { label: '实际投料', prop: '实际投料', width: '100' },
   { label: '计量单位', prop: '计量单位', width: '100' },
   { label: '入仓日期', prop: 'warehousing_date', width: '120' },
-  { label: '入仓数量', prop: '', width: '100' },
+  { label: '入仓数量', prop: 'warehousing_num', width: '100' },
   { label: '目标合格率', prop: 'target_rate', width: '100' },
   { label: '实际合格率', prop: 'real_rate', width: '100' },
   { label: '奖惩系数', prop: '', width: '100' },
@@ -347,6 +346,7 @@ const rowClassName = ({ row, rowIndex }) => {
 
 }
 </script>
+
 <style scoped>
 :deep(.plan-usage-low div) {
   color: red !important;
@@ -357,7 +357,7 @@ const rowClassName = ({ row, rowIndex }) => {
 }
 
 .JKWTree-tree {
-  width: 300px;
+  width: 100%;
   background-color: #fff;
   /*background-color: rgba(241, 224, 224, 0.99);*/
   padding: 10px;

+ 5 - 4
src/view/performance/Manualdocuments.vue

@@ -510,6 +510,7 @@ const handleCurrentChange = (val) => {
    default:
      break
  }
+ console.log(params.type)
 }
 
 const getTableData = async() => {
@@ -528,8 +529,7 @@ const getTableData = async() => {
   
   const response = await getDateList({
     date: params.date, sys_id: params.sys_id,
-    page: page.value.toString(), limit: limit.value.toString(),
-	
+    page: page.value.toString(), limit: limit.value.toString(),	
   })
   if (response.code === 0) {
 	  console.log(response)
@@ -541,6 +541,7 @@ const getTableData = async() => {
       };
     });
     tableData.splice(0, tableData.length, ...processedData);
+	console.log(tableData)
   }
 }
 
@@ -549,9 +550,9 @@ const handleNodeClick = (node,check) => {
    if (node.params) {
     params.date = node.params.date.replace(/\./g, '-');
     params.sys_id = node.params.sys_id;
+    params.type = 'getTableData'
     total.value = node.params.total;
-	   params.type = 'getTableData'
-	    page.value = 1
+    page.value = 1
     getTableData();
   }
 }

+ 553 - 78
src/view/performance/chejianbaogong.vue

@@ -20,14 +20,14 @@
 		
 		
     <el-container>
-      <el-aside width="200px">
+      <!-- <el-aside width="200px">
         <div class="JKWTree-tree">
 
           <h3  > 车间报工</h3>
           <el-tree :data="treeData" :props="defaultProps" :default-expand-all="true" @node-click="handleNodeClick"></el-tree>
         </div>
 
-      </el-aside>
+      </el-aside> -->
       <el-container>
 <!--        <el-header>dd</el-header>-->
         <el-main>
@@ -119,7 +119,7 @@
                                     :row-style="{ height: '20px' }"
                                     :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
                                     :header-cell-style="{ padding: '0px' }"
-                                    @row-dblclick="yjupdateCompanyFunc"
+                                    @row-click="yjupdateCompanyFunc"
                                     style="width: 100%;height: 330px" border tooltip-effect="dark" :data="sbzyData" row-key="ID" @selection-change="handleSelectionChange">
             <!--                <el-table-column type="selection" width="55" />-->
                             <el-table-column align="left" label="选择" prop="yj_yjno"  width="80"/>
@@ -359,8 +359,8 @@
 			   </el-form-item>
 			 </el-col>
 			</el-row> 	
-				
-			<div class="groupbox" style="height: 18vh; width: 920px;">
+			<div style="display: flex;">
+			<div class="groupbox float-div" style="height: 17vh; width: 800px;">
 			    <span class="grouptitle">组员及分配比例</span>
 				<el-row :gutter="10" style="margin-top: 0px; height: 5vh;">
 								 <el-col :span="2">
@@ -557,6 +557,13 @@
 			  				</el-col> -->
 			  </el-row>
 			</div>
+			<div style="height: 17vh; width: 100px;margin-top: 30px;">
+				<el-button type="text"></el-button>
+				<!-- <el-button style="margin-bottom: 5px;" @click="" >新增</el-button> -->
+				<el-button style="margin-bottom: 5px;" @click="selectBz" >更新当前班组</el-button>
+				<!-- <el-button @click="delBz" >删除当前班组</el-button> -->
+			</div>
+			</div>
           </el-dialog>
 
 
@@ -570,24 +577,24 @@
 		  width="1100px"
 		  style="height: 78%;"
 		>
-		  <el-row :gutter="24">
-		    <el-col :span="4">
-		      <el-form-item label="设备编号" prop="id">
-		        <el-input v-model="JTMC" :clearable="true" placeholder="" />
+		  <el-row :gutter="24" style="margin-bottom: 0px;margin-top: 0px;">
+		    <el-col :span="4" style="margin-bottom: 0px;margin-top: 0px;">
+		      <el-form-item label="设备编号" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
+		        <el-input v-model="JTMC" :clearable="true" placeholder="" style="margin-bottom: 0px;margin-top: 0px;"/>
 		      </el-form-item>
 		    </el-col>
-		    <el-col :span="10">
-		      <el-row >
-		        <el-col>
-		          <el-input v-model="formData.产品名称" :clearable="true" placeholder="" />
+		    <el-col :span="10" style="margin-bottom: 0px;margin-top: 0px;">
+		      <el-row style="margin-bottom: 0px;margin-top: 0px;">
+		        <el-col style="margin-bottom: 0px;margin-top: 0px;">
+		          <el-input v-model="formData.产品名称" :clearable="true" placeholder="" style="margin-bottom: 0px;margin-top: 0px;"/>
 		        </el-col>
 		      </el-row>
 		    </el-col>
 		  </el-row>
 		
 		  <div style="display: flex;">
-		    <div style="flex: 0.1;">
-		      <el-aside width="180px" style="margin: 0;">
+		    <div style="flex: 0.1;margin-top: 0px;">
+		      <el-aside width="180px" style="margin: 0; margin-top: 0px;">
 		        <div class="JKWTree-tree" style="height: 100%; border-right: 1px solid #ebeef5;">		          
 		          <el-tree :data="dianjiantreeData" :props="defaultProps" highlight-current="true"
 		            @node-click="dianjianNodeClick" @node-dblclick="handleNodeDoubleClick"></el-tree>
@@ -602,7 +609,7 @@
 		        highlight-current-row="true"
 				:show-overflow-tooltip="true"
 		        border  @row-click="dianjianhandle"
-		        style="width:100%; height:320px;"
+		        style="width:100%; height:320px; margin-top: 5px;"
 		        @row-dblclick="handleSelectClick"
 		        :row-class-name="rowClassName"
 		      >
@@ -711,38 +718,40 @@
 		      <el-aside width="180px" style="margin: 0;">
 		        <div class="JKWTree-tree" style="height: 100%; border-right: 1px solid #ebeef5;">		          
 		          <el-tree :data="zhichengtreeData" :props="defaultProps" highlight-current="true"
-		            @node-click="dianjianNodeClick"></el-tree>
+		            @node-click="zhichengNodeClick"></el-tree>
 		        </div>
 		      </el-aside>
 		    </div>
-		    <div style="flex: 1; margin: 0;">
-		      <el-tabs v-model="activName" type="card" @tab-click="handleClick">
+		    <div v-if="zhichengstatus" style="flex: 0; margin: 0;">
+		      <el-tabs v-model="activNames" type="card" @tab-click="handleClick">
 		        <el-tab-pane label="指标检验"  @click="showTable('指标检验')"  name="first">
 		          <el-table
 		            tooltip-effect="dark"
-		            :data="dianjianselectData"
+		            :data="zhibiaoselectData"
 		            row-key="ID"
 		            highlight-current-row="true"
 		          				:show-overflow-tooltip="true"
 		            border  @row-click="dianjianhandle"
-		            style="width:100%; height:320px;"
+		            style="width:100%; height:310px;"
 		            @row-dblclick="handleSelectClick"
 		            :row-class-name="rowClassName"
 		          >
 		            <el-table-column
 		              prop="检验项目"
 		              label="检验项目"
-		              width="320"
-		            />
-		            <el-table-column
-		              prop="点检方法"
-		              label="点检方法"
-		              width="180"
+		              width="270"
 		            />
+					<el-table-column
+					  v-slot="scope"
+					  label="不检测" 
+					  width="70"
+					>
+					   <el-checkbox v-model="scope.row.notjc" @click="notjcClick(scope.row)"></el-checkbox>
+					</el-table-column>
 		            <el-table-column
 		              v-slot="scope"
-		              label="正常"
-		              width="70"
+		              label="合格"
+		              width="60"
 		            >
 		              
 		             <el-checkbox v-model="scope.row.zc" @click="zcClick(scope.row)"></el-checkbox>
@@ -750,32 +759,33 @@
 		            </el-table-column>
 		            <el-table-column
 		              v-slot="scope"
-		              label="异常" 
+		              label="不合格" 
 		              width="70"
 		            >
 		               <el-checkbox v-model="scope.row.yc" @click="ycClick(scope.row)"></el-checkbox>
 		            </el-table-column>
-		            <el-table-column
-		          				  v-slot="scope"
-		              label="备注说明"
-		              width="180"
-		            >
-		          				<el-input v-model="scope.row.remark"/>
-		            </el-table-column>
-		            <el-table-column
-		              v-slot="scope"
-		              label="不检测" 
-		              width="75"
-		            >
-		               <el-checkbox v-model="scope.row.notjc" @click="notjcClick(scope.row)"></el-checkbox>
-		            </el-table-column>
+					<el-table-column
+					  prop="检测方法"
+					  label="检测方法"
+					  width="90"
+					/>
+					<el-table-column
+					  prop="检验频率"
+					  label="检验频率"
+					  width="150"
+					/>
+					<el-table-column
+					  prop="相关标准"
+					  label="相关标准"
+					  width="180"
+					/>
 		          </el-table>
 		        </el-tab-pane>
 		      
-		        <el-tab-pane label="附件检验记录"  @click="showTable('附件检验记录')"  name="second">
+		        <el-tab-pane label="附加检验记录"  @click="showTable('附加检验记录')"  name="second">
 		          <el-table
 		            tooltip-effect="dark"
-		            :data="dianjianselectData"
+		            :data="fujiaselectData"
 		            row-key="ID"
 		            highlight-current-row="true"
 		          				:show-overflow-tooltip="true"
@@ -784,20 +794,82 @@
 		            @row-dblclick="handleSelectClick"
 		            :row-class-name="rowClassName"
 		          >
+				    <el-table-column
+				      v-slot="scope"
+				      label="不检测" 
+				      width="75"
+				    >
+				       <el-checkbox v-model="scope.row.notjc"></el-checkbox>
+				    </el-table-column>
 		            <el-table-column
-		              prop="检验项目"
-		              label="检验项目"
-		              width="320"
+		              prop="缺陷备注"
+		              label="缺陷及记录"
+		              width="720"
+		            />
+		            <el-table-column
+		              prop="编号"
+		              label="编号"
+		              width="80"
 		            />
+		          </el-table>
+		        </el-tab-pane>
+		      </el-tabs>
+		    </div>
+		  </div>
+		  <template #footer>
+		    <div v-if="zhichengstatus" class="dialog-footer">
+		      <el-button @click="closezhichengDialog">关 闭</el-button>
+		      <el-button type="primary" @click="zhichengDialog">提 交</el-button>
+		    </div>
+		  </template>
+		</el-dialog>
+		
+		<el-dialog
+		  v-model="huanxingVisible"
+		  title="换型清场"
+		  destroy-on-close
+		  width="1100px"
+		  style="height: 78%;"
+		>
+		  <div style="display: flex;">
+		    <div style="flex: 0.1;">
+		      <el-aside width="180px" style="margin: 0;">
+		        <div class="JKWTree-tree" style="height: 55vh; border-right: 1px solid #ebeef5;">		          
+		          <el-tree :data="huanxingtreeData" :props="defaultProps" highlight-current="true"
+		            @node-click="huanxingNodeClick"></el-tree>
+		        </div>
+		      </el-aside>
+		    </div>
+		    <div v-if="huanxingstatus" style="flex: 0; margin: 0;">
+		      <el-tabs v-model="activNames" type="card" @tab-click="handleClick">
+		        <el-tab-pane label="指标检验"  @click="showTable('指标检验')"  name="first">
+		          <el-table
+		            tooltip-effect="dark"
+		            :data="zhibiaoselectData"
+		            row-key="ID"
+		            highlight-current-row="true"
+		          				:show-overflow-tooltip="true"
+		            border  @row-click="dianjianhandle"
+		            style="width:100%; height:310px;"
+		            @row-dblclick="handleSelectClick"
+		            :row-class-name="rowClassName"
+		          >
 		            <el-table-column
-		              prop="点检方法"
-		              label="点检方法"
-		              width="180"
+		              prop="检验项目"
+		              label="检验项目"
+		              width="270"
 		            />
+					<el-table-column
+					  v-slot="scope"
+					  label="不检测" 
+					  width="70"
+					>
+					   <el-checkbox v-model="scope.row.notjc" @click="notjcClick(scope.row)"></el-checkbox>
+					</el-table-column>
 		            <el-table-column
 		              v-slot="scope"
-		              label="正常"
-		              width="70"
+		              label="合格"
+		              width="60"
 		            >
 		              
 		             <el-checkbox v-model="scope.row.zc" @click="zcClick(scope.row)"></el-checkbox>
@@ -805,36 +877,151 @@
 		            </el-table-column>
 		            <el-table-column
 		              v-slot="scope"
-		              label="异常" 
+		              label="不合格" 
 		              width="70"
 		            >
 		               <el-checkbox v-model="scope.row.yc" @click="ycClick(scope.row)"></el-checkbox>
 		            </el-table-column>
+					<el-table-column
+					  prop="检测方法"
+					  label="检测方法"
+					  width="90"
+					/>
+					<el-table-column
+					  prop="检验频率"
+					  label="检验频率"
+					  width="150"
+					/>
+					<el-table-column
+					  prop="相关标准"
+					  label="相关标准"
+					  width="180"
+					/>
+		          </el-table>
+		        </el-tab-pane>
+		      
+		        <el-tab-pane label="当前设备换型记录"  @click="showTable('当前设备换型记录')"  name="second">
+		          <el-table
+		            tooltip-effect="dark"
+		            :data="fujiaselectData"
+		            row-key="ID"
+		            highlight-current-row="true"
+		          				:show-overflow-tooltip="true"
+		            border  @row-click="dianjianhandle"
+		            style="width:100%; height:320px;"
+		            @row-dblclick="handleSelectClick"
+		            :row-class-name="rowClassName"
+		          >
 		            <el-table-column
-		          				  v-slot="scope"
-		              label="备注说明"
-		              width="180"
-		            >
-		          				<el-input v-model="scope.row.remark"/>
-		            </el-table-column>
+		              prop="日期"
+		              label="日期"
+		              width="100"
+		            />
 		            <el-table-column
-		              v-slot="scope"
-		              label="不检测" 
-		              width="75"
-		            >
-		               <el-checkbox v-model="scope.row.notjc" @click="notjcClick(scope.row)"></el-checkbox>
-		            </el-table-column>
+		              prop="机台编号"
+		              label="机台编号"
+		              width="80"
+		            />
+					<el-table-column
+					  prop="班组"
+					  label="班组"
+					  width="70"
+					/>
+					<el-table-column
+					  prop="工单编号A"
+					  label="工单编号A"
+					  width="80"
+					/>
+					<el-table-column
+					  prop="印件名称A"
+					  label="印件名称A"
+					  width="120"
+					/>
+					<el-table-column
+					  prop="印件工序A"
+					  label="印件工序A"
+					  width="80"
+					/>
+					<el-table-column
+					  prop="码包号A"
+					  label="码包号A"
+					  width="80"
+					/>
+					<el-table-column
+					  prop="工单编号B"
+					  label="工单编号B"
+					  width="80"
+					/>
+					<el-table-column
+					  prop="印件名称B"
+					  label="印件名称B"
+					  width="80"
+					/>
+					<el-table-column
+					  prop="印件工序B"
+					  label="印件工序B"
+					  width="100"
+					/>
+					<el-table-column
+					  prop="码包号B"
+					  label="码包号B"
+					  width="80"
+					/>
+					<el-table-column
+					  prop="清场项目A"
+					  label="菲林_标样_签样品_留样品"
+					  width="120"
+					/>
+					<el-table-column
+					  prop="清场项目B"
+					  label="版材_纸张_电化铝_油墨"
+					  width="120"
+					/>
+					<el-table-column
+					  prop="清场项目C"
+					  label="过版纸_废品_次品"
+					  width="120"
+					/>
+					<el-table-column
+					  prop="清场项目D"
+					  label="半成品_成品_零头"
+					  width="120"
+					/>
+					<el-table-column
+					  prop="清场项目E"
+					  label="操作台桌面_抽屉_地面"
+					  width="120"
+					/>
+					<el-table-column
+					  prop="机长"
+					  label="机长"
+					  width="80"
+					/>
+					<el-table-column
+					  prop="班长"
+					  label="带班长"
+					  width="80"
+					/>
+					<el-table-column
+					  prop="质量巡查员"
+					  label="质量巡查员"
+					  width="80"
+					/>
+					<el-table-column
+					  prop="创建时间"
+					  label="创建时间"
+					  width="120"
+					/>
+					<el-table-column
+					  prop="UNIQID"
+					  label="UNIQID"
+					  width="80"
+					/>
 		          </el-table>
 		        </el-tab-pane>
 		      </el-tabs>
 		    </div>
 		  </div>
-		  <template #footer>
-		    <div class="dialog-footer">
-		      <el-button @click="closedianjianDialog">关 闭</el-button>
-		      <el-button type="primary" @click="dianjianDialog">提 交</el-button>
-		    </div>
-		  </template>
 		</el-dialog>
 		
 		<el-dialog
@@ -1450,6 +1637,14 @@ import {
   getCompanyList
 } from '@/api/company'
 
+import {
+  ProcessInspectionRecordsItemAdd,
+  AdditionalInspectionRecordAdd,
+  getMac,
+  remodelGetTab,
+  setMachineTeam
+} from '@/api/jixiaoguanli/baogong'
+
 import {
   facilityTab,
   facilitychanLiang,
@@ -1489,14 +1684,18 @@ import { ref, reactive } from 'vue'
 import Shebeizhuangtai from '@/view/performance/09-workOrderVerification/componets/shebeizhuangtai.vue'
 
 const dialogSbyxgl=ref(false)
+const zhichengstatus=ref(false)
 defineOptions({
     name: 'Company'
 })
 const xunchatreeData=ref([{label: '现场巡查记录',} ])
 const activName=ref('first')
+const activNames=ref('first')
 let checked3=ref(false)
 const detailData = reactive([])
 const treeData=ref([])
+const huanxingtreeData=ref([])
+const huanxingstatus=ref(false)
 const zhichengtreeData=ref([{
 	label: '首件与过程确认'
 },{
@@ -1554,6 +1753,15 @@ const ent = (event,id1,id2,id3) => {
   }
 }
 
+const huanxingNodeClick = (node) => {
+  //存放当前节点的nodeId
+  if(node.machine){
+	  huanxingstatus.value=true
+	  console.log(node)
+  }else{
+	  console.log('2')
+  }
+}
 const handleNodeClick = (nodeData,node) => {
   //存放当前节点的nodeId
   if(nodeData.level === 1){
@@ -1596,7 +1804,9 @@ const FacilityProduction = async () => {
 		formData.value.工序号 = response.data.工序名称.substring(0,2);
 	    formData.value.工序名称 = response.data.工序名称;
 	    formData.value.产品名称 = response.data.产品名称;
+		formData.value.班组Id=response.data.班组Id
 		formData.value.machine=JTMC
+		formData.value.状态=response.data.状态
 		BZMC.value=response.data.班组编号
 	       // 填充sczl_bh和sczl_name字段
 		   let sczl_bhkey=''
@@ -1750,6 +1960,8 @@ const page = ref(1)
 const total = ref(0)
 const pageSize = ref(10)
 const tableData = ref([])
+const zhibiaoselectData=ref([])
+const fujiaselectData=ref([])
 const searchInfo = ref({})
 
 // 重置
@@ -1884,12 +2096,26 @@ function ondianjian() {
   });
   
 }
-function onzhicheng() {
-  zhichengVisible.value = true;
+const onzhicheng = async () => {
+	zhichengstatus.value=false
+	xunchaData.value=[]
+	const response = await reportProduceInfo({machine:JTMC.split("#")[0]});
+	if (response.code === 0) {
+		xunchaData.value.order=response.data.order
+		xunchaData.value.yjno=response.data.yjno
+		xunchaData.value.product_name=response.data.product_name
+		xunchaData.value.gxmc=response.data.gxmc
+		xunchaData.value.lcdh=0
+		xunchaData.value.sczl_bh=''
+		xunchaData.value.sczl_name=''
+		xunchaData.value.remark=''
+		zhichengVisible.value = true;
+	}
 }
 
 const chanliangselectData = reactive([])
 const chanliangVisible = ref(false)
+const huanxingVisible = ref(false)
 const xunchaVisible = ref(false)
 
 //设置机台状态
@@ -1898,6 +2124,32 @@ function onstatus() {
 	 SetMachineStatus()
 	 // ReportProduceInfo()
 }
+function onClear() {
+	huanxingVisible.value=true
+	 RemodelGetTab()
+}
+const RemodelGetTab = async() => {
+  const response = await remodelGetTab()
+  let arr=[]
+  if (response.code === 0) {
+	  for(let key in response.data){
+		  if(response.data[key][0]){
+			  let children =[]
+			  for (let i = 0; i < response.data[key].length; i++) {
+				  children.push({label:response.data[key][i],machine:key})
+			  }
+			  arr.push({
+				  label:key,
+				  children:children
+			  })
+			  console.log(response.data[key].length)
+		  }else{
+			 arr.push({label:key}) 
+		  }
+	  }
+	  huanxingtreeData.value=arr
+  }
+}
 //设置机台状态
 const SetMachineStatus = async () => {
   // const response = await setMachineStatus({
@@ -1957,9 +2209,96 @@ const dianjianDialog = async () => {
 		  dianjianVisible.value=false
 	}
 }
+const zhichengDialog = async () => {
+	console.log(fujiaselectData.value)
+	let arr =[]
+	zhibiaoselectData.value.map(item=>{
+		if(item.zc==true){
+			item.result='合格'
+			item.item=item.检验项目
+			item.instrument=item.检测方法
+			item.standard=item.相关标准
+			delete item.notjc
+			delete item.zc
+			delete item.yc
+			delete item.检验项目
+			delete item.检测方法
+			delete item.相关标准
+			delete item.检验频率
+			arr.push(item)
+			return item
+		}
+		if(item.yc==true){
+			item.result='不合格'
+			item.item=item.检验项目
+			item.instrument=item.检测方法
+			item.standard=item.相关标准
+			delete item.notjc
+			delete item.zc
+			delete item.yc
+			delete item.检验项目
+			delete item.检测方法
+			delete item.相关标准
+			delete item.检验频率
+			arr.push(item)
+			return item
+		}
+		if(item.notjc==true){
+			item.result='不检测'
+			item.item=item.检验项目
+			item.instrument=item.检测方法
+			item.standard=item.相关标准
+			delete item.notjc
+			delete item.zc
+			delete item.yc
+			delete item.检验项目
+			delete item.检测方法
+			delete item.相关标准
+			delete item.检验频率
+			// arr.push(item)
+			return item
+		}
+		
+	})
+	let arrs=[]
+	let fujiastatus=0
+	fujiaselectData.value.map(item=>{
+		if(item.notjc==true){
+			return item
+		}else{
+			fujiastatus=1
+			item.remark=item.缺陷备注
+			delete item.notjc
+			delete item.缺陷备注
+			delete item.编号
+			arrs.push(item)
+			return item
+		}
+		
+	})
+	if(fujiastatus==1){
+		const responses = await AdditionalInspectionRecordAdd(arrs);
+		fujiastatus=0
+	}
+	// const response = await ProcessInspectionRecordsItemAdd(arr);
+	const response = await ProcessInspectionRecordsItemAdd(zhibiaoselectData.value);
+	// const responses = await AdditionalInspectionRecordAdd(zhibiaoselectData.value);
+	if (response.code === 0) {
+		  ElMessage({
+		    type: 'success',
+		    message: '成功'
+		  })
+		  zhichengVisible.value=false
+		  zhibiaoselectData.value=[]
+		  fujiaselectData.value=[]
+	}
+}
 const closedianjianDialog = async () => {
 	dianjianVisible.value=false
 }
+const closezhichengDialog = async () => {
+	zhichengVisible.value=false
+}
 
 //获取机台生产信息
 const ReportProduceInfo = async (value,inputName) => {
@@ -1991,7 +2330,31 @@ const FieldInspectionRecord = async () => {
 }
 //获取机台编号
 const GetMachineMac = async () => {
-  const response = await getMachineMac({ addr: '68-ED-A4-26-5F-37' });
+	var xmlhttp = null;
+	var res;
+	if (window.XMLHttpRequest) {
+		xmlhttp = new XMLHttpRequest();
+	} else if (window.ActiveXObject) {
+		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+	}
+	// 2. 设置回调函数
+	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]
+			  }
+		}
+	}
+	// 3. 打开一个连接http://10.10.4.42/
+	xmlhttp.open("get", "http://127.0.0.1:8090/init")
+	// 5. 发送
+	xmlhttp.send();
+  const response = await getMachineMac({ addr: '68-ED-A4-26-5F-8E' });
   console.log(response);
   if (response.code === 0) {
     // 将接口返回的数据添加到树型结构中
@@ -2222,6 +2585,41 @@ const dianjianNodeClick = (node, check, nodeData) => {
      FacilityInspectionItem(node.label)
   }
 };
+const category =ref()
+const zhichengNodeClick = (node, check) => {
+	if(node.label){
+		zhichengstatus.value=true
+		category.value=node.label
+		processInspectionRecordsItem()
+	}
+};
+const processInspectionRecordsItem = async (value) => {
+  const response = await ProcessInspectionRecordsItem({ process: xunchaData.value.gxmc });
+  if (response.code === 0) {
+	zhibiaoselectData.value=response.data.首件.指标检验.map(item=>{
+		 item.notjc=true;
+		 item.zc=false;
+		 item.yc=false;
+		 item.remark=''
+		 item.category=category.value
+		 item.workOrder=xunchaData.value.order
+		 item.yjno=xunchaData.value.yjno
+		 item.flow=xunchaData.value.lcdh
+		 item.team=BZMC.value
+		 item.machine=JTMC.split("#")[0]
+		 return item
+	 })
+	 fujiaselectData.value=response.data.首件.附加.map(item=>{
+	 	 item.notjc=true;
+	 	 item.workOrder=xunchaData.value.order
+	 	 item.yjno=xunchaData.value.yjno
+	 	 item.flow=xunchaData.value.lcdh
+	 	 item.machine=JTMC.split("#")[0]
+	 	 return item
+	  })
+    
+  }
+};
 const notjcClick =  (val) => {
   try {
 	if(val.notjc==false){
@@ -2529,9 +2927,12 @@ const formDatas = ref({
   percentage10:'',
 })
 
-
+const currentBz ={}
 //班组单击
 const BZhandle = (val, row) => {
+	console.log(val.ID)
+	console.log(val)
+  currentBz.value=val
   formDatas.value  = {};
   for (const key in val) {
     if (val[key] === 0) {
@@ -2550,7 +2951,60 @@ const BZhandle = (val, row) => {
 	BZMC.value=val.班组号
   }
 };
-
+const selectBz = async() => {
+	if(currentBz.value){
+		BZMC.value=currentBz.value.班组号
+		let sczl_bhkey=''
+		let sczl_namekey=''
+		if (currentBz.value) {
+		  for (let i = 1; i <= 6; i++) {
+		  	sczl_bhkey=`sczl_bh${i}`
+		    sczl_namekey=`sczl_name${i}`
+		    formData.value[sczl_bhkey] = '';
+		    formData.value[sczl_namekey] = '';
+		  }
+		  for (let i = 1; i <= Math.min(Object.keys(currentBz.value).length-4, 6); i++) {
+			sczl_bhkey=`sczl_bh${i}`
+			sczl_namekey=`sczl_name${i}`
+			console.log(currentBz.value[i-1].split(' '))
+		    formData.value[sczl_bhkey] = currentBz.value[i-1].split(' ')[0];
+		    formData.value[sczl_namekey] = currentBz.value[i-1].split(' ')[1];
+		    classbz.value[i-1]=currentBz.value[i-1].split(' ')[0]
+		  }
+		  formData.value.class=classbz.value.join(',')
+		}
+		const response = await setMachineTeam({
+			machine: JTMC.split("#")[0],
+			order:formData.value.工单编号,
+			yjno:formData.value.印件号,
+			gy_name:formData.value.工序名称,
+			sczl_bzdh:BZMC.value,
+			status:formData.value.状态,
+			production_now:0,
+			production_all:0,
+			team_id:currentBz.value.ID
+			})
+		if(response.code===0){
+			ElMessage({
+			  type: 'success',
+			  message: '成功'
+			})
+		}
+		currentBz.value={}
+	}
+}
+const delBz = async() => {
+	if(currentBz.value){
+		ElMessageBox.confirm('确定要删除吗?', '提示', {
+		    confirmButtonText: '确定',
+		    cancelButtonText: '取消',
+		    type: 'warning'
+		}).then(() => {
+		        teamDel(currentBz.value.ID)
+		    })
+	currentBz.value={}
+	}
+}
 	
 
 // ============== 表格控制部分结束 ===============
@@ -2631,6 +3085,27 @@ const updateCompanyFunc = async(row) => {
     }
 }
 
+const yjupdateCompanyFunc = async(row) => {
+	console.log(row)
+    const res = await setMachineTeam({
+			machine: JTMC.split("#")[0],
+			order:row['工单编号|质量信息'].split('|')[0],
+			yjno:row['工序名称'].split('-')[0],
+			gy_name:row['工序名称'],
+			sczl_bzdh:BZMC.value,
+			status:formData.value.状态,
+			production_now:0,
+			production_all:0,
+			team_id:formData.value.班组Id
+			})
+    if (res.code === 0) {
+		FacilityProduction()
+		ElMessage({
+		        type: 'success',
+		        message: '成功'
+		    })
+    }
+}
 
 // 删除行
 const deleteCompanyFunc = async (row) => {