addShare.vue 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106
  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" plain="true" 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>
  14. <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>
  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="selectValue=='个人'?stepList:stepList2" :current="stepIndex" mode="dotIcon" :fontSize="(wxFontSize-3)+'px'"></tn-steps>
  20. <view v-show="stepIndex==1">
  21. <view style="padding: 16px">
  22. <view style="line-height: 30px;" :style="{fontSize:(wxFontSize-1)+'px'}">
  23. 发布主体:
  24. <uni-data-checkbox :multiple="false" v-model="selectValue" selectedColor="#01BEFF"
  25. :localdata="[{text: '个人',value: '个人'},{text: '公司',value: '公司'}]" :fontSize="(wxFontSize-3)+'px'"/>
  26. </view>
  27. <!-- <uni-data-select v-model="selectValue" :localdata="selectList" @change="changeSelect"
  28. :clear="false"></uni-data-select> -->
  29. </view>
  30. <view v-if="selectValue=='个人'" style="padding: 16px">
  31. <uni-forms :modelValue="formData" label-width="0">
  32. <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>
  33. <uni-forms-item label="用户昵称" name="realName" label-width="0">
  34. <uni-easyinput type="text" disabled :inputSize="wxFontSize-3" :placeholder-style="styleString" v-model="formInfo.contactNickName" placeholder="请输入您的昵称" />
  35. </uni-forms-item>
  36. <text style="line-height: 30px;vertical-align: middle;" :style="{fontSize:(wxFontSize-3)+'px'}">真实姓名:</text>
  37. <uni-forms-item label="真实姓名" name="contactMethod">
  38. <uni-easyinput type="text" disabled="true" :inputSize="wxFontSize-3" :placeholder-style="styleString" v-model="formInfo.userRealName" placeholder="请输入真实姓名" />
  39. </uni-forms-item>
  40. <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>
  41. <uni-forms-item label="联系方式" name="phone">
  42. <uni-easyinput type="text" disabled :inputSize="wxFontSize-3" :placeholder-style="styleString" v-model="formInfo.contactMethod" placeholder="请输入联系手机/微信/邮箱" />
  43. </uni-forms-item>
  44. </uni-forms>
  45. <text style="font-size: 13px;color:#999;" :style="{fontSize:(wxFontSize-4)+'px'}">如要更改个人信息,请在我的=><text>个人信息</text>页面更改</text>
  46. </view>
  47. <view v-if="selectValue=='公司'" style="padding: 16px">
  48. <uni-forms :modelValue="formData" label-width="0">
  49. <view style="margin-bottom:16px">
  50. <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>
  51. <w-select style="width: 100%;" v-model='searchValue' :list='items' valueName='name'
  52. keyName="regNumber" @change='selectChange' :filterable="true" :fontSize="(wxFontSize-3)+'px'">
  53. </w-select>
  54. </view>
  55. <!-- <uni-forms-item label="公司名称" name="name">
  56. <uni-easyinput type="text" v-model="userInfo.company" placeholder="请输入所在公司名称" />
  57. </uni-forms-item> -->
  58. <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>
  59. <uni-forms-item label="" name="realName" label-width="0">
  60. <uni-easyinput type="text" :clearable="false" :inputSize="wxFontSize-3" :placeholder-style="styleString" v-model="formInfo.jobTitle" placeholder="请输入您的职称" />
  61. </uni-forms-item>
  62. <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>
  63. <uni-forms-item label="联系人姓名" name="contactMethod">
  64. <uni-easyinput type="text" :clearable="false" :inputSize="wxFontSize-3" :placeholder-style="styleString" v-model="formInfo.contactPerson" placeholder="请输入联系人姓名" />
  65. </uni-forms-item>
  66. <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>
  67. <uni-forms-item label="联系方式" name="phone">
  68. <uni-easyinput type="text" :clearable="false" :inputSize="wxFontSize-3" :placeholder-style="styleString" v-model="formInfo.contactMethod" placeholder="请输入联系手机/微信/邮箱" />
  69. </uni-forms-item>
  70. </uni-forms>
  71. </view>
  72. <!-- 悬浮按钮-->
  73. <view class="tn-flex tn-footerfixed">
  74. <!-- <view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center">
  75. <button type="default" plain="true" style="border-radius: 24px;"
  76. @click="preStep()">
  77. 上一步
  78. </button>
  79. </view> -->
  80. <view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center">
  81. <button type="default" plain="true" style="border-radius: 24px;"
  82. @click="nextStep()" :style="{fontSize:(wxFontSize-2)+'px'}">
  83. 下一步
  84. </button>
  85. </view>
  86. </view>
  87. </view>
  88. <view v-show="stepIndex!=1">
  89. <view style="padding: 16px;padding-bottom: 0;" v-if="(selectValue=='公司'&&stepIndex==2)||(selectValue=='个人'&&stepIndex==2)">
  90. <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>
  91. <uni-data-select v-model="selectValue2" :localdata="selectList2" @change="changeSelect2"
  92. :clear="false" :fontSize="(wxFontSize-3)+'px'"></uni-data-select>
  93. </view>
  94. <view v-if="selectValue2=='产品'" >
  95. <view style="padding: 16px" v-if="(selectValue=='公司'&&stepIndex==2)||(selectValue=='个人'&&stepIndex==2)">
  96. <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>
  97. <uni-data-select v-model="selectValue4" :localdata="selectList4" @change="changeSelect4"
  98. placeholder="产品种类" :clear="false" style="margin-bottom:16px" :fontSize="(wxFontSize-3)+'px'"></uni-data-select>
  99. <view style="margin-top: 16px;">
  100. <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>
  101. <uni-easyinput type="text" :clearable="false" :inputSize="wxFontSize-3" :placeholder-style="styleString" required v-model="brand" placeholder="请输入产品品牌" />
  102. </view>
  103. <view style="margin-top: 16px;margin-bottom: 20px;">
  104. <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>
  105. <uni-data-checkbox :multiple="false" v-model="isMedical" selectedColor="#01BEFF"
  106. :localdata="[{text: '是',value: '1'},{text: '否',value: '0'}]" :fontSize="(wxFontSize-3)+'px'"/>
  107. <text v-if="isMedical==1" style="font-size: 13px;color:#999;" :style="{fontSize:(wxFontSize-5)+'px'}">如若产品是医疗器械,请在上传附件步骤上传产品注册证,企业经营许可证等相关信息。</text>
  108. </view>
  109. <view v-for="item,itemIndex in extList">
  110. <view style="margin-bottom: 12px;">
  111. <uni-card >
  112. <template v-slot:title>
  113. <uni-list>
  114. <uni-list-item style="align-items: center;">
  115. <template v-slot:header>
  116. <text :style="{fontSize:(wxFontSize-4)+'px'}">产品信息{{itemIndex+1}}</text>
  117. </template>
  118. <template v-slot:footer>
  119. <button type="default" style="color:#1d60b1;border-color:#1d60b1;" :style="{fontSize:(wxFontSize-5)+'px'}" plain="true" size="mini" v-if="(extList.length>1&&extList.length<6&&itemIndex==extList.length-1)||extList.length==1" @click="newItem">+新增产品</button>
  120. <button type="warn" plain="true" size="mini" :style="{fontSize:(wxFontSize-5)+'px'}" v-if="extList.length>1&&itemIndex!==extList.length-1" @click="delItem(itemIndex)">-删除产品</button>
  121. <!-- <tn-button fontColor="tn-color-white" shape="round" backgroundColor="#3668FC" v-if="extList.length==1" @click="newItem">+新增产品</tn-button>
  122. <tn-button fontColor="tn-color-white" shape="round" backgroundColor="#3668FC" v-if="extList.length>1&&extList.length<6&&itemIndex==extList.length-1" @click="newItem">+新增产品</tn-button>
  123. <tn-button fontColor="tn-color-white" shape="round" backgroundColor="#FF000C" v-if="extList.length>1&&itemIndex!==extList.length-1" @click="delItem(itemIndex)">-删除产品</tn-button> -->
  124. </template>
  125. </uni-list-item>
  126. </uni-list>
  127. </template>
  128. <uni-forms :modelValue="formData" label-width="0">
  129. <uni-forms-item label="" name="prodName" label-width="0">
  130. <text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;" :style="{fontSize:(wxFontSize-4)+'px'}">*</text><text :style="{fontSize:(wxFontSize-4)+'px'}">产品名称:</text>
  131. <uni-easyinput maxlength="50" type="text" :inputSize="wxFontSize-4" :placeholder-style="styleString" :clearable="false" v-model="item.prodName"
  132. placeholder="请输入产品名称" />
  133. </uni-forms-item>
  134. <uni-forms-item label="" name="prodSpec" label-width="0">
  135. <text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;" :style="{fontSize:(wxFontSize-4)+'px'}">*</text><text :style="{fontSize:(wxFontSize-4)+'px'}">产品型号:</text>
  136. <uni-easyinput maxlength="100" type="text" :inputSize="wxFontSize-4" :placeholder-style="styleString" :clearable="false" v-model="item.prodSpec"
  137. placeholder="请输入产品型号" />
  138. </uni-forms-item>
  139. <uni-forms-item label="" name="prodDesc">
  140. <text style="line-height: 30px;vertical-align: middle;" :style="{fontSize:(wxFontSize-4)+'px'}">产品介绍:</text>
  141. <uni-easyinput maxlength="500" :inputSize="wxFontSize-4" :placeholder-style="styleString" type="textarea" v-model="item.prodDesc" placeholder="请输入产品介绍" />
  142. </uni-forms-item>
  143. </uni-forms>
  144. <template v-slot:actions v-if="itemIndex==extList.length-1" >
  145. <view style="margin: 12px;margin-top: -12px;" :style="{fontSize:(wxFontSize-5)+'px'}">
  146. <text style="color:#999">为保证排版整洁,最多一次上传六个产品哦</text>
  147. </view>
  148. </template>
  149. </uni-card>
  150. </view>
  151. </view>
  152. </view>
  153. </view>
  154. <view v-if="selectValue2=='服务'&&stepIndex==2">
  155. <view style="padding: 16px">
  156. <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>
  157. <uni-data-select v-model="selectValue3" :localdata="selectList3" @change="changeSelect3"
  158. :clear="false" :fontSize="(wxFontSize-3)+'px'"></uni-data-select>
  159. </view>
  160. </view>
  161. <view v-if="selectValue2=='服务'&&stepIndex==2">
  162. <view style="padding: 16px">
  163. <text style="line-height: 30px;vertical-align: middle;" :style="{fontSize:(wxFontSize-3)+'px'}">服务品牌:</text>
  164. <uni-easyinput type="text" :clearable="false" :inputSize="wxFontSize-3" :placeholder-style="styleString" v-model="brand" placeholder="请输入服务品牌" />
  165. </view>
  166. </view>
  167. <view>
  168. <view v-if="selectValue2=='服务'&&stepIndex==2" style="padding: 16px;padding-bottom: 0;margin-bottom: -30rpx;">
  169. <text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;">*</text><text>服务介绍:</text>
  170. </view>
  171. <view v-if="selectValue2=='服务'&&stepIndex==2" class="tn-margin tn-bg-gray--light tn-padding"
  172. style="border-radius: 10rpx;">
  173. <textarea maxlength="500" v-model="content" placeholder="请输入服务介绍"
  174. placeholder-style="color:#AAAAAA" :style="{fontSize:(wxFontSize-3)+'px'}" :placeholder-style="styleString"></textarea>
  175. </view>
  176. <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin" style="margin-bottom: 0;" v-if="stepIndex==3">
  177. <view class="tn-flex justify-content-item">
  178. <view class="tn-text-center"
  179. style="border-radius: 100rpx;margin-right: 8rpx;width: 45rpx;height: 45rpx;line-height: 45rpx;">
  180. <text class="tn-icon-image" style="font-size: 20px;" :style="{fontSize:(wxFontSize+3)+'px'}"></text>
  181. </view>
  182. <view class="tn-padding-right-xs tn-text-bold" style="font-size: 16px;" :style="{fontSize:(wxFontSize-1)+'px'}">上传图片(选填)</view>
  183. </view>
  184. <!-- <view class="justify-content-item tn-text-df tn-color-grey" @tap="clear">
  185. <text class="tn-padding-xs">清空上传</text>
  186. <text class="tn-icon-delete"></text>
  187. </view> -->
  188. </view>
  189. <view class="tn-margin-left tn-padding-top-xs" v-show="stepIndex==3">
  190. <uni-file-picker v-model="imgList" :limit="6" :auto-upload="false" @select="select"
  191. @success="success" @delete="deleteFile">
  192. </uni-file-picker>
  193. <view style="margin-top: 8px;">
  194. <text style="color: #999;font-size: 12px;" :style="{fontSize:(wxFontSize-5)+'px'}">一次只能上传六张图片</text>
  195. </view>
  196. </view>
  197. <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin tn-padding-top-xs" style="margin-top:32px;margin-bottom: 0;" v-if="stepIndex==3">
  198. <view class="tn-flex justify-content-item">
  199. <view class="tn-text-center"
  200. style="border-radius: 100rpx;margin-right: 8rpx;width: 45rpx;height: 45rpx;line-height: 45rpx;">
  201. <text class="tn-icon-link" style="font-size: 20px;" :style="{fontSize:(wxFontSize+3)+'px'}"></text>
  202. </view>
  203. <view class="tn-padding-right-xs tn-text-bold" style="font-size: 16px;" :style="{fontSize:(wxFontSize-1)+'px'}">上传相关文件(选填)</view>
  204. </view>
  205. <!-- <view class="justify-content-item tn-text-df tn-color-grey" @tap="clear">
  206. <text class="tn-padding-xs">清空上传</text>
  207. <text class="tn-icon-delete"></text>
  208. </view> -->
  209. </view>
  210. <view class="tn-margin-left tn-padding-top-xs" v-show="stepIndex==3">
  211. <uni-file-picker v-model="fileList" :limit="3" mode="grid" file-mediatype="all"
  212. file-extname="pdf,docx,doc,xls,xlsx" :auto-upload="false" @select="select" @success="success" @delete="deleteFile">
  213. <view style="text-align: left;">
  214. <button size="mini" style="color:#1d60b1;border-color:#1d60b1;display: inline-block;" plain="true" :style="{fontSize:(wxFontSize-5)+'px'}">上传文件</button>
  215. </view>
  216. </uni-file-picker>
  217. <view style="margin-top: 4px;">
  218. <text style="color: #999;font-size: 12px;" :style="{fontSize:(wxFontSize-5)+'px'}">一次只能上传三个文件,支持格式 pdf .doc .xls,不超过5MB。</text>
  219. </view>
  220. <view style="margin-top:6px" v-if="selectValue2=='产品'">
  221. <text style="color: #999;font-size: 12px;" :style="{fontSize:(wxFontSize-5)+'px'}">如若产品属于医疗器械,请上传相关资质证明。</text>
  222. </view>
  223. </view>
  224. </view>
  225. <view label="11" name="check" style="padding:16px;margin-top:20px" v-if="stepIndex==3">
  226. <tn-checkbox v-model="formInfo.agree" activeColor="#45c05d" :size="wxFontSize+17" name="选项1" >
  227. <text :style="{fontSize:(wxFontSize-4)+'px',color:formInfo.agree?'#45c05d':'#666666'}">同意平台核查所填信息的真实性</text>
  228. </tn-checkbox>
  229. <text :style="{fontSize:(wxFontSize-4)+'px',color:'#888',paddingTop:'8px',display:'block'}">系统将短信通知您审核结果。如需关闭通知功能,请前往我的页面自行关闭</text>
  230. <!-- <uni-data-checkbox :multiple="true" v-model="formInfo.agree" selectedColor="#45c05d"
  231. :localdata="[{text: '同意平台核查所填信息的真实性',value: '是'}]" /> -->
  232. </view>
  233. <!-- 悬浮按钮-->
  234. <view class="tn-flex tn-footerfixed" >
  235. <view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center">
  236. <button type="default" plain="true" style="border-radius: 24px;"
  237. @click="preStep()" :style="{fontSize:(wxFontSize-2)+'px'}">
  238. 上一步
  239. </button>
  240. </view>
  241. <view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center">
  242. <button type="default" plain="true" style="border-radius: 24px;"
  243. @click="nextStep()" :style="{fontSize:(wxFontSize-2)+'px'}">
  244. 下一步
  245. </button>
  246. <!-- <tn-button backgroundColor="#3668FC" padding="40rpx 0" width="60%" shadow fontBold
  247. @click="nextStep()">
  248. <text class="tn-color-white">下一步</text>
  249. </tn-button> -->
  250. </view>
  251. </view>
  252. <view class="tn-flex tn-footerfixed" v-if="(stepIndex==3)">
  253. <view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center">
  254. <button type="default" plain="true" style="border-radius: 24px;"
  255. @click="preStep()" :style="{fontSize:(wxFontSize-2)+'px'}" :disabled="!canSave||!canNext">
  256. 上一步
  257. </button>
  258. </view>
  259. <view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center" v-if="canSave&&canNext">
  260. <button type="primary" style="background-color:#1d60b1;border-radius: 23px" @click="saveForm()" :style="{fontSize:(wxFontSize-2)+'px'}">提交审核</button>
  261. <!-- <tn-button backgroundColor="#3668FC" padding="40rpx 0" width="60%" shadow fontBold
  262. @click="saveForm()">
  263. <text class="tn-color-white">提交审核</text>
  264. </tn-button> -->
  265. </view>
  266. <view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center" v-if="!canSave||!canNext">
  267. <button type="primary" :disabled="!canSave||!canNext" style="background-color:#0003;border-radius: 23px" @click="saveForm()" :style="{fontSize:(wxFontSize-2)+'px'}">提交审核</button>
  268. <!-- <tn-button backgroundColor="#3668FC" padding="40rpx 0" width="60%" shadow fontBold
  269. @click="saveForm()">
  270. <text class="tn-color-white">提交审核</text>
  271. </tn-button> -->
  272. </view>
  273. </view>
  274. </view>
  275. </view>
  276. <view class='tn-tabbar-height'></view>
  277. </view>
  278. </template>
  279. <script>
  280. import template_page_mixin from '@/libs/mixin/template_page_mixin.js';
  281. import request from '../utils/request';
  282. export default {
  283. name: 'TemplateEdit',
  284. mixins: [template_page_mixin],
  285. data() {
  286. return {
  287. wxFontSize: 17,
  288. styleString:'font-size:'+14+'px',
  289. showTips:false,
  290. canSave:true,
  291. isMedical: '1',
  292. content: '',
  293. selectValue: '个人',
  294. selectList: [{
  295. value: '个人',
  296. text: '个人'
  297. },
  298. {
  299. value: '公司',
  300. text: '公司'
  301. }
  302. ],
  303. selectValue2: '产品',
  304. selectList2: [{
  305. value: '产品',
  306. text: '产品'
  307. },
  308. {
  309. value: '服务',
  310. text: '服务'
  311. }
  312. ],
  313. selectValue3: '维修维保',
  314. brand: '',
  315. // 维修维保/改造升级/验证/搬迁/厂房建设/其他
  316. selectList3: [{
  317. value: '维修维保',
  318. text: '维修维保'
  319. },
  320. {
  321. value: '改造升级',
  322. text: '改造升级'
  323. },
  324. {
  325. value: '验证',
  326. text: '验证'
  327. },
  328. {
  329. value: '搬迁',
  330. text: '搬迁'
  331. },
  332. {
  333. value: '厂房建设',
  334. text: '厂房建设'
  335. },
  336. {
  337. value: '其他',
  338. text: '其他'
  339. }
  340. ],
  341. selectValue4: '机械五金',
  342. selectList4: [{
  343. value: '机械五金',
  344. text: '机械五金'
  345. },
  346. {
  347. value: '仪器仪表',
  348. text: '仪器仪表'
  349. },
  350. {
  351. value: '耗材',
  352. text: '耗材'
  353. },
  354. {
  355. value: '其他',
  356. text: '其他'
  357. }
  358. ],
  359. extList: [],
  360. // 机械五金/仪器仪表/耗材/其他
  361. formInfo: {
  362. jobTitle: '',
  363. userRealName:JSON.parse(uni.getStorageSync('userInfo')).userRealName,
  364. // contactPerson:JSON.parse(uni.getStorageSync('userInfo')).contactNickName?JSON.parse(uni.getStorageSync('userInfo')).contactNickName:'用户'+JSON.parse(uni.getStorageInfoSync('userInfo')).userName.splice(-4),
  365. agree: false,
  366. contactNickName: JSON.parse(uni.getStorageSync('userInfo')).contactNickName||'用户'+JSON.parse(uni.getStorageSync('userInfo')).userName.slice(-4),
  367. contactMethod: JSON.parse(uni.getStorageSync('userInfo')).contactMethod || JSON.parse(uni
  368. .getStorageSync('userInfo')).userName
  369. },
  370. imgList: [],
  371. fileDetailList: [],
  372. stepIndex: 1,
  373. stepList: [{
  374. name: '填写个人信息',
  375. icon: 'circle',
  376. selectIcon: 'circle-fill'
  377. },
  378. {
  379. name: '填写供应信息',
  380. icon: 'trusty',
  381. selectIcon: 'trusty-fill'
  382. },
  383. {
  384. name: '上传附件',
  385. icon: 'folder',
  386. selectIcon: 'folder-fill'
  387. }
  388. ],
  389. stepList2 : [{
  390. name: '填写公司信息',
  391. icon: 'circle',
  392. selectIcon: 'circle-fill'
  393. },
  394. {
  395. name: '填写供应信息',
  396. icon: 'trusty',
  397. selectIcon: 'trusty-fill'
  398. },
  399. {
  400. name: '上传附件',
  401. icon: 'folder',
  402. selectIcon: 'folder-fill'
  403. }
  404. ],
  405. action: 'https://www.hualigs.cn/api/upload',
  406. // action: '',
  407. formData: {
  408. apiType: 'this,ali',
  409. token: 'dffc1e06e636cff0fdf7d877b6ae6a2e',
  410. image: null
  411. },
  412. fileList: [],
  413. showUploadList: true,
  414. customBtn: false,
  415. autoUpload: true,
  416. showProgress: false,
  417. deleteable: true,
  418. customStyle: false,
  419. maxCount: 9,
  420. disabled: false,
  421. searchValue: '',
  422. items: [],
  423. org: {},
  424. isEdit:false,
  425. editItem:{},
  426. canNext:true
  427. }
  428. },
  429. watch: {
  430. searchValue(val, oldval) {
  431. console.error(val, this.org.name);
  432. if (val !== this.org.name) {
  433. this.current = null;
  434. }
  435. if(this.selectValue!='个人'){
  436. this.search(val)
  437. }
  438. }
  439. },
  440. onLoad(props) {
  441. const appBaseInfo = wx.getAppBaseInfo();
  442. this.wxFontSize = uni.getStorageSync('fontSize')||appBaseInfo.fontSizeSetting||17;
  443. this.styleString='font-size:'+(this.wxFontSize-3)+'px';
  444. //从暂存里面编辑
  445. if(props.sid){
  446. this.isEdit = true;
  447. this.editItem = JSON.parse(uni.getStorageSync(props.sid)||'{}');
  448. this.content = this.editItem.content;
  449. this.selectValue2 = this.editItem.type==1?'产品':'服务';
  450. this.selectValue3 = this.editItem.secType;
  451. this.brand = this.editItem.brand;
  452. this.selectValue = this.editItem.subject=='1'?'公司':'个人';
  453. this.fileDetailList = this.editItem.fileDetailList;
  454. for(let i=0;i<this.fileDetailList.length;i++){
  455. this.fileDetailList[i].path = this.fileDetailList[i].ftpUrl
  456. if(this.isImage(this.fileDetailList[i].fileName)){
  457. this.imgList.push({
  458. name: this.fileDetailList[i].fileName,
  459. url: this.fileDetailList[i].ftpUrl,
  460. path: this.fileDetailList[i].path
  461. })
  462. }else{
  463. this.fileList.push({
  464. name: this.fileDetailList[i].fileName,
  465. url: this.fileDetailList[i].ftpUrl,
  466. path: this.fileDetailList[i].path
  467. })
  468. }
  469. }
  470. if(this.selectValue2=='产品'){
  471. this.selectValue4 = this.editItem.secType;
  472. this.isMedical = this.editItem.isMedical;
  473. this.extList = this.editItem.shareExt;
  474. }
  475. this.org.name = this.editItem.company;
  476. this.formInfo.jobTitle = this.editItem.jobTitle;
  477. this.formInfo.contactPerson = this.editItem.contactPerson;
  478. this.formInfo.contactMethod = this.editItem.contactMethod;
  479. this.formInfo.contactNickName = this.formInfo.contactNickName;
  480. }
  481. this.getCompany();
  482. },
  483. methods: {
  484. isImage(fileName) {
  485. const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'ico']
  486. const extension = fileName.split('.').pop().toLowerCase();
  487. return imageExtensions.includes(extension);
  488. },
  489. showSet(){
  490. uni.navigateTo({
  491. url: '/minePages/set',
  492. });
  493. },
  494. preStep(){
  495. this.stepIndex = this.stepIndex-1;
  496. },
  497. nextStep() {
  498. //todo 检查
  499. let that = this;
  500. if(this.stepIndex==1&&this.extList.length==0){
  501. this.extList.push({
  502. prodDesc: "",
  503. prodName: "",
  504. prodSpec: "",
  505. })
  506. }
  507. if(that.selectValue=='公司'){
  508. console.error(this.org);
  509. //判断必填项
  510. // 公司
  511. if(!this.org.name){
  512. uni.showToast({
  513. title: '请输入公司名称',
  514. duration: 2000,
  515. icon:'none'
  516. });
  517. return false;
  518. }
  519. if(!this.formInfo.jobTitle||this.formInfo.jobTitle.length<1){
  520. uni.showToast({
  521. title: '请输入您的职称',
  522. duration: 2000,
  523. icon:'none'
  524. });
  525. return false;
  526. }
  527. if(!this.formInfo.contactPerson||this.formInfo.contactPerson.length<1){
  528. uni.showToast({
  529. title: '请输入联系人姓名',
  530. duration: 2000,
  531. icon:'none'
  532. });
  533. return false;
  534. }
  535. if(!this.formInfo.contactMethod||this.formInfo.contactMethod.length<1){
  536. uni.showToast({
  537. title: '请输入联系手机/微信/邮箱',
  538. duration: 2000,
  539. icon:'none'
  540. });
  541. return false;
  542. }
  543. }
  544. if(this.stepIndex==2&&that.selectValue2=='产品'){
  545. if(this.brand.length<1){
  546. uni.showToast({
  547. title: '请输入产品品牌',
  548. duration: 2000,
  549. icon:'none'
  550. });
  551. return false;
  552. }
  553. for(let i=0;i<this.extList.length;i++){
  554. if(!this.extList[i].prodName||!this.extList[i].prodSpec){
  555. uni.showToast({
  556. title: !this.extList[i].prodName?'请输入产品'+(i+1)+'的产品名称':'请输入产品'+(i+1)+'的产品型号',
  557. duration: 2000,
  558. icon:'none'
  559. });
  560. return false;
  561. }
  562. }
  563. }
  564. if(this.stepIndex==2&&that.selectValue2=='服务'){
  565. if(!this.selectValue3){
  566. uni.showToast({
  567. title: '请选择服务类型',
  568. duration: 2000,
  569. icon:'none'
  570. });
  571. return false;
  572. }
  573. if(!this.content){
  574. uni.showToast({
  575. title: '请输入服务介绍',
  576. duration: 2000,
  577. icon:'none'
  578. });
  579. return false;
  580. }
  581. }
  582. this.stepIndex = this.stepIndex+1;
  583. },
  584. getCompany(){
  585. let that = this;
  586. request.post('/slbUserCompanyRel/show/my', {
  587. userNo: uni.getStorageSync('userNo')
  588. }).then(res => {
  589. if (res.success) {
  590. let list = res.list || [];
  591. for(let i=0;i<list.length;i++){
  592. list[i].name = list[i].company;
  593. list[i].regNumber= list[i].company;
  594. if(!that.isEdit&&list[i].isDefault=='1'){
  595. that.searchValue = list[i].name
  596. that.current = list[i].name;
  597. that.formInfo.jobTitle = list[i].jobTitle;
  598. that.formInfo.contactPerson = list[i].contactPerson;
  599. that.formInfo.contactMethod = list[i].contactMethod;
  600. that.org = list[i];
  601. that.getAddress(list[i].name);
  602. }
  603. if(that.isEdit&&list[i].name==that.editItem.company){
  604. that.searchValue = list[i].name
  605. that.current = list[i].name;
  606. that.formInfo.jobTitle = list[i].jobTitle;
  607. that.formInfo.contactPerson = list[i].contactPerson;
  608. that.formInfo.contactMethod = list[i].contactMethod;
  609. that.org = list[i];
  610. that.getAddress(list[i].name);
  611. }
  612. }
  613. that.items = list;
  614. console.warn(that.items);
  615. }else{
  616. if(res._redirect){
  617. uni.showToast({
  618. title: '操作过期,请重试',
  619. duration: 2000,
  620. icon:'none'
  621. });
  622. that.goBack();
  623. }
  624. }
  625. })
  626. },
  627. goBack() {
  628. const pages = getCurrentPages()
  629. // 有可返回的页面则直接返回,uni.navigateBack 默认返回失败之后会自动刷新页面 ,无法继续返回
  630. if (pages.length > 1) {
  631. uni.navigateBack()
  632. return;
  633. }else{
  634. uni.navigateTo({
  635. url: '/pages/index/index'
  636. })
  637. }
  638. },
  639. changeSelect(e) {
  640. this.selectValue = e;
  641. },
  642. changeSelect2(e) {
  643. this.selectValue2 = e;
  644. },
  645. changeSelect3(e) {
  646. this.selectValue3 = e;
  647. },
  648. changeSelect4(e) {
  649. this.selectValue4 = e;
  650. },
  651. newItem(){
  652. this.extList.push({
  653. prodDesc: "",
  654. prodName: "",
  655. prodSpec: "",
  656. })
  657. },
  658. delItem(index){
  659. this.extList.splice(index,1);
  660. },
  661. saveForm(status) {
  662. if(!this.canSave){
  663. return false;
  664. }
  665. let that = this;
  666. if(status!=1&&that.selectValue2=='服务'){
  667. if(!this.content){
  668. uni.showToast({
  669. title: '请输入服务介绍',
  670. duration: 2000,
  671. icon:'none'
  672. });
  673. return false;
  674. }
  675. }
  676. if(status!=1&&that.selectValue2=='产品'){
  677. for(let i=0;i<this.extList.length;i++){
  678. if(!this.extList[i].prodName||!this.extList[i].prodSpec){
  679. uni.showToast({
  680. title: !this.extList[i].prodName?'请输入产品'+(i+1)+'的产品名称':'请输入产品'+(i+1)+'的产品型号',
  681. duration: 2000,
  682. icon:'none'
  683. });
  684. return false;
  685. }
  686. }
  687. }
  688. if(status!=1&&!this.formInfo.agree){
  689. uni.showToast({
  690. title: '请勾选同意平台核查所填信息的真实性',
  691. duration: 2000,
  692. icon:'none'
  693. });
  694. return false;
  695. }
  696. if(!that.canNext){
  697. uni.showToast({
  698. title: '照片/文件正在上传中,请耐心等待',
  699. duration: 2000,
  700. icon:'none'
  701. });
  702. return false;
  703. }
  704. let params = {
  705. };
  706. let postData = {
  707. type: that.selectValue2=='服务'?'2':'1',
  708. secType: that.selectValue3,
  709. company: that.selectValue=='公司'?this.org.name:'',
  710. subject: that.selectValue=='公司'?'1':'2',
  711. jobTitle: this.formInfo.jobTitle,
  712. contactPerson: that.selectValue=='公司'?this.formInfo.contactPerson:(this.formInfo.userRealName||this.formInfo.contactNickName),
  713. contactMethod: this.formInfo.contactMethod,
  714. contactNickName: this.formInfo.contactNickName,
  715. content: that.content,
  716. userNo: uni.getStorageSync('userNo'),
  717. status: status==1?status:3,
  718. showFlag: '是',
  719. brand: that.brand,
  720. id: that.isEdit?that.editItem.id:undefined,
  721. bisNo: that.isEdit?that.editItem.bisNo:undefined,
  722. version: that.isEdit?that.editItem.version:undefined
  723. }
  724. if(that.selectValue=='公司'){
  725. postData.companyEntity = {};
  726. postData.companyEntity.company = postData.company;
  727. postData.companyEntity.jobTitle = postData.jobTitle;
  728. postData.companyEntity.creditCode = this.org.creditCode;
  729. postData.companyEntity.address = this.org.base;
  730. postData.companyEntity.regStatus = this.org.regStatus;
  731. postData.companyEntity.contactPerson = postData.contactPerson;
  732. postData.companyEntity.contactMethod = postData.contactMethod;
  733. postData.companyEntity.contactNickName = postData.contactNickName;
  734. // postData.companyEntity.address = this.org.creditCode;
  735. // postData.companyEntity.company = postData.company;
  736. postData.slbUserExt = {};
  737. postData.slbUserExt.userContactMethod = postData.contactMethod;
  738. postData.slbUserExt.contactPerson = postData.contactPerson;
  739. postData.slbUserExt.contactMethod = postData.contactMethod;
  740. postData.slbUserExt.contactNickName = postData.contactNickName;
  741. postData.slbUserExt.userRealName = this.formInfo.userRealName;
  742. }else{
  743. postData.slbUserExt = {};
  744. postData.slbUserExt.userContactMethod = postData.contactMethod;
  745. postData.slbUserExt.contactPerson = postData.contactPerson;
  746. postData.slbUserExt.contactMethod = postData.contactMethod;
  747. postData.slbUserExt.contactNickName = postData.contactNickName;
  748. postData.slbUserExt.userRealName = this.formInfo.userRealName;
  749. }
  750. if(postData.type=='1'){
  751. postData.secType = that.selectValue4;
  752. postData.isMedical = that.isMedical;
  753. postData.content = '';
  754. postData.shareExt = that.extList;
  755. }
  756. params.slbResourceShare = JSON.stringify(postData);
  757. params.fileDetailList = JSON.stringify(this.fileDetailList);
  758. uni.showToast({
  759. title: '提交中...',
  760. icon:'none'
  761. });
  762. that.canSave = false;
  763. request.post(that.isEdit?'/slbResourceShare/update':'/slbResourceShare/add', params).then(res => {
  764. if (res.success) {
  765. uni.showToast({
  766. title: status==1?'信息已暂存,请在我的供应中查看暂存信息':'发布已提交,请在我的供应中查看进度',
  767. icon: 'none',
  768. success: () => {
  769. setTimeout(() => {
  770. uni.redirectTo({
  771. url: "/pages/mine/share?tab="+(status==1?2:1)
  772. });
  773. }, 2500)
  774. }
  775. })
  776. } else {
  777. uni.showToast({
  778. title: res.msg,
  779. icon: 'none'
  780. })
  781. that.canSave = true;
  782. }
  783. console.warn(res);
  784. })
  785. },
  786. // 跳转
  787. tn(e) {
  788. uni.navigateTo({
  789. url: e,
  790. });
  791. },
  792. // 手动上传文件
  793. upload() {
  794. console.warn(121212);
  795. },
  796. // 手动清空列表
  797. clear() {
  798. this.$refs.imageUpload.clear()
  799. },
  800. select(e) {
  801. console.log('选择文件:', e)
  802. let tempFiles = e.tempFiles;
  803. for (let i in tempFiles) {
  804. this.upfile(tempFiles[i])
  805. }
  806. },
  807. upfile(file) {
  808. let that = this;
  809. console.warn(file);
  810. this.canNext = false;
  811. uni.showToast({
  812. title: '照片/文件正在上传中,请耐心等待',
  813. icon:'none'
  814. });
  815. uni.uploadFile({
  816. url: 'https://slb-m.lx-device.com/oss/upload/userFeedback', //仅为示例,非真实的接口地址
  817. filePath: file.url,
  818. name: 'file',
  819. success: (uploadFileRes) => {
  820. that.canNext = true;
  821. uni.hideToast();
  822. console.warn(JSON.parse(uploadFileRes.data));
  823. if(JSON.parse(uploadFileRes.data).success){
  824. let resultMap = JSON.parse(uploadFileRes.data).resultMap;
  825. that.fileDetailList.push({
  826. name: file.name,
  827. fileName: file.name, // 原始文件名
  828. ftpUrl: resultMap.uploadUrl, // 文件访问url
  829. path: file.path
  830. })
  831. }else{
  832. uni.showToast({
  833. title: JSON.parse(uploadFileRes.data).msg+',请删除后重试',
  834. icon:'none'
  835. });
  836. }
  837. },
  838. fail:(err)=>{
  839. uni.showToast({
  840. title: '上传失败,请删除后重试',
  841. icon:'none'
  842. });
  843. }
  844. });
  845. },
  846. // 上传成功
  847. success(e) {
  848. console.log('上传成功')
  849. },
  850. deleteFile(e, index) {
  851. if(!this.canNext){
  852. uni.showToast({
  853. title: '照片/文件正在上传中,请耐心等待',
  854. icon:'none'
  855. });
  856. return false;
  857. }
  858. for(let i=0;i<this.fileDetailList.length;i++){
  859. if(e.tempFile.path===this.fileDetailList[i].path){
  860. this.fileDetailList.splice(i, 1);
  861. }
  862. }
  863. console.error(this.fileDetailList);
  864. },
  865. selectChange(e) {
  866. this.searchValue = e.name
  867. this.current = e.regNumber;
  868. if(e.jobTitle){
  869. this.formInfo.jobTitle = e.jobTitle;
  870. this.formInfo.contactPerson = this[i].contactPerson;
  871. this.formInfo.contactMethod = this[i].contactMethod;
  872. }
  873. this.org = e;
  874. this.getAddress(e.name);
  875. },
  876. getAddress(name){
  877. let that = this;
  878. request.post('/member/getEnterPriseInfo', {
  879. keyWord: name
  880. }).then(res => {
  881. if(res&&res.success&&res.resultMap.data){
  882. if( res.resultMap.data.creditCode){
  883. that.org.creditCode = res.resultMap.data.creditCode
  884. }
  885. if( res.resultMap.data.regStatus){
  886. that.org.regStatus = res.resultMap.data.regStatus
  887. }
  888. if( res.resultMap.data.regLocation){
  889. that.org.base = res.resultMap.data.regLocation
  890. }
  891. }
  892. })
  893. },
  894. search: function(val) {
  895. let that = this;
  896. if (val && val.length > 3) {
  897. request.post('/member/searchCompys', {
  898. keyWord: val
  899. }).then(res => {
  900. if (res.success) {
  901. let list = res.resultMap.data || [];
  902. that.items = list;
  903. }else{
  904. if(res._redirect){
  905. uni.showToast({
  906. title: '操作过期,请重试',
  907. duration: 2000,
  908. icon:'none'
  909. });
  910. that.goBack();
  911. }
  912. }
  913. })
  914. } else {
  915. that.items = [];
  916. that.org = {};
  917. }
  918. },
  919. }
  920. }
  921. </script>
  922. <style lang="scss" scoped>
  923. .template-edit {}
  924. /* 胶囊*/
  925. .tn-custom-nav-bar__back {
  926. width: 60%;
  927. height: 100%;
  928. position: relative;
  929. display: flex;
  930. justify-content: space-evenly;
  931. align-items: center;
  932. box-sizing: border-box;
  933. // background-color: rgba(0, 0, 0, 0.15);
  934. border-radius: 1000rpx;
  935. border: 1rpx solid rgba(255, 255, 255, 0.5);
  936. // color: #FFFFFF;
  937. font-size: 18px;
  938. .icon {
  939. display: block;
  940. flex: 1;
  941. margin: auto;
  942. text-align: center;
  943. }
  944. &:before {
  945. content: " ";
  946. width: 1rpx;
  947. height: 110%;
  948. position: absolute;
  949. top: 22.5%;
  950. left: 0;
  951. right: 0;
  952. margin: auto;
  953. transform: scale(0.5);
  954. transform-origin: 0 0;
  955. pointer-events: none;
  956. box-sizing: border-box;
  957. opacity: 0.7;
  958. background-color: #FFFFFF;
  959. }
  960. }
  961. /* 底部悬浮按钮 start*/
  962. .tn-tabbar-height {
  963. min-height: 100rpx;
  964. height: calc(120rpx + env(safe-area-inset-bottom) / 2);
  965. }
  966. .tn-footerfixed {
  967. position: fixed;
  968. width: 100%;
  969. bottom: calc(env(safe-area-inset-bottom));
  970. z-index: 1024;
  971. box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0);
  972. background: #fff;
  973. }
  974. /* 底部悬浮按钮 end*/
  975. /* 标签内容 start*/
  976. .tn-tag-content {
  977. &__item {
  978. display: inline-block;
  979. line-height: 45rpx;
  980. padding: 10rpx 30rpx;
  981. margin: 20rpx 20rpx 5rpx 0rpx;
  982. &--prefix {
  983. padding-right: 10rpx;
  984. }
  985. }
  986. }
  987. /deep/ .uni-forms-item__label {
  988. display: none;
  989. }
  990. /deep/ .uni-list-item__container {
  991. align-items: center;
  992. }
  993. /deep/.uni-card--shadow {
  994. margin:0 !important;
  995. }
  996. /* 标签内容 end*/
  997. </style>