123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523 |
- <template>
- <div class="page_drugs">
- <div style="display:flex;justify-content: space-between;width:100%;margin-bottom:20px;">
- <div class="cell clearfix" style="margin-bottom:0;">
- <el-input style="width: 180px;margin-right:10px;" @keyup.enter.native='searchAction' v-model.trim="search_input"
- class="filter-item" v-model="keywords"/>
- <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search"
- @click="searchAction">搜索
- </el-button>
- <label class="title"><span class="name">是否启用</span> : </label>
- <el-select v-model="is_use" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeUser">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <label class="title"><span class="name">是否收费</span> : </label>
- <el-select v-model="is_charge" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeCharge">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <span style="color: #909399;font-size:14px;">是否注射类别 : </span>
- <el-select v-model="is_inject" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeInject">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </div>
- <el-button type="primary" @click="openForm(0)">新增</el-button>
- </div>
- <el-table :data="list" border style="width: 100%" :row-style="{ color: '#303133' }"
- :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}">
- <el-table-column type="index" label="序号" width="60px" align="center"></el-table-column>
-
- <el-table-column prop="date" label="药品名称" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.drug_name}}</div>
- </template>
-
- </el-table-column>
- <el-table-column prop="date" label="生产厂商" align="center">
- <template slot-scope="scope">
- <div>{{getName(scope.row.manufacturer)}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="date" label="规格" width="140" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.drug_spec}}</div>
- </template>
- </el-table-column>
- <el-table-column label="最小单位" width="60" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.min_unit}}</div>
- </template>
-
- </el-table-column>
- <el-table-column label="零售价" width="60" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.retail_price}}</div>
- </template>
- </el-table-column>
- <el-table-column label="状态" width="60" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.drug_status.indexOf('停用') == -1 ? '启用':'停用' }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="date" label="操作" width="400" align="center">
- <template slot-scope="scope">
- <el-button @click="openForm(scope.row.id)" type="primary" size="small">编辑</el-button>
- <!--<el-button type="primary" size="small" @click="clickSelfPayment(scope.row.id)">自付比例</el-button>-->
- <!--<el-button type="primary" size="small" @click="clickMainTain">单位维护</el-button>-->
- <el-button type="danger" size="small" @click="deleteDurg(scope.row.id,scope.$index)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <self-payment ref='selfPayment'></self-payment>
- <add-drugs ref='addDrugs'
- :titles="title"
- :formValue="formValue"
- :isCreated="isCreated"
- :manufacturers="manufacturers"
- v-on:dialog-comfirm="goodInfoDialogComfirm"
- v-on:dialog-cancle="goodInfoDialogCancle"
-
- ></add-drugs>
- <!-- <maintain ref='maintain'></maintain> -->
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[10, 50, 100]"
- :page-size="10"
- background
- align="right"
- style="margin-top:20px;"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- >
- </el-pagination>
-
- </div>
- </template>
-
- <script>
- import selfPayment from './selfPayment'
- import maintain from './maintain'
- import addDrugs from './addDrugs'
- import { GetAllManufacturer } from '@/api/stock'
- import { getDataConfig } from "@/utils/data";
- import {
- createBaseDrugLib,
- createDrugUnitSafeguard,
- createMedicineInsurancePercent,
- editBaseDrugLib,
- getBaseDrugLib,
- getBaseDrugLibList,
- deleteDurg
- } from '@/api/data'
-
- export default {
- components: {
- selfPayment,
- maintain,
- addDrugs
- },
- data() {
- return {
- page: 0,
- limit: 10,
- keywords: '',
- is_use: '',
- is_charge: '',
- is_inject: '',
- list: [],
-
- isCreated: 1,
- manufacturers: [],
- title: '',
- formValue: {
- drug_name: '',//药品名称
- pinyin: '',//拼音
- wubi: '',//五笔输入法
- drug_alias: '',//药品别名
- drug_alias_pinyin: '',//别名拼音
- drug_alias_wubi: '',//别名五笔
- drug_category: '',//药品类别
- drug_spec: '',//药品规格
- drug_type: '',//药品类型
- drug_stock_limit: '',//库存警戒
- drug_origin_place: '',//产地
- drug_dosage_form: '',//药品剂型
- medical_insurance_level: '',//医保等级
- max_unit: '',//最大单位
- min_unit: '',//最小单位
- unit_matrixing: '',//单位换算
- retail_price: '',//零售价
- last_price: '',//上次进价
- drug_control: '',//开药控制
- number: '',//批准文号
- drug_classify: '',//药物分类
- drug_dose: '',//药品剂量
- drug_dose_unit: '',
- medical_insurance_number: '',//医保编号
- manufacturer: '', //生产产商
- pharmacology_category: '',//药理分类
- statistics_category: '',//统计分类
- code: '',//本位码
- is_special_diseases: '',//是否特病目录
- is_record: '',//是否备案
- agent: '',// 代理商
- drug_status: '',// 状态
- limit_remark: '',//限制说明
- delivery_way: '',//默认给药途径
- execution_frequency: '',//默认执行频率
- single_dose: '',//默认单次用量
- prescribing_number: '',//默认开药数量
- label: '',//标签
- sort: '',//收费项目排序
- is_use_doctor_advice: '',//是否常用医嘱
- is_default: '',//是否默认
- is_charge_predict: '',//是否收费预估项
- is_statistics_work: '',//是否统计工作量
- is_charge_use: '',//是否收费常用项
- drug_code: ''
-
- },
- tempFormValue: {
- drug_name: '',//药品名称
- pinyin: '',//拼音
- wubi: '',//五笔输入法
- drug_alias: '',//药品别名
- drug_alias_pinyin: '',//别名拼音
- drug_alias_wubi: '',//别名五笔
- drug_category: '',//药品类别
- drug_spec: '',//药品规格
- drug_type: '',//药品类型
- drug_stock_limit: '',//库存警戒
- drug_origin_place: '',//产地
- drug_dosage_form: '',//药品剂型
- medical_insurance_level: '',//医保等级
- max_unit: '',//最大单位
- min_unit: '',//最小单位
- unit_matrixing: '',//单位换算
- retail_price: '',//零售价
- last_price: '',//上次进价
- drug_control: '',//开药控制
- number: '',//批准文号
- drug_classify: '',//药物分类
- drug_dose: '',//药品剂量
- drug_dose_unit: '',
- medical_insurance_number: '',//医保编号
- manufacturer: '', //生产产商
- pharmacology_category: '',//药理分类
- statistics_category: '',//统计分类
- code: '',//本位码
- is_special_diseases: '',//是否特病目录
- is_record: '',//是否备案
- agent: '',// 代理商
- drug_status: '',// 状态
- limit_remark: '',//限制说明
- delivery_way: '',//默认给药途径
- execution_frequency: '',//默认执行频率
- single_dose: '',//默认单次用量
- prescribing_number: '',//默认开药数量
- label: '',//标签
- sort: '',//收费项目排序
- is_use_doctor_advice: '',//是否常用医嘱
- is_default: '',//是否默认
- is_charge_predict: '',//是否收费预估项
- is_statistics_work: '',//是否统计工作量
- is_charge_use: '',//是否收费常用项
- drug_code: ''
-
- },
-
- current_id: 0,
-
- search_input: '',
- total:0,
- options: [
- {
- value: '0',
- label: '全部'
- }, {
- value: '1',
- label: '是'
- }, {
- value: '2',
- label: '否'
- }],
- value: '',
- tableData: [{
- date: '2016-05-02',
- name: '王小虎',
- address: '上海市普陀区金沙江路 1518 弄'
- }, {
- date: '2016-05-04',
- name: '王小虎',
- address: '上海市普陀区金沙江路 1517 弄'
- }, {
- date: '2016-05-01',
- name: '王小虎',
- address: '上海市普陀区金沙江路 1519 弄'
- }, {
- date: '2016-05-03',
- name: '王小虎',
- address: '上海市普陀区金沙江路 1516 弄'
- }]
-
- }
- },
- methods: {
- handleSizeChange(val) {
- this.limit = val
- this.getList()
- },
- handleCurrentChange(val) {
- this.page = val
- this.getList()
- },
- changeInject(val) {
- this.getList()
-
- },
- changeCharge(val) {
- this.getList()
-
- },
- changeUser(val) {
- this.getList()
-
- },
- getName(id) {
- for (let i = 0; i < this.manufacturers.length; i++) {
- if (this.manufacturers[i].id == id) {
- return this.manufacturers[i].manufacturer_name
- }
- }
- return ''
- },
- goodInfoDialogComfirm: function(val) {
-
- //修改自备药
- var untit = ""
- var untis = getDataConfig('hemodialysis','units')
- console.log("999999",untis)
- for(let i=0;i<untis.length;i++){
- if(val.min_unit == untis[i].id){
- untit = untis[i].name
- }
- }
- if (val.id > 0) {
- //修改
- val['id'] = this.current_id
- editBaseDrugLib(val,untit).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$refs.addDrugs.hide()
- this.getList()
- this.$message.success('修改成功')
- }
- })
- } else if (val.id == 0) {
- //新增
- console.log("vale222222",val)
-
- createBaseDrugLib(val).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.$refs.addDrugs.hide()
- this.getList()
- this.$message.success('新增成功')
- }
- })
- }
- },
- goodInfoDialogCancle: function() {
- this.$refs.addDrugs.hide()
- },
- getAllManufacturer: function() {
- this.manufacturers = []
- GetAllManufacturer().then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- for (let i = 0; i < response.data.data.manufacturer.length; i++) {
- this.manufacturers.push(
- response.data.data.manufacturer[i]
- )
- }
- }
- })
- },
- searchAction() {
- this.getList()
- },
- clickSelfPayment(drug_id) {
- this.$refs.selfPayment.show(drug_id, 1)
- },
- clickMainTain() {
- // this.$refs.maintain.show();
- },
- openForm(id) {
- this.current_id = id
- this.getAllManufacturer()
- if (id > 0) {
- let params = {
- id: this.current_id
- }
- getBaseDrugLib(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- for (let key in response.data.data.drug) {
- this.formValue[key] = response.data.data.drug[key]
- }
-
- if(this.formValue.is_special_diseases <= 0){
- this.formValue.is_special_diseases = ''
- } else{
- this.formValue.is_special_diseases = this.formValue.is_special_diseases.toString()
- }
-
- if(this.formValue.is_record <= 0){
- this.formValue.is_record = ''
- } else{
- this.formValue.is_record = this.formValue.is_record.toString()
- }
-
-
- if(this.formValue.is_use_doctor_advice <= 0){
-
- this.formValue.is_use_doctor_advice = ''
- } else{
-
- this.formValue.is_use_doctor_advice = this.formValue.is_use_doctor_advice.toString()
-
-
- }
-
-
- if(this.formValue.is_default <= 0){
-
- this.formValue.is_default = ''
- } else{
-
- this.formValue.is_default = this.formValue.is_default.toString()
-
-
- }
-
- if(this.formValue.is_charge_predict <= 0){
-
- this.formValue.is_charge_predict = ''
- } else{
-
- this.formValue.is_charge_predict = this.formValue.is_charge_predict.toString()
-
-
- }
-
- if(this.formValue.is_statistics_work <= 0){
-
- this.formValue.is_statistics_work = ''
- } else{
-
- this.formValue.is_statistics_work = this.formValue.is_statistics_work.toString()
-
-
- }
-
- if(this.formValue.is_charge_use <= 0){
-
- this.formValue.is_charge_use = ''
- } else{
-
- this.formValue.is_charge_use = this.formValue.is_charge_use.toString()
-
-
- }
-
- this.$refs.addDrugs.show(id, this.formValue)
-
- }
- })
- } else {
- for (let key in this.tempFormValue) {
- this.formValue[key] = this.tempFormValue[key]
- }
- this.$refs.addDrugs.show(0, this.formValue)
- }
- },
-
- deleteDurg(id,index){
- console.log("id",id)
- this.$confirm('确认删除吗?', '删除', {
- confirmButtonText: '确 定',
- cancelButtonText: '取 消',
- type: 'warning'
- }).then(() => {
- const params = {
- id:id,
- }
- deleteDurg(params).then(response => {
- if (response.data.state == 1) {
- var msg = response.data.data.msg
- this.list.splice(index, 1);
- this.$message.success("删除成功")
- } else {
- this.$message.error("药品已经出库不能删除")
- }
- })
- })
- .catch(() => {
- })
- },
- getList() {
- let params = {
- page: this.page,
- limit: this.limit,
- keyword: this.keywords,
- is_use: this.is_use,
- is_charge: this.is_charge,
- is_inject: this.is_inject
- }
- getBaseDrugLibList(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.total = response.data.data.total
- this.list = []
- for (let i = 0; i < response.data.data.list.length; i++) {
- this.list.push(response.data.data.list[i])
- }
- }
- })
- },
- getDataConfig(module, filed_name){
- return getDataConfig(module, filed_name)
- },
-
- }, created() {
- this.getList()
- this.getAllManufacturer()
- }
- }
- </script>
|