refactor(reagent): 加入一些共有功能,优化reagentform

duizhaopin_ui
duan 2 years ago
parent 0ed61d79a0
commit 33a5b7481c

@ -130,22 +130,7 @@ export default {
data() { data() {
return { return {
formData: { formData: {},
name: this.propsformdata.name,
english_name: this.propsformdata.english_name,
cas_number: this.propsformdata.cas_number,
purity: this.propsformdata.purity,
num: 1,
production_date: this.propsformdata.production_date,
expiration_date: this.propsformdata.expiration_date,
manufacturer: this.propsformdata.manufacturer,
distributor: this.propsformdata.distributor,
speci: this.propsformdata.speci,
// field118: undefined,
shelf_life: 0,
net_weight_unit: this.propsformdata.net_weight_unit,
total: this.propsformdata.total
},
rules: { rules: {
name: [{ name: [{
required: true, required: true,
@ -183,6 +168,15 @@ export default {
} }
} }
}, },
watch: {
propsformdata: {
handler(newValue, oldValue) {
this.formData = { ...newValue }
},
deep: true,
immediate: true
}
},
methods: { methods: {
handleConfirm() { handleConfirm() {
this.$refs['elForm'].validate(valid => { this.$refs['elForm'].validate(valid => {

@ -1,3 +1,6 @@
<template>
<div></div>
</template>
<script> <script>
export default { export default {
name: 'Scannner', name: 'Scannner',

@ -0,0 +1,15 @@
import { client_list } from '@/api/common.js'
export const getClients = {
data() {
return {
clientOptions: []
}
},
created() {
client_list().then(
res => {
this.clientOptions = res.data.data_list
}
)
}
}

@ -4,7 +4,14 @@
<div class="header"> <div class="header">
<div class="header-left"> <div class="header-left">
<el-button size="small" @click="$router.push('/reagent/report/index')"></el-button> <el-button size="small" @click="$router.push('/reagent/report/index')"></el-button>
<el-select v-model="client_id" size="small" placeholder="请选择柜体" /> <el-select v-model="client_id" size="small" placeholder="请选择柜体">
<el-option
v-for="item in clientOptions"
:key="item.id"
:label="item.client_name"
:value="item.client_id"
/>
</el-select>
<el-input v-model="selectReagentValue" size="small" placeholder="请输入搜索试剂名称" /> <el-input v-model="selectReagentValue" size="small" placeholder="请输入搜索试剂名称" />
<el-button size="small" type="primary" icon="el-icon-search" @click="searchReagent"></el-button> <el-button size="small" type="primary" icon="el-icon-search" @click="searchReagent"></el-button>
</div> </div>
@ -50,9 +57,11 @@
<script> <script>
import { drug_details_info } from '@/api/reagent/report' import { drug_details_info } from '@/api/reagent/report'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
import { getClients } from '@/views/reagent/mixin/getClients'
export default { export default {
name: 'ReagentInfo', name: 'ReagentInfo',
mixins: [getClients],
data() { data() {
return { return {
selectReagentValue: '', selectReagentValue: '',

@ -4,7 +4,14 @@
<div class="header"> <div class="header">
<div class="header-left"> <div class="header-left">
<el-button size="small" @click="$router.push('/reagent/report/index')"></el-button> <el-button size="small" @click="$router.push('/reagent/report/index')"></el-button>
<el-select v-model="client_id" size="small" placeholder="请选择柜体" /> <el-select v-model="client_id" size="small" placeholder="请选择柜体">
<el-option
v-for="item in clientOptions"
:key="item.id"
:label="item.client_name"
:value="item.client_id"
/>
</el-select>
<el-select v-model="select_status" size="small" placeholder="请选择状态"> <el-select v-model="select_status" size="small" placeholder="请选择状态">
<el-option <el-option
v-for="(item,index) in statusMap" v-for="(item,index) in statusMap"
@ -73,9 +80,11 @@
<script> <script>
import { drug_log_type_info } from '@/api/reagent/report' import { drug_log_type_info } from '@/api/reagent/report'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
import { getClients } from '@/views/reagent/mixin/getClients'
export default { export default {
name: 'Record', name: 'Record',
mixins: [getClients],
data() { data() {
return { return {
titleMap: { titleMap: {

@ -4,7 +4,14 @@
<div class="header"> <div class="header">
<div class="header-left"> <div class="header-left">
<el-button size="small" @click="$router.push('/reagent/report/index')"></el-button> <el-button size="small" @click="$router.push('/reagent/report/index')"></el-button>
<el-select v-model="client_id" size="small" placeholder="请选择柜体" /> <el-select v-model="client_id" size="small" placeholder="请选择柜体">
<el-option
v-for="item in clientOptions"
:key="item.id"
:label="item.client_name"
:value="item.client_id"
/>
</el-select>
<el-input v-model="selectReagentValue" size="small" placeholder="请输入搜索试剂名称" /> <el-input v-model="selectReagentValue" size="small" placeholder="请输入搜索试剂名称" />
<el-date-picker <el-date-picker
v-model="start_time" v-model="start_time"
@ -58,9 +65,11 @@
<script> <script>
import { use_frequency } from '@/api/reagent/report' import { use_frequency } from '@/api/reagent/report'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
import { getClients } from '@/views/reagent/mixin/getClients'
export default { export default {
name: 'Usefrequency', name: 'Usefrequency',
mixins: [getClients],
data() { data() {
return { return {
selectReagentValue: '', selectReagentValue: '',

@ -6,10 +6,10 @@
<el-button size="small">返回上一级</el-button> <el-button size="small">返回上一级</el-button>
<el-select v-model="client_id" placeholder="请选择柜体"> <el-select v-model="client_id" placeholder="请选择柜体">
<el-option <el-option
v-for="item in options" v-for="item in clientOptions"
:key="item.value" :key="item.id"
:label="item.label" :label="item.client_name"
:value="item.value" :value="item.client_id"
/> />
</el-select> </el-select>
<el-button size="small" type="primary" @click="handleReagentToDatabase"></el-button> <el-button size="small" type="primary" @click="handleReagentToDatabase"></el-button>
@ -108,10 +108,9 @@
<el-table-column <el-table-column
fixed="right" fixed="right"
label="操作" label="操作"
width="100"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="handleReagentClick(scope.row)"></el-button> <el-button type="primary" size="small" @click="handleReagentClick(scope.row)"></el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -129,6 +128,7 @@
title="编辑试剂信息" title="编辑试剂信息"
:visible.sync="formVisible" :visible.sync="formVisible"
append-to-body append-to-body
@close="formClose"
> >
<ReagentForm :propsformdata="propsformdata" @handlefunc="handleReagentForm" /> <ReagentForm :propsformdata="propsformdata" @handlefunc="handleReagentForm" />
</el-dialog> </el-dialog>
@ -139,10 +139,10 @@
<el-input v-model="reagentAddTmpName" placeholder="请输入模板名称" /> <el-input v-model="reagentAddTmpName" placeholder="请输入模板名称" />
<el-select v-model="reagentAddClient" placeholder="请选择柜体"> <el-select v-model="reagentAddClient" placeholder="请选择柜体">
<el-option <el-option
v-for="item in options" v-for="item in clientOptions"
:key="item.value" :key="item.id"
:label="item.label" :label="item.client_name"
:value="item.value" :value="item.client_id"
/> />
</el-select> </el-select>
<el-button v-if="opType === 'add'" size="small" type="primary" plain @click="handleADDOpen('add')">+ </el-button> <el-button v-if="opType === 'add'" size="small" type="primary" plain @click="handleADDOpen('add')">+ </el-button>
@ -183,7 +183,7 @@
append-to-body append-to-body
@close="reagentAddFormClose" @close="reagentAddFormClose"
> >
<ReagentForm ref="reform" :propsformdata="reagentAddFormdata" @handlefunc="handleReagentAddForm" /> <ReagentForm :propsformdata="reagentAddFormdata" @handlefunc="handleReagentAddForm" />
</el-dialog> </el-dialog>
</el-dialog> </el-dialog>
<!-- 绑定入库--> <!-- 绑定入库-->
@ -223,10 +223,12 @@ import ReagentForm from '@/components/ReagentForm/index'
import Scanner from '@/components/Scannner/index' import Scanner from '@/components/Scannner/index'
import { show_tmp, select_drug, bind_tmp_enter_warehouse, add_tmp, del_tmp } from '@/api/reagent/warehousing' import { show_tmp, select_drug, bind_tmp_enter_warehouse, add_tmp, del_tmp } from '@/api/reagent/warehousing'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
import { getClients } from '@/views/reagent/mixin/getClients'
export default { export default {
name: 'Warehousing', name: 'Warehousing',
components: { ReagentForm, Scanner }, components: { ReagentForm, Scanner },
mixins: [getClients],
data() { data() {
return { return {
dialogTableVisible: false, dialogTableVisible: false,
@ -248,7 +250,7 @@ export default {
reagent_total: 0, reagent_total: 0,
// dialog form // dialog form
formVisible: false, formVisible: false,
propsformdata: null, propsformdata: {},
// //
opType: null, opType: null,
@ -305,6 +307,9 @@ export default {
this.getTmpList() this.getTmpList()
}, },
methods: { methods: {
formClose() {
this.propsformdata = {}
},
handleCurrentSelectChange(row) { handleCurrentSelectChange(row) {
this.currentRow = row this.currentRow = row
}, },
@ -474,7 +479,7 @@ export default {
this.reagentAddFormVisible = false this.reagentAddFormVisible = false
}, },
reagentAddFormClose() { reagentAddFormClose() {
this.$refs.reform.resetForm() this.reagentAddFormdata = {}
}, },
// handleAddSelectionChange // handleAddSelectionChange
handleAddSelectionChange(val) { handleAddSelectionChange(val) {

Loading…
Cancel
Save