update
1.修改socket弹窗等
This commit is contained in:
@@ -14,10 +14,10 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="单位">
|
||||
<a-select placeholder="选择单位" v-model:value="orgCode" :options="option" :field-names="fieldNames" />
|
||||
<a-select placeholder="选择单位" @change="changeSecond" v-model:value="orgCode1" :options="option1" />
|
||||
</a-form-item>
|
||||
<a-form-item label="部门">
|
||||
<a-select placeholder="选择单位" @focus="changeDept" v-model:value="orgCode" :options="option" :field-names="fieldNames" />
|
||||
<a-select placeholder="选择部门" v-model:value="orgCode2" :options="option2" />
|
||||
</a-form-item>
|
||||
<slot name="searchSecond"></slot>
|
||||
</Form>
|
||||
@@ -56,12 +56,11 @@
|
||||
import Dialog from '/@/components/dialog/Dialog.vue';
|
||||
import { useDialog } from '/@/views/components/dialogHooks.ts';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { SexType, sexTypeList } from '/@/utils/settings.ts';
|
||||
import { SexType } from '/@/utils/settings.ts';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import { useDepart } from '/@/components/secondaryScreen/secondMap/secondMapHooks.ts';
|
||||
import { message } from 'ant-design-vue';
|
||||
import BasicTable from '/@/components/secondaryScreen/secondMap/components/basicTable/BasicTable.vue';
|
||||
import { getSecondaryDepartmentList } from '/@/views/indexSun/indexSun.api.ts';
|
||||
import { allSecondaryDepartsApi, getThreeDepartByOrgCodeApi } from '/@/views/indexSun/indexSun.api.ts';
|
||||
|
||||
const props = defineProps({
|
||||
title: {
|
||||
@@ -95,28 +94,71 @@
|
||||
const formState = ref();
|
||||
const registerTable = ref();
|
||||
const dialogTitle = ref('');
|
||||
const option1 = ref([{ label: '全部', value: '' }]);
|
||||
const option2 = ref([{ label: '全部', value: '' }]);
|
||||
const orgCode1 = ref('');
|
||||
const orgCode2 = ref('');
|
||||
const formRecord = ref({});
|
||||
const dataActity = ref(1);
|
||||
function changeDept() {
|
||||
if (!orgCode.value) {
|
||||
return message.warning('请先选择单位');
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
getSecondDept();
|
||||
getSecondDepart();
|
||||
});
|
||||
|
||||
function getSecondDepart() {
|
||||
allSecondaryDepartsApi({})
|
||||
.then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
const op: any[] = res?.result
|
||||
? res.result.map((it: any) => {
|
||||
return {
|
||||
label: it.departName,
|
||||
value: it.orgCode,
|
||||
};
|
||||
})
|
||||
: [];
|
||||
option1.value = option1.value.concat(op);
|
||||
} else {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
function handleDataChange(type) {
|
||||
if (type == dataActity.value) return;
|
||||
dataActity.value = type;
|
||||
}
|
||||
function getSecondDept() {
|
||||
getSecondaryDepartmentList().then((res) => {
|
||||
console.log(res, 'shshakjhdsjbjanmdjka');
|
||||
if (res.code == 200) {
|
||||
console.log(res, 'ddddddddd');
|
||||
}
|
||||
});
|
||||
|
||||
function changeSecond() {
|
||||
orgCode2.value = '';
|
||||
option2.value = [{ label: '全部', value: '' }];
|
||||
if (orgCode1.value) {
|
||||
getThirdD();
|
||||
}
|
||||
}
|
||||
|
||||
function getThirdD() {
|
||||
getThreeDepartByOrgCodeApi({ orgCode: orgCode1.value })
|
||||
.then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
const op: any[] = res?.result
|
||||
? res.result.map((it: any) => {
|
||||
return {
|
||||
label: it.departName,
|
||||
value: it.orgCode,
|
||||
};
|
||||
})
|
||||
: [];
|
||||
option2.value = option2.value.concat(op);
|
||||
} else {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
const formItemLayout = {
|
||||
labelCol: {
|
||||
style: { width: '80px' },
|
||||
@@ -137,7 +179,6 @@
|
||||
twoROnlyFun();
|
||||
}
|
||||
getField();
|
||||
getSecondDept();
|
||||
});
|
||||
const normalNum = ref();
|
||||
const abnormalNum = ref();
|
||||
@@ -189,7 +230,6 @@
|
||||
...formRecord.value,
|
||||
...result,
|
||||
};
|
||||
getSecondDept();
|
||||
console.log(formRecord.value);
|
||||
}
|
||||
function handleClicksearch() {
|
||||
@@ -200,7 +240,6 @@
|
||||
// registerTable.value.getRecords();
|
||||
}
|
||||
|
||||
const { orgCode, option, fieldNames, setOrgCode } = useDepart();
|
||||
const { visible, closeDialog, openDialog } = useDialog({ title: dialogTitle.value });
|
||||
|
||||
function handleClose() {
|
||||
|
||||
Reference in New Issue
Block a user