Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

drugs.vue 49KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501
  1. <template>
  2. <div class="page_drugs">
  3. <div style="display:flex;justify-content: space-between;width:100%;margin-bottom:20px;">
  4. <div class="cell clearfix" style="margin-bottom:0;">
  5. <el-input style="width: 180px;margin-right:10px;" @keyup.enter.native='searchAction'
  6. class="filter-item" v-model="keywords"/>
  7. <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search"
  8. @click="searchAction">搜索
  9. </el-button>
  10. <label class="title"><span class="name">生产厂商</span> : </label>
  11. <el-select v-model="manufacturer" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeManufacture">
  12. <el-option
  13. v-for="item in manufacturers"
  14. :key="item.id"
  15. :label="item.manufacturer_name"
  16. :value="item.id">
  17. </el-option>
  18. </el-select>
  19. <label class="title"><span class="name">是否备案</span> : </label>
  20. <el-select v-model="is_charge" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeCharge">
  21. <el-option
  22. v-for="item in options"
  23. :key="item.value"
  24. :label="item.label"
  25. :value="item.value">
  26. </el-option>
  27. </el-select>
  28. <span style="color: #909399;font-size:14px;">备案 : &nbsp;</span>
  29. <el-select v-model="is_record" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeRecord">
  30. <el-option
  31. v-for="item in options"
  32. :key="item.value"
  33. :label="item.label"
  34. :value="item.value">
  35. </el-option>
  36. </el-select>
  37. </div>
  38. <div>
  39. <el-button type="primary" @click="openForm(0)">新增</el-button>
  40. </div>
  41. </div>
  42. <div style="display:flex; align-items:center;margin-bottom:10px;">
  43. <!--<el-button type="primary" size="small" @click="BatchDelete()" v-if="$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10138 || $store.getters.xt_user.org_id == 10028" >批量备案</el-button>-->
  44. <el-button type="primary" size="small" @click="GDYBBatchPutOnRecord()">批量备案</el-button>
  45. <el-link target="_blank" href="https://kuyi.shengws.com/drugTemplate.xlsx" :underline="false"
  46. style="margin-left:15px">
  47. <el-button
  48. class="filter-item"
  49. type="primary"
  50. size="small"
  51. >下载模版
  52. </el-button>
  53. </el-link>
  54. <upload-excel :on-success='handleSuccessTwo'></upload-excel>
  55. <el-button
  56. style="margin-left:10px;"
  57. @click="generateLog()"
  58. class="filter-item"
  59. type="primary"
  60. size="small"
  61. >下载日志
  62. </el-button>
  63. </div>
  64. <el-table :data="list" border style="width: 100%" :row-style="{ color: '#303133' }"
  65. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}"
  66. @selection-change="handleSelectionChange">
  67. <el-table-column
  68. align="center"
  69. type="selection"
  70. width="55"
  71. ></el-table-column>
  72. <el-table-column type="index" label="序号" width="60px" align="center"></el-table-column>
  73. <el-table-column prop="date" label="药品名称" align="center" >
  74. <template slot-scope="scope">
  75. <div>{{scope.row.drug_name}}</div>
  76. </template>
  77. </el-table-column>
  78. <el-table-column prop="date" label="单位&规格" align="center">
  79. <template slot-scope="scope">
  80. <!-- <div>{{scope.row.drug_spec}}</div> -->
  81. <div>
  82. <span v-if="scope.row.min_unit != scope.row.dose_unit">{{scope.row.dose}}{{scope.row.dose_unit}}&nbsp;* &nbsp;</span>{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
  83. </div>
  84. </template>
  85. </el-table-column>
  86. <!-- <el-table-column prop="date" label="最大单位" width="60" align="center">
  87. <template slot-scope="scope">
  88. <div>{{scope.row.max_unit}}</div>
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="最小单位" width="60" align="center">
  92. <template slot-scope="scope">
  93. <div>{{scope.row.min_unit}}</div>
  94. </template>
  95. </el-table-column> -->
  96. <el-table-column prop="date" label="进货价" width="100" align="center">
  97. <template slot-scope="scope">
  98. <div>{{scope.row.last_price}}</div>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="零售价" width="100" align="center">
  102. <template slot-scope="scope">
  103. <div>{{scope.row.retail_price}}</div>
  104. </template>
  105. </el-table-column>
  106. <el-table-column prop="date" label="医保编码" width="100" align="center">
  107. <template slot-scope="scope">
  108. <div>{{scope.row.medical_insurance_number}}</div>
  109. </template>
  110. </el-table-column>
  111. <el-table-column prop="date" label="药品本位码" width="100" align="center">
  112. <template slot-scope="scope">
  113. <div>{{scope.row.code}}</div>
  114. </template>
  115. </el-table-column>
  116. <el-table-column prop="date" label="生产厂商" align="center" width="100">
  117. <template slot-scope="scope">
  118. <div>{{getName(scope.row.manufacturer)}}</div>
  119. </template>
  120. </el-table-column>
  121. <el-table-column prop="date" label="经销商" align="center" width="100">
  122. <template slot-scope="scope">
  123. <div>{{getDealer(scope.row.dealer)}}</div>
  124. </template>
  125. </el-table-column>
  126. <el-table-column prop="date" label="备案日期" align="center" width="100">
  127. <template slot-scope="scope">
  128. <span>{{getTime(scope.row.record_date)}}</span>
  129. </template>
  130. </el-table-column>
  131. <el-table-column prop="date" label="药品备注" align="center" width="100">
  132. <template slot-scope="scope">
  133. <div>{{scope.row.drug_remark}}</div>
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="状态" width="60" align="center">
  137. <template slot-scope="scope">
  138. <div>{{scope.row.drug_status.indexOf('停用') == -1 ? '启用':'停用' }}</div>
  139. </template>
  140. </el-table-column>
  141. <el-table-column prop="date" label="操作" width="280" align="center" fixed="right">
  142. <template slot-scope="scope">
  143. <el-button @click="openForm(scope.row.id)" type="primary" size="small">编辑</el-button>
  144. <el-button type="danger" size="small" @click="deleteDurg(scope.row.id,scope.$index)">删除</el-button>
  145. <!--<el-button type="primary" size="small" icon="el-icon-refresh-left" @click="toReturn(scope.row.id,scope.row.is_mark)" v-if="$store.getters.xt_user.org_id == 9504 || $store.getters.xt_user.org_id == 10028 || $store.getters.xt_user.org_id == 10138" >-->
  146. <!--<span v-if="scope.row.is_mark == 0">备案</span>-->
  147. <!--<span v-if="scope.row.is_mark == 1">撤消</span>-->
  148. <!--</el-button>-->
  149. <el-button type="primary" size="small" icon="el-icon-refresh-left">
  150. <span v-if="scope.row.is_mark == 0 || scope.row.is_mark == 2" @click="putOnRecord(scope.row.id)" >目录对照</span>
  151. <span v-if="scope.row.is_mark == 1" @click="putOnUnRecord(scope.row.id)" >撤消对照</span>
  152. </el-button>
  153. </template>
  154. </el-table-column>
  155. </el-table>
  156. <self-payment ref='selfPayment'></self-payment>
  157. <add-drugs ref='addDrugs'
  158. :titles="title"
  159. :formValue="formValue"
  160. :isCreated="isCreated"
  161. :manufacturers="manufacturers"
  162. v-on:dialog-comfirm="goodInfoDialogComfirm"
  163. v-on:dialog-cancle="goodInfoDialogCancle"
  164. ></add-drugs>
  165. <!-- <maintain ref='maintain'></maintain> -->
  166. <el-pagination
  167. @size-change="handleSizeChange"
  168. @current-change="handleCurrentChange"
  169. :page-sizes="[10, 50, 100]"
  170. :page-size="10"
  171. background
  172. align="right"
  173. style="margin-top:20px;"
  174. layout="total, sizes, prev, pager, next, jumper"
  175. :total="total"
  176. >
  177. </el-pagination>
  178. <el-dialog
  179. title="提示"
  180. :visible.sync="dialogVisible"
  181. width="40%"
  182. >
  183. <span>您提交的文档不是系统标准导入模板,请检查您的文档或重新 </span>
  184. <span slot="footer" class="dialog-footer">
  185. <el-button @click="dialogVisible = false">取 消</el-button>
  186. <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  187. </span>
  188. </el-dialog>
  189. <el-dialog
  190. title="提示"
  191. :visible.sync="exportLogVisible"
  192. width="40%"
  193. >
  194. <div v-for="(item,index) in logs" :key="index">
  195. <span> {{ item.export_time | parseTime('{y}-{m}-{d} {h}:{i}:{s}')}}</span>
  196. <br/>
  197. <br/>
  198. <span>{{getContent(item)}}</span>
  199. <span >点击</span>
  200. <span style="color:blue" @click="generateTxt(item)">查看详情</span>
  201. <br/>
  202. <br/>
  203. </div>
  204. <span slot="footer" class="dialog-footer">
  205. <el-button @click="exportLogVisible = false">取 消</el-button>
  206. <el-button type="primary" @click="exportLogVisible = false">确 定</el-button>
  207. </span>
  208. </el-dialog>
  209. </div>
  210. </template>
  211. <script>
  212. import axios from 'axios'
  213. import selfPayment from './selfPayment'
  214. import maintain from './maintain'
  215. import addDrugs from './addDrugs'
  216. import { GetAllManufacturer,postDrugInformation } from '@/api/stock'
  217. import { getDataConfig,getDictionaryDataConfig } from "@/utils/data";
  218. import { uParseTime } from '@/utils/tools'
  219. import {
  220. createBaseDrugLib,
  221. createDrugUnitSafeguard,
  222. createMedicineInsurancePercent,
  223. editBaseDrugLib,
  224. getBaseDrugLib,
  225. getBaseDrugLibList,
  226. deleteDurg
  227. } from '@/api/data'
  228. import {GetAllConfig } from "@/api/stock";
  229. import { generateLog } from '@/api/config'
  230. import UploadExcel from '@/xt_pages/components/UploadExcel'
  231. export default {
  232. components: {
  233. selfPayment,
  234. maintain,
  235. addDrugs,
  236. UploadExcel
  237. },
  238. data() {
  239. return {
  240. page: 0,
  241. limit: 10,
  242. keywords: '',
  243. is_use: '',
  244. is_charge: '',
  245. manufacturer:'',
  246. is_record:"",
  247. is_inject: '',
  248. list: [],
  249. isCreated: 1,
  250. manufacturers: [],
  251. title: '',
  252. formValue: {
  253. drug_name: '',//药品名称
  254. pinyin: '',//拼音
  255. wubi: '',//五笔输入法
  256. drug_alias: '',//药品别名
  257. drug_alias_pinyin: '',//别名拼音
  258. drug_alias_wubi: '',//别名五笔
  259. drug_category: '',//药品类别
  260. drug_spec: '',//药品规格
  261. drug_type: '',//药品类型
  262. drug_stock_limit: '',//库存警戒
  263. drug_origin_place: '',//产地
  264. drug_dosage_form: '',//药品剂型
  265. medical_insurance_level: '',//医保等级
  266. max_unit: '',//最大单位
  267. min_unit: '',//最小单位
  268. unit_matrixing: '',//单位换算
  269. retail_price: '',//零售价
  270. last_price: '',//上次进价
  271. drug_control: '',//开药控制
  272. number: '',//批准文号
  273. drug_classify: '',//药物分类
  274. drug_dose: '',//药品剂量
  275. drug_dose_unit: '',
  276. medical_insurance_number: '',//医保编号
  277. manufacturer: '', //生产产商
  278. pharmacology_category: '',//药理分类
  279. statistics_category: '',//统计分类
  280. code: '',//本位码
  281. is_special_diseases: '',//是否特病目录
  282. is_record: '',//是否备案
  283. agent: '',// 代理商
  284. drug_status: '',// 状态
  285. limit_remark: '',//限制说明
  286. delivery_way: '',//默认给药途径
  287. execution_frequency: '',//默认执行频率
  288. single_dose: '',//默认单次用量
  289. prescribing_number: '',//默认开药数量
  290. label: '',//标签
  291. sort: '',//收费项目排序
  292. is_use_doctor_advice: '',//是否常用医嘱
  293. is_default: '',//是否默认
  294. is_charge_predict: '',//是否收费预估项
  295. is_statistics_work: '',//是否统计工作量
  296. is_charge_use: '',//是否收费常用项
  297. drug_code: '',
  298. hosp_appr_flag:'',
  299. lmt_used_flag:'',
  300. dose_unit:'',
  301. min_price:'',
  302. drug_day:"",//默认开药天数,
  303. total:"",
  304. },
  305. tempFormValue: {
  306. drug_name: '',//药品名称
  307. pinyin: '',//拼音
  308. wubi: '',//五笔输入法
  309. drug_alias: '',//药品别名
  310. drug_alias_pinyin: '',//别名拼音
  311. drug_alias_wubi: '',//别名五笔
  312. drug_category: '',//药品类别
  313. drug_spec: '',//药品规格
  314. drug_type: '',//药品类型
  315. drug_stock_limit: '',//库存警戒
  316. drug_origin_place: '',//产地
  317. drug_dosage_form: '',//药品剂型
  318. medical_insurance_level: '',//医保等级
  319. max_unit: '',//最大单位
  320. min_unit: '',//最小单位
  321. unit_matrixing: '',//单位换算
  322. retail_price: '',//零售价
  323. last_price: '',//上次进价
  324. drug_control: '',//开药控制
  325. number: '',//批准文号
  326. drug_classify: '',//药物分类
  327. drug_dose: '',//药品剂量
  328. drug_dose_unit: '',
  329. medical_insurance_number: '',//医保编号
  330. manufacturer: '', //生产产商
  331. pharmacology_category: '',//药理分类
  332. statistics_category: '',//统计分类
  333. code: '',//本位码
  334. is_special_diseases: '',//是否特病目录
  335. is_record: '',//是否备案
  336. agent: '',// 代理商
  337. drug_status: '',// 状态
  338. limit_remark: '',//限制说明
  339. delivery_way: '',//默认给药途径
  340. execution_frequency: '',//默认执行频率
  341. single_dose: '',//默认单次用量
  342. prescribing_number: '',//默认开药数量
  343. label: '',//标签
  344. sort: '',//收费项目排序
  345. is_use_doctor_advice: '',//是否常用医嘱
  346. is_default: '',//是否默认
  347. is_charge_predict: '',//是否收费预估项
  348. is_statistics_work: '',//是否统计工作量
  349. is_charge_use: '',//是否收费常用项
  350. drug_code: '',
  351. social_security_directory_code:'',
  352. is_mark:'',
  353. prescription_mark:'',
  354. hosp_appr_flag:'',
  355. lmt_used_flag:'',
  356. dosage:'', //剂量
  357. unval:'',//拆零
  358. packing_unit:"",//包装单位
  359. packing_price:"",//包装零售价
  360. drug_day:"",//默认开药天数
  361. total:"",
  362. },
  363. current_id: 0,
  364. search_input: '',
  365. total:0,
  366. options: [
  367. {
  368. value: '0',
  369. label: '全部'
  370. }, {
  371. value: '1',
  372. label: '已备案'
  373. }, {
  374. value: '2',
  375. label: '未备案'
  376. }],
  377. value: '',
  378. dealer:[],
  379. selectDrug:[],
  380. dialogVisible:false,
  381. exportLogVisible:false,
  382. logs:[]
  383. }
  384. },
  385. methods: {
  386. GDYBBatchPutOnRecord(){
  387. var that = this;
  388. var ids = [];
  389. var idMap = {};
  390. for (const index in this.selectDrug) {
  391. ids.push(this.selectDrug[index].id);
  392. idMap[this.selectDrug[index].id] = this.selectDrug[index].id;
  393. }
  394. let params = {
  395. ids:ids.join(','),
  396. record_type: 1,
  397. admin_user_id:this.$store.getters.xt_user.user.id
  398. };
  399. axios.get('http://127.0.0.1:9532/api/checkcode/get',{params:params}).then(function(response) {
  400. if (response.data.state == 0) {
  401. that.$message.error(response.data.data.msg);
  402. return false
  403. } else {
  404. if(response.data.data.failed_code == -10){
  405. // that.$message.error(response.data.data.msg)
  406. that.$confirm(response.data.data.msg, '医保错误信息', {
  407. confirmButtonText: '确 定',
  408. type: 'warning'
  409. }).then(() => {
  410. }).catch(() => {
  411. })
  412. }else{
  413. }
  414. }
  415. }).catch(function(error) {
  416. })
  417. },
  418. handleSizeChange(val) {
  419. this.limit = val;
  420. this.getList()
  421. },
  422. handleCurrentChange(val) {
  423. this.page = val;
  424. this.getList()
  425. },
  426. changeInject(val) {
  427. this.getList()
  428. },
  429. changeCharge(val) {
  430. this.getList()
  431. },
  432. changeUser(val) {
  433. this.getList()
  434. },
  435. changeManufacture(){
  436. this.getList()
  437. },
  438. changeRecord(){
  439. this.getList()
  440. },
  441. getName(id) {
  442. for (let i = 0; i < this.manufacturers.length; i++) {
  443. if (this.manufacturers[i].id == id) {
  444. return this.manufacturers[i].manufacturer_name
  445. }
  446. }
  447. return ''
  448. },
  449. getDealer(id){
  450. var name = "";
  451. for(let i=0;i<this.dealer.length;i++){
  452. if(this.dealer[i].id == id){
  453. name = this.dealer[i].dealer_name
  454. }
  455. }
  456. return name
  457. },
  458. goodInfoDialogComfirm: function(val) {
  459. //修改自备药
  460. var untit = "";
  461. var untis = getDataConfig('hemodialysis','units');
  462. for(let i=0;i<untis.length;i++){
  463. if(val.min_unit == untis[i].id){
  464. untit = untis[i].name
  465. }
  466. }
  467. if (val.id > 0) {
  468. //修改
  469. val['id'] = this.current_id;
  470. val.min_number = parseInt(val.min_number)
  471. editBaseDrugLib(val,untit).then(response => {
  472. if (response.data.state == 0) {
  473. this.$message.error(response.data.msg);
  474. return false
  475. } else {
  476. this.$refs.addDrugs.hide();
  477. this.getList();
  478. this.$message.success('修改成功')
  479. }
  480. })
  481. } else if (val.id == 0) {
  482. //新增
  483. createBaseDrugLib(val).then(response => {
  484. if (response.data.state == 0) {
  485. this.$message.error(response.data.msg);
  486. return false
  487. } else {
  488. this.$refs.addDrugs.hide();
  489. this.getList();
  490. this.$message.success('新增成功')
  491. }
  492. })
  493. }
  494. },
  495. goodInfoDialogCancle: function() {
  496. this.$refs.addDrugs.hide()
  497. },
  498. getAllManufacturer: function() {
  499. this.manufacturers = [];
  500. GetAllManufacturer().then(response => {
  501. if (response.data.state == 0) {
  502. this.$message.error(response.data.msg);
  503. return false
  504. } else {
  505. var obj = {id:0,manufacturer_name:"全部"};
  506. this.manufacturers.push(obj);
  507. for (let i = 0; i < response.data.data.manufacturer.length; i++) {
  508. this.manufacturers.push(response.data.data.manufacturer[i])
  509. }
  510. }
  511. })
  512. },
  513. searchAction() {
  514. this.getList()
  515. },
  516. clickSelfPayment(drug_id) {
  517. this.$refs.selfPayment.show(drug_id, 1)
  518. },
  519. clickMainTain() {
  520. // this.$refs.maintain.show();
  521. },
  522. openForm(id) {
  523. this.current_id = id;
  524. this.getAllManufacturer();
  525. if (id > 0) {
  526. let params = {
  527. id: this.current_id
  528. };
  529. getBaseDrugLib(params).then(response => {
  530. if (response.data.state == 0) {
  531. this.$message.error(response.data.msg);
  532. return false
  533. } else {
  534. console.log("药品详情",response.data.data.drug)
  535. for (let key in response.data.data.drug) {
  536. this.formValue[key] = response.data.data.drug[key]
  537. }
  538. if(this.formValue.is_special_diseases <= 0){
  539. this.formValue.is_special_diseases = ''
  540. } else{
  541. this.formValue.is_special_diseases = this.formValue.is_special_diseases.toString()
  542. }
  543. if(this.formValue.is_record <= 0){
  544. this.formValue.is_record = ''
  545. } else{
  546. this.formValue.is_record = this.formValue.is_record.toString()
  547. }
  548. if(this.formValue.is_use_doctor_advice <= 0){
  549. this.formValue.is_use_doctor_advice = ''
  550. } else{
  551. this.formValue.is_use_doctor_advice = this.formValue.is_use_doctor_advice.toString()
  552. }
  553. if(this.formValue.is_default <= 0){
  554. this.formValue.is_default = ''
  555. } else{
  556. this.formValue.is_default = this.formValue.is_default.toString()
  557. }
  558. if(this.formValue.is_charge_predict <= 0){
  559. this.formValue.is_charge_predict = ''
  560. } else{
  561. this.formValue.is_charge_predict = this.formValue.is_charge_predict.toString()
  562. }
  563. if(this.formValue.is_statistics_work <= 0){
  564. this.formValue.is_statistics_work = ''
  565. } else{
  566. this.formValue.is_statistics_work = this.formValue.is_statistics_work.toString()
  567. }
  568. if(this.formValue.is_charge_use <= 0){
  569. this.formValue.is_charge_use = ''
  570. } else{
  571. this.formValue.is_charge_use = this.formValue.is_charge_use.toString()
  572. }
  573. if(this.formValue.prescription_mark<=0){
  574. this.formValue.prescription_mark = ''
  575. }else{
  576. this.formValue.prescription_mark = this.formValue.prescription_mark.toString()
  577. }
  578. this.formValue.record_date = this.getTime(this.formValue.record_date);
  579. if(this.formValue.drug_category == 0){
  580. this.formValue.drug_category = ""
  581. }
  582. if(this.formValue.drug_control == 0){
  583. this.formValue.drug_control = ""
  584. }
  585. if(this.formValue.pharmacology_category == 0){
  586. this.formValue.pharmacology_category = ""
  587. }
  588. if(this.formValue.statistics_category == 0){
  589. this.formValue.statistics_category = ""
  590. }
  591. if(this.formValue.pinyin == 0){
  592. this.formValue.pinyin = ""
  593. }
  594. if(this.formValue.wubi == 0){
  595. this.formValue.wubi = ""
  596. }
  597. if(this.formValue.last_price == 0){
  598. this.formValue.last_price = ""
  599. }
  600. if(this.formValue.retail_price == 0){
  601. this.formValue.retail_price = ""
  602. }
  603. if(this.formValue.social_security_directory_code == 0){
  604. this.formValue.social_security_directory_code = ""
  605. }
  606. if(this.formValue.is_mark == 0){
  607. this.formValue.is_mark = ""
  608. }
  609. if(this.formValue.prescription_mark == 0){
  610. this.formValue.prescription_mark = ""
  611. }
  612. if(this.formValue.hosp_appr_flag == 0){
  613. this.formValue.hosp_appr_flag = ""
  614. }
  615. if(this.formValue.drug_classify == 0){
  616. this.formValue.drug_classify = ""
  617. }
  618. this.$refs.addDrugs.show(id, this.formValue)
  619. }
  620. })
  621. } else {
  622. for (let key in this.tempFormValue) {
  623. this.formValue[key] = this.tempFormValue[key]
  624. }
  625. this.$refs.addDrugs.show(0, this.formValue)
  626. }
  627. },
  628. deleteDurg(id,index){
  629. this.$confirm('确认删除吗?', '删除', {
  630. confirmButtonText: '确 定',
  631. cancelButtonText: '取 消',
  632. type: 'warning'
  633. }).then(() => {
  634. const params = {
  635. id:id,
  636. };
  637. deleteDurg(params).then(response => {
  638. if (response.data.state == 1) {
  639. var msg = response.data.data.msg;
  640. this.list.splice(index, 1);
  641. this.$message.success("删除成功")
  642. } else {
  643. this.$message.error("药品已经出库不能删除")
  644. }
  645. })
  646. })
  647. .catch(() => {
  648. })
  649. },
  650. getList() {
  651. let params = {
  652. page: this.page,
  653. limit: this.limit,
  654. keyword: this.keywords,
  655. is_use: this.is_use,
  656. is_charge: this.is_charge,
  657. is_inject: this.is_inject,
  658. manufacturer:this.manufacturer,
  659. is_record:this.is_record
  660. };
  661. getBaseDrugLibList(params).then(response => {
  662. if (response.data.state == 0) {
  663. this.$message.error(response.data.msg);
  664. return false
  665. } else {
  666. this.total = response.data.data.total;
  667. this.list = [];
  668. for (let i = 0; i < response.data.data.list.length; i++) {
  669. this.list.push(response.data.data.list[i])
  670. }
  671. console.log("数据库字典",this.list)
  672. }
  673. })
  674. },
  675. getDataConfig(module, filed_name){
  676. return getDataConfig(module, filed_name)
  677. },
  678. putOnUnRecord(id){
  679. var that = this;
  680. let params = {
  681. ids:id.toString(),
  682. record_type: 1,
  683. admin_user_id:this.$store.getters.xt_user.user.id
  684. };
  685. axios.get('http://127.0.0.1:9532/api/uncheckcode/get',{params:params}).then(function(response) {
  686. if (response.data.state == 0) {
  687. that.$message.error(response.data.data.msg);
  688. return false
  689. } else {
  690. if(response.data.data.failed_code == -10){
  691. // that.$message.error(response.data.data.msg)
  692. that.$confirm(response.data.data.msg, '医保错误信息', {
  693. confirmButtonText: '确 定',
  694. type: 'warning'
  695. }).then(() => {
  696. }).catch(() => {
  697. })
  698. }else{
  699. // for (let i = 0; i < that.tableData.length; i++) {
  700. // if (that.tableData[i].id == that.currentObject.id) {
  701. // that.tableData[i].record.is_cancel == 1
  702. // }
  703. // }
  704. }
  705. }
  706. }).catch(function(error) {
  707. })
  708. },
  709. putOnRecord(id){
  710. var that = this;
  711. let params = {
  712. ids:id.toString(),
  713. record_type: 1,
  714. admin_user_id:this.$store.getters.xt_user.user.id
  715. };
  716. axios.get('http://127.0.0.1:9532/api/checkcode/get',{params:params}).then(function(response) {
  717. if (response.data.state == 0) {
  718. that.$message.error(response.data.data.msg);
  719. return false
  720. } else {
  721. if(response.data.data.failed_code == -10){
  722. // that.$message.error(response.data.data.msg)
  723. that.$confirm(response.data.data.msg, '医保错误信息', {
  724. confirmButtonText: '确 定',
  725. type: 'warning'
  726. }).then(() => {
  727. }).catch(() => {
  728. })
  729. }else{
  730. }
  731. }
  732. }).catch(function(error) {
  733. })
  734. },
  735. // toRecord(){
  736. // var that = this
  737. // axios.get('http://127.0.0.1:9532/sz/api/drug/get').then(function(response) {
  738. // if (response.data.state == 0) {
  739. // that.$message.error(response.data.msg)
  740. // return false
  741. // } else {
  742. // that.$message({ message: '备案成功', type: 'success' })
  743. // that.getList()
  744. // }
  745. // }).catch(function(error) {
  746. // })
  747. // },
  748. toReturn(id,isMark){
  749. var that = this;
  750. let params = {
  751. 'id':id,
  752. 'type_id':1,
  753. 'is_mark':isMark,
  754. 'admin_user_id':this.$store.getters.xt_user.user.id
  755. };
  756. axios.get('http://127.0.0.1:9532/sz/api/revocation/get',{params:params}).then(function(response) {
  757. if (response.data.state == 0) {
  758. that.$message.error(response.data.data.msg);
  759. return false
  760. } else {
  761. if(response.data.data.msg == ""){
  762. that.$message.success("备案成功!");
  763. that.getList()
  764. }
  765. if(response.data.data.msg!=""){
  766. that.$message.error(response.data.data.msg);
  767. that.getList()
  768. }
  769. }
  770. }).catch(function(error) {
  771. })
  772. },
  773. GetAllConfig(){
  774. GetAllConfig().then(response => {
  775. if (response.data.state == 0) {
  776. this.$message.error(response.data.msg);
  777. return false;
  778. } else {
  779. this.dealer = response.data.data.dealer;
  780. }
  781. });
  782. },
  783. getTime(val) {
  784. if(val < 0){
  785. return ""
  786. }
  787. if(val == ""){
  788. return ""
  789. }else {
  790. return uParseTime(val, '{y}-{m}-{d}')
  791. }
  792. },
  793. handleSelectionChange(val){
  794. this.selectDrug = val
  795. },
  796. BatchDelete() {
  797. if (this.selectDrug.length == 0) {
  798. this.$message.error("请选择要备案的信息");
  799. return false;
  800. }
  801. this.$confirm(
  802. "确认要备案所选记录吗? <br>",
  803. "备案提示",
  804. {
  805. dangerouslyUseHTMLString: true,
  806. confirmButtonText: "确定",
  807. cancelButtonText: "取消",
  808. type: "warning"
  809. }
  810. ).then(() => {
  811. var ids = [];
  812. var idMap = {};
  813. for (const index in this.selectDrug) {
  814. ids.push(this.selectDrug[index].id);
  815. idMap[this.selectDrug[index].id] = this.selectDrug[index].id;
  816. }
  817. var idss = ids.join(',');
  818. let params = {
  819. ids:idss,
  820. admin_user_id:this.$store.getters.xt_user.user.id
  821. };
  822. var that = this;
  823. axios.get('http://127.0.0.1:9532/sz/api/drug/get',{ params: params }).then(function(response) {
  824. if (response.data.state == 0) {
  825. that.$message.error(response.data.data.msg);
  826. return false
  827. } else {
  828. if(response.data.data.msg == ""){
  829. that.$message.success("备案成功!");
  830. that.getList()
  831. }
  832. if(response.data.data.msg!=""){
  833. that.$message.error(response.data.data.msg);
  834. that.getList()
  835. }
  836. }
  837. }).catch(function(error) {
  838. })
  839. });
  840. },
  841. handleSuccessTwo({ results, header }) {
  842. console.log("header22222",header)
  843. if (header != undefined && header.length > 0) {
  844. var isHasDrugName = header.includes('*药品名称');
  845. console.log("isHasDrugName",isHasDrugName)
  846. var isHasUnval = header.includes('*拆零');
  847. console.log("isHasUnval",isHasUnval)
  848. var isHasMinUnit= header.includes('*拆零单位');
  849. console.log("isHasMinUnit",isHasMinUnit)
  850. var isHasDosage = header.includes('*剂量')
  851. console.log("isHasDosage",isHasDosage)
  852. var isHasMaxUnit= header.includes('*剂量单位');
  853. console.log("isHasMaxUnit",isHasMaxUnit)
  854. var isHasPackingUnit = header.includes('*包装单位')
  855. console.log("isHasPackingUnit",isHasPackingUnit)
  856. var isHasDrugType = header.includes('*药品类型');
  857. console.log("isHasDrugType",isHasDrugType)
  858. var isHasDrugStockLimit = header.includes('*库存警戒');
  859. console.log("isHasDrugStockLimit",isHasDrugStockLimit)
  860. var isHasDrugOriginPlace= header.includes('*产地');
  861. console.log("isHasDrugOriginPlace",isHasDrugOriginPlace)
  862. var isHasDrugDosageForm = header.includes('*药品剂型');
  863. console.log("isHasDrugDosageForm",isHasDrugDosageForm)
  864. var isHasUnitMatrixing= header.includes("*单位换算");
  865. console.log("isHasUnitMatrixing",isHasUnitMatrixing)
  866. var isHasRetailPrice = header.includes('*拆零零售价');
  867. console.log("isHasRetailPrice",isHasRetailPrice)
  868. var isHasLastPrice = header.includes('*进货价');
  869. var isHasPackingPrice= header.includes('*包装零售价');
  870. console.log("isHasLastPrice",isHasLastPrice)
  871. var isHasDrugClassifye = header.includes('*药物分类');
  872. console.log("isHasDrugClassifye",isHasDrugClassifye)
  873. var isHasManufacturer = header.includes('*生产厂商');
  874. console.log("isHasManufacturer",isHasManufacturer)
  875. var isHasDrugDose = header.includes('*默认单次用量');
  876. console.log("isHasDrugDose",isHasDrugDose)
  877. var isDrugDoseUnit = header.includes('*默认单次用量单位');
  878. console.log("isDrugDoseUnit",isDrugDoseUnit)
  879. if (!(isHasDrugName && isHasUnval && isHasDrugType && isHasDrugStockLimit && isHasDrugOriginPlace && isHasDrugDosageForm && isHasMaxUnit && isHasMinUnit && isHasUnitMatrixing && isHasRetailPrice && isHasLastPrice && isHasPackingPrice && isHasDrugClassifye && isHasManufacturer && isHasDrugDose && isDrugDoseUnit && isHasDosage && isHasPackingUnit)) {
  880. console.log("分区222222222222222222222222222222")
  881. this.dialogVisible = true;
  882. return
  883. }
  884. }else {
  885. this.dialogVisible = true;
  886. return
  887. }
  888. var tableData = [];
  889. for(let i=1;i<results.length;i++){
  890. let obj = {"drug_type_id":0,"drug_dosage_form_id":0,"medical_insurance_level_id":0,"drug_classify_id":0,"manufacturer_id":0,"dealer_id":0,"statistics_category_id":0,"drug_control_id":0,"pharmacology_category_id":0,"drug_category_id":0};
  891. for (var key in results[i]) {
  892. if (results[i]['*药品名称'] === undefined) {
  893. obj['drug_name'] = ''
  894. } else {
  895. if (key == '*药品名称') {
  896. obj['drug_name'] = results[i][key].replace(/\s/g,"")
  897. }
  898. }
  899. if (results[i]['*拆零'] === undefined) {
  900. obj['min_number'] = ''
  901. } else {
  902. if (key == '*拆零') {
  903. obj['min_number'] = results[i][key].replace(/\s/g,"")
  904. }
  905. }
  906. if (results[i]['*拆零单位'] === undefined) {
  907. obj['min_unit'] = ''
  908. } else {
  909. if (key == '*拆零单位') {
  910. obj['min_unit'] = results[i][key].replace(/\s/g,"")
  911. }
  912. }
  913. if (results[i]['*剂量'] === undefined) {
  914. obj['dosage'] = ''
  915. } else {
  916. if (key == '*剂量') {
  917. obj['dosage'] = results[i][key].replace(/\s/g,"")
  918. }
  919. }
  920. if (results[i]['*剂量单位'] === undefined) {
  921. obj['max_unit'] = ''
  922. } else {
  923. if (key == '*剂量单位') {
  924. obj['max_unit'] = results[i][key].replace(/\s/g,"")
  925. }
  926. }
  927. if (results[i]['*包装单位'] === undefined) {
  928. obj['packing_unit'] = ''
  929. } else {
  930. if (key == '*包装单位') {
  931. obj['packing_unit'] = results[i][key].replace(/\s/g,"")
  932. }
  933. }
  934. if (results[i]['默认给药途径'] === undefined) {
  935. obj['delivery_way'] = ''
  936. } else {
  937. if (key == '默认给药途径') {
  938. obj['delivery_way'] = results[i][key].replace(/\s/g,"")
  939. }
  940. }
  941. if (results[i]['默认执行频率'] === undefined) {
  942. obj['execution_frequency'] = ''
  943. } else {
  944. if (key == '默认执行频率') {
  945. obj['execution_frequency'] = results[i][key].replace(/\s/g,"")
  946. }
  947. }
  948. if (results[i]['默认开药天数'] === undefined) {
  949. obj['drug_day'] = ''
  950. } else {
  951. if (key == '默认开药天数') {
  952. obj['drug_day'] = results[i][key].replace(/\s/g,"")
  953. }
  954. }
  955. if (results[i]['*药品类型'] === undefined) {
  956. obj['drug_type'] = ''
  957. } else {
  958. if (key == '*药品类型') {
  959. obj['drug_type'] = results[i][key].replace(/\s/g,"")
  960. }
  961. }
  962. if (results[i]['*库存警戒'] === undefined) {
  963. obj['drug_stock_limit'] = ''
  964. } else {
  965. if (key == '*库存警戒') {
  966. obj['drug_stock_limit'] = results[i][key].replace(/\s/g,"")
  967. }
  968. }
  969. if (results[i]['*产地'] === undefined) {
  970. obj['drug_origin_place'] = ''
  971. } else {
  972. if (key == '*产地') {
  973. obj['drug_origin_place'] = results[i][key].replace(/\s/g,"")
  974. }
  975. }
  976. if (results[i]['*药品剂型'] === undefined) {
  977. obj['drug_dosage_form'] = ''
  978. } else {
  979. if (key == '*药品剂型') {
  980. obj['drug_dosage_form'] = results[i][key].replace(/\s/g,"")
  981. }
  982. }
  983. if (results[i]['*医保等级'] === undefined) {
  984. obj['medical_insurance_level'] = ''
  985. } else {
  986. if (key == '*医保等级') {
  987. obj['medical_insurance_level'] = results[i][key].replace(/\s/g,"")
  988. }
  989. }
  990. if (results[i]['*单位换算'] === undefined) {
  991. obj['unit_matrixing'] = ''
  992. } else {
  993. if (key == '*单位换算') {
  994. obj['unit_matrixing'] = results[i][key].replace(/\s/g,"")
  995. }
  996. }
  997. if (results[i]['*拆零零售价'] === undefined) {
  998. obj['retail_price'] = ''
  999. } else {
  1000. if (key == '*拆零零售价') {
  1001. obj['retail_price'] = results[i][key].replace(/\s/g,"")
  1002. }
  1003. }
  1004. if (results[i]['*包装零售价'] === undefined) {
  1005. obj['packing_price'] = ''
  1006. } else {
  1007. if (key == '*包装零售价') {
  1008. obj['packing_price'] = results[i][key].replace(/\s/g,"")
  1009. }
  1010. }
  1011. if (results[i]['*进货价'] === undefined) {
  1012. obj['last_price'] = ''
  1013. } else {
  1014. if (key == '*进货价') {
  1015. obj['last_price'] = results[i][key].replace(/\s/g,"")
  1016. }
  1017. }
  1018. if (results[i]['*药物分类'] === undefined) {
  1019. obj['drug_classify'] = ''
  1020. } else {
  1021. if (key == '*药物分类') {
  1022. obj['drug_classify'] = results[i][key].replace(/\s/g,"")
  1023. }
  1024. }
  1025. if (results[i]['*默认单次用量'] === undefined) {
  1026. obj['drug_dose'] = ''
  1027. } else {
  1028. if (key == '*默认单次用量') {
  1029. obj['drug_dose'] = results[i][key].replace(/\s/g,"")
  1030. }
  1031. }
  1032. if (results[i]['*默认单次用量单位'] === undefined) {
  1033. obj['drug_dose_unit'] = ''
  1034. } else {
  1035. if (key == '*默认单次用量单位') {
  1036. obj['drug_dose_unit'] = results[i][key].replace(/\s/g,"")
  1037. }
  1038. }
  1039. if (results[i]['*生产厂商'] === undefined) {
  1040. obj['manufacturer'] = ''
  1041. } else {
  1042. if (key == '*生产厂商') {
  1043. obj['manufacturer'] = results[i][key].replace(/\s/g,"")
  1044. }
  1045. }
  1046. if (results[i]['经销商'] === undefined) {
  1047. obj['dealer'] = ''
  1048. } else {
  1049. if (key == '经销商') {
  1050. obj['dealer'] = results[i][key].replace(/\s/g,"")
  1051. }
  1052. }
  1053. if (results[i]['限制性用药'] === undefined) {
  1054. obj['lmt_used_flag'] = ''
  1055. } else {
  1056. if (key == '限制性用药') {
  1057. obj['lmt_used_flag'] = results[i][key].replace(/\s/g,"")
  1058. }
  1059. }
  1060. if (results[i]['药品别名'] === undefined) {
  1061. obj['drug_alias'] = ''
  1062. } else {
  1063. if (key == '药品别名') {
  1064. obj['drug_alias'] = results[i][key].replace(/\s/g,"")
  1065. }
  1066. }
  1067. if (results[i]['药品类别'] === undefined) {
  1068. obj['drug_category'] = ''
  1069. } else {
  1070. if (key == '药品类别') {
  1071. obj['drug_category'] = results[i][key].replace(/\s/g,"")
  1072. }
  1073. }
  1074. if (results[i]['开药控制'] === undefined) {
  1075. obj['drug_control'] = ''
  1076. } else {
  1077. if (key == '开药控制') {
  1078. obj['drug_control'] = results[i][key].replace(/\s/g,"")
  1079. }
  1080. }
  1081. if (results[i]['批准文号'] === undefined) {
  1082. obj['number'] = ''
  1083. } else {
  1084. if (key == '批准文号') {
  1085. obj['number'] = results[i][key].replace(/\s/g,"")
  1086. }
  1087. }
  1088. if (results[i]['审批标志'] === undefined) {
  1089. obj['hosp_appr_flag'] = ''
  1090. } else {
  1091. if (key == '审批标志') {
  1092. obj['hosp_appr_flag'] = results[i][key].replace(/\s/g,"")
  1093. }
  1094. }
  1095. if (results[i]['医保编码'] === undefined) {
  1096. obj['medical_insurance_number'] = ''
  1097. } else {
  1098. if (key == '医保编码') {
  1099. obj['medical_insurance_number'] = results[i][key].replace(/\s/g,"")
  1100. }
  1101. }
  1102. if (results[i]['药理分类'] === undefined) {
  1103. obj['pharmacology_category'] = ''
  1104. } else {
  1105. if (key == '药理分类') {
  1106. obj['pharmacology_category'] = results[i][key].replace(/\s/g,"")
  1107. }
  1108. }
  1109. if (results[i]['统计分类'] === undefined) {
  1110. obj['statistics_category'] = ''
  1111. } else {
  1112. if (key == '统计分类') {
  1113. obj['statistics_category'] = results[i][key].replace(/\s/g,"")
  1114. }
  1115. }
  1116. if (results[i]['本位码'] === undefined) {
  1117. obj['code'] = ''
  1118. } else {
  1119. if (key == '本位码') {
  1120. obj['code'] = results[i][key].replace(/\s/g,"")
  1121. }
  1122. }
  1123. if (results[i]['是否特病目录'] === undefined) {
  1124. obj['is_special_diseases'] = ''
  1125. } else {
  1126. if (key == '是否特病目录') {
  1127. obj['is_special_diseases'] = results[i][key].replace(/\s/g,"")
  1128. }
  1129. }
  1130. if (results[i]['是否备案'] === undefined) {
  1131. obj['is_record'] = ''
  1132. } else {
  1133. if (key == '是否备案') {
  1134. obj['is_record'] = results[i][key].replace(/\s/g,"")
  1135. }
  1136. }
  1137. if (results[i]['处方药标志'] === undefined) {
  1138. obj['prescription_mark'] = ''
  1139. } else {
  1140. if (key == '处方药标志') {
  1141. obj['prescription_mark'] = results[i][key].replace(/\s/g,"")
  1142. }
  1143. }
  1144. if (results[i]['社保目录编码'] === undefined) {
  1145. obj['social_security_directory_code'] = ''
  1146. } else {
  1147. if (key == '社保目录编码') {
  1148. obj['social_security_directory_code'] = results[i][key].replace(/\s/g,"")
  1149. }
  1150. }
  1151. if (results[i]['备案日期'] === undefined) {
  1152. obj['record_date'] = ''
  1153. } else {
  1154. if (key == '备案日期') {
  1155. obj['record_date'] = results[i][key].replace(/\s/g,"")
  1156. }
  1157. }
  1158. if (results[i]['药品备注'] === undefined) {
  1159. obj['drug_remark'] = ''
  1160. } else {
  1161. if (key == '药品备注') {
  1162. obj['drug_remark'] = results[i][key].replace(/\s/g,"")
  1163. }
  1164. }
  1165. if (results[i]['状态'] === undefined) {
  1166. obj['drug_status'] = ''
  1167. } else {
  1168. if (key == '状态') {
  1169. obj['drug_status'] = results[i][key].replace(/\s/g,"")
  1170. }
  1171. }
  1172. if (results[i]['限制说明'] === undefined) {
  1173. obj['limit_remark'] = ''
  1174. } else {
  1175. if (key == '限制说明') {
  1176. obj['limit_remark'] = results[i][key].replace(/\s/g,"")
  1177. }
  1178. }
  1179. }
  1180. var newArr = [];
  1181. tableData.push(obj);
  1182. for(let i=0;i<tableData.length;i++){
  1183. if(tableData[i].is_special_diseases == ""){
  1184. tableData[i].is_special_diseases = 0
  1185. }
  1186. if(tableData[i].is_special_diseases == "是"){
  1187. tableData[i].is_special_diseases = 1
  1188. }
  1189. if(tableData[i].is_special_diseases == "否"){
  1190. tableData[i].is_special_diseases = 2
  1191. }
  1192. if(tableData[i].is_record == ""){
  1193. tableData[i].is_record = 0
  1194. }
  1195. if(tableData[i].is_record == "是"){
  1196. tableData[i].is_record = 1
  1197. }
  1198. if(tableData[i].is_record == "否"){
  1199. tableData[i].is_record = 2
  1200. }
  1201. if(tableData[i].prescription_mark == ""){
  1202. tableData[i].prescription_mark = 0
  1203. }
  1204. if(tableData[i].prescription_mark == "是"){
  1205. tableData[i].prescription_mark =1
  1206. }
  1207. if(tableData[i].prescription_mark == "否"){
  1208. tableData[i].prescription_mark =2
  1209. }
  1210. if(tableData[i].hosp_appr_flag == ""){
  1211. tableData[i].hosp_appr_flag = 0
  1212. }
  1213. if(tableData[i].hosp_appr_flag == "无需审批"){
  1214. tableData[i].hosp_appr_flag = 1
  1215. }
  1216. if(tableData[i].hosp_appr_flag == "审批通过"){
  1217. tableData[i].hosp_appr_flag = 2
  1218. }
  1219. if(tableData[i].hosp_appr_flag == "审批不通过"){
  1220. tableData[i].hosp_appr_flag = 3
  1221. }
  1222. if(tableData[i].lmt_used_flag == ""){
  1223. tableData[i].lmt_used_flag = 0
  1224. }
  1225. if(tableData[i].lmt_used_flag == "否"){
  1226. tableData[i].lmt_used_flag = 0
  1227. }
  1228. if(tableData[i].lmt_used_flag == "是"){
  1229. tableData[i].lmt_used_flag = 1
  1230. }
  1231. }
  1232. }
  1233. let params = {
  1234. 'drugs':tableData
  1235. };
  1236. console.log("params222222222",params)
  1237. postDrugInformation(params).then(response=>{
  1238. if(response.data.state == 1){
  1239. var msg = response.data.data.msg;
  1240. this.getList();
  1241. this.getAllManufacturer();
  1242. this.GetAllConfig();
  1243. this.$message.success("导入成功!")
  1244. }else{
  1245. this.$message.error("导入失败,请下载日志查看")
  1246. }
  1247. })
  1248. },
  1249. generateTxt: function(log) {
  1250. var content = '';
  1251. var errlog = log.err_logs;
  1252. content = this.getContent(log);
  1253. for (let i = 0; i < errlog.length; i++) {
  1254. if (content.length == 0) {
  1255. content = errlog[i].err_msg
  1256. } else {
  1257. content = content + '\n' + errlog[i].err_msg
  1258. }
  1259. }
  1260. var url = new Blob(['\ufeff' + content], { type: 'text/txt,charset=UTF-8' });
  1261. if (typeof url === 'object' && url instanceof Blob) {
  1262. url = URL.createObjectURL(url) // 创建blob地址
  1263. }
  1264. const aLink = document.createElement('a');
  1265. aLink.href = url;
  1266. aLink.download = this.timestampToTime(log.export_time) + '患者导入日志' + '.txt';
  1267. aLink.click()
  1268. },
  1269. getContent(log) {
  1270. return '您导入的文档共' + log.total_num + '条患者数据' + ',' + '已成功导入' + log.success_num + '条,导入失败' + log.fail_num + '条,'
  1271. },
  1272. timestampToTime(timestamp) {
  1273. var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
  1274. var Y = date.getFullYear() + '年';
  1275. var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '月';
  1276. var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + '日 ';
  1277. var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + '时';
  1278. var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + '分';
  1279. var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()) + '秒';
  1280. return Y + M + D + h + m + s
  1281. },
  1282. generateLog() {
  1283. let params = {
  1284. 'log_type': 4
  1285. };
  1286. generateLog(params).then(
  1287. response => {
  1288. if (response.data.state === 1) {
  1289. this.logs = response.data.data.logs;
  1290. this.exportLogVisible = true
  1291. } else {
  1292. this.$message.error(response.data.msg)
  1293. }
  1294. }
  1295. )
  1296. },
  1297. getDictionaryDataConfig(module,filed_name){
  1298. return getDictionaryDataConfig(module,filed_name)
  1299. },
  1300. },
  1301. created() {
  1302. this.getList();
  1303. this.getAllManufacturer();
  1304. this.GetAllConfig()
  1305. }
  1306. }
  1307. </script>