|
@@ -6,7 +6,7 @@
|
|
|
<el-step title="跟进日程" />
|
|
<el-step title="跟进日程" />
|
|
|
</el-steps>
|
|
</el-steps>
|
|
|
|
|
|
|
|
- <el-form ref="form" label-width="120px" :model="form" :rules="rules">
|
|
|
|
|
|
|
+ <el-form ref="form" :model="form" :rules="rules">
|
|
|
<el-row v-if="activeSteps === 1" :gutter="20">
|
|
<el-row v-if="activeSteps === 1" :gutter="20">
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item label="项目名称" prop="nboName">
|
|
<el-form-item label="项目名称" prop="nboName">
|
|
@@ -15,7 +15,7 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item label="关联客户" prop="custName">
|
|
<el-form-item label="关联客户" prop="custName">
|
|
|
- <el-input v-model="form.custName" readonly @focus="handleSelectCustomer" />
|
|
|
|
|
|
|
+ <el-input v-model="form.custName" :disabled="custInfo.custName" readonly @focus="handleSelectCustomer" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
@@ -136,7 +136,7 @@
|
|
|
<script>
|
|
<script>
|
|
|
import businessApi from '@/api/proj/business'
|
|
import businessApi from '@/api/proj/business'
|
|
|
import ProductTable from './ProductTable'
|
|
import ProductTable from './ProductTable'
|
|
|
- import SelectContact from '@/components/select/SelectContact'
|
|
|
|
|
|
|
+ import SelectContact from '@/components/select/SelectCustomerContact'
|
|
|
import SelectCustomer from '@/components/select/SelectCustomer'
|
|
import SelectCustomer from '@/components/select/SelectCustomer'
|
|
|
import SelectUser from '@/components/select/SelectUser'
|
|
import SelectUser from '@/components/select/SelectUser'
|
|
|
import SelectDistributor from '@/components/select/SelectDistributor'
|
|
import SelectDistributor from '@/components/select/SelectDistributor'
|
|
@@ -145,6 +145,15 @@
|
|
|
export default {
|
|
export default {
|
|
|
name: 'BusinessEdit',
|
|
name: 'BusinessEdit',
|
|
|
components: { ProductTable, SelectContact, SelectProduct, SelectDistributor, SelectCustomer, SelectUser },
|
|
components: { ProductTable, SelectContact, SelectProduct, SelectDistributor, SelectCustomer, SelectUser },
|
|
|
|
|
+ props: {
|
|
|
|
|
+ // 客户信息{ custId: id, custName: custName}
|
|
|
|
|
+ custInfo: {
|
|
|
|
|
+ type: Object,
|
|
|
|
|
+ default() {
|
|
|
|
|
+ return {}
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
const validateDistributor = (rule, value, callback) => {
|
|
const validateDistributor = (rule, value, callback) => {
|
|
|
if ('' === value && this.form.salesModel !== '10')
|
|
if ('' === value && this.form.salesModel !== '10')
|
|
@@ -199,6 +208,13 @@
|
|
|
productData: [],
|
|
productData: [],
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ custInfo: function (val) {
|
|
|
|
|
+ this.form.custId = val.custId
|
|
|
|
|
+ this.form.custName = val.custName
|
|
|
|
|
+ this.customerInfo = val
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
created() {},
|
|
created() {},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.getDicts('proj_nbo_source').then((response) => {
|
|
this.getDicts('proj_nbo_source').then((response) => {
|
|
@@ -216,12 +232,9 @@
|
|
|
this.activeSteps++
|
|
this.activeSteps++
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (this.activeSteps === 2) {
|
|
|
|
|
|
|
+ } else if (this.activeSteps === 2) {
|
|
|
this.form.products = this.productData
|
|
this.form.products = this.productData
|
|
|
this.activeSteps++
|
|
this.activeSteps++
|
|
|
- return
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
handleSelectCustomer() {
|
|
handleSelectCustomer() {
|
|
@@ -281,13 +294,13 @@
|
|
|
this.form.followUserName = val.map((item) => item.userName).join()
|
|
this.form.followUserName = val.map((item) => item.userName).join()
|
|
|
},
|
|
},
|
|
|
selectProduct(data) {
|
|
selectProduct(data) {
|
|
|
- console.log(data)
|
|
|
|
|
let projData = data.map((item) => ({
|
|
let projData = data.map((item) => ({
|
|
|
prodId: item.id,
|
|
prodId: item.id,
|
|
|
prodCode: item.prodCode,
|
|
prodCode: item.prodCode,
|
|
|
prodName: item.prodName,
|
|
prodName: item.prodName,
|
|
|
prodClass: item.prodClass,
|
|
prodClass: item.prodClass,
|
|
|
- prodPrice: item.guidPrice,
|
|
|
|
|
|
|
+ guidPrice: item.guidPrice,
|
|
|
|
|
+ prodPrice: item.marketPrice,
|
|
|
prodNum: 1,
|
|
prodNum: 1,
|
|
|
}))
|
|
}))
|
|
|
this.productData.push(...projData)
|
|
this.productData.push(...projData)
|
|
@@ -334,8 +347,13 @@
|
|
|
save() {
|
|
save() {
|
|
|
this.$refs['form'].validate(async (valid) => {
|
|
this.$refs['form'].validate(async (valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- const { msg } = await businessApi.doAdd(this.form)
|
|
|
|
|
- this.$baseMessage(msg, 'success')
|
|
|
|
|
|
|
+ let res
|
|
|
|
|
+ if (this.form.id) {
|
|
|
|
|
+ res = await businessApi.doEdit(this.form)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ res = await businessApi.doAdd(this.form)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$baseMessage(res.msg, 'success')
|
|
|
this.$emit('fetch-data')
|
|
this.$emit('fetch-data')
|
|
|
this.close()
|
|
this.close()
|
|
|
} else {
|
|
} else {
|