对照品需求更改

duizhaopin_ui
tangxuan 2 years ago
parent 71478d1da5
commit 4078f93384

@ -5,25 +5,13 @@
<el-col :span="24">
<el-form-item label="试剂名称" prop="name">
<!-- <el-input v-model="formData.name" placeholder="请输入试剂名称" clearable :style="{width: '100%'}" /> -->
<el-autocomplete
v-model="formData.name"
class="inline-input"
:style="{width: '100%'}"
:fetch-suggestions="querySearchAsync"
clearable
placeholder="请输入试剂名称"
@select="handleSelect"
/>
<el-autocomplete v-model="formData.name" class="inline-input" :style="{ width: '100%' }"
:fetch-suggestions="querySearchAsync" clearable placeholder="请输入试剂名称" @select="handleSelect" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="英文名称" prop="english_name">
<el-input
v-model="formData.english_name"
placeholder="请输入英文名称"
clearable
:style="{width: '100%'}"
/>
<el-input v-model="formData.english_name" placeholder="请输入英文名称" clearable :style="{ width: '100%' }" />
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
@ -33,44 +21,29 @@
<!-- </el-col>-->
<el-col :span="12">
<el-form-item label="CAS码" prop="cas_number">
<el-input
v-model="formData.cas_number"
placeholder="请输入CAS码"
clearable
:style="{width: '100%'}"
/>
<el-input v-model="formData.cas_number" placeholder="请输入CAS码" clearable :style="{ width: '100%' }" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="试剂纯度" prop="purity">
<el-input v-model="formData.purity" placeholder="请输入试剂纯度" clearable :style="{width: '100%'}" />
<el-input v-model="formData.purity" placeholder="请输入试剂纯度" clearable :style="{ width: '100%' }" />
</el-form-item>
</el-col>
<el-col>
<el-form-item label="导入数量" prop="export_count">
<el-input v-model.number="formData.export_count" placeholder="请输入导入数量" clearable :style="{width: '100%'}" />
<el-input v-model.number="formData.export_count" placeholder="请输入导入数量" clearable :style="{ width: '100%' }" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生产日期" prop="production_date">
<el-date-picker
v-model="formData.production_date"
type="datetime"
clearable
placeholder="请选择生产日期"
value-format="yyyy-MM-dd HH:mm:ss"
/>
<el-date-picker v-model="formData.production_date" type="datetime" clearable placeholder="请选择生产日期"
value-format="yyyy-MM-dd HH:mm:ss" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="过期日期" prop="expiration_date">
<el-date-picker
v-model="formData.expiration_date"
type="datetime"
clearable
placeholder="选择过期日期"
value-format="yyyy-MM-dd HH:mm:ss"
/>
<el-date-picker v-model="formData.expiration_date" type="datetime" clearable placeholder="选择过期日期"
value-format="yyyy-MM-dd HH:mm:ss" />
</el-form-item>
</el-col>
<!-- <el-col>-->
@ -81,27 +54,17 @@
<el-col :span="12">
<el-form-item label="生产厂家" prop="manufacturer">
<el-input
v-model="formData.manufacturer"
placeholder="请输入生产厂家"
clearable
:style="{width: '100%'}"
/>
<el-input v-model="formData.manufacturer" placeholder="请输入生产厂家" clearable :style="{ width: '100%' }" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="经销商" prop="distributor">
<el-input
v-model="formData.distributor"
placeholder="请输入经销商"
clearable
:style="{width: '100%'}"
/>
<el-input v-model="formData.distributor" placeholder="请输入经销商" clearable :style="{ width: '100%' }" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="speci">
<el-input v-model="formData.speci" placeholder="请输入规格" clearable :style="{width: '100%'}" />
<el-input v-model="formData.speci" placeholder="请输入规格" clearable :style="{ width: '100%' }" />
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
@ -112,26 +75,22 @@
<el-col :span="12">
<el-form-item label="单位" prop="net_weight_unit">
<!-- <el-input v-model="formData.net_weight_unit" placeholder="请输入单位" clearable :style="{width: '100%'}" /> -->
<el-select v-model="formData.net_weight_unit" :style="{width: '100%'}" placeholder="单位">
<el-option
label="ml"
value="ml"
/>
<el-option
label="g"
value="g"
/>
<el-select v-model="formData.net_weight_unit" :style="{ width: '100%' }" placeholder="单位">
<el-option label="ml" value="ml" />
<el-option label="g" value="g" />
<el-option label="mg" value="mg" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="预估质量" prop="total">
<el-input v-model="formData.total" placeholder="请输入预估质量" clearable :style="{width: '100%'}" />
<el-input v-model="formData.total" placeholder="请输入预估质量" clearable :style="{ width: '100%' }" />
</el-form-item>
</el-col>
<el-col v-for="item in extra_form" :key="item.id" :span="12">
<el-form-item :label="item.name" :prop="item.name">
<el-input v-model="formData[item.name]" :placeholder="'请输入' + item.name " clearable :style="{width: '100%'}" />
<el-input v-model="formData[item.name]" :placeholder="'请输入' + item.name" clearable
:style="{ width: '100%' }" />
</el-form-item>
</el-col>
</el-form>
@ -146,7 +105,7 @@ import { throttle } from '@/utils'
import { get_use } from '@/api/reagent/customform'
import { weigh, get_drug_info, tare, zero } from '@/api/reagent/weight'
import { get_drug_group_list } from '@/api/reagent/warehousing'
import { get_func_type } from '@/utils/index'
export default {
name: 'ReagentForm',
// title dialog title
@ -157,10 +116,12 @@ export default {
props: ['propsformdata', 'handlefunc'],
data() {
var func_type = get_func_type()
return {
weight:'',
weight: '',
formData: {},
loadAll: [],
showTotal: func_type == 3 ? false : true,
rules: {
name: [{
required: true,
@ -169,12 +130,12 @@ export default {
}],
english_name: [],
cas_number: [{
required: true,
required: func_type == 3 ? false : true,
message: '请输入CAS码',
trigger: 'blur'
}],
purity: [{
required: true,
required: func_type == 3 ? false : true,
message: '请输入试剂纯度',
trigger: 'blur'
}],
@ -185,12 +146,12 @@ export default {
type: 'number'
}],
production_date: [{
required: true,
required: func_type == 3 ? false : true,
message: '请输入生产日期',
trigger: 'blur'
}],
expiration_date: [{
required: true,
required: func_type == 3 ? false : true,
message: '请输入过期日期',
trigger: 'blur'
}],
@ -251,8 +212,8 @@ export default {
return
}
//
console.log(weigh,'11111111111111111')
if (weigh.toFixed(2)>10){
console.log(weigh, '11111111111111111')
if (weigh.toFixed(2) > 10) {
this.formData.total = weigh.toFixed(2)
}
}
@ -276,10 +237,10 @@ export default {
drugList() {
get_drug_group_list().then(
res => {
if (res.status === 0) {
this.loadAll = res.data
}
})
if (res.status === 0) {
this.loadAll = res.data
}
})
},
querySearchAsync(queryString, cb) {
var restaurants = this.loadAll
@ -305,7 +266,7 @@ export default {
return regPos.test(val) || regNeg.test(val)
},
handleConfirm: throttle(function() {
handleConfirm: throttle(function () {
//
this.drugList()
this.$refs['elForm'].validate(valid => {
@ -349,5 +310,4 @@ export default {
}
</script>
<style>
</style>
<style></style>

@ -98,7 +98,7 @@
/>
<el-table-column
prop="remain"
label="余量(g)"
label="余量"
align="center"
/>
<el-table-column
@ -460,6 +460,11 @@
<el-input v-model="formData.storage_type" placeholder="请输入管理分类" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="余量" prop="remain">
<el-input v-model="formData.remain" placeholder="请输入余量" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col v-for="item in extra_form" :key="item.id" :span="12">
<el-form-item :label="item.name" :prop="item.name">
<el-input
@ -545,10 +550,7 @@
:before-upload="beforeUpload"
:on-success="uploadSuccess"
:on-error="uploadErr"
:data="{
variety_id: currentItem.variety_id,
medicament_id: currentItem.medicament_id
}"
:data="uploadImgData"
>
<el-button type="primary">普通上传</el-button>
</el-upload>
@ -734,7 +736,8 @@ export default {
category: undefined,
standard_code: undefined,
storage_condition: undefined,
storage_type: undefined
storage_type: undefined,
remain: undefined,
},
rules: {
price: [{
@ -1131,11 +1134,16 @@ export default {
const data = JSON.parse(JSON.stringify(this.formData))
data.is_supervise = data.is_supervise ? 1 : 0
data.is_weigh = data.is_weigh ? 1 : 0
update(stringify(data)).then(res => {
this.$message.success(res.msg)
this.getList()
})
this.onClose()
if (Number(data.remain) > Number(data.speci)){
this.$message.warning("余量不能大于规格")
} else {
update(stringify(data)).then(res => {
this.$message.success(res.msg)
this.getList()
})
this.onClose()
}
})
},
//

Loading…
Cancel
Save