|
|
@@ -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>
|