addShare.js 16 KB

12
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["circlePages/addShare"],{188:function(t,e,n){"use strict";(function(t,e){var i=n(4);n(26);i(n(25));var o=i(n(189));t.__webpack_require_UNI_MP_PLUGIN__=n,e(o.default)}).call(this,n(1)["default"],n(2)["createPage"])},189:function(t,e,n){"use strict";n.r(e);var i=n(190),o=n(192);for(var s in o)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(s);n(194);var a,c=n(36),r=Object(c["default"])(o["default"],i["render"],i["staticRenderFns"],!1,null,"7d5436a7",null,!1,i["components"],a);r.options.__file="circlePages/addShare.vue",e["default"]=r.exports},190:function(t,e,n){"use strict";n.r(e);var i=n(191);n.d(e,"render",(function(){return i["render"]})),n.d(e,"staticRenderFns",(function(){return i["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return i["recyclableRender"]})),n.d(e,"components",(function(){return i["components"]}))},191:function(t,e,n){"use strict";var i;n.r(e),n.d(e,"render",(function(){return o})),n.d(e,"staticRenderFns",(function(){return a})),n.d(e,"recyclableRender",(function(){return s})),n.d(e,"components",(function(){return i}));try{i={tnNavBar:function(){return Promise.all([n.e("common/vendor"),n.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(n.bind(null,204))},tnSteps:function(){return n.e("tuniao-ui/components/tn-steps/tn-steps").then(n.bind(null,410))},uniDataCheckbox:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox")]).then(n.bind(null,424))},uniForms:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uni-forms/components/uni-forms/uni-forms")]).then(n.bind(null,394))},uniFormsItem:function(){return n.e("uni_modules/uni-forms/components/uni-forms-item/uni-forms-item").then(n.bind(null,403))},uniEasyinput:function(){return n.e("uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput").then(n.bind(null,387))},wSelect:function(){return n.e("components/w-select/w-select").then(n.bind(null,417))},uniDataSelect:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uni-data-select/components/uni-data-select/uni-data-select")]).then(n.bind(null,362))},uniCard:function(){return n.e("uni_modules/uni-card/components/uni-card/uni-card").then(n.bind(null,431))},uniList:function(){return n.e("uni_modules/uni-list/components/uni-list/uni-list").then(n.bind(null,438))},uniListItem:function(){return n.e("uni_modules/uni-list/components/uni-list-item/uni-list-item").then(n.bind(null,445))},uniFilePicker:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker")]).then(n.bind(null,378))},tnCheckbox:function(){return n.e("tuniao-ui/components/tn-checkbox/tn-checkbox").then(n.bind(null,252))}}}catch(c){if(-1===c.message.indexOf("Cannot find module")||-1===c.message.indexOf(".vue"))throw c;console.error(c.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var o=function(){var t=this,e=t.$createElement,n=(t._self._c,"产品"==t.selectValue2&&("公司"==t.selectValue&&2==t.stepIndex||"个人"==t.selectValue&&2==t.stepIndex)?t.__map(t.extList,(function(e,n){var i=t.__get_orig(e),o=t.extList.length>1&&t.extList.length<6&&n==t.extList.length-1||1==t.extList.length,s=t.extList.length>1&&n!==t.extList.length-1,a=t.extList.length;return{$orig:i,g0:o,g1:s,g2:a}})):null);t.$mp.data=Object.assign({},{$root:{l0:n}})},s=!1,a=[];o._withStripped=!0},192:function(t,e,n){"use strict";n.r(e);var i=n(193),o=n.n(i);for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);e["default"]=o.a},193:function(t,e,n){"use strict";(function(t,o){var s=n(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=s(n(185)),c=s(n(61)),r={name:"TemplateEdit",mixins:[a.default],data:function(){return{wxFontSize:17,styleString:"font-size:14px",showTips:!1,canSave:!0,isMedical:"1",content:"",selectValue:"个人",selectList:[{value:"个人",text:"个人"},{value:"公司",text:"公司"}],selectValue2:"产品",selectList2:[{value:"产品",text:"产品"},{value:"服务",text:"服务"}],selectValue3:"维修维保",brand:"",selectList3:[{value:"维修维保",text:"维修维保"},{value:"改造升级",text:"改造升级"},{value:"验证",text:"验证"},{value:"搬迁",text:"搬迁"},{value:"厂房建设",text:"厂房建设"},{value:"其他",text:"其他"}],selectValue4:"机械五金",selectList4:[{value:"机械五金",text:"机械五金"},{value:"仪器仪表",text:"仪器仪表"},{value:"耗材",text:"耗材"},{value:"其他",text:"其他"}],extList:[],formInfo:{jobTitle:"",userRealName:JSON.parse(t.getStorageSync("userInfo")).userRealName,agree:!1,contactNickName:JSON.parse(t.getStorageSync("userInfo")).contactNickName||"用户"+JSON.parse(t.getStorageSync("userInfo")).userName.slice(-4),contactMethod:JSON.parse(t.getStorageSync("userInfo")).contactMethod||JSON.parse(t.getStorageSync("userInfo")).userName},imgList:[],fileDetailList:[],stepIndex:1,stepList:[{name:"填写个人信息",icon:"circle",selectIcon:"circle-fill"},{name:"填写供应信息",icon:"trusty",selectIcon:"trusty-fill"},{name:"上传附件",icon:"folder",selectIcon:"folder-fill"}],stepList2:[{name:"填写公司信息",icon:"circle",selectIcon:"circle-fill"},{name:"填写供应信息",icon:"trusty",selectIcon:"trusty-fill"},{name:"上传附件",icon:"folder",selectIcon:"folder-fill"}],action:"https://www.hualigs.cn/api/upload",formData:{apiType:"this,ali",token:"dffc1e06e636cff0fdf7d877b6ae6a2e",image:null},fileList:[],showUploadList:!0,customBtn:!1,autoUpload:!0,showProgress:!1,deleteable:!0,customStyle:!1,maxCount:9,disabled:!1,searchValue:"",items:[],org:{},isEdit:!1,editItem:{},canNext:!0}},watch:{searchValue:function(t,e){console.error(t,this.org.name),t!==this.org.name&&(this.current=null),"个人"!=this.selectValue&&this.search(t)}},onLoad:function(e){var n=o.getAppBaseInfo();if(this.wxFontSize=t.getStorageSync("fontSize")||n.fontSizeSetting||17,this.styleString="font-size:"+(this.wxFontSize-3)+"px",e.sid){this.isEdit=!0,this.editItem=JSON.parse(t.getStorageSync(e.sid)||"{}"),this.content=this.editItem.content,this.selectValue2=1==this.editItem.type?"产品":"服务",this.selectValue3=this.editItem.secType,this.brand=this.editItem.brand,this.selectValue="1"==this.editItem.subject?"公司":"个人",this.fileDetailList=this.editItem.fileDetailList;for(var i=0;i<this.fileDetailList.length;i++)this.fileDetailList[i].path=this.fileDetailList[i].ftpUrl,this.isImage(this.fileDetailList[i].fileName)?this.imgList.push({name:this.fileDetailList[i].fileName,url:this.fileDetailList[i].ftpUrl,path:this.fileDetailList[i].path}):this.fileList.push({name:this.fileDetailList[i].fileName,url:this.fileDetailList[i].ftpUrl,path:this.fileDetailList[i].path});"产品"==this.selectValue2&&(this.selectValue4=this.editItem.secType,this.isMedical=this.editItem.isMedical,this.extList=this.editItem.shareExt),this.org.name=this.editItem.company,this.formInfo.jobTitle=this.editItem.jobTitle,this.formInfo.contactPerson=this.editItem.contactPerson,this.formInfo.contactMethod=this.editItem.contactMethod,this.formInfo.contactNickName=this.formInfo.contactNickName}this.getCompany()},methods:{isImage:function(t){var e=["jpg","jpeg","png","gif","bmp","webp","ico"],n=t.split(".").pop().toLowerCase();return e.includes(n)},showSet:function(){t.navigateTo({url:"/minePages/set"})},preStep:function(){this.stepIndex=this.stepIndex-1},nextStep:function(){var e=this;if(1==this.stepIndex&&0==this.extList.length&&this.extList.push({prodDesc:"",prodName:"",prodSpec:""}),"公司"==e.selectValue){if(console.error(this.org),!this.org.name)return t.showToast({title:"请输入公司名称",duration:2e3,icon:"none"}),!1;if(!this.formInfo.jobTitle||this.formInfo.jobTitle.length<1)return t.showToast({title:"请输入您的职称",duration:2e3,icon:"none"}),!1;if(!this.formInfo.contactPerson||this.formInfo.contactPerson.length<1)return t.showToast({title:"请输入联系人姓名",duration:2e3,icon:"none"}),!1;if(!this.formInfo.contactMethod||this.formInfo.contactMethod.length<1)return t.showToast({title:"请输入联系手机/微信/邮箱",duration:2e3,icon:"none"}),!1}if(2==this.stepIndex&&"产品"==e.selectValue2){if(this.brand.length<1)return t.showToast({title:"请输入产品品牌",duration:2e3,icon:"none"}),!1;for(var n=0;n<this.extList.length;n++)if(!this.extList[n].prodName||!this.extList[n].prodSpec)return t.showToast({title:this.extList[n].prodName?"请输入产品"+(n+1)+"的产品型号":"请输入产品"+(n+1)+"的产品名称",duration:2e3,icon:"none"}),!1}if(2==this.stepIndex&&"服务"==e.selectValue2){if(!this.selectValue3)return t.showToast({title:"请选择服务类型",duration:2e3,icon:"none"}),!1;if(!this.content)return t.showToast({title:"请输入服务介绍",duration:2e3,icon:"none"}),!1}this.stepIndex=this.stepIndex+1},getCompany:function(){var e=this;c.default.post("/slbUserCompanyRel/show/my",{userNo:t.getStorageSync("userNo")}).then((function(n){if(n.success){for(var i=n.list||[],o=0;o<i.length;o++)i[o].name=i[o].company,i[o].regNumber=i[o].company,e.isEdit||"1"!=i[o].isDefault||(e.searchValue=i[o].name,e.current=i[o].name,e.formInfo.jobTitle=i[o].jobTitle,e.formInfo.contactPerson=i[o].contactPerson,e.formInfo.contactMethod=i[o].contactMethod,e.org=i[o],e.getAddress(i[o].name)),e.isEdit&&i[o].name==e.editItem.company&&(e.searchValue=i[o].name,e.current=i[o].name,e.formInfo.jobTitle=i[o].jobTitle,e.formInfo.contactPerson=i[o].contactPerson,e.formInfo.contactMethod=i[o].contactMethod,e.org=i[o],e.getAddress(i[o].name));e.items=i,console.warn(e.items)}else n._redirect&&(t.showToast({title:"操作过期,请重试",duration:2e3,icon:"none"}),e.goBack())}))},goBack:function(){var e=getCurrentPages();e.length>1?t.navigateBack():t.navigateTo({url:"/pages/index/index"})},changeSelect:function(t){this.selectValue=t},changeSelect2:function(t){this.selectValue2=t},changeSelect3:function(t){this.selectValue3=t},changeSelect4:function(t){this.selectValue4=t},newItem:function(){this.extList.push({prodDesc:"",prodName:"",prodSpec:""})},delItem:function(t){this.extList.splice(t,1)},saveForm:function(e){if(!this.canSave)return!1;var n=this;if(1!=e&&"服务"==n.selectValue2&&!this.content)return t.showToast({title:"请输入服务介绍",duration:2e3,icon:"none"}),!1;if(1!=e&&"产品"==n.selectValue2)for(var i=0;i<this.extList.length;i++)if(!this.extList[i].prodName||!this.extList[i].prodSpec)return t.showToast({title:this.extList[i].prodName?"请输入产品"+(i+1)+"的产品型号":"请输入产品"+(i+1)+"的产品名称",duration:2e3,icon:"none"}),!1;if(1!=e&&!this.formInfo.agree)return t.showToast({title:"请勾选同意平台核查所填信息的真实性",duration:2e3,icon:"none"}),!1;if(!n.canNext)return t.showToast({title:"照片/文件正在上传中,请耐心等待",duration:2e3,icon:"none"}),!1;var o={},s={type:"服务"==n.selectValue2?"2":"1",secType:n.selectValue3,company:"公司"==n.selectValue?this.org.name:"",subject:"公司"==n.selectValue?"1":"2",jobTitle:this.formInfo.jobTitle,contactPerson:"公司"==n.selectValue?this.formInfo.contactPerson:this.formInfo.userRealName||this.formInfo.contactNickName,contactMethod:this.formInfo.contactMethod,contactNickName:this.formInfo.contactNickName,content:n.content,userNo:t.getStorageSync("userNo"),status:1==e?e:3,showFlag:"是",brand:n.brand,id:n.isEdit?n.editItem.id:void 0,bisNo:n.isEdit?n.editItem.bisNo:void 0,version:n.isEdit?n.editItem.version:void 0};"公司"==n.selectValue?(s.companyEntity={},s.companyEntity.company=s.company,s.companyEntity.jobTitle=s.jobTitle,s.companyEntity.creditCode=this.org.creditCode,s.companyEntity.address=this.org.base,s.companyEntity.regStatus=this.org.regStatus,s.companyEntity.contactPerson=s.contactPerson,s.companyEntity.contactMethod=s.contactMethod,s.companyEntity.contactNickName=s.contactNickName,s.slbUserExt={},s.slbUserExt.userContactMethod=s.contactMethod,s.slbUserExt.contactPerson=s.contactPerson,s.slbUserExt.contactMethod=s.contactMethod,s.slbUserExt.contactNickName=s.contactNickName,s.slbUserExt.userRealName=this.formInfo.userRealName):(s.slbUserExt={},s.slbUserExt.userContactMethod=s.contactMethod,s.slbUserExt.contactPerson=s.contactPerson,s.slbUserExt.contactMethod=s.contactMethod,s.slbUserExt.contactNickName=s.contactNickName,s.slbUserExt.userRealName=this.formInfo.userRealName),"1"==s.type&&(s.secType=n.selectValue4,s.isMedical=n.isMedical,s.content="",s.shareExt=n.extList),o.slbResourceShare=JSON.stringify(s),o.fileDetailList=JSON.stringify(this.fileDetailList),t.showToast({title:"提交中...",icon:"none"}),n.canSave=!1,c.default.post(n.isEdit?"/slbResourceShare/update":"/slbResourceShare/add",o).then((function(i){i.success?t.showToast({title:1==e?"信息已暂存,请在我的供应中查看暂存信息":"发布已提交,请在我的供应中查看进度",icon:"none",success:function(){setTimeout((function(){t.redirectTo({url:"/pages/mine/share?tab="+(1==e?2:1)})}),2500)}}):(t.showToast({title:i.msg,icon:"none"}),n.canSave=!0),console.warn(i)}))},tn:function(e){t.navigateTo({url:e})},upload:function(){console.warn(121212)},clear:function(){this.$refs.imageUpload.clear()},select:function(t){console.log("选择文件:",t);var e=t.tempFiles;for(var n in e)this.upfile(e[n])},upfile:function(e){var n=this;console.warn(e),this.canNext=!1,t.showToast({title:"照片/文件正在上传中,请耐心等待",icon:"none"}),t.uploadFile({url:"https://slb-m.lx-device.com/oss/upload/userFeedback",filePath:e.url,name:"file",success:function(i){if(n.canNext=!0,t.hideToast(),console.warn(JSON.parse(i.data)),JSON.parse(i.data).success){var o=JSON.parse(i.data).resultMap;n.fileDetailList.push({name:e.name,fileName:e.name,ftpUrl:o.uploadUrl,path:e.path})}else t.showToast({title:JSON.parse(i.data).msg+",请删除后重试",icon:"none"})},fail:function(e){t.showToast({title:"上传失败,请删除后重试",icon:"none"})}})},success:function(t){console.log("上传成功")},deleteFile:function(e,n){if(!this.canNext)return t.showToast({title:"照片/文件正在上传中,请耐心等待",icon:"none"}),!1;for(var i=0;i<this.fileDetailList.length;i++)e.tempFile.path===this.fileDetailList[i].path&&this.fileDetailList.splice(i,1);console.error(this.fileDetailList)},selectChange:function(t){this.searchValue=t.name,this.current=t.regNumber,t.jobTitle&&(this.formInfo.jobTitle=t.jobTitle,this.formInfo.contactPerson=this[i].contactPerson,this.formInfo.contactMethod=this[i].contactMethod),this.org=t,this.getAddress(t.name)},getAddress:function(t){var e=this;c.default.post("/member/getEnterPriseInfo",{keyWord:t}).then((function(t){t&&t.success&&t.resultMap.data&&(t.resultMap.data.creditCode&&(e.org.creditCode=t.resultMap.data.creditCode),t.resultMap.data.regStatus&&(e.org.regStatus=t.resultMap.data.regStatus),t.resultMap.data.regLocation&&(e.org.base=t.resultMap.data.regLocation))}))},search:function(e){var n=this;e&&e.length>3?c.default.post("/member/searchCompys",{keyWord:e}).then((function(e){if(e.success){var i=e.resultMap.data||[];n.items=i}else e._redirect&&(t.showToast({title:"操作过期,请重试",duration:2e3,icon:"none"}),n.goBack())})):(n.items=[],n.org={})}}};e.default=r}).call(this,n(2)["default"],n(1)["default"])},194:function(t,e,n){"use strict";n.r(e);var i=n(195),o=n.n(i);for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);e["default"]=o.a},195:function(t,e,n){}},[[188,"common/runtime","common/vendor"]]]);
  2. //# sourceMappingURL=../../.sourcemap/mp-weixin/circlePages/addShare.js.map