|
@@ -53,7 +53,6 @@ export default {
|
|
|
|
|
|
companyConfig: {
|
|
|
label: "所属公司",
|
|
|
- multiple: true,
|
|
|
field: { id: "id", label: "label" },
|
|
|
method: params => {
|
|
|
return new Promise(resolve => {
|
|
@@ -97,8 +96,11 @@ export default {
|
|
|
],
|
|
|
method: params => {
|
|
|
return new Promise(resolve => {
|
|
|
- let tenantId = (!this.$store.state.user.tenantId || this.$store.state.user.tenantId === 'null') ? null : this.$store.state.user.tenantId
|
|
|
- getPost({ ...params, tenantId }).then(res => {
|
|
|
+ if (!params.tenantId) {
|
|
|
+ let tenantId = (!this.$store.state.user.tenantId || this.$store.state.user.tenantId === 'null') ? null : this.$store.state.user.tenantId
|
|
|
+ params.tenantId = tenantId
|
|
|
+ }
|
|
|
+ getPost({ ...params }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
resolve(res.data)
|
|
|
} else {
|
|
@@ -125,13 +127,14 @@ export default {
|
|
|
{
|
|
|
group: [
|
|
|
{
|
|
|
- field: "tenantId",
|
|
|
+ field: "tenantIds",
|
|
|
label: "公司",
|
|
|
required: true,
|
|
|
type: 'select',
|
|
|
config: {
|
|
|
data: [],
|
|
|
- field: { id: "id", label: "label" },
|
|
|
+ field: { id: "id", label: "name" },
|
|
|
+ multiple: true,
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -240,12 +243,13 @@ export default {
|
|
|
if (res.code != 200) return this.$message.error('获取公司数据失败')
|
|
|
this.dialogVisible = true
|
|
|
this.inputConfig.data[0].group.forEach(i => {
|
|
|
- i.value = row[i.field]
|
|
|
- if (i.field ==='tenantId') {
|
|
|
- res.data.forEach(i => {
|
|
|
- i.label = i.name
|
|
|
- })
|
|
|
+
|
|
|
+ if (i.field ==='tenantIds') {
|
|
|
i.config.data = res.data
|
|
|
+ i.value = [row.tenantId]
|
|
|
+ i.disabled = true
|
|
|
+ } else {
|
|
|
+ i.value = row[i.field]
|
|
|
}
|
|
|
})
|
|
|
this.$nextTick(() => {
|
|
@@ -263,11 +267,9 @@ export default {
|
|
|
this.dialogVisible = true
|
|
|
this.inputConfig.data[0].group.forEach(i => {
|
|
|
i.value = ""
|
|
|
- if (i.field ==='tenantId') {
|
|
|
- res.data.forEach(i => {
|
|
|
- i.label = i.name
|
|
|
- })
|
|
|
+ if (i.field ==='tenantIds') {
|
|
|
i.config.data = res.data
|
|
|
+ i.disabled = false
|
|
|
}
|
|
|
})
|
|
|
this.$nextTick(() => {
|
|
@@ -289,7 +291,6 @@ export default {
|
|
|
})
|
|
|
} else if (this.status === '新增') {
|
|
|
// 至少填写一项
|
|
|
- if (Object.keys(data).some(k => data[k])) {
|
|
|
addPost(data).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success('添加成功')
|
|
@@ -297,7 +298,6 @@ export default {
|
|
|
this.cancel()
|
|
|
} else this.$message.error('添加失败')
|
|
|
})
|
|
|
- } else this.cancel()
|
|
|
}
|
|
|
|
|
|
} else this.$message.warning('请先填写必填项')
|