|
@@ -53,6 +53,7 @@
|
|
:with-search="false"
|
|
:with-search="false"
|
|
search-placeholder="请输入单位名称"
|
|
search-placeholder="请输入单位名称"
|
|
:data-list="regulatorList"
|
|
:data-list="regulatorList"
|
|
|
|
+ :check-disabled="regulatorCheckDisabled"
|
|
@load="loadRegulatorList"
|
|
@load="loadRegulatorList"
|
|
@check-change="regulatorCheckChangeHandler"
|
|
@check-change="regulatorCheckChangeHandler"
|
|
/>
|
|
/>
|
|
@@ -89,23 +90,99 @@ import sectionTree from '../mixins/sectionTree'
|
|
import regulatorList from '../mixins/regulatorList'
|
|
import regulatorList from '../mixins/regulatorList'
|
|
import orgTree from '../mixins/orgTree'
|
|
import orgTree from '../mixins/orgTree'
|
|
import { SaveSection } from '@/api/section'
|
|
import { SaveSection } from '@/api/section'
|
|
|
|
+import { translateDataToTreeAll } from '@/utils/validate'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
components: { CheckCardList, MultipleTree },
|
|
components: { CheckCardList, MultipleTree },
|
|
mixins: [userList, sectionTree, regulatorList, orgTree],
|
|
mixins: [userList, sectionTree, regulatorList, orgTree],
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ regulatorCheckDisabled: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ checkedSections(arr) {
|
|
|
|
+ this.hasChecked('section', !!arr.length)
|
|
|
|
+ },
|
|
|
|
+ checkedRegulators(arr) {
|
|
|
|
+ this.hasChecked('regulator', !!arr.length)
|
|
|
|
+ },
|
|
|
|
+ checkedOrgs(arr) {
|
|
|
|
+ this.hasChecked('org', !!arr.length)
|
|
|
|
+ },
|
|
|
|
+ sectionList: {
|
|
|
|
+ handler(arr) {
|
|
|
|
+ const obj = {
|
|
|
|
+ SessionId: -1,
|
|
|
|
+ SessionName: '标段',
|
|
|
|
+ UpSessionId: -2,
|
|
|
|
+ disabled: true,
|
|
|
|
+ children: translateDataToTreeAll(arr, 'UpSessionId', 'SessionId')
|
|
|
|
+ }
|
|
|
|
+ this.sectionTree = [obj]
|
|
|
|
+ },
|
|
|
|
+ deep: true
|
|
|
|
+ },
|
|
|
|
+ orgList: {
|
|
|
|
+ handler(arr) {
|
|
|
|
+ const obj = {
|
|
|
|
+ AuthCount: 0,
|
|
|
|
+ JobCount: 0,
|
|
|
|
+ OfficerCount: 0,
|
|
|
|
+ OrganId: -1,
|
|
|
|
+ OrganName: '佛山路桥',
|
|
|
|
+ OrganUpid: -2,
|
|
|
|
+ QueryTarget: '0',
|
|
|
|
+ Type: 0,
|
|
|
|
+ disabled: true,
|
|
|
|
+ children: translateDataToTreeAll(arr, 'OrganUpid', 'OrganId')
|
|
|
|
+ }
|
|
|
|
+ this.orgTree = [obj]
|
|
|
|
+ },
|
|
|
|
+ deepL: true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ hasChecked(type, checked) {
|
|
|
|
+ switch (type) {
|
|
|
|
+ case 'section':
|
|
|
|
+ this.regulatorCheckDisabled = checked
|
|
|
|
+ this.orgList = this.orgList.map(element => {
|
|
|
|
+ element.disabled = checked
|
|
|
|
+ return element
|
|
|
|
+ })
|
|
|
|
+ break
|
|
|
|
+ case 'regulator':
|
|
|
|
+ this.sectionList = this.sectionList.map(element => {
|
|
|
|
+ element.disabled = checked
|
|
|
|
+ return element
|
|
|
|
+ })
|
|
|
|
+ this.orgList = this.orgList.map(element => {
|
|
|
|
+ element.disabled = checked
|
|
|
|
+ return element
|
|
|
|
+ })
|
|
|
|
+ break
|
|
|
|
+ case 'org':
|
|
|
|
+ this.regulatorCheckDisabled = checked
|
|
|
|
+ this.sectionList = this.sectionList.map(element => {
|
|
|
|
+ element.disabled = checked
|
|
|
|
+ return element
|
|
|
|
+ })
|
|
|
|
+ break
|
|
|
|
+ default:
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ },
|
|
btnSaveHandler() {
|
|
btnSaveHandler() {
|
|
if (this.checkedUsers.length === 0) {
|
|
if (this.checkedUsers.length === 0) {
|
|
this.$message.error('请选择用户')
|
|
this.$message.error('请选择用户')
|
|
return
|
|
return
|
|
- } else if (this.checkedSections.length === 0) {
|
|
|
|
- this.$message.error('请选择标段')
|
|
|
|
- return
|
|
|
|
- } else if (this.checkedRegulators.length === 0) {
|
|
|
|
- this.$message.error('请选择监管单位')
|
|
|
|
- return
|
|
|
|
- } else if (this.checkedOrgs.length === 0) {
|
|
|
|
- this.$message.error('请选择组织')
|
|
|
|
|
|
+ } else if (
|
|
|
|
+ this.checkedSections.length === 0 &&
|
|
|
|
+ this.checkedRegulators.length === 0 &&
|
|
|
|
+ this.checkedOrgs.length === 0
|
|
|
|
+ ) {
|
|
|
|
+ this.$message.error('请选择标段、监管单位或组织')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
const mixedDatas = []
|
|
const mixedDatas = []
|