tty hai 1 ano
pai
achega
27b335bafd

+ 10 - 35
src/api/mes_api_gty/myapi.js

@@ -55,6 +55,15 @@ export const getYg = (params) => {
   })
 }
 
+// 新增
+export const addPackingTable = (data) => {
+  return service({
+    url: '/mes_server/packaging_count_document/add',
+    method: 'post',
+    data
+  })
+}
+
 // 修改数据数据
 export const updatePackingTable = (data) => {
   return service({
@@ -73,41 +82,6 @@ export const DeletePackingTable = (data) => {
   })
 }
 
-// 其他计件单据维护
-export const getOtherSideTable = (data) => {
-  return service({
-    url: '/mes_server/other_count_document/getTab',
-    method: 'get',
-    data
-  })
-}
-
-export const getOtherTable = (params) => {
-  return service({
-    url: '/mes_server/other_count_document/getList',
-    method: 'get',
-    params
-  })
-}
-
-// 计件工计时单侧边栏
-export const getTimeSheetSideTable = (data) => {
-  return service({
-    url: '/mes_server/piece_work_schedule/getTab',
-    method: 'get',
-    data
-  })
-}
-
-// 计件工计时单列表
-export const getTimeSheetTable = (params) => {
-  return service({
-    url: '/mes_server/piece_work_schedule/getList',
-    method: 'get',
-    params
-  })
-}
-
 // 工单核验单侧边栏
 export const getOrderVerificationSideTable = (data) => {
   return service({
@@ -125,3 +99,4 @@ export const getOrderVerificationTable = (params) => {
     params
   })
 }
+

+ 59 - 4
src/api/mes_api_gty/orderAccounting.js

@@ -5,19 +5,74 @@ import service from '@/utils/request'
 */
 
 // 1.1获取左侧菜单栏
-export const getSide = (data) => {
+export const getSide = (params) => {
   return service({
     url: '/mes_server/order_super_loss/getTab',
     method: 'get',
-    data
+    params
   })
 }
 
-// 1.2获取超节损工单列表
-export const getTable = (data) => {
+// 1.2获取超节损工单列表-筛选
+export const getTable = (params) => {
   return service({
     url: '/mes_server/order_super_loss/getList',
     method: 'get',
+    params
+  })
+}
+
+// 1.3获取工单超节损工艺
+export const getOrderSuperLossGy = (params) => {
+  return service({
+    url: '/mes_server/order_super_loss/getOrderSuperLossGy',
+    method: 'get',
+    params
+  })
+}
+
+// 2工单超节损统计(按工序)
+export const getOrderSuperLossCount = (params) => {
+  return service({
+    url: '/mes_server/order_super_loss/getOrderSuperLossCount',
+    method: 'get',
+    params
+  })
+}
+
+// 3.1查改-获取工单工艺流程
+export const getOrderGy = (params) => {
+  return service({
+    url: '/mes_server/order_super_loss/getOrderGy',
+    method: 'get',
+    params
+  })
+}
+
+// 3.2查改-更新产品工艺资料
+export const updateOrderGy = (data) => {
+  return service({
+    url: '/mes_server/order_super_loss/updateOrderGy',
+    method: 'post',
     data
   })
 }
+
+// 4.1考核设置-获取工单印件资料
+export const getOrderYj = (params) => {
+  return service({
+    url: '/mes_server/order_super_loss/getOrderYj',
+    method: 'get',
+    params
+  })
+}
+
+// 4.2考核设置-更新工单印件资料
+
+// 5.1修正工单实际投料-获取列表
+
+// 5.2更新工单实际投料
+
+// 6工单工序产量查核
+
+//

+ 110 - 94
src/view/performance/06-packingDocuments/index.vue

@@ -11,8 +11,7 @@
             >
               <el-tree
                 :data="treeData"
-                :props="defaultProps"
-                highlight-current="true"
+                highlight-current
                 @node-click="handleNodeClick"
               />
             </el-scrollbar>
@@ -36,7 +35,19 @@
                 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"
@@ -67,7 +78,8 @@
               :header-row-style="{ height: '20px' }"
               :header-cell-style="{ padding: '0px' }"
               @selection-change="handleSelectionChange"
-              @row-dblclick="doubleClick"
+              @row-dblclick="handleShowDetail"
+              @row-click="currentRow = $event"
             >
               <el-table-column
                 type="selection"
@@ -98,8 +110,7 @@
           <!-- 弹出框 -->
           <el-dialog
             v-model="dialogFormVisible"
-            :before-close="closeDialog"
-            :title="type === 'create' ? '添加' : '修改'"
+            :title="type"
             destroy-on-close
             width="1200px"
           >
@@ -107,9 +118,8 @@
             <el-form
               ref="elFormRef"
               :model="detailData"
-              inline="true"
+              inline
               label-position="left"
-              :rules="rule"
             >
               <el-form-item
                 label="日期"
@@ -268,7 +278,7 @@
 
             <template #footer>
               <div class="dialog-footer">
-                <el-button @click="closeDialog">取 消</el-button>
+                <el-button @click="dialogFormVisible = false">取 消</el-button>
                 <el-button
                   type="primary"
                   @click="enterDialog"
@@ -320,19 +330,17 @@
 </template>
 
 <script setup>
-import { createCompany, deleteCompanyByIds, updateCompany } from '@/api/company'
 
-// 全量引入格式化工具 请按需保留
 import { ElMessage, ElMessageBox } 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 } from '@/api/mes_api_gty/myapi'
+import { getGxMc, getInfo, getLocate, getPackingSideTable, getPackingTable, updatePackingTable, getYg, DeletePackingTable, addPackingTable } from '@/api/mes_api_gty/myapi'
 
 defineOptions({
   name: '06PackingDocuments',
 })
 
-// 侧边栏数据
+// region 侧边栏功能
 const treeData = reactive([])
 const getSideData = async() => {
   try {
@@ -354,16 +362,10 @@ const getSideData = async() => {
     console.log(e)
   }
 }
-
 getSideData()
+// endregion
 
-// 验证规则
-const rule = reactive({})
-
-const elFormRef = ref()
-const elSearchFormRef = ref()
-
-// ============== 表格页面 ==============
+// region 表格功能
 const tableColumns = [
   { label: '员工编号', prop: 'sczl_bh', width: '100' },
   { label: '员工姓名', prop: 'name', width: '100' },
@@ -379,12 +381,6 @@ const tableColumns = [
   { label: 'UNIQID', prop: 'UniqId', width: '100' },
 ]
 const tableData = reactive([])
-
-const total = ref(0)
-const page = ref(1)
-const limit = ref(10)
-
-const searchInfo = ref('')
 const params = {
   type: '',
   date: '',
@@ -392,7 +388,13 @@ const params = {
   gdbh: '',
 }
 
-// 多选数据
+const total = ref(0)
+const page = ref(1)
+const limit = ref(10)
+
+const type = ref('')
+const searchInfo = ref('')
+const currentRow = ref({})
 const multipleSelection = ref([])
 
 // 获取列表数据
@@ -410,7 +412,6 @@ const getTableData = async() => {
     console.log(e)
   }
 }
-
 // 获取定位数据
 const getLocateTable = async() => {
   try {
@@ -426,7 +427,7 @@ const getLocateTable = async() => {
     console.log(e)
   }
 }
-
+// 删除数据
 const deleteTableData = async(id) => {
   try {
     const res = await DeletePackingTable({ UniqId: id })
@@ -438,7 +439,6 @@ const deleteTableData = async(id) => {
   }
 }
 
-// 左侧树结构点击
 const handleNodeClick = (node, check) => {
   if (node.params) {
     params.date = node.params.date
@@ -450,61 +450,55 @@ const handleNodeClick = (node, check) => {
 }
 
 // 定位
-function handleSearch() {
-  console.log(searchInfo.value)
+const handleSearch = () => {
   params.gdbh = searchInfo.value
   params.type = 'getLocateTable'
   page.value = 1
   getLocateTable()
 }
 
-// 删除方法
-const handleSelectionChange = (val) => {
-  multipleSelection.value = val
+// 查改
+const handleShowDetail = () => {
+  type.value = '查改'
+  getTableInfo(currentRow.value?.UniqId)
 }
 
+// 删除
 const handleDelete = () => {
-  console.log(multipleSelection.value)
-  if (multipleSelection.value.length === 1) {
-    ElMessageBox.confirm(
-      `确认删除这条数据么?`,
-      '警告',
-      {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning',
-      }
-    )
-      .then(async() => {
-        const ret = await deleteTableData(multipleSelection.value[0].UniqId)
-        console.log(ret)
-        if (ret === 0) {
-          ElMessage({
-            type: 'success',
-            message: '删除成功',
-          })
-        } else {
-          ElMessage({
-            type: 'error',
-            message: '删除失败',
-          })
-        }
-      })
-      .catch(() => {
+  console.log(currentRow.value)
+  ElMessageBox.confirm(
+    `确认删除这条数据么?`,
+    '警告',
+    {
+      confirmButtonText: '确认',
+      cancelButtonText: '取消',
+      type: 'warning',
+    }
+  )
+    .then(async() => {
+      const ret = await deleteTableData(currentRow.value?.UniqId)
+      console.log(ret)
+      if (ret === 0) {
         ElMessage({
-          type: 'info',
-          message: '取消删除',
+          type: 'success',
+          message: '删除成功',
         })
+      } else {
+        ElMessage({
+          type: 'error',
+          message: '删除失败',
+        })
+      }
+    })
+    .catch(() => {
+      ElMessage({
+        type: 'info',
+        message: '取消删除',
       })
-  } else {
-    ElMessage({
-      type: 'info',
-      message: '仅支持单条数据删除',
     })
-  }
 }
 
-// 分页设置
+// 分页
 const handleSizeChange = () => {
   switch (params.type) {
     case 'getTableData':
@@ -517,8 +511,6 @@ const handleSizeChange = () => {
       break
   }
 }
-
-// 页面跳转
 const handleCurrentChange = () => {
   switch (params.type) {
     case 'getTableData':
@@ -531,8 +523,9 @@ const handleCurrentChange = () => {
       break
   }
 }
+// endregion
 
-// ============== 详情页面 ==============
+// region 详情界面
 const detailData = reactive({
   UniqId: '',
   selectIndex: 0,
@@ -547,8 +540,6 @@ const detailData = reactive({
 })
 const selectData = reactive([])
 
-// 行为控制标记(弹窗内部需要增还是改)
-const type = ref('')
 // 弹窗控制标记
 const dialogFormVisible = ref(false)
 const dialogSelectVisible = ref(false)
@@ -642,10 +633,45 @@ const updateDetailData = async() => {
   }
 }
 
-// 双击打开详情页
-function doubleClick(row, column, event) {
-  type.value = 'update'
-  getTableInfo(row.UniqId)
+// 新增数据
+const handleShowAdd = () => {
+  type.value = '新增'
+  getTableInfo(currentRow.value?.UniqId)
+}
+const addDetailData = async() => {
+  const restoredData = {
+    sys_id: params.sys_id,
+    sczl_rq: detailData.sczl_rq,
+    sczl_bh: detailData.sczl_bh,
+    // name: detailData.name,
+    sczl_bzdh: detailData.sczl_bzdh,
+    sczl_jsss: detailData.sczl_jsss,
+    sczl_冲定额: detailData.sczl_冲定额,
+    sczl_desc: detailData.sczl_desc,
+  }
+  detailData.table.forEach((item, index, array) => {
+    const num = index + 1
+    restoredData[`sczl_gdbh${num}`] = item.sczl_gdbh
+    restoredData[`sczl_yjGx${num}`] = item.sczl_yjGx
+    restoredData[`sczl_gxmc${num}`] = item.sczl_gxmc
+    // restoredData[`Gd_cpmc${num}`] = item.Gd_cpmc
+    restoredData[`sczl_cl${num}`] = item.sczl_cl
+    restoredData[`sczl_返工产量${num}`] = item.sczl_返工产量
+    restoredData[`sczl_PgCl${num}`] = item.sczl_PgCl
+    restoredData[`sczl_计产系数${num}`] = item.sczl_计产系数
+    restoredData[`sczl_Jtbh${num}`] = item.sczl_Jtbh1
+    restoredData[`sczl_dedh${num}`] = item.sczl_dedh
+  })
+  const res = await addPackingTable(restoredData)
+  console.log(restoredData)
+  console.log(res)
+  if (res.code === 0) {
+    ElMessage({
+      type: 'success',
+      message: '新增成功',
+    })
+    dialogFormVisible.value = false
+  }
 }
 
 const handleGetYg = async() => {
@@ -682,23 +708,13 @@ const handleSelectClick = (row, column, event) => {
 
 // 弹窗确定
 const enterDialog = () => {
-  switch (type.value) {
-    case 'create':
-      break
-    case 'update':
-      updateDetailData()
-      break
-
-    default:
-      break
+  if (type.value === '查改') {
+    updateDetailData()
+  } else if (type.value === '新增') {
+    addDetailData()
   }
 }
 
-// 关闭弹窗
-const closeDialog = () => {
-  dialogFormVisible.value = false
-}
-
 // 导出excel
 function handleExportExcel() {
   console.log('导出到excel')

+ 25 - 18
src/view/performance/07-otherDocuments/index.vue

@@ -8,8 +8,7 @@
             <h3>其他计件单据维护</h3>
             <el-tree
               :data="treeData"
-              :props="defaultProps"
-              highlight-current="true"
+              highlight-current
               @node-click="handleNodeClick"
             />
           </div>
@@ -32,7 +31,20 @@
                 type="primary"
                 :icon="Search"
                 @click="onSearch"
-              >搜索</el-button>
+              >定位</el-button>
+
+              <el-button
+                type="primary"
+                :icon="Search"
+                @click="handleShowDetail"
+              >查改</el-button>
+
+              <el-button
+                type="primary"
+                :icon="Search"
+                @click="onSearch"
+              >新增</el-button>
+
               <div style="margin-left: auto;">
                 <el-button
                   type="primary"
@@ -56,7 +68,8 @@
               :header-row-style="{ height: '20px' }"
               :header-cell-style="{ padding: '0px' }"
               @selection-change="handleSelectionChange"
-              @row-dblclick="doubleClick"
+              @row-click="currentRow = $event"
+              @row-dblclick="handleShowDetail"
             >
               <el-table-column
                 type="selection"
@@ -90,7 +103,7 @@
           <el-dialog
             v-model="dialogFormVisible"
             :before-close="closeDialog"
-            title="拉料计件产量维护"
+            :title="type"
             destroy-on-close
             width="800px"
           >
@@ -284,6 +297,9 @@ const tableColumns = [
   { prop: 'UniqId', label: 'UNIQID', width: '100' }
 ]
 const tableData = reactive([])
+const currentRow = ref({})
+const type = ref('')
+
 const page = ref(1)
 const total = ref(0)
 const limit = ref(10)
@@ -347,18 +363,12 @@ const detailData = reactive({})
 // 弹窗控制标记
 const dialogFormVisible = ref(false)
 
-// 双击表格操作
-const doubleClick = async(row, column, event) => {
-  type.value = 'update'
-  // const res = await getInfo({ UniqId: row.UniqId })
-  // if (res.code === 0) {
-  //   console.log(res)
-  // }
-
-  Object.assign(detailData, row)
+// 查改
+const handleShowDetail = () => {
+  type.value = '查改'
+  Object.assign(detailData, currentRow.value)
   dialogFormVisible.value = true
 }
-
 const handleYgbhEnter = async() => {
   const res = await getOtherInfo({ Sczl_bh1: detailData.Sczl_bh1 })
   if (res.code === 0) {
@@ -452,9 +462,6 @@ const onDelete = async() => {
   }
 }
 
-// 行为控制标记(弹窗内部需要增还是改)
-const type = ref('')
-
 // 更新行
 const updateCompanyFunc = async(row) => {
   const res = await findCompany({ ID: row.ID })

+ 3 - 3
src/view/performance/09-workOrderVerification/index.vue

@@ -409,12 +409,12 @@
           />
 
           <!-- 测试图表 -->
-<!--          <el-dialog
-            model-value
+          <el-dialog
+            title="【01.24 08:30】【JY01#--海德堡对开八色平版胶印机(JY08-01)】【2311116-->钻石(荷花)盒包装纸】【01--胶印】"
             fullscreen
           >
             <Shebeizhuangtai />
-          </el-dialog>-->
+          </el-dialog>
 
         </el-main>
       </el-container>

+ 89 - 14
src/view/performance/09-workOrderVerification/shebeizhuangtai.vue

@@ -32,21 +32,75 @@
           />
         </el-row>
 
+        <el-col style="height: 10vh; text-align: center; margin-top: 10px">
+          <el-button
+            class="btn-right"
+            style="background: #5B79D7;"
+          >
+            上一班次
+          </el-button>
+
+          <span
+            style="font-size: 26px;vertical-align: middle;margin: 20px"
+          >当前班次:{{ currentFrequency }}</span>
+
+          <el-button
+            class="btn-right"
+            style="background: #5B79D7;"
+          >
+            下一班次
+          </el-button>
+        </el-col>
+
       </el-col>
 
       <el-col :span="4">
-        <div>设备状态:</div>
-        <el-button>待单</el-button><br>
-        <el-button>维修</el-button><br>
-        <el-button>保养</el-button><br>
-        <el-button>测试</el-button><br>
-        <el-button>打样</el-button><br>
-        <el-button>待料</el-button><br>
-        <el-button>装版</el-button><br>
-        <el-button>生产</el-button><br>
-
+        <div
+          style="font-size: 22px; margin-left: 30px"
+        >设备状态:</div><br>
+        <el-button
+          class="btn-right"
+          :class="{ 'active': activeBtn === '待单'}"
+          @click="handleBtnActive"
+        >待单</el-button><br>
+        <el-button
+          class="btn-right"
+          :class="{ 'active': activeBtn === '维修' }"
+          @click="handleBtnActive"
+        >维修</el-button><br>
+        <el-button
+          class="btn-right"
+          :class="{ 'active': activeBtn === '保养' }"
+          @click="handleBtnActive"
+        >保养</el-button><br>
+        <el-button
+          class="btn-right"
+          :class="{ 'active': activeBtn === '测试' }"
+          @click="handleBtnActive"
+        >测试</el-button><br>
+        <el-button
+          class="btn-right"
+          :class="{ 'active': activeBtn === '打样' }"
+          @click="handleBtnActive"
+        >打样</el-button><br>
+        <el-button
+          class="btn-right"
+          :class="{ 'active': activeBtn === '待料' }"
+          @click="handleBtnActive"
+        >待料</el-button><br>
+        <el-button
+          class="btn-right"
+          :class="{ 'active': activeBtn === '装版' }"
+          @click="handleBtnActive"
+        >装版</el-button><br>
+        <el-button
+          class="btn-right"
+          :class="{ 'active': activeBtn === '生产' }"
+          @click="handleBtnActive"
+        >生产</el-button><br>
       </el-col>
     </el-row>
+
   </div>
 
 </template>
@@ -72,6 +126,14 @@ use([
 ])
 // provide(THEME_KEY, 'dark')
 
+const activeBtn = ref(null)
+const handleBtnActive = (e) => {
+  activeBtn.value = e.target.innerText
+  console.log(e.target.innerText)
+}
+
+const currentFrequency = ref('2023-01-02 08:30')
+
 const option1 = ref({
   xAxis: {
     data: ['待单', '维修', '保养', '测试', '打样', '待料', '装版', '生产'],
@@ -89,7 +151,7 @@ const option1 = ref({
     left: '8%',
     right: '2%',
     top: '22%',
-    bottom: '12%',
+    bottom: '15%',
   },
   series: {
     type: 'bar',
@@ -138,7 +200,7 @@ const option2 = ref({
     left: '8%',
     right: '2%',
     top: '22%',
-    bottom: '12%',
+    bottom: '15%',
   },
   tooltip: {
     trigger: 'axis'
@@ -168,7 +230,7 @@ const option3 = ref({
     nameGap: 5,
     nameTextStyle: {
       align: 'left',
-      verticalAlign: 'bottom',
+      verticalAlign: 'bottom'
     },
     axisLine: {
       show: true,
@@ -182,7 +244,7 @@ const option3 = ref({
     left: '8%',
     right: '2%',
     top: '22%',
-    bottom: '12%',
+    bottom: '15%',
   },
   series: {
     type: 'scatter',
@@ -209,5 +271,18 @@ const option3 = ref({
 </script>
 
 <style scoped>
+.active {
+  background-color: #528B34 !important;
+}
 
+.btn-right {
+  width: 100px;
+  height: 50px;
+  margin-bottom: 5px;
+  margin-left: 30px;
+  color: #FFFFFF;
+  background-color: #C6BEC4;
+  font-size: 20px;
+  font-style: italic;
+}
 </style>

+ 372 - 0
src/view/performance/12-orderAccounting/index.bak.vue

@@ -0,0 +1,372 @@
+<template>
+  <div>
+    <layout>
+      <layout-header>
+        <div class="">
+          <!--按钮部分-->
+          <el-form
+            ref="elSearchFormRef"
+            :inline="true"
+            class="demo-form-inline"
+            :rules="searchRule"
+            @keyup.enter="onSubmit"
+          >
+            <el-form-item>
+              <el-input
+                v-model="searchInfo"
+                placeholder="搜索产品编号或产品名称"
+                clearable
+                style="width: 180px;"
+              />
+              <el-button
+                type="primary"
+                :icon="Search"
+                class="bt"
+                @click="onSearch"
+              >定位</el-button>
+
+              <el-button
+                type="primary"
+                :icon="Download"
+                class="bt"
+                style="margin-left: auto;"
+                @click="exportExcel"
+              >导出到Excel</el-button>
+            </el-form-item>
+          </el-form>
+        </div>
+
+      </layout-header>
+
+      <layout>
+        <!--    左侧树侧形结构-->
+        <layout-sider
+          :resize-directions="['right']"
+          :width="190"
+          style="margin-right: 10px;"
+        />
+
+        <!--  右侧内容区域 -->
+        <layout-content />
+
+      </layout>
+    </layout>
+  </div>
+</template>
+
+<script setup>
+
+// 全量引入格式化工具 请按需保留
+import { ElMessage, ElMessageBox } from 'element-plus'
+import { Search, Refresh, Download } from '@element-plus/icons-vue'
+import { ref, reactive, onMounted } from 'vue'
+import { getSide, getTable } from '@/api/mes_api_gty/orderAccounting'
+import { Layout, LayoutSider, LayoutContent, LayoutHeader } from '@arco-design/web-vue'
+
+defineOptions({
+  name: '12orDerAccounting'
+})
+
+// 侧边栏数据
+const treeData = ref([])
+const getSideData = async() => {
+  const res = await getSide()
+  if (res.code === 0) {
+    const { data } = res
+    const transformedData = []
+
+    for (const [key, value] of Object.entries(data)) {
+      const [date, total] = key.split('-') // 提取日期和数量
+
+      const transformedItem = {
+        label: `${date}(工单数:${total})`,
+        children: value.map(item => ({
+          label: `${item['客户编号']}【${item['客户名称']}】(工单数:${item.total})`
+        })),
+      }
+
+      transformedData.push(transformedItem)
+    }
+    treeData.value = transformedData
+  }
+}
+
+getSideData()
+
+// 自动化生成的字典(可能为空)以及字段
+const formData = ref({
+  id: '',
+  name: '',
+  date: '',
+  group: '',
+  packingOutput: '',
+  reworkOutput: '',
+  pieceOutput: '',
+  order: '',
+  user: '',
+  createTime: '',
+  updateTime: '',
+  uniqid: '',
+})
+
+// 验证规则
+const rule = reactive({
+})
+
+const elFormRef = ref()
+const elSearchFormRef = ref()
+
+// =========== 表格控制部分 ===========
+const tableCols = [
+  { label: '工单编号', prop: 'qczl_gdbh', width: '100' },
+  { label: '印件号', prop: 'qczl_yjno', width: '100' },
+  { label: '印件名称', prop: 'Gd_cpmc', width: '400' },
+  { label: '日期', prop: 'qczl_rq', width: '100' },
+  { label: '流程单号', prop: 'qczl_num', width: '100' },
+  { label: '流程单备注', prop: 'qczl_NumDesc', width: '100' },
+  { label: '总废品', prop: 'qczl_fp', width: '100' },
+  { label: '废品1', prop: 'sl_lb1', width: '250' },
+  { label: '废品2', prop: 'sl_lb2', width: '250' },
+  { label: '废品3', prop: 'sl_lb3', width: '250' },
+  { label: '废品4', prop: 'sl_lb4', width: '250' },
+  { label: '废品5', prop: 'sl_lb5', width: '250' },
+  { label: '废品6', prop: 'sl_lb6', width: '250' },
+  { label: '废品7', prop: 'sl_lb7', width: '250' },
+  { label: '废品8', prop: 'sl_lb8', width: '250' },
+  { label: '废品9', prop: 'sl_lb9', width: '250' },
+  { label: '废品10', prop: 'sl_lb10', width: '250' },
+  { label: '废品11', prop: 'sl_lb11', width: '250' },
+  { label: '废品12', prop: 'sl_lb12', width: '250' },
+  { label: '废品13', prop: 'sl_lb13', width: '250' },
+  { label: '废品14', prop: 'sl_lb14', width: '250' },
+  { label: '废品15', prop: 'sl_lb15', width: '250' },
+  { label: '废品16', prop: 'sl_lb16', width: '250' },
+  { label: '废品17', prop: 'sl_lb17', width: '250' },
+  { label: '创建用户', prop: 'sys_id', width: '200' },
+]
+const tableData = reactive([])
+const detailData = reactive([
+  {
+    gdbh: '2311736',
+    yjgx: '01-15',
+    gxmc: '包装(圆切)',
+    yjmc: '利群(新)小《降焦改版)',
+    bzcl: '13.00',
+    fgcl: '0.00',
+    mxsl: '2500',
+    jcxs: '1.000',
+    ly: '',
+    dedh: '030002002',
+  },
+])
+const total = ref(0)
+const page = ref(1)
+const limit = ref(10)
+const searchInfo = ref('')
+const params = {
+  date: '',
+  sys_id: '',
+  page: page.value.toString(),
+  limit: limit.value.toString(),
+}
+
+const getTableData = async() => {
+  try {
+    const response = await getOrderVerificationTable(params)
+    if (response.code === 0) {
+      tableData.splice(0, tableData.length, ...response.data.rows)
+    }
+  } catch (error) {
+    console.log(error)
+  }
+}
+
+const handleNodeClick = (node, check) => {
+  if (node.params) {
+    params.date = node.params.date
+    params.sys_id = node.params.sys_id
+    total.value = node.params.total
+    getTableData()
+  }
+}
+
+// 搜索
+function onSearch() {
+
+}
+// ============== 表格控制部分结束 ===============
+
+// 获取需要的字典 可能为空 按需保留
+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
+  }
+  multipleSelection.value &&
+  multipleSelection.value.map(item => {
+    ids.push(item.ID)
+  })
+  const res = await deleteCompanyByIds({ ids })
+  if (res.code === 0) {
+    ElMessage({
+      type: 'success',
+      message: '删除成功'
+    })
+    if (tableData.value.length === ids.length && page.value > 1) {
+      page.value--
+    }
+    deleteVisible.value = false
+    getTableData()
+  }
+}
+
+// 行为控制标记(弹窗内部需要增还是改)
+const type = ref('')
+
+// 更新行
+const updateCompanyFunc = async(row) => {
+  const res = await findCompany({ ID: row.ID })
+  type.value = 'update'
+  if (res.code === 0) {
+    formData.value = res.data.recompany
+    dialogFormVisible.value = true
+  }
+}
+
+// 弹窗控制标记
+const dialogFormVisible = ref(false)
+
+// 打开弹窗
+const openDialog = () => {
+  type.value = 'create'
+  dialogFormVisible.value = true
+}
+
+// 关闭弹窗
+const closeDialog = () => {
+  dialogFormVisible.value = false
+  formData.value = {
+    address: '',
+    image: '',
+    name: '',
+  }
+}
+// 弹窗确定
+const enterDialog = async() => {
+  elFormRef.value?.validate(async(valid) => {
+    if (!valid) return
+    let res
+    switch (type.value) {
+      case 'create':
+        res = await createCompany(formData.value)
+        break
+      case 'update':
+        res = await updateCompany(formData.value)
+        break
+      default:
+        res = await createCompany(formData.value)
+        break
+    }
+    if (res.code === 0) {
+      ElMessage({
+        type: 'success',
+        message: '创建/更改成功'
+      })
+      closeDialog()
+      getTableData()
+    }
+  })
+}
+
+// 双击表格操作
+function doubleClick(row, column, event) {
+  console.log(row, column, event)
+  // updateCompanyFunc(row);
+  type.value = 'update'
+  dialogFormVisible.value = true
+}
+
+// 导出excel
+function exportExcel() {
+  console.log('导出到excel')
+}
+
+// 生命周期钩子
+onMounted(async() => {
+})
+</script>
+
+<style scoped>
+.JKWTree-container {
+  display: flex;
+}
+
+.JKWTree-tree {
+  width: 300px;
+  background-color: #fff;
+  padding: 10px;
+  margin-right: 20px;
+}
+
+.JKWTree-tree h3 {
+  font-size: 15px;
+  font-weight: 700;
+  margin: 10px 0;
+}
+
+.JKWTree-content {
+  flex: 1;
+}
+
+/* 选中某行时的背景色 */
+:deep(.el-table__body tr.current-row) > td {
+  background: #ff80ff !important;
+}
+</style>
+<style scoped>
+:deep(.el-table td .cell) {
+  line-height: 20px !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>

+ 144 - 160
src/view/performance/12-orderAccounting/index.vue

@@ -1,13 +1,16 @@
 <template>
   <div>
-    <!-- 左侧树形结构 -->
     <el-container>
+      <!-- 左侧树形结构 -->
       <el-scrollbar max-height="80vh">
         <el-aside width="280px">
           <div class="JKWTree-tree">
             <h3>工单超节损核算</h3>
-            <el-tree :data="treeData" :props="defaultProps" highlight-current="true"
-              @node-click="handleNodeClick"></el-tree>
+            <el-tree
+              :data="treeData"
+              highlight-current
+              @node-click="handleNodeClick"
+            />
           </div>
         </el-aside>
       </el-scrollbar>
@@ -15,126 +18,86 @@
       <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-input
+                  v-model="searchInfo"
+                  placeholder="输入工单编号或产品名称"
+                />
               </el-row>
-              <!-- 按钮区域 -->
-              <el-button type="primary" :icon="Search" @click="onSearch">搜索</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>
+              <el-button
+                type="primary"
+                :icon="Search"
+                @click="onSearch"
+              >定位</el-button>
+
+              <el-button
+                type="primary"
+                :icon="Download"
+                style="margin-left: auto;"
+                @click="exportExcel"
+              >导出到Excel</el-button>
             </div>
             <!-- 数据展示 -->
-            <el-table ref="multipleTable" style="width: 100%;height:30vh;" tooltip-effect="dark" :data="tableData"
-              row-key="ID" highlight-current-row="true" border :row-style="{ height: '20px' }"
-              :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-              :header-cell-style="{ padding: '0px' }" @selection-change="handleSelectionChange"
-              @row-dblclick="doubleClick">
-              <el-table-column type="selection" width="55" />
+            <el-table
+              style="width: 100%;height:30vh;"
+              :data="tableData"
+              row-key="ID"
+              highlight-current-row
+              border
+              :row-style="{ height: '20px' }"
+              :cell-style="{ padding: '0px' }"
+              :header-row-style="{ height: '20px' }"
+              :header-cell-style="{ padding: '0px' }"
+              @selection-change="handleSelectionChange"
+              @row-dblclick="doubleClick"
+            >
+              <el-table-column
+                type="selection"
+                width="55"
+              />
               <!-- 使用 v-for 循环渲染每一列 -->
-              <el-table-column v-for="column in tableCols" :key="column.prop" :prop="column.prop" :label="column.label"
-                :width="column.width" show-overflow-tooltip="true"></el-table-column>
+              <el-table-column
+                v-for="column in tableCols"
+                :key="column.prop"
+                :prop="column.prop"
+                :label="column.label"
+                :width="column.width"
+                show-overflow-tooltip="true"
+              />
 
             </el-table>
             <br>
-            <el-table ref="multipleTable" style="width: 100%;height: 40vh;" tooltip-effect="dark" :data="tableData"
-              row-key="ID" highlight-current-row="true" border :row-style="{ height: '20px' }"
-              :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-              :header-cell-style="{ padding: '0px' }" @selection-change="handleSelectionChange"
-              @row-dblclick="doubleClick">
-              <el-table-column type="selection" width="55" />
+            <el-table
+              style="width: 100%;height: 40vh;"
+              row-key="ID"
+              highlight-current-row
+              border
+              :row-style="{ height: '20px' }"
+              :cell-style="{ padding: '0px' }"
+              :header-row-style="{ height: '20px' }"
+              :header-cell-style="{ padding: '0px' }"
+              @selection-change="handleSelectionChange"
+              @row-dblclick="doubleClick"
+            >
+              <el-table-column
+                type="selection"
+                width="55"
+              />
               <!-- 使用 v-for 循环渲染每一列 -->
-              <el-table-column v-for="column in tableCols" :key="column.prop" :prop="column.prop" :label="column.label"
-                :width="column.width" show-overflow-tooltip="true"></el-table-column>
+              <el-table-column
+                v-for="column in tableCols"
+                :key="column.prop"
+                :prop="column.prop"
+                :label="column.label"
+                :width="column.width"
+                show-overflow-tooltip="true"
+              />
 
             </el-table>
-
-            <!-- 分页 -->
-            <!-- <div class="gva-pagination">
-              <el-pagination layout="total, sizes, prev, pager, next, jumper" :current-page="page" :page-size="limit"
-                :page-sizes="[10, 30, 50, 100]" :total="total" @current-change="handleCurrentChange"
-                @size-change="handleSizeChange" />
-            </div> -->
           </div>
           <!-- 弹出框 -->
-          <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type === 'create' ? '添加' : '修改'"
-            destroy-on-close width="1200px">
-            <!-- <el-scrollbar height="500px"> -->
-            <el-form :model="formData" label-position="left" ref="elFormRef" :rules="rule">
-
-              <el-row :gutter="20">
-                <el-col :span="4">
-                  <el-form-item label="日期" prop="id">
-                    <el-input v-model="formData.address" :clearable="true" placeholder="2023.12.14" />
-                  </el-form-item>
-                </el-col>
-                <el-col :span="6">
-                  <el-form-item label="员工编号" prop="name">
-                    <el-row :gutter="20">
-                      <el-col :span="12">
-                        <el-input v-model="formData.code" :clearable="true" placeholder="ZT01733" />
-                      </el-col>
-                      <el-col :span="12">
-                        <el-input v-model="formData.name" :clearable="true" placeholder="张玉田" />
-                      </el-col>
-                    </el-row>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="3">
-                  <el-form-item label="组别" prop="name">
-                    <el-input v-model="formData.image" :clearable="true" placeholder="A班" />
-                  </el-form-item>
-                </el-col>
-              </el-row>
-
-              <el-row :gutter="20">
-                <el-col :span="4">
-                </el-col>
-                <el-col :span="8">
-                  <el-row :gutter="20">
-                    <el-col :span="14">
-                      <el-form-item label="计时时数" prop="id">
-                        <el-input v-model="formData.address" :clearable="true" placeholder="0.00" />
-                      </el-form-item>
-                    </el-col>
-                    <el-col :span="10">
-                      <el-form-item label="冲月定额" prop="id">
-                        <el-input v-model="formData.address" :clearable="true" placeholder="是" />
-                      </el-form-item>
-                    </el-col>
-                  </el-row>
-                </el-col>
-              </el-row>
-              <el-scrollbar height="300px">
-                <el-table style="width: 100%" :data="detailData">
-                  <el-table-column prop="gdbh" label="工单编号" width="80"></el-table-column>
-                  <el-table-column prop="yjgx" label="印件工序" width="80"></el-table-column>
-                  <el-table-column prop="gxmc" label="工序名称" width="100"></el-table-column>
-                  <el-table-column prop="yjmc" label="印件名称"></el-table-column>
-                  <el-table-column prop="bzcl" label="包装产量" width="80"></el-table-column>
-                  <el-table-column prop="fgcl" label="返工产量" width="80"></el-table-column>
-                  <el-table-column prop="mxsl" label="每箱数量" width="80"></el-table-column>
-                  <el-table-column prop="jcxs" label="计产系数" width="80"></el-table-column>
-                  <el-table-column prop="ly" label="来源" width="80"></el-table-column>
-                  <el-table-column prop="dedh" label="定额代号" width="100"></el-table-column>
-                </el-table>
-              </el-scrollbar>
-
-              <el-form-item label="其他备注" prop="id" style="margin-top: 10px;">
-                <el-input v-model="formData.address" :clearable="true" placeholder="" />
-              </el-form-item>
-
-            </el-form>
-            <!-- </el-scrollbar> -->
-            <template #footer>
-              <div class="dialog-footer">
-                <el-button @click="closeDialog">取 消</el-button>
-                <el-button type="primary" @click="enterDialog">确 定</el-button>
-              </div>
-            </template>
-          </el-dialog>
 
         </el-main>
       </el-container>
@@ -144,47 +107,42 @@
 </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 { getOrderVerificationSideTable, getOrderVerificationTable } from '@/api/mes_api_gty/myapi'
+import { ref, reactive, onMounted } from 'vue'
+import { getSide, getTable } from '@/api/mes_api_gty/orderAccounting'
 
 defineOptions({
-  name: '06-packingDocuments'
+  name: '12orDerAccounting'
 })
 
-// 侧边栏数据请求
-const treeData = reactive([]);
-const getSideData = async () => {
-  const response = await getOrderVerificationSideTable();
-  if (response.code === 0) {
-    const transformedData = response.data.map(item => ({
-      label: `${item.date.replace(/-/g, '.')}【单据数: ${item.counts}张】`,
-      children: item.sys.map(sysItem => ({
-        label: `${sysItem.sys_id} 【记录数: ${sysItem.count}张】`,
-        params: {
-          date: item.date.replace(/\./g, '-'),
-          sys_id: sysItem.sys_id,
-          total: sysItem.count,
-        },
-      })),
-    }));
-    treeData.splice(0, treeData.length, ...transformedData);
+// 侧边栏数据
+const treeData = ref([])
+const getSideData = async() => {
+  const res = await getSide()
+  if (res.code === 0) {
+    const { data } = res
+    const transformedData = []
+
+    for (const [key, value] of Object.entries(data)) {
+      const [date, total] = key.split('-') // 提取日期和数量
+
+      const transformedItem = {
+        label: `${date}(工单数:${total})`,
+        children: value.map(item => ({
+          label: `${item['客户编号']}【${item['客户名称']}】(工单数:${item.total})`
+        })),
+      }
+
+      transformedData.push(transformedItem)
+    }
+    treeData.value = transformedData
   }
-};
+}
 
-getSideData();
+getSideData()
 
 // 自动化生成的字典(可能为空)以及字段
 const formData = ref({
@@ -213,7 +171,7 @@ const elSearchFormRef = ref()
 const tableCols = [
   { label: '工单编号', prop: 'qczl_gdbh', width: '100' },
   { label: '印件号', prop: 'qczl_yjno', width: '100' },
-  { label: '印件名称', prop: 'Gd_cpmc', width: '400', },
+  { label: '印件名称', prop: 'Gd_cpmc', width: '400' },
   { label: '日期', prop: 'qczl_rq', width: '100' },
   { label: '流程单号', prop: 'qczl_num', width: '100' },
   { label: '流程单备注', prop: 'qczl_NumDesc', width: '100' },
@@ -236,7 +194,7 @@ const tableCols = [
   { label: '废品16', prop: 'sl_lb16', width: '250' },
   { label: '废品17', prop: 'sl_lb17', width: '250' },
   { label: '创建用户', prop: 'sys_id', width: '200' },
-];
+]
 const tableData = reactive([])
 const detailData = reactive([
   {
@@ -263,23 +221,23 @@ const params = {
   limit: limit.value.toString(),
 }
 
-const getTableData = async () => {
+const getTableData = async() => {
   try {
-    const response = await getOrderVerificationTable(params);
+    const response = await getOrderVerificationTable(params)
     if (response.code === 0) {
-      tableData.splice(0, tableData.length, ...response.data.rows);
+      tableData.splice(0, tableData.length, ...response.data.rows)
     }
   } catch (error) {
-    console.log(error);
+    console.log(error)
   }
 }
 
 const handleNodeClick = (node, check) => {
   if (node.params) {
-    params.date = node.params.date;
-    params.sys_id = node.params.sys_id;
-    total.value = node.params.total;
-    getTableData();
+    params.date = node.params.date
+    params.sys_id = node.params.sys_id
+    total.value = node.params.total
+    getTableData()
   }
 }
 
@@ -290,7 +248,7 @@ function onSearch() {
 // ============== 表格控制部分结束 ===============
 
 // 获取需要的字典 可能为空 按需保留
-const setOptions = async () => {
+const setOptions = async() => {
 }
 
 // 获取需要的字典 可能为空 按需保留
@@ -307,7 +265,7 @@ const handleSelectionChange = (val) => {
 const deleteVisible = ref(false)
 
 // 多选删除
-const onDelete = async () => {
+const onDelete = async() => {
   const ids = []
   if (multipleSelection.value.length === 0) {
     ElMessage({
@@ -338,7 +296,7 @@ const onDelete = async () => {
 const type = ref('')
 
 // 更新行
-const updateCompanyFunc = async (row) => {
+const updateCompanyFunc = async(row) => {
   const res = await findCompany({ ID: row.ID })
   type.value = 'update'
   if (res.code === 0) {
@@ -366,8 +324,8 @@ const closeDialog = () => {
   }
 }
 // 弹窗确定
-const enterDialog = async () => {
-  elFormRef.value?.validate(async (valid) => {
+const enterDialog = async() => {
+  elFormRef.value?.validate(async(valid) => {
     if (!valid) return
     let res
     switch (type.value) {
@@ -394,20 +352,20 @@ const enterDialog = async () => {
 
 // 双击表格操作
 function doubleClick(row, column, event) {
-  console.log(row, column, event);
+  console.log(row, column, event)
   // updateCompanyFunc(row);
-  type.value = 'update';
+  type.value = 'update'
   dialogFormVisible.value = true
 }
 
 // 导出excel
 function exportExcel() {
-  console.log('导出到excel');
+  console.log('导出到excel')
 }
 
 // 生命周期钩子
-onMounted(async () => {
-});
+onMounted(async() => {
+})
 </script>
 
 <style scoped>
@@ -437,3 +395,29 @@ onMounted(async () => {
   background: #ff80ff !important;
 }
 </style>
+<style scoped>
+:deep(.el-table td .cell) {
+  line-height: 20px !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>