|
|
@@ -24,11 +24,6 @@
|
|
|
/>
|
|
|
<span> {{ formatDictValue(responseTypeOptions, record.treatmentStage) }}</span>
|
|
|
</template>
|
|
|
- <!-- <template v-if="column.key === 'supplierCategory'">
|
|
|
- <span>
|
|
|
- {{ formatDictValue(responsesupplierCategoryOptions, record.supplierCategory) }}</span
|
|
|
- >
|
|
|
- </template> -->
|
|
|
<template v-if="column.key === 'action'">
|
|
|
<TableAction
|
|
|
:actions="[
|
|
|
@@ -36,7 +31,11 @@
|
|
|
auth: 'biz:drug:edit',
|
|
|
icon: 'icon-xt-details_delete_default|iconfont',
|
|
|
tooltip: '删除',
|
|
|
- onClick: handleDelete.bind(null, record),
|
|
|
+ popConfirm: {
|
|
|
+ title: '是否确认删除',
|
|
|
+ placement: 'left',
|
|
|
+ confirm: handleDelete.bind(null, record),
|
|
|
+ },
|
|
|
},
|
|
|
]"
|
|
|
/>
|
|
|
@@ -46,19 +45,19 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
- import { onBeforeMount, ref } from 'vue';
|
|
|
+ import { onBeforeMount, ref, reactive } from 'vue';
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/TableCard';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
|
|
import { formatDictValue, formatDictPreColor } from '/@/utils';
|
|
|
import { columns } from './data';
|
|
|
|
|
|
- import { getrecordList, recordNumber, recordDel } from '/@/api/biz/mission/recordApi';
|
|
|
+ import { getrecordList, getRecordNumber, recordDel } from '/@/api/biz/mission/recordApi';
|
|
|
import { listDictModel } from '/@/api/common';
|
|
|
import { XTTitle } from '/@/components/XTTitle/index';
|
|
|
import { XTTab } from '/@/components/XTTab/index';
|
|
|
import { XTForm } from '/@/components/XTForm/index';
|
|
|
-
|
|
|
+ import dayjs from 'dayjs';
|
|
|
// formdata
|
|
|
const formData = [
|
|
|
{
|
|
|
@@ -67,7 +66,7 @@
|
|
|
format: 'YYYY-MM-DD',
|
|
|
valueFormat: 'YYYY-MM-DD',
|
|
|
placeholder: '请选择日期',
|
|
|
- width: 240,
|
|
|
+ width: 300,
|
|
|
},
|
|
|
{
|
|
|
name: 'searchNames',
|
|
|
@@ -77,22 +76,29 @@
|
|
|
width: 240,
|
|
|
},
|
|
|
];
|
|
|
+
|
|
|
+ const formValue = reactive({
|
|
|
+ shiftDate: [
|
|
|
+ dayjs().subtract(1, 'month').format('YYYY-MM-DD'),
|
|
|
+ dayjs().add(12, 'month').format('YYYY-MM-DD'),
|
|
|
+ ],
|
|
|
+ content: '',
|
|
|
+ });
|
|
|
+
|
|
|
// tab 切换选中
|
|
|
const tabSelected = ref();
|
|
|
// 操作名称
|
|
|
const searchNames = ref('');
|
|
|
- const shiftDate = ref([]);
|
|
|
+ // const shiftDate = ref([]);
|
|
|
|
|
|
const typeOptions = ref();
|
|
|
const responseTypeOptions = ref();
|
|
|
- const responsesupplierCategoryOptions = ref();
|
|
|
onBeforeMount(async () => {
|
|
|
- responseTypeOptions.value = await listDictModel({ dictCode: 'sys_disable_type' });
|
|
|
- responsesupplierCategoryOptions.value = await listDictModel({ dictCode: 'd' });
|
|
|
+ responseTypeOptions.value = await listDictModel({ dictCode: 'd' });
|
|
|
getTab();
|
|
|
});
|
|
|
|
|
|
- const { createMessage } = useMessage();
|
|
|
+ const { createConfirm, createMessage } = useMessage();
|
|
|
|
|
|
// const tableSort = ref([
|
|
|
// {
|
|
|
@@ -101,11 +107,11 @@
|
|
|
// },
|
|
|
// ]) as any;
|
|
|
|
|
|
- const [registerTable, { reload, clearSelectedRowKeys }] = useTable({
|
|
|
+ const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({
|
|
|
api: getrecordList,
|
|
|
batchDelApi: recordDel,
|
|
|
// batchExportApi: pharmaceuticalsExport,
|
|
|
- delAuthList: ['biz:consumable:remove'],
|
|
|
+ delAuthList: ['biz:educationRecord:remove'],
|
|
|
rowKey: 'id',
|
|
|
columns,
|
|
|
showIndexColumn: true,
|
|
|
@@ -121,11 +127,23 @@
|
|
|
// 删除按钮事件
|
|
|
async function handleDelete(record: Recordable) {
|
|
|
if (record) {
|
|
|
- await recordDel(record.id);
|
|
|
+ await recordDel([record.id]);
|
|
|
createMessage.success('删除成功!');
|
|
|
clearSelectedRowKeys();
|
|
|
await reload();
|
|
|
await getTab();
|
|
|
+ } else {
|
|
|
+ createConfirm({
|
|
|
+ content: '你确定要删除?',
|
|
|
+ iconType: 'warning',
|
|
|
+ onOk: async () => {
|
|
|
+ const keys = getSelectRowKeys();
|
|
|
+ await recordDel(keys);
|
|
|
+ createMessage.success('删除成功!');
|
|
|
+ await reload();
|
|
|
+ await getTab();
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -135,15 +153,19 @@
|
|
|
return {
|
|
|
...params,
|
|
|
// orders: tableSort.value,
|
|
|
- name: searchNames.value == '' ? undefined : searchNames.value,
|
|
|
- status: tabSelected.value == '' ? undefined : tabSelected.value,
|
|
|
- time: shiftDate.value.length <= 0 ? undefined : shiftDate.value,
|
|
|
+ title: searchNames.value == '' ? undefined : searchNames.value,
|
|
|
+ treatmentStage: tabSelected.value == '' ? undefined : tabSelected.value,
|
|
|
+ // time: shiftDate.value.length <= 0 ? undefined : shiftDate.value,
|
|
|
+ time: [
|
|
|
+ formValue.shiftDate[0],
|
|
|
+ dayjs(formValue.shiftDate[1]).add(1, 'day').format('YYYY-MM-DD'),
|
|
|
+ ],
|
|
|
};
|
|
|
}
|
|
|
|
|
|
async function getTab() {
|
|
|
- typeOptions.value = await listDictModel({ dictCode: 'sys_disable_type' });
|
|
|
- const typeNums = await recordNumber(); // 获取各类型数量
|
|
|
+ typeOptions.value = await listDictModel({ dictCode: 'd' });
|
|
|
+ const typeNums = await getRecordNumber(); // 获取各类型数量
|
|
|
let typeList = [];
|
|
|
typeOptions.value.forEach(ele => {
|
|
|
// 变量各类型放置对应数量
|
|
|
@@ -182,8 +204,9 @@
|
|
|
|
|
|
// 查询组件回调
|
|
|
async function callForm(data) {
|
|
|
- shiftDate.value = data.shiftDate ? data.shiftDate : '';
|
|
|
+ // shiftDate.value = data.shiftDate ? data.shiftDate : '';
|
|
|
searchNames.value = data.searchNames ? data.searchNames : '';
|
|
|
+ formValue.shiftDate = data.shiftDate || '';
|
|
|
console.log('callForm:::', searchNames.value);
|
|
|
await reload();
|
|
|
}
|
|
|
@@ -197,6 +220,18 @@
|
|
|
border-radius: 50%;
|
|
|
}
|
|
|
|
|
|
+ &--d_after {
|
|
|
+ background-color: #1bc1b3;
|
|
|
+ }
|
|
|
+
|
|
|
+ &--d_among {
|
|
|
+ background-color: #2d5aff;
|
|
|
+ }
|
|
|
+
|
|
|
+ &--d_before {
|
|
|
+ background-color: #854aff;
|
|
|
+ }
|
|
|
+
|
|
|
::v-deep(.ant-btn-link) {
|
|
|
color: #3d4155;
|
|
|
}
|