|
@@ -6,14 +6,14 @@
|
|
|
<!-- 按钮部分-->
|
|
<!-- 按钮部分-->
|
|
|
<el-form ref="elSearchFormRef" class="demo-form-inline" :rules="searchRule" >
|
|
<el-form ref="elSearchFormRef" class="demo-form-inline" :rules="searchRule" >
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
- <el-input v-model="searchInfo" placeholder="搜索工单编号" clearable style="width: 200px;margin: 5px"></el-input>
|
|
|
|
|
|
|
+ <!-- <el-input v-model="searchInfo" placeholder="搜索工单编号" clearable style="width: 200px;margin: 5px"></el-input>
|
|
|
<el-button type="primary" class="bt" icon="edit" @click="onout">月度费用结构建立</el-button>
|
|
<el-button type="primary" class="bt" icon="edit" @click="onout">月度费用结构建立</el-button>
|
|
|
<el-button type="primary" class="bt" icon="edit" @click="onout">月度费用处理</el-button>
|
|
<el-button type="primary" class="bt" icon="edit" @click="onout">月度费用处理</el-button>
|
|
|
<el-button type="primary" class="bt" icon="edit" @click="onout">创建</el-button>
|
|
<el-button type="primary" class="bt" icon="edit" @click="onout">创建</el-button>
|
|
|
<el-button type="primary" class="bt" icon="edit" @click="onout">月度人工维护</el-button>
|
|
<el-button type="primary" class="bt" icon="edit" @click="onout">月度人工维护</el-button>
|
|
|
<el-button type="primary" class="bt" icon="download" @click="hzToExcel" >导出到Excel(汇总)</el-button>
|
|
<el-button type="primary" class="bt" icon="download" @click="hzToExcel" >导出到Excel(汇总)</el-button>
|
|
|
<el-button type="primary" class="bt" icon="download" @click="mxToExcel" >导出到Excel(明细)</el-button>
|
|
<el-button type="primary" class="bt" icon="download" @click="mxToExcel" >导出到Excel(明细)</el-button>
|
|
|
- <el-button type="primary" class="bt" icon="edit" @click="onforms">能耗报表</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" class="bt" icon="edit" @click="onforms">能耗报表</el-button> -->
|
|
|
|
|
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
@@ -26,7 +26,7 @@
|
|
|
<layout>
|
|
<layout>
|
|
|
<!-- 左侧树侧形结构-->
|
|
<!-- 左侧树侧形结构-->
|
|
|
<layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
|
|
<layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
|
|
|
- <div class="JKWTree-tree" style="height: 200px">
|
|
|
|
|
|
|
+ <div class="JKWTree-tree" style="height: 700px">
|
|
|
<h3>V23各月制造费用维护</h3>
|
|
<h3>V23各月制造费用维护</h3>
|
|
|
<el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick" @node-expand="handleNodeExpand">
|
|
<el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick" @node-expand="handleNodeExpand">
|
|
|
</el-tree>
|
|
</el-tree>
|
|
@@ -36,25 +36,76 @@
|
|
|
<!-- 右侧区域 -->
|
|
<!-- 右侧区域 -->
|
|
|
<layout-content >
|
|
<layout-content >
|
|
|
<el-main>
|
|
<el-main>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="gva-table-box">
|
|
|
|
|
+ <!-- 表格数据 -->
|
|
|
|
|
+ <el-table v-if="tableStates.showrgupTable"
|
|
|
|
|
+ ref="multipleTable" style="width: 100%;height: 40vh" tooltip-effect="dark"
|
|
|
|
|
+ :row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
|
|
+ :data="rguptableData" border row-key="ID"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ :cell-class-name="gxbgCellClass"
|
|
|
|
|
+ highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
|
|
|
+ @row-click="rguptableRowClick" :show-overflow-tooltip="true"
|
|
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
|
|
+ <el-table-column sortable align="center" label="年月" prop="年月" width="120" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="车间" prop="车间" width="120" />
|
|
|
|
|
+ <el-table-column align="center" label="人工分摊因子总额" prop="人工分摊因子总额" width="200" />
|
|
|
|
|
+ <el-table-column align="center" label="车间实发工资" prop="车间实发工资" width="200" />
|
|
|
|
|
+ <el-table-column align="center" label="管理人员工资实发" prop="管理人员工资实发" width="200" />
|
|
|
|
|
+ <el-table-column align="center" label="部门人员工资实发" prop="部门人员工资实发" width="200" />
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
<div class="gva-table-box">
|
|
<div class="gva-table-box">
|
|
|
<!-- 表格数据 -->
|
|
<!-- 表格数据 -->
|
|
|
- <el-table ref="multipleTable" style="width: 100%;height: 33vh" tooltip-effect="dark"
|
|
|
|
|
|
|
+ <el-table v-if="tableStates.showrgdownTable"
|
|
|
|
|
+
|
|
|
|
|
+ ref="multipleTable" style="width: 100%;height: 40vh" tooltip-effect="dark"
|
|
|
:row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
|
|
:row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
- :data="hztableData" border row-key="ID"
|
|
|
|
|
|
|
+ :data="rgdowntableData" border row-key="ID"
|
|
|
size="small"
|
|
size="small"
|
|
|
:cell-class-name="gxbgCellClass"
|
|
:cell-class-name="gxbgCellClass"
|
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
|
@row-click="tableRowClick" :show-overflow-tooltip="true"
|
|
@row-click="tableRowClick" :show-overflow-tooltip="true"
|
|
|
@selection-change="handleSelectionChange">
|
|
@selection-change="handleSelectionChange">
|
|
|
|
|
+ <el-table-column sortable align="center" label="工单编号" prop="工单编号" width="120" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="印件名称" prop="印件名称" width="300" />
|
|
|
|
|
+ <el-table-column align="center" label="印件号" prop="印件号" width="90" />
|
|
|
|
|
+ <el-table-column align="center" label="工序号" prop="工序号" width="90" />
|
|
|
|
|
+ <el-table-column align="center" label="工序名称" prop="工序名称" width="110" />
|
|
|
|
|
+ <el-table-column align="center" label="班组车头产量" prop="班组车头产量" width="160" />
|
|
|
|
|
+ <el-table-column align="center" label="工序难度系数" prop="工序难度系数" width="160" />
|
|
|
|
|
+ <!-- <el-table-column align="center" label="计件产量" prop="计件产量" width="110" /> -->
|
|
|
|
|
+ <el-table-column align="center" label="计件工资" prop="计件工资" width="110" />
|
|
|
|
|
+ <!-- <el-table-column align="center" label="人工分推因子" prop="人工分推因子" width="110" /> -->
|
|
|
|
|
+ <el-table-column align="center" label="年月" prop="年月" width="110" />
|
|
|
|
|
+ <el-table-column align="center" label="车间名称" prop="车间名称" width="110" />
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="gva-table-box">
|
|
|
|
|
+ <!-- 表格数据 -->
|
|
|
|
|
+ <el-table v-if="tableStates.showsdqzjupTable"
|
|
|
|
|
+ ref="multipleTable" style="width: 100%;height: 40vh" tooltip-effect="dark"
|
|
|
|
|
+ :row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
|
|
+ :data="sdqzjuptableData" border row-key="ID"
|
|
|
|
|
+
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ :cell-class-name="gxbgCellClass"
|
|
|
|
|
+ highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
|
|
|
+ @row-click="sdqzjuptableRowClick" :show-overflow-tooltip="true"
|
|
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
<el-table-column sortable align="center" label="部门名称" prop="部门名称" width="120" />
|
|
<el-table-column sortable align="center" label="部门名称" prop="部门名称" width="120" />
|
|
|
<el-table-column sortable align="center" label="设备编号" prop="设备编号" width="120" />
|
|
<el-table-column sortable align="center" label="设备编号" prop="设备编号" width="120" />
|
|
|
- <el-table-column align="center" label="设备名称" prop="设备名称" width="200" />
|
|
|
|
|
- <el-table-column align="center" label="耗电量" prop="耗电量" width="200" />
|
|
|
|
|
|
|
+ <el-table-column align="center" label="设备名称" prop="设备名称" width="300" />
|
|
|
|
|
+ <el-table-column align="center" label="耗电量" prop="耗电量" width="110" />
|
|
|
<el-table-column align="center" label="单位电价" prop="单位电价" width="110" />
|
|
<el-table-column align="center" label="单位电价" prop="单位电价" width="110" />
|
|
|
- <el-table-column align="center" label="耗气量" prop="耗气量" width="200" />
|
|
|
|
|
- <el-table-column align="center" label="单位气价" prop="单位气价" width="200" />
|
|
|
|
|
- <el-table-column align="center" label="直接费用合计" prop="直接费用合计" width="110" />
|
|
|
|
|
|
|
+ <el-table-column align="center" label="耗气量" prop="耗气量" width="110" />
|
|
|
|
|
+ <el-table-column align="center" label="单位气价" prop="单位气价" width="110" />
|
|
|
|
|
+ <el-table-column align="center" label="直接费用合计" prop="直接费用合计" width="120" />
|
|
|
<el-table-column align="center" label="创建用户" prop="创建用户" width="110" />
|
|
<el-table-column align="center" label="创建用户" prop="创建用户" width="110" />
|
|
|
<el-table-column align="center" label="创建时间" prop="创建时间" width="110" />
|
|
<el-table-column align="center" label="创建时间" prop="创建时间" width="110" />
|
|
|
</el-table>
|
|
</el-table>
|
|
@@ -62,52 +113,56 @@
|
|
|
|
|
|
|
|
<div class="gva-table-box">
|
|
<div class="gva-table-box">
|
|
|
<!-- 表格数据 -->
|
|
<!-- 表格数据 -->
|
|
|
- <el-table ref="multipleTable" style="width: 100%;height: 45vh" tooltip-effect="dark"
|
|
|
|
|
|
|
+ <el-table v-if="tableStates.showsdqzjdownTable"
|
|
|
|
|
+ ref="multipleTable" style="width: 100%;height: 40vh" tooltip-effect="dark"
|
|
|
:row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
|
|
:row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
- :data="mxtableData" border row-key="ID"
|
|
|
|
|
|
|
+ :data="sdqzjdowntableData" border row-key="ID"
|
|
|
size="small"
|
|
size="small"
|
|
|
:cell-class-name="gxbgCellClass"
|
|
:cell-class-name="gxbgCellClass"
|
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
|
@row-click="tableRowClick" :show-overflow-tooltip="true"
|
|
@row-click="tableRowClick" :show-overflow-tooltip="true"
|
|
|
@selection-change="handleSelectionChange">
|
|
@selection-change="handleSelectionChange">
|
|
|
<el-table-column sortable align="center" label="工单编号" prop="工单编号" width="120" />
|
|
<el-table-column sortable align="center" label="工单编号" prop="工单编号" width="120" />
|
|
|
- <el-table-column sortable align="center" label="印件名称" prop="印件名称" width="120" />
|
|
|
|
|
- <el-table-column sortable align="center" label="印件号" prop="印件号" width="200" />
|
|
|
|
|
- <el-table-column sortable align="center" label="工序号" prop="工序号" width="100" />
|
|
|
|
|
- <el-table-column sortable align="center" label="班组车头产量" prop="班组车头产量" width="100" />
|
|
|
|
|
|
|
+ <el-table-column sortable align="center" label="印件名称" prop="印件名称" width="300" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="印件号" prop="印件号" width="90" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="工序号" prop="工序号" width="90" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="班组车头产量" prop="班组车头产量" width="140" />
|
|
|
<el-table-column sortable align="center" label="计件产量" prop="计件产量" width="100" />
|
|
<el-table-column sortable align="center" label="计件产量" prop="计件产量" width="100" />
|
|
|
<el-table-column sortable align="center" label="占用机时" prop="占用机时" width="100" />
|
|
<el-table-column sortable align="center" label="占用机时" prop="占用机时" width="100" />
|
|
|
- <el-table-column sortable align="center" label="水电气分摊因子" prop="水电气分摊因子" width="100" />
|
|
|
|
|
|
|
+ <el-table-column sortable align="center" label="水电气分摊因子" prop="水电气分摊因子" width="140" />
|
|
|
<el-table-column sortable align="center" label="年月" prop="年月" width="100" />
|
|
<el-table-column sortable align="center" label="年月" prop="年月" width="100" />
|
|
|
- <el-table-column sortable align="center" label="车间名称" prop="车间名称" width="100" />
|
|
|
|
|
|
|
+ <!-- <el-table-column sortable align="center" label="车间名称" prop="车间名称" width="100" /> -->
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <el-table ref="multipleTable" style="width: 100%;height: 45vh" tooltip-effect="dark"
|
|
|
|
|
|
|
+ <el-table v-if="tableStates.showsdqftupTable"
|
|
|
|
|
+ ref="multipleTable" style="width: 100%;height: 40vh" tooltip-effect="dark"
|
|
|
:row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
|
|
:row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
- :data="mxtableData" border row-key="ID"
|
|
|
|
|
|
|
+ :data="sdqftuptableData" border row-key="ID"
|
|
|
size="small"
|
|
size="small"
|
|
|
:cell-class-name="gxbgCellClass"
|
|
:cell-class-name="gxbgCellClass"
|
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
|
- @row-click="tableRowClick" :show-overflow-tooltip="true"
|
|
|
|
|
|
|
+ @row-click="sdqftuptableRowClick" :show-overflow-tooltip="true"
|
|
|
@selection-change="handleSelectionChange">
|
|
@selection-change="handleSelectionChange">
|
|
|
<el-table-column sortable align="center" label="部门名称" prop="部门名称" width="120" />
|
|
<el-table-column sortable align="center" label="部门名称" prop="部门名称" width="120" />
|
|
|
- <el-table-column sortable align="center" label="科目名称" prop="科目名称" width="120" />
|
|
|
|
|
- <el-table-column sortable align="center" label="耗电量" prop="耗电量" width="200" />
|
|
|
|
|
|
|
+ <el-table-column sortable align="center" label="设备编号" prop="设备编号" width="120" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="设备名称" prop="设备名称" width="160" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="耗电量" prop="耗电量" width="160" />
|
|
|
<el-table-column sortable align="center" label="单位电价" prop="单位电价" width="100" />
|
|
<el-table-column sortable align="center" label="单位电价" prop="单位电价" width="100" />
|
|
|
<el-table-column sortable align="center" label="耗气量" prop="耗气量" width="100" />
|
|
<el-table-column sortable align="center" label="耗气量" prop="耗气量" width="100" />
|
|
|
<el-table-column sortable align="center" label="单位气价" prop="单位气价" width="100" />
|
|
<el-table-column sortable align="center" label="单位气价" prop="单位气价" width="100" />
|
|
|
- <el-table-column sortable align="center" label="直接费用合计" prop="直接费用合计" width="100" />
|
|
|
|
|
- <el-table-column sortable align="center" label="创建用户" prop="创建用户" width="100" />
|
|
|
|
|
|
|
+ <el-table-column sortable align="center" label="直接费用合计" prop="直接费用合计" width="130" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="创建用户" prop="创建用户" width="130" />
|
|
|
<el-table-column sortable align="center" label="创建时间" prop="创建时间" width="100" />
|
|
<el-table-column sortable align="center" label="创建时间" prop="创建时间" width="100" />
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
- <el-table ref="multipleTable" style="width: 100%;height: 45vh" tooltip-effect="dark"
|
|
|
|
|
|
|
+ <el-table v-if="tableStates.showsdqftdownTable"
|
|
|
|
|
+ ref="multipleTable" style="width: 100%;height: 40vh" tooltip-effect="dark"
|
|
|
:row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
|
|
:row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
- :data="mxtableData" border row-key="ID"
|
|
|
|
|
|
|
+ :data="sdqftdowntableData" border row-key="ID"
|
|
|
size="small"
|
|
size="small"
|
|
|
:cell-class-name="gxbgCellClass"
|
|
:cell-class-name="gxbgCellClass"
|
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
@@ -125,10 +180,11 @@
|
|
|
<el-table-column sortable align="center" label="修改时间" prop="修改时间" width="100" />
|
|
<el-table-column sortable align="center" label="修改时间" prop="修改时间" width="100" />
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
- <el-table ref="multipleTable" style="width: 100%;height: 45vh" tooltip-effect="dark"
|
|
|
|
|
|
|
+ <el-table v-if="tableStates.showqtdtTable"
|
|
|
|
|
+ ref="multipleTable" style="width: 100%;height: 80vh" tooltip-effect="dark"
|
|
|
:row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
|
|
:row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
- :data="mxtableData" border row-key="ID"
|
|
|
|
|
|
|
+ :data="qtdttableData" border row-key="ID"
|
|
|
size="small"
|
|
size="small"
|
|
|
:cell-class-name="gxbgCellClass"
|
|
:cell-class-name="gxbgCellClass"
|
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
@@ -146,6 +202,50 @@
|
|
|
<el-table-column sortable align="center" label="修改时间" prop="修改时间" width="100" />
|
|
<el-table-column sortable align="center" label="修改时间" prop="修改时间" width="100" />
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
+ <el-table v-if="tableStates.showsdsupTable"
|
|
|
|
|
+ ref="multipleTable" style="width: 100%;height: 40vh" tooltip-effect="dark"
|
|
|
|
|
+ :row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
|
|
+ :data="sdsuptableData" border row-key="ID"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ :cell-class-name="gxbgCellClass"
|
|
|
|
|
+ highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
|
|
|
+ @row-click="sdsuptableRowClick" :show-overflow-tooltip="true"
|
|
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
|
|
+ <el-table-column sortable align="center" label="年月" prop="年月" width="120" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="色度数" prop="色度数" width="180" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="车间" prop="车间" width="120" />
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table v-if="tableStates.showsdsdownTable"
|
|
|
|
|
+ ref="multipleTable" style="width: 100%;height: 40vh" tooltip-effect="dark"
|
|
|
|
|
+ :row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
|
|
+ :data="sdsdowntableData" border row-key="ID"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ :cell-class-name="gxbgCellClass"
|
|
|
|
|
+ highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
|
|
|
+ @row-click="tableRowClick" :show-overflow-tooltip="true"
|
|
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
|
|
+ <el-table-column sortable align="center" label="工单编号" prop="sczl_gdbh" width="120" />
|
|
|
|
|
+ <!-- <el-table-column sortable align="center" label="印件名称" prop="管理人员工资" width="120" /> -->
|
|
|
|
|
+ <el-table-column sortable align="center" label="印件号" prop="sczl_yjno" width="90" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="工序号" prop="sczl_gxh" width="90" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="工序名称" prop="sczl_gxmc" width="130" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="设备编号" prop="sczl_jtbh" width="100" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="班组车头产量" prop="sczl_cl" width="130" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="墨色" prop="sczl_ms" width="90" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="工序难度系数" prop="创建时间" width="130" />
|
|
|
|
|
+ <!-- <el-table-column sortable align="center" label="班组换算产量" prop="修改时间" width="100" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="计件产量" prop="科目名称" width="100" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="车头产量色度数" prop="使用部门" width="100" /> -->
|
|
|
|
|
+ <el-table-column sortable align="center" label="占用机时" prop="通电时间" width="100" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="年月" prop="年月" width="100" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="车间名称" prop="部门" width="100" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="创建用户" prop="Sys_ID" width="110" />
|
|
|
|
|
+ <el-table-column sortable align="center" label="创建时间" prop="Sys_Rq" width="110" />
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+
|
|
|
</el-main>
|
|
</el-main>
|
|
|
</layout-content>
|
|
</layout-content>
|
|
|
</layout>
|
|
</layout>
|
|
@@ -159,15 +259,247 @@
|
|
|
import {ref, reactive} from 'vue'
|
|
import {ref, reactive} from 'vue'
|
|
|
import {hiprint} from "vue-plugin-hiprint";
|
|
import {hiprint} from "vue-plugin-hiprint";
|
|
|
import { exportExcelFile } from '@/utils/excel'
|
|
import { exportExcelFile } from '@/utils/excel'
|
|
|
|
|
+ import {GetZzTab,ArtificialAdd,ArtificialAddList,ArtificialEdit,ArtificialList,ArtificialDetailList,shuidianqiList,shuidianqiDetailList,
|
|
|
|
|
+ shuidianqifentanList,ChromaticityAdd,ChromaticityDetailAdd,ChromaticityDetailList,MonochromaticDetailList,
|
|
|
|
|
+ } from '@/api/jixiaoguanli/caiwubaobiao'
|
|
|
import {ElMessage} from "element-plus";
|
|
import {ElMessage} from "element-plus";
|
|
|
defineOptions({name: 'Company'})
|
|
defineOptions({name: 'Company'})
|
|
|
// =========== 获取左侧树侧形结构 ===========
|
|
// =========== 获取左侧树侧形结构 ===========
|
|
|
-
|
|
|
|
|
|
|
+ const treeData = ref([])
|
|
|
|
|
+const getDepartmentData = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const { data } = await GetZzTab();
|
|
|
|
|
+ console.log('原始数据:', data);
|
|
|
|
|
+
|
|
|
|
|
+ // 转换数据为树形结构
|
|
|
|
|
+ treeData.value = Object.entries(data)
|
|
|
|
|
+ .map(([yearMonth, yearData]) => {
|
|
|
|
|
+ // 提取年份和月份(假设格式为YYYYMM)
|
|
|
|
|
+ const year = yearMonth.substring(0, 4);
|
|
|
|
|
+ const month = yearMonth.substring(4);
|
|
|
|
|
+
|
|
|
|
|
+ return {
|
|
|
|
|
+ label: `${year}${month}`,
|
|
|
|
|
+ value: yearMonth,
|
|
|
|
|
+ children: Object.entries(yearData).map(([category, value]) => ({
|
|
|
|
|
+ label: category, // 移除"1、"前缀
|
|
|
|
|
+ value: `${yearMonth}-${category}`,
|
|
|
|
|
+ children: Array.isArray(value)
|
|
|
|
|
+ ? value.map(item => ({
|
|
|
|
|
+ label: item,
|
|
|
|
|
+ value: `${yearMonth}-${category}-${item}`
|
|
|
|
|
+ }))
|
|
|
|
|
+ : [{ label: value, value: `${yearMonth}-${category}-value` }]
|
|
|
|
|
+ }))
|
|
|
|
|
+ };
|
|
|
|
|
+ })
|
|
|
|
|
+ // 按年月倒序排序
|
|
|
|
|
+ .sort((a, b) => b.value.localeCompare(a.value));
|
|
|
|
|
+
|
|
|
|
|
+ console.log('树形数据:', treeData.value);
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('获取数据失败:', error);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 初始化加载数据
|
|
|
|
|
+getDepartmentData();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+const tableStates = reactive({
|
|
|
|
|
+ showrgupTable: false,
|
|
|
|
|
+ showrgdownTable: false,
|
|
|
|
|
+ showsdqzjupTable: false,
|
|
|
|
|
+ showsdqzjdownTable: false,
|
|
|
|
|
+ showsdqftupTable: false,
|
|
|
|
|
+ showsdqftdownTable: false,
|
|
|
|
|
+ showqtdtTable: false,
|
|
|
|
|
+ showsdsupTable: false,
|
|
|
|
|
+ showsdsdownTable: false
|
|
|
|
|
+})
|
|
|
|
|
+const rguptableData = ref([])
|
|
|
|
|
+const rgdowntableData = ref([])
|
|
|
|
|
+const sdqzjuptableData = ref([])
|
|
|
|
|
+const sdqzjdowntableData = ref([])
|
|
|
|
|
+const sdqftuptableData = ref([])
|
|
|
|
|
+const sdqftdowntableData = ref([])
|
|
|
|
|
+const qtdttableData = ref([])
|
|
|
|
|
+const sdsuptableData = ref([])
|
|
|
|
|
+const sdsdowntableData = ref([])
|
|
|
|
|
+
|
|
|
|
|
+const _noderq = ref('')
|
|
|
|
|
+
|
|
|
|
|
+const handleNodeClick = (node) => {
|
|
|
|
|
+ // 首先重置所有表格的显示状态
|
|
|
|
|
+ Object.keys(tableStates).forEach(key => {
|
|
|
|
|
+ tableStates[key] = false
|
|
|
|
|
+ })
|
|
|
|
|
+console.log(node)
|
|
|
|
|
+ // 根据节点值判断显示哪些表格
|
|
|
|
|
+ const nodeValue = node.value // 假设node.value是类似 "202410-2、水电气直接费用-胶印车间" 的格式
|
|
|
|
|
+ const parts = nodeValue.split('-') // 分割节点值
|
|
|
|
|
+
|
|
|
|
|
+ // 第一层:年度/月份节点 (如 "202410")
|
|
|
|
|
+ if (parts.length === 1) {
|
|
|
|
|
+ // 点击月份节点,默认不显示任何表格或显示汇总表格
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 第二层:分类节点 (如 "202410-2、水电气直接费用")
|
|
|
|
|
+ if (parts.length === 2) {
|
|
|
|
|
+ // const category = parts[1]
|
|
|
|
|
+
|
|
|
|
|
+ // if (category.includes('1、月度人工数据')) {
|
|
|
|
|
+ // tableStates.showrgupTable = true
|
|
|
|
|
+ // tableStates.showrgdownTable = true
|
|
|
|
|
+ // loadRgData() // 加载人工数据
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else if (category.includes('2、水电气直接费用')) {
|
|
|
|
|
+ // tableStates.showsdqzjupTable = true
|
|
|
|
|
+ // tableStates.showsdqzjdownTable = true
|
|
|
|
|
+ // loadSdqzjData() // 加载水电气直接费用数据
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else if (category.includes('3、水电气分摊费用')) {
|
|
|
|
|
+ // tableStates.showsdqftupTable = true
|
|
|
|
|
+ // tableStates.showsdqftdownTable = true
|
|
|
|
|
+ // loadSdqftData() // 加载水电气分摊费用数据
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else if (category.includes('4、其他待摊费用')) {
|
|
|
|
|
+ // tableStates.showqtdtTable = true
|
|
|
|
|
+ // loadQtdtData() // 加载其他待摊费用数据
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else if (category.includes('5、车间色度数')) {
|
|
|
|
|
+ // tableStates.showsdsupTable = true
|
|
|
|
|
+ // tableStates.showsdsdownTable = true
|
|
|
|
|
+ // loadSdsData() // 加载车间色度数数据
|
|
|
|
|
+ // }
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 第三层:具体项目节点 (如 "202410-2、水电气直接费用-胶印车间")
|
|
|
|
|
+ if (parts.length === 3) {
|
|
|
|
|
+ const rq = parts[0]
|
|
|
|
|
+ _noderq.value = rq
|
|
|
|
|
+
|
|
|
|
|
+ const category = parts[1]
|
|
|
|
|
+ const item = parts[2]
|
|
|
|
|
+
|
|
|
|
|
+ if (category.includes('1、月度人工数据')) {
|
|
|
|
|
+ tableStates.showrgupTable = true
|
|
|
|
|
+ tableStates.showrgdownTable = true
|
|
|
|
|
+
|
|
|
|
|
+ loadRgData(rq,category,item) // 加载特定项目的人工数据
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (category.includes('2、水电气直接费用')) {
|
|
|
|
|
+ tableStates.showsdqzjupTable = true
|
|
|
|
|
+ tableStates.showsdqzjdownTable = true
|
|
|
|
|
+ loadSdqzjDetailData(rq,category,item) // 加载特定车间的水电气直接费用明细
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (category.includes('3、水电气分摊费用')) {
|
|
|
|
|
+ tableStates.showsdqftupTable = true
|
|
|
|
|
+ tableStates.showsdqftdownTable = true
|
|
|
|
|
+ loadSdqftDetailData(rq,category,item) // 加载特定项目的水电气分摊费用明细
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (category.includes('4、其他待摊费用')) {
|
|
|
|
|
+ tableStates.showqtdtTable = true
|
|
|
|
|
+ loadQtdtData(rq,category,item) // 加载特定项目的其他待摊费用明细
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ else if (category.includes('5、车间色度数')) {
|
|
|
|
|
+ tableStates.showsdsupTable = true
|
|
|
|
|
+ tableStates.showsdsdownTable = true
|
|
|
|
|
+ loadSdsDetailData(rq,category,item) // 加载特定车间的色度数明细
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 示例数据加载函数
|
|
|
|
|
+const loadRgData = async (rq,category,item) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await ArtificialList({month: rq})
|
|
|
|
|
+ rguptableData.value = res.data
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('加载人工数据失败:', error)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+const loadSdqzjDetailData = async (rq,category,item) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await shuidianqiList({month: rq,sist:item})
|
|
|
|
|
+ sdqzjuptableData.value = res.data
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('加载水电气直接数据失败:', error)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const loadSdqftDetailData = async (rq,category,item) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await shuidianqifentanList({month: rq})
|
|
|
|
|
+ sdqftuptableData.value = res.data
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('加载水电气分摊数据失败:', error)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// const loadQtdtData = async (rq,category,item) => {
|
|
|
|
|
+// try {
|
|
|
|
|
+// const res = await ArtificialList({month: rq})
|
|
|
|
|
+// rguptableData.value = res.data
|
|
|
|
|
+// } catch (error) {
|
|
|
|
|
+// console.error('加载其他分摊数据失败:', error)
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+const loadSdsDetailData = async (rq,category,item) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await ChromaticityDetailList({month: rq})
|
|
|
|
|
+ sdsuptableData.value = res.data
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('加载色度数数据失败:', error)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 人工上方数据行点击事件
|
|
|
|
|
+const rguptableRowClick = async (row) => {
|
|
|
|
|
+ console.log(row)
|
|
|
|
|
+ const res = await ArtificialDetailList({month: row.年月,sist: row.车间})
|
|
|
|
|
+ if(res.code === 0){
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ rgdowntableData.value = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+// 水电费直接上方数据行点击事件
|
|
|
|
|
+const sdqzjuptableRowClick = async (row) => {
|
|
|
|
|
+ console.log(row)
|
|
|
|
|
+ const res = await shuidianqiDetailList({month:_noderq.value,machine: row.设备编号})
|
|
|
|
|
+ if(res.code === 0){
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ sdqzjdowntableData.value = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+// 水电费分摊上方数据行点击事件
|
|
|
|
|
+// const sdqftuptableRowClick = async (row) => {
|
|
|
|
|
+// console.log(row)
|
|
|
|
|
+// const res = await ArtificialDetailList({month: row.年月,machine: row.设备编号})
|
|
|
|
|
+// if(res.code === 0){
|
|
|
|
|
+// console.log(res)
|
|
|
|
|
+// rgdowntableData.value = res.data
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// 色度数上方数据行点击事件
|
|
|
|
|
+const sdsuptableRowClick = async (row) => {
|
|
|
|
|
+ console.log(row)
|
|
|
|
|
+ const res = await MonochromaticDetailList({month: row.年月,sist: row.车间})
|
|
|
|
|
+ if(res.code === 0){
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ sdsdowntableData.value = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
let _table_print = ref([
|
|
let _table_print = ref([
|
|
|
{
|
|
{
|
|
|
- mergeRowCount: 3,
|
|
|
|
|
|
|
+ mergeRowCount: 4,
|
|
|
data: [
|
|
data: [
|
|
|
{
|
|
{
|
|
|
type: "公共课",
|
|
type: "公共课",
|
|
@@ -176,7 +508,7 @@
|
|
|
time: "",
|
|
time: "",
|
|
|
score: "",
|
|
score: "",
|
|
|
start: "",
|
|
start: "",
|
|
|
- tName2: ""
|
|
|
|
|
|
|
+ tName2: "",
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
type: "",
|
|
type: "",
|
|
@@ -227,7 +559,7 @@
|
|
|
}
|
|
}
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
- //打印小票数据
|
|
|
|
|
|
|
+ //打印数据
|
|
|
const jsondata ={
|
|
const jsondata ={
|
|
|
"panels": [{
|
|
"panels": [{
|
|
|
"index": 0,
|
|
"index": 0,
|
|
@@ -280,7 +612,7 @@
|
|
|
"top": 55.5,
|
|
"top": 55.5,
|
|
|
"height": 15,
|
|
"height": 15,
|
|
|
"width": 120,
|
|
"width": 120,
|
|
|
- "title": "2024年11月",
|
|
|
|
|
|
|
+ "title": " ",
|
|
|
"field": "riqi",
|
|
"field": "riqi",
|
|
|
"coordinateSync": false,
|
|
"coordinateSync": false,
|
|
|
"widthHeightSync": false,
|
|
"widthHeightSync": false,
|
|
@@ -326,7 +658,7 @@
|
|
|
"top": 61.5,
|
|
"top": 61.5,
|
|
|
"height": 13.5,
|
|
"height": 13.5,
|
|
|
"width": 78,
|
|
"width": 78,
|
|
|
- "title": "凹印车间",
|
|
|
|
|
|
|
+ "title": " ",
|
|
|
"right": 133.49478149414062,
|
|
"right": 133.49478149414062,
|
|
|
"bottom": 74.99740219116211,
|
|
"bottom": 74.99740219116211,
|
|
|
"vCenter": 99.74478149414062,
|
|
"vCenter": 99.74478149414062,
|
|
@@ -359,9 +691,69 @@
|
|
|
"hCenter": 143.99218368530273,
|
|
"hCenter": 143.99218368530273,
|
|
|
"tableHeaderRowHeight": 30,
|
|
"tableHeaderRowHeight": 30,
|
|
|
"tableBodyRowHeight": 30,
|
|
"tableBodyRowHeight": 30,
|
|
|
- "rowsColumnsMerge": "function (data, col, colIndex, rowIndex) {\n // 1. 获取当前行数据\n const rowData = (data.table || data)[rowIndex];\n \n // 2. 从行数据或顶层获取合并参数\n const mergeRowCount = rowData?._hiprintMergeInfo?.mergeRowCount || \n data?._hiprintOptions?.mergeRowCount || \n 0;\n \n // 3. 合并第一列\n if (colIndex === 0) {\n if (rowIndex === 0 && mergeRowCount > 1) {\n console.log(`合并第${rowIndex}行,合并${mergeRowCount}行`);\n return [mergeRowCount, 1];\n }\n if (rowIndex < mergeRowCount) {\n console.log(`隐藏第${rowIndex}行`);\n return [0, 1];\n }\n }\n \n // 4. 特殊行样式\n if (mergeRowCount > 0 && \n (rowIndex === mergeRowCount || rowIndex === mergeRowCount + 2)) {\n return {\n rowspan: 1,\n colspan: 1,\n style: {\n 'background-color': '#FFD700 !important',\n 'border': 'none !important',\n 'font-weight': 'bold !important'\n }\n };\n }\n \n // 5. 默认不合并\n return [1, 1];\n}",
|
|
|
|
|
- "cellStyle": "function (data, rowIndex, colIndex) {\n // 1. 获取合并行数\n const mergeRowCount = data._hiprint_mergeRowCount || \n (data.table && data.table._mergeRowCount) || \n 0;\n \n // 2. 特殊行样式\n if (mergeRowCount > 0 && \n (rowIndex === mergeRowCount || rowIndex === mergeRowCount + 2)) {\n return {\n 'background-color': '#FFD700 !important',\n 'border': 'none !important',\n 'font-weight': 'bold !important'\n };\n }\n return null;\n}",
|
|
|
|
|
- "rowsColumnsMergeClean": true,
|
|
|
|
|
|
|
+"rowsColumnsMerge": `function (data, col, colIndex, rowIndex) {
|
|
|
|
|
+ // 正确获取数据的方式(hiprint特定格式)
|
|
|
|
|
+ const rowData = data[rowIndex] || {};
|
|
|
|
|
+ console.log('合并行数:', data._hiprintMergeInfo.mergeRowCount); // 调试用
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // 合并逻辑(动态获取mergeRowCount)
|
|
|
|
|
+ // 从表格数据中获取mergeRowCount,而不是使用固定默认值3
|
|
|
|
|
+ const mergeRowCount = data._hiprintMergeInfo.mergeRowCount || 1; // 默认1行不合并
|
|
|
|
|
+ if (colIndex === 0) { // 只合并第一列
|
|
|
|
|
+ if (rowIndex === 0) {
|
|
|
|
|
+ return [mergeRowCount, 1]; // 首行合并
|
|
|
|
|
+ }
|
|
|
|
|
+ if (rowIndex < mergeRowCount) {
|
|
|
|
|
+ return [0, 1]; // 隐藏被合并行
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return [1, 1]; // 其他单元格不合并
|
|
|
|
|
+}`,
|
|
|
|
|
+"cellStyle": `function (data, rowIndex, colIndex) {
|
|
|
|
|
+ console.log('cellStyle called', rowIndex, colIndex); // 调试用
|
|
|
|
|
+ console.log('当前数据:', data); // 检查数据结构
|
|
|
|
|
+
|
|
|
|
|
+ // 1. 获取当前行数据
|
|
|
|
|
+ const rowData = data[rowIndex] || {};
|
|
|
|
|
+ console.log('当前行数据:', rowData); // 调试用
|
|
|
|
|
+
|
|
|
|
|
+ // 2. 特殊行样式 - 小计/合计行(整行高亮)
|
|
|
|
|
+ if (rowData.id === '小计' || rowData.id === '合计') {
|
|
|
|
|
+ console.log('匹配到小计/合计行'); // 调试用
|
|
|
|
|
+ return {
|
|
|
|
|
+ 'background-color': '#FFD700',
|
|
|
|
|
+ 'font-weight': 'bold',
|
|
|
|
|
+ 'border-top': '2px solid #333',
|
|
|
|
|
+ 'border-bottom': '2px solid #333',
|
|
|
|
|
+ '!important': true
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 3. 合并行首单元格样式(仅第一列生效)
|
|
|
|
|
+ const mergeInfo = data._hiprintMergeInfo || {};
|
|
|
|
|
+ const mergeRowCount = mergeInfo.mergeRowCount || 0;
|
|
|
|
|
+
|
|
|
|
|
+ if (colIndex === 0) {
|
|
|
|
|
+ if (rowIndex === 0 && mergeRowCount > 1) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ 'background-color': '#E3F2FD',
|
|
|
|
|
+ 'vertical-align': 'middle',
|
|
|
|
|
+ '!important': true
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ if (rowIndex < mergeRowCount && rowIndex !== 0) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ 'border': 'none',
|
|
|
|
|
+ 'background-color': 'transparent',
|
|
|
|
|
+ '!important': true
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return null;
|
|
|
|
|
+}`,
|
|
|
|
|
+"rowsColumnsMergeClean": true,
|
|
|
"tableHeaderRepeat": "first",
|
|
"tableHeaderRepeat": "first",
|
|
|
"columns": [
|
|
"columns": [
|
|
|
[{
|
|
[{
|
|
@@ -515,29 +907,29 @@ const onforms = () => {
|
|
|
template: jsondata
|
|
template: jsondata
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- // 准备打印数据(关键修改)
|
|
|
|
|
|
|
+ // 修复方案:直接将合并参数注入到每行数据
|
|
|
|
|
+ const tableData = JSON.parse(JSON.stringify(_table_print.value[0].data));
|
|
|
|
|
+ tableData.forEach((row, index) => {
|
|
|
|
|
+ row._hiprintMergeInfo = {
|
|
|
|
|
+ mergeRowCount: index === 0 ? _table_print.value[0].mergeRowCount : 0
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
const printData = {
|
|
const printData = {
|
|
|
- // 1. 保持table字段结构
|
|
|
|
|
- table: JSON.parse(JSON.stringify(_table_print.value[0].data)),
|
|
|
|
|
-
|
|
|
|
|
- // 2. 合并参数必须附加到每行数据上
|
|
|
|
|
|
|
+ table: tableData, // 使用处理后的数据
|
|
|
|
|
+ riqi: "2024年11月",
|
|
|
|
|
+ bm: "凹印车间",
|
|
|
|
|
+ // 保留顶层参数(某些版本可能需要)
|
|
|
_hiprintOptions: {
|
|
_hiprintOptions: {
|
|
|
mergeRowCount: _table_print.value[0].mergeRowCount
|
|
mergeRowCount: _table_print.value[0].mergeRowCount
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- // 3. 其他模板字段
|
|
|
|
|
- riqi: "2024年11月",
|
|
|
|
|
- bm: "凹印车间"
|
|
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- // 4. 将合并参数注入到每行数据(关键步骤)
|
|
|
|
|
- printData.table.forEach(row => {
|
|
|
|
|
- row._hiprintMergeInfo = {
|
|
|
|
|
- mergeRowCount: _table_print.value[0].mergeRowCount
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ console.log("最终打印数据:", {
|
|
|
|
|
+ table: printData.table,
|
|
|
|
|
+ mergeInfo: printData.table[0]._hiprintMergeInfo
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- console.log("最终打印数据:", JSON.stringify(printData, null, 2));
|
|
|
|
|
hiprintTemplate.print(printData);
|
|
hiprintTemplate.print(printData);
|
|
|
}
|
|
}
|
|
|
|
|
|