From 336dcb70c156c947530eab0f0a96ee17de477929 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期五, 12 七月 2024 18:04:33 +0800
Subject: [PATCH] 设备管理修改
---
src/views/eam/MalfunctionRepair.vue | 585 +++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 434 insertions(+), 151 deletions(-)
diff --git a/src/views/eam/MalfunctionRepair.vue b/src/views/eam/MalfunctionRepair.vue
index 007551e..bac4ed4 100644
--- a/src/views/eam/MalfunctionRepair.vue
+++ b/src/views/eam/MalfunctionRepair.vue
@@ -8,11 +8,27 @@
<a-form
layout="inline"
@keyup.enter.native="searchQuery"
- >
+ > <a-row
+ :gutter="24"
+ style="margin-bottom: 1%;"
+ >
+ <a-col
+ :md="24"
+ :sm="6"
+ >
+ <a-form-item label="缁熶竴缂栧彿缇�">
+ <a-textarea
+ placeholder="璇疯緭鍏ユ墍鏈夌粺涓�缂栫爜,椤荤敤鎹㈣闅斿紑,鍚﹀垯鍙兘鏌ヨ鍑洪敊璇俊鎭�"
+ v-model="queryParam.nums"
+ :auto-size="{ minRows: 2, maxRows:2 }"
+ ></a-textarea>
+ </a-form-item>
+ </a-col>
+ </a-row>
<a-row :gutter="24">
<a-col
:md="6"
- :sm="8"
+ :sm="6"
>
<a-form-item label="鍗曟嵁鍙�">
<a-input
@@ -23,52 +39,191 @@
</a-col>
<a-col
:md="6"
- :sm="8"
+ :sm="6"
>
- <a-form-item label="璁惧缂栫爜">
+ <a-form-item label="缁熶竴缂栧彿">
<a-input
- placeholder="璇疯緭鍏ヨ澶囩紪鐮�"
+ placeholder="璇疯緭鍏ョ粺涓�缂栧彿"
v-model="queryParam.equipmentNum"
></a-input>
</a-form-item>
</a-col>
<a-col
:md="6"
- :sm="8"
+ :sm="6"
>
- <span
- style="float: left;overflow: hidden;"
- class="table-page-search-submitButtons"
- >
- <a-button
- type="primary"
- @click="searchQuery"
- icon="search"
- >鏌ヨ</a-button>
- <a-button
- type="primary"
- @click="searchReset"
- icon="reload"
- style="margin-left: 8px"
- >閲嶇疆</a-button>
- </span>
+ <a-form-item label="璁惧鍚嶇О">
+ <a-input
+ placeholder="璇疯緭鍏ヨ澶囧悕绉�"
+ v-model="queryParam.equipmentName"
+ ></a-input>
+ </a-form-item>
+ </a-col>
+ <a-col
+ :md="6"
+ :sm="6"
+ >
+ <a-form-item label="璁惧鍨嬪彿">
+ <a-input
+ placeholder="璇疯緭鍏ヨ澶囧瀷鍙�"
+ v-model="queryParam.model"
+ ></a-input>
+ </a-form-item>
+ </a-col>
+ </a-row>
+ <a-row :gutter="24">
+ <a-col
+ :md="6"
+ :sm="6"
+ >
+ <a-form-item label="璁惧瑙勬牸">
+ <a-input
+ placeholder="璇疯緭鍏ヨ澶囪鏍�"
+ v-model="queryParam.specification"
+ ></a-input>
+ </a-form-item>
+ </a-col>
+ <a-col
+ :md="6"
+ :sm="6"
+ >
+ <a-form-item label="浣跨敤閮ㄩ棬">
+ <a-tree-select
+ style="width: 100%"
+ :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
+ :tree-data="treeData"
+ placeholder="璇烽�夋嫨浣跨敤閮ㄩ棬"
+ tree-default-expand-all
+ v-model="queryParam.useId"
+ />
+ </a-form-item>
+ </a-col>
+ <a-col
+ :md="6"
+ :sm="6"
+ >
+ <a-form-item label="鏁呴殰鏃堕棿">
+ <a-range-picker
+ style="width: 100%;"
+ format="YYYY-MM-DD HH:mm:ss"
+ v-model="faultTime"
+ @change="timeChange"
+ />
+ </a-form-item>
+ </a-col>
+ <a-col
+ :md="6"
+ :sm="6"
+ >
+ <a-form-item label="鎶ヤ慨浜�">
+ <a-input
+ placeholder="璇疯緭鍏ユ姤淇汉"
+ v-model="queryParam.errUda2"
+ ></a-input>
+ </a-form-item>
+ </a-col>
+ </a-row>
+ <a-row :gutter="24">
+ <a-col
+ :md="6"
+ :sm="6"
+ >
+ <a-form-item label="鍗曟嵁鐘舵��">
+ <j-dict-select-tag
+ allow-clear
+ placeholder="璇烽�夋嫨鍗曟嵁鐘舵��"
+ :triggerChange="true"
+ dictCode="equipment_report_repair_status"
+ v-model="queryParam.status"
+ />
+ </a-form-item>
+ </a-col>
+ <a-col
+ :md="6"
+ :sm="6"
+ >
+ <a-form-item label="鏄惁鍋滄満">
+ <j-dict-select-tag
+ allow-clear
+ placeholder="璇烽�夋嫨鏄惁鍋滄満"
+ :triggerChange="true"
+ dictCode="is_stop"
+ v-model="queryParam.isStop"
+ />
+ </a-form-item>
+ </a-col>
+ <a-col
+ :md="6"
+ :sm="6"
+ >
+ <a-form-item label="鏄惁鍔犲伐闆朵欢">
+ <j-dict-select-tag
+ allow-clear
+ placeholder="璇烽�夋嫨鏄惁鍦ㄥ姞宸ラ浂浠�"
+ :triggerChange="true"
+ dictCode="is_product"
+ v-model="queryParam.errUda1"
+ />
+ </a-form-item>
+ </a-col>
+ <a-col
+ :md="6"
+ :sm="6"
+ >
+ <a-form-item label="鍒跺崟浜�">
+ <a-input
+ placeholder="璇疯緭鍏ュ埗鍗曚汉"
+ v-model="queryParam.createBy"
+ ></a-input>
+ </a-form-item>
+ </a-col>
+ <a-col
+ :md="6"
+ :sm="6"
+ >
+ <a-form-item label="鏄惁鍏抽敭璁惧">
+ <j-dict-select-tag
+ allow-clear
+ placeholder="璇烽�夋嫨鏄惁鍏抽敭璁惧"
+ :triggerChange="true"
+ dictCode="specific_equipment"
+ v-model="queryParam.specificEquipment"
+ />
+ </a-form-item>
</a-col>
</a-row>
</a-form>
</div>
<div class="table-operator">
<a-button
+ type="primary"
+ @click="searchQuery"
+ icon="search"
+ >鏌ヨ</a-button>
+ <a-button
+ type="primary"
+ @click="searchReset"
+ icon="reload"
+ style="margin-left: 8px"
+ >閲嶇疆</a-button>
+ <a-button
@click="handleAdd"
type="primary"
icon="plus"
+ v-has="'report:add&edit'"
>鏂板</a-button>
+ <a-button
+ type="primary"
+ icon="download"
+ @click="handleExportXls('鏁呴殰鎶ヤ慨')"
+ >瀵煎嚭</a-button>
</div>
<div>
<a-table
ref="table"
size="middle"
- :scroll="{ x: 'calc(1900px + 50%)', y: 900 }"
+ :scroll="{ x: 'calc(1500px + 50%)', y: 900 }"
bordered
rowKey="id"
:columns="columns"
@@ -77,83 +232,85 @@
:loading="loading"
class="j-table-force-nowrap"
@change="handleTableChange"
- :rowSelection = "rowSelection"
+ :customRow="clickThenSelect"
>
- <!-- :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" -->
-
+ <!-- 鐐瑰嚮鍒楄烦杞埌浜嬫晠鐧昏椤� -->
<template
- slot="htmlSlot"
- slot-scope="text"
+ slot="accidentRegistrationProgress"
+ slot-scope="text, record"
>
- <div v-html="text"></div>
- </template>
- <template
- slot="imgSlot"
- slot-scope="text,record"
- >
- <span
- v-if="!text"
- style="font-size: 12px;font-style: italic;"
- >鏃犲浘鐗�</span>
- <img
- v-else
- :src="getImgView(text)"
- :preview="record.id"
- height="25px"
- alt=""
- style="max-width:80px;font-size: 12px;font-style: italic;"
- />
- </template>
- <template
- slot="fileSlot"
- slot-scope="text"
- >
- <span
- v-if="!text"
- style="font-size: 12px;font-style: italic;"
- >鏃犳枃浠�</span>
- <a-button
- v-else
- :ghost="true"
- type="primary"
- icon="download"
- size="small"
- @click="downloadFile(text)"
+ <a
+ v-if="text!==''&&text!==null"
+ @click="handleAccidentRegistration(record)"
>
- 涓嬭浇
- </a-button>
+ {{text=='yes'? '宸茬‘璁�':'鏈‘璁�'}}
+ </a>
</template>
-
+ <!-- 鐐瑰嚮鍒楄烦杞埌璐ㄩ噺闅愭偅椤� -->
+ <template
+ slot="qualityHiddenDangerProgress"
+ slot-scope="text, record"
+ >
+ <a
+ v-if="text!==''&&text!==null"
+ @click="handleQualityHiddenDanger(record)"
+ >
+ {{text=='yes'? '宸茬‘璁�':'鏈‘璁�'}}
+ </a>
+ </template>
+ <span
+ slot="specificEquipment"
+ slot-scope="text"
+ >
+ <a-icon
+ type="check"
+ style="color: chartreuse;"
+ v-if="text==='0'"
+ />
+ <a-icon
+ type="close"
+ v-else
+ style="color:red;"
+ />
+ </span>
<span
slot="action"
slot-scope="text, record"
>
- <a-popconfirm
- v-if="record.status == '1'"
- title="纭鎻愪氦鍚�?"
- @confirm="() =>handleCommit(record, 'commit')"
- >
- <a>鎻愪氦</a>
- </a-popconfirm>
- <a-popconfirm
- v-if="record.status == '2'"
- title="纭鎾ゅ洖鍚�?"
- @confirm="() =>handleCommit(record, 'back')"
- >
- <a>鎾ゅ洖</a>
- </a-popconfirm>
+ <a
+ :disabled=" record.status !== '4'"
+ @click="handleAccept(record)"
+ v-has="'report:accept'"
+ >楠屾敹</a>
+ <!-- <a-popconfirm
+ v-if="record.status == '1' || record.status == '4'"
+ title="纭鎻愪氦鍚�?"
+ @confirm="() =>handleCommit(record, 'commit')"
+ >
+ <a>鎻愪氦</a>
+ </a-popconfirm>
+ <a-popconfirm
+ v-if="record.status == '2'"
+ title="纭鎾ゅ洖鍚�?"
+ @confirm="() =>handleCommit(record, 'back')"
+ >
+ <a>鎾ゅ洖</a>
+ </a-popconfirm>
<a-divider
- v-if="record.status == '1' || record.status == '2'"
+ v-if="record.status == '1' || record.status == '2' || record.status == '4'"
type="vertical"
/>
<a
- v-if="record.status == '1' "
+ v-if="record.status == '1' || record.status == '4'"
@click="handleEdit(record)"
>缂栬緫</a>
- <a v-if="record.status == '2'" @click="handleApprove(record)">瀹℃壒</a>
+ <a
+ v-if="record.status == '2'"
+ @click="handleApprove(record)"
+ >瀹℃壒</a>
<a-divider
- v-if="record.status == '1' || record.status == '2'"
+ v-if="record.status == '1' || record.status == '2' || record.status == '4'"
type="vertical"
/>
<a-dropdown>
@@ -171,33 +328,6 @@
<a>鍒犻櫎</a>
</a-popconfirm>
</a-menu-item>
- <!-- <a-menu-item v-if="record.status == '1'">
- <a-popconfirm
- v-if="record.status == '1'"
- title="纭鎻愪氦鍚�?"
- @confirm="() =>handleCommit(record, 'commit')"
- >
- <a>鎻愪氦</a>
- </a-popconfirm>
- </a-menu-item>
- <a-menu-item v-if="record.status == '2'">
- <a-popconfirm
- v-if="record.status == '2'"
- title="纭鎾ゅ洖鍚�?"
- @confirm="() =>handleCommit(record, 'back')"
- >
- <a>鎾ゅ洖</a>
- </a-popconfirm>
- </a-menu-item>
- <a-menu-item v-if="record.status == '2'">
- <a-popconfirm
- v-if="record.status == '2'"
- title="纭椹冲洖鍚�?"
- @confirm="() =>handleFinish(record, 'reject')"
- >
- <a>椹冲洖</a>
- </a-popconfirm>
- </a-menu-item>-->
<a-menu-item v-if="record.status == '3' || record.status == '4'">
<a-popconfirm
v-if="record.status == '3' || record.status == '4'"
@@ -208,7 +338,16 @@
</a-popconfirm>
</a-menu-item>
</a-menu>
- </a-dropdown>
+ </a-dropdown> -->
+ </span>
+ <span
+ slot="jell"
+ slot-scope="text"
+ >
+ <j-ellipsis
+ :value="text"
+ :length="10"
+ />
</span>
</a-table>
@@ -226,7 +365,10 @@
class="table-operator"
style="margin-top: 0px"
>
- <FaultDescriptionList ref="FaultDescriptionList" />
+ <FaultDescriptionList
+ ref="FaultDescriptionList"
+ @ok="modalFormOk"
+ />
</div>
</a-tab-pane>
@@ -236,19 +378,30 @@
ref="modalForm"
@ok="modalFormOk"
></malfunction-repair-modal>
- <approvel-modal ref='approvalModalForm' @ok='approvalModalFormOk' @cancel='approvalModalFormOk'></approvel-modal>
+ <approvel-modal
+ ref='approvalModalForm'
+ @ok='approvalModalFormOk'
+ @cancel='approvalModalFormOk'
+ ></approvel-modal>
+ <accept-model
+ ref="acceptModel"
+ @ok="modalFormOk"
+ ></accept-model>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
-import { putAction,getAction } from '@/api/manage'
+import { putAction, getAction } from '@/api/manage'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import MalfunctionRepairModal from './modules/malfunctionRepair/MalfunctionRepaireModal'
-import FaultDescriptionList from './FaultDescriptionList'
+import FaultDescriptionList from './modules/malfunctionRepair/FaultDescriptionList'
import ApprovelModal from './modules/malfunctionRepair/ApprovelModal'
+import JEllipsis from '@/components/jeecg/JEllipsis'
+import moment from 'moment'
+import AcceptModel from './modules/malfunctionRepair/AcceptModel'
export default {
name: 'MalfunctionRepairList',
@@ -256,10 +409,14 @@
components: {
MalfunctionRepairModal,
FaultDescriptionList,
- ApprovelModal
+ ApprovelModal,
+ JEllipsis,
+ AcceptModel,
},
data() {
return {
+ treeData: [],
+ faultTime: [],
description: '鏁呴殰鎶ヤ慨',
queryParam: { delflag: 0 },
selectedRowKeys: [],
@@ -276,20 +433,54 @@
}
},
{
+ title: '鍗曟嵁鍙�',
+ align: "center",
+ dataIndex: 'num',
+ width: 150
+ },
+ {
+ title: '缁熶竴缂栧彿',
+ align: "center",
+ dataIndex: 'equipmentNum'
+ },
+ {
title: '鐘舵��',
align: "center",
dataIndex: 'statusName',
},
{
- title: '鍗曟嵁鍙�',
+ title: '鎶ヤ慨绫诲瀷',
align: "center",
- dataIndex: 'num'
+ dataIndex: 'type',
+ customRender: (text) => {
+ if (text == '1') {
+ return "琚姩鎶ヤ慨";
+ } else if (text == '2') {
+ return "杞﹂棿鎶ヤ慨";
+ } else if (text == '3') {
+ return "涓诲姩缁翠慨";
+ }
+ },
},
{
- title: '璁惧缂栫爜',
+ title: '鏉ユ簮',
align: "center",
- dataIndex: 'equipmentNum'
+ dataIndex: 'source',
+ customRender: (text) => {
+ if (text == '1') {
+ return "鎵嬪姩鍒涘缓";
+ } else if (text == '2') {
+ return "鐐规鎶ヤ慨";
+ }
+ },
},
+ {
+ title: '鍏抽敭璁惧',
+ align: "center",
+ dataIndex: 'specificEquipment',
+ scopedSlots: { customRender: 'specificEquipment' }
+ },
+
{
title: '璁惧鍚嶇О',
align: "center",
@@ -300,25 +491,29 @@
align: "center",
dataIndex: 'equipmentModel',
},
- {
- title: '瑙勬牸',
- align: "center",
- dataIndex: 'equipmentSpecification',
- },
+ // {
+ // title: '瑙勬牸',
+ // align: "center",
+ // dataIndex: 'equipmentSpecification',
+ // },
{
title: '浣跨敤閮ㄩ棬',
align: "center",
dataIndex: 'departName',
},
- {
- title: '绱ф�ョ▼搴�',
- align: "center",
- dataIndex: 'urgencyName',
- },
+ // {
+ // title: '绱ф�ョ▼搴�',
+ // align: "center",
+ // dataIndex: 'urgencyName',
+ // },
{
title: '鏁呴殰鎻忚堪',
align: "center",
- dataIndex: 'faultDescription'
+ dataIndex: 'faultDescription',
+ scopedSlots: {
+ customRender: 'faultDescription'
+ }
+
},
// {
// title: '鏁呴殰鎷嶇収',
@@ -327,38 +522,67 @@
// scopedSlots: { customRender: 'imgSlot' }
// },
{
+ title: '鎶ヤ慨浜�',
+ align: "center",
+ dataIndex: 'errUda2'
+ },
+ {
title: '鏁呴殰鏃堕棿',
align: "center",
- dataIndex: 'faultTime'
+ dataIndex: 'faultTime',
+ width: 200
},
- // {
- // title: '鏄惁鍋滄満寰呬慨',
- // align: "center",
- // dataIndex: 'isStop_dictText',
- // },
{
- title: '鍒涘缓浜�',
+ title: '鏄惁鍋滄満',
+ align: "center",
+ dataIndex: 'isStopName',
+ },
+ {
+ title: '鏄惁鍦ㄥ姞宸ラ浂浠�',
+ align: "center",
+ dataIndex: 'errUda1_dictText',
+ },
+ {
+ title: '鍒跺崟浜�',
align: "center",
dataIndex: 'createBy'
},
{
- title: '鍒涘缓鏃堕棿',
+ title: '楠屾敹鎰忚',
align: "center",
- dataIndex: 'createTime',
+ dataIndex: 'errUda5',
+ scopedSlots: {
+ customRender: 'jell'
+ }
},
{
title: '澶囨敞',
align: "center",
dataIndex: 'remark'
},
+ //璐ㄩ噺闅愭偅纭杩涘害
+ {
+ title: '璐ㄩ噺闅愭偅',
+ align: "center",
+ dataIndex: 'isConfirm1',
+ scopedSlots: { customRender: 'qualityHiddenDangerProgress' }
+ },
+ //浜嬫晠鐧昏纭杩涘害
+ {
+ title: '浜嬫晠鐧昏',
+ align: "center",
+ dataIndex: 'isConfirm2',
+ scopedSlots: { customRender: 'accidentRegistrationProgress' }
+ },
{
title: '鎿嶄綔',
dataIndex: 'action',
align: "center",
fixed: "right",
- width: 147,
+ width: 100,
scopedSlots: { customRender: 'action' }
- }
+ },
+
],
url: {
list: "/eam/equipmentReportRepair/getReportRepairList",
@@ -367,12 +591,24 @@
exportXlsUrl: "/eam/equipmentReportRepair/exportXls",
importExcelUrl: "eam/equipmentReportRepair/importExcel",
edit: "/eam/equipmentReportRepair/edit",
+ loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
},
- imgList:''
+ /* 鍒嗛〉鍙傛暟 */
+ ipagination: {
+ current: 1,
+ pageSize: 20,
+ pageSizeOptions: ['5', '10', '20', '50'],
+ showTotal: (total, range) => {
+ return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�"
+ },
+ showQuickJumper: true,
+ showSizeChanger: true,
+ total: 0
+ },
}
},
created() {
-
+ this.initOptions();
},
computed: {
importExcelUrl: function () {
@@ -397,6 +633,16 @@
},
},
methods: {
+
+ clickThenSelect(record) {
+ return {
+ on: {
+ click: () => {
+ this.onSelectChange(record.id.split(","), [record]);
+ }
+ }
+ }
+ },
loadData(arg) {
if (!this.url.list) {
@@ -459,12 +705,12 @@
})
},
- handleFinish(record,type) {
- if(type == 'agree'){
+ handleFinish(record, type) {
+ if (type == 'agree') {
record.status = '3'
- }else if(type == 'reject'){
+ } else if (type == 'reject') {
record.status = '4'
- }else if(type == 'revoke'){
+ } else if (type == 'revoke') {
record.status = '2'
}
putAction(this.url.edit, record).then(res => {
@@ -476,10 +722,10 @@
}
})
},
- handleApprove: function(record) {
+ handleApprove: function (record) {
let edit
edit = this.url.edit
- this.$refs.approvalModalForm.showModals(record, edit,'3','4')
+ this.$refs.approvalModalForm.showModals(record, edit, '3', '4')
this.$refs.approvalModalForm.title = '瀹℃壒'
this.$refs.approvalModalForm.disableSubmit = false
@@ -506,9 +752,46 @@
this.queryParam = {}
this.loadData(1)
this.onClearSelected()
+ this.faultTime = []
this.$refs.FaultDescriptionList.faultId = '-1'
},
-
+ initOptions() {
+ getAction(this.url.loadOptions).then(res => {
+ if (res.success) {
+ this.treeData = res.result
+ } else {
+ this.$message.warning(res.message)
+ }
+ })
+ },
+ timeChange() {
+ this.queryParam.faultStartTime = moment(this.faultTime[0]).format("YYYY-MM-DD HH:mm:ss")
+ this.queryParam.faultEndTime = moment(this.faultTime[1]).format("YYYY-MM-DD HH:mm:ss")
+ },
+ handleAccept(record) {
+ this.$refs.acceptModel.title = "楠屾敹"
+ this.$refs.acceptModel.edit(record)
+ },
+ //鐐瑰嚮璺宠浆鍒颁簨鏁呯櫥璁伴〉
+ handleAccidentRegistration(record) {
+ this.$router.push({
+ path: '/eam/FaultInfoList',
+ query: {
+ id: record.faultInfoId,
+ num: record.num
+ }
+ })
+ },
+ //鐐瑰嚮璺宠浆鍒拌川閲忛殣鎮i〉
+ handleQualityHiddenDanger(record) {
+ this.$router.push({
+ path: '/eam/QuanlityConfirmList',
+ query: {
+ id: record.quanlityId,
+ num: record.num
+ }
+ })
+ },
}
}
</script>
--
Gitblit v1.9.3