addShare.vue 36 KB

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