addShare.vue 30 KB

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