| | |
| | | <!-- 按钮操作区域 --> |
| | | <a-row style="margin-left: 14px"> |
| | | <a-button @click="handleAdd(1)" type="primary">添加机构</a-button> |
| | | <a-button @click="handleAdd(2)" type="primary">添加下级</a-button> |
| | | <!--<a-button type="primary" icon="download" @click="handleExportXls('车间信息')">导出</a-button>--> |
| | | <!--<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"--> |
| | | <!--:action="importExcelUrl" @change="handleImportExcel">--> |
| | | <!--<a-button type="primary" icon="import">导入</a-button>--> |
| | | <!--</a-upload>--> |
| | | <a-button @click="handleAdd(2)" type="primary" v-if="currSelected.factoryCategory!=3">添加下级</a-button> |
| | | <a-button @click="handleDelete" v-if="selectedKeys.length>0">删除</a-button> |
| | | <a-button title="删除多条数据" @click="batchDel" v-if="checkedKeys.length>0">批量删除</a-button> |
| | | </a-row> |
| | |
| | | <a-input-search @search="onSearch" style="width:100%;margin-top: 10px" placeholder="请输入车间名称"/> |
| | | <!-- 树--> |
| | | <a-col :md="10" :sm="24"> |
| | | <a-tree |
| | | checkable |
| | | multiple |
| | | @select="onSelect" |
| | | @check="onCheck" |
| | | :selectedKeys="selectedKeys" |
| | | :checkedKeys="checkedKeys" |
| | | :treeData="departTree" |
| | | :checkStrictly="checkStrictly" |
| | | :expandedKeys="expandedKeys" |
| | | :autoExpandParent="autoExpandParent" |
| | | @expand="onExpand"/> |
| | | <a-tree checkable multiple @select="onSelect" @check="onCheck" :selectedKeys="selectedKeys" |
| | | :checkedKeys="checkedKeys" :treeData="departTree" :checkStrictly="checkStrictly" |
| | | :expandedKeys="expandedKeys" :autoExpandParent="autoExpandParent" @expand="onExpand"/> |
| | | </a-col> |
| | | </div> |
| | | </a-card> |
| | |
| | | <template v-if="selectedKeys.length>0"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol"> |
| | | <a-form-model-item label="机构编码"> |
| | | <a-form-model-item label="机构编码" prop="factoryCode"> |
| | | <a-input placeholder="请输入机构编码" v-model="model.factoryCode"/> |
| | | </a-form-model-item> |
| | | <a-form-model-item expandedKeys prop="factoryName" label="机构名称"> |
| | | <a-form-model-item prop="factoryName" label="机构名称"> |
| | | <a-input placeholder="请输入机构名称" v-model="model.factoryName"/> |
| | | </a-form-model-item> |
| | | <a-form-model-item expandedKeys label="上级车间"> |
| | |
| | | sm: { span: 16 } |
| | | }, |
| | | validatorRules: { |
| | | factoryName: [{ required: true, message: '请输入机构名称!' }] |
| | | factoryCode: [{ required: true, message: '请输入机构编号', trigger: 'change' }], |
| | | factoryName: [{ required: true, message: '请输入机构名称', trigger: 'change' }] |
| | | }, |
| | | url: { |
| | | getProductionTreeList: '/eam/BaseFactory/queryTreeList', |
| | | delete: '/eam/BaseFactory/delete', |
| | | edit: '/eam/BaseFactory/edit', |
| | | deleteBatch: '/eam/BaseFactory/deleteBatch', |
| | | exportXlsUrl: '/eam/BaseFactory/exportXls', |
| | | importExcelUrl: '/eam/BaseFactory/importExcel' |
| | | deleteBatch: '/eam/BaseFactory/deleteBatch' |
| | | }, |
| | | isIncludesNotLeaf: false, |
| | | confirmLoading: false |
| | |
| | | this.model = this.currSelected |
| | | this.selectedKeys = [record.key] |
| | | this.$refs.userList.show(record.id) |
| | | if (this.$refs.form) this.$refs.form.clearValidate() |
| | | }, |
| | | |
| | | onClearSelected() { |
| | |
| | | }, |
| | | |
| | | emptyCurrForm() { |
| | | this.$refs.form.resetFields() |
| | | this.model = {} |
| | | this.model = { parentId: this.model.parentId } |
| | | }, |
| | | |
| | | handleAdd(num) { |