chunk-4b1c.e35ebe18.js 12.9 KB
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-4b1c"],{"6PG/":function(e,t,i){"use strict";i.r(t);var r=i("jr1U"),n=i.n(r),o=i("4d7F"),a=i.n(o),s=i("P2sY"),l=i.n(s),c=i("tVFF"),u=i("s+7F"),d=i("7NVX"),p=i("hZMg"),m={name:"OrderEdit",components:{AddDialog:d.a,SearchTree:c.a,SearchTreeNoAsyc:u.a},props:{params:{type:Object,default:function(){return{}}},parentRef:{type:Object,default:function(){return{}}},fn:{type:Function,default:function(){return{}}}},data:function(){return{WEBURL:"https://bhg.didihu.com.cn",CONSTANTSSTATUS:this.$Constants.ORDERALLSTATUS,loading:!0,pickerOption:{},ruleForm:{carBrand:void 0,carColor:"",carVinNo:"",carSeries:void 0,carType:"",orderDeviceList:[],installRemark:"",orderFileList:[]},rules:{carBrand:[{type:"number",message:"请选择品牌",trigger:"change",placeholder:"请选择品牌"}],carSeries:[{type:"number",message:"请选择车系",trigger:"change",placeholder:"请选择车系"}],carType:[{type:"string",message:"请选择车型",trigger:"change",placeholder:"请选择车型"}],carColor:[{min:0,max:50,message:"请输入车身颜色",trigger:"blur",placeholder:"请输入车身颜色"}],carVinNo:[{min:0,max:50,message:"请输入车架号",trigger:"blur",placeholder:"请输入车架号"}],deviceNo:[{message:"请输入设备编号",trigger:"blur",placeholder:"请输入设备编号"}],installLocation:[{message:"请选择安装位置",trigger:"change",placeholder:"请选择安装位置"}],chooseSupplier:[{message:"请选择设备供应商",trigger:"change",placeholder:"请选择设备供应商"}]},serviceTypeOptions:[],serviceAsycType:[],reserveInstallReasonOptions:[],installLocationOptions:[],diaWidth:"1000px",isDisabled:!0,isDSC:!1,previewSrcList:[],photoConfList:[],vinResult:!1,snResult:!1}},watch:{},mounted:function(){var e=this;this.resetForm(),this.$nextTick(function(){e.getPhotoConfig(),e.getEditDetail(),e.isDisabled="edit"!==e.params.type}),this.getOcrResultByOrderId()},methods:{resetForm:function(){this.$set(this,"ruleForm",{carBrand:void 0,carColor:"",carVinNo:"",carSeries:void 0,carType:"",orderDeviceList:[],orderFileList:[]})},getPhotoConfig:function(){var t=this;Object(p.Xb)({id:this.params.id}).then(function(e){t.photoConfList=e.data.map(function(e){return e.isRequired})})},getEditDetail:function(){var n=this;Object(p.zb)({id:this.params.id}).then(function(e){if(n.loading=!1,e&&200==e.code){var i=e.data;n.isDSC="DSC"==i.channel;var t={orderSn:i.orderSn,workOrderNo:i.workOrderNo,orderChannel:i.orderChannel,carBrand:Number(i.carBrand)&&null!=i.carBrand?Number(i.carBrand):void 0,carSeries:Number(i.carSeries)&&null!=i.carSeries?Number(i.carSeries):void 0,carType:String(i.carType)&&"null"!=String(i.carType)?String(i.carType):"",carColor:i.carColor,carVinNo:i.vinNo,installRemark:i.installRemark,orderDeviceList:i.orderDeviceList,orderFileList:i.orderFileList.sort(function(e,t){return e.sort-t.sort})};t.orderDeviceList.map(function(e){e.installLocationOptions="DSC"==i.channel?n.$Constants.DSC_INSTALL_LOCATION[e.deviceType]:n.$Constants.INSTALL_LOCATION;var t=e.installLocationOptions.indexOf(e.installLocation);e.extraLocation="其他"===e.installLocation||!(-1<t),e.installLocationIdx=e.extraLocation?e.installLocationOptions.length-1:t}).sort(function(e,t){return e.sort-t.sort});var r=l()({},n.ruleForm,t);n.$set(n,"ruleForm",{}),n.$nextTick(function(){n.$set(n,"ruleForm",r)})}})},verifyDetail:function(){var o=this;return new a.a(function(r,n){o.$refs.ruleForm.validate(function(e){if(e){var i=[];o.ruleForm.orderDeviceList.forEach(function(e){var t={deviceNo:e.deviceNo,deviceType:e.deviceType,installLocation:e.installLocation,sort:e.sort,id:e.id};o.isDSC&&(t.chooseSupplier=e.chooseSupplier,t.indexNo=e.indexNo),i.push(t)});var t={orderId:o.params.id,installRemark:o.ruleForm.installRemark,orderDeviceList:i,orderFileList:o.ruleForm.orderFileList};r(t)}else n()})})},handleClickImg:function(e,t){var i=this.ruleForm.orderFileList.map(function(e){return e.filePath});this.previewSrcList=t?n()(i.slice(t),i.slice(0,t)):i,this.previewSrcList=this.previewSrcList.filter(function(e){return!!e})},handleBack:function(){var t=this;this.verifyDetail().then(function(e){t.$emit("handleDetailBack",e)}).catch(function(){})},handleComfirm:function(){var t=this;this.verifyDetail().then(function(e){t.$emit("handleDetailConfirm",e)}).catch(function(){})},handleUpload:function(e,t,i){this.ruleForm.orderFileList[i].filePath=e.data,this.loading=!1,this.manualOcrRecognition(e.data,t.fileName)},handleDelete:function(e,t){var i=this;this.$confirm("是否删除该图片?","删除",{type:"warning"}).then(function(){i.ruleForm.orderFileList[t].filePath=""}).catch(function(){})},uploadImageChange:function(e,t){this.loading=!0;var i="image/jpeg"===e.type||"image/png"===e.type||"image/jpg"===e.type||"image/bmp"===e.type,r=e.size/1024/1024<20;return i?r?i&&r:(this.$message.error("上传的"+t+"大小不能超过 20MB!"),this.loading=!1):(this.$message.error("上传的"+t+"只能是JPG/JPEG/PNG/BMP格式!"),this.loading=!1)},installLocationChange:function(e){e.extraLocation=e.installLocationOptions[e.installLocationIdx]===this.$Constants.INSTALL_LOCATION[this.$Constants.INSTALL_LOCATION.length-1],e.extraLocation?e.installLocation="":e.installLocation=e.installLocationOptions[e.installLocationIdx]},getOcrResultByOrderId:function(){var t=this;Object(p.Pb)({orderId:this.params.id}).then(function(e){200==e.code?(t.vinResult=e.data.vinResult,t.snResult=e.data.snResult):message.error("获取验证结果失败")})},manualOcrRecognition:function(e,t){var i=this,r=[];this.ruleForm.orderDeviceList.forEach(function(e){r.push(e.deviceNo)}),r=r.join(",");var n={orderId:this.params.id,filePath:e,sns:r,vin:this.ruleForm.carVinNo,fileName:t};this.$store.dispatch("SetIsJson",!0),Object(p.Lc)(n,"accountDetailAudit","post").then(function(e){200==e.code||message.error("调用OCR识别失败")}),setTimeout(function(){i.$store.dispatch("SetIsJson",!1)},3e3)}}},h=(i("nCAs"),i("Iqyh"),i("KHd+")),v=Object(h.a)(m,function(){var r=this,e=r.$createElement,n=r._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:r.loading,expression:"loading"}],staticClass:"detail-container-order",attrs:{"element-loading-text":"hard working..."}},[n("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:r.ruleForm,rules:r.rules,"label-width":"100px"}},[n("h3",[r._v("设备信息")]),r._v(" "),r._l(r.ruleForm.orderDeviceList,function(t,e){return n("div",{key:e,staticClass:"h3_part"},[n("el-form-item",{staticClass:"width-33 pr-0",attrs:{prop:"orderDeviceList."+e+".deviceNo",rules:{required:!0,message:"请输入设备信息",trigger:"blur"},label:"设备编号"}},[n("el-input",{attrs:{placeholder:r.rules.deviceNo[0].placeholder,disabled:r.isDisabled},model:{value:t.deviceNo,callback:function(e){r.$set(t,"deviceNo","string"==typeof e?e.trim():e)},expression:"subItem.deviceNo"}})],1),r._v(" "),n("div",{staticClass:"width-33 pl-0"},[t.isInstallLocation?n("el-form-item",{attrs:{prop:"orderDeviceList."+e+".installLocationIdx",rules:{required:!0,message:"请选择安装位置",trigger:"change"},label:"安装位置"}},[n("el-select",{attrs:{placeholder:r.rules.installLocation[0].placeholder,disabled:r.isDisabled},on:{change:function(e){r.installLocationChange(t)}},model:{value:t.installLocationIdx,callback:function(e){r.$set(t,"installLocationIdx",e)},expression:"subItem.installLocationIdx"}},r._l(t.installLocationOptions,function(e,t){return n("el-option",{key:t,attrs:{label:e,value:t}})}))],1):r._e()],1),r._v(" "),t.isInstallLocation&&t.extraLocation?n("el-form-item",{attrs:{prop:"orderDeviceList."+e+".installLocation",rules:{required:!0,message:"请输入安装位置",trigger:"change"}}},[n("span",{staticClass:"required"},[r._v("*")]),r._v(" "),n("el-input",{attrs:{disabled:r.isDisabled,placeholder:"请输入安装位置"},model:{value:t.installLocation,callback:function(e){r.$set(t,"installLocation","string"==typeof e?e.trim():e)},expression:"subItem.installLocation"}})],1):r._e(),r._v(" "),r.isDSC?n("el-form-item",{staticClass:"width-33 pl-0",attrs:{prop:"orderDeviceList."+e+".chooseSupplier",rules:{required:!0,message:"请选择设备供应商",trigger:"change"},label:"设备供应商"}},[n("el-select",{attrs:{placeholder:r.rules.chooseSupplier[0].placeholder,disabled:r.isDisabled},model:{value:t.chooseSupplier,callback:function(e){r.$set(t,"chooseSupplier",e)},expression:"subItem.chooseSupplier"}},r._l(t.suppliers,function(e,t){return n("el-option",{key:t,attrs:{label:e,value:e}})}))],1):r._e()],1)}),r._v(" "),n("div",{staticClass:"h3_part"},[n("el-form-item",{attrs:{label:"备注",prop:"installRemark"}},[n("el-input",{attrs:{disabled:r.isDisabled,rows:4,maxlength:"200","show-word-limit":"",type:"textarea"},model:{value:r.ruleForm.installRemark,callback:function(e){r.$set(r.ruleForm,"installRemark",e)},expression:"ruleForm.installRemark"}})],1)],1),r._v(" "),n("h3",[r._v("车辆信息")]),r._v(" "),n("div",{staticClass:"h3_part"},[n("el-form-item",{attrs:{label:"车架号",prop:"carVinNo"}},[n("el-input",{attrs:{placeholder:r.rules.carVinNo[0].placeholder,disabled:r.isDisabled},model:{value:r.ruleForm.carVinNo,callback:function(e){r.$set(r.ruleForm,"carVinNo","string"==typeof e?e.trim():e)},expression:"ruleForm.carVinNo"}})],1)],1),r._v(" "),n("div",{staticClass:"ocr-box"},[n("div",{staticClass:"title"},[r._v("OCR验证")]),r._v(" "),n("div",[n("span",{class:r.vinResult?"vin-result-success":null===r.vinResult?"":"vin-result-error",staticStyle:{"margin-right":"6px"}},[r._v(r._s(r.vinResult?"车架号验证通过":null===r.vinResult?"结果识别中…":"车架号验证不通过"))]),r._v(" "),n("span",{class:r.snResult?"vin-result-success":null===r.snResult?"":"vin-result-error"},[r._v(r._s(r.snResult?"设备号验证通过":null===r.snResult?"结果识别中…":"设备号验证不通过"))]),r._v(" "),n("el-button",{staticClass:"ocr-btn",attrs:{size:"mini",round:""},on:{click:r.getOcrResultByOrderId}},[r._v("验证结果刷新")])],1)]),r._v(" "),n("div",[n("h3",[r._v("安装照片")]),r._v(" "),n("div",{staticClass:"h3_part_img"},r._l(r.ruleForm.orderFileList,function(t,i){return n("div",{key:i,staticClass:"width-33 text-center"},[n("el-form-item",{attrs:{prop:"orderFileList."+i+".filePath",rules:{required:r.photoConfList[i],message:"请上传图片",trigger:"change"}}},[n("span",{staticClass:"demonstration"},[r._v(r._s(t.fileName))]),r._v(" "),n("el-image",{staticClass:"install-img",attrs:{src:t.filePath,"preview-src-list":r.previewSrcList},on:{click:function(e){r.handleClickImg(t,i)}}},[n("div",{staticClass:"el-image__error",attrs:{slot:"error"},slot:"error"},[r._v("\n                "+r._s(t.fileDesc)+"\n                ")])])],1),r._v(" "),r.isDisabled?r._e():n("div",{staticClass:"img-btns"},[n("el-upload",{ref:"pictures",refInFor:!0,staticStyle:{display:"inline-block"},attrs:{action:r.WEBURL+"/carservice/publicservice/common/uploadFile","show-file-list":!1,"on-success":function(e){return r.handleUpload(e,t,i)},"on-error":function(e){return r.uploadError(e,"附件")},"before-upload":function(e){return r.uploadImageChange(e,t.fileName)},header:"Access-Control-Allow-Origin"}},[n("el-button",{attrs:{size:"mini",icon:"el-icon-upload2"}},[r._v("上传")])],1),r._v(" "),n("el-button",{attrs:{disabled:!t.filePath,size:"mini",icon:"el-icon-delete"},on:{click:function(e){r.handleDelete(t,i)}}},[r._v("删除")])],1)],1)}))])],2)],1)},[],!1,null,"45c82720",null);v.options.__file="detail.vue",t.default=v.exports},InzB:function(e,t,i){},Iqyh:function(e,t,i){"use strict";var r=i("Pe7H");i.n(r).a},Pe7H:function(e,t,i){},WEEz:function(e,t,i){"use strict";var r=i("Kw5r");r.default.directive("dialogDrag",{bind:function(e,t,i,r){var s,l,c=-1<e.className.indexOf("dialogDragNoHeader")?e.querySelector(".el-tabs__header"):e.querySelector(".el-dialog__header");if(s="el-tabs__header is-top"==c.className?(l=!0,document.querySelectorAll(".el-dialog")[t.value]):(l=!1,e.querySelector(".el-dialog")),c.style.cursor="move",s){var u=s&&s.currentStyle||window.getComputedStyle(s,null);c.onmousedown=function(e){var r=e.clientX-(l?0:c.offsetLeft),n=e.clientY-(l?0:c.offsetTop),o=void 0,a=void 0;a=u.left.includes("%")?(o=+document.body.clientWidth*(+u.left.replace(/\%/g,"")/100),+document.body.clientHeight*(+u.top.replace(/\%/g,"")/100)):(o=+u.left.replace(/\px/g,""),+u.top.replace(/\px/g,"")),document.onmousemove=function(e){var t=e.clientX-r,i=e.clientY-n;s.style.left=t+o+"px",s.style.top=i+a+"px"},document.onmouseup=function(e){document.onmousemove=null,document.onmouseup=null}}}}}),r.default.directive("dialogDragWidth",{bind:function(t,e,i,r){var n=e.value.$el.querySelector(".el-dialog");t.onmousedown=function(e){var i=e.clientX-t.offsetLeft;document.onmousemove=function(e){e.preventDefault();var t=e.clientX-i;n.style.width=t+"px"},document.onmouseup=function(e){document.onmousemove=null,document.onmouseup=null}}}})},jr1U:function(e,t,i){e.exports={default:i("wObO"),__esModule:!0}},nCAs:function(e,t,i){"use strict";var r=i("InzB");i.n(r).a},wObO:function(e,t){e.exports=function(){return Function.call.apply(Array.prototype.concat,arguments)}}}]);