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

duizhaopin_ui
duan 2 years ago
parent 0ed61d79a0
commit 33a5b7481c

@ -130,22 +130,7 @@ export default {
data() {
return {
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
},
formData: {},
rules: {
name: [{
required: true,
@ -183,6 +168,15 @@ export default {
}
}
},
watch: {
propsformdata: {
handler(newValue, oldValue) {
this.formData = { ...newValue }
},
deep: true,
immediate: true
}
},
methods: {
handleConfirm() {
this.$refs['elForm'].validate(valid => {

@ -1,3 +1,6 @@
<template>
<div></div>
</template>
<script>
export default {
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-left">
<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-button size="small" type="primary" icon="el-icon-search" @click="searchReagent"></el-button>
</div>
@ -50,9 +57,11 @@
<script>
import { drug_details_info } from '@/api/reagent/report'
import stringify from '@/utils/stringify'
import { getClients } from '@/views/reagent/mixin/getClients'
export default {
name: 'ReagentInfo',
mixins: [getClients],
data() {
return {
selectReagentValue: '',

@ -4,7 +4,14 @@
<div class="header">
<div class="header-left">
<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-option
v-for="(item,index) in statusMap"
@ -73,9 +80,11 @@
<script>
import { drug_log_type_info } from '@/api/reagent/report'
import stringify from '@/utils/stringify'
import { getClients } from '@/views/reagent/mixin/getClients'
export default {
name: 'Record',
mixins: [getClients],
data() {
return {
titleMap: {

@ -4,7 +4,14 @@
<div class="header">
<div class="header-left">
<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-date-picker
v-model="start_time"
@ -58,9 +65,11 @@
<script>
import { use_frequency } from '@/api/reagent/report'
import stringify from '@/utils/stringify'
import { getClients } from '@/views/reagent/mixin/getClients'
export default {
name: 'Usefrequency',
mixins: [getClients],
data() {
return {
selectReagentValue: '',

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

Loading…
Cancel
Save