|
@@ -21,25 +21,34 @@
|
|
|
>
|
|
|
</t-table>
|
|
|
</div>
|
|
|
+
|
|
|
+ <edit-customer-dialog
|
|
|
+ v-model:visible="showEditCustomerDialog"
|
|
|
+ :curRow="curRow"
|
|
|
+ @success="fetchData"
|
|
|
+ ></edit-customer-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="jsx" name="CustomerManage">
|
|
|
import { ref, reactive } from 'vue';
|
|
|
-import { getTableData } from '@/api/test';
|
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
|
+import EditCustomerDialog from './edit-customer-dialog.vue';
|
|
|
+import { customerListApi } from '@/api/system';
|
|
|
+const showEditCustomerDialog = ref(false);
|
|
|
+const curRow = ref(null);
|
|
|
|
|
|
const columns = [
|
|
|
- { colKey: 'a', title: '客户ID' },
|
|
|
- { colKey: 'b', title: '客户名称' },
|
|
|
- { colKey: 'c', title: '客户类型' },
|
|
|
- { colKey: 'd', title: '省份' },
|
|
|
- { colKey: 'e', title: '城市' },
|
|
|
- { colKey: 'f', title: '县区' },
|
|
|
- { colKey: 'g', title: '地址' },
|
|
|
- { colKey: 'h', title: '客户经理' },
|
|
|
- { colKey: 'i', title: '服务档位名称' },
|
|
|
- { colKey: 'j', title: '项目角色配置' },
|
|
|
+ { colKey: 'id', title: '客户ID' },
|
|
|
+ { colKey: 'name', title: '客户名称' },
|
|
|
+ { colKey: 'type', title: '客户类型' },
|
|
|
+ { colKey: 'province', title: '省份' },
|
|
|
+ { colKey: 'city', title: '城市' },
|
|
|
+ { colKey: 'area', title: '县区' },
|
|
|
+ { colKey: 'address', title: '地址' },
|
|
|
+ { colKey: 'manager', title: '客户经理' },
|
|
|
+ { colKey: 'serviceName', title: '服务档位名称' },
|
|
|
+ { colKey: 'roles', title: '项目角色配置' },
|
|
|
{ colKey: 'k', title: '标准人天' },
|
|
|
{ colKey: 'l', title: '创建人' },
|
|
|
{ colKey: 'm', title: '创建时间' },
|
|
@@ -83,7 +92,7 @@ const {
|
|
|
tableData,
|
|
|
fetchData,
|
|
|
onChange,
|
|
|
-} = useFetchTable(getTableData);
|
|
|
+} = useFetchTable(customerListApi);
|
|
|
|
|
|
const refresh = async () => {};
|
|
|
|
|
@@ -144,7 +153,8 @@ const params = reactive({
|
|
|
});
|
|
|
|
|
|
const handleAdd = () => {
|
|
|
- console.log('add');
|
|
|
+ curRow.value = null;
|
|
|
+ showEditCustomerDialog.value = true;
|
|
|
};
|
|
|
const handleImport = () => {
|
|
|
console.log('import');
|
|
@@ -154,6 +164,8 @@ const handleDelete = (row) => {
|
|
|
};
|
|
|
const handleEdit = (row) => {
|
|
|
console.log(row);
|
|
|
+ curRow.value = row;
|
|
|
+ showEditCustomerDialog.value = true;
|
|
|
};
|
|
|
</script>
|
|
|
|