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

drugs.vue 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  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' v-model.trim="search_input"
  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="is_use" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeUser">
  12. <el-option
  13. v-for="item in options"
  14. :key="item.value"
  15. :label="item.label"
  16. :value="item.value">
  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_inject" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeInject">
  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. <el-button type="primary" @click="openForm(0)">新增</el-button>
  39. </div>
  40. <el-table :data="list" border style="width: 100%" :row-style="{ color: '#303133' }"
  41. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}">
  42. <el-table-column type="index" label="序号" width="60px" align="center"></el-table-column>
  43. <el-table-column prop="date" label="药品名称" align="center">
  44. <template slot-scope="scope">
  45. <div>{{scope.row.drug_name}}</div>
  46. </template>
  47. </el-table-column>
  48. <el-table-column prop="date" label="生产厂商" align="center">
  49. <template slot-scope="scope">
  50. <div>{{getName(scope.row.manufacturer)}}</div>
  51. </template>
  52. </el-table-column>
  53. <el-table-column prop="date" label="规格" width="140" align="center">
  54. <template slot-scope="scope">
  55. <div>{{scope.row.drug_spec}}</div>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="最小单位" width="60" align="center">
  59. <template slot-scope="scope">
  60. <div>{{scope.row.min_unit}}</div>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="零售价" width="60" align="center">
  64. <template slot-scope="scope">
  65. <div>{{scope.row.retail_price}}</div>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="状态" width="60" align="center">
  69. <template slot-scope="scope">
  70. <div>{{scope.row.drug_status.indexOf('停用') == -1 ? '启用':'停用' }}</div>
  71. </template>
  72. </el-table-column>
  73. <el-table-column prop="date" label="操作" width="400" align="center">
  74. <template slot-scope="scope">
  75. <el-button @click="openForm(scope.row.id)" type="primary" size="small">编辑</el-button>
  76. <!--<el-button type="primary" size="small" @click="clickSelfPayment(scope.row.id)">自付比例</el-button>-->
  77. <!--<el-button type="primary" size="small" @click="clickMainTain">单位维护</el-button>-->
  78. <el-button type="danger" size="small" @click="deleteDurg(scope.row.id,scope.$index)">删除</el-button>
  79. </template>
  80. </el-table-column>
  81. </el-table>
  82. <self-payment ref='selfPayment'></self-payment>
  83. <add-drugs ref='addDrugs'
  84. :titles="title"
  85. :formValue="formValue"
  86. :isCreated="isCreated"
  87. :manufacturers="manufacturers"
  88. v-on:dialog-comfirm="goodInfoDialogComfirm"
  89. v-on:dialog-cancle="goodInfoDialogCancle"
  90. ></add-drugs>
  91. <!-- <maintain ref='maintain'></maintain> -->
  92. <el-pagination
  93. @size-change="handleSizeChange"
  94. @current-change="handleCurrentChange"
  95. :page-sizes="[10, 50, 100]"
  96. :page-size="10"
  97. background
  98. align="right"
  99. style="margin-top:20px;"
  100. layout="total, sizes, prev, pager, next, jumper"
  101. :total="total"
  102. >
  103. </el-pagination>
  104. </div>
  105. </template>
  106. <script>
  107. import selfPayment from './selfPayment'
  108. import maintain from './maintain'
  109. import addDrugs from './addDrugs'
  110. import { GetAllManufacturer } from '@/api/stock'
  111. import { getDataConfig } from "@/utils/data";
  112. import {
  113. createBaseDrugLib,
  114. createDrugUnitSafeguard,
  115. createMedicineInsurancePercent,
  116. editBaseDrugLib,
  117. getBaseDrugLib,
  118. getBaseDrugLibList,
  119. deleteDurg
  120. } from '@/api/data'
  121. export default {
  122. components: {
  123. selfPayment,
  124. maintain,
  125. addDrugs
  126. },
  127. data() {
  128. return {
  129. page: 0,
  130. limit: 10,
  131. keywords: '',
  132. is_use: '',
  133. is_charge: '',
  134. is_inject: '',
  135. list: [],
  136. isCreated: 1,
  137. manufacturers: [],
  138. title: '',
  139. formValue: {
  140. drug_name: '',//药品名称
  141. pinyin: '',//拼音
  142. wubi: '',//五笔输入法
  143. drug_alias: '',//药品别名
  144. drug_alias_pinyin: '',//别名拼音
  145. drug_alias_wubi: '',//别名五笔
  146. drug_category: '',//药品类别
  147. drug_spec: '',//药品规格
  148. drug_type: '',//药品类型
  149. drug_stock_limit: '',//库存警戒
  150. drug_origin_place: '',//产地
  151. drug_dosage_form: '',//药品剂型
  152. medical_insurance_level: '',//医保等级
  153. max_unit: '',//最大单位
  154. min_unit: '',//最小单位
  155. unit_matrixing: '',//单位换算
  156. retail_price: '',//零售价
  157. last_price: '',//上次进价
  158. drug_control: '',//开药控制
  159. number: '',//批准文号
  160. drug_classify: '',//药物分类
  161. drug_dose: '',//药品剂量
  162. drug_dose_unit: '',
  163. medical_insurance_number: '',//医保编号
  164. manufacturer: '', //生产产商
  165. pharmacology_category: '',//药理分类
  166. statistics_category: '',//统计分类
  167. code: '',//本位码
  168. is_special_diseases: '',//是否特病目录
  169. is_record: '',//是否备案
  170. agent: '',// 代理商
  171. drug_status: '',// 状态
  172. limit_remark: '',//限制说明
  173. delivery_way: '',//默认给药途径
  174. execution_frequency: '',//默认执行频率
  175. single_dose: '',//默认单次用量
  176. prescribing_number: '',//默认开药数量
  177. label: '',//标签
  178. sort: '',//收费项目排序
  179. is_use_doctor_advice: '',//是否常用医嘱
  180. is_default: '',//是否默认
  181. is_charge_predict: '',//是否收费预估项
  182. is_statistics_work: '',//是否统计工作量
  183. is_charge_use: '',//是否收费常用项
  184. drug_code: ''
  185. },
  186. tempFormValue: {
  187. drug_name: '',//药品名称
  188. pinyin: '',//拼音
  189. wubi: '',//五笔输入法
  190. drug_alias: '',//药品别名
  191. drug_alias_pinyin: '',//别名拼音
  192. drug_alias_wubi: '',//别名五笔
  193. drug_category: '',//药品类别
  194. drug_spec: '',//药品规格
  195. drug_type: '',//药品类型
  196. drug_stock_limit: '',//库存警戒
  197. drug_origin_place: '',//产地
  198. drug_dosage_form: '',//药品剂型
  199. medical_insurance_level: '',//医保等级
  200. max_unit: '',//最大单位
  201. min_unit: '',//最小单位
  202. unit_matrixing: '',//单位换算
  203. retail_price: '',//零售价
  204. last_price: '',//上次进价
  205. drug_control: '',//开药控制
  206. number: '',//批准文号
  207. drug_classify: '',//药物分类
  208. drug_dose: '',//药品剂量
  209. drug_dose_unit: '',
  210. medical_insurance_number: '',//医保编号
  211. manufacturer: '', //生产产商
  212. pharmacology_category: '',//药理分类
  213. statistics_category: '',//统计分类
  214. code: '',//本位码
  215. is_special_diseases: '',//是否特病目录
  216. is_record: '',//是否备案
  217. agent: '',// 代理商
  218. drug_status: '',// 状态
  219. limit_remark: '',//限制说明
  220. delivery_way: '',//默认给药途径
  221. execution_frequency: '',//默认执行频率
  222. single_dose: '',//默认单次用量
  223. prescribing_number: '',//默认开药数量
  224. label: '',//标签
  225. sort: '',//收费项目排序
  226. is_use_doctor_advice: '',//是否常用医嘱
  227. is_default: '',//是否默认
  228. is_charge_predict: '',//是否收费预估项
  229. is_statistics_work: '',//是否统计工作量
  230. is_charge_use: '',//是否收费常用项
  231. drug_code: ''
  232. },
  233. current_id: 0,
  234. search_input: '',
  235. total:0,
  236. options: [
  237. {
  238. value: '0',
  239. label: '全部'
  240. }, {
  241. value: '1',
  242. label: '是'
  243. }, {
  244. value: '2',
  245. label: '否'
  246. }],
  247. value: '',
  248. tableData: [{
  249. date: '2016-05-02',
  250. name: '王小虎',
  251. address: '上海市普陀区金沙江路 1518 弄'
  252. }, {
  253. date: '2016-05-04',
  254. name: '王小虎',
  255. address: '上海市普陀区金沙江路 1517 弄'
  256. }, {
  257. date: '2016-05-01',
  258. name: '王小虎',
  259. address: '上海市普陀区金沙江路 1519 弄'
  260. }, {
  261. date: '2016-05-03',
  262. name: '王小虎',
  263. address: '上海市普陀区金沙江路 1516 弄'
  264. }]
  265. }
  266. },
  267. methods: {
  268. handleSizeChange(val) {
  269. this.limit = val
  270. this.getList()
  271. },
  272. handleCurrentChange(val) {
  273. this.page = val
  274. this.getList()
  275. },
  276. changeInject(val) {
  277. this.getList()
  278. },
  279. changeCharge(val) {
  280. this.getList()
  281. },
  282. changeUser(val) {
  283. this.getList()
  284. },
  285. getName(id) {
  286. for (let i = 0; i < this.manufacturers.length; i++) {
  287. if (this.manufacturers[i].id == id) {
  288. return this.manufacturers[i].manufacturer_name
  289. }
  290. }
  291. return ''
  292. },
  293. goodInfoDialogComfirm: function(val) {
  294. //修改自备药
  295. var untit = ""
  296. var untis = getDataConfig('hemodialysis','units')
  297. console.log("999999",untis)
  298. for(let i=0;i<untis.length;i++){
  299. if(val.min_unit == untis[i].id){
  300. untit = untis[i].name
  301. }
  302. }
  303. if (val.id > 0) {
  304. //修改
  305. val['id'] = this.current_id
  306. editBaseDrugLib(val,untit).then(response => {
  307. if (response.data.state == 0) {
  308. this.$message.error(response.data.msg)
  309. return false
  310. } else {
  311. this.$refs.addDrugs.hide()
  312. this.getList()
  313. this.$message.success('修改成功')
  314. }
  315. })
  316. } else if (val.id == 0) {
  317. //新增
  318. console.log("vale222222",val)
  319. createBaseDrugLib(val).then(response => {
  320. if (response.data.state == 0) {
  321. this.$message.error(response.data.msg)
  322. return false
  323. } else {
  324. this.$refs.addDrugs.hide()
  325. this.getList()
  326. this.$message.success('新增成功')
  327. }
  328. })
  329. }
  330. },
  331. goodInfoDialogCancle: function() {
  332. this.$refs.addDrugs.hide()
  333. },
  334. getAllManufacturer: function() {
  335. this.manufacturers = []
  336. GetAllManufacturer().then(response => {
  337. if (response.data.state == 0) {
  338. this.$message.error(response.data.msg)
  339. return false
  340. } else {
  341. for (let i = 0; i < response.data.data.manufacturer.length; i++) {
  342. this.manufacturers.push(
  343. response.data.data.manufacturer[i]
  344. )
  345. }
  346. }
  347. })
  348. },
  349. searchAction() {
  350. this.getList()
  351. },
  352. clickSelfPayment(drug_id) {
  353. this.$refs.selfPayment.show(drug_id, 1)
  354. },
  355. clickMainTain() {
  356. // this.$refs.maintain.show();
  357. },
  358. openForm(id) {
  359. this.current_id = id
  360. this.getAllManufacturer()
  361. if (id > 0) {
  362. let params = {
  363. id: this.current_id
  364. }
  365. getBaseDrugLib(params).then(response => {
  366. if (response.data.state == 0) {
  367. this.$message.error(response.data.msg)
  368. return false
  369. } else {
  370. for (let key in response.data.data.drug) {
  371. this.formValue[key] = response.data.data.drug[key]
  372. }
  373. if(this.formValue.is_special_diseases <= 0){
  374. this.formValue.is_special_diseases = ''
  375. } else{
  376. this.formValue.is_special_diseases = this.formValue.is_special_diseases.toString()
  377. }
  378. if(this.formValue.is_record <= 0){
  379. this.formValue.is_record = ''
  380. } else{
  381. this.formValue.is_record = this.formValue.is_record.toString()
  382. }
  383. if(this.formValue.is_use_doctor_advice <= 0){
  384. this.formValue.is_use_doctor_advice = ''
  385. } else{
  386. this.formValue.is_use_doctor_advice = this.formValue.is_use_doctor_advice.toString()
  387. }
  388. if(this.formValue.is_default <= 0){
  389. this.formValue.is_default = ''
  390. } else{
  391. this.formValue.is_default = this.formValue.is_default.toString()
  392. }
  393. if(this.formValue.is_charge_predict <= 0){
  394. this.formValue.is_charge_predict = ''
  395. } else{
  396. this.formValue.is_charge_predict = this.formValue.is_charge_predict.toString()
  397. }
  398. if(this.formValue.is_statistics_work <= 0){
  399. this.formValue.is_statistics_work = ''
  400. } else{
  401. this.formValue.is_statistics_work = this.formValue.is_statistics_work.toString()
  402. }
  403. if(this.formValue.is_charge_use <= 0){
  404. this.formValue.is_charge_use = ''
  405. } else{
  406. this.formValue.is_charge_use = this.formValue.is_charge_use.toString()
  407. }
  408. this.$refs.addDrugs.show(id, this.formValue)
  409. }
  410. })
  411. } else {
  412. for (let key in this.tempFormValue) {
  413. this.formValue[key] = this.tempFormValue[key]
  414. }
  415. this.$refs.addDrugs.show(0, this.formValue)
  416. }
  417. },
  418. deleteDurg(id,index){
  419. console.log("id",id)
  420. this.$confirm('确认删除吗?', '删除', {
  421. confirmButtonText: '确 定',
  422. cancelButtonText: '取 消',
  423. type: 'warning'
  424. }).then(() => {
  425. const params = {
  426. id:id,
  427. }
  428. deleteDurg(params).then(response => {
  429. if (response.data.state == 1) {
  430. var msg = response.data.data.msg
  431. this.list.splice(index, 1);
  432. this.$message.success("删除成功")
  433. } else {
  434. this.$message.error("药品已经出库不能删除")
  435. }
  436. })
  437. })
  438. .catch(() => {
  439. })
  440. },
  441. getList() {
  442. let params = {
  443. page: this.page,
  444. limit: this.limit,
  445. keyword: this.keywords,
  446. is_use: this.is_use,
  447. is_charge: this.is_charge,
  448. is_inject: this.is_inject
  449. }
  450. getBaseDrugLibList(params).then(response => {
  451. if (response.data.state == 0) {
  452. this.$message.error(response.data.msg)
  453. return false
  454. } else {
  455. this.total = response.data.data.total
  456. this.list = []
  457. for (let i = 0; i < response.data.data.list.length; i++) {
  458. this.list.push(response.data.data.list[i])
  459. }
  460. }
  461. })
  462. },
  463. getDataConfig(module, filed_name){
  464. return getDataConfig(module, filed_name)
  465. },
  466. }, created() {
  467. this.getList()
  468. this.getAllManufacturer()
  469. }
  470. }
  471. </script>