123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705 |
- <template>
- <div class="main-contain">
- <div class="app-container "
- v-loading="loading"
- element-loading-text="拼命加载中">
- <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
- <div>
- <span>仓库:</span>
- <el-select v-model="storehouse_id" style="width:200px;margin-right:10px;" placeholder="请选择"
- filterable
- @change="changeStorehouseName">
- <el-option
- v-for="item in houseList"
- :key="item.id"
- :label="item.storehouse_name"
- :value="item.id">
- </el-option>
- </el-select>
- <span>库存预警:</span>
- <el-select v-model="good_type" style="width:250px;margin-right:10px;" placeholder="请选择"
- filterable
- @change="changeGoodName">
- <el-option
- v-for="item in goodList"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- <el-input v-model="keyword" style="width:200px" placeholder="请输入耗材名称或生产厂商" ></el-input>
- <el-button type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
- </div>
- </div>
-
- <el-table
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266'
- }"
- :data="tableList"
- :class="signAndWeighBoxPatients"
- border
- >
- <el-table-column label="耗材类型" align="center">
- <template slot-scope="scope">
- {{getGoodTypeName(scope.row.good_type_id)}}
- </template>
- </el-table-column>
- <el-table-column label="耗材名称" align="center">
- <template slot-scope="scope">
- {{scope.row.good_name}}
- </template>
- </el-table-column>
- <el-table-column label="规格&单位" align="center">
- <template slot-scope="scope">
- {{scope.row.specification_name}}
- </template>
- </el-table-column>
- <el-table-column label="生产厂商" align="center">
- <template slot-scope="scope">
- {{getManufacturName(scope.row.manufacturer)}}
- </template>
- </el-table-column>
- <el-table-column label="国家编码" align="center">
- <template slot-scope="scope">
- {{scope.row.social_security_directory_code}}
- </template>
- </el-table-column>
- <el-table-column label="仓库名称" align="center">
- <template slot-scope="scope">
- <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
- <td style="border-right: none; border-inline-end: none;text-align: center" >
- {{getHouseName(item.storehouse_id)}}
- </td>
- </tr>
- </template>
- </el-table-column>
-
- <el-table-column label="入库量" align="center">
- <template slot-scope="scope">
- <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
- <td style="border-right: none; border-inline-end: none;text-align: center">
- {{getWareInfoCount(scope.row.xt_warehouse_info,item.storehouse_id)}}
- </td>
- </tr>
- </template>
- </el-table-column>
-
- <el-table-column label="出库量" align="center">
- <template slot-scope="scope">
- <span v-if="org_id == 3907 || org_id == 9583">{{ getAutoCount(scope.row.id) + getOutCount(scope.row.id) }}</span>
- <span v-if="org_id!=3907 && org_id!=9583">
- <tr style="background: none" v-for="(item,index) in scope.row.warehouse_out_info" :key="index">
- <td style="border-right: none; border-inline-end: none;text-align: center">
- <span style="color:#0099FF" @click="toDialogClick(scope.row.id,scope.row.good_name,scope.row.specification_name)"> {{getWareOutInfoCount(scope.row.warehouse_out_info,item.storehouse_id)}}</span>
- </td>
- </tr>
- </span>
- </template>
- </el-table-column>
-
- <el-table-column label="退库数量" align="center">
- <template slot-scope="scope">
- <tr style="background: none" v-for="(item,index) in scope.row.cancel_stock_info" :key="index">
- <td style="border-right: none; border-inline-end: none;text-align: center">
- {{getCancelCountInfo(scope.row.cancel_stock_info,item.storehouse_id)}}
- </td>
- </tr>
-
- </template>
- </el-table-column>
-
- <el-table-column label="实际出库" align="center">
- <template slot-scope="scope">
- <span v-if="org_id == 3907 || org_id == 9583">{{ getAutoCount(scope.row.id) + getOutCount(scope.row.id) }}</span>
- <span v-if="org_id!=3907 && org_id!=9583">
- <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
- <td style="border-right: none; border-inline-end: none;text-align: center">
- {{getWareInfoCount(scope.row.xt_warehouse_info,item.storehouse_id) - getWareInfoCountOne(scope.row.xt_warehouse_info,item.storehouse_id)}}
- </td>
- </tr>
- </span>
- </template>
- </el-table-column>
-
- <el-table-column label="剩余库存" align="center">
- <template slot-scope="scope">
- <span v-if="org_id == 3907 || org_id == 9583">
- {{
- getWareInfo(scope.row.xt_warehouse_info) -
- getAutoCount(scope.row.id) -
- getOutCount(scope.row.id) +
- getCancelCount(scope.row.id)
- }}
- </span>
- <span v-if="org_id!=3907 && org_id!=9583">
- <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
- <td style="border-right: none; border-inline-end: none;text-align: center">
- {{getWareInfoCountOne(scope.row.xt_warehouse_info,item.storehouse_id)}}
- </td>
- </tr>
- </span>
- </template>
- </el-table-column>
-
- <el-table-column label="总库存量" align="center">
- <template slot-scope="scope">
- <span v-if="org_id == 3907 || org_id == 9583">
- {{getWareInfo(scope.row.xt_warehouse_info) - getAutoCount(scope.row.id) -getOutCount(scope.row.id) +getCancelCount(scope.row.id)}}
- </span>
- <span v-if="org_id != 3907 && org_id != 9583">
- <span v-if="getOverFlushInfo(scope.row.xt_warehouse_info) <= scope.row.stock_warn_count" style="color:red"> {{getOverFlushInfo(scope.row.xt_warehouse_info)}}</span>
- <span v-if="getOverFlushInfo(scope.row.xt_warehouse_info) > scope.row.stock_warn_count"> {{getOverFlushInfo(scope.row.xt_warehouse_info)}}</span>
- </span>
- </template>
- </el-table-column>
-
- <el-table-column label="操作" align="center" width="200px">
-
- <template slot-scope="scope">
- <el-button
- size="small"
- type="primary"
- @click="toClick(scope.row)"
- >库存流水
- </el-button>
- <el-button
- size="small"
- type="primary"
- @click="toClickOne(scope.row)"
- >批次
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[10, 50, 100,200,500,1000]"
- :page-size="10"
- background
- align="right"
- style="margin-top:20px;"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- >
- </el-pagination>
- </div>
-
-
-
- <el-dialog
- title="出库详情"
- :visible.sync="dialogVisible"
- width="70%">
- <span>
- 耗材名称:{{good_name}}
- 规格&单位:{{specification_name}}
- 查询日期:
- <el-date-picker
- size="small"
- v-model="start_first_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="startFirstTimeChange"
- ></el-date-picker>
- <span>-</span>
- <el-date-picker
- size="small"
- v-model="end_first_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="endEndTimeChange"
- ></el-date-picker>
- </span>
- <el-divider></el-divider>
- <el-table
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266'
- }"
- :data="tableData"
- :class="signAndWeighBoxPatients"
- border
- >
- <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">
- {{getTime(scope.row.ctime)}}
- </template>
- </el-table-column>
- <el-table-column label="出库数量" align="center">
- <template slot-scope="scope">
- {{scope.row.count}}
- </template>
- </el-table-column>
- <el-table-column label="库存数量" align="center">
- <template slot-scope="scope">
-
- </template>
- </el-table-column>
- <el-table-column label="使用人" align="center">
- <template slot-scope="scope">
- {{getName(scope.row.patient_id)}}
- </template>
- </el-table-column>
- <el-table-column label="备注" align="center">
- <template slot-scope="scope">
- {{scope.row.remark}}
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="handleSizeChangeOne"
- @current-change="handleCurrentChangeOne"
- :page-sizes="[10, 50, 100,200,500,1000]"
- :page-size="10"
- background
- align="right"
- style="margin-top:20px;"
- layout="total, sizes, prev, pager, next, jumper"
- :total="totalone"
- >
- </el-pagination>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
- </span>
- </el-dialog>
-
- </div>
- </template>
- <script>
- import { getStorehouseList,getGoodNewQuery,getGoodWarehouseOutInfoById } from "@/api/drug/drug"
- import {
- getStockDrugCount
- } from "@/api/stock";
- import { uParseTime } from '@/utils/tools'
- export default {
-
- data(){
- return{
- tableList:[],
- goodList:[
- {id:1,name:"全部耗材"},
- {id:2,name:"库存预警"},
- ],
- houseList:[],
- storehouse_id:0,
- good_type:1,
- multipleSelection: [],
- signAndWeighBoxPatients: "sign-and-weigh-box-patients",
- manufacturerList:[],
- limit:10,
- page:1,
- total:0,
- limitone:10,
- pageone:1,
- totalone:0,
- keyword:"",
- goodTypeList:[],
- start_time:"",
- end_time:"",
- countList:[],
- outCountList:[],
- autoCountList:[],
- cancelCountList:[],
- org_id:this.$store.getters.xt_user.org_id,
- dialogVisible:false,
- start_first_time:"",
- end_first_time:"",
- tableData:[],
- good_id:0,
- patientList:[],
- good_name:"",
- specification_name:"",
- loading:false,
- }
-
- },
- methods:{
- changeStorehouseName(){
-
- },
- changeGoodName(){
- this.getlist()
- },
- toClick(val){
- var manufacturer_name = ""
- var specification_name = ""
- for(let i=0;i<this.manufacturerList.length;i++){
- if(val.manufacturer == this.manufacturerList[i].id){
- manufacturer_name = this.manufacturerList[i].manufacturer_name
- }
- }
- specification_name = val.specification_name + "/" + val.packing_unit
- var overCount = this.getOverplus(val.xt_warehouse_info)
- // window.sessionStorage.setItem('start_time',this.start_time)
- // window.sessionStorage.setItem('end_time',this.end_time)
- this.$router.push({path:"/stock/in/stockflow?id="+val.id+"&manufacturer="+manufacturer_name+"&packing_unit="+val.packing_unit+"&overCount="+overCount})
- },
- toClickOne(val){
-
- var manufacturer_name = ""
- var specification_name = ""
- for(let i=0;i<this.manufacturerList.length;i++){
- if(val.manufacturer == this.manufacturerList[i].id){
- manufacturer_name = this.manufacturerList[i].manufacturer_name
- }
- }
- specification_name = val.specification_name + "/" + val.packing_unit
- var overCount = this.getOverplus(val.xt_warehouse_info)
- // window.sessionStorage.setItem('start_time',this.start_time)
- // window.sessionStorage.setItem('end_time',this.end_time)
- this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.id+"&manufacturer="+manufacturer_name+"&packing_unit="+val.packing_unit+"&overCount="+overCount})
- },
-
- getStorehouseList(){
- getStorehouseList().then(response=>{
- if(response.data.state == 1){
- var houseList = response.data.data.list
- var obj = {id:0,storehouse_name:"全部"}
- this.houseList.push(obj)
- for(let i=0;i<houseList.length;i++){
- this.houseList.push(houseList[i])
- }
- this.manufacturerList = response.data.data.manufacturerList
- this.goodTypeList = response.data.data.goodTypeList
- this.patientList = response.data.data.patientList
- }
- })
- },
- getlist(){
- this.loading = true
- var params = {
- storehouse_id:this.storehouse_id,
- good_type:this.good_type,
- keyword:this.keyword,
- page:this.page,
- limit:this.limit,
- start_time:this.start_time,
- end_time:this.end_time,
- }
- getGoodNewQuery(params).then(response=>{
- if(response.data.state == 1){
- var list = response.data.data.list
- this.loading = false
- if(list.length > 0){
- var arr = []
- for(let i=0;i<list.length;i++){
- if(list[i].xt_warehouse_info.length > 0){
- arr.push(list[i])
- }
- }
- this.tableList = arr
- }
- this.total = response.data.data.total
-
- }
- })
- },
- getManufacturName(id){
- var manufacturer_name = ""
- for(let i=0;i<this.manufacturerList.length;i++){
- if(id == this.manufacturerList[i].id){
- manufacturer_name = this.manufacturerList[i].manufacturer_name
- }
- }
- return manufacturer_name
- },
- handleSizeChange(val) {
- this.limit = val;
- this.getlist()
- },
- handleCurrentChange(val) {
- this.page = val;
- this.getlist()
- },
- handleSizeChangeOne(val) {
- this.limitone = val;
- this.toDialogClick(this.good_id,this.good_name,this.specification_name)
- },
- handleCurrentChangeOne(val) {
- this.pageone = val;
- this.toDialogClick(this.good_id,this.good_name,this.specification_name)
- },
- seach(){
- this.getlist()
- },
- getGoodTypeName(id){
- var type_name = ""
- for(let i=0;i<this.goodTypeList.length;i++){
- if(id == this.goodTypeList[i].id){
- type_name = this.goodTypeList[i].type_name
- }
- }
- return type_name
- },
- 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
- },
- getWareInfoCount(val,storehouse_id){
- var count = 0
- if(val.length > 0){
- for(let i=0;i<val.length;i++){
- if(val[i].storehouse_id == storehouse_id){
- count +=val[i].warehousing_count
- }
- }
- }
- if(count > 0){
- return count
- }else{
- return ""
- }
- },
- getStockDrugCount(){
- var params ={
- keywords: this.keywords,
- start_time:this.start_time,
- end_time:this.end_time,
- }
- getStockDrugCount(params).then(response=>{
- if(response.data.state == 1){
- var outlist = response.data.data.outList
- this.outCountList = outlist
- var autoCount = response.data.data.autoCount
- this.autoCountList = autoCount
- var totalCount = response.data.data.totalCount
- this.cancelCountList = totalCount
- }
- })
- },
- getWareInfoCountOne(val,storehouse_id){
- var count = 0
- if(val.length > 0){
- for(let i=0;i<val.length;i++){
- if(val[i].storehouse_id == storehouse_id){
- count +=val[i].stock_count
- }
- }
- }
- if(count > 0){
- return count
- }else{
- return ""
- }
- },
- getOutCount(id){
- var count = 0
- for(let i=0;i<this.outCountList.length;i++){
- if(id == this.outCountList[i].good_id){
- count = this.outCountList[i].count
- }
- }
- return count
- },
- getAutoCount(id){
- var count= 0
- for(let i=0;i<this.autoCountList.length;i++){
- if(id == this.autoCountList[i].good_id){
- count = this.autoCountList[i].count
- }
- }
- return count
- },
- getCancelCount(id){
- var count = 0
- for(let i=0;i<this.cancelCountList.length;i++){
- if(id == this.cancelCountList[i].good_id){
- count = this.cancelCountList[i].count
- }
- }
- return count
- },
- getCancelCountInfo(cancel_stock_info,storehouse_id){
- var count = 0
- if(cancel_stock_info.length >0){
- for(let i=0;i<cancel_stock_info.length;i++){
- if(storehouse_id == cancel_stock_info[i].storehouse_id){
- count += cancel_stock_info[i].count
- }
- }
- }
- return count
- },
- getWareOutInfoCount(warehouse_out_info,storehouse_id){
- var count = 0
- if(warehouse_out_info.length > 0){
- for(let i=0;i<warehouse_out_info.length;i++){
- if(storehouse_id == warehouse_out_info[i].storehouse_id){
- count +=warehouse_out_info[i].count
- }
- }
- }
- return count
- },
- getInCount(id){
- var count= 0
- for(let i=0;i<this.countList.length;i++){
- if(id == this.countList[i].good_id){
- count = this.countList[i].count
- }
- }
- return count
- },
- getOutCount(id){
- var count = 0
- for(let i=0;i<this.outCountList.length;i++){
- if(id == this.outCountList[i].good_id){
- count = this.outCountList[i].count
- }
- }
- return count
- },
- getAutoCount(id){
- var count= 0
- for(let i=0;i<this.autoCountList.length;i++){
- if(id == this.autoCountList[i].good_id){
- count = this.autoCountList[i].count
- }
- }
- return count
- },
- getCancelCount(id){
- var count = 0
- for(let i=0;i<this.cancelCountList.length;i++){
- if(id == this.cancelCountList[i].good_id){
- count = this.cancelCountList[i].count
- }
- }
- return count
- },
- getStockCount(id){
- var stock_count = 0
- for(let i=0;i<this.countList.length;i++){
- if(id == this.countList[i].good_id){
- stock_count = this.countList[i].stock_count
- }
- }
- return stock_count
- },
- getWareInfo(arr){
- var total = 0
- if(arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total += parseInt(arr[i].warehousing_count)
- }
- }else{
- total = ""
- }
- return total
- },
- getOverplus(arr){
- var total = 0
- if(arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total += arr[i].stock_count
- }
- }else{
- total = ""
- }
- return total
- },
- getCancelInfo(arr){
- var total = 0
- if(arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total += arr[i].count
- }
- }else{
- total = ""
- }
- return total
- },
- getOverFlushInfo(arr){
- var total = 0
- if(arr.length >0){
- for(let i=0;i<arr.length;i++){
- total += arr[i].stock_count
- }
- }
- return total
- },
- toDialogClick(id,good_name,specification_name){
- this.good_id = id
- this.good_name = good_name
- this.specification_name = specification_name
- var params = {
- good_id:id,
- limit:this.limitone,
- page:this.pageone,
- start_first_time:this.start_first_time,
- end_first_time:this.end_first_time,
- }
- getGoodWarehouseOutInfoById(params).then(response=>{
- if(response.data.state == 1){
- var list = response.data.data.list
- console.log("list23233233232w",list)
- this.tableData = list
- this.totalone = response.data.data.total
- this.dialogVisible = true
- }
- })
-
- },
- startFirstTimeChange(){
-
- },
- endEndTimeChange(){
-
- },
- getTime(val) {
- if(val < 0){
- return ""
- }
- if(val == ""){
- return ""
- }else {
- return uParseTime(val, '{y}-{m}-{d}')
- }
- },
- getName(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
- }
- },
- created(){
- this.getStorehouseList()
- this.getlist()
- this.getStockDrugCount()
- }
- }
- </script>
-
|