index.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  4. <!-- <el-form-item label="市" prop="city">
  5. <el-input v-model="queryParams.city" placeholder="请输入市" clearable size="small" @keyup.enter.native="handleQuery" />
  6. </el-form-item> -->
  7. <!-- <el-form-item
  8. label="省市区镇"
  9. prop="area"
  10. >
  11. <area-select type='text' v-model='selectedtwo' :data='$pcaa' :level='3' style="display: flex;line-height: 18px;" @change="onSelectedtwo"></area-select>
  12. </el-form-item> -->
  13. <el-row>
  14. <el-col :span="8">
  15. <el-form-item label="姓名" prop="userName">
  16. <el-input v-model="queryParams.userName" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery" />
  17. </el-form-item>
  18. </el-col>
  19. <el-col :span="8">
  20. <el-form-item label="身份证号" prop="idCard">
  21. <el-input v-model="queryParams.idCard" placeholder="请输入身份证号码" clearable @keyup.enter.native="handleQuery" />
  22. </el-form-item>
  23. </el-col>
  24. <el-col :span="8">
  25. <el-form-item label="联系号码" prop="phoneNum">
  26. <el-input v-model="queryParams.phoneNum" placeholder="请输入联系号码" clearable @keyup.enter.native="handleQuery" />
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="24">
  30. <el-row>
  31. <el-col :span="8">
  32. <el-form-item label="进度" prop="progress">
  33. <!-- <el-input v-model="queryParams.progress" placeholder="请输入进度" clearable size="small" @keyup.enter.native="handleQuery" /> -->
  34. <el-select v-model="queryParams.progress" placeholder="进度" clearable >
  35. <el-option v-for="dict in statusOptionstue" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
  36. </el-select>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="8">
  40. <el-form-item label="接种情况" prop="isVaccination">
  41. <el-input v-model="queryParams.isVaccination" placeholder="请输入接种情况" clearable @keyup.enter.native="handleQuery" />
  42. </el-form-item>
  43. </el-col>
  44. <el-col :span="8">
  45. <el-form-item label="疫苗名称" prop="vaccineName">
  46. <!-- <el-input v-model="queryParams.vaccineName" placeholder="请输入疫苗名称" clearable size="small" @keyup.enter.native="handleQuery" /> -->
  47. <el-select v-model="queryParams.vaccineName" placeholder="疫苗名称" clearable >
  48. <el-option v-for="dict in typeOptionsname" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
  49. </el-select>
  50. </el-form-item>
  51. </el-col>
  52. </el-row>
  53. </el-col>
  54. <el-col :span="8">
  55. <el-form-item label="剂次" prop="jici">
  56. <el-select v-model="queryParams.jici" placeholder="剂次" clearable >
  57. <el-option v-for="dict in typeOptionstimes" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
  58. </el-select>
  59. <!-- <el-input v-model="queryParams.jici" placeholder="请输入剂次" clearable size="small" @keyup.enter.native="handleQuery" /> -->
  60. </el-form-item>
  61. </el-col>
  62. <el-col :span="8">
  63. <el-form-item label="接种时间" prop="vaccinationTime">
  64. <el-date-picker
  65. clearable
  66. v-model="queryParams.vaccinationTime"
  67. type="datetime"
  68. value-format="yyyy-MM-dd HH:mm:ss"
  69. format="yyyy-MM-dd HH:mm:ss"
  70. placeholder="选择接种时间"
  71. ></el-date-picker>
  72. </el-form-item>
  73. </el-col>
  74. <el-col :span="8">
  75. <el-form-item label="接种地点" prop="vaccinationPlace">
  76. <!-- <el-input v-model="queryParams.vaccinationPlace" placeholder="请输入接种地点" clearable size="small" @keyup.enter.native="handleQuery" /> -->
  77. <el-select v-model="queryParams.vaccinationPlace" placeholder="接种地点" clearable >
  78. <el-option v-for="dict in typeOptionsvaccinatio" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
  79. </el-select>
  80. </el-form-item>
  81. </el-col>
  82. <el-col :span="24">
  83. <el-row>
  84. <el-col :span="8">
  85. <el-form-item
  86. label="应种未种"
  87. prop="shouldBe"
  88. >
  89. <el-radio-group v-model="queryParams.shouldBe">
  90. <el-radio v-for="dict in typeOptionsty" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel }}</el-radio>
  91. </el-radio-group>
  92. <!-- <el-input
  93. v-model="queryParams.shouldBe"
  94. placeholder="请输入应种未种
  95. "
  96. clearable
  97. size="small"
  98. @keyup.enter.native="handleQuery"
  99. /> -->
  100. </el-form-item>
  101. </el-col>
  102. <el-col :span="8">
  103. <el-form-item label="户籍地" prop="villagerGroup">
  104. <el-cascader placeholder="点击选择户籍地" :options="options" filterable @change="chahetwo" :props="optionProps" style="width: 100%;"></el-cascader>
  105. </el-form-item>
  106. </el-col>
  107. <el-col :span="8" style="text-align: center;">
  108. <el-form-item>
  109. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  110. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  111. </el-form-item>
  112. </el-col>
  113. </el-row>
  114. </el-col>
  115. </el-row>
  116. <!-- <el-form-item
  117. label="现居住地省市区镇"
  118. prop="region"
  119. >
  120. <area-select type='text' v-model='selectedtwo' :data='$pcaa' :level='2' style="display: flex;line-height: 18px;" @change="onSelectedtwo"></area-select>
  121. </el-form-item> -->
  122. <!-- <el-form-item label="状态" prop="status">
  123. <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small"><el-option label="请选择字典生成" value="" /></el-select>
  124. </el-form-item> -->
  125. <!-- <el-form-item label="是否删除" prop="isDel">
  126. <el-input v-model="queryParams.isDel" placeholder="请输入是否删除" clearable size="small" @keyup.enter.native="handleQuery" />
  127. </el-form-item> -->
  128. </el-form>
  129. <el-row :gutter="10" class="mb8">
  130. <el-col :span="1.5"><el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['core:info:add']">新增</el-button></el-col>
  131. <el-col :span="1.5">
  132. <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['core:info:edit']">修改</el-button>
  133. </el-col>
  134. <el-col :span="1.5">
  135. <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['core:info:remove']">删除</el-button>
  136. </el-col>
  137. <el-col :span="1.5"><el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['core:info:export']">导出</el-button></el-col>
  138. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  139. </el-row>
  140. <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange" stripe style="width: 100%" height="350">
  141. <el-table-column type="selection" width="55" align="center" />
  142. <el-table-column label="编号" align="center" prop="code" fixed />
  143. <el-table-column label="姓名" align="center" prop="userName" fixed />
  144. <el-table-column label="性别" align="center" prop="gender" />
  145. <el-table-column label="身份证号码" align="center" prop="idCard" width="180" />
  146. <el-table-column label="现居住地省份" align="center" prop="province" />
  147. <el-table-column label="现居住地市" align="center" prop="city" />
  148. <el-table-column label="现居住地区" align="center" prop="region" />
  149. <el-table-column label="现居住地详细地址" align="center" prop="nowIn" width="180" />
  150. <el-table-column label="联系号码" align="center" prop="phoneNum" />
  151. <el-table-column label="户籍乡镇" align="center" prop="villageTowns" />
  152. <el-table-column label="户籍村居" align="center" prop="village" />
  153. <el-table-column label="户籍村民组" align="center" prop="villagerGroup" />
  154. <el-table-column label="户别" align="center" prop="houseType" />
  155. <el-table-column label="户籍地" align="center" prop="domicile" />
  156. <!-- <el-table-column label="重点行业" align="center" prop="keyIndustries" /> -->
  157. <el-table-column label="接种情况" align="center" prop="isVaccination" />
  158. <el-table-column label="疫苗名称" align="center" prop="vaccineName" />
  159. <el-table-column label="剂次" align="center" prop="jici" />
  160. <el-table-column label="接种时间" align="center" prop="vaccinationTime" width="180">
  161. <template slot-scope="scope">
  162. <span>{{ scope.row.vaccinationTime }}</span>
  163. </template>
  164. </el-table-column>
  165. <el-table-column label="接种地点" align="center" prop="vaccinationPlace" />
  166. <!-- <el-table-column label="禁忌症" align="center" prop="contraindication" /> -->
  167. <!-- <el-table-column
  168. label="暂缓
  169. "
  170. align="center"
  171. prop="suspend"
  172. /> -->
  173. <!-- <el-table-column label="死亡" align="center" prop="death" /> -->
  174. <!-- <el-table-column
  175. label="失联失踪
  176. "
  177. align="center"
  178. prop="lostInMissing"
  179. /> -->
  180. <el-table-column
  181. label="应种未种
  182. "
  183. align="center"
  184. prop="shouldBe"
  185. />
  186. <el-table-column label="其他" align="center" prop="other" />
  187. <el-table-column label="进度" align="center" prop="progress" />
  188. <el-table-column label="备注" align="center" prop="remark" />
  189. <!-- <el-table-column label="状态" align="center" prop="status">
  190. <template slot-scope="scope">
  191. <span>{{ scope.row.status==0?'启用' :'停用' }}</span>
  192. </template>
  193. </el-table-column> -->
  194. <!-- <el-table-column label="是否删除" align="center" prop="isDel" /> -->
  195. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
  196. <template slot-scope="scope">
  197. <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['core:info:edit']">修改</el-button>
  198. <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['core:info:remove']">删除</el-button>
  199. </template>
  200. </el-table-column>
  201. </el-table>
  202. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
  203. <!-- 添加或修改疫苗信息对话框 -->
  204. <el-dialog :title="title" :visible.sync="open" width="1300px" append-to-body>
  205. <el-form ref="form" :model="form" :rules="rules" label-width="140px">
  206. <el-row>
  207. <el-col :span="6">
  208. <el-form-item label="身份证号" prop="idCard"><el-input v-model="form.idCard" placeholder="请输入身份证号码" @blur="idcde" /></el-form-item>
  209. </el-col>
  210. <el-col :span="6">
  211. <el-form-item label="姓名" prop="userName"><el-input v-model="form.userName" placeholder="请输入姓名" /></el-form-item>
  212. </el-col>
  213. <el-col :span="6">
  214. <el-form-item label="出生日期" prop="birthday">
  215. <el-date-picker clearable v-model="form.birthday" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd " style="width: 100%;" placeholder="选择出生日期"></el-date-picker>
  216. </el-form-item>
  217. </el-col>
  218. <el-col :span="6">
  219. <el-form-item label="性别" prop="gender">
  220. <!-- <el-input v-model="form.gender" placeholder="请输入性别" /> -->
  221. <el-select v-model="form.gender" placeholder="性别" clearable size="small" >
  222. <el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
  223. </el-select>
  224. </el-form-item>
  225. </el-col>
  226. <el-col :span="6">
  227. <el-form-item label="联系号码" prop="phoneNum"><el-input v-model="form.phoneNum" placeholder="请输入联系号码" /></el-form-item>
  228. </el-col>
  229. <el-col :span="6">
  230. <el-form-item label="编号" prop="code"><el-input v-model="form.code" placeholder="请输入编号" /></el-form-item>
  231. </el-col>
  232. <el-col :span="6">
  233. <el-form-item label="重点行业" prop="keyIndustries">
  234. <el-select v-model="form.keyIndustries" placeholder="重点行业" clearable style="width: 100%;" >
  235. <el-option v-for="dict in typeOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
  236. </el-select>
  237. </el-form-item>
  238. </el-col>
  239. <el-col :span="6">
  240. <el-form-item label="户别" prop="houseType">
  241. <!-- <el-select v-model="form.houseType" placeholder="请选择户别"><el-option label="请选择字典生成" value="" /></el-select> -->
  242. <!-- <el-input v-model="form.houseType" placeholder="请输入内容" /> -->
  243. <el-select v-model="form.houseType" placeholder="户别" clearable style="width: 100%;" >
  244. <el-option v-for="dict in typeOptionshuuj" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
  245. </el-select>
  246. </el-form-item>
  247. </el-col>
  248. <el-col :span="12">
  249. <el-form-item label="现居省市区" prop="region">
  250. <area-select type="text" v-model="selected" :data="$pcaa" :level="2" style="display: flex;line-height: 18px;" @change="onSelected"></area-select>
  251. </el-form-item>
  252. </el-col>
  253. <el-col :span="12">
  254. <el-form-item label="详细地址" prop="nowIn"><el-input v-model="form.nowIn" type="input" placeholder="请输入内容" /></el-form-item>
  255. </el-col>
  256. <el-col :span="12">
  257. <el-form-item label="乡/村/村组" prop="villagerGroup">
  258. <!-- <el-input v-model="form.villageTowns" type="textarea" placeholder="请输入内容" /> -->
  259. <!-- <treeselect v-model="form.parentId" :options="deptOptionstwo" :normalizer="normalizer" :flat="true" :maxHeight="150" @select="djieskle" :multiple=true placeholder="点击选择户籍地" /> -->
  260. <el-cascader placeholder="点击选择户籍地" :options="options" :filterable="true" @change="chahe" v-model="form.villagerGroup" :props="optionProps" style="width: 100%;"></el-cascader>
  261. </el-form-item>
  262. </el-col>
  263. <el-col :span="12">
  264. <el-form-item label="详细地址" prop="domicile"><el-input v-model="form.domicile" type="input" placeholder="请输入户籍详细地址" /></el-form-item>
  265. </el-col>
  266. <el-col :span="12">
  267. <el-form-item label="其他" prop="other"><el-input v-model="form.other" placeholder="请输入其他" /></el-form-item>
  268. </el-col>
  269. <el-col :span="12">
  270. <el-form-item label="备注" prop="remark"><el-input v-model="form.remark" placeholder="请输入备注" /></el-form-item>
  271. </el-col>
  272. <el-col :span="24">
  273. <el-row>
  274. <el-col :span="4.8">
  275. <el-form-item label="接种情况" prop="isVaccination">
  276. <!-- <el-input v-model="form.isVaccination" placeholder="请输入接种情况" /> -->
  277. <el-radio-group v-model="form.isVaccination" @change="gywoa">
  278. <el-radio v-for="dict in typeOptionsty" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel }}</el-radio>
  279. </el-radio-group>
  280. </el-form-item>
  281. </el-col>
  282. <el-col :span="4.8">
  283. <el-form-item label="暂缓" prop="suspend">
  284. <!-- <el-input
  285. v-model="form.suspend"
  286. placeholder="请输入暂缓"
  287. /> -->
  288. <el-radio-group v-model="form.suspend" :disabled="shouwes">
  289. <el-radio v-for="dict in typeOptionsty" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel }}</el-radio>
  290. </el-radio-group>
  291. </el-form-item>
  292. </el-col>
  293. <el-col :span="4.8">
  294. <el-form-item label="死亡" prop="death">
  295. <!-- <el-input v-model="form.death" placeholder="请输入死亡" /> -->
  296. <el-radio-group v-model="form.death" :disabled="shouwes">
  297. <el-radio v-for="dict in typeOptionsty" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel }}</el-radio>
  298. </el-radio-group>
  299. </el-form-item>
  300. </el-col>
  301. <el-col :span="4.8">
  302. <el-form-item
  303. label="失联失踪
  304. "
  305. prop="lostInMissing"
  306. >
  307. <el-radio-group v-model="form.lostInMissing" :disabled="shouwes">
  308. <el-radio v-for="dict in typeOptionsty" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel }}</el-radio>
  309. </el-radio-group>
  310. </el-form-item>
  311. </el-col>
  312. <el-col :span="4.8">
  313. <el-form-item label="应种未种" prop="shouldBe">
  314. <el-radio-group v-model="form.shouldBe" :disabled="shouwes">
  315. <el-radio v-for="dict in typeOptionsty" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel }}</el-radio>
  316. </el-radio-group>
  317. </el-form-item>
  318. </el-col>
  319. </el-row>
  320. </el-col>
  321. <el-col :span="6">
  322. <el-form-item label="人群分类" prop="crowd_classification"><el-input v-model="form.crowd_classification" placeholder="请输入人群分类" /></el-form-item>
  323. </el-col>
  324. <el-col :span="6">
  325. <el-form-item label="疫苗名称" prop="vaccineName">
  326. <!-- <el-input v-model="form.vaccineName" placeholder="请输入疫苗名称" /> -->
  327. <el-select v-model="form.vaccineName" placeholder="疫苗名称" clearable :disabled="naneme" @change="changeheu">
  328. <el-option v-for="dict in typeOptionsname" :key="dict.dictValue" :label="dict.dictLabel" :value="{value:dict.dictValue,label:dict.dictLabel}" />
  329. <!-- dict.dictValue -->
  330. </el-select>
  331. </el-form-item>
  332. </el-col>
  333. <el-col :span="6">
  334. <el-form-item label="接种时间" prop="vaccinationTime">
  335. <el-date-picker
  336. clearable
  337. v-model="form.vaccinationTime"
  338. type="datetime"
  339. value-format="yyyy-MM-dd HH:mm:ss"
  340. format="yyyy-MM-dd HH:mm:ss"
  341. placeholder="选择接种时间"
  342. style="width: 100%;"
  343. :disabled="naneme"
  344. ></el-date-picker>
  345. </el-form-item>
  346. </el-col>
  347. <el-col :span="6">
  348. <el-form-item label="剂次" prop="jici">
  349. <!-- <el-input v-model="form.jici" placeholder="请输入剂次" /> -->
  350. <el-select @change="changeheujici" v-model="form.jici" placeholder="剂次" clearable size="small" :disabled="naneme">
  351. <el-option v-for="dict in typeOptionstimes" :key="dict.dictValue" :label="dict.dictLabel" :value="{value:dict.dictValue,label:dict.dictLabel}" />
  352. </el-select>
  353. </el-form-item>
  354. </el-col>
  355. <el-col :span="6">
  356. <el-form-item label="接种地点" prop="vaccinationPlace">
  357. <!-- <el-input v-model="form.vaccinationPlace" placeholder="请输入接种地点" /> -->
  358. <el-select :disabled="naneme" v-model="form.vaccinationPlace" placeholder="接种地点" clearable size="small">
  359. <el-option v-for="dict in typeOptionsvaccinatio" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
  360. </el-select>
  361. </el-form-item>
  362. </el-col>
  363. <el-col :span="6">
  364. <el-form-item label="进度" prop="progress">
  365. <!-- <el-input v-model="form.progress" placeholder="请输入进度" /> -->
  366. <el-select v-model="form.progress" placeholder="进度" clearable size="small" :disabled="naneme">
  367. <el-option v-for="dict in statusOptionstue" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictLabel" />
  368. <!-- dictValue -->
  369. </el-select>
  370. </el-form-item>
  371. </el-col>
  372. <el-col :span="24">
  373. <el-form-item label="禁忌症" prop="contraindication" class="ehiqya">
  374. <!-- <el-input v-model="form.contraindication" placeholder="请输入禁忌症" /> -->
  375. <el-select :disabled="shouwes" v-model="form.contraindication" placeholder="禁忌症" clearable style="100%">
  376. <el-option v-for="dict in typeOptionscont" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
  377. </el-select>
  378. <div class="jdidur">
  379. <el-upload :disabled="shouwes" class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}"
  380. :action="process + '/boman-file/upload'" :on-change="handleChangert"
  381. :on-success="upImageFn" :on-error="err" :on-remove="reseImage" :file-list="config" :on-preview="handlePictureCardPreview" :before-upload="befors">
  382. <el-button size="small" type="primary">点击上传</el-button>
  383. </el-upload>
  384. <div class="el-upload__tip" style="margin-left: 5px; color: red; margin-top: 0;">
  385. 请上传png/jpg文档,且不超过50MB
  386. </div>
  387. </div>
  388. </el-form-item>
  389. </el-col>
  390. </el-row>
  391. <!-- <el-form-item label="户籍地村居" prop="village">
  392. <el-input v-model="form.village" type="textarea" placeholder="请输入内容" /></el-form-item> -->
  393. <!-- <el-form-item label="户籍地村居" prop="village">
  394. <el-input v-model="form.village" type="textarea" placeholder="请输入内容" /></el-form-item>
  395. <el-form-item label="户籍地村民组" prop="villagerGroup"><el-input v-model="form.villagerGroup" type="textarea" placeholder="请输入内容" /></el-form-item> -->
  396. <!-- <el-form-item label="省" prop="province"><el-input v-model="form.province" type="textarea" placeholder="请输入内容" /></el-form-item>
  397. <el-form-item label="市" prop="city"><el-input v-model="form.city" placeholder="请输入市" /></el-form-item>
  398. <el-form-item
  399. label="区"
  400. prop="area"
  401. >
  402. <el-input v-model="form.area" placeholder="请输入区" />
  403. </el-form-item> -->
  404. <!-- <el-form-item label="状态">
  405. <el-radio-group v-model="form.status"><el-radio label="1">请选择字典生成</el-radio></el-radio-group>
  406. </el-form-item> -->
  407. </el-form>
  408. <div slot="footer" class="dialog-footer">
  409. <el-button type="primary" @click="submitForm">确 定</el-button>
  410. <el-button @click="cancel">取 消</el-button>
  411. </div>
  412. </el-dialog>
  413. <!-- 图片预览 -->
  414. <el-dialog :close-on-click-modal="false" title="预览" :visible.sync="imashow" width="1200px" append-to-body>
  415. <div class="demo-image__preview">
  416. <img :src="dialogImageUrl" alt="" style="width: 100%;">
  417. <!-- <iframe v-if="shouewhu" :src="dialogImageUrl" frameborder="0" style="width: 100%; height: 100vh;"></iframe>
  418. <a v-if="exelshow" :href="dialogImageUrl" :download="dialogImageUrlname" >{{dialogImageUrlname}} <span style="color: #039BE5;">点击下载</span></a> -->
  419. </div>
  420. </el-dialog>
  421. </div>
  422. </template>
  423. <script>
  424. import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo, listRoleer,idces } from '@/api/system/time';
  425. import { treeselect } from '@/api/system/dept';
  426. import Treeselect from '@riophae/vue-treeselect';
  427. import {
  428. getToken
  429. } from "@/utils/auth";
  430. import '@riophae/vue-treeselect/dist/vue-treeselect.css';
  431. export default {
  432. name: 'Info',
  433. components: { Treeselect },
  434. data() {
  435. return {
  436. // 遮罩层
  437. loading: true,
  438. // 选中数组
  439. ids: [],
  440. // 非单个禁用
  441. single: true,
  442. // 非多个禁用
  443. multiple: true,
  444. // 显示搜索条件
  445. showSearch: true,
  446. // 总条数
  447. total: 0,
  448. // 疫苗信息表格数据
  449. infoList: [],
  450. dialogImageUrl: '',
  451. // 弹出层标题
  452. title: '',
  453. // 是否显示弹出层
  454. open: false,
  455. process: process.env.VUE_APP_BASE_API,
  456. // 查询参数
  457. queryParams: {
  458. pageNum: 1,
  459. pageSize: 10,
  460. villageTowns: null,
  461. village: null,
  462. villagerGroup: null,
  463. houseType: null,
  464. domicile: null,
  465. province: null,
  466. city: null,
  467. region: null,
  468. userName: null,
  469. gender: null,
  470. idCard: null,
  471. phoneNum: null,
  472. keyIndustries: null,
  473. isVaccination: null,
  474. vaccineName: null,
  475. jici: null,
  476. vaccinationTime: null,
  477. vaccinationPlace: null,
  478. contraindication: null,
  479. suspend: null,
  480. death: null,
  481. lostInMissing: null,
  482. shouldBe: null,
  483. other: null,
  484. progress: null,
  485. status: null,
  486. isDel: null
  487. },
  488. config: [],
  489. // 表单参数
  490. form: {
  491. birthday: ''
  492. },
  493. // 表单校验
  494. rules: {
  495. region: [{ required: true, message: '区不能为空', trigger: 'blur' }],
  496. idCard: [{ required: true, message: '身份证号码不能为空', trigger: 'blur' }],
  497. userName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
  498. },
  499. selected: ['安徽省', '安庆市', '潜山市'],
  500. selectedtwo: ['安徽省', '安庆市', '潜山市'],
  501. statusOptions: [
  502. {
  503. dictValue: '女',
  504. dictLabel: '女'
  505. },
  506. {
  507. dictValue: '男',
  508. dictLabel: '男'
  509. }
  510. ],
  511. statusOptionstue: [
  512. {
  513. dictValue: '已完成',
  514. dictLabel: '已完成'
  515. },
  516. {
  517. dictValue: '未完成',
  518. dictLabel: '未完成'
  519. }
  520. ],
  521. typeOptionshuuj:[
  522. {
  523. dictValue: '农业',
  524. dictLabel: '农业'
  525. },
  526. {
  527. dictValue: '非农业',
  528. dictLabel: '非农业'
  529. }
  530. ],
  531. deptOptionstwo: [],
  532. options: [],
  533. optionProps: {
  534. value: 'label',
  535. label: 'label',
  536. children: 'children'
  537. },
  538. heuiq: [],
  539. typeOptions: [],
  540. typeOptionsty: [
  541. {
  542. dictValue: '是',
  543. dictLabel: '是'
  544. },
  545. {
  546. dictValue: '否',
  547. dictLabel: '否'
  548. }
  549. ],
  550. typeOptionsname: [],
  551. typeOptionstimes: [],
  552. typeOptionsvaccinatio: [],
  553. typeOptionscont: [],
  554. imashow:false,
  555. naneme:false,
  556. shouwes:false
  557. };
  558. },
  559. created() {
  560. this.getList();
  561. this.getTreeselectjue();
  562. // 重点行业
  563. this.getDicts('key_trades').then(response => {
  564. this.typeOptions = response.data;
  565. });
  566. // 疫苗名称
  567. this.getDicts('vaccine_name').then(response => {
  568. this.typeOptionsname = response.data;
  569. });
  570. // 接种地点
  571. this.getDicts('vaccination_site').then(response => {
  572. this.typeOptionsvaccinatio = response.data;
  573. });
  574. // 禁忌症
  575. this.getDicts('contraindication').then(response => {
  576. this.typeOptionscont = response.data;
  577. });
  578. this.form.province = this.selected[0];
  579. this.form.city = this.selected[1];
  580. this.form.region = this.selected[2];
  581. },
  582. methods: {
  583. onSelected(data) {
  584. console.log(data);
  585. // province
  586. this.form.province = data[0];
  587. this.form.city = data[1];
  588. this.form.region = data[2];
  589. // this.form.villageTowns = data[3]
  590. },
  591. onSelectedtwo(data) {
  592. console.log(data);
  593. // province
  594. this.queryParams.province = data[0];
  595. this.queryParams.city = data[1];
  596. this.queryParams.region = data[2];
  597. // this.queryParams.villageTowns = data[3]
  598. },
  599. /** 查询疫苗信息列表 */
  600. getList() {
  601. this.loading = true;
  602. listInfo(this.queryParams).then(response => {
  603. this.infoList = response.rows;
  604. this.total = response.total;
  605. this.loading = false;
  606. });
  607. },
  608. getToken() {
  609. return getToken()
  610. },
  611. getTreeselectjue() {
  612. this.loading = true;
  613. listRoleer(this.queryParams).then(response => {
  614. this.options = response.data;
  615. this.loading = false;
  616. });
  617. },
  618. /** 转换角色数据结构 */
  619. normalizer(node) {
  620. // if (node.children && !node.children.length) {
  621. // delete node.children;
  622. // }
  623. return {
  624. id: node.id,
  625. label: node.roleName
  626. };
  627. },
  628. // 点击组/角色
  629. djieskle(node, instanceId) {
  630. // this.personnel(node.id);
  631. console.log(node, instanceId);
  632. },
  633. // 身份证
  634. idcde(event) {
  635. console.log(event);
  636. // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
  637. let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
  638. if (reg.test(this.form.idCard)) {
  639. this.idea()
  640. // this.go(this.form.idCard.length);
  641. // callback()
  642. } else {
  643. // callback(new Error('身份证号码不正确'))
  644. this.msgInfo('身份证号码不正确');
  645. }
  646. },
  647. // 实现自动生成生日,性别,年龄
  648. go(val) {
  649. let iden = this.form.idCard;
  650. let sex = null;
  651. let birth = null;
  652. let birthr = '';
  653. let myDate = new Date();
  654. let month = myDate.getMonth() + 1;
  655. let day = myDate.getDate();
  656. let age = 0;
  657. if (val === 18) {
  658. age = myDate.getFullYear() - iden.substring(6, 10) - 1;
  659. sex = iden.substring(16, 17);
  660. birth = iden.substring(6, 10) + '-' + iden.substring(10, 12) + '-' + iden.substring(12, 14);
  661. if (iden.substring(10, 12) < month || (iden.substring(10, 12) == month && iden.substring(12, 14) <= day)) age++;
  662. }
  663. if (val === 15) {
  664. age = myDate.getFullYear() - iden.substring(6, 8) - 1901;
  665. sex = iden.substring(13, 14);
  666. birth = '19' + iden.substring(6, 8) + '-' + iden.substring(8, 10) + '-' + iden.substring(10, 12);
  667. if (iden.substring(8, 10) < month || (iden.substring(8, 10) == month && iden.substring(10, 12) <= day)) age++;
  668. }
  669. if (sex % 2 === 0) sex = '女';
  670. else sex = '男';
  671. this.form.gender = sex;
  672. // this.baseInfo.age = age;
  673. birthr = birth + '';
  674. console.log(birthr);
  675. this.form.birthday = birthr;
  676. // this.$set(this.form.birthday, birthr)
  677. // this.baseInfo.birthplace = this.area[iden.substring(0,2)];
  678. },
  679. // 请求身份证数据
  680. idea(){
  681. idces({idCard:this.form.idCard}).then(response => {
  682. console.log(response)
  683. this.form.gender = response.data.gender;
  684. this.form.birthday = response.data.birthday;
  685. if(response.data.userName == null){
  686. this.form.userName = undefined
  687. }else{
  688. this.form.userName = response.data.userName
  689. }
  690. });
  691. },
  692. // 取消按钮
  693. cancel() {
  694. this.open = false;
  695. this.reset();
  696. },
  697. // 上传前控制
  698. befors(res, file){
  699. console.log(res,file)
  700. console.log(res.name.substr(0,res.name.length-4))
  701. // if(res.type !== 'application/pdf'){
  702. // this.msgSuccess('只能上传pdf文件');
  703. // return false
  704. // }else{
  705. // return true
  706. // }
  707. return true
  708. },
  709. gywoa(){
  710. console.log(this.form.isVaccination)
  711. if(this.form.isVaccination == '是'){
  712. // 接种疫苗
  713. this.naneme = false,
  714. this.shouwes = true
  715. }else{
  716. this.naneme = true,
  717. this.shouwes = false
  718. }
  719. },
  720. // 图片预览
  721. handlePictureCardPreview(file) {
  722. console.log(file,87)
  723. console.log(file.name.split('.'))
  724. let hegs = file.name.split('.')
  725. console.log(hegs[hegs.length - 1])
  726. if(hegs[hegs.length - 1] == 'pdf'){
  727. this.shouewhu = true
  728. }else{
  729. if(hegs[hegs.length - 1] == 'jpg' || hegs[hegs.length - 1] == 'png'){
  730. this.shouewhu = false
  731. this.exelshow = false
  732. }else{
  733. this.exelshow = true
  734. }
  735. }
  736. console.log(this.shouewhu,this.exelshow)
  737. this.dialogImageUrl = file.url;
  738. this.dialogImageUrlname = file.name
  739. console.log(this.dialogImageUrlname)
  740. this.dialogVisible = true;
  741. this.imashow = true
  742. },
  743. // 上传文件
  744. handleChangert(file, fileList) {
  745. this.fileList = fileList.slice(-3);
  746. },
  747. upImageFn(res, file) {
  748. if(res.code !== 200){
  749. this.msgSuccess('上传失败');
  750. return false
  751. }else{
  752. this.msgSuccess('上传成功');
  753. this.config.push(res.data);
  754. console.log(res.data)
  755. console.log(res.data.name.substr(0,res.data.name.length-4))
  756. this.form.url = this.config
  757. // console.log(this.querjtgoe.message_upload)
  758. // this.querjtgoe.message_title = res.data.name
  759. // this.form.message_title = res.data.name.substr(0,res.data.name.length-4)
  760. this.form.url = JSON.stringify(this.form.url)
  761. }
  762. // querjtgoe.message_title
  763. console.log(res)
  764. console.log(res.data.name.substr(-4))
  765. },
  766. err(){
  767. this.msgSuccess("上传失败");
  768. console.log(35)
  769. },
  770. reseImage(file, fileList) {
  771. let urls = ""
  772. if (file.response) {
  773. urls = file.response.url
  774. } else {
  775. urls = file.url
  776. }
  777. for (let i = this.config.length - 1; i >= 0; i--) {
  778. if (this.config[i].url == urls) {
  779. this.config.splice(i, 1);
  780. }
  781. }
  782. if(this.config.length == 0){
  783. this.form.url = undefined
  784. }else{
  785. this.form.url = JSON.stringify(this.config)
  786. }
  787. },
  788. // 表单重置
  789. reset() {
  790. this.form = {
  791. id: null,
  792. villageTowns: null,
  793. village: null,
  794. birthday: '',
  795. villagerGroup: null,
  796. houseType: null,
  797. domicile: null,
  798. province: null,
  799. city: null,
  800. region: null,
  801. userName: null,
  802. gender: null,
  803. idCard: null,
  804. phoneNum: null,
  805. keyIndustries: null,
  806. isVaccination: null,
  807. vaccineName: null,
  808. jici: null,
  809. vaccinationTime: null,
  810. vaccinationPlace: null,
  811. contraindication: null,
  812. suspend: null,
  813. death: null,
  814. lostInMissing: null,
  815. shouldBe: null,
  816. other: null,
  817. progress: null,
  818. remark: null,
  819. status: '0',
  820. createBy: null,
  821. createTime: null,
  822. updateBy: null,
  823. updateTime: null,
  824. isDel: null
  825. };
  826. this.resetForm('form');
  827. },
  828. /** 搜索按钮操作 */
  829. handleQuery() {
  830. this.queryParams.pageNum = 1;
  831. this.getList();
  832. },
  833. /** 重置按钮操作 */
  834. resetQuery() {
  835. this.resetForm('queryForm');
  836. this.handleQuery();
  837. },
  838. // 多选框选中数据
  839. handleSelectionChange(selection) {
  840. this.ids = selection.map(item => item.id);
  841. this.single = selection.length !== 1;
  842. this.multiple = !selection.length;
  843. },
  844. /** 新增按钮操作 */
  845. handleAdd() {
  846. this.reset();
  847. this.open = true;
  848. this.naneme= false,
  849. this.shouwes =false
  850. this.selected = ['安徽省', '安庆市', '潜山市'],
  851. this.form.province = this.selected[0];
  852. this.form.city = this.selected[1];
  853. this.form.region = this.selected[2];
  854. this.title = '添加疫苗信息';
  855. },
  856. /** 修改按钮操作 */
  857. handleUpdate(row) {
  858. this.reset();
  859. const id = row.id || this.ids;
  860. getInfo(id).then(response => {
  861. this.form = response.data;
  862. this.selected[0] = response.data.province;
  863. this.selected[1] = response.data.city;
  864. this.selected[2] = response.data.region;
  865. // if(this.form){
  866. if(this.form.isVaccination == '是'){
  867. // 接种疫苗
  868. this.naneme = false,
  869. this.shouwes = true
  870. }else{
  871. this.naneme = true,
  872. this.shouwes = false
  873. }
  874. if(this.form.dictValue !== null && this.form.dictValue !== undefined){
  875. this.jicheru(this.form.dictValue)
  876. }
  877. // }
  878. // this.heuiq.push()
  879. this.open = true;
  880. this.title = '修改疫苗信息';
  881. });
  882. },
  883. chahe(data) {
  884. console.log(data);
  885. this.form.villageTowns = data[1];
  886. this.form.village = data[2];
  887. this.form.villagerGroup = data[3];
  888. },
  889. chahetwo(data) {
  890. this.queryParams.villageTowns = data[1];
  891. this.queryParams.village = data[2];
  892. this.queryParams.villagerGroup = data[3];
  893. },
  894. /** 提交按钮 */
  895. submitForm() {
  896. this.$refs['form'].validate(valid => {
  897. console.log(this.selected);
  898. if (valid) {
  899. if (this.form.id != null) {
  900. updateInfo(this.form).then(response => {
  901. this.msgSuccess('修改成功');
  902. this.open = false;
  903. this.getList();
  904. });
  905. } else {
  906. addInfo(this.form).then(response => {
  907. this.msgSuccess('新增成功');
  908. this.open = false;
  909. this.getList();
  910. });
  911. }
  912. }
  913. });
  914. },
  915. /** 删除按钮操作 */
  916. handleDelete(row) {
  917. const ids = row.id || this.ids;
  918. this.$confirm('是否确认删除疫苗信息编号为"' + ids + '"的数据项?', '警告', {
  919. confirmButtonText: '确定',
  920. cancelButtonText: '取消',
  921. type: 'warning'
  922. })
  923. .then(function() {
  924. return delInfo(ids);
  925. })
  926. .then(() => {
  927. this.getList();
  928. this.msgSuccess('删除成功');
  929. });
  930. },
  931. /** 导出按钮操作 */
  932. handleExport() {
  933. this.download('/boman-web-core/core/info/export', {
  934. ...this.queryParams
  935. }, `post_${new Date().getTime()}.xlsx`)
  936. },
  937. // 疫苗名称改变
  938. changeheu(data){
  939. console.log(data)
  940. this.form.vaccineName = this.form.vaccineName.label
  941. console.log(this.form.vaccineName)
  942. this.jicheru(data.value)
  943. },
  944. // 剂次
  945. jicheru(data){
  946. // 计次
  947. this.getDicts(data).then(response => {
  948. this.typeOptionstimes = response.data;
  949. });
  950. },
  951. // 剂次改变
  952. changeheujici(data){
  953. console.log(data)
  954. this.form.jici = this.form.jici.label
  955. console.log(this.form.jici)
  956. if(data.value == this.typeOptionstimes.length){
  957. this.form.progress = '已完成'
  958. }else{
  959. this.form.progress = '未完成'
  960. }
  961. }
  962. }
  963. };
  964. </script>
  965. <style lang="scss">
  966. .el-dialog__body{
  967. padding-top: 0;
  968. padding-bottom: 0;
  969. }
  970. .ehiqya{
  971. .el-form-item__content{
  972. display: flex;
  973. .jdidur{
  974. flex: 1;
  975. margin-left: 10px;
  976. // display: flex;
  977. }
  978. }
  979. .upload-demo{
  980. display: flex;
  981. }
  982. }
  983. </style>