585.b4b2e4dd.js 39 KB

1
  1. "use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[585],{74514:function(t,e,a){a.d(e,{Z:function(){return f}});var i=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")])},s=[],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)])},l=[],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)}}},o=n,c=a(43736),d=(0,c.Z)(o,r,l,!1,null,"252d8fd2",null),u=d.exports,p={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:u},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()}},h=p,m=(0,c.Z)(h,i,s,!1,null,"3e271747",null),f=m.exports},32556:function(t,e,a){a.d(e,{Z:function(){return c}});var i=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)},s=[],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)}},l=r,n=a(43736),o=(0,n.Z)(l,i,s,!1,null,"46086deb",null),c=o.exports},27531:function(t,e,a){a.d(e,{Z:function(){return p}});var i=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"},on:{click:t.onShow}},[t._v("自产品档案添加")]),a("el-drawer",{attrs:{title:"自产品档案添加",visible:t.dialogProductVisible,"append-to-body":"",size:"80%",direction:"rtl","show-close":!1},on:{"update:visible":function(e){t.dialogProductVisible=e},close:t.onColes}},[a("div",{staticClass:"drawer__panel"},[a("div",{staticClass:"flex-align-center flex-between "},[t._t("operation"),a("div",{staticClass:"flex-align-center"},[a("el-input",{attrs:{size:"small","suffix-icon":"el-icon-search",placeholder:"搜索",clearable:""},on:{clear:function(e){return t.productData(t.params.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.params.content.pageNumber=1)}},model:{value:t.params.content.where.condition,callback:function(e){t.$set(t.params.content.where,"condition",e)},expression:"params.content.where.condition"}}),t._v("  ")],1),a("div",{staticStyle:{"margin-top":"-10px","margin-bottom":"10px",float:"right"}},[a("div",[a("el-button",{staticStyle:{float:"right"},attrs:{type:"primary",size:"mini",disabled:0===t.tableSelectData.length},on:{click:t.batchSelect}},[t._v("批量添加")])],1)])],2),a("div",{staticClass:"container"},[a("selectClass",{ref:"classShow",attrs:{default:!0},on:{brandChange:t.brandChange,onClassChange:t.onClassChange,Search:t.Search,clearSearch:t.clearSearch,clickStandard:t.clickStandard,clickField:t.clickField}})],1),a("div",{staticClass:"produtMag-panel"},[a("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{height:"calc(100vh - 370px)",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:{align:"center",label:"产品图",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.attinfos[0]?a("div",[a("previewImage",{staticClass:"image",attrs:{image:e.row.attinfos[0],list:e.row.attinfos,deletebtn:!1}})],1):t._e()]}}])}),a("el-table-column",{attrs:{prop:"itemno",label:"品号",width:"180"}}),a("el-table-column",{attrs:{prop:"itemname",label:"品名",width:"180"}}),a("el-table-column",{attrs:{prop:"erpitemno",label:"品号",width:"180"}}),a("el-table-column",{attrs:{prop:"standards",label:"标准",width:"100"}}),a("el-table-column",{attrs:{label:"型号",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.model))])])]}}])}),a("el-table-column",{attrs:{label:"规格",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.spec))])])]}}])}),a("el-table-column",{attrs:{prop:"material",label:"材质",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.material||"--"))])])]}}])}),a("el-table-column",{attrs:{prop:"device",label:"装置",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.device||"--"))])])]}}])}),a("el-table-column",{attrs:{prop:"prodline",label:"产线",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.prodline||"--"))])])]}}])}),a("el-table-column",{attrs:{prop:"specalnote",label:"特殊说明",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.specalnote||"--"))])])]}}])}),a("el-table-column",{attrs:{prop:"brand",label:"品牌",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.brand,(function(i,s){return a("p",[s===e.row.brand.length-1?a("span",{staticStyle:{float:"left"}},[t._v(t._s(i?i.brandname+"":"--"))]):a("span",{staticStyle:{float:"left"}},[t._v(t._s(i?i.brandname+",":"--"))])])}))}}])}),a("el-table-column",{attrs:{prop:"itemclass",label:"类别",width:"0"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.itemclass,(function(i,s){return a("p",[s===e.row.itemclass.length-1?a("span",{staticStyle:{float:"left"}},[t._v(t._s(i?i.itemclassname+"":"--"))]):a("span",{staticStyle:{float:"left"}},[t._v(t._s(i?i.itemclassname+",":"--"))])])}))}}])}),a("el-table-column",{attrs:{prop:"unitid",label:"计量单位",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-tag",{attrs:{size:"mini",type:"info",effect:"plain"}},[t._v(t._s(e.row.unitname)+"/"+t._s(e.row.axunitname))])]}}])}),a("el-table-column",{attrs:{prop:"marketprice",label:"牌价(元)",fixed:"right",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.marketprice?e.row.marketprice:"--"))])]}}])}),a("el-table-column",{attrs:{prop:"totalPrice",fixed:"right",label:"操作",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){return t.onSelect(e.row)}}},[t._v("添 加")])]}}])})],1),a("div",[a("div",{staticStyle:{float:"left"}},[t._v("已选:"+t._s(t.selectTotal)+"个产品")]),a("div",{staticStyle:{"margin-top":"16px","text-align":"right"}},[a("el-pagination",{attrs:{background:"","current-page":t.params.content.pageNumber,"page-sizes":[20,50,100,200],"page-size":100,layout:"total,sizes, prev, pager, next, jumper",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)])],1)]),a("div",{staticClass:"fixed__btn__panel"},[a("el-button",{staticClass:"normal-btn-width",attrs:{size:"small"},on:{click:t.onColes}},[t._v("取 消")])],1)])],1)},s=[],r=a(33028),l=a(39115),n=a(74514),o={name:"productTable",props:["id"],components:{uploadFile:r.Z,previewImage:l.Z,selectClass:n.Z},data(){return{dialogProductVisible:!1,type:"",tablecols:[],list:[],total:0,currentPage:0,tableSelectData:[],selectData:[],selectTotal:0,sa_quotedpriceid:"",params:{id:20221020164903,content:{sa_projectid:0,sa_quotedpriceid:"",pageNumber:1,pageSize:100,where:{condition:"",tradefield:"",itemclassid:"",sa_brandid:"",standards:""}}},timer:0}},methods:{onShow(){this.dialogProductVisible=!0,setTimeout((()=>{this.params.content.where.tradefield=this.$refs.classShow.field_act,this.params.content.where.sa_brandid=this.$refs.classShow.brand_act,this.productData(),this.selectListData()}),1e3)},onColes(){this.dialogProductVisible=!1,this.$refs.classShow.queryClass(),this.$refs.classShow.queryStandard(),this.$refs.classShow.queryBrands(),this.$refs.classShow.queryAgentiInfo()},async onSubmit(t){const e=await this.$api.requested({id:20221021095403,content:{sa_quotedpriceid:this.$route.query.id,items:t}});this.tool.showMessage(e,(()=>{this.$emit("productAdd"),this.productData(),this.selectListData()}))},onSelect(t){this.tableSelectData=[],this.tableSelectData[0]=t;let e=this.tableSelectData.map((t=>({sa_quotedprice_itemsid:"0",itemid:t.itemid,oldprice:t.marketprice,price:t.marketprice,discountrate:1,qty:1})));this.selectData=e,this.debounce(this.onSubmit(this.selectData),300)()},batchSelect(){this.debounce(this.onSubmit(this.selectData),300)()},debounce(t,e){let a=this;return function(){null!==a.timer&&clearTimeout(a.timer),a.timer=setTimeout(t,e)}},queryProduct(t,e){this.dialogProductVisible=!0,this.params.content.sa_projectid=0,this.type=e,this.sa_quotedpriceid=t,this.productData()},async productData(){this.params.content.sa_quotedpriceid=this.$route.query.id,this.params.content.sa_projectid=0;const t=await this.$api.requested(this.params);this.list=t.data,this.total=t.total},handleSizeChange(t){this.params.content.pageSize=t,this.productData()},handleCurrentChange(t){this.params.content.pageNumber=t,this.productData()},onSuccess(){this.productData()},clearData(){this.search="",this.params.content.where.condition=this.search,this.productData()},queryClick(){this.params.content.where.condition=this.search,this.productData()},selectionChange(t){if(this.tableSelectData=[],this.tableSelectData=t,"项目报价"===this.type){let t=this.tableSelectData.map((t=>({sa_quotedprice_itemsid:"0",itemid:t.itemid,oldprice:t.marketprice,price:t.marketprice,discountrate:1,qty:1})));this.selectData=t}else{let t=this.tableSelectData.map((t=>({sa_quotedprice_itemsid:"0",itemid:t.itemid,oldprice:t.marketprice,price:t.marketprice,discountrate:1,qty:1})));this.selectData=t}},async selectListData(){const t=await this.$api.requested({id:20221021095503,content:{sa_quotedpriceid:this.$route.query.id}});this.selectTotal=t.total},brandChange(t){this.brandId=t,this.productData()},onClassChange(t){this.params.content.where.itemclassid=t.itemclassid,this.productData()},Search(t){this.params.content.where.condition=t,this.params.content.pageNumber=1,this.productData()},clearSearch(){this.params.content.where.condition="",this.params.content.pageNumber=1,this.productData()},clickField(t){this.params.content.where.tradefield=t.value,this.productData()},clickStandard(t){this.params.content.where.standards=t.value,this.productData()}},mounted(){}},c=o,d=a(43736),u=(0,d.Z)(c,i,s,!1,null,"0336eb3c",null),p=u.exports},57852:function(t,e,a){a.d(e,{Z:function(){return p}});var i=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"},on:{click:t.onShow}},[t._v("自项目产品添加")]),a("el-drawer",{attrs:{title:"自项目产品添加",visible:t.dialogProductVisible,"append-to-body":"",size:"80%","show-close":!1,direction:"rtl"},on:{"update:visible":function(e){t.dialogProductVisible=e},close:t.onColes}},[a("div",{staticClass:"drawer__panel"},[a("div",{staticClass:"flex-align-center flex-between "},[t._t("operation"),a("div",{staticClass:"flex-align-center"},[a("el-input",{attrs:{size:"small","suffix-icon":"el-icon-search",placeholder:"搜索",clearable:""},on:{clear:function(e){return t.productData(t.params.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.params.content.pageNumber=1)}},model:{value:t.params.content.where.condition,callback:function(e){t.$set(t.params.content.where,"condition",e)},expression:"params.content.where.condition"}}),t._v("  ")],1),a("div",{staticStyle:{"margin-top":"-10px","margin-bottom":"10px",float:"right"}},[a("div",[a("el-button",{staticStyle:{float:"right"},attrs:{type:"primary",size:"mini",disabled:0===t.tableSelectData.length},on:{click:t.batchSelect}},[t._v("批量添加")])],1)])],2),a("div",{staticClass:"container"},[a("selectClass",{ref:"classShow",attrs:{default:!0},on:{brandChange:t.brandChange,onClassChange:t.onClassChange,Search:t.Search,clearSearch:t.clearSearch,clickStandard:t.clickStandard,clickField:t.clickField}})],1),a("div",{staticClass:"produtMag-panel"},[a("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{height:"calc(100vh - 370px)",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:{align:"center",label:"产品图",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.attinfos[0]?a("div",[a("previewImage",{staticClass:"image",attrs:{image:e.row.attinfos[0],list:e.row.attinfos,deletebtn:!1}})],1):t._e()]}}])}),a("el-table-column",{attrs:{prop:"itemno",label:"品号",width:"180"}}),a("el-table-column",{attrs:{prop:"itemname",label:"品名",width:"180"}}),a("el-table-column",{attrs:{prop:"erpitemno",label:"品号",width:"180"}}),a("el-table-column",{attrs:{prop:"standards",label:"标准",width:"100"}}),a("el-table-column",{attrs:{label:"型号",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.model))])])]}}])}),a("el-table-column",{attrs:{label:"规格",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.spec))])])]}}])}),a("el-table-column",{attrs:{prop:"material",label:"材质",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.material||"--"))])])]}}])}),a("el-table-column",{attrs:{prop:"device",label:"装置",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.device||"--"))])])]}}])}),a("el-table-column",{attrs:{prop:"prodline",label:"产线",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.prodline||"--"))])])]}}])}),a("el-table-column",{attrs:{prop:"specalnote",label:"特殊说明",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.specalnote||"--"))])])]}}])}),a("el-table-column",{attrs:{prop:"brand",label:"品牌",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.brand,(function(i,s){return a("p",[s===e.row.brand.length-1?a("span",{staticStyle:{float:"left"}},[t._v(t._s(i?i.brandname+"":"--"))]):a("span",{staticStyle:{float:"left"}},[t._v(t._s(i?i.brandname+",":"--"))])])}))}}])}),a("el-table-column",{attrs:{prop:"itemclass",label:"类别",width:"0"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.itemclass,(function(i,s){return a("p",[s===e.row.itemclass.length-1?a("span",{staticStyle:{float:"left"}},[t._v(t._s(i?i.itemclassname+"":"--"))]):a("span",{staticStyle:{float:"left"}},[t._v(t._s(i?i.itemclassname+",":"--"))])])}))}}])}),a("el-table-column",{attrs:{prop:"unitid",label:"计量单位",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-tag",{attrs:{size:"mini",type:"info",effect:"plain"}},[t._v(t._s(e.row.unitname)+"/"+t._s(e.row.axunitname))])]}}])}),a("el-table-column",{attrs:{prop:"marketprice",label:"牌价(元)",fixed:"right",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.marketprice?e.row.marketprice:"--"))])]}}])}),a("el-table-column",{attrs:{prop:"totalPrice",fixed:"right",label:"操作",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){return t.onSelect(e.row)}}},[t._v("添 加")])]}}])})],1),a("div",[a("div",{staticStyle:{float:"left"}},[t._v("已选:"+t._s(t.selectTotal)+"个产品")]),a("div",{staticStyle:{"margin-top":"16px","text-align":"right"}},[a("el-pagination",{attrs:{background:"","current-page":t.params.content.pageNumber,"page-sizes":[20,50,100,200],"page-size":100,layout:"total,sizes, prev, pager, next, jumper",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)])],1)]),a("div",{staticClass:"fixed__btn__panel"},[a("el-button",{staticClass:"normal-btn-width",attrs:{size:"small"},on:{click:t.onColes}},[t._v("取 消")])],1)])],1)},s=[],r=a(33028),l=a(39115),n=a(74514),o={name:"productTable",props:["sa_projectid","type"],components:{uploadFile:r.Z,previewImage:l.Z,selectClass:n.Z},data(){return{dialogProductVisible:!1,tablecols:[],list:[],total:0,currentPage:0,tableSelectData:[],selectData:[],selectTotal:0,params:{id:20221020164903,content:{sa_projectid:"",sa_quotedpriceid:"",pageNumber:1,pageSize:100,where:{condition:"",tradefield:"",itemclassid:"",sa_brandid:"",standards:""}}},timer:0}},methods:{onShow(){this.dialogProductVisible=!0,setTimeout((()=>{this.params.content.where.tradefield=this.$refs.classShow.field_act,this.params.content.where.sa_brandid=this.$refs.classShow.brand_act,this.productData(),this.selectListData()}),1e3)},onColes(){this.dialogProductVisible=!1,this.$refs.classShow.queryClass(),this.$refs.classShow.queryStandard(),this.$refs.classShow.queryBrands(),this.$refs.classShow.queryAgentiInfo()},async onSubmit(t){console.log(this.selectData,"添加选择的产品");const e=await this.$api.requested({id:20221021095403,content:{sa_quotedpriceid:this.$route.query.id,items:t}});this.tool.showMessage(e,(()=>{this.$emit("productAdd"),this.productData(),this.selectListData()}))},batchSelect(){this.debounce(this.onSubmit(this.selectData),300)()},onSelect(t){this.tableSelectData=[],this.tableSelectData[0]=t;let e=this.tableSelectData.map((t=>({sa_quotedprice_itemsid:"0",itemid:t.itemid,oldprice:t.marketprice,price:t.price,discountrate:t.discountrate,qty:t.qty})));this.selectData=e,this.debounce(this.onSubmit(this.selectData),300)()},debounce(t,e){let a=this;return function(){null!==a.timer&&clearTimeout(a.timer),a.timer=setTimeout(t,e)}},queryProduct(t,e){this.dialogProductVisible=!0,this.params.content.sa_projectid=this.id,this.type=e,this.sa_quotedpriceid=t,this.productData()},async productData(){this.params.content.sa_quotedpriceid=this.$route.query.id,this.params.content.sa_projectid=this.sa_projectid;const t=await this.$api.requested(this.params);this.list=t.data,this.total=t.total,this.$nextTick((()=>{if("项目报价"===this.type)for(let t=0;t<this.list.length;t++)this.$refs.multipleTable.toggleRowSelection(this.list[t],!0)}))},handleSizeChange(t){this.params.content.pageSize=t,this.productData()},handleCurrentChange(t){this.params.content.pageNumber=t,this.productData()},onSuccess(){this.productData()},clearData(){this.search="",this.params.content.where.condition=this.search,this.productData()},queryClick(){this.params.content.where.condition=this.search,this.productData()},selectionChange(t){if(this.tableSelectData=[],this.tableSelectData=t,"项目报价"===this.type){let t=this.tableSelectData.map((t=>({sa_quotedprice_itemsid:"0",itemid:t.itemid,oldprice:t.marketprice,price:t.price,discountrate:t.discountrate,qty:t.qty})));this.selectData=t}else{let t=this.tableSelectData.map((t=>({sa_quotedprice_itemsid:"0",itemid:t.itemid,oldprice:t.marketprice,price:t.price,discountrate:t.discountrate,qty:t.qty})));this.selectData=t}},async selectListData(){const t=await this.$api.requested({id:20221021095503,content:{sa_quotedpriceid:this.$route.query.id}});this.selectTotal=t.total},brandChange(t){this.brandId=t,this.productData()},onClassChange(t){this.params.content.where.itemclassid=t.itemclassid,this.productData()},Search(t){this.params.content.where.condition=t,this.params.content.pageNumber=1,this.productData()},clearSearch(){this.params.content.where.condition="",this.params.content.pageNumber=1,this.productData()},clickField(t){this.params.content.where.tradefield=t.value,this.productData()},clickStandard(t){this.params.content.where.standards=t.value,this.productData()}},mounted(){}},c=o,d=a(43736),u=(0,d.Z)(c,i,s,!1,null,"26d04c29",null),p=u.exports},30585:function(t,e,a){a.d(e,{Z:function(){return f}});var i=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}}),"客户报价"===t.type?a("importExcel",{ref:"quoterImport",staticStyle:{float:"right","margin-right":"10px"},on:{onSuccess:t.onSuccess,checkForm:t.checkFormImport}}):t._e(),"项目报价"===t.type?a("productTableProject",{ref:"quoterPriceProject",staticStyle:{float:"right","margin-right":"10px"},attrs:{id:t.sa_projectid},on:{checkFormProject:t.checkFormProject,productAdd:t.productAddF}}):t._e(),a("productTable",{ref:"quoterPrice",staticStyle:{float:"right","margin-right":"10px"},attrs:{id:t.sa_projectid},on:{checkForm:t.checkForm,productAdd:t.productAddS}})],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:{align:"center",label:"产品图",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.attinfos[0]?a("div",[a("previewImage",{staticClass:"image",attrs:{image:e.row.attinfos[0],list:e.row.attinfos,deletebtn:!1}})],1):t._e()]}}])}),a("el-table-column",{attrs:{prop:"itemno",label:"品号",width:"180"}}),a("el-table-column",{attrs:{prop:"itemname",label:"品名",width:"180"}}),a("el-table-column",{attrs:{label:"型号",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.model))])])]}}])}),a("el-table-column",{attrs:{label:"规格",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.spec))])])]}}])}),a("el-table-column",{attrs:{prop:"caliber",label:"口径",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.caliber?e.row.caliber:"--"))])])]}}])}),a("el-table-column",{attrs:{prop:"pressure",label:"压力",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.pressure?e.row.pressure:"--"))])])]}}])}),a("el-table-column",{attrs:{prop:"material",label:"材质",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.material?e.row.material:"--"))])])]}}])}),a("el-table-column",{attrs:{prop:"brand",label:"品牌",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.brand,(function(i,s){return a("p",[s===e.row.brand.length-1?a("span",{staticStyle:{float:"left"}},[t._v(t._s(i?i.brandname+"":"--"))]):a("span",{staticStyle:{float:"left"}},[t._v(t._s(i?i.brandname+",":"--"))])])}))}}])}),a("el-table-column",{attrs:{prop:"itemclass",label:"类别",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.itemclass,(function(i,s){return a("p",[s===e.row.itemclass.length-1?a("span",{staticStyle:{float:"left"}},[t._v(t._s(i?i.itemclassname+"":"--"))]):a("span",{staticStyle:{float:"left"}},[t._v(t._s(i?i.itemclassname+",":"--"))])])}))}}])}),a("el-table-column",{attrs:{prop:"unitid",label:"计量单位",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-tag",{attrs:{size:"mini",type:"info",effect:"plain"}},[t._v(t._s(e.row.unitname)+"/"+t._s(e.row.axunitname))])]}}])}),a("el-table-column",{attrs:{prop:"num",label:"数量",fixed:"right",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input-number",{attrs:{size:"mini",min:1,label:"描述文字"},on:{change:function(a){return t.onChangeNum(e.row.qty,e.row,e.$index)}},model:{value:e.row.qty,callback:function(a){t.$set(e.row,"qty",a)},expression:"scope.row.qty"}})]}}])}),a("el-table-column",{attrs:{prop:"marketprice",label:"牌价(元)",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(e.row.marketprice?e.row.marketprice:"--"))])])]}}])}),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"}})]}}])}),a("el-table-column",{attrs:{prop:"mindiscountrate",label:"最低授权折扣(%)",fixed:"right",width:"80"}}),a("el-table-column",{attrs:{prop:"price",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.onChangePrice(e.row.price,e.row,e.$index)}},model:{value:e.row.price,callback:function(a){t.$set(e.row,"price",a)},expression:"scope.row.price"}})]}}])}),a("el-table-column",{attrs:{prop:"discountDifferenceAmount",label:"授权折扣差额(元)",fixed:"right",width:"80"}}),a("el-table-column",{attrs:{prop:"amount",label:"金额(元)",fixed:"right",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[a("span",[t._v(t._s(t.tool.formatAmount(e.row.amount,2)))])])]}}])}),a("el-table-column",{attrs:{prop:"specialoffer",fixed:"right",label:"是否特价",width:"60"},scopedSlots:t._u([{key:"default",fn:function(e){return[1===e.row.specialoffer?a("i",{staticClass:"el-icon-check",staticStyle:{color:"red","font-size":"20px"}}):t._e()]}}])})],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)])},s=[],r=a(33028),l=a(39115),n=a(27531),o=a(89523),c=a(32556),d=a(57852),u={props:["sa_projectid","type"],name:"quotedPriceProduct",components:{uploadFile:r.Z,previewImage:l.Z,productTable:n.Z,importExcel:o.Z,delProduct:c.Z,productTableProject:d.Z},data(){return{selectDel:[],totalPrice:0,step:1,tablecols:[],list:[],total:0,currentPage:0,changeList:[],sa_quotedpriceid:"",param:{id:20221021095503,content:{sa_quotedpriceid:"",pageNumber:1,pageSize:20,where:{condition:""}}}}},methods:{productAddF(){this.productData()},productAddS(){this.productData()},async productData(){console.log(this.sa_quotedpriceid,"报价单id"),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<this.list.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].qty*t.data[e].price;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")},checkFormProject(t){this.$emit("checkFormProject",t)},checkFormImport(){this.$emit("checkFormImport")},quoterImport(t){this.sa_quotedpriceid=t,this.$refs.quoterImport.onImport(t)},quoterPrice(t,e,a){this.sa_quotedpriceid=t,"project"===a?this.$refs.quoterPriceProject.queryProduct(t,e):this.$refs.quoterPrice.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 i=0;i<this.list.length;i++)this.totalPrice=this.totalPrice+this.list[i].qty*this.list[i].price;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 i=0;i<this.list.length;i++)this.totalPrice=this.totalPrice+this.list[i].qty*this.list[i].price;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 i=0;i<this.list.length;i++)this.totalPrice=this.totalPrice+this.list[i].qty*this.list[i].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)}))}},mounted(){console.log(this.sa_projectid,this.type,"产品报价信息")}},p=u,h=a(43736),m=(0,h.Z)(p,i,s,!1,null,"79b6b9b8",null),f=m.exports},89523:function(t,e,a){a.d(e,{Z:function(){return c}});var i=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("el-button",{attrs:{type:"success",size:"small",icon:"el-icon-upload"},on:{click:t.onshow}},[t._v("导 入")]),i("el-dialog",{staticClass:"import-panel",attrs:{visible:t.dialogUploadVisible,width:"500px","append-to-body":"","close-on-click-modal":!1,"show-close":!1,"before-close":t.clearFiles},on:{"update:visible":function(e){t.dialogUploadVisible=e}}},[i("div",{staticStyle:{padding:"20px"}},[i("el-upload",{ref:"my-upload",staticClass:"upload-demo normal-margin",staticStyle:{width:"100%"},attrs:{accept:".xls,.xlsx",action:"#","auto-upload":!1,"show-file-list":!1,"on-change":t.handleChange,drag:"",multiple:""}},[i("i",{staticClass:"el-icon-upload"}),i("div",{staticClass:"el-upload__text"},[t._v("将文件拖到此处,或"),i("em",[t._v("点击上传")])])]),t._l(t.filelist,(function(e){return i("div",{key:e.uid,staticClass:"progress_panel"},["DOC"===e.type||"DOCX"===e.type?i("img",{attrs:{width:"30",src:a(12349),alt:""}}):"PDF"===e.type?i("img",{attrs:{width:"30",src:a(58813),alt:""}}):"MP4"===e.type||"AVI"===e.type?i("img",{attrs:{width:"30",src:a(29902),alt:""}}):"XLS"===e.type||"XLSX"===e.type?i("img",{attrs:{width:"30",src:a(54005),alt:""}}):"PNG"===e.type||"JPG"===e.type||"JPEG"===e.type?i("img",{attrs:{width:"30",src:a(45968),alt:""}}):"PPT"===e.type||"PPTX"===e.type?i("img",{attrs:{width:"30",src:a(4858),alt:""}}):i("img",{attrs:{width:"30",src:a(63899),alt:""}}),i("div",[100===e.progress?i("p",{staticStyle:{float:"right"}},[i("span",{staticStyle:{color:"#67C23A"}},[t._v("●")]),t._v("上传成功")]):t._e(),i("p",[t._v(t._s(e.raw?e.raw.name:"暂无上传文件"))]),i("el-progress",{attrs:{percentage:e.progress,"show-text":!1}})],1)])})),t._t("errorFile"),i("p",{staticClass:"tips"},[t._v("• 为保证数据导入顺利,推荐您下载并使用"),i("a",{attrs:{href:t.modelurl}},[t._v("《Excel标准模板》")])]),i("p",{staticClass:"tips"},[t._v("• 文件中数据不能超过5000行")]),t.error?i("p",{staticStyle:{color:"#0048ff"}},[t._v("文件中存在错误数据")]):t._e(),t.error?i("a",{staticStyle:{color:"red"},attrs:{href:t.errorFile}},[t._v(t._s(t.errorFile))]):t._e(),i("div",{staticClass:"dialog-footer"},[i("el-button",{staticClass:"normal-btn-width",attrs:{size:"small"},on:{click:function(e){t.clearFiles(),t.error=!1,t.errorFile=""}}},[t._v("取 消")]),i("el-button",{staticClass:"normal-btn-width btn-warning",attrs:{size:"small",type:"warning"},on:{click:function(e){t.dialogUploadVisible=!1}}},[t._v("确 定")])],1)],2)])],1)},s=[],r={props:[],data(){return{folderid:JSON.parse(sessionStorage.getItem("folderid")).appfolderid,dialogUploadVisible:!1,params:{classname:"system.attachment.huawei.OBS",method:"getFileName",content:{filename:"",filetype:"",parentid:""}},file:{},filelist:[],CampaignList:[],activeName:"first",modelurl:"",campaignid:"",sa_quotedpriceid:"",error:!1,errorFile:""}},mounted(){this.getModelUrl()},methods:{handleChange(t,e){this.filelist=e;var a=t.raw.name.lastIndexOf("."),i=t.name.substr(a+1);this.params.content.filename=t.raw.name,this.params.content.filetype=i,this.getUploadUrl(t,i)},handleClick(){this.getModelUrl()},async getModelUrl(){const t=await this.$api.requested({id:"20221024141403",content:{}});this.modelurl=t.data},async getUploadUrl(t,e){this.params.content.parentid=this.folderid;const a=await this.$api.requested(this.params);let i=a.data.uploadurl,s=a.data.serialfilename;this.upoladFileToServer(i,t,e,s)},async upoladFileToServer(t,e,a,i){let s=this,r={headers:"pdf"===a?{"Content-Type":"application/pdf"}:{"Content-Type":"application/octet-stream"},onUploadProgress:function(t){let i=t.loaded/t.total*100;s.filelist.forEach((t=>{t.uid===e.uid&&(s.$set(t,"type",a.toUpperCase()),s.$set(t,"progress",i))}))}};await this.$upload.hw_upload(t,e.raw,r);this.createFileRecord(i)},async createFileRecord(t){let e={serialfilename:t};e=Object.assign({},e);let a={classname:"system.attachment.huawei.OBS",method:"uploadSuccess",content:e};const i=await this.$api.requested(a);this.importData(i.data.attachmentids[0])},async importData(t){const e=await this.$api.requested({id:"20221024141503",content:{sa_quotedpriceid:this.sa_quotedpriceid,attachmentid:t}});"成功"===e.data?this.tool.showMessage(e,(()=>{this.$emit("onSuccess"),this.clearFiles()})):(this.error=!0,this.errorFile=e.data)},clearFiles(){this.$refs["my-upload"].clearFiles(),this.filelist=[],this.dialogUploadVisible=!1},onshow(){this.$emit("checkForm")},onImport(t){this.sa_quotedpriceid=t,this.dialogUploadVisible=!0}}},l=r,n=a(43736),o=(0,n.Z)(l,i,s,!1,null,"56a505e8",null),c=o.exports}}]);