| | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | |
| | | <!-- <a-row :gutter="24"> |
| | | <!-- <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | label="上级设备分类编号" |
| | |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12" v-if="parentId!='-1'"> |
| | | <a-col |
| | | :span="12" |
| | | v-if="parentId!='-1'" |
| | | > |
| | | <a-form-item |
| | | label="设备分类名称" |
| | | :labelCol="labelCol" |
| | |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12" v-if="parentId=='-1'"> |
| | | <a-col |
| | | :span="12" |
| | | v-if="parentId=='-1'" |
| | | > |
| | | <a-form-item |
| | | label="设备分类名称" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | > |
| | | <j-dict-select-tag |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :disabled="disableSubmit" |
| | | :placeholder="disableSubmit?'':'请选择分类名称'" |
| | |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <!-- <a-row |
| | | hidden |
| | | :gutter="24" |
| | | > |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | |
| | | :wrapperCol="wrapperCol" |
| | | label="技术状态鉴定周期" |
| | | > |
| | | <j-dict-select-tag |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :disabled="disableSubmit" |
| | | :placeholder="disableSubmit?'':'请选择技术状态鉴定周期'" |
| | |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | </a-row> --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | <a-divider v-if="title!='新增'" orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 选择子设备分类使其跟随父设备分类属性 </a-divider> |
| | | <a-divider |
| | | v-if="title!='新增'" |
| | | orientation="center" |
| | | style="font-size: large;font-style: italic;color: #66aeed;" |
| | | > 选择子设备分类使其跟随父设备分类属性 </a-divider> |
| | | <a-tabs |
| | | type="card" |
| | | defaultActiveKey="1" |
| | | v-if="title!='新增'" |
| | | > |
| | | <a-tab-pane |
| | | <a-tab-pane |
| | | tab='子设备分类' |
| | | key='1' |
| | | |
| | | > |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">清空</a> |
| | | </div> |
| | | <a-table |
| | | ref="table" |
| | | bordered |
| | | size="middle" |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange" |
| | | :scroll="{ x: true}" |
| | | > |
| | | <template slot="num" slot-scope="text" > |
| | | <a-tooltip placement="top" :title="text" trigger="hover"> |
| | | <div> |
| | | <template slot="title"> </template> |
| | | <p style="cusor:pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 130px;">{{ text }}</p> |
| | | </div> |
| | | </a-tooltip> |
| | | </template> |
| | | <div |
| | | class="ant-alert ant-alert-info" |
| | | style="margin-bottom: 16px;" |
| | | > |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a |
| | | style="margin-left: 24px" |
| | | @click="onClearSelected" |
| | | >清空</a> |
| | | </div> |
| | | <a-table |
| | | ref="table" |
| | | bordered |
| | | size="middle" |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange" |
| | | :scroll="{ x: true}" |
| | | > |
| | | <template |
| | | slot="num" |
| | | slot-scope="text" |
| | | > |
| | | <a-tooltip |
| | | placement="top" |
| | | :title="text" |
| | | trigger="hover" |
| | | > |
| | | <div> |
| | | <template slot="title"> </template> |
| | | <p style="cusor:pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 130px;">{{ text }}</p> |
| | | </div> |
| | | </a-tooltip> |
| | | </template> |
| | | |
| | | </a-table> |
| | | </a-table> |
| | | |
| | | |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | |
| | | </a-spin> |
| | | |
| | |
| | | > |
| | | 关闭 |
| | | </a-button> |
| | | <!-- <a-button |
| | | <!-- <a-button |
| | | v-if="!this.model.id" |
| | | :disabled="disableSubmit || confirmLoading" |
| | | :loading="confirmLoading" |
| | |
| | | |
| | | export default { |
| | | name: 'EquipmentCategoryModel', |
| | | mixins:[JeecgListMixin], |
| | | props:{ |
| | | mainId:{ |
| | | type:String, |
| | | default:'', |
| | | required:false |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | mainId: { |
| | | type: String, |
| | | default: '', |
| | | required: false |
| | | }, |
| | | }, |
| | | data() { |
| | |
| | | codeDisable: true, |
| | | disableSubmit: false, |
| | | parentId: '', |
| | | equipmentCategoryUda1:'', |
| | | model: {}, |
| | | labelCol: { |
| | | span:7 |
| | | span: 7 |
| | | }, |
| | | wrapperCol: { |
| | | span:17 |
| | | span: 17 |
| | | }, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | |
| | | { validator: this.validateName }, |
| | | ] |
| | | }, |
| | | equipmentCategoryUda1:{ |
| | | equipmentCategoryUda1: { |
| | | rules: [ |
| | | { required: true, message: '请选择类别标识!' }, |
| | | ] |
| | |
| | | { min: 0, max: 100, message: '长度不超过 100 个字符', trigger: 'blur' }, |
| | | ] |
| | | }, |
| | | equipmentCategoryUda2:{ |
| | | equipmentCategoryUda2: { |
| | | rules: [ |
| | | { required: true, message: '请选择技术状态鉴定周期!' }, |
| | | ] |
| | |
| | | url: { |
| | | add: "/eam/equipmentCategory/add", |
| | | edit: "/eam/equipmentCategory/edit", |
| | | list:"/eam/equipmentCategory/getAllChildren" |
| | | list: "/eam/equipmentCategory/getAllChildren" |
| | | }, |
| | | columns: [ |
| | | { |
| | |
| | | }, |
| | | width: 50, |
| | | }, |
| | | /* { |
| | | title: '上级设备分类编码', |
| | | align: "center", |
| | | dataIndex: 'parentNum', |
| | | customRender:function(text, record){ |
| | | return record.parentName+text; |
| | | } |
| | | }, |
| | | |
| | | { |
| | | title: '上级设备分类名称', |
| | | align: "center", |
| | | dataIndex: 'parentName', |
| | | }, */ |
| | | /* { |
| | | title: '上级设备分类编码', |
| | | align: "center", |
| | | dataIndex: 'parentNum', |
| | | customRender:function(text, record){ |
| | | return record.parentName+text; |
| | | } |
| | | }, |
| | | |
| | | { |
| | | title: '上级设备分类名称', |
| | | align: "center", |
| | | dataIndex: 'parentName', |
| | | }, */ |
| | | { |
| | | title: '分类编码', |
| | | align: "center", |
| | |
| | | this.visible = true; |
| | | this.disableSubmit = false; |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, 'parentNum','equipmentCategoryUda1','equipmentCategoryUda2', 'parentName', 'num', 'name', 'remark')) |
| | | this.form.setFieldsValue(pick(this.model, 'parentNum', 'equipmentCategoryUda1', 'equipmentCategoryUda2', 'parentName', 'num', 'name', 'remark')) |
| | | }); |
| | | if (record.id) { |
| | | this.codeDisable = true; |
| | |
| | | this.onClearSelected(); |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectionRows) { |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.selectionRows = selectionRows; |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.selectionRows = selectionRows; |
| | | }, |
| | | onClearSelected() { |
| | | this.selectedRowKeys = []; |
| | | this.selectionRows = []; |
| | | this.selectedRowKeys = []; |
| | | this.selectionRows = []; |
| | | }, |
| | | |
| | | //保存并新增按钮触发 |
| | |
| | | let obj; |
| | | if (!this.model.id) { |
| | | formData.parentId = this.parentId |
| | | formData.equipmentCategoryUda1 = this.equipmentCategoryUda1; |
| | | obj = postAction(this.url.add, formData); |
| | | } else { |
| | | formData.equipmentCategoryDtlList = this.selectionRows; |
| | |
| | | } |
| | | }) |
| | | }, |
| | | clearList(){ |
| | | this.dataSource=[] |
| | | this.selectedRowKeys=[] |
| | | this.ipagination.current = 1 |
| | | clearList() { |
| | | this.dataSource = [] |
| | | this.selectedRowKeys = [] |
| | | this.ipagination.current = 1 |
| | | } |
| | | |
| | | }, |
| | |
| | | alterFlag() { |
| | | this.$bus.$emit('queryTreeData'); |
| | | }, |
| | | mainId:{ |
| | | immediate:true, |
| | | handler(val) { |
| | | if(!this.mainId){ |
| | | this.clearList() |
| | | }else{ |
| | | this.queryParam['parentId'] = val |
| | | this.loadData(1); |
| | | } |
| | | mainId: { |
| | | immediate: true, |
| | | handler(val) { |
| | | if (!this.mainId) { |
| | | this.clearList() |
| | | } else { |
| | | this.queryParam['parentId'] = val |
| | | this.loadData(1); |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |