|
|
@@ -3,42 +3,38 @@
|
|
|
<layout>
|
|
|
<layout-header>
|
|
|
<div class="">
|
|
|
- <!-- 按钮部分-->
|
|
|
- <el-form ref="elSearchFormRef" class="demo-form-inline" :rules="searchRule" >
|
|
|
+ <el-form ref="elSearchFormRef" class="demo-form-inline" :rules="searchRule">
|
|
|
<el-form-item>
|
|
|
- <!-- <el-input v-model="searchInfo" placeholder="搜索工单编号" clearable style="width: 200px;margin: 5px" @keyup.enter="onSubmit"></el-input>
|
|
|
- <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-form-item>
|
|
|
</el-form>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
</div>
|
|
|
</layout-header>
|
|
|
-
|
|
|
+
|
|
|
<layout>
|
|
|
- <!-- 左侧树侧形结构-->
|
|
|
<layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
|
|
|
<div class="JKWTree-tree" style="height: 200px">
|
|
|
<h3>样衣生产月份</h3>
|
|
|
- <el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick" class="treecolor">
|
|
|
- </el-tree>
|
|
|
+ <el-tree
|
|
|
+ ref="menuTreeRef"
|
|
|
+ :data="treeData"
|
|
|
+ :props="defaultProps"
|
|
|
+ node-key="id"
|
|
|
+ :default-expanded-keys="defaultExpandedKeys"
|
|
|
+ :current-node-key="currentTreeKey"
|
|
|
+ highlight-current
|
|
|
+ @node-click="handleNodeClick"
|
|
|
+ class="treecolor"
|
|
|
+ />
|
|
|
</div>
|
|
|
</layout-sider>
|
|
|
-
|
|
|
- <!-- 右侧区域 -->
|
|
|
- <layout-content >
|
|
|
+
|
|
|
+ <layout-content>
|
|
|
<el-main>
|
|
|
<div class="gva-table-box">
|
|
|
- <!-- <div style="margin-bottom: 10px; text-align: right;">
|
|
|
- <el-button size="small" type="primary" @click="addFirstRow">新增一行</el-button>
|
|
|
- </div> -->
|
|
|
- <!-- 表格数据 -->
|
|
|
<el-table ref="multipleTable" style="width: 100%;height: 70vh" 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' }"
|
|
|
- :data="tableData" border row-key="ID"
|
|
|
+ :data="tableData" border row-key="ID"
|
|
|
size="small"
|
|
|
:cell-class-name="gxbgCellClass"
|
|
|
highlight-current-row="true"
|
|
|
@@ -48,128 +44,131 @@
|
|
|
@row-dblclick="handleRowDblclick">
|
|
|
<el-table-column sortable align="center" label="客户编号" prop="客户编号" width="120">
|
|
|
<template #default="{ row }">
|
|
|
- <el-input v-if="editingCell.rowId === (row.UniqId || row.tempId) && editingCell.prop === '客户编号'"
|
|
|
+ <el-input v-if="isEditing(row, '客户编号')"
|
|
|
v-model="row.客户编号"
|
|
|
@blur="handleCellBlur(row, '客户编号')"
|
|
|
@keyup.enter="handleCellBlur(row, '客户编号')"
|
|
|
:ref="el => { if (el) el.focus() }" />
|
|
|
- <span v-else @click="handleCellClick(row, '客户编号')" class="cell-span">{{ row.客户编号 }}</span>
|
|
|
+ <div v-else class="cell-span">{{ row.客户编号 || '\u00A0' }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column sortable align="center" label="款号" prop="款号" width="120">
|
|
|
<template #default="{ row }">
|
|
|
- <el-input v-if="editingCell.rowId === (row.UniqId || row.tempId) && editingCell.prop === '款号'"
|
|
|
+ <el-input v-if="isEditing(row, '款号')"
|
|
|
v-model="row.款号"
|
|
|
@blur="handleCellBlur(row, '款号')"
|
|
|
@keyup.enter="handleCellBlur(row, '款号')"
|
|
|
:ref="el => { if (el) el.focus() }" />
|
|
|
- <span v-else @click="handleCellClick(row, '款号')" class="cell-span">{{ row.款号 }}</span>
|
|
|
+ <div v-else class="cell-span">{{ row.款号 || '\u00A0' }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column sortable align="center" label="款式" prop="款式" width="120">
|
|
|
<template #default="{ row }">
|
|
|
- <el-input v-if="editingCell.rowId === (row.UniqId || row.tempId) && editingCell.prop === '款式'"
|
|
|
+ <el-input v-if="isEditing(row, '款式')"
|
|
|
v-model="row.款式"
|
|
|
@blur="handleCellBlur(row, '款式')"
|
|
|
@keyup.enter="handleCellBlur(row, '款式')"
|
|
|
:ref="el => { if (el) el.focus() }" />
|
|
|
- <span v-else @click="handleCellClick(row, '款式')" class="cell-span">{{ row.款式 }}</span>
|
|
|
+ <div v-else class="cell-span">{{ row.款式 || '\u00A0' }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column sortable align="center" label="样办种类" prop="样办种类" width="120">
|
|
|
<template #default="{ row }">
|
|
|
- <el-input v-if="editingCell.rowId === (row.UniqId || row.tempId) && editingCell.prop === '样办种类'"
|
|
|
+ <el-input v-if="isEditing(row, '样办种类')"
|
|
|
v-model="row.样办种类"
|
|
|
@blur="handleCellBlur(row, '样办种类')"
|
|
|
@keyup.enter="handleCellBlur(row, '样办种类')"
|
|
|
:ref="el => { if (el) el.focus() }" />
|
|
|
- <span v-else @click="handleCellClick(row, '样办种类')" class="cell-span">{{ row.样办种类 }}</span>
|
|
|
+ <div v-else class="cell-span">{{ row.样办种类 || '\u00A0' }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column sortable align="center" label="做办部门" prop="做办部门" width="120">
|
|
|
<template #default="{ row }">
|
|
|
- <el-input v-if="editingCell.rowId === (row.UniqId || row.tempId) && editingCell.prop === '做办部门'"
|
|
|
+ <el-input v-if="isEditing(row, '做办部门')"
|
|
|
v-model="row.做办部门"
|
|
|
@blur="handleCellBlur(row, '做办部门')"
|
|
|
@keyup.enter="handleCellBlur(row, '做办部门')"
|
|
|
:ref="el => { if (el) el.focus() }" />
|
|
|
- <span v-else @click="handleCellClick(row, '做办部门')" class="cell-span">{{ row.做办部门 }}</span>
|
|
|
+ <div v-else class="cell-span">{{ row.做办部门 || '\u00A0' }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column sortable align="center" label="数量" prop="数量" width="100">
|
|
|
<template #default="{ row }">
|
|
|
- <el-input v-if="editingCell.rowId === (row.UniqId || row.tempId) && editingCell.prop === '数量'"
|
|
|
+ <el-input v-if="isEditing(row, '数量')"
|
|
|
v-model="row.数量"
|
|
|
@blur="handleCellBlur(row, '数量')"
|
|
|
@keyup.enter="handleCellBlur(row, '数量')"
|
|
|
:ref="el => { if (el) el.focus() }" />
|
|
|
- <span v-else @click="handleCellClick(row, '数量')" class="cell-span">{{ row.数量 }}</span>
|
|
|
+ <div v-else class="cell-span">{{ row.数量 || '\u00A0' }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column sortable align="center" label="下单日期" prop="下单日期" width="120">
|
|
|
<template #default="{ row }">
|
|
|
- <el-date-picker v-if="editingCell.rowId === (row.UniqId || row.tempId) && editingCell.prop === '下单日期'"
|
|
|
+ <el-date-picker v-if="isEditing(row, '下单日期')"
|
|
|
v-model="row.下单日期"
|
|
|
type="date"
|
|
|
value-format="YYYY-MM-DD"
|
|
|
placeholder="选择日期"
|
|
|
style="width: 100%"
|
|
|
- @blur="handleCellBlur(row, '下单日期')" />
|
|
|
- <span v-else @click="handleCellClick(row, '下单日期')" class="cell-span">{{ row.下单日期 }}</span>
|
|
|
+ @blur="handleCellBlur(row, '下单日期')"
|
|
|
+ @change="handleCellBlur(row, '下单日期')" />
|
|
|
+ <div v-else class="cell-span">{{ row.下单日期 || '\u00A0' }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column sortable align="center" label="面料进度" prop="面料进度" width="120">
|
|
|
<template #default="{ row }">
|
|
|
- <el-input v-if="editingCell.rowId === (row.UniqId || row.tempId) && editingCell.prop === '面料进度'"
|
|
|
+ <el-input v-if="isEditing(row, '面料进度')"
|
|
|
v-model="row.面料进度"
|
|
|
@blur="handleCellBlur(row, '面料进度')"
|
|
|
@keyup.enter="handleCellBlur(row, '面料进度')"
|
|
|
:ref="el => { if (el) el.focus() }" />
|
|
|
- <span v-else @click="handleCellClick(row, '面料进度')" class="cell-span">{{ row.面料进度 }}</span>
|
|
|
+ <div v-else class="cell-span">{{ row.面料进度 || '\u00A0' }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column sortable align="center" label="辅料进度" prop="辅料进度" width="120">
|
|
|
<template #default="{ row }">
|
|
|
- <el-input v-if="editingCell.rowId === (row.UniqId || row.tempId) && editingCell.prop === '辅料进度'"
|
|
|
+ <el-input v-if="isEditing(row, '辅料进度')"
|
|
|
v-model="row.辅料进度"
|
|
|
@blur="handleCellBlur(row, '辅料进度')"
|
|
|
@keyup.enter="handleCellBlur(row, '辅料进度')"
|
|
|
:ref="el => { if (el) el.focus() }" />
|
|
|
- <span v-else @click="handleCellClick(row, '辅料进度')" class="cell-span">{{ row.辅料进度 }}</span>
|
|
|
+ <div v-else class="cell-span">{{ row.辅料进度 || '\u00A0' }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column sortable align="center" label="计划交办日期" prop="计划交办日期" width="140">
|
|
|
<template #default="{ row }">
|
|
|
- <el-date-picker v-if="editingCell.rowId === (row.UniqId || row.tempId) && editingCell.prop === '计划交办日期'"
|
|
|
+ <el-date-picker v-if="isEditing(row, '计划交办日期')"
|
|
|
v-model="row.计划交办日期"
|
|
|
type="date"
|
|
|
value-format="YYYY-MM-DD"
|
|
|
placeholder="选择日期"
|
|
|
style="width: 100%"
|
|
|
- @blur="handleCellBlur(row, '计划交办日期')" />
|
|
|
- <span v-else @click="handleCellClick(row, '计划交办日期')" class="cell-span">{{ row.计划交办日期 }}</span>
|
|
|
+ @blur="handleCellBlur(row, '计划交办日期')"
|
|
|
+ @change="handleCellBlur(row, '计划交办日期')" />
|
|
|
+ <div v-else class="cell-span">{{ row.计划交办日期 || '\u00A0' }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column sortable align="center" label="实际交办日期" prop="实际交办日期" width="140">
|
|
|
<template #default="{ row }">
|
|
|
- <el-date-picker v-if="editingCell.rowId === (row.UniqId || row.tempId) && editingCell.prop === '实际交办日期'"
|
|
|
+ <el-date-picker v-if="isEditing(row, '实际交办日期')"
|
|
|
v-model="row.实际交办日期"
|
|
|
type="date"
|
|
|
value-format="YYYY-MM-DD"
|
|
|
placeholder="选择日期"
|
|
|
style="width: 100%"
|
|
|
- @blur="handleCellBlur(row, '实际交办日期')" />
|
|
|
- <span v-else @click="handleCellClick(row, '实际交办日期')" class="cell-span">{{ row.实际交办日期 }}</span>
|
|
|
+ @blur="handleCellBlur(row, '实际交办日期')"
|
|
|
+ @change="handleCellBlur(row, '实际交办日期')" />
|
|
|
+ <div v-else class="cell-span">{{ row.实际交办日期 || '\u00A0' }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column sortable align="center" label="备注" prop="备注" width="150">
|
|
|
<template #default="{ row }">
|
|
|
- <el-input v-if="editingCell.rowId === (row.UniqId || row.tempId) && editingCell.prop === '备注'"
|
|
|
+ <el-input v-if="isEditing(row, '备注')"
|
|
|
v-model="row.备注"
|
|
|
@blur="handleCellBlur(row, '备注')"
|
|
|
@keyup.enter="handleCellBlur(row, '备注')"
|
|
|
:ref="el => { if (el) el.focus() }" />
|
|
|
- <span v-else @click="handleCellClick(row, '备注')" class="cell-span">{{ row.备注 }}</span>
|
|
|
+ <div v-else class="cell-span">{{ row.备注 || '\u00A0' }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="操作" width="230" fixed="right">
|
|
|
@@ -181,13 +180,11 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
- <!-- 分页 -->
|
|
|
<div class="gva-pagination">
|
|
|
<el-pagination layout="total" :current-page="page" :page-size="pageSize"
|
|
|
:total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" />
|
|
|
</div>
|
|
|
|
|
|
- <!-- 日志弹窗 -->
|
|
|
<el-dialog title="修改记录" v-model="logDialogVisible" width="800px">
|
|
|
<el-table :data="logTableData" border size="small">
|
|
|
<el-table-column prop="ModifyField" label="修改字段" width="120" />
|
|
|
@@ -198,485 +195,433 @@
|
|
|
</el-table>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
-
|
|
|
</el-main>
|
|
|
</layout-content>
|
|
|
</layout>
|
|
|
</layout>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <script setup>
|
|
|
- import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
|
|
|
- import * as XLSX from 'xlsx'
|
|
|
- import FileSaver from 'file-saver'
|
|
|
- import {ref, reactive} from 'vue'
|
|
|
- import { exportExcelFile } from '@/utils/excel'
|
|
|
- import {ElMessage} from "element-plus";
|
|
|
- import { getDateTree, getMonthlyGarmentsList, saveMonthlyGarments, updateMonthlyGarments, deleteMonthlyGarments, getLogs, } from '@/api/mes/job'
|
|
|
- import { useUserStore } from '@/pinia/modules/user';
|
|
|
- //获取登录用户信息
|
|
|
- const userStore = useUserStore()
|
|
|
- const _username = ref('')
|
|
|
- _username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
|
|
|
- defineOptions({name: 'Company'})
|
|
|
-
|
|
|
- const treeData = ref([])
|
|
|
- const defaultProps = {
|
|
|
- children: 'children',
|
|
|
- label: 'label'
|
|
|
- }
|
|
|
+<script setup>
|
|
|
+import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue'
|
|
|
+import * as XLSX from 'xlsx'
|
|
|
+import { ref, reactive, nextTick } from 'vue'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
+import { getDateTree, getMonthlyGarmentsList, saveMonthlyGarments, updateMonthlyGarments, deleteMonthlyGarments, getLogs } from '@/api/mes/job'
|
|
|
+import { useUserStore } from '@/pinia/modules/user'
|
|
|
|
|
|
- const getTree = async () => {
|
|
|
- try {
|
|
|
- const response = await getDateTree()
|
|
|
- const data = response.data || {}
|
|
|
-
|
|
|
- const sortedYearMonths = Object.keys(data).sort((a, b) => {
|
|
|
- const yearMonthA = parseInt(a);
|
|
|
- const yearMonthB = parseInt(b);
|
|
|
- return yearMonthB - yearMonthA;
|
|
|
- });
|
|
|
-
|
|
|
- treeData.value = sortedYearMonths.map(yearMonth => {
|
|
|
- return {
|
|
|
- label: `${yearMonth}`,
|
|
|
- children: data[yearMonth].map(customer => {
|
|
|
- return {
|
|
|
- label: `${customer.客户编号} (${customer.total}条)`,
|
|
|
- yearMonth: yearMonth,
|
|
|
- customerCode: customer.客户编号,
|
|
|
- total: customer.total,
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+defineOptions({ name: 'Company' })
|
|
|
|
|
|
- if (treeData.value.length === 0 && tableData.value.length === 0) {
|
|
|
- tableData.value.push({
|
|
|
- tempId: 'empty_row_' + Date.now(),
|
|
|
- '客户编号': '',
|
|
|
- '款号': '',
|
|
|
- '款式': '',
|
|
|
- '样办种类': '',
|
|
|
- '做办部门': '',
|
|
|
- '数量': '',
|
|
|
- '下单日期': '',
|
|
|
- '面料进度': '',
|
|
|
- '辅料进度': '',
|
|
|
- '计划交办日期': '',
|
|
|
- '实际交办日期': '',
|
|
|
- '备注': ''
|
|
|
- })
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- ElMessage.error('获取数据失败')
|
|
|
- console.error('获取树形数据失败:', error)
|
|
|
- }
|
|
|
- }
|
|
|
- getTree()
|
|
|
-
|
|
|
- const tableData = ref([])
|
|
|
- const _noderq = ref('')
|
|
|
- const _nodecode = ref('')
|
|
|
- const page = ref(1)
|
|
|
- const pageSize = ref(20)
|
|
|
- const total = ref(0)
|
|
|
- const editingCell = reactive({ rowId: null, prop: null })
|
|
|
- const editingOriginalValue = ref('')
|
|
|
- const logDialogVisible = ref(false)
|
|
|
- const logTableData = ref([])
|
|
|
-
|
|
|
- const handleNodeClick = async (node) => {
|
|
|
- const allNodes = document.querySelectorAll('.treecolor .el-tree-node');
|
|
|
- allNodes.forEach(node => {
|
|
|
- node.querySelector('.el-tree-node__label').style.color = '';
|
|
|
- });
|
|
|
-
|
|
|
- const clickedNodeId = node['$treeNodeId'];
|
|
|
- const clickedNode = document.querySelector(`.treecolor .el-tree-node[data-key="${clickedNodeId}"]`);
|
|
|
- if (clickedNode) {
|
|
|
- clickedNode.querySelector('.el-tree-node__label').style.color = 'red';
|
|
|
- }
|
|
|
-
|
|
|
- _noderq.value = node.yearMonth
|
|
|
- _nodecode.value = node.customerCode
|
|
|
-
|
|
|
- if (!node.children) {
|
|
|
- const res = await getMonthlyGarmentsList({sys_rq: node.yearMonth, customer: node.customerCode})
|
|
|
- if(res.code === 0){
|
|
|
- tableData.value = res.data.result || []
|
|
|
- total.value = res.data.total || res.data.result.length
|
|
|
- }
|
|
|
- if (tableData.value.length === 0) {
|
|
|
- tableData.value.push({
|
|
|
- tempId: 'empty_row_' + Date.now(),
|
|
|
- '客户编号': '',
|
|
|
- '款号': '',
|
|
|
- '款式': '',
|
|
|
- '样办种类': '',
|
|
|
- '做办部门': '',
|
|
|
- '数量': '',
|
|
|
- '下单日期': '',
|
|
|
- '面料进度': '',
|
|
|
- '辅料进度': '',
|
|
|
- '计划交办日期': '',
|
|
|
- '实际交办日期': '',
|
|
|
- '备注': ''
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+const userStore = useUserStore()
|
|
|
+const _username = ref('')
|
|
|
+_username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
|
|
|
|
|
|
- const searchInfo = ref('')
|
|
|
- const searchRule = {}
|
|
|
- const elSearchFormRef = ref()
|
|
|
+const treeData = ref([])
|
|
|
+const menuTreeRef = ref(null)
|
|
|
+const defaultExpandedKeys = ref([])
|
|
|
+const currentTreeKey = ref('')
|
|
|
+const defaultProps = {
|
|
|
+ children: 'children',
|
|
|
+ label: 'label'
|
|
|
+}
|
|
|
|
|
|
- const onSubmit = async () => {
|
|
|
- if (!searchInfo.value) {
|
|
|
- ElMessage.warning('请输入搜索内容');
|
|
|
- return;
|
|
|
- } else {
|
|
|
- const res = await getMonthlyGarmentsList({search: searchInfo.value})
|
|
|
- if(res.code === 0){
|
|
|
- tableData.value = res.data.result
|
|
|
- total.value = res.data.total || res.data.result.length
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+const tableData = ref([])
|
|
|
+const _noderq = ref('')
|
|
|
+const _nodecode = ref('')
|
|
|
+const page = ref(1)
|
|
|
+const pageSize = ref(20)
|
|
|
+const total = ref(0)
|
|
|
+const editingCell = reactive({ rowId: null, prop: null })
|
|
|
+const editingOriginalValue = ref('')
|
|
|
+const logDialogVisible = ref(false)
|
|
|
+const logTableData = ref([])
|
|
|
+const searchInfo = ref('')
|
|
|
+const searchRule = {}
|
|
|
+const elSearchFormRef = ref()
|
|
|
|
|
|
- const tableRowClick = (row) => {
|
|
|
- console.log('当前行数据:', row)
|
|
|
- }
|
|
|
+const getCurrentYearMonth = () => {
|
|
|
+ const now = new Date()
|
|
|
+ const y = now.getFullYear()
|
|
|
+ const m = String(now.getMonth() + 1).padStart(2, '0')
|
|
|
+ return `${y}-${m}`
|
|
|
+}
|
|
|
|
|
|
- const handleSelectionChange = (selectedItems) => {
|
|
|
- console.log('选中项:', selectedItems)
|
|
|
- }
|
|
|
+const createEmptyRow = () => ({
|
|
|
+ tempId: 'empty_row_' + Date.now() + '_' + Math.random().toString(36).slice(2, 7),
|
|
|
+ 客户编号: '',
|
|
|
+ 款号: '',
|
|
|
+ 款式: '',
|
|
|
+ 样办种类: '',
|
|
|
+ 做办部门: '',
|
|
|
+ 数量: '',
|
|
|
+ 下单日期: '',
|
|
|
+ 面料进度: '',
|
|
|
+ 辅料进度: '',
|
|
|
+ 计划交办日期: '',
|
|
|
+ 实际交办日期: '',
|
|
|
+ 备注: ''
|
|
|
+})
|
|
|
|
|
|
- const handleCurrentChange = (val) => {
|
|
|
- page.value = val
|
|
|
+const ensureEditableRows = () => {
|
|
|
+ if (!tableData.value.length) {
|
|
|
+ tableData.value.push(createEmptyRow())
|
|
|
}
|
|
|
+}
|
|
|
|
|
|
- const handleSizeChange = (val) => {
|
|
|
- pageSize.value = val
|
|
|
- }
|
|
|
+const rowKeyOf = (row) => row.UniqId || row.tempId
|
|
|
+const isEditing = (row, prop) =>
|
|
|
+ editingCell.rowId === rowKeyOf(row) && editingCell.prop === prop
|
|
|
|
|
|
- const updateCompanyFunc = (row) => {
|
|
|
- console.log('双击行:', row)
|
|
|
- }
|
|
|
+const loadListByMonth = async (sys_rq, customer = '') => {
|
|
|
+ _noderq.value = sys_rq || ''
|
|
|
+ _nodecode.value = customer || ''
|
|
|
+ if (!sys_rq) {
|
|
|
+ tableData.value = [createEmptyRow()]
|
|
|
+ total.value = 0
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const params = { sys_rq }
|
|
|
+ if (customer) params.customer = customer
|
|
|
+ const res = await getMonthlyGarmentsList(params)
|
|
|
+ if (res.code === 0) {
|
|
|
+ tableData.value = res.data.result || []
|
|
|
+ total.value = res.data.total || (res.data.result?.length ?? 0)
|
|
|
+ } else {
|
|
|
+ tableData.value = []
|
|
|
+ total.value = 0
|
|
|
+ }
|
|
|
+ ensureEditableRows()
|
|
|
+}
|
|
|
|
|
|
- const gxbgCellClass = ({row, column, rowIndex, columnIndex}) => {
|
|
|
- return ''
|
|
|
- }
|
|
|
+const highlightTreeNode = (node) => {
|
|
|
+ const allNodes = document.querySelectorAll('.treecolor .el-tree-node')
|
|
|
+ allNodes.forEach((el) => {
|
|
|
+ const label = el.querySelector('.el-tree-node__label')
|
|
|
+ if (label) label.style.color = ''
|
|
|
+ })
|
|
|
+ const clickedNodeId = node?.['$treeNodeId']
|
|
|
+ if (!clickedNodeId) return
|
|
|
+ const clickedNode = document.querySelector(`.treecolor .el-tree-node[data-key="${clickedNodeId}"]`)
|
|
|
+ if (clickedNode) {
|
|
|
+ const label = clickedNode.querySelector('.el-tree-node__label')
|
|
|
+ if (label) label.style.color = 'red'
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- const addRow = (index) => {
|
|
|
- const newRow = {
|
|
|
- tempId: 'temp_' + Date.now(),
|
|
|
- '客户编号': '',
|
|
|
- '款号': '',
|
|
|
- '款式': '',
|
|
|
- '样办种类': '',
|
|
|
- '做办部门': '',
|
|
|
- '数量': '',
|
|
|
- '下单日期': '',
|
|
|
- '面料进度': '',
|
|
|
- '辅料进度': '',
|
|
|
- '计划交办日期': '',
|
|
|
- '实际交办日期': '',
|
|
|
- '备注': ''
|
|
|
- }
|
|
|
- tableData.value.splice(index + 1, 0, newRow)
|
|
|
- }
|
|
|
+const buildTreeData = (data) => {
|
|
|
+ const sortedYearMonths = Object.keys(data || {}).sort((a, b) => parseInt(b) - parseInt(a))
|
|
|
+ return sortedYearMonths.map((yearMonth) => ({
|
|
|
+ id: `m-${yearMonth}`,
|
|
|
+ label: `${yearMonth}`,
|
|
|
+ yearMonth,
|
|
|
+ children: (data[yearMonth] || []).map((customer) => ({
|
|
|
+ id: `c-${yearMonth}-${customer.客户编号}`,
|
|
|
+ label: `${customer.客户编号} (${customer.total}条)`,
|
|
|
+ yearMonth,
|
|
|
+ customerCode: customer.客户编号,
|
|
|
+ total: customer.total,
|
|
|
+ })),
|
|
|
+ }))
|
|
|
+}
|
|
|
|
|
|
- const addFirstRow = () => {
|
|
|
- const newRow = {
|
|
|
- tempId: 'temp_' + Date.now(),
|
|
|
- '客户编号': '',
|
|
|
- '款号': '',
|
|
|
- '款式': '',
|
|
|
- '样办种类': '',
|
|
|
- '做办部门': '',
|
|
|
- '数量': '',
|
|
|
- '下单日期': '',
|
|
|
- '面料进度': '',
|
|
|
- '辅料进度': '',
|
|
|
- '计划交办日期': '',
|
|
|
- '实际交办日期': '',
|
|
|
- '备注': ''
|
|
|
- }
|
|
|
- tableData.value.push(newRow)
|
|
|
- }
|
|
|
+const getTree = async () => {
|
|
|
+ try {
|
|
|
+ const response = await getDateTree()
|
|
|
+ const data = response.data || {}
|
|
|
+ treeData.value = buildTreeData(data)
|
|
|
+
|
|
|
+ // 进入页面默认展示当天所在月份数据
|
|
|
+ const todayYm = getCurrentYearMonth()
|
|
|
+ const monthNode =
|
|
|
+ treeData.value.find((n) => n.yearMonth === todayYm) ||
|
|
|
+ treeData.value[0] ||
|
|
|
+ null
|
|
|
|
|
|
- const handleRowDblclick = async (row) => {
|
|
|
- if (!row.UniqId) return
|
|
|
- const res = await getLogs({ UniqId: row.UniqId })
|
|
|
- if (res.code === 0) {
|
|
|
- logTableData.value = res.data.result || []
|
|
|
- logDialogVisible.value = true
|
|
|
+ if (monthNode) {
|
|
|
+ currentTreeKey.value = monthNode.id
|
|
|
+ defaultExpandedKeys.value = [monthNode.id]
|
|
|
+ await loadListByMonth(monthNode.yearMonth)
|
|
|
+ await nextTick()
|
|
|
+ menuTreeRef.value?.setCurrentKey?.(monthNode.id)
|
|
|
} else {
|
|
|
- ElMessage.error('获取日志失败')
|
|
|
+ ensureEditableRows()
|
|
|
}
|
|
|
+ } catch (error) {
|
|
|
+ ElMessage.error('获取数据失败')
|
|
|
+ console.error('获取树形数据失败:', error)
|
|
|
+ ensureEditableRows()
|
|
|
}
|
|
|
+}
|
|
|
+getTree()
|
|
|
+
|
|
|
+const handleNodeClick = async (node) => {
|
|
|
+ highlightTreeNode(node)
|
|
|
+ currentTreeKey.value = node.id || ''
|
|
|
+ // 月份节点:查当月全部;客户节点:按客户过滤
|
|
|
+ if (node.children) {
|
|
|
+ await loadListByMonth(node.yearMonth || node.label)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (node.yearMonth) {
|
|
|
+ await loadListByMonth(node.yearMonth, node.customerCode || '')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const onSubmit = async () => {
|
|
|
+ if (!searchInfo.value) {
|
|
|
+ ElMessage.warning('请输入搜索内容')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const res = await getMonthlyGarmentsList({ search: searchInfo.value })
|
|
|
+ if (res.code === 0) {
|
|
|
+ tableData.value = res.data.result
|
|
|
+ total.value = res.data.total || res.data.result.length
|
|
|
+ ensureEditableRows()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const tableRowClick = () => {}
|
|
|
+const handleSelectionChange = () => {}
|
|
|
+const handleCurrentChange = (val) => { page.value = val }
|
|
|
+const handleSizeChange = (val) => { pageSize.value = val }
|
|
|
+const gxbgCellClass = () => ''
|
|
|
+
|
|
|
+const addRow = (index) => {
|
|
|
+ tableData.value.splice(index + 1, 0, createEmptyRow())
|
|
|
+}
|
|
|
+
|
|
|
+const addFirstRow = () => {
|
|
|
+ tableData.value.push(createEmptyRow())
|
|
|
+}
|
|
|
|
|
|
- const deleteRow = async (row, index) => {
|
|
|
- try {
|
|
|
- if (row.UniqId) {
|
|
|
- const res = await deleteMonthlyGarments({ UniqId: row.UniqId, nickName: userStore.userInfo.nickName })
|
|
|
- if(res.code !== 0){
|
|
|
- ElMessage.error('删除失败')
|
|
|
- return
|
|
|
- }
|
|
|
+const handleRowDblclick = async (row) => {
|
|
|
+ if (!row.UniqId) return
|
|
|
+ const res = await getLogs({ UniqId: row.UniqId })
|
|
|
+ if (res.code === 0) {
|
|
|
+ logTableData.value = res.data.result || []
|
|
|
+ logDialogVisible.value = true
|
|
|
+ } else {
|
|
|
+ ElMessage.error('获取日志失败')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const deleteRow = async (row, index) => {
|
|
|
+ try {
|
|
|
+ if (row.UniqId) {
|
|
|
+ const res = await deleteMonthlyGarments({ UniqId: row.UniqId, nickName: userStore.userInfo.nickName })
|
|
|
+ if (res.code !== 0) {
|
|
|
+ ElMessage.error('删除失败')
|
|
|
+ return
|
|
|
}
|
|
|
- tableData.value.splice(index, 1)
|
|
|
- ElMessage.success('删除成功')
|
|
|
- await refreshData()
|
|
|
- } catch (error) {
|
|
|
- ElMessage.error('删除失败')
|
|
|
- console.error('删除失败:', error)
|
|
|
}
|
|
|
- }
|
|
|
+ tableData.value.splice(index, 1)
|
|
|
+ ElMessage.success('删除成功')
|
|
|
+ await refreshData()
|
|
|
+ } catch (error) {
|
|
|
+ ElMessage.error('删除失败')
|
|
|
+ console.error('删除失败:', error)
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- const handleCellClick = (row, prop) => {
|
|
|
- editingCell.rowId = row.UniqId || row.tempId
|
|
|
- editingCell.prop = prop
|
|
|
- editingOriginalValue.value = row[prop]
|
|
|
- }
|
|
|
+const EDITABLE_FIELDS = [
|
|
|
+ '客户编号',
|
|
|
+ '款号',
|
|
|
+ '款式',
|
|
|
+ '样办种类',
|
|
|
+ '做办部门',
|
|
|
+ '数量',
|
|
|
+ '下单日期',
|
|
|
+ '面料进度',
|
|
|
+ '辅料进度',
|
|
|
+ '计划交办日期',
|
|
|
+ '实际交办日期',
|
|
|
+ '备注',
|
|
|
+]
|
|
|
|
|
|
- const handleTableCellClick = (row, column, cell, event) => {
|
|
|
- console.log('cell-click triggered:', { rowId: row.UniqId || row.tempId, columnLabel: column.label, columnProp: column.prop, columnIndex: column.index })
|
|
|
- if (column.prop && column.prop !== '') {
|
|
|
- handleCellClick(row, column.prop)
|
|
|
- console.log('editingCell after click:', editingCell)
|
|
|
- }
|
|
|
+const normalizeCellValue = (val) => String(val ?? '').trim()
|
|
|
+
|
|
|
+const isRowAllEmpty = (row) =>
|
|
|
+ EDITABLE_FIELDS.every((field) => !normalizeCellValue(row[field]))
|
|
|
+
|
|
|
+const isCellUnchanged = (row, prop) =>
|
|
|
+ normalizeCellValue(row[prop]) === normalizeCellValue(editingOriginalValue.value)
|
|
|
+
|
|
|
+const clearEditingCell = () => {
|
|
|
+ editingCell.rowId = null
|
|
|
+ editingCell.prop = null
|
|
|
+}
|
|
|
+
|
|
|
+const handleCellClick = (row, prop) => {
|
|
|
+ if (!prop || prop === '操作') return
|
|
|
+ editingCell.rowId = rowKeyOf(row)
|
|
|
+ editingCell.prop = prop
|
|
|
+ editingOriginalValue.value = row[prop] ?? ''
|
|
|
+}
|
|
|
+
|
|
|
+const handleTableCellClick = (row, column) => {
|
|
|
+ // Element Plus 单元格点击事件里字段名在 column.property
|
|
|
+ const prop = column?.property || column?.prop
|
|
|
+ if (!prop || prop === '操作') return
|
|
|
+ handleCellClick(row, prop)
|
|
|
+}
|
|
|
+
|
|
|
+const refreshData = async () => {
|
|
|
+ const keepRq = _noderq.value
|
|
|
+ const keepCode = _nodecode.value
|
|
|
+ try {
|
|
|
+ const response = await getDateTree()
|
|
|
+ treeData.value = buildTreeData(response.data || {})
|
|
|
+ } catch (e) {
|
|
|
+ console.error(e)
|
|
|
+ }
|
|
|
+ await loadListByMonth(keepRq, keepCode)
|
|
|
+}
|
|
|
+
|
|
|
+const handleCellBlur = async (row, prop) => {
|
|
|
+ // 已退出编辑态,忽略重复 blur/change
|
|
|
+ if (editingCell.rowId !== rowKeyOf(row) || editingCell.prop !== prop) {
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
- const refreshData = async () => {
|
|
|
- await getTree()
|
|
|
- if (_noderq.value && _nodecode.value) {
|
|
|
- const res = await getMonthlyGarmentsList({sys_rq: _noderq.value, customer: _nodecode.value})
|
|
|
- if(res.code === 0){
|
|
|
- tableData.value = res.data.result || []
|
|
|
- total.value = res.data.total || res.data.result.length
|
|
|
- if (tableData.value.length === 0) {
|
|
|
- tableData.value.push({
|
|
|
- tempId: 'empty_row_' + Date.now(),
|
|
|
- '客户编号': '',
|
|
|
- '款号': '',
|
|
|
- '款式': '',
|
|
|
- '样办种类': '',
|
|
|
- '做办部门': '',
|
|
|
- '数量': '',
|
|
|
- '下单日期': '',
|
|
|
- '面料进度': '',
|
|
|
- '辅料进度': '',
|
|
|
- '计划交办日期': '',
|
|
|
- '实际交办日期': '',
|
|
|
- '备注': ''
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ // 仅点击未改内容:不触发新增/修改
|
|
|
+ if (isCellUnchanged(row, prop)) {
|
|
|
+ clearEditingCell()
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
- const handleCellBlur = async (row, prop) => {
|
|
|
- try {
|
|
|
- if (row.UniqId) {
|
|
|
- if (String(row[prop]) === String(editingOriginalValue.value)) {
|
|
|
- editingCell.rowId = null
|
|
|
- editingCell.prop = null
|
|
|
- return
|
|
|
- }
|
|
|
- const res = await updateMonthlyGarments({
|
|
|
- UniqId: row.UniqId,
|
|
|
- nickName: userStore.userInfo.nickName,
|
|
|
- '客户编号': row['客户编号'],
|
|
|
- '款号': row['款号'],
|
|
|
- '款式': row['款式'],
|
|
|
- '样办种类': row['样办种类'],
|
|
|
- '做办部门': row['做办部门'],
|
|
|
- '数量': row['数量'],
|
|
|
- '下单日期': row['下单日期'],
|
|
|
- '面料进度': row['面料进度'],
|
|
|
- '辅料进度': row['辅料进度'],
|
|
|
- '计划交办日期': row['计划交办日期'],
|
|
|
- '实际交办日期': row['实际交办日期'],
|
|
|
- '备注': row['备注']
|
|
|
- })
|
|
|
- if(res.code !== 0){
|
|
|
- ElMessage.error('修改失败')
|
|
|
- editingCell.rowId = null
|
|
|
- editingCell.prop = null
|
|
|
- return
|
|
|
- }
|
|
|
- await refreshData()
|
|
|
- } else if (row.tempId) {
|
|
|
- const res = await saveMonthlyGarments({
|
|
|
- '客户编号': row['客户编号'],
|
|
|
- '款号': row['款号'],
|
|
|
- '款式': row['款式'],
|
|
|
- '样办种类': row['样办种类'],
|
|
|
- '做办部门': row['做办部门'],
|
|
|
- '数量': row['数量'],
|
|
|
- '下单日期': row['下单日期'],
|
|
|
- '面料进度': row['面料进度'],
|
|
|
- '辅料进度': row['辅料进度'],
|
|
|
- '计划交办日期': row['计划交办日期'],
|
|
|
- '实际交办日期': row['实际交办日期'],
|
|
|
- '备注': row['备注']
|
|
|
- })
|
|
|
- if(res.code === 0){
|
|
|
- row.UniqId = parseInt(res.data.id)
|
|
|
- delete row.tempId
|
|
|
- await refreshData()
|
|
|
- } else {
|
|
|
- ElMessage.error('保存失败')
|
|
|
- editingCell.rowId = null
|
|
|
- editingCell.prop = null
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- editingCell.rowId = null
|
|
|
- editingCell.prop = null
|
|
|
- ElMessage.success('保存成功')
|
|
|
- } catch (error) {
|
|
|
- ElMessage.error('保存失败')
|
|
|
- console.error('保存失败:', error)
|
|
|
- editingCell.rowId = null
|
|
|
- editingCell.prop = null
|
|
|
- }
|
|
|
+ // 新行且所有列都为空:不触发保存
|
|
|
+ if (row.tempId && isRowAllEmpty(row)) {
|
|
|
+ clearEditingCell()
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
- const exportToExcel = (data, filename = '导出数据.xlsx', sheetName = 'Sheet1') => {
|
|
|
- try {
|
|
|
- const wb = XLSX.utils.book_new();
|
|
|
-
|
|
|
- if (typeof data === 'object' && data.nodeType === 1) {
|
|
|
- const worksheet = XLSX.utils.table_to_sheet(data, { raw: true });
|
|
|
- XLSX.utils.book_append_sheet(wb, worksheet, sheetName);
|
|
|
- } else if (Array.isArray(data)) {
|
|
|
- const worksheet = XLSX.utils.json_to_sheet(data);
|
|
|
- XLSX.utils.book_append_sheet(wb, worksheet, sheetName);
|
|
|
- } else if (data['!ref']) {
|
|
|
- XLSX.utils.book_append_sheet(wb, data, sheetName);
|
|
|
+ // 先退出编辑态,避免重复触发
|
|
|
+ clearEditingCell()
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (row.UniqId) {
|
|
|
+ const res = await updateMonthlyGarments({
|
|
|
+ UniqId: row.UniqId,
|
|
|
+ nickName: userStore.userInfo.nickName,
|
|
|
+ 客户编号: row['客户编号'],
|
|
|
+ 款号: row['款号'],
|
|
|
+ 款式: row['款式'],
|
|
|
+ 样办种类: row['样办种类'],
|
|
|
+ 做办部门: row['做办部门'],
|
|
|
+ 数量: row['数量'],
|
|
|
+ 下单日期: row['下单日期'],
|
|
|
+ 面料进度: row['面料进度'],
|
|
|
+ 辅料进度: row['辅料进度'],
|
|
|
+ 计划交办日期: row['计划交办日期'],
|
|
|
+ 实际交办日期: row['实际交办日期'],
|
|
|
+ 备注: row['备注']
|
|
|
+ })
|
|
|
+ if (res.code !== 0) {
|
|
|
+ ElMessage.error('修改失败')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ await refreshData()
|
|
|
+ } else if (row.tempId) {
|
|
|
+ const res = await saveMonthlyGarments({
|
|
|
+ 客户编号: row['客户编号'],
|
|
|
+ 款号: row['款号'],
|
|
|
+ 款式: row['款式'],
|
|
|
+ 样办种类: row['样办种类'],
|
|
|
+ 做办部门: row['做办部门'],
|
|
|
+ 数量: row['数量'],
|
|
|
+ 下单日期: row['下单日期'],
|
|
|
+ 面料进度: row['面料进度'],
|
|
|
+ 辅料进度: row['辅料进度'],
|
|
|
+ 计划交办日期: row['计划交办日期'],
|
|
|
+ 实际交办日期: row['实际交办日期'],
|
|
|
+ 备注: row['备注']
|
|
|
+ })
|
|
|
+ if (res.code === 0) {
|
|
|
+ row.UniqId = parseInt(res.data.id)
|
|
|
+ delete row.tempId
|
|
|
+ await refreshData()
|
|
|
} else {
|
|
|
- throw new Error('不支持的导出数据类型');
|
|
|
+ ElMessage.error('保存失败')
|
|
|
+ return
|
|
|
}
|
|
|
-
|
|
|
- XLSX.writeFile(wb, filename);
|
|
|
- return true;
|
|
|
- } catch (error) {
|
|
|
- console.error('导出Excel失败:', error);
|
|
|
- ElMessage.error('导出失败: ' + error.message);
|
|
|
- return false;
|
|
|
}
|
|
|
- };
|
|
|
-
|
|
|
- const hzToExcel = () => {
|
|
|
- if (tableData.value.length === 0) {
|
|
|
- ElMessage.warning('暂无数据可导出');
|
|
|
- return;
|
|
|
- }
|
|
|
- exportToExcel(tableData.value, '月份样衣生产进度表.xlsx', '月份样衣生产进度表');
|
|
|
+ ElMessage.success('保存成功')
|
|
|
+ } catch (error) {
|
|
|
+ ElMessage.error('保存失败')
|
|
|
+ console.error('保存失败:', error)
|
|
|
}
|
|
|
+}
|
|
|
|
|
|
- const mxToExcel = () => {
|
|
|
- if (tableData.value.length === 0) {
|
|
|
- ElMessage.warning('暂无数据可导出');
|
|
|
- return;
|
|
|
+const exportToExcel = (data, filename = '导出数据.xlsx', sheetName = 'Sheet1') => {
|
|
|
+ try {
|
|
|
+ const wb = XLSX.utils.book_new()
|
|
|
+ if (typeof data === 'object' && data.nodeType === 1) {
|
|
|
+ const worksheet = XLSX.utils.table_to_sheet(data, { raw: true })
|
|
|
+ XLSX.utils.book_append_sheet(wb, worksheet, sheetName)
|
|
|
+ } else if (Array.isArray(data)) {
|
|
|
+ const worksheet = XLSX.utils.json_to_sheet(data)
|
|
|
+ XLSX.utils.book_append_sheet(wb, worksheet, sheetName)
|
|
|
+ } else if (data['!ref']) {
|
|
|
+ XLSX.utils.book_append_sheet(wb, data, sheetName)
|
|
|
+ } else {
|
|
|
+ throw new Error('不支持的导出数据类型')
|
|
|
}
|
|
|
- exportToExcel(tableData.value, '月份样衣生产进度明细表.xlsx', '月份样衣生产进度明细表');
|
|
|
- }
|
|
|
- </script>
|
|
|
-
|
|
|
- <style scoped>
|
|
|
- .form-container {
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- }
|
|
|
-
|
|
|
- .form-column {
|
|
|
- /*flex: 1;*/
|
|
|
- margin-right: 15px; /* 调整列之间的间距 */
|
|
|
- }
|
|
|
-
|
|
|
- /* 左侧输入框宽度调整 */
|
|
|
- .form-column .el-form-item .el-input {
|
|
|
- width: 150px; /* 调整左侧输入框的宽度 */
|
|
|
- }
|
|
|
-
|
|
|
- :deep(.hui-plan-usage-lows div) {
|
|
|
- color: #8c939d !important;
|
|
|
- }
|
|
|
- :deep(.lan-plan-usage-lows div) {
|
|
|
- color: blue !important;
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
-
|
|
|
+ XLSX.writeFile(wb, filename)
|
|
|
+ return true
|
|
|
+ } catch (error) {
|
|
|
+ console.error('导出Excel失败:', error)
|
|
|
+ ElMessage.error('导出失败: ' + error.message)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- /* 媒体查询,根据需要调整断点 */
|
|
|
- @media screen and (max-width: 768px) {
|
|
|
- .form-column {
|
|
|
- flex: 1 0 100%; /* 在小屏幕下变成单列布局 */
|
|
|
- margin-right: 0;
|
|
|
- }
|
|
|
- }
|
|
|
- /*:deep(.el-table td .cell) {*/
|
|
|
- /* line-height: 30px !important;*/
|
|
|
- /*}*/
|
|
|
- .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;
|
|
|
+const hzToExcel = () => {
|
|
|
+ if (tableData.value.length === 0) {
|
|
|
+ ElMessage.warning('暂无数据可导出')
|
|
|
+ return
|
|
|
}
|
|
|
+ exportToExcel(tableData.value, '月份样衣生产进度表.xlsx', '月份样衣生产进度表')
|
|
|
+}
|
|
|
|
|
|
-
|
|
|
- /* 选中某行时的背景色 */
|
|
|
- :deep(.el-table__body tr.current-row) > td {
|
|
|
- background: #ff80ff !important;
|
|
|
- }
|
|
|
- </style>
|
|
|
- <style scoped>
|
|
|
- :deep(.el-table td .cell) {
|
|
|
- line-height: 20px !important;
|
|
|
- }
|
|
|
- :deep(.el-tabs__header){
|
|
|
- margin-bottom: 0;
|
|
|
- }
|
|
|
- .search{
|
|
|
- margin-left: 0px !important;
|
|
|
- margin-right: 10px !important;
|
|
|
- }
|
|
|
- .bt{
|
|
|
- margin-left: 2px !important;
|
|
|
- padding: 3px !important;
|
|
|
- font-size: 12px;
|
|
|
- }
|
|
|
- .el-tabs__header{
|
|
|
- margin: 0px !important;
|
|
|
- }
|
|
|
- .gva-table-box{
|
|
|
- padding: 0px !important;
|
|
|
- }
|
|
|
- .mab{
|
|
|
- margin-bottom: 5px;
|
|
|
- }
|
|
|
- .cell-span {
|
|
|
- display: inline-block;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- cursor: pointer;
|
|
|
- padding: 4px 0;
|
|
|
- }
|
|
|
- </style>
|
|
|
-
|
|
|
+const mxToExcel = () => {
|
|
|
+ if (tableData.value.length === 0) {
|
|
|
+ ElMessage.warning('暂无数据可导出')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ exportToExcel(tableData.value, '月份样衣生产进度明细表.xlsx', '月份样衣生产进度明细表')
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.JKWTree-tree {
|
|
|
+ background-color: #fff;
|
|
|
+ padding: 10px;
|
|
|
+ margin-right: 20px;
|
|
|
+}
|
|
|
+.JKWTree-tree h3 {
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 700;
|
|
|
+ margin: 10px 0;
|
|
|
+}
|
|
|
+:deep(.el-table__body tr.current-row) > td {
|
|
|
+ background: #ff80ff !important;
|
|
|
+}
|
|
|
+:deep(.el-table td .cell) {
|
|
|
+ line-height: 20px !important;
|
|
|
+ min-height: 24px;
|
|
|
+}
|
|
|
+.gva-table-box {
|
|
|
+ padding: 0px !important;
|
|
|
+}
|
|
|
+.cell-span {
|
|
|
+ display: block;
|
|
|
+ width: 100%;
|
|
|
+ min-height: 24px;
|
|
|
+ line-height: 24px;
|
|
|
+ cursor: pointer;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 0 4px;
|
|
|
+}
|
|
|
+:deep(.el-table td.el-table__cell) {
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+</style>
|