| 1 |
- "use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[4387],{64387:function(t,e,a){a.r(e),a.d(e,{default:function(){return m}});var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){t.dialogFormVisible=!0}}},[t._v("新 建")]),a("el-drawer",{attrs:{title:"新建项目报价单",visible:t.dialogFormVisible,size:"600px",direction:"rtl","append-to-body":"","show-close":!1},on:{"update:visible":function(e){t.dialogFormVisible=e},close:t.onClose}},[a("div",{staticClass:"drawer__panel",staticStyle:{"margin-bottom":"0px"}},[a("el-row",{staticStyle:{"margin-top":"10px"},attrs:{gutter:10}},[a("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,size:"mini","label-position":"right"}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"报价类型:","label-width":"100px"}},[a("el-input",{attrs:{autocomplete:"off",placeholder:"报价类型",disabled:""},model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"项目名称:","label-width":"100px",prop:"projectname"}},[a("el-input",{attrs:{disabled:"",autocomplete:"off",placeholder:"请选择项目"},model:{value:t.form.projectname,callback:function(e){t.$set(t.form,"projectname",e)},expression:"form.projectname"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"项目编号:","label-width":"100px"}},[a("el-input",{attrs:{autocomplete:"off",placeholder:"项目编号",disabled:""},model:{value:t.form.projectnum,callback:function(e){t.$set(t.form,"projectnum",e)},expression:"form.projectnum"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"客户名称:","label-width":"100px",prop:"enterprisename"}},[a("el-popover",{attrs:{placement:"bottom",width:"700",trigger:"click"},on:{show:t.customerList},model:{value:t.customerShow,callback:function(e){t.customerShow=e},expression:"customerShow"}},[a("el-input",{staticStyle:{width:"300px","margin-bottom":"10px"},attrs:{placeholder:"请输入内容",clearable:"",size:"mini"},on:{clear:function(e){return t.customerList(t.customerParam.content.pageNumber=1)}},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.customerList(t.customerParam.content.pageNumber=1)}},model:{value:t.customerParam.content.where.condition,callback:function(e){t.$set(t.customerParam.content.where,"condition",e)},expression:"customerParam.content.where.condition"}},[a("i",{staticClass:"el-icon-search",attrs:{slot:"prefix"},on:{click:function(e){return t.customerList(t.customerParam.content.pageNumber=1)}},slot:"prefix"})]),a("el-table",{attrs:{data:t.customer.customerData},on:{"row-click":t.customerData}},[a("el-table-column",{attrs:{label:"客户编号",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticStyle:{"margin-left":"10px"}},[t._v(t._s(e.row.sa_customersid?e.row.sa_customersid:"--"))])]}}])}),a("el-table-column",{attrs:{label:"客户名称",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticStyle:{"margin-left":"10px"}},[t._v(t._s(e.row.enterprisename?e.row.enterprisename:"--"))])]}}])}),a("el-table-column",{attrs:{label:"地址"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticStyle:{"margin-left":"10px"}},[t._v(t._s(e.row.address?e.row.address:"--"))])]}}])})],1),a("div",{staticClass:"container normal-panel",staticStyle:{"text-align":"right"}},[a("el-pagination",{attrs:{background:"",small:"","page-sizes":[10,20,50,100],layout:"total,sizes, prev, pager, next, jumper","current-page":t.customer.currentPage,total:t.customer.total},on:{"size-change":t.handleSizeChangeCustomer,"current-change":t.handleCurrentChangeCustomer}})],1),a("el-input",{attrs:{slot:"reference",readonly:!0,autocomplete:"off",placeholder:"请选择客户"},on:{input:t.selectCustomer},slot:"reference",model:{value:t.form.enterprisename,callback:function(e){t.$set(t.form,"enterprisename",e)},expression:"form.enterprisename"}})],1)],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"电话:","label-width":"100px"}},[a("el-input",{attrs:{autocomplete:"off",placeholder:"电话",disabled:""},model:{value:t.form.telephone,callback:function(e){t.$set(t.form,"telephone",e)},expression:"form.telephone"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"联系人:","label-width":"100px"}},[a("el-popover",{attrs:{placement:"bottom",width:"700",trigger:"click"},on:{show:t.contactsList},model:{value:t.contactsShow,callback:function(e){t.contactsShow=e},expression:"contactsShow"}},[a("el-input",{staticStyle:{width:"300px","margin-bottom":"10px"},attrs:{placeholder:"请输入内容",clearable:"",size:"mini"},on:{clear:function(e){return t.contactsList(t.contactsParam.content.pageNumber=1)}},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.contactsList(t.contactsParam.content.pageNumber=1)}},model:{value:t.contactsParam.content.where.condition,callback:function(e){t.$set(t.contactsParam.content.where,"condition",e)},expression:"contactsParam.content.where.condition"}},[a("i",{staticClass:"el-icon-search",attrs:{slot:"prefix"},on:{click:function(e){return t.contactsList(t.contactsParam.content.pageNumber=1)}},slot:"prefix"})]),a("el-table",{attrs:{data:t.contacts.contactsData},on:{"row-click":t.contactsData}},[a("el-table-column",{attrs:{label:"姓名",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticStyle:{"margin-left":"10px"}},[t._v(t._s(e.row.name?e.row.name:"--"))])]}}])}),a("el-table-column",{attrs:{label:"手机号",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticStyle:{"margin-left":"10px"}},[t._v(t._s(e.row.phonenumber?e.row.phonenumber:"--"))])]}}])}),a("el-table-column",{attrs:{label:"邮箱",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticStyle:{"margin-left":"10px"}},[t._v(t._s(e.row.email?e.row.email:"--"))])]}}])}),a("el-table-column",{attrs:{label:"地址"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticStyle:{"margin-left":"10px"}},[t._v(t._s(e.row.address?e.row.address:"--"))])]}}])})],1),a("div",{staticClass:"container normal-panel",staticStyle:{"text-align":"right"}},[a("el-pagination",{attrs:{background:"",small:"","page-sizes":[10,20,50,100],layout:"total,sizes, prev, pager, next, jumper","current-page":t.contacts.currentPage,total:t.contacts.total},on:{"size-change":t.handleSizeChangeContacts,"current-change":t.handleCurrentChangeContacts}})],1),a("el-input",{attrs:{slot:"reference",readonly:!0,autocomplete:"off",placeholder:"请选择联系人"},on:{input:t.selectContacts},slot:"reference",model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1)],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"联系人手机号:","label-width":"100px"}},[a("el-input",{attrs:{autocomplete:"off",placeholder:"手机号",disabled:""},model:{value:t.form.phonenumber,callback:function(e){t.$set(t.form,"phonenumber",e)},expression:"form.phonenumber"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"报价日期:","label-width":"100px"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date","value-format":"yyyy-MM-dd",placeholder:"选择日期","picker-options":t.pickerOptions},model:{value:t.form.billdate,callback:function(e){t.$set(t.form,"billdate",e)},expression:"form.billdate"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"有效期:","label-width":"100px",prop:"date"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"daterange","value-format":"yyyy-MM-dd","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","picker-options":t.pickerOptions},model:{value:t.form.date,callback:function(e){t.$set(t.form,"date",e)},expression:"form.date"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"产品系列:","label-width":"100px",prop:"itemtype"}},[a("el-select",{ref:"sle",staticStyle:{width:"100%"},attrs:{multiple:"",placeholder:"请选择产品系列",size:"mini"},model:{value:t.form.itemtype,callback:function(e){t.$set(t.form,"itemtype",e)},expression:"form.itemtype"}},t._l(t.itemtype,(function(e){return a("el-option",{key:e.index,attrs:{label:e.value,value:e.value}},[a("span",{staticStyle:{float:"left"}},[t._v(t._s(e.value))]),a("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"12px"}},[t._v(t._s(e.remarks?e.remarks:"暂无描述"))])])})),1)],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"折扣(%):","label-width":"100px",prop:"discountrate"}},[a("el-input",{attrs:{type:"number",autocomplete:"off",placeholder:"请输入0-100%"},on:{change:t.discountrateChange},model:{value:t.form.discountrate,callback:function(e){t.$set(t.form,"discountrate",e)},expression:"form.discountrate"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"业务员:","label-width":"100px",prop:"salername"}},[a("el-input",{attrs:{disabled:"",autocomplete:"off",placeholder:"请选择业务员"},model:{value:t.form.salername,callback:function(e){t.$set(t.form,"salername",e)},expression:"form.salername"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"备注:","label-width":"100px",prop:"remarks"}},[a("el-input",{attrs:{autocomplete:"off",placeholder:"请输入备注信息",type:"textarea",autosize:""},model:{value:t.form.remarks,callback:function(e){t.$set(t.form,"remarks",e)},expression:"form.remarks"}})],1)],1)],1)],1)],1),a("div",{staticClass:"fixed__btn__panel"},[a("el-button",{staticClass:"normal-btn-width",attrs:{size:"small"},on:{click:t.onClose}},[t._v("取 消")]),a("el-button",{staticClass:"normal-btn-width",attrs:{size:"small",type:"primary"},on:{click:t.getSubmit}},[t._v("确 定")])],1)])],1)},o=[],s=(a(21703),a(37393)),i={name:"add",props:["data"],components:{quotedPriceProduct:s.Z},data(){var t=(t,e,a)=>{this.form.discountrate<0||this.form.discountrate>100?a(new Error("请输入0-100%")):a()};return{dialogFormVisible:!1,projectShow:!1,customerShow:!1,contactsShow:!1,projectParam:{id:20221020143503,content:{pageNumber:1,pageSize:10,type:1,where:{condition:"",startdate:"",enddate:"",status:"",projecttype:"",stagename:"",tag:""}}},project:{projectData:[],total:0,currentPage:0},customerParam:{id:20220920083901,content:{pageNumber:1,pageSize:10,where:{condition:"",type:4,sa_projectid:""}}},customer:{customerData:[],total:0,currentPage:0},contactsParam:{id:"20221022165503",version:1,content:{sys_enterpriseid:"",pageNumber:1,pageSize:10,where:{condition:"",workaddress:0}}},contacts:{contactsData:[],total:0,currentPage:0},pickerOptions:{disabledDate(t){return t.getTime()+864e5<Date.now()}},drawer:!1,isQuotedPrice:!1,date:[],productObj:{},form:{date:[],totalPrice:"",type:"",projectnum:"",enterprisename:"",name:"",phonenumber:"",telephone:"",specialOffer:"否",sa_quotedpriceid:0,sys_enterpriseid:"",contactsid:8,sa_projectid:"0",discountrate:"",remarks:"",invaliddate:"",projectname:"",address:"",billdate:"",enddate:"",begdate:"",itemtype:[],saler_userid:this.data.leader[0].userid||"",salername:this.data.leader[0].name||"",quotedpricenotes:["1、报价为含税13%税率,含运费","2、报价有限期 2023-02-02 13:16:47至2023-02-22 13:16:47"],source:1},rules:{projectname:[{required:!0,message:"请选择项目",trigger:"change"}],enterprisename:[{required:!0,message:"请选择客户",trigger:"change"}],date:[{required:!0,message:"请选择有效期",trigger:"change"}],itemtype:[{required:!0,message:"请选择产品系列",trigger:"change"}],discountrate:[{required:!1,validator:t,trigger:"change"}]},itemtype:[]}},methods:{onClose(){this.dialogFormVisible=!1},onSubmit(t){0===this.form.date.length?(this.form.begdate="",this.form.enddate=""):(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),console.log(this.form,"form"),this.$refs.form.validate((async e=>{if(!e)return!1;this.form.discountrate=(this.form.discountrate/100).toFixed(3);const a=await this.$api.requested({id:20221020164803,content:this.form});setTimeout((()=>{this.$refs.quoterPrice.quoterPrice(a.data.sa_quotedpriceid,this.form.type,t),this.form.sa_quotedpriceid=a.data.sa_quotedpriceid,console.log(a.data.sa_quotedpriceid)}),500)}))},onCheckFormImport(){0===this.form.date.length?(this.form.begdate="",this.form.enddate=""):(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 t=>{if(!t)return!1;const e=await this.$api.requested({id:20221020164803,content:this.form});this.$refs.quoterPrice.quoterImport(e.data.sa_quotedpriceid,this.form.type),this.form.sa_quotedpriceid=e.data.sa_quotedpriceid}))},getSubmit(){this.dialogFormVisible=!1,0===this.form.date.length?(this.form.begdate="",this.form.enddate=""):(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 t=>{if(!t)return!1;this.form.discountrate=this.form.discountrate/100;const e=await this.$api.requested({id:20221020164803,content:this.form});this.tool.showMessage(e,(()=>{this.$emit("addSuccess");let t=this.$route;"/quotedPriceDetail"!==t.path&&(this.oldRoute={path:t.path,query:t.query},this.$store.dispatch("setHistoryRouter",this.oldRoute)),this.$store.dispatch("changeDetailDrawer",!0),this.$router.push({path:"/quotedPriceDetail",query:{id:e.data.sa_quotedpriceid,rowindex:e.data.rowindex}})}))}))},productDataChange(t){let e=t.map((t=>({sa_quotedprice_itemsid:t.sa_quotedprice_itemsid,itemid:t.itemid,oldprice:t.marketprice,price:t.price,discountrate:(t.discountrate/100).toFixed(4),qty:t.qty})));this.productObj=e},async changeData(t){await this.$api.requested({id:20221021095403,content:{sa_quotedpriceid:this.form.sa_quotedpriceid,items:t}});this.$emit("addSuccess")},async projectList(){const t=await this.$api.requested(this.projectParam);this.project.projectData=t.data,this.project.total=t.total,this.project.currentPage=t.pageNumber},async selectProject(){this.projectParam.content.where.condition=this.form.projectname,this.projectList()},async customerList(){"0"===this.form.sa_projectid&&"普通报价"===this.form.type?this.customerParam.content.where.type=2:(this.customerParam.content.where.type=4,this.customerParam.content.where.sa_projectid=this.form.sa_projectid);const t=await this.$api.requested(this.customerParam);this.customer.customerData=t.data,this.customer.total=t.total,this.customer.currentPage=t.pageNumber},selectCustomer(){this.customerParam.content.where.condition=this.form.enterprisename,this.customerList()},async contactsList(){this.contactsParam.content.sys_enterpriseid=this.form.sys_enterpriseid;const t=await this.$api.requested(this.contactsParam);this.contacts.contactsData=t.data,this.contacts.total=t.total,this.contacts.currentPage=t.pageNumber},selectContacts(){this.contactsParam.content.where.condition=this.form.name,this.contactsList()},projectData(t){this.form.sa_projectid=t.sa_projectid,this.form.projectname=t.projectname,this.form.projectnum=t.projectnum,this.form.sys_enterpriseid="",this.form.enterprisename="",this.form.contactsid=0,this.form.name="",this.form.phonenumber="",this.form.telephone="",this.projectShow=!1},customerData(t){this.form.sys_enterpriseid=t.sys_enterpriseid,this.form.enterprisename=t.enterprisename,this.form.contactsid=0,this.form.name="",this.form.phonenumber="",this.form.telephone="",this.customerShow=!1},contactsData(t){this.form.contactsid=t.contactsid,this.form.name=t.name,this.form.phonenumber=t.phonenumber,this.form.telephone=t.telephone,this.contactsShow=!1},handleSizeChangeProject(t){this.projectParam.content.pageSize=t,this.projectList()},handleCurrentChangeProject(t){this.projectParam.content.pageNumber=t,this.projectList()},handleSizeChangeCustomer(t){this.customerParam.content.pageSize=t,this.customerList()},handleCurrentChangeCustomer(t){this.customerParam.content.pageNumber=t,this.customerList()},handleSizeChangeContacts(t){this.contactsParam.content.pageSize=t,this.contactsList()},handleCurrentChangeContacts(t){this.contactsParam.content.pageNumber=t,this.contactsList()},queryItemType(){this.$store.dispatch("optiontypeselect","itemtype").then((t=>{this.itemtype=t.data}))},discountrateChange(){this.form.discountrate=Math.round(100*this.form.discountrate)/100}},mounted(){const t=new Date;this.form.billdate=t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate(),this.form.sa_projectid=this.data.sa_projectid,this.form.projectname=this.data.projectname,this.form.projectnum=this.data.projectnum,this.form.type="项目报价",this.form.sa_quotedpriceid=0,this.queryItemType()}},n=i,c=a(43736),l=(0,c.Z)(n,r,o,!1,null,"b9f080c2",null),m=l.exports}}]);
|