From d289be3b10e9b259625ca9128b54bc62950c4e48 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期一, 08 九月 2025 17:57:49 +0800 Subject: [PATCH] 出库状态改为生命周期 其他文档改为电子文档 电子文档新增指派设备结构树 --- src/views/eam/base/modules/RepairWarehouseForm.vue | 132 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 132 insertions(+), 0 deletions(-) diff --git a/src/views/eam/base/modules/RepairWarehouseForm.vue b/src/views/eam/base/modules/RepairWarehouseForm.vue new file mode 100644 index 0000000..7fe4485 --- /dev/null +++ b/src/views/eam/base/modules/RepairWarehouseForm.vue @@ -0,0 +1,132 @@ +<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="鏁呴殰绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultType"> + <j-dict-select-tag dict-code="repair_warehouse_fault_type " v-model="model.faultType" + placeholder="璇烽�夋嫨鏁呴殰绫诲瀷"/> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏁呴殰閮ㄤ綅" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultPart"> + <a-input v-model="model.faultPart" placeholder="璇疯緭鍏ユ晠闅滈儴浣�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="鏁呴殰瀛愰儴浣�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultChildPart"> + <a-input v-model="model.faultChildPart" placeholder="璇疯緭鍏ユ晠闅滃瓙閮ㄤ綅" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="缁翠慨鎻忚堪" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairDescription"> + <a-input v-model="model.repairDescription" 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: 'RepairWarehouseForm', + 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: { + faultType: [ + { required: true, message: '璇疯緭鍏ユ晠闅滅被鍨�!'}, + ], + faultPart: [ + { required: true, message: '璇疯緭鍏ユ晠闅滈儴浣�!'}, + ], + faultChildPart: [ + { required: true, message: '璇疯緭鍏ユ晠闅滃瓙閮ㄤ綅!'}, + ], + repairDescription: [ + { required: true, message: '璇疯緭鍏ョ淮淇弿杩�!'}, + ], + }, + url: { + add: "/repairWarehouse/repairWarehouse/add", + edit: "/repairWarehouse/repairWarehouse/edit", + queryById: "/repairWarehouse/repairWarehouse/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