From a9f005e2af294c47d7cd1e4b6ed401bf65f5b080 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期二, 04 三月 2025 16:44:09 +0800
Subject: [PATCH] art: 所有设备 台账 二保工单 根据设备id查询二保工单,并过滤掉已完成和已取消的二保工单
---
src/views/eam/modules/equipmentCategory/EquipmentCategoryModel.vue | 208 ++++++++++++++++++++++++++++++---------------------
1 files changed, 123 insertions(+), 85 deletions(-)
diff --git a/src/views/eam/modules/equipmentCategory/EquipmentCategoryModel.vue b/src/views/eam/modules/equipmentCategory/EquipmentCategoryModel.vue
index c579e09..760a7d1 100644
--- a/src/views/eam/modules/equipmentCategory/EquipmentCategoryModel.vue
+++ b/src/views/eam/modules/equipmentCategory/EquipmentCategoryModel.vue
@@ -14,7 +14,7 @@
<a-spin :spinning="confirmLoading">
<a-form :form="form">
-<!-- <a-row :gutter="24">
+ <!-- <a-row :gutter="24">
<a-col :span="12">
<a-form-item
label="涓婄骇璁惧鍒嗙被缂栧彿"
@@ -54,13 +54,16 @@
>
<a-input
allow-clear
- :disabled="disableSubmit"
- :placeholder="disableSubmit?'':'璇疯緭鍏ヨ澶囧垎绫荤紪鍙�'"
+ :disabled="true"
+ :placeholder="disableSubmit?'':'灏嗙敱绯荤粺鑷姩鐢熸垚'"
v-decorator="['num', validatorRules.num ]"
/>
</a-form-item>
</a-col>
- <a-col :span="12" v-if="parentId!='-1'">
+ <a-col
+ :span="12"
+ v-if="parentId!='-1'"
+ >
<a-form-item
label="璁惧鍒嗙被鍚嶇О"
:labelCol="labelCol"
@@ -74,13 +77,16 @@
/>
</a-form-item>
</a-col>
- <a-col :span="12" v-if="parentId=='-1'">
+ <a-col
+ :span="12"
+ v-if="parentId=='-1'"
+ >
<a-form-item
label="璁惧鍒嗙被鍚嶇О"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
>
- <j-dict-select-tag
+ <j-dict-select-tag
allow-clear
:disabled="disableSubmit"
:placeholder="disableSubmit?'':'璇烽�夋嫨鍒嗙被鍚嶇О'"
@@ -90,6 +96,11 @@
/>
</a-form-item>
</a-col>
+ </a-row>
+ <!-- <a-row
+ hidden
+ :gutter="24"
+ >
<a-col :span="12">
<a-form-item
:labelCol="labelCol"
@@ -112,7 +123,7 @@
:wrapperCol="wrapperCol"
label="鎶�鏈姸鎬侀壌瀹氬懆鏈�"
>
- <j-dict-select-tag
+ <j-dict-select-tag
allow-clear
:disabled="disableSubmit"
:placeholder="disableSubmit?'':'璇烽�夋嫨鎶�鏈姸鎬侀壌瀹氬懆鏈�'"
@@ -122,6 +133,8 @@
/>
</a-form-item>
</a-col>
+ </a-row> -->
+ <a-row :gutter="24">
<a-col :span="12">
<a-form-item
:labelCol="labelCol"
@@ -138,48 +151,63 @@
</a-col>
</a-row>
</a-form>
- <a-divider v-if="title!='鏂板'" orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 閫夋嫨瀛愯澶囧垎绫讳娇鍏惰窡闅忕埗璁惧鍒嗙被灞炴�� </a-divider>
+ <a-divider
+ v-if="title!='鏂板'"
+ orientation="center"
+ style="font-size: large;font-style: italic;color: #66aeed;"
+ > 閫夋嫨瀛愯澶囧垎绫讳娇鍏惰窡闅忕埗璁惧鍒嗙被灞炴�� </a-divider>
<a-tabs
type="card"
defaultActiveKey="1"
v-if="title!='鏂板'"
>
- <a-tab-pane
+ <a-tab-pane
tab='瀛愯澶囧垎绫�'
key='1'
-
>
- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
- <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤�
- <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a>
- </div>
- <a-table
- ref="table"
- bordered
- size="middle"
- rowKey="id"
- :columns="columns"
- :dataSource="dataSource"
- :pagination="ipagination"
- :loading="loading"
- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
- @change="handleTableChange"
- :scroll="{ x: true}"
- >
- <template slot="num" slot-scope="text" >
- <a-tooltip placement="top" :title="text" trigger="hover">
- <div>
- <template slot="title"> </template>
- <p style="cusor:pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 130px;">{{ text }}</p>
- </div>
- </a-tooltip>
- </template>
+ <div
+ class="ant-alert ant-alert-info"
+ style="margin-bottom: 16px;"
+ >
+ <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤�
+ <a
+ style="margin-left: 24px"
+ @click="onClearSelected"
+ >娓呯┖</a>
+ </div>
+ <a-table
+ ref="table"
+ bordered
+ size="middle"
+ rowKey="id"
+ :columns="columns"
+ :dataSource="dataSource"
+ :pagination="ipagination"
+ :loading="loading"
+ :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+ @change="handleTableChange"
+ :scroll="{ x: true}"
+ >
+ <template
+ slot="num"
+ slot-scope="text"
+ >
+ <a-tooltip
+ placement="top"
+ :title="text"
+ trigger="hover"
+ >
+ <div>
+ <template slot="title"> </template>
+ <p style="cusor:pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 130px;">{{ text }}</p>
+ </div>
+ </a-tooltip>
+ </template>
- </a-table>
+ </a-table>
-
- </a-tab-pane>
- </a-tabs>
+ </a-tab-pane>
+ </a-tabs>
</a-spin>
@@ -190,7 +218,7 @@
>
鍏抽棴
</a-button>
-<!-- <a-button
+ <!-- <a-button
v-if="!this.model.id"
:disabled="disableSubmit || confirmLoading"
:loading="confirmLoading"
@@ -211,19 +239,19 @@
<script>
import pick from 'lodash.pick'
-import { postAction, requestPut } from '@/api/manage'
+import { getAction,postAction, requestPut } from '@/api/manage'
import { duplicateCheck } from '@/api/api'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
name: 'EquipmentCategoryModel',
- mixins:[JeecgListMixin],
- props:{
- mainId:{
- type:String,
- default:'',
- required:false
+ mixins: [JeecgListMixin],
+ props: {
+ mainId: {
+ type: String,
+ default: '',
+ required: false
},
},
data() {
@@ -233,12 +261,13 @@
codeDisable: true,
disableSubmit: false,
parentId: '',
+ equipmentCategoryUda1:'',
model: {},
labelCol: {
- span:7
+ span: 7
},
wrapperCol: {
- span:17
+ span: 17
},
confirmLoading: false,
form: this.$form.createForm(this),
@@ -257,7 +286,7 @@
{ validator: this.validateName },
]
},
- equipmentCategoryUda1:{
+ equipmentCategoryUda1: {
rules: [
{ required: true, message: '璇烽�夋嫨绫诲埆鏍囪瘑!' },
]
@@ -267,7 +296,7 @@
{ min: 0, max: 100, message: '闀垮害涓嶈秴杩� 100 涓瓧绗�', trigger: 'blur' },
]
},
- equipmentCategoryUda2:{
+ equipmentCategoryUda2: {
rules: [
{ required: true, message: '璇烽�夋嫨鎶�鏈姸鎬侀壌瀹氬懆鏈�!' },
]
@@ -276,7 +305,8 @@
url: {
add: "/eam/equipmentCategory/add",
edit: "/eam/equipmentCategory/edit",
- list:"/eam/equipmentCategory/getAllChildren"
+ list: "/eam/equipmentCategory/getAllChildren",
+ getNum: '/eam/sysIdentity/getNumNew',
},
columns: [
{
@@ -289,20 +319,20 @@
},
width: 50,
},
- /* {
- title: '涓婄骇璁惧鍒嗙被缂栫爜',
- align: "center",
- dataIndex: 'parentNum',
- customRender:function(text, record){
- return record.parentName+text;
- }
- },
-
- {
- title: '涓婄骇璁惧鍒嗙被鍚嶇О',
- align: "center",
- dataIndex: 'parentName',
- }, */
+ /* {
+ title: '涓婄骇璁惧鍒嗙被缂栫爜',
+ align: "center",
+ dataIndex: 'parentNum',
+ customRender:function(text, record){
+ return record.parentName+text;
+ }
+ },
+
+ {
+ title: '涓婄骇璁惧鍒嗙被鍚嶇О',
+ align: "center",
+ dataIndex: 'parentName',
+ }, */
{
title: '鍒嗙被缂栫爜',
align: "center",
@@ -381,12 +411,19 @@
this.visible = true;
this.disableSubmit = false;
this.$nextTick(() => {
- this.form.setFieldsValue(pick(this.model, 'parentNum','equipmentCategoryUda1','equipmentCategoryUda2', 'parentName', 'num', 'name', 'remark'))
+ this.form.setFieldsValue(pick(this.model, 'parentNum', 'equipmentCategoryUda1', 'equipmentCategoryUda2', 'parentName', 'num', 'name', 'remark'))
});
if (record.id) {
this.codeDisable = true;
} else {
this.codeDisable = false;
+ this.$nextTick(() => {
+ getAction(this.url.getNum, { type: 'EquipmentCategory', length: '4' }).then((res) => {
+ if (res.success) {
+ this.form.setFieldsValue({ num: res.message });
+ }
+ })
+ });
}
},
@@ -396,12 +433,12 @@
this.onClearSelected();
},
onSelectChange(selectedRowKeys, selectionRows) {
- this.selectedRowKeys = selectedRowKeys;
- this.selectionRows = selectionRows;
+ this.selectedRowKeys = selectedRowKeys;
+ this.selectionRows = selectionRows;
},
onClearSelected() {
- this.selectedRowKeys = [];
- this.selectionRows = [];
+ this.selectedRowKeys = [];
+ this.selectionRows = [];
},
//淇濆瓨骞舵柊澧炴寜閽Е鍙�
@@ -442,6 +479,7 @@
let obj;
if (!this.model.id) {
formData.parentId = this.parentId
+ formData.equipmentCategoryUda1 = this.equipmentCategoryUda1;
obj = postAction(this.url.add, formData);
} else {
formData.equipmentCategoryDtlList = this.selectionRows;
@@ -506,10 +544,10 @@
}
})
},
- clearList(){
- this.dataSource=[]
- this.selectedRowKeys=[]
- this.ipagination.current = 1
+ clearList() {
+ this.dataSource = []
+ this.selectedRowKeys = []
+ this.ipagination.current = 1
}
},
@@ -517,17 +555,17 @@
alterFlag() {
this.$bus.$emit('queryTreeData');
},
- mainId:{
- immediate:true,
- handler(val) {
- if(!this.mainId){
- this.clearList()
- }else{
- this.queryParam['parentId'] = val
- this.loadData(1);
- }
+ mainId: {
+ immediate: true,
+ handler(val) {
+ if (!this.mainId) {
+ this.clearList()
+ } else {
+ this.queryParam['parentId'] = val
+ this.loadData(1);
}
- },
+ }
+ },
}
}
</script>
--
Gitblit v1.9.3