circle.vue 25 KB

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