|
@@ -0,0 +1,583 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-drawer
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="drawer"
|
|
|
+ size="600px"
|
|
|
+ direction="rtl"
|
|
|
+ append-to-body
|
|
|
+ :show-close="false"
|
|
|
+ @close="onClose">
|
|
|
+ <div class="drawer__panel" style="margin-bottom: 0px">
|
|
|
+ <el-row style="margin-top: 10px" :gutter="10">
|
|
|
+ <el-form :model="form" :rules="rules" ref="form" size="mini" label-position="right">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="报价类型:" label-width="100px" >
|
|
|
+ <el-input v-model="form.type" autocomplete="off" placeholder="报价类型" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="isQuotedPrice">
|
|
|
+ <el-form-item label="项目名称:" label-width="100px" prop="projectname">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ width="700"
|
|
|
+ trigger="click"
|
|
|
+ v-model="projectShow"
|
|
|
+ @show="projectList">
|
|
|
+ <selectTemplate type="项目" ref="projectTemplate" :param="projectParam" @selectData="projectData"></selectTemplate>
|
|
|
+ <el-input slot="reference" :readonly="true" v-model="form.projectname" autocomplete="off" placeholder="请选择项目" ></el-input>
|
|
|
+ </el-popover>
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="isQuotedPrice">
|
|
|
+ <el-form-item label="项目编号:" label-width="100px" >
|
|
|
+ <el-input v-model="form.projectnum" autocomplete="off" placeholder="项目编号" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="isQuotedPrice">
|
|
|
+ <el-form-item label="客户名称:" label-width="100px" prop="enterprisename">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ width="700"
|
|
|
+ trigger="click"
|
|
|
+ v-model="customerShow"
|
|
|
+ @show="customerList">
|
|
|
+ <selectTemplate type="客户" ref="customerTemplate" :param="customerParam" @selectData="customerData"></selectTemplate>
|
|
|
+ <el-input slot="reference" :readonly="true" v-model="form.enterprisename" autocomplete="off" placeholder="请选择客户" :disabled="form.sa_projectid === ''" ></el-input>
|
|
|
+ </el-popover>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="客户名称:" label-width="100px" prop="enterprisename" v-if="!isQuotedPrice">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ width="700"
|
|
|
+ trigger="click"
|
|
|
+ v-model="customerShow"
|
|
|
+ @show="customerList">
|
|
|
+ <el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
|
|
|
+ <el-tab-pane label="客户" name="客户">
|
|
|
+ <selectTemplate type="客户" ref="customerTemplate" :param="customerParam" @selectData="customerData"></selectTemplate>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="合作伙伴" name="合作伙伴">
|
|
|
+ <selectTemplate type="客户" ref="distributorTemplate" :param="customerParam" @selectData="distributorData"></selectTemplate>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <el-input slot="reference" :readonly="true" v-model="form.enterprisename" autocomplete="off" placeholder="请选择客户" ></el-input>
|
|
|
+ </el-popover>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="联系人:" label-width="100px" prop="name">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ width="700"
|
|
|
+ trigger="click"
|
|
|
+ v-model="contactsShow"
|
|
|
+ @show="contactsList">
|
|
|
+ <selectTemplate type="联系人" ref="contactTemplate" :param="contactsParam" @selectData="contactsData"></selectTemplate>
|
|
|
+ <el-input slot="reference" :readonly="true" v-model="form.name" autocomplete="off" placeholder="请选择联系人" :disabled="form.sys_enterpriseid === ''" ></el-input>
|
|
|
+ </el-popover>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="联系人手机号:" label-width="100px" >
|
|
|
+ <el-input v-model="form.phonenumber" autocomplete="off" placeholder="手机号" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="电话:" label-width="100px" >
|
|
|
+ <el-input v-model="form.telephone" autocomplete="off" placeholder="电话" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="报价日期:" label-width="100px">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.billdate"
|
|
|
+ style="width: 100%"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择日期"
|
|
|
+ :picker-options="pickerOptions">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="有效期:" label-width="100px" prop="date">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.date"
|
|
|
+ style="width: 100%"
|
|
|
+ type="daterange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ :picker-options="pickerOptions">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" >
|
|
|
+ <el-form-item label="产品系列:" label-width="100px" prop="itemtype">
|
|
|
+ <el-select
|
|
|
+ ref="sle"
|
|
|
+ style="width:100%;"
|
|
|
+ v-model="form.itemtype"
|
|
|
+ multiple
|
|
|
+ placeholder="请选择产品系列"
|
|
|
+ size="mini"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in itemtype"
|
|
|
+ :key="item.index"
|
|
|
+ :label="item.value"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ <span style="float: left">{{ item.value }}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="业务员:" label-width="100px" prop="salername">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ trigger="manual"
|
|
|
+ v-model="salesmanVisible"
|
|
|
+ width="500">
|
|
|
+ <selectSalesman ref="selectSalesman" :radio="true" @onSelect="salesmanChange" @onCancel="salesmanVisible = false"></selectSalesman>
|
|
|
+ <el-input readonly type="text" slot="reference" size="small" @focus="showChange" v-model="form.salername" placeholder="请选择业务员"></el-input>
|
|
|
+ </el-popover>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="备注:" label-width="100px" prop="remarks">
|
|
|
+ <el-input v-model="form.remarks" autocomplete="off" placeholder="请输入备注信息" type="textarea" autosize></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div class="fixed__btn__panel">
|
|
|
+ <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="getSubmit" :loading="loading" class="normal-btn-width">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import quoted_price_product from '../components/quotedPriceProduct'
|
|
|
+import selectSalesman from '../components/selectSalesman'
|
|
|
+import {mapGetters} from "vuex";
|
|
|
+
|
|
|
+import selectTemplate from '@/template/quotation/index.vue'
|
|
|
+export default {
|
|
|
+ name: "ProjectQuotationAdd",
|
|
|
+ props:["drawerShow","typeData"],
|
|
|
+ components:{quoted_price_product,selectSalesman,selectTemplate},
|
|
|
+ data(){
|
|
|
+ var discountrate = (rule,value,callback) =>{
|
|
|
+ if (this.form.discountrate < 0 || this.form.discountrate > 100){
|
|
|
+ callback(new Error('请输入0-100%'))
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ search:'',
|
|
|
+ title:'',
|
|
|
+ projectShow:false,
|
|
|
+ customerShow:false,
|
|
|
+ contactsShow:false,
|
|
|
+ salesmanVisible:false,
|
|
|
+ activeName:'客户',
|
|
|
+ projectParam:{
|
|
|
+ "id": 20221020143503,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 10,
|
|
|
+ "type":1, // 1:我负责的;2:我参与的;3:我下属负责的;4:我下属参与的
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "startdate": "",
|
|
|
+ "enddate": "",
|
|
|
+ "status":"",//跟进中、已成交、已失败
|
|
|
+ "projecttype":"",
|
|
|
+ "stagename":"",
|
|
|
+ "tag":""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ customerParam:{
|
|
|
+ "id": 20220920083901,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 10,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "type":4,
|
|
|
+ "sa_projectid":""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ contactsParam:{
|
|
|
+ "id": "20221022165503",
|
|
|
+ "version": 1,
|
|
|
+ "content": {
|
|
|
+ "sys_enterpriseid":"",
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 10,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "workaddress": 0//0表示人,1表示地址
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ salerParam:{
|
|
|
+ "id":20230306144402,
|
|
|
+ "content":{
|
|
|
+ "type":'',////type:1客户2:项目
|
|
|
+ "sys_enterpriseid":'',//type=1
|
|
|
+ "sa_projectid":'' //type=2时传
|
|
|
+ }
|
|
|
+ },
|
|
|
+ pickerOptions: {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() + 3600 * 1000 * 24 < Date.now() ;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ drawer:false,
|
|
|
+ isQuotedPrice:false,
|
|
|
+ date:[],
|
|
|
+ productObj:{},
|
|
|
+ form:{
|
|
|
+ date:[],
|
|
|
+ totalPrice:'',
|
|
|
+ type:'',
|
|
|
+ projectnum:'',
|
|
|
+ enterprisename:'',
|
|
|
+ name:'',
|
|
|
+ phonenumber:'',
|
|
|
+ fax:'',
|
|
|
+ telephone:'',
|
|
|
+ specialOffer:'否',
|
|
|
+ sa_quotedpriceid:0, //sat_notice_classid<=0时 为新增
|
|
|
+ sys_enterpriseid: "",
|
|
|
+ contactsid:0,
|
|
|
+ sa_projectid: '',
|
|
|
+ discountrate: '',
|
|
|
+ remarks: "",
|
|
|
+ invaliddate: "",
|
|
|
+ projectname: "",
|
|
|
+ address: "",
|
|
|
+ billdate:"",
|
|
|
+ enddate:'',
|
|
|
+ begdate:'',
|
|
|
+ saler_hrid:'',
|
|
|
+ salername:'',
|
|
|
+ itemtype:[],
|
|
|
+ quotedpricenotes: [
|
|
|
+ "1、报价为含税13%税率, 含运费 ",
|
|
|
+ "2、报价有限期 2023-02-02 13:16:47至2023-02-22 13:16:47",
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ rules:{
|
|
|
+ projectname:[
|
|
|
+ { required: true, message: '请选择项目', trigger: 'change'},
|
|
|
+ ],
|
|
|
+ enterprisename:[
|
|
|
+ { required: true, message: '请选择客户', trigger: 'change'},
|
|
|
+ ],
|
|
|
+ date:[
|
|
|
+ { required: true, message: '请选择有效期', trigger: 'change'},
|
|
|
+ ],
|
|
|
+ itemtype:[
|
|
|
+ { required: true, message: '请选择产品系列', trigger: 'change'},
|
|
|
+ ],
|
|
|
+ discountrate:[
|
|
|
+ { required: false, validator: discountrate, trigger: 'change'},
|
|
|
+ ],
|
|
|
+ /*name:[
|
|
|
+ { required: true, message: '请选择联系人', trigger: 'change'},
|
|
|
+ ]*/
|
|
|
+ },
|
|
|
+ itemtype:[]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ ...mapGetters({
|
|
|
+ loading:'loading'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ onClose(){
|
|
|
+ this.drawer = false
|
|
|
+ this.$emit('addSuccess')
|
|
|
+ },
|
|
|
+ /*创建报价单,获取商品信息*/
|
|
|
+ onSubmit(type){
|
|
|
+
|
|
|
+ if (this.form.date.length === 0){
|
|
|
+ this.form.begdate = ''
|
|
|
+ this.form.enddate = ''
|
|
|
+ this.form.sa_quotedpriceid = 0
|
|
|
+ }else {
|
|
|
+ this.form.begdate = this.form.date[0]
|
|
|
+ this.form.enddate = this.form.date[1]
|
|
|
+ this.form.sa_quotedpriceid = 0
|
|
|
+ this.form.quotedpricenotes[1] = "2、报价有限期" + this.form.begdate + "至" + this.form.enddate
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ this.form.discountrate = (this.form.discountrate /100).toFixed(3)
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221020164803,
|
|
|
+ "content": this.form
|
|
|
+ })
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.$refs.quoterPrice.quoterPrice(res.data.sa_quotedpriceid,this.form.type,type)
|
|
|
+ this.form.sa_quotedpriceid = res.data.sa_quotedpriceid
|
|
|
+
|
|
|
+ },500)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /*导入创建报价单校验*/
|
|
|
+ onCheckFormImport(){
|
|
|
+ if (this.form.date.length === 0){
|
|
|
+ this.form.begdate = ''
|
|
|
+ this.form.enddate = ''
|
|
|
+ }else {
|
|
|
+ this.form.begdate = this.form.date[0]
|
|
|
+ this.form.enddate = this.form.date[1]
|
|
|
+ this.form.quotedpricenotes[1] = "2、报价有限期" + this.form.begdate + "至" + this.form.enddate
|
|
|
+ }
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221020164803,
|
|
|
+ "content": this.form
|
|
|
+ })
|
|
|
+ this.$refs.quoterPrice.quoterImport(res.data.sa_quotedpriceid,this.form.type)
|
|
|
+ this.form.sa_quotedpriceid = res.data.sa_quotedpriceid
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /*提交*/
|
|
|
+ getSubmit(){
|
|
|
+ if (this.form.date.length === 0){
|
|
|
+ this.form.begdate = ''
|
|
|
+ this.form.enddate = ''
|
|
|
+ }else {
|
|
|
+ this.form.begdate = this.form.date[0]
|
|
|
+ this.form.enddate = this.form.date[1]
|
|
|
+ this.form.quotedpricenotes[1] = "2、报价有限期" + this.form.begdate + "至" + this.form.enddate
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
+ if (!valid) return false
|
|
|
+ this.$store.commit('setLoading',true)
|
|
|
+ this.form.discountrate = this.form.discountrate?(this.form.discountrate / 100).toFixed(4):''
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221020164803,
|
|
|
+ "content": this.form
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,() => {
|
|
|
+ this.$store.commit('setLoading',false)
|
|
|
+ this.drawer = false
|
|
|
+ this.$emit('addSuccess')
|
|
|
+ this.$store.dispatch('changeDetailDrawer',true)
|
|
|
+ this.$router.push({path:'/quotedPriceDetail',query:{id:res.data.sa_quotedpriceid,rowindex:res.data.rowindex}})
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /*修改后的产品数据*/
|
|
|
+ productDataChange(val){
|
|
|
+ let obj = val.map(e=>{
|
|
|
+ return {
|
|
|
+ sa_quotedprice_itemsid:e.sa_quotedprice_itemsid,
|
|
|
+ itemid:e.itemid,
|
|
|
+ oldprice:e.marketprice,
|
|
|
+ price:e.price,
|
|
|
+ discountrate:(e.discountrate/100).toFixed(4),
|
|
|
+ qty:e.qty
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.productObj = obj
|
|
|
+ },
|
|
|
+ async changeData(obj){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221021095403,
|
|
|
+ "content": {
|
|
|
+ "sa_quotedpriceid":this.form.sa_quotedpriceid, //sat_notice_classid<=0时 为新增
|
|
|
+ "items":obj
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$emit('addSuccess')
|
|
|
+ },
|
|
|
+ projectList(){
|
|
|
+ this.$refs.projectTemplate.listData()
|
|
|
+ },
|
|
|
+ /*可选客户*/
|
|
|
+ customerList(){
|
|
|
+ if (this.form.type === '客户报价'){
|
|
|
+ this.form.sa_projectid = 0
|
|
|
+ this.customerParam.content.where.sa_projectid = 0
|
|
|
+ this.customerParam.content.where.type = 19
|
|
|
+ }else {
|
|
|
+ this.customerParam.content.where.type = 4
|
|
|
+ this.customerParam.content.where.sa_projectid = this.form.sa_projectid
|
|
|
+ }
|
|
|
+ this.$refs.customerTemplate.listData()
|
|
|
+ },
|
|
|
+
|
|
|
+ /*可选择合作伙伴*/
|
|
|
+ distributorList(){
|
|
|
+ this.customerParam.content.where.sa_projectid = 0
|
|
|
+ this.customerParam.content.where.type = 20
|
|
|
+ this.$refs.distributorTemplate.listData()
|
|
|
+ },
|
|
|
+ /*可选联系人*/
|
|
|
+ contactsList(){
|
|
|
+ this.contactsParam.content.sys_enterpriseid = this.form.sys_enterpriseid
|
|
|
+ this.$refs.contactTemplate.listData()
|
|
|
+ },
|
|
|
+
|
|
|
+ /*项目选择信息*/
|
|
|
+ projectData(val){
|
|
|
+ this.form.sa_projectid = val.sa_projectid
|
|
|
+ this.form.projectname = val.projectname
|
|
|
+ this.form.projectnum = val.projectnum
|
|
|
+ this.form.sys_enterpriseid = ''
|
|
|
+ this.form.enterprisename = ''
|
|
|
+ this.form.contactsid = 0
|
|
|
+ this.form.name = ''
|
|
|
+ this.form.phonenumber = ''
|
|
|
+ this.form.fax = ''
|
|
|
+ this.form.telephone = ''
|
|
|
+ this.projectShow = false
|
|
|
+ this.salerParam.content.type = 2
|
|
|
+ this.salerParam.content.sa_projectid = this.form.sa_projectid
|
|
|
+ this.querySalesman()
|
|
|
+ },
|
|
|
+ /*客户选择信息*/
|
|
|
+ customerData(val){
|
|
|
+ this.form.sys_enterpriseid = val.sys_enterpriseid
|
|
|
+ this.form.enterprisename = val.enterprisename
|
|
|
+ this.form.contactsid = 0
|
|
|
+ this.form.name = ''
|
|
|
+ this.form.phonenumber = ''
|
|
|
+ this.form.fax = ''
|
|
|
+ this.form.telephone = ''
|
|
|
+ this.customerShow = false
|
|
|
+ if (!this.isQuotedPrice){
|
|
|
+ this.salerParam.content.type = 1
|
|
|
+ this.salerParam.content.sys_enterpriseid = this.form.sys_enterpriseid
|
|
|
+ this.querySalesman()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /*合作伙伴选择信息*/
|
|
|
+ distributorData(val){
|
|
|
+ this.form.sys_enterpriseid = val.sys_enterpriseid
|
|
|
+ this.form.enterprisename = val.enterprisename
|
|
|
+ this.form.contactsid = 0
|
|
|
+ this.form.contactsname = ''
|
|
|
+ this.form.contactsphonenumber = ''
|
|
|
+ this.form.fax = ''
|
|
|
+ this.form.telephone = ''
|
|
|
+ this.customerShow = false
|
|
|
+ if (!this.isQuotedPrice){
|
|
|
+ this.salerParam.content.type = 1
|
|
|
+ this.salerParam.content.sys_enterpriseid = this.form.sys_enterpriseid
|
|
|
+ this.querySalesman()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /*联系人选择信息*/
|
|
|
+ contactsData(val){
|
|
|
+ this.form.contactsid = val.contactsid
|
|
|
+ this.form.name = val.name
|
|
|
+ this.form.phonenumber = val.phonenumber
|
|
|
+ this.form.fax = val.fax
|
|
|
+ this.form.telephone = val.telephone
|
|
|
+ this.contactsShow = false
|
|
|
+ },
|
|
|
+ /*查询产品系列*/
|
|
|
+ queryItemType(){
|
|
|
+ this.$store.dispatch('optiontypeselect','itemtype').then(res => {
|
|
|
+ this.itemtype = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /*业务员*/
|
|
|
+ showChange(){
|
|
|
+ this.salesmanVisible = true
|
|
|
+ if (this.isQuotedPrice){
|
|
|
+ this.$refs.selectSalesman.param.content.type = 2
|
|
|
+ this.$refs.selectSalesman.param.content.sa_projectid = this.form.sa_projectid
|
|
|
+ this.$refs.selectSalesman.listData()
|
|
|
+ }else {
|
|
|
+ this.$refs.selectSalesman.param.content.type = 1
|
|
|
+ this.$refs.selectSalesman.param.content.sys_enterpriseid = this.form.sys_enterpriseid
|
|
|
+ this.$refs.selectSalesman.listData()
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ salesmanChange(data){
|
|
|
+ this.form.saler_hrid = data[0].hrid
|
|
|
+ this.form.salername = data[0].name
|
|
|
+ this.salesmanVisible = false
|
|
|
+ },
|
|
|
+ async querySalesman(){
|
|
|
+ const res = await this.$api.requested(this.salerParam)
|
|
|
+ this.form.salername = res.data[0].name
|
|
|
+ this.form.saler_hrid = res.data[0].hrid
|
|
|
+ },
|
|
|
+ /*修改折扣数据*/
|
|
|
+ discountrateChange(){
|
|
|
+ this.form.discountrate = Math.round(this.form.discountrate * 100)/100
|
|
|
+ },
|
|
|
+ handleClick(tab){
|
|
|
+ if (tab.name === '合作伙伴'){
|
|
|
+ this.distributorList(this.customerParam.content.pageNumber = 1)
|
|
|
+ }else {
|
|
|
+ this.customerList(this.customerParam.content.pageNumber = 1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ if (this.drawerShow){this.drawer = true}
|
|
|
+ this.form.type = this.typeData
|
|
|
+ if (this.typeData === '项目报价'){
|
|
|
+ this.isQuotedPrice = true
|
|
|
+ this.title = '新建项目报价单'
|
|
|
+ }else {
|
|
|
+ this.isQuotedPrice = false
|
|
|
+ this.title = '新建客户报价单'
|
|
|
+ }
|
|
|
+ const date = new Date()
|
|
|
+ this.form.billdate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
|
|
|
+ this.form.sa_quotedpriceid = 0
|
|
|
+ this.queryItemType()
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+>>> .el-divider--horizontal {
|
|
|
+ height: 1px;
|
|
|
+ width: 100%;
|
|
|
+ margin: 0px;
|
|
|
+}
|
|
|
+/deep/.el-input__prefix {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+</style>
|