|
@@ -1,105 +1,45 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
- <el-container>
|
|
|
|
|
- <!-- 左侧树形结构 -->
|
|
|
|
|
- <el-scrollbar max-height="75vh">
|
|
|
|
|
- <el-aside>
|
|
|
|
|
- <div class="JKWTree-tree">
|
|
|
|
|
- <h3>其他计件单据维护</h3>
|
|
|
|
|
- <el-tree
|
|
|
|
|
- :data="treeData"
|
|
|
|
|
- highlight-current
|
|
|
|
|
- @node-click="handleNodeClick"
|
|
|
|
|
|
|
+ <layout>
|
|
|
|
|
+ <layout-header>
|
|
|
|
|
+ <!-- 按钮 -->
|
|
|
|
|
+ <el-form inline>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="searchInfo"
|
|
|
|
|
+ placeholder="搜索产品编号或产品名称"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ style="width: 180px;"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon="Search"
|
|
|
|
|
+ class="search"
|
|
|
|
|
+ @click="handleSearch"
|
|
|
/>
|
|
/>
|
|
|
- </div>
|
|
|
|
|
- </el-aside>
|
|
|
|
|
- </el-scrollbar>
|
|
|
|
|
-
|
|
|
|
|
- <el-container>
|
|
|
|
|
- <el-main>
|
|
|
|
|
- <!-- 按钮区域 -->
|
|
|
|
|
- <div class="gva-table-box">
|
|
|
|
|
- <div class="gva-btn-list">
|
|
|
|
|
- <el-row :span="6">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="searchInfo"
|
|
|
|
|
- placeholder="输入工单编号"
|
|
|
|
|
- style="width: 200px"
|
|
|
|
|
- />
|
|
|
|
|
- </el-row>
|
|
|
|
|
- <el-button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- :icon="Search"
|
|
|
|
|
- @click="onSearch"
|
|
|
|
|
- >定位</el-button>
|
|
|
|
|
-
|
|
|
|
|
- <el-button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- :icon="Search"
|
|
|
|
|
- @click="handleShowDetail"
|
|
|
|
|
- >查改</el-button>
|
|
|
|
|
-
|
|
|
|
|
- <el-button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- :icon="Search"
|
|
|
|
|
- @click="handleShowAdd"
|
|
|
|
|
- >新增</el-button>
|
|
|
|
|
-
|
|
|
|
|
- <div style="margin-left: auto;">
|
|
|
|
|
- <el-button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- :icon="Download"
|
|
|
|
|
- @click="exportExcel"
|
|
|
|
|
- >导出到Excel</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <!-- 数据展示 -->
|
|
|
|
|
- <el-table
|
|
|
|
|
- ref="multipleTable"
|
|
|
|
|
- style="width: 100%"
|
|
|
|
|
- tooltip-effect="dark"
|
|
|
|
|
- :data="tableData"
|
|
|
|
|
- row-key="ID"
|
|
|
|
|
- highlight-current-row
|
|
|
|
|
- border
|
|
|
|
|
- show-overflow-tooltip="true"
|
|
|
|
|
- :row-style="{ height: '20px' }"
|
|
|
|
|
- :cell-style="{ padding: '0px' }"
|
|
|
|
|
- :header-row-style="{ height: '20px' }"
|
|
|
|
|
- :header-cell-style="{ padding: '0px' }"
|
|
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
|
|
- @row-click="currentRow = $event"
|
|
|
|
|
- @row-dblclick="handleShowDetail"
|
|
|
|
|
- >
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- type="selection"
|
|
|
|
|
- width="55"
|
|
|
|
|
- />
|
|
|
|
|
-
|
|
|
|
|
- <!-- 循环渲染列 -->
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- v-for=" column in tableColumns "
|
|
|
|
|
- :key="column.prop"
|
|
|
|
|
- :prop="column.prop"
|
|
|
|
|
- :label="column.label"
|
|
|
|
|
- :width="column.width"
|
|
|
|
|
- />
|
|
|
|
|
|
|
|
|
|
- </el-table>
|
|
|
|
|
- <!-- 分页 -->
|
|
|
|
|
- <div class="gva-pagination">
|
|
|
|
|
- <el-pagination
|
|
|
|
|
- v-model:current-page="page"
|
|
|
|
|
- v-model:page-size="limit"
|
|
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
- :page-sizes="[10, 30, 50, 100]"
|
|
|
|
|
- :total="total"
|
|
|
|
|
- @current-change="handleCurrentChange"
|
|
|
|
|
- @size-change="handleSizeChange"
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <!-- 弹出框 -->
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon="edit"
|
|
|
|
|
+ class="bt"
|
|
|
|
|
+ @click="handleShowDetail"
|
|
|
|
|
+ ><i class="el-icon-edit" />查改
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon="edit"
|
|
|
|
|
+ class="bt"
|
|
|
|
|
+ @click="handleShowAdd"
|
|
|
|
|
+ >新增
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 弹出框 -->
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <!-- 详情页 -->
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
v-model="dialogFormVisible"
|
|
v-model="dialogFormVisible"
|
|
|
:before-close="closeDialog"
|
|
:before-close="closeDialog"
|
|
@@ -109,11 +49,12 @@
|
|
|
>
|
|
>
|
|
|
<!-- <el-scrollbar height="500px"> -->
|
|
<!-- <el-scrollbar height="500px"> -->
|
|
|
<el-form
|
|
<el-form
|
|
|
|
|
+ id="detail-form"
|
|
|
ref="elFormRef"
|
|
ref="elFormRef"
|
|
|
:model="detailData"
|
|
:model="detailData"
|
|
|
- :rules="rule"
|
|
|
|
|
label-position="left"
|
|
label-position="left"
|
|
|
inline
|
|
inline
|
|
|
|
|
+ @keyup="moveFocus"
|
|
|
>
|
|
>
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
label="员工编号"
|
|
label="员工编号"
|
|
@@ -135,10 +76,29 @@
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
label="工序类别"
|
|
label="工序类别"
|
|
|
>
|
|
>
|
|
|
- <el-input
|
|
|
|
|
|
|
+ <el-select
|
|
|
v-model="detailData.sczl_Type"
|
|
v-model="detailData.sczl_Type"
|
|
|
style="width: 150px"
|
|
style="width: 150px"
|
|
|
- />
|
|
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ label="拆片"
|
|
|
|
|
+ value="拆片"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ label="包装"
|
|
|
|
|
+ value="包装"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ label="打包"
|
|
|
|
|
+ value="打包"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ label="拉料"
|
|
|
|
|
+ value="拉料"
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item
|
|
<el-form-item
|
|
@@ -169,18 +129,56 @@
|
|
|
label="工艺流程"
|
|
label="工艺流程"
|
|
|
>
|
|
>
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="detailData.image"
|
|
|
|
|
|
|
+ v-model="detailData.jyGx"
|
|
|
style="width: 300px"
|
|
style="width: 300px"
|
|
|
|
|
+ @keyup.enter="handleGylcEnter"
|
|
|
/>
|
|
/>
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="detailData.image"
|
|
|
|
|
|
|
+ v-model="detailData.sczl_gxh"
|
|
|
style="width: 100px; margin-left: 5px"
|
|
style="width: 100px; margin-left: 5px"
|
|
|
|
|
+ readonly
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <br>
|
|
|
|
|
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
|
|
+ v-if="type === '新增'"
|
|
|
|
|
+ label=""
|
|
|
|
|
+ style="margin-left: 67px;"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="leftData"
|
|
|
|
|
+ style="width: 100px"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ v-if="type === '新增'"
|
|
|
|
|
+ label="X"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="rightData"
|
|
|
|
|
+ style="width: 100px;margin-left: 12px;"
|
|
|
|
|
+ @keyup.enter="()=>{detailData.Sczl_cl = (leftData * rightData).toString()}"
|
|
|
|
|
+ @keyup.down="()=>{detailData.Sczl_cl = (leftData * rightData).toString()}"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ v-if="type === '新增'"
|
|
|
label="计件产量"
|
|
label="计件产量"
|
|
|
- style="margin-left: 300px"
|
|
|
|
|
|
|
+ style="margin-left: 30px;"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="detailData.Sczl_cl"
|
|
|
|
|
+ style="width: 100px"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ v-if="type === '查改'"
|
|
|
|
|
+ label="计件产量"
|
|
|
|
|
+ style="margin-left: 400px;"
|
|
|
>
|
|
>
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="detailData.Sczl_cl"
|
|
v-model="detailData.Sczl_cl"
|
|
@@ -225,29 +223,128 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
- </el-main>
|
|
|
|
|
- </el-container>
|
|
|
|
|
- </el-container>
|
|
|
|
|
|
|
+ <!-- 工价代号弹窗 -->
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ v-model="dialogDedh"
|
|
|
|
|
+ :before-close="()=>{dialogDedh = false}"
|
|
|
|
|
+ title="工价代号"
|
|
|
|
|
+ destroy-on-close
|
|
|
|
|
+ >
|
|
|
|
|
+
|
|
|
|
|
+ <el-scrollbar
|
|
|
|
|
+ style="height: 50vh;width: 50vw;"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-tree
|
|
|
|
|
+ :data="dedhTreeData"
|
|
|
|
|
+ highlight-current
|
|
|
|
|
+ style="width: 90%;"
|
|
|
|
|
+ @node-click="handleSelectDjdh"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-scrollbar>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 工艺流程弹窗 -->
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ v-model="dialogGylc"
|
|
|
|
|
+ :before-close="()=>{dialogGylc = false}"
|
|
|
|
|
+ title="工艺流程"
|
|
|
|
|
+ destroy-on-close
|
|
|
|
|
+ >
|
|
|
|
|
+
|
|
|
|
|
+ <el-scrollbar
|
|
|
|
|
+ style="height: 50vh;width: 50vw;"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-tree
|
|
|
|
|
+ :data="gylcTreeData"
|
|
|
|
|
+ highlight-current
|
|
|
|
|
+ style="width: 90%;"
|
|
|
|
|
+ @node-click="handleSelectGylc"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-scrollbar>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ </layout-header>
|
|
|
|
|
+
|
|
|
|
|
+ <layout>
|
|
|
|
|
+ <!-- 左侧树侧形结构-->
|
|
|
|
|
+ <layout-sider
|
|
|
|
|
+ :resize-directions="['right']"
|
|
|
|
|
+ :width="220"
|
|
|
|
|
+ style="margin-right: 10px;"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="JKWTree-tree"
|
|
|
|
|
+ style="height: 70vh;"
|
|
|
|
|
+ >
|
|
|
|
|
+ <h3>其他计件单据维护</h3>
|
|
|
|
|
+ <el-tree
|
|
|
|
|
+ :data="treeData"
|
|
|
|
|
+ highlight-current
|
|
|
|
|
+ @node-click="handleNodeClick"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </layout-sider>
|
|
|
|
|
+
|
|
|
|
|
+ <layout-content>
|
|
|
|
|
+ <!-- 数据展示 -->
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ ref="table"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ tooltip-effect="dark"
|
|
|
|
|
+ :data="tableData"
|
|
|
|
|
+ row-key="ID"
|
|
|
|
|
+ highlight-current-row
|
|
|
|
|
+ border
|
|
|
|
|
+ show-overflow-tooltip="true"
|
|
|
|
|
+ :row-style="{ height: '20px' }"
|
|
|
|
|
+ :cell-style="{ padding: '0px' }"
|
|
|
|
|
+ :header-row-style="{ height: '20px' }"
|
|
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
|
|
+ @row-dblclick="handleShowDetail"
|
|
|
|
|
+ @current-change="(row, oldRow) => { currentRow = row}"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ type="selection"
|
|
|
|
|
+ width="55"
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 循环渲染列 -->
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ v-for=" column in tableColumns "
|
|
|
|
|
+ :key="column.prop"
|
|
|
|
|
+ :prop="column.prop"
|
|
|
|
|
+ :label="column.label"
|
|
|
|
|
+ :width="column.width"
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ <!-- 分页 -->
|
|
|
|
|
+ <div class="gva-pagination">
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ v-model:current-page="page"
|
|
|
|
|
+ v-model:page-size="limit"
|
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
+ :page-sizes="[10, 30, 50, 100]"
|
|
|
|
|
+ :total="total"
|
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </layout-content>
|
|
|
|
|
+ </layout>
|
|
|
|
|
+ </layout>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import {
|
|
|
|
|
- createCompany,
|
|
|
|
|
- deleteCompany,
|
|
|
|
|
- deleteCompanyByIds,
|
|
|
|
|
- updateCompany,
|
|
|
|
|
- findCompany,
|
|
|
|
|
- getCompanyList
|
|
|
|
|
-} from '@/api/company'
|
|
|
|
|
-
|
|
|
|
|
-// 全量引入格式化工具 请按需保留
|
|
|
|
|
-import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
|
|
|
|
|
-import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
-import { Search, Refresh, Download } from '@element-plus/icons-vue'
|
|
|
|
|
-import { ref, reactive, onMounted, onBeforeMount } from 'vue'
|
|
|
|
|
-import { getSide, getTable, getInfo, getOtherInfo, updateData,add } from '@/api/mes_api_gty/otherDocuments'
|
|
|
|
|
|
|
+import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
|
|
|
|
|
+import { ElMessage, dayjs } from 'element-plus'
|
|
|
|
|
+import { ref, reactive } from 'vue'
|
|
|
|
|
+import { getSide, getTable, getYg, getGdmc, getDedh, getGxMc, updateData, add } from '@/api/mes_api_gty/otherDocuments'
|
|
|
|
|
|
|
|
defineOptions({
|
|
defineOptions({
|
|
|
name: '07OtherDocuments'
|
|
name: '07OtherDocuments'
|
|
@@ -274,7 +371,6 @@ const getSideData = async() => {
|
|
|
getSideData()
|
|
getSideData()
|
|
|
|
|
|
|
|
const elFormRef = ref()
|
|
const elFormRef = ref()
|
|
|
-const elSearchFormRef = ref()
|
|
|
|
|
|
|
|
|
|
// ============== 表格页面 ==============
|
|
// ============== 表格页面 ==============
|
|
|
const tableColumns = [
|
|
const tableColumns = [
|
|
@@ -286,7 +382,7 @@ const tableColumns = [
|
|
|
{ prop: 'Gd_cpmc', label: '产品名称', width: '300' },
|
|
{ prop: 'Gd_cpmc', label: '产品名称', width: '300' },
|
|
|
{ prop: 'Sczl_cl', label: '产量', width: '100' },
|
|
{ prop: 'Sczl_cl', label: '产量', width: '100' },
|
|
|
{ prop: '', label: '千件工价', width: '100' }, // prop 属性值需要补充
|
|
{ prop: '', label: '千件工价', width: '100' }, // prop 属性值需要补充
|
|
|
- { prop: '', label: '工价备注', width: '200' }, // prop 属性值需要补充
|
|
|
|
|
|
|
+ { prop: 'sys_mc', label: '工价备注', width: '200' }, // prop 属性值需要补充
|
|
|
{ prop: 'Sczl_desc', label: '备注', width: '100' },
|
|
{ prop: 'Sczl_desc', label: '备注', width: '100' },
|
|
|
{ prop: 'Sczl_gxmc', label: '工序名称', width: '100' },
|
|
{ prop: 'Sczl_gxmc', label: '工序名称', width: '100' },
|
|
|
{ prop: 'sczl_yjno', label: '印件号', width: '100' },
|
|
{ prop: 'sczl_yjno', label: '印件号', width: '100' },
|
|
@@ -297,7 +393,7 @@ const tableColumns = [
|
|
|
{ prop: 'UniqId', label: 'UNIQID', width: '100' }
|
|
{ prop: 'UniqId', label: 'UNIQID', width: '100' }
|
|
|
]
|
|
]
|
|
|
const tableData = reactive([])
|
|
const tableData = reactive([])
|
|
|
-const currentRow = ref({})
|
|
|
|
|
|
|
+const currentRow = ref()
|
|
|
const type = ref('')
|
|
const type = ref('')
|
|
|
|
|
|
|
|
const page = ref(1)
|
|
const page = ref(1)
|
|
@@ -312,6 +408,11 @@ const params = {
|
|
|
limit: limit.value.toString(),
|
|
limit: limit.value.toString(),
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const table = ref()
|
|
|
|
|
+const setCurrent = (row) => {
|
|
|
|
|
+ table.value?.setCurrentRow(row)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 获取表格数据
|
|
// 获取表格数据
|
|
|
const getTableData = async() => {
|
|
const getTableData = async() => {
|
|
|
try {
|
|
try {
|
|
@@ -319,6 +420,7 @@ const getTableData = async() => {
|
|
|
if (response.code === 0) {
|
|
if (response.code === 0) {
|
|
|
total.value = response.data.total
|
|
total.value = response.data.total
|
|
|
tableData.splice(0, tableData.length, ...response.data.rows)
|
|
tableData.splice(0, tableData.length, ...response.data.rows)
|
|
|
|
|
+ setCurrent(tableData[0])
|
|
|
}
|
|
}
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
console.log(e)
|
|
console.log(e)
|
|
@@ -349,7 +451,7 @@ const handleNodeClick = (node, check) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 搜索
|
|
// 搜索
|
|
|
-function onSearch() {
|
|
|
|
|
|
|
+function handleSearch() {
|
|
|
params.order = searchInfo.value
|
|
params.order = searchInfo.value
|
|
|
params.date = ''
|
|
params.date = ''
|
|
|
params.Sczl_bh1 = ''
|
|
params.Sczl_bh1 = ''
|
|
@@ -359,56 +461,121 @@ function onSearch() {
|
|
|
|
|
|
|
|
// ============== 详情页面 ==============
|
|
// ============== 详情页面 ==============
|
|
|
const detailData = reactive({})
|
|
const detailData = reactive({})
|
|
|
|
|
+const leftData = ref(0)
|
|
|
|
|
+const rightData = ref(0)
|
|
|
|
|
+const dedhTreeData = ref()
|
|
|
|
|
+const gylcTreeData = ref()
|
|
|
|
|
|
|
|
// 弹窗控制标记
|
|
// 弹窗控制标记
|
|
|
const dialogFormVisible = ref(false)
|
|
const dialogFormVisible = ref(false)
|
|
|
|
|
+const dialogDedh = ref(false)
|
|
|
|
|
+const dialogGylc = ref(false)
|
|
|
// 新增数据
|
|
// 新增数据
|
|
|
const handleShowAdd = () => {
|
|
const handleShowAdd = () => {
|
|
|
- type.value = '新增'
|
|
|
|
|
- Object.assign(detailData, currentRow.value)
|
|
|
|
|
- dialogFormVisible.value = true
|
|
|
|
|
|
|
+ if (!currentRow.value) {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'info',
|
|
|
|
|
+ message: '请选择一条数据'
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ type.value = '新增'
|
|
|
|
|
+ Object.assign(detailData, currentRow.value)
|
|
|
|
|
+ // dialogFormVisible.value = true
|
|
|
|
|
+ const date = dayjs().format('YYYY-MM-DD')
|
|
|
|
|
+ detailData.Sczl_rq = date
|
|
|
|
|
+ showDialog()
|
|
|
}
|
|
}
|
|
|
// 查改
|
|
// 查改
|
|
|
const handleShowDetail = () => {
|
|
const handleShowDetail = () => {
|
|
|
type.value = '查改'
|
|
type.value = '查改'
|
|
|
Object.assign(detailData, currentRow.value)
|
|
Object.assign(detailData, currentRow.value)
|
|
|
- console.log(detailData)
|
|
|
|
|
- console.log(currentRow.value)
|
|
|
|
|
- dialogFormVisible.value = true
|
|
|
|
|
|
|
+ // dialogFormVisible.value = true
|
|
|
|
|
+ showDialog()
|
|
|
}
|
|
}
|
|
|
const handleYgbhEnter = async() => {
|
|
const handleYgbhEnter = async() => {
|
|
|
- const res = await getOtherInfo({ Sczl_bh1: detailData.Sczl_bh1 })
|
|
|
|
|
|
|
+ const res = await getYg({ sczl_bh: detailData.Sczl_bh1 })
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
- detailData.name = res.data.name
|
|
|
|
|
|
|
+ detailData.name = res.data.ygxm
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const handleGdbhEnter = async() => {
|
|
const handleGdbhEnter = async() => {
|
|
|
- const res = await getOtherInfo({ Sczl_gdbh: detailData.sczl_gdbh })
|
|
|
|
|
|
|
+ const res = await getGdmc({ gdbh: detailData.sczl_gdbh })
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
- detailData.Gd_cpmc = res.data.name
|
|
|
|
|
|
|
+ detailData.Gd_cpmc = res.data.Gd_cpmc
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const handleGylcEnter = async() => {
|
|
|
|
|
+ const res = await getGxMc({ gdbh: detailData.sczl_gdbh, keyword: '' })
|
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
|
+ const ret = res.data.map(item => ({
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ label: item['jyGx'],
|
|
|
|
|
+ }))
|
|
|
|
|
+ gylcTreeData.value = ret
|
|
|
|
|
+ dialogGylc.value = true
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const handleSelectGylc = (node, check) => {
|
|
|
|
|
+ detailData.jyGx = node['jyGx']
|
|
|
|
|
+ detailData.sczl_gxh = node['Gy0_gxh']
|
|
|
|
|
+ dialogGylc.value = false
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const handleGjdhEnter = async() => {
|
|
const handleGjdhEnter = async() => {
|
|
|
- const res = await getOtherInfo({ Sczl_dedh: detailData.Sczl_dedh })
|
|
|
|
|
|
|
+ const res = await getDedh({ sczl_jtbh: '' })
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
- detailData.aaaa = res.data.name
|
|
|
|
|
|
|
+ const { data } = res
|
|
|
|
|
+
|
|
|
|
|
+ const transformData = (data) => {
|
|
|
|
|
+ if (Array.isArray(data)) {
|
|
|
|
|
+ return data.map((item) => transformData(item))
|
|
|
|
|
+ } else if (typeof data === 'object') {
|
|
|
|
|
+ const { Key_, sys_bh, sys_mc, bh_mc } = data
|
|
|
|
|
+ const label = `${sys_bh}【${sys_mc}】`
|
|
|
|
|
+ const node = { Key_, sys_bh, sys_mc, label }
|
|
|
|
|
+
|
|
|
|
|
+ if (bh_mc) {
|
|
|
|
|
+ node.children = transformData(bh_mc)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return node
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return data
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const temp = []
|
|
|
|
|
+ temp[0] = transformData(data)
|
|
|
|
|
+ dedhTreeData.value = temp
|
|
|
|
|
+ console.log(temp)
|
|
|
|
|
+ dialogDedh.value = true
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const handleSelectDjdh = (node, check) => {
|
|
|
|
|
+ if (!node['children']) {
|
|
|
|
|
+ console.log(node)
|
|
|
|
|
+ const { sys_bh, sys_mc } = node
|
|
|
|
|
+ detailData.sys_bh = sys_bh
|
|
|
|
|
+ detailData.sys_mc = sys_mc
|
|
|
|
|
+ dialogDedh.value = false
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 弹窗确定
|
|
// 弹窗确定
|
|
|
const enterDialog = async() => {
|
|
const enterDialog = async() => {
|
|
|
-
|
|
|
|
|
- if (type.value === '查改') {
|
|
|
|
|
- updateDetailData()
|
|
|
|
|
- } else if (type.value === '新增') {
|
|
|
|
|
- addDetailData()
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-//新增
|
|
|
|
|
|
|
+ if (type.value === '查改') {
|
|
|
|
|
+ updateDetailData()
|
|
|
|
|
+ } else if (type.value === '新增') {
|
|
|
|
|
+ addDetailData()
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+// 新增
|
|
|
const addDetailData = async() => {
|
|
const addDetailData = async() => {
|
|
|
-
|
|
|
|
|
const restoredData = {
|
|
const restoredData = {
|
|
|
Sys_id: '[1009/李美芬]',
|
|
Sys_id: '[1009/李美芬]',
|
|
|
Sczl_bh1: detailData.Sczl_bh1,
|
|
Sczl_bh1: detailData.Sczl_bh1,
|
|
@@ -418,9 +585,9 @@ const addDetailData = async() => {
|
|
|
Sczl_gdbh: detailData.sczl_gdbh,
|
|
Sczl_gdbh: detailData.sczl_gdbh,
|
|
|
Sczl_gxmc: detailData.Sczl_gxmc,
|
|
Sczl_gxmc: detailData.Sczl_gxmc,
|
|
|
sczl_gxh: detailData.sczl_gxh,
|
|
sczl_gxh: detailData.sczl_gxh,
|
|
|
- Sczl_cl: detailData.Sczl_cl,
|
|
|
|
|
- Sczl_dedh: detailData.sys_bh,
|
|
|
|
|
- Sczl_desc: detailData.Sczl_desc,
|
|
|
|
|
|
|
+ Sczl_cl: detailData.Sczl_cl,
|
|
|
|
|
+ Sczl_dedh: detailData.sys_bh,
|
|
|
|
|
+ Sczl_desc: detailData.Sczl_desc,
|
|
|
}
|
|
}
|
|
|
console.log(restoredData)
|
|
console.log(restoredData)
|
|
|
const res = await add(restoredData)
|
|
const res = await add(restoredData)
|
|
@@ -433,112 +600,87 @@ const addDetailData = async() => {
|
|
|
})
|
|
})
|
|
|
dialogFormVisible.value = false
|
|
dialogFormVisible.value = false
|
|
|
}
|
|
}
|
|
|
|
|
+ getSideData()
|
|
|
}
|
|
}
|
|
|
-//修改
|
|
|
|
|
|
|
+// 修改
|
|
|
const updateDetailData = async() => {
|
|
const updateDetailData = async() => {
|
|
|
- const params = {
|
|
|
|
|
- UniqId: detailData.UniqId,
|
|
|
|
|
- Sczl_bh1: detailData.Sczl_bh1,
|
|
|
|
|
- sczl_Type: detailData.sczl_Type,
|
|
|
|
|
- Sczl_rq: detailData.Sczl_rq,
|
|
|
|
|
- Sczl_gdbh: detailData.sczl_gdbh,
|
|
|
|
|
- Sczl_gxmc: '',
|
|
|
|
|
- sczl_gxh: detailData.sczl_gxh,
|
|
|
|
|
- Sczl_cl: detailData.Sczl_cl,
|
|
|
|
|
- Sczl_dedh: '',
|
|
|
|
|
- Sczl_desc: detailData.Sczl_desc,
|
|
|
|
|
- }
|
|
|
|
|
- const res = await updateData(params)
|
|
|
|
|
- if (res.code === 0) {
|
|
|
|
|
- ElMessage({
|
|
|
|
|
- type: 'success',
|
|
|
|
|
- message: '更新成功',
|
|
|
|
|
- })
|
|
|
|
|
- dialogFormVisible.value = false
|
|
|
|
|
- params.order = ''
|
|
|
|
|
- // page.value = 1
|
|
|
|
|
- handleCurrentChange()
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-// 获取需要的字典 可能为空 按需保留
|
|
|
|
|
-const setOptions = async() => {
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 获取需要的字典 可能为空 按需保留
|
|
|
|
|
-setOptions()
|
|
|
|
|
-
|
|
|
|
|
-// 多选数据
|
|
|
|
|
-const multipleSelection = ref([])
|
|
|
|
|
-// 多选
|
|
|
|
|
-const handleSelectionChange = (val) => {
|
|
|
|
|
- multipleSelection.value = val
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 批量删除控制标记
|
|
|
|
|
-const deleteVisible = ref(false)
|
|
|
|
|
-
|
|
|
|
|
-// 多选删除
|
|
|
|
|
-const onDelete = async() => {
|
|
|
|
|
- const ids = []
|
|
|
|
|
- if (multipleSelection.value.length === 0) {
|
|
|
|
|
- ElMessage({
|
|
|
|
|
- type: 'warning',
|
|
|
|
|
- message: '请选择要删除的数据'
|
|
|
|
|
- })
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ UniqId: detailData.UniqId,
|
|
|
|
|
+ Sczl_bh1: detailData.Sczl_bh1,
|
|
|
|
|
+ sczl_Type: detailData.sczl_Type,
|
|
|
|
|
+ Sczl_rq: detailData.Sczl_rq,
|
|
|
|
|
+ Sczl_gdbh: detailData.sczl_gdbh,
|
|
|
|
|
+ Sczl_gxmc: '',
|
|
|
|
|
+ sczl_gxh: detailData.sczl_gxh,
|
|
|
|
|
+ Sczl_cl: detailData.Sczl_cl,
|
|
|
|
|
+ Sczl_dedh: '',
|
|
|
|
|
+ Sczl_desc: detailData.Sczl_desc,
|
|
|
}
|
|
}
|
|
|
- multipleSelection.value &&
|
|
|
|
|
- multipleSelection.value.map(item => {
|
|
|
|
|
- ids.push(item.ID)
|
|
|
|
|
- })
|
|
|
|
|
- const res = await deleteCompanyByIds({ ids })
|
|
|
|
|
|
|
+ const res = await updateData(params)
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
ElMessage({
|
|
ElMessage({
|
|
|
type: 'success',
|
|
type: 'success',
|
|
|
- message: '删除成功'
|
|
|
|
|
|
|
+ message: '更新成功',
|
|
|
})
|
|
})
|
|
|
- if (tableData.value.length === ids.length && page.value > 1) {
|
|
|
|
|
- page.value--
|
|
|
|
|
- }
|
|
|
|
|
- deleteVisible.value = false
|
|
|
|
|
- getTableData()
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 更新行
|
|
|
|
|
-const updateCompanyFunc = async(row) => {
|
|
|
|
|
- const res = await findCompany({ ID: row.ID })
|
|
|
|
|
- type.value = 'update'
|
|
|
|
|
- if (res.code === 0) {
|
|
|
|
|
- detailData.value = res.data.recompany
|
|
|
|
|
- dialogFormVisible.value = true
|
|
|
|
|
|
|
+ dialogFormVisible.value = false
|
|
|
|
|
+ params.order = ''
|
|
|
|
|
+ // page.value = 1
|
|
|
|
|
+ handleCurrentChange()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 打开弹窗
|
|
|
|
|
-const openDialog = () => {
|
|
|
|
|
- type.value = 'create'
|
|
|
|
|
|
|
+// 开启弹窗
|
|
|
|
|
+const showDialog = () => {
|
|
|
dialogFormVisible.value = true
|
|
dialogFormVisible.value = true
|
|
|
|
|
+ // 在 setTimeout 中获取元素,确保在 DOM 渲染完毕后执行
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ formElements = document.getElementById('detail-form').elements
|
|
|
|
|
+ formElements[0].focus()
|
|
|
|
|
+ }, 0)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 关闭弹窗
|
|
// 关闭弹窗
|
|
|
const closeDialog = () => {
|
|
const closeDialog = () => {
|
|
|
dialogFormVisible.value = false
|
|
dialogFormVisible.value = false
|
|
|
- detailData.value = {
|
|
|
|
|
- address: '',
|
|
|
|
|
- image: '',
|
|
|
|
|
- name: '',
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 导出excel
|
|
|
|
|
-function exportExcel() {
|
|
|
|
|
- console.log('导出到excel')
|
|
|
|
|
|
|
+let formElements
|
|
|
|
|
+const moveFocus = (event) => {
|
|
|
|
|
+ const index = Array.from(formElements).indexOf(event.target)
|
|
|
|
|
+ const key = event.key
|
|
|
|
|
+ event.preventDefault()
|
|
|
|
|
+ switch (index) {
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ if (key === 'ArrowDown') {
|
|
|
|
|
+ formElements[1].focus()
|
|
|
|
|
+ } else if (key === 'ArrowUp') {
|
|
|
|
|
+ formElements[formElements.length - 1].focus()
|
|
|
|
|
+ } else if (key === 'Enter') {
|
|
|
|
|
+ formElements[1].focus()
|
|
|
|
|
+ }
|
|
|
|
|
+ break
|
|
|
|
|
+
|
|
|
|
|
+ case formElements.length - 1 :
|
|
|
|
|
+ if (key === 'ArrowDown') {
|
|
|
|
|
+ formElements[0].focus()
|
|
|
|
|
+ } else if (key === 'ArrowUp') {
|
|
|
|
|
+ formElements[index - 1].focus()
|
|
|
|
|
+ } else if (key === 'Enter') {
|
|
|
|
|
+ formElements[0].focus()
|
|
|
|
|
+ }
|
|
|
|
|
+ break
|
|
|
|
|
+
|
|
|
|
|
+ default:
|
|
|
|
|
+ if (key === 'ArrowDown') {
|
|
|
|
|
+ formElements[index + 1].focus()
|
|
|
|
|
+ } else if (key === 'ArrowUp') {
|
|
|
|
|
+ formElements[index - 1].focus()
|
|
|
|
|
+ } else if (key === 'Enter') {
|
|
|
|
|
+ formElements[index + 1].focus()
|
|
|
|
|
+ }
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-// 生命周期钩子
|
|
|
|
|
-onMounted(() => {
|
|
|
|
|
-})
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
@@ -547,7 +689,7 @@ onMounted(() => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.JKWTree-tree {
|
|
.JKWTree-tree {
|
|
|
- width: 300px;
|
|
|
|
|
|
|
+ width: 100%;
|
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
|
padding: 10px;
|
|
padding: 10px;
|
|
|
margin-right: 20px;
|
|
margin-right: 20px;
|
|
@@ -568,3 +710,36 @@ onMounted(() => {
|
|
|
background: #ff80ff !important;
|
|
background: #ff80ff !important;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped>
|
|
|
|
|
+:deep(.el-table td .cell) {
|
|
|
|
|
+ line-height: 25px !important;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+:deep(.el-tabs__header) {
|
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.search {
|
|
|
|
|
+ margin-left: 0px !important;
|
|
|
|
|
+ margin-right: 10px !important;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.bt {
|
|
|
|
|
+ margin-left: 2px !important;
|
|
|
|
|
+ padding: 3px !important;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.el-tabs__header {
|
|
|
|
|
+ margin: 0px !important;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.gva-table-box {
|
|
|
|
|
+ padding: 0px !important;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.mab {
|
|
|
|
|
+ margin-bottom: 5px;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|