|
|
|
|
@ -12,11 +12,15 @@
|
|
|
|
|
<el-option v-for="dict in trip_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="申请人姓名" prop="applicantName">
|
|
|
|
|
<el-input v-model="queryParams.applicantName" placeholder="请输入申请人姓名" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
<el-form-item label="申请人姓名" prop="applicantId">
|
|
|
|
|
<el-select v-model="queryParams.applicantId" placeholder="请选择申请人" clearable filterable style="width: 200px">
|
|
|
|
|
<el-option v-for="user in userList" :key="user.userId" :label="user.nickName" :value="user.userId" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="申请人部门" prop="deptName">
|
|
|
|
|
<el-input v-model="queryParams.deptName" placeholder="请输入申请人部门" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
<el-form-item label="申请人部门" prop="deptId">
|
|
|
|
|
<el-select v-model="queryParams.deptId" placeholder="请选择部门" clearable filterable style="width: 200px">
|
|
|
|
|
<el-option v-for="dept in deptList" :key="dept.deptId" :label="dept.deptName" :value="dept.deptId" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="出差地点" prop="tripLocation">
|
|
|
|
|
<el-input v-model="queryParams.tripLocation" placeholder="请输入出差地点" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
@ -28,7 +32,9 @@
|
|
|
|
|
<el-date-picker clearable v-model="queryParams.endTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择结束日期" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="业务方向" prop="businessDirection">
|
|
|
|
|
<el-input v-model="queryParams.businessDirection" placeholder="请输入业务方向" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
<el-select v-model="queryParams.businessDirection" placeholder="请选择业务方向" clearable filterable style="width: 200px">
|
|
|
|
|
<el-option v-for="dict in business_direction" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="申请状态" prop="tripStatus">
|
|
|
|
|
<el-select v-model="queryParams.tripStatus" placeholder="请选择申请状态" clearable>
|
|
|
|
|
@ -107,7 +113,11 @@
|
|
|
|
|
<el-table-column label="项目ID" align="center" prop="projectId" v-if="columns[13].visible" />
|
|
|
|
|
<!-- <el-table-column label="客户ID" align="center" prop="customerId" v-if="columns[14].visible" /> -->
|
|
|
|
|
<el-table-column label="交流对象" align="center" prop="exchangeObject" v-if="columns[15].visible" />
|
|
|
|
|
<el-table-column label="业务方向" align="center" prop="businessDirection" v-if="columns[16].visible" />
|
|
|
|
|
<el-table-column label="业务方向" align="center" prop="businessDirection" v-if="columns[16].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :options="business_direction" :value="scope.row.businessDirection" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="交流目的" align="center" prop="exchangePurpose" v-if="columns[17].visible" />
|
|
|
|
|
<el-table-column label="交流过程简述" align="center" prop="exchangeProcess" v-if="columns[18].visible" />
|
|
|
|
|
<el-table-column label="会议/展会名称" align="center" prop="meetingName" v-if="columns[19].visible" />
|
|
|
|
|
@ -120,7 +130,7 @@
|
|
|
|
|
<el-table-column label="流程状态" align="center" prop="flowStatus" v-if="columns[22].visible" />
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" v-if="columns[23].visible" />
|
|
|
|
|
<!-- <el-table-column label="附件ID" align="center" prop="ossId" v-if="columns[24].visible" /> -->
|
|
|
|
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
|
|
|
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" width="160">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-tooltip
|
|
|
|
|
content="修改"
|
|
|
|
|
@ -132,6 +142,19 @@
|
|
|
|
|
<el-tooltip content="查看详情" placement="top" v-if="scope.row.flowStatus !== 'draft' && scope.row.flowStatus">
|
|
|
|
|
<el-button link type="info" icon="DocumentChecked" @click="handleView(scope.row)"></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip
|
|
|
|
|
content="填写反馈"
|
|
|
|
|
placement="top"
|
|
|
|
|
v-if="scope.row.tripStatus === '3' && (scope.row.tripType === '2' || scope.row.tripType === '3')"
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="success"
|
|
|
|
|
icon="ChatDotRound"
|
|
|
|
|
@click="handleFeedback(scope.row)"
|
|
|
|
|
v-hasPermi="['oa/crm:businessTripApply:edit']"
|
|
|
|
|
></el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip content="删除" placement="top">
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
@ -147,15 +170,41 @@
|
|
|
|
|
|
|
|
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
<!-- 出差反馈对话框 -->
|
|
|
|
|
<el-dialog v-model="feedbackDialogVisible" title="填写出差反馈" width="600px" append-to-body>
|
|
|
|
|
<el-form ref="feedbackFormRef" :model="feedbackForm" :rules="feedbackRules" label-width="120px">
|
|
|
|
|
<el-form-item label="申请单号">
|
|
|
|
|
<el-input v-model="feedbackForm.applyCode" disabled />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="出差类型">
|
|
|
|
|
<dict-tag :options="trip_type" :value="feedbackForm.tripType" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="交流过程简述" prop="exchangeProcess" v-if="feedbackForm.tripType === '2'">
|
|
|
|
|
<el-input v-model="feedbackForm.exchangeProcess" type="textarea" placeholder="如与某某客户某某负责人交谈,参观XX等" :rows="4" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="结果反馈" prop="feedback">
|
|
|
|
|
<el-input v-model="feedbackForm.feedback" type="textarea" placeholder="达成某种共识或初步合作意向或会议成果" :rows="4" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<el-button @click="feedbackDialogVisible = false">取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="submitFeedback" :loading="feedbackLoading">提交</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup name="BusinessTripApply" lang="ts">
|
|
|
|
|
import { listBusinessTripApply, delBusinessTripApply } from '@/api/oa/crm/businessTripApply';
|
|
|
|
|
import { listBusinessTripApply, delBusinessTripApply, updateBusinessTripApply } from '@/api/oa/crm/businessTripApply';
|
|
|
|
|
import { BusinessTripApplyVO, BusinessTripApplyQuery } from '@/api/oa/crm/businessTripApply/types';
|
|
|
|
|
import { listUser } from '@/api/system/user';
|
|
|
|
|
import { UserVO } from '@/api/system/user/types';
|
|
|
|
|
import { listDept } from '@/api/system/dept';
|
|
|
|
|
import { DeptVO } from '@/api/system/dept/types';
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
const { trip_status, trip_type } = toRefs<any>(proxy?.useDict('trip_status', 'trip_type'));
|
|
|
|
|
const { trip_status, trip_type, business_direction } = toRefs<any>(proxy?.useDict('trip_status', 'trip_type', 'business_direction'));
|
|
|
|
|
|
|
|
|
|
const businessTripApplyList = ref<BusinessTripApplyVO[]>([]);
|
|
|
|
|
const loading = ref(true);
|
|
|
|
|
@ -165,6 +214,8 @@ const single = ref(true);
|
|
|
|
|
const multiple = ref(true);
|
|
|
|
|
const total = ref(0);
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const userList = ref<UserVO[]>([]);
|
|
|
|
|
const deptList = ref<DeptVO[]>([]);
|
|
|
|
|
|
|
|
|
|
const queryFormRef = ref<ElFormInstance>();
|
|
|
|
|
|
|
|
|
|
@ -255,7 +306,7 @@ const handleSelectionChange = (selection: BusinessTripApplyVO[]) => {
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
const handleAdd = (command: string) => {
|
|
|
|
|
router.push({
|
|
|
|
|
path: '/oa/crm/businessTripApply/edit',
|
|
|
|
|
path: '/tripapply/businessTripApply/edit',
|
|
|
|
|
query: { type: 'add', tripType: command }
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
@ -264,7 +315,7 @@ const handleAdd = (command: string) => {
|
|
|
|
|
const handleUpdate = (row?: BusinessTripApplyVO) => {
|
|
|
|
|
const _tripId = row?.tripId || ids.value[0];
|
|
|
|
|
router.push({
|
|
|
|
|
path: '/oa/crm/businessTripApply/edit',
|
|
|
|
|
path: '/tripapply/businessTripApply/edit',
|
|
|
|
|
query: { id: _tripId, type: 'update' }
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
@ -273,7 +324,7 @@ const handleUpdate = (row?: BusinessTripApplyVO) => {
|
|
|
|
|
const handleView = (row: BusinessTripApplyVO) => {
|
|
|
|
|
const _tripId = row?.tripId;
|
|
|
|
|
router.push({
|
|
|
|
|
path: '/oa/crm/businessTripApply/edit',
|
|
|
|
|
path: '/tripapply/businessTripApply/edit',
|
|
|
|
|
query: { id: _tripId, type: 'view' }
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
@ -292,17 +343,89 @@ const handleExport = () => {
|
|
|
|
|
proxy?.download(
|
|
|
|
|
'oa/crm/businessTripApply/export',
|
|
|
|
|
{
|
|
|
|
|
...queryParams.value
|
|
|
|
|
...queryParams.value,
|
|
|
|
|
// 如果选中了数据,则只导出选中的数据
|
|
|
|
|
tripIds: ids.value.length > 0 ? ids.value.join(',') : undefined
|
|
|
|
|
},
|
|
|
|
|
`businessTripApply_${new Date().getTime()}.xlsx`
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
// 加载用户列表
|
|
|
|
|
const userRes = await listUser({ pageNum: 1, pageSize: 1000 });
|
|
|
|
|
userList.value = userRes.rows;
|
|
|
|
|
// 加载部门列表
|
|
|
|
|
const deptRes = await listDept();
|
|
|
|
|
deptList.value = deptRes.data;
|
|
|
|
|
// 加载数据列表
|
|
|
|
|
getList();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
onActivated(() => {
|
|
|
|
|
getList();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// ============ 出差反馈相关 ============
|
|
|
|
|
const feedbackDialogVisible = ref(false);
|
|
|
|
|
const feedbackLoading = ref(false);
|
|
|
|
|
const feedbackFormRef = ref<ElFormInstance>();
|
|
|
|
|
const feedbackForm = ref<{
|
|
|
|
|
tripId?: number | string;
|
|
|
|
|
applyCode?: string;
|
|
|
|
|
tripType?: string;
|
|
|
|
|
applicantId?: number | string;
|
|
|
|
|
tripLocation?: string;
|
|
|
|
|
startTime?: string;
|
|
|
|
|
endTime?: string;
|
|
|
|
|
durationDays?: number;
|
|
|
|
|
exchangeProcess?: string;
|
|
|
|
|
feedback?: string;
|
|
|
|
|
}>({});
|
|
|
|
|
const feedbackRules = {
|
|
|
|
|
feedback: [{ required: true, message: '请填写结果反馈', trigger: 'blur' }]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 填写反馈按钮操作 */
|
|
|
|
|
const handleFeedback = (row: BusinessTripApplyVO) => {
|
|
|
|
|
feedbackForm.value = {
|
|
|
|
|
tripId: row.tripId,
|
|
|
|
|
applyCode: row.applyCode,
|
|
|
|
|
tripType: row.tripType,
|
|
|
|
|
applicantId: row.applicantId,
|
|
|
|
|
tripLocation: row.tripLocation,
|
|
|
|
|
startTime: row.startTime,
|
|
|
|
|
endTime: row.endTime,
|
|
|
|
|
durationDays: row.durationDays,
|
|
|
|
|
exchangeProcess: row.exchangeProcess || '',
|
|
|
|
|
feedback: row.feedback || ''
|
|
|
|
|
};
|
|
|
|
|
feedbackDialogVisible.value = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 提交反馈 */
|
|
|
|
|
const submitFeedback = async () => {
|
|
|
|
|
await feedbackFormRef.value?.validate();
|
|
|
|
|
feedbackLoading.value = true;
|
|
|
|
|
try {
|
|
|
|
|
await updateBusinessTripApply({
|
|
|
|
|
tripId: String(feedbackForm.value.tripId),
|
|
|
|
|
tripType: feedbackForm.value.tripType,
|
|
|
|
|
applicantId: feedbackForm.value.applicantId,
|
|
|
|
|
tripLocation: feedbackForm.value.tripLocation,
|
|
|
|
|
startTime: feedbackForm.value.startTime,
|
|
|
|
|
endTime: feedbackForm.value.endTime,
|
|
|
|
|
durationDays: feedbackForm.value.durationDays,
|
|
|
|
|
exchangeProcess: feedbackForm.value.exchangeProcess,
|
|
|
|
|
feedback: feedbackForm.value.feedback
|
|
|
|
|
});
|
|
|
|
|
proxy?.$modal.msgSuccess('反馈提交成功');
|
|
|
|
|
feedbackDialogVisible.value = false;
|
|
|
|
|
await getList();
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error(e);
|
|
|
|
|
} finally {
|
|
|
|
|
feedbackLoading.value = false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|