|
@@ -9,11 +9,12 @@
|
|
|
<!-- <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" :disabled="tableStates.showrgdownTable === false" @click="onartificial">月度人工维护</el-button>
|
|
|
|
|
+ <el-button type="primary" class="bt" icon="edit" :disabled="tableStates.showsdqftupTable === false" @click="onsdqft">水电气分摊批量维护</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>
|
|
@@ -44,7 +45,7 @@
|
|
|
: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="rguptableData" border row-key="ID"
|
|
:data="rguptableData" border row-key="ID"
|
|
|
- size="small"
|
|
|
|
|
|
|
+ size="small" id="up-rg"
|
|
|
:cell-class-name="gxbgCellClass"
|
|
:cell-class-name="gxbgCellClass"
|
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
|
@row-click="rguptableRowClick" :show-overflow-tooltip="true"
|
|
@row-click="rguptableRowClick" :show-overflow-tooltip="true"
|
|
@@ -66,7 +67,7 @@
|
|
|
: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="rgdowntableData" border row-key="ID"
|
|
:data="rgdowntableData" border row-key="ID"
|
|
|
- size="small"
|
|
|
|
|
|
|
+ size="small" id="down-rg"
|
|
|
: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"
|
|
@@ -92,8 +93,7 @@
|
|
|
: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="sdqzjuptableData" border row-key="ID"
|
|
:data="sdqzjuptableData" border row-key="ID"
|
|
|
-
|
|
|
|
|
- size="small"
|
|
|
|
|
|
|
+ size="small" id="up-sdqzj"
|
|
|
:cell-class-name="gxbgCellClass"
|
|
:cell-class-name="gxbgCellClass"
|
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
|
@row-click="sdqzjuptableRowClick" :show-overflow-tooltip="true"
|
|
@row-click="sdqzjuptableRowClick" :show-overflow-tooltip="true"
|
|
@@ -118,7 +118,7 @@
|
|
|
: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="sdqzjdowntableData" border row-key="ID"
|
|
:data="sdqzjdowntableData" border row-key="ID"
|
|
|
- size="small"
|
|
|
|
|
|
|
+ size="small" id="down-sdqzj"
|
|
|
: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"
|
|
@@ -141,7 +141,7 @@
|
|
|
: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="sdqftuptableData" border row-key="ID"
|
|
:data="sdqftuptableData" border row-key="ID"
|
|
|
- size="small"
|
|
|
|
|
|
|
+ size="small" id="up-sdqft"
|
|
|
:cell-class-name="gxbgCellClass"
|
|
:cell-class-name="gxbgCellClass"
|
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
|
@row-click="sdqftuptableRowClick" :show-overflow-tooltip="true"
|
|
@row-click="sdqftuptableRowClick" :show-overflow-tooltip="true"
|
|
@@ -163,7 +163,7 @@
|
|
|
: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="sdqftdowntableData" border row-key="ID"
|
|
:data="sdqftdowntableData" border row-key="ID"
|
|
|
- size="small"
|
|
|
|
|
|
|
+ size="small" id="down-sdqft"
|
|
|
: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"
|
|
@@ -171,7 +171,7 @@
|
|
|
<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 sortable align="center" label="通电工时_全部" prop="通电工时_全部" width="200" />
|
|
<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="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="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" />
|
|
@@ -207,7 +207,7 @@
|
|
|
: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="sdsuptableData" border row-key="ID"
|
|
:data="sdsuptableData" border row-key="ID"
|
|
|
- size="small"
|
|
|
|
|
|
|
+ size="small" id="up-sds"
|
|
|
:cell-class-name="gxbgCellClass"
|
|
:cell-class-name="gxbgCellClass"
|
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
highlight-current-row="true" @row-dblclick="updateCompanyFunc"
|
|
|
@row-click="sdsuptableRowClick" :show-overflow-tooltip="true"
|
|
@row-click="sdsuptableRowClick" :show-overflow-tooltip="true"
|
|
@@ -222,7 +222,7 @@
|
|
|
: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="sdsdowntableData" border row-key="ID"
|
|
:data="sdsdowntableData" border row-key="ID"
|
|
|
- size="small"
|
|
|
|
|
|
|
+ size="small" id="down-sds"
|
|
|
: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"
|
|
@@ -246,6 +246,81 @@
|
|
|
<el-table-column sortable align="center" label="创建时间" prop="Sys_Rq" width="110" />
|
|
<el-table-column sortable align="center" label="创建时间" prop="Sys_Rq" width="110" />
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog v-model="rgsjlist" title="月度车间人工维护" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
|
|
|
|
|
+ <el-button type="primary" @click="rgsjConfirm":class="{ 'confirm-btn': true, 'is-new': isNewData }">{{ isNewData ? '新增' : '更新' }}</el-button>
|
|
|
|
|
+ <el-button type="" @click="rgsjCancel">退出</el-button>
|
|
|
|
|
+ <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
|
|
|
|
|
+ <el-form-item label="年月份:" prop="currentProcess" style="margin-right: 20px; padding: 0px">
|
|
|
|
|
+ <el-input v-model="_noderq"
|
|
|
|
|
+ @keyup.enter="rgsjgetProductValue" style="width: 200px;"/>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-table ref="paichengRef"
|
|
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
|
|
+ :row-style="{ height: '0px' }"
|
|
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
|
|
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
|
|
+ style="width: 100%;height: 74vh" border tooltip-effect="dark"
|
|
|
|
|
+ :data="rgsjtableData" row-key="ID"
|
|
|
|
|
+ :cell-class-name="rgsjCellClass">
|
|
|
|
|
+ <template v-for="(item, idx) in rgsj_tableColumns">
|
|
|
|
|
+ <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
|
|
|
|
|
+ <div v-if="['一线工资总额',].includes(item.prop)">
|
|
|
|
|
+ <el-input v-model="row[item.prop]" :clearable="false"
|
|
|
|
|
+ :id="`input${idx}${$index}`" @keyup="zjfpxs_handleKeyDown($event, idx, $index, item.prop)"/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-else>{{ row[item.prop] }}</div>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog v-model="sdqftlist" title="水电气分推批量维护" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
|
|
|
|
|
+ <el-button type="primary" @click="sdqftConfirm":class="{ 'confirm-btn': true, 'is-new': isNewData }">{{ isNewData ? '新增' : '更新' }}</el-button>
|
|
|
|
|
+ <el-button type="" @click="sdqftCancel">退出</el-button>
|
|
|
|
|
+ <el-button type="primary" icon="plus" @click="add_sdqftenterDialog">新增一行</el-button>
|
|
|
|
|
+ <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
|
|
|
|
|
+ <el-form-item label="年月份:" prop="currentProcess" style="margin-right: 20px; padding: 0px">
|
|
|
|
|
+ <el-input v-model="_noderq"
|
|
|
|
|
+ @keyup.enter="sdqftgetProductValue" style="width: 200px;"/>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-table ref="paichengRef"
|
|
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
|
|
+ :row-style="{ height: '0px' }"
|
|
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
|
|
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
|
|
+ style="width: 100%;height: 74vh" border tooltip-effect="dark"
|
|
|
|
|
+ :data="sdqfttableData" row-key="ID"
|
|
|
|
|
+ :cell-class-name="sdqftCellClass">
|
|
|
|
|
+ <template v-for="(item, idx) in sdqft_tableColumns">
|
|
|
|
|
+ <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width">
|
|
|
|
|
+ <div v-if="['耗电量','单位电价','耗气量','单位气价','部门名称','科目名称'].includes(item.prop)">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="row[item.prop]"
|
|
|
|
|
+ :clearable="false"
|
|
|
|
|
+ :disabled="!row.isNew && ['部门名称','科目名称'].includes(item.prop)"
|
|
|
|
|
+ :id="`input${idx}${$index}`"
|
|
|
|
|
+ @keyup="sdqft_handleKeyDown($event, idx, $index, item.prop)"/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-else>{{ row[item.prop] }}</div>
|
|
|
|
|
+</el-table-column>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column fixed="right" label="操作" width="80">
|
|
|
|
|
+ <template #default="{ row, $index }">
|
|
|
|
|
+ <el-button @click="record_deleteRow(row,$index)" type="danger" size="small"
|
|
|
|
|
+ style="font-size: 16px;padding: 0px;width: 60px;background-color: red;">
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
</el-main>
|
|
</el-main>
|
|
|
</layout-content>
|
|
</layout-content>
|
|
|
</layout>
|
|
</layout>
|
|
@@ -258,12 +333,18 @@
|
|
|
|
|
|
|
|
import {ref, reactive} from 'vue'
|
|
import {ref, reactive} from 'vue'
|
|
|
import {hiprint} from "vue-plugin-hiprint";
|
|
import {hiprint} from "vue-plugin-hiprint";
|
|
|
|
|
+ import { useUserStore } from '@/pinia/modules/user'
|
|
|
import { exportExcelFile } from '@/utils/excel'
|
|
import { exportExcelFile } from '@/utils/excel'
|
|
|
|
|
+ import * as XLSX from 'xlsx'
|
|
|
import {GetZzTab,ArtificialAdd,ArtificialAddList,ArtificialEdit,ArtificialList,ArtificialDetailList,shuidianqiList,shuidianqiDetailList,
|
|
import {GetZzTab,ArtificialAdd,ArtificialAddList,ArtificialEdit,ArtificialList,ArtificialDetailList,shuidianqiList,shuidianqiDetailList,
|
|
|
- shuidianqifentanList,ChromaticityAdd,ChromaticityDetailAdd,ChromaticityDetailList,MonochromaticDetailList,
|
|
|
|
|
|
|
+ shuidianqifentanList,ChromaticityAdd,ChromaticityDetailAdd,ChromaticityDetailList,MonochromaticDetailList,UtilitiesList,UtilitiesAdd,shuidianqiMachineDetailList
|
|
|
} from '@/api/jixiaoguanli/caiwubaobiao'
|
|
} from '@/api/jixiaoguanli/caiwubaobiao'
|
|
|
- import {ElMessage} from "element-plus";
|
|
|
|
|
|
|
+ import {ElMessage,ElMessageBox} from "element-plus";
|
|
|
defineOptions({name: 'Company'})
|
|
defineOptions({name: 'Company'})
|
|
|
|
|
+ const userStore = useUserStore()
|
|
|
|
|
+ const _username = ref('')
|
|
|
|
|
+ _username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
|
|
|
|
|
+
|
|
|
// =========== 获取左侧树侧形结构 ===========
|
|
// =========== 获取左侧树侧形结构 ===========
|
|
|
const treeData = ref([])
|
|
const treeData = ref([])
|
|
|
const getDepartmentData = async () => {
|
|
const getDepartmentData = async () => {
|
|
@@ -348,31 +429,6 @@ console.log(node)
|
|
|
// 第二层:分类节点 (如 "202410-2、水电气直接费用")
|
|
// 第二层:分类节点 (如 "202410-2、水电气直接费用")
|
|
|
if (parts.length === 2) {
|
|
if (parts.length === 2) {
|
|
|
// const category = parts[1]
|
|
// 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;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -495,6 +551,385 @@ const sdsuptableRowClick = async (row) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const isNewData = ref(false);//新增or修改
|
|
|
|
|
+const rgsjlist = ref(false)
|
|
|
|
|
+const rgsjtableData = ref([]);
|
|
|
|
|
+const rgsj_tableColumns = ref(
|
|
|
|
|
+ [
|
|
|
|
|
+ { label: '车间', prop: '车间', width: '100' },
|
|
|
|
|
+ { label: '一线工资总额', prop: '一线工资总额', width: '140' },
|
|
|
|
|
+ { label: '创建用户', prop: '创建用户', width: '130' },
|
|
|
|
|
+ { label: '创建时间', prop: '创建时间', width: '160' },
|
|
|
|
|
+ { label: '修订时间', prop: '修订时间', width: '160' },
|
|
|
|
|
+ ]
|
|
|
|
|
+)
|
|
|
|
|
+const DEFAULT_WORKSHOPS = ['胶印车间', '凹丝印车间', '印后车间', '检验车间'];
|
|
|
|
|
+const onartificial = () => {
|
|
|
|
|
+ rgsjlist.value = true
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const rgsjgetProductValue = () => {
|
|
|
|
|
+ if(_noderq.value === ''){
|
|
|
|
|
+ rgsjtableData.value = [];
|
|
|
|
|
+ ElMessage({type: 'warning',message: '年月份输入框为空'});
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ ArtificialAddListdata();
|
|
|
|
|
+};
|
|
|
|
|
+//月度人工数据->数据获取
|
|
|
|
|
+const ArtificialAddListdata = async ()=>{
|
|
|
|
|
+ let Sys_ny = _noderq.value;
|
|
|
|
|
+ try {
|
|
|
|
|
+ const ArtificialAdddata = await ArtificialAddList({Sys_ny:Sys_ny});
|
|
|
|
|
+ if(ArtificialAdddata.data.length === 0){
|
|
|
|
|
+ ElMessage({type: 'warning',message: '该月无数据,改为新增数据'});
|
|
|
|
|
+ rgsjtableData.value = DEFAULT_WORKSHOPS.map(workshop => ({
|
|
|
|
|
+ 车间: workshop,
|
|
|
|
|
+ 一线工资总额: '',
|
|
|
|
|
+ 创建用户: '',
|
|
|
|
|
+ 创建时间: '',
|
|
|
|
|
+ 修订时间: ''
|
|
|
|
|
+}));
|
|
|
|
|
+isNewData.value = true;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ rgsjtableData.value = ArtificialAdddata.data;
|
|
|
|
|
+ isNewData.value = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error(error);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//月度人工数据【新增or更新】
|
|
|
|
|
+const rgsjConfirm = async () => {
|
|
|
|
|
+ if (isNewData.value) {
|
|
|
|
|
+ await handleAddData(); // 新增数据逻辑
|
|
|
|
|
+ } else {
|
|
|
|
|
+ await handleUpdateData(); // 更新数据逻辑
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const handleAddData = async () => {
|
|
|
|
|
+ const rawValueArray = rgsjtableData._rawValue;
|
|
|
|
|
+ const formattedData = rawValueArray.map(item => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ sys_ny: _noderq.value,
|
|
|
|
|
+ sys_id: userStore.userInfo.nickName,
|
|
|
|
|
+ sist: item.车间 !== null ? item.车间 : "",
|
|
|
|
|
+ number: item.一线工资总额 !== null ? item.一线工资总额 : "",
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(formattedData)
|
|
|
|
|
+ const ArtificialAdds = await ArtificialAdd(formattedData);
|
|
|
|
|
+ if (ArtificialAdds.code === 0) {
|
|
|
|
|
+ rgsjlist.value = false;
|
|
|
|
|
+ ElMessage({type: 'success',message: '新增成功'})
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage({type: 'error',message: '新增失败'})
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 更新数据方法
|
|
|
|
|
+const handleUpdateData = async () => {
|
|
|
|
|
+ const rawValueArray = rgsjtableData._rawValue;
|
|
|
|
|
+ const formattedData = rawValueArray.map(item => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ UniqID: item.UniqID,
|
|
|
|
|
+ number: item.一线工资总额 !== null ? item.一线工资总额 : "",
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(formattedData)
|
|
|
|
|
+ const ArtificialEdits = await ArtificialEdit(formattedData);
|
|
|
|
|
+ if (ArtificialEdits.code === 0) {
|
|
|
|
|
+ rgsjlist.value = false;
|
|
|
|
|
+ ElMessage({type: 'success',message: '更新成功'})
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage({type: 'error',message: '更新失败'})
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+//月度人工数据【退出】
|
|
|
|
|
+const rgsjCancel = () => {
|
|
|
|
|
+ rgsjlist.value = false;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+//水电气分摊
|
|
|
|
|
+
|
|
|
|
|
+const sdqftlist = ref(false)
|
|
|
|
|
+const sdqfttableData = ref([]);
|
|
|
|
|
+const sdqft_tableColumns = ref(
|
|
|
|
|
+ [
|
|
|
|
|
+ { label: '年月', prop: '年月', width: '100' },
|
|
|
|
|
+ { label: '部门名称', prop: '部门名称', width: '140' },
|
|
|
|
|
+ { label: '科目名称', prop: '科目名称', width: '130' },
|
|
|
|
|
+ { label: '耗电量', prop: '耗电量', width: '160' },
|
|
|
|
|
+ { label: '单位电价', prop: '单位电价', width: '160' },
|
|
|
|
|
+ { label: '耗气量', prop: '耗气量', width: '160' },
|
|
|
|
|
+ { label: '单位气价', prop: '单位气价', width: '160' },
|
|
|
|
|
+ ]
|
|
|
|
|
+)
|
|
|
|
|
+const SDQFT_WORKSHOPS = ['胶印车间', '凹丝印车间', '印后车间', '检验车间','制造中心','制造中心','制造中心','制造中心','制造中心','制造中心','制造中心','制造中心','制造中心'];
|
|
|
|
|
+const SDQFT_kmmc = ['待分摊总额','待分摊总额','待分摊总额','待分摊总额','废气处理(RTO)','锅炉','空压机A','空压机B','热水锅炉','真空鼓风机A','真空鼓风机B','中央空调A(6号楼)','中央空调B(5号楼)'];
|
|
|
|
|
+
|
|
|
|
|
+const onsdqft = () => {
|
|
|
|
|
+ sdqftlist.value = true
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const sdqftgetProductValue = () => {
|
|
|
|
|
+ if(_noderq.value === ''){
|
|
|
|
|
+ sdqfttableData.value = [];
|
|
|
|
|
+ ElMessage({type: 'warning',message: '年月份输入框为空'});
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ UtilitiesListdata();
|
|
|
|
|
+};
|
|
|
|
|
+//月度人工数据->数据获取
|
|
|
|
|
+const UtilitiesListdata = async ()=>{
|
|
|
|
|
+ let Sys_ny = _noderq.value;
|
|
|
|
|
+ try {
|
|
|
|
|
+ const UtilitiesListdata = await UtilitiesList({month:Sys_ny});
|
|
|
|
|
+ if(UtilitiesListdata.data.length === 0){
|
|
|
|
|
+ sdqfttableData.value = SDQFT_WORKSHOPS.map(workshop => ({
|
|
|
|
|
+ 年月: _noderq.value,
|
|
|
|
|
+ 部门名称: workshop,
|
|
|
|
|
+ 科目名称: SDQFT_kmmc,
|
|
|
|
|
+ 耗电量: '',
|
|
|
|
|
+ 单位电价: 0.690,
|
|
|
|
|
+ 耗气量: '',
|
|
|
|
|
+ 单位气价: ''
|
|
|
|
|
+}));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ sdqfttableData.value = UtilitiesListdata.data;
|
|
|
|
|
+ isNewData.value = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error(error);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//月度人工数据【更新】
|
|
|
|
|
+const sdqftConfirm = async () => {
|
|
|
|
|
+ await sdqft_handleUpdateData(); // 新增数据逻辑
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const sdqft_handleUpdateData = async () => {
|
|
|
|
|
+ const rawValueArray = sdqfttableData._rawValue;
|
|
|
|
|
+ const formattedData = rawValueArray.map(item => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ sys_ny: _noderq.value,
|
|
|
|
|
+ sys_id: userStore.userInfo.nickName,
|
|
|
|
|
+ sist: item.部门名称 !== null ? item.部门名称 : "",
|
|
|
|
|
+ 耗电量: item.耗电量 !== null ? item.耗电量 : "",
|
|
|
|
|
+ 科目名称: item.科目名称 !== null ? item.科目名称 : "",
|
|
|
|
|
+ 单位电价: item.单位电价 !== null ? item.单位电价 : "",
|
|
|
|
|
+ 耗气量: item.耗气量 !== null ? item.耗气量 : "",
|
|
|
|
|
+ 单位气价: item.单位气价 !== null ? item.单位气价 : "",
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(formattedData)
|
|
|
|
|
+ const UtilitiesAdds = await UtilitiesAdd(formattedData);
|
|
|
|
|
+ if (UtilitiesAdds.code === 0) {
|
|
|
|
|
+ sdqftlist.value = false;
|
|
|
|
|
+ ElMessage({type: 'success',message: '更新成功'})
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage({type: 'error',message: '更新失败'})
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ //新增行
|
|
|
|
|
+ const add_sdqftenterDialog = async() => {
|
|
|
|
|
+ // 创建一行空数据,字段值可以根据需求初始化
|
|
|
|
|
+ const newRow = {
|
|
|
|
|
+ '年月': _noderq.value,
|
|
|
|
|
+ '部门名称': '',
|
|
|
|
|
+ '科目名称': '',
|
|
|
|
|
+ '耗电量': '',
|
|
|
|
|
+ '单位电价': '',
|
|
|
|
|
+ '耗气量': '',
|
|
|
|
|
+ '单位气价': '',
|
|
|
|
|
+ 'isNew': true
|
|
|
|
|
+ };
|
|
|
|
|
+ if (!sdqfttableData.value || !Array.isArray(sdqfttableData.value)) {
|
|
|
|
|
+ sdqfttableData.value = []; // 重新初始化
|
|
|
|
|
+ }
|
|
|
|
|
+ // 将新增的行数据推入到表格数据中
|
|
|
|
|
+ sdqfttableData.value.push(newRow);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 删除行
|
|
|
|
|
+ const record_deleteRow = async (row, index) => {
|
|
|
|
|
+ // 使用 ElMessageBox 提示确认删除
|
|
|
|
|
+ ElMessageBox.confirm('确定删除此行数据吗?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(async () => {
|
|
|
|
|
+ // 删除当前行数据
|
|
|
|
|
+ sdqfttableData.value.splice(index, 1);
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: '删除成功'
|
|
|
|
|
+ });
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ // 取消删除
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'info',
|
|
|
|
|
+ message: '已取消删除'
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+//水电气分推【退出】
|
|
|
|
|
+const sdqftCancel = () => {
|
|
|
|
|
+ sdqftlist.value = false;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+const exportExcel = async (isSummary) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 1. 获取当前显示的表格ID
|
|
|
|
|
+ const tableId = getCurrentTableId(isSummary);
|
|
|
|
|
+ if (!tableId) {
|
|
|
|
|
+ ElMessage.warning('没有找到可导出的表格');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 2. 获取表格DOM元素
|
|
|
|
|
+ const el = document.getElementById(tableId);
|
|
|
|
|
+ if (!el) {
|
|
|
|
|
+ ElMessage.warning('表格元素不存在');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 3. 转换表格数据
|
|
|
|
|
+ const worksheet = XLSX.utils.table_to_sheet(el, { raw: true });
|
|
|
|
|
+
|
|
|
|
|
+ // 4. 智能数字类型转换
|
|
|
|
|
+ convertToNumbers(worksheet);
|
|
|
|
|
+
|
|
|
|
|
+ // 5. 创建并导出工作簿
|
|
|
|
|
+ const workbook = XLSX.utils.book_new();
|
|
|
|
|
+ XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
|
|
|
|
+
|
|
|
|
|
+ // 根据表格类型生成文件名
|
|
|
|
|
+ const fileName = generateFileName(tableId, isSummary);
|
|
|
|
|
+ XLSX.writeFile(workbook, fileName);
|
|
|
|
|
+
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('导出失败:', error);
|
|
|
|
|
+ ElMessage.error('导出数据失败: ' + error.message);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 获取当前应该导出的表格ID
|
|
|
|
|
+const getCurrentTableId = (isSummary) => {
|
|
|
|
|
+ // 特殊处理:只有一个表格的情况(其他待摊费用)
|
|
|
|
|
+ if (tableStates.showqtdtTable) {
|
|
|
|
|
+ return 'single-qtdt';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 常规情况:根据按钮类型选择上下表格
|
|
|
|
|
+ const prefix = isSummary ? 'up-' : 'down-';
|
|
|
|
|
+
|
|
|
|
|
+ // 检查当前显示的表格
|
|
|
|
|
+ const visibleTables = Object.keys(tableStates).filter(key => tableStates[key]);
|
|
|
|
|
+
|
|
|
|
|
+ // 根据表格状态映射到对应的ID
|
|
|
|
|
+ const tableMap = {
|
|
|
|
|
+ showrgupTable: 'up-rg',
|
|
|
|
|
+ showrgdownTable: 'down-rg',
|
|
|
|
|
+ showsdqzjupTable: 'up-sdqzj',
|
|
|
|
|
+ showsdqzjdownTable: 'down-sdqzj',
|
|
|
|
|
+ showsdqftupTable: 'up-sdqft',
|
|
|
|
|
+ showsdqftdownTable: 'down-sdqft',
|
|
|
|
|
+ showsdsupTable: 'up-sds',
|
|
|
|
|
+ showsdsdownTable: 'down-sds'
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 找到第一个匹配的可见表格
|
|
|
|
|
+ for (const tableKey of visibleTables) {
|
|
|
|
|
+ if (tableMap[tableKey] && tableMap[tableKey].startsWith(prefix)) {
|
|
|
|
|
+ return tableMap[tableKey];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return null;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 生成导出文件名
|
|
|
|
|
+const generateFileName = (tableId, isSummary) => {
|
|
|
|
|
+ const now = new Date();
|
|
|
|
|
+ const dateStr = `${now.getFullYear()}${(now.getMonth()+1).toString().padStart(2,'0')}${now.getDate().toString().padStart(2,'0')}`;
|
|
|
|
|
+
|
|
|
|
|
+ // 从tableId提取表格类型
|
|
|
|
|
+ const tableType = tableId.split('-')[1] || '';
|
|
|
|
|
+
|
|
|
|
|
+ const typeMap = {
|
|
|
|
|
+ 'rg': '人工数据',
|
|
|
|
|
+ 'sdqzj': '水电气直接费用',
|
|
|
|
|
+ 'sdqft': '水电气分摊费用',
|
|
|
|
|
+ 'sds': '车间色度数',
|
|
|
|
|
+ 'qtdt': '其他待摊费用'
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const typeName = typeMap[tableType] || '数据';
|
|
|
|
|
+ const suffix = isSummary ? '汇总' : '明细';
|
|
|
|
|
+
|
|
|
|
|
+ return `${typeName}${suffix}_${dateStr}.xlsx`;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 智能数字类型转换(优化版)
|
|
|
|
|
+const convertToNumbers = (worksheet) => {
|
|
|
|
|
+ const range = XLSX.utils.decode_range(worksheet['!ref']);
|
|
|
|
|
+ const headerRow = range.s.r;
|
|
|
|
|
+
|
|
|
|
|
+ // 需要排除的列(表头包含这些关键词)
|
|
|
|
|
+ const excludeKeywords = ['年月', '时间', '工单', '编号', '名称', '用户'];
|
|
|
|
|
+
|
|
|
|
|
+ // 1. 先识别要排除的列
|
|
|
|
|
+ const excludeCols = [];
|
|
|
|
|
+ for (let col = range.s.c; col <= range.e.c; col++) {
|
|
|
|
|
+ const cellAddress = XLSX.utils.encode_cell({ r: headerRow, c: col });
|
|
|
|
|
+ const headerCell = worksheet[cellAddress];
|
|
|
|
|
+ if (headerCell) {
|
|
|
|
|
+ const headerText = String(headerCell.v).toLowerCase();
|
|
|
|
|
+ if (excludeKeywords.some(kw => headerText.includes(kw.toLowerCase()))) {
|
|
|
|
|
+ excludeCols.push(col);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 2. 转换数字(跳过排除列)
|
|
|
|
|
+ for (let col = range.s.c; col <= range.e.c; col++) {
|
|
|
|
|
+ if (excludeCols.includes(col)) continue;
|
|
|
|
|
+
|
|
|
|
|
+ for (let row = headerRow + 1; row <= range.e.r; row++) {
|
|
|
|
|
+ const cellAddress = XLSX.utils.encode_cell({ r: row, c: col });
|
|
|
|
|
+ if (worksheet[cellAddress]) {
|
|
|
|
|
+ const cellValue = worksheet[cellAddress].v;
|
|
|
|
|
+ const numValue = parseFloat(cellValue);
|
|
|
|
|
+
|
|
|
|
|
+ if (!isNaN(numValue)) {
|
|
|
|
|
+
|
|
|
|
|
+ worksheet[cellAddress].t = 'n';
|
|
|
|
|
+ worksheet[cellAddress].v = numValue;
|
|
|
|
|
+ // worksheet[cellAddress].z = '#,##0.00'; // 可选:设置数字格式
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 按钮事件绑定
|
|
|
|
|
+const hzToExcel = () => exportExcel(true); // 汇总导出
|
|
|
|
|
+const mxToExcel = () => exportExcel(false); // 明细导出
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
let _table_print = ref([
|
|
let _table_print = ref([
|
|
@@ -934,8 +1369,19 @@ const onforms = () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+const rgsjCellClass = ({row, column, rowIndex, columnIndex}) =>{
|
|
|
|
|
+ if (column.label === '一线工资总额') {
|
|
|
|
|
+ return 'background-plan-usage-low';
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const sdqftCellClass = ({row, column, rowIndex, columnIndex}) =>{
|
|
|
|
|
+ if (column.label === '耗电量' || column.label === '单位电价' || column.label === '耗气量'|| column.label === '单位气价' ) {
|
|
|
|
|
+
|
|
|
|
|
+ return 'background-plan-usage-low';
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -997,6 +1443,10 @@ const onforms = () => {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/*修正工单核算参数背景*/
|
|
|
|
|
+:deep(.el-table__body .background-plan-usage-low div div div) {
|
|
|
|
|
+ background: #80FA80 !important;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
/* 选中某行时的背景色 */
|
|
/* 选中某行时的背景色 */
|
|
|
:deep(.el-table__body tr.current-row) > td {
|
|
:deep(.el-table__body tr.current-row) > td {
|