Compare commits

...

2 Commits

@ -100,6 +100,31 @@
<el-input v-model="formData.category" placeholder="请输入分类" clearable :style="{ width: '100%' }" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="包装" prop="is_packing">
<el-select v-model="formData.is_packing" :style="{ width: '100%' }" placeholder="包装是否完好">
<el-option label="是" value="1" />
<el-option label="否" value="0" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="标签" prop="is_label">
<el-select v-model="formData.is_label" :style="{ width: '100%' }" placeholder="标签是否清晰">
<el-option label="是" value="1" />
<el-option label="否" value="0" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="外观" prop="is_aspect">
<el-select v-model="formData.is_aspect" :style="{ width: '100%' }" placeholder="外观是否符合要求">
<el-option label="是" value="1" default/>
<el-option label="否" value="0" />
</el-select>
</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
@ -197,6 +222,9 @@ export default {
trigger: 'blur'
}],
category:[],
is_packing: [],
is_label: [],
is_aspect: [],
},
extra_form: []
}

@ -276,7 +276,8 @@ export default {
{ required: true, message: '请选择陪同人', trigger: 'change' }
]
},
currentItem: {}
currentItem: {},
notes_msg: "",
}
},
created() {
@ -397,44 +398,26 @@ export default {
//
handleClick(row) {
var that = this
that.$prompt('请输入领取用途', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
if (value) {
row.notes = value
//
get_check_last_drug(stringify(row)).then(res => {
this.check_last_medicament(res.data).then((check_res) => {
//
if (check_res) {
var result = that.checkList.filter(item => item).map(item => item.bar_code)
var result = that.checkList.filter(item => item).map(item => item.bar_code);
if (result.indexOf(row.bar_code) != -1) {
that.$message({
type: 'info',
message: '不可重复添加'
})
});
} else {
that.checkList.push(row)
let getLocation = that.tableData.indexOf(row)
let getLocation = that.tableData.indexOf(row);
that.tableData.splice(getLocation, 1)
}
}
})
})
} else {
that.$message({
type: 'info',
message: '请输入用途'
})
}
}).catch(() => {
that.$message({
type: 'info',
message: '取消输入'
})
})
},
//
cancelClick(row) {
@ -518,47 +501,70 @@ export default {
})
console.log('giao')
},
//
prompt_notes(){
var that = this
return new Promise((resolve, reject) => {
that.$prompt('请输入领取用途', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({ value }) => {
if(value){
this.notes_msg =value
resolve(true)
}else{
that.$message({
type: 'info',
message: '请输入用途'
});
resolve(false)
}
}).catch(() => {
that.$message({
type: 'info',
message: '取消输入'
});
resolve(false)
});
})
},
//
create_apply(pt_from) {
var that = this
that.prompt_notes().then(notes_res => {
if (!notes_res){
return
} else {
console.log("申请理由notes_msg", this.notes_msg)
let datalist = that.checkList.map((item) => {
return Object.assign({}, {
info: '',
notes: item.notes,
bar_code: item.bar_code,
client_code: item.client_code,
place: item.flow_position_code,
remark12: item.remark12,
name: item.name,
num: item.num,
client_id: item.client_id,
purity: item.purity,
speci: item.speci,
medicament_id: item.medicament_id
})
return Object.assign({}, {info:'',notes:this.notes_msg,bar_code: item.bar_code,client_code: item.client_code,place: item.flow_position_code,remark12: item.remark12,name: item.name, num: item.num,client_id: item.client_id, purity: item.purity, speci: item.speci,medicament_id:item.medicament_id})
})
if (pt_from.user_id_pt === '') {
that.$message({
type: 'info',
message: '请选择陪同人'
})
});
} else {
const data = {
user_id: this.$store.state.user.id,
user_id_pt: pt_from.user_id_pt,
use_content: JSON.stringify(datalist)
use_content: JSON.stringify(datalist),
}
add_apply(stringify(data)).then(rsp => {
console.log('rsp>>', rsp)
console.log("rsp>>", rsp)
if (rsp.status == 0) {
this.dialogTableClose()
//
this.$refs.multipleTable.clearSelection()
this.$refs.multipleTable.clearSelection();
that.checkList = []
this.get_apply()
}
})
}
}
})
},
//
pageChange(page) {

@ -25,9 +25,11 @@
<el-table-column prop="english_name" show-overflow-tooltip label="英文名称" align="center" />
<el-table-column prop="cas_number" show-overflow-tooltip label="药剂cas码" align="center" />
<el-table-column prop="purity" label="纯度" align="center" />
<el-table-column prop="density" label="密度(g/cm³)" align="center" />
<el-table-column prop="total" label="总量" align="center" />
<el-table-column prop="net_weight_unit" label="净含量单位" align="center" />
<el-table-column prop="net_weight" label="净含量" align="center" />
<el-table-column prop="remark5" label="有效期年份" align="center" />
<el-table-column prop="inventory_warning_value" label="库存预警量" align="center" />
<el-table-column prop="shelf_life_warning_value" label="保质期到期提前预警天数" align="center" />
<el-table-column prop="use_days_warning_value" label="领用超期预警天数" align="center" />
@ -78,6 +80,18 @@
<el-input v-model="formData.purity" placeholder="请输入纯度" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="密度" prop="density">
<el-input v-model="formData.density" placeholder="请输入密度" clearable :style="{width: '100%'}" >
<template slot="append">g/cm<sup>3</sup></template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有效期年份" prop="remark5">
<el-input v-model="formData.remark5" placeholder="请输入有效期年份" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="总量" prop="total" hidden>
<el-input v-model="formData.total" placeholder="请输入总量" clearable :style="{width: '100%'}" />
@ -183,6 +197,7 @@ export default {
message: '请输入纯度',
trigger: 'blur'
}],
density: [],
total: [{
required: false,
message: '请输入总量',
@ -206,7 +221,8 @@ export default {
empty_count: [],
use_count: [],
normal_count: [],
total_count: []
total_count: [],
remark5:[],
},
dialogVisible: false,
dialogTitile: ''
@ -244,9 +260,14 @@ export default {
}).finally(() => { this.loadingReagent = false })
},
handleFormEdit(row) {
if(this.$store.state.user.role_name.indexOf("管理员") !== -1){
this.dialogTitile = '编辑试剂品类信息'
this.formData = { ...row }
this.dialogVisible = true
} else {
this.$message.error("分类编辑只有管理员可以编辑!")
}
},
//
handleSelectionChange(val) {

@ -90,9 +90,19 @@
<!-- <el-radio v-model="radio" label="2"></el-radio> -->
<el-button type="primary" @click="updateDrugRemain"></el-button>
<el-button type="primary" plain @click="doTare"></el-button>
<el-input v-model="inputWeigh" placeholder="手动输入" />
<el-button type="warning" @click="handleSetEmpty"></el-button>
</div>
<div>
<el-input v-model="inputWeigh" placeholder="手动输入" slot="append" style="width: 50%">
<template slot="append">
<el-select style="width: 50px" v-model="select_unit" slot="prepend" placeholder="请选择单位" >
<el-option label="g" value="g"></el-option>
<el-option label="ml" value="ml"></el-option>
</el-select>
</template>
</el-input>
</div>
</div>
</div>
<div class="bottom">
@ -149,7 +159,7 @@
<script>
import Scannner from '@/components/Scannner/index'
import { use, drug_return, use_or_return_list } from '@/api/reagent/receivingReturn'
import { use, drug_return, use_or_return_list, calculate_volume_weight } from '@/api/reagent/receivingReturn'
import {
get_check_last_drug,
} from '@/api/reagent/createapply'
@ -180,7 +190,8 @@ export default {
surplusWeigh: '',
dialogVisible: false,
place: null,
is_wait:true
is_wait:true,
select_unit: ""
}
},
computed: {
@ -387,14 +398,15 @@ export default {
this.$message.warning('请选择试剂!')
}
},
updateDrugRemain() {
async updateDrugRemain() {
if (this.infoData.medicament_id) {
const w = this.checkInputWeigh()
var weight = await this.check_volume_weight()
const data = {
'bar_code': this.infoData.bar_code,
'medicament_id': this.infoData.medicament_id,
'remain': w ? parseFloat(this.inputWeigh).toFixed(2) : this.surplusWeigh
'remain': weight
}
//
if (this.$route.name == "standardReceiving"){
update_drug_remain(stringify(data)).then(res => {
@ -407,11 +419,10 @@ export default {
this.dialogVisible = false
this.$message.success('归还成功!')
//
if (this.$route.name === 'standardSendBack'){
const h = this.$createElement;
var msg = ""
if (res.data.is_liquid){
msg += `用量:${res.data.use_quality}, 液体 体积用量:${res.data.use_volum} ${res.data.net_weight_unit}`
msg += `用量:${res.data.use_quality}, 液体 体积用量:${res.data.use_volume} ${res.data.net_weight_unit}`
} else {
msg += `当次用量:${res.data.use_quality} ${res.data.net_weight_unit}`
}
@ -420,7 +431,7 @@ export default {
title: '本次使用用量',
message: h('i', { style: 'color: teal'}, msg)
});
}
})
}
@ -428,7 +439,32 @@ export default {
} else {
this.$message.warning('请选择试剂!')
}
},
//
check_volume_weight(){
return new Promise((resolve, reject) => {
const w = this.checkInputWeigh()
if (this.inputWeigh && this.select_unit == "ml") {
const data = {
"variety_id": this.infoData.variety_id,
'input_volume': parseFloat(this.inputWeigh).toFixed(2)
}
calculate_volume_weight(stringify(data)).then(res => {
if (res.status == 0){
resolve(res.data.weight)
} else {
this.$message.error(res.msg)
reject(res.msg)
}
})
} else {
resolve(w ? parseFloat(this.inputWeigh).toFixed(2) : this.surplusWeigh)
}
})
}
}
}
</script>

@ -45,6 +45,9 @@
<el-tag :type="statusColorMap[scope.row.status-1]">{{ statusMap[scope.row.status - 1] }}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" property="is_packing" label="包装是否完好" :formatter="formatInfo" />
<el-table-column align="center" property="is_label" label="标签是否清晰" :formatter="formatInfo"/>
<el-table-column align="center" property="is_aspect" label="外观是否符合要求" :formatter="formatInfo"/>
<el-table-column align="center" property="by_user_name" label="最后使用人" />
<el-table-column align="center" property="client_id" label="所属终端">
<template slot-scope="scope">
@ -137,6 +140,10 @@ export default {
}).finally(() => {
this.loadingReagent = false
})
},
//
formatInfo(row, column) {
return row[column.property] == 1 ? "是" : "否"
}
}
}

Loading…
Cancel
Save