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/modules/operationCertificate/OperationCertificateDetailModal.vue | 264 +++++++++++++++++++++++++++++++---------------------
1 files changed, 159 insertions(+), 105 deletions(-)
diff --git a/src/views/eam/modules/operationCertificate/OperationCertificateDetailModal.vue b/src/views/eam/modules/operationCertificate/OperationCertificateDetailModal.vue
index ebb3c10..d817f12 100644
--- a/src/views/eam/modules/operationCertificate/OperationCertificateDetailModal.vue
+++ b/src/views/eam/modules/operationCertificate/OperationCertificateDetailModal.vue
@@ -7,38 +7,92 @@
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
- cancelText="鍏抽棴">
+ cancelText="鍏抽棴"
+ >
<a-spin :spinning="confirmLoading">
- <a-form-model ref="form" :model="model" :rules="validatorRules">
+ <a-form-model
+ ref="form"
+ :model="model"
+ :rules="validatorRules"
+ >
<a-row>
<a-col :span="24">
- <a-form-model-item label="璇佷功ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operationCertificateId">
- <a-input v-model="model.operationCertificateId"placeholder="璇疯緭鍏ヨ瘉涔D" ></a-input>
+ <a-form-model-item
+ label="璇佷功ID"
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ prop="operationCertificateId"
+ >
+ <a-input
+ v-model="model.operationCertificateId"
+ placeholder="璇疯緭鍏ヨ瘉涔D"
+ ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
- <a-form-model-item label="鍙戠敓鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="happenDate">
- <j-date placeholder="璇烽�夋嫨鍙戠敓鏃堕棿" v-model="model.happenDate" style="width: 100%" />
+ <a-form-model-item
+ label="鍙戠敓鏃堕棿"
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ prop="happenDate"
+ >
+ <j-date
+ placeholder="璇烽�夋嫨鍙戠敓鏃堕棿"
+ v-model="model.happenDate"
+ style="width: 100%"
+ />
</a-form-model-item>
</a-col>
<a-col :span="24">
- <a-form-model-item label="绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
- <a-input v-model="model.type"placeholder="璇疯緭鍏ョ被鍨�" ></a-input>
+ <a-form-model-item
+ label="绫诲瀷"
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ prop="type"
+ >
+ <a-input
+ v-model="model.type"
+ placeholder="璇疯緭鍏ョ被鍨�"
+ ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
- <a-form-model-item label="璁惧id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId">
- <a-input v-model="model.equipmentId"placeholder="璇疯緭鍏ヨ澶噄d" ></a-input>
+ <a-form-model-item
+ label="璁惧id"
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ prop="equipmentId"
+ >
+ <a-input
+ v-model="model.equipmentId"
+ placeholder="璇疯緭鍏ヨ澶噄d"
+ ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
- <a-form-model-item label="鎵e垎椤�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deductionItem">
- <a-input v-model="model.deductionItem"placeholder="璇疯緭鍏ユ墸鍒嗛」" ></a-input>
+ <a-form-model-item
+ label="鎵e垎椤�"
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ prop="deductionItem"
+ >
+ <a-input
+ v-model="model.deductionItem"
+ placeholder="璇疯緭鍏ユ墸鍒嗛」"
+ ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
- <a-form-model-item label="鎵e垎鍛ㄦ湡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="period">
- <a-input v-model="model.period"placeholder="璇疯緭鍏ユ墸鍒嗗懆鏈�" ></a-input>
+ <a-form-model-item
+ label="鎵e垎鍛ㄦ湡"
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ prop="period"
+ >
+ <a-input
+ v-model="model.period"
+ placeholder="璇疯緭鍏ユ墸鍒嗗懆鏈�"
+ ></a-input>
</a-form-model-item>
</a-col>
</a-row>
@@ -49,100 +103,100 @@
<script>
- import { httpAction } from '@/api/manage'
- import { validateDuplicateValue } from '@/utils/util'
+import { httpAction } from '@/api/manage'
+import { validateDuplicateValue } from '@/utils/util'
- export default {
- name: "OperationCertificateDetailModal",
- components: {
- },
- props:{
- mainId:{
- type:String,
- required:false,
- default:''
+export default {
+ name: "OperationCertificateDetailModal",
+ components: {
+ },
+ props: {
+ mainId: {
+ type: String,
+ required: false,
+ default: ''
+ }
+ },
+ data() {
+ return {
+ title: "鎿嶄綔",
+ width: 800,
+ visible: false,
+ model: {
+ },
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 5 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 16 },
+ },
+
+ confirmLoading: false,
+ validatorRules: {
+ },
+ url: {
+ add: "/eam/operationCertificate/addOperationCertificateDetail",
+ edit: "/eam/operationCertificate/editOperationCertificateDetail",
}
- },
- data () {
- return {
- title:"鎿嶄綔",
- width:800,
- visible: false,
- model:{
- },
- labelCol: {
- xs: { span: 24 },
- sm: { span: 5 },
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 16 },
- },
-
- confirmLoading: false,
- validatorRules: {
- },
- url: {
- add: "/eam/operationCertificate/addOperationCertificateDetail",
- edit: "/eam/operationCertificate/editOperationCertificateDetail",
- }
-
- }
- },
- created () {
- //澶囦唤model鍘熷鍊�
- this.modelDefault = JSON.parse(JSON.stringify(this.model));
- },
- methods: {
- add () {
- this.edit(this.modelDefault);
- },
- edit (record) {
- this.model = Object.assign({}, record);
- this.visible = true;
- },
- close () {
- this.$emit('close');
- this.visible = false;
- this.$refs.form.clearValidate();
- },
- handleOk () {
- const that = this;
- // 瑙﹀彂琛ㄥ崟楠岃瘉
- this.$refs.form.validate(valid => {
- if (valid) {
- that.confirmLoading = true;
- let httpurl = '';
- let method = '';
- if(!this.model.id){
- httpurl+=this.url.add;
- method = 'post';
- }else{
- httpurl+=this.url.edit;
- method = 'put';
- }
- this.model['operationCertificateId'] = this.mainId
- httpAction(httpurl,this.model,method).then((res)=>{
- if(res.success){
- that.$message.success(res.message);
- that.$emit('ok');
- }else{
- that.$message.warning(res.message);
- }
- }).finally(() => {
- that.confirmLoading = false;
- that.close();
- })
- }else{
- return false
- }
- })
- },
- handleCancel () {
- this.close()
- },
-
}
+ },
+ created() {
+ //澶囦唤model鍘熷鍊�
+ this.modelDefault = JSON.parse(JSON.stringify(this.model));
+ },
+ methods: {
+ add() {
+ this.edit(this.modelDefault);
+ },
+ edit(record) {
+ this.model = Object.assign({}, record);
+ this.visible = true;
+ },
+ close() {
+ this.$emit('close');
+ this.visible = false;
+ this.$refs.form.clearValidate();
+ },
+ handleOk() {
+ const that = this;
+ // 瑙﹀彂琛ㄥ崟楠岃瘉
+ this.$refs.form.validate(valid => {
+ if (valid) {
+ that.confirmLoading = true;
+ let httpurl = '';
+ let method = '';
+ if (!this.model.id) {
+ httpurl += this.url.add;
+ method = 'post';
+ } else {
+ httpurl += this.url.edit;
+ method = 'put';
+ }
+ this.model['operationCertificateId'] = this.mainId
+ httpAction(httpurl, this.model, method).then((res) => {
+ if (res.success) {
+ that.$message.success(res.message);
+ that.$emit('ok');
+ } else {
+ that.$message.warning(res.message);
+ }
+ }).finally(() => {
+ that.confirmLoading = false;
+ that.close();
+ })
+ } else {
+ return false
+ }
+ })
+ },
+ handleCancel() {
+ this.close()
+ },
+
+
}
+}
</script>
--
Gitblit v1.9.3