| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="lm_user" |
| | | prop="username" |
| | | label="创建人员" |
| | | sortable="custom" |
| | | /> |
| | |
| | | <el-form-item label="组织名称" prop="OrganName"> |
| | | <el-input v-model="dialogForm.OrganName" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="所属组织" prop="parent_id"> |
| | | <el-form-item label="所属组织" prop="storgcode"> |
| | | <el-cascader |
| | | ref="cascader" |
| | | v-model="dialogForm.parent_id" |
| | | v-model="dialogForm.storgcode" |
| | | :options="cascaderOptions" |
| | | filterable |
| | | :props="defaultProps" |
| | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleCancel">取 消</el-button> |
| | | <el-button v-waves type="primary" @click="dialogVisibleConfirm">确 定</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="dialogVisibleConfirm" |
| | | >确 定</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | |
| | | OrganCode: '', // 组织编码 |
| | | OrganName: '', // 组织名称 |
| | | leve: 0, // 层级编码 |
| | | parent_id: '', // 父级编码 |
| | | storgcode: '', // 父级编码 |
| | | parent_id: '', // 原pid |
| | | torg_seq: '', // 排序 |
| | | status: 'Y'// 状态 |
| | | }, |
| | |
| | | OrganName: [ |
| | | { required: true, message: '请输入组织名称', trigger: ['blur', 'change'] } |
| | | ], |
| | | parent_id: [ |
| | | storgcode: [ |
| | | { required: true, message: '请选择所属组织', trigger: ['blur', 'change'] } |
| | | ] |
| | | }, |
| | |
| | | this.dialogForm.leve = parseFloat(row.leve) |
| | | this.dialogForm.torg_seq = row.torg_seq |
| | | this.dialogForm.status = row.status |
| | | this.dialogForm.parent_id = this.findParent([], row.parent_id, this.cascaderOptions).reverse() |
| | | this.dialogForm.storgcode = this.findParent([], row.parent_id, this.cascaderOptions).reverse() |
| | | this.dialogForm.parent_id = row.parent_id |
| | | }) |
| | | }, |
| | | filterChildren(treeData, code) { |
| | |
| | | handleClose() { |
| | | this.dialogForm.OrganCode = '' |
| | | this.dialogForm.OrganName = '' |
| | | this.dialogForm.storgcode = '' |
| | | this.dialogForm.parent_id = '' |
| | | this.dialogForm.status = 'Y' |
| | | this.dialogForm.leve = 0 |
| | |
| | | }, |
| | | cascaderChange(val) { |
| | | const temp = this.Options.find(i => i.torg_code === val[val.length - 1]) |
| | | this.dialogForm.parent_id = val |
| | | this.dialogForm.storgcode = val |
| | | this.dialogForm.leve = parseFloat(temp.leve) + 1 |
| | | this.dialogForm.torg_seq = this.Options.filter(i => i.parent_id === val[val.length - 1]).length + 1 |
| | | }, |
| | |
| | | dialogVisibleConfirm() { |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | this.dialogForm.parent_id = this.dialogForm.parent_id[this.dialogForm.parent_id.length - 1] |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | this.dialogForm.storgcode = this.dialogForm.storgcode[this.dialogForm.storgcode.length - 1] |
| | | AddUpdateOrganization(this.dialogForm).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success(this.operation === 'add' ? '添加成功!' : '修改成功!') |
| | | this.dialogVisible = false |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.getSTorgData() |
| | | } else { |
| | | this.$notify.error(this.operation === 'add' ? '添加失败!' : '修改失败!') |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } |
| | | }) |
| | | } |