领用申请

duizhaopin_ui
cxw 2 years ago
parent 0d03e3d4ef
commit f8340004ac

@ -2,5 +2,5 @@
ENV = 'development' ENV = 'development'
# base api # base api
VUE_APP_BASE_API = 'http://127.0.0.1:9001' VUE_APP_BASE_API = 'http://192.168.1.114:9001'
VUE_APP_FACE_API = 'http://127.0.0.1:5000' VUE_APP_FACE_API = 'http://192.168.1.114:5000'

@ -2,6 +2,6 @@
ENV = 'production' ENV = 'production'
# base api # base api
VUE_APP_BASE_API = 'http://127.0.0.1:9001' VUE_APP_BASE_API = 'http://192.168.1.114:9001'
VUE_APP_FACE_API ='http://127.0.0.1:5000' VUE_APP_FACE_API ='http://192.168.1.114:5000'

@ -4,6 +4,6 @@ NODE_ENV = production
ENV = 'staging' ENV = 'staging'
# base api # base api
VUE_APP_BASE_API = 'http://127.0.0.1:9001' VUE_APP_BASE_API = 'http://192.168.1.114:9001'
VUE_APP_FACE_API='http://127.0.0.1:5000' VUE_APP_FACE_API='http://192.168.1.114:5000'

@ -3,9 +3,32 @@
<div class="title">创建申请</div> <div class="title">创建申请</div>
<div class="header"> <div class="header">
<el-button type="primary" plain @click="openDialogTableVisible"><i class="el-icon-edit" />申请</el-button> <el-button type="primary" plain @click="openDialogTableVisible"><i class="el-icon-edit" />申请</el-button>
<el-button type="primary" plain @click="handleCheck"><i class="el-icon-edit" />详情查看</el-button>
<el-dialog :close-on-click-modal="false" :visible.sync="dialogHistoryVisible" width="60%" title="申请详情">
<div class="box">
<el-scrollbar style="height: 100%">
<el-table
v-loading="loadingHistory"
element-loading-text="拼命加载中"
:header-cell-style="headerStyle"
:data="historyData"
height="420"
@close="dialogHistoryClose"
>
<el-table-column align="center" type="index" width="50" label="序号" />
<el-table-column align="center" property="name" label="试剂名称" />
<el-table-column align="center" property="purity" label="纯度" />
<el-table-column align="center" property="speci" label="规格" />
<el-table-column align="center" property="num" label="数量" />
</el-table>
</el-scrollbar>
</div>
</el-dialog>
<el-dialog title="确认提交申请" :visible.sync="dialogTableVisible"> <el-dialog title="确认提交申请" :visible.sync="dialogTableVisible">
<el-form :inline="true" :model="pt_form" :rules="rules" ref="pt_form" class="demo-form-inline"> <div style="display:flex;flex-direction: row;">
<el-form :inline="true" :model="pt_form" :rules="rules" ref="pt_form" class="demo-form-inline" style="padding-top:13px">
<el-form-item label="申请陪同人" prop="user_id_pt"> <el-form-item label="申请陪同人" prop="user_id_pt">
<el-select v-model="pt_form.user_id_pt" filterable placeholder="请选择陪同人"> <el-select v-model="pt_form.user_id_pt" filterable placeholder="请选择陪同人">
<el-option <el-option
@ -17,25 +40,52 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="header">
<el-input v-model="seach_word" clearable placeholder="请输入试剂名称" />
<el-button type="primary" icon="el-icon-search" @click="get_drug_group()"></el-button>
</div>
</div>
<el-table :data="checkList"> <el-table :data="tableData" max-height="250" style="height:250px;padding-bottom: 50px;">
<el-table-column type="index" align="center" width="50" label="序号" />
<el-table-column prop="name" show-overflow-tooltip label="试剂名称" align="center" />
<el-table-column prop="drug_num" show-overflow-tooltip label="试剂数量" align="center" />
<el-table-column prop="speci" show-overflow-tooltip label="规格" align="center" />
<el-table-column prop="purity" show-overflow-tooltip label="纯度" align="center" />
<el-table-column prop="distributor" show-overflow-tooltip label="经销商" align="center" />
<el-table-column prop="manufacturer" show-overflow-tooltip label="生产厂家" align="center" />
<el-table-column
fixed="right"
label="操作"
width="100">
<template slot-scope="scope">
<el-button @click="handleClick(scope.row)" type="text" size="small">添加申请</el-button>
</template>
</el-table-column>
</el-table>
<el-table-column align="center" type="index" width="50" label="序号" /> <el-table :data="checkList" max-height="250" style="height:250px;padding-bottom: 50px;">
<el-table-column type="index" align="center" width="50" label="序号" />
<el-table-column prop="name" show-overflow-tooltip label="试剂名称" align="center" /> <el-table-column prop="name" show-overflow-tooltip label="试剂名称" align="center" />
<el-table-column prop="drug_num" show-overflow-tooltip label="剩余数量" align="center" /> <el-table-column prop="num" show-overflow-tooltip label="申请数量" align="center" />
<el-table-column prop="speci" show-overflow-tooltip label="规格" align="center" /> <el-table-column prop="speci" show-overflow-tooltip label="规格" align="center" />
<el-table-column prop="purity" show-overflow-tooltip label="纯度" align="center" /> <el-table-column prop="purity" show-overflow-tooltip label="纯度" align="center" />
<el-table-column prop="num" show-overflow-tooltip label="领用数量" align="center"> <el-table-column prop="distributor" show-overflow-tooltip label="经销商" align="center" />
<el-table-column prop="manufacturer" show-overflow-tooltip label="生产厂家" align="center" />
<el-table-column
fixed="right"
label="操作"
width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number type="number" :max="Number(scope.row.drug_num)" :min="0" v-model="scope.row.num" size="small"></el-input-number> <el-button @click="cancelClick(scope.row)" type="text" size="small">取消申请</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div slot="footer" style="text-align: center"> <div slot="footer" style="text-align: center">
<el-button @click="dialogTableClose"></el-button> <el-button @click="dialogTableClose"></el-button>
<el-button type="primary" @click="create_apply(pt_form)"></el-button> <el-button type="primary" @click="create_apply(pt_form)"></el-button>
</div> </div>
</el-dialog> </el-dialog>
<div class="header-right"> <div class="header-right">
@ -45,28 +95,35 @@
<el-table <el-table
stripe stripe
ref="multipleTable" ref="multipleTable"
:data="tableData" :data="tableData1"
:header-cell-style="headerStyle" :header-cell-style="headerStyle"
@select="handleSelection" @select="handleSelection"
row-key="medicament_id" row-key="medicament_id"
height="69vh" height="69vh"
class="table-style" class="table-style"
> >
<el-table-column :reserve-selection="true" type="selection" width="55" align="center" label="选择" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" align="center" width="50" label="序号" /> <el-table-column align="center" type="index" width="50" label="序号" />
<el-table-column prop="name" show-overflow-tooltip label="试剂名称" align="center" /> <el-table-column prop="user_name" show-overflow-tooltip label="用户名称" align="center" />
<el-table-column prop="drug_num" show-overflow-tooltip label="试剂数量" align="center" /> <el-table-column prop="user_name_pt" show-overflow-tooltip label="陪同用户名称" align="center" />
<el-table-column prop="speci" show-overflow-tooltip label="规格" align="center" /> <el-table-column prop="use_content" show-overflow-tooltip label="试剂详情" align="center" />
<el-table-column prop="purity" show-overflow-tooltip label="纯度" align="center" /> <el-table-column prop="create_date" show-overflow-tooltip label="申请时间" align="center" />
<el-table-column prop="distributor" show-overflow-tooltip label="经销商" align="center" /> <el-table-column prop="is_solve" show-overflow-tooltip label="状态" align="center">
<el-table-column prop="manufacturer" show-overflow-tooltip label="生产厂家" align="center" /> <template slot-scope="scope">
<el-tag :type="statusColorMap[scope.row.is_solve]">{{ statusMap[scope.row.is_solve] }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="solve_user_name" show-overflow-tooltip label="审批人1" align="center" />
<el-table-column prop="solve_user_pt_name" show-overflow-tooltip label="审批人2" align="center" />
<el-table-column prop="solve_date" show-overflow-tooltip label="审批时间" align="center" />
<el-table-column prop="information" show-overflow-tooltip label="备注" align="center" />
</el-table> </el-table>
<div class="my-pagination" style="text-align: center"> <div class="my-pagination" style="text-align: center">
<el-pagination <el-pagination
background background
layout="prev, pager, next" layout="prev, pager, next"
:current-page.sync="page" :current-page.sync="page"
:total="total" :total="total1"
:page-size.sync="page_size" :page-size.sync="page_size"
@current-change="pageChange" @current-change="pageChange"
/> />
@ -81,16 +138,22 @@ import {
get_drug_group_list, get_drug_group_list,
add_apply add_apply
} from '@/api/reagent/createapply' } from '@/api/reagent/createapply'
import {
get_apply_list,
} from '@/api/reagent/applymanage'
export default { export default {
name: 'CreateApply', name: 'CreateApply',
data() { data() {
return { return {
page: 1, page: 1,
page_size: 15, page_size: 10,
seach_word:'',
total: 0, total: 0,
total1: 0,
client_id: '', client_id: '',
dialogVisible: false, dialogVisible: false,
tableData: [], tableData: [],
tableData1: [],
headerStyle: { 'background': '#E6E6E6' }, headerStyle: { 'background': '#E6E6E6' },
multipleSelection: [], multipleSelection: [],
handleSelectionSelection: [], handleSelectionSelection: [],
@ -110,6 +173,8 @@ export default {
pt_form:{ pt_form:{
user_id_pt: '', user_id_pt: '',
}, },
statusColorMap: ['warning','success','danger'],
statusMap: ['未处理', '已处理','已驳回'],
rules: { rules: {
user_id_pt: [ user_id_pt: [
{ required: true, message: '请选择陪同人', trigger: 'change' } { required: true, message: '请选择陪同人', trigger: 'change' }
@ -119,33 +184,106 @@ export default {
}, },
created () { created () {
this.client_id = this.$store.getters.currentOptions[0].client_id this.client_id = this.$store.getters.currentOptions[0].client_id
this.get_apply()
this.get_drug_group() this.get_drug_group()
this.get_pt_user() this.get_pt_user()
}, },
methods: { methods: {
//
handleSelection(selection){ handleSelection(selection){
var that =this var that =this
that.checkList =selection that.handleSelectionSelection =selection
},
//
handleCheck() {
if (this.handleSelectionSelection.length === 1) {
this.dialogHistoryVisible = true
this.historyData = JSON.parse(this.handleSelectionSelection[0].use_content)
} else {
this.$message.warning("选择一条记录操作!")
}
},
//
dialogHistoryClose() {
this.dialogHistoryVisible = false
this.historyData = []
},
//
handleClick(row){
var that =this
that.$prompt('请输入数量', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /^[1-9]\d*$/,
inputErrorMessage: '请输入数字'
}).then(({ value }) => {
if(value>row.drug_num){
that.$message({
type: 'info',
message: '余量不足'
});
}else{
row.num =value
console.log(row.name,that.checkList)
var result = that.checkList.filter(x => x.name === row.name);
console.log(result,'111')
if (result.length>0){
that.$message({
type: 'info',
message: '禁止重复添加'
});
}else{
that.checkList.push(row)
}
// that.tableData.splice(row.$index, 1)
}
}).catch(() => {
that.$message({
type: 'info',
message: '取消输入'
});
});
},
//
cancelClick(row){
var that =this
let getLocation = that.checkList.indexOf(row);
that.checkList.splice(getLocation, 1)
}, },
//
get_drug_group: function() { get_drug_group: function() {
const data = { const data = {
client_id: this.client_id, page:1,
page:this.page, seach_word:this.seach_word,
page_size: this.page_size page_size: 10000
} }
get_drug_group_list(stringify(data)).then(rsp => { get_drug_group_list(stringify(data)).then(rsp => {
console.log("rsp.data.data_list>>", rsp.data.data_list) console.log("rsp.data.data_list>>", rsp.data.data_list)
rsp.data.data_list.forEach((value , index) => {
value['num'] = 1
})
this.tableData = this.addDataIndex(rsp.data.data_list) this.tableData = this.addDataIndex(rsp.data.data_list)
this.total = rsp.data.total_count this.total = rsp.data.total_count
}) })
}, },
//
get_apply(){
const data = {
page:this.page,
page_size: this.page_size
}
get_apply_list(stringify(data)).then(rsp => {
console.log("apply>>>", rsp)
this.tableData1 = rsp.data.data_list
this.total1 = rsp.data.total_count
})
},
//
get_pt_user() { get_pt_user() {
console.log("jjj") console.log("jjj")
const data = { const data = {
page: this.page, page: 1,
page_size: 10000, page_size: 10000,
user_id:this.$store.state.user.id, user_id:this.$store.state.user.id,
user_code: this.user_code, user_code: this.user_code,
@ -160,13 +298,17 @@ export default {
}) })
console.log("giao") console.log("giao")
}, },
//
create_apply(pt_from){ create_apply(pt_from){
var that =this var that =this
let datalist = that.checkList.map((item) => { let datalist = that.checkList.map((item) => {
return Object.assign({}, { name: item.name, num: item.num,client_id: item.client_id, purity: item.purity, speci: item.speci}) return Object.assign({}, { name: item.name, num: item.num,client_id: item.client_id, purity: item.purity, speci: item.speci})
}) })
if (pt_from.user_id_pt === '') { if (pt_from.user_id_pt === '') {
alert("请选择陪同人"); that.$message({
type: 'info',
message: '请选择陪同人'
});
}else{ }else{
const data = { const data = {
user_id: this.$store.state.user.id, user_id: this.$store.state.user.id,
@ -180,13 +322,15 @@ export default {
// //
this.$refs.multipleTable.clearSelection(); this.$refs.multipleTable.clearSelection();
that.checkList=[] that.checkList=[]
this.get_apply()
} }
}) })
} }
}, },
//
pageChange(page) { pageChange(page) {
this.page = page this.page = page
this.get_drug_group() this.get_apply()
}, },
addDataIndex(initData){ addDataIndex(initData){
for (let i = 0; i < initData.length; i++) { for (let i = 0; i < initData.length; i++) {
@ -194,35 +338,20 @@ export default {
} }
return initData return initData
}, },
//
handleRefresh() { handleRefresh() {
this.get_apply()
this.get_drug_group() this.get_drug_group()
}, },
handleApply() { //
const data = {
client_id: this.client_id
}
get_drug_list(stringify(data)).then(rsp => {
this.multipleSelection = rsp.data
})
this.dialogVisible = true
},
onClose() {
this.multipleSelection = []
},
close() {
this.dialogVisible = false
this.multipleSelection = []
},
openDialogTableVisible(){ openDialogTableVisible(){
if (this.checkList.length === 0 ){
alert("未选择");
} else {
this.dialogTableVisible = true this.dialogTableVisible = true
}
}, },
//
dialogTableClose() { dialogTableClose() {
this.user_id_pt = '' this.user_id_pt = ''
this.dialogTableVisible = false this.dialogTableVisible = false
this.checkList=[]
}, },
} }
} }
@ -264,12 +393,6 @@ export default {
} }
</style> </style>
<style scoped>
.table-style /deep/ .el-table-column--selection.is-leaf .el-checkbox {
display: none;
}
</style>
<style> <style>
/* 1,必须去掉scoped否则overflow-x: hidden失效 */ /* 1,必须去掉scoped否则overflow-x: hidden失效 */
.box { .box {
@ -283,6 +406,6 @@ export default {
overflow-x: hidden; overflow-x: hidden;
} }
.el-dialog__body { .el-dialog__body {
height: 500px; height: 600px !important;
} }
</style> </style>

@ -49,7 +49,8 @@
<el-table :data="tableData" max-height="250" style="height:250px;padding-bottom: 50px;"> <el-table :data="tableData" max-height="250" style="height:250px;padding-bottom: 50px;">
<el-table-column type="index" align="center" width="50" label="序号" /> <el-table-column type="index" align="center" width="50" label="序号" />
<el-table-column prop="name" show-overflow-tooltip label="试剂名称" align="center" /> <el-table-column prop="name" show-overflow-tooltip label="试剂名称" align="center" />
<el-table-column prop="drug_num" show-overflow-tooltip label="试剂数量" align="center" /> <el-table-column prop="remain" show-overflow-tooltip label="余量" align="center" />
<el-table-column prop="bar_code" show-overflow-tooltip label="编号" align="center" />
<el-table-column prop="speci" show-overflow-tooltip label="规格" align="center" /> <el-table-column prop="speci" show-overflow-tooltip label="规格" align="center" />
<el-table-column prop="purity" show-overflow-tooltip label="纯度" align="center" /> <el-table-column prop="purity" show-overflow-tooltip label="纯度" align="center" />
<el-table-column prop="distributor" show-overflow-tooltip label="经销商" align="center" /> <el-table-column prop="distributor" show-overflow-tooltip label="经销商" align="center" />
@ -67,7 +68,8 @@
<el-table :data="checkList" max-height="250" style="height:250px;padding-bottom: 50px;"> <el-table :data="checkList" max-height="250" style="height:250px;padding-bottom: 50px;">
<el-table-column type="index" align="center" width="50" label="序号" /> <el-table-column type="index" align="center" width="50" label="序号" />
<el-table-column prop="name" show-overflow-tooltip label="试剂名称" align="center" /> <el-table-column prop="name" show-overflow-tooltip label="试剂名称" align="center" />
<el-table-column prop="num" show-overflow-tooltip label="申请数量" align="center" /> <el-table-column prop="remain" show-overflow-tooltip label="余量" align="center" />
<el-table-column prop="bar_code" show-overflow-tooltip label="编号" align="center" />
<el-table-column prop="speci" show-overflow-tooltip label="规格" align="center" /> <el-table-column prop="speci" show-overflow-tooltip label="规格" align="center" />
<el-table-column prop="purity" show-overflow-tooltip label="纯度" align="center" /> <el-table-column prop="purity" show-overflow-tooltip label="纯度" align="center" />
<el-table-column prop="distributor" show-overflow-tooltip label="经销商" align="center" /> <el-table-column prop="distributor" show-overflow-tooltip label="经销商" align="center" />
@ -212,39 +214,50 @@ export default {
// //
handleClick(row){ handleClick(row){
var that =this var that =this
that.$prompt('请输入数量', '提示', { // that.$prompt('', '', {
confirmButtonText: '确定', // confirmButtonText: '',
cancelButtonText: '取消', // cancelButtonText: '',
inputPattern: /^[1-9]\d*$/, // inputPattern: /^[1-9]\d*$/,
inputErrorMessage: '请输入数字' // inputErrorMessage: ''
}).then(({ value }) => { // }).then(({ value }) => {
if(value>row.drug_num){ // if(value>row.drug_num){
that.$message({ // that.$message({
type: 'info', // type: 'info',
message: '余量不足' // message: ''
}); // });
}else{ // }else{
row.num =value // row.num =value
console.log(row.name,that.checkList) // console.log(row.name,that.checkList)
var result = that.checkList.filter(x => x.name === row.name); // var result = that.checkList.filter(x => x.name === row.name);
console.log(result,'111') // console.log(result,'111')
if (result.length>0){ // if (result.length>0){
// that.$message({
// type: 'info',
// message: ''
// });
// }else{
// that.checkList.push(row)
// }
// // that.tableData.splice(row.$index, 1)
// }
// }).catch(() => {
// that.$message({
// type: 'info',
// message: ''
// });
// });
var result = that.checkList.filter(item => item).map(item => item.bar_code);
if(result.indexOf(row.bar_code) !=-1){
that.$message({ that.$message({
type: 'info', type: 'info',
message: '禁止重复添加' message: '不可重复添加'
}); });
}else{ }else{
that.checkList.push(row) that.checkList.push(row)
let getLocation = that.tableData.indexOf(row);
that.tableData.splice(getLocation, 1)
} }
// that.tableData.splice(row.$index, 1)
}
}).catch(() => {
that.$message({
type: 'info',
message: '取消输入'
});
});
}, },
// //
cancelClick(row){ cancelClick(row){
@ -254,6 +267,7 @@ export default {
}, },
// //
get_drug_group: function() { get_drug_group: function() {
var that =this
const data = { const data = {
page:1, page:1,
seach_word:this.seach_word, seach_word:this.seach_word,
@ -261,7 +275,14 @@ export default {
} }
get_drug_group_list(stringify(data)).then(rsp => { get_drug_group_list(stringify(data)).then(rsp => {
console.log("rsp.data.data_list>>", rsp.data.data_list) console.log("rsp.data.data_list>>", rsp.data.data_list)
this.tableData = this.addDataIndex(rsp.data.data_list) var datalist=[]
var result = that.checkList.filter(item => item).map(item => item.bar_code);
rsp.data.data_list.forEach(item => {
if (result.indexOf(item.bar_code) ==-1) {
datalist.push(item)
}
})
this.tableData = this.addDataIndex(datalist)
this.total = rsp.data.total_count this.total = rsp.data.total_count
}) })
}, },

@ -913,7 +913,7 @@ export default {
}, },
// form // form
handleReagentAddForm(obj) { handleReagentAddForm(obj) {
obj.name = obj.value obj.name = obj.name
if (this.reagentAddFormTitle.indexOf('新增') !== -1) { if (this.reagentAddFormTitle.indexOf('新增') !== -1) {
this.reagentAddTmpData.push(obj) this.reagentAddTmpData.push(obj)
} else { } else {

Loading…
Cancel
Save