|
|
|
@ -3,39 +3,89 @@
|
|
|
|
|
<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">
|
|
|
|
|
<el-form-item label="申请陪同人" prop="user_id_pt">
|
|
|
|
|
<el-select v-model="pt_form.user_id_pt" filterable placeholder="请选择陪同人">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in ptUserArray"
|
|
|
|
|
:key="item.user_id"
|
|
|
|
|
:label="item.real_name"
|
|
|
|
|
:value="item.user_id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<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
|
|
|
|
|
v-for="item in ptUserArray"
|
|
|
|
|
:key="item.user_id"
|
|
|
|
|
:label="item.real_name"
|
|
|
|
|
:value="item.user_id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</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
|
|
|
|
|
}
|
|
|
|
|
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>
|
|
|
|
|