Browse Source

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

Lexie 1 year ago
parent
commit
5f4291bdcf

+ 2 - 1
jsconfig.json

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

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

@@ -0,0 +1,23 @@
+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
+  })
+}

+ 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
   })
-}
+}

+ 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.jyGx"
                   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.jyGx = 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: '',
+    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>

+ 213 - 240
src/view/performance/08-timesheet/index.vue

@@ -1,100 +1,45 @@
 <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"
@@ -379,29 +324,90 @@
             </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="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>
+
+        </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 } from 'element-plus'
+import { ref, reactive } from 'vue'
+import { getSide, getTable, getDetail, updateData, getLocate, createData } from '@/api/mes_api_gty/timesheet'
 
 defineOptions({
   name: '08Timesheet'
@@ -428,7 +434,7 @@ const rule = reactive({
 })
 
 const elFormRef = ref()
-const elSearchFormRef = ref()
+// const elSearchFormRef = ref()
 
 // ============== 表格页面 ==============
 const tableColumns = [
@@ -530,16 +536,16 @@ const handleNodeClick = (node, check) => {
   }
 }
 // 新增数据
-const handleShowAdd = async () => {
-  const res = await getDetail({ wgjs_rq: value1.value, wgjs_bh1: value2.value });
+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
+    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
@@ -564,13 +570,13 @@ async function doubleClick(row, column, event) {
     dialogFormVisible.value = true
   }
 }
-const value1=ref()
-const value2=ref()
+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
+  value1.value = wgjs_rq
+  value2.value = wgjs_bh1
   // console.log(wgjs_rq)
   // console.log(wgjs_bh1)
   // const res = await getDetail({ wgjs_rq, wgjs_bh1 })
@@ -581,48 +587,45 @@ async function Click(row, column, event) {
 }
 // 更新数据
 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,83 +639,28 @@ 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()
-  }
-}
-
-// 更新行
-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
+    params.type = 'getTableData'
+    // page.value = 1
+    handleCurrentChange()
+    // if(response.code==0){
+    // 		 ElMessage({
+    // 		   type: 'success',
+    // 		   message: '更新成功',
+    // 		 })
+    // }
+    dialogFormVisible.value = false
   }
 }
 
@@ -721,14 +669,6 @@ const closeDialog = () => {
   dialogFormVisible.value = false
 }
 
-// 导出excel
-function exportExcel() {
-  console.log('导出到excel')
-}
-
-// 生命周期钩子
-onMounted(() => {
-})
 </script>
 
 <style scoped>
@@ -737,7 +677,7 @@ onMounted(() => {
 }
 
 .JKWTree-tree {
-  width: 300px;
+  width: 100%;
   background-color: #fff;
   padding: 10px;
   margin-right: 20px;
@@ -758,3 +698,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>

+ 51 - 51
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'
@@ -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;

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

@@ -1065,6 +1065,9 @@ const rqsubmit = () =>{
 
 //机台失去焦点事件
 const getJtbhsubmit = () => {
+	if(BzVisible.value){
+		return false
+	}
 	//弹出选择
 	reportGetJtbh({sczl_type:formData.value.sczl_type,key_word:''}).then(response=>{
 		if (response.code === 0) {
@@ -1125,7 +1128,8 @@ const getDedhsubmit = () => {
 	productionDedh({sczl_jtbh:formData.value.sczl_jtbh}).then(response=>{
 		if (response.code === 0) {
 			if(formData.value.sczl_jtbh==''){
-				const data = response.data;
+				const data = [];
+				data[0] = response.data;
 				   
 				   // 递归函数来构建树形结构
 				   const buildTree = (node) => {
@@ -1145,7 +1149,7 @@ const getDedhsubmit = () => {
 				   };
 				   
 				   // 构建树形结构的根节点
-				   const treeData = data.bh_mc.map(buildTree);
+				   const treeData = data.map(buildTree);
 				   
 				   GetDedhtreeData = treeData; // 假设这是外部可访问的变量
 				   GetDedhVisible.value = true; // 假设这是一个响应式引用

File diff suppressed because it is too large
+ 427 - 523
src/view/performance/Manualdocuments.vue


+ 281 - 86
src/view/performance/chejianbaogong.vue

@@ -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,55 +794,32 @@
 		            @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="180"
+		              prop="编号"
+		              label="编号"
+		              width="80"
 		            />
-		            <el-table-column
-		              v-slot="scope"
-		              label="正常"
-		              width="70"
-		            >
-		              
-		             <el-checkbox v-model="scope.row.zc" @click="zcClick(scope.row)"></el-checkbox>
-		            
-		            </el-table-column>
-		            <el-table-column
-		              v-slot="scope"
-		              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>
 		        </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 v-if="zhichengstatus" class="dialog-footer">
+		      <el-button @click="closezhichengDialog">关 闭</el-button>
+		      <el-button type="primary" @click="zhichengDialog">提 交</el-button>
 		    </div>
 		  </template>
 		</el-dialog>
@@ -1450,6 +1437,12 @@ import {
   getCompanyList
 } from '@/api/company'
 
+import {
+  ProcessInspectionRecordsItemAdd,
+  AdditionalInspectionRecordAdd,
+  getMac
+} from '@/api/jixiaoguanli/baogong'
+
 import {
   facilityTab,
   facilitychanLiang,
@@ -1489,11 +1482,13 @@ 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([])
@@ -1750,6 +1745,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,8 +1881,21 @@ 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([])
@@ -1957,9 +1967,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,6 +2088,30 @@ const FieldInspectionRecord = async () => {
 }
 //获取机台编号
 const GetMachineMac = async () => {
+	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-37' });
   console.log(response);
   if (response.code === 0) {
@@ -2222,6 +2343,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 +2685,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 +2709,43 @@ 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(',')
+		}
+		currentBz.value={}
+	}
+}
+const delBz = async() => {
+	if(currentBz.value){
+		ElMessageBox.confirm('确定要删除吗?', '提示', {
+		    confirmButtonText: '确定',
+		    cancelButtonText: '取消',
+		    type: 'warning'
+		}).then(() => {
+		        teamDel(currentBz.value.ID)
+		    })
+	currentBz.value={}
+	}
+}
 	
 
 // ============== 表格控制部分结束 ===============

Some files were not shown because too many files changed in this diff