From 585fb0bbd4a7bc7f8f333ecba7c5fecd2ee5cbc2 Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期四, 28 三月 2024 09:46:44 +0800 Subject: [PATCH] Merge branch 'master' of http://117.34.109.166:18448/r/vue_mdc_430 into develop --- src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModalEdit.vue | 126 +++++++++++++++++++++++++++--------------- 1 files changed, 81 insertions(+), 45 deletions(-) diff --git a/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModalEdit.vue b/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModalEdit.vue index 0a48a9a..ba239b5 100644 --- a/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModalEdit.vue +++ b/src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModalEdit.vue @@ -5,12 +5,12 @@ <a-form :form="form"> <a-row :gutter="24"> <a-col :span="12"> - <a-form-item label="鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨鏃堕棿" - class="query-group-cust" v-decorator="['torqueDate', validatorRules.torqueDate]"></j-date> + <a-form-item label="璁惧缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" :readOnly="readOnly" allow-clear placeholder="璇疯緭鍏ヨ澶囩紪鍙�" + v-decorator="['equipmentId',validatorRules.equipmentId]"/> </a-form-item> - </a-col> + <a-col :span="12"> <a-form-item label="璁惧鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-input :disabled="disableSubmit" :readOnly="readOnly" allow-clear placeholder="璇疯緭鍏ヨ澶囧悕绉�" @@ -20,22 +20,29 @@ </a-row> <a-row :gutter="24"> <a-col :span="12"> + <a-form-item label="鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨鏃堕棿" + class="query-group-cust" v-decorator="['torqueDate', validatorRules.torqueDate]" style="width: 100%"></j-date> + </a-form-item> + </a-col> + + <a-col :span="12"> <a-form-item label="鎵煩鍊�" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-input :disabled="disableSubmit" placeholder="璇疯緭鍏ユ壄鐭╁��" + <a-input-number :min="0" :disabled="disableSubmit" placeholder="璇疯緭鍏ユ壄鐭╁��" v-decorator="['torqueValue', validatorRules.torqueValue]"/> </a-form-item> </a-col> + </a-row> + <a-row :gutter="24"> <a-col :span="12"> - - <a-form-item label="璁惧缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-input :disabled="disableSubmit" :readOnly="readOnly" allow-clear placeholder="璇疯緭鍏ヨ澶囩紪鍙�" - v-decorator="['equipmentId',validatorRules.equipmentId]"/> + <a-form-item label="杩涚粰鍙傛暟" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input placeholder="璇疯緭鍏ヨ繘缁欏弬鏁�" v-decorator="['feedParameter', validatorRules.feedParameter]"></a-input> </a-form-item> </a-col> </a-row> <a-row :gutter="24"> <a-form-item label="澶囨敞" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> - <a-textarea :disabled="disableSubmit" v-decorator="['notes', validatorRules.notes]" placeholder="璇疯緭鍏ュ娉�" ></a-textarea> + <a-textarea :maxLength="20" :disabled="disableSubmit" v-decorator="['notes', validatorRules.notes]" placeholder="璇疯緭鍏ュ娉�" ></a-textarea> </a-form-item> </a-row> </a-form> @@ -125,6 +132,30 @@ }, ], }, + torqueDate:{ + rules:[ + { + required:true, + message: "璇烽�夋嫨鏃堕棿" + }, + ], + }, + torqueValue:{ + rules:[ + { + required:true, + message: "璇疯緭鍏ユ壄鐭╁��" + }, + ], + }, + feedParameter:{ + rules:[ + { + required:true, + message:'璇疯緭鍏ヨ繘缁欏弬鏁�' + } + ] + } // mdcRepairType:{ // rules:[ // { @@ -138,7 +169,7 @@ url: { add: '/mdc/mdcEquipmentRepair/add', - edit: '/mdc/mdcEquipmentRepair/edit' + edit: '/mdc/MdcTorqueConfig/editMdcTorqueConfig' }, disableSubmit: true, @@ -228,7 +259,7 @@ // this.editStart = (this.model.startTime).replace(/:/g,''); this.visible = true this.$nextTick(() => { - this.form.setFieldsValue(pick(this.model,'equipmentId', 'equipmentName','torqueDate', 'torqueValue','notes' + this.form.setFieldsValue(pick(this.model,'equipmentId', 'equipmentName','torqueDate', 'torqueValue','feedParameter','notes' )) }) }, @@ -245,44 +276,46 @@ that.confirmLoading = true let formData = Object.assign(this.model, values) let obj - if (!this.model.id) { - obj = postAction(this.url.add, formData) - } else { - - obj = requestPut(this.url.edit, formData, { - id: this.model.id - }) - let shijian = startOne - } - obj.then((res) => { - if (res.success) { - // that.$message.success("淇敼鎴愬姛") - that.$message.success(res.message) - that.$emit('ok', res.result) - } else { - that.$message.warning(res.message) - } - }).finally(() => { - that.confirmLoading = false - that.close() - }) + if (!this.model.id) { + obj = postAction(this.url.add, formData) + } else { + obj = requestPut(this.url.edit, formData, { + id: this.model.id + }) + } + obj.then((res) => { + if (res.success) { + // that.$message.success("淇敼鎴愬姛") + that.$notification.success({ + message:'娑堟伅', + description:"淇敼鎴愬姛" + }); + // that.$message.success(res.message) + that.$emit('ok', res.result) + } else { + // that.$message.warning(res.message) + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); } - // } - - - // } + }).finally(() => { + that.confirmLoading = false + that.close() + }) + } }) }, handleCancel() { this.close() }, - loadCascade() { - getAction(this.url.loadCascadeData).then((res) => { - if (res.success) { - this.partCategoryCascade = res.result - } - }) - }, + // loadCascade() { + // getAction(this.url.loadCascadeData).then((res) => { + // if (res.success) { + // this.partCategoryCascade = res.result + // } + // }) + // }, onCascadeChange(value, selectedOptions) { this.cascadeDefaultValue = [...value] }, @@ -314,7 +347,7 @@ } </script> -<style scoped> +<style scoped lang="less"> .ant-btn { padding: 0 10px; margin-left: 3px; @@ -333,4 +366,7 @@ .ant-tabs-content .ant-form-item { margin-bottom: 0px; } + /deep/ .ant-input-number{ + width: 100%!important; + } </style> -- Gitblit v1.9.3