From 2de735967d33dba5da5fc87191dee543b000afaf Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期五, 18 七月 2025 20:20:18 +0800 Subject: [PATCH] 删除 --- src/views/eam/repair/modules/EamRepairPersonForm.vue | 124 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 124 insertions(+), 0 deletions(-) diff --git a/src/views/eam/repair/modules/EamRepairPersonForm.vue b/src/views/eam/repair/modules/EamRepairPersonForm.vue new file mode 100644 index 0000000..8d21893 --- /dev/null +++ b/src/views/eam/repair/modules/EamRepairPersonForm.vue @@ -0,0 +1,124 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="缁翠慨宸ュ崟Id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairId"> + <a-input v-model="model.repairId" placeholder="璇疯緭鍏ョ淮淇伐鍗旾d" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="缁翠慨浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairUser"> + <a-input v-model="model.repairUser" placeholder="璇疯緭鍏ョ淮淇汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏄惁鏄富缁翠慨浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairPrimary"> + <a-input v-model="model.repairPrimary" placeholder="璇疯緭鍏ユ槸鍚︽槸涓荤淮淇汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="缁翠慨鏃堕暱" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairDuration"> + <a-input v-model="model.repairDuration" placeholder="璇疯緭鍏ョ淮淇椂闀�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="澶囨敞" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> + <a-input v-model="model.remark" placeholder="璇疯緭鍏ュ娉�" ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'EamRepairPersonForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + }, + url: { + add: "/eam/eamRepairPerson/add", + edit: "/eam/eamRepairPerson/edit", + queryById: "/eam/eamRepairPerson/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + 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; + }, + submitForm () { + 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'; + } + 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; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file -- Gitblit v1.9.3