addShare.vue 47 KB

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