123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896 |
- <template>
- <div>
- <div style="display: flex;margin-bottom:10px;">
- <div class="cell clearfix" style="flex: 1;">
- <span>发药时间:</span>
- <el-date-picker
- size="small"
- v-model="start_time"
- prefix-icon="el-icon-date"
- :editable="false"
- style="width: 150px;"
- type="date"
- placeholder="选择日期时间"
- align="right"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- @change="changeStartTime"
- ></el-date-picker>
- -
- <el-date-picker
- @change="changeEndTime"
- size="small"
- v-model="end_time"
- prefix-icon="el-icon-date"
- :editable="false"
- style="width: 150px;margin-right:10px;"
- type="date"
- placeholder="选择日期时间"
- align="right"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- ></el-date-picker>
-
- <div style="width:150px;display: inline-block;">
- <el-input style="width: 150px"
- v-model="keywords" @input="searchAction"
- @keyup.enter.native="searchAction"
- class="filter-item" placeholder="请输入患者姓名"
- />
- </div>
- </div>
-
- <div style="flex: 1;">
- <el-button type="primary" @click="batchUpload()">批量上传</el-button>
- <el-button type="primary" @click="query()">查询</el-button>
- <el-button type="primary" @click="exportdata()">导出</el-button>
- </div>
- </div>
- <div style="display: flex;margin-bottom:10px;">
-
- <div>上传状态:
- <el-select size="small" v-model="is_sale" placeholder="请选择" style="width:100px;" @change="changeStock">
- <el-option
- v-for="item,index in items"
- :key="index"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </div>
-
- <div>结算状态:
- <el-select size="small" v-model="is_settle" placeholder="请选择" style="width:100px;" @change="changeSettle">
- <el-option
- v-for="item,index in settle_items"
- :key="index"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </div>
-
- <div>是否有溯源码:
- <el-select size="small" v-model="is_code" placeholder="请选择" style="width:100px;" @change="changeCode">
- <el-option
- v-for="item,index in code_items"
- :key="index"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </div>
-
- <div>数据来源:
- <el-select size="small" v-model="is_type" placeholder="请选择" style="width:100px;" @change="changeType">
- <el-option
- v-for="item,index in advice_items"
- :key="index"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </div>
- </div>
- <el-table v-loading="isloading" :data="tableData" border :row-style="{ color: '#303133' }" ref="table2"
- :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
- max-height="800"
- @select="selectCostInfo"
- @selection-change="changeCostInfoTableData"
- @select-all="changeAllCostInfoTableData"
- highlight-current-row>
- <el-table-column
- align="center"
- type="selection"
- width="55"
- ></el-table-column>
- <el-table-column align="center" prop="name" label="患者姓名">
- <template slot-scope="scope">{{ getPatientName(scope.row.patient_id) }}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="处方日期">
- <template slot-scope="scope">{{is_type == 3 ? getTime(scope.row.record_date): getTime(scope.row.advice_date) }}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="药品名称">
- <template slot-scope="scope">{{ is_type == 3 ? scope.row.good_info.good_name :scope.row.advice_name }}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="规格">
- <template slot-scope="scope">{{is_type == 3 ? scope.row.good_info.specification_name : getDrugSpec(scope.row.drug_id) }}</template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="开药总量">
- <template slot-scope="scope">{{ is_type == 3 ? scope.row.count : scope.row.prescribing_number }}{{
- is_type == 3 ? scope.row.unit :scope.row.prescribing_number_unit
- }}
- </template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="药品追溯码">
- <template slot-scope="scope">
- <div @click="getDrugCode(scope.row.id,scope.row.DataSources,scope.row.drug_code,scope.$index)">
- <el-input style="width: 100;" v-model="scope.row.drug_code"></el-input>
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="上传状态">
- <template slot-scope="scope">
- <div v-if="scope.row.is_upload == 1">已上传</div>
- <div v-if="scope.row.is_upload == 2 || scope.row.is_upload == 0">未上传</div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="发药状态" v-if="is_type == 1">
- <template slot-scope="scope">
- <div v-if="scope.row.is_medicine == 1">已发药</div>
- <div v-if="scope.row.is_medicine == 2 || scope.row.is_medicine == 0">未发药</div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="结算状态" v-if="is_type == 1">
- <template slot-scope="scope">
-
- <div v-if="scope.row.pre.order_status == 2">已结算</div>
- <div v-if="scope.row.pre.order_status != 2">未结算</div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="name" label="操作" width="200">
- <template slot-scope="scope">
- <div>
- <el-button v-if="scope.row.is_upload == 1" type="primary" @click="revokeDrugCode(scope.row)">撤销
- </el-button>
- <el-button type="primary" v-if="scope.row.is_upload == 0" @click="toUpload(scope.row)">上传</el-button>
- <el-button v-if="faShow == true" type="primary" @click="toFaYao(scope.row)">发药</el-button>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-size="10"
- :page-sizes="[10, 20, 50, 100,500,1000,2000]"
- background
- layout="total, sizes, prev, pager, next, jumper"
- style="margin-top:20px;float: right"
- :total="total"
- ></el-pagination>
-
-
- <el-dialog
- title="药品追溯码"
- :visible.sync="dialogVisibleOne"
- width="40%">
- <span>
- <el-input
- @keyup.native="changeText"
- type="textarea"
- placeholder="请输入内容"
- v-model="textarea"
- :rows="10"
- >
- </el-input>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisibleOne = false">取 消</el-button>
- <el-button type="primary" @click="saveTextArea()">确 定</el-button>
- </span>
- </el-dialog>
- </div>
-
-
- </template>
-
-
- <script>
- import BreadCrumb from '@/xt_pages/components/bread-crumb'
- import {getHisDrugCodeQueryList, getPatientDrugCode} from '../../api/new_stock/stock'
- import {getDictionaryDataConfig} from "@/utils/data";
- import {uParseTime} from '@/utils/tools'
- import {changeDrugCode} from "@/api/pharmacy";
-
- import axios from 'axios'
-
- const moment = require('moment')
- export default {
- components: {
- BreadCrumb
- },
- data() {
- return {
- isloading:false,
- drugTypeList: [{id: 0, name: "全部"}],
- start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
- end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
- is_settle:"0",
- is_code:"0",
- tableData: [],
- change_type: "3",
- selection: [],
- page: 1,
- limit: 10,
- value: 0,
- keywords:"",
- is_sale: "0",
- is_type:"1",
- items: [
- {id: "0", name: '全部'},
- {id: "1", name: '已上传'},
- {id: "2", name: '未上传'},
- ],
- code_items:[
- {id: "0", name: '全部'},
- {id: "2", name: '有溯源码'},
- {id: "1", name: '无溯源码'},
-
- ],
- settle_items: [
- {id: "0", name: '全部'},
- {id: "2", name: '已结算'},
- {id: "1", name: '未结算'},
- ],
- advice_items:[
- {id:"1",name:"HIS系统药品"},
- {id:"2",name:"血透系统"},
- {id:"3",name:"HIS系统耗材"},
-
- ],
- patientList: [],
- drugList: [],
- dialogVisibleOne: false,
- id: 0,
- is_source: 0,
- drug_code: 0,
- currentRow: {},
- currentIndex: 0,
- is_drug_open: "2",
- textarea: '',
- total: 0,
- faShow: false,
- is_open: false,
- }
- },
- methods: {
- searchAction() {
- this.page = 1
-
- this.getlist()
- },
- toUpload(row) {
- if(this.is_type == 3){
- if (row.drug_code.length == 0) {
- this.$message.error("追溯码不能为空");
- return
- }
- let ids = row.id
- var that = this;
- let params = {
- id: ids,
- admin_user_id: this.$store.getters.xt_user.user.id,
- is_type:this.is_type,
- };
-
- axios.get('http://127.0.0.1:9532/test/net', {}).then(function (response) {
- if (response.data.state == 0) {
- // that.$message.error(response.data.data.msg);
- that.$confirm("请检查医保程序是否有打开", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
-
-
- })
- .catch(() => {
- });
- return false
- } else {
-
- //有打开则调用接口
- axios.get('http://127.0.0.1:9532/api/changedrug/six', {params: params}).then(function (response) {
- if (response.data.state == 0) {
- that.$message.error(response.data.data.msg);
- return false
- } else {
- if (response.data.data.failed_code == -10) {
- that.$confirm(response.data.data.msg, '医保错误信息', {
- confirmButtonText: '确 定',
- type: 'warning'
- }).then(() => {
-
- }).catch(() => {
- })
- } else {
- that.getlist()
- }
- }
- }).catch(function (error) {
- })
- }
- }).catch(function (error) {
- that.$confirm("请检查医保程序是否有打开", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- })
- .catch(() => {
- });
- })
-
- }else {
- if (row.drug_code.length == 0) {
- this.$message.error("追溯码不能为空");
- return
- }
- let ids = row.id
- var that = this;
- let params = {
- id: ids,
- admin_user_id: this.$store.getters.xt_user.user.id,
- is_type:this.is_type,
- };
-
- axios.get('http://127.0.0.1:9532/test/net', {}).then(function (response) {
- if (response.data.state == 0) {
- // that.$message.error(response.data.data.msg);
- that.$confirm("请检查医保程序是否有打开", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
-
-
- })
- .catch(() => {
- });
- return false
- } else {
-
- //有打开则调用接口
- axios.get('http://127.0.0.1:9532/api/changedrug/five', {params: params}).then(function (response) {
- if (response.data.state == 0) {
- that.$message.error(response.data.data.msg);
- return false
- } else {
- if (response.data.data.failed_code == -10) {
- that.$confirm(response.data.data.msg, '医保错误信息', {
- confirmButtonText: '确 定',
- type: 'warning'
- }).then(() => {
-
- }).catch(() => {
- })
- } else {
- that.getlist()
- }
- }
- }).catch(function (error) {
- })
- }
- }).catch(function (error) {
- that.$confirm("请检查医保程序是否有打开", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- })
- .catch(() => {
- });
- })
-
- }
-
-
-
- },
-
- revokeDrugCode(row) {
- let ids = row.id
- var that = this;
- let params = {
- id: ids,
- admin_user_id: this.$store.getters.xt_user.user.id,
- is_type:this.is_type,
-
- };
- axios.get('http://127.0.0.1:9532/test/net', {}).then(function (response) {
- if (response.data.state == 0) {
- // that.$message.error(response.data.data.msg);
- that.$confirm("请检查医保程序是否有打开", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
-
- })
- .catch(() => {
- });
- return false
- } else {
- axios.get('http://127.0.0.1:9532/api/delete_xs_bg_three', {params: params}).then(function (response) {
- if (response.data.state == 0) {
-
- that.$message.error(response.data.data.msg);
- return false
- } else {
- if (response.data.data.failed_code == -10) {
- that.$confirm(response.data.data.msg, '医保错误信息', {
- confirmButtonText: '确 定',
- type: 'warning'
- }).then(() => {
-
- }).catch(() => {
- })
- } else {
- that.getlist()
- }
- }
- }).catch(function (error) {
- })
- }
- }).catch(function (error) {
- that.$confirm("请检查医保程序是否有打开", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- })
- .catch(() => {
- });
- })
-
-
- },
-
- changeText(event) {
- // 检查是否为特定的按键,例如回车键,来确认扫码枪输入完成
- if (event.key === 'Enter') {
- var textarea = ""
- textarea += this.textarea + ","
- this.textarea = textarea
- }
- },
- changeType(val){
- this.is_type =val
- this.getlist()
- },
- getDrugCode(id, DataSources, DrugCode, index) {
- this.id = id
- this.textarea = DrugCode
- this.currentIndex = index
- this.dialogVisibleOne = true
- },
- saveTextArea() {
- var params = {
- id: this.id,
- data_source: 1,
- drug_code: this.textarea,
- }
- console.log("paramss", params)
- if(this.is_type == 1){
- changeDrugCode(params).then(response => {
- if (response.data.state == 1) {
- this.$message.success("保存成功!")
- for (let i = 0; i < this.tableData.length; i++) {
- if (this.currentIndex == i) {
- this.tableData[i].drug_code = this.textarea
- }
- }
- this.dialogVisibleOne = false
- }
- })
- }
- if(this.is_type == 3){
- var params = {
- id: this.id,
- data_source: 2,
- drug_code: this.textarea,
- }
- changeDrugCode(params).then(response=>{
- this.$message.success("保存成功!")
- for (let i = 0; i < this.tableData.length; i++) {
- if (this.currentIndex == i) {
- this.tableData[i].drug_code = this.textarea
- }
- }
- this.dialogVisibleOne = false
- })
- }
-
- if(this.is_type == 3){
- var params = {
- id: this.id,
- data_source: 3,
- drug_code: this.textarea,
- }
- changeDrugCode(params).then(response=>{
- this.$message.success("保存成功!")
- for (let i = 0; i < this.tableData.length; i++) {
- if (this.currentIndex == i) {
- this.tableData[i].drug_code = this.textarea
- }
- }
- this.dialogVisibleOne = false
- })
- }
-
- },
- getPatientName(id) {
- var name = ""
- for (let i = 0; i < this.patientList.length; i++) {
- if (id == this.patientList[i].id) {
- name = this.patientList[i].name
- }
- }
- return name
- },
- getTime(val) {
- if (val < 0) {
- return ""
- }
- if (val == "") {
- return ""
- } else {
- return uParseTime(val, '{y}-{m}-{d}')
- }
- },
- getDrugName(drug_id) {
- var drug_name = ""
- for (let i = 0; i < this.drugList.length; i++) {
- if (drug_id == this.drugList[i].id) {
- drug_name = this.drugList[i].drug_name
- }
- }
- return drug_name
- },
- getDrugSpec(drug_id) {
- var specification_name = ""
- for (let i = 0; i < this.drugList.length; i++) {
- if (drug_id == this.drugList[i].id) {
- specification_name = this.drugList[i].specification_name
- }
- }
- return specification_name
- },
- handleSizeChange(val) {
- this.limit = val
- this.getlist()
- },
- handleCurrentChange(val) {
- this.page = val
- this.getlist()
- },
- selectCostInfo(selection, row) {
- this.selection = selection
- },
- changeCostInfoTableData(val) {
- this.selection = val
- }, changeAllCostInfoTableData(selection) {
- this.selection = selection
- },
- delete() {
-
-
- },
- exportdata() {
- console.log("hahahahh", this.tableData)
- if (this.tableData != null && this.tableData.length > 0) {
- for (let i = 0; i < this.tableData.length; i++) {
- this.tableData[i].patient_name = this.getPatientName(this.tableData[i].patient_id)
- this.tableData[i].advice_date_str = this.getTime(this.tableData[i].advice_date)
- if (this.tableData[i].is_upload == 1) {
- this.tableData[i].is_upload_name = "已上传"
- }
- if (this.tableData[i].is_upload == 2 || this.tableData[i].is_upload == 0) {
- this.tableData[i].is_upload_name = "未上传"
- }
-
- if (this.tableData[i].is_medicine == 1) {
- this.tableData[i].is_medicine_name = "已发药"
- }
- if (this.tableData[i].is_medicine == 2 || this.tableData[i].is_medicine == 0) {
- this.tableData[i].is_medicine_name = "未发药"
- }
- this.tableData[i].specification_name = this.getDrugSpec(this.tableData[i].drug_id)
-
- this.tableData[i].prescribing_numbers = ""
-
- this.tableData[i].prescribing_numbers = this.tableData[i].prescribing_number + this.tableData[i].prescribing_number_unit
- }
- }
-
- import('@/vendor/Export2Excel').then(excel => {
- const tHeader = ['患者姓名', '处方日期', '药品名称', '规格', '开药总量', '药品追溯码', '上传状态', '发药状态']
- const filterVal = ['patient_name', 'advice_date_str', 'advice_name', 'specification_name', 'prescribing_numbers', 'drug_code', 'is_upload_name', 'is_medicine_name']
-
- const data = this.formatJson(filterVal, this.tableData)
- excel.export_json_to_excel({
- header: tHeader,
- data,
- filename: '药品追溯'
- })
- })
-
- }, formatJson(filterVal, jsonData) {
- return jsonData.map(v => filterVal.map(j => v[j]))
- }, isWithinOneMonth(start_time, end_time) {
- // 将字符串或其他格式的时间转为 Date 对象
- const startDate = new Date(start_time);
- const endDate = new Date(end_time);
- // 如果起始时间晚于结束时间,直接返回 false
- if (startDate > endDate) {
- return false;
- }
- // 获取起始时间加上一个月后的日期
- const oneMonthLater = new Date(startDate);
- oneMonthLater.setMonth(oneMonthLater.getMonth() + 1);
- // 判断结束时间是否在一个月内
- return endDate <= oneMonthLater;
- }, batchUpload() {
- if(this.is_type == 3){
- var that = this
- let ids = ""
- for (var i = 0; i < this.selection.length; i++){
- if (ids.length == 0){
- ids = this.selection[i].id
- }else{
- ids = ids + "," + this.selection[i].id
- }
- }
- if(ids.length == 0 ){
- this.$message.error("请勾选需要上传的数据");
- return
- }
- let params = {
- id: ids,
- admin_user_id: this.$store.getters.xt_user.user.id,
- is_type:this.is_type
-
- };
- axios.get('http://127.0.0.1:9532/test/net', {}).then(function (response) {
- if (response.data.state == 0) {
- // that.$message.error(response.data.data.msg);
- that.$confirm("请检查医保程序是否有打开", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
-
- })
- .catch(() => {
-
- });
- return false
- } else {
- that.isloading = true
-
- //有打开则调用接口
- axios.get('http://127.0.0.1:9532/api/changedrug/six', {params: params}).then(function (response) {
- if (response.data.state == 0) {
- that.isloading = false
- that.$message.error(response.data.data.msg);
- return false
- } else {
- that.isloading = false
- if (response.data.data.failed_code == -10) {
- that.$confirm(response.data.data.msg, '医保错误信息', {
- confirmButtonText: '确 定',
- type: 'warning'
- }).then(() => {
-
- }).catch(() => {
- })
- } else {
- that.getlist()
- }
- }
- }).catch(function (error) {
- that.isloading = false
- })
- }
- }).catch(function (error) {
-
- that.$confirm("请检查医保程序是否有打开", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- })
- .catch(() => {
- });
- })
-
-
- }else{
- var that = this
- let ids = ""
- for (var i = 0; i < this.selection.length; i++){
- if (ids.length == 0){
- ids = this.selection[i].id
- }else{
- ids = ids + "," + this.selection[i].id
- }
- }
- if(ids.length == 0 ){
- this.$message.error("请勾选需要上传的数据");
- return
- }
- let params = {
- id: ids,
- admin_user_id: this.$store.getters.xt_user.user.id,
- is_type:this.is_type
-
- };
- axios.get('http://127.0.0.1:9532/test/net', {}).then(function (response) {
- if (response.data.state == 0) {
- // that.$message.error(response.data.data.msg);
- that.$confirm("请检查医保程序是否有打开", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
-
- })
- .catch(() => {
-
- });
- return false
- } else {
- that.isloading = true
-
- //有打开则调用接口
- axios.get('http://127.0.0.1:9532/api/changedrug/five', {params: params}).then(function (response) {
- if (response.data.state == 0) {
- that.isloading = false
- that.$message.error(response.data.data.msg);
- return false
- } else {
- that.isloading = false
- if (response.data.data.failed_code == -10) {
- that.$confirm(response.data.data.msg, '医保错误信息', {
- confirmButtonText: '确 定',
- type: 'warning'
- }).then(() => {
-
- }).catch(() => {
- })
- } else {
- that.getlist()
- }
- }
- }).catch(function (error) {
- that.isloading = false
- })
- }
- }).catch(function (error) {
-
- that.$confirm("请检查医保程序是否有打开", "提示", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- })
- .catch(() => {
- });
- })
-
-
- }
-
- }, query() {
- this.getlist()
- },
- getDrugType(id) {
- var name = "";
- for (let i = 0; i < this.drugTypeList.length; i++) {
- if (this.drugTypeList[i].id == id) {
- name = this.drugTypeList[i].name;
- }
- }
-
- return name;
- },
- getTime(val) {
- if (val == "" || val == undefined) {
- return ""
- } else {
- return uParseTime(val, '{y}-{m}-{d}')
- }
- },
- getlist() {
- this.tableData = []
- let params = {
- start_time: this.start_time,
- end_time: this.end_time,
- page: this.page,
- limit: this.limit,
- is_sale: this.is_sale,
- is_settle:this.is_settle,
- is_code:this.is_code,
- keywords:this.keywords,
- is_type:parseInt(this.is_type),
- }
- getHisDrugCodeQueryList(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- if(this.is_type != 3){
- this.tableData = response.data.data.list
-
- }else{
- this.tableData = response.data.data.project_list
-
- }
-
- this.total = response.data.data.total
- this.drugList = response.data.data.drug
- this.patientList = response.data.data.patients
- this.is_open = response.data.data.codeConfig.is_open
- }
- })
- },changeCode(val){
- this.is_code = val
- this.getlist()
-
- },changeSettle(val){
-
- this.is_settle = val
- this.getlist()
- },
- changeStock(val) {
- this.is_sale = val
- this.getlist()
- },
- changeStartTime(val) {
- this.start_time = val
- },
- changeEndTime(val) {
- this.end_time = val
- },
- toFaYao(row) {
-
- // if (this.is_open == 1) {
- // if (row.drug_code == '') {
- // this.$message.error("药品追溯码不能为空!")
- // return
- // }
- // }
- var params = {
- drug_id: row.drug_id,
- patient_id: row.patient_id,
- advice_date: row.advice_date,
- }
- getPatientDrugCode(params).then(response => {
- if (response.data.state == 1) {
- this.$message.success("发药成功!")
- this.getlist()
- }
- })
- }
- },
- created() {
- var drugTypeList = getDictionaryDataConfig("system", "drug_type");
- this.drugTypeList.push(...drugTypeList);
- this.getlist()
- }
- }
- </script>
-
-
|