This commit is contained in:
beyond 2019-05-23 10:14:48 +08:00
parent 3d046c1895
commit a4bc228490
3 changed files with 599 additions and 26 deletions

View file

@ -9,12 +9,12 @@
<el-row>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.title')" style="width: 100%;">
<el-input v-model="personalForm.title" style="margin-left: 18px" clearable/>
<el-input v-model="personalForm.title" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('ProduceTask.sourceType')" prop="sourceType" style="width: 100%;">
<el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 218px" @change="chooseType">
<el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 200px" @change="chooseSource">
<el-option value="1" label="无来源" />
<el-option value="2" label="销售机会" />
</el-select>
@ -22,12 +22,13 @@
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleReturn.sourceNumber')" style="width: 100%;">
<el-input v-model="personalForm.sourceNumber" :disabled="IsNumber" style="margin-left: 18px" clearable/>
<el-input v-model="personalForm.sourceNumber" :disabled="IsNumber" style="margin-left: 18px;width: 200px" @focus="openoppo"/>
<my-opportunity :opportunitycontrol.sync="opportunitycontrol" @opportunityDetail="opportunityDetail" @opportunity="opportunity"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.customerType')" prop="customerType" style="width: 100%;">
<el-select v-model="personalForm.customerType" style="margin-left: 18px;width: 218px" @change="clearCustomer">
<el-select v-model="personalForm.customerType" style="margin-left: 18px;width: 200px" @change="clearCustomer">
<el-option value="1" label="经销商"/>
<el-option value="2" label="零售"/>
</el-select>
@ -35,19 +36,19 @@
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.customerName')" prop="customerId" style="width: 100%;">
<el-input v-model="customerId" style="margin-left: 18px;width: 218px" @focus="chooseCustomer"/>
<el-input v-model="customerId" style="margin-left: 18px;width: 200px" @focus="chooseCustomer"/>
<my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
<my-agent :agentcontrol.sync="agentcontrol" @agentdata="agentdata"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.customerPhone')" style="width: 100%;">
<el-input v-model="personalForm.customerPhone" style="margin-left: 18px" clearable/>
<el-input v-model="personalForm.customerPhone" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.invoiceType')" style="width: 100%;">
<el-select v-model="personalForm.invoiceType" style="margin-left: 18px;width: 218px">
<el-select v-model="personalForm.invoiceType" style="margin-left: 18px;width: 200px">
<el-option
v-for="(item, index) in invoiceTypes"
:value="item.id"
@ -59,7 +60,7 @@
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.payMode')" style="width: 100%;">
<el-select v-model="personalForm.payMode" style="margin-left: 18px;width: 218px">
<el-select v-model="personalForm.payMode" style="margin-left: 18px;width: 200px">
<el-option value="1" label="货到付款"/>
<el-option value="2" label="当场支付"/>
</el-select>
@ -72,28 +73,28 @@
:picker-options="pickerOptions1"
type="date"
value-format="yyyy-MM-dd"
style="margin-left: 18px"/>
style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.salePersonId')" prop="salePersonId" style="width: 100%;">
<el-input v-model="salePersonId" style="margin-left: 18px" @focus="handlechooseStock"/>
<el-input v-model="salePersonId" style="margin-left: 18px;width: 200px" @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.saleRepositoryId')" style="width: 100%;">
<el-input v-model="saleRepositoryId" style="margin-left: 18px;width: 218px" disabled/>
<el-input v-model="saleRepositoryId" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.roleId')" style="width: 100%;">
<el-input v-model="roleId" style="margin-left: 18px;width: 218px" disabled/>
<el-input v-model="roleId" style="margin-left: 18px;width: 200px" disabled/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.saleType')" style="width: 100%;">
<el-select v-model="personalForm.saleType" style="margin-left: 18px;width: 218px">
<el-select v-model="personalForm.saleType" style="margin-left: 18px;width: 200px">
<el-option value="1" label="类别1"/>
<el-option value="2" label="类别2"/>
</el-select>
@ -101,7 +102,7 @@
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.payType')" style="width: 100%;">
<el-select v-model="personalForm.payType" style="margin-left: 18px;width: 218px">
<el-select v-model="personalForm.payType" style="margin-left: 18px;width: 200px">
<el-option value="1" label="方式1"/>
<el-option value="2" label="方式2"/>
</el-select>
@ -109,7 +110,7 @@
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.currency')" style="width: 100%;">
<el-select v-model="personalForm.currency" style="margin-left: 18px;width: 218px">
<el-select v-model="personalForm.currency" style="margin-left: 18px;width: 200px">
<el-option value="1" label="RMB"/>
<el-option value="2" label="USD"/>
</el-select>
@ -117,17 +118,17 @@
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.transAddress')" style="width: 100%;">
<el-input v-model="personalForm.transAddress" style="margin-left: 18px;width: 218px"/>
<el-input v-model="personalForm.transAddress" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.receiveMoney')" style="width: 100%;">
<el-input v-model="personalForm.receiveMoney" style="margin-left: 18px;width: 218px"/>
<el-input v-model="personalForm.receiveMoney" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.colseType')" style="width: 100%;">
<el-select v-model="personalForm.colseType" style="margin-left: 18px;width: 218px">
<el-select v-model="personalForm.colseType" style="margin-left: 18px;width: 200px">
<el-option
v-for="(item, index) in colseTypes"
:value="item.id"
@ -144,7 +145,7 @@
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" >订单明细</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button @click="handleAddproduct">添加商品</el-button>
<el-button :disabled="Isproduct" @click="chooseType">添加商品</el-button>
<my-detail :control.sync="control" @product="productdetail"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
</div>
@ -331,7 +332,7 @@
<el-row>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.backType')" prop="backType" style="width: 100%;">
<el-select v-model="personalForm.backType" style="margin-left: 18px;width: 218px" disabled>
<el-select v-model="personalForm.backType" style="margin-left: 18px;width: 200px" disabled>
<el-option value="1" label="已回款"/>
<el-option value="2" label="未回款"/>
</el-select>
@ -344,7 +345,7 @@
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.sendType')" style="width: 100%;">
<el-select v-model="personalForm.sendType" style="margin-left: 18px;width: 218px" disabled>
<el-select v-model="personalForm.sendType" style="margin-left: 18px;width: 200px" disabled>
<el-option value="1" label="已发货"/>
<el-option value="2" label="未发货"/>
</el-select>
@ -370,13 +371,14 @@ import MyEmp from './components/MyEmp'
import MyDelivery from '../DailyAdjust/components/MyDelivery'
import MyDetail from './components/MyDetail'
import MyApply from './components/MyApply'
import MyOpportunity from './components/MyOpportunity'
import MySupplier from '../Product/components/MySupplier'
import MyRequire from './components/MyRequire'
import MyCustomer from './components/MyCustomer'
import MyAgent from './components/MyAgent'
export default {
name: 'AddSaleOrder',
components: { MyAgent, MyCustomer, MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp },
components: { MyAgent, MyCustomer, MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp, MyOpportunity },
data() {
const validatePass = (rule, value, callback) => {
console.log(this.supplierId)
@ -386,6 +388,13 @@ export default {
callback()
}
}
const validatePass2 = (rule, value, callback) => {
if (this.customerId === undefined || this.customerId === null || this.customerId === '') {
callback(new Error('请选择客户'))
} else {
callback()
}
}
return {
pickerOptions1: {
disabledDate: (time) => {
@ -418,10 +427,16 @@ export default {
agentcontrol: false,
//
choosedata: [],
//
opportunitycontrol: false,
//
Isproduct: true,
//
salePersonId: '',
//
stockControl: false,
//
IsNumber: true,
//
invoiceTypes: [],
//
@ -440,6 +455,8 @@ export default {
},
//
control: false,
//
addpro: true,
//
personalForm: {
createPersonId: this.$store.getters.userId,
@ -452,10 +469,14 @@ export default {
sendType: '2',
currency: '1',
transDate: null,
sourceType: '1'
sourceType: '1',
otherMoney: '0.00'
},
//
personalrules: {
customerId: [
{ required: true, validator: validatePass2, trigger: 'change' }
],
customerType: [
{ required: true, message: '请选择客户类别', trigger: 'change' }
],
@ -483,6 +504,63 @@ export default {
this.getdatatime()
},
methods: {
//
opportunityDetail(val) {
console.log(val)
const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) {
if (val[i].sourceNumber === nowlistdata[j].sourceNumber) {
// this.$notify.error({
// title: '',
// message: '',
// offset: 100
// })
return false
}
}
this.$refs.editable.insert(val[i])
}
},
opportunity(val) {
console.log(val)
if (val.customerType !== null && val.customerType !== undefined && val.customerType !== '') {
this.personalForm.customerType = String(val.customerType)
}
// this.personalForm.customerId = val.customerId
// this.customerId = val.customerName
// this.personalForm.customerPhone = val.customerPhone
this.personalForm.sourceNumber = val.opportunityNumber
this.personalForm.salePersonId = val.handlePersonId
this.salePersonId = val.handlePersonName
this.personalForm.handleRepositoryId = val.handleRepositoryId
this.handleRepositoryId = val.handleRepositoryName
},
openoppo() {
if (this.personalForm.sourceType === '2') {
this.opportunitycontrol = true
}
},
//
chooseSource(val) {
if (val === '2') {
this.Isproduct = true
this.IsNumber = false
this.$refs.editable.clear()
} else if (val === '1') {
this.Isproduct = false
this.IsNumber = true
this.$refs.editable.clear()
}
},
//
chooseType() {
this.control = true
},
//
handleAddSouce() {
this.arrivalcontrol = true
},
getdatatime() { //
this.personalForm.transDate = new Date()
},
@ -514,6 +592,7 @@ export default {
sums[6] = ''
sums[8] = ''
sums[9] = ''
sums[23] = ''
this.heji1 = sums[10]
this.heji2 = sums[18]
this.heji3 = sums[15]

View file

@ -11,6 +11,20 @@
<el-input v-model="personalForm.title" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('ProduceTask.sourceType')" prop="sourceType" style="width: 100%;">
<el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 200px" @change="chooseSource">
<el-option value="1" label="无来源" />
<el-option value="2" label="销售机会" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.sourceNumber')" style="width: 100%;">
<el-input v-model="personalForm.sourceNumber" :disabled="IsNumber" style="margin-left: 18px;width: 200px" @focus="openoppo"/>
<my-opportunity :opportunitycontrol.sync="opportunitycontrol" @opportunityDetail="opportunityDetail" @opportunity="opportunity"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.customerType')" prop="customerType" style="width: 100%;">
<el-select v-model="personalForm.customerType" style="margin-left: 18px;width: 200px" @change="clearCustomer">
@ -129,7 +143,7 @@
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" >订单明细</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button @click="handleAddproduct">添加商品</el-button>
<el-button :disabled="Isproduct" @click="handleAddproduct">添加商品</el-button>
<my-detail :control.sync="control" @product="productdetail"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
</div>
@ -355,8 +369,9 @@ import MySupplier from '../../Product/components/MySupplier'
import MyRequire from './MyRequire'
import MyCustomer from './MyCustomer'
import MyAgent from './MyAgent'
import MyOpportunity from './MyOpportunity'
export default {
components: { MyAgent, MyCustomer, MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp },
components: { MyAgent, MyCustomer, MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp, MyOpportunity },
props: {
editcontrol: {
type: Boolean,
@ -393,6 +408,8 @@ export default {
heji7: '',
heji8: '',
heji9: '',
//
Isproduct: true,
//
customerId: '',
//
@ -412,12 +429,16 @@ export default {
},
//
colseTypes: [],
//
IsNumber: true,
//
colseTypeparms: {
type: 3,
pagenum: 1,
pagesize: 99999
},
//
opportunitycontrol: false,
//
control: false,
//
@ -455,15 +476,70 @@ export default {
this.personalForm = this.editdata
this.planPersonId = this.personalForm.planPersonName
this.stockPersonId = this.personalForm.stockPersonName
this.salePersonId = this.personalForm.salePersonName
this.customerId = this.personalForm.customerName
this.list2 = this.personalForm.saleOrderDetailVos
this.list3 = this.personalForm.saleOrderCostDetails
this.chooseType()
this.chooseSource(this.personalForm.sourceType)
}
},
created() {
this.getTypes()
},
methods: {
//
opportunityDetail(val) {
console.log(val)
const nowlistdata = this.$refs.editable.getRecords()
for (let i = 0; i < val.length; i++) {
for (let j = 0; j < nowlistdata.length; j++) {
if (val[i].sourceNumber === nowlistdata[j].sourceNumber) {
// this.$notify.error({
// title: '',
// message: '',
// offset: 100
// })
return false
}
}
this.$refs.editable.insert(val[i])
}
},
opportunity(val) {
console.log(val)
if (val.customerType !== null && val.customerType !== undefined && val.customerType !== '') {
this.personalForm.customerType = String(val.customerType)
}
// this.personalForm.customerId = val.customerId
// this.customerId = val.customerName
// this.personalForm.customerPhone = val.customerPhone
this.personalForm.sourceNumber = val.opportunityNumber
this.personalForm.salePersonId = val.handlePersonId
this.salePersonId = val.handlePersonName
this.personalForm.handleRepositoryId = val.handleRepositoryId
this.handleRepositoryId = val.handleRepositoryName
},
openoppo() {
if (this.personalForm.sourceType === '2') {
this.opportunitycontrol = true
}
},
//
chooseSource(val) {
if (val === '2') {
this.Isproduct = true
this.IsNumber = false
this.$refs.editable.clear()
} else if (val === '1') {
this.Isproduct = false
this.IsNumber = true
this.$refs.editable.clear()
}
},
//
handleAddSouce() {
this.arrivalcontrol = true
},
//
getSummaries(param) {
const { columns, data } = param

View file

@ -0,0 +1,418 @@
<template>
<el-dialog :visible.sync="employeeVisible" :opportunitycontrol="opportunitycontrol" :close-on-press-escape="false" top="10px" title="选择销售机会单" append-to-body width="1100px" @close="$emit('update:opportunitycontrol', false)">
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
<el-row>
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
<el-col :span="4">
<el-form-item>
<el-input v-model="getemplist.title" :placeholder="$t('SaleOpportunity.title')" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 5px">
<el-form-item>
<el-input v-model="getemplist.opportunityNumber" placeholder="机会单号" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<el-form-item>
<el-select v-model="getemplist.opportunityType" :value="getemplist.opportunityType" clearable @keyup.enter.native="handleFilter">
<el-option value="1" label="机会1"/>
</el-select>
</el-form-item>
</el-col>
<!--更多搜索条件-->
<el-col :span="3" style="margin-left: 30px">
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="manual">
<el-select v-model="getemplist.customerType" :placeholder="$t('SaleOpportunity.customerType')" clearable style="width: 40%;float: left;margin-left: 20px">
<el-option value="1" label="经销商"/>
<el-option value="2" label="零售"/>
</el-select>
<el-input v-model="customerName" :placeholder="$t('SaleOpportunity.customerName')" style="width: 40%;float: right;margin-right: 20px;" clearable @focus="chooseCustomer"/>
<my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
<my-agent :agentcontrol.sync="agentcontrol" @agentdata="agentdata"/>
<!--<el-select v-model="getemplist.receiptStat" :value="getemplist.receiptStat" placeholder="单据状态" clearable style="width: 40%;float: left;margin-left: 20px;margin-top: 20px">-->
<!--<el-option value="1" label="制单"/>-->
<!--<el-option value="2" label="执行"/>-->
<!--<el-option value="3" label="结单"/>-->
<!--</el-select>-->
<!--<el-select v-model="getemplist.judgeStat" :value="getemplist.judgeStat" placeholder="审批状态" clearable style="width: 40%;float: right;margin-right: 20px;margin-top: 20px">-->
<!--<el-option value="0" label="未审核"/>-->
<!--<el-option value="1" label="审核中"/>-->
<!--<el-option value="2" label="审核通过"/>-->
<!--<el-option value="3" label="审核不通过"/>-->
<!--</el-select>-->
<!--<el-date-picker-->
<!--v-model="date"-->
<!--type="daterange"-->
<!--range-separator="-"-->
<!--unlink-panels-->
<!--start-placeholder="销售日期"-->
<!--end-placeholder="销售日期"-->
<!--value-format="yyyy-MM-dd"-->
<!--style="margin-top: 20px;margin-left: 20px"/>-->
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
<el-button v-waves class="filter-item" type="primary" style="float: right" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</div>
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px" @click="visible2 = !visible2">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
</el-popover>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<!-- 搜索按钮 -->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</el-col>
<el-col :span="3">
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button>
</el-col>
</el-form>
</el-row>
</el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
:key="tableKey"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@current-change="handleCurrentChange">
<el-table-column :label="$t('public.id')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.opportunityNumber }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleOpportunity.title')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.title }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleOpportunity.customerName')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.customerName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleOpportunity.customerPhone')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.customerPhone }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleOpportunity.opportunityType')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.opportunityTypeName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleOpportunity.opportunitySource')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.opportunitySourceName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleOpportunity.handlePersonId')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.handlePersonName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleOpportunity.isSale')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.isSale | isSaleFilter }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pageNum" :limit.sync="getemplist.pageSize" @pagination="getlist" />
<!--修改开始=================================================-->
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-bottom: 10px" @click="handleConfirm">确认添加</el-button>
</el-card>
</el-dialog>
</template>
<script>
import { saleopportunitylist } from '@/api/SaleOpportunity'
import { getdeptlist } from '@/api/BasicSettings'
import { searchStockCategory } from '@/api/StockCategory'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination'
import MyEmp from './MyEmp'
import MyCustomer from './MyCustomer'
import MyAgent from './MyAgent'
export default {
directives: { waves },
components: { MyEmp, MyCustomer, MyAgent, Pagination },
filters: {
judgeStatFilter(status) {
const statusMap = {
0: '未审核',
1: '审核中',
2: '审核通过',
3: '审核不通过'
}
return statusMap[status]
},
receiptStatFilter(status) {
const statusMap = {
1: '制单',
2: '执行',
3: '结单'
}
return statusMap[status]
},
stockTypeFilter(status) {
const statusMap = {
1: '采购1'
}
return statusMap[status]
},
isSaleFilter(status) {
const statusMap = {
1: '跟进中',
2: '销售成功'
}
return statusMap[status]
}
},
props: {
opportunitycontrol: {
type: Boolean,
default: false
}
},
data() {
return {
//
employeeVisible: this.opportunitycontrol,
//
customerName: '',
//
customercontrol: false,
agentcontrol: false,
//
typeparms: {
pagenum: 1,
pagesize: 99999
},
//
types: [],
//
depts: [],
//
reviewParms: {
id: '',
judgePersonId: '',
judgeStat: ''
},
//
detailvisible: false,
//
visible2: false,
//
supplierId: '',
//
empcontrol: false,
//
stockPersonId: '',
//
stockControl: false,
//
moreaction: '',
//
downloadLoading: false,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
pageNum: 1,
pageSize: 10,
isUse: 1,
repositoryId: this.$store.getters.repositoryId,
regionIds: this.$store.getters.regionId
},
//
personalForm: {},
//
editVisible: false,
//
date: []
}
},
watch: {
opportunitycontrol() {
this.employeeVisible = this.opportunitycontrol
}
},
created() {
this.getlist()
},
methods: {
//
clearCustomer() {
this.getemplist.customerId = ''
this.customerName = ''
},
// focus
chooseCustomer() {
if (this.getemplist.customerType === '1') {
this.agentcontrol = true
} else if (this.getemplist.customerType === '2') {
this.customercontrol = true
}
},
customerdata(val) {
this.getemplist.customerId = val.id
this.customerName = val.customerName
},
agentdata(val) {
this.getemplist.customerId = val.id
this.customerName = val.agentName
},
//
updatecountry() {
this.getlist()
},
getlist() {
//
this.listLoading = true
saleopportunitylist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
//
getdeptlist().then(res => {
if (res.data.ret === 200) {
this.depts = res.data.data.content
}
})
//
searchStockCategory(this.typeparms).then(res => {
if (res.data.ret === 200) {
this.types = res.data.data.content.list
}
})
},
//
restFilter() {
this.customerName = ''
this.getemplist.customerId = ''
this.stockPersonId = ''
this.getemplist.stockPersonId = ''
},
//
handleFilter() {
this.getemplist.pageNum = 1
saleopportunitylist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
this.restFilter()
} else {
this.restFilter()
}
})
},
// focus
handlechooseStock() {
this.stockControl = true
},
//
stockName(val) {
this.stockPersonId = val.personName
this.getemplist.stockPersonId = val.id
},
// focus
handlechoose() {
this.empcontrol = true
},
//
supplierName(val) {
console.log(val)
this.supplierId = val.supplierName
this.getemplist.supplierId = val.id
},
//
handleAdd() {
this.$router.push('/SaleOpportunity/AddSaleOpportunity')
},
//
handleCurrentChange(val) {
this.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
console.log(this.choosedata)
const opportunitydata = this.choosedata.saleOpportunityDetailVos
const opportunityNumber = this.choosedata.opportunityNumber
const opportunityDetail = opportunitydata.map(function(item) {
return {
productCode: item.productCode,
productName: item.productName,
productCategory: item.categoryId,
Categoryid: item.productCategory,
category: item.categoryId,
unit: item.unit,
productType: item.typeId,
typeId: item.productType,
type: item.typeId,
color: item.color,
kpiGrade: item.kpiGrade,
point: item.point,
quantity: 0,
salePrice: '0.00',
costPrice: '0.00',
taxprice: '0.00',
costMoney: '0.00',
includeTaxMoney: '0.00',
taxRate: '0.00',
taxMoney: '0.00',
money: '0.00',
includeTaxCostMoney: '0.00',
discount: '0.00',
discountMoney: '0.00',
carCode: 0,
motorCode: 0,
batteryCode: 0,
sourceNumber: opportunityNumber,
alreadyApplicationQuantity: 0,
alreadyProduceQuantity: 0
}
})
this.$emit('opportunityDetail', opportunityDetail)
this.$emit('opportunity', this.choosedata)
}
//
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 140px;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 30px;
}
.container{
margin-top: 2%;
border: 1px solid #eceff6;
}
</style>