diff --git a/src/api/crm/business/status/index.ts b/src/api/crm/business/status/index.ts
index 567dae31..4f686819 100644
--- a/src/api/crm/business/status/index.ts
+++ b/src/api/crm/business/status/index.ts
@@ -11,6 +11,27 @@ export interface BusinessStatusTypeVO {
}
}
+export const DEFAULT_STATUSES = [
+ {
+ endStatus: 1,
+ key: '结束',
+ name: '赢单',
+ percent: 100
+ },
+ {
+ endStatus: 2,
+ key: '结束',
+ name: '输单',
+ percent: 0
+ },
+ {
+ endStatus: 3,
+ key: '结束',
+ name: '无效',
+ percent: 0
+ }
+]
+
// 查询商机状态组列表
export const getBusinessStatusPage = async (params: any) => {
return await request.get({ url: `/crm/business-status/page`, params })
@@ -31,6 +52,11 @@ export const getBusinessStatus = async (id: number) => {
return await request.get({ url: `/crm/business-status/get?id=` + id })
}
+// 删除商机状态
+export const deleteBusinessStatus = async (id: number) => {
+ return await request.delete({ url: `/crm/business-status/delete?id=` + id })
+}
+
// 获得商机状态组列表
export const getBusinessStatusTypeSimpleList = async () => {
return await request.get({ url: `/crm/business-status/type-simple-list` })
diff --git a/src/views/crm/business/BusinessForm.vue b/src/views/crm/business/BusinessForm.vue
index 48efea98..d78cf935 100644
--- a/src/views/crm/business/BusinessForm.vue
+++ b/src/views/crm/business/BusinessForm.vue
@@ -50,6 +50,7 @@
placeholder="请选择商机状态组"
clearable
class="w-1/1"
+ :disabled="formType !== 'create'"
>
-
+
- 阶段 {{ scope.$index + 1 }}
+ 阶段 {{ scope.$index + 1 }}
+ 结束
-
+
+ {{ row.name }}
-
+
+ {{ row.percent }}
- 添加
+ 添加
+
+ {
formData.value = await BusinessStatusApi.getBusinessStatus(id)
treeRef.value.setCheckedKeys(formData.value.deptIds)
if (formData.value.statuses.length == 0) {
- addStatusArea(0)
+ addStatus()
}
} finally {
formLoading.value = false
}
} else {
- addStatusArea(0)
+ addStatus()
}
// 加载部门树
deptList.value = handleTree(await DeptApi.getSimpleDeptList())
@@ -162,7 +178,7 @@ const resetForm = () => {
}
/** 添加状态 */
-const addStatusArea = () => {
+const addStatus = () => {
const data = formData.value
data.statuses.push({
name: '',
diff --git a/src/views/crm/business/status/index.vue b/src/views/crm/business/status/index.vue
index b4eb8458..af372ab6 100644
--- a/src/views/crm/business/status/index.vue
+++ b/src/views/crm/business/status/index.vue
@@ -80,6 +80,7 @@ import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as BusinessStatusApi from '@/api/crm/business/status'
import BusinessStatusForm from './BusinessStatusForm.vue'
+import { deleteBusinessStatus } from '@/api/crm/business/status'
defineOptions({ name: 'CrmBusinessStatus' })
@@ -126,40 +127,19 @@ const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
-/** 选择客户操作 */
-const formCustomerRef = ref()
-const openCustomerForm = (id?: number) => {
- formCustomerRef.value.open(id)
-}
-
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
// 删除的二次确认
await message.delConfirm()
// 发起删除
- await BusinessStatusTypeApi.deleteBusinessStatusType(id)
+ await BusinessStatusApi.deleteBusinessStatus(id)
message.success(t('common.delSuccess'))
// 刷新列表
await getList()
} catch {}
}
-/** 导出按钮操作 */
-const handleExport = async () => {
- try {
- // 导出的二次确认
- await message.exportConfirm()
- // 发起导出
- exportLoading.value = true
- const data = await BusinessStatusTypeApi.exportBusinessStatusType(queryParams)
- download.excel(data, '商机状态组.xls')
- } catch {
- } finally {
- exportLoading.value = false
- }
-}
-
/** 初始化 **/
onMounted(() => {
getList()