From b5e4adfc3a55490ad1cd49f50dfcc9dfb7b57d33 Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期四, 31 八月 2023 13:45:34 +0800 Subject: [PATCH] 文档名称来源 修改 --- src/views/eam/modules/repairorder/EquipmentDocumentModal.vue | 254 ++++++++++++++++++++++++++++---------------------- 1 files changed, 141 insertions(+), 113 deletions(-) diff --git a/src/views/eam/modules/repairorder/EquipmentDocumentModal.vue b/src/views/eam/modules/repairorder/EquipmentDocumentModal.vue index 13aa73b..9c6cc66 100644 --- a/src/views/eam/modules/repairorder/EquipmentDocumentModal.vue +++ b/src/views/eam/modules/repairorder/EquipmentDocumentModal.vue @@ -7,29 +7,57 @@ 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="鏂囨。缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num"> - <a-input v-model="model.num" placeholder="璇疯緭鍏ユ枃妗g紪鍙�" ></a-input> + <a-form-model-item + label="鏂囨。缂栧彿" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="num" + > + <a-input + v-model="model.num" + placeholder="璇疯緭鍏ユ枃妗g紪鍙�" + ></a-input> </a-form-model-item> </a-col> <a-col :span="24"> - <a-form-model-item label="鏂囨。绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="documentTypeId"> + <a-form-model-item + label="鏂囨。绫诲瀷" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="documentTypeId" + > <j-dict-select-tag allow-clear placeholder="璇烽�夋嫨鏂囨。绫诲瀷" :triggerChange="true" - dictCode="common_upload_type" + dictCode="mom_eam_document_type,name,id, del_flag!='1'" v-model="model.documentTypeId" /> + </a-form-model-item> </a-col> <a-col :span="24"> - <a-form-model-item label="涓婁紶" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="file"> - <j-upload :returnUrl= "false" :isMultiple="false" v-model="model.file" ></j-upload> + <a-form-model-item + label="涓婁紶" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="file" + > + <j-upload + :returnUrl="false" + :isMultiple="false" + v-model="model.file" + ></j-upload> </a-form-model-item> </a-col> </a-row> @@ -40,116 +68,116 @@ <script> - import { httpAction } from '@/api/manage' - import { validateDuplicateValue } from '@/utils/util' - import { duplicateCheck } from '@/api/api' +import { httpAction } from '@/api/manage' +import { validateDuplicateValue } from '@/utils/util' +import { duplicateCheck } from '@/api/api' - export default { - name: "EquipmentDocumentModal", - components: { - }, - props:{ - mainId:{ - type:String, - required:false, - default:'' +export default { + name: "EquipmentDocumentModal", + 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: { + num: [ + { required: true, message: '璇疯緭鍏ユ枃妗g紪鍙�!' }, + { validator: this.validateNum }, + { max: 32, message: '瓒呰繃鏈�澶ц緭鍏ラ檺鍒�,璇风缉鍑忛暱搴�' } + ], + documentTypeId: [ + { required: true, message: '璇烽�夋嫨鏂囦欢绫诲瀷!' }, + ], + file: [ + { required: true, message: '璇蜂笂浼犳枃浠�!' }, + ] + }, + url: { + add: "/eam/repairOrder/addEquipmentDocument", + edit: "/eam/repairOrder/editEquipmentDocument", } - }, - 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: { - num:[ - { required: true, message: '璇疯緭鍏ユ枃妗g紪鍙�!'}, - { validator: this.validateNum }, - {max:32,message:'瓒呰繃鏈�澶ц緭鍏ラ檺鍒�,璇风缉鍑忛暱搴�'} - ], - documentTypeId:[ - { required: true, message: '璇烽�夋嫨鏂囦欢绫诲瀷!'}, - ], - file:[ - { required: true, message: '璇蜂笂浼犳枃浠�!'}, - ] - }, - url: { - add: "/eam/repairOrder/addEquipmentDocument", - edit: "/eam/repairOrder/editEquipmentDocument", - } - - } - }, - created () { + } + }, + created() { //澶囦唤model鍘熷鍊� - this.modelDefault = JSON.parse(JSON.stringify(this.model)); + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add() { + this.edit(this.modelDefault); }, - 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) { - console.log(this.model.file) - 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['name'] = this.model.file[0].fileName; - this.model['path'] = this.model.file[0].filePath; - this.model['size'] = this.model.file[0].fileSize; - this.model['repairOrderId'] = 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 + 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) { + console.log(this.model.file) + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if (!this.model.id) { + httpurl += this.url.add; + method = 'post'; + } else { + httpurl += this.url.edit; + method = 'put'; } - }) - }, - handleCancel () { - this.close() - }, - //琛ㄥ崟鏍¢獙 - validateNum(rule, value, callback) { + this.model['name'] = this.model.file[0].fileName; + this.model['path'] = this.model.file[0].filePath; + this.model['size'] = this.model.file[0].fileSize; + this.model['repairOrderId'] = 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() + }, + //琛ㄥ崟鏍¢獙 + validateNum(rule, value, callback) { var params = { tableName: 'mom_eam_repair_order_operation_guidance', fieldName: 'num', @@ -168,6 +196,6 @@ } - } } +} </script> -- Gitblit v1.9.3