添加手动输入模板动态添加功能;

修复已入库后页面数据刷新问题
修复柜体禁止显示异常问题;
duizhaopin_ui
13507605001 2 years ago
parent 583ba74f4e
commit 0e8d97225c

@ -1,4 +1,4 @@
build/*.js build/*.js
src/assets src/*
public public
dist dist

@ -69,3 +69,12 @@ export function pring_bar_code(data) {
data data
}) })
} }
// /api/drug_tmplate/pring_bar_code
export function get_drug_group_list(data) {
return request({
url: '/api/drug_tmplate/get_drug_group_list',
method: 'post',
data
})
}

@ -4,7 +4,16 @@
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="80px"> <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="80px">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="试剂名称" prop="name"> <el-form-item label="试剂名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入试剂名称" clearable :style="{width: '100%'}" /> <!-- <el-input v-model="formData.name" placeholder="请输入试剂名称" clearable :style="{width: '100%'}" /> -->
<el-autocomplete
v-model="formData.value"
class="inline-input"
:style="{width: '100%'}"
:fetch-suggestions="querySearchAsync"
clearable
placeholder="请输入试剂名称"
@select="handleSelect"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
@ -125,6 +134,8 @@
<script> <script>
import { throttle } from '@/utils' import { throttle } from '@/utils'
import { get_use } from '@/api/reagent/customform' import { get_use } from '@/api/reagent/customform'
import { get_drug_group_list } from '@/api/reagent/warehousing'
export default { export default {
name: 'ReagentForm', name: 'ReagentForm',
// title dialog title // title dialog title
@ -137,6 +148,7 @@ export default {
data() { data() {
return { return {
formData: {}, formData: {},
loadAll: [],
rules: { rules: {
name: [{ name: [{
required: true, required: true,
@ -187,9 +199,44 @@ export default {
get_use().then(res => { get_use().then(res => {
this.extra_form = res.data this.extra_form = res.data
}) })
this.drugList()
}, },
methods: { methods: {
drugList() {
get_drug_group_list().then(
res => {
if (res.status === 0) {
this.loadAll = res.data
}
})
},
querySearchAsync(queryString, cb) {
var restaurants = this.loadAll
var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants
clearTimeout(this.timeout)
cb(results)
},
createStateFilter(queryString) {
return (state) => {
return (state.name.toLowerCase().indexOf(queryString.toLowerCase()) >= 0)
}
},
handleSelect(item) {
console.log(item)
this.formData = item
this.formData.name = item.value
},
isNumber(val) {
const regPos = /^\d+(\.\d+)?$/
const regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/
return regPos.test(val) || regNeg.test(val)
},
handleConfirm: throttle(function() { handleConfirm: throttle(function() {
//
this.drugList()
this.$refs['elForm'].validate(valid => { this.$refs['elForm'].validate(valid => {
if (valid) { if (valid) {
// //
@ -208,6 +255,12 @@ export default {
} else { } else {
this.formData.shelf_life = 0 this.formData.shelf_life = 0
} }
// this.formData['name'] = this.formData.value
//
this.$set(this.formData, 'name', this.formData.value)
// delete this.formData['value']
console.log(this.formData, '-----------------------')
this.$emit('handlefunc', this.formData) this.$emit('handlefunc', this.formData)
} }
if (!valid) return if (!valid) return

@ -229,8 +229,8 @@
<div class="user-header"> <div class="user-header">
<el-input v-model="seach_user" clearable placeholder="请输入内容" /> <el-input v-model="seach_user" clearable placeholder="请输入内容" />
<el-button type="primary" icon="el-icon-search" @click="getUserList"></el-button> <el-button type="primary" icon="el-icon-search" @click="getUserList"></el-button>
<el-button plain type="danger" @click="handleDisUser"><svg-icon icon-class="" /> 确认禁用</el-button> <el-button plain type="danger" @click="handleEnUser"><svg-icon icon-class="" /> 确认禁用</el-button>
<el-button plain type="success" @click="handleEnUser"><svg-icon icon-class="" /> 解除禁用</el-button> <el-button plain type="success" @click="handleDisUser"><svg-icon icon-class="" /> 解除禁用</el-button>
</div> </div>
<el-table <el-table
v-loading="loadingUser" v-loading="loadingUser"
@ -251,8 +251,8 @@
<el-table-column align="center" property="role_name" label="用户身份" /> <el-table-column align="center" property="role_name" label="用户身份" />
<el-table-column align="center" label="禁用状态"> <el-table-column align="center" label="禁用状态">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="scope.row.status_type === 1?'danger':'success'"> <el-tag :type="scope.row.status_type === 0?'danger':'success'">
{{ scope.row.status_type === 1? '已禁用':'未禁用' }} {{ scope.row.status_type === 0? '已禁用':'未禁用' }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>

@ -341,13 +341,13 @@ export default {
client_id: '', client_id: '',
selectReagentValue: '', selectReagentValue: '',
multipleSelection: [], multipleSelection: [],
loading: true, loading: false,
// //
page: 1, page: 1,
page_size: 15, page_size: 15,
total: 0, total: 0,
// //
loadingReagent: true, loadingReagent: false,
reagentData: [], reagentData: [],
reagent_page: 1, reagent_page: 1,
reagent_page_size: 15, reagent_page_size: 15,
@ -375,6 +375,7 @@ export default {
barCode: '', barCode: '',
currentRow: null, currentRow: null,
client_id_input: '', client_id_input: '',
click_num: false,
// //
fileList: [], fileList: [],
@ -400,7 +401,16 @@ export default {
}, },
// //
handlePrintCode() { handlePrintCode() {
this.dialogVisible = true if (this.multipleSelection.length === 1) {
const template_id = this.multipleSelection[0].template_id
console.log(template_id)
const data = {
template_id: template_id
}
pring_bar_code(stringify(data)).then(res => {
this.$message.success(res.msg)
})
}
}, },
handlePringClose() { handlePringClose() {
this.formData = { this.formData = {
@ -510,11 +520,11 @@ export default {
}, },
getTmpList() { getTmpList() {
this.loading = true this.loading = true
show_tmp({ show_tmp(stringify({
page: this.page, page: this.page,
page_size: this.page_size, page_size: this.page_size,
client_id: this.client_id client_id: this.client_id
}).then(res => { })).then(res => {
this.tableData = res.data.data_list this.tableData = res.data.data_list
this.total = res.data.total_count this.total = res.data.total_count
}).finally(() => { }).finally(() => {
@ -530,7 +540,7 @@ export default {
reagentPageChange(page) { reagentPageChange(page) {
this.reagent_page = page this.reagent_page = page
const data = { seach_word: this.selectReagentValue, page: this.reagent_page, page_size: this.reagent_page_size } const data = { seach_word: this.selectReagentValue, page: this.reagent_page, page_size: this.reagent_page_size }
this.getSelectDrug(stringify(data)) this.getSelectDrug(data)
}, },
// //
handleReagentClick(row) { handleReagentClick(row) {
@ -542,7 +552,7 @@ export default {
this.formVisible = false this.formVisible = false
this.bindToDBData = [] this.bindToDBData = []
for (let i = 0; i < obj.export_count; i++) { for (let i = 0; i < obj.export_count; i++) {
this.bindToDBData.push({ ...this.propsformdata, ...obj, 'status': true, 'index': i }) this.bindToDBData.push({ ...this.propsformdata, ...obj, 'status': false, 'index': i })
} }
this.client_id_input = obj.client_id this.client_id_input = obj.client_id
// //
@ -551,6 +561,7 @@ export default {
}) })
this.bindToDBDataTmp = this.bindToDBData this.bindToDBDataTmp = this.bindToDBData
this.bindToDBVisible = true this.bindToDBVisible = true
this.click_num = true
}, },
// //
handleSelectClose() { handleSelectClose() {
@ -561,7 +572,7 @@ export default {
getSelectDrug(data) { getSelectDrug(data) {
this.loadingReagent = true this.loadingReagent = true
this.reagentData = [] this.reagentData = []
select_drug(data).then(res => { select_drug(stringify(data)).then(res => {
this.reagentData = res.data.data_list this.reagentData = res.data.data_list
this.reagent_total = res.data.total_count this.reagent_total = res.data.total_count
}).finally(() => { }).finally(() => {
@ -664,7 +675,8 @@ export default {
}, },
// form // form
handleReagentAddForm(obj) { handleReagentAddForm(obj) {
if (this.reagentAddFormTitle === '新增模板条目') { obj.name = obj.value
if (this.reagentAddFormTitle.indexOf('新增') !== -1) {
this.reagentAddTmpData.push(obj) this.reagentAddTmpData.push(obj)
} else { } else {
// //
@ -681,6 +693,9 @@ export default {
}, },
// //
handleBindToDB() { handleBindToDB() {
if (this.click_num) {
return
}
if (this.bindToDBData.length === 0 && this.multipleSelection.length === 0) { if (this.bindToDBData.length === 0 && this.multipleSelection.length === 0) {
this.$message.warning('请选择入库试剂或模板!') this.$message.warning('请选择入库试剂或模板!')
return return
@ -709,6 +724,7 @@ export default {
this.$refs.singleTable.setCurrentRow(this.bindToDBData[0]) this.$refs.singleTable.setCurrentRow(this.bindToDBData[0])
}) })
this.bindToDBVisible = true this.bindToDBVisible = true
this.click_num = true
} }
} }
} }

Loading…
Cancel
Save