circle.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  1. <template>
  2. <view class="template-edit tn-safe-area-inset-bottom">
  3. <!-- 顶部自定义导航 -->
  4. <tn-nav-bar fixed customBack>
  5. <view slot="back" class='tn-custom-nav-bar__back' @click="goBack">
  6. <text class='icon tn-icon-left'></text>
  7. </view>
  8. <view slot="default" style="display: flex;">
  9. <view style="flex:1;margin-left:25px">
  10. <text :style="{fontSize:(wxFontSize)+'px'}">发布需求</text>
  11. </view>
  12. <view>
  13. <button v-if="!canSave" :disabled="!canSave" plain="true" style="margin-right: 4px;border-radius: 24px;height:32px;line-height: 32px;font-size:15px;margin-top:4px;color:#0003;border-color:#0003;" @click="saveForm(1)" :style="{fontSize:(wxFontSize-3)+'px'}">暂存</button>
  14. <button v-if="canSave" plain="true" :disabled="!canSave" style="margin-right: 4px;border-radius: 24px;height:32px;line-height: 32px;font-size:15px;margin-top:4px;color:#1d60b1;border-color:#1d60b1;" @click="saveForm(1)" :style="{fontSize:(wxFontSize-3)+'px'}">暂存</button>
  15. </view>
  16. </view>
  17. </tn-nav-bar>
  18. <view class="tn-safe-area-inset-bottom" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
  19. <tn-steps style="pointer-events:none;" :list="stepList" :current="stepIndex" mode="dotIcon" :fontSize="(wxFontSize-3)+'px'"></tn-steps>
  20. <view v-show="stepIndex==1">
  21. <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-padding-top tn-margin">
  22. <view class="tn-flex justify-content-item">
  23. <view class="tn-text-lg tn-padding-right-xs tn-text-bold" style="font-size: 16px;" :style="{fontSize:(wxFontSize-1)+'px'}">以下三种方式可任选其一,若有可都输入</view>
  24. </view>
  25. </view>
  26. <view class="tn-margin tn-bg-gray--light tn-padding" style="border-radius: 10rpx;">
  27. <textarea maxlength="500" v-model="content" placeholder="请描述您的需求..." :style="{fontSize:(wxFontSize-3)+'px'}" :placeholder-style="styleString"></textarea>
  28. </view>
  29. <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin" style="margin-top:40px;margin-bottom: 0;">
  30. <view class="tn-flex justify-content-item">
  31. <view class=" tn-text-center"
  32. style="border-radius: 100rpx;margin-right: 8rpx;width: 45rpx;height: 45rpx;line-height: 45rpx;">
  33. <text class="tn-icon-image" style="font-size: 20px;" :style="{fontSize:(wxFontSize+3)+'px'}"></text>
  34. </view>
  35. <view class="tn-padding-right-xs tn-text-bold" style="font-size: 16px;" :style="{fontSize:(wxFontSize-1)+'px'}">上传图片</view>
  36. </view>
  37. <!-- <view class="justify-content-item tn-text-df tn-color-grey" @tap="clear">
  38. <text class="tn-padding-xs">清空上传</text>
  39. <text class="tn-icon-delete"></text>
  40. </view> -->
  41. </view>
  42. <view class="tn-margin-left tn-padding-top-xs">
  43. <uni-file-picker
  44. v-model="imgList" :limit="6" @delete="deleteFile" :auto-upload="false" @select="select" @success="success">
  45. </uni-file-picker>
  46. <view style="margin-top: 8px;">
  47. <text style="color: #999;font-size: 12px;" :style="{fontSize:(wxFontSize-5)+'px'}">一次只能上传六张图片</text>
  48. </view>
  49. </view>
  50. <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-padding-top-xl tn-margin" style="margin-bottom: 0;">
  51. <view class="tn-flex justify-content-item">
  52. <view class=" tn-text-center"
  53. style="border-radius: 100rpx;margin-right: 8rpx;width: 45rpx;height: 45rpx;line-height: 45rpx;">
  54. <text class="tn-icon-link" style="font-size: 20px;" :style="{fontSize:(wxFontSize+3)+'px'}"></text>
  55. </view>
  56. <view class="tn-padding-right-xs tn-text-bold" style="font-size: 16px;" :style="{fontSize:(wxFontSize-1)+'px'}">上传文件</view>
  57. </view>
  58. <!-- <view class="justify-content-item tn-text-df tn-color-grey" @tap="clear">
  59. <text class="tn-padding-xs">清空上传</text>
  60. <text class="tn-icon-delete"></text>
  61. </view> -->
  62. </view>
  63. <view class="tn-margin-left tn-padding-top-xs">
  64. <uni-file-picker
  65. v-model="fileList" :limit="3" mode="grid" @delete="deleteFile" file-mediatype="all" file-extname="pdf,docx,doc,xls,xlsx" :auto-upload="false" @select="select" @success="success">
  66. <!-- <button size="default">上传文件</button> -->
  67. <view style="text-align: left;">
  68. <button size="mini" style="color:#1d60b1;border-color:#1d60b1;" plain="true" :style="{fontSize:(wxFontSize-5)+'px'}">上传文件</button>
  69. </view>
  70. <!-- <tn-button shadow shape="round" fontColor="tn-color-white" size="lg" backgroundColor="tn-bg-blue" :fontSize="24" height="auto" padding="20rpx 36rpx">上传文件</tn-button>
  71. -->
  72. </uni-file-picker>
  73. <view style="margin-top: 4px;">
  74. <text style="color: #999;font-size: 12px;" :style="{fontSize:(wxFontSize-5)+'px'}">一次只能上传三个文件,支持格式 pdf .doc .xls,不超过5MB。</text>
  75. </view>
  76. </view>
  77. <view style="margin-top:20px;padding: 16px">
  78. <text style="font-size: 16px;line-height: 30px;" :style="{fontSize:(wxFontSize-1)+'px'}">需求有效期:</text>
  79. <uni-data-select
  80. v-model="selectValue"
  81. :localdata="selectList"
  82. @change="changeSelect"
  83. placement="top"
  84. placeholder="请选择"
  85. :fontSize="(wxFontSize-3)+'px'"
  86. ></uni-data-select>
  87. </view>
  88. <!-- 悬浮按钮-->
  89. <view class="tn-flex tn-footerfixed">
  90. <view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center">
  91. <button type="default" plain="true" style="border-radius: 24px;" :disabled="!canNext"
  92. @click="nextStep()" :style="{fontSize:(wxFontSize-2)+'px'}">
  93. 下一步
  94. </button>
  95. </view>
  96. </view>
  97. </view>
  98. <view v-show="stepIndex==2">
  99. <view style="padding:16px">
  100. <uni-forms :modelValue="formData" label-width="0">
  101. <view style="margin:16px 0" :style="{fontSize:(wxFontSize-3)+'px'}">
  102. <text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;" >*</text><text>公司名称:</text>
  103. <w-select
  104. style="width: 100%;"
  105. v-model='searchValue'
  106. :list='items'
  107. valueName='name'
  108. keyName="regNumber"
  109. @change='selectChange'
  110. :filterable="true"
  111. :fontSize="(wxFontSize-3)+'px'"
  112. >
  113. </w-select>
  114. </view>
  115. <!-- <uni-forms-item label="公司名称" name="name">
  116. <uni-easyinput type="text" v-model="userInfo.company" placeholder="请输入所在公司名称" />
  117. </uni-forms-item> -->
  118. <text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;" :style="{fontSize:(wxFontSize-3)+'px'}">*</text><text :style="{fontSize:(wxFontSize-3)+'px'}">您的职称:</text>
  119. <uni-forms-item label="" name="realName" label-width="0">
  120. <uni-easyinput type="text" v-model="formInfo.jobTitle" :inputSize="wxFontSize-3" :placeholder-style="styleString" :clearable="false" placeholder="请输入您的职称" />
  121. </uni-forms-item>
  122. <text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;" :style="{fontSize:(wxFontSize-3)+'px'}">*</text><text :style="{fontSize:(wxFontSize-3)+'px'}">联系人姓名:</text>
  123. <uni-forms-item label="联系人姓名" name="contactMethod">
  124. <uni-easyinput type="text" v-model="formInfo.contactPerson" :inputSize="wxFontSize-3" :placeholder-style="styleString" :clearable="false" placeholder="请输入联系人姓名" />
  125. </uni-forms-item>
  126. <text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;" :style="{fontSize:(wxFontSize-3)+'px'}">*</text><text :style="{fontSize:(wxFontSize-3)+'px'}">联系方式:</text>
  127. <uni-forms-item label="联系方式" name="phone">
  128. <uni-easyinput type="text" v-model="formInfo.contactMethod" :inputSize="wxFontSize-3" :placeholder-style="styleString" :clearable="false" placeholder="请输入联系手机/微信/邮箱" />
  129. </uni-forms-item>
  130. <uni-forms-item label="11" name="check">
  131. <tn-checkbox v-model="formInfo.agree" activeColor="#45c05d" :size="wxFontSize+17" name="选项1" >
  132. <text :style="{fontSize:(wxFontSize-4)+'px',color:formInfo.agree?'#45c05d':'#666666'}">同意平台核查所填信息的真实性</text>
  133. </tn-checkbox>
  134. </uni-forms-item>
  135. </uni-forms>
  136. </view>
  137. <view class="tn-flex tn-footerfixed">
  138. <view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center">
  139. <button type="default" plain="true" style="border-radius: 24px;"
  140. @click="preStep()" :disabled="!canSave" :style="{fontSize:(wxFontSize-2)+'px'}">
  141. 上一步
  142. </button>
  143. </view>
  144. <view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center">
  145. <button v-if="canSave&&canNext" type="primary" style="background-color:#1d60b1;border-radius: 23px" @click="saveForm()" :style="{fontSize:(wxFontSize-2)+'px'}">提交审核</button>
  146. <button v-if="!canSave||!canNext" type="primary" :disabled="!canSave||!canNext" style="background-color:#0003;border-radius: 23px" @click="saveForm()" :style="{fontSize:(wxFontSize-2)+'px'}">提交审核</button>
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. <view class='tn-tabbar-height'></view>
  152. </view>
  153. </template>
  154. <script>
  155. import template_page_mixin from '@/libs/mixin/template_page_mixin.js';
  156. import request from '../utils/request';
  157. export default {
  158. name: 'TemplateEdit',
  159. mixins: [template_page_mixin],
  160. data() {
  161. return {
  162. wxFontSize:17,
  163. canSave: true,
  164. selectValue: '',
  165. //非常紧急/两周/一月/长期
  166. selectList: [{
  167. value: '一周',
  168. text: '一周'
  169. },
  170. {
  171. value: '两周',
  172. text: '两周'
  173. },
  174. {
  175. value: '一月',
  176. text: '一月'
  177. }
  178. ],
  179. content:'',
  180. formInfo:{
  181. jobTitle:'',
  182. agree:false,
  183. contactPerson:JSON.parse(uni.getStorageSync('userInfo')).contactNickName,
  184. contactMethod:JSON.parse(uni.getStorageSync('userInfo')).contactMethod||JSON.parse(uni.getStorageSync('userInfo')).userName
  185. },
  186. imgList:[],
  187. fileDetailList:[],
  188. stepIndex:1,
  189. stepList: [{
  190. name: '填写需求',
  191. icon: 'circle',
  192. selectIcon: 'circle-fill'
  193. },
  194. {
  195. name: '填写联系方式',
  196. icon: 'trusty',
  197. selectIcon: 'trusty-fill'
  198. }
  199. ],
  200. formData: {
  201. apiType: 'this,ali',
  202. token: 'dffc1e06e636cff0fdf7d877b6ae6a2e',
  203. image: null
  204. },
  205. fileList: [],
  206. showUploadList: true,
  207. customBtn: false,
  208. autoUpload: true,
  209. showProgress: false,
  210. deleteable: true,
  211. customStyle: false,
  212. maxCount: 9,
  213. disabled: false,
  214. searchValue: '',
  215. items: [],
  216. org:{
  217. name:'',
  218. regNumber:''
  219. },
  220. editItem:{},
  221. styleString:'font-size:'+14+'px',
  222. canNext:true
  223. }
  224. },
  225. watch: {
  226. searchValue(val, oldval) {
  227. console.error(val,this.org.name);
  228. if(val!==this.org.name){
  229. this.current = null;
  230. }
  231. if(this.stepIndex==2){
  232. this.search(val)
  233. }
  234. }
  235. },
  236. onLoad(props) {
  237. const appBaseInfo = wx.getAppBaseInfo();
  238. this.wxFontSize = uni.getStorageSync('fontSize')||appBaseInfo.fontSizeSetting||17;
  239. this.styleString='font-size:'+(this.wxFontSize-3)+'px';
  240. if(props.sid){
  241. this.isEdit = true;
  242. this.editItem = JSON.parse(uni.getStorageSync(props.sid)||'{}');
  243. this.content = this.editItem.content;
  244. this.fileDetailList = this.editItem.fileDetailList;
  245. for(let i=0;i<this.fileDetailList.length;i++){
  246. this.fileDetailList[i].path = this.fileDetailList[i].ftpUrl
  247. if(this.isImage(this.fileDetailList[i].fileName)){
  248. this.imgList.push({
  249. name: this.fileDetailList[i].fileName,
  250. url: this.fileDetailList[i].ftpUrl,
  251. path: this.fileDetailList[i].path
  252. })
  253. }else{
  254. this.fileList.push({
  255. name: this.fileDetailList[i].fileName,
  256. url: this.fileDetailList[i].ftpUrl,
  257. path: this.fileDetailList[i].path
  258. })
  259. }
  260. }
  261. this.org.name = this.editItem.company;
  262. this.formInfo.jobTitle = this.editItem.jobTitle;
  263. this.formInfo.contactPerson = this.editItem.contactPerson;
  264. this.formInfo.contactMethod = this.editItem.contactMethod;
  265. }
  266. this.getCompany();
  267. },
  268. methods: {
  269. isImage(fileName) {
  270. const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'ico']
  271. const extension = fileName.split('.').pop().toLowerCase();
  272. return imageExtensions.includes(extension);
  273. },
  274. getCompany(){
  275. let that = this;
  276. request.post('/slbUserCompanyRel/show/my', {
  277. userNo: uni.getStorageSync('userNo')
  278. }).then(res => {
  279. if (res.success) {
  280. let list = res.list || [];
  281. for(let i=0;i<list.length;i++){
  282. list[i].name = list[i].company;
  283. list[i].regNumber= list[i].company;
  284. if(!that.isEdit&&list[i].isDefault=='1'){
  285. that.searchValue = list[i].name
  286. that.current = list[i].name;
  287. that.org = list[i];
  288. if(list[i].jobTitle){
  289. that.formInfo.jobTitle = list[i].jobTitle
  290. }
  291. if(list[i].contactPerson){
  292. that.formInfo.contactPerson = list[i].contactPerson
  293. }
  294. if(list[i].contactMethod){
  295. that.formInfo.contactMethod = list[i].contactMethod;
  296. }
  297. that.getAddress(list[i].name);
  298. }
  299. if(that.isEdit&&list[i].name==that.editItem.company){
  300. that.searchValue = list[i].name
  301. that.current = list[i].name;
  302. that.formInfo.jobTitle = list[i].jobTitle;
  303. that.formInfo.contactPerson = list[i].contactPerson;
  304. that.formInfo.contactMethod = list[i].contactMethod;
  305. that.org = list[i];
  306. that.getAddress(list[i].name);
  307. }
  308. }
  309. that.items = list;
  310. }else{
  311. if(res._redirect){
  312. uni.showToast({
  313. title: '操作过期,请重试',
  314. duration: 2000,
  315. icon:'none'
  316. });
  317. that.goBack();
  318. }
  319. }
  320. })
  321. },
  322. preStep(){
  323. this.stepIndex = 1;
  324. },
  325. nextStep(){
  326. console.warn(this.searchValue);
  327. if(this.content==''&&this.fileDetailList.length===0){
  328. uni.showToast({
  329. title:'请输入您的需求或上传图片/文件',
  330. icon:'none'
  331. })
  332. this.stepIndex = 1;
  333. return false;
  334. }
  335. this.stepIndex = 2;
  336. },
  337. changeSelect(e) {
  338. this.selectValue = e;
  339. },
  340. saveForm(status){
  341. if(!this.canSave){
  342. return false;
  343. }
  344. let that = this;
  345. let params = {
  346. };
  347. if(status!=1&&!this.org.name){
  348. uni.showToast({
  349. title: '请输入公司名称',
  350. duration: 2000,
  351. icon:'none'
  352. });
  353. return false;
  354. }
  355. if(status!=1&&this.formInfo.jobTitle.length<1){
  356. uni.showToast({
  357. title: '请输入您的职称',
  358. duration: 2000,
  359. icon:'none'
  360. });
  361. return false;
  362. }
  363. if(status!=1&&this.formInfo.contactPerson.length<1){
  364. uni.showToast({
  365. title: '请输入联系人姓名',
  366. duration: 2000,
  367. icon:'none'
  368. });
  369. return false;
  370. }
  371. if(status!=1&&this.formInfo.contactMethod.length<1){
  372. uni.showToast({
  373. title: '请输入联系方式',
  374. duration: 2000,
  375. icon:'none'
  376. });
  377. return false;
  378. }
  379. if(status!=1&&!this.formInfo.agree){
  380. uni.showToast({
  381. title: '请勾选同意平台核查所填信息的真实性',
  382. duration: 2000,
  383. icon:'none'
  384. });
  385. return false;
  386. }
  387. if(!that.canNext){
  388. uni.showToast({
  389. title: '照片/文件正在上传中,请耐心等待',
  390. duration: 2000,
  391. icon:'none'
  392. });
  393. return false;
  394. }
  395. uni.showToast({
  396. title: '提交中...',
  397. icon:'none'
  398. });
  399. that.canSave = false;
  400. params.slbResourceDemand = {
  401. type:'3',
  402. company:this.org.name,
  403. jobTitle:this.formInfo.jobTitle,
  404. contactPerson:this.formInfo.contactPerson,
  405. contactMethod:this.formInfo.contactMethod,
  406. content:that.content,
  407. userNo:uni.getStorageSync('userNo'),
  408. validDate:this.selectValue,
  409. status: status==1?status:3,
  410. showFlag:'是',
  411. id: that.isEdit?that.editItem.id:undefined,
  412. bisNo: that.isEdit?that.editItem.bisNo:undefined,
  413. version: that.isEdit?that.editItem.version:undefined
  414. };
  415. params.slbResourceDemand.companyEntity = {};
  416. params.slbResourceDemand.companyEntity.company = params.slbResourceDemand.company;
  417. params.slbResourceDemand.companyEntity.jobTitle = params.slbResourceDemand.jobTitle;
  418. params.slbResourceDemand.companyEntity.creditCode = this.org.creditCode;
  419. params.slbResourceDemand.companyEntity.address = this.org.base;
  420. params.slbResourceDemand.companyEntity.regStatus = this.org.regStatus;
  421. params.slbResourceDemand.companyEntity.contactPerson = params.slbResourceDemand.contactPerson;
  422. params.slbResourceDemand.companyEntity.contactMethod = params.slbResourceDemand.contactMethod;
  423. params.slbResourceDemand.slbUserExt = {
  424. contactPerson:params.slbResourceDemand.contactPerson,
  425. contactMethod:params.slbResourceDemand.contactMethod,
  426. userNo:uni.getStorageSync('userNo'),
  427. };
  428. params.slbResourceDemand = JSON.stringify(params.slbResourceDemand);
  429. // params.slbResourceDemand.companyEntity.contactNickName = params.slbResourceDemand.contactNickName;
  430. // params.slbUserExt = JSON.stringify({
  431. // jobTitle:this.formInfo.jobTitle,
  432. // contactPerson:this.formInfo.contactPerson,
  433. // contactMethod:this.formInfo.contactMethod,
  434. // userNo:uni.getStorageSync('userNo'),
  435. // });
  436. params.fileDetailList = JSON.stringify(this.fileDetailList);
  437. request.post(that.isEdit?'/slbResourceDemand/update':'/slbResourceDemand/add', params).then(res => {
  438. if(res.success){
  439. uni.showToast({
  440. title:status==1?'信息已暂存,请在我的需求中查看暂存信息':'发布已提交,请在我的需求中查看进度',
  441. icon:'none',
  442. success:()=>{
  443. setTimeout(()=>{
  444. uni.redirectTo({
  445. url: "/pages/mine/need?tab="+(status==1?2:1)
  446. });
  447. },1500)
  448. }
  449. })
  450. }else{
  451. uni.showToast({
  452. title:res.msg,
  453. icon:'none'
  454. })
  455. that.canSave = true;
  456. }
  457. console.warn(res);
  458. })
  459. },
  460. // 跳转
  461. tn(e) {
  462. uni.navigateTo({
  463. url: e,
  464. });
  465. },
  466. // 手动上传文件
  467. upload() {
  468. console.warn(121212);
  469. },
  470. // 手动清空列表
  471. clear() {
  472. this.$refs.imageUpload.clear()
  473. },
  474. // 图片拖拽重新排序
  475. onSortList(list) {
  476. console.log(list);
  477. },
  478. select(e) {
  479. console.log('选择文件:', e)
  480. let tempFiles = e.tempFiles;
  481. for (let i in tempFiles) {
  482. this.upfile(tempFiles[i])
  483. }
  484. },
  485. deleteFile(e, index) {
  486. if(!this.canNext){
  487. uni.showToast({
  488. title: '照片/文件正在上传中,请耐心等待',
  489. icon:'none'
  490. });
  491. return false;
  492. }
  493. for(let i=0;i<this.fileDetailList.length;i++){
  494. if(e.tempFile.path===this.fileDetailList[i].path){
  495. this.fileDetailList.splice(i, 1);
  496. }
  497. }
  498. },
  499. upfile(file) {
  500. let that = this;
  501. console.warn(file);
  502. this.canNext = false;
  503. uni.showToast({
  504. title: '照片/文件正在上传中,请耐心等待',
  505. icon:'none'
  506. });
  507. uni.uploadFile({
  508. url: 'https://slb-m.lx-device.com/oss/upload/userFeedback', //仅为示例,非真实的接口地址
  509. filePath: file.url,
  510. name: 'file',
  511. success: (uploadFileRes) => {
  512. that.canNext = true;
  513. uni.hideToast();
  514. console.warn(JSON.parse(uploadFileRes.data));
  515. if(JSON.parse(uploadFileRes.data).success){
  516. let resultMap = JSON.parse(uploadFileRes.data).resultMap;
  517. that.fileDetailList.push({
  518. name: file.name,
  519. fileName: file.name, // 原始文件名
  520. ftpUrl: resultMap.uploadUrl, // 文件访问url
  521. path: file.path
  522. })
  523. }else{
  524. uni.showToast({
  525. title: JSON.parse(uploadFileRes.data).msg+',请删除后重试',
  526. icon:'none'
  527. });
  528. }
  529. },
  530. fail:(err)=>{
  531. uni.showToast({
  532. title: '上传失败,请删除后重试',
  533. icon:'none'
  534. });
  535. }
  536. });
  537. },
  538. // 上传成功
  539. success(e) {
  540. console.log('上传成功')
  541. },
  542. selectChange(e){
  543. console.error(e);
  544. this.searchValue = e.name
  545. this.current = e.regNumber;
  546. if(e.jobTitle){
  547. this.formInfo.jobTitle = e.jobTitle;
  548. }
  549. this.org = e;
  550. this.getAddress(e.name);
  551. },
  552. getAddress(name){
  553. let that = this;
  554. request.post('/member/getEnterPriseInfo', {
  555. keyWord: name
  556. }).then(res => {
  557. if(res&&res.success&&res.resultMap.data){
  558. if( res.resultMap.data.creditCode){
  559. that.org.creditCode = res.resultMap.data.creditCode
  560. }
  561. if( res.resultMap.data.regStatus){
  562. that.org.regStatus = res.resultMap.data.regStatus
  563. }
  564. if( res.resultMap.data.regLocation){
  565. that.org.base = res.resultMap.data.regLocation
  566. }
  567. }
  568. })
  569. },
  570. search: function(val) {
  571. let that = this;
  572. if (val && val.length > 3) {
  573. request.post('/member/searchCompys', {
  574. keyWord: val
  575. }).then(res => {
  576. if(res&&res.success){
  577. let list = res.resultMap.data || [];
  578. that.items = list;
  579. }else{
  580. if(res._redirect){
  581. uni.showToast({
  582. title: '操作过期,请重试',
  583. duration: 2000,
  584. icon:'none'
  585. });
  586. that.goBack();
  587. }
  588. }
  589. })
  590. }else{
  591. that.items = [];
  592. that.org = {};
  593. }
  594. },
  595. goBack() {
  596. const pages = getCurrentPages()
  597. // 有可返回的页面则直接返回,uni.navigateBack 默认返回失败之后会自动刷新页面 ,无法继续返回
  598. if (pages.length > 1) {
  599. uni.navigateBack()
  600. return;
  601. }else{
  602. uni.navigateTo({
  603. url: '/pages/index/index'
  604. })
  605. }
  606. },
  607. }
  608. }
  609. </script>
  610. <style lang="scss" scoped>
  611. .template-edit {}
  612. /* 胶囊*/
  613. .tn-custom-nav-bar__back {
  614. width: 60%;
  615. height: 100%;
  616. position: relative;
  617. display: flex;
  618. justify-content: space-evenly;
  619. align-items: center;
  620. box-sizing: border-box;
  621. // background-color: rgba(0, 0, 0, 0.15);
  622. border-radius: 1000rpx;
  623. border: 1rpx solid rgba(255, 255, 255, 0.5);
  624. // color: #FFFFFF;
  625. font-size: 18px;
  626. .icon {
  627. display: block;
  628. flex: 1;
  629. margin: auto;
  630. text-align: center;
  631. }
  632. &:before {
  633. content: " ";
  634. width: 1rpx;
  635. height: 110%;
  636. position: absolute;
  637. top: 22.5%;
  638. left: 0;
  639. right: 0;
  640. margin: auto;
  641. transform: scale(0.5);
  642. transform-origin: 0 0;
  643. pointer-events: none;
  644. box-sizing: border-box;
  645. opacity: 0.7;
  646. background-color: #FFFFFF;
  647. }
  648. }
  649. /* 底部悬浮按钮 start*/
  650. .tn-tabbar-height {
  651. min-height: 100rpx;
  652. height: calc(120rpx + env(safe-area-inset-bottom) / 2);
  653. }
  654. .tn-footerfixed {
  655. position: fixed;
  656. width: 100%;
  657. bottom: calc(env(safe-area-inset-bottom));
  658. z-index: 1024;
  659. box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0);
  660. background: #fff;
  661. }
  662. /* 底部悬浮按钮 end*/
  663. /* 标签内容 start*/
  664. .tn-tag-content {
  665. &__item {
  666. display: inline-block;
  667. line-height: 45rpx;
  668. padding: 10rpx 30rpx;
  669. margin: 20rpx 20rpx 5rpx 0rpx;
  670. &--prefix {
  671. padding-right: 10rpx;
  672. }
  673. }
  674. }
  675. /deep/ .uni-forms-item__label {
  676. display: none;
  677. }
  678. /deep/ .uni-stat__select .uni-select__input-placeholder {
  679. font-size: 14px;
  680. }
  681. /* 标签内容 end*/
  682. </style>