|
|
@@ -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>
|