chunk-1340b24e.4d4b900c.js 11 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1340b24e"],{"337d":function(t,e,n){"use strict";var r=n("4f5f"),o=n.n(r);o.a},"36b1":function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"xianzhiziyuan-add"},[n("div",{staticClass:"form"},[n("div",{staticClass:"form-item",staticStyle:{display:"flex",padding:"20px 0px"}},[t._m(0),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.name,expression:"form.name"}],attrs:{placeholder:"请输入",type:"text"},domProps:{value:t.form.name},on:{input:function(e){e.target.composing||t.$set(t.form,"name",e.target.value)}}})]),n("div",{staticClass:"form-item",staticStyle:{display:"flex",padding:"20px 0px"},on:{click:function(e){return t.goodsType("goodsType")}}},[t._m(1),n("div",{staticStyle:{width:"65%",display:"flex","justify-content":"space-between","padding-right":"10px"}},[0==t.goodsTypeArray.length?n("div",{staticStyle:{color:"#6c6c6c"}},[t._v("\n 请选择\n ")]):t._e(),0==t.goodsTypeArray.length?n("div",{staticStyle:{color:"#6c6c6c"}},[t._v(">")]):t._l(t.goodsTypeArray,function(e){return n("span",[t._v("\n "+t._s(e.value+",")+"\n ")])})],2)]),n("div",{staticClass:"form-item",staticStyle:{display:"flex",padding:"20px 0px"},on:{click:function(e){return t.openParkSelect("useTypeText")}}},[n("div",{staticClass:"form-label width30"},[t._v("使用方式:")]),n("div",{staticStyle:{width:"60%",display:"flex","justify-content":"space-between","padding-right":"10px"}},[n("div",{style:{color:t.form.useTypeText?"":"#6c6c6c"}},[t._v("\n "+t._s(t.form.useTypeText?t.form.useTypeText:"请选择")+"\n ")])]),0==t.goodsTypeArray.length?n("div",{staticStyle:{"text-align":"left",color:"#6c6c6c"}},[t._v("\n >\n ")]):t._e()]),n("div",{staticClass:"form-item",staticStyle:{display:"flex",padding:"20px 0px"}},[t._m(2),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.initUseMoney,expression:"form.initUseMoney"}],attrs:{placeholder:"请输入",type:"text"},domProps:{value:t.form.initUseMoney},on:{input:function(e){e.target.composing||t.$set(t.form,"initUseMoney",e.target.value)}}})]),n("div",{staticClass:"form-item",staticStyle:{display:"flex",padding:"20px 0px"}},[t._m(3),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.connectName,expression:"form.connectName"}],attrs:{placeholder:"请输入",type:"text"},domProps:{value:t.form.connectName},on:{input:function(e){e.target.composing||t.$set(t.form,"connectName",e.target.value)}}})]),n("div",{staticClass:"form-item",staticStyle:{display:"flex",padding:"20px 0px"}},[t._m(4),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.connectPhone,expression:"form.connectPhone"}],attrs:{placeholder:"请输入",type:"text"},domProps:{value:t.form.connectPhone},on:{input:function(e){e.target.composing||t.$set(t.form,"connectPhone",e.target.value)}}})]),n("div",{staticClass:"form-item",staticStyle:{padding:"20px 0px"}},[t._m(5),n("van-uploader",{attrs:{multiple:!0,"max-count":6,"after-read":t.afterRead,"before-delete":t.beforeDelete},model:{value:t.componentsFileUrlList,callback:function(e){t.componentsFileUrlList=e},expression:"componentsFileUrlList"}})],1),n("div",{staticClass:"form-item"},[t._m(6),n("div",{staticStyle:{"margin-top":"8px"}},[n("van-field",{attrs:{autosize:"",maxlength:"5000",placeholder:"请输入留言",rows:"2","show-word-limit":"",type:"textarea"},model:{value:t.form.info,callback:function(e){t.$set(t.form,"info",e)},expression:"form.info"}})],1)])]),n("div",{staticClass:"btn-view"},[n("button",{staticClass:"btn btn1",on:{click:function(e){return t.goBack()}}},[t._v("关闭")]),n("button",{staticClass:"btn btn2",on:{click:function(e){return t.submitData(2)}}},[t._v("保存")]),n("button",{staticClass:"btn btn2",on:{click:function(e){return t.submitData(0)}}},[t._v("提交")])]),n("zhaozu-select",{ref:"zhaozuSelect",attrs:{columns:t.dc_data.sunan_idle_resource_type},on:{getZhaozuType:t.getZhaozuType}}),n("current-select",{ref:"userType",attrs:{columns:t.userType},on:{getAboultPark:t.getAboultPark}})],1)},o=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-label width30"},[n("span",{staticClass:"required"},[t._v("*")]),t._v("资源名称:\n ")])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-label width30"},[n("span",{staticClass:"required"},[t._v("*")]),t._v("资源类别:\n ")])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-label width30"},[n("span",{staticClass:"required"},[t._v("*")]),t._v("参考金额(元):\n ")])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-label width30"},[n("span",{staticClass:"required"},[t._v("*")]),t._v("联系人:\n ")])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-label width30"},[n("span",{staticClass:"required"},[t._v("*")]),t._v("联系电话:\n ")])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-label width30"},[n("span",{staticClass:"required"},[t._v("*")]),t._v("资源图片:\n ")])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"form-label",staticStyle:{padding:"5px 0px"}},[n("span",{staticClass:"required"},[t._v("*")]),t._v("资源描述:\n ")])}],a=n("795b"),i=n.n(a),s=(n("6b54"),n("96cf"),n("3b8d")),c=(n("28a5"),n("7f7f"),n("3089")),l=n("da5e"),u=n("ff4f"),d=n("bc3a"),f=n.n(d),m=n("06a8"),p=n("b4db"),h=n("5cab"),y={name:"xianzhiziyuan-add",components:{Form:c["Form"],Field:c["Field"],currentSelect:l["a"],zhaozuSelect:u["a"]},mixins:[m["a"]],data:function(){return{myFileList:[],sunan_idle_resource_type:[],dc_data:{},userType:[{text:"租赁",value:1},{text:"购买",value:2}],dc_key:["sunan_idle_resource_type"],pattern:/\d{6}/,active:"",form:{},fileList:[],id:"",goodsTypeArray:[],componentsFileUrlList:[]}},mounted:function(){var t=this;this.initDict(this.dc_key).then(function(e){console.log(t.dc_data),t.getTmpInfoByUserId(),t.sunan_idle_resource_type=t.dc_data.sunan_idle_resource_type.map(function(t){return{text:t.label,value:t.value}}),t.$forceUpdate()})},methods:{goBack:function(){this.$router.go(-1)},getTmpInfoByUserId:function(){var t=this;Object(p["d"])({id:h["a"].currUser().id}).then(function(e){if(console.log(1==e.data),200==e.code&&e.data){var n=e.data;console.log(n),t.id=n.id,t.form.name=n.name;var r=n.types.split();t.goodsTypeArray=r.map(function(t){return{label:t,value:t}}),t.form.info=n.info;var o=n.pictureUrl.split(",");t.myFileList=o,t.componentsFileUrlList=o.map(function(t){return{url:"https://www.idea-co-sf.com/industryParkApi/FileController/download/"+t,isImage:!0}}),t.form.connectPhone=n.connectPhone,t.form.connectName=n.connectName,t.form.initUseMoney=n.initUseMoney,t.form.useTypeText=1==n.useType?"租赁":"购买"}})},submitData:function(){var t=Object(s["a"])(regeneratorRuntime.mark(function t(e){var n,r,o;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(console.log(this.goodsTypeArray),this.form.name&&0!=this.form.name.length){t.next=3;break}return t.abrupt("return",Object(c["Toast"])("请填写资源名称"));case 3:if(this.goodsTypeArray&&0!=this.goodsTypeArray.length){t.next=5;break}return t.abrupt("return",Object(c["Toast"])("请选择资源类别"));case 5:if(this.form.useTypeText&&0!=this.form.useTypeText.length){t.next=7;break}return t.abrupt("return",Object(c["Toast"])("请选择使用方式"));case 7:if(this.form.initUseMoney&&0!=this.form.initUseMoney.length){t.next=9;break}return t.abrupt("return",Object(c["Toast"])("请填写参考金额"));case 9:if(this.form.connectName&&0!=this.form.connectName.length){t.next=11;break}return t.abrupt("return",Object(c["Toast"])("请填写联系人"));case 11:if(this.form.connectPhone&&0!=this.form.connectPhone.length){t.next=13;break}return t.abrupt("return",Object(c["Toast"])("请填写联系电话"));case 13:if(this.myFileList&&0!=this.myFileList.length){t.next=15;break}return t.abrupt("return",Object(c["Toast"])("请上传招租图片"));case 15:if(this.form.info&&0!=this.form.info.length){t.next=17;break}return t.abrupt("return",Object(c["Toast"])("请填写资源描述"));case 17:return console.log(this.goodsTypeArray),n=this.goodsTypeArray.map(function(t){return t.value}),console.log(this.id),r={types:n.toString(),useType:"租赁"==this.form.useTypeText?1:2,pictureUrl:this.myFileList.join(","),connectName:this.form.connectName,connectPhone:this.form.connectPhone,info:this.form.info,status:e,id:this.id,name:this.form.name,initUseMoney:this.form.initUseMoney,createdBy:h["a"].currUser().id},t.next=23,Object(p["a"])(r);case 23:o=t.sent,200==o.code&&0==e?(Object(c["Toast"])("提交成功"),this.$router.go(-1)):(console.log(this.id),this.getTmpInfoByUserId(),Object(c["Toast"])("保存成功")),console.log(r);case 26:case"end":return t.stop()}},t,this)}));function e(e){return t.apply(this,arguments)}return e}(),getZhaozuType:function(t){console.log(t),this.goodsTypeArray=t},goodsType:function(t){this.$refs.zhaozuSelect.setVisible(!0)},beforeDelete:function(t,e){console.log(t,e);var n=this;return n.myFileList.splice(e.index,1),function(t,r){var o=r.index;n.myFileList[e.index].splice(o,1)}},uploadImg:function(t){var e=this,n=new FormData;n.append("file",t.file),console.log(n.get("file"));var r={headers:{"Content-Type":"multipart/form-data","MVVM-Key":String((new Date).getTime()),xx:"anything"}};return new i.a(function(t,o){f.a.post("/industryParkApi/wx/fileController/upload",n,r).then(function(t){var n=t.data.data.substring(1,t.data.data.length);n=n.substring(0,n.length-1),console.log(e.$common.castEval(n)),e.fileUrlList.push(e.$common.castEval(n))}).catch(function(t,e){o(t,e)})})},afterRead:function(){var t=Object(s["a"])(regeneratorRuntime.mark(function t(e){var n,r;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return[],t.next=3,this.$common.uploadImg(e);case 3:for(n=t.sent,r=0;r<n.length;r++)this.myFileList.push(n[r]);this.$forceUpdate();case 6:case"end":return t.stop()}},t,this)}));function e(e){return t.apply(this,arguments)}return e}(),getAboultPark:function(t,e){console.log(t),this.form[e]=t.text,this.$forceUpdate()},openParkSelect:function(t){this.$refs.userType.setVisible(!0,{},t)},onFailed:function(t){console.log("failed",t)}}},v=y,g=(n("337d"),n("2877")),b=Object(g["a"])(v,r,o,!1,null,null,null);e["default"]=b.exports},"4f5f":function(t,e,n){},b4db:function(t,e,n){"use strict";n.d(e,"e",function(){return i}),n.d(e,"d",function(){return s}),n.d(e,"a",function(){return c}),n.d(e,"c",function(){return l}),n.d(e,"b",function(){return u}),n.d(e,"f",function(){return d}),n.d(e,"h",function(){return f}),n.d(e,"g",function(){return m});var r=n("8982"),o="/industryParkApi",a="/wx/SunanIdleResourceController";function i(t){return Object(r["a"])({url:o+a+"/list",method:"post",data:t})}function s(t){return Object(r["a"])({url:o+a+"/getTmpInfoByUserId",method:"post",data:t})}function c(t){return Object(r["a"])({url:o+a+"/add",method:"post",data:t})}function l(t){return Object(r["a"])({url:o+a+"/edit",method:"post",data:t})}function u(t){return Object(r["a"])({url:o+a+"/getById",method:"post",data:t})}function d(t){return Object(r["a"])({url:o+a+"/pushDown",method:"post",data:t})}function f(t){return Object(r["a"])({url:o+a+"/remove",method:"post",data:t})}function m(t){return Object(r["a"])({url:o+a+"/pushUp",method:"post",data:t})}}}]);