123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759 |
- <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"
- placeholder="请输入单据编号或操作人姓名"
- >搜索</el-button
- >
- <el-date-picker
- size="small"
- v-model="start_time"
- type="date"
- style="margin-left:5px;width:140px;"
- placeholder="选择日期">
- </el-date-picker>
- <el-date-picker
- size="small"
- v-model="end_time"
- type="date"
- style="margin-left:5px;width:140px;"
- placeholder="选择日期">
- </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">导出</el-button>
- </div>
- </div>
- <div>
- <div style="width:100%;margin-right:10px;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="100">
- <template slot-scope="scope" align="center">
- {{scope.row.warehousing_order}}
- </template>
- </el-table-column>
- <el-table-column label="耗材名称" width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.good_name}}
- </template>
- </el-table-column>
- <el-table-column label="规格" width="100">
- <template slot-scope="scope">
- {{scope.row.specification_name}}
- </template>
- </el-table-column>
- <el-table-column label="单位" width="100">
- <template slot-scope="scope">
- {{scope.row.packing_unit}}
- </template>
- </el-table-column>
- <el-table-column label="调价数量" width="100">
- <template slot-scope="scope">
- {{scope.row.count}}
- </template>
- </el-table-column>
- <el-table-column label="原进货价" width="100">
- <template slot-scope="scope">
- {{scope.row.buy_price}}
- </template>
- </el-table-column>
- <el-table-column label="原零售价" width="100">
- <template slot-scope="scope">
- {{scope.row.packing_price}}
- </template>
- </el-table-column>
- <el-table-column label="生产厂商" width="100">
- <template slot-scope="scope">
- {{scope.row.manufacturer}}
- </template>
- </el-table-column>
- <el-table-column label="经销商" width="100">
- <template slot-scope="scope">
- {{scope.row.dealer}}
- </template>
- </el-table-column>
- <el-table-column label="操作人" width="100">
- <template slot-scope="scope">
- {{getDoctor(scope.row.creater)}}
- </template>
- </el-table-column>
- <el-table-column label="核对人" width="100">
- <template slot-scope="scope">
- {{getDoctor(scope.row.checker)}}
- </template>
- </el-table-column>
- <el-table-column label="状态" width="100">
- <template slot-scope="scope">
- <span v-if="scope.row.checker_status == 2">未核对</span>
- <span v-if="scope.row.checker_status == 1">已核对</span>
- </template>
- </el-table-column>
- <el-table-column prop="date" label="调价日期" width="100">
- <template slot-scope="scope">
- {{getTime(scope.row.start_time)}}
- </template>
- </el-table-column>
- <el-table-column label="备注" width="100">
- <template slot-scope="scope">
- {{scope.row.remark}}
- </template>
- </el-table-column>
- </el-table>
- </div>
- <!-- <el-table :data="tableData" border :height="tableHeight" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
- <el-table-column
- fixed="left"
- prop="date"
- label="药品ID"
- width="80">
- </el-table-column>
- <el-table-column
- prop="date"
- label="药品名称"
- width="100">
- </el-table-column>
- <el-table-column
- prop="name"
- label="规格"
- width="100">
- </el-table-column>
- <el-table-column
- prop="name"
- label="生产厂家"
- width="100">
- </el-table-column>
- <el-table-column
- prop="name"
- label="批准文书"
- width="100">
- </el-table-column>
- <el-table-column
- prop="name"
- label="经销商"
- width="100">
- </el-table-column>
- <el-table-column
- prop="name"
- label="数量"
- width="100">
- </el-table-column>
- <el-table-column
- prop="name"
- label="原零价"
- width="100">
- </el-table-column>
- <el-table-column
- prop="name"
- label="现零价"
- width="100">
- </el-table-column>
- <el-table-column
- prop="name"
- label="进货价"
- width="100">
- </el-table-column>
- <el-table-column
- prop="name"
- label="零售总价"
- width="100">
- </el-table-column>
- <el-table-column
- prop="name"
- label="批号"
- width="100">
- </el-table-column>
- <el-table-column
- prop="name"
- label="生产日期"
- width="100">
- </el-table-column>
- <el-table-column
- prop="name"
- label="有效日期"
- width="100">
- </el-table-column>
- </el-table> -->
-
- </div>
- </div>
- <el-dialog
- title="库房调价"
- :visible.sync="dialogVisible"
- width="1200px">
- <el-form :model="form" class="modifyDialog" label-width="120px">
- <el-form-item label="耗材名称">
- <!-- <el-input v-model="form.name"></el-input> -->
- <el-autocomplete
- class="checkSearch"
- popper-class="my-autocomplete"
- v-model="form.good_name"
- :fetch-suggestions="querySearchAsync"
- :trigger-on-focus="true"
- placeholder="请输入耗材名称"
- @select="handleSelect"
- @input="changeGoodName(scope.$index)"
- style="width:160px;"
- >
- <i class="el-icon-search el-input__icon" slot="suffix"></i>
- <template slot-scope="{ item }">
- <div class="name">{{ item.good_name +" " +item.specification_name + " "+item.manufacturer }}</div>
- </template>
- </el-autocomplete>
- </el-form-item>
- <el-form-item label="原价格">
- <el-input v-model="form.packing_price"></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.good_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" align="center">
- <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.buy_price}}
- </template>
- </el-table-column>
- <el-table-column prop="name" label="原零售价" width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.packing_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="manufacturer" 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.license_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="deletePrice(scope.$index)">删除</el-button>
- <el-button type="text" size="small" @click="editPrice(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="saveAdjustPrice">确 定</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.good_name"
- :fetch-suggestions="querySearchAsync"
- :trigger-on-focus="true"
- placeholder="请输入耗材名称"
- @select="handleSelect"
- @input="changeGoodName(scope.$index)"
- style="width:160px;"
- >
- <i class="el-icon-search el-input__icon" slot="suffix"></i>
- <template slot-scope="{ item }">
- <div class="name">{{ item.good_name +" " +item.specification_name + " "+item.manufacturer }}</div>
- </template>
- </el-autocomplete>
- </el-form-item>
- <el-form-item label="原价格:">
- <el-input v-model="form.packing_price" style="width:200px"></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-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="调价数量:">
- <el-input v-model="form.count" style="width:200px"></el-input>
- </el-form-item>
- <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="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="SaveCheckedPrice">保 存</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
-
- <script>
- import BreadCrumb from "../components/bread-crumb";
- import { postSearchGoodWarehouseList,saveAdjustPrice,getAllStockPrice,SaveCheckedPrice} from "@/api/stock"
- import { uParseTime } from '@/utils/tools'
- 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:"",
- good_name: '',
- packing_price:'',
- new_price:"",
- count:"",
- remark:"",
- warehousing_order:"",
- manufacturer:"",
- dealer:"",
- license_number:"",
- warehousing_unit:"",
- specification_name:"",
- buy_price:"",
- good_id:"",
- packing_unit:"",
- },
- goodList:[],
- manufacturerList:[],
- dealerList:[],
- currentIndex: 0,
- editPriceDialogVisible:false,
- tableList:[],
- doctorList:[],
- start_time:"",
- end_time:"",
- ids:"",
- check_time:new Date(),
- checker:this.$store.getters.xt_user.user.id,
- checkDialogVisible:false,
- }
- },
- methods:{
- search(){
-
- },
- print(){
- if(this.ids == ""){
- this.$message.error("请勾选打印数据")
- return
- }
- this.$router.push({path:'/stock/stockModifyPricePrint?ids='+this.ids})
-
- },
- querySearchAsync(keyword, cb) {
- let key = '';
- if (keyword != undefined) {
- key = keyword
- }
- postSearchGoodWarehouseList(key).then(response => {
- if (response.data.state == 1) {
-
- var list = response.data.data.list
- console.log("列表数据",list)
- this.goodList = 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.goodList.length;i++){
- for(let j=0;j<this.manufacturerList.length;j++){
- if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
- this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
- }
- }
- }
-
- for(let i=0;i<this.goodList.length;i++){
- for(let j=0;j<this.dealerList.length;j++){
- if(this.goodList[i].dealer == this.dealerList[j].id){
- this.goodList[i].dealer = this.dealerList[j].dealer_name
- }
- }
- }
-
- cb(this.goodList)
- } else {
- cb([])
- }
- })
- },
- changeGoodName(val){
- this.currentIndex = val
- },
- handleSelect(val){
- console.log("val23232323",val)
- this.form.id = val.id
- this.form.good_id = val.good_id,
- this.form.good_name = val.good_name
- this.form.packing_price = val.packing_price
- this.form.warehousing_order = val.warehousing_order
- this.form.license_number = val.license_number
- this.form.dealer = val.dealer
- this.form.manufacturer = val.manufacturer
- this.form.specification_name = val.specification_name
- this.form.remark = val.remark
- this.form.buy_price = val.buy_price
- this.form.warehousing_unit = val.packing_unit
-
- },
- handleClose(){
-
- },
- addPrice(){
- var obj = {
- id:this.form.id,
- good_name:this.form.good_name,
- specification_name:this.form.specification_name,
- warehousing_order:this.form.warehousing_order,
- good_name:this.form.good_name,
- packing_price:this.form.packing_price,
- license_number:this.form.license_number,
- dealer:this.form.dealer,
- manufacturer:this.form.manufacturer,
- warehousing_unit:this.form.warehousing_unit,
- start_time:this.getTime(new Date()),
- count:this.form.count,
- new_price:this.form.new_price,
- remark:this.form.remark,
- buy_price:this.form.buy_price,
- good_id:this.form.good_id,
- }
- this.tableData.push(obj)
- this.form.good_name = ""
- this.form.specification_name = ""
- this.form.warehousing_order = ""
- this.form.good_name = ""
- this.form.packing_price = ""
- this.form.license_number= ""
- this.form.dealer = ""
- this.form.manufacturer = ""
- this.form.warehousing_unit = ""
- this.form.count = ""
- this.form.new_price = ""
- this.form.remark = ""
- this.form.buy_price= ""
- },
- getTime(val) {
- if(val < 0){
- return ""
- }
- if(val == ""){
- return ""
- }else {
- return uParseTime(val, '{y}-{m}-{d}')
- }
- },
- deletePrice(index){
- this.tableData.splice(index,1)
- },
- editPrice(row){
- console.log("row232233223",row)
- this.form.good_name = row.good_name
- this.form.packing_price = row.packing_unit
- this.form.new_price = row.new_price
- this.form.count = row.count
- this.form.remark = row.remark
- this.form.id = row.id
- this.editPriceDialogVisible = true
- },
- upatePrice(){
- for(let i=0;i<this.tableData.length;i++){
- if(this.form.id == this.tableData[i].id){
- this.tableData[i].good_name = this.form.good_name
- this.tableData[i].packing_price = this.form.packing_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
- },
- saveAdjustPrice(){
- for(let i=0;i<this.tableData.length;i++){
- this.tableData[i].buy_price = this.tableData[i].buy_price.toString()
- this.tableData[i].packing_price = this.tableData[i].packing_price.toString()
- this.tableData[i].new_price = this.tableData[i].new_price.toString()
- this.tableData[i].count = parseInt(this.tableData[i].count)
- }
- var params= {
- tableData:this.tableData,
- }
- console.log("parasm222",params)
- saveAdjustPrice(params).then(response=>{
- if(response.data.state == 1){
- var msg = response.data.data.msg
- console.log("msg",msg)
- this.$message.success("保存成功!")
- this.dialogVisible = false
- }
- })
- },
- getAllStockPrice(){
- var params = {
- keyword:this.searchKey,
- start_time:this.start_time,
- end_time:this.end_time,
- }
- console.log("params",params)
- getAllStockPrice(params).then(response=>{
- if(response.data.state == 1){
- var list = response.data.data.list
- console.log("zhognguoffs",list)
- this.tableList = list
- var doctor = response.data.data.doctor
- console.log("doctor",doctor)
- this.doctorList = doctor
- }
- })
- },
- getDoctor(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){
- console.log("val23232322323",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
- }
-
- },
- SaveCheckedPrice(){
-
- var params = {
- ids:this.ids,
- check_time:this.getTime(this.check_time),
- checker:this.checker,
- }
- console.log("params",params)
- SaveCheckedPrice(params).then(response=>{
- if(response.data.state == 1){
- var adjustPrice = response.data.data.adjustPrice
- this.$message.success("保存成功")
- this.getAllStockPrice()
- this.checkDialogVisible = false
- }
- })
- }
- },
- created(){
- let tableHeight = document.body.clientHeight - 200;
- this.tableHeight = tableHeight
- this.getAllStockPrice()
- },
- 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>
|