1 line
6.1 KiB
JavaScript
1 line
6.1 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-62ee6ae0"],{"0a6c":function(e,t,r){"use strict";r.r(t);var o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"workorder"},[r("div",{staticClass:"workorder__h"},[r("p",{staticClass:"workorder__h--p"},[e._v(e._s(e.$t("addworkorder1")))])]),r("div",{staticClass:"workorder__form"},[r("Form",{ref:"formValidate",staticClass:"workorder__form__box",attrs:{model:e.formValidate,rules:e.ruleValidate,"label-width":120}},[r("FormItem",{staticStyle:{width:"60%"},attrs:{label:e.$t("addworkorder2"),prop:"title"}},[r("Input",{attrs:{placeholder:""},model:{value:e.formValidate.title,callback:function(t){e.$set(e.formValidate,"title",t)},expression:"formValidate.title"}})],1),r("FormItem",{staticStyle:{width:"60%"},attrs:{label:e.$t("addworkorder3"),prop:"module_id"}},[r("Select",{attrs:{placeholder:""},on:{"on-change":e.changeModule},model:{value:e.formValidate.module_id,callback:function(t){e.$set(e.formValidate,"module_id",t)},expression:"formValidate.module_id"}},e._l(e.moduleList,(function(t){return r("Option",{key:t.key,attrs:{value:t.key}},[e._v(e._s(t.name))])})),1)],1),r("FormItem",{staticStyle:{width:"60%"},attrs:{label:e.$t("addworkorder4"),prop:"problem_desc"}},[r("Input",{attrs:{placeholder:"",type:"textarea",autosize:{minRows:6,maxRows:12}},model:{value:e.formValidate.problem_desc,callback:function(t){e.$set(e.formValidate,"problem_desc",t)},expression:"formValidate.problem_desc"}})],1),r("FormItem",{staticStyle:{width:"60%"},attrs:{label:e.$t("addworkorder5"),prop:"phone"}},[r("Input",{attrs:{placeholder:""},model:{value:e.formValidate.phone,callback:function(t){e.$set(e.formValidate,"phone",t)},expression:"formValidate.phone"}}),r("p",{staticStyle:{color:"#989898"}},[e._v(e._s(e.$t("addworkorder16")))])],1),r("FormItem",{staticStyle:{width:"60%"},attrs:{label:e.$t("addworkorder6"),prop:"file_ids"}},[r("Upload",{attrs:{action:"/api/platform.php?s=Platform.File.Upload",multiple:!0,data:{access_token:e.token},"on-success":e.handleUploadLogo,"max-size":2048,format:["jpg","jpeg","png"],"show-upload-list":"","before-upload":e.uploadList,"on-remove":e.removeUploadItem,"on-format-error":e.handleFormatError,"default-file-list":e.uploadImgList,"on-exceeded-size":e.handleMaxSize}},[r("Button",{attrs:{icon:"ios-cloud-upload-outline"}},[e._v(e._s(e.$t("addworkorder18")))]),r("span",{staticStyle:{color:"#989898"}},[e._v(e._s(e.$t("addworkorder17")))])],1)],1),r("FormItem",{staticStyle:{"padding-bottom":"30px"}},[r("Button",{attrs:{type:"primary"},on:{click:function(t){return e.handleSubmit("formValidate")}}},[e._v(e._s(e.$t("addworkorder7")))])],1)],1)],1)])},a=[],d=(r("a450"),r("779a")),i=r("c276"),l={name:"",data:function(){return{id:0,token:Object(i["g"])(),moduleList:[],uploadImgList:[],file_img:"",formValidate:{title:"",module_id:1,problem_desc:"",phone_pre:"",phone:"",file_ids:""},ruleValidate:{title:[{required:!0,message:this.$t("addworkorder8"),trigger:"blur"}],module_id:[{required:!0,message:this.$t("addworkorder12"),trigger:"blur",type:"number"}],problem_desc:[{required:!0,message:this.$t("addworkorder9"),trigger:"blur"}],phone:[{required:!0,message:this.$t("addworkorder10"),trigger:"blur"},{pattern:/^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/,message:this.$t("addworkorder11"),trigger:"blur"}]}}},created:function(){this.id=this.$route.query.id,this.getGetModuleLst()},methods:{handleSubmit:function(e){var t=this;t.$refs[e].validate((function(e){if(e){var r=new FormData;r.append("access_token",t.token),r.append("title",t.formValidate.title),r.append("module_id",t.formValidate.module_id),r.append("problem_desc",t.formValidate.problem_desc),r.append("phone",t.formValidate.phone),""!==t.file_img&&r.append("file_ids",t.file_img),Object(d["a"])(r).then((function(e){200===e.ret&&(t.$Message.success(t.$t("addworkorder13")),t.$router.push({name:"apiUsbWorkOrderList"}))}))}else t.$Message.error(t.$t("addworkorder14"))}))},getGetModuleLst:function(){var e=this,t=new FormData;t.append("access_token",e.token),Object(d["c"])(t).then((function(t){e.moduleList=t.data.filter((function(e){return 0!==e.key}))}))},changeModule:function(e){this.formValidate.module_id=e},uploadList:function(e){var t=this;return t.uploadImgList.length>=5?t.$Message.error(t.$t("addworkorder15")):(t.uploadImgList.push(e),t.uploadimg(e)),!1},removeUploadItem:function(e,t){this.uploadImgList=t},handleUploadLogo:function(e,t,r){},uploadimg:function(e){var t=this,r=new FormData;r.append("access_token",t.token),r.append("file",e),Object(d["f"])(r).then((function(e){t.file_img=t.file_img+e.data.id+","}))},handleFormatError:function(e){this.$Notice.warning({title:this.$t("document_format_error"),desc:this.$t("document_format_error_content")})},handleMaxSize:function(e){this.$Notice.warning({title:this.$t("file_too_large"),desc:this.$t("file_too_large_error_content")})}}},n=l,s=(r("d0b8"),r("4ac2")),u=Object(s["a"])(n,o,a,!1,null,"2025e974",null);t["default"]=u.exports},"779a":function(e,t,r){"use strict";r.d(t,"d",(function(){return a})),r.d(t,"a",(function(){return d})),r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return l})),r.d(t,"e",(function(){return n})),r.d(t,"f",(function(){return s})),r.d(t,"g",(function(){return u}));var o=r("66df"),a=function(e){return o["a"].request({method:"post",url:"platform.php?s=Platform.WorkOrder_WorkOrder.LstWorkOrder",data:e})},d=function(e){return o["a"].request({method:"post",url:"platform.php?s=Platform.WorkOrder_WorkOrder.AddWorkOrder",data:e})},i=function(e){return o["a"].request({method:"post",url:"platform.php?s=Platform.WorkOrder_WorkOrder.GetModuleLst",data:e})},l=function(e){return o["a"].request({method:"post",url:"platform.php?s=Platform.WorkOrder_WorkOrder.DetailWorkOrder",data:e})},n=function(e){return o["a"].request({method:"post",url:"platform.php?s=Platform.WorkOrder_WorkOrder.UpdateChatRecodeWorkOrder",data:e})},s=function(e){return o["a"].request({method:"post",url:"platform.php?s=Platform.File.Upload",data:e})},u=function(e){return o["a"].request({method:"post",url:"platform.php?s=Platform.File.UploadType",data:e})}},a7d4:function(e,t,r){},d0b8:function(e,t,r){"use strict";r("a7d4")}}]); |