shareDeatail.vue 45 KB

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