修改bug
This commit is contained in:
parent
4337353a1f
commit
8df2f9a64b
|
|
@ -40,6 +40,7 @@
|
|||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined" style="margin-left: 8px"> 新增</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
|
@ -98,6 +99,7 @@
|
|||
</a-row>
|
||||
<!-- 表单区域 -->
|
||||
<NuBaseInfoModal ref="registerModal" @success="handleSuccess"></NuBaseInfoModal>
|
||||
<NuBaseInfoAddModal ref="registerAddModal" @success="handleSuccess"></NuBaseInfoAddModal>
|
||||
<BaseWlsbListModal ref="wlsbModal" ></BaseWlsbListModal>
|
||||
<CameraPreviewModal ref="previewModal"></CameraPreviewModal>
|
||||
<!--角色菜单授权抽屉-->
|
||||
|
|
@ -113,6 +115,7 @@
|
|||
import { qyList, saveOrUpdate } from './NuBaseInfo.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import NuBaseInfoModal from './components/NuBaseInfoModal.vue'
|
||||
import NuBaseInfoAddModal from './components/NuBaseInfoAddModal.vue'
|
||||
import BaseWlsbListModal from './components/BaseWlsbListModal.vue'
|
||||
import CameraPreviewModal from '/@/views/iot/tplink/camera/components/CameraPreviewModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
|
|
@ -139,6 +142,7 @@ const { createMessage } = useMessage();
|
|||
const tableData = ref<any>([]);
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const registerAddModal = ref();
|
||||
const userStore = useUserStore();
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
|
|
@ -164,6 +168,13 @@ const { createMessage } = useMessage();
|
|||
wlsbModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerAddModal.value.disableSubmit = false;
|
||||
registerAddModal.value.add();
|
||||
}
|
||||
//清口区域状态
|
||||
function changeAreaFlag(value) {
|
||||
queryParam.status = '';
|
||||
|
|
|
|||
|
|
@ -0,0 +1,172 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||
name="NuBaseInfoForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="区域名称" v-bind="validateInfos.nuName" id="NuBaseInfoForm-nuName" name="nuName">
|
||||
<a-input v-model:value="formData.nuName" placeholder="请输入区域名称" maxLength="15" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" hidden>
|
||||
<a-form-item label="区域编码" v-bind="validateInfos.nuId" id="NuBaseInfoForm-nuId" name="nuId">
|
||||
<a-input v-model:value="formData.nuId" placeholder="编码自动生成" allow-clear :disabled="true"
|
||||
:readonly="formData.nuId"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" >
|
||||
<a-form-item label="区域属性" v-bind="validateInfos.areaFlag" id="NuBaseInfoForm-areaFlag" name="areaFlag">
|
||||
<j-dict-select-tag v-model:value="formData.areaFlag" dictCode="nu_type"
|
||||
placeholder="请选择区域属性" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <a-col :span="24">
|
||||
<a-form-item label="使用状态 0未使用 1占用 2入住 3退住 4留床" v-bind="validateInfos.status" id="NuBaseInfoForm-status" name="status">
|
||||
<j-dict-select-tag v-model:value="formData.status" dictCode="nu_status" placeholder="请选择使用状态 0未使用 1占用 2入住 3退住 4留床" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../NuBaseInfo.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({}) },
|
||||
formBpm: { type: Boolean, default: true }
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
nuName: '',
|
||||
nuId: '',
|
||||
areaFlag: '',
|
||||
status: '',
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
nuName: [{ required: true, message: '请输入文件类型!' },],
|
||||
areaFlag: [{ required: true, message: '请选择区域属性!' },],
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(() => {
|
||||
if (props.formBpm === true) {
|
||||
if (props.formData.disabled === false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if (record.hasOwnProperty(key)) {
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
try {
|
||||
// 触发表单验证
|
||||
await validate();
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
}
|
||||
confirmLoading.value = true;
|
||||
const isUpdate = ref<boolean>(false);
|
||||
//时间格式化
|
||||
let model = formData;
|
||||
if (model.id) {
|
||||
isUpdate.value = true;
|
||||
}
|
||||
//循环数据
|
||||
for (let data in model) {
|
||||
//如果该数据是数组并且是字符串类型
|
||||
if (model[data] instanceof Array) {
|
||||
let valueType = getValueType(formRef.value.getProps, data);
|
||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||
if (valueType === 'string') {
|
||||
model[data] = model[data].join(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!model.id) {
|
||||
model.status = "0";
|
||||
}
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 0px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
<template>
|
||||
<!-- <j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"> -->
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true" bodyStyle="padding:14px;"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
|
||||
<NuBaseInfoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuBaseInfoForm>
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
|
||||
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
<!-- </j-modal> -->
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import NuBaseInfoForm from './NuBaseInfoAddForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
title.value = '新增';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = disableSubmit.value ? '详情' : '更名';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
|
|
@ -45,6 +45,11 @@ export const columns: BasicColumn[] = [
|
|||
align: 'center',
|
||||
dataIndex: 'guardianPhone',
|
||||
},
|
||||
{
|
||||
title: '入驻日期',
|
||||
align: 'center',
|
||||
dataIndex: 'checkinTime',
|
||||
},
|
||||
];
|
||||
|
||||
export const auditHisColumns: BasicColumn[] = [
|
||||
|
|
@ -105,7 +110,7 @@ export const auditHisColumns: BasicColumn[] = [
|
|||
if (text == '2') {
|
||||
applyStatus = '审核通过';
|
||||
} else if (text == '3') {
|
||||
applyStatus = '审核未通过';
|
||||
applyStatus = '审核驳回';
|
||||
}
|
||||
return applyStatus;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -17,6 +17,12 @@
|
|||
<JInput v-model:value="queryParam.guardianName" placeholder="请输入监护人姓名" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="checkinTime">
|
||||
<template #label><span title="入驻日期">入驻日期</span></template>
|
||||
<a-date-picker placeholder="请选择入驻日期" v-model:value="queryParam.checkinTime" value-format="YYYY-MM-DD" style="width: 100%" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-col :lg="6">
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ const superQueryConfig = reactive(superQuerySchema);
|
|||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
record.status = record.modifyStatus;
|
||||
registerModal.value.hisDetail(record, props.querySign);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@
|
|||
</a-table>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
{{ izAudit }} 1
|
||||
|
||||
<a-form style="margin-top: 14px;height: 100px;" ref="formRef" layout="horizontal" :model="formData"
|
||||
:label-col="labelCol" :wrapper-col="wrapperCol" v-if="izAudit">
|
||||
<a-row :gutter="16">
|
||||
|
|
@ -57,6 +60,29 @@
|
|||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<JFormContainer :disabled="true">
|
||||
<template #detail>
|
||||
<a-form style="margin-top: 14px;height: 100px;" ref="formRef" layout="horizontal" :model="formData"
|
||||
:label-col="labelCol" :wrapper-col="wrapperCol" v-if="!izAudit">
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="审核状态" name="status" v-bind="validateInfos.status">
|
||||
<a-select v-model:value="formData.status" style="width: 200px" placeholder="请选择审核状态">
|
||||
<a-select-option value="2">审核通过</a-select-option>
|
||||
<a-select-option value="3">审核驳回</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" v-if="formData.status == '3'">
|
||||
<a-form-item label="驳回原因" name="auditContent" v-bind="validateInfos.auditContent">
|
||||
<a-textarea :maxlength="50" show-count v-model:value="formData.auditContent" placeholder="请输入驳回原因(如驳回)"
|
||||
style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -68,6 +94,7 @@ import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.v
|
|||
import { getModifyInfo, getHisModifyInfo, guaAudit } from '../ElderInfo.api'
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { initDictOptions } from '/@/utils/dict';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
|
||||
const props = defineProps({
|
||||
sndjDicts: null
|
||||
|
|
@ -202,6 +229,7 @@ const setRowClassName = (record) => {
|
|||
};
|
||||
const izAudit = ref(false)
|
||||
async function show(record, sign) {
|
||||
console.log("🚀 ~ show ~ record, sign:", record, sign)
|
||||
let data = null;
|
||||
if (sign == 'audit') {
|
||||
data = await getModifyInfo({ id: record.id, queryModifyType: 'gua' })
|
||||
|
|
@ -217,6 +245,8 @@ async function show(record, sign) {
|
|||
formData.guardianOpenId = record.guardianOpenId
|
||||
formData.name = record.name
|
||||
formData.sysOrgCode = record.sysOrgCode
|
||||
formData.status = record.status
|
||||
formData.auditContent = record.auditContent
|
||||
|
||||
tableData.value = data.map(item => ({
|
||||
...item,
|
||||
|
|
|
|||
|
|
@ -79,13 +79,13 @@
|
|||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
sm:4,
|
||||
xl:6,
|
||||
xxl:4
|
||||
sm:8,
|
||||
xl:8,
|
||||
xxl:8
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
sm: 16,
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue