|
@@ -47,9 +47,11 @@
|
|
|
<div class="flex-1 p-5 overflow-auto">
|
|
|
<div class="bg-white w-full h-full p-3 shadow-md rounded-md flex flex-col">
|
|
|
<div class="flex justify-end pb-3">
|
|
|
- <el-button type="primary">新建商机</el-button>
|
|
|
+ <el-button type="primary" @click="showVisible('newBusinessisible')">新建商机</el-button>
|
|
|
<el-button type="primary">批量转移</el-button>
|
|
|
<el-button type="primary">批量删除</el-button>
|
|
|
+ <el-button type="primary">阶段设置</el-button>
|
|
|
+ <el-button type="primary">回收站</el-button>
|
|
|
<el-button type="primary">导入</el-button>
|
|
|
<el-button type="primary">导出</el-button>
|
|
|
</div>
|
|
@@ -59,7 +61,7 @@
|
|
|
<el-table-column type="selection" width="55" />
|
|
|
<el-table-column prop="name" label="商机名称" width="180">
|
|
|
<template #default="scope">
|
|
|
- <el-button link type="primary" size="large">{{
|
|
|
+ <el-button link type="primary" size="large" @click="toBusinessTableDetail(scope.row)">{{
|
|
|
scope.row.name
|
|
|
}}</el-button>
|
|
|
</template>
|
|
@@ -93,51 +95,61 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!-- 弹窗 -->
|
|
|
+ <el-dialog v-model="allVisible.newBusinessisible" width="1000" :show-close="false" top="10vh"
|
|
|
+ :before-close="handleClose">
|
|
|
+ <template #header="{ close, titleId, titleClass }">
|
|
|
+ <div class="flex justify-between items-center border-b pb-3 dialog-header">
|
|
|
+ <h4 :id="titleId">{{ allText.newBusinessisibleText }}</h4>
|
|
|
+ <div>
|
|
|
+ <el-button type="primary">保存并新建</el-button>
|
|
|
+ <el-button type="primary" @click="editBusiness()">保存</el-button>
|
|
|
+ <el-button @click="closeVisible('newBusinessisible')">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="h-[60vh] overflow-y-auto scroll-bar">
|
|
|
+ <GenerateForm ref="generateForm" :data="generateFormData" />
|
|
|
+ <div>相关产品</div>
|
|
|
+ <RelatedProducts />
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { ref, reactive, onMounted, inject } from "vue";
|
|
|
-import { GETSYSFILED, MOD, GETPERSONNEL } from './api'
|
|
|
+import type { FormInstance, FormRules } from 'element-plus'
|
|
|
+import { useRouter, useRoute } from "vue-router";
|
|
|
+import { GETSYSFILED, MOD, GETPERSONNEL, GETGENERATEFOEM } from './api'
|
|
|
import { post, get } from "@/utils/request";
|
|
|
import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, getLastDayOfMonth, formatDate } from '@/utils/tools'
|
|
|
+import { GenerateForm } from '@zmjs/form-design';
|
|
|
+import RelatedProducts from './component/relatedProducts.vue'
|
|
|
|
|
|
-// 定义类型
|
|
|
-interface businessOpportunityFormType { // 线索筛选条件类型
|
|
|
- name: string,
|
|
|
- stageId: string | number,
|
|
|
- customerName: string,
|
|
|
- contactPerson: string,
|
|
|
- product: string | number,
|
|
|
- inchargerId: string | number,
|
|
|
- startTime: string | number,
|
|
|
- endTime: string | number,
|
|
|
- pageIndex: string | number,
|
|
|
- pageFrom: string | number
|
|
|
-}
|
|
|
-
|
|
|
-interface fixedDataInterface {
|
|
|
- id: string | number,
|
|
|
- companyId: string | number,
|
|
|
- code: string,
|
|
|
- name: string,
|
|
|
- seq: string | number,
|
|
|
-}
|
|
|
-
|
|
|
-interface personnelInterface {
|
|
|
- id: string | number,
|
|
|
- name: string,
|
|
|
- phone: string,
|
|
|
- jobNumber: string
|
|
|
-}
|
|
|
-
|
|
|
+const route = useRoute()
|
|
|
+const router = useRouter()
|
|
|
+const globalPopup = inject<GlobalPopup>('globalPopup')
|
|
|
const businessTotalTable = ref(0)
|
|
|
+const generateForm = ref<typeof GenerateForm>() // 自定义表单dom
|
|
|
+const generateFormData = ref({
|
|
|
+ config: {},
|
|
|
+ list: []
|
|
|
+}) // 自定义表单数据
|
|
|
const businessTable = ref([
|
|
|
- {name: '商机040101',phone: '张山'}
|
|
|
+ { name: '商机040101', phone: '张山' }
|
|
|
])
|
|
|
-const allLoading = reactive({
|
|
|
+const allLoading = reactive<AllLoadingInterface>({
|
|
|
businessTableLading: false
|
|
|
})
|
|
|
+const allVisible = reactive<AllVisibleInterface>({
|
|
|
+ newBusinessisible: false,
|
|
|
+ recycleVisible: false,
|
|
|
+})
|
|
|
+const allText = reactive({
|
|
|
+ newBusinessisibleText: '新建商机'
|
|
|
+}) // 所有文本
|
|
|
+
|
|
|
const businessOpportunityForm = reactive<businessOpportunityFormType>({
|
|
|
name: '',
|
|
|
stageId: '',
|
|
@@ -155,6 +167,28 @@ const fixedData = reactive({
|
|
|
Personnel: [] as personnelInterface[]
|
|
|
})
|
|
|
|
|
|
+
|
|
|
+function editBusiness() {
|
|
|
+ generateForm.value?.getData().then((res: any) => {
|
|
|
+ console.log('正确')
|
|
|
+ console.log(res)
|
|
|
+ }).catch( (_err: any) => {
|
|
|
+ globalPopup?.showError('请填写完整')
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function showVisible(type: keyof AllVisibleInterface) { // 显示弹窗
|
|
|
+ allVisible[type] = true
|
|
|
+}
|
|
|
+
|
|
|
+function closeVisible(type: keyof AllVisibleInterface) {
|
|
|
+ allVisible[type] = false
|
|
|
+}
|
|
|
+
|
|
|
+function handleClose(done: () => void) {
|
|
|
+ done()
|
|
|
+}
|
|
|
+
|
|
|
async function getSystemField() {
|
|
|
const systemField = getAllListByCode(['商机阶段'])
|
|
|
for (let i in systemField) {
|
|
@@ -173,6 +207,17 @@ async function getSystemField() {
|
|
|
id, name, phone, jobNumber
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+ const res = await get(GETGENERATEFOEM)
|
|
|
+ generateFormData.value = JSON.parse(res.data[0].config)
|
|
|
+}
|
|
|
+
|
|
|
+function toBusinessTableDetail(row: any) {
|
|
|
+ console.log('点击跳转详情')
|
|
|
+ router.push({
|
|
|
+ path: `${MOD}/detail`,
|
|
|
+ query: { id: row.id }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
@@ -180,4 +225,11 @@ onMounted(() => {
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped></style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.dialog-header {
|
|
|
+ h4 {
|
|
|
+ font-size: 18px;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|