From bdca59f8f15e80e6dc98c1136748124844939472 Mon Sep 17 00:00:00 2001
From: “linengliang” <vanSuperEnergy@163.com>
Date: 星期一, 06 十一月 2023 14:56:44 +0800
Subject: [PATCH] 部门修改加导入优化
---
src/views/eam/modules/equipmentSeal/EquipmentSealForm.vue | 401 +++++++++++++++++++++++++++-----------------------------
1 files changed, 193 insertions(+), 208 deletions(-)
diff --git a/src/views/eam/modules/equipmentSeal/EquipmentSealForm.vue b/src/views/eam/modules/equipmentSeal/EquipmentSealForm.vue
index 385819d..74abf77 100644
--- a/src/views/eam/modules/equipmentSeal/EquipmentSealForm.vue
+++ b/src/views/eam/modules/equipmentSeal/EquipmentSealForm.vue
@@ -2,66 +2,102 @@
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<!-- 涓昏〃鍗曞尯鍩� -->
- <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+ <a-form-model
+ ref="form"
+ :model="model"
+ :rules="validatorRules"
+ slot="detail"
+ >
<a-row>
<a-col :span="24">
- <a-form-model-item label="鍗曟嵁鍙�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
- <a-input v-model="model.num" placeholder="璇疯緭鍏ュ崟鎹彿"></a-input>
+ <a-form-model-item
+ label="鍗曟嵁鍙�"
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ prop="num"
+ >
+ <a-input
+ v-model="model.num"
+ placeholder="灏嗙敱绯荤粺鑷姩鐢熸垚"
+ disabled
+ ></a-input>
</a-form-model-item>
</a-col>
- <a-col :span="12" :hidden=true>
- <a-form-model-item label="鍙樺姩鏂瑰紡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="changeMethod">
- <a-input v-model="model.changeMethod" placeholder="璇疯緭鍏ュ彉鍔ㄦ柟寮�" defaultValue="seal"></a-input>
+ <a-col
+ :span="12"
+ :hidden=true
+ >
+ <a-form-model-item
+ label="鍙樺姩鏂瑰紡"
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ prop="changeMethod"
+ >
+ <a-input
+ v-model="model.changeMethod"
+ placeholder="璇疯緭鍏ュ彉鍔ㄦ柟寮�"
+ defaultValue="seal"
+ ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
- <a-form-model-item label="澶囨敞" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
- <a-textarea v-model="model.remark" rows="4" placeholder="璇疯緭鍏ュ娉�" />
+ <a-form-model-item
+ label="澶囨敞"
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ prop="remark"
+ >
+ <a-textarea
+ v-model="model.remark"
+ rows="4"
+ placeholder="璇疯緭鍏ュ娉�"
+ />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
<!-- 瀛愯〃鍗曞尯鍩� -->
- <a-tabs v-model="activeKey" @change="handleChangeTabs">
- <a-tab-pane tab="璁惧灏佸瓨鏄庣粏" :key="refKeys[0]" :forceRender="true">
- <j-vxe-table keep-source :ref="refKeys[0]" :loading="equipmentSealDetailTable.loading"
- :columns="equipmentSealDetailTable.columns" :dataSource="equipmentSealDetailTable.dataSource" :maxHeight="300"
- :disabled="formDisabled" :rowNumber="true" :rowSelection="true" :toolbar="true" :toolbarConfig="toolbarConfig"
- :linkage-config="linkageConfig">
+ <a-tabs
+ v-model="activeKey"
+ @change="handleChangeTabs"
+ >
+ <a-tab-pane
+ tab="璁惧灏佸瓨鏄庣粏"
+ :key="refKeys[0]"
+ :forceRender="true"
+ >
+ <j-vxe-table
+ keep-source
+ :ref="refKeys[0]"
+ :loading="equipmentSealDetailTable.loading"
+ :columns="equipmentSealDetailTable.columns"
+ :dataSource="equipmentSealDetailTable.dataSource"
+ :maxHeight="300"
+ :disabled="formDisabled"
+ :alwaysEdit="true"
+ :bordered="true"
+ :rowNumber="true"
+ :rowSelection="true"
+ :toolbar="true"
+ :toolbarConfig="toolbarConfig"
+ :linkage-config="linkageConfig"
+ :addDefaultRowNum="0"
+ >
<template slot="toolbarPrefix">
- <a-button type="primary" @click="selectEquipmentList" :disabled="formDisabled">閫夋嫨璁惧
+ <a-button
+ type="primary"
+ @click="selectEquipmentList"
+ :disabled="formDisabled"
+ >閫夋嫨璁惧
</a-button>
</template>
- <!-- state.address.regionName -->
- <template v-slot:maintenanceStandardId="props">
- <a-form-model ref="form" :model="props.row">
- <a-form-model-item style="margin-bottom: 0;" v-if="props.row.maintenanceAfterUnseal == 'Y'" label=""
- :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceStandardId"
- :rules="[{ required: true, message: '蹇呭~椤�',trigger: 'change' }]">
- <a-select v-model="props.row.maintenanceStandardId" @change="(e) => handleChange(e, props.row)"
- :options="manageList" />
- </a-form-model-item>
- <a-form-model-item style="margin-bottom: 0;" v-else label="" :labelCol="labelCol" :wrapperCol="wrapperCol"
- prop="maintenanceStandardId">
- <a-select v-model="props.row.maintenanceStandardId" :options="manageList"
- @change="(e) => handleChange(e, props.row.maintenanceAfterUnseal)" />
- </a-form-model-item>
- </a-form-model>
- </template>
- <!-- 璁惧鍥剧墖鎻掓Ы -->
- <template v-slot:equipmentPhoto='props'>
- <Tooltip
- placement="top"
- title="棰勮鍥剧墖"
- >
- <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span>
- <img v-else :src="getImgView(text)" :preview="props.rowId" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
- </Tooltip>
- </template>
<template v-slot:action="props">
- <a-popconfirm title="纭畾鍒犻櫎鍚楋紵" @confirm="handleDL(props)">
+ <a-popconfirm
+ title="纭畾鍒犻櫎鍚楋紵"
+ @confirm="handleDL(props)"
+ >
<a>鍒犻櫎</a>
</a-popconfirm>
</template>
@@ -69,27 +105,19 @@
</a-tab-pane>
</a-tabs>
<equipment-select-modal ref="EquipmentSelectModal"></equipment-select-modal>
- <!-- <equipment-selection @selectionRows="selectionRows" :equipmentStatus="['2', '3']"
- ref="EquipmentSelection"></equipment-selection> -->
</a-spin>
</template>
<script>
-import { JEditableTableModelMixin } from '@/mixins/JEditableTableModelMixin'
-import { randomUUID, randomNumber } from '@/utils/util'
-
import { validateDuplicateValue } from '@/utils/util'
-import pick from 'lodash.pick'
-import { getAction, postAction, requestPut } from '@api/manage'
// import EquipmentSelection from '@/components/tools/EquipmentSelection.vue'
import EquipmentSelectModal from './EquipmentSelectModal.vue'
-
+import { getAction, postAction, requestPut } from '@api/manage'
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@comp/jeecg/JVxeTable'
import { getRefPromise, VALIDATE_FAILED } from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
-
import JFormContainer from '@/components/jeecg/JFormContainer'
export default {
@@ -116,19 +144,15 @@
xs: { span: 24 },
sm: { span: 16 }
},
- manageList: [
- { label: '绌�', value: '' },
- { label: '淇濆吇鏍囧噯涓�', value: '1001' },
- { label: '淇濆吇鏍囧噯浜�', value: '1002' }
- ],
- // 鏂板鏃跺瓙琛ㄩ粯璁ゆ坊鍔犲嚑琛岀┖鏁版嵁
addDefaultRowNum: 0,
model: {},
validatorRules: {
+
num: [
{ required: true, message: '璇疯緭鍏ュ崟鎹彿!' },
{ validator: (rule, value, callback) => validateDuplicateValue('mom_eam_equipment_change', 'num', value, this.model.id, callback) }
],
+
remark: [
{ required: false, message: '璇疯緭鍏ュ娉�!' }
]
@@ -155,14 +179,13 @@
title: '璁惧灏佸瓨鏄庣粏id',
key: 'id',
type: JVXETypes.hidden,
- width: '100px',
- fixed: 'left'
+ width: '100px'
},
+ // fixed: 'left'
{
title: '璁惧鍙樺姩鍗昳d',
key: 'equipmentChangeId',
type: JVXETypes.hidden,
-
placeholder: '璇疯緭鍏�${title}',
defaultValue: ''
},
@@ -176,112 +199,18 @@
title: '璁惧缂栫爜',
key: 'equipmentNum',
type: JVXETypes.normal,
- width: '120px',
+ width: '150px',
+ align: 'center'
// placeholder: '璇疯緭鍏�${title}',
- fixed: 'left'
},
- {
- title: '璁惧璧勪骇缂栫爜',
- key: 'assetNumber',
- type: JVXETypes.normal,
- width: '120px',
- fixed: 'left',
- defaultValue: ''
- },
- {
- title: '灏佸瓨鍘熷洜',
- key: 'sealReason',
- type: JVXETypes.input,
- width: '200px',
- placeholder: '璇疯緭鍏�${title}',
- defaultValue: '',
- validateRules: [
- {
- required: true, // 蹇呭~
- message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈�
- }]
- },
- {
- title: '灏佸瓨鏃ユ湡',
- key: 'sealDate',
- type: JVXETypes.datetime,
- width: '100px',
- placeholder: '璇烽�夋嫨${title}',
- defaultValue: '',
- validateRules: [
- {
- required: true, // 蹇呭~
- message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈�
- }]
-
- },
- {
- title: '棰勮鍚皝鏃ユ湡',
- key: 'planUnsealDate',
- type: JVXETypes.date,
- width: '120px',
- placeholder: '璇疯緭鍏�${title}',
- defaultValue: ''
- },
- // {
- // title: '寮哄埗鍚皝',
- // key: 'isForceUnseal',
- // type: JVXETypes.checkbox,
- // customValue: ['Y', 'N'],
- // width: '120px',
- // placeholder: '璇疯緭鍏�${title}',
- // defaultValue: ''
- // },
- // {
- // title: '寮哄埗鍚皝鏃ユ湡',
- // key: 'forceUnsealDate',
- // type: JVXETypes.date,
- // width: '120px',
- // placeholder: '璇疯緭鍏�${title}',
- // defaultValue: ''
- // },
- // {
- // title: '寮哄埗鍚皝鍚庝繚鍏�',
- // key: 'maintenanceAfterUnseal',
- // type: JVXETypes.checkbox,
- // customValue: ['Y', 'N'],
- // width: '150px',
- // placeholder: '璇疯緭鍏�${title}',
- // defaultValue: 'N',
-
- // },
- // {
- // title: '淇濆吇鏍囧噯',
- // key: 'maintenanceStandardId',
- // type: JVXETypes.slot,
- // width: '260px',
- // slotName: 'maintenanceStandardId'
- // },
-
- {
- title: '鐗圭璁惧',
- key: 'specificEquipment',
- type: JVXETypes.hidden,
- disabled: true,
-
- placeholder: '璇疯緭鍏�${title}',
- defaultValue: ''
- },
- {
- title: '鐗圭璁惧',
- key: 'specificEquipment_dictText',
- type: JVXETypes.normal,
- disabled: true,
- width: '100px',
- defaultValue: ''
- },
+ // fixed: 'left'
{
title: '璁惧鍚嶇О',
key: 'equipmentName',
type: JVXETypes.normal,
disabled: true,
- width: '200px',
-
+ width: '150px',
+ align: 'center',
defaultValue: ''
},
{
@@ -289,7 +218,8 @@
key: 'model',
type: JVXETypes.normal,
disabled: true,
- width: '120px',
+ width: '150px',
+ align: 'center',
defaultValue: ''
},
{
@@ -297,36 +227,90 @@
key: 'specification',
type: JVXETypes.normal,
disabled: true,
- width: '120px',
+ width: '150px',
+ align: 'center',
placeholder: '璇疯緭鍏�${title}',
defaultValue: ''
},
+ {
+ title: '璁惧璧勪骇缂栫爜',
+ key: 'assetNumber',
+ type: JVXETypes.normal,
+ width: '150px',
+ align: 'center',
+ defaultValue: ''
+ },
+ {
+ title: '灏佸瓨鍘熷洜',
+ key: 'sealReason',
+ type: JVXETypes.input,
+ width: '200px',
+ align: 'center',
+ placeholder: '璇疯緭鍏�${title}',
+ defaultValue: '',
+ validateRules: [{
+ required: true, // 蹇呭~
+ message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈�
+ }]
+ },
+ {
+ title: '灏佸瓨鏃ユ湡',
+ key: 'sealDate',
+ type: JVXETypes.datetime,
+ width: '150px',
+ align: 'center',
+ placeholder: '璇烽�夋嫨${title}',
+ defaultValue: '',
+ validateRules: [{
+ required: true, // 蹇呭~
+ message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈�
+ }]
+
+ },
+ {
+ title: '棰勮鍚皝鏃ユ湡',
+ key: 'planUnsealDate',
+ type: JVXETypes.date,
+ width: '150px',
+ align: 'center',
+ placeholder: '璇疯緭鍏�${title}',
+ defaultValue: ''
+ },
+ {
+ title: '鐗圭璁惧',
+ key: 'specificEquipment',
+ type: JVXETypes.hidden,
+ disabled: true,
+ placeholder: '璇疯緭鍏�${title}',
+ defaultValue: '',
+ width: '150px'
+ },
+ {
+ title: '鐗圭璁惧',
+ key: 'specificEquipment_dictText',
+ type: JVXETypes.normal,
+ disabled: true,
+ width: '150px',
+ align: 'center',
+ defaultValue: ''
+ },
+
{
title: '璁惧鐘舵��',
key: 'equipmentStatus_dictText',
type: JVXETypes.normal,
disabled: true,
- width: '100px',
- // placeholder: '璇疯緭鍏�${title}',
+ width: '150px',
+ align: 'center',
defaultValue: ''
},
- // {
- // title: '璁惧鐘舵��',
- // key: 'equipmentStatus',
- // type: JVXETypes.select,
- // options: [],
- // dictCode: 'equipment_status',
- // disabled: true,
- // width: '200px',
- // // placeholder: '璇疯緭鍏�${title}',
- // defaultValue: ''
- // },
{
title: '鎶�鏈姸鎬�',
key: 'technologyStatus_dictText',
type: JVXETypes.normal,
disabled: true,
- width: '100px',
+ width: '150px',
+ align: 'center',
defaultValue: ''
},
{
@@ -334,40 +318,40 @@
key: 'location',
type: JVXETypes.normal,
disabled: true,
- width: '120px'
-
+ width: '200px',
+ align: 'center'
},
{
title: '閲嶈搴�',
key: 'equipmentImportanceId_dictText',
type: JVXETypes.normal,
disabled: true,
- width: '100px',
- // placeholder: '璇疯緭鍏�${title}',
+ width: '150px',
+ align: 'center',
defaultValue: ''
},
{
title: '閲嶈搴�',
key: 'equipmentImportanceId',
type: JVXETypes.hidden
- },
- {
- title: '璁惧鍥剧墖',
- key: 'equipmentPhoto',
- type: JVXETypes.slot,
- disabled: true,
- width: '120px',
- slotName:'equipmentPhoto'
-
- },
- {
- title: '鎿嶄綔',
- key: 'action',
- type: JVXETypes.slot,
- disabled: true,
- width: '100px',
- slotName: 'action',
- },
+ }
+ // {
+ // title: '璁惧鍥剧墖',
+ // key: 'equipmentPhoto',
+ // type: JVXETypes.slot,
+ // disabled: true,
+ // width: '150px',
+ // slotName: 'equipmentPhoto'
+ // },
+ // {
+ // title: '鎿嶄綔',
+ // key: 'action',
+ // type: JVXETypes.slot,
+ // disabled: true,
+ // width: '150px',
+ // align: "center",
+ // slotName: 'action',
+ // },
]
},
@@ -375,6 +359,7 @@
add: '/eam/equipmentSeal/add',
edit: '/eam/equipmentSeal/edit',
queryById: '/eam/equipmentSeal/queryById',
+ getNum: '/eam/sysIdentity/getNumNew',
equipmentSealDetail: {
list: '/eam/equipmentSeal/listEquipmentSealDetailByMainId'
}
@@ -404,6 +389,7 @@
})
},
methods: {
+
handleChange(value, data) {
this.$nextTick(() => {
this.$set(data, 'maintenanceAfterUnseal', data.maintenanceAfterUnseal)
@@ -419,9 +405,9 @@
this.addSelectedEquipments(data)
},
handleDL(props) {
- // 璋冪敤鍒犻櫎鏂规硶
- props.target.removeRows(props.row)
- },
+ // 璋冪敤鍒犻櫎鏂规硶
+ props.target.removeRows(props.row)
+ },
//閫夋嫨璁惧
selectEquipmentList() {
@@ -484,6 +470,12 @@
if (this.model.id) {
let params = { equipmentChangeId: this.model.id }
this.requestSubTableData(this.url.equipmentSealDetail.list, params, this.equipmentSealDetailTable)
+ }else{
+ getAction(this.url.getNum, { type: 'EquipmentSeal', length: '4' }).then((res) => {
+ if (res.success) {
+ this.model.num = res.message
+ }
+ })
}
},
//鏍¢獙鎵�鏈変竴瀵逛竴瀛愯〃琛ㄥ崟
@@ -519,15 +511,8 @@
</script>
<style scoped>
-/** tab panel 涓湁涓嬫媺妗�/鏃ユ湡 杩欑被甯︿笅鎷夋晥鏋滅殑锛岄渶瑕佸姞姝ゆ牱寮� */
-::v-deep .jeecg-tabs-top {
+/deep/ .jeecg-tabs-top {
overflow: visible;
-}
-
-::v-deep .ant-form-explain {
- position: absolute;
- right: -50px;
- top: 12px;
}
</style>
\ No newline at end of file
--
Gitblit v1.9.3