领用申请

duizhaopin_ui
cxw 2 years ago
parent 0d03e3d4ef
commit f8340004ac

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

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

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

@ -3,9 +3,32 @@
<div class="title">创建申请</div>
<div class="header">
<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-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-select v-model="pt_form.user_id_pt" filterable placeholder="请选择陪同人">
<el-option
@ -17,25 +40,52 @@
</el-select>
</el-form-item>
</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="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="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">
<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>
</el-table-column>
</el-table>
<div slot="footer" style="text-align: center">
<el-button @click="dialogTableClose"></el-button>
<el-button type="primary" @click="create_apply(pt_form)"></el-button>
</div>
</el-dialog>
<div class="header-right">
@ -45,28 +95,35 @@
<el-table
stripe
ref="multipleTable"
:data="tableData"
:data="tableData1"
:header-cell-style="headerStyle"
@select="handleSelection"
row-key="medicament_id"
height="69vh"
class="table-style"
>
<el-table-column :reserve-selection="true" type="selection" width="55" align="center" 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="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 type="selection" width="55" align="center" />
<el-table-column align="center" type="index" width="50" label="序号" />
<el-table-column prop="user_name" show-overflow-tooltip label="用户名称" align="center" />
<el-table-column prop="user_name_pt" show-overflow-tooltip label="陪同用户名称" align="center" />
<el-table-column prop="use_content" show-overflow-tooltip label="试剂详情" align="center" />
<el-table-column prop="create_date" show-overflow-tooltip label="申请时间" align="center" />
<el-table-column prop="is_solve" 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>
<div class="my-pagination" style="text-align: center">
<el-pagination
background
layout="prev, pager, next"
:current-page.sync="page"
:total="total"
:total="total1"
:page-size.sync="page_size"
@current-change="pageChange"
/>
@ -81,16 +138,22 @@ import {
get_drug_group_list,
add_apply
} from '@/api/reagent/createapply'
import {
get_apply_list,
} from '@/api/reagent/applymanage'
export default {
name: 'CreateApply',
data() {
return {
page: 1,
page_size: 15,
page_size: 10,
seach_word:'',
total: 0,
total1: 0,
client_id: '',
dialogVisible: false,
tableData: [],
tableData1: [],
headerStyle: { 'background': '#E6E6E6' },
multipleSelection: [],
handleSelectionSelection: [],
@ -110,6 +173,8 @@ export default {
pt_form:{
user_id_pt: '',
},
statusColorMap: ['warning','success','danger'],
statusMap: ['未处理', '已处理','已驳回'],
rules: {
user_id_pt: [
{ required: true, message: '请选择陪同人', trigger: 'change' }
@ -119,33 +184,106 @@ export default {
},
created () {
this.client_id = this.$store.getters.currentOptions[0].client_id
this.get_apply()
this.get_drug_group()
this.get_pt_user()
},
methods: {
//
handleSelection(selection){
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() {
const data = {
client_id: this.client_id,
page:this.page,
page_size: this.page_size
page:1,
seach_word:this.seach_word,
page_size: 10000
}
get_drug_group_list(stringify(data)).then(rsp => {
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.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() {
console.log("jjj")
const data = {
page: this.page,
page: 1,
page_size: 10000,
user_id:this.$store.state.user.id,
user_code: this.user_code,
@ -160,13 +298,17 @@ export default {
})
console.log("giao")
},
//
create_apply(pt_from){
var that =this
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})
})
if (pt_from.user_id_pt === '') {
alert("请选择陪同人");
that.$message({
type: 'info',
message: '请选择陪同人'
});
}else{
const data = {
user_id: this.$store.state.user.id,
@ -180,13 +322,15 @@ export default {
//
this.$refs.multipleTable.clearSelection();
that.checkList=[]
this.get_apply()
}
})
}
},
//
pageChange(page) {
this.page = page
this.get_drug_group()
this.get_apply()
},
addDataIndex(initData){
for (let i = 0; i < initData.length; i++) {
@ -194,35 +338,20 @@ export default {
}
return initData
},
//
handleRefresh() {
this.get_apply()
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(){
if (this.checkList.length === 0 ){
alert("未选择");
} else {
this.dialogTableVisible = true
}
},
//
dialogTableClose() {
this.user_id_pt = ''
this.dialogTableVisible = false
this.checkList=[]
},
}
}
@ -264,12 +393,6 @@ export default {
}
</style>
<style scoped>
.table-style /deep/ .el-table-column--selection.is-leaf .el-checkbox {
display: none;
}
</style>
<style>
/* 1,必须去掉scoped否则overflow-x: hidden失效 */
.box {
@ -283,6 +406,6 @@ export default {
overflow-x: hidden;
}
.el-dialog__body {
height: 500px;
height: 600px !important;
}
</style>

@ -49,7 +49,8 @@
<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="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="purity" 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-column type="index" align="center" width="50" label="序号" />
<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="purity" 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){
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.$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: ''
// });
// });
var result = that.checkList.filter(item => item).map(item => item.bar_code);
if(result.indexOf(row.bar_code) !=-1){
that.$message({
type: 'info',
message: '禁止重复添加'
message: '不可重复添加'
});
}else{
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){
@ -254,6 +267,7 @@ export default {
},
//
get_drug_group: function() {
var that =this
const data = {
page:1,
seach_word:this.seach_word,
@ -261,7 +275,14 @@ export default {
}
get_drug_group_list(stringify(data)).then(rsp => {
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
})
},

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

Loading…
Cancel
Save