2 lines
9.0 KiB
JavaScript
2 lines
9.0 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6a9aec96"],{"078e":function(e,t,o){"use strict";o("28ba")},"1a9a":function(e,t,o){"use strict";o("8e9d")},"28ba":function(e,t,o){},"55ba":function(e,t,o){},"5e31":function(e,t,o){"use strict";var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"upload-image-container"},[e._l(e.photos,(function(o,s){return t("div",{key:s,staticClass:"image-item"},[t("el-image",{staticStyle:{width:"100px",height:"100px"},attrs:{src:o,fit:"cover","preview-src-list":e.photos}}),t("i",{staticClass:"el-icon-delete delete-icon",on:{click:function(t){return e.removeImage(s)}}})],1)})),e.photos.length<e.imageCount?t("div",{staticClass:"upload-button",on:{click:e.triggerUpload}},[t("i",{staticClass:"el-icon-plus"})]):e._e(),t("input",{ref:"fileInput",attrs:{type:"file",accept:"image/*",hidden:""},on:{change:e.handleFileChange}})],2)},i=[],a=o("3549"),n={name:"UploadImageUrl",props:{imageCount:{type:Number,default:1}},data(){return{photos:[],photosUrl:[]}},methods:{triggerUpload(){this.$refs.fileInput.click()},async handleFileChange(e){const t=e.target.files[0];if(!t)return;if(t.size>2097152)return void this.$message.error("图片大小不能超过2MB");const o=new FileReader;o.onload=e=>{this.photos.push(e.target.result)},o.readAsDataURL(t);try{const e=new FormData;e.append("uploadFile",t),e.append("communityId","-1");const{data:o}=await Object(a["b"])(e);this.photosUrl.push(o.url),this.$emit("notifyUploadCoverImage",this.photosUrl)}catch(s){this.$message.error(s.message||"上传失败")}e.target.value=null},removeImage(e){this.photos.splice(e,1),this.photosUrl.splice(e,1),this.$emit("notifyUploadCoverImage",this.photosUrl)},clearImages(){this.photos=[],this.photosUrl=[]},setImages(e){this.clearImages(),e.forEach(e=>{if(!(e.indexOf("base64,")>-1))return e.indexOf("http")>-1?(this.photos.push(e),void this.photosUrl.push(e)):void this.photosUrl.push(e);this.photos.push(e)})}}},l=n,r=(o("e457"),o("2877")),c=Object(r["a"])(l,s,i,!1,null,"c3e7566c",null);t["a"]=c.exports},"8e9d":function(e,t,o){},e457:function(e,t,o){"use strict";o("55ba")},f2ab:function(e,t,o){"use strict";o.r(t);var s=function(){var e=this,t=e._self._c;return t("div",[t("el-row",[t("el-col",{attrs:{span:24}},[t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v("项目收费")]),t("div",[t("el-button",{attrs:{type:"primary",size:"small"},on:{click:e._chooseServFees}},[e._v("选择费用")])],1)]),t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.finishHousekeepingPoolInfo.fees,border:"",stripe:""}},[t("el-table-column",{attrs:{prop:"typeName",label:"费用大类",align:"center"}}),t("el-table-column",{attrs:{prop:"feeName",label:"费用名称",align:"center"}}),t("el-table-column",{attrs:{prop:"price",label:"收费金额",align:"center"}}),t("el-table-column",{attrs:{label:"实收金额",align:"center"},scopedSlots:e._u([{key:"default",fn:function(o){return["1001"==o.row.state?t("el-input",{attrs:{placeholder:"请输入实际收入金额",size:"small"},model:{value:o.row.payPrice,callback:function(t){e.$set(o.row,"payPrice",t)},expression:"scope.row.payPrice"}}):t("span",[e._v(e._s(o.row.payPrice))])]}}])}),t("el-table-column",{attrs:{label:"状态",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s("1001"==t.row.state?"未支付":"已支付")+" ")]}}])}),"1001"==e.scope.row.state?t("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(o){return[t("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(t){return e._deleteFee(o.$index)}}},[e._v("删除")])]}}],null,!1,556187731)}):e._e()],1)],1)],1)],1),t("el-row",{staticStyle:{"margin-top":"20px"}},[t("el-col",{attrs:{span:24}},[t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v("工单结单")])]),t("el-form",{attrs:{"label-width":"100px"}},[t("el-form-item",{attrs:{label:"处理意见"}},[t("el-input",{attrs:{type:"textarea",rows:3,placeholder:"必填,请填写处理意见"},model:{value:e.finishHousekeepingPoolInfo.context,callback:function(t){e.$set(e.finishHousekeepingPoolInfo,"context",t)},expression:"finishHousekeepingPoolInfo.context"}})],1),t("el-form-item",{attrs:{label:"处理前图片"}},[t("upload-image",{ref:"beforeRepairUpload",attrs:{callBackListener:"finishHousekeepingPoolInfo",callBackFunction:"notifyUploadBeforeReapirImage"}})],1),t("el-form-item",{attrs:{label:"处理后图片"}},[t("upload-image",{ref:"afterRepairUpload",attrs:{callBackListener:"finishHousekeepingPoolInfo",callBackFunction:"notifyUploadAfterReapirImage"}})],1),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e._finishHousekeepingPoolInfo}},[e._v("提交")]),t("el-button",{staticStyle:{"margin-left":"20px"},on:{click:e._back}},[e._v("返回")])],1)],1)],1)],1)],1),t("choose-housekeeping-serv-fee",{ref:"chooseHousekeepingServFee",on:{chooseHousekeepingServFee:e.handleChooseHousekeepingServFee}})],1)},i=[],a=o("7323"),n=o("b775");function l(e){return new Promise((t,o)=>{Object(n["a"])({url:"/housekeepingFeeConfig.queryHousekeepingServConfig",method:"get",params:e}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}function r(e){return new Promise((t,o)=>{Object(n["a"])({url:"/storeOrder.queryStoreOrderCartFee",method:"get",params:e}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}function c(e){return new Promise((t,o)=>{Object(n["a"])({url:"/housekeeping.servPoolFinish",method:"post",data:e,headers:{"Content-Type":"application/json"}}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}var p=o("5e31"),h=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:"选择服务费用",visible:e.dialogVisible,width:"80%","before-close":e.handleClose},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.chooseHousekeepingServFeeInfo.housekeepingServFees,border:"",stripe:""}},[t("el-table-column",{attrs:{prop:"feeName",label:"费用名称",align:"center"}}),t("el-table-column",{attrs:{prop:"typeName",label:"费用大类",align:"center"}}),t("el-table-column",{attrs:{prop:"computingFormula",label:"计算公式",align:"center"}}),t("el-table-column",{attrs:{prop:"feePrice",label:"金额",align:"center"}}),t("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(o){return[t("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.handleChoose(o.row)}}},[e._v("选择")])]}}])})],1)],1)},u=[],d={data(){return{dialogVisible:!1,chooseHousekeepingServFeeInfo:{housekeepingServFees:[],servId:""}}},methods:{open(e){this.chooseHousekeepingServFeeInfo.servId=e.servId,this._loadHousekeepingServFees(),this.dialogVisible=!0},handleClose(){this.dialogVisible=!1},handleChoose(e){this.$emit("chooseHousekeepingServFee",e),this.dialogVisible=!1},_loadHousekeepingServFees(){let e=Object(a["f"])();l({page:1,row:10,shopId:e,servId:this.chooseHousekeepingServFeeInfo.servId}).then(e=>{this.chooseHousekeepingServFeeInfo.housekeepingServFees=e.data}).catch(e=>{console.error("请求失败:",e)})}}},f=d,g=(o("078e"),o("2877")),m=Object(g["a"])(f,h,u,!1,null,"6fad9d80",null),b=m.exports,v={components:{UploadImage:p["a"],ChooseHousekeepingServFee:b},data(){return{finishHousekeepingPoolInfo:{poolId:"",servId:"",context:"",fees:[],beforeRepairPhotos:[],afterRepairPhotos:[]},shopId:"",validateErrInfo:""}},created(){this.shopId=Object(a["f"])(),console.log(l),this.finishHousekeepingPoolInfo.poolId=this.$route.query.poolId,this.finishHousekeepingPoolInfo.servId=this.$route.query.servId,this._loadPoolFees()},methods:{_chooseServFees(){this.$refs.chooseHousekeepingServFee.open({servId:this.finishHousekeepingPoolInfo.servId})},handleChooseHousekeepingServFee(e){e.state="1001",e.price=e.feePrice,e.payPrice=e.feePrice,this.finishHousekeepingPoolInfo.fees.push(e)},_finishHousekeepingPoolInfo(){if(!this.finishHousekeepingPoolValidate())return void this.$message.error(this.validateErrInfo);let e=this.finishHousekeepingPoolInfo.fees.filter(e=>"1001"==e.state&&!e.cartId),t={shopId:this.shopId,poolId:this.finishHousekeepingPoolInfo.poolId,context:this.finishHousekeepingPoolInfo.context,fees:e};c(t).then(e=>{0===e.code?(this.$message.success(e.msg),this._back()):this.$message.error(e.msg)}).catch(e=>{this.$message.error(e)})},_deleteFee(e){this.finishHousekeepingPoolInfo.fees.splice(e,1)},_loadPoolFees(){r({page:1,row:50,poolId:this.finishHousekeepingPoolInfo.poolId,shopId:this.shopId}).then(e=>{this.finishHousekeepingPoolInfo.fees=e.data}).catch(e=>{console.error("请求失败:",e)})},_back(){this.$router.go(-1)},finishHousekeepingPoolValidate(){return this.finishHousekeepingPoolInfo.poolId?!!this.finishHousekeepingPoolInfo.context||(this.validateErrInfo="处理意见不能为空",!1):(this.validateErrInfo="报修单不能为空",!1)}}},I=v,k=(o("1a9a"),Object(g["a"])(I,s,i,!1,null,"7e812058",null));t["default"]=k.exports}}]);
|
|
//# sourceMappingURL=chunk-6a9aec96.deb780ce.js.map
|