index.vue 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300
  1. <template>
  2. <view id="unitInfoCollection" v-if="!successBool">
  3. <view>
  4. <u-notice-bar text="注:信息提交后不可修改,提交前请核对填写是否有误" :duration="7000" color="#FF0000" bgColor="#FFFFFF"></u-notice-bar>
  5. </view>
  6. <view class="centerOne" v-if="pagingBool">
  7. <view class="title"> 单位基本信息(1/2) </view>
  8. <u--form :model="form" ref="uForm" :rules="rules" labelWidth="130">
  9. <view style="padding: 10px 0">
  10. <view style="padding: 10px 10px 20px 10px; background: #ffffff">
  11. <view style="padding-left: 9px">
  12. <u-form-item label="单位名称" prop="companyName" required :borderBottom="true">
  13. <u-input v-model="form.companyName" placeholder="请输入单位名称" border="none">
  14. <template #suffix>
  15. <u-icon name="search" color="#999999" size="22" @click="companySubmit(form.companyName)"></u-icon>
  16. </template>
  17. </u-input>
  18. </u-form-item>
  19. <u-form-item label="统一社会信用代码" prop="organization" required :borderBottom="true">
  20. <u-input v-model="form.organization" placeholder="请输入统一社会信用代码" border="none" maxlength="18" />
  21. </u-form-item>
  22. <u-form-item label="法人代表" prop="delegateName" required :borderBottom="true">
  23. <u-input v-model="form.delegateName" placeholder="请输入法人代表" border="none" />
  24. </u-form-item>
  25. <u-form-item label="所属街镇" prop="streetTown" required :borderBottom="true" @click="handleAction('所属街镇')">
  26. <u-input v-model="form.streetTown" placeholder="请选择所属街镇" suffixIcon="arrow-right" suffixIconStyle="color: #909399" border="none" disabledColor="transparent" disabled />
  27. </u-form-item>
  28. <u-form-item label="单位地址" prop="address" required :borderBottom="true">
  29. <u-input v-model="form.address" placeholder="请输入单位地址" border="none" />
  30. </u-form-item>
  31. <u-form-item label="消防管理人电话" prop="fireManagePhone" required :borderBottom="true">
  32. <u-input v-model="form.fireManagePhone" placeholder="请输入消防管理人电话" border="none" maxlength="11" />
  33. </u-form-item>
  34. <u-form-item label="成立时间" prop="foundTime" required :borderBottom="true" @click="handleDateTime('成立时间', 0, form.foundTime)">
  35. <u-input v-model="form.foundTime" placeholder="请选择成立时间" border="none" suffixIcon="calendar" suffixIconStyle="color: #909399;font-size:22px" />
  36. </u-form-item>
  37. <u-form-item label="单位使用性质" prop="companyNature" :borderBottom="true" @click="handleAction('单位使用性质')" required>
  38. <u-input v-model="form.companyNature" placeholder="请选择单位使用性质" suffixIcon="arrow-right" suffixIconStyle="color: #909399" border="none" disabledColor="transparent" disabled />
  39. </u-form-item>
  40. <u-form-item label="产证" prop="birthCert" :borderBottom="true" @click="handleAction('产证')" required>
  41. <u-input v-model="form.birthCert" placeholder="请选择产证" suffixIcon="arrow-right" suffixIconStyle="color: #909399" border="none" disabledColor="transparent" disabled />
  42. </u-form-item>
  43. <u-form-item label="单位建筑面积" prop="buildArea" :borderBottom="true" required>
  44. <u-input type="number" v-model="form.buildArea" placeholder="请输入单位建筑面积" suffixIcon="平方米" suffixIconStyle="color:#999999;font-size:15px" border="none" />
  45. </u-form-item>
  46. <u-form-item label="消防安全责任人" prop="fireDutyName" :borderBottom="true">
  47. <u-input v-model="form.fireDutyName" placeholder="请输入消防安全责任人" border="none" />
  48. </u-form-item>
  49. <u-form-item label="消防安全管理人" prop="fireManageName" :borderBottom="true">
  50. <u-input v-model="form.fireManageName" placeholder="请输入消防安全管理人" border="none" />
  51. </u-form-item>
  52. <u-form-item label="职工人数" prop="employeeNum" :borderBottom="true">
  53. <u-input type="digit" v-model="form.employeeNum" placeholder="请输入职工人数" suffixIcon="人" suffixIconStyle="color:#999999;font-size:15px" border="none" />
  54. </u-form-item>
  55. <u-form-item label="固定资产(万元)" prop="fixedAssets" :borderBottom="true">
  56. <u-input type="number" v-model="form.fixedAssets" placeholder="请输入固定资产(万元)" suffixIcon="万元" suffixIconStyle="color:#999999;font-size:15px" border="none" />
  57. </u-form-item>
  58. </view>
  59. </view>
  60. </view>
  61. </u--form>
  62. <view style="padding-bottom: 70px"> </view>
  63. <view style="position: fixed; left: 0; right: 0; bottom: 0; padding: 15px">
  64. <view>
  65. <u-button type="primary" style="width: 100%; height: 40px; font-size: 14px" @click="handleSubmit('下一步')" shape="circle"> 下一步 </u-button>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="centerTwo" v-else>
  70. <view class="title"> 所在建筑信息(2/2) </view>
  71. <u--form ref="uForm1" :model="form" :rules="rules" labelWidth="130">
  72. <view style="padding: 10px 0" v-for="(li, index) in form.baseBuildList" :key="index">
  73. <view class="" style="padding: 10px 10px 20px 10px; background: #ffffff">
  74. <view style="display: flex; overflow: hidden">
  75. <image style="width: 15px; height: 15px; margin: auto 10px auto 0" src="@/static/images/unitInfoCollection/icon1.png" />
  76. <view style="margin: auto auto auto 0">建筑{{ index + 1 }}</view>
  77. <u-icon v-if="form.baseBuildList.length > 1" name="trash" color="#FF0000" size="20" style="float: right" @click="deleteSubmit('建筑', index)"></u-icon>
  78. </view>
  79. <view style="padding-left: 9px">
  80. <u-form-item label="建筑名称" :prop="`baseBuildList.${index}.baseBuild.buildName`" required :borderBottom="true">
  81. <u-input v-model="li.baseBuild.buildName" placeholder="请输入建筑名称" border="none" maxlength="30" />
  82. </u-form-item>
  83. <u-form-item label="建筑地址" :prop="`baseBuildList.${index}.baseBuild.address`" required :borderBottom="true">
  84. <u-input v-model="li.baseBuild.address" placeholder="请输入建筑地址" border="none" maxlength="100" />
  85. </u-form-item>
  86. <u-form-item label="建筑结构" :prop="`baseBuildList.${index}.baseBuild.buildStructure`" required :borderBottom="true" @click="handleAction('建筑结构', index)">
  87. <u-input
  88. v-model="li.baseBuild.buildStructure"
  89. placeholder="请选择建筑结构"
  90. border="none"
  91. suffixIcon="arrow-right"
  92. suffixIconStyle="color: #909399"
  93. disabledColor="transparent"
  94. disabled
  95. />
  96. </u-form-item>
  97. <u-form-item v-if="li.baseBuild.buildStructure === '钢结构'" label="是否有防火涂层" :prop="`baseBuildList.${index}.baseBuild.fireproofCoat`" required :borderBottom="true">
  98. <u-radio-group v-model="li.baseBuild.fireproofCoat" placement="row">
  99. <u-radio style="margin-right: 30px" :name="0" label="无"></u-radio>
  100. <u-radio :name="1" label="有"></u-radio>
  101. </u-radio-group>
  102. </u-form-item>
  103. <u-form-item label="建筑高度" :prop="`baseBuildList.${index}.baseBuild.buildHigh`" required :borderBottom="true">
  104. <u-input type="number" v-model="li.baseBuild.buildHigh" placeholder="请输入建筑高度" suffixIcon="米" suffixIconStyle="color: #909399;font-size:15px" border="none" maxlength="20" />
  105. </u-form-item>
  106. <u-form-item label="地上层数" :prop="`baseBuildList.${index}.baseBuild.aboveFloor`" required :borderBottom="true">
  107. <u-input type="number" v-model="li.baseBuild.aboveFloor" placeholder="请输入地上层数" border="none" maxlength="5" />
  108. </u-form-item>
  109. <u-form-item label="地下层数" prop="li.underFloor" :borderBottom="true">
  110. <u-input type="number" v-model="li.baseBuild.underFloor" placeholder="请输入地下层数" border="none" maxlength="5" />
  111. </u-form-item>
  112. <u-form-item label="建筑面积" :prop="`baseBuildList.${index}.baseBuild.buildArea`" required :borderBottom="true">
  113. <u-input type="digit" v-model="li.baseBuild.buildArea" placeholder="请输入建筑面积" suffixIcon="平方米" suffixIconStyle="color:#999999;font-size:15px" border="none" maxlength="20" />
  114. </u-form-item>
  115. <u-form-item label="地下空间" prop="li.underSpace" :borderBottom="true">
  116. <u-input
  117. type="number"
  118. v-model="li.baseBuild.underSpace"
  119. placeholder="请输入地下空间面积"
  120. suffixIcon="平方米"
  121. suffixIconStyle="color:#999999;font-size:15px"
  122. border="none"
  123. maxlength="20"
  124. />
  125. </u-form-item>
  126. <u-form-item label="建成年份" :prop="`baseBuildList.${index}.baseBuild.completeYear`" required :borderBottom="true" @click="handleDateTime('建成年份', index, li.completeYear)">
  127. <u-input
  128. v-model="li.baseBuild.completeYear"
  129. placeholder="请选择建成年份"
  130. suffixIcon="calendar"
  131. suffixIconStyle="color: #909399;font-size:22px"
  132. border="none"
  133. disabledColor="transparent"
  134. disabled
  135. />
  136. </u-form-item>
  137. <u-form-item label="使用性质" :prop="`baseBuildList.${index}.baseBuild.useCharacter`" required :borderBottom="true" @click="handleAction('使用性质', index)">
  138. <u-input
  139. v-model="li.baseBuild.useCharacter"
  140. placeholder="请选择使用性质"
  141. suffixIcon="arrow-right"
  142. suffixIconStyle="color: #909399"
  143. border="none"
  144. disabledColor="transparent"
  145. disabled
  146. />
  147. </u-form-item>
  148. <view
  149. v-if="
  150. li.baseBuild.useCharacter == '生产类厂房' || li.baseBuild.useCharacter == '仓库、物流' || li.baseBuild.useCharacter == '涉及易燃易爆危险品的单位(生产、充装、储存、供应、销售等)'
  151. "
  152. >
  153. <view style="margin: 10px 0; text-align: center">危险品生产数量(吨/月)</view>
  154. <u-form-item label="甲类" prop="li.baseBuildAttach.hazardousProduceA" :borderBottom="true">
  155. <u-input type="number" v-model="li.baseBuildAttach.hazardousProduceA" placeholder="请输入甲类" border="none" maxlength="24" />
  156. </u-form-item>
  157. <u-form-item label="乙类" prop="li.baseBuildAttach.hazardousProduceB" :borderBottom="true">
  158. <u-input type="number" v-model="li.baseBuildAttach.hazardousProduceB" placeholder="请输入乙类" border="none" maxlength="24" />
  159. </u-form-item>
  160. <u-form-item label="丙类" prop="li.baseBuildAttach.hazardousProduceC" :borderBottom="true">
  161. <u-input type="number" v-model="li.baseBuildAttach.hazardousProduceC" placeholder="请输入丙类" border="none" maxlength="24" />
  162. </u-form-item>
  163. <u-form-item label="丁戊类" prop="li.baseBuildAttach.hazardousProduceD" :borderBottom="true">
  164. <u-input type="number" v-model="li.baseBuildAttach.hazardousProduceD" placeholder="请输入丁戊类" border="none" maxlength="24" />
  165. </u-form-item>
  166. <view style="margin: 10px 0; text-align: center">危险品存储数量(吨)</view>
  167. <u-form-item label="甲类" prop="li.baseBuildAttach.hazardousStorageA" :borderBottom="true">
  168. <u-input type="number" v-model="li.baseBuildAttach.hazardousStorageA" placeholder="请输入甲类" border="none" maxlength="24" />
  169. </u-form-item>
  170. <u-form-item label="乙类" prop="li.baseBuildAttach.hazardousStorageB" :borderBottom="true">
  171. <u-input type="number" v-model="li.baseBuildAttach.hazardousStorageB" placeholder="请输入乙类" border="none" maxlength="24" />
  172. </u-form-item>
  173. <u-form-item label="丙类" prop="li.baseBuildAttach.hazardousStorageC" :borderBottom="true">
  174. <u-input type="number" v-model="li.baseBuildAttach.hazardousStorageC" placeholder="请输入丙类" border="none" maxlength="24" />
  175. </u-form-item>
  176. <u-form-item label="丁戊类" prop="li.baseBuildAttach.hazardousStorageD" :borderBottom="true">
  177. <u-input type="number" v-model="li.baseBuildAttach.hazardousStorageD" placeholder="请输入丁戊类" border="none" maxlength="24" />
  178. </u-form-item>
  179. </view>
  180. <u-form-item label="消防设施设置" :prop="`baseBuildList.${index}.baseBuild.fireFacilitySystem`" required :borderBottom="true">
  181. <u-checkbox-group v-model="li.baseBuild.fireFacilitySystem" placement="column" @change="checkboxChange">
  182. <u-checkbox :customStyle="{ marginBottom: '8px' }" label="自动喷水灭火系统" :name="1"> </u-checkbox>
  183. <u-checkbox :customStyle="{ marginBottom: '8px' }" label="火灾自动报警系统" :name="2"> </u-checkbox>
  184. <u-checkbox :customStyle="{ marginBottom: '8px' }" label="防排烟与排烟系统" :name="3"> </u-checkbox>
  185. <u-checkbox :customStyle="{ marginBottom: '8px' }" label="消防物联网系统" :name="4"> </u-checkbox>
  186. </u-checkbox-group>
  187. </u-form-item>
  188. <u-form-item label="其他设施" :prop="`li.baseBuildList.baseBuild.otherSystem`" :borderBottom="true">
  189. <u-checkbox-group v-model="li.baseBuild.otherSystem" placement="column" @change="checkboxChange">
  190. <u-checkbox :customStyle="{ marginBottom: '8px' }" label="泡沫灭火系统" :name="1"> </u-checkbox>
  191. <u-checkbox :customStyle="{ marginBottom: '8px' }" label="水喷雾、细水雾灭火系统" :name="2"> </u-checkbox>
  192. <u-checkbox :customStyle="{ marginBottom: '8px' }" label="消防炮、自动跟踪定位射流灭火系统" :name="3"> </u-checkbox>
  193. <u-checkbox :customStyle="{ marginBottom: '8px' }" label="气体灭火系统" :name="4"> </u-checkbox>
  194. <u-checkbox :customStyle="{ marginBottom: '8px' }" label="干粉灭火系统" :name="5"> </u-checkbox>
  195. <u-checkbox :customStyle="{ marginBottom: '8px' }" label="其他" :name="6"> </u-checkbox>
  196. <u-input v-if="li.baseBuild.otherSystem.includes(6)" v-model="li.baseBuild.otherFacilities" placeholder="请输入消防设施名称" border="none" />
  197. </u-checkbox-group>
  198. </u-form-item>
  199. <view>
  200. <view v-for="(base, baseIndex) in li.baseBuildExtinguishList" :key="baseIndex">
  201. <view style="margin: 10px 0; text-align: left">
  202. {{ "灭火器" + (baseIndex + 1) }}
  203. <u-icon v-if="li.baseBuildExtinguishList.length > 1" name="trash" color="#FF0000" size="20" style="float: right" @click="deleteSubmit('灭火器', index, baseIndex)"></u-icon>
  204. </view>
  205. <u-form-item
  206. label="类型"
  207. :prop="`baseBuildList.${index}.baseBuildExtinguishList.${baseIndex}.extinguishType`"
  208. required
  209. :borderBottom="true"
  210. @click="handleAction('灭火器', index, baseIndex)"
  211. >
  212. <u-input v-model="base.extinguishType" placeholder="请选择类型" border="none" suffixIcon="arrow-right" suffixIconStyle="color: #909399" disabledColor="transparent" disabled />
  213. </u-form-item>
  214. <u-form-item label="数量" :prop="`baseBuildList.${index}.baseBuildExtinguishList.${baseIndex}.extinguishNum`" :borderBottom="true" required>
  215. <u-input type="number" v-model="base.extinguishNum" placeholder="请输入数量" border="none" maxlength="10" />
  216. </u-form-item>
  217. </view>
  218. <u-button
  219. type="primary"
  220. style="width: 100px; height: 25px; margin-top: 10px"
  221. v-if="li.baseBuildExtinguishList.length < 6"
  222. @click="addSubmit('灭火器', index)"
  223. shape="circle"
  224. icon="plus"
  225. :plain="true"
  226. size="mini"
  227. >
  228. 添加灭火器
  229. </u-button>
  230. </view>
  231. </view>
  232. </view>
  233. </view>
  234. </u--form>
  235. <view style="padding-bottom: 70px">
  236. <u-button type="primary" style="width: 25%; height: 25px; margin-top: 10px" @click="addSubmit('建筑')" shape="circle" icon="plus" size="mini"> 添加建筑 </u-button>
  237. </view>
  238. <view style="position: fixed; left: 0; right: 0; bottom: 0; padding: 15px; background-color: transparent">
  239. <view style="display: flex">
  240. <u-button style="width: 50%; height: 40px; font-size: 14px; margin-right: 15px" @click="handleSubmit('上一步')" shape="circle" customStyle="border-color:#3c9cff;color:#3c9cff">
  241. 上一步
  242. </u-button>
  243. <u-button type="primary" style="width: 50%; height: 40px; font-size: 14px" @click="handleSubmit('提交')" shape="circle"> 提交 </u-button>
  244. </view>
  245. </view>
  246. </view>
  247. <u-picker
  248. :show="actionShow"
  249. :columns="actionsList"
  250. :title="'请选择' + actionTitle"
  251. keyName="name"
  252. visibleItemCount="6"
  253. :defaultIndex="[actionDefaultIndex]"
  254. :closeOnClickOverlay="true"
  255. @close="actionShow = false"
  256. @cancel="actionShow = false"
  257. @confirm="selectAction"
  258. ></u-picker>
  259. <u-datetime-picker
  260. :show="showTime"
  261. v-model="timeValue"
  262. mode="date"
  263. @close="showTime = false"
  264. @cancel="showTime = false"
  265. @confirm="timeSubmit"
  266. :closeOnClickOverlay="true"
  267. :minDate="Number(new Date('1900'))"
  268. :maxDate="Number(new Date())"
  269. ></u-datetime-picker>
  270. <u-modal
  271. :show="modalShow"
  272. title="系统提示"
  273. confirmText="修改"
  274. cancelText="新增"
  275. :showCancelButton="true"
  276. cancelColor="#2979ff"
  277. @confirm="handleSubmitApi('是')"
  278. @cancel="handleSubmitApi('否')"
  279. :closeOnClickOverlay="true"
  280. @close="modalShow = false"
  281. >
  282. <view class="slot-content">
  283. <view style="text-align: center; margin-bottom: 10px">是否修改单位名称为“{{ newCompanyName }}”的信息?</view>
  284. <view style="text-align: center; font-size: 13px; color: #ff0000">注:“修改”则点击修改,“新增”将提交一条新的记录,如需“取消”操作可点击空白区域</view>
  285. </view>
  286. </u-modal>
  287. </view>
  288. <view v-else>
  289. <view style="display: flex">
  290. <image style="width: 120px; height: 120px; margin: 50px auto 20px auto" src="@/static/images/unitInfoCollection/success.png" />
  291. </view>
  292. <view style="text-align: center; font-weight: 600">提交成功</view>
  293. </view>
  294. </template>
  295. <script setup>
  296. import { onLoad, onShow, onHide, onLaunch, onReady } from "@dcloudio/uni-app";
  297. import { ref, onMounted, inject, shallowRef, reactive, toRefs, getCurrentInstance } from "vue";
  298. import { getToken } from "@/utils/auth";
  299. import publicStore from "@/store/modules/public.js";
  300. import { companyByNameSelect, addBaseCompany, delBaseBuild, delBaseBuildExtinguish } from "@/api/business/mhxf/unitInfoCollection";
  301. const { proxy } = getCurrentInstance();
  302. const publicStores = publicStore();
  303. const checkboxValue = ref([]);
  304. //基本信息-单位使用性质下拉数据存储
  305. const companyNatureList = ref([
  306. [
  307. { value: 33, name: "办公" },
  308. { value: 1, name: "餐饮场所" },
  309. { value: 2, name: "超市" },
  310. { value: 3, name: "宾(旅)馆" },
  311. { value: 4, name: "商场" },
  312. { value: 5, name: "集贸市场" },
  313. { value: 6, name: "体育场馆、会堂" },
  314. { value: 7, name: "影剧院、放映厅(录像厅)、礼堂等演出、放映场所" },
  315. { value: 8, name: "歌舞娱乐场所(含KTV、夜总会、具有娱乐功能的餐饮场所)" },
  316. { value: 9, name: "网吧" },
  317. { value: 10, name: "棋牌室" },
  318. { value: 11, name: "美容院(含SPA、瘦身等)" },
  319. { value: 12, name: "足浴" },
  320. { value: 13, name: "浴室(含洗浴、桑拿按摩、汗蒸等)" },
  321. { value: 14, name: "营业性健身、休闲场所" },
  322. { value: 15, name: "托儿所幼儿园" },
  323. { value: 16, name: "中小学校" },
  324. { value: 17, name: "大学" },
  325. { value: 18, name: "教育培训机构(含早教中心、亲子活动场所等)" },
  326. { value: 19, name: "养老院" },
  327. { value: 20, name: "福利院" },
  328. { value: 21, name: "医院" },
  329. { value: 22, name: "月子会所" },
  330. { value: 23, name: "公共图书馆、展览馆、博物馆" },
  331. { value: 24, name: "宗教活动场所" },
  332. { value: 25, name: "机场航站楼、客运车站候车室、客运码头候船厅" },
  333. { value: 26, name: "政府机关" },
  334. { value: 27, name: "广播电台、电视台和邮政、通信枢纽" },
  335. { value: 28, name: "文物保护单位" },
  336. { value: 29, name: "具有生产性质的厂房" },
  337. { value: 30, name: "大型仓库、物流企业" },
  338. { value: 31, name: "综合性工业企业、园区(含生产、仓库等)" },
  339. { value: 32, name: "其他" },
  340. ],
  341. ]);
  342. //建筑-建筑结构下拉数据存储
  343. const buildStructureList = ref([
  344. [
  345. { value: 2, name: "钢筋混凝土" },
  346. { value: 1, name: "砖混结构" },
  347. { value: 3, name: "钢结构" },
  348. { value: 4, name: "大型钢筋混凝土" },
  349. { value: 5, name: "木质结构" },
  350. { value: 6, name: "砖木结构" },
  351. ],
  352. ]);
  353. //建筑-使用性质下拉数据存储
  354. const useCharacterList = ref([
  355. [
  356. { value: 1, name: "大型综合体" },
  357. { value: 2, name: "商业" },
  358. { value: 3, name: "办公" },
  359. { value: 4, name: "住宿" },
  360. { value: 5, name: "科研" },
  361. { value: 6, name: "政府机关" },
  362. { value: 7, name: "医院、医疗机构" },
  363. { value: 8, name: "学校" },
  364. { value: 9, name: "宗教场所" },
  365. { value: 10, name: "客运站(航站楼、候船厅)" },
  366. { value: 11, name: "展览、博物馆" },
  367. { value: 12, name: "体育场馆" },
  368. { value: 13, name: "客运站(航站楼、候船厅)" },
  369. { value: 14, name: "生产类厂房" },
  370. { value: 15, name: "仓库、物流" },
  371. { value: 16, name: "涉及易燃易爆危险品的单位(生产、充装、储存、供应、销售等)" },
  372. { value: 17, name: "其他(需具体填写)" },
  373. ],
  374. ]);
  375. //建筑-灭火器下拉数据存储
  376. const extinguishTypeList = ref([
  377. [
  378. { value: 1, name: "水基型灭火器" },
  379. { value: 2, name: "干粉灭火器" },
  380. { value: 3, name: "洁净气体灭火器" },
  381. { value: 4, name: "二氧化碳灭火器" },
  382. { value: 5, name: "泡沫灭火器" },
  383. { value: 6, name: "其他灭火器" },
  384. ],
  385. ]);
  386. const dataList = reactive({
  387. form: {
  388. companyName: "", //单位名称
  389. organization: "", //信用代码
  390. delegateName: "", //法人代表姓名
  391. streetTown: "", //所属街镇
  392. streetTownValue: 0, //所属街镇
  393. address: "", //详细地址
  394. fireManagePhone: "", //消防安全管理人电话
  395. foundTime: "", //单位成立时间
  396. companyNature: "", //单位使用性质
  397. companyNatureValue: 0, //单位使用性质
  398. birthCert: "", //产证
  399. birthCertValue: 0, //产证
  400. fireDutyName: "", //消防安全责任人姓名
  401. fireManageName: "", //消防安全管理人姓名
  402. employeeNum: "", //职工人数
  403. fixedAssets: "", //固定资产(单位:万元)
  404. buildArea: "", //建筑面积
  405. baseBuildList: [],
  406. },
  407. baseBuildListForm: {
  408. baseBuild: {
  409. buildName: "", //建筑名称
  410. address: "", //详细地址
  411. buildStructure: "", //建筑结构
  412. buildStructureValue: 0, //建筑结构
  413. aboveFloor: "", //地上楼层
  414. underFloor: "", //地下楼层
  415. buildArea: "", //建筑面积
  416. underSpace: "", //地下空间
  417. useCharacter: "", //使用性质
  418. useCharacterValue: 0,
  419. completeYear: "", //竣工年份
  420. buildHigh: "", //建筑高度
  421. fireproofCoat: 0, //是否有防火涂层
  422. fireFacilitySystem: "", //消防设施设置
  423. otherSystem: "", //其他设施
  424. otherFacilities: "", //其他设施名称
  425. },
  426. baseBuildAttach: {
  427. hazardousProduceA: null, //甲类危险品生产数量
  428. hazardousProduceB: null, //乙类危险品生产数量
  429. hazardousProduceC: null, //丙类危险品生产数量
  430. hazardousProduceD: null, //丁戊类危险品生产数量
  431. hazardousStorageA: null, //甲类危险品存储数量
  432. hazardousStorageB: null, //乙类危险品存储数量
  433. hazardousStorageC: null, //丙类危险品存储数量
  434. hazardousStorageD: null, //丁戊类危险品存储数量
  435. },
  436. baseBuildExtinguishList: [
  437. {
  438. extinguishType: "", //灭火器类型
  439. extinguishTypeValue: 0, //灭火器类型
  440. extinguishNum: "", //灭火器数量
  441. deleteFlag: null,
  442. },
  443. ],
  444. },
  445. baseBuildExtinguishArray: {
  446. extinguishType: "", //灭火器类型
  447. extinguishTypeValue: 0, //灭火器类型
  448. extinguishNum: "", //灭火器数量
  449. deleteFlag: null,
  450. },
  451. rules: {
  452. companyName: [
  453. {
  454. required: true,
  455. message: "请输入营业执照单位名称",
  456. trigger: ["blur", "change"],
  457. },
  458. ],
  459. organization: [
  460. {
  461. required: true,
  462. message: "请输入统一社会信用代码",
  463. trigger: ["blur", "change"],
  464. },
  465. {
  466. type: "string",
  467. min: 18,
  468. required: true,
  469. message: "请输入18位统一社会信用代码",
  470. trigger: ["change"],
  471. },
  472. ],
  473. delegateName: [
  474. {
  475. required: true,
  476. message: "请输入法人代表",
  477. trigger: ["blur", "change"],
  478. },
  479. ],
  480. streetTown: [
  481. {
  482. required: true,
  483. message: "请选择所属街镇",
  484. trigger: ["blur", "change"],
  485. },
  486. ],
  487. address: [
  488. {
  489. required: true,
  490. message: "请输入单位地址",
  491. trigger: ["blur", "change"],
  492. },
  493. ],
  494. fireManagePhone: [
  495. {
  496. required: true,
  497. message: "请输入消防管理人电话",
  498. trigger: ["blur", "change"],
  499. },
  500. {
  501. type: "string",
  502. min: 11,
  503. required: true,
  504. message: "请输入正确11位消防管理人电话",
  505. pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
  506. trigger: ["blur", "change"],
  507. },
  508. ],
  509. foundTime: [
  510. {
  511. required: true,
  512. message: "请选择成立时间",
  513. trigger: ["blur", "change"],
  514. },
  515. ],
  516. companyNature: [
  517. {
  518. required: true,
  519. message: "请选择单位使用性质",
  520. trigger: ["blur", "change"],
  521. },
  522. ],
  523. birthCert: [
  524. {
  525. required: true,
  526. message: "请选择产证",
  527. trigger: ["blur", "change"],
  528. },
  529. ],
  530. buildArea: [
  531. {
  532. required: true,
  533. message: "请输入单位建筑面积",
  534. trigger: ["blur", "change"],
  535. },
  536. ],
  537. baseBuildList: [],
  538. },
  539. baseBuildListRules: {
  540. baseBuild: {
  541. buildName: [
  542. {
  543. required: true,
  544. message: "请输入建筑名称",
  545. trigger: ["blur", "change"],
  546. },
  547. ],
  548. address: [
  549. {
  550. required: true,
  551. message: "请输入建筑地址",
  552. trigger: ["blur", "change"],
  553. },
  554. ],
  555. buildStructure: [
  556. {
  557. required: true,
  558. message: "请选择建筑结构",
  559. trigger: ["blur", "change"],
  560. },
  561. ],
  562. buildHigh: [
  563. {
  564. type: "number",
  565. required: true,
  566. message: "请输入建筑高度",
  567. trigger: ["blur", "change"],
  568. },
  569. ],
  570. aboveFloor: [
  571. {
  572. type: "number",
  573. required: true,
  574. message: "请输入地上层数",
  575. trigger: ["blur", "change"],
  576. },
  577. ],
  578. buildArea: [
  579. {
  580. type: "number",
  581. required: true,
  582. message: "请输入建筑面积",
  583. trigger: ["blur", "change"],
  584. },
  585. ],
  586. completeYear: [
  587. {
  588. required: true,
  589. message: "请选择建成年份",
  590. trigger: ["blur", "change"],
  591. },
  592. ],
  593. useCharacter: [
  594. {
  595. required: true,
  596. message: "请输入使用性质",
  597. trigger: ["blur", "change"],
  598. },
  599. ],
  600. fireFacilitySystem: [
  601. {
  602. type: "array",
  603. required: true,
  604. message: "请选择消防设施设置",
  605. trigger: ["change"],
  606. },
  607. ],
  608. },
  609. baseBuildExtinguishList: [],
  610. },
  611. baseBuildExtinguishRules: {
  612. extinguishType: [
  613. {
  614. required: true,
  615. message: "请选择灭火器类型",
  616. trigger: ["blur", "change"],
  617. },
  618. ],
  619. extinguishNum: [
  620. {
  621. type: "number",
  622. required: true,
  623. message: "请输入灭火器数量",
  624. trigger: ["blur", "change"],
  625. },
  626. ],
  627. },
  628. pagingBool: true,
  629. actionIndex: 0,
  630. actionIndex1: 0,
  631. actionTitle: "",
  632. actionShow: false,
  633. actionDefaultIndex: 0,
  634. actionsList: [[]],
  635. showTime: false, //时间选择显示隐藏
  636. timeValue: Number(new Date()), //时间选择值
  637. timeTitle: "", //时间选择标题
  638. timeIndex: 0, //时间选择下标
  639. modalShow: false,
  640. });
  641. const {
  642. form,
  643. baseBuildListForm,
  644. baseBuildExtinguishArray,
  645. rules,
  646. baseBuildListRules,
  647. baseBuildExtinguishRules,
  648. pagingBool,
  649. actionTitle,
  650. actionIndex,
  651. actionIndex1,
  652. actionsList,
  653. actionShow,
  654. actionDefaultIndex,
  655. showTime,
  656. timeValue,
  657. timeTitle,
  658. timeIndex,
  659. modalShow,
  660. } = toRefs(dataList);
  661. const uForm = ref(null);
  662. const uForm1 = ref(null);
  663. const newCompanyName = ref("");
  664. const successBool = ref(false);
  665. const scanBool = ref(false);
  666. /**
  667. * @单位名称
  668. * @icon图标按钮点击事件
  669. */
  670. function companySubmit(e) {
  671. actionsList.value = [[]];
  672. companyByNameSelect({
  673. companyName: e,
  674. }).then((res) => {
  675. if (res.status == "SUCCESS") {
  676. if (res.data.length > 0) {
  677. actionShow.value = true;
  678. res.data.forEach((el) => {
  679. el.name = el.companyName;
  680. actionsList.value[0].push(el);
  681. });
  682. actionTitle.value = "单位名称";
  683. } else {
  684. proxy.$modal.msg("未匹配到您所输入的单位!");
  685. }
  686. }
  687. });
  688. }
  689. /**
  690. * @上一步
  691. * @下一步
  692. * @提交
  693. * @按钮点击事件
  694. */
  695. function handleSubmit(value) {
  696. if (value === "上一步") {
  697. pagingBool.value = true;
  698. } else if (value === "下一步") {
  699. uForm.value
  700. .validate()
  701. .then((res) => {
  702. uni.$u.toast("校验通过");
  703. pagingBool.value = false;
  704. })
  705. .catch((errors) => {
  706. uni.$u.toast("校验失败");
  707. });
  708. } else if (value === "提交") {
  709. if (newCompanyName.value == "") {
  710. handleSubmitApi("否");
  711. } else {
  712. modalShow.value = true;
  713. }
  714. }
  715. }
  716. /**
  717. * @api提交
  718. */
  719. function handleSubmitApi(value) {
  720. let param = {};
  721. uForm1.value
  722. .validate()
  723. .then((res) => {
  724. uni.$u.toast("校验通过");
  725. param = {
  726. baseCompany: {
  727. companyName: form.value.companyName, //单位名称
  728. organization: form.value.organization, //组织机构代码
  729. address: form.value.address, //单位地址
  730. foundTime: form.value.foundTime + "T00:00:00", //成立时间
  731. companyNature: form.value.companyNatureValue, //单位使用性质
  732. streetTown: form.value.streetTown, //街镇
  733. },
  734. baseCompanyAttach1: {
  735. employeeNum: form.value.employeeNum, //职工人数
  736. buildArea: form.value.buildArea, //建筑面积
  737. fixedAssets: form.value.fixedAssets, //固定资产
  738. birthCert: form.value.birthCertValue, //产证
  739. },
  740. baseCompanyPerson: {
  741. delegateName: form.value.delegateName, //法人代表姓名
  742. fireDutyName: form.value.fireDutyName, //消防安全责任人姓名
  743. fireManageName: form.value.fireManageName, //消防安全管理人姓名
  744. fireManagePhone: form.value.fireManagePhone, //消防安全管理人电话
  745. },
  746. baseBuildList: [],
  747. };
  748. if (value === "是") {
  749. param.baseCompany.id = "id" in form.value ? form.value.id : undefined; //主键ID
  750. param.baseCompany.companyId = "companyId" in form.value ? form.value.companyId : undefined; //单位ID
  751. param.baseCompanyAttach1.id = "id1" in form.value ? form.value.id1 : undefined; //附表ID(id1)
  752. param.baseCompanyPerson.id = "id2" in form.value ? form.value.id2 : undefined; //单位关联人员表ID(id2)
  753. }
  754. form.value.baseBuildList.forEach((el, ind) => {
  755. param.baseBuildList.push({
  756. baseBuild: {
  757. buildName: el.baseBuild.buildName, //建筑名称
  758. address: el.baseBuild.address, //详细地址
  759. buildStructure: el.baseBuild.buildStructureValue, //建筑结构
  760. aboveFloor: Number(el.baseBuild.aboveFloor), //地上楼层
  761. underFloor: Number(el.baseBuild.underFloor), //地下楼层
  762. buildArea: Number(el.baseBuild.buildArea), //建筑面积
  763. underSpace: Number(el.baseBuild.underSpace), //地下空间
  764. useCharacter: el.baseBuild.useCharacterValue, //使用性质
  765. completeYear: el.baseBuild.completeYear, //竣工年份
  766. buildHigh: Number(el.baseBuild.buildHigh), //建筑高度
  767. fireFacilitySystem: el.baseBuild.fireFacilitySystem.join(","), //消防设施
  768. fireproofCoat: el.baseBuild.fireproofCoat, //是否有防火涂层;0、无 1、有
  769. otherSystem: el.baseBuild.otherSystem.join(","), //其他系统;0、无 1、有
  770. otherFacilities: el.baseBuild.otherFacilities, //其他设施
  771. },
  772. baseBuildAttach: {
  773. hazardousProduceA: Number(el.baseBuildAttach.hazardousProduceA), //甲类危险品生产数量
  774. hazardousProduceB: Number(el.baseBuildAttach.hazardousProduceB), //乙类危险品生产数量
  775. hazardousProduceC: Number(el.baseBuildAttach.hazardousProduceC), //丙类危险品生产数量
  776. hazardousProduceD: Number(el.baseBuildAttach.hazardousProduceD), //丁戊类危险品生产数量
  777. hazardousStorageA: Number(el.baseBuildAttach.hazardousStorageA), //甲类危险品存储数量
  778. hazardousStorageB: Number(el.baseBuildAttach.hazardousStorageB), //乙类危险品存储数量
  779. hazardousStorageC: Number(el.baseBuildAttach.hazardousStorageC), //丙类危险品存储数量
  780. hazardousStorageD: Number(el.baseBuildAttach.hazardousStorageD), //丁戊类危险品存储数量
  781. },
  782. baseBuildExtinguishList: [],
  783. });
  784. el.baseBuildExtinguishList.forEach((e, index) => {
  785. param.baseBuildList[ind].baseBuildExtinguishList.push({
  786. extinguishType: e.extinguishTypeValue,
  787. extinguishNum: Number(e.extinguishNum), //灭火器数量
  788. deleteFlag: e.deleteFlag,
  789. });
  790. if (value === "是") {
  791. if ("id" in e) {
  792. param.baseBuildList[ind].baseBuildExtinguishList[index].id = e.id;
  793. }
  794. }
  795. });
  796. if (value === "是") {
  797. if ("id" in el.baseBuild) {
  798. param.baseBuildList[ind].baseBuild.id = el.baseBuild.id;
  799. }
  800. if ("id" in el.baseBuildAttach) {
  801. param.baseBuildList[ind].baseBuildAttach.id = el.baseBuildAttach.id;
  802. }
  803. }
  804. });
  805. addBaseCompany(param).then((res) => {
  806. if (res.status == "SUCCESS") {
  807. if (scanBool.value) {
  808. successBool.value = true;
  809. } else {
  810. uni.showToast({
  811. title: "提交成功",
  812. });
  813. setTimeout(() => {
  814. proxy.$tab.reLaunch("/pages/index");
  815. }, 2000);
  816. }
  817. }
  818. });
  819. })
  820. .catch((errors) => {
  821. uni.$u.toast("校验失败");
  822. });
  823. }
  824. /**
  825. * @复选框选中事件
  826. */
  827. function checkboxChange(n) {
  828. console.log("change", n);
  829. }
  830. /**
  831. * @action弹出框点击事件
  832. */
  833. function handleAction(value, index, ind) {
  834. if (value == "所属街镇") {
  835. actionTitle.value = "所属街镇";
  836. actionsList.value = [
  837. [
  838. {
  839. name: "江川路街道",
  840. value: 1201,
  841. x: 121.399126538181,
  842. y: 31.0099719391863,
  843. },
  844. {
  845. name: "新虹街道",
  846. value: 1217,
  847. x: 121.319329296294,
  848. y: 31.1983901916889,
  849. },
  850. {
  851. name: "古美路街道",
  852. value: 1206,
  853. x: 121.388451866936,
  854. y: 31.1478233480159,
  855. },
  856. {
  857. name: "浦锦街道",
  858. value: 1218,
  859. x: 121.483929120352,
  860. y: 31.089967318558,
  861. },
  862. {
  863. name: "浦江镇",
  864. value: 1215,
  865. x: 121.524058543447,
  866. y: 31.0540039472667,
  867. },
  868. {
  869. name: "吴泾镇",
  870. value: 1213,
  871. x: 121.454076463728,
  872. y: 31.04860402113,
  873. },
  874. {
  875. name: "马桥镇",
  876. value: 1214,
  877. x: 121.352680027718,
  878. y: 31.0213512298508,
  879. },
  880. {
  881. name: "颛桥镇",
  882. value: 1209,
  883. x: 121.40607138504,
  884. y: 31.0612972443508,
  885. },
  886. {
  887. name: "莘庄镇",
  888. value: 1207,
  889. x: 121.37064864047,
  890. y: 31.1154549548722,
  891. },
  892. {
  893. name: "梅陇镇",
  894. value: 1212,
  895. x: 121.421346814491,
  896. y: 31.1069718313722,
  897. },
  898. {
  899. name: "七宝镇",
  900. value: 1208,
  901. x: 121.350366186317,
  902. y: 31.1553292680362,
  903. },
  904. {
  905. name: "虹桥镇",
  906. value: 1211,
  907. x: 121.37956256207,
  908. y: 31.1806219953212,
  909. },
  910. {
  911. name: "华漕镇",
  912. value: 1210,
  913. x: 121.277541517147,
  914. y: 31.2289121171624,
  915. },
  916. {
  917. name: "莘庄工业区",
  918. value: 1216,
  919. x: 121.376508452784,
  920. y: 31.0678185611843,
  921. },
  922. ],
  923. ];
  924. if (form.value.streetTown) {
  925. actionsList.value[0].forEach((el, ind) => {
  926. if (el.name === form.value.streetTown) {
  927. actionDefaultIndex.value = ind;
  928. }
  929. });
  930. } else {
  931. actionDefaultIndex.value = 0;
  932. }
  933. }
  934. if (value == "单位使用性质") {
  935. actionTitle.value = "单位使用性质";
  936. actionsList.value = companyNatureList.value;
  937. actionDefaultIndex.value = 0;
  938. }
  939. if (value == "产证") {
  940. actionTitle.value = "产证";
  941. actionsList.value = [
  942. [
  943. {
  944. value: 1,
  945. name: "商业服务业设施用地(商业设施、商务设施、娱乐康体设施、公用设施营业网点、其它服务设施等)",
  946. },
  947. {
  948. value: 2,
  949. name: "工业用地",
  950. },
  951. {
  952. value: 3,
  953. name: "居住用地",
  954. },
  955. {
  956. value: 4,
  957. name: "公共管理与公共服务用地(行政办公、文化设施、教育科研、体育、医疗卫生、社会福利设施、文物古迹、外事、宗教设施等",
  958. },
  959. {
  960. value: 5,
  961. name: "物流仓储用地",
  962. },
  963. {
  964. value: 6,
  965. name: "道路与交通设施用地",
  966. },
  967. {
  968. value: 7,
  969. name: "公用设施用地",
  970. },
  971. {
  972. value: 8,
  973. name: "绿地与广场用地",
  974. },
  975. ],
  976. ];
  977. actionDefaultIndex.value = 0;
  978. }
  979. if (value == "建筑结构") {
  980. actionTitle.value = "建筑结构";
  981. actionIndex.value = index;
  982. actionsList.value = buildStructureList.value;
  983. actionDefaultIndex.value = 0;
  984. }
  985. if (value == "使用性质") {
  986. actionTitle.value = "使用性质";
  987. actionIndex.value = index;
  988. actionsList.value = useCharacterList.value;
  989. actionDefaultIndex.value = 0;
  990. }
  991. if (value == "灭火器") {
  992. actionTitle.value = "灭火器";
  993. actionIndex.value = index;
  994. actionIndex1.value = ind;
  995. actionsList.value = extinguishTypeList.value;
  996. actionDefaultIndex.value = 0;
  997. }
  998. actionShow.value = true;
  999. }
  1000. /**
  1001. * @action弹出框选择事件
  1002. */
  1003. function selectAction(e) {
  1004. if (actionTitle.value == "单位名称") {
  1005. form.value.baseBuildList = [];
  1006. rules.value.baseBuildList = [];
  1007. newCompanyName.value = e.value[0].companyName;
  1008. // form.value = e.value[0];
  1009. form.value.id = e.value[0].id;
  1010. form.value.id1 = e.value[0].id1;
  1011. form.value.id2 = e.value[0].id2;
  1012. form.value.companyId = e.value[0].companyId;
  1013. form.value.companyName = e.value[0].companyName;
  1014. form.value.organization = e.value[0].organization;
  1015. form.value.delegateName = e.value[0].delegateName;
  1016. form.value.address = e.value[0].address;
  1017. form.value.foundTime = e.value[0].foundTime.split("T")[0];
  1018. if (e.value[0].baseBuildList != null) {
  1019. form.value.baseBuildList = e.value[0].baseBuildList;
  1020. } else {
  1021. form.value.baseBuildList.push(baseBuildListForm.value);
  1022. }
  1023. form.value.baseBuildList.forEach((el, index) => {
  1024. rules.value.baseBuildList.push(JSON.parse(JSON.stringify(baseBuildListRules.value)));
  1025. el.baseBuild.fireFacilitySystem = el.baseBuild.fireFacilitySystem ? el.baseBuild.fireFacilitySystem.split(",").map((num) => Number(num)) : [];
  1026. el.baseBuild.otherSystem = el.baseBuild.otherSystem ? el.baseBuild.otherSystem.split(",").map((num) => Number(num)) : [];
  1027. //建筑结构
  1028. buildStructureList.value[0].forEach((e) => {
  1029. if (e.value == el.baseBuild.buildStructure) {
  1030. el.baseBuild.buildStructureValue = el.baseBuild.buildStructure;
  1031. el.baseBuild.buildStructure = e.name;
  1032. }
  1033. });
  1034. //使用性质
  1035. useCharacterList.value[0].forEach((e) => {
  1036. if (e.value == el.baseBuild.useCharacter) {
  1037. el.baseBuild.useCharacterValue = el.baseBuild.useCharacter;
  1038. el.baseBuild.useCharacter = e.name;
  1039. }
  1040. });
  1041. el.baseBuildAttach
  1042. ? el.baseBuildAttach
  1043. : (el.baseBuildAttach = {
  1044. hazardousProduceA: "", //甲类危险品生产数量
  1045. hazardousProduceB: "", //乙类危险品生产数量
  1046. hazardousProduceC: "", //丙类危险品生产数量
  1047. hazardousProduceD: "", //丁戊类危险品生产数量
  1048. hazardousStorageA: "", //甲类危险品存储数量
  1049. hazardousStorageB: "", //乙类危险品存储数量
  1050. hazardousStorageC: "", //丙类危险品存储数量
  1051. hazardousStorageD: "", //丁戊类危险品存储数量
  1052. });
  1053. el.baseBuildExtinguishList ? el.baseBuildExtinguishList : (el.baseBuildExtinguishList = []);
  1054. extinguishTypeList.value[0].forEach((e) => {
  1055. el.baseBuildExtinguishList.forEach((f) => {
  1056. if (e.value == f.extinguishType) {
  1057. f.extinguishTypeValue = f.extinguishType;
  1058. f.extinguishType = e.name;
  1059. }
  1060. });
  1061. });
  1062. el.baseBuildExtinguishList.forEach((f) => {
  1063. rules.value.baseBuildList[index].baseBuildExtinguishList.push(JSON.parse(JSON.stringify(baseBuildExtinguishRules.value)));
  1064. });
  1065. });
  1066. }
  1067. if (actionTitle.value == "所属街镇") {
  1068. form.value.streetTown = e.value[0].name;
  1069. form.value.streetTownValue = e.value[0].value;
  1070. }
  1071. if (actionTitle.value == "单位使用性质") {
  1072. form.value.companyNature = e.value[0].name;
  1073. form.value.companyNatureValue = e.value[0].value;
  1074. }
  1075. if (actionTitle.value == "产证") {
  1076. form.value.birthCert = e.value[0].name;
  1077. form.value.birthCertValue = e.value[0].value;
  1078. }
  1079. if (actionTitle.value == "建筑结构") {
  1080. form.value.baseBuildList[actionIndex.value].baseBuild.buildStructure = e.value[0].name;
  1081. form.value.baseBuildList[actionIndex.value].baseBuild.buildStructureValue = e.value[0].value;
  1082. }
  1083. if (actionTitle.value == "使用性质") {
  1084. form.value.baseBuildList[actionIndex.value].baseBuild.useCharacter = e.value[0].name;
  1085. form.value.baseBuildList[actionIndex.value].baseBuild.useCharacterValue = e.value[0].value;
  1086. }
  1087. if (actionTitle.value == "灭火器") {
  1088. form.value.baseBuildList[actionIndex.value].baseBuildExtinguishList[actionIndex1.value].extinguishType = e.value[0].name;
  1089. form.value.baseBuildList[actionIndex.value].baseBuildExtinguishList[actionIndex1.value].extinguishTypeValue = e.value[0].value;
  1090. }
  1091. actionShow.value = false;
  1092. }
  1093. /**
  1094. * @时间弹出框点击事件
  1095. */
  1096. function handleDateTime(value, index, time) {
  1097. showTime.value = true;
  1098. if (value == "成立时间") {
  1099. timeValue.value = time ? Number(new Date(time)) : Number(new Date());
  1100. timeIndex.value = index;
  1101. timeTitle.value = "成立时间";
  1102. } else if (value == "建成年份") {
  1103. timeValue.value = time ? Number(new Date(time)) : Number(new Date());
  1104. timeIndex.value = index;
  1105. timeTitle.value = "建成年份";
  1106. }
  1107. }
  1108. /**
  1109. * @时间选择器
  1110. * @确定按钮事件
  1111. */
  1112. function timeSubmit(data) {
  1113. let time = publicStores.formatterDateTime(data.value);
  1114. let timeData = time.split(" ")[0];
  1115. if (timeTitle.value == "成立时间") {
  1116. form.value.foundTime = timeData;
  1117. } else if (timeTitle.value == "建成年份") {
  1118. form.value.baseBuildList[timeIndex.value].baseBuild.completeYear = timeData;
  1119. }
  1120. showTime.value = false;
  1121. }
  1122. /**
  1123. * @添加建筑
  1124. * @添加灭火器
  1125. * @按钮点击事件
  1126. */
  1127. function addSubmit(type, index) {
  1128. if (type === "建筑") {
  1129. form.value.baseBuildList.push(JSON.parse(JSON.stringify(baseBuildListForm.value)));
  1130. rules.value.baseBuildList.push(JSON.parse(JSON.stringify(baseBuildListRules.value)));
  1131. } else if (type == "灭火器") {
  1132. form.value.baseBuildList[index].baseBuildExtinguishList.push(JSON.parse(JSON.stringify(baseBuildExtinguishArray.value)));
  1133. rules.value.baseBuildList[index].baseBuildExtinguishList.push(JSON.parse(JSON.stringify(baseBuildExtinguishRules.value)));
  1134. }
  1135. }
  1136. /**
  1137. * @删除建筑
  1138. * @删除灭火器
  1139. * @按钮点击事件
  1140. */
  1141. function deleteSubmit(type, index, baseIndex) {
  1142. if (type == "建筑") {
  1143. if ("id" in form.value.baseBuildList[index].baseBuild) {
  1144. delBaseBuild(form.value.baseBuildList[index].baseBuild.id).then((res) => {
  1145. if (res.status == "SUCCESS") {
  1146. form.value.baseBuildList.splice(index, 1);
  1147. }
  1148. });
  1149. } else {
  1150. form.value.baseBuildList.splice(index, 1);
  1151. }
  1152. rules.value.baseBuildList.splice(index, 1);
  1153. } else if (type == "灭火器") {
  1154. if ("id" in form.value.baseBuildList[index].baseBuildExtinguishList[baseIndex]) {
  1155. delBaseBuildExtinguish(form.value.baseBuildList[index].baseBuildExtinguishList[baseIndex].id).then((res) => {
  1156. if (res.status == "SUCCESS") {
  1157. form.value.baseBuildList[index].baseBuildExtinguishList.splice(baseIndex, 1);
  1158. }
  1159. });
  1160. } else {
  1161. form.value.baseBuildList[index].baseBuildExtinguishList.splice(baseIndex, 1);
  1162. }
  1163. rules.value.baseBuildList[index].baseBuildExtinguishList.splice(baseIndex, 1);
  1164. }
  1165. }
  1166. onLoad((options) => {
  1167. form.value.baseBuildList = [];
  1168. rules.value.baseBuildList = [];
  1169. addSubmit("建筑");
  1170. if (options.scanBool) {
  1171. scanBool.value = options.scanBool;
  1172. if (scanBool.value) {
  1173. document.getElementsByClassName("uni-page-head-hd")[0].style.cssText = "display: none;";
  1174. }
  1175. }
  1176. });
  1177. onShow(() => {
  1178. //调用系统主题颜色
  1179. proxy.$settingStore.systemThemeColor([1]);
  1180. });
  1181. </script>
  1182. <style lang="scss">
  1183. #unitInfoCollection {
  1184. .centerOne,
  1185. .centerTwo {
  1186. .title {
  1187. color: #333333;
  1188. text-align: center;
  1189. margin-top: 10px;
  1190. }
  1191. }
  1192. :deep(.u-picker__view__column__item) {
  1193. font-size: 13px;
  1194. }
  1195. }
  1196. </style>