|
@@ -7,9 +7,9 @@ import {
|
|
|
getCurrencyCodeSelect,
|
|
|
getOperationSelect,
|
|
|
getTasks,
|
|
|
- postCreateTask,
|
|
|
postDeleteTask,
|
|
|
postSendMessage,
|
|
|
+ postUpdateManyTask,
|
|
|
postUpdateTask,
|
|
|
postUpdateTaskStatus
|
|
|
} from '/src/views/reportManage/TaskManage/api.ts';
|
|
@@ -19,6 +19,7 @@ import { dateType, requiredFields } from '/@/views/reportManage/TaskManage/utils
|
|
|
|
|
|
const selectorRef = ref(null);
|
|
|
const message = ref('');
|
|
|
+const currencyList = ref([]);// 货币列表
|
|
|
|
|
|
//表单
|
|
|
interface taskRuleForm {
|
|
@@ -27,7 +28,7 @@ interface taskRuleForm {
|
|
|
country: string;
|
|
|
brand: string;
|
|
|
operation: string[];
|
|
|
- operater: string[];
|
|
|
+ operater: [];
|
|
|
currency: string;
|
|
|
currencyCodePlatform: string;
|
|
|
line: string;
|
|
@@ -67,7 +68,10 @@ const rules = reactive<FormRules>({
|
|
|
company: [{ required: true, message: '请输入注册公司', trigger: 'blur' }],
|
|
|
platform: [{ required: true, message: '请输入平台', trigger: 'blur' }],
|
|
|
});
|
|
|
-const currencyList = ref([]);
|
|
|
+
|
|
|
+// 修改填写人弹窗
|
|
|
+const userDialogFormVisible = ref(false);
|
|
|
+const updateSelect = ref(1);
|
|
|
|
|
|
//表格
|
|
|
interface RowVO {
|
|
@@ -76,7 +80,7 @@ interface RowVO {
|
|
|
country: string;
|
|
|
brandName: string;
|
|
|
user_name: string;
|
|
|
- operater: string;
|
|
|
+ operater: [];
|
|
|
currencyCode: string;
|
|
|
currencyCodePlatform: string;
|
|
|
child_user_number: number;
|
|
@@ -88,10 +92,10 @@ interface RowVO {
|
|
|
}
|
|
|
|
|
|
const xGrid = ref<VxeGridInstance<RowVO>>();
|
|
|
-const originalDataMap = new Map();
|
|
|
+const originalData = ref([]);
|
|
|
let allTasks = []; // 用于存储所有任务数据
|
|
|
-const operationList = ref([]);//填写人列表
|
|
|
-const filter = ref({});
|
|
|
+const operationList = ref([]);// 填写人列表
|
|
|
+const filter = ref({}); // 筛选条件
|
|
|
|
|
|
const gridOptions = reactive<VxeGridProps<RowVO>>({
|
|
|
border: 'inner',
|
|
@@ -124,10 +128,10 @@ const gridOptions = reactive<VxeGridProps<RowVO>>({
|
|
|
pageSizes: [10, 20, 30],
|
|
|
},
|
|
|
editConfig: {
|
|
|
- trigger: 'manual',
|
|
|
+ trigger: 'click',
|
|
|
mode: 'row',
|
|
|
showStatus: true,
|
|
|
- autoClear: false,
|
|
|
+ //autoClear: false,
|
|
|
},
|
|
|
checkboxConfig: {
|
|
|
reserve: true,
|
|
@@ -149,7 +153,7 @@ const gridOptions = reactive<VxeGridProps<RowVO>>({
|
|
|
editRender: { autofocus: '.vxe-input--inner' },
|
|
|
slots: { edit: 'name_edit' },
|
|
|
align: 'center',
|
|
|
- minWidth: 150
|
|
|
+ minWidth: 150, isEditing: false
|
|
|
},
|
|
|
{
|
|
|
field: 'country',
|
|
@@ -171,7 +175,10 @@ const gridOptions = reactive<VxeGridProps<RowVO>>({
|
|
|
field: 'user_name',
|
|
|
title: '填写人',
|
|
|
editRender: {},
|
|
|
- slots: { edit: 'operation_edit' },
|
|
|
+ slots: {
|
|
|
+ edit: 'operation_edit',
|
|
|
+ //default: 'operation_default'
|
|
|
+ },
|
|
|
align: 'center',
|
|
|
minWidth: 104
|
|
|
},
|
|
@@ -233,6 +240,74 @@ const gridEvents: VxeGridListeners<RowVO> = {
|
|
|
},
|
|
|
};
|
|
|
|
|
|
+const hasActiveEditRow = (row: RowVO) => {
|
|
|
+ const $grid = xGrid.value;
|
|
|
+ if ($grid) {
|
|
|
+ return $grid.isEditByRow(row);
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+};
|
|
|
+
|
|
|
+const editRowEvent = (row: RowVO) => {
|
|
|
+ const $grid = xGrid.value;
|
|
|
+ if ($grid) {
|
|
|
+ // 在进入编辑状态前保存原始数据
|
|
|
+ //originalDataMap.set(row.id, { ...row });
|
|
|
+ //// 初始化 row.user 确保其与 row.user_name 同步
|
|
|
+ if (!row.user || row.user.length === 0) {
|
|
|
+ row.user = userNameToUser(row.user_name); // 转换 user_name 到 user
|
|
|
+ }
|
|
|
+ $grid.setEditRow(row);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const handleEditActived = ({ row, column }) => {
|
|
|
+ if (!row.user || row.user.length === 0) {
|
|
|
+ row.user = userNameToUser(row.user_name); // 转换 user_name 到 user
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const handleEditClosed = ({ row, column }) => {
|
|
|
+ if (column.property === 'user_name') {
|
|
|
+ // 将 user 转换为 user_name 并更新 row
|
|
|
+ row.user_name = userToUserName(row.user);
|
|
|
+ // 强制刷新视图
|
|
|
+ $grid.refreshRow(row);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 将 user 数组转换为 user_name 字符串
|
|
|
+function userToUserName(user: string[]): string {
|
|
|
+ return operationList.value
|
|
|
+ .filter(op => user.includes(op.value))
|
|
|
+ .map(op => op.label)
|
|
|
+ .join(', ');
|
|
|
+}
|
|
|
+
|
|
|
+// 将 user_name 字符串转换为 user 数组
|
|
|
+function userNameToUser(user_name: string): string[] {
|
|
|
+ return operationList.value
|
|
|
+ .filter(op => user_name.includes(op.label))
|
|
|
+ .map(op => op.value);
|
|
|
+}
|
|
|
+
|
|
|
+// 清除编辑状态并保存已编辑的数据
|
|
|
+const clearRowEvent = (row) => {
|
|
|
+ const $grid = xGrid.value;
|
|
|
+ if ($grid) {
|
|
|
+ // 手动保存当前行的数据
|
|
|
+ const editRecord = $grid.getEditRecord();
|
|
|
+ if (editRecord) {
|
|
|
+ const { row: editedRow } = editRecord;
|
|
|
+ // 更新原始 row 数据,确保编辑的值被保存
|
|
|
+ row.user = editedRow.user;
|
|
|
+ row.user_name = userToUserName(editedRow.user);
|
|
|
+ }
|
|
|
+ // 清除编辑状态
|
|
|
+ $grid.clearEdit();
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
// 获取任务列表
|
|
|
async function getTaskList() {
|
|
|
try {
|
|
@@ -243,6 +318,7 @@ async function getTaskList() {
|
|
|
...filter.value,
|
|
|
});
|
|
|
gridOptions.data = response.data;
|
|
|
+ originalData.value = JSON.parse(JSON.stringify(response.data));
|
|
|
gridOptions.pagerConfig.total = response.total;
|
|
|
} catch (error) {
|
|
|
console.error('Error fetching task data:', error);
|
|
@@ -262,41 +338,92 @@ function filteredDataChange(newList) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const hasActiveEditRow = (row: RowVO) => {
|
|
|
+// 全部保存按钮
|
|
|
+async function saveEvent(row) {
|
|
|
const $grid = xGrid.value;
|
|
|
if ($grid) {
|
|
|
- return $grid.isEditByRow(row);
|
|
|
- }
|
|
|
- return false;
|
|
|
-};
|
|
|
+ try {
|
|
|
+ const { updateRecords } = $grid.getRecordset();
|
|
|
+ const originalDataMap = new Map(originalData.value.map(item => [item.id, item]));
|
|
|
+
|
|
|
+ const updatedRecords = updateRecords.map(record => {
|
|
|
+ const originalRecord = originalDataMap.get(record.id);
|
|
|
+ if (!originalRecord) return null;
|
|
|
+
|
|
|
+ const updatedFields = {};
|
|
|
+ // 比较字段并记录变化
|
|
|
+ for (const key in record) {
|
|
|
+ if (record[key] !== originalRecord[key]) {
|
|
|
+ updatedFields[key] = record[key];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ id: record.id,
|
|
|
+ ...updatedFields
|
|
|
+ };
|
|
|
+ }).filter(record => record); // 过滤掉值为 null 的记录
|
|
|
+ await postUpdateManyTask(updatedRecords);
|
|
|
+ await getTaskList();
|
|
|
+ await VXETable.modal.message({
|
|
|
+ content: `更新 ${ updatedRecords.length } 条`,
|
|
|
+ status: 'success',
|
|
|
+ });
|
|
|
|
|
|
-const editRowEvent = (row: RowVO) => {
|
|
|
- const $grid = xGrid.value;
|
|
|
- if ($grid) {
|
|
|
- // 在进入编辑状态前保存原始数据
|
|
|
- originalDataMap.set(row.id, { ...row });
|
|
|
- // 初始化 row.user 确保其与 row.user_name 同步
|
|
|
- if (!row.user || row.user.length === 0) {
|
|
|
- row.user = operationList.value
|
|
|
- .filter(op => row.user_name.includes(op.label))
|
|
|
- .map(op => op.value);
|
|
|
+ } catch (e) {
|
|
|
+ console.log('error', e);
|
|
|
}
|
|
|
- $grid.setEditRow(row);
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
|
|
|
-const clearRowEvent = (row: RowVO) => {
|
|
|
+// 批量修改填写人
|
|
|
+async function updateUser() {
|
|
|
const $grid = xGrid.value;
|
|
|
if ($grid) {
|
|
|
- const originalData = originalDataMap.get(row.id);
|
|
|
- if (originalData) {
|
|
|
- // 恢复原始数据
|
|
|
- Object.assign(row, originalData);
|
|
|
- originalDataMap.delete(row.id);
|
|
|
+ const selectRecords = $grid.getCheckboxRecords(); // 获取勾选的表格行
|
|
|
+ const selectedUsers = taskRuleForm.operation; // 获取选择的填写人
|
|
|
+ const operationType = updateSelect.value; // 获取选择的操作类型
|
|
|
+
|
|
|
+ const updateData = selectRecords.map(record => {
|
|
|
+ const existingUsers = userNameToUser(record.user_name) || [];
|
|
|
+ let updatedUsers;
|
|
|
+ if (operationType === 1) { // 添加操作
|
|
|
+ updatedUsers = Array.from(new Set([...existingUsers, ...selectedUsers]));
|
|
|
+ } else if (operationType === 2) { // 删除操作
|
|
|
+ updatedUsers = existingUsers.filter(user => !selectedUsers.includes(user));
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ id: record.id,
|
|
|
+ user: updatedUsers, // 更新后的 user 数组
|
|
|
+ };
|
|
|
+ });
|
|
|
+ try {
|
|
|
+ // 调用接口批量保存修改的数据
|
|
|
+ await postUpdateManyTask(updateData);
|
|
|
+ if (operationType === 1) { // 添加操作
|
|
|
+ ElMessage.success('添加成功');
|
|
|
+ } else if (operationType === 2) { // 删除操作
|
|
|
+ ElMessage.success('删除成功');
|
|
|
+
|
|
|
+ }
|
|
|
+ userDialogFormVisible.value = false; // 关闭弹窗
|
|
|
+ await getTaskList(); // 重新加载表格数据
|
|
|
+ } catch (error) {
|
|
|
+ console.error('修改失败', error);
|
|
|
+ ElMessage.error('修改失败');
|
|
|
+ } finally {
|
|
|
+ // 清除表单数据
|
|
|
+ taskRuleForm.operation = []; // 清除选择的填写人
|
|
|
+ updateSelect.value = 1; // 清除操作类型
|
|
|
}
|
|
|
- $grid.clearEdit();
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
+
|
|
|
+function updateUserCancel() {
|
|
|
+ taskRuleForm.operation = [];
|
|
|
+ updateSelect.value = 1;
|
|
|
+ userDialogFormVisible.value = false;
|
|
|
+}
|
|
|
|
|
|
// 删除任务
|
|
|
async function deleteTask() {
|
|
@@ -304,7 +431,6 @@ async function deleteTask() {
|
|
|
if ($grid) {
|
|
|
const selectRecords = $grid.getCheckboxRecords();
|
|
|
const selectedIds = selectRecords.map(record => record.id);
|
|
|
- // console.log(selectedIds);
|
|
|
const obj = { keys: selectedIds };
|
|
|
try {
|
|
|
const resp = await postDeleteTask(obj);
|
|
@@ -345,6 +471,7 @@ const removeEvent = async () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+// 数据校验
|
|
|
const validateRow = (row) => {
|
|
|
for (const { field, title } of requiredFields) {
|
|
|
if (!row[field] || (Array.isArray(row[field]) && row[field].length === 0)) {
|
|
@@ -373,7 +500,7 @@ async function updateRow(row) {
|
|
|
country: row.country,
|
|
|
brandName: row.brandName,
|
|
|
user: row.user,
|
|
|
- operater: row.operater,
|
|
|
+ operater: row.operater[0]?.split(',').map(item => item.trim()),
|
|
|
currencyCode: row.currencyCode,
|
|
|
currencyCodePlatform: row.currencyCodePlatform,
|
|
|
line: row.line,
|
|
@@ -381,7 +508,6 @@ async function updateRow(row) {
|
|
|
company: row.company,
|
|
|
platform: row.platform,
|
|
|
};
|
|
|
- //console.log('updatedRowData', updatedRowData);
|
|
|
try {
|
|
|
const response = await postUpdateTask(updatedRowData);
|
|
|
if (response.code === 2000) {
|
|
@@ -397,6 +523,23 @@ async function updateRow(row) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 更新行任务保存按钮
|
|
|
+const saveRowEvent = async (row: RowVO) => {
|
|
|
+ const $grid = xGrid.value;
|
|
|
+ if ($grid) {
|
|
|
+ if (!validateRow(row)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ await $grid.clearEdit();
|
|
|
+ await updateRow(row);
|
|
|
+ await getTaskList();
|
|
|
+ gridOptions.loading = true;
|
|
|
+ setTimeout(() => {
|
|
|
+ gridOptions.loading = false;
|
|
|
+ }, 300);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
// 更新状态
|
|
|
async function handleStatusChange(row) {
|
|
|
const $grid = xGrid.value;
|
|
@@ -422,23 +565,7 @@ async function handleStatusChange(row) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 更新任务保存按钮
|
|
|
-const saveRowEvent = async (row: RowVO) => {
|
|
|
- const $grid = xGrid.value;
|
|
|
- if ($grid) {
|
|
|
- if (!validateRow(row)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- await $grid.clearEdit();
|
|
|
- await updateRow(row);
|
|
|
- await getTaskList();
|
|
|
- gridOptions.loading = true;
|
|
|
- setTimeout(() => {
|
|
|
- gridOptions.loading = false;
|
|
|
- }, 300);
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
+// 创建任务
|
|
|
async function createTask() {
|
|
|
const body = {
|
|
|
country: taskRuleForm.country,
|
|
@@ -466,6 +593,7 @@ async function createTask() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 提交任务确认按钮
|
|
|
const submitForm = async (formEl) => {
|
|
|
if (!formEl) return;
|
|
|
await formEl.validate(async (valid, fields) => {
|
|
@@ -492,9 +620,34 @@ const submitForm = async (formEl) => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+function handleClose(done: Function) {
|
|
|
+ if (taskRuleFormRef.value) taskRuleFormRef.value.resetFields();
|
|
|
+ done();
|
|
|
+}
|
|
|
+
|
|
|
+//发送通知
|
|
|
+async function sendMessage(selectedValue: string) {
|
|
|
+ const body = {
|
|
|
+ date_type: selectedValue,
|
|
|
+ };
|
|
|
+ try {
|
|
|
+ const response = await postSendMessage(body);
|
|
|
+ if (response.code === 2000) {
|
|
|
+ ElMessage.success('发送成功');
|
|
|
+ } else if (response.code == 400) {
|
|
|
+ ElMessage.warning(`${ response.data.description }`);
|
|
|
+ } else {
|
|
|
+ ElMessage.error('发送失败');
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 导出接口
|
|
|
async function handleExport() {
|
|
|
gridOptions.loading = true;
|
|
|
const response = await exportTaskData();
|
|
|
+
|
|
|
const url = window.URL.createObjectURL(new Blob([response.data]));
|
|
|
const link = document.createElement('a');
|
|
|
link.href = url;
|
|
@@ -505,11 +658,7 @@ async function handleExport() {
|
|
|
ElMessage.success('导出数据成功');
|
|
|
}
|
|
|
|
|
|
-function handleClose(done: Function) {
|
|
|
- if (taskRuleFormRef.value) taskRuleFormRef.value.resetFields();
|
|
|
- done();
|
|
|
-}
|
|
|
-
|
|
|
+// 获取填写人下拉框
|
|
|
async function fetchOperationSelect() {
|
|
|
try {
|
|
|
const resp = await getOperationSelect();
|
|
@@ -521,6 +670,7 @@ async function fetchOperationSelect() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 获取币种下拉框
|
|
|
async function fetchCurrencyList() {
|
|
|
try {
|
|
|
const response = await getCurrencyCodeSelect(); // 替换为你的后端接口
|
|
@@ -553,6 +703,7 @@ function handelRowCurrencyCodePlatformSelect(item, row) {
|
|
|
row.currencyCodePlatform = item;
|
|
|
}
|
|
|
|
|
|
+// 表格样式
|
|
|
const cellStyle = () => {
|
|
|
return {
|
|
|
fontSize: '13px',
|
|
@@ -566,29 +717,12 @@ const headerCellStyle = () => {
|
|
|
};
|
|
|
};
|
|
|
|
|
|
-//发送通知
|
|
|
-async function sendMessage(selectedValue: string) {
|
|
|
- const body = {
|
|
|
- date_type: selectedValue,
|
|
|
- };
|
|
|
- try {
|
|
|
- const response = await postSendMessage(body);
|
|
|
- if (response.code === 2000) {
|
|
|
- ElMessage.success('发送成功');
|
|
|
- } else if (response.code == 400) {
|
|
|
- ElMessage.warning(`${ response.data.description }`);
|
|
|
- } else {
|
|
|
- ElMessage.error('发送失败');
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
onMounted(() => {
|
|
|
//getTaskList();
|
|
|
fetchOperationSelect();
|
|
|
fetchCurrencyList();
|
|
|
});
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -597,118 +731,124 @@ onMounted(() => {
|
|
|
<Selector ref="selectorRef" :showOperationSearch="true" @update:filteredData="filteredDataChange" />
|
|
|
</el-card>
|
|
|
<el-card class="my-3" shadow="hover">
|
|
|
- <div style="position: relative">
|
|
|
- <vxe-grid ref="xGrid" :cell-style="cellStyle" :header-cell-style="headerCellStyle" stripe v-bind="gridOptions"
|
|
|
- v-on="gridEvents">
|
|
|
- <template #toolbar_buttons>
|
|
|
- <el-button :icon="Plus" plain type="success" @click="dialogFormVisible = true"> 添加任务</el-button>
|
|
|
- <el-dropdown style="padding: 0 10px;" trigger="click">
|
|
|
- <el-button plain type="primary">
|
|
|
- <el-icon class="el-icon--left">
|
|
|
- <arrow-down />
|
|
|
- </el-icon>
|
|
|
- 发送通知
|
|
|
- </el-button>
|
|
|
- <template #dropdown>
|
|
|
- <el-dropdown-menu>
|
|
|
- <el-dropdown-item v-for="info of dateType" @click="sendMessage(info.value)">{{
|
|
|
- info.label
|
|
|
- }}
|
|
|
- </el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </template>
|
|
|
- </el-dropdown>
|
|
|
- <el-button :disabled="isDeleteDisabled" :icon="Delete" plain type="danger" @click="removeEvent">删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- <template #toolbar_tools>
|
|
|
- <div class="mx-3.5">
|
|
|
+ <vxe-grid ref="xGrid" :cell-style="cellStyle" :header-cell-style="headerCellStyle" stripe v-bind="gridOptions"
|
|
|
+ v-on="gridEvents" @edit-actived="handleEditActived" @edit-closed="handleEditClosed">
|
|
|
+ <template #toolbar_buttons>
|
|
|
+ <el-button :icon="Plus" plain type="primary" @click="dialogFormVisible = true"> 添加任务</el-button>
|
|
|
+ <!--<el-button plain type="success" @click="saveEvent">保存</el-button>-->
|
|
|
+ <el-button :disabled="isDeleteDisabled" :icon="Delete" plain type="danger" @click="removeEvent">删除
|
|
|
+ </el-button>
|
|
|
+ <el-button v-if="!isDeleteDisabled" plain round type="success" @click="userDialogFormVisible =true">
|
|
|
+ 修改填写人
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template #toolbar_tools>
|
|
|
+ <div class="pr-2.5">
|
|
|
+ <el-tooltip content="保存" placement="top">
|
|
|
+ <vxe-button circle icon="vxe-icon-save" @click="saveEvent"></vxe-button>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip content="发送通知" placement="top">
|
|
|
+ <el-dropdown style="padding: 0 10px;" trigger="click">
|
|
|
+ <vxe-button circle icon="vxe-icon-bell"></vxe-button>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item v-for="info of dateType" @click="sendMessage(info.value)">{{
|
|
|
+ info.label
|
|
|
+ }}
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip content="下载表格" placement="top">
|
|
|
<vxe-button circle icon="vxe-icon-download" @click="handleExport"></vxe-button>
|
|
|
- </div>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #operate="{ row }">
|
|
|
+ <template v-if="hasActiveEditRow(row)">
|
|
|
+ <vxe-button content="取消" type="text" @click="clearRowEvent(row)"></vxe-button>
|
|
|
+ <vxe-button content="保存" status="success" type="text" @click="saveRowEvent(row)"></vxe-button>
|
|
|
</template>
|
|
|
- <template #operate="{ row }">
|
|
|
- <template v-if="hasActiveEditRow(row)">
|
|
|
- <vxe-button content="取消" type="text" @click="clearRowEvent(row)"></vxe-button>
|
|
|
- <vxe-button content="保存" status="success" type="text" @click="saveRowEvent(row)"></vxe-button>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
+ <template v-else>
|
|
|
+ <el-tooltip content="编辑" placement="top">
|
|
|
<el-button icon="Edit" type="text" @click="editRowEvent(row)"></el-button>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- <template #number_edit="{ row }">
|
|
|
- <vxe-input v-model="row.platformNumber"></vxe-input>
|
|
|
+ </el-tooltip>
|
|
|
</template>
|
|
|
- <template #name_edit="{ row }">
|
|
|
- <vxe-input v-model="row.platformName"></vxe-input>
|
|
|
- </template>
|
|
|
- <template #country_edit="{ row }">
|
|
|
- <vxe-input v-model="row.country"></vxe-input>
|
|
|
- </template>
|
|
|
- <template #brand_edit="{ row }">
|
|
|
- <vxe-input v-model="row.brandName"></vxe-input>
|
|
|
- </template>
|
|
|
- <template #line_edit="{ row }">
|
|
|
- <vxe-input v-model="row.line"></vxe-input>
|
|
|
- </template>
|
|
|
- <template #ipaddress_edit="{ row }">
|
|
|
- <vxe-input v-model="row.ipaddress"></vxe-input>
|
|
|
- </template>
|
|
|
- <template #company_edit="{ row }">
|
|
|
- <vxe-input v-model="row.company"></vxe-input>
|
|
|
- </template>
|
|
|
- <template #platform_edit="{ row }">
|
|
|
- <vxe-input v-model="row.platform"></vxe-input>
|
|
|
- </template>
|
|
|
- <template #status_default="{ row }">
|
|
|
- <el-switch
|
|
|
- v-model="row.status"
|
|
|
- :active-value="1"
|
|
|
- :inactive-value="0"
|
|
|
- inline-prompt
|
|
|
- size="small"
|
|
|
- @change="handleStatusChange(row)"
|
|
|
- />
|
|
|
- </template>
|
|
|
- <template #operation_edit="{ row }">
|
|
|
- <vxe-select v-model="row.user" multiple>
|
|
|
- <vxe-option v-for="item in operationList" :key="item.value" :label="item.label"
|
|
|
- :value="item.value"></vxe-option>
|
|
|
- </vxe-select>
|
|
|
- </template>
|
|
|
- <template #operater_name_edit="{ row }">
|
|
|
- <vxe-input v-model="row.operater"></vxe-input>
|
|
|
- </template>
|
|
|
- <template #currency_edit="{ row }">
|
|
|
- <!--<vxe-input v-model="row.currencyCode"></vxe-input>-->
|
|
|
- <el-autocomplete
|
|
|
- v-model="row.currencyCode"
|
|
|
- :debounce="100"
|
|
|
- :fetch-suggestions="querySearch"
|
|
|
- :trigger-on-focus="false"
|
|
|
- clearable
|
|
|
- @select="item => handleRowSelect(item, row)"
|
|
|
- >
|
|
|
- <template v-slot="{ item }">
|
|
|
- <div>{{ item }}</div>
|
|
|
- </template>
|
|
|
- </el-autocomplete>
|
|
|
- </template>
|
|
|
- <template #currencyCodePlatform_edit="{ row }">
|
|
|
- <el-autocomplete
|
|
|
- v-model="row.currencyCodePlatform"
|
|
|
- :debounce="100"
|
|
|
- :fetch-suggestions="querySearch"
|
|
|
- :trigger-on-focus="false"
|
|
|
- clearable
|
|
|
- @select="item => handelRowCurrencyCodePlatformSelect(item,row)"
|
|
|
- >
|
|
|
- <template v-slot="{ item }">
|
|
|
- <div>{{ item }}</div>
|
|
|
- </template>
|
|
|
- </el-autocomplete>
|
|
|
- </template>
|
|
|
- </vxe-grid>
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
+ <template #number_edit="{ row }">
|
|
|
+ <vxe-input v-model="row.platformNumber"></vxe-input>
|
|
|
+ </template>
|
|
|
+ <template #name_edit="{ row }">
|
|
|
+ <vxe-input v-model="row.platformName"></vxe-input>
|
|
|
+ </template>
|
|
|
+ <template #country_edit="{ row }">
|
|
|
+ <vxe-input v-model="row.country"></vxe-input>
|
|
|
+ </template>
|
|
|
+ <template #brand_edit="{ row }">
|
|
|
+ <vxe-input v-model="row.brandName"></vxe-input>
|
|
|
+ </template>
|
|
|
+ <template #line_edit="{ row }">
|
|
|
+ <vxe-input v-model="row.line"></vxe-input>
|
|
|
+ </template>
|
|
|
+ <template #ipaddress_edit="{ row }">
|
|
|
+ <vxe-input v-model="row.ipaddress"></vxe-input>
|
|
|
+ </template>
|
|
|
+ <template #company_edit="{ row }">
|
|
|
+ <vxe-input v-model="row.company"></vxe-input>
|
|
|
+ </template>
|
|
|
+ <template #platform_edit="{ row }">
|
|
|
+ <vxe-input v-model="row.platform"></vxe-input>
|
|
|
+ </template>
|
|
|
+ <template #status_default="{ row }">
|
|
|
+ <el-switch
|
|
|
+ v-model="row.status"
|
|
|
+ :active-value="1"
|
|
|
+ :inactive-value="0"
|
|
|
+ inline-prompt
|
|
|
+ size="small"
|
|
|
+ @change="handleStatusChange(row)"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template #operation_edit="{ row }">
|
|
|
+ <vxe-select v-model="row.user" multiple>
|
|
|
+ <vxe-option v-for="item in operationList" :key="item.value" :label="item.label"
|
|
|
+ :value="item.value"></vxe-option>
|
|
|
+ </vxe-select>
|
|
|
+ </template>
|
|
|
+ <template #operater_name_edit="{ row }">
|
|
|
+ <vxe-input v-model="row.operater"></vxe-input>
|
|
|
+ </template>
|
|
|
+ <template #currency_edit="{ row }">
|
|
|
+ <!--<vxe-input v-model="row.currencyCode"></vxe-input>-->
|
|
|
+ <el-autocomplete
|
|
|
+ v-model="row.currencyCode"
|
|
|
+ :debounce="100"
|
|
|
+ :fetch-suggestions="querySearch"
|
|
|
+ :trigger-on-focus="false"
|
|
|
+ clearable
|
|
|
+ @select="item => handleRowSelect(item, row)"
|
|
|
+ >
|
|
|
+ <template v-slot="{ item }">
|
|
|
+ <div>{{ item }}</div>
|
|
|
+ </template>
|
|
|
+ </el-autocomplete>
|
|
|
+ </template>
|
|
|
+ <template #currencyCodePlatform_edit="{ row }">
|
|
|
+ <el-autocomplete
|
|
|
+ v-model="row.currencyCodePlatform"
|
|
|
+ :debounce="100"
|
|
|
+ :fetch-suggestions="querySearch"
|
|
|
+ :trigger-on-focus="false"
|
|
|
+ clearable
|
|
|
+ @select="item => handelRowCurrencyCodePlatformSelect(item,row)"
|
|
|
+ >
|
|
|
+ <template v-slot="{ item }">
|
|
|
+ <div>{{ item }}</div>
|
|
|
+ </template>
|
|
|
+ </el-autocomplete>
|
|
|
+ </template>
|
|
|
+ </vxe-grid>
|
|
|
</el-card>
|
|
|
</div>
|
|
|
<el-dialog v-model="dialogFormVisible" :before-close="handleClose" style="border-radius: 10px;" title="新建任务"
|
|
@@ -794,6 +934,28 @@ onMounted(() => {
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog v-model="userDialogFormVisible" :before-close="updateUserCancel" align-center
|
|
|
+ style="border-radius: 10px;" title="修改填写人" width="500">
|
|
|
+ <div class="mb-3">
|
|
|
+ <el-radio-group v-model="updateSelect">
|
|
|
+ <el-radio :label="1">添加</el-radio>
|
|
|
+ <el-radio :label="2">删除</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ <el-form-item align-center label="录入人员:" prop="operation" width="500">
|
|
|
+ <el-select v-model="taskRuleForm.operation" collapse-tags collapse-tags-tooltip multiple
|
|
|
+ placeholder="请选择录入人员">
|
|
|
+ <el-option v-for="item in operationList" :key="item.value" :label="item.label"
|
|
|
+ :value="item.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="updateUserCancel">取消</el-button>
|
|
|
+ <el-button type="primary" @click="updateUser"> 确认</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<style scoped>
|