|
|
@@ -8,7 +8,7 @@
|
|
|
@click="handleClick('up')">
|
|
|
升级
|
|
|
</el-button>
|
|
|
- <!--未在审批中 且级别为 A、B 可J降级-->
|
|
|
+ <!--未在审批中 且级别为 A、B 可降级-->
|
|
|
<el-button
|
|
|
v-permissions="['proj:business:downgrade']"
|
|
|
:disabled="!['10', '20'].includes(businessInfo.nboType) || businessInfo.approStatus === '20'"
|
|
|
@@ -16,8 +16,15 @@
|
|
|
@click="handleClick('down')">
|
|
|
降级
|
|
|
</el-button>
|
|
|
+
|
|
|
<el-dialog append-to-body :title="title" :visible.sync="dialogFormVisible" width="60%" @close="close">
|
|
|
- <el-form ref="form" label-position="top" :model="form" :rules="rules" style="margin-top: -20px">
|
|
|
+ <el-form
|
|
|
+ v-if="type === 'up'"
|
|
|
+ ref="form"
|
|
|
+ label-position="top"
|
|
|
+ :model="form"
|
|
|
+ :rules="rules"
|
|
|
+ style="margin-top: -20px">
|
|
|
<el-form-item label="项目类别" prop="nboType">
|
|
|
<el-select v-model="form.nboType" placeholder="请选择项目类别" style="width: 100%">
|
|
|
<el-option
|
|
|
@@ -35,55 +42,77 @@
|
|
|
<!-- <el-option v-if="type === 'down'" label="储备" value="50" />-->
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <!-- C-B 项目预算 经销商/代理商 技术支持时间 技术支持人员 技术支持内容 总部对接人 项目预算期限 资金来源 产品/方案满足情况-->
|
|
|
- <el-row v-if="type === 'up' && form.nboType !== '30'" :gutter="20">
|
|
|
+ <!-- C-B 必填项:项目类别、项目预算、渠道销售人员、渠道销售电话、微信、预计出货金额(不填)、添加产品、上传报价单 -->
|
|
|
+ <el-row v-if="form.nboType !== '30'" :gutter="20">
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="项目预算" prop="nboBudget">
|
|
|
<amount-input v-model.trim="form.nboBudget" placeholder="请输入金额" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <div v-if="businessInfo.salesModel !== '10'">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="渠道销售人员" prop="dealerSalesName">
|
|
|
+ <el-input
|
|
|
+ v-model="form.dealerSalesName"
|
|
|
+ readonly
|
|
|
+ suffix-icon="el-icon-search"
|
|
|
+ @focus="handleSelectDistributorContact" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="渠道销售电话/微信" prop="dealerSalesContact">
|
|
|
+ <el-input v-model="form.dealerSalesContact" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="经销商/代理商" prop="distributorName">
|
|
|
- <el-input
|
|
|
- v-model="form.distributorName"
|
|
|
- readonly
|
|
|
- suffix-icon="el-icon-search"
|
|
|
- @focus="handleSelectDistributor" />
|
|
|
+ <el-form-item
|
|
|
+ label="报价单"
|
|
|
+ prop="quotationFile"
|
|
|
+ :required="form.nboType === '10' || form.nboType === '20'">
|
|
|
+ <el-upload
|
|
|
+ :action="uploadFileUrl"
|
|
|
+ :file-list="quotationFileList"
|
|
|
+ :limit="1"
|
|
|
+ :on-success="setQuotationFile">
|
|
|
+ <el-button size="mini" type="primary">点击上传</el-button>
|
|
|
+ </el-upload>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="总部对接人" prop="parentReceiver">
|
|
|
- <el-input v-model="form.parentReceiver" />
|
|
|
- </el-form-item>
|
|
|
+ <el-col :span="24">
|
|
|
+ <div style="float: right; margin-bottom: 10px">
|
|
|
+ <span style="margin-right: 10px; color: red">预计出货金额:{{ formatPrice(form.estTransPrice) }}</span>
|
|
|
+ <el-button size="mini" type="primary" @click="handleSelectProduct">添加产品</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <product-table
|
|
|
+ ref="productTable"
|
|
|
+ :product-data="productData"
|
|
|
+ @changeProductData="changeProductData"
|
|
|
+ @delProductData="delProductData" />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row v-if="!(type === 'up' && form.nboType === '30')" :gutter="20">
|
|
|
+ <!-- B-A 必填项:采购方式、资金来源、计划采购时间、客户决策人、客户决策部分、客户联系人姓名、客户联系人电话/微信、是否采纳我司技术参数(是/否)、竞争公司、客户倾向厂家 -->
|
|
|
+ <el-row v-if="form.nboType === '10'" :gutter="20">
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="技术支持人员" prop="technicalSupportName" :required="type === 'up'">
|
|
|
- <el-input v-model="form.technicalSupportName" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="技术支持内容" prop="technicalSupportContent" :required="type === 'up'">
|
|
|
- <el-input v-model="form.technicalSupportContent" />
|
|
|
+ <el-form-item label="采购方式" prop="purchasingWay" :required="type === 'up' && form.nboType === '10'">
|
|
|
+ <el-select v-model="form.purchasingWay" placeholder="请选择" style="width: 100%">
|
|
|
+ <el-option v-for="item in purchasingWayOptions" :key="item.key" :label="item.value" :value="item.key" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="技术支持时间" prop="technicalSupportTime" :required="type === 'up'">
|
|
|
- <el-date-picker
|
|
|
- v-model="form.technicalSupportTime"
|
|
|
- placeholder="选择日期"
|
|
|
- style="width: 100%"
|
|
|
- type="datetime"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss" />
|
|
|
+ <el-form-item label="资金来源" prop="capitalSource">
|
|
|
+ <el-input v-model="form.capitalSource" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row v-if="type === 'up' && form.nboType !== '30'" :gutter="20">
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="项目预算期限" prop="nboBudgetTime">
|
|
|
+ <el-form-item
|
|
|
+ label="计划采购时间"
|
|
|
+ prop="planPurchaseTime"
|
|
|
+ :required="type === 'up' && form.nboType === '10'">
|
|
|
<el-date-picker
|
|
|
- v-model="form.nboBudgetTime"
|
|
|
+ v-model="form.planPurchaseTime"
|
|
|
placeholder="选择日期"
|
|
|
style="width: 100%"
|
|
|
type="datetime"
|
|
|
@@ -91,58 +120,37 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="资金来源" prop="capitalSource">
|
|
|
- <el-input v-model="form.capitalSource" />
|
|
|
+ <el-form-item label="客户决策人" prop="makerName">
|
|
|
+ <el-input v-model="form.makerName" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="产品/方案满足情况" prop="productSatisfaction">
|
|
|
- <el-input v-model="form.productSatisfaction" />
|
|
|
+ <el-form-item label="客户决策部门" prop="makerDept">
|
|
|
+ <el-input v-model="form.makerDept" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
- <!-- B-A 采购方式 采购时间 是否采纳大数技术参数(上传附件) 决策部门 决策人员 经销商与客户历史成交信息 经销商销售人员 维护部门及人员-->
|
|
|
- <el-row v-if="type === 'up' && form.nboType === '10'" :gutter="20">
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="采购方式" prop="purchasingWay" :required="type === 'up' && form.nboType === '10'">
|
|
|
- <el-select v-model="form.purchasingWay" placeholder="请选择" style="width: 100%">
|
|
|
- <el-option v-for="item in purchasingWayOptions" :key="item.key" :label="item.value" :value="item.key" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="采购时间" prop="purchasingTime" :required="type === 'up' && form.nboType === '10'">
|
|
|
- <el-date-picker
|
|
|
- v-model="form.purchasingTime"
|
|
|
- placeholder="选择日期"
|
|
|
- style="width: 100%"
|
|
|
- type="datetime"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="决策人员" prop="makerName">
|
|
|
- <el-input v-model="form.makerName" readonly suffix-icon="el-icon-search" @focus="handleSelectContact" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="决策部门" prop="makerDept">
|
|
|
- <el-input v-model="form.makerDept" readonly />
|
|
|
+ <el-form-item label="客户联系人" prop="contactName">
|
|
|
+ <el-input
|
|
|
+ v-model="form.contactName"
|
|
|
+ readonly
|
|
|
+ suffix-icon="el-icon-search"
|
|
|
+ @focus="handleSelectCustomerContact" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="经销商与客户历史成交信息" prop="historicalTransactionInfo">
|
|
|
- <el-input v-model="form.historicalTransactionInfo" />
|
|
|
+ <el-form-item label="客户联系人电话/微信" prop="contactTelephone">
|
|
|
+ <el-input v-model="form.contactTelephone" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="经销商销售人员" prop="dealerSalesName">
|
|
|
- <el-input v-model="form.dealerSalesName" />
|
|
|
+ <el-form-item label="竞争公司" prop="competitor">
|
|
|
+ <el-input v-model="form.competitor" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="维护部门及人员" prop="accendant">
|
|
|
- <el-input v-model="form.accendant" />
|
|
|
+ <el-form-item label="客户倾向厂家" prop="customerIntentionFactory">
|
|
|
+ <el-input v-model="form.customerIntentionFactory" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
@@ -168,7 +176,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row v-if="type === 'up' && form.nboType === '30'">
|
|
|
+ <el-row v-if="form.nboType === '30'">
|
|
|
<el-form-item label="转化原因" prop="projConversionReason">
|
|
|
<el-input
|
|
|
v-model="form.projConversionReason"
|
|
|
@@ -180,22 +188,8 @@
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
<el-row v-else>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="报价单"
|
|
|
- prop="quotationFile"
|
|
|
- :required="form.nboType === '10' || form.nboType === '20'">
|
|
|
- <el-upload
|
|
|
- :action="uploadFileUrl"
|
|
|
- :file-list="quotationFileList"
|
|
|
- :limit="1"
|
|
|
- :on-success="setQuotationFile">
|
|
|
- <el-button size="mini" type="primary">点击上传</el-button>
|
|
|
- </el-upload>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="16">
|
|
|
- <el-form-item :label="title + '原因'" prop="remark" :required="type === 'down'">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="升级原因" prop="remark">
|
|
|
<el-input
|
|
|
v-model="form.remark"
|
|
|
maxlength="300"
|
|
|
@@ -207,20 +201,60 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
+ <el-form
|
|
|
+ v-if="type === 'down'"
|
|
|
+ ref="form"
|
|
|
+ label-position="top"
|
|
|
+ :model="form"
|
|
|
+ :rules="rules"
|
|
|
+ style="margin-top: -20px">
|
|
|
+ <el-form-item label="项目类别" prop="nboType">
|
|
|
+ <el-select v-model="form.nboType" placeholder="请选择项目类别" style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ :disabled="
|
|
|
+ (type === 'up' && businessInfo.nboType === '10') ||
|
|
|
+ (type === 'down' && ['10', '20'].includes(businessInfo.nboType))
|
|
|
+ "
|
|
|
+ label="A"
|
|
|
+ value="10" />
|
|
|
+ <el-option :disabled="businessInfo.nboType === '20'" label="B" value="20" />
|
|
|
+ <el-option
|
|
|
+ :disabled="type === 'up' && ['10', '20', '30'].includes(businessInfo.nboType)"
|
|
|
+ label="C"
|
|
|
+ value="30" />
|
|
|
+ <!-- <el-option v-if="type === 'down'" label="储备" value="50" />-->
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="降级原因" prop="remark" required>
|
|
|
+ <el-input
|
|
|
+ v-model="form.remark"
|
|
|
+ maxlength="300"
|
|
|
+ placeholder="请输入备注原因"
|
|
|
+ rows="3"
|
|
|
+ show-word-limit
|
|
|
+ type="textarea" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
<template #footer>
|
|
|
<el-button @click="close">取 消</el-button>
|
|
|
<el-button :loading="loading" type="primary" @click="save">确 定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <!-- 选择客户决策人弹窗 -->
|
|
|
- <select-contact
|
|
|
- ref="selectContact"
|
|
|
+ <!-- 选择客户联系人弹窗 -->
|
|
|
+ <select-customer-contact
|
|
|
+ ref="selectCustomerContact"
|
|
|
:default-customer="customerInfo"
|
|
|
- :query-params="queryContact"
|
|
|
- @save="selectContact" />
|
|
|
- <!-- 选择经销商弹窗 -->
|
|
|
- <select-distributor ref="selectDistributor" @save="selectDistributor" />
|
|
|
+ :query-params="queryCustomerContact"
|
|
|
+ @save="selectCustomerContact" />
|
|
|
+ <!-- 选择渠道销售人员弹窗 -->
|
|
|
+ <select-distributor-contact
|
|
|
+ ref="selectDistributorContact"
|
|
|
+ :default-dist="distInfo"
|
|
|
+ :query-params="queryDistContact"
|
|
|
+ @save="selectDistributorContact" />
|
|
|
+ <!-- 选择产品弹窗 -->
|
|
|
+ <select-product ref="selectProduct" multiple @save="selectProduct" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -228,15 +262,20 @@
|
|
|
import to from 'await-to-js'
|
|
|
import businessApi from '@/api/proj/business'
|
|
|
import AmountInput from '@/components/currency/index.vue'
|
|
|
- import SelectContact from '@/components/select/SelectCustomerContact'
|
|
|
- import SelectDistributor from '@/components/select/SelectDistributor'
|
|
|
+ import SelectCustomerContact from '@/components/select/SelectCustomerContact'
|
|
|
+ import SelectDistributorContact from '@/components/select/SelectDistributorContact'
|
|
|
+ import ProductTable from '@/views/proj/business/components/ProductTable.vue'
|
|
|
+ import SelectProduct from '@/components/select/SelectProduct'
|
|
|
+ import {nextTick} from "vue";
|
|
|
|
|
|
export default {
|
|
|
name: 'BusinessGradation',
|
|
|
components: {
|
|
|
+ SelectProduct,
|
|
|
+ ProductTable,
|
|
|
AmountInput,
|
|
|
- SelectContact,
|
|
|
- SelectDistributor,
|
|
|
+ SelectCustomerContact,
|
|
|
+ SelectDistributorContact,
|
|
|
},
|
|
|
props: {
|
|
|
// 项目Id
|
|
|
@@ -251,14 +290,6 @@
|
|
|
},
|
|
|
},
|
|
|
data() {
|
|
|
- const validateTechnicalSupport = (rule, value, callback) => {
|
|
|
- if (!value && this.type === 'up') callback(new Error('不能为空'))
|
|
|
- else callback()
|
|
|
- }
|
|
|
- const validateUpgradeA = (rule, value, callback) => {
|
|
|
- if (!value && this.type === 'up' && this.form.nboType === '10') callback(new Error('不能为空'))
|
|
|
- else callback()
|
|
|
- }
|
|
|
const validateDowngrade = (rule, value, callback) => {
|
|
|
if (!value && this.type === 'down') callback(new Error('不能为空'))
|
|
|
else callback()
|
|
|
@@ -271,78 +302,72 @@
|
|
|
if (this.form.isAdoptDashoo === '10' && !value) callback(new Error())
|
|
|
else callback()
|
|
|
}
|
|
|
- const validateQuotationFile = (rule, value, callback) => {
|
|
|
- if ((this.form.nboType === '10' || this.form.nboType === '20') && !value) callback(new Error())
|
|
|
- else callback()
|
|
|
- }
|
|
|
return {
|
|
|
title: '项目',
|
|
|
type: '',
|
|
|
loading: false,
|
|
|
form: {
|
|
|
id: undefined,
|
|
|
- distributorId: undefined,
|
|
|
- distributorName: undefined,
|
|
|
- custId: undefined,
|
|
|
- custName: undefined,
|
|
|
+ nboType: undefined,
|
|
|
+ // C => B
|
|
|
+ nboBudget: undefined,
|
|
|
+ dealerSalesId: undefined,
|
|
|
+ dealerSalesName: undefined,
|
|
|
+ dealerSalesContact: undefined,
|
|
|
+ estTransPrice: undefined,
|
|
|
+ quotationFile: undefined,
|
|
|
+ products: [],
|
|
|
+ // B => A
|
|
|
+ purchasingWay: undefined,
|
|
|
+ capitalSource: undefined,
|
|
|
+ planPurchaseTime: undefined,
|
|
|
+ contactId: undefined,
|
|
|
+ contactName: undefined,
|
|
|
+ contactTelephone: undefined,
|
|
|
+ contactWechat: undefined,
|
|
|
makerId: undefined,
|
|
|
makerName: undefined,
|
|
|
makerDept: undefined,
|
|
|
makerPost: undefined,
|
|
|
makerTelephone: undefined,
|
|
|
- nboType: undefined,
|
|
|
- nboBudget: undefined,
|
|
|
- technicalSupportName: undefined,
|
|
|
- technicalSupportContent: undefined,
|
|
|
- technicalSupportTime: undefined,
|
|
|
- parentReceiver: undefined,
|
|
|
- nboBudgetTime: undefined,
|
|
|
- capitalSource: undefined,
|
|
|
- productSatisfaction: undefined,
|
|
|
- purchasingWay: undefined,
|
|
|
- purchasingTime: undefined,
|
|
|
+ customerIntentionFactory: undefined,
|
|
|
+ competitor: undefined,
|
|
|
isAdoptDashoo: undefined,
|
|
|
- historicalTransactionInfo: undefined,
|
|
|
- dealerSalesId: undefined,
|
|
|
- dealerSalesName: undefined,
|
|
|
- accendant: undefined,
|
|
|
+ dashooParamFile: undefined,
|
|
|
projConversionReason: undefined,
|
|
|
remark: undefined,
|
|
|
- dashooParamFile: undefined,
|
|
|
- quotationFile: undefined,
|
|
|
},
|
|
|
rules: {
|
|
|
nboType: [{ required: true, trigger: ['blur', 'change'], message: '请选择项目类别' }],
|
|
|
+ // C => B
|
|
|
nboBudget: [
|
|
|
{ required: true, trigger: ['blur', 'change'], message: '请输入项目预算' },
|
|
|
- {
|
|
|
- validator: validateNboBudget,
|
|
|
- trigger: ['blur', 'change'],
|
|
|
- message: '项目预算应大于0',
|
|
|
- },
|
|
|
- ],
|
|
|
- // distributorName: [{ required: true, trigger: ['blur', 'change'], message: '请选择经销商/代理商' }],
|
|
|
- technicalSupportName: [
|
|
|
- { validator: validateTechnicalSupport, trigger: ['blur', 'change'], message: '请输入技术支持人员' },
|
|
|
- ],
|
|
|
- technicalSupportContent: [
|
|
|
- { validator: validateTechnicalSupport, trigger: ['blur', 'change'], message: '请输入技术支持内容' },
|
|
|
+ { validator: validateNboBudget, trigger: ['blur', 'change'], message: '项目预算应大于0' },
|
|
|
],
|
|
|
- technicalSupportTime: [
|
|
|
- { validator: validateTechnicalSupport, trigger: ['blur', 'change'], message: '请选择技术支持时间' },
|
|
|
- ],
|
|
|
-
|
|
|
- purchasingTime: [{ validator: validateUpgradeA, trigger: ['blur', 'change'], message: '请选择采购时间' }],
|
|
|
- purchasingWay: [{ validator: validateUpgradeA, trigger: ['blur', 'change'], message: '请选择采购方式' }],
|
|
|
- isAdoptDashoo: [{ validator: validateUpgradeA, trigger: ['blur', 'change'], message: '请选择是或否' }],
|
|
|
+ dealerSalesId: [{ required: true, trigger: ['blur', 'change'], message: '请选择渠道销售' }],
|
|
|
+ dealerSalesName: [{ required: true, trigger: ['blur', 'change'], message: '请选择项渠道销售人员' }],
|
|
|
+ dealerSalesContact: [{ required: true, trigger: ['blur', 'change'], message: '请输入渠道销售电话/微信' }],
|
|
|
+ estTransPrice: [{ required: true, trigger: ['blur', 'change'], message: '请选择预计出货金额' }],
|
|
|
+ quotationFile: [{ required: true, trigger: ['blur', 'change'], message: '请选择报价单' }],
|
|
|
+ products: [{ required: true, trigger: ['blur', 'change'], message: '请选择产品' }],
|
|
|
+ // B => A
|
|
|
+ purchasingWay: [{ required: true, trigger: ['blur', 'change'], message: '请选择采购方式' }],
|
|
|
+ capitalSource: [{ required: true, trigger: ['blur', 'change'], message: '请输入资金来源' }],
|
|
|
+ planPurchaseTime: [{ required: true, trigger: ['blur', 'change'], message: '请选择计划采购时间' }],
|
|
|
+ contactId: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户联系人' }],
|
|
|
+ contactName: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户联系人姓名' }],
|
|
|
+ contactTelephone: [{ required: true, trigger: ['blur', 'change'], message: '请输入客户联系人电话/微信' }],
|
|
|
+ makerId: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户决策人' }],
|
|
|
+ makerName: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户决策人姓名' }],
|
|
|
+ makerDept: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户决策部门' }],
|
|
|
+ customerIntentionFactory: [{ required: true, trigger: ['blur', 'change'], message: '请输入客户倾向厂家' }],
|
|
|
+ competitor: [{ required: true, trigger: ['blur', 'change'], message: '请输入竞争公司' }],
|
|
|
+ isAdoptDashoo: [{ required: true, trigger: ['blur', 'change'], message: '请选择是或否' }],
|
|
|
dashooParamFile: [{ validator: validateAdoptDashoo, trigger: ['blur', 'change'], message: '请选择上传文件' }],
|
|
|
- quotationFile: [{ validator: validateQuotationFile, trigger: ['blur', 'change'], message: '请选择上传文件' }],
|
|
|
-
|
|
|
- remark: [{ validator: validateDowngrade, trigger: ['blur', 'change'], message: '请输入原因' }],
|
|
|
projConversionReason: [{ required: true, trigger: ['blur', 'change'], message: '请输入转化原因' }],
|
|
|
+ remark: [{ validator: validateDowngrade, trigger: ['blur', 'change'], message: '请输入原因' }],
|
|
|
},
|
|
|
dialogFormVisible: false,
|
|
|
- yesOrNoOptions: [],
|
|
|
purchasingWayOptions: [],
|
|
|
// 大数参数文件
|
|
|
dashooParamFileList: [],
|
|
|
@@ -358,8 +383,11 @@
|
|
|
videoSize: 104857600,
|
|
|
videoType: '.mp4',
|
|
|
},
|
|
|
- queryContact: {},
|
|
|
+ queryCustomerContact: {},
|
|
|
customerInfo: {},
|
|
|
+ queryDistContact: {},
|
|
|
+ distInfo: {},
|
|
|
+ productData: [],
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -368,10 +396,63 @@
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ selectProduct(data) {
|
|
|
+ let projData = data.map((item) => ({
|
|
|
+ prodId: item.id,
|
|
|
+ prodCode: item.prodCode,
|
|
|
+ prodName: item.prodName,
|
|
|
+ prodClass: item.prodClass,
|
|
|
+ guidPrice: item.guidPrice,
|
|
|
+ prodPrice: item.marketPrice,
|
|
|
+ prodNum: 1,
|
|
|
+ }))
|
|
|
+ this.productData.push(...projData)
|
|
|
+ this.productData = this.removeDuplicateObj(this.productData)
|
|
|
+ this.getEstTransPrice()
|
|
|
+ },
|
|
|
+ // 数组对象去重
|
|
|
+ removeDuplicateObj(arr) {
|
|
|
+ let newArrId = []
|
|
|
+ let newArrObj = []
|
|
|
+ arr.forEach((item) => {
|
|
|
+ if (!newArrId.includes(item.prodId)) {
|
|
|
+ newArrId.push(item.prodId)
|
|
|
+ newArrObj.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return newArrObj
|
|
|
+ },
|
|
|
+ handleSelectProduct() {
|
|
|
+ this.$refs.selectProduct.open()
|
|
|
+ },
|
|
|
+ // 修改产品列表数据
|
|
|
+ changeProductData(data) {
|
|
|
+ this.productData = this.productData.map((item) => {
|
|
|
+ return item.prodId === data.prodId ? data : item
|
|
|
+ })
|
|
|
+ this.getEstTransPrice()
|
|
|
+ },
|
|
|
+ delProductData(data) {
|
|
|
+ this.productData = this.productData.filter((item) => item.prodId !== data.prodId)
|
|
|
+ this.getEstTransPrice()
|
|
|
+ },
|
|
|
+ getEstTransPrice() {
|
|
|
+ this.form.estTransPrice = 0
|
|
|
+ for (let item of this.productData) {
|
|
|
+ console.log(item, '--------------------')
|
|
|
+ this.form.estTransPrice += parseFloat(item.prodNum) * parseFloat(item.prodPrice)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getProductData(busId) {
|
|
|
+ const { data } = await businessApi.getProductByBusinessId({ id: busId })
|
|
|
+ if (data) {
|
|
|
+ this.productData = data
|
|
|
+ }
|
|
|
+ },
|
|
|
// 上传文件
|
|
|
setDashooParamFile(res) {
|
|
|
// 如果上传成功
|
|
|
- if (res.Code == 200) {
|
|
|
+ if (res.Code === 200) {
|
|
|
this.form.dashooParamFile = res.Data
|
|
|
} else {
|
|
|
this.$message.error('上传文件失败')
|
|
|
@@ -379,95 +460,137 @@
|
|
|
},
|
|
|
setQuotationFile(res) {
|
|
|
// 如果上传成功
|
|
|
- if (res.Code == 200) {
|
|
|
+ if (res.Code === 200) {
|
|
|
this.form.quotationFile = res.Data
|
|
|
} else {
|
|
|
this.$message.error('上传文件失败')
|
|
|
}
|
|
|
},
|
|
|
- handleSelectContact() {
|
|
|
- if (!this.queryContact.custId) {
|
|
|
+ handleSelectCustomerContact() {
|
|
|
+ if (!this.queryCustomerContact.custId) {
|
|
|
this.$message.warning('请先选择客户')
|
|
|
return
|
|
|
}
|
|
|
- this.$refs.selectContact.open()
|
|
|
+ this.$refs.selectCustomerContact.open()
|
|
|
},
|
|
|
- selectContact(val) {
|
|
|
+ selectCustomerContact(val) {
|
|
|
if (val && val.length > 0) {
|
|
|
- this.form.makerId = val[0].id
|
|
|
- this.form.makerName = val.map((item) => item.cuctName)
|
|
|
- this.form.makerDept = val.map((item) => item.makerDept)
|
|
|
- this.form.makerPost = val.map((item) => item.postion)
|
|
|
- this.form.makerTelephone = val.map((item) => item.telephone)
|
|
|
+ this.form.contactId = val[0].id
|
|
|
+ this.form.contactName = val.map((item) => item.cuctName).join()
|
|
|
+ this.form.contactPostion = val.map((item) => item.postion).join()
|
|
|
+ this.form.contactTelephone = val.map((item) => {
|
|
|
+ if (item.telephone !== '' && item.wechat !== '') {
|
|
|
+ return item.telephone + '/' + item.wechat
|
|
|
+ }
|
|
|
+ if (item.telephone !== '') {
|
|
|
+ return item.telephone
|
|
|
+ }
|
|
|
+ if (item.wechat !== '') {
|
|
|
+ return item.wechat
|
|
|
+ }
|
|
|
+ }).join()
|
|
|
}
|
|
|
},
|
|
|
- handleSelectDistributor() {
|
|
|
- this.$refs.selectDistributor.open()
|
|
|
+ handleSelectDistributorContact() {
|
|
|
+ this.$refs.selectDistributorContact.open()
|
|
|
},
|
|
|
- selectDistributor(val) {
|
|
|
+ selectDistributorContact(val) {
|
|
|
if (val && val.length > 0) {
|
|
|
- this.form.distributorId = val[0].id
|
|
|
- this.form.distributorName = val.map((item) => item.distName).join()
|
|
|
+ this.form.dealerSalesId = val[0].id
|
|
|
+ this.form.dealerSalesName = val.map((item) => item.name).join()
|
|
|
+ this.form.dealerSalesContact = val
|
|
|
+ .map((item) => {
|
|
|
+ if (item.phone !== '' && item.wechat !== '') {
|
|
|
+ return item.phone + '/' + item.wechat
|
|
|
+ }
|
|
|
+ if (item.phone !== '') {
|
|
|
+ return item.phone
|
|
|
+ }
|
|
|
+ if (item.wechat !== '') {
|
|
|
+ return item.wechat
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .join()
|
|
|
}
|
|
|
},
|
|
|
// 业务调级(升级、降级)
|
|
|
handleClick(type) {
|
|
|
+ this.form.id = this.busId
|
|
|
+ this.form = Object.assign(this.form, this.businessInfo)
|
|
|
if (type === 'up') {
|
|
|
this.title = '升级'
|
|
|
+ if (this.form.nboType === '50') {
|
|
|
+ this.form.nboType = '30'
|
|
|
+ }
|
|
|
+ if (this.form.nboType === '30') {
|
|
|
+ this.form.nboType = '20'
|
|
|
+ }
|
|
|
+ if (this.form.nboType === '20') {
|
|
|
+ this.form.nboType = '10'
|
|
|
+ }
|
|
|
}
|
|
|
if (type === 'down') {
|
|
|
this.title = '降级'
|
|
|
+ if (this.form.nboType === '30') {
|
|
|
+ this.form.nboType = '50'
|
|
|
+ }
|
|
|
+ if (this.form.nboType === '20') {
|
|
|
+ this.form.nboType = '30'
|
|
|
+ }
|
|
|
+ if (this.form.nboType === '10') {
|
|
|
+ this.form.nboType = '20'
|
|
|
+ }
|
|
|
}
|
|
|
this.type = type
|
|
|
- this.form.id = this.busId
|
|
|
- this.form = Object.assign(this.form, this.businessInfo)
|
|
|
- this.form.nboType = undefined
|
|
|
this.form.isAdoptDashoo = '20'
|
|
|
this.customerInfo = { custId: this.form.custId, custName: this.form.custName }
|
|
|
- this.queryContact = { custId: this.form.custId, isDecision: '10' }
|
|
|
+ this.queryCustomerContact = { custId: this.form.custId, isDecision: '10' }
|
|
|
+ this.distInfo = { distId: this.form.distributorId, distName: this.form.distributorName }
|
|
|
+ this.queryDistContact = { distId: this.form.distributorId }
|
|
|
+ this.productData = this.form.products || []
|
|
|
+ if (this.form.quotationFileList) {
|
|
|
+ this.quotationFileList = this.form.quotationFileList.map((item) => {
|
|
|
+ this.form.quotationFile = item.fileUrl
|
|
|
+ return { name: item.fileName, url: item.fileUrl }
|
|
|
+ })
|
|
|
+ }
|
|
|
this.dialogFormVisible = true
|
|
|
+ this.$nextTick(() => this.$refs['form'].clearValidate())
|
|
|
},
|
|
|
open(row) {
|
|
|
this.form.id = row.id
|
|
|
this.form = Object.assign(this.form, row)
|
|
|
this.dialogFormVisible = true
|
|
|
this.loading = false
|
|
|
+ this.$refs['form'].clearValidate()
|
|
|
},
|
|
|
close() {
|
|
|
this.$refs['form'].resetFields()
|
|
|
+ this.$refs['form'].clearValidate()
|
|
|
this.form = this.$options.data().form
|
|
|
+ this.productData = []
|
|
|
+ this.quotationFileList = []
|
|
|
+ this.dashooParamFileList = []
|
|
|
this.dialogFormVisible = false
|
|
|
this.loading = false
|
|
|
},
|
|
|
save() {
|
|
|
+ this.form.products = this.productData
|
|
|
this.$refs['form'].validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
this.$baseConfirm('你确定要对当前项目' + this.title + '吗', null, async () => {
|
|
|
this.loading = true
|
|
|
+ let err, res
|
|
|
if (this.type === 'up') {
|
|
|
- // if (this.form.nboType === '10' || this.form.nboType === '20') {
|
|
|
- // const [err, res] = await to(businessApi.BusinessUpgradeAorB(this.form))
|
|
|
- // if (err) {
|
|
|
- // this.$baseMessage(res.msg, 'error')
|
|
|
- // } else {
|
|
|
- // this.$baseMessage(res.msg, 'success')
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- const [err, res] = await to(businessApi.businessUpgrade(this.form))
|
|
|
- if (err) {
|
|
|
- this.$baseMessage(res.msg, 'error')
|
|
|
- } else {
|
|
|
- this.$baseMessage(res.msg, 'success')
|
|
|
- }
|
|
|
- // }
|
|
|
+ ;[err, res] = await to(businessApi.businessUpgrade(this.form))
|
|
|
}
|
|
|
if (this.type === 'down') {
|
|
|
- const [err, res] = await to(businessApi.businessDowngrade(this.form))
|
|
|
- if (err) {
|
|
|
- this.$baseMessage(res.msg, 'error')
|
|
|
- } else {
|
|
|
- this.$baseMessage(res.msg, 'success')
|
|
|
- }
|
|
|
+ ;[err, res] = await to(businessApi.businessDowngrade(this.form))
|
|
|
+ }
|
|
|
+ if (err) {
|
|
|
+ this.$baseMessage(res.msg, 'error')
|
|
|
+ } else {
|
|
|
+ this.$baseMessage(res.msg, 'success')
|
|
|
}
|
|
|
this.loading = false
|
|
|
this.$emit('fetch-data')
|
|
|
@@ -483,4 +606,8 @@
|
|
|
.el-form-item--small.el-form-item {
|
|
|
margin-bottom: 10px;
|
|
|
}
|
|
|
+
|
|
|
+ .el-col-8 {
|
|
|
+ height: 75px;
|
|
|
+ }
|
|
|
</style>
|