diff --git a/src/api/reagent/weight.js b/src/api/reagent/weight.js
new file mode 100644
index 0000000..553f1c9
--- /dev/null
+++ b/src/api/reagent/weight.js
@@ -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
+ })
+}
diff --git a/src/views/reagent/weighing/index.vue b/src/views/reagent/weighing/index.vue
index db3d503..faca264 100644
--- a/src/views/reagent/weighing/index.vue
+++ b/src/views/reagent/weighing/index.vue
@@ -15,13 +15,13 @@
- 1042.56
+ {{ weight }}
克(g)
余量称重
用量称重
-
开始称重
+
开始称重
去皮(初始化天平)
设置为空
@@ -31,20 +31,26 @@
详情信息
- 氢氧化1-(3-硫代丙基)-2-13-(3-硫代丙基)-2(3H)-苯并噻唑亚基]甲基}萘并[1.2-d]噻唑内盐,三乙基铵盐
- 1-(3-Sulfopropyl)-2-[3-(3-sulfopropyl)-2(3H)-benzothiazolylidene]methyl}naphtho1,2-djthiazolium
- 578104F3500104E0
- 226883-66-5
- AR
+ {{ infoData.name }}
+ {{ infoData.english_name }}}
+ {{ infoData.bar_code }}
+ {{ infoData.cas_number }}
+ {{ infoData.purity }}
578
- 2022-02-26 10:00:00
- 2023-02-26 10:00:00
- 中国计量科学研究院
- 中国计量科学研究院
- 出库
- 否
- 1号柜-L2-A1
- 陈小红
+ {{ infoData.production_date }}
+ {{ infoData.expiration_date }}
+ {{ infoData.manufacturer }}
+ {{ infoData.distributor }}
+
+
+ {{ statusMap[scope.row.status - 1] }}
+
+
+ {{ infoData.is_supervise }}
+ {{ infoData.client_id }}
+
+ {{ infoData.by_user_name }}
+
@@ -56,6 +62,9 @@
import Scannner from '@/components/Scannner/index'
import { use } from '@/api/reagent/receivingReturn'
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 {
name: 'Weighing',
components: { Scannner },
@@ -64,7 +73,11 @@ export default {
headerStyle: { 'background': '#E6E6E6' },
tableData: [],
radio: '1',
- barCode: ''
+ barCode: '',
+ infoData: '',
+ statusMap: ['在库', '出库', '空瓶'],
+ statusColorMap: ['success', '', 'warning'],
+ weight: '0.00'
}
},
watch: {
@@ -73,8 +86,8 @@ export default {
barCode: function(newCode, oldCode) {
if (this.$route.name === 'Receiving') {
use(stringify({ 'bar_code': newCode })).then(res => {
- this.tableData.push(res.data)
- this.$message.success(res.data.name + ' 试剂领用成功!')
+ this.infoData = res.data
+ this.$message.success(res.data.name + ' 试剂领扫描成功!')
})
} else {
this.dialogVisible = true
@@ -87,50 +100,90 @@ export default {
methods: {
getCode(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('请选择试剂!')
+ }
}
}
}