| | |
| | | <a-col :span="24"> |
| | | <a-form-item label="设备组" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> |
| | | <a-input-search :readOnly="true" v-decorator="['equipmentIds', validatorRules.equipmentIds]" |
| | | @search="deviceSearch" enter-button/> |
| | | @search="deviceSearch" enter-button placeholder="请选择设备"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | <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="请选择时间" |
| | | v-decorator="['torqueDate', validatorRules.torqueDate]"></j-date> |
| | | v-decorator="['torqueDate', validatorRules.torqueDate]"></j-date> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label="扭矩值" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input-number :min="0" :disabled="disableSubmit" placeholder="请输入扭矩值" |
| | | v-decorator="['torqueValue', validatorRules.torqueValue]"/> |
| | | v-decorator="['torqueValue', validatorRules.torqueValue]"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item label="备注" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> |
| | | <a-textarea :maxLength="20" v-decorator="['notes', validatorRules.notes]" placeholder="请输入备注" ></a-textarea> |
| | | </a-form-item> |
| | | <a-form-item label="备注" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> |
| | | <a-textarea :maxLength="20" v-decorator="['notes', validatorRules.notes]" |
| | | placeholder="请输入备注"></a-textarea> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </a-spin> |
| | | <torqueconfiguration-modal-list ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></torqueconfiguration-modal-list> |
| | | |
| | | <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/> |
| | | </a-modal> |
| | | </template> |
| | | |
| | |
| | | import { |
| | | duplicateCheck |
| | | } from '@/api/api' |
| | | import SelectDeviceModal from '../../../../system/modules/SelectDeviceModal' |
| | | |
| | | export default { |
| | | name: 'TorqueconfigurationModal', |
| | | components: {TorqueconfigurationModalList}, |
| | | components: { SelectDeviceModal }, |
| | | props: {}, |
| | | data() { |
| | | return { |
| | | mesag:21, |
| | | readOnly:true, |
| | | mesag: 21, |
| | | readOnly: true, |
| | | title: '', |
| | | visible: false, |
| | | show: false, |
| | | model: {}, |
| | | checked: false, |
| | | startData:"", |
| | | endData:"", |
| | | startData: '', |
| | | endData: '', |
| | | labelCol: { |
| | | xs: { |
| | | span: 24 |
| | |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | equipmentIds:{ |
| | | rules:[ |
| | | equipmentIds: { |
| | | rules: [ |
| | | { |
| | | required:true, |
| | | message: "请选择设备" |
| | | }, |
| | | ], |
| | | required: true, |
| | | message: '请选择设备' |
| | | } |
| | | ] |
| | | }, |
| | | torqueDate:{ |
| | | rules:[ |
| | | torqueDate: { |
| | | rules: [ |
| | | { |
| | | required:true, |
| | | message: "请选择时间" |
| | | }, |
| | | ], |
| | | required: true, |
| | | message: '请选择时间' |
| | | } |
| | | ] |
| | | }, |
| | | torqueValue:{ |
| | | rules:[ |
| | | torqueValue: { |
| | | rules: [ |
| | | { |
| | | required:true, |
| | | message: "请输入扭矩值" |
| | | }, |
| | | ], |
| | | }, |
| | | required: true, |
| | | message: '请输入扭矩值' |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | |
| | | url: { |
| | |
| | | // // this.endData = dateStrings[1]; |
| | | // // console.log(this.startData,this.endData); |
| | | // }, |
| | | onChangeEnd(dates, dateStrings){ |
| | | this.endTime = dateStrings[0]; |
| | | onChangeEnd(dates, dateStrings) { |
| | | this.endTime = dateStrings[0] |
| | | }, |
| | | getDeviceRows(val) { |
| | | var equipmentIds; |
| | | for(var i = 0;i<val.length;i++){ |
| | | var equipmentIds |
| | | for (var i = 0; i < val.length; i++) { |
| | | if (i == 0) { |
| | | equipmentIds = val[i].equipmentId; |
| | | equipmentIds = val[i].equipmentId |
| | | } else { |
| | | equipmentIds = equipmentIds + "," + val[i].equipmentId; |
| | | equipmentIds = equipmentIds + ',' + val[i].equipmentId |
| | | } |
| | | } |
| | | // console.log("========",equipmentIds); |
| | | this.form.setFieldsValue({ |
| | | equipmentIds: equipmentIds, |
| | | equipmentIds: equipmentIds |
| | | }) |
| | | // this.form.setFieldsValue({ |
| | | // equipmentId: val.equipmentId, |
| | |
| | | // }) |
| | | }, |
| | | deviceSearch() { |
| | | this.$refs.deviceRepairListModel.openPage() |
| | | this.$refs.deviceRepairListModel.title = '选择设备' |
| | | this.$refs.deviceRepairListModel.disableSubmit = false |
| | | this.$refs.selectDeviceModal.visible = true |
| | | this.$refs.selectDeviceModal.selectedRowKeys = [] |
| | | this.$refs.selectDeviceModal.selectedRows = [] |
| | | this.$refs.selectDeviceModal.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : [] |
| | | }, |
| | | //级联框onChange事件 |
| | | // onChange(value) { |
| | |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, 'equipmentIds', 'equipmentName', 'mdcRepairType', 'startTime', 'endTime', |
| | | this.form.setFieldsValue(pick(this.model, 'equipmentIds', 'equipmentName', 'mdcRepairType', 'startTime', 'endTime' |
| | | )) |
| | | }) |
| | | }, |
| | |
| | | // // this.endTime = '' |
| | | // that.confirmLoading = false |
| | | // }else{ |
| | | let obj |
| | | 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() |
| | | let obj |
| | | 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() |
| | | }) |
| | | } |
| | | // } |
| | | |
| | | // } |
| | | }) |
| | |
| | | }, |
| | | checkboxChange(e) { |
| | | this.checked = e.target.checked |
| | | }, |
| | | |
| | | /** |
| | | * 选择已有设备后点击确定时触发 |
| | | * @param data 已选择的设备 |
| | | */ |
| | | selectOK(data) { |
| | | // let params = {} |
| | | // params.equipmentIdList = [] |
| | | // for (var a = 0; a < data.length; a++) { |
| | | // params.equipmentIdList.push(data[a]) |
| | | // } |
| | | console.log('data=', data) |
| | | this.form.setFieldsValue({ |
| | | equipmentIds: data.join(',') |
| | | }) |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | .ant-tabs-content .ant-form-item { |
| | | margin-bottom: 0px; |
| | | } |
| | | /deep/ .ant-input-number{ |
| | | width: 100%!important; |
| | | |
| | | /deep/ .ant-input-number { |
| | | width: 100% !important; |
| | | } |
| | | </style> |