Просмотр исходного кода

周筛选bug修改和添加部门字段

liujintao 2 месяцев назад
Родитель
Сommit
05d3aaf035

+ 1 - 1
.eslintrc.js

@@ -71,7 +71,7 @@ module.exports = {
 		'vue/no-unused-vars': "off",
 		'no-v-model-argument': 'off',
 		'no-case-declarations': 'off',
-		'no-console': 'error',
+		'no-console': 'off',
 		'no-redeclare': 'off',
 	},
 };

+ 14 - 7
src/views/reportManage/TaskManage/index.vue

@@ -67,6 +67,7 @@ const taskRuleForm = reactive({
   platform: '',
   companyEnglishName: '',
   juridicalPerson: '',
+  department: '',
 });
 
 const resetForm = (formEl: FormInstance | undefined) => {
@@ -86,6 +87,7 @@ const rules = reactive<FormRules>({
   ipaddress: [{ required: true, message: '请输入IP地址', trigger: 'blur' }],
   company: [{ required: true, message: '请输入注册公司', trigger: 'blur' }],
   platform: [{ required: true, message: '请输入平台', trigger: 'blur' }],
+  department: [{ required: true, message: '请输入部门', trigger: 'blur' }],
 });
 
 // 修改填写人弹窗
@@ -112,6 +114,7 @@ interface RowVO {
   ipaddress: string;
   company: string;
   platform: string;
+  department: string;
 }
 
 const xGrid = ref<VxeGridInstance<RowVO>>();
@@ -527,6 +530,7 @@ async function updateRow(row) {
       companyEnglishName: row.companyEnglishName,
       // address: row.address,
       juridicalPerson: row.juridicalPerson,
+      department: row.department,
       // juridicalPersonCreditCard: row.juridicalPersonCreditCard,
       // juridicalPersonCreditCardAddress: row.juridicalPersonCreditCardAddress,
       // receivablesAccount: row.receivablesAccount,
@@ -608,6 +612,7 @@ async function createTask() {
     companyEnglishName: taskRuleForm.companyEnglishName,
     // address: taskRuleForm.address,
     juridicalPerson: taskRuleForm.juridicalPerson,
+    department: taskRuleForm.department,
     // juridicalPersonCreditCard: taskRuleForm.juridicalPersonCreditCard,
     // juridicalPersonCreditCardAddress: taskRuleForm.juridicalPersonCreditCardAddress,
     // receivablesAccount: taskRuleForm.receivablesAccount,
@@ -621,6 +626,7 @@ async function createTask() {
     const resp = await postCreateTask(body);
     if (resp.code === 2000) {
       dialogFormVisible.value = false;
+      taskRuleFormRef.value.resetFields();
       await getTaskList(); // 重新获取任务列表
       ElMessage({ message: '创建成功', type: 'success', });
     }
@@ -650,9 +656,7 @@ const submitForm = async (formEl) => {
         await ElMessage({ message: '回款/余额币种无效,请重新选择', type: 'warning' });
         return;
       }
-
       await createTask();
-      taskRuleFormRef.value.resetFields();
     }
   });
 };
@@ -677,6 +681,7 @@ async function sendMessage(selectedValue: string) {
       ElMessage.error('发送失败');
     }
   } catch (error) {
+    console.log('error:', error);
   }
 }
 
@@ -758,6 +763,7 @@ const formItems = ref([
     collapseTagsTooltip: true,
     options: operationList
   },
+  { label: '部门', prop: 'department', type: 'input', placeholder: '请输入部门' },
   { label: '运营', prop: 'operater', type: 'input', placeholder: '请输入运营' },
   {
     label: '平台币种',
@@ -788,6 +794,7 @@ const formItems = ref([
   { label: '公司英文名称', prop: 'companyEnglishName', type: 'input', placeholder: '请输入公司英文名称' },
   // { label: '公司地址', prop: 'address', type: 'input', placeholder: '请输入公司地址' },
   { label: '公司法人', prop: 'juridicalPerson', type: 'input', placeholder: '请输入公司法人' },
+
   // { label: '法人信用卡', prop: 'juridicalPersonCreditCard', type: 'input', placeholder: '请输入法人信用卡' },
   // { label: '信用卡地址', prop: 'juridicalPersonCreditCardAddress', type: 'input', placeholder: '请输入信用卡地址' },
   // { label: '收款账号', prop: 'receivablesAccount', type: 'input', placeholder: '请输入收款账号' },
@@ -850,10 +857,7 @@ onMounted(() => {
                 <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-item v-for="info of dateType" @click="sendMessage(info.value)">{{info.label}}</el-dropdown-item>
                   </el-dropdown-menu>
                 </template>
               </el-dropdown>
@@ -886,6 +890,9 @@ onMounted(() => {
         <template #brand_edit="{ row }">
           <vxe-input v-model="row.brandName"></vxe-input>
         </template>
+        <template #department_edit="{ row }">
+          <vxe-input v-model="row.department"></vxe-input>
+        </template>
         <template #line_edit="{ row }">
           <vxe-input v-model="row.line"></vxe-input>
         </template>
@@ -1031,7 +1038,7 @@ onMounted(() => {
     <template #footer>
       <div class="dialog-footer">
         <el-button @click="dialogFormVisible = false ;resetForm(taskRuleFormRef)">取消</el-button>
-        <el-button type="primary" @click="submitForm(taskRuleFormRef)"> 确认</el-button>
+        <el-button type="primary" @click="submitForm(taskRuleFormRef)">确认</el-button>
       </div>
     </template>
   </el-dialog>

+ 11 - 0
src/views/reportManage/TaskManage/utils/columns.ts

@@ -38,6 +38,17 @@ export const taskColumns = ref([
     align: 'center',
     minWidth: 70,
   },
+  {
+    field: 'department',
+    title: '部门',
+    fixed: 'left',
+    editRender: {},
+    slots: {
+      edit: 'department_edit',
+    },
+    align: 'center',
+    minWidth: 104
+  },
   {
     field: 'user_name',
     title: '填写人',

+ 1 - 1
src/views/reportManage/dataCenter/combinedDisplay/components/tableData/mainData.vue

@@ -290,7 +290,7 @@ function handleSortChange({ field, order }) {
     const matchMonth = field.match(/(\d{4}-\d{2})的销售额/);
     const matchTotal = field.match(/当月累计销售额/);
     if (matchRange) {
-      order_date.value = matchRange[1];
+      order_date.value = matchRange[2];
       dateType.value = 'week';
       totalSales.value = '';
     } else if (match) {

+ 16 - 4
src/views/reportManage/dataCenter/normalDisplay/components/Selector/index.vue

@@ -19,20 +19,22 @@ const usersList = ref(JSON.parse(localStorage.getItem('usersList') || '[]'));
 const countryList = ref(JSON.parse(localStorage.getItem('countryList') || '[]'));
 const brandNameList = ref(JSON.parse(localStorage.getItem('brandNameList') || '[]'));
 const platformList = ref(JSON.parse(localStorage.getItem('platformList') || '[]'));
+const departmentList = ref(JSON.parse(localStorage.getItem('departmentList') || '[]'));
 
 // const platformNumberOptions = ref([]);
 // const platformNameOptions = ref([]);
 const usersOptions = ref([]);
 // const operationOptions = ref([]);
 const countryOptions = ref([]);
+const departmentOptions = ref([]);
 const brandNameOptions = ref([]);
 const platformOptions = ref([]);
 
 const updateData = ref([]);
 const filteredData = ref([]);
 
-function sortCountriesByInitial(countries) {
-  return countries.sort((a, b) => a.localeCompare(b));
+function sortByInitial(data) {
+  return data.sort((a, b) => a.localeCompare(b));
 }
 
 // async function fetchAllTasks() {
@@ -76,7 +78,8 @@ async function fetchUsersSelect() {
 async function fetchSelectData() {
   try {
     const resp = await getSelect();
-    countryOptions.value = sortCountriesByInitial(resp.data.country)
+    countryOptions.value = sortByInitial(resp.data.country)
+    departmentOptions.value = resp.data.department
     brandNameOptions.value = resp.data.brandName;
     platformOptions.value = resp.data.platform;
   } catch (e) {
@@ -108,6 +111,9 @@ async function fetchFilteredData() {
   processFilterMultiple(countryList, 'country', 'countrys');
   processFilterMultiple(brandNameList, 'brandName', 'brandNames');
   processFilterMultiple(platformList, 'platform', 'platforms');
+  processFilterMultiple(platformList, 'platform', 'platforms');
+  processFilterMultiple(departmentList, 'department', 'department');
+
   if (usersList.value.length > 0) {
     filters.users = usersList.value.join(',');
   }
@@ -134,6 +140,7 @@ async function emitChange() {
   localStorage.setItem('countryList', JSON.stringify(countryList.value));
   localStorage.setItem('brandNameList', JSON.stringify(brandNameList.value));
   localStorage.setItem('platformList', JSON.stringify(platformList.value));
+  localStorage.setItem('departmentList', JSON.stringify(departmentList.value));
 }
 
 // 快捷选择美洲区国家
@@ -148,7 +155,7 @@ const selectCommonGroup2 = () => {
   emitChange(); // 更新选择后的数据
 };
 
-watch([countryList, brandNameList, usersList, platformList], () => {
+watch([countryList, brandNameList, usersList, platformList, departmentList], () => {
   emitChange();
 });
 
@@ -170,6 +177,11 @@ defineExpose({ fetchFilteredData, filteredData, updateData });
               @change="emitChange"></el-input>
     <el-input v-model="operationList" class="flex-item" clearable placeholder="运营" style="width: 130px"
               @change="emitChange"></el-input>
+    <el-select v-model="departmentList" class="flex-item" clearable collapse-tags collapse-tags-tooltip multiple
+               placeholder="部门"
+               style="width: 145px;">
+      <el-option v-for="item in departmentOptions" :key="item" :label="item" :value="item" />
+    </el-select>
     <el-select
         v-model="usersList"
         class="flex-item"

+ 0 - 1
src/views/reportManage/dataCenter/normalDisplay/components/TableDataDisplay.vue

@@ -315,7 +315,6 @@ function handleSortChange({ field, order }) {
     const matchTotal = field.match(/当月累计销售额/);
     if (matchRange) {
       order_date.value = matchRange[2];
-      console.log("=>(TableDataDisplay.vue:318) order_date.value", order_date.value);
       totalSales.value = '';
     } else if (match) {
       order_date.value = match[1];