| 1 |
- "use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[6413],{31752:function(t,e,a){a.r(e),a.d(e,{default:function(){return $}});var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-button",{attrs:{size:"mini",disabled:"新建"!==t.data.status||!t.data.disabled,type:"新建"===t.data.status&&t.data.disabled?"primary":""},on:{click:t.onShow}},[t._v("编 辑")]),a("el-drawer",{attrs:{title:"编辑报价单",visible:t.drawer,size:"600px",direction:"rtl","show-close":!1,"append-to-body":""},on:{"update:visible":function(e){t.drawer=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.quotedpricetype,callback:function(e){t.$set(t.form,"quotedpricetype",e)},expression:"form.quotedpricetype"}})],1)],1),t.isQuotedPrice?a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"项目名称:","label-width":"100px",prop:"projectname"}},[a("el-popover",{attrs:{placement:"bottom",width:"700",trigger:"click"},on:{show:t.projectList},model:{value:t.projectShow,callback:function(e){t.projectShow=e},expression:"projectShow"}},[a("el-input",{staticStyle:{width:"300px","margin-bottom":"10px"},attrs:{placeholder:"请输入内容",clearable:"",size:"mini"},on:{clear:function(e){return t.projectList(t.projectParam.content.pageNumber=1)}},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.projectList(t.projectParam.content.pageNumber=1)}},model:{value:t.projectParam.content.where.condition,callback:function(e){t.$set(t.projectParam.content.where,"condition",e)},expression:"projectParam.content.where.condition"}},[a("i",{staticClass:"el-icon-search",attrs:{slot:"prefix"},on:{click:function(e){return t.projectList(t.projectParam.content.pageNumber=1)}},slot:"prefix"})]),a("el-table",{attrs:{data:t.project.projectData,height:"396px","header-cell-style":{background:"#EEEEEE",color:"#333"},size:"mini"},on:{"row-click":t.projectOpen}},[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.projectnum?e.row.projectnum:"--"))])]}}],null,!1,83220129)}),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.projectname?e.row.projectname:"--"))])]}}],null,!1,4140801697)}),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:"--"))])]}}],null,!1,450065441)})],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.project.currentPage,total:t.project.total},on:{"size-change":t.handleSizeChangeProject,"current-change":t.handleCurrentChangeProject}})],1),a("el-input",{attrs:{slot:"reference",readonly:!0,autocomplete:"off",placeholder:"请选择项目"},on:{input:t.selectProject},slot:"reference",model:{value:t.form.projectname,callback:function(e){t.$set(t.form,"projectname",e)},expression:"form.projectname"}})],1)],1)],1):t._e(),t.isQuotedPrice?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):t._e(),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,height:"396px","header-cell-style":{background:"#EEEEEE",color:"#333"},size:"mini"},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",prop:"name"}},[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,height:"396px","header-cell-style":{background:"#EEEEEE",color:"#333"},size:"mini"},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.contactsname,callback:function(e){t.$set(t.form,"contactsname",e)},expression:"form.contactsname"}})],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.contactsphonenumber,callback:function(e){t.$set(t.form,"contactsphonenumber",e)},expression:"form.contactsphonenumber"}})],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-popover",{attrs:{placement:"bottom",trigger:"manual",width:"500"},model:{value:t.salesmanVisible,callback:function(e){t.salesmanVisible=e},expression:"salesmanVisible"}},[a("selectSalesman",{ref:"selectSalesman",attrs:{radio:!0},on:{onSelect:t.salesmanChange,onCancel:function(e){t.salesmanVisible=!1}}}),a("el-input",{attrs:{slot:"reference",readonly:"",type:"text",size:"small",placeholder:"请选择业务员"},on:{focus:t.showChange},slot:"reference",model:{value:t.form.salername,callback:function(e){t.$set(t.form,"salername",e)},expression:"form.salername"}})],1)],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:"warning"},on:{click:t.getSubmit}},[t._v("保 存")])],1)])],1)},i=[],r=(a(21703),a(53332)),o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticStyle:{"padding-bottom":"35px"}},[a("el-input",{staticStyle:{width:"200px",float:"left"},attrs:{size:"small","suffix-icon":"el-icon-search",placeholder:"产品名称,编号",clearable:""},on:{clear:function(e){return t.productData(t.param.content.pageNumber=1)}},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.productData(t.param.content.pageNumber=1)}},model:{value:t.param.content.where.condition,callback:function(e){t.$set(t.param.content.where,"condition",e)},expression:"param.content.where.condition"}}),a("delProduct",{ref:"delProduct",staticStyle:{float:"right"},attrs:{data:t.selectDel},on:{delSuccess:t.delSuccess}}),a("itemClassAdd",{ref:"quoterPrice",staticStyle:{float:"right","margin-right":"10px","margin-bottom":"10px"},attrs:{id:t.sa_projectid,sa_quotedpriceid:t.sa_quotedpriceid,quotedpricetype:t.quotedpricetype},on:{productAdd:t.productData}})],1),a("div",{staticClass:"produtMag-panel"},[a("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:t.list,"header-cell-style":{height:"50px",color:"#606266",fontWeight:"400"},"cell-style":{height:"50px",color:"#666666",fontWeight:"400"}},on:{"selection-change":t.selectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"42",fixed:""}}),a("el-table-column",{attrs:{prop:"itemno",label:"产品类别名称",width:"0"}}),a("el-table-column",{attrs:{prop:"itemname",label:"品牌",width:"0"}}),a("el-table-column",{attrs:{prop:"discountrate",label:"折扣(%)",fixed:"right",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input",{attrs:{size:"mini",placeholder:"请输入折扣"},on:{change:function(a){return t.onChangeDiscountrate(e.row.discountrate,e.row,e.$index)}},model:{value:e.row.discountrate,callback:function(a){t.$set(e.row,"discountrate",a)},expression:"scope.row.discountrate"}})]}}])})],1),a("div",{staticStyle:{height:"35px","margin-top":"20px"}},[a("div",{staticStyle:{float:"left"}},[t._v("总金额:"+t._s(t.totalPrice)+"元")]),a("div",{staticStyle:{float:"right"}},[a("el-pagination",{staticStyle:{"text-align":"right"},attrs:{background:"",small:"","current-page":t.currentPage,"page-size":t.param.content.pageSize,layout:"total, prev, pager, next, jumper",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)])],1)])},n=[],c=a(33028),l=a(39115),d=a(9606),m=a(75727),u=a(18022),p=a(74830),h=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-button",{attrs:{size:"small",type:"primary",icon:"el-icon-plus"}},[t._v("添加")])],1)},f=[],g={name:"itemClassAdd"},b=g,y=a(43736),_=(0,y.Z)(b,h,f,!1,null,"037663e0",null),w=_.exports,v={props:["sa_projectid","sa_quotedpriceid","quotedpricetype"],name:"quotedPriceProduct",components:{uploadFile:c.Z,previewImage:l.Z,productTable:d.Z,delProduct:u.Z,importExcel:m.Z,productTableProject:p.Z,itemClassAdd:w},data(){return{selectDel:[],totalPrice:0,step:1,tablecols:[],list:[],total:0,currentPage:0,changeList:[],setTopColor:{color:"#79da56"},setDownColor:{color:"#ef230c"},param:{id:20221021095503,version:1,content:{sa_quotedpriceid:"",pageNumber:1,pageSize:20,where:{condition:""}}}}},methods:{async productData(){this.param.content.sa_quotedpriceid=this.sa_quotedpriceid;const t=await this.$api.requested(this.param);this.list=t.data,this.total=t.total,this.totalPrice=0;for(var e=0;e<t.data.length;e++)this.list[e].discountrate=Math.round(100*t.data[e].discountrate*100)/100,this.list[e].mindiscountrate=Math.round(100*t.data[e].mindiscountrate*100)/100,this.list[e].price=Math.round(100*t.data[e].price)/100,this.list[e].discountDifferenceAmount=Math.round(100*t.data[e].discountDifferenceAmount)/100,this.totalPrice=this.totalPrice+t.data[e].amount;this.totalPrice=Math.round(100*this.totalPrice)/100,this.$emit("productData",this.list)},handleSizeChange(t){this.param.content.pageSize=t,this.productData()},handleCurrentChange(t){this.param.content.pageNumber=t,this.productData()},delSuccess(){this.productData()},onSuccess(){this.productData()},clearData(){this.search="",this.param.content.where.condition=this.search,this.productData()},queryClick(){this.param.content.where.condition=this.search,this.productData()},selectionChange(t){this.selectDel=[];for(let e=0;e<t.length;e++)this.selectDel[e]=t[e].sa_quotedprice_itemsid;this.$refs.delProduct.length=this.selectDel.length},checkForm(){this.$emit("checkForm")},quoterPrice(t,e){this.sa_quotedpriceid=t,this.$refs.quoterPrice.queryProduct(t,e),this.$refs.quoterPriceProject.queryProduct(t,e)},onChangeNum(t,e,a){e.qty=Math.round(100*t)/100,e.amount=Math.round(e.qty*e.price*100)/100,e.discountDifferenceAmount=Math.round(100*(e.marketprice*(e.discountrate/100)-e.marketprice*(e.mindiscountrate/100)))/100,this.$set(this.list,a,e),this.totalPrice=0;for(var s=0;s<this.list.length;s++)this.totalPrice=this.totalPrice+this.list[s].amount;this.totalPrice=Math.round(100*this.totalPrice)/100,this.$emit("productData",this.list)},onChangeDiscountrate(t,e,a){e.specialoffer=0,e.discountrate=t>100?100:t<=0?1:Math.round(100*t)/100,e.price=Math.round(e.marketprice*(e.discountrate/100)*100)/100,e.amount=Math.round(e.qty*e.price*100)/100,e.discountDifferenceAmount=Math.round(100*(e.marketprice*(e.discountrate/100)-e.marketprice*(e.mindiscountrate/100)))/100,e.discountDifferenceAmount<0&&(e.specialoffer=1),this.$set(this.list,a,e),this.totalPrice=0;for(var s=0;s<this.list.length;s++)this.totalPrice=this.totalPrice+this.list[s].amount;this.totalPrice=Math.round(100*this.totalPrice)/100,this.$emit("productData",this.list)},onChangePrice(t,e,a){e.specialoffer=0,t>e.marketprice?e.price=e.marketprice:t<.01*e.marketprice?e.price=.01*e.marketprice:e.price=Math.round(100*e.price)/100,e.discountrate=Math.round(e.price/e.marketprice*100*100)/100,e.discountDifferenceAmount=Math.round(100*(e.marketprice*(e.discountrate/100)-e.marketprice*(e.mindiscountrate/100)))/100,e.amount=Math.round(e.qty*e.price*100)/100,e.discountDifferenceAmount<0&&(e.specialoffer=1),this.$set(this.list,a,e),this.totalPrice=0;for(var s=0;s<this.list.length;s++)this.totalPrice=this.totalPrice+this.list[s].qty*this.list[s].price;this.totalPrice=Math.round(100*this.totalPrice)/100,this.$emit("productData",this.list)},objSet(t){let e=t.map((t=>({sa_quotedprice_itemsid:t.sa_quotedprice_itemsid,itemid:t.itemid,oldprice:t.marketprice,price:t.price,discountrate:0,qty:t.qty})));this.changeDiscountrateData(e)},async changeData(t){const e=await this.$api.requested({id:20221021095403,version:1,content:{sa_quotedpriceid:this.list[0].sa_quotedpriceid,items:t}});this.productData(e.data[0].sa_quotedpriceid)},async changeDiscountrateData(t){const e=await this.$api.requested({id:20221021095403,version:1,content:{sa_quotedpriceid:this.list[0].sa_quotedpriceid,items:t}});this.productDiscountrateData(e.data[0].sa_quotedpriceid)},async deleteProduct(t){const e=await this.$api.requested({id:20221021095603,version:1,content:{sa_quotedprice_itemsids:[t.sa_quotedprice_itemsid]}});this.tool.showMessage(e,(()=>{this.productData(t.sa_quotedpriceid)}))},async queryItemClass(){const t=await this.$api.requested({id:"20230219162803",content:{sa_quotedpriceid:this.$route.query.id,where:{condition:"",istool:"",sa_brandid:""}}});console.log(t,"营销类别末级")}},mounted(){this.productData(),this.queryItemClass()}},k=v,C=(0,y.Z)(k,o,n,!1,null,"14b4641b",null),x=C.exports,S=a(9042),P={name:"edit",props:["data","btnType"],components:{quotedPriceProduct:r.Z,quotedPriceItemClass:x,selectSalesman:S.Z},data(){var t=(t,e,a)=>{this.form.discountrate<0||this.form.discountrate>100?a(new Error("请输入0-100%")):a()};return{projectShow:!1,customerShow:!1,contactsShow:!1,salesmanVisible:!1,disabled:!1,userInfo:JSON.parse(window.sessionStorage.getItem("userInfo")),primary:"primary",text:"",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",content:{sys_enterpriseid:"",where:{condition:"",workaddress:0}}},contacts:{contactsData:[],total:0,currentPage:0},pickerOptions:{disabledDate(t){return t.getTime()+864e5<Date.now()}},drawer:!1,isQuotedPrice:!1,date:[],clearData:[],salerParam:{id:20230306144402,content:{type:"",sys_enterpriseid:"",sa_projectid:""}},form:{quotedpricetype:"",totalPrice:0,type:"",projectnum:"",enterprisename:"",name:"",phonenumber:"",fax:"",telephone:"",specialOffer:"否",sa_quotedpriceid:0,sys_enterpriseid:"",contactsid:8,sa_projectid:"0",discountrate:"",remarks:"",invaliddate:"",projectname:"",address:"",billdate:"",enddate:"",begdate:"",saler_hrid:"",salername:"",date:[],itemtype:[],quotedpricenotes:["1、报价为含税13%税率, 含运费 ","2、报价有限期 2023-02-02 13:16:47至2023-02-22 13:16:47"]},rules:{projectname:[{required:!0,message:"请选择项目",trigger:"change"}],enterprisename:[{required:!0,message:"请选择客户",trigger:"change"}],itemtype:[{required:!0,message:"请选择产品系列",trigger:"change"}],date:[{required:!0,message:"请选择有效期",trigger:"change"}],discountrate:[{required:!1,validator:t,trigger:"change"}]},itemtype:[]}},watch:{mainData(t){0!==this.data.leader.length&&(JSON.parse(window.sessionStorage.getItem("userInfo")).userid===this.data.leader[0].userid?this.disabled=!1:this.disabled=!0),console.log("权限结果",this.disabled)}},methods:{onShow(){this.drawer=!0,this.form=Object.assign({},this.form,this.data),this.form.date[0]=this.form.begdate,this.form.date[1]=this.form.enddate,0!==this.form.discountrate?this.form.discountrate=Math.round(100*this.form.discountrate*100)/100:this.form.discountrate="",this.form.salername=this.form.leader[0].name,console.log(this.form,"form"),"项目报价"===this.form.quotedpricetype?this.isQuotedPrice=!0:this.isQuotedPrice=!1},onClose(){this.drawer=!1,this.$emit("onSuccess")},onSubmit(){0!==this.form.data.length?(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.form.begdate="",this.form.enddate=""),this.$refs.form.validate((async t=>{if(!t)return!1;await this.$api.requested({id:20221020164803,content:this.form})}))},getSubmit(){console.log(this.form,"提交表单"),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;console.log(this.form.discountrate,"discountrate"),this.form.discountrate=(this.form.discountrate/100).toFixed(4);const e=await this.$api.requested({id:20221020164803,content:this.form});this.tool.showMessage(e,(()=>{this.drawer=!1,this.changeData(this.productObj)}))}))},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("onSuccess")},queryTotalPrice(t){this.form.totalPrice=t},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.projectShow=!0,this.projectParam.content.where.condition=this.form.projectname,this.projectList()},async customerList(){"客户报价"===this.form.quotedpricetype?(this.customerParam.content.where.sa_projectid=0,this.customerParam.content.where.type=7):(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.contactsShow=!0,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.contactsname="",this.form.contactsphonenumber="",this.form.fax="",this.form.telephone="",this.projectShow=!1,this.salerParam.content.type=2,this.salerParam.content.sa_projectid=this.form.sa_projectid,this.querySalesman()},projectOpen(t){this.$confirm("修改项目后将清空产品配置, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.productList(),this.projectData(t)})).catch((()=>{this.$message({type:"info",message:"已取消"})}))},async productList(){const t=await this.$api.requested({id:20221021095503,content:{sa_quotedpriceid:this.form.sa_quotedpriceid}});console.log(t,"产品明细"),this.clearData=[],t.data.forEach(((t,e)=>{console.log(t),this.clearData[e]=t.sa_quotedprice_itemsid})),console.log(this.clearData,"需要删除的产品明细"),this.productClear()},async productClear(){await this.$api.requested({id:20221021095603,content:{sa_quotedprice_itemsids:this.clearData}});this.$refs.quoterPrice.productData()},customerData(t){this.form.sys_enterpriseid=t.sys_enterpriseid,this.form.enterprisename=t.enterprisename,this.form.contactsid=0,this.form.contactsname="",this.form.contactsphonenumber="",this.form.fax="",this.form.telephone="",this.customerShow=!1,this.isQuotedPrice||(this.salerParam.content.type=1,this.salerParam.content.sys_enterpriseid=this.form.sys_enterpriseid,this.querySalesman())},contactsData(t){this.form.contactsid=t.contactsid,this.form.contactsname=t.name,this.form.contactsphonenumber=t.phonenumber,this.form.fax=t.fax,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}))},showChange(){this.salesmanVisible=!0,this.isQuotedPrice?(this.$refs.selectSalesman.param.content.type=2,this.$refs.selectSalesman.param.content.sa_projectid=this.form.sa_projectid,this.$refs.selectSalesman.listData()):(this.$refs.selectSalesman.param.content.type=1,this.$refs.selectSalesman.param.content.sys_enterpriseid=this.form.sys_enterpriseid,this.$refs.selectSalesman.listData())},salesmanChange(t){console.log(t,"业务员"),this.form.saler_hrid=t[0].hrid,this.form.salername=t[0].name,this.salesmanVisible=!1},async querySalesman(){const t=await this.$api.requested(this.salerParam);this.form.salername=t.data[0].name,this.form.saler_hrid=t.data[0].hrid,console.log(this.form,"更换业务员后")},discountrateChange(){this.form.discountrate=Math.round(100*this.form.discountrate)/100}},mounted(){this.queryItemType()},created(){}},q=P,j=(0,y.Z)(q,s,i,!1,null,"6d6786c2",null),$=j.exports},74514:function(t,e,a){a.d(e,{Z:function(){return f}});var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"border-bottom"},[a("div",[a("ul",{staticClass:"flex-align-center normal-margin-new"},t._l(t.fields,(function(e){return a("li",{key:e.value,staticClass:"brand-item",class:t.field_act===e.value?"act":"",staticStyle:{"margin-left":"0"},on:{click:function(a){return t.clickField(e)}}},[t._v(t._s(e.value))])})),0),a("ul",{staticClass:"flex-align-center normal-margin-new"},t._l(t.brands,(function(e){return a("li",{key:e.sa_brandid,staticClass:"brand-item",class:t.brand_act===e.sa_brandid?"act":"",staticStyle:{"margin-left":"0"},on:{click:function(a){return t.clickBrand(e.sa_brandid)}}},[t._v(t._s(e.brandname))])})),0),a("ul",{staticClass:"flex-align-center normal-margin-new"},[a("li",{staticClass:"brand-item border-all",class:""===t.class_act?"act":"",on:{click:function(e){return t.clickClass("")}}},[t._v("全部分类")]),t._l(t.itemclass,(function(e){return a("li",{key:e.itemclassnum,staticClass:"brand-item margin-notAll",class:t.class_act===e.itemclassnum?"act":"",on:{click:function(a){return t.clickClass(e)}}},[t._v(t._s(e.itemclassname))])}))],2),a("classTree",{staticStyle:{"padding-left":"80px"},attrs:{data:t.activeClass.subdep},on:{onClassChange:t.change}})],1),a("div")])},i=[],r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"flex-align-center"},t._l(t.data,(function(e){return a("div",{key:e.index,on:{click:function(a){return t.classClick(e)}}},[a("p",{staticClass:"normal-margin class-item",class:t.class_act===e.itemclassnum?"act":""},[t._v(t._s(e.itemclassname))]),e.subdep?a("Tree",{attrs:{data:e.subdep},on:{onClassChange:t.change}}):t._e()],1)})),0)])},o=[],n={name:"Tree",props:["data"],data(){return{activeClass:{},class_act:0}},methods:{classClick(t){this.activeClass=t,this.class_act=t.itemclassnum,this.change(t)},change(t){this.$emit("onClassChange",t)}}},c=n,l=a(43736),d=(0,l.Z)(c,r,o,!1,null,"252d8fd2",null),m=d.exports,u={data(){return{value:"",brands:[],fields:[],itemclass:[],activeClass:{},field_act:0,brand_act:0,class_act:"",standard_act:0,itemstandards:[]}},props:{default:{type:Boolean,default:()=>!1}},components:{classTree:m},methods:{queryAgentiInfo(){this.$store.dispatch("optiontypeselect","tradefield").then((t=>{this.fields=t.data,console.log(this.fields,"tradefield"),this.field_act=t.data[0].value,console.log(this.field_act)}))},queryStandard(){this.$store.dispatch("optiontypeselect","itemstandards").then((t=>{this.itemstandards=t.data,console.log(this.itemstandards,"itemstandards"),this.standard_act=t.data[0].value,console.log(this.standard_act)}))},async queryBrands(){const t=await this.$api.requested({id:"20220924163702",content:{pageSize:1e3,where:{condition:""}}});this.brands=t.data,this.brand_act=this.brands[0].sa_brandid,this.queryClass()},async queryClass(){const t=await this.$api.requested({id:"20220922110403",content:{sa_brandid:this.brand_act}});console.log(t.data,"pop"),this.itemclass=t.data[0].ttemclass},clickBrand(t){this.brand_act=t,this.queryClass(),this.$emit("brandChange",t)},clickField(t){this.field_act=t.value,this.$emit("clickField",t)},clickStandard(t){this.standard_act=t.value,this.$emit("clickStandard",t)},clickClass(t){this.activeClass=t,this.class_act=t.itemclassnum,this.change(t)},change(t){console.log(t),this.$emit("onClassChange",t)},clearSearch(){this.$emit("clearSearch")}},mounted(){this.queryAgentiInfo(),this.queryBrands(),this.queryClass()}},p=u,h=(0,l.Z)(p,s,i,!1,null,"3e271747",null),f=h.exports},18022:function(t,e,a){a.d(e,{Z:function(){return l}});var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-button",{attrs:{type:"primary",size:"small",disabled:0===t.length},on:{click:function(e){t.dialogVisible=!0}}},[t._v("删 除")]),a("el-dialog",{attrs:{title:"提示",visible:t.dialogVisible,"append-to-body":"",width:"20%"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("span",[t._v("确定删除这些商品吗")]),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"mini"},on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),a("el-button",{attrs:{size:"mini",type:"primary"},on:{click:t.delProduct}},[t._v("确 定")])],1)])],1)},i=[],r={name:"delProduct",props:["data"],data(){return{dialogVisible:!1,length:0}},methods:{async delProduct(){const t=await this.$api.requested({id:20221021095603,version:1,content:{sa_quotedprice_itemsids:this.data}});this.tool.showMessage(t,(()=>{this.dialogVisible=!1,this.$emit("delSuccess")}))}},mounted(){console.log(this.data)}},o=r,n=a(43736),c=(0,n.Z)(o,s,i,!1,null,"32bc6b6c",null),l=c.exports},9042:function(t,e,a){a.d(e,{Z:function(){return l}});var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"search_input normal-margin"},[t._l(t.selected,(function(e){return a("div",{key:e.index,staticClass:"tag flex-align-center",attrs:{type:"primary",size:"mini",closable:""}},[a("div",{staticClass:"avatar-mini"},[e.headpic?a("img",{staticClass:"avatar__image",attrs:{src:e.headpic,alt:""}}):a("p",[t._v(t._s(e.name))])]),a("p",{staticClass:"inline-16"},[t._v(t._s(e.name))]),a("b",[a("i",{staticClass:"el-icon-close",on:{click:function(a){return t.closeTag(e)}}})])])})),a("input",{directives:[{name:"model",rawName:"v-model",value:t.search,expression:"search"}],staticClass:"input_panel",attrs:{type:"text",placeholder:"输入搜索内容"},domProps:{value:t.search},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.listData.apply(null,arguments)},input:function(e){e.target.composing||(t.search=e.target.value)}}})],2),a("div",{staticClass:"flex-align-stretch menber__panel"},t._l(t.tableData,(function(e){return a("div",{key:e.index,staticClass:"flex-align-center menber__item flex-between",class:t.showSelelctIcon(e)?"active_menber__item":"",staticStyle:{flex:"1 0 auto"},on:{click:function(a){return t.clickMenber(e)}}},[a("div",{staticClass:"flex-align-center"},[a("div",{staticClass:"avatar inline-16"},[e.headpic?a("img",{staticClass:"avatar__image",attrs:{src:e.headpic,alt:""}}):a("p",[t._v(t._s(e.name))])]),a("div",[a("p",[t._v(t._s(e.name))]),a("small",{staticStyle:{color:"#999999ad","margin-top":"10px"}},[t._v("地址:"+t._s(e.address?e.address:"暂无")+" 联系电话:"+t._s(e.phonenumber?e.phonenumber:"暂无"))])])]),t.showSelelctIcon(e)?a("i",{staticClass:"el-icon-check iconCheck"}):t._e()])})),0),0===t.tableData.length?a("el-empty",{attrs:{description:"暂无数据","image-size":40}}):t._e(),a("el-button",{staticStyle:{"margin-top":"16px",float:"right"},attrs:{size:"mini",type:"text"},on:{click:t.onCancel}},[t._v("取 消")]),a("div",{staticStyle:{"margin-top":"16px","text-align":"left"}},[a("el-pagination",{attrs:{background:"",small:"","current-page":t.currentPage,"page-size":t.param.content.pageSize,layout:"total, prev, pager, next",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1)},i=[],r={props:["radio","type","sa_projectid","checked","sys_enterpriseid"],data(){return{search:"",tableData:[],total:0,currentPage:0,selected:[],param:{id:20230306144402,content:{type:"",sys_enterpriseid:"",sa_projectid:""}}}},components:{},methods:{async listData(){console.log(this.param);const t=await this.$api.requested(this.param);this.tableData=t.data,this.total=t.total,this.currentPage=t.pageNumber,console.log(this.tableData)},handleSizeChange(t){this.param.content.pageSize=t,this.listData()},handleCurrentChange(t){this.param.content.pageNumber=t,this.listData()},clickMenber(t){this.radio&&(this.selected=[]);let e=this.selected.some((e=>t.hrid===e.hrid));e?this.selected=this.selected.filter((e=>e.hrid!==t.hrid)):this.selected.push(t),this.onSelect()},showSelelctIcon(t){let e=this.selected.some((e=>t.hrid===e.hrid));return e},onSelect(){this.$emit("onSelect",this.selected)},closeTag(t){this.selected=this.selected.filter((e=>e.hrid!==t.hrid))},onCancel(){this.$emit("onCancel")}},mounted(){this.listData()}},o=r,n=a(43736),c=(0,n.Z)(o,s,i,!1,null,"0941154c",null),l=c.exports}}]);
|