addShare.vue 35 KB

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