duizhaopin_ui
cxw 2 years ago
parent 520690b494
commit d829337ad9

@ -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.101:9001'
VUE_APP_FACE_API = 'http://192.168.1.101: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.101:9001'
VUE_APP_FACE_API ='http://192.168.1.101: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.101:9001'
VUE_APP_FACE_API='http://192.168.1.101:5000'

@ -152,3 +152,10 @@ export function dowload_putin_acceptance_record(data) {
data
})
}
export function dowload(data) {
return request_server({
url: '/api/shengou/dowload',
params: data
})
}

@ -0,0 +1,41 @@
import request from '@/utils/request'
export function get_list(data) {
return request({
url: '/api/shengou/get_list',
method: 'post',
data
})
}
export function add(data) {
return request({
url: '/api/shengou/add',
method: 'post',
data
})
}
export function update(data) {
return request({
url: '/api/shengou/update',
method: 'post',
data
})
}
export function solve(data) {
return request({
url: '/api/shengou/solve',
method: 'post',
data
})
}
export function del(data) {
return request({
url: '/api/shengou/del',
method: 'post',
data
})
}

@ -194,7 +194,7 @@ export function getALLRouter(data) {
{
name: 'reagent',
router: rasr[0],
title: '高危化品'
title: '易制毒易制爆'
},
{
name: 'standard',

@ -1,5 +1,5 @@
import Layout from '@/layout'
// 高危化品管理路由
// 易制毒易制爆管理路由
const reagentRouter = [
{
path: '/reagent/mainoverview',
@ -85,6 +85,34 @@ const reagentRouter = [
}
]
},
{
path: '/reagent/buy',
component: Layout,
redirect: '/reagent/buy/index',
meta: { classification: 'reagent',module_code: 'DrugPurchase'},
children: [
{
path: 'index',
name: 'Buy',
component: () => import('@/views/reagent/buy/index'),
meta: { title: '采购', icon: '请购', classification: 'reagent'}
}
]
},
{
path: '/reagent/purchaseapproval',
component: Layout,
redirect: '/reagent/purchaseapproval/index',
meta: { classification: 'reagent',module_code: 'DrugPurchaseApproval'},
children: [
{
path: 'index',
name: 'PurchaseApproval',
component: () => import('@/views/reagent/purchaseapproval/index'),
meta: { title: '采购审批', icon: '请购', classification: 'reagent'}
}
]
},
{
path: '/reagent/warehousing',
component: Layout,
@ -95,7 +123,7 @@ const reagentRouter = [
path: 'index',
name: 'Warehousing',
component: () => import('@/views/reagent/warehousing/index'),
meta: { title: '高危化品入库', icon: '试剂入库', classification: 'reagent' }
meta: { title: '易制毒易制爆入库', icon: '试剂入库', classification: 'reagent' }
}
]
},
@ -109,7 +137,7 @@ const reagentRouter = [
// path: 'index',
// name: 'Receiving',
// component: () => import('@/views/reagent/receivingandreturn/index'),
// meta: { title: '高危化品领用', icon: '试剂领用', classification: 'reagent' }
// meta: { title: '易制毒易制爆领用', icon: '试剂领用', classification: 'reagent' }
// }
// ]
// },
@ -123,7 +151,7 @@ const reagentRouter = [
path: 'index',
name: 'SendBack',
component: () => import('@/views/reagent/receivingandreturn/index'),
meta: { title: '高危化品归还', icon: '试剂归还', classification: 'reagent' }
meta: { title: '易制毒易制爆归还', icon: '试剂归还', classification: 'reagent' }
}
]
},
@ -137,7 +165,7 @@ const reagentRouter = [
path: 'index',
name: 'createapply',
component: () => import('@/views/reagent/createapply/index'),
meta: { title: '高危化品创建申请', icon: '创建申请', classification: 'reagent' }
meta: { title: '易制毒易制爆创建申请', icon: '创建申请', classification: 'reagent' }
}
]
},
@ -151,7 +179,7 @@ const reagentRouter = [
path: 'index',
name: 'applymanagement',
component: () => import('@/views/reagent/applymanagement/index'),
meta: { title: '高危化品申请管理', icon: '申请管理', classification: 'reagent' }
meta: { title: '易制毒易制爆申请管理', icon: '申请管理', classification: 'reagent' }
}
]
},
@ -165,7 +193,7 @@ const reagentRouter = [
path: 'index',
name: 'weightregistration',
component: () => import('@/views/reagent/weightregistration/index'),
meta: { title: '高危化品称重登记', icon: '称重登记', classification: 'reagent' }
meta: { title: '易制毒易制爆称重登记', icon: '称重登记', classification: 'reagent' }
}
]
},
@ -179,7 +207,7 @@ const reagentRouter = [
// path: 'index',
// name: 'weighing',
// component: () => import('@/views/reagent/weighing/index'),
// meta: { title: '高危化品称重', icon: '试剂称重', classification: 'reagent' }
// meta: { title: '易制毒易制爆称重', icon: '试剂称重', classification: 'reagent' }
// }
// ]
// },
@ -193,7 +221,7 @@ const reagentRouter = [
path: 'index',
name: 'Inventory',
component: () => import('@/views/reagent/inventory/index'),
meta: { title: '高危化品盘点', icon: '库存盘点', classification: 'reagent' }
meta: { title: '易制毒易制爆盘点', icon: '库存盘点', classification: 'reagent' }
}
]
},
@ -221,13 +249,13 @@ const reagentRouter = [
path: '/reagent/management',
component: Layout,
redirect: '/reagent/management/index',
meta: { title: '高危化品管理', icon: '试剂管理', classification: 'reagent', module_code: 'DrugIndex' },
meta: { title: '易制毒易制爆管理', icon: '试剂管理', classification: 'reagent', module_code: 'DrugIndex' },
children: [
{
path: 'index',
name: 'Management',
component: () => import('@/views/reagent/management/data/index'),
meta: { title: '高危化品管理', icon: '试剂管理', classification: 'reagent' }
meta: { title: '易制毒易制爆管理', icon: '试剂管理', classification: 'reagent' }
}
]
},
@ -273,20 +301,6 @@ const reagentRouter = [
// }
// ]
// },
{
path: '/reagent/buy',
component: Layout,
redirect: '/reagent/buy/index',
meta: { classification: 'reagent',module_code: 'Purchase'},
children: [
{
path: 'index',
name: 'Buy',
component: () => import('@/views/reagent/buy/index'),
meta: { title: '请购', icon: '请购', classification: 'reagent'}
}
]
},
{
path: '/gotohome',
redirect: '/home',

@ -200,7 +200,7 @@ export function getALLRouter(data) {
{
name: 'reagent',
router: rasr[0],
title: '高危化品管理'
title: '易制毒易制爆管理'
},
{
name: 'standard',

@ -1,5 +1,5 @@
const mapTitle = {
'reagent': '高危化品',
'reagent': '易制毒易制爆',
'user': 'user',
'standard': '危化品',
'consumables': '对照品',

@ -1,15 +1,477 @@
<template>
<h1>
请购
</h1>
<div class="main-container-text">
<div class="title">采购申请</div>
<div class="header">
<el-button type="primary" plain @click="openDialogTableVisible"><i class="el-icon-edit" />新建采购申请单</el-button>
<!-- <el-dialog :title="dialogTitile" :close-on-click-modal="false" :visible.sync="dialogVisible" @close="onClose">
<el-row :gutter="15">
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="80px">
<el-col :span="24">
<el-form-item label="柜体名称" prop="client_name">
<el-input
v-model="formData.client_name"
placeholder="请输入柜体名称"
clearable
:style="{width: '100%'}"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="柜体标题" prop="client_title">
<el-input
v-model="formData.client_title"
placeholder="请输入柜体标题"
clearable
:style="{width: '100%'}"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="柜体序号" prop="client_code">
<el-input v-model="formData.client_code" placeholder="请输入柜体序号" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="柜体类型" prop="client_type">
<el-input v-model="formData.client_type" placeholder="请输入柜体类型" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="柜体位置" prop="place">
<el-autocomplete
v-model="formData.place"
class="inline-input"
:style="{width: '100%'}"
:fetch-suggestions="querySearchAsync"
clearable
placeholder="请输入柜体位置"
@select="handleSelect"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单元数量" prop="layer_num">
<el-input v-model="formData.layer_num" placeholder="请输入柜体单元数量" clearable :style="{width: '100%'}" :disabled="dialogTitile =='编辑柜体信息' ? true:false" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="柜体滤芯 生产日期" prop="filter_production_date">
<el-date-picker
v-model="formData.filter_production_date"
style="width: 100%"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择柜体滤芯 生产日期"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="提醒滤芯 到期提前" prop="filter_shelf_life_warning_value">
<el-input
v-model="formData.filter_shelf_life_warning_value"
placeholder="请输入提醒滤芯 到期提前"
clearable
:style="{width: '100%'}"
>
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人" prop="contact_people_name">
<el-input v-model="formData.contact_people_name" placeholder="请输入联系人" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="contact_phone">
<el-input v-model="formData.contact_phone" placeholder="请输入联系电话" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="说明" prop="description">
<el-input v-model="formData.description" placeholder="请输入说明" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
</el-form>
</el-row>
<div slot="footer" style="text-align: center">
<el-button @click="onClose"></el-button>
<el-button type="primary" @click="handelConfirm"></el-button>
</div>
</el-dialog> -->
<el-dialog
title="撤销采购单申请"
:visible.sync="centerDialogVisible"
width="30%"
center>
<span>是否确认撤销</span>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false"> </el-button>
<el-button type="primary" @click="backcheck()"> </el-button>
</span>
</el-dialog>
<div class="header-right">
<el-button icon="el-icon-refresh" circle @click="handleRefresh" />
</div>
</div>
<el-table
stripe
ref="multipleTable"
:data="tableData"
:header-cell-style="headerStyle"
@select="handleSelection"
row-key="medicament_id"
height="69vh"
class="table-style"
>
<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="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-column
fixed="right"
label="操作"
align="center"
width="250">
<template slot-scope="scope">
<el-button @click="handleCheck(scope.row)" type="text" size="small">修改申请单</el-button>
<el-button @click="handback(scope.row)" type="text" size="small">撤销申请单</el-button>
<el-button @click="handleExport(scope.row)" type="text" size="small">导出申请单</el-button>
</template>
</el-table-column>
</el-table>
<div class="my-pagination" style="text-align: center">
<el-pagination
background
layout="prev, pager, next"
:current-page.sync="page"
:total="total"
:page-size.sync="page_size"
@current-change="pageChange"
/>
</div>
</div>
</template>
<script>
import stringify from '@/utils/stringify'
import {
get_list,
add,
update,
solve,
del
} from '@/api/reagent/purchase'
import { dowload,click_dowload } from '@/api/reagent/dowload_file'
export default {
name: 'Buy'
name: 'Buy',
data() {
return {
page: 1,
page_size: 10,
total: 0,
tableData: [],
centerDialogVisible: false,
row_id:'',
statusColorMap: ['warning','success','danger'],
statusMap: ['未处理', '已处理','已驳回'],
seach_word:'',
total1: 0,
client_id: '',
dialogVisible: false,
tableData1: [],
headerStyle: { 'background': '#E6E6E6' },
multipleSelection: [],
handleSelectionSelection: [],
dialogHistoryVisible: false,
loadingHistory: false,
historyData: [],
name: '',
history_client_id: '',
value1: '',
value2: ['', ''],
history_page: 1,
history_page_size: 15,
history_total: 100,
dialogTableVisible: false,
checkList: [],
ptUserArray:[],
pt_form:{
user_id_pt: '',
},
rules: {
user_id_pt: [
{ required: true, message: '请选择陪同人', trigger: 'change' }
],
}
}
},
created () {
this.get_drug_group()
},
methods: {
//
get_drug_group: function() {
var that =this
const data = {
page:1,
page_size: 10
}
get_list(stringify(data)).then(rsp => {
console.log("rsp.data.data_list>>", rsp.data.data_list)
this.tableData = this.addDataIndex(rsp.data.data_list)
this.total = rsp.data.total_count
})
},
handleExport(row){
const data = {
id: row.id,
file_name: '请购单'
}
this.recordLoading = true
//
dowload(data).then(
res => {
this.$message.success(res.statusText)
click_dowload(data, res)
}
).finally(() => { this.recordLoading = false })
},
handback(row){
this.row_id =row.id
this.centerDialogVisible =true
},
backcheck(){
this.recordLoading = true
const data = {
id: this.row_id,
}
//
del(stringify(data)).then(
res => {
if (res.status ==0){
this.centerDialogVisible =false
this.$message.success(res.msg)
this.get_drug_group()
}else{
this.$message.error(res.msg)
}
}
).finally(() => { this.recordLoading = false })
},
//
handleSelection(selection){
var that =this
that.handleSelectionSelection =selection
},
//
handleCheck(row) {
this.dialogHistoryVisible = true
this.historyData = JSON.parse(row.use_content)
// 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
var result = that.checkList.filter(item => item).map(item => item.bar_code);
if(result.indexOf(row.bar_code) !=-1){
that.$message({
type: 'info',
message: '不可重复添加'
});
}else{
that.checkList.push(row)
let getLocation = that.tableData.indexOf(row);
that.tableData.splice(getLocation, 1)
}
},
//
cancelClick(row){
var that =this
let getLocation = that.checkList.indexOf(row);
that.checkList.splice(getLocation, 1)
},
//
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: 1,
page_size: 10000,
user_id:this.$store.state.user.id,
user_code: this.user_code,
real_name: this.real_name,
role_id: this.role_id,
is_enabled: this.is_enabled
}
console.log("hhhhh")
get_pt_user_list(stringify(data)).then(res => {
this.ptUserArray = res.data.data_list
console.log("res>>>", res)
})
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 === '') {
that.$message({
type: 'info',
message: '请选择陪同人'
});
}else{
const data = {
user_id: this.$store.state.user.id,
user_id_pt: pt_from.user_id_pt,
use_content: JSON.stringify(datalist),
}
add_apply(stringify(data)).then(rsp => {
console.log("rsp>>", rsp)
if (rsp.status==0){
this.dialogTableClose()
//
this.$refs.multipleTable.clearSelection();
that.checkList=[]
this.get_apply()
}
})
}
},
//
pageChange(page) {
this.page = page
this.get_apply()
},
addDataIndex(initData){
for (let i = 0; i < initData.length; i++) {
initData[i]["index"] = i
}
return initData
},
//
handleRefresh() {
this.get_apply()
this.get_drug_group()
},
//
openDialogTableVisible(){
this.dialogTableVisible = true
},
//
dialogTableClose() {
this.user_id_pt = ''
this.dialogTableVisible = false
this.checkList=[]
},
}
}
</script>
<style scoped>
<style lang="scss" scoped>
.main-container-text {
min-height: calc(100vh - 110px);
padding: 1rem;
margin: 1rem;
background: white;
.title {
font-size: 20px;
font-weight: bold;
color: #000000;
}
.header {
margin: 1rem 0 1rem 0;
.el-input {
width: 9.375rem;
margin-right: 1rem;
}
.el-select {
margin-right: 1rem;
}
.header-right {
float: right;
}
}
}
.add-item {
margin-bottom: 1rem;
}
</style>
<style>
/* 1,必须去掉scoped否则overflow-x: hidden失效 */
.box {
margin: 0 auto;
width: 95%;
height: 95%;
}
/* 2外包一个div,来减少对其他页面会有冲突此时缺少scoped */
.box .el-scrollbar__wrap {
overflow-x: hidden;
}
/* .el-dialog__body {
height: 600px !important;
} */
</style>

@ -0,0 +1,477 @@
<template>
<div class="main-container-text">
<div class="title">采购申请</div>
<div class="header">
<el-button type="primary" plain @click="openDialogTableVisible"><i class="el-icon-edit" />新建采购申请单</el-button>
<!-- <el-dialog :title="dialogTitile" :close-on-click-modal="false" :visible.sync="dialogVisible" @close="onClose">
<el-row :gutter="15">
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="80px">
<el-col :span="24">
<el-form-item label="柜体名称" prop="client_name">
<el-input
v-model="formData.client_name"
placeholder="请输入柜体名称"
clearable
:style="{width: '100%'}"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="柜体标题" prop="client_title">
<el-input
v-model="formData.client_title"
placeholder="请输入柜体标题"
clearable
:style="{width: '100%'}"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="柜体序号" prop="client_code">
<el-input v-model="formData.client_code" placeholder="请输入柜体序号" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="柜体类型" prop="client_type">
<el-input v-model="formData.client_type" placeholder="请输入柜体类型" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="柜体位置" prop="place">
<el-autocomplete
v-model="formData.place"
class="inline-input"
:style="{width: '100%'}"
:fetch-suggestions="querySearchAsync"
clearable
placeholder="请输入柜体位置"
@select="handleSelect"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单元数量" prop="layer_num">
<el-input v-model="formData.layer_num" placeholder="请输入柜体单元数量" clearable :style="{width: '100%'}" :disabled="dialogTitile =='编辑柜体信息' ? true:false" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="柜体滤芯 生产日期" prop="filter_production_date">
<el-date-picker
v-model="formData.filter_production_date"
style="width: 100%"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择柜体滤芯 生产日期"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="提醒滤芯 到期提前" prop="filter_shelf_life_warning_value">
<el-input
v-model="formData.filter_shelf_life_warning_value"
placeholder="请输入提醒滤芯 到期提前"
clearable
:style="{width: '100%'}"
>
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人" prop="contact_people_name">
<el-input v-model="formData.contact_people_name" placeholder="请输入联系人" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="contact_phone">
<el-input v-model="formData.contact_phone" placeholder="请输入联系电话" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="说明" prop="description">
<el-input v-model="formData.description" placeholder="请输入说明" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
</el-form>
</el-row>
<div slot="footer" style="text-align: center">
<el-button @click="onClose"></el-button>
<el-button type="primary" @click="handelConfirm"></el-button>
</div>
</el-dialog> -->
<el-dialog
title="撤销采购单申请"
:visible.sync="centerDialogVisible"
width="30%"
center>
<span>是否确认撤销</span>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false"> </el-button>
<el-button type="primary" @click="backcheck()"> </el-button>
</span>
</el-dialog>
<div class="header-right">
<el-button icon="el-icon-refresh" circle @click="handleRefresh" />
</div>
</div>
<el-table
stripe
ref="multipleTable"
:data="tableData"
:header-cell-style="headerStyle"
@select="handleSelection"
row-key="medicament_id"
height="69vh"
class="table-style"
>
<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="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-column
fixed="right"
label="操作"
align="center"
width="250">
<template slot-scope="scope">
<el-button @click="handleCheck(scope.row)" type="text" size="small">修改申请单</el-button>
<el-button @click="handback(scope.row)" type="text" size="small">撤销申请单</el-button>
<el-button @click="handleExport(scope.row)" type="text" size="small">导出申请单</el-button>
</template>
</el-table-column>
</el-table>
<div class="my-pagination" style="text-align: center">
<el-pagination
background
layout="prev, pager, next"
:current-page.sync="page"
:total="total"
:page-size.sync="page_size"
@current-change="pageChange"
/>
</div>
</div>
</template>
<script>
import stringify from '@/utils/stringify'
import {
get_list,
add,
update,
solve,
del
} from '@/api/reagent/purchase'
import { dowload,click_dowload } from '@/api/reagent/dowload_file'
export default {
name: 'Buy',
data() {
return {
page: 1,
page_size: 10,
total: 0,
tableData: [],
centerDialogVisible: false,
row_id:'',
statusColorMap: ['warning','success','danger'],
statusMap: ['未处理', '已处理','已驳回'],
seach_word:'',
total1: 0,
client_id: '',
dialogVisible: false,
tableData1: [],
headerStyle: { 'background': '#E6E6E6' },
multipleSelection: [],
handleSelectionSelection: [],
dialogHistoryVisible: false,
loadingHistory: false,
historyData: [],
name: '',
history_client_id: '',
value1: '',
value2: ['', ''],
history_page: 1,
history_page_size: 15,
history_total: 100,
dialogTableVisible: false,
checkList: [],
ptUserArray:[],
pt_form:{
user_id_pt: '',
},
rules: {
user_id_pt: [
{ required: true, message: '请选择陪同人', trigger: 'change' }
],
}
}
},
created () {
this.get_drug_group()
},
methods: {
//
get_drug_group: function() {
var that =this
const data = {
page:1,
page_size: 10
}
get_list(stringify(data)).then(rsp => {
console.log("rsp.data.data_list>>", rsp.data.data_list)
this.tableData = this.addDataIndex(rsp.data.data_list)
this.total = rsp.data.total_count
})
},
handleExport(row){
const data = {
id: row.id,
file_name: '请购单'
}
this.recordLoading = true
//
dowload(data).then(
res => {
this.$message.success(res.statusText)
click_dowload(data, res)
}
).finally(() => { this.recordLoading = false })
},
handback(row){
this.row_id =row.id
this.centerDialogVisible =true
},
backcheck(){
this.recordLoading = true
const data = {
id: this.row_id,
}
//
del(stringify(data)).then(
res => {
if (res.status ==0){
this.centerDialogVisible =false
this.$message.success(res.msg)
this.get_drug_group()
}else{
this.$message.error(res.msg)
}
}
).finally(() => { this.recordLoading = false })
},
//
handleSelection(selection){
var that =this
that.handleSelectionSelection =selection
},
//
handleCheck(row) {
this.dialogHistoryVisible = true
this.historyData = JSON.parse(row.use_content)
// 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
var result = that.checkList.filter(item => item).map(item => item.bar_code);
if(result.indexOf(row.bar_code) !=-1){
that.$message({
type: 'info',
message: '不可重复添加'
});
}else{
that.checkList.push(row)
let getLocation = that.tableData.indexOf(row);
that.tableData.splice(getLocation, 1)
}
},
//
cancelClick(row){
var that =this
let getLocation = that.checkList.indexOf(row);
that.checkList.splice(getLocation, 1)
},
//
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: 1,
page_size: 10000,
user_id:this.$store.state.user.id,
user_code: this.user_code,
real_name: this.real_name,
role_id: this.role_id,
is_enabled: this.is_enabled
}
console.log("hhhhh")
get_pt_user_list(stringify(data)).then(res => {
this.ptUserArray = res.data.data_list
console.log("res>>>", res)
})
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 === '') {
that.$message({
type: 'info',
message: '请选择陪同人'
});
}else{
const data = {
user_id: this.$store.state.user.id,
user_id_pt: pt_from.user_id_pt,
use_content: JSON.stringify(datalist),
}
add_apply(stringify(data)).then(rsp => {
console.log("rsp>>", rsp)
if (rsp.status==0){
this.dialogTableClose()
//
this.$refs.multipleTable.clearSelection();
that.checkList=[]
this.get_apply()
}
})
}
},
//
pageChange(page) {
this.page = page
this.get_apply()
},
addDataIndex(initData){
for (let i = 0; i < initData.length; i++) {
initData[i]["index"] = i
}
return initData
},
//
handleRefresh() {
this.get_apply()
this.get_drug_group()
},
//
openDialogTableVisible(){
this.dialogTableVisible = true
},
//
dialogTableClose() {
this.user_id_pt = ''
this.dialogTableVisible = false
this.checkList=[]
},
}
}
</script>
<style lang="scss" scoped>
.main-container-text {
min-height: calc(100vh - 110px);
padding: 1rem;
margin: 1rem;
background: white;
.title {
font-size: 20px;
font-weight: bold;
color: #000000;
}
.header {
margin: 1rem 0 1rem 0;
.el-input {
width: 9.375rem;
margin-right: 1rem;
}
.el-select {
margin-right: 1rem;
}
.header-right {
float: right;
}
}
}
.add-item {
margin-bottom: 1rem;
}
</style>
<style>
/* 1,必须去掉scoped否则overflow-x: hidden失效 */
.box {
margin: 0 auto;
width: 95%;
height: 95%;
}
/* 2外包一个div,来减少对其他页面会有冲突此时缺少scoped */
.box .el-scrollbar__wrap {
overflow-x: hidden;
}
/* .el-dialog__body {
height: 600px !important;
} */
</style>

@ -149,7 +149,7 @@
v-loading="tabsLoading"
element-loading-text="拼命加载中"
>
<el-tab-pane label="高危化品管理" name="first">
<el-tab-pane label="易制毒易制爆管理" name="first">
<el-checkbox
v-model="checkAll_drug_module_id"
:indeterminate="isIndeterminate_drug_module_id"

@ -184,7 +184,7 @@ export default {
role_id: undefined,
role_code: undefined,
role_name: undefined,
//
//
drug_module_id: [],
//
standard_module_id: [],

Loading…
Cancel
Save