| | |
| | | @cancel="handleCancel" |
| | | cancelText="关闭"> |
| | | |
| | | |
| | | |
| | | <a-spin :spinning="spinning"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="standardCode" label="工具编号"> |
| | | <a-input-search v-model="model.toolId" placeholder="请选择工具编号" :disabled="disableSubmit" |
| | | <a-form-model-item prop="standardCode" label="工具编码"> |
| | | <a-input-search v-model="model.toolId" placeholder="请选择工具编码" :disabled="disableSubmit" |
| | | @search="selectTools" enter-button |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="classify_id" label="工具分类编码"> |
| | | <a-form-model-item prop="classify_id" label="工具分类名称"> |
| | | <a-input placeholder="请输入工具分类名称" v-model="model.classifyId" readOnly :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="paramaTableName" label="工具参数标识"> |
| | | <a-input placeholder="选择设备后自动带出" readOnly v-model="model.paramaTableName" readOnly |
| | | <a-input placeholder="选择设备后自动带出" readOnly v-model="model.paramaTableName_dictText" readOnly |
| | | :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="工具类型"> |
| | | <a-input placeholder="选择设备后自动带出" v-model="model.applicationType" readOnly |
| | | <a-input placeholder="选择设备后自动带出" v-model="model.applicationType_dictText" readOnly |
| | | :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="存储位置" prop="storageLocation"> |
| | | <a-input placeholder="选择填写存储位置" v-model="model.positionCode" readOnly |
| | | :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="备注"> |
| | | <a-form-model-item label="备注" prop="remark"> |
| | | <a-textarea v-model="model.remark" rows="3" placeholder="请输入备注" :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | |
| | | |
| | | <a-button @click="handleOk()" :disabled="disableSubmit" type="primary" :loading="confirmLoading">确定</a-button> |
| | | </template> |
| | | <tools-modal ref="toolListModel"></tools-modal> |
| | | <tools-modal ref="toolListModel" @sendSelectionRows="getRows"></tools-modal> |
| | | |
| | | |
| | | </j-modal> |
| | |
| | | import { getAction, postAction, requestPut } from '@/api/manage' |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import ToolsModal from '@views/tms/requirement/modules/ToolsModal.vue' |
| | | import pick from 'lodash.pick' |
| | | import DeviceListModel from '@views/mdc/base/modules/EquipmentList/DeviceListModal.vue' |
| | | |
| | | export default { |
| | | name: 'ToolsSharpeningModal', |
| | | mixins: [JVxeTableModelMixin], |
| | | components: { |
| | | DeviceListModel, |
| | | ToolsModal |
| | | }, |
| | | data() { |
| | |
| | | { required: true, message: '请输入刃磨结果及建议!' } |
| | | ] |
| | | }, |
| | | lastSelectionData: null, |
| | | url: { |
| | | add: '/tms/toolSharpening/add', |
| | | edit: '/tms/toolSharpening/edit', |
| | | queryDetailList: '/tms/toolSharpening/listToolSharpening' |
| | | // queryDetailList: '/tms/toolSharpening/listToolSharpening' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | console.log('selectionRows', data) |
| | | if (data && data.length > 0) { |
| | | const item = data[0] |
| | | // 使用 $set 确保 model 的属性是响应式的 |
| | | this.$set(this.model, 'toolId', item.toolCode) |
| | | this.$set(this.model, 'toolCode', item.id) |
| | | |
| | | methods: { |
| | | getRows(item) { |
| | | console.log(item) |
| | | if (item.id) { |
| | | this.$set(this.model, 'toolId', item.toolId) |
| | | this.$set(this.model, 'toolCode', item.toolCode) |
| | | this.$set(this.model, 'classifyId', item.classifyId) |
| | | this.$set(this.model, 'paramaTableName', item.paramaTableName_dictText) |
| | | this.$set(this.model, 'applicationType', item.applicationType_dictText) |
| | | this.$set(this.model, 'paramaTableName_dictText', item.paramaTableName_dictText) |
| | | this.$set(this.model, 'applicationType_dictText', item.applicationType_dictText) |
| | | this.$set(this.model, 'toolModel', item.toolModel) |
| | | this.$set(this.model, 'provinceCity', item.provinceCity) |
| | | this.$set(this.model, 'warehouseId', item.warehouseId) |
| | | this.$set(this.model, 'positionCode', item.positionCode) |
| | | this.$set(this.model, 'mainUnit', item.mainUnit) |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | methods: { |
| | | }, |
| | | |
| | | selectTools: function() { |
| | | this.$refs.toolListModel.showModals() |
| | |
| | | }, |
| | | |
| | | add() { |
| | | this.addShow = false |
| | | this.edit() |
| | | this.edit({}) |
| | | }, |
| | | |
| | | edit(record) { |
| | | console.log(record) |
| | | // this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | getAction(this.url.queryDetailList, { |
| | | id: record.id, |
| | | pageNo: 1, |
| | | pageSize: 99999 |
| | | }).then((res) => { |
| | | if (res.success) { |
| | | const readOnlyData = res.result.records[0] || {} |
| | | this.model = Object.assign({}, this.model, { |
| | | paramaTableName: readOnlyData.paramaTableName_dictText, |
| | | applicationType: readOnlyData.applicationType_dictText, |
| | | provinceCity: readOnlyData.provinceCity, |
| | | warehouseId: readOnlyData.warehouseId, |
| | | positionCode: readOnlyData.positionCode, |
| | | mainUnit: readOnlyData.mainUnit, |
| | | toolModel: readOnlyData.toolModel |
| | | }) |
| | | let that = this |
| | | that.visible = true |
| | | that.model = Object.assign({}, record) |
| | | // this.$nextTick(() => { |
| | | // this.form.setFieldsValue(pick(that.model, 'selectedDeparts', 'selectedProduction', 'equipmentId', 'equipmentName', 'equipmentModel', 'equipmentType', 'equipmentIp', 'dataPort', |
| | | // 'driveType', 'sortNo', 'remark', 'systemVersion', 'devicePower', 'controlSystem', 'saveTableName', 'systemValue')) |
| | | // }) |
| | | }, |
| | | // edit(record) { |
| | | // let that = this |
| | | // that.visible = true |
| | | // that.model = Object.assign({}, record) |
| | | // |
| | | // // 如果有 selectionRows 数据,则重新赋值 |
| | | // if (this.lastSelectionData && this.lastSelectionData.length > 0) { |
| | | // this.assignModelFromSelection(this.lastSelectionData[0]) |
| | | // console.log('this.model',this.assignModelFromSelection(this.lastSelectionData[0])) |
| | | // } |
| | | // }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | |
| | | } else { |
| | | this.dataSource = null |
| | | } |
| | | }) |
| | | }, |
| | | handleOk() { |
| | | const that = this |
| | |
| | | this.close() |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | this.$refs.form.clearValidate() |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |
| | | </style> |
| | | |
| | | |
| | | |