feat(src/views/reagent/weighing): 称重模块接口

duizhaopin_ui
duan 2 years ago
parent 768f4ce114
commit cfefe3f9eb

@ -0,0 +1,17 @@
import request from '@/utils/request'
export function weigh() {
return request({
url: '/api/weigh/',
method: 'get',
baseURL: process.env.VUE_APP_FACE_API
})
}
export function update_drug_remain(data) {
return request({
url: '/api/drug/update_drug_remain',
method: 'post',
data
})
}

@ -15,13 +15,13 @@
<div class="tip">精度0.01g±0.03g</div> <div class="tip">精度0.01g±0.03g</div>
<div class="show-data"> <div class="show-data">
<div class="top"> <div class="top">
<span class="num">1042.56</span> <span class="num">{{ weight }}</span>
<span class="unit">(g)</span> <span class="unit">(g)</span>
</div> </div>
<div class="bottom"> <div class="bottom">
<el-radio v-model="radio" label="1"></el-radio> <el-radio v-model="radio" label="1"></el-radio>
<el-radio v-model="radio" label="2"></el-radio> <el-radio v-model="radio" label="2"></el-radio>
<el-button type="primary">开始称重</el-button> <el-button type="primary" @click="doWeigh"></el-button>
<el-button type="primary" plain>去皮初始化天平</el-button> <el-button type="primary" plain>去皮初始化天平</el-button>
<el-input placeholder="手动输入" /> <el-input placeholder="手动输入" />
<el-button type="warning">设置为空</el-button> <el-button type="warning">设置为空</el-button>
@ -31,20 +31,26 @@
<div class="bottom"> <div class="bottom">
<div class="title">详情信息</div> <div class="title">详情信息</div>
<el-descriptions class="margin-top" :column="2" border> <el-descriptions class="margin-top" :column="2" border>
<el-descriptions-item span="2" label="试剂名称">氢氧化1-(3-硫代丙基)-2-13-(3-硫代丙基)-2(3H)-苯并噻唑亚基]甲基}萘并[1.2-d]噻唑内盐,三乙基铵盐</el-descriptions-item> <el-descriptions-item span="2" label="试剂名称">{{ infoData.name }}</el-descriptions-item>
<el-descriptions-item span="2" label="英文名称">1-(3-Sulfopropyl)-2-[3-(3-sulfopropyl)-2(3H)-benzothiazolylidene]methyl}naphtho1,2-djthiazolium</el-descriptions-item> <el-descriptions-item span="2" label="英文名称">{{ infoData.english_name }}}</el-descriptions-item>
<el-descriptions-item label="条码编号">578104F3500104E0</el-descriptions-item> <el-descriptions-item label="条码编号">{{ infoData.bar_code }}</el-descriptions-item>
<el-descriptions-item label="CAS码">226883-66-5</el-descriptions-item> <el-descriptions-item label="CAS码">{{ infoData.cas_number }}</el-descriptions-item>
<el-descriptions-item label="试剂纯度">AR</el-descriptions-item> <el-descriptions-item label="试剂纯度">{{ infoData.purity }}</el-descriptions-item>
<el-descriptions-item label="试剂余量">578</el-descriptions-item> <el-descriptions-item label="试剂余量">578</el-descriptions-item>
<el-descriptions-item label="生产日期">2022-02-26 10:00:00</el-descriptions-item> <el-descriptions-item label="生产日期">{{ infoData.production_date }}</el-descriptions-item>
<el-descriptions-item label="过期日期">2023-02-26 10:00:00</el-descriptions-item> <el-descriptions-item label="过期日期">{{ infoData.expiration_date }}</el-descriptions-item>
<el-descriptions-item label="生产厂家">中国计量科学研究院</el-descriptions-item> <el-descriptions-item label="生产厂家">{{ infoData.manufacturer }}</el-descriptions-item>
<el-descriptions-item label="经销商">中国计量科学研究院</el-descriptions-item> <el-descriptions-item label="经销商">{{ infoData.distributor }}</el-descriptions-item>
<el-descriptions-item label="当前状态">出库</el-descriptions-item> <el-table-column align="center" property="status" label="状态">
<el-descriptions-item label="是否监管"></el-descriptions-item> <template slot-scope="scope">
<el-descriptions-item label="所属终端">1号柜-L2-A1</el-descriptions-item> <el-tag :type="statusColorMap[scope.row.status-1]">{{ statusMap[scope.row.status - 1] }}</el-tag>
<el-descriptions-item label="最后使用人"><el-tag>陈小红</el-tag></el-descriptions-item> </template>
</el-table-column>
<el-descriptions-item label="是否监管">{{ infoData.is_supervise }}</el-descriptions-item>
<el-descriptions-item label="所属终端">{{ infoData.client_id }}</el-descriptions-item>
<el-descriptions-item label="最后使用人">
<el-tag>{{ infoData.by_user_name }}</el-tag>
</el-descriptions-item>
</el-descriptions> </el-descriptions>
</div> </div>
</div> </div>
@ -56,6 +62,9 @@
import Scannner from '@/components/Scannner/index' import Scannner from '@/components/Scannner/index'
import { use } from '@/api/reagent/receivingReturn' import { use } from '@/api/reagent/receivingReturn'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
import { update_drug_remain, weigh } from '@/api/reagent/weight'
import { set_drug_empty_bottle } from '@/api/reagent/management'
export default { export default {
name: 'Weighing', name: 'Weighing',
components: { Scannner }, components: { Scannner },
@ -64,7 +73,11 @@ export default {
headerStyle: { 'background': '#E6E6E6' }, headerStyle: { 'background': '#E6E6E6' },
tableData: [], tableData: [],
radio: '1', radio: '1',
barCode: '' barCode: '',
infoData: '',
statusMap: ['在库', '出库', '空瓶'],
statusColorMap: ['success', '', 'warning'],
weight: '0.00'
} }
}, },
watch: { watch: {
@ -73,8 +86,8 @@ export default {
barCode: function(newCode, oldCode) { barCode: function(newCode, oldCode) {
if (this.$route.name === 'Receiving') { if (this.$route.name === 'Receiving') {
use(stringify({ 'bar_code': newCode })).then(res => { use(stringify({ 'bar_code': newCode })).then(res => {
this.tableData.push(res.data) this.infoData = res.data
this.$message.success(res.data.name + ' 试剂领成功!') this.$message.success(res.data.name + ' 试剂领扫描成功!')
}) })
} else { } else {
this.dialogVisible = true this.dialogVisible = true
@ -87,50 +100,90 @@ export default {
methods: { methods: {
getCode(code) { getCode(code) {
this.barCode = code this.barCode = code
},
handleSetEmpty() {
if (this.infoData.medicament_id) {
const data = {
medicament_id: this.infoData.medicament_id
}
set_drug_empty_bottle(stringify(data)).then(res => {
this.$message.success(res.msg)
})
} else {
this.$message.warning('请选择试剂!')
}
},
doWeigh() {
weigh().then(
res => (this.weight = res.data)
)
},
updateDrugRemain() {
if (this.infoData.medicament_id) {
const data = {
'medicament_id': this.infoData.medicament_id,
'reain': this.weight
}
update_drug_remain(stringify(data)).then(
res => {
this.$message.success(res.msg)
}
)
} else {
this.$message.warning('请选择试剂!')
}
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.contents{ .contents {
margin: 1rem; margin: 1rem;
display: flex; display: flex;
.content{
.content {
width: 50%; width: 50%;
height: calc(100vh - 110px); height: calc(100vh - 110px);
padding: 1rem; padding: 1rem;
background: white; background: white;
.title{
.title {
font-size: 1.25rem; font-size: 1.25rem;
font-weight: bold; font-weight: bold;
color: #000000; color: #000000;
} }
.tip{
.tip {
width: 100%; width: 100%;
font-size: 0.875rem; font-size: 0.875rem;
font-weight: 400; font-weight: 400;
color: #C0C4CC; color: #C0C4CC;
text-align: right; text-align: right;
} }
.img{
.img {
text-align: center; text-align: center;
margin-top: 6rem; margin-top: 6rem;
img{
img {
width: 25.25rem; width: 25.25rem;
} }
} }
.text{
.text {
margin-top: 2rem; margin-top: 2rem;
text-align: center; text-align: center;
font-size: 1.8rem; font-size: 1.8rem;
font-weight: 400; font-weight: 400;
color: #909399; color: #909399;
} }
.show-data{
.show-data {
margin-top: 1rem; margin-top: 1rem;
.top{
.num{ .top {
.num {
width: 660px; width: 660px;
height: 124px; height: 124px;
background: linear-gradient(180deg, #FFFFFF 0%, #F2F6FC 100%); background: linear-gradient(180deg, #FFFFFF 0%, #F2F6FC 100%);
@ -140,23 +193,28 @@ export default {
} }
} }
} }
.page{
.page {
text-align: center; text-align: center;
} }
} }
.left{
.left {
margin-right: 1rem; margin-right: 1rem;
} }
.right{
.right {
background-color: #F7F7F7; background-color: #F7F7F7;
padding: 0; padding: 0;
.top{
.top {
background: white; background: white;
margin-bottom: 1rem; margin-bottom: 1rem;
padding: 1rem; padding: 1rem;
.show-data{
.top{ .show-data {
.num{ .top {
.num {
padding: 0.75rem 8.25rem 0.75rem 8.25rem; padding: 0.75rem 8.25rem 0.75rem 8.25rem;
width: 41.25rem; width: 41.25rem;
height: 7.75rem; height: 7.75rem;
@ -168,7 +226,8 @@ export default {
font-weight: 400; font-weight: 400;
color: #606266; color: #606266;
} }
.unit{
.unit {
font-size: 32px; font-size: 32px;
font-weight: 400; font-weight: 400;
color: #909399; color: #909399;
@ -177,15 +236,18 @@ export default {
} }
} }
.bottom{
.bottom {
background: white; background: white;
padding: 1rem; padding: 1rem;
.el-input{
.el-input {
width: 6rem; width: 6rem;
margin-right: 1rem; margin-right: 1rem;
margin-left: 1rem; margin-left: 1rem;
} }
.title{
.title {
margin-bottom: 1rem; margin-bottom: 1rem;
} }
} }

Loading…
Cancel
Save