index.vue 47 KB

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