Эх сурвалжийг харах

fix: 线索管理tab标段创建接口联调其他tab修复

liyang 4 сар өмнө
parent
commit
8688b6bd96

+ 4 - 0
src/api/market-manage/activity-manage/index.js

@@ -11,6 +11,10 @@ export function getPersonalOriganization(id){
 export function addMember(params){
     return postRequest('/supports/activity/member/create',params)
 }
+/* 标段创建 */
+export function addSectionSreation(params){
+    return postRequest('/supports/project/section/create',params)
+}
 /* 上传附件 */
 export function uploadFile(params){
     return postRequest('/supports/activity/attachment/create',params)

+ 101 - 98
src/views/market-manage/external-manage/clue-management/view-details/components/CooperativeProject.vue

@@ -37,22 +37,29 @@
     <a-layout-content class="right-content">
       <div class="association-chain">
         <h3 class="section-title">关联链列表</h3>
-        <a-table
-            :columns="columns"
-            :data-source="dataSource"
-            :pagination="false"
-            size="middle"
-            bordered
-        >
-          <template #bodyCell="{ column, record }">
-            <template v-if="column.key === 'operation'">
-              <a-space>
-                <a-button type="link" size="small" @click="handleEdit(record)">编辑</a-button>
-                <a-button type="link" size="small" danger @click="handleDelete(record)">删除</a-button>
-              </a-space>
-            </template>
+        <bs-table v-bind="tableOptions">
+          <template #toolbarLeft>
+            <a-space>
+              <span>累计留资客户 283人</span>
+            </a-space>
           </template>
-        </a-table>
+        </bs-table>
+<!--        <a-table-->
+<!--            :columns="columns"-->
+<!--            :data-source="dataSource"-->
+<!--            :pagination="false"-->
+<!--            size="middle"-->
+<!--            bordered-->
+<!--        >-->
+<!--          <template #bodyCell="{ column, record }">-->
+<!--            <template v-if="column.key === 'operation'">-->
+<!--              <a-space>-->
+<!--                <a-button type="link" size="small" @click="handleEdit(record)">编辑</a-button>-->
+<!--                <a-button type="link" size="small" danger @click="handleDelete(record)">删除</a-button>-->
+<!--              </a-space>-->
+<!--            </template>-->
+<!--          </template>-->
+<!--        </a-table>-->
       </div>
     </a-layout-content>
   </a-layout>
@@ -71,6 +78,7 @@ import {
   Space,
   message
 } from 'ant-design-vue';
+import BsTable, {useBsTable} from "/@/components/BsUi/Table/index.js";
 
 const ownerSubsidiaries = [
   '下属公司名称信息展示',
@@ -87,89 +95,84 @@ const contractorSubsidiaries = [
   '下属公司名称信息展示位置',
   '下属公司名称信息展示位置'
 ];
-
-const columns = [
-  {
-    title: '姓名',
-    dataIndex: 'name',
-    key: 'name',
-    width: 100
-  },
-  {
-    title: '性别',
-    dataIndex: 'gender',
-    key: 'gender',
-    width: 80
-  },
-  {
-    title: '年龄',
-    dataIndex: 'age',
-    key: 'age',
-    width: 80
-  },
-  {
-    title: '联系电话',
-    dataIndex: 'phone',
-    key: 'phone',
-    width: 120
-  },
-  {
-    title: '类型',
-    dataIndex: 'type',
-    key: 'type',
-    width: 120
+const {
+  tableOptions,
+  setTablePropsValue: setValue,
+  getTablePropsValue: getValue,
+} = useBsTable({
+  tableOptions: {
+    url: '',
+    gridOptions: {
+      loading: false,
+      columns: [
+        {
+          field: 'knowRunyang',
+          title: '姓名',
+        },
+        {
+          field: 'knowRunyang',
+          title: '性别',
+        },
+        {
+          field: 'companyName',
+          title: '年龄',
+
+        },
+        {
+          field: 'address',
+          title: '联系电话',
+        },
+        {
+          field: 'contact',
+          title: '类型',
+        },
+        {
+          field: 'contactPhone',
+          title: '职务',
+        },
+        {
+          field: 'post',
+          title: '邮箱',
+        },
+        {
+          field: 'needDescription',
+          title: '关系深度',
+        },
+        {
+          field: 'communicativeProject',
+          title: '爱好',
+        },
+        {
+          field: 'projectDescription',
+          title: '家庭情况',
+        },
+        {
+          field: 'follow',
+          title: '家庭住址',
+        },
+        {
+          field: 'follow',
+          title: '操作',
+        },
+      ],
+    },
+    pagerConfig: {
+      enabled: true,
+      pageSize: 10,
+      pageNum: 1,
+      total: 0,
+      isFixed: false
+    },
+    toolbarConfig: {
+      enable: false,
+    },
+    tableSearchBeforeBiz() {
+      const searchParams = getValue('searchConfig.data');
+      setValue('searchConfig.data', {...searchParams, id: id});
+    },
   },
-  {
-    title: '职务',
-    dataIndex: 'position',
-    key: 'position',
-    width: 120
-  },
-  {
-    title: '操作',
-    key: 'operation',
-    width: 120
-  }
-];
+});
 
-const dataSource = ref([
-  {
-    key: '1',
-    name: '唐敏',
-    gender: '男',
-    age: 43,
-    phone: '13245674567',
-    type: '总承包单位',
-    position: '总经理'
-  },
-  {
-    key: '2',
-    name: '吴胜',
-    gender: '女',
-    age: 43,
-    phone: '13245674567',
-    type: '业主单位',
-    position: '总监'
-  },
-  {
-    key: '3',
-    name: '胡思宁',
-    gender: '男',
-    age: 43,
-    phone: '13245674567',
-    type: '设计院',
-    position: '副总经理'
-  },
-  {
-    key: '4',
-    name: '江民泰',
-    gender: '女',
-    age: 43,
-    phone: '13245674567',
-    type: '业主单位',
-    position: '副总经理'
-  }
-]);
 
 const handleEdit = (record) => {
   message.info(`编辑 ${record.name}`);
@@ -177,8 +180,8 @@ const handleEdit = (record) => {
 };
 
 const handleDelete = (record) => {
-  dataSource.value = dataSource.value.filter(item => item.key !== record.key);
-  message.success(`已删除 ${record.name}`);
+  // dataSource.value = dataSource.value.filter(item => item.key !== record.key);
+  // message.success(`已删除 ${record.name}`);
 };
 </script>
 

+ 43 - 15
src/views/market-manage/external-manage/clue-management/view-details/components/SectionManagement.vue

@@ -4,7 +4,7 @@
       <template #toolbarTop>
         <div class="toolbarTop">
           <div></div>
-          <a-button type="primary">
+          <a-button type="primary" @click="openModal('标段创建',null)">
             <span>创建标段</span>
           </a-button>
           <a-button type="primary" style="margin-left: 10px">
@@ -14,19 +14,26 @@
       </template>
       <template #toolbarLeft>
         <a-space>
-<!--          <span>累计留资客户 283人</span>-->
         </a-space>
       </template>
     </bs-table>
   </div>
+  <sectionSreation :title="title" ref="memberModalRef" :id="id" />
 </template>
 <script setup lang="jsx">
-import { ref, reactive } from "vue"
-import BsTable, { useBsTable } from '/@/components/BsUi/Table/index.js';
-import { DISPLAY_STATE } from '/@/components/BsUi/constant.js';
-import { useRouter } from "vue-router";
-const { id } = defineProps(['id'])
+import {ref, reactive} from "vue"
+import BsTable, {useBsTable} from '/@/components/BsUi/Table/index.js';
+import BsModal, {useBsModal} from '/@/components/BsUi/Modal/index.js';
+import {DISPLAY_STATE, SCENE_TYPE, SELECT_MULTIPLE} from '/@/components/BsUi/constant.js';
+import {useRouter} from "vue-router";
+import sectionSreation from "./sectionSreation.vue";
+
+const {id} = defineProps(['id'])
 const router = useRouter()
+const memberModalRef = ref(null)
+function openModal(title, data) {
+  memberModalRef.value.showModal(title, data)
+}
 const {
   tableOptions,
   setTablePropsValue: setValue,
@@ -37,7 +44,7 @@ const {
     gridOptions: {
       loading: false,
       columns: [
-  
+
         {
           field: 'knowRunyang',
           title: '标段名称',
@@ -93,13 +100,13 @@ const {
                 {
                   title: '编辑',
                   code: 'add',
-                  display: ({ row }) => {
+                  display: ({row}) => {
                     return row.name !== 'hanxiaohui0' ? DISPLAY_STATE.VISIBLE : DISPLAY_STATE.HIDDEN;
                   },
-                  disabled({ row }) {
+                  disabled({row}) {
                     return false;
                   },
-                  onClick({ row }) {
+                  onClick({row}) {
                     console.log("row", row);
                     // message.success(row.name)
                   },
@@ -108,13 +115,13 @@ const {
                 {
                   title: '详情',
                   code: 'view',
-                  display: ({ row }) => {
+                  display: ({row}) => {
                     return DISPLAY_STATE.VISIBLE;
                   },
-                  disabled({ row }) {
+                  disabled({row}) {
                     return false;
                   },
-                  onClick({ row }) {
+                  onClick({row}) {
                     // router.push('/market-manage/activity-manage/activity-management/detail')
                   },
                   extraProps: {},
@@ -138,7 +145,28 @@ const {
     },
     tableSearchBeforeBiz() {
       const searchParams = getValue('searchConfig.data');
-      setValue('searchConfig.data', { ...searchParams, id: id });
+      setValue('searchConfig.data', {...searchParams, id: id});
+    },
+  },
+});
+
+const handleCancel = () => {
+  setMVal('visible', false);
+};
+const {
+  modalOptions,
+  getModalPropsValue: getMVal,
+  setModalPropsValue: setMVal,
+} = useBsModal({
+  modalOptions: {
+    width: '25%',
+    title: '',
+    visible: false,
+    modalExtraProps: {
+      destroyOnClose: true,
+      okButtonProps: {
+        loading: false
+      }
     },
   },
 });

+ 167 - 0
src/views/market-manage/external-manage/clue-management/view-details/components/sectionSreation.vue

@@ -0,0 +1,167 @@
+<template>
+  <bs-modal :visible="modalOptions.visible" :width="modalOptions.width" :title="modalOptions.title"
+            :modal-extra-props="modalOptions.modalExtraProps" @cancel="handleCancel" @ok="handleOk">
+    <a-form :rules="rules" :model="formData">
+      <!--      <a-row :gutter="16">-->
+      <!--        <a-col :span="24">-->
+      <!--          <a-form-item label="线索名称" name="marketer">-->
+      <!--            <a-input-->
+      <!--                v-model:value="formData.clueName"-->
+      <!--                placeholder="自动生成的项目名称信息展示位置"-->
+      <!--            />-->
+      <!--          </a-form-item>-->
+      <!--        </a-col>-->
+      <!--      </a-row>-->
+      <!--      <a-row :gutter="16">-->
+      <!--        <a-col :span="24">-->
+      <!--          <a-form-item label="项目名称" name="team">-->
+      <!--            <a-input-->
+      <!--                v-model:value="formData.clueName"-->
+      <!--                placeholder="自动生成的项目名称信息展示位置"-->
+      <!--            />-->
+      <!--          </a-form-item>-->
+      <!--        </a-col>-->
+      <!--      </a-row>-->
+      <a-row :gutter="16">
+        <a-col :span="12">
+          <a-form-item label="标段名称" name="sectionName">
+            <a-select
+                v-model:value="formData.sectionName"
+                placeholder="请选择"
+                :options="serviceProviderOptions"
+            />
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="标段概算金额" name="budgetAmount">
+            <a-input-number
+                v-model:value="formData.budgetAmount"
+                placeholder="请输入"
+                :min="0"
+                :formatter="(value) => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
+                :parser="(value) => value.replace(/\$\s?|(,*)/g, '')"
+                style="width: 100%"
+                addon-after="元"
+            />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="16">
+        <a-col :span="12">
+          <a-form-item label="预计招标日期" name="tenderDate">
+            <a-date-picker
+                v-model:value="formData.tenderDate"
+                placeholder="请选择日期"
+                show-time
+                format="YYYY-MM-DD HH:mm:ss"
+                value-format="YYYY-MM-DD HH:mm:ss"
+                style="width: 100%"
+            />
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="竞争对手(暂无竞争对手,去添加)" name="competitor">
+            <OrgUserSelector v-model:selected-data="formData.competitor" :multiple="SELECT_MULTIPLE.ONE"
+                             :scene-type="SCENE_TYPE.ORG"/>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="16">
+        <a-col :span="24">
+          <a-form-item label="备注" name="notes">
+            <a-input
+                v-model:value="formData.notes"
+                placeholder="请输入"
+            />
+          </a-form-item>
+        </a-col>
+      </a-row>
+
+    </a-form>
+  </bs-modal>
+</template>
+<script setup lang="jsx">
+import {ref, watch} from 'vue';
+import BsModal, {useBsModal} from '/@/components/BsUi/Modal/index.js';
+import OrgUserSelector from '/@/components/BsUi/OrgUserSelector/index.vue';
+import {SCENE_TYPE, SELECT_MULTIPLE} from '/@/components/BsUi/constant.js';
+import {addMember, addSectionSreation, getPersonalOriganization} from "/@/api/market-manage/activity-manage";
+import {isEmpty} from 'lodash';
+
+const emit = defineEmits(['fetchTableData'])
+const props = defineProps(['title'])
+const formData = ref({
+  id: "",
+  sectionName: "",
+  budgetAmount: 0,
+  tenderDate: "",
+  competitor: "",
+  note: ""
+})
+const rules = {
+  sectionName: [{required: true, message: '请选择标段名称'}],
+  budgetAmount: [{required: true, message: '请输入概算金额'}],
+  tenderDate: [{required: true, message: '请选择预计招标日期'}]
+}
+watch(() => formData.value.marketer, (value) => {
+  getPersonalOriganization(value.id).then((res) => {
+    formData.value.marketingTeam = res
+  })
+  console.log(value, formData.value);
+})
+const {
+  modalOptions,
+  getModalPropsValue: getMVal,
+  setModalPropsValue: setMVal,
+} = useBsModal({
+  modalOptions: {
+    width: '40%',
+    title: '',
+    visible: false,
+    modalExtraProps: {
+      destroyOnClose: true,
+      okButtonProps: {
+        loading: false
+      }
+    },
+  },
+});
+const serviceProviderOptions = ref([
+  {value: 'serviceProvider', label: '服务商提供'},
+  {value: 'marketActivity', label: '市场活动'},
+  {value: 'referral', label: '转介绍'}
+]);
+const showModal = (title, rowData) => {
+  // setMVal("width", "100%")
+  if (!isEmpty(rowData)) {
+    formData.value = rowData
+  }
+  setMVal('title', title);
+  setMVal('visible', true);
+};
+
+const handleCancel = () => {
+  setMVal('visible', false);
+};
+
+const handleOk = () => {
+  formData.value.competitor = formData.value.competitor?.id || null;
+  setMVal("modalExtraProps.okButtonProps.loading", true)
+  addSectionSreation(formData.value).then((res) => {
+    setMVal("modalExtraProps.okButtonProps.loading", false)
+    setMVal('visible', false);
+    emit('fetchTableData')
+  })
+};
+
+defineExpose({
+  showModal,
+});
+</script>
+
+<style lang="scss" scoped>
+.content {
+  width: 100%;
+  height: 900px;
+}
+</style>