123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs="crumbs"></bread-crumb>
- </div>
- <div class="app-container">
- <div style="display: flex;align-items: center;justify-content: space-between;">
- <div>
- <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
- >
- <el-date-picker
- size="small"
- v-model="start_time"
- type="date"
- style="margin-left:5px;width:140px;"
- placeholder="选择日期"
- @change="changeStartime"
- >
- </el-date-picker>
- <el-date-picker
- size="small"
- v-model="end_time"
- type="date"
- style="margin-left:5px;width:140px;"
- placeholder="选择日期"
- @change="changeEndTime">
- </el-date-picker>
- </div>
- <div>
- <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
- <el-button size="small" type="primary" @click="toCheck">核对</el-button>
- <!-- <el-button size="small" type="primary" @click="print">打印</el-button>
- <el-button size="small" type="primary" @click="toExport">导出</el-button> -->
- </div>
- </div>
- <div style="margin-top:10px">
- <el-table :data="tableList" border :height="tableHeight" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }" @selection-change="changePrice">
- <el-table-column type="selection" width="55" align="center"> </el-table-column>
- <el-table-column prop="date" label="单据编码" width="200px" align="center">
- <template slot-scope="scope">
- {{scope.row.warehousing_order}}
- </template>
- </el-table-column>
- <el-table-column prop="date" label="调价日期" width="150px" align="center">
- <template slot-scope="scope">
- {{getTime(scope.row.start_time)}}
- </template>
- </el-table-column>
- <el-table-column prop="date" label="药品名称" width="200px" align="center">
- <template slot-scope="scope">
- {{scope.row.drug_name}}
- </template>
- </el-table-column>
- <el-table-column prop="date" label="药品规格" width="100px" align="center">
- <template slot-scope="scope">
- {{scope.row.specification_name}}
- </template>
- </el-table-column>
- <el-table-column prop="date" label="原价格" width="100px" align="center">
- <template slot-scope="scope">
- {{scope.row.retail_price}}
- </template>
- </el-table-column>
- <el-table-column prop="date" label="现价格" width="100px" align="center">
- <template slot-scope="scope">
- {{scope.row.new_price}}
- </template>
- </el-table-column>
- <el-table-column prop="name" label="操作人" width="100px" align="center">
- <template slot-scope="scope">
- {{getDoctorName(scope.row.creater)}}
- </template>
- </el-table-column>
- <el-table-column prop="name" label="状态" align="center" width="100px">
- <template slot-scope="scope">
- <span v-if="scope.row.checker_status == 1">已核对</span>
- <span v-if="scope.row.checker_status == 2">未核对</span>
- </template>
- </el-table-column>
- <el-table-column prop="name" label="核对人" align="center" width="100px">
- <template slot-scope="scope">
- {{getDoctorName(scope.row.checker)}}
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="200px">
- <template slot-scope="scope">
- <el-button type="primary" size="small" @click="modifty(scope.row.id,scope.row.checker_status)">编辑</el-button>
- <el-button type="danger" size="small" @click="deleteDrugPrice(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
-
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[10, 20, 40, 100]"
- :page-size="10"
- background
- style="margin-top:20px;text-align: right"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total">
- </el-pagination>
- </div>
- </div>
- <el-dialog
- title="药品调价"
- :visible.sync="dialogVisible"
- width="1200px">
- <el-form :model="form" class="modifyDialog" label-width="120px">
- <el-form-item label="药品名称">
-
- <el-autocomplete
- class="checkSearch"
- popper-class="my-autocomplete"
- v-model="form.drug_name"
- :fetch-suggestions="querySearchAsync"
- :trigger-on-focus="true"
- placeholder="请输入药品名称"
- @select="handleSelect"
- @input="changeGoodName(scope.$index)"
- style="width:300px;"
- >
- <i class="el-icon-search el-input__icon" slot="suffix"></i>
- <template slot-scope="{ item }">
- <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + " "+item.manufacturer}}</div>
- </template>
- </el-autocomplete>
- </el-form-item>
- <el-form-item label="原价格">
- <el-input v-model="form.retail_price" :disabled="true"></el-input>
- </el-form-item>
- <el-form-item label="现价格">
- <el-input v-model="form.new_price"></el-input>
- </el-form-item>
- <!-- <el-form-item label="调价数量">
- <el-input v-model="form.count"></el-input>
- </el-form-item> -->
- <el-form-item label="备注" style="width:66%;">
- <div style="display:flex;">
- <el-input v-model="form.remark"></el-input>
- <el-button style="margin-left:5px;" type="primary" @click="addPrice">添加</el-button>
- </div>
- </el-form-item>
- </el-form>
- <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
- <el-table-column prop="date" label="单据编号" width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.warehousing_order}}
- </template>
- </el-table-column>
- <el-table-column prop="date"label="药品名称" width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.drug_name}}
- </template>
- </el-table-column>
- <el-table-column prop="name"label="规格" width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.specification_name}}
- </template>
- </el-table-column>
- <el-table-column prop="name" label="单位" width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.warehousing_unit}}
- </template>
- </el-table-column>
- <!-- <el-table-column prop="name" label="调价数量" width="100">
- <template slot-scope="scope">
- {{scope.row.count}}
- </template>
- </el-table-column> -->
- <el-table-column prop="name" label="原进货价" width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.retail_price}}
- </template>
- </el-table-column>
- <el-table-column prop="name" label="原零售价" width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.retail_price}}
- </template>
- </el-table-column>
- <el-table-column prop="name" label="新零售价" width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.new_price}}
- </template>
- </el-table-column>
- <el-table-column prop="name" label="生产厂商" width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.manufacturer}}
- </template>
- </el-table-column>
- <el-table-column prop="name" label="批准文号" width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.number}}
- </template>
- </el-table-column>
- <el-table-column prop="name" label="经销商" width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.dealer}}
- </template>
- </el-table-column>
- <el-table-column prop="name" label="备注" width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.remark}}
- </template>
- </el-table-column>
- <el-table-column
- fixed="right"
- width="100"
- label="操作">
- <template slot-scope="scope">
- <el-button type="text" size="small" @click="toDel(scope.$index)">删除</el-button>
- <el-button type="text" size="small" @click="toEdit(scope.row)">编辑</el-button>
- </template>
- </el-table-column>
- </el-table>
-
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="saveDrugPrice">确 定</el-button>
- </span>
- </el-dialog>
-
- <el-dialog
- title="药品盘点核对"
- :visible.sync="checkDialogVisible"
- width="30%"
- >
- <span>
- <el-form :model="form">
- <el-row>
- <el-col>
- <el-form-item label="核对时间">
- <el-date-picker
- size="small"
- v-model="check_time"
- type="date"
- style="margin-left:5px;width:140px;"
- placeholder="选择日期">
- </el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="核对人">
- <el-select v-model="checker" placeholder="请选择">
- <el-option
- v-for="item in doctorList"
- :key="item.admin_user_id"
- :label="item.user_name"
- :value="item.admin_user_id">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="checkDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="SaveCheckedDrugPrice">保 存</el-button>
- </span>
- </el-dialog>
-
-
- <!-- 编辑调价 -->
- <el-dialog
- title="编辑"
- :visible.sync="editPriceDialogVisible"
- width="50%">
- <span>
- <el-form :model="form">
- <el-row>
- <el-col>
- <el-form-item label="药品名称">
- <el-autocomplete
- class="checkSearch"
- popper-class="my-autocomplete"
- v-model="form.drug_name"
- :fetch-suggestions="querySearchAsync"
- :trigger-on-focus="true"
- placeholder="请输入药品名称"
- @select="handleSelect"
- @input="changeGoodName(scope.$index)"
- style="width:300px;"
- >
- <i class="el-icon-search el-input__icon" slot="suffix"></i>
- <template slot-scope="{ item }">
- <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + " "+item.manufacturer}}</div>
- </template>
- </el-autocomplete>
- </el-form-item>
- <el-form-item label="规格:">
- <el-input v-model="form.specification_name" style="width:200px" :disabled="true"></el-input>
- </el-form-item>
- <el-form-item label="原价格:">
- <el-input v-model="form.retail_price" style="width:200px" :disabled="true"></el-input>
- </el-form-item>
- <el-form-item label="现价格:">
- <el-input v-model="form.new_price" style="width:200px"></el-input>
- </el-form-item>
- <el-form-item label="生产厂商:">
- <el-input v-model="form.manufacturer" style="width:200px" :disabled="true"></el-input>
- </el-form-item>
- <el-form-item label="经销商:">
- <el-input v-model="form.dealer" style="width:200px" :disabled="true"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="备注:">
- <div style="display:flex;">
- <el-input v-model="form.remark" style="width:200px"></el-input>
- </div>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="editPriceDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="upatePrice">保存</el-button>
- </span>
- </el-dialog>
-
-
- <el-dialog
- title="编辑"
- :visible.sync="modifyPriceDialogVisible"
- width="50%">
- <span>
- <el-form :model="form">
- <el-row>
- <el-col>
- <el-form-item label="药品名称">
- <el-autocomplete
- class="checkSearch"
- popper-class="my-autocomplete"
- v-model="form.drug_name"
- :fetch-suggestions="querySearchAsync"
- :trigger-on-focus="true"
- placeholder="请输入药品名称"
- @select="handleSelect"
- @input="changeGoodName(scope.$index)"
- style="width:200px;"
- >
- <i class="el-icon-search el-input__icon" slot="suffix"></i>
- <template slot-scope="{ item }">
- <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + " "+item.manufacturer}}</div>
- </template>
- </el-autocomplete>
- </el-form-item>
- <el-form-item label="规格:">
- <el-input v-model="form.specification_name" style="width:200px" :disabled="true"></el-input>
- </el-form-item>
- <el-form-item label="单位:">
- <el-input v-model="form.warehousing_unit" style="width:200px" :disabled="true"></el-input>
- </el-form-item>
- <el-form-item label="原价格:">
- <el-input v-model="form.retail_price" style="width:200px" :disabled="true"></el-input>
- </el-form-item>
- <el-form-item label="现价格:">
- <el-input v-model="form.new_price" style="width:200px"></el-input>
- </el-form-item>
- <el-form-item label="生产厂商:">
- <el-input v-model="form.manufacturer" style="width:200px" :disabled="true"></el-input>
- </el-form-item>
- <el-form-item label="批准文号:">
- <el-input v-model="form.number" style="width:200px" :disabled="true"></el-input>
- </el-form-item>
- <el-form-item label="经销商:">
- <el-input v-model="form.number" style="width:200px" :disabled="true"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="备注:">
- <div style="display:flex;">
- <el-input v-model="form.remark" style="width:200px"></el-input>
- </div>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="modifyPriceDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="modifyDrugPrice">保存</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
-
- <script>
- import { uParseTime } from '@/utils/tools'
- import BreadCrumb from "../../components/bread-crumb";
- import {postSearchDrugWarehouseList,saveDrugPrice,getDrugPriceList,SaveCheckedDrugPrice,getDrugModiftyPrice,modifyDrugPrice,deleteDrugPrice} from "@/api/drug/drug"
- export default {
- name: "stockModifyPrice",
- components:{
- BreadCrumb
- },
- data() {
- return{
- crumbs: [
- { path: false, name: "库存管理" },
- { path: false, name: "药品管理" },
- { path: false, name: "药品调价" }
- ],
- tableHeight: '',
- fullHeight: document.documentElement.clientHeight,
- searchKey:'',
- value1:'',
- value2:'',
- tableData: [],
- dialogVisible:false,
- form: {
- id:"",
- drug_name: '',
- retail_price :'',
- new_price:"",
- count:"",
- remark:"",
- warehousing_order:"",
- manufacturer:"",
- dealer:"",
- license_number:"",
- warehousing_unit:"",
- specification_name:"",
- buy_price:"",
- drug_id:"",
- packing_unit:"",
- drug_origin_place:"",
- report_count:"",
- total:"",
- dose:"",
- dose_unit:"",
- min_number:"",
- min_unit:"",
- max_unit:"",
- batch_number:"",
- last_price:"",
- },
- drugList:[],
- manufacturerList:[],
- dealerList:[],
- currentIndex: 0,
- limit:10,
- page:1,
- tableList:[],
- ids:"",
- checkDialogVisible:false,
- checker:this.$store.getters.xt_user.user.id,
- check_time:new Date(),
- doctorList:[],
- editPriceDialogVisible:false,
- modifyPriceDialogVisible:false,
- id:0,
- start_time:"",
- end_time:"",
- }
- },
- methods:{
- search(){
- this.getlist()
- },
- print(){
- if(this.ids == ""){
- this.$message.error("请勾选打印数据")
- return false
- }else{
- this.$router.push({path:'/stock/drugs/drugModifyPricePrint?ids='+this.ids})
- }
- },
- addPrice(){
- if(this.form.drug_name == ""){
- this.$message.error("请输入药品名称")
- return
- }
- if(this.form.new_price == ""){
- this.$message.error("请输入现价格")
- return
- }
- var obj = {
- id:this.form.id,
- drug_id:this.form.drug_id,
- drug_name:this.form.drug_name,
- warehousing_unit:this.form.warehousing_unit,
- count:parseInt(this.form.count),
- retail_price:this.form.retail_price.toString(),
- manufacturer:this.form.manufacturer,
- drug_origin_place:this.form.drug_origin_place,
- number:this.form.number,
- remark:this.form.remark,
- new_price:this.form.new_price.toString(),
- warehousing_order:this.form.warehousing_order,
- dealer:this.form.dealer,
- last_price:this.form.last_price,
- start_time:this.getTime(new Date()),
- specification_name:this.form.specification_name,
- }
- this.tableData.push(obj)
- },
- querySearchAsync(keyword, cb) {
- let key = '';
- if (keyword != undefined) {
- key = keyword
- }
- postSearchDrugWarehouseList(key).then(response => {
- if (response.data.state == 1) {
-
- var list = response.data.data.list
- console.log("列表数据",list)
- this.drugList = list
- var manufacturerList = response.data.data.manufacturerList
- this.manufacturerList = manufacturerList
- var dealer = response.data.data.dealerList
- this.dealerList = dealer
- for(let i=0;i<this.drugList.length;i++){
- for(let j=0;j<this.manufacturerList.length;j++){
- if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
- this.drugList[i].manufacturer = this.manufacturerList[j].manufacturer_name
- }
- }
- }
-
- for(let i=0;i<this.drugList.length;i++){
- for(let j=0;j<this.dealerList.length;j++){
- if(this.drugList[i].dealer == this.dealerList[j].id){
- this.drugList[i].dealer = this.dealerList[j].dealer_name
- }
- }
- }
-
- cb(this.drugList)
- } else {
- cb([])
- }
- })
- },
- changeGoodName(val){
- this.currentIndex = val
- },
- handleSelect(val){
- console.log("val232323223",val)
- this.form.id = val.id
- this.form.drug_id = val.drug_id,
- this.form.drug_name = val.drug_name
- this.form.retail_price = val.retail_price
- this.form.warehousing_order = val.warehousing_order
- this.form.number = val.number
- if(val.dealer == 0){
- this.form.dealer = ""
- }else{
- this.form.dealer = val.dealer
- }
- this.form.manufacturer = val.manufacturer
- this.form.remark = val.remark
- this.form.warehousing_unit = val.max_unit
- this.form.total = val.total
- this.form.batch_number = val.batch_number
- this.form.last_price = val.last_price
- this.form.specification_name = val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
- this.form.new_price = ""
- },
- getTime(val) {
- if(val < 0){
- return ""
- }
- if(val == ""){
- return ""
- }else {
- return uParseTime(val, '{y}-{m}-{d}')
- }
- },
- saveDrugPrice(){
- for(let i=0;i<this.tableData.length;i++){
- this.tableData[i].retail_price = this.tableData[i].retail_price.toString()
- this.tableData[i].last_price = this.tableData[i].last_price.toString()
- this.tableData[i].new_price = this.tableData[i].new_price.toString()
- // this.tableData[i].count = parseInt(this.tableData[i].count)
- if(this.tableData[i].dealer == 0){
- this.tableData[i].dealer = ""
- }
- if(this.tableData[i].manufacturer == 0){
- this.tableData[i].manufacturer = ""
- }
- }
- var params= {
- tableData:this.tableData,
- }
- console.log("parasm222",params)
- saveDrugPrice(params).then(response=>{
- if(response.data.state == 1){
- var msg = response.data.data.msg
- console.log("msg",msg)
- this.$message.success("保存成功!")
- this.dialogVisible = false
- this.getlist()
- }
- })
- },
- getlist(){
- var params = {
- keyword:this.searchKey,
- start_time:this.start_time,
- end_time:this.end_time,
- limit:this.limit,
- page:this.page,
- }
- console.log("params",params)
- getDrugPriceList(params).then(response=>{
- if(response.data.state == 1){
- var list = response.data.data.list
- this.total = response.data.data.total
- this.tableList = list
- this.doctorList = response.data.data.doctorList
- }
- })
- },
- getDoctorName(id){
- var user_name = ""
- for(let i=0;i<this.doctorList.length;i++){
- if(id == this.doctorList[i].admin_user_id){
- user_name = this.doctorList[i].user_name
- }
- }
- return user_name
- },
- changePrice(val){
- var arr = []
-
- for(let i=0;i<val.length;i++){
- arr.push(val[i].id)
- }
- var str = arr.join(",")
-
- console.log("str",str)
- this.ids = str
-
- },
- toCheck(){
- if(this.ids.length <=0){
- this.$message.error("请勾选核对数据")
- return
- }else{
- this.checkDialogVisible = true
- }
- },
- SaveCheckedDrugPrice(){
- var params = {
- ids:this.ids,
- check_time:this.getTime(this.check_time),
- checker:this.checker,
- }
- console.log("params",params)
- SaveCheckedDrugPrice(params).then(response=>{
- if(response.data.state == 1){
- this.$message.success("保存成功")
- var adjustPrice = response.data.data.adjustPrice
- this.checkDialogVisible = false
- this.getlist()
- }
- })
- },
- toDel(index){
- this.tableData.splice(index,1)
- },
- toEdit(row){
- console.log("row2222",row)
- this.form.drug_name = row.drug_name
- this.form.retail_price = row.retail_price
- this.form.new_price = row.new_price
- this.form.remark = row.remark
- this.form.id = row.id
- this.form.specification_name = row.specification_name
- this.form.last_price = row.last_price
- this.form.number = row.number
- this.form.manufacturer = row.manufacturer
- this.form.dealer = row.dealer
- this.editPriceDialogVisible = true
- },
- upatePrice(){
- for(let i=0;i<this.tableData.length;i++){
- if(this.form.id == this.tableData[i].id){
- this.tableData[i].drug_name = this.form.drug_name
- this.tableData[i].retail_price = this.form.retail_price
- this.tableData[i].new_price = this.form.new_price
- this.tableData[i].count = this.form.count
- this.tableData[i].remark = this.form.remark
- }else{
- this.tableData[i].drug_name = this.form.drug_name
- this.tableData[i].retail_price = this.form.retail_price
- this.tableData[i].new_price - this.form.new_price
- this.tableData[i].count = this.form.count
- this.tableData[i].remark = this.form.remark
- }
- }
- this.editPriceDialogVisible = false
- this.form.drug_name = ""
- this.form.retail_price = ""
- this.form.new_price = ""
- this.form.count = ""
- this.form.remark = ""
- },
- modifty(id,checker_status){
- if(checker_status == 1){
- this.$message.error("已核对,无法编辑")
- return false
- }
- getDrugModiftyPrice(id).then(response=>{
- if(response.data.state == 1){
- var detail = response.data.data.detail
- console.log("detail",detail)
- this.form.drug_name = detail.drug_name
- this.form.specification_name = detail.specification_name
- this.form.last_price = detail.last_price
- this.form.dealer = detail.dealer
- this.form.manufacturer = detail.manufacturer
- this.form.retail_price = detail.retail_price
- this.form.new_price = detail.new_price
- this.form.count = detail.count
- this.form.remark = detail.remark
- this.id = detail.id
- this.form.warehousing_unit = detail.warehousing_unit
- this.form.number = detail.number
- this.form.drug_id = detail.drug_id
- this.modifyPriceDialogVisible = true
- }
- })
- },
- modifyDrugPrice(){
- var params = {
- drug_name:this.form.drug_name,
- specification_name:this.form.specification_name,
- warehousing_unit:this.form.warehousing_unit,
- retail_price:this.form.retail_price.toString(),
- new_price:this.form.new_price.toString(),
- manufacturer:this.form.manufacturer,
- number:this.form.number,
- count:parseInt(this.form.count),
- remark:this.form.remark,
- id:this.id,
- drug_id:this.form.drug_id,
- }
-
- modifyDrugPrice(params).then(response=>{
- if(response.data.state == 1){
- var adjustPrice = response.data.data.adjustPrice
- this.$message.success("保存成功")
- this.modifyPriceDialogVisible = false
- }
- })
- },
- deleteDrugPrice(id,checker_status,index){
- if(checker_status == 1){
- this.$message.error("已核对,无法编辑")
- return false
- }
- this.$confirm('是否删除所选内容?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let params = {
- id:id,
- }
- deleteDrugPrice(params).then(response => {
- if (response.data.state == 1) {
- var msg = response.data.data.msg
- this.$message.success("保存成功")
- this.tableList.splice(index,1)
- }
- })
- }).catch(() => {
- this.loading = false
- });
- },
- handleSizeChange(val){
- this.limit = val
- this.getlist()
- },
- handleCurrentChange(val){
- this.page = val
- this.getlist()
- },
- toExport(){
- import('@/vendor/Export2Excel').then(excel => {
- const tHeader = ['药品名称','规格','单位','批次','原进货价','新进货价','进货差价','原零售价','新零售价','零售差价',]
- const filterVal = ['drug_name', '','warehousing_unit','number','retail_price','new_price','','new_price','']
- console.log("table",this.tableList)
-
- const data = this.formatJson(filterVal, this.tableList)
- excel.export_json_to_excel({
- header: tHeader,
- data,
- filename: '药品调价'
- })
- this.downloadLoading = false
- })
- },
- formatJson(filterVal, jsonData) {
- return jsonData.map(v => filterVal.map(j => v[j]));
- },
- changeStartime(val){
- this.start_time = this.getTime(val)
- this.getlist()
- },
- changeEndTime(val){
- this.end_time = this.getTime(val)
- this.getlist()
- }
- },
- created(){
- let tableHeight = document.body.clientHeight - 200;
- this.tableHeight = tableHeight
- this.getlist()
- },
- mounted() {
- const that = this;
- window.onresize = () => {
- return (() => {
- window.fullHeight = document.documentElement.clientHeight;
- that.fullHeight = window.fullHeight
- })()
- }
- },
- watch: {
- fullHeight(val) {
- if (!this.timer) {
- this.fullHeight = val
- let tableHeight = val - 200
- this.tableHeight = tableHeight
- this.timer = true
- let that = this
- setTimeout(function() {
- that.timer = false
- }, 400)
- }
- }
-
- }
- };
- </script>
-
- <style rel="stylesheet/scss" lang="scss">
- .app-container {
- // margin: 20px;
- font-size: 15px;
- }
- .modifyDialog{
- display: flex;
- flex-wrap: wrap;
- margin-bottom: 10px;
- .el-form-item{
- width: 33%;
- }
- }
- .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;
- }
- ::-webkit-scrollbar{
- height: 20px !important;
- }
- </style>
|