|
|
|
@ -4,17 +4,21 @@
|
|
|
|
|
<div class="header">
|
|
|
|
|
<el-select v-model="client_id" placeholder="请选择柜体">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in $store.getters.clientOptions"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.client_name"
|
|
|
|
|
:value="item.client_id"
|
|
|
|
|
/>
|
|
|
|
|
v-for="item in $store.getters.currentOptions"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.client_name"
|
|
|
|
|
:value="item.client_id"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-button type="primary" plain @click="handleAddReagent"><i class="el-icon-edit" />录入库存</el-button>
|
|
|
|
|
<el-button type="primary" @click="handleCheck">提交校验</el-button>
|
|
|
|
|
<div class="header-right">
|
|
|
|
|
<el-button type="primary" @click="handleCheck">查看盘点</el-button>
|
|
|
|
|
<!-- <div class="header-right">
|
|
|
|
|
<el-button type="primary" plain @click="handleHistory">历史记录</el-button>
|
|
|
|
|
<el-button icon="el-icon-refresh" circle @click="handleRefresh" />
|
|
|
|
|
</div> -->
|
|
|
|
|
<div class="header-right">
|
|
|
|
|
<el-button icon="el-icon-delete" circle @click="handleDel" />
|
|
|
|
|
<el-button icon="el-icon-refresh" circle @click="handleRefresh" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table
|
|
|
|
@ -24,54 +28,12 @@
|
|
|
|
|
height="69vh"
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column
|
|
|
|
|
type="selection"
|
|
|
|
|
width="55"
|
|
|
|
|
align="center"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
align="center"
|
|
|
|
|
type="index"
|
|
|
|
|
width="50"
|
|
|
|
|
label="序号"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="name"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
label="试剂名称"
|
|
|
|
|
align="center"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="purity"
|
|
|
|
|
label="纯度"
|
|
|
|
|
align="center"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
prop="address"
|
|
|
|
|
label="人工录入库存量"
|
|
|
|
|
align="center"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="address"
|
|
|
|
|
label="系统校验库存量"
|
|
|
|
|
align="center"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="address"
|
|
|
|
|
label="校验结果"
|
|
|
|
|
align="center"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="address"
|
|
|
|
|
label="操作用户"
|
|
|
|
|
align="center"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="address"
|
|
|
|
|
label="最新一次校验时间"
|
|
|
|
|
align="center"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column align="center" type="index" width="50" label="序号" />
|
|
|
|
|
<el-table-column prop="create_date" show-overflow-tooltip label="录入时间" align="center" />
|
|
|
|
|
<el-table-column prop="user_name" show-overflow-tooltip label="录入人" align="center" />
|
|
|
|
|
<el-table-column prop="medicament_info" show-overflow-tooltip label="信息详情" align="center" />
|
|
|
|
|
<el-table-column prop="client_name" show-overflow-tooltip label="终端名称" align="center" />
|
|
|
|
|
</el-table>
|
|
|
|
|
<div class="my-pagination" style="text-align: center">
|
|
|
|
|
<el-pagination
|
|
|
|
@ -80,41 +42,46 @@
|
|
|
|
|
:current-page.sync="page"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page-size.sync="page_size"
|
|
|
|
|
|
|
|
|
|
@current-change="pageChange"
|
|
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<el-dialog
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
:visible.sync="dialogVisible"
|
|
|
|
|
width="30%"
|
|
|
|
|
height="500px"
|
|
|
|
|
title="录入库存"
|
|
|
|
|
@close="onClose"
|
|
|
|
|
>
|
|
|
|
|
<div v-for="item in multipleSelection" :key="item.id" class="add-item">
|
|
|
|
|
<div>{{ `${item.name} (${item.purity})` }}</div>
|
|
|
|
|
<el-input v-model.number="item.num" placement="请输入校验在库数量" />
|
|
|
|
|
<div class="box">
|
|
|
|
|
<el-scrollbar style="height: 100%">
|
|
|
|
|
<el-form>
|
|
|
|
|
<div v-for="(item, index) in multipleSelection" :key="index">
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item :label="item.name" prop="input_num">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="item.input_num"
|
|
|
|
|
placeholder="请输入数量"
|
|
|
|
|
clearable
|
|
|
|
|
type="number"
|
|
|
|
|
:style="{width: '100%'}"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
</div>
|
|
|
|
|
<div slot="footer" style="text-align: center">
|
|
|
|
|
<el-button @click="close">取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="handelConfirm">确定</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<el-dialog :close-on-click-modal="false" :visible.sync="dialogHistoryVisible" width="60%" title="历史记录">
|
|
|
|
|
<!-- <el-dialog :close-on-click-modal="false" :visible.sync="dialogHistoryVisible" width="60%" title="历史记录">
|
|
|
|
|
<div class="header">
|
|
|
|
|
<div class="header-left">
|
|
|
|
|
<!-- <el-date-picker-->
|
|
|
|
|
<!-- v-model="value1"-->
|
|
|
|
|
<!-- type="date"-->
|
|
|
|
|
<!-- placeholder="选择日期">-->
|
|
|
|
|
<!-- </el-date-picker>-->
|
|
|
|
|
<!-- <el-time-picker-->
|
|
|
|
|
<!-- v-model="value2"-->
|
|
|
|
|
<!-- is-range-->
|
|
|
|
|
<!-- range-separator="至"-->
|
|
|
|
|
<!-- start-placeholder="开始时间"-->
|
|
|
|
|
<!-- end-placeholder="结束时间"-->
|
|
|
|
|
<!-- placeholder="选择时间范围">-->
|
|
|
|
|
<!-- </el-time-picker>-->
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="value2"
|
|
|
|
|
type="datetimerange"
|
|
|
|
@ -122,82 +89,67 @@
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
/>
|
|
|
|
|
<el-select v-model="history_client_id" class="header-select" placeholder="请选择柜体">
|
|
|
|
|
<el-select v-model="client_id" class="header-select" placeholder="请选择柜体">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in $store.getters.clientOptions"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.client_name"
|
|
|
|
|
:value="item.client_id"
|
|
|
|
|
v-for="item in $store.getters.currentOptions"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.client_name"
|
|
|
|
|
:value="item.client_id"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-input v-model="name" placeholder="搜索试剂名称" />
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="searchHistory">搜索</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table
|
|
|
|
|
v-loading="loadingHistory"
|
|
|
|
|
element-loading-text="拼命加载中"
|
|
|
|
|
:header-cell-style="headerStyle"
|
|
|
|
|
:data="historyData"
|
|
|
|
|
height="420"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column align="center" property="name" label="试剂名称" />
|
|
|
|
|
<el-table-column align="center" property="english_name" label="英文名称" />
|
|
|
|
|
<el-table-column align="center" property="bar_code" label="试剂编码" />
|
|
|
|
|
<el-table-column align="center" property="purity" label="纯度" />
|
|
|
|
|
<el-table-column align="center" property="cas_number" label="CAS码" />
|
|
|
|
|
<el-table-column align="center" property="use_quantity" label="用量" />
|
|
|
|
|
<el-table-column align="center" property="create_date" label="归还时间" />
|
|
|
|
|
<el-table-column align="center" property="create_user_name" label="操作人员" />
|
|
|
|
|
<el-table-column align="center" property="client_id" label="所属终端" />
|
|
|
|
|
</el-table>
|
|
|
|
|
<div class="my-pagination" style="text-align: center">
|
|
|
|
|
<el-pagination
|
|
|
|
|
background
|
|
|
|
|
layout="prev, pager, next"
|
|
|
|
|
:current-page.sync="history_page"
|
|
|
|
|
:total="history_total"
|
|
|
|
|
:page-size.sync="history_page_size"
|
|
|
|
|
@current-change="pageChange"
|
|
|
|
|
/>
|
|
|
|
|
</div> -->
|
|
|
|
|
<el-dialog :close-on-click-modal="false" :visible.sync="dialogHistoryVisible" width="60%" title="库存详情">
|
|
|
|
|
<div class="box">
|
|
|
|
|
<el-scrollbar style="height: 100%">
|
|
|
|
|
<el-table
|
|
|
|
|
v-loading="loadingHistory"
|
|
|
|
|
element-loading-text="拼命加载中"
|
|
|
|
|
:header-cell-style="headerStyle"
|
|
|
|
|
:data="historyData"
|
|
|
|
|
height="420"
|
|
|
|
|
@close="dialogHistoryClose"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column align="center" type="index" width="50" label="序号" />
|
|
|
|
|
<el-table-column align="center" property="name" label="试剂名称" />
|
|
|
|
|
<el-table-column align="center" property="purity" label="纯度" />
|
|
|
|
|
<el-table-column align="center" property="speci" label="规格" />
|
|
|
|
|
<el-table-column align="center" property="purity" label="纯度" />
|
|
|
|
|
<el-table-column align="center" property="input_num" label="录入量" />
|
|
|
|
|
<el-table-column align="center" property="stock_num" label="库存量" />
|
|
|
|
|
<el-table-column align="center" property="difference_num" label="相差值" />
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
get_list,
|
|
|
|
|
get_drug_list,
|
|
|
|
|
set_stock,
|
|
|
|
|
del_stock,
|
|
|
|
|
get_stock_info
|
|
|
|
|
} from '@/api/reagent/drugStock'
|
|
|
|
|
import stringify from '@/utils/stringify'
|
|
|
|
|
export default {
|
|
|
|
|
name: 'Inventory',
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// drugStockForm:[],
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 15,
|
|
|
|
|
total: 100,
|
|
|
|
|
total: 0,
|
|
|
|
|
client_id: '',
|
|
|
|
|
dialogVisible: false,
|
|
|
|
|
tableData: [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
name: '硫酸',
|
|
|
|
|
purity: 'AR',
|
|
|
|
|
num: 0
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
name: '硼氢化钾',
|
|
|
|
|
purity: 'AR',
|
|
|
|
|
num: 0
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
name: '氢氧化1-(3-硫代丙基)-2-13-(3-硫代丙基)-2(3H)-苯并噻唑亚' +
|
|
|
|
|
'基]甲基}萘并[1.2-d]噻唑内盐,三乙基铵盐(AR)',
|
|
|
|
|
purity: 'AR',
|
|
|
|
|
num: 0
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
tableData: [],
|
|
|
|
|
headerStyle: { 'background': '#E6E6E6' },
|
|
|
|
|
multipleSelection: [],
|
|
|
|
|
handleSelectionSelection: [],
|
|
|
|
|
dialogHistoryVisible: false,
|
|
|
|
|
loadingHistory: false,
|
|
|
|
|
historyData: [],
|
|
|
|
@ -210,38 +162,112 @@ export default {
|
|
|
|
|
history_total: 100
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created () {
|
|
|
|
|
this.client_id = this.$store.getters.currentOptions[0].client_id
|
|
|
|
|
this.get_stock_list()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
get_stock_list: function() {
|
|
|
|
|
const data = {
|
|
|
|
|
client_id: this.client_id,
|
|
|
|
|
page:this.page,
|
|
|
|
|
page_size: this.page_size
|
|
|
|
|
}
|
|
|
|
|
get_list(stringify(data)).then(rsp => {
|
|
|
|
|
this.tableData = rsp.data.data_list
|
|
|
|
|
this.total = rsp.data.total_count
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
pageChange(page) {
|
|
|
|
|
this.page = page
|
|
|
|
|
this.get_stock_list()
|
|
|
|
|
},
|
|
|
|
|
handleSelectionChange(val) {
|
|
|
|
|
this.multipleSelection = val
|
|
|
|
|
},
|
|
|
|
|
handleHistory() {
|
|
|
|
|
this.dialogHistoryVisible = true
|
|
|
|
|
this.handleSelectionSelection = val
|
|
|
|
|
},
|
|
|
|
|
// handleHistory() {
|
|
|
|
|
// this.dialogHistoryVisible = true
|
|
|
|
|
// },
|
|
|
|
|
handleRefresh() {
|
|
|
|
|
this.get_stock_list()
|
|
|
|
|
},
|
|
|
|
|
handleDel() {
|
|
|
|
|
if (this.handleSelectionSelection.length === 1) {
|
|
|
|
|
const data = {
|
|
|
|
|
id:this.handleSelectionSelection[0].id
|
|
|
|
|
}
|
|
|
|
|
del_stock(stringify(data)).then(rsp => {
|
|
|
|
|
if (rsp.status === 0) {
|
|
|
|
|
this.$message.success("删除成功!")
|
|
|
|
|
this.get_stock_list()
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(rsp.msg)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.warning("选择一条记录操作")
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 录入库存
|
|
|
|
|
handleAddReagent() {
|
|
|
|
|
if (this.multipleSelection.length === 0) {
|
|
|
|
|
this.$message.warning('请选择试剂!')
|
|
|
|
|
return
|
|
|
|
|
const data = {
|
|
|
|
|
client_id: this.client_id
|
|
|
|
|
}
|
|
|
|
|
get_drug_list(stringify(data)).then(rsp => {
|
|
|
|
|
this.multipleSelection = rsp.data
|
|
|
|
|
})
|
|
|
|
|
this.dialogVisible = true
|
|
|
|
|
},
|
|
|
|
|
// 提交校验
|
|
|
|
|
// 查看 录入信息
|
|
|
|
|
handleCheck() {
|
|
|
|
|
|
|
|
|
|
if (this.handleSelectionSelection.length === 1) {
|
|
|
|
|
this.dialogHistoryVisible = true
|
|
|
|
|
const data = {
|
|
|
|
|
id:this.handleSelectionSelection[0].id
|
|
|
|
|
}
|
|
|
|
|
get_stock_info(stringify(data)).then(rsp => {
|
|
|
|
|
if (rsp.status === 0) {
|
|
|
|
|
this.historyData = rsp.data
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(rsp.msg)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.warning("选择一条记录操作!")
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
dialogHistoryClose() {
|
|
|
|
|
this.dialogHistoryVisible = false
|
|
|
|
|
this.historyData = []
|
|
|
|
|
},
|
|
|
|
|
onClose() {
|
|
|
|
|
this.multipleSelection = []
|
|
|
|
|
},
|
|
|
|
|
close() {
|
|
|
|
|
this.dialogVisible = false
|
|
|
|
|
this.multipleSelection = []
|
|
|
|
|
},
|
|
|
|
|
handelConfirm() {
|
|
|
|
|
|
|
|
|
|
const stock_info = {}
|
|
|
|
|
for (let i = 0; i < this.multipleSelection.length; i++) {
|
|
|
|
|
stock_info[this.multipleSelection[i].name] = this.multipleSelection[i].input_num == "" ? 0: parseInt(this.multipleSelection[i].input_num)
|
|
|
|
|
}
|
|
|
|
|
const data = {
|
|
|
|
|
stock_info: JSON.stringify(stock_info),
|
|
|
|
|
client_id: this.client_id,
|
|
|
|
|
client_code: this.client_code
|
|
|
|
|
}
|
|
|
|
|
set_stock(stringify(data)).then(rsp => {
|
|
|
|
|
console.log(rsp)
|
|
|
|
|
if (rsp.status == 0) {
|
|
|
|
|
this.$message.success(rsp.msg)
|
|
|
|
|
this.dialogVisible = false
|
|
|
|
|
this.get_stock_list()
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(rsp.msg)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
searchHistory() {
|
|
|
|
|
|
|
|
|
@ -285,3 +311,20 @@ export default {
|
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
/* 1,必须去掉scoped,否则overflow-x: hidden失效 */
|
|
|
|
|
.box {
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
width: 95%;
|
|
|
|
|
height: 95%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 2,外包一个div,来减少对其他页面会有冲突(此时缺少scoped) */
|
|
|
|
|
.box .el-scrollbar__wrap {
|
|
|
|
|
overflow-x: hidden;
|
|
|
|
|
}
|
|
|
|
|
.el-dialog__body {
|
|
|
|
|
height: 500px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|