|
@@ -2,38 +2,46 @@
|
|
|
<template>
|
|
|
<div class="">
|
|
|
<el-button el-button type="primary" icon="Camera" @click="showDia">入库</el-button>
|
|
|
- <el-dialog v-model="dialogFormVisible" title="入库" :append-to-body="true" :before-close="closeFun" draggable :close-on-click-modal="false" :close-on-press-escape="false" width="60%">
|
|
|
+ <el-dialog v-model="dialogFormVisible" title="入库" :append-to-body="true" :before-close="closeFun" draggable
|
|
|
+ :close-on-click-modal="false" :close-on-press-escape="false" width="60%">
|
|
|
<el-form ref="ruleFormRef" :rules="rules" :model="initParam" :inline="true">
|
|
|
<el-divider content-position="center">药品信息</el-divider>
|
|
|
- <el-form-item :label="item.name" :label-width="formLabelWidth" v-for="(item,index) in data.showDiaData" :key="index" :prop="'medicineInfo.'+item.field_name">
|
|
|
- <el-select v-model="initParam.medicineInfo[item.field_name]" :placeholder="'请选择'+item.name" class="inputWidth" v-if="[1,2,3,4,5].includes(item.type)">
|
|
|
- <el-option :label="itemIt.name" :value="itemIt.id" v-for="itemIt,i in item.list" :key="i"/>
|
|
|
+ <el-form-item :label="item.name" :label-width="formLabelWidth" v-for="(item, index) in data.showDiaData"
|
|
|
+ :key="index" :prop="'medicineInfo.' + item.field_name">
|
|
|
+ <el-select v-model="initParam.medicineInfo[item.field_name]" :placeholder="'请选择' + item.name"
|
|
|
+ class="inputWidth" v-if="[1, 2, 3, 4, 5].includes(item.type)">
|
|
|
+ <el-option :label="itemIt.name" :value="itemIt.id" v-for="itemIt, i in item.list" :key="i" />
|
|
|
</el-select>
|
|
|
- <el-input v-model="initParam.medicineInfo[item.field_name]" autocomplete="off" :placeholder="'请输入'+item.name" class="inputWidth" v-if="item.type==6"/>
|
|
|
- <el-input v-model="initParam.medicineInfo[item.field_name]" autocomplete="off" :placeholder="'请输入'+item.name" class="inputWidth" v-if="item.type==7"/>
|
|
|
- <el-input v-model="initParam.medicineInfo[item.field_name]" autocomplete="off" :placeholder="'请输入'+item.name" class="inputWidth" v-if="item.type==8"/>
|
|
|
- <el-date-picker v-model="initParam.medicineInfo[item.field_name]" type="date" value-format="YYYY-MM-DD" :placeholder="'请输入'+item.name" clearable style="width: 200px;" v-if="item.type==9"/>
|
|
|
- <el-date-picker v-model="initParam.medicineInfo[item.field_name]" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" :placeholder="'请输入'+item.name" clearable style="width: 200px;" v-if="item.type==10"/>
|
|
|
+ <el-input v-model="initParam.medicineInfo[item.field_name]" autocomplete="off"
|
|
|
+ :placeholder="'请输入' + item.name" class="inputWidth" v-if="item.type == 6" />
|
|
|
+ <el-input v-model="initParam.medicineInfo[item.field_name]" autocomplete="off"
|
|
|
+ :placeholder="'请输入' + item.name" class="inputWidth" v-if="item.type == 7" />
|
|
|
+ <el-input v-model="initParam.medicineInfo[item.field_name]" autocomplete="off"
|
|
|
+ :placeholder="'请输入' + item.name" class="inputWidth" v-if="item.type == 8" />
|
|
|
+ <el-date-picker v-model="initParam.medicineInfo[item.field_name]" type="date" value-format="YYYY-MM-DD"
|
|
|
+ :placeholder="'请输入' + item.name" clearable style="width: 200px;" v-if="item.type == 9" />
|
|
|
+ <el-date-picker v-model="initParam.medicineInfo[item.field_name]" type="datetime"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss" :placeholder="'请输入' + item.name" clearable style="width: 200px;"
|
|
|
+ v-if="item.type == 10" />
|
|
|
</el-form-item>
|
|
|
<el-divider content-position="center">入库信息</el-divider>
|
|
|
<el-form-item class="el-form-item-main" label="数量" :label-width="formLabelWidth" prop="quantity">
|
|
|
<el-input v-model.number="initParam.quantity" autocomplete="off" class="inputWidth" />
|
|
|
</el-form-item>
|
|
|
<el-form-item class="el-form-item-main" label="购进单价" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="initParam.unitPrice" autocomplete="off" class="inputWidth"/>
|
|
|
+ <el-input v-model="initParam.unitPrice" autocomplete="off" class="inputWidth" />
|
|
|
</el-form-item>
|
|
|
<el-form-item class="el-form-item-main" label="入库日期" :label-width="formLabelWidth" prop="date">
|
|
|
- <el-date-picker v-model="initParam.date" type="date" placeholder="血液制品效期" value-format="YYYY-MM-DD" clearable style="width: 200px;" />
|
|
|
+ <el-date-picker v-model="initParam.date" type="date" placeholder="入库日期" value-format="YYYY-MM-DD"
|
|
|
+ clearable style="width: 200px;" />
|
|
|
</el-form-item>
|
|
|
<el-form-item class="el-form-item-main" label="发货单位" :label-width="formLabelWidth">
|
|
|
- <el-select v-model="initParam.forwardingUnit" placeholder="请选择发货单位" class="inputWidth">
|
|
|
- <el-option :value="it" v-for="it,j in data.itemPir" :key="j" />
|
|
|
- </el-select>
|
|
|
+ <el-autocomplete v-model="initParam.forwardingUnit" :fetch-suggestions="querySearch1" clearable class="inputWidth"
|
|
|
+ placeholder="发货单位" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="经办人" :label-width="formLabelWidth" prop="operator">
|
|
|
- <el-select v-model="initParam.operator" placeholder="请选择经办人" class="inputWidth">
|
|
|
- <el-option :label="it" :value="it" v-for="(it,j) in data.itemOpen" :key="j+Math.random()" />
|
|
|
- </el-select>
|
|
|
+ <el-autocomplete v-model="initParam.operator" :fetch-suggestions="querySearch" clearable class="inputWidth"
|
|
|
+ placeholder="经办人" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
@@ -43,22 +51,25 @@
|
|
|
<el-button type="danger" @click="resetForm(ruleFormRef)">重置数据</el-button>
|
|
|
</span>
|
|
|
</template>
|
|
|
- <el-dialog v-model="innerVisible" title="入库数据" width="95%" append-to-body draggable :close-on-click-modal="false" :close-on-press-escape="false">
|
|
|
- <el-table :data="data.tableData" style="width: 100%" border max-height="450" :header-cell-style="{'background-color':'#ccc','color': 'white'}">
|
|
|
- <el-table-column :label="item.label" v-for="item,i in data.columns" :key="i" min-width="110" show-overflow-tooltip>
|
|
|
+ <el-dialog v-model="innerVisible" title="入库数据" width="95%" append-to-body draggable
|
|
|
+ :close-on-click-modal="false" :close-on-press-escape="false">
|
|
|
+ <el-table :data="data.tableData" style="width: 100%" border max-height="450"
|
|
|
+ :header-cell-style="{ 'background-color': '#ccc', 'color': 'white' }">
|
|
|
+ <el-table-column :label="item.label" v-for="item, i in data.columns" :key="i" min-width="110"
|
|
|
+ show-overflow-tooltip>
|
|
|
<template #default="scope"><!--scope.row.medicineInfo[item.prop] -->
|
|
|
- {{ findFun(scope.row.medicineInfo[item.prop],item.list)}}
|
|
|
+ {{ findFun(scope.row.medicineInfo[item.prop], item.list) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="quantity" label="数量" min-width="110" show-overflow-tooltip/>
|
|
|
- <el-table-column prop="unitPrice" label="购进单价" min-width="110" show-overflow-tooltip/>
|
|
|
- <el-table-column prop="forwardingUnit" label="发货单位" min-width="110" show-overflow-tooltip/>
|
|
|
- <el-table-column prop="date" label="入库日期" min-width="110" show-overflow-tooltip/>
|
|
|
- <el-table-column prop="operator" label="经办人" min-width="110" show-overflow-tooltip/>
|
|
|
+ <el-table-column prop="quantity" label="数量" min-width="110" show-overflow-tooltip />
|
|
|
+ <el-table-column prop="unitPrice" label="购进单价" min-width="110" show-overflow-tooltip />
|
|
|
+ <el-table-column prop="forwardingUnit" label="发货单位" min-width="110" show-overflow-tooltip />
|
|
|
+ <el-table-column prop="date" label="入库日期" min-width="110" show-overflow-tooltip />
|
|
|
+ <el-table-column prop="operator" label="经办人" min-width="110" show-overflow-tooltip />
|
|
|
|
|
|
<el-table-column fixed="right" label="操作" min-width="110">
|
|
|
<template #default="scope">
|
|
|
- <el-button type="primary" :icon="Edit" @click="handleClick(scope.row,scope.$index)" circle />
|
|
|
+ <el-button type="primary" :icon="Edit" @click="handleClick(scope.row, scope.$index)" circle />
|
|
|
<el-button type="danger" :icon="Delete" @click="delClick(scope.$index)" circle />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -75,16 +86,16 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { reactive, ref } from 'vue'
|
|
|
-import type { FormInstance, FormRules} from 'element-plus'
|
|
|
-import { ElNotification} from 'element-plus'
|
|
|
-import { syrulesData,columnsTable } from "@/plugins/rulesData";
|
|
|
+import { reactive, ref ,onMounted} from 'vue'
|
|
|
+import type { FormInstance, FormRules } from 'element-plus'
|
|
|
+import { ElNotification } from 'element-plus'
|
|
|
+import { syrulesData, columnsTable } from "@/plugins/rulesData";
|
|
|
const dialogFormVisible = ref(false)
|
|
|
const ruleFormRef = ref<FormInstance>()
|
|
|
|
|
|
-let rules:any = reactive({})
|
|
|
+let rules: any = reactive({})
|
|
|
|
|
|
-import {
|
|
|
+import {
|
|
|
medicListStock,
|
|
|
stockunit,//发货单位
|
|
|
operatorList,//经办人
|
|
@@ -93,33 +104,62 @@ import {
|
|
|
} from "@/api";
|
|
|
const innerVisible = ref(false)
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
-import {Delete,Edit,} from '@element-plus/icons-vue'
|
|
|
+import { Delete, Edit, } from '@element-plus/icons-vue'
|
|
|
const formLabelWidth = '110px'
|
|
|
-let initParam:any = reactive({
|
|
|
+let initParam: any = reactive({
|
|
|
"date": "",
|
|
|
"forwardingUnit": "",
|
|
|
"medicineInfo": {},
|
|
|
- "operator":'',
|
|
|
+ "operator": '',
|
|
|
"quantity": null,
|
|
|
- "unitPrice":null
|
|
|
+ "unitPrice": null
|
|
|
+})
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+interface RestaurantItem {
|
|
|
+ value: string
|
|
|
+ link: string
|
|
|
+}
|
|
|
+const restaurants = ref<RestaurantItem[]>([])
|
|
|
+const querySearch = (queryString: string, cb: any) => {
|
|
|
+ const results = queryString
|
|
|
+ ? restaurants.value.filter(createFilter(queryString))
|
|
|
+ : restaurants.value
|
|
|
+ cb(results)
|
|
|
+}
|
|
|
+const createFilter = (queryString: string) => {
|
|
|
+ return (restaurant: RestaurantItem) => {
|
|
|
+ return (
|
|
|
+ restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
|
|
+ )
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const restaurants1 = ref<RestaurantItem[]>([])
|
|
|
+const querySearch1 = (queryString: string, cb: any) => {
|
|
|
+ const results = queryString
|
|
|
+ ? restaurants1.value.filter(createFilter(queryString))
|
|
|
+ : restaurants1.value
|
|
|
+ cb(results)
|
|
|
+}
|
|
|
+
|
|
|
+let data: any = reactive({
|
|
|
+ tableData: [],
|
|
|
+ showDiaData: [],
|
|
|
+ itemPir: [],
|
|
|
+ rules1: {},
|
|
|
+ columns: [],// 渲染表格
|
|
|
+ selectType: [],//表格的下拉对应
|
|
|
+ editStrot: false,
|
|
|
+ editIndex: null
|
|
|
})
|
|
|
-let data:any = reactive({
|
|
|
- tableData:[],
|
|
|
- showDiaData:[],
|
|
|
- itemPir:[],
|
|
|
- itemOpen:[],
|
|
|
- rules1:{},
|
|
|
- columns:[],// 渲染表格
|
|
|
- selectType:[],//表格的下拉对应
|
|
|
- editStrot:false,
|
|
|
- editIndex:null
|
|
|
-})
|
|
|
-const emit:any = defineEmits(['scanCode'])
|
|
|
+const emit: any = defineEmits(['scanCode'])
|
|
|
//立即入库
|
|
|
-const subStock = async ()=>{
|
|
|
- const reslut:any = await stockTemplateBatchIn({"stockInList": data.tableData})
|
|
|
- console.log('返回',reslut)
|
|
|
- if(reslut.code==200 && reslut.msg=='入库成功'){
|
|
|
+const subStock = async () => {
|
|
|
+ const reslut: any = await stockTemplateBatchIn({ "stockInList": data.tableData })
|
|
|
+ console.log('返回', reslut)
|
|
|
+ if (reslut.code == 200 && reslut.msg == '入库成功') {
|
|
|
ElMessage.success(reslut.msg)
|
|
|
dialogFormVisible.value = false
|
|
|
innerVisible.value = false
|
|
@@ -128,53 +168,52 @@ const subStock = async ()=>{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//函数
|
|
|
-const findFun = (data:any,list:any)=>{
|
|
|
- if(list){
|
|
|
- const b = list.find((item:any) => item.id==data)
|
|
|
- if(b) return b.name
|
|
|
+const findFun = (data: any, list: any) => {
|
|
|
+ if (list) {
|
|
|
+ const b = list.find((item: any) => item.id == data)
|
|
|
+ if (b) return b.name
|
|
|
else return ''
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return data
|
|
|
}
|
|
|
}
|
|
|
const resetForm = (formEl: FormInstance | undefined) => {
|
|
|
- if (!formEl) return
|
|
|
- formEl.resetFields()
|
|
|
+ if (!formEl) return
|
|
|
+ formEl.resetFields()
|
|
|
}
|
|
|
//加入暂存区
|
|
|
const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
- if (!formEl) return
|
|
|
- await formEl.validate((valid, fields) => {
|
|
|
- if (valid) {
|
|
|
- ElNotification({
|
|
|
- title: '暂存成功',
|
|
|
- message: 'ok,加入暂存成功,右下角按钮查看/提交暂存',
|
|
|
- type: 'success',
|
|
|
- })
|
|
|
- console.log('提交',data.editStrot)
|
|
|
- if(data.editStrot){//编辑状态
|
|
|
- let {date,forwardingUnit,operator,quantity,unitPrice,medicineInfo} = initParam
|
|
|
- data.tableData.splice(data.editIndex,1,{date,forwardingUnit,operator,quantity,unitPrice:parseInt(unitPrice),medicineInfo:{...medicineInfo}})
|
|
|
- console.log('编辑状态',data.tableData)
|
|
|
- }else{//正常添加
|
|
|
- let {date,forwardingUnit,operator,quantity,unitPrice,medicineInfo} = initParam
|
|
|
- data.tableData.push({date,forwardingUnit,operator,quantity,unitPrice:parseInt(unitPrice),medicineInfo:{...medicineInfo}})
|
|
|
- console.log('正常添加',data.tableData)
|
|
|
+ if (!formEl) return
|
|
|
+ await formEl.validate((valid, fields) => {
|
|
|
+ if (valid) {
|
|
|
+ ElNotification({
|
|
|
+ title: '暂存成功',
|
|
|
+ message: 'ok,加入暂存成功,右下角按钮查看/提交暂存',
|
|
|
+ type: 'success',
|
|
|
+ })
|
|
|
+ console.log('提交', data.editStrot)
|
|
|
+ if (data.editStrot) {//编辑状态
|
|
|
+ let { date, forwardingUnit, operator, quantity, unitPrice, medicineInfo } = initParam
|
|
|
+ data.tableData.splice(data.editIndex, 1, { date, forwardingUnit, operator, quantity, unitPrice: parseInt(unitPrice), medicineInfo: { ...medicineInfo } })
|
|
|
+ console.log('编辑状态', data.tableData)
|
|
|
+ } else {//正常添加
|
|
|
+ let { date, forwardingUnit, operator, quantity, unitPrice, medicineInfo } = initParam
|
|
|
+ data.tableData.push({ date, forwardingUnit, operator, quantity, unitPrice: parseInt(unitPrice), medicineInfo: { ...medicineInfo } })
|
|
|
+ console.log('正常添加', data.tableData)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ElMessage.error('请完善必填项')
|
|
|
}
|
|
|
- } else {
|
|
|
- ElMessage.error('请完善必填项')
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
//函数
|
|
|
const closeFun = async () => {
|
|
|
- if(data.tableData.length==0){
|
|
|
+ if (data.tableData.length == 0) {
|
|
|
dialogFormVisible.value = false
|
|
|
data.tableData = []
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
ElMessageBox.confirm('请检查录入数据是否已经提交,该操作将放弃录入信息,是否放弃?', '提示', {
|
|
|
confirmButtonText: '立即去入库',
|
|
|
cancelButtonText: '放弃数据',
|
|
@@ -190,29 +229,37 @@ const closeFun = async () => {
|
|
|
}
|
|
|
}
|
|
|
//收发货单位
|
|
|
-const itemPirFun = async()=>{
|
|
|
- const reslut:any = await stockunit({ type: 3 })
|
|
|
- data.itemPir = reslut.data?.list
|
|
|
+const itemPirFun = async () => {
|
|
|
+ const reslut: any = await stockunit({ type: 3 })
|
|
|
+ const arrMap = reslut.data?.list
|
|
|
+ const arr:any = []
|
|
|
+ arrMap.forEach((item:any)=>{
|
|
|
+ arr.push({ value: item, link: item})
|
|
|
+ })
|
|
|
+ restaurants1.value = arr
|
|
|
}
|
|
|
//经办人Api
|
|
|
-const operatorListApi = async()=>{
|
|
|
- const reslut:any = await operatorList({})
|
|
|
- data.itemOpen = reslut.data?.list
|
|
|
+const operatorListApi = async () => {
|
|
|
+ const reslut: any = await operatorList({})
|
|
|
+ const arrMap = reslut.data?.list
|
|
|
+ const arr:any = []
|
|
|
+ arrMap.forEach((item:any)=>{
|
|
|
+ arr.push({ value: item, link: item})
|
|
|
+ })
|
|
|
+ restaurants.value = arr
|
|
|
}
|
|
|
|
|
|
|
|
|
//函数
|
|
|
-const showinnerVisible = async ()=>{
|
|
|
+const showinnerVisible = async () => {
|
|
|
innerVisible.value = true
|
|
|
data.editStrot = false
|
|
|
console.log(data.tableData)
|
|
|
}
|
|
|
|
|
|
-const showDia = async ()=>{
|
|
|
+const showDia = async () => {
|
|
|
data.tableData = []
|
|
|
data.showDiaData = []
|
|
|
- data.itemPir = []
|
|
|
- data.itemOpen = []
|
|
|
data.rules1 = []
|
|
|
data.columns = []
|
|
|
data.selectType = []
|
|
@@ -224,7 +271,7 @@ const showDia = async ()=>{
|
|
|
operatorListApi()//经办人
|
|
|
}
|
|
|
//复原表单
|
|
|
-const resetFun = async ()=>{
|
|
|
+const resetFun = async () => {
|
|
|
initParam.date = ''
|
|
|
initParam.forwardingUnit = ''
|
|
|
initParam.medicineInfo = {}
|
|
@@ -234,56 +281,54 @@ const resetFun = async ()=>{
|
|
|
resetForm(ruleFormRef.value)
|
|
|
}
|
|
|
//获取入库表单Api
|
|
|
-const medicListStockFun = async ()=>{
|
|
|
+const medicListStockFun = async () => {
|
|
|
data.columns = []
|
|
|
- const reslut:any = await medicListStock({})
|
|
|
- if(reslut.code==200 && reslut.msg=='查询成功'){
|
|
|
+ const reslut: any = await medicListStock({})
|
|
|
+ if (reslut.code == 200 && reslut.msg == '查询成功') {
|
|
|
data.showDiaData = reslut.data?.list
|
|
|
data.rules1 = {}
|
|
|
data.columns = []
|
|
|
data.selectType = []
|
|
|
- reslut.data?.list.forEach((value:any) => { //value设置成key
|
|
|
- data.selectType.push({type:value.type,list:value.list})
|
|
|
- data.columns.push({ prop: value.field_name, label: value.name, list:value.list})
|
|
|
+ reslut.data?.list.forEach((value: any) => { //value设置成key
|
|
|
+ data.selectType.push({ type: value.type, list: value.list })
|
|
|
+ data.columns.push({ prop: value.field_name, label: value.name, list: value.list })
|
|
|
initParam.medicineInfo[value.field_name] = ''; // 这里可以根据需要设置其他值作为键的内容
|
|
|
- if(['product_id','enterprise_id','spec_id','batch_number','expiry_date','approval_number'].includes(value.field_name)){
|
|
|
- if(value.type==6){
|
|
|
- data.rules1['medicineInfo.'+value.field_name] = [{required: true,message: '必填项',trigger: 'change'},{ pattern: /^([1-9]\d*|0)(\.\d{1,2})?$/, message: '请输入>=0,(最多两位小数)', trigger: "blur" },]
|
|
|
- }else if(value.type==7){
|
|
|
- data.rules1['medicineInfo.'+value.field_name] = [{required: true,message: '必填项',trigger: 'change'},{ pattern: /^(?:[1-9]\d*)$/, message: '请输入正整数', trigger: "blur" },]
|
|
|
- }else{
|
|
|
- data.rules1['medicineInfo.'+value.field_name] = [{required: true,message: '必填项',trigger: 'change',}]
|
|
|
+ if (['product_id', 'enterprise_id', 'spec_id', 'batch_number', 'expiry_date', 'approval_number'].includes(value.field_name)) {
|
|
|
+ if (value.type == 6) {
|
|
|
+ data.rules1['medicineInfo.' + value.field_name] = [{ required: true, message: '必填项', trigger: 'change' }, { pattern: /^([1-9]\d*|0)(\.\d{1,2})?$/, message: '请输入>=0,(最多两位小数)', trigger: "blur" },]
|
|
|
+ } else if (value.type == 7) {
|
|
|
+ data.rules1['medicineInfo.' + value.field_name] = [{ required: true, message: '必填项', trigger: 'change' }, { pattern: /^(?:[1-9]\d*)$/, message: '请输入正整数', trigger: "blur" },]
|
|
|
+ } else {
|
|
|
+ data.rules1['medicineInfo.' + value.field_name] = [{ required: true, message: '必填项', trigger: 'change', }]
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- Object.assign(rules,{...data.rules1,...syrulesData})
|
|
|
+ Object.assign(rules, { ...data.rules1, ...syrulesData })
|
|
|
console.log('表格', data.selectType)
|
|
|
dialogFormVisible.value = true
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const handleClick = (datas:any,index:any) => {
|
|
|
- data.editStrot = true
|
|
|
- data.editIndex = index
|
|
|
- let {date,forwardingUnit,operator,quantity,unitPrice,medicineInfo} = datas
|
|
|
- Object.assign(initParam,{date,forwardingUnit,operator,quantity,unitPrice,medicineInfo:{...medicineInfo}})
|
|
|
- innerVisible.value = false
|
|
|
+const handleClick = (datas: any, index: any) => {
|
|
|
+ data.editStrot = true
|
|
|
+ data.editIndex = index
|
|
|
+ let { date, forwardingUnit, operator, quantity, unitPrice, medicineInfo } = datas
|
|
|
+ Object.assign(initParam, { date, forwardingUnit, operator, quantity, unitPrice, medicineInfo: { ...medicineInfo } })
|
|
|
+ innerVisible.value = false
|
|
|
}
|
|
|
-const delClick = (index:any) => {
|
|
|
- ElMessageBox.confirm('删除一条信息,是否继续?','删除',{
|
|
|
- confirmButtonText: '确认删除',
|
|
|
- cancelButtonText: 'Cancel',
|
|
|
- type: 'warning',
|
|
|
- center: true,
|
|
|
+const delClick = (index: any) => {
|
|
|
+ ElMessageBox.confirm('删除一条信息,是否继续?', '删除', {
|
|
|
+ confirmButtonText: '确认删除',
|
|
|
+ cancelButtonText: 'Cancel',
|
|
|
+ type: 'warning',
|
|
|
+ center: true,
|
|
|
}).then(() => {
|
|
|
data.tableData.splice(index, 1);
|
|
|
- ElMessage.success('已删除')
|
|
|
+ ElMessage.success('已删除')
|
|
|
})
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
-<style lang="scss">
|
|
|
-.inputWidth {
|
|
|
+<style lang="scss">.inputWidth {
|
|
|
width: 200px;
|
|
|
-}
|
|
|
-</style>
|
|
|
+}</style>
|