12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631 |
- <template>
- <div class="main-contain">
- <div class="app-container "
- style="padding-left:0px;margin:0px;" v-loading="loading"
- element-loading-text="拼命加载中">
- <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
- <div>
- <span style="font-size:14px;color:#606266">操作时间:</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"
- :picker-options="pickerOptions"
- :clearable="false"
- ></el-date-picker>
- <span>-</span>
- <el-date-picker
- size="small"
- v-model="end_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"
- :picker-options="pickerOptions"
- :clearable="false"
- ></el-date-picker>
- <el-button type="primary" icon="el-icon-search" @click="getDrugQuery">查询</el-button>
- <span style="font-size:14px;color:#606266">药品类型:</span>
- <el-select v-model="good_type" style="width:200px;margin-right:10px;" placeholder="请选择"
- filterable
- @change="changeGoodTypeName">
- <el-option
- v-for="item in drugTypeList"
- :key="item.value"
- :label="item.name"
- :value="item.value">
- </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-button type="primary" @click="toOverCount">调试</el-button> -->
- <el-button type="primary" @click="toPrint">打印</el-button>
- <el-button type="primary" @click="exportList">导出</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">
- {{getDrugTypeName(scope.row.drug_type)}}
- </template>
- </el-table-column>
- <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">
- {{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">
- {{getManufacturName(scope.row.manufacturer)}}
- </template>
- </el-table-column>
- <el-table-column label="经销商" align="center">
- <template slot-scope="scope">
- {{getDearName(scope.row.dealer)}}
- </template>
- </el-table-column>
- <el-table-column label="期初结余" align="center">
-
- <el-table-column prop="drugIn" label="数量" width="100" align="center">
-
- </el-table-column>
-
- <el-table-column prop="drugInMoney" label="进货金额" width="100" align="center">
-
- </el-table-column>
- <el-table-column prop="drugSaleMoney" label="销售金额" width="100" align="center">
-
- </el-table-column>
-
- </el-table-column>
- <el-table-column label="本期增加" align="center">
-
- <el-table-column prop="drugAdd" label="数量" width="100" align="center">
-
- </el-table-column>
-
- <el-table-column prop="drugAddPrice" label="进货金额" width="100" align="center">
-
- </el-table-column>
- <el-table-column prop="drugAddSalePrice" label="销售金额" width="100" align="center">
- </el-table-column>
-
- </el-table-column>
-
- <el-table-column label="本期减少" align="center">
- <el-table-column prop="drugOut" label="数量" width="100" align="center">
- </el-table-column>
- <el-table-column prop="drugOutPrice" label="进货金额" width="100" align="center">
- </el-table-column>
- <el-table-column prop="drugOutSalePrice" label="销售金额" width="100" align="center">
- </el-table-column>
- </el-table-column>
-
- <el-table-column label="期末结余" align="center">
- <el-table-column prop="overDrug" label="数量" width="100" align="center">
- </el-table-column>
- <el-table-column prop="overDrugPrice" label="进货金额" width="100" align="center">
- </el-table-column>
- <el-table-column prop="oveDrugSaleMoney" label="销售金额" width="100" align="center">
- </el-table-column>
- </el-table-column>
-
-
- </el-table>
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[10, 50, 100,200,300,400,500,1000]"
- :page-size="10"
- background
- align="right"
- style="margin-top:20px;"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- >
- </el-pagination>
- </div>
-
-
-
-
-
- </div>
- </template>
- <script>
- import { getStorehouseList,getPurchaseNewDrugQuery,getDrugOverCount } from "@/api/drug/drug"
- const moment = require('moment')
- import { uParseTime } from '@/utils/tools'
- export default {
-
- data(){
- return{
- tableList:[],
- goodList:[
- {id:1,name:"全部药品"},
- {id:2,name:"库存预警"},
- ],
- houseList:[],
- storehouse_id:0,
- good_type:0,
- multipleSelection: [],
- signAndWeighBoxPatients: "sign-and-weigh-box-patients",
- manufacturerList:[],
- limit:10,
- page:1,
- total:0,
- keyword:"",
- drugTypeList:[],
- 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,
- pickerOptions:{ //禁用当前日期之前的日期
- disabledDate(v) {
- return v.getTime() < 1667491200000
- },
- },
- dealerList:[]
- }
-
- },
- methods:{
- changeStorehouseName(){
-
- },
- changeGoodTypeName(){
- this.drugTypeList = []
- this.getlist()
- },
- 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.patientList = response.data.data.patientList
- this.dealerList = response.data.data.dealerList
- }
- })
- },
- getlist(){
- this.loading = true
- var params = {
- good_type:this.good_type,
- keyword:this.keyword,
- page:this.page,
- limit:this.limit,
- start_time:this.start_time,
- end_time:this.end_time,
- }
- getPurchaseNewDrugQuery(params).then(response=>{
- if(response.data.state == 1){
- this.loading = false
- var list = response.data.data.list
- for (let i = 0; i < list.length; i++) {
-
- //期初结余入库
- if(list[i].DrugWarehouseInfoStart!=null && list[i].DrugWarehouseInfoStart.length > 0){
- for(let j=0;j<list[i].DrugWarehouseInfoStart.length;j++){
- if(list[i].max_unit == list[i].DrugWarehouseInfoStart[j].max_unit){
- list[i].DrugWarehouseInfoStart[j].count =list[i].min_number * list[i].DrugWarehouseInfoStart[j].count
- }
- }
- }
-
- //期初结余出库
- if(list[i].DrugWarehouseOutInfoStart!=null && list[i].DrugWarehouseOutInfoStart.length>0){
- for(let j=0;j<list[i].DrugWarehouseOutInfoStart.length;j++){
- if(list[i].max_unit == list[i].DrugWarehouseOutInfoStart[j].max_unit){
- list[i].DrugWarehouseOutInfoStart[j].count = list[i].DrugWarehouseOutInfoStart[j].count*list[i].min_number
- }
- }
- }
-
- //期初结余退库
- if(list[i].WareStartStockCancelInfo!=null && list[i].WareStartStockCancelInfo.length>0){
- for(let j=0;j<list[i].WareStartStockCancelInfo.length;j++){
- if(list[i].max_unit == list[i].WareStartStockCancelInfo[j].max_unit){
- list[i].WareStartStockCancelInfo[j].count = list[i].WareStartStockCancelInfo[j].count*list[i].min_number
- }
- }
- }
-
-
- //期末结余入库
- if(list[i].DrugWarehouseInfoEnd!=null && list[i].DrugWarehouseInfoEnd.length > 0){
- for(let j=0;j<list[i].DrugWarehouseInfoEnd.length;j++){
- if(list[i].max_unit == list[i].DrugWarehouseInfoEnd[j].max_unit){
- list[i].DrugWarehouseInfoEnd[j].count = list[i].min_number * list[i].DrugWarehouseInfoEnd[j].count
- }
- }
- }
-
- //期末结余出库
- if(list[i].DrugWarehouseOutInfoEnd!=null && list[i].DrugWarehouseOutInfoEnd.length>0){
- for(let j=0;j<list[i].DrugWarehouseOutInfoEnd.length;j++){
- if(list[i].max_unit == list[i].DrugWarehouseOutInfoEnd[j].max_unit){
- list[i].DrugWarehouseOutInfoEnd[j].count = list[i].DrugWarehouseOutInfoEnd[j].count*list[i].min_number
- }
- }
- }
-
- //期末结余退库
- if(list[i].WareEndStockCancelInfo!=null && list[i].WareEndStockCancelInfo.length>0){
- for(let j=0;j<list[i].WareEndStockCancelInfo.length;j++){
- if(list[i].max_unit == list[i].WareEndStockCancelInfo[j].max_unit){
- list[i].WareEndStockCancelInfo[j].count = list[i].WareEndStockCancelInfo[j].count*list[i].min_number
- }
- }
- }
-
- //期中增加
- if(list[i].DrugWarehouseInfoStartEnd!=null && list[i].DrugWarehouseInfoStartEnd.length > 0){
- for(let j=0;j<list[i].DrugWarehouseInfoStartEnd.length;j++){
- if(list[i].max_unit == list[i].DrugWarehouseInfoStartEnd[j].max_unit){
- list[i].DrugWarehouseInfoStartEnd[j].count =list[i].min_number * list[i].DrugWarehouseInfoStartEnd[j].count
- }
- }
- }
-
- //期中减少
- if(list[i].DrugWarehouseOutInfoStartEnd!=null && list[i].DrugWarehouseOutInfoStartEnd.length > 0){
- for(let j=0;j<list[i].DrugWarehouseOutInfoStartEnd.length;j++){
- if(list[i].max_unit == list[i].DrugWarehouseOutInfoStartEnd[j].max_unit){
- list[i].DrugWarehouseOutInfoStartEnd[j].count =list[i].min_number * list[i].DrugWarehouseOutInfoStartEnd[j].count
- }
- }
- }
-
- //期中退库
- if(list[i].WareStartEndStockCancelInfo!=null && list[i].WareStartEndStockCancelInfo.length > 0){
- for(let j=0;j<list[i].WareStartEndStockCancelInfo.length;j++){
- if(list[i].max_unit == list[i].WareStartEndStockCancelInfo[j].max_unit){
- list[i].WareStartEndStockCancelInfo[j].count =list[i].min_number * list[i].WareStartEndStockCancelInfo[j].count
- }
- }
- }
-
-
-
- //期初盘盈
- if(list[i].WareStartStockInventoryProfit!=null && list[i].WareStartStockInventoryProfit.length > 0){
- for(let j=0;j<list[i].WareStartStockInventoryProfit.length;j++){
- if(list[i].max_unit == list[i].WareStartStockInventoryProfit[j].max_unit){
- list[i].WareStartStockInventoryProfit[j].count = list[i].WareStartStockInventoryProfit[j].count * list[i].min_number
- }
- }
- }
-
- //期初盘亏
- if(list[i].WareStartStockInventoryLosses!=null && list[i].WareStartStockInventoryLosses.length > 0){
- for(let j=0;j<list[i].WareStartStockInventoryLosses.length;j++){
- if(list[i].max_unit == list[i].WareStartStockInventoryLosses[j].max_unit){
- list[i].WareStartStockInventoryLosses.count = list[i].WareStartStockInventoryLosses[j].count * list[i].min_number
- }
- }
- }
-
-
-
- //期中盘盈
- if(list[i].WareStartEndStockInventoryProfit!=null && list[i].WareStartEndStockInventoryProfit.length > 0){
- for(let j=0;j<list[i].WareStartEndStockInventoryProfit.length;j++){
- if(list[i].max_unit == list[i].WareStartEndStockInventoryProfit[j].max_unit){
- list[i].WareStartEndStockInventoryProfit[j].count = list[i].WareStartEndStockInventoryProfit[j].count * list[i].min_number
- }
- }
- }
-
- //期中盘亏
- if(list[i].WareStartEndStockInventoryLosses!=null && list[i].WareStartEndStockInventoryLosses.length > 0){
- for(let j=0;j<list[i].WareStartEndStockInventoryLosses.length;j++){
- if(list[i].max_unit == list[i].WareStartEndStockInventoryLosses[j].max_unit){
- list[i].WareStartEndStockInventoryLosses[j].count = list[i].WareStartEndStockInventoryLosses[j].count * list[i].min_number
- }
- }
- }
- //期末盘盈
- if(list[i].WareEndStockInventoryProfit!=null && list[i].WareEndStockInventoryProfit.length >0){
- for(let j=0;j<list[i].WareEndStockInventoryProfit.length;j++){
- if(list[i].max_unit == list[i].WareEndStockInventoryProfit[j].max_unit){
- list[i].WareEndStockInventoryProfit[j].count = list[i].WareEndStockInventoryProfit[j].count * list[i].min_number
- }
- }
- }
- //期末盘亏
- if(list[i].WareEndStockInventoryLosses!=null && list[i].WareEndStockInventoryLosses.length > 0){
- for(let j=0;j<list[i].WareEndStockInventoryLosses.length;j++){
- if(list[i].max_unit == list[i].WareEndStockInventoryLosses[j].max_unit){
- list[i].WareEndStockInventoryLosses[j].count = list[i].WareEndStockInventoryLosses[j].count * list[i].min_number
- }
- }
- }
-
- if(this.org_id !=10210 && this.org_id!=0 && this.org_id !=10402 && this.org_id !=10215){
-
- // 新版
- if(list[i].new_drug_in_flow_info!=null && list[i].new_drug_in_flow_info.length>0){
- for(let j=0;j<list[i].new_drug_in_flow_info.length;j++){
- if(list[i].max_unit == list[i].new_drug_in_flow_info[j].max_unit){
- list[i].new_drug_in_flow_info[j].count = list[i].new_drug_in_flow_info[j].count * list[i].min_number
- }
- }
- }
-
- if(list[i].new_drug_cancel_flow_info!=null && list[i].new_drug_cancel_flow_info.length>0){
- for(let j=0;j<list[i].new_drug_cancel_flow_info.length;j++){
- if(list[i].max_unit == list[i].new_drug_cancel_flow_info[j].max_unit){
- list[i].new_drug_cancel_flow_info[j].count = list[i].new_drug_cancel_flow_info[j].count * list[i].min_number
- }
- }
- }
-
- if(list[i].new_drug_no_profit_flow_info!=null && list[i].new_drug_no_profit_flow_info.length>0){
- for(let j=0;j<list[i].new_drug_no_profit_flow_info.length;j++){
- if(list[i].max_unit == list[i].new_drug_no_profit_flow_info[j].max_unit){
- list[i].new_drug_no_profit_flow_info[j].count = list[i].new_drug_no_profit_flow_info[j].count * list[i].min_number
- }
- }
- }
-
- if(list[i].new_drug_out_flow_info!=null && list[i].new_drug_out_flow_info.length>0){
- for(let j=0;j<list[i].new_drug_out_flow_info.length;j++){
- if(list[i].max_unit == list[i].new_drug_out_flow_info[j].max_unit){
- list[i].new_drug_out_flow_info[j].count = list[i].new_drug_out_flow_info[j].count * list[i].min_number
- }
- }
- }
-
- if(list[i].new_drug_profit_flow_info!=null && list[i].new_drug_profit_flow_info.length>0){
- for(let j=0;j<list[i].new_drug_profit_flow_info.length;j++){
- if(list[i].max_unit == list[i].new_drug_profit_flow_info[j].max_unit){
- list[i].new_drug_profit_flow_info[j].count = list[i].new_drug_profit_flow_info[j].count * list[i].min_number
- }
- }
- }
-
-
- }
-
- }
-
- console.log("list23323223322332232323322323wode",list)
- for(let i=0;i<list.length;i++){
- list[i].last_price_in = 0
- list[i].drugAddOne= 0
- list[i].drugOutOne =0
-
- if(this.org_id ==10210 || this.org_id ==10402 || this.org_id ==10215 || this.org_id == 0 || this.org_id ==10191){
- list[i].drugIn = this.GetDrugStartFlow(list[i].DrugStatFlow.over_count,list[i].min_number,list[i].min_unit,list[i].max_unit)
- }else{
- list[i].drugIn = this.GetInitStartFlow(list[i].new_drug_in_flow_info,list[i].new_drug_profit_flow_info,list[i].new_drug_out_flow_info,list[i].new_drug_no_profit_flow_info,list[i].new_drug_cancel_flow_info,list[i].min_number,list[i].min_unit,list[i].max_unit)
- }
-
-
-
- list[i].over_count_one = this.GetInitStartFlowOne(list[i].new_drug_in_flow_info,list[i].new_drug_profit_flow_info,list[i].new_drug_out_flow_info,list[i].new_drug_no_profit_flow_info,list[i].new_drug_cancel_flow_info,list[i].min_number,list[i].min_unit,list[i].max_unit)
- list[i].drugInMoney = list[i].last_price
- if(this.org_id == 0 || this.org_id == 10697){
- list[i].drugSaleMoney = (list[i].over_count_one * list[i].last_price).toFixed(2)
- }else{
- list[i].drugSaleMoney = "/"
- }
-
-
- list[i].drugAdd = this.drugAddInfo(list[i].DrugWarehouseInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryProfit)
- list[i].drugAddOne = this.drugAddInfoOne(list[i].DrugWarehouseInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryProfit)
-
- if(this.org_id == 0 || this.org_id == 10697){
- list[i].drugAddPrice = list[i].last_price
- list[i].drugAddSalePrice = (list[i].last_price *list[i].drugAddOne).toFixed(2)
- }else{
- list[i].drugAddPrice = "/"
- list[i].drugAddSalePrice = "/"
- }
-
-
- list[i].drugOut= this.getDrugOut(list[i].DrugWarehouseOutInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryLosses,list[i].WareStartEndStockCancelInfo)
- list[i].drugOutOne =this.getDrugOutOne(list[i].DrugWarehouseOutInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryLosses,list[i].WareStartEndStockCancelInfo)
-
- if(this.org_id == 0 || this.org_id == 10697){
- list[i].drugOutPrice = list[i].retail_price
- list[i].drugOutSalePrice = (list[i].drugOutOne * list[i].retail_price).toFixed(2)
- }else{
- list[i].drugOutPrice = "/"
- list[i].drugOutSalePrice = "/"
- }
-
-
-
- if(this.org_id == 10265 || this.org_id ==10210 || this.org_id==10402 || this.org_id ==10215){
- list[i].overDrug = this.GetDrugEndFlow(list[i].DrugEndFlow.over_count,list[i].min_number,list[i].min_unit,list[i].max_unit)
- }else{
- list[i].overDrug = this.GetDrugOver(list[i].over_count_one,list[i].drugAddOne,list[i].drugOutOne,list[i].min_number,list[i].min_unit,list[i].max_unit)
- }
-
- list[i].overDrugOne = this.GetDrugOverOne(list[i].over_count_one,list[i].drugAddOne,list[i].drugOutOne,list[i].min_number,list[i].min_unit,list[i].max_unit)
- if(this.org_id == 0 || this.org_id == 10697){
- list[i].overDrugPrice = list[i].retail_price
- list[i].oveDrugSaleMoney = (list[i].overDrugOne * list[i].retail_price).toFixed(2)
- }else{
- list[i].overDrugPrice = "/"
- list[i].oveDrugSaleMoney = "/"
- }
-
- }
- this.tableList = list;
- this.total = response.data.data.total
- this.manufacturerList = response.data.data.manufacturerList
- var drugTypeList = response.data.data.drugTypeList
- var obj = {value:0,name:"全部"}
- this.drugTypeList.push(obj)
- for(let i=0;i<drugTypeList.length;i++){
- this.drugTypeList.push(drugTypeList[i])
- }
-
- }
- })
- },
- 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.drugTypeList = []
- this.limit = val;
- this.getlist()
- },
- handleCurrentChange(val) {
- this.page = val;
- this.drugTypeList = []
- this.getlist()
- },
- seach(){
- this.drugTypeList = []
- this.houseList= []
- this.getlist()
- },
- getDrugTypeName(id){
- var type_name = ""
- for(let i=0;i<this.drugTypeList.length;i++){
- if(id == this.drugTypeList[i].value){
- type_name = this.drugTypeList[i].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
- },
- 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
- },
- endTimeChange(){
- this.drugTypeList = []
- this.getlist()
- },
- startTimeChange(){
- this.drugTypeList = []
- this.getlist()
- },
- getDrugWarehouseInfoOne(arr,min_number,min_unit,max_unit,arr2,arr3,arr4,arr5){
- var total = 0
- var totalOne =0
- var totalTwo = 0
- var totalthree= 0
- var totalfour = 0
- var totalfive = 0
- var max_str = "";
- var min_str = "";
- if(arr!=null && arr.length > 0){
- for(let i=0;i<arr.length;i++){
- totalOne += arr[i].count
- }
- }
- if(arr2!=null && arr2.length > 0){
- for(let i=0;i<arr2.length;i++){
- totalTwo += arr2[i].count
- }
- }
- if(arr3!=null && arr3.length > 0){
- for(let i=0;i<arr3.length;i++){
- totalthree += arr3[i].count
- }
- }
- if(arr4!=null && arr4.length > 0){
- for(let i=0;i<arr4.length;i++){
- totalfour += arr4[i].count
- }
- }
-
- if(arr5!=null && arr5.length > 0){
- for(let i=0;i<arr5.length;i++){
- totalfive += arr5[i].count
- }
- }
- // console.log("totalONE223323232323232",totalOne)
- // console.log("totalTwo2oo2o32o3o32o23",totalTwo)
- // console.log("totalfive",totalfive)
- // console.log("00-------------------------")
- total = totalOne - totalTwo + totalthree - totalfour + totalfive
- if (total < min_number) {
- min_str = total + min_unit;
- }
- if (total == 0) {
- min_str = "";
- max_str = "";
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number) + max_unit;
- }
- if (total % min_number != 0) {
- min_str = (total % min_number) + min_unit;
- }
- }
- console.log("max_str",max_str)
- console.log("min_str",min_str)
- if(max_str == "" && min_str == ""){
- return "0"
- }else{
- return max_str + min_str
- }
-
-
- },
- getDrugWarehouseInfo(arr,arr4,min_number,min_unit,max_unit,arr2,arr3,arr5){
- var total = 0
- var total_one= 0
- var total_two = 0
- var total_three = 0
- var total_four = 0
- var total_five = 0
- var max_str = "";
- var min_str = "";
- if(arr!=null && arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total_one += arr[i].count
- }
- }
- if(arr4!=null && arr4.length > 0){
- for(let i=0;i<arr4.length;i++){
- total_four += arr4[i].count
- }
- }
- if(arr2!=null && arr2.length > 0){
- for(let i=0;i<arr2.length;i++){
- total_two+= arr2[i].count
- }
- }
- if(arr3!=null && arr3.length >0){
- for(let i=0;i<arr3.length;i++){
- total_three +=arr3[i].count
- }
- }
-
- if(arr5!=null && arr5.length >0){
- for(let i=0;i<arr5.length;i++){
- total_five +=arr5[i].count
- }
- }
-
- total = total_one - total_four +total_two - total_three + total_five
- if(total < 0){
- total = 0
- }
- if (total < min_number) {
- min_str = total + min_unit;
- }
- if (total == 0) {
- min_str = "";
- max_str = "";
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number) + max_unit;
- }
- if (total % min_number != 0) {
- min_str = (total % min_number) + min_unit;
- }
- }
- if(max_str == "" && min_str == ""){
- return "0"
- }else{
- return max_str + min_str;
- }
-
- },
- getDrugWarehouseInfoStart(arr,min_number,min_unit,max_unit,outArr){
- var total = 0
- var add_total = 0
- var out_total = 0
- var max_str = "";
- var min_str = "";
- if(arr!=null &&arr.length > 0){
- for(let i=0;i<arr.length;i++){
- add_total += arr[i].warehousing_count
- }
- }
- if(outArr.length > 0){
- for(let i=0;i<outArr.length;i++){
- out_total+= outArr[i].count
- }
- }
- total = add_total - out_total
- if (total < min_number) {
- min_str = total + min_unit;
- }
- if (total == 0) {
- min_str = "";
- max_str = "";
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number) + max_unit;
- }
- if (total % min_number != 0) {
- min_str = (total % min_number) + min_unit;
- }
- }
- return max_str + min_str;
-
- },
- getDrugWarehouseInfoMoneyStart(arr,min_number,min_unit,max_unit,last_price,outArr){
- var total = 0
- var min_str = 0
- var max_str = 0
- var addTotal = 0
- var outTotal = 0
- var total_price = 0
- if(arr.length > 0){
- for(let i=0;i<arr.length;i++){
- addTotal += arr[i].warehousing_count
- }
- }
- if(outArr.length > 0){
- for(let i=0;i<outArr.length;i++){
- outTotal += outArr[i].count
- }
- }
-
- total = addTotal - outTotal
- if (total < min_number) {
- min_str = total
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number);
- }
- if (total % min_number != 0) {
- min_str = (total % min_number);
- }
- }
-
- total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
-
- return total_price
- },
- getDrugWarehouseInfoMoney(arr,min_number,min_unit,max_unit,last_price){
- var total = 0
- var min_str = 0
- var max_str = 0
- var total_price = 0
- if(arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total += arr[i].stock_max_number + arr[i].stock_min_number
- }
- }
- if (total < min_number) {
- min_str = total
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number);
- }
- if (total % min_number != 0) {
- min_str = (total % min_number);
- }
- }
-
- total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
-
- return total_price
- },
- getDrugWarehouseInfoStockAdd(arr,min_number,min_unit,max_unit){
-
- var total = 0
- var max_str = "";
- var min_str = "";
- if(arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total += arr[i].warehousing_count
- }
- }
- if (total < min_number) {
- min_str = total + min_unit;
- }
- if (total == 0) {
- min_str = "";
- max_str = "";
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number) + max_unit;
- }
- if (total % min_number != 0) {
- min_str = (total % min_number) + min_unit;
- }
- }
- return max_str + min_str;
- },
- getDrugWarehouseInfoaddMoney(arr,min_number,min_unit,max_unit,last_price){
- var total = 0
- var min_str = 0
- var max_str = 0
- var total_price = 0
- if(arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total += arr[i].warehousing_count
- }
- }
- if (total < min_number) {
- min_str = total
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number);
- }
- if (total % min_number != 0) {
- min_str = (total % min_number);
- }
- }
-
- total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
- return total_price
- },
- getDrugInMoneyOne(arr,min_number,min_unit,max_unit,arr2,arr3,arr4,arr5){
-
- var totalOne = 0
- var totalTwo =0
- var total_three = 0
- var total_four = 0
- var totalFive = 0
- var total_price = 0
- if(arr!=null&&arr.length > 0){
- for(let i=0;i<arr.length;i++){
- totalOne += (arr[i].count/min_number*arr[i].price) + arr[i].count*(arr[i].price%min_number)
- }
- }
-
- if(arr2!=null&&arr2.length > 0){
- for(let i=0;i<arr2.length;i++){
- totalTwo += ((arr2[i].count/min_number) * arr2[i].price) + ((arr2[i].count%min_number)*(arr2[i].price/min_number))
- }
- }
-
-
- if(arr3!=null&&arr3.length > 0){
- for(let i=0;i<arr3.length;i++){
- total_three+=arr3[i].count* arr3[i].xt_drug_warehouse_info.retail_price
- }
- }
-
- if(arr4!=null&&arr4.length > 0){
- for(let i=0;i<arr4.length;i++){
- total_four+=arr4[i].count * arr4[i].xt_drug_warehouse_info.retail_price
- }
- }
-
- if(arr5!=null&&arr5.length > 0){
- for(let i=0;i<arr5.length;i++){
- totalFive += ((arr5[i].count/min_number) * arr5[i].price) + ((arr5[i].count%min_number)*(arr5[i].price/min_number))
- }
- }
-
- total_price =(totalOne - totalTwo + total_three - total_four + totalFive).toFixed(2)
-
- if(total_price >0){
- return total_price
- }else{
- return "0.00"
- }
-
- },
- getDrugInMoney(arr,arr4,min_number,min_unit,max_unit,arr2,arr3,arr5){
-
- var total_price = 0
- var total_one_price = 0
- var total_two_price = 0
- var total_four_price =0
- var total_three_price = 0
- var total_five_price = 0
- if(arr!=null&&arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total_one_price += arr[i].count * (arr[i].price/min_number) + arr[i].count * (arr[i].price%min_number)
- }
- }
-
- if(arr4!=null && arr4.length > 0){
- for(let i=0;i<arr4.length;i++){
- // total_four_price +=arr4[i].count * arr4[i].xt_drug_warehouse_info.price/min_number
- total_four_price+= ((arr4[i].count/min_number) * arr4[i].price) + ((arr4[i].count%min_number)*(arr4[i].price/min_number))
- }
- }
-
- if(arr2!=null && arr2.length > 0){
- for(let i=0;i<arr2.length;i++){
- total_two_price += arr2[i].count * arr2[i].xt_drug_warehouse_info.price/min_number
- }
- }
-
- if(arr3!=null && arr3.length > 0){
- for(let i=0;i<arr3.length;i++){
- total_three_price += arr3[i].count * arr3[i].xt_drug_warehouse_info.price/min_number
- }
- }
-
- if(arr5!=null && arr5.length > 0){
- for(let i=0;i<arr5.length;i++){
- total_five_price += arr5[i].count * arr5[i].xt_drug_warehouse_info.price/min_number
- }
- }
-
- total_price = total_one_price - total_four_price + total_two_price - total_three_price + total_five_price
- if(total_price > 0){
- return total_price.toFixed(2)
- }else{
- return "0.00"
- }
- },
- getSaleMoney(arr,arr4,min_number,min_unit,max_unit,arr2,arr3,arr5){
-
- var total_price = 0
- var total_price_one = 0
- var total_price_two = 0
- var total_price_four = 0
- var total_price_three =0
- var total_price_five = 0
- if(arr!=null&&arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total_price_one += arr[i].count * arr[i].xt_drug_warehouse_info.retail_price
- }
- }
- if(arr4!=null && arr4.length>0){
- for(let i=0;i<arr4.length > 0;i++){
- total_price_four += arr4[i].count * arr4[i].xt_drug_warehouse_info.retail_price
- }
- }
- if(arr2!=null && arr2.length > 0){
- for(let i=0;i<arr2.length;i++){
- total_price_two += arr2[i].count * arr2[i].xt_drug_warehouse_info.retail_price
- }
-
- }
-
- if(arr3!=null && arr3.length > 0){
- for(let i=0;i<arr3.length;i++){
- total_price_three += arr3[i].count * arr3[i].xt_drug_warehouse_info.retail_price
- }
-
- }
-
- if(arr5!=null && arr5.length > 0){
- for(let i=0;i<arr5.length;i++){
- total_price_five += arr5[i].count * arr5[i].xt_drug_warehouse_info.retail_price
- }
-
- }
-
- total_price = total_price_one - total_price_four + total_price_two - total_price_three + total_price_five
- if(total_price >0){
- return total_price.toFixed(2)
- }else{
- return "0.00"
- }
-
- },
- getSaleMoneyOne(arr,min_number,min_unit,max_unit,arr2,arr3,arr4,arr5){
- var totalOne = 0
- var totalTwo =0
- var total_price = 0
- var total_three= 0
- var total_four = 0
- var total_five = 0
- if(arr!=null&&arr.length > 0){
- for(let i=0;i<arr.length;i++){
- totalOne += arr[i].count*arr[i].xt_drug_warehouse_info.retail_price
- }
- }
-
- if(arr2!=null&&arr2.length > 0){
- for(let i=0;i<arr2.length;i++){
- totalTwo += arr2[i].count * arr2[i].xt_drug_warehouse_info.retail_price
- }
- }
-
- if(arr3!=null&&arr3.length > 0){
- for(let i=0;i<arr3.length;i++){
- total_three+=arr3[i].count* arr3[i].xt_drug_warehouse_info.retail_price
- }
- }
-
- if(arr4!=null&&arr4.length > 0){
- for(let i=0;i<arr4.length;i++){
- total_four+=arr4[i].count * arr4[i].xt_drug_warehouse_info.retail_price
- }
- }
-
- if(arr5!=null&&arr5.length > 0){
- for(let i=0;i<arr5.length;i++){
- total_five+=arr5[i].count * arr5[i].xt_drug_warehouse_info.retail_price
- }
- }
- // console.log("total_one",totalOne)
- // console.log("totalTwo",totalTwo)
- // console.log("total_three",total_three)
- // console.log("total_four",total_four)
-
- // console.log("total_pricewode",(totalOne - totalTwo+total_three - total_four).toFixed(2))
- total_price =(totalOne - totalTwo+total_three - total_four + total_five).toFixed(2)
- if(total_price > 0){
- return total_price
- }else{
- return "0.00"
- }
-
- },
- getDrugWarehouseOutInfo(arr,min_number,min_unit,max_unit){
- var total = 0
- var max_str = "";
- var min_str = "";
- if(arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total += arr[i].count
- }
- }
- if (total < min_number) {
- min_str = total + min_unit;
- }
- if (total == 0) {
- min_str = "";
- max_str = "";
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number) + max_unit;
- }
- if (total % min_number != 0) {
- min_str = (total % min_number) + min_unit;
- }
- }
- return max_str + min_str;
- },
- getDrugWarehouseOutMoney(arr,min_number,min_unit,max_unit,last_price){
- var total = 0
- var min_str = 0
- var max_str = 0
- var total_price = 0
- if(arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total += arr[i].count
- }
- }
- if (total < min_number) {
- min_str = total
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number);
- }
- if (total % min_number != 0) {
- min_str = (total % min_number);
- }
- total_price = (max_str * last_price + min_str*(last_price/min_number)).toFixed(2)
- return total_price
- }
- },
- open(){
-
- // this.start_time = moment().year(2022).month(10).date(4).format('YYYY-MM-DD')
- this.start_time = moment().startOf('month').format('YYYY-MM-DD')
- this.end_time = moment(new Date()).add('year',0).format("YYYY-MM-DD")
- this.houseList= []
- this.drugTypeList = []
- this.getStorehouseList()
- this.getlist()
- },
-
- drugAddInfo(arr,min_number,min_unit,max_unit,arr2){
- var total = 0
- var totalone = 0
- var totaltwo = 0
- var max_str = "";
- var min_str = "";
- if(arr!=null && arr.length > 0){
- for(let i=0;i<arr.length;i++){
- totalone += arr[i].count
- }
- }
- if(arr2!=null && arr2.length >0){
- for(let i=0;i<arr2.length;i++){
- totaltwo += arr2[i].count
- }
- }
- total = totalone + totaltwo
-
- if (total < min_number) {
- min_str = total + min_unit;
- }
- if (total == 0) {
- min_str = "";
- max_str = "";
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number) + max_unit;
- }
- if (total % min_number != 0) {
- min_str = (total % min_number) + min_unit;
- }
- }
- if(max_str == "" && min_str == ""){
- return "0"
- }else{
- return max_str + min_str
- }
-
- },
- drugAddInfoOne(arr,min_number,min_unit,max_unit,arr2){
- var total = 0
- var totalone = 0
- var totaltwo = 0
- var max_str = "";
- var min_str = "";
- if(arr!=null && arr.length > 0){
- for(let i=0;i<arr.length;i++){
- totalone += arr[i].count
- }
- }
- if(arr2!=null && arr2.length >0){
- for(let i=0;i<arr2.length;i++){
- totaltwo += arr2[i].count
- }
- }
- total = totalone + totaltwo
-
-
- return total
-
- },
- getdrugAddPrice(arr,min_number,min_unit,max_unit,arr2){
- var total = 0
- var totalone =0
- var totaltwo = 0
- var total_price = 0
-
- if(arr!=null&&arr.length > 0){
- for(let i=0;i<arr.length;i++){
- totalone += arr[i].count * arr[i].xt_drug_warehouse_info.price/min_number
- }
- }
-
- if(arr2!=null && arr2.length > 0){
- for(let i=0;i<arr2.length;i++){
- totaltwo +=arr2[i].count * arr2[i].xt_drug_warehouse_info.price/min_number
- }
- }
- total = totalone + totaltwo
- total_price =total.toFixed(2)
- return total_price
- },
- drugAddSalePrice(arr,min_number,min_unit,max_unit,arr2){
- var total = 0
- var total_one = 0
- var total_two = 0
- var total_price = 0
- if(arr!=null&&arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total_one += arr[i].count * arr[i].xt_drug_warehouse_info.retail_price
- }
- }
-
- if(arr2!=null&&arr2.length > 0){
- for(let i=0;i<arr2.length;i++){
- total_two +=arr2[i].count * arr2[i].xt_drug_warehouse_info.retail_price
- }
- }
-
- total = total_one + total_two
-
- total_price = total.toFixed(2)
- return total_price
- },
- getDrugOut(arr,min_number,min_unit,max_unit,arr2,arr3){
- var total = 0
- var totalone = 0
- var totaltwo = 0
- var totalthree = 0
- var min_str = ""
- var max_str = ""
- if(arr!=null&&arr.length > 0){
- for(let i=0;i<arr.length;i++){
- totalone +=arr[i].count
- }
- }
- if(arr2!=null && arr2.length>0){
- for(let i=0;i<arr2.length;i++){
- totaltwo +=arr2[i].count
- }
- }
- if(arr3!=null && arr3.length>0){
- for(let i=0;i<arr3.length;i++){
- totalthree +=arr3[i].count
- }
- }
- console.log("出库ssssssssssssssss",totalone)
- console.log("盘亏",totaltwo)
- console.log("退库22222222222",totalthree)
- total = totalone + totaltwo - totalthree
- console.log("剩余阿道夫阿道夫阿道夫",total)
- if (total < min_number) {
- min_str = total + min_unit;
- }
- if (total == 0) {
- min_str = "";
- max_str = "";
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number) + max_unit;
- }
- if (total % min_number != 0) {
- min_str = (total % min_number) + min_unit;
- }
- }
- if(max_str == "" && min_str == ""){
- return "0"
- }else{
- return max_str + min_str;
- }
-
- },
- getDrugOutOne(arr,min_number,min_unit,max_unit,arr2,arr3){
- var total = 0
- var totalone = 0
- var totaltwo = 0
- var totalthree = 0
- var min_str = ""
- var max_str = ""
- if(arr!=null&&arr.length > 0){
- for(let i=0;i<arr.length;i++){
- totalone +=arr[i].count
- }
- }
- if(arr2!=null && arr2.length>0){
- for(let i=0;i<arr2.length;i++){
- totaltwo +=arr2[i].count
- }
- }
- if(arr3!=null && arr3.length>0){
- for(let i=0;i<arr3.length;i++){
- totalthree +=arr3[i].count
- }
- }
- total = totalone + totaltwo - totalthree
-
- return total
-
- },
- getDrugOutPrice(arr,min_number,min_unit,max_unit,arr2,arr3){
-
- var total_price = 0
- var total_one_price =0
- var total_two_price = 0
- var total_three_price = 0
- var total = 0
- var total_two = 0
- var total_three = 0
- if(arr!=null&&arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total_one_price += arr[i].count * (arr[i].xt_drug_warehouse_info.price/min_number)
- total += arr[i].count
- }
- }
- if(arr2!=null && arr2.length>0){
- for(let i=0;i<arr2.length;i++){
- total_two_price +=arr2[i].count * arr2[i].xt_drug_warehouse_info.price/min_number
- total_two +=arr2[i].count
- }
- }
-
- if(arr3!=null && arr3.length>0){
- for(let i=0;i<arr3.length;i++){
- total_three_price +=arr3[i].count * arr3[i].xt_drug_warehouse_info.price/min_number
- total_three +=arr3[i].count
- }
- }
-
- total_price = total_one_price + total_two_price - total_three_price
- if(total_price > 0){
- return total_price.toFixed(2)
- }else{
- return "0.00"
- }
-
- },
- getDrugOutSaleprice(arr,min_number,min_unit,max_unit,arr3,arr4){
- var total_price = 0
- var total_price_one = 0
- var total_price_two = 0
- var total_price_three = 0
- if(arr!=null&&arr.length > 0){
- for(let i=0;i<arr.length;i++){
- total_price_one += arr[i].count * arr[i].xt_drug_warehouse_info.retail_price
- }
- }
-
- if(arr3!=null && arr3.length >0){
- for(let i=0;i<arr3.length;i++){
- total_price_two +=arr3[i].count * arr3[i].xt_drug_warehouse_info.retail_price
- }
- }
-
- if(arr4!=null && arr4.length >0){
- for(let i=0;i<arr4.length;i++){
- total_price_three +=arr4[i].count * arr4[i].xt_drug_warehouse_info.retail_price
- }
- }
-
- total_price = total_price_one + total_price_two - total_price_three
-
- if(total_price > 0){
- return total_price.toFixed(2)
- }else{
- return "0.00"
- }
-
- },
- toPrint(){
- this.$router.push({path:"/drugs/purchase/new/query/print?start_time="+this.start_time+"&end_time="+this.end_time+"&page="+this.page+"&limit="+this.limit+"&keyword="+this.keyword+"&good_type="+this.good_type})
- },
- exportList: function() {
- for(let i=0;i<this.tableList.length;i++){
- this.tableList[i].index = i+1
- this.tableList[i].query_date = this.start_time+"~"+this.end_time
- this.tableList[i].good_type = this.getDrugTypeName(this.tableList[i].drug_type)
- this.tableList[i].manufacturer_name = this.getManufacturName(this.tableList[i].manufacturer)
- this.tableList[i].dealer_name = this.getDearName(this.tableList[i].dealer)
- this.tableList[i].specification_name = this.tableList[i].dose + this.tableList[i].dose_unit +"*"+this.tableList[i].min_number + this.tableList[i].min_unit+"/"+this.tableList[i].max_unit
- // this.tableList[i].drugInMoney = this.tableList[i].last_price
-
- }
- import('@/vendor/Export2Excel').then(excel => {
- const multiHeader = [['序号', '查询日期',' 药品类型','药品名称','规格&单位','生产产商','经销商', '期初结余' , '', '', '本期增加', '', '', '本期减少' , '', '', '期末结余' , '', '']]
- const header = ['', '','','','','','', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额']
- const merges = ['A1:A2', 'B1:B2','C1:C2','D1:D2','E1:E2','F1:F2','G1:G2','H1:J1', 'K1:M1', 'N1:P1', 'Q1:S1']
- const filterVal = ['index', 'query_date', 'good_type','drug_name','specification_name','manufacturer_name','dealer_name','drugIn','drugInMoney','drugSaleMoney','drugAdd','drugAddPrice','drugAddSalePrice','drugOut','drugOutPrice','drugOutSalePrice','overDrug','overDrugPrice','oveDrugSaleMoney']
-
- const data = this.formatJson(filterVal, this.tableList)
-
- const filename = '药品进销存查询'
-
-
- excel.export_json_to_excel({
- multiHeader,
- header,
- merges,
- data,
- filename
- })
- })
- },
- formatJson(filterVal, jsonData) {
- return jsonData.map(v => filterVal.map(j => v[j]));
- },
- GetDrugStartFlow(total,min_number,min_unit,max_unit){
- var min_str = ""
- var max_str = ""
- if (total < min_number) {
- min_str = total + min_unit;
- }
- if (total == 0) {
- min_str = "";
- max_str = "";
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number) + max_unit;
- }
- if (total % min_number != 0) {
- min_str = (total % min_number) + min_unit;
- }
- }
- if(max_str == "" && min_str == ""){
- return "0"
- }else{
- return max_str + min_str;
- }
- },
-
-
- GetDrugEndFlow(total,min_number,min_unit,max_unit){
-
- var min_str = ""
- var max_str = ""
- if (total < min_number) {
- min_str = total + min_unit;
- }
- if (total == 0) {
- min_str = "";
- max_str = "";
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number) + max_unit;
- }
- if (total % min_number != 0) {
- min_str = (total % min_number) + min_unit;
- }
- }
- if(max_str == "" && min_str == ""){
- return "0"
- }else{
- return max_str + min_str;
- }
- },
- toOverCount(){
- getDrugOverCount().then(response=>{
- if(response.data.state == 1){
- var msg = response.data.data.msg
- this.$message.success("调试成功")
- }
- })
- },
- getDearName(id){
- var dear_name = ""
- for(let i=0;i<this.dealerList.length;i++){
- if(id == this.dealerList[i].id){
- dear_name = this.dealerList[i].dealer_name
- }
- }
- return dear_name
- },
- GetDrugOver(totalone,totaltwo,totalthree,min_number,min_unit,max_unit){
- var total = 0
- var min_str = ""
- var max_str = ""
- total = totalone + totaltwo - totalthree
- // console.log("totoalone---------------",totalone)
- // console.log("totaltwo------------",totaltwo)
- // console.log("totalthree----------",totalthree)
- if (total < min_number) {
- min_str = total + min_unit;
- }
- if (total == 0) {
- min_str = "";
- max_str = "";
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number) + max_unit;
- }
- if (total % min_number != 0) {
- min_str = (total % min_number) + min_unit;
- }
- }
- if(max_str == "" && min_str == ""){
- return "0"
- }else{
- return max_str + min_str;
- }
- },
- GetDrugOverOne(totalone,totaltwo,totalthree,min_number,min_unit,max_unit){
- var total = 0
-
- total = totalone + totaltwo - totalthree
-
- return total
-
- },
- GetInitStartFlow(val1,val2,val3,val4,val5,min_number,min_unit,max_unit){
- var total_one =0
- var total_two = 0
- var total_three =0
- var total_four =0
- var total_five = 0
- var total =0
- var min_str = ""
- var max_str = ""
- if(val1!=null && val1.length>0){
- for(let i=0;i<val1.length;i++){
- total_one +=val1[i].count
- }
- }
-
- if(val2!=null && val2.length>0){
- for(let i=0;i<val2.length;i++){
- total_two +=val2[i].count
- }
- }
-
- console.log("val3",val3)
- if(val3!=null && val3.length>0){
- for(let i=0;i<val3.length;i++){
- total_three +=val3[i].count
- }
- }
- if(val4!=null && val4.length>0){
- for(let i=0;i<val4.length;i++){
- total_four +=val4[i].count
- }
- }
-
- if(val5!=null && val5.length>0){
- for(let i=0;i<val5.length;i++){
- total_five +=val5[i].count
- }
- }
- console.log("入库",total_one)
- console.log("盘盈",total_two)
- console.log("出库",total_three)
- console.log("盘亏",total_four)
- console.log("退库",total_five)
- var total = total_one + total_two -total_three-total_four + total_five
- if (total <=0) {
- return 0
- }else{
- if (total < min_number) {
- min_str = total + min_unit;
- }
- if (total == 0) {
- min_str = "";
- max_str = "";
- }
- if (total >= min_number) {
- if (parseInt(total / min_number) != 0) {
- max_str = parseInt(total / min_number) + max_unit;
- }
- if (total % min_number != 0) {
- min_str = (total % min_number) + min_unit;
- }
- }
- if(max_str == "" && min_str == ""){
- return "0"
- }else{
- return max_str + min_str;
- }
- }
-
- },
- GetInitStartFlowOne(val1,val2,val3,val4,val5,min_number,min_unit,max_unit){
- var total_one =0
- var total_two = 0
- var total_three =0
- var total_four =0
- var total_five = 0
- var total =0
- var min_str = ""
- var max_str = ""
- if(val1!=null && val1.length>0){
- for(let i=0;i<val1.length;i++){
- total_one +=val1[i].count
- }
- }
-
- if(val2!=null && val2.length>0){
- for(let i=0;i<val2.length;i++){
- total_two +=val2[i].count
- }
- }
-
- console.log("val3",val3)
- if(val3!=null && val3.length>0){
- for(let i=0;i<val3.length;i++){
- total_three +=val3[i].count
- }
- }
- if(val4!=null && val4.length>0){
- for(let i=0;i<val4.length;i++){
- total_four +=val4[i].count
- }
- }
-
- if(val5!=null && val5.length>0){
- for(let i=0;i<val5.length;i++){
- total_five +=val5[i].count
- }
- }
- console.log("入库",total_one)
- console.log("盘盈",total_two)
- console.log("出库",total_three)
- console.log("盘亏",total_four)
- console.log("退库",total_five)
- var total = total_one + total_two -total_three-total_four + total_five
- if(total>0){
- return total
- }else{
- return 0
- }
-
- },
- getDrugQuery(){
- this.getlist()
- }
- }
- }
- </script>
-
|