| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904 |
- <template>
- <div>
- <!-- 左侧树形结构 -->
- <el-container>
- <el-aside width="250px">
- <div class="JKWTree-tree">
- <h3>机器检验计件单据维护</h3>
- <el-tree :data="treeData" :props="defaultProps" highlight-current="true"
- @node-click="handleNodeClick"></el-tree>
- </div>
- </el-aside>
- <el-container>
- <el-main>
- <!-- 按钮区域 -->
- <div class="gva-table-box">
- <div class="gva-btn-list">
- <el-row :span="6">
- <el-input v-model="positionvalue" 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>
- </div>
- <!-- 数据展示 -->
- <el-table ref="multipleTable" style="width: 100%" tooltip-effect="dark" :data="tableData" row-key="ID"
- highlight-current-row="true" border @selection-change="handleSelectionChange" :show-overflow-tooltip="true" @row-dblclick="doubleClick">
- <el-table-column type="selection" width="55" />
- <el-table-column align="left" label="分类" prop="sczl_单据类型" width="120"/>
- <el-table-column align="left" label="工单印件" prop="combinedProp"width="340"/>
- <el-table-column align="left" label="印件工序" prop="combinedProp2" width="220"/>
- <el-table-column align="left" label="机台编号" prop="sczl_jtbh" width="120"/>
- <el-table-column align="left" label="机台" prop="sczl_jtbh" width="120"/>
- <el-table-column align="left" label="日期" prop="sczl_rq" width="120"/>
- <el-table-column align="left" label="计件产量" prop="sczl_cl" width="120"/>
- <el-table-column align="left" label="检验类别" prop="sczl_检验类别" width="120"/>
- <el-table-column align="left" label="废品率系数" prop="sczl_废品率系数" width="120"/>
- <el-table-column align="left" label="日定额" prop="日定额" width="120"/>
- <el-table-column align="left" label="员工姓名1" prop="sczl_bh1_name" width="120"/>
- <el-table-column align="left" label="员工姓名2" prop="sczl_bh2_name"width="120" />
- <el-table-column align="left" label="员工姓名3" prop="sczl_bh3_name" width="120"/>
- <el-table-column align="left" label="员工姓名4" prop="sczl_bh4_name"width="120" />
- <el-table-column align="left" label="班组代号" prop="sczl_bzdh" width="120"/>
- <el-table-column align="left" label="千件工价" prop="千件工价" width="120"/>
- <el-table-column align="left" label="日通电工时" prop="sczl_设备运行工时" width="120"/>
- <el-table-column align="left" label="流程单备注" prop="qczl_NumDesc" width="120"/>
- <el-table-column align="left" label="创建用户" prop="sys_id" width="120"/>
- <el-table-column align="left" label="创建时间" prop="sys_rq" width="160"/>
- <el-table-column align="left" label="修改时间" prop="mod_rq" width="160"/>
- <el-table-column align="left" label="UNIQID" prop="UniqId" width="120"/>
- </el-table>
- <!-- 分页 -->
- <div class="gva-pagination">
- <el-pagination layout="total, sizes, prev, pager, next, jumper" v-model:current-page="page"
- v-model: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.sczl_rq" :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.sczl_bzdh" :clearable="true" placeholder="ZT01733" />
- </el-col>
- </el-row>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="20">
- <el-row :gutter="20">
- <el-col :span="5">
- <el-form-item label="工单编号" prop="id">
- <el-input v-model="formData.sczl_gdbh" :clearable="true" placeholder="0.00" />
- </el-form-item>
- </el-col>
- <el-col :span="5">
- <el-input v-model="formData.sczl_yjgx" :clearable="true" placeholder="是" />
- </el-col>
- <el-col :span="5">
- <el-input v-model="formData.sczl_gxmc" :clearable="true" placeholder="是" />
- </el-col>
- <el-col :span="5">
- <el-input v-model="formData.yj_yjmc" :clearable="true" placeholder="是" />
- </el-col>
- </el-row>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="4">
- <el-form-item label="机台编号" prop="id">
- <el-input v-model="formData.sczl_jtbh" :clearable="true" placeholder="2023.12.14" />
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="检验类型" prop="id">
- <el-input v-model="formData.sczl_单据类型" :clearable="true" placeholder="ZT01733" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-col>
- <el-col :span="3">
- <el-form-item label="检验类别" prop="name">
- <el-input v-model="formData.sczl_检验类别" :clearable="true" placeholder="A班" />
- </el-form-item>
- </el-col>
- <el-col :span="3">
- <el-form-item label="废品率系数" prop="name">
- <el-input v-model="formData.sczl_废品率系数" :clearable="true" placeholder="A班" />
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="20">
- <el-col :span="4">
- <el-form-item label="计件箱数" prop="id">
- <el-input v-model="formData.sczl_cl" :clearable="true" placeholder="2023.12.14" />
- </el-form-item>
- </el-col>
- <el-col :span="3">
- <el-form-item label="每箱数量" prop="name">
- <el-input v-model="formData.sczl_PgCl" :clearable="true" placeholder="A班" />
- </el-form-item>
- </el-col>
- <el-col :span="3">
- <el-form-item label="定额代号" prop="name">
- <el-input v-model="formData.sczl_dedh" :clearable="true" placeholder="A班" />
- </el-form-item>
- </el-col>
- </el-row>
-
-
- <el-row :gutter="1">
- <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="1">
- <el-input v-model="formData.流程单号1" :clearable="true" placeholder="ZT01733" />
- </el-col>
- <el-col :span="1">
- <el-input v-model="formData.流程单号2" :clearable="true" placeholder="ZT01733" />
- </el-col>
- <el-col :span="1">
- <el-input v-model="formData.流程单号3" :clearable="true" placeholder="ZT01733" />
- </el-col>
-
- <el-col :span="1">
- <el-input v-model="formData.流程单号4" :clearable="true" placeholder="ZT01733" />
- </el-col>
- <el-col :span="1">
- <el-input v-model="formData.流程单号5" :clearable="true" placeholder="ZT01733" />
- </el-col>
- <el-col :span="1">
- <el-input v-model="formData.流程单号6" :clearable="true" placeholder="ZT01733" />
- </el-col>
- <el-col :span="1">
- <el-input v-model="formData.流程单号7" :clearable="true" placeholder="ZT01733" />
- </el-col>
- <el-col :span="1">
- <el-input v-model="formData.流程单号8" :clearable="true" placeholder="ZT01733" />
- </el-col>
- <el-col :span="1">
- <el-input v-model="formData.流程单号9" :clearable="true" placeholder="ZT01733" />
- </el-col>
- <el-col :span="6">
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="备注" prop="id">
- <el-input v-model="formData.qczl_NumDesc" :clearable="true" placeholder="ZT01733" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-col>
- </el-row>
-
-
- <el-row :gutter="20">
- <el-col :span="4">
- <el-form-item label="换模补产工时" prop="id">
- <el-input v-model="formData.sczl_装版工时" :clearable="true" placeholder="2023.12.14" />
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="设备保养工时" prop="id">
- <el-input v-model="formData.sczl_保养工时" :clearable="true" placeholder="ZT01733" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-col>
- <el-col :span="3">
- <el-form-item label="异常停机" prop="name">
- <el-input v-model="formData.sczl_异常停机工时" :clearable="true" placeholder="A班" />
- </el-form-item>
- </el-col>
- <el-col :span="3">
- <el-form-item label="设备通电工时" prop="name">
- <el-input v-model="formData.sczl_设备运行工时" :clearable="true" placeholder="A班" />
- </el-form-item>
- </el-col>
- </el-row>
-
-
-
-
- <!-- <el-row :gutter="10" style="margin-top: 10px;">
- <el-col :span="2">
- <span>组员信息</span>
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh1" :clearable="true" placeholder="ZI00401" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh2" :clearable="true" placeholder="瞿春生" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh3" :clearable="true" placeholder="11.0" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh4" :clearable="true" placeholder="打包废纸" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh5" :clearable="true" placeholder="是" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh6" :clearable="true" placeholder="ZI00401" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh7" :clearable="true" placeholder="瞿春生" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh8" :clearable="true" placeholder="11.0" />
- </el-col>
- </el-row>
- </el-form> -->
-
- <!-- <el-row :gutter="10" style="margin-top: 10px;">
- <el-col :span="2">
-
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh1_name" :clearable="true" placeholder="ZI00401" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh2_name" :clearable="true" placeholder="瞿春生" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh3_name" :clearable="true" placeholder="11.0" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh4_name" :clearable="true" placeholder="打包废纸" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh5_name" :clearable="true" placeholder="是" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh6_name" :clearable="true" placeholder="ZI00401" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh7_name" :clearable="true" placeholder="瞿春生" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.sczl_bh8_name" :clearable="true" placeholder="11.0" />
- </el-col>
- </el-row> -->
-
- <!-- <el-row :gutter="10" style="margin-top: 10px;">
- <el-col :span="2">
-
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.流程单号1" :clearable="true" placeholder="ZI00401" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.流程单号1" :clearable="true" placeholder="瞿春生" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.流程单号1" :clearable="true" placeholder="11.0" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.流程单号1" :clearable="true" placeholder="打包废纸" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.流程单号1" :clearable="true" placeholder="是" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.流程单号1" :clearable="true" placeholder="ZI00401" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.流程单号1" :clearable="true" placeholder="瞿春生" />
- </el-col>
- <el-col :span="2">
- <el-input v-model="formData.流程单号1" :clearable="true" placeholder="11.0" />
- </el-col>
- </el-row> -->
-
-
- <el-table
- :data="detailData.table"
- border
- tooltip-effect="dark"
- :row-style="{ height: '20px' }"
- :cell-style="{ padding: '0px' }"
- :header-row-style="{ height: '20px' }"
- :header-cell-style="{ padding: '0px' }"
- >
- <el-form-item label="11111" prop="name">
- <el-input v-model="formData.sczl_设备运行工时" :clearable="true" placeholder="A班" />
- </el-form-item>
- <el-table-column label="组员信息">
- <template #default="{ row }">
- <el-input v-model="row.Gd_cpmc" />
- </template>
- </el-table-column>
- <el-table-column label="组员信息">
- <template #default="{ row }">
- <el-input v-model="row.Gd_cpmc" />
- </template>
- </el-table-column>
- <el-table-column label="组员信息">
- <template #default="{ row }">
- <el-input v-model="row.Gd_cpmc" />
- </template>
- </el-table-column>
- <el-table-column label="组员信息">
- <template #default="{ row }">
- <el-input v-model="row.Gd_cpmc" />
- </template>
- </el-table-column>
- <el-table-column label="组员信息">
- <template #default="{ row }">
- <el-input v-model="row.Gd_cpmc" />
- </template>
- </el-table-column>
- <el-table-column label="组员信息">
- <template #default="{ row }">
- <el-input v-model="row.Gd_cpmc" />
- </template>
- </el-table-column>
- <el-table-column label="组员信息">
- <template #default="{ row }">
- <el-input v-model="row.Gd_cpmc" />
- </template>
- </el-table-column>
- <el-table-column label="组员信息">
- <template #default="{ row }">
- <el-input v-model="row.Gd_cpmc" />
- </template>
- </el-table-column>
- </el-table>
-
-
-
- </el-form>
- <el-row :gutter="20">
- <el-col :span="20">
- <el-form-item label="其他备注" prop="id">
- <el-input v-model="formData.流程单号" :clearable="true" placeholder="2023.12.14" />
- </el-form-item>
- </el-col>
- </el-row>
-
- <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>
- </el-container>
- </div>
- </template>
- <script setup>
- import {
- getMachineCount,
- getDateMachine,
- machineLocate,
- MachineInfo,
- getYg
- } from '@/api/jixiaoguanli/jitairibaobiao'
- // 全量引入格式化工具 请按需保留
- 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 { getPackingSideTable, getPackingTable } from '@/api/mes_api_gty/myapi'
- defineOptions({
- name: '06-packingDocuments'
- })
- // 侧边栏数据请求
- const treeData = reactive([]);
- const getTabdata = async () => {
- //接口调用函数
- const response = await getMachineCount();
- console.log(response)
-
- const transformedData = response.data.map(item => ({
- label: `${item.sys_rq.replace(/-/g, '.')}【单据数: ${item.count}张】`,
- children: item.sys.map(sysItem => ({
- label: `${sysItem.sys_id} 【记录数: ${sysItem.count}张】`,
- params: {
- date: item.sys_rq.replace(/\./g, '-'),
- sys_id: sysItem.sys_id,
- total: sysItem.count,
- },
- })),
- }));
- treeData.splice(0, treeData.length, ...transformedData);
- }
- getTabdata();
- // 自动化生成的字典(可能为空)以及字段
- const formData = ref({
- sczl_gdbh: '',
- sczl_yjgx: '',
- sczl_gxmc: '',
- sczl_jtbh: '',
- sczl_bzdh: '',
- sczl_rq: '',
- sczl_cl: '',
- sczl_PgCl: '',
- sczl_单据类型: '',
- sczl_dedh: '',
- sczl_装版工时: '',
- sczl_保养工时: '',
- sczl_异常停机工时: '',
- sczl_设备运行工时: '',
- sczl_废品率系数: '',
- sczl_检验类别: '',
- sczl_bh1: '',
- sczl_bh2: '',
- sczl_bh3: '',
- sczl_bh4: '',
- sczl_bh5: '',
- sczl_bh6: '',
- sczl_bh7: '',
- sczl_bh8: '',
- 流程单号 :'',
- 流程单号2: '',
- 流程单号3: '',
- 流程单号4: '',
- 流程单号5: '',
- 流程单号6: '',
- 流程单号7: '',
- 流程单号8: '',
- 流程单号9:'',
- qczl_NumDesc:'',
- sczl_desc:'',
- sczl_bh1_name:'',
- sczl_bh2_name:'',
- sczl_bh3_name: '',
- sczl_bh4_name: '',
- sczl_bh5_name: '',
- sczl_bh6_name: '',
- sczl_bh7_name: '',
- sczl_bh8_name: '',
- yj_yjmc: ''
- })
- // 验证规则
- const rule = reactive({
- })
- const elFormRef = ref()
- const elSearchFormRef = ref()
- // =========== 表格控制部分 ===========
- 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',
- },
- {
- gdbh: '2311736',
- yjgx: '01-15',
- gxmc: '包装(圆切)',
- yjmc: '利群(新)小《降焦改版)',
- bzcl: '13.00',
- fgcl: '0.00',
- mxsl: '2500',
- jcxs: '1.000',
- ly: '',
- dedh: '030002002',
- },
- {
- gdbh: '2311736',
- yjgx: '01-15',
- gxmc: '包装(圆切)',
- yjmc: '利群(新)小《降焦改版)',
- bzcl: '13.00',
- fgcl: '0.00',
- mxsl: '2500',
- jcxs: '1.000',
- ly: '',
- dedh: '030002002',
- },
- {
- gdbh: '2311736',
- yjgx: '01-15',
- gxmc: '包装(圆切)',
- yjmc: '利群(新)小《降焦改版)',
- bzcl: '13.00',
- fgcl: '0.00',
- mxsl: '2500',
- jcxs: '1.000',
- ly: '',
- dedh: '030002002',
- },
- {
- gdbh: '2311736',
- yjgx: '01-15',
- gxmc: '包装(圆切)',
- yjmc: '利群(新)小《降焦改版)',
- bzcl: '13.00',
- fgcl: '0.00',
- mxsl: '2500',
- jcxs: '1.000',
- ly: '',
- dedh: '030002002',
- },
- {
- gdbh: '2311736',
- yjgx: '01-15',
- gxmc: '包装(圆切)',
- yjmc: '利群(新)小《降焦改版)',
- bzcl: '13.00',
- fgcl: '0.00',
- mxsl: '2500',
- jcxs: '1.000',
- ly: '',
- dedh: '030002002',
- },
- {
- gdbh: '2311736',
- yjgx: '01-15',
- gxmc: '包装(圆切)',
- yjmc: '利群(新)小《降焦改版)',
- bzcl: '13.00',
- fgcl: '0.00',
- mxsl: '2500',
- jcxs: '1.000',
- ly: '',
- dedh: '030002002',
- },
- {
- gdbh: '2311736',
- yjgx: '01-15',
- gxmc: '包装(圆切)',
- yjmc: '利群(新)小《降焦改版)',
- bzcl: '13.00',
- fgcl: '0.00',
- mxsl: '2500',
- jcxs: '1.000',
- ly: '',
- dedh: '030002002',
- },
- {
- gdbh: '2311736',
- yjgx: '01-15',
- gxmc: '包装(圆切)',
- yjmc: '利群(新)小《降焦改版)',
- bzcl: '13.00',
- fgcl: '0.00',
- mxsl: '2500',
- jcxs: '1.000',
- ly: '',
- dedh: '030002002',
- },
- {
- 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 = {
- type: '',
- date: '',
- sys_id: '',
- gdbh: '',
- }
- // 分页设置
- const handleSizeChange = (val) => {
- switch (params.type) {
- case 'getTableData':
- getTableData()
- break
- case 'getLocateTable':
- GetmachineLocate()
- break
- default:
- break
- }
- }
- // 页面跳转
- const handleCurrentChange = (val) => {
- switch (params.type) {
- case 'getTableData':
- getTableData()
- break
- case 'getLocateTable':
- GetmachineLocate()
- break
- default:
- break
- }
- }
- const getTableData = async() => {
-
-
- const response = await getDateMachine({
- date: params.date, sys_id: params.sys_id,
- page: page.value.toString(), limit: limit.value.toString(),
- })
- if (response.code === 0) {
- const processedData = response.data.data.map(item => {
- return {
- ...item,
- combinedProp: item.sczl_gdbh + '--'+item.yj_yjmc,
- combinedProp2: item.sczl_yjgx + '-'+item.sczl_gxmc
- };
- });
- tableData.splice(0, tableData.length, ...processedData);
- }
-
- // const response = await getDateMachine(params);
- // console.log(response)
- // if (response.code === 0) {
- // const processedData = response.data.data.map(item => {
- // return {
- // ...item,
- // combinedProp: item.sczl_gdbh + '--'+item.yj_yjmc,
- // combinedProp2: item.sczl_yjgx + '-'+item.sczl_gxmc
- // };
- // });
- // tableData.splice(0, tableData.length, ...processedData);
- // }
- }
- const GetmachineLocate = async () => {
- const response = await machineLocate({
- gdbh: params.gdbh,
- 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)
- }
-
- // const response = await machineLocate(locatevalue);
- // console.log(locatevalue)
- // console.log(response)
- // if (response.code === 0) {
- // tableData.splice(0, tableData.length, ...response.data.rows);
- // }
- }
- const GetMachineInfo = async (value) => {
- const response = await MachineInfo({UniqId:value});
- console.log(response)
- if (response.code === 0) {
- formData.value=response.data;
- }
- }
- const handleNodeClick = (node,check) => {
- //存放当前节点的nodeId
- //存放当前节点的nodeId
- if (node.params) {
- params.date = node.params.date;
- params.sys_id = node.params.sys_id;
- total.value = node.params.total;
- params.type = 'getTableData'
- page.value = 1
- getTableData();
- }
- }
- const locatevalue={
- gdbh:'',
- cpmc:'',
- page:'5',
- limit:'10',
- }
- let positionvalue=ref()
- // 搜索
- function onSearch() {
- params.gdbh = positionvalue.value
- params.type = 'getLocateTable'
- page.value = 1
- GetmachineLocate()
- }
- // ============== 表格控制部分结束 ===============
- // 获取需要的字典 可能为空 按需保留
- 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()
- }
- })
- }
- let table=ref(5);
- let lastCellValue=ref()
- // 双击表格操作
- function doubleClick(row) {
- type.value = 'update';
- dialogFormVisible.value = true
- lastCellValue= row['UniqId'];
- console.log(lastCellValue)
- table.value=lastCellValue
- GetMachineInfo(table.value)
- }
- // 导出excel
- function exportExcel() {
- console.log('导出到excel');
- }
- // 生命周期钩子
- onMounted(async () => {
- });
- </script>
- <style>
- .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;
- }
- /* 选中某行时的背景色*/
- .el-table__body tr.current-row>td {
- background: #ff80ff !important;
- /* 背景颜色 */
- }
- </style>
|