对照品需求更改

duizhaopin_ui
tangxuan 2 years ago
parent 71478d1da5
commit 4078f93384

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

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

Loading…
Cancel
Save