addShare.vue 35 KB

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