|
@@ -7,7 +7,7 @@
|
|
<t-button
|
|
<t-button
|
|
theme="success"
|
|
theme="success"
|
|
:disabled="!selectedRowKeys.length"
|
|
:disabled="!selectedRowKeys.length"
|
|
- @click="regionalHandle"
|
|
|
|
|
|
+ @click="handlerBatchBind"
|
|
>批量划定</t-button
|
|
>批量划定</t-button
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
@@ -21,82 +21,91 @@
|
|
defaultCurrent: 1,
|
|
defaultCurrent: 1,
|
|
defaultPageSize: 10,
|
|
defaultPageSize: 10,
|
|
onChange,
|
|
onChange,
|
|
- total: pagination.total,
|
|
|
|
|
|
+ current: pagination.page,
|
|
}"
|
|
}"
|
|
|
|
+ v-loading="tableLoading"
|
|
:selected-row-keys="selectedRowKeys"
|
|
:selected-row-keys="selectedRowKeys"
|
|
select-on-row-click
|
|
select-on-row-click
|
|
@select-change="selectChange"
|
|
@select-change="selectChange"
|
|
>
|
|
>
|
|
|
|
+ <template #type="{ col, row }">
|
|
|
|
+ {{ customerTypeFilter(row[col.colKey]) }}
|
|
|
|
+ </template>
|
|
|
|
+ <template #begin-time="{ col, row }">
|
|
|
|
+ {{ timestampFilter(row[col.colKey]) }}
|
|
|
|
+ </template>
|
|
|
|
+ <template #exam-start-time="{ col, row }">
|
|
|
|
+ {{ timestampFilter(row[col.colKey]) }}
|
|
|
|
+ </template>
|
|
|
|
+ <template #exam-end-time="{ col, row }">
|
|
|
|
+ {{ timestampFilter(row[col.colKey]) }}
|
|
|
|
+ </template>
|
|
|
|
+ <template #create-time="{ col, row }">
|
|
|
|
+ {{ timestampFilter(row[col.colKey]) }}
|
|
|
|
+ </template>
|
|
</t-table>
|
|
</t-table>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <!-- SelectServiceUnitDialog -->
|
|
|
|
+ <select-service-unit-dialog
|
|
|
|
+ v-model:visible="showSelectServiceUnitDialog"
|
|
|
|
+ :crm-ids="selectedRowKeys"
|
|
|
|
+ @success="search"
|
|
|
|
+ ></select-service-unit-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup name="AddRange">
|
|
<script setup name="AddRange">
|
|
import { reactive, ref } from 'vue';
|
|
import { reactive, ref } from 'vue';
|
|
-import { getTableData } from '@/api/test';
|
|
|
|
|
|
+import { omit } from 'lodash';
|
|
|
|
+import { MessagePlugin } from 'tdesign-vue-next';
|
|
|
|
+import { serviceScopeUnbindCrmQueryApi } from '@/api/service-unit';
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
|
|
+import { CUSTOMER_TYPE } from '@/config/constants';
|
|
|
|
+import { customerTypeFilter, timestampFilter } from '@/utils/filter';
|
|
|
|
+import SelectServiceUnitDialog from './select-service-unit-dialog.vue';
|
|
|
|
+
|
|
|
|
+let showSelectServiceUnitDialog = ref(false);
|
|
|
|
|
|
-const selectedRowKeys = ref([]);
|
|
|
|
-const selectChange = (value, { selectedRowData }) => {
|
|
|
|
- selectedRowKeys.value = value;
|
|
|
|
-};
|
|
|
|
-const regionalHandle = () => {};
|
|
|
|
-const columns = [
|
|
|
|
- {
|
|
|
|
- colKey: 'row-select',
|
|
|
|
- type: 'multiple',
|
|
|
|
- width: 50,
|
|
|
|
- fixed: 'left',
|
|
|
|
- },
|
|
|
|
- { colKey: 'a', title: '项目单号', minWidth: 80 },
|
|
|
|
- { colKey: 'b', title: '派单时间', width: 140 },
|
|
|
|
- { colKey: 'c', title: '派单人', minWidth: 80 },
|
|
|
|
- { colKey: 'd', title: '客户类型', minWidth: 80 },
|
|
|
|
- { colKey: 'e', title: '客户名称', minWidth: 80 },
|
|
|
|
- { colKey: 'f', title: '项目名称', minWidth: 80 },
|
|
|
|
- { colKey: 'g', title: '实施产品', minWidth: 80 },
|
|
|
|
- { colKey: 'h', title: '考试开始时间', width: 140 },
|
|
|
|
- { colKey: 'i', title: '考试结束时间', width: 140 },
|
|
|
|
- { colKey: 'j', title: '大区经理', minWidth: 80 },
|
|
|
|
- { colKey: 'k', title: '提交人', minWidth: 80 },
|
|
|
|
- { colKey: 'l', title: '提交时间', width: 140 },
|
|
|
|
-];
|
|
|
|
-const {
|
|
|
|
- loading: tableLoading,
|
|
|
|
- pagination,
|
|
|
|
- tableData,
|
|
|
|
- fetchData,
|
|
|
|
- onChange,
|
|
|
|
-} = useFetchTable(getTableData);
|
|
|
|
const fields = ref([
|
|
const fields = ref([
|
|
{
|
|
{
|
|
- prop: 'a',
|
|
|
|
- label: '服务单元',
|
|
|
|
|
|
+ prop: 'crmUserId',
|
|
|
|
+ label: '派单人',
|
|
type: 'select',
|
|
type: 'select',
|
|
labelWidth: 80,
|
|
labelWidth: 80,
|
|
colSpan: 5,
|
|
colSpan: 5,
|
|
|
|
+ attrs: {
|
|
|
|
+ clearable: true,
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- prop: 'b',
|
|
|
|
- label: '大区经理',
|
|
|
|
|
|
+ prop: 'productType',
|
|
|
|
+ label: '客户类型',
|
|
type: 'select',
|
|
type: 'select',
|
|
labelWidth: 80,
|
|
labelWidth: 80,
|
|
colSpan: 5,
|
|
colSpan: 5,
|
|
|
|
+ attrs: {
|
|
|
|
+ clearable: true,
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- prop: 'c',
|
|
|
|
- label: '派单人',
|
|
|
|
- type: 'select',
|
|
|
|
|
|
+ prop: 'customName',
|
|
|
|
+ label: '客户名称',
|
|
labelWidth: 80,
|
|
labelWidth: 80,
|
|
colSpan: 5,
|
|
colSpan: 5,
|
|
|
|
+ options: dictToOptionList(CUSTOMER_TYPE),
|
|
|
|
+ attrs: {
|
|
|
|
+ clearable: true,
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- prop: 'd',
|
|
|
|
- label: '客户类型',
|
|
|
|
- type: 'select',
|
|
|
|
|
|
+ prop: 'crmNo',
|
|
|
|
+ label: '项目单号',
|
|
labelWidth: 80,
|
|
labelWidth: 80,
|
|
colSpan: 5,
|
|
colSpan: 5,
|
|
|
|
+ attrs: {
|
|
|
|
+ clearable: true,
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'buttons',
|
|
type: 'buttons',
|
|
@@ -105,38 +114,88 @@ const fields = ref([
|
|
{
|
|
{
|
|
type: 'button',
|
|
type: 'button',
|
|
text: '查询',
|
|
text: '查询',
|
|
|
|
+ onClick: () => {
|
|
|
|
+ search();
|
|
|
|
+ },
|
|
},
|
|
},
|
|
],
|
|
],
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- prop: 'e',
|
|
|
|
- label: '客户名称',
|
|
|
|
- labelWidth: 80,
|
|
|
|
- colSpan: 5,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- prop: 'f',
|
|
|
|
- label: '项目单号',
|
|
|
|
- labelWidth: 80,
|
|
|
|
- colSpan: 5,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- prop: 'g',
|
|
|
|
|
|
+ prop: 'crmTime',
|
|
label: '派单时间',
|
|
label: '派单时间',
|
|
type: 'daterange',
|
|
type: 'daterange',
|
|
labelWidth: 80,
|
|
labelWidth: 80,
|
|
colSpan: 10,
|
|
colSpan: 10,
|
|
|
|
+ attrs: {
|
|
|
|
+ clearable: true,
|
|
|
|
+ },
|
|
},
|
|
},
|
|
]);
|
|
]);
|
|
const params = reactive({
|
|
const params = reactive({
|
|
- a: '',
|
|
|
|
- b: '',
|
|
|
|
- c: '',
|
|
|
|
- d: '',
|
|
|
|
- e: '',
|
|
|
|
- f: '',
|
|
|
|
- g: [],
|
|
|
|
|
|
+ crmUserId: '',
|
|
|
|
+ productType: '',
|
|
|
|
+ customName: '',
|
|
|
|
+ crmNo: '',
|
|
|
|
+ crmTime: [],
|
|
|
|
+});
|
|
|
|
+const computedParams = computed(() => {
|
|
|
|
+ let data = omit(params, ['crmTime']);
|
|
|
|
+ data.startTime = params.crmTime[0];
|
|
|
|
+ data.endTime = params.crmTime[1];
|
|
|
|
+ return data;
|
|
});
|
|
});
|
|
-</script>
|
|
|
|
|
|
|
|
-<style></style>
|
|
|
|
|
|
+const selectedRowKeys = ref([]);
|
|
|
|
+const selectChange = (value) => {
|
|
|
|
+ selectedRowKeys.value = value;
|
|
|
|
+};
|
|
|
|
+const columns = [
|
|
|
|
+ {
|
|
|
|
+ colKey: 'row-select',
|
|
|
|
+ type: 'multiple',
|
|
|
|
+ width: 50,
|
|
|
|
+ fixed: 'left',
|
|
|
|
+ },
|
|
|
|
+ { colKey: 'crmNo', title: '项目单号', minWidth: 80 },
|
|
|
|
+ { colKey: 'beginTime', title: '派单时间', width: 170, cell: 'begin-time' },
|
|
|
|
+ { colKey: 'crmUserName', title: '派单人', minWidth: 80 },
|
|
|
|
+ { colKey: 'productType', title: '客户类型', width: 90, cell: 'type' },
|
|
|
|
+ { colKey: 'customName', title: '客户名称', minWidth: 100 },
|
|
|
|
+ { colKey: 'productName', title: '项目名称', minWidth: 80 },
|
|
|
|
+ { colKey: 'productName', title: '实施产品', minWidth: 80 },
|
|
|
|
+ {
|
|
|
|
+ colKey: 'examStartTime',
|
|
|
|
+ title: '考试开始时间',
|
|
|
|
+ width: 170,
|
|
|
|
+ cell: 'exam-start-time',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ colKey: 'examEndTime',
|
|
|
|
+ title: '考试结束时间',
|
|
|
|
+ width: 170,
|
|
|
|
+ cell: 'exam-end-time',
|
|
|
|
+ },
|
|
|
|
+ { colKey: 'creatorName', title: '提交人', minWidth: 80 },
|
|
|
|
+ { colKey: 'createTime', title: '提交时间', width: 170, cell: 'create-time' },
|
|
|
|
+];
|
|
|
|
+const {
|
|
|
|
+ loading: tableLoading,
|
|
|
|
+ pagination,
|
|
|
|
+ tableData,
|
|
|
|
+ search,
|
|
|
|
+ onChange,
|
|
|
|
+} = useFetchTable(serviceScopeUnbindCrmQueryApi, {
|
|
|
|
+ fetchDataHandle: () => {
|
|
|
|
+ selectedRowKeys.value = [];
|
|
|
|
+ },
|
|
|
|
+ params: computedParams,
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+const handlerBatchBind = () => {
|
|
|
|
+ if (!selectedRowKeys.value.length) {
|
|
|
|
+ MessagePlugin.error('请选择要划定的记录');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ showSelectServiceUnitDialog.value = true;
|
|
|
|
+};
|
|
|
|
+</script>
|