添加客户操作功能

This commit is contained in:
yangjun 2025-04-16 09:22:35 +08:00
parent 942efd62ce
commit 1009de2848
3 changed files with 191 additions and 1 deletions

View File

@ -29,7 +29,15 @@
</div> </div>
<a-row> <a-row>
<a-col :span="6" v-for="(item,index) in dataList" :key="index"> <a-col :span="6" v-for="(item,index) in dataList" :key="index">
<a-card :title="item.customerName +'/'+item.customerSex_dictText +'/'+item.currentState_dictText " class="cardClass"> <a-card class="cardClass">
<template #title>
{{item.customerName}} /
{{item.customerSex_dictText?item.customerSex_dictText:'无'}} /
<span v-if="item.currentState=='0'" style="color: #1890ff">{{item.currentState_dictText}}</span>
<span v-if="item.currentState=='1'" style="color: green">{{item.currentState_dictText}}</span>
<span v-if="item.currentState=='2'" style="color: #ff6c00">{{item.currentState_dictText}}</span>
<span v-if="item.currentState=='3'" style="color: red">{{item.currentState_dictText}}</span>
</template>
<template #extra><a title="操作"> <template #extra><a title="操作">
<a-popover title="功能" style="width: 300px;" placement="topRight"> <a-popover title="功能" style="width: 300px;" placement="topRight">
@ -38,6 +46,18 @@
<span class="buttonMargin"> <span class="buttonMargin">
<a-button type="primary" @click="handleEdit(item)">编辑</a-button> <a-button type="primary" @click="handleEdit(item)">编辑</a-button>
</span> </span>
<span class="buttonMargin" v-if="item.currentState!='3'">
<a-button type="primary" @click="handleCheckNu(item)">更换护理单元</a-button>
</span>
<span class="buttonMargin" v-if="item.currentState=='1'">
<a-button type="primary" @click="handleWaichu(item)">外出</a-button>
</span>
<span class="buttonMargin" v-if="item.currentState=='2'">
<a-button type="primary" @click="handleFanhui(item)">返回</a-button>
</span>
<span class="buttonMargin" v-if="item.currentState=='1' || item.currentState=='2'">
<a-button type="primary" @click="handleTuizhu(item)">退住</a-button>
</span>
</div> </div>
</template> </template>
<icon icon="ant-design:setting-outlined" /> <icon icon="ant-design:setting-outlined" />
@ -69,6 +89,7 @@
<!-- 表单区域 --> <!-- 表单区域 -->
<NuBizCustomerInfoModal ref="registerModal" @success="handleSuccess"></NuBizCustomerInfoModal> <NuBizCustomerInfoModal ref="registerModal" @success="handleSuccess"></NuBizCustomerInfoModal>
<CheckNuListModal ref="checkNuListModal" @success="handleSuccess"></CheckNuListModal>
</div> </div>
</template> </template>
@ -78,6 +99,7 @@
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuBizCustomerInfo.api'; import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuBizCustomerInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils'; import { downloadFile } from '/@/utils/common/renderUtils';
import NuBizCustomerInfoModal from './components/NuBizCustomerInfoModal.vue' import NuBizCustomerInfoModal from './components/NuBizCustomerInfoModal.vue'
import CheckNuListModal from './components/CheckNuListModal.vue'
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils'; import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
@ -88,6 +110,7 @@
const queryParam = reactive<any>({}); const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false); const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref(); const registerModal = ref();
const checkNuListModal = ref();
const userStore = useUserStore(); const userStore = useUserStore();
const dataList = ref<any[]>([]); const dataList = ref<any[]>([]);
const current = ref(1); const current = ref(1);
@ -105,6 +128,29 @@
}); });
//
function handleCheckNu(record){
checkNuListModal.value.disableSubmit = false;
checkNuListModal.value.edit(record);
}
//退
function handleTuizhu(record){
defHttp.post({ url: "/nuBizCustomerInfo/nuBizCustomerInfo/editTuizhu", params: { id: record.id } }).then((data) => {
reload();
});
}
//
function handleWaichu(record){
defHttp.post({ url: "/nuBizCustomerInfo/nuBizCustomerInfo/edit", params: { id: record.id,currentStatus:'2' } }).then((data) => {
reload();
});
}
//
function handleFanhui(record){
defHttp.post({ url: "/nuBizCustomerInfo/nuBizCustomerInfo/edit", params: { id: record.id,currentStatus:'1' } }).then((data) => {
reload();
});
}
//logo //logo
function handleHeadPath(headPath){ function handleHeadPath(headPath){

View File

@ -0,0 +1,67 @@
<template>
<div>
<div v-for="(item, index) in nulistSource" :key="index" style="padding: 4px">
<a-card :title="index+1 +'、'+ item.nuName" style="width: 100%">
<template #extra><a @click="handleCheckNu(item)" >{{nuId == item.id?'已选择':'选择'}}</a></template>
</a-card>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import axios from 'axios';
const emit = defineEmits(['register', 'ok']);
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const nulistSource = ref([]);
const customerInfo = ref<any>({});
const nuId = ref<string>('');
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
customerInfo.value = record;
const getNulistUrl = "/h5Api/nuBaseInfo/list";
defHttp.get({ url: getNulistUrl }).then((data) => {
nulistSource.value = data;
});
}
/**
* 提交数据
*/
async function submitForm() {
defHttp.post({ url: '/nuBizCustomerInfo/nuBizCustomerInfo/editNu', params: customerInfo.value }).then((data) => {
emit('ok');
});
}
function handleCheckNu(record) {
customerInfo.value.nuId = record.id;
nuId.value = record.id;
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,77 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<CheckNuListForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></CheckNuListForm>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import CheckNuListForm from './CheckNuListForm.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(record) {
handleCancel();
emit('success',record);
}
/**
* 取消按钮回调事件
*/
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>