|
@@ -1,23 +1,24 @@
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import Selector from '/@/views/reportManage/dataCenter/components/Selector/index.vue'
|
|
|
|
-import {ref, reactive, onMounted, nextTick } from 'vue'
|
|
|
|
-import {VXETable, VxeGridInstance, VxeGridProps, VxeGridListeners} from 'vxe-table'
|
|
|
|
-import {getTasks, postCreateTask, getOperationSelect ,postUpdateTask } from '../api'
|
|
|
|
-import {ComponentSize, ElMessage, FormInstance, FormRules} from 'element-plus'
|
|
|
|
|
|
+import Selector from '/@/views/reportManage/dataCenter/components/Selector/index.vue';
|
|
|
|
+import { ref, reactive, onMounted, nextTick } from 'vue';
|
|
|
|
+import { VXETable, VxeGridInstance, VxeGridProps, VxeGridListeners } from 'vxe-table';
|
|
|
|
+import { getTasks, postCreateTask, getOperationSelect, postUpdateTask, postDeleteTask } from '../api';
|
|
|
|
+import { ComponentSize, ElMessage, FormInstance, FormRules } from 'element-plus';
|
|
|
|
+import { length } from 'sortablejs';
|
|
|
|
|
|
//表单
|
|
//表单
|
|
interface taskRuleForm {
|
|
interface taskRuleForm {
|
|
- number: string
|
|
|
|
- name: string
|
|
|
|
- country: string
|
|
|
|
- brand: string
|
|
|
|
- operation: string[]
|
|
|
|
- currency: string
|
|
|
|
|
|
+ number: string;
|
|
|
|
+ name: string;
|
|
|
|
+ country: string;
|
|
|
|
+ brand: string;
|
|
|
|
+ operation: string[];
|
|
|
|
+ currency: string;
|
|
}
|
|
}
|
|
|
|
|
|
-const formSize = ref<ComponentSize>('default')
|
|
|
|
-const dialogFormVisible = ref(false)
|
|
|
|
-const taskRuleFormRef = ref<FormInstance>()
|
|
|
|
|
|
+const formSize = ref<ComponentSize>('default');
|
|
|
|
+const dialogFormVisible = ref(false);
|
|
|
|
+const taskRuleFormRef = ref<FormInstance>();
|
|
const taskRuleForm = reactive({
|
|
const taskRuleForm = reactive({
|
|
number: '',
|
|
number: '',
|
|
name: '',
|
|
name: '',
|
|
@@ -25,11 +26,11 @@ const taskRuleForm = reactive({
|
|
brand: '',
|
|
brand: '',
|
|
operation: '',
|
|
operation: '',
|
|
currency: '',
|
|
currency: '',
|
|
-})
|
|
|
|
|
|
+});
|
|
const resetForm = (formEl: FormInstance | undefined) => {
|
|
const resetForm = (formEl: FormInstance | undefined) => {
|
|
- if (!formEl) return
|
|
|
|
- formEl.resetFields()
|
|
|
|
-}
|
|
|
|
|
|
+ if (!formEl) return;
|
|
|
|
+ formEl.resetFields();
|
|
|
|
+};
|
|
const rules = reactive<FormRules>({
|
|
const rules = reactive<FormRules>({
|
|
number: [{required: true, message: '请输入平台编号', trigger: 'blur'},],
|
|
number: [{required: true, message: '请输入平台编号', trigger: 'blur'},],
|
|
name: [{required: true, message: '请输入平台名称', trigger: 'blur'}],
|
|
name: [{required: true, message: '请输入平台名称', trigger: 'blur'}],
|
|
@@ -37,30 +38,32 @@ const rules = reactive<FormRules>({
|
|
brand: [{required: true, message: '请输入品牌', trigger: 'blur'}],
|
|
brand: [{required: true, message: '请输入品牌', trigger: 'blur'}],
|
|
operation: [{required: true, message: '请选择运营', trigger: 'change'}],
|
|
operation: [{required: true, message: '请选择运营', trigger: 'change'}],
|
|
currency: [{required: true, message: '请输入货币', trigger: 'blur'}],
|
|
currency: [{required: true, message: '请输入货币', trigger: 'blur'}],
|
|
-})
|
|
|
|
|
|
+});
|
|
|
|
|
|
//表格
|
|
//表格
|
|
-let page = 1
|
|
|
|
-let limit = 10
|
|
|
|
-const loading = ref(false)
|
|
|
|
|
|
+let page = 1;
|
|
|
|
+let limit = 10;
|
|
|
|
+
|
|
|
|
+// const loading = ref(false)
|
|
|
|
|
|
interface RowVO {
|
|
interface RowVO {
|
|
- platformNumber: string
|
|
|
|
- platformName: string
|
|
|
|
- country: string
|
|
|
|
- brandName: string
|
|
|
|
- operation: string
|
|
|
|
- currencyCode: string
|
|
|
|
- quantity: number
|
|
|
|
|
|
+ platformNumber: string;
|
|
|
|
+ platformName: string;
|
|
|
|
+ country: string;
|
|
|
|
+ brandName: string;
|
|
|
|
+ user_name: string;
|
|
|
|
+ currencyCode: string;
|
|
|
|
+ child_user_number: number;
|
|
|
|
+ user: [];
|
|
}
|
|
}
|
|
|
|
|
|
-const xGrid = ref<VxeGridInstance<RowVO>>()
|
|
|
|
|
|
+const xGrid = ref<VxeGridInstance<RowVO>>();
|
|
|
|
|
|
const gridOptions = reactive<VxeGridProps<RowVO>>({
|
|
const gridOptions = reactive<VxeGridProps<RowVO>>({
|
|
border: false,
|
|
border: false,
|
|
keepSource: true,
|
|
keepSource: true,
|
|
showOverflow: true,
|
|
showOverflow: true,
|
|
- height: 500,
|
|
|
|
|
|
+ height: 1000,
|
|
loading: false,
|
|
loading: false,
|
|
round: true,
|
|
round: true,
|
|
toolbarConfig: {
|
|
toolbarConfig: {
|
|
@@ -69,7 +72,6 @@ const gridOptions = reactive<VxeGridProps<RowVO>>({
|
|
},
|
|
},
|
|
refresh: true,
|
|
refresh: true,
|
|
},
|
|
},
|
|
-
|
|
|
|
rowConfig: {
|
|
rowConfig: {
|
|
isHover: true,
|
|
isHover: true,
|
|
},
|
|
},
|
|
@@ -84,7 +86,7 @@ const gridOptions = reactive<VxeGridProps<RowVO>>({
|
|
pageSizes: [10, 20, 30],
|
|
pageSizes: [10, 20, 30],
|
|
},
|
|
},
|
|
editConfig: {
|
|
editConfig: {
|
|
- trigger: 'auto',
|
|
|
|
|
|
+ trigger: 'click',
|
|
mode: 'row',
|
|
mode: 'row',
|
|
showStatus: true,
|
|
showStatus: true,
|
|
},
|
|
},
|
|
@@ -95,7 +97,7 @@ const gridOptions = reactive<VxeGridProps<RowVO>>({
|
|
},
|
|
},
|
|
columns: [
|
|
columns: [
|
|
{type: 'checkbox', width: 50},
|
|
{type: 'checkbox', width: 50},
|
|
- {type: 'seq', title: 'ID', width: 120},
|
|
|
|
|
|
+ // {type: 'seq', title: 'ID', width: 120},
|
|
{
|
|
{
|
|
field: 'platformNumber',
|
|
field: 'platformNumber',
|
|
title: '平台编号',
|
|
title: '平台编号',
|
|
@@ -117,36 +119,30 @@ const gridOptions = reactive<VxeGridProps<RowVO>>({
|
|
{title: '操作', width: 300, slots: {default: 'operate'}},
|
|
{title: '操作', width: 300, slots: {default: 'operate'}},
|
|
],
|
|
],
|
|
data: [],
|
|
data: [],
|
|
-})
|
|
|
|
|
|
+});
|
|
|
|
|
|
-const operationList = ref([
|
|
|
|
- {value: '1', label: 'option1'},
|
|
|
|
- {value: '2', label: 'option2'},
|
|
|
|
-])
|
|
|
|
-const quantityList = ref([
|
|
|
|
- {value: '1', label: 'per1'},
|
|
|
|
- {value: '2', label: 'per2'},
|
|
|
|
-])
|
|
|
|
|
|
+const operationList = ref([]);
|
|
|
|
+const quantityList = ref([]);
|
|
|
|
|
|
// 分页
|
|
// 分页
|
|
const gridEvents: VxeGridListeners<RowVO> = {
|
|
const gridEvents: VxeGridListeners<RowVO> = {
|
|
pageChange({currentPage, pageSize}) {
|
|
pageChange({currentPage, pageSize}) {
|
|
// console.log(currentPage, pageSize)
|
|
// console.log(currentPage, pageSize)
|
|
if (gridOptions.pagerConfig) {
|
|
if (gridOptions.pagerConfig) {
|
|
- gridOptions.pagerConfig.currentPage = currentPage
|
|
|
|
- gridOptions.pagerConfig.pageSize = pageSize
|
|
|
|
- getTaskList()
|
|
|
|
|
|
+ gridOptions.pagerConfig.currentPage = currentPage;
|
|
|
|
+ gridOptions.pagerConfig.pageSize = pageSize;
|
|
|
|
+ getTaskList();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
-}
|
|
|
|
|
|
+};
|
|
|
|
|
|
async function getTaskList() {
|
|
async function getTaskList() {
|
|
const resp = await getTasks({
|
|
const resp = await getTasks({
|
|
page: gridOptions.pagerConfig.currentPage,
|
|
page: gridOptions.pagerConfig.currentPage,
|
|
limit: gridOptions.pagerConfig.pageSize
|
|
limit: gridOptions.pagerConfig.pageSize
|
|
- })
|
|
|
|
- gridOptions.data = resp.data
|
|
|
|
- gridOptions.pagerConfig.total = resp.total
|
|
|
|
|
|
+ });
|
|
|
|
+ gridOptions.data = resp.data;
|
|
|
|
+ gridOptions.pagerConfig.total = resp.total;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -155,94 +151,130 @@ async function getTaskList() {
|
|
* @return {boolean}
|
|
* @return {boolean}
|
|
*/
|
|
*/
|
|
const hasActiveEditRow = (row: RowVO) => {
|
|
const hasActiveEditRow = (row: RowVO) => {
|
|
- const $grid = xGrid.value
|
|
|
|
|
|
+ const $grid = xGrid.value;
|
|
if ($grid) {
|
|
if ($grid) {
|
|
- return $grid.isEditByRow(row)
|
|
|
|
|
|
+ return $grid.isEditByRow(row);
|
|
}
|
|
}
|
|
- return false
|
|
|
|
-}
|
|
|
|
|
|
+ return false;
|
|
|
|
+};
|
|
|
|
|
|
const editRowEvent = (row: RowVO) => {
|
|
const editRowEvent = (row: RowVO) => {
|
|
- const $grid = xGrid.value
|
|
|
|
|
|
+ const $grid = xGrid.value;
|
|
if ($grid) {
|
|
if ($grid) {
|
|
- $grid.setEditRow(row)
|
|
|
|
- console.log(row.id)
|
|
|
|
|
|
+ $grid.setEditRow(row);
|
|
|
|
+ // console.log(row)
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+};
|
|
|
|
|
|
//清除编辑状态
|
|
//清除编辑状态
|
|
const clearRowEvent = () => {
|
|
const clearRowEvent = () => {
|
|
- const $grid = xGrid.value
|
|
|
|
|
|
+ const $grid = xGrid.value;
|
|
if ($grid) {
|
|
if ($grid) {
|
|
- $grid.clearEdit()
|
|
|
|
|
|
+ $grid.clearEdit();
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+async function deleteTask() {
|
|
|
|
+ const $grid = xGrid.value;
|
|
|
|
+ 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);
|
|
|
|
+ if (resp.code === 2000) {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: '删除成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ });
|
|
|
|
+ await getTaskList();
|
|
|
|
+ }
|
|
|
|
+ } catch (e) {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: '删除失败',
|
|
|
|
+ type: 'error',
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+}}
|
|
|
|
|
|
// 删除选中行
|
|
// 删除选中行
|
|
const removeEvent = async () => {
|
|
const removeEvent = async () => {
|
|
- const $grid = xGrid.value
|
|
|
|
|
|
+ const $grid = xGrid.value;
|
|
if ($grid) {
|
|
if ($grid) {
|
|
- const selectRecords = $grid.getCheckboxRecords()
|
|
|
|
|
|
+ const selectRecords = $grid.getCheckboxRecords();
|
|
if (selectRecords.length > 0) {
|
|
if (selectRecords.length > 0) {
|
|
- const type = await VXETable.modal.confirm('您确定要删除选中的数据?')
|
|
|
|
|
|
+ const type = await VXETable.modal.confirm('您确定要删除选中的数据?');
|
|
if (type === 'confirm') {
|
|
if (type === 'confirm') {
|
|
- await $grid.removeCheckboxRow()
|
|
|
|
|
|
+ await deleteTask(selectRecords);
|
|
|
|
+ await $grid.removeCheckboxRow();
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- await VXETable.modal.message({content: '请选择要删除的数据', status: 'error'})
|
|
|
|
|
|
+ await VXETable.modal.message({content: '请选择要删除的数据', status: 'error'});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+};
|
|
|
|
|
|
-// let n = setEditRow(row.id)
|
|
|
|
-async function updateRow() {
|
|
|
|
- const body = {
|
|
|
|
- country:gridOptions.data[0].country,
|
|
|
|
- platformNumber:gridOptions.data[0].platformNumber,
|
|
|
|
- platformName:gridOptions.data[0].platformName,
|
|
|
|
- brandName:gridOptions.data[0].brandName,
|
|
|
|
- user:gridOptions.data[0].operation,
|
|
|
|
- currencyCode:gridOptions.data[0].currencyCode,
|
|
|
|
- }
|
|
|
|
- try {
|
|
|
|
- const response = await postUpdateTask(body)
|
|
|
|
- console.log(response.data)
|
|
|
|
- if (response.data.code === 'success') {
|
|
|
|
- ElMessage.success('更新成功')
|
|
|
|
- } else if (response.data.code === 'error') {
|
|
|
|
- ElMessage.warning(`${response.data.description}`)
|
|
|
|
- } else {
|
|
|
|
- ElMessage.error('更新失败')
|
|
|
|
|
|
+async function updateRow(row: RowVO) {
|
|
|
|
+ const $grid = xGrid.value;
|
|
|
|
+ const transUser = ref('');
|
|
|
|
+ operationList.value.find((item) => {
|
|
|
|
+ if (item.label === row.user_name) {
|
|
|
|
+ transUser.value = item.value;
|
|
|
|
+ } else if (row.user_name === item.value) {
|
|
|
|
+ row.user_name = item.label;
|
|
|
|
+ transUser.value = item.value;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ if ($grid) {
|
|
|
|
+ const updatedRowData = {
|
|
|
|
+ id: row.id,
|
|
|
|
+ platformNumber: row.platformNumber,
|
|
|
|
+ platformName: row.platformName,
|
|
|
|
+ country: row.country,
|
|
|
|
+ brandName: row.brandName,
|
|
|
|
+ user: [transUser.value],
|
|
|
|
+ currencyCode: row.currencyCode,
|
|
|
|
+ };
|
|
|
|
+ try {
|
|
|
|
+ const response = await postUpdateTask(updatedRowData);
|
|
|
|
+ if (response.code === 2000) {
|
|
|
|
+ ElMessage.success('更新成功');
|
|
|
|
+ } else if (response.code == 400) {
|
|
|
|
+ ElMessage.warning(`${response.data.description}`);
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage.error('更新失败');
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log('error:', error);
|
|
}
|
|
}
|
|
- } catch (error) {
|
|
|
|
- console.error('error:', error)
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
// 保存表格行数据
|
|
// 保存表格行数据
|
|
const saveRowEvent = async (row: RowVO) => {
|
|
const saveRowEvent = async (row: RowVO) => {
|
|
- const $grid = xGrid.value
|
|
|
|
|
|
+ const $grid = xGrid.value;
|
|
if ($grid) {
|
|
if ($grid) {
|
|
- // await updateRow()
|
|
|
|
- console.log(gridOptions.data[0].id)
|
|
|
|
- await $grid.clearEdit()
|
|
|
|
- gridOptions.loading = true
|
|
|
|
|
|
+ await $grid.clearEdit();
|
|
|
|
+ await updateRow(row);
|
|
|
|
+ gridOptions.loading = true;
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- gridOptions.loading = false
|
|
|
|
- }, 300)
|
|
|
|
|
|
+ gridOptions.loading = false;
|
|
|
|
+ }, 300);
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+};
|
|
|
|
|
|
// 保存全部数据
|
|
// 保存全部数据
|
|
const saveEvent = async () => {
|
|
const saveEvent = async () => {
|
|
- const $grid = xGrid.value
|
|
|
|
|
|
+ const $grid = xGrid.value;
|
|
if ($grid) {
|
|
if ($grid) {
|
|
- const {insertRecords, removeRecords, updateRecords} = $grid.getRecordset()
|
|
|
|
|
|
+ const {insertRecords, removeRecords, updateRecords} = $grid.getRecordset();
|
|
await VXETable.modal.message({
|
|
await VXETable.modal.message({
|
|
content: `新增 ${insertRecords.length} 条,删除 ${removeRecords.length} 条,更新 ${updateRecords.length} 条`,
|
|
content: `新增 ${insertRecords.length} 条,删除 ${removeRecords.length} 条,更新 ${updateRecords.length} 条`,
|
|
status: 'success',
|
|
status: 'success',
|
|
- })
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+};
|
|
|
|
|
|
async function createTask() {
|
|
async function createTask() {
|
|
const body = {
|
|
const body = {
|
|
@@ -252,12 +284,12 @@ async function createTask() {
|
|
brandName: taskRuleForm.brand,
|
|
brandName: taskRuleForm.brand,
|
|
currencyCode: taskRuleForm.currency,
|
|
currencyCode: taskRuleForm.currency,
|
|
user: [taskRuleForm.operation],
|
|
user: [taskRuleForm.operation],
|
|
- }
|
|
|
|
|
|
+ };
|
|
try {
|
|
try {
|
|
- const resp = await postCreateTask(body) // await VXETable.modal.message({ content: '创建成功', status: 'success' })
|
|
|
|
|
|
+ const resp = await postCreateTask(body);
|
|
} catch (error) {
|
|
} catch (error) {
|
|
- console.error('error:', error)
|
|
|
|
- await VXETable.modal.message({content: '创建失败,请重试', status: 'error'})
|
|
|
|
|
|
+ console.error('error:', error);
|
|
|
|
+ await VXETable.modal.message({content: '创建失败,请重试', status: 'error'});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -273,69 +305,52 @@ const submitEvent = async () => {
|
|
user_name: taskRuleForm.operation,
|
|
user_name: taskRuleForm.operation,
|
|
currencyCode: taskRuleForm.currency,
|
|
currencyCode: taskRuleForm.currency,
|
|
child_user_number: '',
|
|
child_user_number: '',
|
|
- }
|
|
|
|
|
|
+ };
|
|
// 将新行添加到表格数据中
|
|
// 将新行添加到表格数据中
|
|
- gridOptions.data.push(newRow)
|
|
|
|
|
|
+ gridOptions.data.push(newRow);
|
|
try {
|
|
try {
|
|
- await createTask()
|
|
|
|
- dialogFormVisible.value = false
|
|
|
|
|
|
+ await createTask();
|
|
|
|
+ dialogFormVisible.value = false;
|
|
//获取更新表格数据
|
|
//获取更新表格数据
|
|
- await saveEvent()
|
|
|
|
- await getTaskList()
|
|
|
|
- await nextTick(() => {
|
|
|
|
- loading.value = true
|
|
|
|
- setTimeout(() => {
|
|
|
|
- loading.value = false
|
|
|
|
- }, 500)
|
|
|
|
- })
|
|
|
|
|
|
+ await getTaskList();
|
|
|
|
+ gridOptions.loading = true;
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ gridOptions.loading = false;
|
|
|
|
+ }, 300);
|
|
} catch (error) {
|
|
} catch (error) {
|
|
- console.error('Failed to save task:', error)
|
|
|
|
|
|
+ console.error('Failed to save task:', error);
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+};
|
|
|
|
|
|
// 提交表单
|
|
// 提交表单
|
|
const submitForm = async (formEl: FormInstance | undefined) => {
|
|
const submitForm = async (formEl: FormInstance | undefined) => {
|
|
- if (!formEl) return
|
|
|
|
|
|
+ if (!formEl) return;
|
|
await formEl.validate(async (valid, fields) => {
|
|
await formEl.validate(async (valid, fields) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
await submitEvent();
|
|
await submitEvent();
|
|
await nextTick();
|
|
await nextTick();
|
|
taskRuleFormRef.value.resetFields();
|
|
taskRuleFormRef.value.resetFields();
|
|
} else {
|
|
} else {
|
|
- console.log('error submit!', fields)
|
|
|
|
|
|
+ console.log('error submit!', fields);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
-
|
|
|
|
async function fetchOperationSelect() {
|
|
async function fetchOperationSelect() {
|
|
try {
|
|
try {
|
|
- const resp = await getOperationSelect()
|
|
|
|
- // console.log("resp", resp.data)
|
|
|
|
|
|
+ const resp = await getOperationSelect();
|
|
operationList.value = resp.data.map((item: any) => {
|
|
operationList.value = resp.data.map((item: any) => {
|
|
- return {value: item.id, label: item.name}
|
|
|
|
- })
|
|
|
|
- // console.log(operationList.value)
|
|
|
|
|
|
+ return {value: item.id, label: item.name};
|
|
|
|
+ });
|
|
} catch (e) {
|
|
} catch (e) {
|
|
- console.error("Failed to fetch operation select:", e)
|
|
|
|
|
|
+ console.error('Failed to fetch operation select:', e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-// async function fetchQuantitySelect() {
|
|
|
|
-// try {
|
|
|
|
-// const resp = await getQuantitySelect()
|
|
|
|
-// quantityList.value = resp.data.map((item: any) => {
|
|
|
|
-// return {value: item.id, label: item.name}
|
|
|
|
-// })
|
|
|
|
-// } catch (e) {
|
|
|
|
-// console.error("Failed to fetch operation select:", e)
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
- getTaskList()
|
|
|
|
- fetchOperationSelect()
|
|
|
|
-})
|
|
|
|
|
|
+ getTaskList();
|
|
|
|
+ fetchOperationSelect();
|
|
|
|
+});
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -344,7 +359,7 @@ onMounted(() => {
|
|
</el-card>
|
|
</el-card>
|
|
<el-card class="mx-2">
|
|
<el-card class="mx-2">
|
|
<div style="position: relative">
|
|
<div style="position: relative">
|
|
- <vxe-grid ref="xGrid" v-bind="gridOptions" v-on="gridEvents" v-loading="loading">
|
|
|
|
|
|
+ <vxe-grid ref="xGrid" v-bind="gridOptions" v-on="gridEvents">
|
|
<template #toolbar_buttons>
|
|
<template #toolbar_buttons>
|
|
<vxe-button icon="vxe-icon-add" plain @click="dialogFormVisible = true"> 添加任务</vxe-button>
|
|
<vxe-button icon="vxe-icon-add" plain @click="dialogFormVisible = true"> 添加任务</vxe-button>
|
|
<vxe-button icon="vxe-icon-delete" @click="removeEvent">删除</vxe-button>
|
|
<vxe-button icon="vxe-icon-delete" @click="removeEvent">删除</vxe-button>
|
|
@@ -374,7 +389,8 @@ onMounted(() => {
|
|
</template>
|
|
</template>
|
|
<template #operation_edit="{ row }">
|
|
<template #operation_edit="{ row }">
|
|
<vxe-select v-model="row.user_name" transfer>
|
|
<vxe-select v-model="row.user_name" transfer>
|
|
- <vxe-option v-for="item in operationList" :key="item.value" :value="item.value" :label="item.label"></vxe-option>
|
|
|
|
|
|
+ <vxe-option v-for="item in operationList" :key="item.value" :value="item.value"
|
|
|
|
+ :label="item.label"></vxe-option>
|
|
</vxe-select>
|
|
</vxe-select>
|
|
</template>
|
|
</template>
|
|
<template #currency_edit="{ row }">
|
|
<template #currency_edit="{ row }">
|
|
@@ -382,7 +398,8 @@ onMounted(() => {
|
|
</template>
|
|
</template>
|
|
<template #quantity_edit="{ row }">
|
|
<template #quantity_edit="{ row }">
|
|
<vxe-select v-model="row.child_user_number" transfer>
|
|
<vxe-select v-model="row.child_user_number" transfer>
|
|
- <vxe-option v-for="item in quantityList" :key="item.value" :value="item.value" :label="item.label"></vxe-option>
|
|
|
|
|
|
+ <vxe-option v-for="item in quantityList" :key="item.value" :value="item.value"
|
|
|
|
+ :label="item.label"></vxe-option>
|
|
</vxe-select>
|
|
</vxe-select>
|
|
</template>
|
|
</template>
|
|
</vxe-grid>
|
|
</vxe-grid>
|
|
@@ -390,14 +407,14 @@ onMounted(() => {
|
|
</el-card>
|
|
</el-card>
|
|
<el-dialog v-model="dialogFormVisible" title="新建任务" width="500">
|
|
<el-dialog v-model="dialogFormVisible" title="新建任务" width="500">
|
|
<el-form
|
|
<el-form
|
|
- ref="taskRuleFormRef"
|
|
|
|
- style="max-width: 600px"
|
|
|
|
- :model="taskRuleForm"
|
|
|
|
- :rules="rules"
|
|
|
|
- label-width="auto"
|
|
|
|
- class="demo-taskRuleForm"
|
|
|
|
- :size="formSize"
|
|
|
|
- status-icon>
|
|
|
|
|
|
+ ref="taskRuleFormRef"
|
|
|
|
+ style="max-width: 600px"
|
|
|
|
+ :model="taskRuleForm"
|
|
|
|
+ :rules="rules"
|
|
|
|
+ label-width="auto"
|
|
|
|
+ class="demo-taskRuleForm"
|
|
|
|
+ :size="formSize"
|
|
|
|
+ status-icon>
|
|
<el-form-item label="平台编号" prop="number">
|
|
<el-form-item label="平台编号" prop="number">
|
|
<el-input v-model="taskRuleForm.number" placeholder="请输入平台编号" />
|
|
<el-input v-model="taskRuleForm.number" placeholder="请输入平台编号" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -412,7 +429,8 @@ onMounted(() => {
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="运营" prop="operation">
|
|
<el-form-item label="运营" prop="operation">
|
|
<el-select v-model="taskRuleForm.operation" placeholder="请选择运营">
|
|
<el-select v-model="taskRuleForm.operation" placeholder="请选择运营">
|
|
- <el-option v-for="item in operationList" :key="item.value" :value="item.value" :label="item.label"></el-option>
|
|
|
|
|
|
+ <el-option v-for="item in operationList" :key="item.value" :value="item.value"
|
|
|
|
+ :label="item.label"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="回款币种" prop="currency">
|
|
<el-form-item label="回款币种" prop="currency">
|