1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs="crumbs"></bread-crumb>
- <el-button
- size="small"
- @click="AddNewOrder"
- class="filter-item"
- style="float:right;"
- type="primary"
- icon="el-icon-circle-plus-outline"
- >新增</el-button>
- </div>
- <div class="app-container">
- <div class="cell clearfix">
- <label class="title"><span class="name">仓库</span> :</label>
- <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeStoreHouse">
- <el-option
- v-for="(option, index) in houseList"
- :key="index"
- :label="option.storehouse_name"
- :value="option.id">
- </el-option>
- </el-select>
- <el-input
- size="small"
- style="width: 200px;"
- class="filter-item"
- v-model.trim="searchKey"
- placeholder="单据编码/制单人/厂商"
- />
- <el-button
- size="small"
- class="filter-item"
- type="primary"
- icon="el-icon-search"
- @click="search"
- >搜索</el-button
- >
- <div style="margin-left:10px;">
- <label class="title"><span class="name">出库时间</span> : </label>
- <el-date-picker
- size="small"
- v-model="start_time"
- prefix-icon="el-icon-date"
- :editable="false"
- style="width: 196px;"
- type="date"
- placeholder="选择日期时间"
- align="right"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- @change="startTimeChange"
- ></el-date-picker>
- <span class="cellLine"> - </span>
- <el-date-picker
- size="small"
- v-model="end_time"
- prefix-icon="el-icon-date"
- :editable="false"
- style="width: 196px;"
- type="date"
- placeholder="选择日期时间"
- align="right"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- @change="endTimeChange"
- ></el-date-picker>
- </div>
- </div>
-
-
-
- <div class="cell clearfix">
- <el-checkbox
- style="width: 70px"
- v-model="checked"
- @change="changeAllSelected"
- >全选</el-checkbox
- >
- <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
- <el-button size="small" type="primary" @click="toPrint">打印</el-button>
- <el-button size="small" type="primary" @click="toExport">导出</el-button>
-
- <span> </span>
- <label class="title"><span class="name">出库方式</span> :</label>
- <el-select size="small" v-model="way_type" filterable placeholder="请选择仓库" style="width:200px" @change="changeWay">
- <el-option
- v-for="(option, index) in wayList"
- :key="index"
- :label="option.name"
- :value="option.id">
- </el-option>
- </el-select>
- </div>
-
- <el-table
- @current-change="handleSearch"
- :data="warehouseOutDate"
- :class="signAndWeighBoxPatients"
- style="width: 100%"
- border
- highlight-current-row
- ref="multipleTable"
- @selection-change="select"
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266'
- }"
- >
- <el-table-column type="selection" width="55" align="center"> </el-table-column>
-
- <el-table-column label="单据日期" align="center">
- <template slot-scope="scope">
- {{ scope.row.warehouse_out_time | parseTime("{y}-{m}-{d}") }}
- </template>
- </el-table-column>
-
- <el-table-column label="单据编号" align="center">
- <template slot-scope="scope">
- {{ scope.row.warehouse_out_order_number }}
- </template>
- </el-table-column>
-
- <el-table-column label="仓库名称" align="center">
- <template slot-scope="scope">
- {{getHouseName(scope.row.storehouse_id)}}
- </template>
- </el-table-column>
-
- <el-table-column label="制单人" align="center">
- <template slot-scope="scope">
- {{ getXuserName(scope.row.creater) }}
- </template>
- </el-table-column>
-
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>出库方式</span>
- </template>
- <template slot-scope="scope">
- <span v-if="scope.row.is_sys == 1">{{"自动出库"}}</span>
- <span v-if="scope.row.is_sys == 0">{{"手动出库"}}</span>
- <span v-if="scope.row.is_sys == 12">{{"调拨出库"}}</span>
- </template>
- </el-table-column>
-
-
- <el-table-column label="操作" align="center" width="240">
- <template slot-scope="scope">
-
-
- <el-tooltip
- class="item"
- effect="dark"
- content="编辑"
- placement="top"
- >
- <el-button
- size="mini"
- type="primary"
- icon="el-icon-edit-outline"
- @click="handleEdit(scope.$index, scope.row)"
- >
- </el-button>
- </el-tooltip>
- <el-tooltip
- class="item"
- effect="dark"
- content="删除"
- placement="top"
- >
- <el-button
- size="mini"
- type="danger"
- :disabled="scope.row.is_sys == 1"
- icon="el-icon-delete"
- @click="handleDelete(scope.$index, scope.row)"
- >
- </el-button>
- </el-tooltip>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[5, 10, 50, 100]"
- :page-size="5"
- background
- style="margin-top:20px;text-align: right"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- >
- </el-pagination>
- <!-- 使用详情 -->
- <div v-show="tableShow" style="margin-top:10px">
- <el-table
- :data="tableList"
- :class="signAndWeighBoxPatients"
- style="width: 100%"
- border
- highlight-current-row
- ref="multipleTableOne"
- @selection-change="select"
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266'
- }"
- >
- <el-table-column label="药品名称" align="center">
- <template slot-scope="scope">
- {{scope.row.drug_name}}
- </template>
- </el-table-column>
- <el-table-column label="药品类型" align="center">
- <template slot-scope="scope">
- {{getDrugType(scope.row.drug_type)}}
- </template>
- </el-table-column>
- <el-table-column label="规格&单位" align="center">
- <template slot-scope="scope">
- {{scope.row.dose}} {{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
- </template>
- </el-table-column>
- <el-table-column label="国家编码" align="center">
- <template slot-scope="scope">
- {{scope.row.medical_insurance_number}}
- </template>
- </el-table-column>
- <el-table-column label="仓库名称" align="center">
- <template slot-scope="scope">
- {{getHouseName(scope.row.storehouse_id)}}
- </template>
- </el-table-column>
-
- <el-table-column label="出库数量" align="center">
- <template slot-scope="scope">
- <span> {{getTotalCountOne(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span>
- </template>
- </el-table-column>
- <el-table-column label="出库对象" align="center" v-if="is_sys == 0">
- <template slot-scope="scope">
- <span>{{getXuserName(scope.row.admin_user_id)}} </span>
- </template>
- </el-table-column>
- <el-table-column label="单价" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.price > 0"> {{scope.row.price}}</span>
- <span v-if="scope.row.price == 0"> {{scope.row.retail_price}}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="拆零零售价" align="center">
- <template slot-scope="scope">
- {{scope.row.retail_price}}
- </template>
- </el-table-column> -->
- <el-table-column label="总价" align="center">
- <template slot-scope="scope">
- <span v-if="org_id == 10210 || org_id == 9671">{{(scope.row.count * scope.row.price).toFixed(2)}}</span>
- <span v-if="org_id != 10210 && org_id !=9671">
- <span v-if="scope.row.price > 0">{{getAllPriceOne(scope.row.drug_id,scope.row.price,scope.row.price,scope.row.max_unit,scope.row.count_unit,scope.row.min_number,scope.row.is_sys).toFixed(2)}}</span>
- <span v-if="scope.row.price == 0">{{getAllPriceOne(scope.row.drug_id,scope.row.retail_price,scope.row.min_price,scope.row.max_unit,scope.row.count_unit,scope.row.min_number,scope.row.is_sys).toFixed(2)}}</span>
- </span>
- </template>
- </el-table-column>
- <el-table-column label="生产厂家" align="center">
- <template slot-scope="scope">
- {{getManufacturerName(scope.row.manufacturer)}}
- </template>
- </el-table-column>
- <el-table-column label="生产日期" align="center">
- <template slot-scope="scope">
- {{getTime(scope.row.product_date)}}
- </template>
- </el-table-column>
- <el-table-column label="有效日期" align="center">
- <template slot-scope="scope">
- {{getTime(scope.row.expiry_date)}}
- </template>
- </el-table-column>
- <el-table-column label="经销商" align="center">
- <template slot-scope="scope">
- {{getDealerName(scope.row.dealer)}}
- </template>
- </el-table-column>
- <el-table-column label="批准文号" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.number!=''">{{scope.row.number}}</span>
- <span v-if="scope.row.number == '0'"></span>
- </template>
- </el-table-column>
- <el-table-column label="备注" align="center">
- <template slot-scope="scope">
- {{scope.row.remark}}
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <span style="color: #589ff8" @click="toDetail(scope.row)">使用明细</span>
- </template>
- </el-table-column>
- </el-table>
-
- </div>
- </div>
-
-
- <el-dialog
- title="提示"
- :visible.sync="drugDialogVisible"
- width="90%">
- <span>
- <el-table :data="userList" :class="signAndWeighBoxPatients" style="width: 50%"
- border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
- >
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>序号</span>
- </template>
- <template slot-scope="scope">
- {{scope.$index+1}}
- </template>
- </el-table-column>
-
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>使用人</span>
- </template>
- <template slot-scope="scope">
- {{scope.row.user.name}}
- </template>
- </el-table-column>
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>使用数量</span>
- </template>
- <template slot-scope="scope">
- <span >{{scope.row.count}}{{scope.row.count_unit}}</span>
- </template>
- </el-table-column>
-
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>使用时间</span>
- </template>
- <template slot-scope="scope">
- <span>{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
- </template>
- </el-table-column>
-
- </el-table>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="drugDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="drugDialogVisible = false">确 定</el-button>
- </span>
- </el-dialog>
-
-
-
- <el-dialog
- title="提示"
- :visible.sync="drugDialogVisibleTwo"
- width="90%">
- <span>
- <el-table :data="userListOne" :class="signAndWeighBoxPatients" style="width: 50%"
- border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
- >
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>序号</span>
- </template>
- <template slot-scope="scope">
- {{scope.$index+1}}
- </template>
- </el-table-column>
-
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>使用人</span>
- </template>
- <template slot-scope="scope">
- <span>系统</span>
- </template>
- </el-table-column>
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>使用数量</span>
- </template>
- <template slot-scope="scope">
- {{scope.row.count}}{{scope.row.count_unit}}
- </template>
- </el-table-column>
-
- <el-table-column min-width="35" align="center">
- <template slot="header" slot-scope="scope">
- <span>使用时间</span>
- </template>
- <template slot-scope="scope">
- <span>{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
- </template>
- </el-table-column>
- </el-table>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="drugDialogVisibleTwo = false">取 消</el-button>
- <el-button type="primary" @click="drugDialogVisibleTwo = false">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
-
- <script>
- import { uParseTime } from "@/utils/tools";
- import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
-
- import {
- deleteDrugWarehouseOut,
- GetAllConfig,
- getDrugWarehouseOutList,
- getDrugWarehouseOutUser,
- getDrugAutoMaticList,
- getSinleOrderDetail,
- getAutoDrugDetail,
- getDrugCountList,
- getExportOutOrderDrugList
- } from "@/api/drug/drug_stock";
- import BreadCrumb from "../../components/bread-crumb";
- import { getInitializtion } from '@/api/stock'
- export default {
- name: "salesReturnOrder",
- components: { BreadCrumb },
- created() {
- this.org_id = this.$store.getters.xt_user.org.id
- var nowDate = new Date();
- var nowYear = nowDate.getFullYear();
- var nowMonth = nowDate.getMonth() + 1;
- var nowDay = nowDate.getDate();
- this.end_time =
- nowYear +
- "-" +
- (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
- "-" +
- (nowDay < 10 ? "0" + nowDay : nowDay);
- nowDate.setMonth(nowDate.getMonth() - 1);
- nowYear = nowDate.getFullYear();
- nowMonth = nowDate.getMonth() + 1;
- nowDay = nowDate.getDate();
- this.start_time =
- nowYear +
- "-" +
- (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
- "-" +
- (nowDay < 10 ? "0" + nowDay : nowDay);
- this.GetWarehouseOut();
- this.fetchAllAdminUsers();
- this.getDrugCountList()
- this.getInitializtion()
- },
- data() {
- return {
- searchKey: "",
- crumbs: [
- { path: false, name: "库存管理" },
- { path: false, name: "出库单" }
- ],
- page: 1,
- limit: 5,
- checked: false,
- total: 0,
- pageTotal: 0,
- pageSelect: 0,
- adminUserOptions: [],
- multipleSelection: [],
- signAndWeighBoxPatients: "sign-and-weigh-box-patients",
- start_time: "",
- warehouseOutDate: [],
- end_time: "",
- goodType: [],
- goodInfo: [],
- manufacturer: [],
- selectedTableData: [],
- dealer: [],
- type: 1,
- dialogVisible:false,
- dialogVisibleTwo:false,
- warehousingOutInfo: {
- loading: false,
- warehousingOutData: [],
- info: {}
- },
- userList:[],
- list:[],
- drugConfig:{},
- drugList:[],
- tableList:[],
- drugTypeList:[],
- tableShow:false,
- manufacturerList:[],
- drugDialogVisible:false,
- drugDialogVisibleTwo:false,
- order_id:0,
- dealerList:[],
- countList:[],
- outCountList:[],
- autoCountList:[],
- keyword:"",
- drug_type:0,
- minCount:[],
- drugOutList:[],
- outList:[],
- userListOne:[],
- exportList:[],
- batchNumberList:[],
- drugFlowList:[],
- houseList:[],
- storehouse_id:0,
- is_sys:0,
- org_id:0,
- way_type:0,
- wayList:[
- { id:0,name:"全部"},
- { id:1,name:"手动出库"},
- { id:2,name:"自动出库"},
- { id:3,name:"调拨出库"}
- ]
- };
- },
- methods: {
- search: function() {
- const Params = {
- page: this.page,
- limit: this.limit,
- start_time: this.start_time,
- end_time: this.end_time,
- type: this.type,
- keywords: this.searchKey,
- storehouse_id:this.storehouse_id,
- way_type:this.way_type,
- };
- this.warehouseOutDate = [];
- getDrugWarehouseOutList(Params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.total = response.data.data.total;
- for (let i = 0; i < response.data.data.list.length; i++) {
- this.warehouseOutDate.push(response.data.data.list[i]);
- }
- this.houseList = response.data.data.houseList
- }
- });
- },
- AddNewOrder: function() {
- this.$router.push({
- name: "drugStockOutOrderAdd",
- query: { type: this.type }
- });
- },
- GetWarehouseOut: function() {
- const Params = {
- page: this.page,
- limit: this.limit,
- start_time: this.start_time,
- end_time: this.end_time,
- type: this.type,
- keywords: this.searchKey,
- storehouse_id:this.storehouse_id,
- way_type:this.way_type,
- };
- this.warehouseOutDate = [];
- getDrugWarehouseOutList(Params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.total = response.data.data.total;
- for (let i = 0; i < response.data.data.list.length; i++) {
- this.warehouseOutDate.push(response.data.data.list[i]);
- }
- var obj = {id:0,storehouse_name:"全部"}
- this.houseList = []
- this.houseList.push(obj)
- for(let i=0;i<response.data.data.houseList.length;i++){
- this.houseList.push(response.data.data.houseList[i])
- }
- }
- });
- },
- getXuserName(id) {
- if (id <= 0) {
- return "";
- }
- var name = "";
- if (
- this.adminUserOptions == null ||
- typeof this.adminUserOptions.length === "undefined"
- ) {
- return name;
- }
- var leng = this.adminUserOptions.length;
- if (leng == 0) {
- return name;
- }
- for (let index = 0; index < leng; index++) {
- if (this.adminUserOptions[index].id == id) {
- name = this.adminUserOptions[index].name;
- break;
- }
- }
- return name;
- },
- fetchAllAdminUsers() {
- fetchAllAdminUsers().then(response => {
- if (response.data.state == 1) {
- this.adminUserOptions = response.data.data.users;
- var alen = this.adminUserOptions.length;
- for (let index = 0; index < alen; index++) {
- if (this.adminUserOptions[index].user_type == 2) {
- // this.doctorOptions.push(this.adminUserOptions[index]);
- }
- }
- }
- });
- },
- handleSelectionChange: function(val) {
- this.multipleSelection = val;
- },
- handleSizeChange(val) {
- this.limit = val;
- this.GetWarehouseOut();
- },
- handleCurrentChange(val) {
- this.page = val;
- this.GetWarehouseOut();
- },
- startTimeChange(val) {
- var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
- if (time > 0) {
- this.$message.error("结束时间不能小于开始时间");
- this.start_time = "";
- } else {
- this.GetWarehouseOut();
- }
- },
- endTimeChange(val) {
- var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
- if (time < 0) {
- this.$message.error("结束时间不能小于开始时间");
- this.end_time = "";
- } else {
- this.GetWarehouseOut();
- }
- },
- getTimestamp(time) {
- // 把时间日期转成时间戳
- return new Date(time).getTime() / 1000;
- },
- calculate: function(val) {
- return Math.round(parseFloat(val) * 100) / 100;
- },
- GetConfigInfo: function() {
- GetAllConfig().then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.manufacturer = response.data.data.manufacturer;
- this.dealer = response.data.data.dealer;
- }
- });
- },
-
- handleEdit: function(index, row) {
-
- this.$router.push({path:"/drug/out/drugstockoutorderedit?id="+row.id+"&type="+this.type+"&is_sys="+row.is_sys+"&supply_cancel_out_id="+row.supply_cancel_out_id})
- },
- handleSearch(val){
- this.is_sys = val.is_sys
- this.getInitializtion()
- this.getSinleOrderDetail(val.id,val.warehouse_out_time,val.is_sys)
- this.list = []
-
- },
-
- handleDelete: function(index, row) {
- if(row.is_sys == 12){
- this.$message.error("调拨出库数据不能删除!")
- return
- }
- if(row.supply_cancel_out_id >0){
- this.$message.error("采购出库数据不能删除!")
- return
- }
- const ids = [];
- ids.push(row.id);
- const idStr = ids.join(",");
-
- const params = {
- ids: idStr
- };
-
- this.$confirm("确认删除出库单记录?", "删除出库单记录", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- deleteDrugWarehouseOut(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.$notify({
- title: "成功",
- message: "删除成功",
- type: "success",
- duration: 2000
- });
- for (let i = 0; i < ids.length; i++) {
- for (let y = 0; y < this.warehouseOutDate.length; y++) {
- if (ids[i] == this.warehouseOutDate[y].id) {
- this.warehouseOutDate.splice(y, 1);
- }
- }
- }
- }
- });
- })
- .catch(() => {});
- },
- changeAllSelected: function(val) {
- if (val) {
- this.$refs.multipleTable.toggleAllSelection();
- } else {
- this.$refs.multipleTable.clearSelection();
- }
- },
- select(selection) {
-
- var ids= []
- for(let i=0;i<selection.length;i++){
- ids.push(selection[i].id)
- }
- this.order_id = ids.join(",")
- this.selectedTableData = selection;
- this.getExportOutOrderDrugList()
- },
- batchDelete() {
- console.log("232322323",this.selectedTableData)
-
- if (this.selectedTableData.length <= 0) {
- this.$message.error("请选择要删除的记录");
- return;
- }
- const ids = [];
- const idsOne = []
- for (let i = 0; i < this.selectedTableData.length; i++) {
- if(this.selectedTableData[i].is_sys == 1){
- this.$message.error("自动出库数据不能删除!")
- return false
- }
- if(this.selectedTableData[i].is_sys == 12){
- this.$message.error("调拨出库数据不能删除!")
- return false
- }
- if(this.selectedTableData[i].is_sys == 0){
- ids.push(this.selectedTableData[i].id);
- idsOne.push(this.selectedTableData[i].supply_cancel_out_id)
- }
- }
- if(idsOne.length > 0){
- this.$message.error("采购出库数据不能删除!")
- return
- }
- const idStr = ids.join(",");
- const params = {
- ids: idStr
- };
- this.$confirm("确认删除出库单记录?", "删除出库单记录", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- deleteDrugWarehouseOut(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.$notify({
- title: "成功",
- message: "删除成功",
- type: "success",
- duration: 2000
- });
-
- for (let i = 0; i < ids.length; i++) {
- for (let y = 0; y < this.warehouseOutDate.length; y++) {
- if (ids[i] == this.warehouseOutDate[y].id) {
- this.warehouseOutDate.splice(y, 1);
- }
- }
- }
- }
- });
- })
- .catch(() => {});
- },
-
- jump(id){
-
- this.GetOrderDetailTwo(id)
- this.userList=[]
- this.dialogVisibleTwo = true
- },
-
- GetOrderDetailTwo(order_id) {
- const params = {
- 'id': order_id
- }
- getDrugWarehouseOutUser(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg)
- return false
- } else {
- this.userList=[]
- var total = 0
-
- for (let i = 0; i < response.data.data.list.length; i++) {
- var obj = response.data.data.list[i]
- obj['is_total'] = 0
- this.userList.push(obj)
- total = total + response.data.data.list[i].count
- }
-
- this.userList.push({
- is_total: 1,
- total: total,
- })
-
-
- }
- })
- },
- merge({ row, column, rowIndex, columnIndex }) {
- if (columnIndex === 0) {
- const _row = this.tempArr[rowIndex]
- const _col = _row > 0 ? 1 : 0
- return {
- rowspan: _row,
- colspan: _col
- }
- }
- },
- handleSpanTempArr(){
- this.tempArr = []
-
- for (let i = 0; i < this.warehousingOutInfo.warehousingOutData.length; i++) {
- if (i === 0) {
- this.tempArr.push(1)
- this.pos = 0
- } else {
- // 判断当前元素与上一个元素是否相同
- if (this.warehousingOutInfo.warehousingOutData[i].drug_id === this.warehousingOutInfo.warehousingOutData[i - 1].drug_id) {
- this.tempArr[this.pos] += 1
- this.tempArr.push(0)
- } else {
- this.tempArr.push(1)
- this.pos = i
- }
- }
- }
-
- let sameRowArr = [], sIdx = 0
- this.warehousingOutInfo.warehousingOutData.forEach((item, index) => {
- item.index = index
- if (index === 0) {
- sameRowArr.push([index])
- } else {
- if (item.drug_id === this.warehousingOutInfo.warehousingOutData[index - 1].drug_id) {
- sameRowArr[sIdx].push(index)
- } else {
- sIdx = sIdx + 1
- sameRowArr.push([index])
- }
- }
- })
- this.sameRowArr = sameRowArr
- },
- getDrugAutoMaticList(id,recordTime,warehouse_out_order_number){
- var params = {
- warehous_out_id:id,
- record_time:recordTime,
- warehouse_out_order_number:warehouse_out_order_number,
- }
- getDrugAutoMaticList(params).then(response=>{
- if(response.data.state ==1){
- var list = response.data.data.list
- this.list = list
- var drugConfig = response.data.data.drugConfig
-
- this.drugConfig = drugConfig
- var drugList = response.data.data.drugList
- this.drugList = drugList
- var manulist = response.data.data.manufacturerList
- this.manufacturerList = manulist
- }
- })
- },
- getDrugCount(id){
-
- var count = 0
- for(let i=0;i<this.list.length;i++){
- if(this.list[i].drug_id == id){
- count = this.list[i].Total
- }
- }
- return count
- },
- getRetailPrice(id){
- var price = 0
- for(let i=0;i<this.drugList.length;i++){
- if(id == this.drugList[i].id){
- price = this.drugList[i].retail_price
- }
- }
- return price
- },
- getTime(val) {
- if(val < 0){
- return ""
- }
- if(val == ""){
- return ""
- }else {
- return uParseTime(val, '{y}-{m}-{d}')
- }
- },
- getInitializtion(){
- getInitializtion().then(response=>{
- if(response.data.state ==1){
- var drugTypeList = response.data.data.drugTypeList
-
- this.drugTypeList = drugTypeList
- }
- })
- },
- getDrugType(id){
- var name = ""
- for(let i=0;i<this.drugTypeList.length;i++){
- if(id == this.drugTypeList[i].value){
- name = this.drugTypeList[i].name
- }
- }
- return name
- },
- getManufacturerName(id){
- var name = ""
- for(let i=0;i<this.manufacturerList.length;i++){
- if(id == this.manufacturerList[i].id){
- name = this.manufacturerList[i].manufacturer_name
- }
- }
- return name
- },
- getDealerName(id){
- var name = ""
- for(let i=0;i<this.dealerList.length;i++){
- if(id == this.dealerList[i].id){
- name = this.dealerList[i].dealer_name
- }
- }
- return name
- },
- getSinleOrderDetail(id,start_time,is_sys){
- var params = {
- id:id,
- start_time:start_time,
- }
- getSinleOrderDetail(params).then(response=>{
- if(response.data.state == 1){
- this.tableShow = true
- this.tableList = []
- var list = response.data.data.list
- console.log("lisrt233232323232233223",list)
- this.manufacturerList = response.data.data.manufacturerList
- this.dealerList = response.data.data.dealerList
- var drugFlowList = response.data.data.drugFlowList
-
- if (is_sys == 1){
- if(drugFlowList.length >0){
- for(let i=0;i<drugFlowList.length;i++){
- if(drugFlowList[i].count_unit == drugFlowList[i].XtBaseDrug.max_unit){
- drugFlowList[i].count = drugFlowList[i].count * drugFlowList[i].XtBaseDrug.min_number
-
-
- }
- if(drugFlowList[i].count_unit == drugFlowList[i].XtBaseDrug.min_unit){
- drugFlowList[i].count = drugFlowList[i].count
- }
-
- }
- }
-
- this.drugFlowList = drugFlowList
- }
- if(is_sys == 0 || is_sys == 12){
- var flowlist = response.data.data.flowlist
- console.log("flowlist233232232323233223",flowlist)
- this.drugFlowList = []
- for(let i=0;i<flowlist.length;i++){
- if(flowlist[i].count_unit == flowlist[i].max_unit){
- flowlist[i].count = flowlist[i].count * flowlist[i].min_number
- flowlist[i].count_unit = flowlist[i].min_unit
- }
- if(flowlist[i].count_unit == flowlist[i].min_unit){
- flowlist[i].count = flowlist[i].count
- }
- }
- this.drugFlowList = flowlist
- console.log("this.drugFlowList32323232322323323232322323我的",flowlist)
-
- }
-
- for(let i=0;i<list.length;i++){
- if(list[i].batch_number == "0" || list[i].batch_number == 0){
- list[i].batch_number = ""
- }
-
- if(list[i].number == "0" || list[i].number == 0){
- list[i].number = ""
- }
- }
- this.tableList = list
- console.log("单价23323232323232232332232323233223",this.tableList)
- }
- })
- },
- toDetail(val){
- this.userList = []
- this.userListOne = []
- var params = {
- warehouse_out_id:val.warehouse_out_id,
- drug_id:val.drug_id,
- record_time:val.sys_record_time,
- }
- // console.log("使用明细",params)
- getAutoDrugDetail(params).then(response=>{
- if(response.data.state == 1){
-
- this.userList = response.data.data.list
- console.log("自动出库数据",this.userList)
- if(val.is_sys == 1){
-
- this.drugDialogVisible = true
- }
- if(val.is_sys == 0 || val.is_sys == 12){
-
- this.drugDialogVisibleTwo = true
- }
- var userListOne = response.data.data.outList
- // console.log("手动出库2232332",userListOne)
- this.userListOne = userListOne
- var batchNumber = response.data.data.batchNumber
- // console.log("出库详情",batchNumber)
- this.batchNumberList = batchNumber
- }
- })
- },
- toPrint(){
- if(this.order_id == 0){
- this.$message.error("请选择出库单")
- }else{
- this.$router.push({path:"/stock/drugStockOutOrderDetailPrint?id="+this.order_id})
- }
- },
-
- getDrugCountList(){
- var params = {
- keyword: this.keywords,
- start_time:this.start_time,
- end_time:this.end_time,
- }
-
- getDrugCountList(params).then(response=>{
- if(response.data.state == 1){
- var countlist = response.data.data.countList
- // console.log("入库数据",countlist)
- this.countList = countlist
- var outcountlist = response.data.data.outCountList
- // console.log("出库数据",outcountlist)
- this.outCountList = outcountlist
- var aucountlist = response.data.data.auCountList
- // console.log("自动数据",aucountlist)
- this.autoCountList = aucountlist
- var minCount = response.data.data.minCount
- // console.log("minCount",minCount)
- this.minCount = minCount
- var info = response.data.data.info
- for(let i=0;i<info.length;i++){
- if(info[i].count_unit == info[i].max_unit){
- info[i].count = info[i].count * info[i].min_number
- }
- }
- // console.log("info2222222",info)
- this.drugOutList = info
- }
- })
- },
-
- getCount(drug_id,min_number,max_unit,min_unit){
- var count= 0
- var str = ""
- var min_str = ""
- for(let i=0;i<this.drugOutList.length;i++){
- if(drug_id == this.drugOutList[i].drug_id){
- count += parseInt(this.drugOutList[i].count)
- }
- }
- if(parseInt(count/min_number)!=0){
- str = parseInt(count/min_number)+ max_unit
- }
- if((count%min_number)!=0){
- min_str = count%min_number + min_unit
- }
- return str + min_str
- },
- getTotalCount(drug_id,min_number,max_unit,min_unit){
- var str = ""
- var min_str = ""
- var arr = []
- var total = 0
- for(let i=0;i<this.outList.length;i++){
- if(this.outList[i].drug_id == drug_id){
- total += this.outList[i].count
- }
- }
-
- if (total >=min_number){
- if(parseInt(total/min_number)!=0){
- str = parseInt(total/min_number)+ max_unit
- }
- if((total%min_number)!=0){
- min_str = total%min_number + min_unit
- }
- }
-
- if (total < min_number){
- str = ""
- min_str = total + min_unit
- }
-
- return str + min_str
- },
- getTotalCountOne(id,min_number,max_unit,min_unit){
- var arr = []
- for(let i=0;i<this.drugFlowList.length;i++){
- if(id == this.drugFlowList[i].drug_id){
- arr.push(this.drugFlowList[i])
- }
- }
- var str = ""
- var min_str = ""
- var total = 0
- if(arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total +=arr[i].count
- }
- if(parseInt(total/min_number)!=0){
- str = parseInt(total/min_number)+ max_unit
- }
- if(total%min_number !=0){
- min_str = total%min_number + min_unit
- }
- }
- return str + min_str
- },
-
- getAllPrice(drug_id,price,min_price){
- var strprice = 0
- var minstrprice = 0
- var str = ""
- var min_str = ""
- var total_price = 0
- for(let i=0;i<this.outList.length;i++){
- if(this.outList[i].drug_id == drug_id){
- if(parseInt(this.outList[i].count/this.outList[i].min_number)!=0){
- str = parseInt(this.outList[i].count/this.outList[i].min_number)
- }
- if((this.outList[i].count%this.outList[i].min_number)!=0){
- min_str = this.outList[i].count%this.outList[i].min_number
- }
- }
- }
- strprice = str * price
- minstrprice = min_str * min_price
-
- total_price = strprice + minstrprice
- return total_price
- },
- getDrugBatchNumber(drugid,count){
- console.log("drug_id2323",drugid)
- console.log("count",count)
- console.log("hhhhhhhhhhh",this.batchNumberList)
- var arr = []
- for(let i=0;i<this.batchNumberList.length;i++){
- if(drugid == this.batchNumberList[i].drug_id && count == this.batchNumberList[i].count){
- arr.push(this.batchNumberList[i].batch_number)
- }
- }
- return arr.join(",")
- },
-
- getExportOutOrderDrugList(){
-
- var params = {
- order_id:this.order_id
- }
- getExportOutOrderDrugList(params).then(response=>{
- if(response.data.state == 1){
- var list = response.data.data.list
- console.log("list22222",list)
- this.exportList = list
- this.manufacturerList = response.data.data.manufacturerList
- this.dealerList = response.data.data.dealerList
- }
- })
- },
- toExport(){
- if(this.order_id == ""){
- this.$message.error("请勾选出库单")
- return
- }
- console.log("hh2323232322323",this.exportList)
- for(let i=0;i<this.exportList.length;i++){
- if(this.exportList[i].dealer == 0){
- this.exportList[i].dealer = ""
- }
- if(this.exportList[i].manufacturer == 0){
- this.exportList[i].manufacturer = ""
- }
- this.exportList[i].unit = this.exportList[i].dose + this.exportList[i].dose_unit + "*" + this.exportList[i].min_number + this.exportList[i].min_unit + "/"+this.exportList[i].max_unit
-
- this.exportList[i].total_price = (this.exportList[i].count * this.exportList[i].price).toFixed(2)
- this.exportList[i].expiry_date = this.getTime(this.exportList[i].expire_date)
- this.exportList[i].product_date = this.getTime(this.exportList[i].product_date)
- for(let j=0;j<this.manufacturerList.length;j++){
- if(this.exportList[i].manufacturer == this.manufacturerList[j].id){
- this.exportList[i].manufacturer = this.manufacturerList[j].manufacturer_name
- }
- }
-
- for(let z=0;z<this.dealerList.length;z++){
- if(this.exportList[i].dealer == this.dealerList[z].id){
- this.exportList[i].dealer = this.dealerList[z].dealer_name
- }
- }
-
- }
-
- import('@/vendor/Export2Excel').then(excel => {
- for(let i=0;i<this.exportList.length;i++){
- for(let j=0;j<this.drugTypeList.length;j++){
- if(this.exportList[i].drug_type == this.drugTypeList[j].value){
- this.exportList[i].drug_type = this.drugTypeList[j].name
- }
- }
- }
- const tHeader = ['药品名称','药品类型','规格&单位', '批号','出库数量','单价','拆零零售价','总价','生产厂家','生产日期','有效日期','经销商','批准文号','备注']
- const filterVal = ['drug_name','drug_type','unit','batch_number', 'count','price','retail_price','total_price','manufacturer','product_date','expiry_date','dealer','number','remark']
-
- // console.log("table",this.exportList)
-
- const data = this.formatJson(filterVal, this.exportList)
- excel.export_json_to_excel({
- header: tHeader,
- data,
- filename: '药品出库单详情'
- })
- this.downloadLoading = false
- })
- },
- formatJson(filterVal, jsonData) {
- return jsonData.map(v => filterVal.map(j => v[j]));
- },
- getAllPriceOne(drug_id,price,min_price,max_unit,count_unit,min_number,is_sys){
-
- var total = 0
- var all_price = 0
- for(let i=0;i<this.drugFlowList.length;i++){
- if(drug_id == this.drugFlowList[i].drug_id){
- total += this.drugFlowList[i].count
- }
- }
- if(max_unit == count_unit && is_sys!=0 && is_sys!=12){
- total = total * min_number
- }
- all_price = (total/min_number) * price
-
- return all_price
- },
- getHouseName(id){
- var storehouse_name = ""
- for(let i=0;i<this.houseList.length;i++){
- if(id == this.houseList[i].id){
- storehouse_name = this.houseList[i].storehouse_name
- }
- }
- return storehouse_name
- },
- changeStoreHouse(){
- this.GetWarehouseOut()
- },
- changeWay(){
- this.GetWarehouseOut()
- }
- }
- };
- </script>
-
- <style rel="stylesheet/scss" lang="scss">
- .app-container {
- // margin: 20px;
- font-size: 15px;
- .filter-container {
- padding-bottom: 5px;
- }
- .search-component {
- width: 500px;
- .searchBox {
- width: 300px;
- height: 36px;
- line-height: 36px;
- padding-left: 15px;
- border: 1px #dcdfe6 solid;
- border-right: none;
- outline: none;
- float: left;
- border-radius: 6px 0 0 6px;
- font-size: 14px;
- color: #333;
- background: #fff;
- box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
- }
- .searchBtn {
- background-color: #409eff;
- color: #fff;
- font-size: 15px;
- text-align: center;
- height: 36px;
- line-height: 36px;
- float: left;
- outline: none;
- width: 70px;
- border: none;
- border-radius: 0 6px 6px 0;
- font-family: "Microsoft Yahei";
- cursor: pointer;
- }
- }
-
- .amount {
- font-weight: normal;
- padding: 10px 0 0 0;
- color: #606266;
- font-size: 14px;
- span {
- color: #ef2525;
- font-family: "Arial";
- padding: 0 2px;
- }
- }
- }
- .el-table td,
- .el-table th.is-leaf,
- .el-table--border,
- .el-table--group {
- border-color: #d0d3da;
- }
- .el-table--border::after,
- .el-table--group::after,
- .el-table::before {
- background-color: #d0d3da;
- }
- </style>
|