(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2e4caa1d"],{1426:function(t,e,a){"use strict";a.r(e);var i=a("2909"),o=a("c7eb"),r=a("1da1"),s=(a("a434"),a("a15b"),a("99af"),a("4e82"),a("14d9"),a("c740"),a("c4c8")),l=(a("d81d"),{props:{visible:{type:Boolean,default:!1},goods:{type:Object,default:function(){return{}}},attr:{type:Object,default:function(){return{}}},avatar:{type:Object,default:function(){return{}}},picture:{type:Array,default:function(){return[]}}},data:function(){return{formData:{avatar:"",nickname:"",comment:""},product_score:5,service_score:5,pics:[],add_time:"",visibleModal:!1}},watch:{picture:function(t){this.pics=t.map((function(t){return t.att_dir}))},visible:function(t){(this.visibleModal=t)||(this.formData.nickname="",this.formData.comment="",this.product_score=0,this.service_score=0,this.add_time="")}},methods:{removeUser:function(){this.avatar.att_dir=""},removePicture:function(t){this.$emit("removePicture",t)},onChange:function(t){this.add_time=t},callGoods:function(){this.$emit("callGoods")},callAttr:function(){this.$emit("callAttr")},callPicture:function(t){this.$emit("callPicture",t)},onOk:function(){var t,e=this;return this.goods.id?this.attr.image?this.avatar.att_dir?this.formData.nickname?this.formData.comment?this.product_score?this.service_score?(t={image:{image:this.goods.image,product_id:this.goods.id},suk:this.attr.suk,avatar:this.avatar.att_dir,nickname:this.formData.nickname,comment:this.formData.comment,product_score:this.product_score,service_score:this.service_score,pics:this.pics,add_time:this.add_time},void Object(s.E)(t).then((function(t){e.$message.success(t.msg),e.$emit("close",!1)})).catch((function(t){e.$message.error(t.msg)}))):this.$message.error("服务分数必须是1-5之间的整数"):this.$message.error("商品分数必须是1-5之间的整数"):this.$message.error("请填写评论内容"):this.$message.error("请填写用户昵称"):this.$message.error("请选择用户头像"):this.$message.error("请选择商品规格"):this.$message.error("请选择商品")},onCancel:function(){this.$emit("close",!1)}}}),n=(a("856a"),a("2877")),c=(l=Object(n.a)(l,(function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{visible:t.visibleModal,title:"添加自评",width:"720px","close-on-click-modal":!1},on:{"update:visible":function(e){t.visibleModal=e},close:t.onCancel}},[e("el-form",{attrs:{model:t.formData,"label-width":"100px","label-position":"right"}},[e("el-form-item",{attrs:{label:"商品:"}},[e("div",{staticClass:"upload-box",on:{click:t.callGoods}},[t.goods.id?e("img",{staticClass:"image",attrs:{src:t.goods.image}}):e("i",{staticClass:"el-icon-goods"})])]),t.goods.id?e("el-form-item",{attrs:{label:"商品规格:"}},[e("div",{staticClass:"upload-box",on:{click:t.callAttr}},[t.attr.image?e("img",{staticClass:"image",attrs:{src:t.attr.image}}):e("i",{staticClass:"el-icon-plus"})]),e("div",[t._v(t._s(t.attr.suk))])]):t._e(),e("el-form-item",{attrs:{label:"用户头像:"}},[e("div",{staticClass:"upload-box",on:{click:function(e){return t.callPicture("单选")}}},[t.avatar.att_dir?e("img",{staticClass:"image",attrs:{src:t.avatar.att_dir}}):t._e(),t.avatar.att_dir?e("i",{staticClass:"el-icon-error btn",on:{click:function(e){return e.stopPropagation(),t.removeUser.apply(null,arguments)}}}):e("i",{staticClass:"el-icon-user"})])]),e("el-form-item",{attrs:{label:"用户名称:"}},[e("el-input",{staticClass:"w100",attrs:{placeholder:"请输入用户名称"},model:{value:t.formData.nickname,callback:function(e){t.$set(t.formData,"nickname",e)},expression:"formData.nickname"}})],1),e("el-form-item",{attrs:{label:"评价文字:"}},[e("el-input",{staticClass:"w100",attrs:{type:"textarea",placeholder:"请输入评价文字"},model:{value:t.formData.comment,callback:function(e){t.$set(t.formData,"comment",e)},expression:"formData.comment"}})],1),e("el-form-item",{attrs:{label:"商品分数:"}},[e("el-rate",{model:{value:t.product_score,callback:function(e){t.product_score=e},expression:"product_score"}})],1),e("el-form-item",{attrs:{label:"服务分数:"}},[e("el-rate",{model:{value:t.service_score,callback:function(e){t.service_score=e},expression:"service_score"}})],1),e("el-form-item",{attrs:{label:"评价图片:"}},[e("div",{staticClass:"df-aic"},[t._l(t.picture,(function(a){return e("div",{key:a.att_id,staticClass:"upload-box"},[e("img",{staticClass:"image",attrs:{src:a.att_dir}}),e("i",{staticClass:"el-icon-error btn",on:{click:function(e){return e.stopPropagation(),t.removePicture(a.att_id)}}})])})),t.picture.length<8?e("div",{staticClass:"upload-box",on:{click:function(e){return t.callPicture("多选")}}},[e("i",{staticClass:"el-icon-picture-outline"})]):t._e()],2)]),e("el-form-item",{attrs:{label:"评价时间:"}},[e("el-date-picker",{staticStyle:{width:"414px"},attrs:{clearable:"",type:"datetime","range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期"},on:{change:t.onChange},model:{value:t.add_time,callback:function(e){t.add_time=e},expression:"add_time"}})],1)],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:t.onCancel}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.onOk}},[t._v("确 定")])],1)],1)}),[],!1,null,"7ee26125",null).exports,a("c4ad")),d=a("b0e7");l={name:"product_productEvaluate",components:{addReply:l,goodsList:c.default,uploadPictures:d.a},data:function(){return{templateRadio:0,modals:!1,replyModal:!1,pictureModal:!1,goodsModal:!1,attrModal:!1,grid:{xl:7,lg:10,md:12,sm:12,xs:24},gridPic:{xl:6,lg:8,md:12,sm:12,xs:12},gridBtn:{xl:4,lg:8,md:8,sm:8,xs:8},formValidate:{is_reply:"",data:"",store_name:"",key:"",order:"",account:"",product_id:void 0===this.$route.params.id?0:this.$route.params.id,page:1,limit:15},pickerOptions:this.$timeOptions,value:"45",tableList:[],goodsAddType:"",goodsData:{},attrData:{},avatarData:{},pictureData:[],selectProductAttrList:[],isChoice:"",picTit:"",tableIndex:0,total:0,loading:!1,timeVal:[],contents:{content:""},ruleInline:{content:[{required:!0,message:"请输入回复内容",trigger:"blur"}]},rows:{}}},computed:{},created:function(){0==this.$route.query.is_reply&&(this.formValidate.is_reply=this.$route.query.is_reply),this.getList()},watch:{"$route.params.id":function(t,e){this.formValidate.product_id=0,this.getList()},replyModal:function(t){t||(this.goodsData={},this.attrData={},this.avatarData={},this.pictureData=[],this.getList())}},methods:{addRep:function(){this.replyModal=!0},getRowKey:function(t){return t.unique},getTemplateRow:function(t){this.attrData=t,this.attrModal=!1},oks:function(){var t=this;this.modals=!0,this.$refs.contents.validate((function(e){if(!e)return!1;Object(s.F)(t.contents,t.rows.id).then(function(){var e=Object(r.a)(Object(o.a)().mark((function e(a){return Object(o.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.$message.success(a.msg),t.modals=!1,t.$refs.contents.resetFields(),t.getList();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$message.error(e.msg)}))}))},cancels:function(){this.modals=!1,this.$refs.contents.resetFields()},del:function(t,e,a){var i=this;e={title:e,num:a,url:"product/reply/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(e).then((function(t){i.$message.success(t.msg),i.tableList.splice(a,1),i.total=i.total-1})).catch((function(t){i.$message.error(t.msg)}))},reply:function(t){this.modals=!0,this.rows=t},onchangeTime:function(t){this.timeVal=t||[],this.formValidate.data=this.timeVal[0]&&this.timeVal?this.timeVal.join("-"):"",this.formValidate.page=1,this.getList()},sortMethod:function(t){"normal"===t.order?(this.formValidate.key="",this.formValidate.order=""):(this.formValidate.key=t.key,this.formValidate.order=t.order),this.getList()},close:function(t){this.replyModal=t,this.attrData={},this.templateRadio=""},selectChange:function(t){this.formValidate.data=t,this.timeVal=[],this.formValidate.page=1,this.getList()},getList:function(){var t=this;this.loading=!0,this.formValidate.is_reply=this.formValidate.is_reply||"",this.formValidate.store_name=this.formValidate.store_name||"",Object(s.A)(this.formValidate).then(function(){var e=Object(r.a)(Object(o.a)().mark((function e(a){var i;return Object(o.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=a.data,t.tableList=i.list,t.total=a.data.count,t.loading=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$message.error(e.msg)}))},userSearchs:function(){this.formValidate.page=1,this.getList()},search:function(){},callGoods:function(){this.goodsModal=!0},callAttr:function(){this.attrModal=!0},getProductId:function(t){this.goodsData=t,this.goodsModal=!1,this.attrData.unique="",this.templateRadio="",this.attrData={}},getPic:function(t){this.avatarData=t,this.pictureModal=!1},getPicD:function(t){var e=Object(i.a)(this.pictureData);(e=e.concat(t)).sort((function(t,e){return t.att_id-e.att_id}));for(var a=[],o=0;oc(e)?1:-1})),a=l(o),m=0;m