|
|
@@ -7,10 +7,11 @@
|
|
|
<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"></el-input>
|
|
|
+ <el-button type="primary" class="bt" icon="search" @click="search">搜索</el-button>
|
|
|
<el-button type="primary" class="bt" icon="download" @click="search">维修工时统计</el-button>
|
|
|
<el-button type="primary" class="bt" icon="download" @click="hzToExcel" >设备运行时间统计</el-button>
|
|
|
<el-button type="primary" class="bt" icon="download" @click="hzToExcel" >导出到Excel</el-button>
|
|
|
- <el-button type="primary" class="bt" icon="search" @click="search">搜索</el-button>
|
|
|
+ <el-button type="primary" class="bt" @click="onADD" >新增</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
@@ -40,51 +41,29 @@
|
|
|
@selection-change="selectionChange($event)"
|
|
|
:row-style="{ height: '20px' }" :selectable="checkboxT"
|
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
- :header-cell-style="{ padding: '0px' }" @row-click="pchzRowClick"
|
|
|
+ :header-cell-style="{ padding: '0px' }" @row-click="wxyearRowClick"
|
|
|
:row-class-name="pchzrowClassStyle"
|
|
|
highlight-current-row="true" @row-dblclick="gytableDatadoubleClick" id="pchztable"
|
|
|
style="width: 100%;height: 30vh" border tooltip-effect="dark" :data="yeartableData" row-key="ID" >
|
|
|
<el-table-column sortable align="center" label="使用部门" prop="使用部门" width="120" />
|
|
|
<el-table-column sortable align="center" label="设备编号" prop="设备编号" width="130" />
|
|
|
- <el-table-column align="center" label="设备名称" prop="设备名称" width="60" />
|
|
|
- <el-table-column v-if="yearcode === 1" align="center" label="维修次数" prop="维修次数" width="70" />
|
|
|
- <el-table-column v-else-if="yearcode === 2" align="center" label="保养次数" prop="保养次数" width="70" />
|
|
|
- <el-table-column align="center" label="1月" prop="1月" width="90" />
|
|
|
- <el-table-column align="center" label="2月" prop="2月" width="90" />
|
|
|
- <el-table-column align="center" label="3月" prop="3月" width="90" />
|
|
|
- <el-table-column align="center" label="4月" prop="4月" width="110" />
|
|
|
- <el-table-column align="center" label="5月" prop="5月" width="110" />
|
|
|
- <el-table-column align="center" label="6月" prop="6月" width="140" />
|
|
|
- <el-table-column align="center" label="7月" prop="7月" width="200" />
|
|
|
- <el-table-column align="center" label="8月" prop="8月" width="110" />
|
|
|
- <el-table-column align="center" label="9月" prop="9月" width="200" />
|
|
|
- <el-table-column align="center" label="10月" prop="10月" width="200" />
|
|
|
- <el-table-column align="center" label="11月" prop="11月" width="200" />
|
|
|
- <el-table-column align="center" label="12月" prop="12月" width="200" />
|
|
|
+ <el-table-column align="center" label="设备名称" prop="设备名称" width="220" />
|
|
|
+ <el-table-column v-if="yearcode === 1" align="center" label="维修次数" prop="total" width="90" />
|
|
|
+ <el-table-column v-else-if="yearcode === 2" align="center" label="保养次数" prop="total" width="90" />
|
|
|
+ <el-table-column align="center" label="1月" prop="01" width="70" />
|
|
|
+ <el-table-column align="center" label="2月" prop="02" width="70" />
|
|
|
+ <el-table-column align="center" label="3月" prop="03" width="70" />
|
|
|
+ <el-table-column align="center" label="4月" prop="04" width="70" />
|
|
|
+ <el-table-column align="center" label="5月" prop="05" width="70" />
|
|
|
+ <el-table-column align="center" label="6月" prop="06" width="70" />
|
|
|
+ <el-table-column align="center" label="7月" prop="07" width="70" />
|
|
|
+ <el-table-column align="center" label="8月" prop="08" width="70" />
|
|
|
+ <el-table-column align="center" label="9月" prop="09" width="70" />
|
|
|
+ <el-table-column align="center" label="10月" prop="10" width="70" />
|
|
|
+ <el-table-column align="center" label="11月" prop="11" width="70" />
|
|
|
+ <el-table-column align="center" label="12月" prop="12" width="70" />
|
|
|
</el-table>
|
|
|
|
|
|
- <el-table ref="JPmultipleTable"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- @selection-change="selectionChange($event)"
|
|
|
- :row-style="{ height: '20px' }" :row-class-name="totalClassName" :cell-class-name="tableDataCellClass"
|
|
|
- :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
- :header-cell-style="{ padding: '0px' }" @row-click="getUid"
|
|
|
- highlight-current-row="true" @row-dblclick="JPgytableDatadoubleClick" id="pcmxtable"
|
|
|
- style="width: 100%;height: 45vh" border tooltip-effect="dark" :data="pcmxtableData" row-key="ID" >
|
|
|
- <el-table-column align="left" fixed label="日期" prop="日期" width="110"/>
|
|
|
- <el-table-column align="left" fixed label="交易类别" prop="交易类别" width="90"/>
|
|
|
- <el-table-column align="left" fixed label="领用部门" prop="领用部门" width="70"/>
|
|
|
- <el-table-column align="left" label="机台编号" prop="机台编号" width="90"/>
|
|
|
- <el-table-column align="left" label="仓库编号" prop="仓库编号" width="70"/>
|
|
|
- <el-table-column align="left" label="仓库名称" prop="仓库名称" width="120"/>
|
|
|
- <el-table-column align="left" label="物料编号" prop="物料编号" width="70"/>
|
|
|
- <el-table-column align="left" label="物料名称" prop="物料名称" width="120"/>
|
|
|
- <el-table-column align="left" label="领用数量" prop="领用数量" width="90"/>
|
|
|
- <el-table-column align="left" label="领用单位" prop="领用单位" width="110"/>
|
|
|
- <el-table-column align="left" label="领用单价" prop="领用单价" width="90"/>
|
|
|
- <el-table-column align="left" label="金额" prop="金额" width="110"/>
|
|
|
- <el-table-column align="left" label="备注" prop="备注" width="110"/>
|
|
|
- </el-table>
|
|
|
|
|
|
|
|
|
<el-table ref="multipleTable"
|
|
|
@@ -95,14 +74,14 @@
|
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
:header-cell-style="{ padding: '0px' }" @row-click="sbhzRowClick"
|
|
|
highlight-current-row="true" @row-dblclick="gytableDatadoubleClick" id="sbhztable"
|
|
|
- style="width: 100%;height: 30vh" border tooltip-effect="dark" :data="sbhztableData" row-key="ID" >
|
|
|
+ style="width: 100%;height: 30vh" border tooltip-effect="dark" :data="wxmonthtableData" row-key="ID" >
|
|
|
<el-table-column fixed align="left" label="设备编号" prop="设备编号" width="90"/>
|
|
|
- <el-table-column fixed align="left" label="设备名称" prop="设备名称" width="70"/>
|
|
|
- <el-table-column align="left" label="报障时间" prop="报障时间" width="85"/>
|
|
|
- <el-table-column align="left" label="维修受理时间" prop="维修受理时间" width="85"/>
|
|
|
- <el-table-column align="left" label="修复时间" prop="修复时间" width="85"/>
|
|
|
- <el-table-column align="left" label="故障维修工时" prop="故障维修工时" width="85"/>
|
|
|
- <el-table-column align="left" label="非故障微信工时" prop="非故障微信工时" width="95"/>
|
|
|
+ <el-table-column fixed align="left" label="设备名称" prop="设备名称" width="220"/>
|
|
|
+ <el-table-column align="left" label="报障时间" prop="报障时间" width="120"/>
|
|
|
+ <el-table-column align="left" label="维修受理时间" prop="维修受理时间" width="120"/>
|
|
|
+ <el-table-column align="left" label="修复时间" prop="修复时间" width="120"/>
|
|
|
+ <el-table-column align="left" label="故障维修工时" prop="故障维修工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="非故障维修工时" prop="非故障维修工时" width="125"/>
|
|
|
<el-table-column align="left" label="计划维修工时" prop="计划维修工时" width="110"/>
|
|
|
<el-table-column align="left" label="专项维修工时" prop="专项维修工时" width="110"/>
|
|
|
<el-table-column align="left" label="验收情况" prop="验收情况" width="110"/>
|
|
|
@@ -111,8 +90,8 @@
|
|
|
<el-table-column align="left" label="处理方法" prop="处理方法" width="110"/>
|
|
|
<el-table-column align="left" label="使用部门" prop="使用部门" width="110"/>
|
|
|
<el-table-column align="left" label="创建用户" prop="创建用户" width="110"/>
|
|
|
- <el-table-column align="left" label="创建时间" prop="创建时间" width="110"/>
|
|
|
- <el-table-column align="left" label="修改时间" prop="修改时间" width="110"/>
|
|
|
+ <el-table-column align="left" label="创建时间" prop="创建时间" width="120"/>
|
|
|
+ <el-table-column align="left" label="修改时间" prop="修改时间" width="120"/>
|
|
|
</el-table>
|
|
|
|
|
|
<el-table ref="JPmultipleTable"
|
|
|
@@ -124,7 +103,7 @@
|
|
|
:header-cell-style="{ padding: '0px' }" @row-click="sbmxRowClick"
|
|
|
:row-class-name="sbmxrowClassStyle"
|
|
|
highlight-current-row="true" @row-dblclick="JPgytableDatadoubleClick" id="sbmxtable"
|
|
|
- style="width: 100%;height: 45vh" border tooltip-effect="dark" :data="sbmxtableData" row-key="ID" >
|
|
|
+ style="width: 100%;height: 45vh" border tooltip-effect="dark" :data="bymonthtableData" row-key="ID" >
|
|
|
<el-table-column align="left" label="设备编号" prop="设备编号" width="100" />
|
|
|
<el-table-column align="left" label="设备名称" prop="设备名称" width="200" />
|
|
|
<el-table-column align="left" label="使用部门" prop="使用部门" width="100" />
|
|
|
@@ -141,8 +120,256 @@
|
|
|
<el-table-column align="left" label="创建用户" prop="创建用户" width="100" />
|
|
|
<el-table-column align="left" label="创建时间" prop="创建时间" width="150" />
|
|
|
</el-table>
|
|
|
+
|
|
|
+ <el-table ref="JPmultipleTable"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ @selection-change="selectionChange($event)"
|
|
|
+ :row-style="{ height: '20px' }" :row-class-name="totalClassName" :cell-class-name="tableDataCellClass"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }" @row-click="getUid"
|
|
|
+ highlight-current-row="true" @row-dblclick="JPgytableDatadoubleClick" id="pcmxtable"
|
|
|
+ style="width: 100%;height: 45vh" border tooltip-effect="dark" :data="pcmxtableData" row-key="ID" >
|
|
|
+ <el-table-column align="left" fixed label="日期" prop="日期" width="110"/>
|
|
|
+ <el-table-column align="left" fixed label="交易类别" prop="交易类别" width="90"/>
|
|
|
+ <el-table-column align="left" fixed label="领用部门" prop="领用部门" width="90"/>
|
|
|
+ <el-table-column align="left" label="机台编号" prop="机台编号" width="90"/>
|
|
|
+ <el-table-column align="left" label="仓库编号" prop="仓库编号" width="90"/>
|
|
|
+ <el-table-column align="left" label="仓库名称" prop="仓库名称" width="120"/>
|
|
|
+ <el-table-column align="left" label="物料编号" prop="物料编号" width="90"/>
|
|
|
+ <el-table-column align="left" label="物料名称" prop="物料名称" width="120"/>
|
|
|
+ <el-table-column align="left" label="领用数量" prop="领用数量" width="90"/>
|
|
|
+ <el-table-column align="left" label="领用单位" prop="领用单位" width="110"/>
|
|
|
+ <el-table-column align="left" label="领用单价" prop="领用单价" width="90"/>
|
|
|
+ <el-table-column align="left" label="金额" prop="金额" width="110"/>
|
|
|
+ <el-table-column align="left" label="备注" prop="备注" width="110"/>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
+<!-- 设备维修记录弹出框 -->
|
|
|
+<el-dialog
|
|
|
+ v-model="dialogFormVisible"
|
|
|
+ :before-close="closeDialog"
|
|
|
+ :title="type === 'create' ? '设备维修记录新增' : '设备维修记录修改'"
|
|
|
+ destroy-on-close
|
|
|
+ style="width: 60%; margin: 5vh auto;"
|
|
|
+>
|
|
|
+ <el-form :model="repairForm" label-width="120px">
|
|
|
+ <!-- 第一行:部门 -->
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="部门">
|
|
|
+ <el-input v-model="repairForm.部门" @keyup.enter="getbm()" placeholder="请输入部门" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- 第二行:设备信息 -->
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="设备编号">
|
|
|
+ <el-input v-model="repairForm.设备编号"@keyup.enter="getsb()" placeholder="请输入设备编号" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="设备名称">
|
|
|
+ <el-input v-model="repairForm.设备名称" placeholder="请输入设备名称" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- 第三行:故障信息 -->
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="故障报告时间">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="repairForm.故障报告时间"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择故障报告时间"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="机长">
|
|
|
+ <el-input
|
|
|
+ v-model="repairForm.code5"
|
|
|
+ @keyup.enter.native="() => openEmployeeDialog('code5')"
|
|
|
+ placeholder="请输入编号或首字母缩写"
|
|
|
+ />
|
|
|
+ <el-input v-model="repairForm.name5" readonly />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-form-item label="故障现象">
|
|
|
+ <el-input
|
|
|
+ v-model="repairForm.故障现象"
|
|
|
+ type="textarea"
|
|
|
+ :rows="3"
|
|
|
+ placeholder="请输入故障现象"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <!-- 第四行:维修信息 -->
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="维修性质">
|
|
|
+ <el-select v-model="repairForm.维修性质" placeholder="请选择维修性质" style="width: 100%">
|
|
|
+ <el-option label="故障维修" value="故障维修" />
|
|
|
+ <el-option label="非故障维修" value="非故障维修" />
|
|
|
+ <el-option label="计划维修" value="计划维修" />
|
|
|
+ <el-option label="专项维修" value="专项维修" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- 第五行:时间信息 -->
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="维修受理时间">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="repairForm.维修受理时间"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择维修受理时间"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="等配件时间">
|
|
|
+ <el-input v-model="repairForm.等配件时间" placeholder="请输入等配件时间" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="修复时间">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="repairForm.修复时间"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择修复时间"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- 第六行:维修人员 -->
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="维修人员">
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="3" v-for="index in 4" :key="index">
|
|
|
+ <el-input
|
|
|
+ v-model="repairForm[`code${index}`]"
|
|
|
+ @keyup.enter.native="() => openEmployeeDialog(`code${index}`)"
|
|
|
+ :placeholder="'维修人员' + index"
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ v-model="repairForm[`name${index}`]"
|
|
|
+ readonly
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+</el-row>
|
|
|
+
|
|
|
+ <!-- 第七行:分析措施 -->
|
|
|
+ <el-form-item label="原因分析及措施">
|
|
|
+ <el-input
|
|
|
+ v-model="repairForm.原因分析及措施"
|
|
|
+ type="textarea"
|
|
|
+ :rows="3"
|
|
|
+ placeholder="请输入原因分析及维修措施"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <!-- 第八行:工时信息 -->
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="实际维修工时">
|
|
|
+ <el-input v-model="repairForm.实际维修工时" placeholder="请输入实际维修工时" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="设备故障总工时">
|
|
|
+ <el-input v-model="repairForm.设备故障总工时" placeholder="请输入设备故障总工时" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- 第九行:验收信息 -->
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="验收人">
|
|
|
+ <el-input v-model="repairForm.验收人" placeholder="请输入验收人" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="验收情况">
|
|
|
+ <el-input v-model="repairForm.验收情况" placeholder="请输入验收情况" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <!-- 弹窗底部按钮 -->
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer" style="width: 100%;">
|
|
|
+ <el-button @click="closeDialog" style="width: 100px; height: 40px;">关 闭</el-button>
|
|
|
+ <el-button type="primary" @click="enterDialog" style="width: 100px; height: 40px;">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+</el-dialog>
|
|
|
+
|
|
|
+<!-- 选择部门弹出框 -->
|
|
|
+<el-dialog
|
|
|
+ v-model="deptDialogVisible"
|
|
|
+ title="选择部门"
|
|
|
+ width="30%"
|
|
|
+>
|
|
|
+ <el-tree
|
|
|
+ :data="deptTreeData"
|
|
|
+ :props="defaultProps"
|
|
|
+ @node-click="handleDeptSelect"
|
|
|
+ highlight-current
|
|
|
+ />
|
|
|
+</el-dialog>
|
|
|
+
|
|
|
+<!-- 选择设备弹窗 -->
|
|
|
+<el-dialog
|
|
|
+ v-model="deviceDialogVisible"
|
|
|
+ title="选择设备"
|
|
|
+ width="40%"
|
|
|
+>
|
|
|
+ <el-table
|
|
|
+ :data="deviceList"
|
|
|
+ highlight-current-row
|
|
|
+ @row-click="handleDeviceSelect"
|
|
|
+ style="height: 400px; overflow: auto;"
|
|
|
+ >
|
|
|
+ <el-table-column prop="id" label="设备编号" width="180" />
|
|
|
+ <el-table-column prop="name" label="设备名称" />
|
|
|
+ </el-table>
|
|
|
+</el-dialog>
|
|
|
+
|
|
|
+<!-- 员工选择弹窗 -->
|
|
|
+<el-dialog
|
|
|
+ v-model="showEmployeeDialog"
|
|
|
+ title="选择员工"
|
|
|
+ width="500px"
|
|
|
+>
|
|
|
+ <el-table
|
|
|
+ :data="employeeList"
|
|
|
+ highlight-current-row
|
|
|
+ @row-click="selectEmployee"
|
|
|
+ >
|
|
|
+ <el-table-column prop="员工编号" label="编号" width="120" />
|
|
|
+ <el-table-column prop="ygxm" label="姓名" />
|
|
|
+ </el-table>
|
|
|
+</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -155,11 +382,13 @@
|
|
|
<script setup>
|
|
|
// 全量引入格式化工具 请按需保留
|
|
|
import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
|
|
|
-
|
|
|
import {ref, reactive} from 'vue'
|
|
|
import { exportExcelFile } from '@/utils/excel'
|
|
|
import {ElMessage} from "element-plus";
|
|
|
- import {getMaintenanceTab,YearMaintenanceList,YearAccessoriesList,YearMaintainList,MonthAccessoriesList,MouthMaintainList} from "@/api/mes/job.js"
|
|
|
+ import {getMaintenanceTab,YearMaintenanceList,YearAccessoriesList,YearMaintainList,MonthAccessoriesList,MouthMaintainList,getDepartment} from "@/api/mes/job.js"
|
|
|
+ import {gdzl_MachineList} from "@/api/yunyin/yunying.js"
|
|
|
+ import {getYg} from "@/api/jixiaoguanli/jitairibaobiao"
|
|
|
+
|
|
|
|
|
|
defineOptions({name: 'Company'})
|
|
|
// =========== 获取左侧树侧形结构 ===========
|
|
|
@@ -235,7 +464,7 @@ const actionMap = {
|
|
|
try {
|
|
|
const res = await YearMaintenanceList({ sist: nodeData.label.split('(')[0], year: nodeData.rq });
|
|
|
isyear.value = true;
|
|
|
- yearcode = 1;
|
|
|
+ yearcode.value = 1;
|
|
|
yeartableData.value = res.data;
|
|
|
} catch (error) {
|
|
|
console.error('年度维修数据获取失败:', error);
|
|
|
@@ -244,7 +473,7 @@ const actionMap = {
|
|
|
'月度维修': async (nodeData) => {
|
|
|
console.log('获取月度维修数据:', nodeData.rq); // 比如 nodeData.rq = "2024-12"
|
|
|
try {
|
|
|
- const res = await MonthAccessoriesList({ sist: nodeData.label.split('(')[0], month: nodeData.rq });
|
|
|
+ const res = await MonthAccessoriesList({ sist: nodeData.label.split('(')[0], mouth: nodeData.rq });
|
|
|
isyear.value = false;
|
|
|
iscode.value = true;
|
|
|
wxmonthtableData.value = res.data;
|
|
|
@@ -257,7 +486,7 @@ const actionMap = {
|
|
|
try {
|
|
|
const res = await YearMaintainList({ sist: nodeData.label.split('(')[0], year: nodeData.rq });
|
|
|
isyear.value = true;
|
|
|
- yearcode = 2;
|
|
|
+ yearcode.value = 2;
|
|
|
yeartableData.value = res.data;
|
|
|
} catch (error) {
|
|
|
console.error('年度保养数据获取失败:', error);
|
|
|
@@ -266,7 +495,7 @@ const actionMap = {
|
|
|
'月度保养': async (nodeData) => {
|
|
|
console.log('获取月度保养数据:', nodeData.rq);
|
|
|
try {
|
|
|
- const res = await MouthMaintainList({ sist: nodeData.label.split('(')[0], month: nodeData.rq });
|
|
|
+ const res = await MouthMaintainList({ sist: nodeData.label.split('(')[0], mouth: nodeData.rq });
|
|
|
isyear.value = false;
|
|
|
iscode.value = false;
|
|
|
bymonthtableData.value = res.data;
|
|
|
@@ -276,6 +505,7 @@ const actionMap = {
|
|
|
},
|
|
|
};
|
|
|
|
|
|
+const noderq = ref('')//节点的rq
|
|
|
// 点击节点时的处理函数
|
|
|
const handleNodeClick = async (nodeData) => {
|
|
|
console.log('当前点击节点:', nodeData);
|
|
|
@@ -284,19 +514,164 @@ const handleNodeClick = async (nodeData) => {
|
|
|
const action = actionMap[nodeData.code];
|
|
|
if (action) {
|
|
|
await action(nodeData); // 执行对应的函数,并传入 nodeData
|
|
|
+ noderq.value = nodeData.rq;
|
|
|
} else {
|
|
|
console.warn('未知节点类型:', nodeData.code);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-
|
|
|
|
|
|
+const wxyearRowClick = (row, column, event) => {
|
|
|
+ console.log('row:', row); // 调试信息
|
|
|
+}
|
|
|
+
|
|
|
+const initRepairForm = () => ({
|
|
|
+ 部门: '',
|
|
|
+ 设备编号: '',
|
|
|
+ 设备名称: '',
|
|
|
+ 机长: '',
|
|
|
+ 故障报告时间: '',
|
|
|
+ 故障现象: '',
|
|
|
+ 维修性质: '',
|
|
|
+ 维修受理时间: '',
|
|
|
+ 等配件时间: '',
|
|
|
+ 修复时间: '',
|
|
|
+ 维修人员: Array(8).fill(''), // 8个维修人员
|
|
|
+ 原因分析及措施: '',
|
|
|
+ 实际维修工时: '',
|
|
|
+ 设备故障总工时: '',
|
|
|
+ 验收人: '',
|
|
|
+ 验收情况: ''
|
|
|
+})
|
|
|
+
|
|
|
+const repairForm = reactive(initRepairForm())
|
|
|
+const dialogFormVisible = ref(false)
|
|
|
+const type = ref('create') // 'create' 或 'edit'
|
|
|
+const deptDialogVisible = ref(false) // 部门选择弹窗控制
|
|
|
+const deptTreeData = ref([]) // 部门树数据
|
|
|
+const deviceDialogVisible = ref(false) // 设备选择弹窗控制
|
|
|
+const deviceList = ref([]) // 设备列表数据
|
|
|
+const defaultProps = {
|
|
|
+ children: 'children',
|
|
|
+ label: 'label'
|
|
|
+}
|
|
|
+
|
|
|
+// 打开弹窗
|
|
|
+const onADD = () => {
|
|
|
+ Object.assign(repairForm, initRepairForm()) // 重置表单
|
|
|
+ type.value = 'create'
|
|
|
+ dialogFormVisible.value = true
|
|
|
+}
|
|
|
+
|
|
|
+// 关闭弹窗
|
|
|
+const closeDialog = () => {
|
|
|
+ dialogFormVisible.value = false
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+// 获取部门数据
|
|
|
+const getbm = async () => {
|
|
|
+ try {
|
|
|
+ const res = await getDepartment()
|
|
|
+ if (res.code === 0) {
|
|
|
+ // 转换数据结构为Tree需要的格式
|
|
|
+ deptTreeData.value = res.data.map(item => ({
|
|
|
+ label: item,
|
|
|
+ value: item
|
|
|
+ }))
|
|
|
+ deptDialogVisible.value = true // 显示部门选择弹窗
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('请求出错:', error)
|
|
|
+ ElMessage.error('获取部门失败')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 部门选择处理
|
|
|
+const handleDeptSelect = (data) => {
|
|
|
+ repairForm.部门 = data.label
|
|
|
+ deptDialogVisible.value = false
|
|
|
+}
|
|
|
+
|
|
|
+// 获取设备数据
|
|
|
+const getsb = async () => {
|
|
|
+ if (!repairForm.部门) {
|
|
|
+ ElMessage.warning('请先选择部门')
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
+ try {
|
|
|
+ const res = await gdzl_MachineList({ address: repairForm.部门 })
|
|
|
+ if (res.code === 0) {
|
|
|
+ if (!res.data) {
|
|
|
+ ElMessage.warning('该部门下暂无设备')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 转换数据结构:将 ["FJ02#-->复卷机"] 拆分为 {id: "FJ02#", name: "复卷机"}
|
|
|
+ deviceList.value = res.data.map(item => {
|
|
|
+ const [id, name] = item.split('-->')
|
|
|
+ return { id: id.trim(), name: name.trim() }
|
|
|
+ })
|
|
|
+ deviceDialogVisible.value = true
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('请求出错:', error)
|
|
|
+ ElMessage.error('获取设备失败')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 设备选择处理
|
|
|
+const handleDeviceSelect = (row) => {
|
|
|
+ repairForm.设备编号 = row.id
|
|
|
+ repairForm.设备名称 = row.name
|
|
|
+ deviceDialogVisible.value = false
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+const showEmployeeDialog = ref(false)
|
|
|
+const employeeList = ref([])
|
|
|
+const currentSelectField = ref('') // 记录当前正在编辑的字段
|
|
|
+
|
|
|
+// 打开员工选择弹窗
|
|
|
+const openEmployeeDialog = (fieldPrefix) => {
|
|
|
+ currentSelectField.value = fieldPrefix.replace('code', '') // 存储基础数字部分
|
|
|
+ const codeValue = repairForm[fieldPrefix] || '' // 直接使用fieldPrefix作为key
|
|
|
+ getEmployee(codeValue)
|
|
|
+}
|
|
|
+
|
|
|
+// 获取员工数据
|
|
|
+const getEmployee = async (searchValue = '') => {
|
|
|
+ try {
|
|
|
+ const response = await getYg({ sczl_bh: searchValue })
|
|
|
+ if (response.code === 0) {
|
|
|
+ if (response.data.length === 1) {
|
|
|
+ // 只有一条数据直接填充
|
|
|
+ selectEmployee(response.data[0])
|
|
|
+ } else {
|
|
|
+ // 多条数据展示弹窗
|
|
|
+ employeeList.value = response.data
|
|
|
+ showEmployeeDialog.value = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取员工失败:', error)
|
|
|
+ ElMessage.error('获取员工信息失败')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 选择员工
|
|
|
+const selectEmployee = (row) => {
|
|
|
+ if (currentSelectField.value) {
|
|
|
+ const index = currentSelectField.value
|
|
|
+ repairForm[`code${index}`] = row.员工编号
|
|
|
+ repairForm[`name${index}`] = row.ygxm
|
|
|
+ }
|
|
|
+ showEmployeeDialog.value = false
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|