You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
142 lines
4.9 KiB
Vue
142 lines
4.9 KiB
Vue
1 year ago
|
<template>
|
||
|
<div>
|
||
|
<el-card style="margin-top: -20px">
|
||
|
<!--<div style=" float: right;-->
|
||
|
<!-- text-align: right;-->
|
||
|
<!-- margin-bottom: 8px;">-->
|
||
|
<!-- <el-button type="primary" size="mini" icon="search" @click="addDrugLevel"-->
|
||
|
<!-- style="text-align:right">新增药品层级-->
|
||
|
<!-- </el-button>-->
|
||
|
<!--</div>-->
|
||
|
<el-descriptions title="产品信息" :column="2" border style="margin-top: 5px">
|
||
|
<el-descriptions-item label="产品名称">{{ prescribeData.cpmctymc }}</el-descriptions-item>
|
||
|
<el-descriptions-item label="产品标识">{{ prescribeData.nameCode }}</el-descriptions-item>
|
||
|
<el-descriptions-item label="产品规格">{{ prescribeData.ggxh }}</el-descriptions-item>
|
||
|
<el-descriptions-item label="批次号">{{ prescribeData.batchNo }}</el-descriptions-item>
|
||
|
<el-descriptions-item label="计量单位">{{ prescribeData.measname }}</el-descriptions-item>
|
||
|
<el-descriptions-item label="剩余数量">{{ prescribeData.reCount }}</el-descriptions-item>
|
||
|
<el-descriptions-item label="生产日期">{{ produceDate }}</el-descriptions-item>
|
||
|
<el-descriptions-item label="失效日期">{{ expireDate }}</el-descriptions-item>
|
||
|
<el-descriptions-item label="生产企业">{{ prescribeData.manufactory }}</el-descriptions-item>
|
||
|
<el-descriptions-item label="供应商">{{ prescribeData.supName }}</el-descriptions-item>
|
||
|
<el-descriptions-item label="医保编码">{{ prescribeData.ybbm }}</el-descriptions-item>
|
||
|
</el-descriptions>
|
||
|
<!--<el-button type="primary" icon="el-icon-plus" sty>提交</el-button>-->
|
||
|
|
||
|
<el-form :inline="true" :model="formData" class="demo-form-inline" style="margin-top: 30px" :rules="rules" ref="formRef">
|
||
|
<el-row :gutter="24">
|
||
|
<el-col :span="10">
|
||
|
<el-form-item label="损耗出库数量" prop="count">
|
||
|
<el-input v-model.number="formData.count" placeholder="请填写损耗出库数量" type="number" :min="1" @input="checkCount"></el-input>
|
||
|
<!--<span v-if="countExceeded" class="exceeded-message">损耗出库数量不能超过10个</span>-->
|
||
|
</el-form-item>
|
||
|
</el-col>
|
||
|
<el-col :span="10">
|
||
|
<el-form-item label="损耗出库说明">
|
||
|
<el-input v-model="formData.remark" placeholder="请填写损耗出库说明" clearable></el-input>
|
||
|
</el-form-item>
|
||
|
</el-col>
|
||
|
</el-row>
|
||
|
|
||
|
<!--<el-form-item>-->
|
||
|
<!-- <el-button type="primary" @click="onSubmit">提交</el-button>-->
|
||
|
<!--</el-form-item>-->
|
||
|
</el-form>
|
||
|
|
||
|
<div style="text-align: center; margin-top: 20px;">
|
||
|
<el-button type="primary" @click="destroyOutOrder" :loading="saveLoading">提交</el-button>
|
||
|
<el-button @click="closeAddDialog">取消</el-button>
|
||
|
</div>
|
||
|
</el-card>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import { destroyOut } from '@/api/collect/IoDestroy'
|
||
|
|
||
|
export default {
|
||
|
name: 'destroyOutDialog',
|
||
|
props: {
|
||
|
prescribeData: {
|
||
|
type: Object,
|
||
|
required: true
|
||
|
},
|
||
|
closeDialog: {
|
||
|
type: Function,
|
||
|
required: true
|
||
|
}
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
formData:{},
|
||
|
produceDate: null,
|
||
|
expireDate: null,
|
||
|
saveLoading: false,
|
||
|
rules: {
|
||
|
count: [
|
||
|
{ validator: this.validateCount,message: '损耗出库数量不能超出剩余数量',trigger: 'blur' }
|
||
|
]
|
||
|
},
|
||
|
|
||
|
}
|
||
|
},
|
||
|
methods: {
|
||
|
conversionDate(dateString){
|
||
|
const parts = dateString.split('');
|
||
|
const year = '20' + parts.slice(0, 2).join('') ;
|
||
|
const month = parts[2] + parts[3];
|
||
|
const day = parts[4] + parts[5];
|
||
|
return `${year}-${month}-${day}`;
|
||
|
},
|
||
|
validateCount(rule, value, callback) {
|
||
|
if (value > this.prescribeData.reCount) {
|
||
|
callback(new Error('损耗出库数量超出剩余数量'));
|
||
|
} else {
|
||
|
callback();
|
||
|
}
|
||
|
},
|
||
|
checkCount() {
|
||
|
// 这里可以调用表单验证方法
|
||
|
this.$refs.formRef.validateField('count');
|
||
|
},
|
||
|
closeAddDialog(){
|
||
|
this.closeDialog()
|
||
|
},
|
||
|
|
||
|
//损耗出库
|
||
|
destroyOutOrder(){
|
||
|
let query = {
|
||
|
outCount: this.formData.count,
|
||
|
remark: this.formData.remark,
|
||
|
updateUser: this.$store.getters.adminId,
|
||
|
createUser: this.$store.getters.adminId,
|
||
|
splitFifoInv : this.prescribeData
|
||
|
}
|
||
|
destroyOut(query).then(res => {
|
||
|
if (res.code == 20000){
|
||
|
this.closeDialog()
|
||
|
return this.$message.success("损耗出库成功")
|
||
|
}else {
|
||
|
return this.$message.error(res.message)
|
||
|
}
|
||
|
})
|
||
|
},
|
||
|
|
||
|
},
|
||
|
created() {
|
||
|
if (this.prescribeData.produceDate != null){
|
||
|
this.produceDate = this.conversionDate(this.prescribeData.produceDate)
|
||
|
}
|
||
|
if (this.prescribeData.expireDate != null){
|
||
|
this.expireDate = this.conversionDate(this.prescribeData.expireDate)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style scoped>
|
||
|
|
||
|
|
||
|
|
||
|
</style>
|