| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454 |
- <template>
- <div>
- <headerTitle title="基本信息"></headerTitle>
- <el-form
- label-width="120px"
- ref="form"
- :model="form"
- :rules="rules"
- style="margin-top: 30px"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="客户名称:" prop="contactName">
- {{ detailData.contactName }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label=" 商机名称:" prop="name">
- {{ detailData.name }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="负责人名称:" prop="responsibleName">
- {{ detailData.responsibleName }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="商机来源:" prop="sourceCode">
- {{ detailData.sourceName }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="赢单率:" prop="winRate">
- {{ detailData.winRate ? detailData.winRate + '%' : '' }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="预算:" prop="budget">
- {{ detailData.budget ? detailData.budget + '万元' : '' }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="预计结单日期:" prop="expectedClosingDate">
- {{ detailData.expectedClosingDate }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="商机阶段:" prop="stageCode">
- {{ detailData.stageName }}
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="附件:" prop="files">
- <fileMain v-model="detailData.files" type="view"></fileMain>
- <!-- <div v-if="detailData.files && detailData.files?.length">-->
- <!-- <el-link-->
- <!-- v-for="link in detailData.files"-->
- <!-- :key="link.id"-->
- <!-- type="primary"-->
- <!-- :underline="false"-->
- <!-- @click="downloadFile(link)"-->
- <!-- >-->
- <!-- {{ link.name }}</el-link-->
- <!-- >-->
- <!-- </div>-->
- </el-form-item>
- </el-col>
- <!-- <el-col :span="8">
- <el-form-item label="计费方式:" prop="pricingWay">
- {{ detailData.pricingWay == 1 ? '按数量计费' : '按重量计费' }}
- </el-form-item>
- </el-col> -->
- <el-col :span="16">
- <el-form-item label="备注:" prop="remark">
- {{ detailData.remark }}
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <headerTitle title="物品清单"></headerTitle>
- <inventoryTable
- pageName="businessOpportunity"
- v-if="
- [
- 'productionSupervisorApprove1',
- 'technicianApprove',
- 'techLeaderApprove',
- 'productionSupervisorApprove2',
- 'salesManagerApprove'
- ].includes(taskDefinitionKey)
- "
- :isCustomerMark="false"
- ref="inventoryTable"
- :isDeliveryDeadline="false"
- :isGuaranteePeriod="false"
- :isDiscount="false"
- :pricing-way="form.pricingWay"
-
- ></inventoryTable>
- <inventoryTabledetail
- v-if="
- ![
- 'productionSupervisorApprove1',
- 'technicianApprove',
- 'techLeaderApprove',
- 'productionSupervisorApprove2',
- 'salesManagerApprove'
- ].includes(taskDefinitionKey)
- "
- ref="inventoryTabledetailRef"
- :isDeliveryDeadline="false"
- :isGuaranteePeriod="false"
- :isCustomerMark="false"
- :isDiscount="false"
- :pricingWay="detailData.pricingWay"
- ></inventoryTabledetail>
- <!-- <el-card
- shadow="never"
- header="竞品对手"
- body-style="padding: 22px 20px 0 20px;"
- >
- <ele-pro-table
- ref="table"
- :needPage="false"
- :columns="competAnalysisListcolumns1"
- :datasource="detailData.competAnalysisList"
- row-key="id"
- >
- </ele-pro-table>
- </el-card>
- <el-card
- shadow="never"
- header="关键人信息"
- body-style="padding: 22px 20px 0 20px;"
- >
- <ele-pro-table
- ref="table"
- :needPage="false"
- :columns="partyListcolumns"
- :datasource="detailData.partyList"
- row-key="id"
- >
- </ele-pro-table>
- </el-card> -->
- </div>
- </template>
- <script>
- import { getDetail } from '@/api/bpm/components/saleManage/businessOpportunity';
- import { getFile } from '@/api/system/file';
- import dictMixins from '@/mixins/dictMixins';
- // import inventoryTable from './saleGeneralityInventoryTable.vue';
- import inventoryTable from '@/BIZComponents/inventoryTable.vue';
- import inventoryTabledetail from '@/views/bpm/handleTask/components/contractBook/inventoryTabledetail.vue';
- import fileMain from '@/components/addDoc/index.vue';
- import {contactDetail} from '@/api/bpm/components/saleManage/contact';
- export default {
- mixins: [dictMixins],
- components: {
- fileMain,
- inventoryTable,
- inventoryTabledetail
- },
- props: {
- businessId: {
- default: ''
- },
- taskDefinitionKey: {
- default: ''
- }
- },
- data() {
- return {
- visible: false,
- customerMark:'',
- title: '详情',
- row: {},
- activeName: 'base',
- form: {},
- rules: {},
- detailData: {},
- competAnalysisListcolumns1: [
- {
- prop: 'name',
- label: '竞争对手名称',
- // sortable: 'custom',
- showOverflowTooltip: true,
- align: 'center',
- width: 300
- },
- {
- prop: 'analysis',
- label: '竞品分析',
- showOverflowTooltip: true,
- align: 'center'
- }
- ],
- partyListcolumns: [
- {
- prop: 'linkName',
- label: '关键人名称',
- // sortable: 'custom',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'linkMobilePhone',
- label: '联系方式',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'linkPost',
- label: '职位',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'attitudeName',
- label: '态度',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'influenceName',
- label: '影响力',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'goal',
- label: '项目目标/期望',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- }
- ],
- competAnalysisListcolumns: [
- {
- width: 45,
- type: 'index',
- columnKey: 'index',
- align: 'center',
- fixed: 'left'
- },
- {
- width: 200,
- prop: 'productName',
- label: '名称',
- slot: 'productName'
- },
- {
- width: 120,
- prop: 'productCode',
- label: '编码',
- slot: 'productCode'
- },
- {
- width: 200,
- prop: 'productCategoryName',
- label: '类型',
- slot: 'productCategoryName'
- },
- {
- width: 160,
- prop: 'productBrand',
- label: '牌号',
- slot: 'productBrand'
- },
- {
- width: 120,
- prop: 'modelType',
- label: '型号',
- slot: 'modelType'
- },
- {
- width: 120,
- prop: 'specification',
- label: '规格',
- slot: 'specification'
- },
- {
- width: 160,
- prop: 'singlePrice',
- label: '单价',
- slot: 'singlePrice'
- },
- {
- width: 120,
- prop: 'totalCount',
- label: '数量',
- slot: 'totalCount'
- },
- {
- width: 120,
- prop: 'totalPrice',
- label: '销售总金额',
- slot: 'totalPrice',
- formatter: (_row, _column, cellValue) => {
- return _row.totalPrice ? _row.totalPrice + '元' : '';
- }
- },
- {
- width: 120,
- prop: 'measuringUnit',
- label: '计量单位',
- slot: 'measuringUnit'
- },
- {
- width: 120,
- prop: 'deliveryDays',
- label: '交期(天)',
- slot: 'deliveryDays'
- },
- {
- width: 200,
- prop: 'guaranteePeriod',
- label: '质保期',
- slot: 'guaranteePeriod',
- formatter: (_row, _column, cellValue) => {
- return (
- (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
- );
- }
- },
- // {
- // width: 120,
- // prop: 'guaranteePeriodUnitCode',
- // label: '',
- // slot: 'guaranteePeriodUnitCode'
- // },
- {
- width: 240,
- prop: 'customerReqFiles',
- label: '客户需求',
- slot: 'customerReqFiles'
- },
- {
- width: 120,
- prop: 'technicalAnswerName',
- label: '技术答疑人',
- slot: 'technicalAnswerName'
- },
- {
- width: 220,
- prop: 'technicalParams',
- label: '技术参数',
- slot: 'technicalParams'
- },
- {
- width: 240,
- prop: 'technicalDrawings',
- label: '技术图纸',
- slot: 'technicalDrawings',
- formatter: (_row, _column, cellValue) => {
- return (
- (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
- );
- }
- },
- {
- width: 220,
- prop: 'remark',
- label: '备注',
- slot: 'remark'
- }
- ]
- };
- },
- created() {
- this.getDetailData(this.businessId);
- },
- methods: {
- downloadFile(file) {
- getFile({ objectName: file.storePath }, file.name);
- },
- async getDetailData(id) {
- this.loading = true;
- const data = await getDetail(id);
- this.loading = false;
- this.detailData = data;
- this.getContactDetail()
- if (this.detailData) {
- this.$refs.inventoryTable &&
- this.$refs.inventoryTable.putTableValue(this.detailData);
- this.$refs.inventoryTabledetailRef &&
- this.$refs.inventoryTabledetailRef.putTableValue(this.detailData);
- }
- },
- //获取客户
- async getContactDetail(type) {
- const { base } = await contactDetail(this.detailData.contactId);
- this.customerMark = base.serialNo;
-
- },
- getValidate() {
- return Promise.all([
- new Promise((resolve, reject) => {
- this.$refs.inventoryTable.validateForm((valid) => {
- if (!valid) {
- reject(false);
- } else {
- resolve(true);
- }
- });
- })
- ]);
- },
- async getTableValue() {
- try {
- await this.getValidate();
- if (this.$refs.inventoryTable.getTableValue().length == 0) {
- this.$message.warning('物品清单不能为空');
- return;
- }
- this.detailData.totalPrice= this.$refs.inventoryTable.getPrice()[0]
- const commitData = {
- opportunity: this.detailData,
- competAnalysisList: this.detailData.competAnalysisList,
- partyList: this.detailData.partyList,
- productList: this.$refs.inventoryTable.getTableValue()
- };
- return commitData;
- } catch (error) {
- console.log(error);
- return Promise.resolve([]);
- }
- }
- }
- };
- </script>
- <style scoped lang="scss">
- .ele-dialog-form {
- .el-form-item {
- margin-bottom: 10px;
- }
- }
- </style>
|