|
@@ -93,6 +93,16 @@
|
|
|
<el-input v-model="form.name"
|
|
|
autocomplete="off"></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="所属分部"
|
|
|
+ prop="organId"
|
|
|
+ :label-width="formLabelWidth">
|
|
|
+ <el-select v-model="form.organId">
|
|
|
+ <el-option v-for="item in userBranchList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="联系人"
|
|
|
prop="linkman"
|
|
|
:label-width="formLabelWidth">
|
|
@@ -131,6 +141,7 @@
|
|
|
<script>
|
|
|
import pagination from '@/components/Pagination/index'
|
|
|
import { cooperationOrganAdd, cooperationOrganUpdate, cooperationOrganDel, queryPage } from '@/api/systemManage'
|
|
|
+import { getEmployeeOrgan } from '@/api/buildTeam'
|
|
|
import store from '@/store'
|
|
|
import { isvalidPhone } from '@/utils/validate'
|
|
|
let validPhone = (rule, value, callback) => {
|
|
@@ -152,6 +163,7 @@ export default {
|
|
|
},
|
|
|
searchLsit: [],
|
|
|
tableList: [],
|
|
|
+ userBranchList: [], // 用户当前分部列表
|
|
|
pageInfo: {
|
|
|
// 分页规则
|
|
|
limit: 10, // 限制显示条数
|
|
@@ -180,6 +192,7 @@ export default {
|
|
|
linkman: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
|
|
|
job: [{ required: true, message: '请输入职位', trigger: 'blur' }],
|
|
|
mobileNo: [{ required: true, validator: validPhone, trigger: 'blur' }],
|
|
|
+ organId: [{ required: true, message: '请选择所属分部', trigger: 'change' }]
|
|
|
// ownershipType: [{ required: true, message: '请选择权属类型', trigger: 'change' }]
|
|
|
},
|
|
|
|
|
@@ -187,6 +200,18 @@ export default {
|
|
|
},
|
|
|
mounted () {
|
|
|
this.getList() // 获取列表数据
|
|
|
+
|
|
|
+ // 获取当前用户分部
|
|
|
+ getEmployeeOrgan().then(res => {
|
|
|
+ if(res.code == 200){
|
|
|
+ res.data.forEach(item => {
|
|
|
+ this.userBranchList.push({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
onDelete (rows) {
|
|
@@ -211,6 +236,9 @@ export default {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.formActionTitle == 'create') {
|
|
|
+ if (this.form.id) { // 判断有没有Id,如果有则删除
|
|
|
+ delete this.form.id
|
|
|
+ }
|
|
|
cooperationOrganAdd(this.form).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success('修改成功')
|
|
@@ -222,7 +250,6 @@ export default {
|
|
|
})
|
|
|
} else if (this.formActionTitle == 'update') {
|
|
|
cooperationOrganUpdate(this.form).then(res => {
|
|
|
- // console.log(res)
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success('修改成功')
|
|
|
this.teachingStatus = false
|
|
@@ -239,7 +266,6 @@ export default {
|
|
|
},
|
|
|
getList () {
|
|
|
queryPage({
|
|
|
- search: this.form.organId,
|
|
|
rows: this.pageInfo.limit,
|
|
|
page: this.pageInfo.page
|
|
|
}).then(res => {
|
|
@@ -271,17 +297,18 @@ export default {
|
|
|
job: rows.job, // 费用
|
|
|
mobileNo: rows.mobileNo ? rows.mobileNo : null,
|
|
|
ownershipType: rows.ownershipType,
|
|
|
- organId: null
|
|
|
+ organId: rows.organId
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
onFormClose (formName) { // 关闭弹窗重置验证
|
|
|
- this.$refs[formName].clearValidate()
|
|
|
+ // this.$refs[formName].clearValidate()
|
|
|
+ this.$refs[formName].resetFields()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-<style lang="scss">
|
|
|
+<style lang="scss" scoped>
|
|
|
.el-button--primary {
|
|
|
background: #14928a;
|
|
|
border-color: #14928a;
|
|
@@ -294,6 +321,9 @@ export default {
|
|
|
color: #fff;
|
|
|
}
|
|
|
}
|
|
|
+/deep/.el-select {
|
|
|
+ width: 100% !important;
|
|
|
+}
|
|
|
.el-vue-search-box-container {
|
|
|
position: absolute !important;
|
|
|
left: 10px;
|