|
|
|
@ -79,13 +79,14 @@
|
|
|
|
|
<!-- </el-row>-->
|
|
|
|
|
<!-- <el-divider/>-->
|
|
|
|
|
<!--</el-form>-->
|
|
|
|
|
<el-form v-if="queryList && queryList.length > 0" :model="filterQuery" label-width="100px" >
|
|
|
|
|
<el-form v-if="queryList && queryList.length > 0" :model="filterQuery" label-width="100px">
|
|
|
|
|
<el-row style=" display:flex; flex-wrap: wrap; ">
|
|
|
|
|
<template v-for="(item, index) in queryList">
|
|
|
|
|
<div v-if="showSearch || item.isImport">
|
|
|
|
|
<el-form-item
|
|
|
|
|
v-if="item.columnType == 'input' && item.columnName !='queryName' && executeEval(row,item.expression,true)"
|
|
|
|
|
:label="item.columnDesc+`:`" :key="item.id">
|
|
|
|
|
:label="item.columnDesc+`:`" :key="item.id"
|
|
|
|
|
>
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="filterQuery[item.columnName]"
|
|
|
|
|
:placeholder="item.columnDesc"
|
|
|
|
@ -96,7 +97,8 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item
|
|
|
|
|
v-if="item.columnType == 'input' && item.columnName =='queryName' && executeEval(row,item.expression,true)"
|
|
|
|
|
:label="item.columnDesc+`:`" :key="item.id">
|
|
|
|
|
:label="item.columnDesc+`:`" :key="item.id"
|
|
|
|
|
>
|
|
|
|
|
<el-autocomplete
|
|
|
|
|
class="inline-input"
|
|
|
|
|
style="width: 90%"
|
|
|
|
@ -109,12 +111,14 @@
|
|
|
|
|
></el-autocomplete>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item v-if="item.columnType == 'select' && executeEval(row,item.expression,true)"
|
|
|
|
|
:label="item.columnDesc+`:`">
|
|
|
|
|
:label="item.columnDesc+`:`"
|
|
|
|
|
>
|
|
|
|
|
<el-select v-model="filterQuery[item.columnName]"
|
|
|
|
|
:placeholder="item.columnDesc"
|
|
|
|
|
@change="executeFuc($event,'5',item.checkRules)"
|
|
|
|
|
:disabled="executeEval(null,item.disabledFuc,false)"
|
|
|
|
|
clearable>
|
|
|
|
|
clearable
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in item.lableRuleObj"
|
|
|
|
|
:key="dict.value"
|
|
|
|
@ -128,7 +132,8 @@
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item v-if="item.columnType == 'selectServer' && executeEval(row,item.expression,true)"
|
|
|
|
|
:label="item.columnDesc+`:`">
|
|
|
|
|
:label="item.columnDesc+`:`"
|
|
|
|
|
>
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="filterQuery[item.columnName]"
|
|
|
|
|
:placeholder="item.columnDesc"
|
|
|
|
@ -137,7 +142,8 @@
|
|
|
|
|
remote
|
|
|
|
|
@change="executeFuc($event,'5',item.checkRules)"
|
|
|
|
|
:remote-method="(query) => executeFuc(query,'5',item.clickFuc)"
|
|
|
|
|
clearable>
|
|
|
|
|
clearable
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in options[item.clickFuc]"
|
|
|
|
|
:key="item.code"
|
|
|
|
@ -151,7 +157,8 @@
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item v-if="item.columnType == 'datePicker' && executeEval(row,item.expression,true)"
|
|
|
|
|
:label="item.columnDesc+`:`">
|
|
|
|
|
:label="item.columnDesc+`:`"
|
|
|
|
|
>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
:picker-options="pickerOptions"
|
|
|
|
|
v-model="actDateRange"
|
|
|
|
@ -164,7 +171,8 @@
|
|
|
|
|
></el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item v-if="item.columnType == 'date' && executeEval(row,item.expression,true)"
|
|
|
|
|
:label="item.columnDesc+`:`">
|
|
|
|
|
:label="item.columnDesc+`:`"
|
|
|
|
|
>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="filterQuery[item.columnName]"
|
|
|
|
|
:style="`width:${item.width+'px'}`"
|
|
|
|
@ -188,7 +196,7 @@
|
|
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="chooseHouseDrug">添加院内药品</el-button>
|
|
|
|
|
<el-upload
|
|
|
|
|
:action="action"
|
|
|
|
|
:headers ="headers"
|
|
|
|
|
:headers="headers"
|
|
|
|
|
accept=".txt"
|
|
|
|
|
:on-preview="handlePreview"
|
|
|
|
|
:on-remove="handleRemove"
|
|
|
|
@ -201,8 +209,9 @@
|
|
|
|
|
:on-exceed="handleExceed"
|
|
|
|
|
:file-list="fileList"
|
|
|
|
|
:show-file-list="false"
|
|
|
|
|
:data="extraData">
|
|
|
|
|
<el-button icon="el-icon-upload" type="primary" style="margin: 0;">药品标识上传</el-button>
|
|
|
|
|
:data="extraData"
|
|
|
|
|
>
|
|
|
|
|
<el-button icon="el-icon-upload" type="primary" style="margin: 0;">药品标识上传</el-button>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-button-group>
|
|
|
|
|
</div>
|
|
|
|
@ -210,7 +219,7 @@
|
|
|
|
|
<el-table v-loading="loading" :data="list" style="width: 100%" :row-style="{height: '32px' }"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="index" label="序号"></el-table-column>
|
|
|
|
|
<el-table-column label="药品标识码" prop="nameCode" width="160"></el-table-column>
|
|
|
|
|
<el-table-column label="药品编码" prop="nameCode" width="100"></el-table-column>
|
|
|
|
|
<!--<el-table-column label="收费项目编码" prop="payFeeCode" width="100"></el-table-column>-->
|
|
|
|
|
<el-table-column label="药品通用名称" prop="cpmctymc" width="160"></el-table-column>
|
|
|
|
|
<el-table-column label="制剂规格" prop="prepnSpec" width="90"></el-table-column>
|
|
|
|
@ -334,11 +343,11 @@ import {
|
|
|
|
|
import drugAdd from '@/views/basic/product/drug/drugAdd'
|
|
|
|
|
import chooseDrug from '@/views/basic/product/drug/chooseDrug'
|
|
|
|
|
import chooseHouseDrug from '@/views/basic/product/drug/chooseHouseDrug'
|
|
|
|
|
import {getAdminId, getToken} from '@/utils/auth';
|
|
|
|
|
import { getAdminId, getToken } from '@/utils/auth'
|
|
|
|
|
import { executeFuc, getHead } from '@/utils/customConfig'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {drugAdd, chooseDrug,chooseHouseDrug},
|
|
|
|
|
components: { drugAdd, chooseDrug, chooseHouseDrug },
|
|
|
|
|
name: 'drugMaintain',
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
@ -346,33 +355,24 @@ export default {
|
|
|
|
|
tableHeader: [],
|
|
|
|
|
queryList: [],
|
|
|
|
|
fromList: [],
|
|
|
|
|
executeFuc(row, type, clickFuc, value) {
|
|
|
|
|
return executeFuc(this, row, type, clickFuc, value);
|
|
|
|
|
},
|
|
|
|
|
executeEval(row, expression, defaultRet) {
|
|
|
|
|
if (expression) {
|
|
|
|
|
return eval(expression);
|
|
|
|
|
}
|
|
|
|
|
return defaultRet;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
showSearch: false,
|
|
|
|
|
filterBadInv: true,
|
|
|
|
|
query: {},
|
|
|
|
|
list: [],
|
|
|
|
|
mainIds:[],
|
|
|
|
|
mainIds: [],
|
|
|
|
|
filterQuery: {
|
|
|
|
|
productsType: 2,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20,
|
|
|
|
|
addType: 1,
|
|
|
|
|
keyWords:"",
|
|
|
|
|
keyWords: ''
|
|
|
|
|
},
|
|
|
|
|
addDrugVisible: false,
|
|
|
|
|
chooseDrugVisible: false,
|
|
|
|
|
statusMap: {
|
|
|
|
|
0: "停用",
|
|
|
|
|
1: "在用"
|
|
|
|
|
0: '停用',
|
|
|
|
|
1: '在用'
|
|
|
|
|
},
|
|
|
|
|
fromName: '',
|
|
|
|
|
rowData: {},
|
|
|
|
@ -380,22 +380,22 @@ export default {
|
|
|
|
|
type: null,
|
|
|
|
|
fromMap: {
|
|
|
|
|
'add': '新增-药品信息',
|
|
|
|
|
'edit': '编辑-药品信息',
|
|
|
|
|
'edit': '编辑-药品信息'
|
|
|
|
|
},
|
|
|
|
|
loading: false,
|
|
|
|
|
chooseHouseDrugVisible: false,
|
|
|
|
|
uuid: "111",
|
|
|
|
|
relId: "",
|
|
|
|
|
uuid: '111',
|
|
|
|
|
relId: '',
|
|
|
|
|
isImport: false,
|
|
|
|
|
pId: 0,
|
|
|
|
|
thisData: {
|
|
|
|
|
nameCode: null,
|
|
|
|
|
cpmctymc: null,
|
|
|
|
|
ggxh: null,
|
|
|
|
|
ggxh: null
|
|
|
|
|
},
|
|
|
|
|
relevanceEdit: {
|
|
|
|
|
id: null,
|
|
|
|
|
thirdId: "",
|
|
|
|
|
thirdId: '',
|
|
|
|
|
isDisable: null,
|
|
|
|
|
isUseDy: false,
|
|
|
|
|
isLock: null,
|
|
|
|
@ -404,38 +404,48 @@ export default {
|
|
|
|
|
allowNoExpire: null,
|
|
|
|
|
allowNoProduct: null,
|
|
|
|
|
allowNoSerial: null,
|
|
|
|
|
pId: null,
|
|
|
|
|
pId: null
|
|
|
|
|
},
|
|
|
|
|
total: 0,
|
|
|
|
|
headers:{
|
|
|
|
|
headers: {
|
|
|
|
|
ADMINID: getAdminId(),
|
|
|
|
|
ADMINTOKEN: getToken()
|
|
|
|
|
},
|
|
|
|
|
extraData:{"uuid": "upload-txt"},
|
|
|
|
|
extraData: { 'uuid': 'upload-txt' },
|
|
|
|
|
uploadLoading: false,
|
|
|
|
|
action: process.env.VUE_APP_BASE_API + "/udiwms/aliDrug/txtUpload",
|
|
|
|
|
action: process.env.VUE_APP_BASE_API + '/udiwms/aliDrug/txtUpload',
|
|
|
|
|
fileList: []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
executeFuc(row, type, clickFuc, value) {
|
|
|
|
|
return executeFuc(this, row, type, clickFuc, value)
|
|
|
|
|
},
|
|
|
|
|
executeEval(row, expression, defaultRet) {
|
|
|
|
|
if (expression) {
|
|
|
|
|
return eval(expression)
|
|
|
|
|
}
|
|
|
|
|
return defaultRet
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onReset() {
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path: "",
|
|
|
|
|
});
|
|
|
|
|
path: ''
|
|
|
|
|
})
|
|
|
|
|
this.filterQuery = {
|
|
|
|
|
productsType: 2,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20,
|
|
|
|
|
addType: 1,
|
|
|
|
|
keyWords:""
|
|
|
|
|
};
|
|
|
|
|
this.getList();
|
|
|
|
|
keyWords: ''
|
|
|
|
|
}
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
hideSearch() {
|
|
|
|
|
this.showSearch = !this.showSearch;
|
|
|
|
|
this.showSearch = !this.showSearch
|
|
|
|
|
},
|
|
|
|
|
onSubmit() {
|
|
|
|
|
this.filterQuery.page = 1;
|
|
|
|
|
this.filterQuery.page = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
addDrug() {
|
|
|
|
@ -448,47 +458,47 @@ export default {
|
|
|
|
|
this.chooseDrugVisible = true
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
chooseHouseDrug(val){
|
|
|
|
|
this.defaultSys = null;
|
|
|
|
|
this.uuid = val.uuid;
|
|
|
|
|
this.relId = val.id;
|
|
|
|
|
this.isImport = true;
|
|
|
|
|
this.thisData = val;
|
|
|
|
|
chooseHouseDrug(val) {
|
|
|
|
|
this.defaultSys = null
|
|
|
|
|
this.uuid = val.uuid
|
|
|
|
|
this.relId = val.id
|
|
|
|
|
this.isImport = true
|
|
|
|
|
this.thisData = val
|
|
|
|
|
this.chooseHouseDrugVisible = true
|
|
|
|
|
},
|
|
|
|
|
handleRemove(file, fileList) {
|
|
|
|
|
console.log(file, fileList);
|
|
|
|
|
console.log(file, fileList)
|
|
|
|
|
},
|
|
|
|
|
handlePreview(file) {
|
|
|
|
|
console.log(file);
|
|
|
|
|
console.log(file)
|
|
|
|
|
},
|
|
|
|
|
handleExceed(files, fileList) {
|
|
|
|
|
this.$message.warning(`当前限制选择 5 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
|
|
|
|
|
this.$message.warning(`当前限制选择 5 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
|
|
|
|
|
},
|
|
|
|
|
beforeRemove(file, fileList) {
|
|
|
|
|
return this.$confirm(`确定移除 ${ file.name }?`);
|
|
|
|
|
return this.$confirm(`确定移除 ${file.name}?`)
|
|
|
|
|
},
|
|
|
|
|
handleSuccess(res, file, fileList) {
|
|
|
|
|
fileList = fileList.filter(item => item.response.code === 20000);
|
|
|
|
|
this.fileList = fileList;
|
|
|
|
|
fileList = fileList.filter(item => item.response.code === 20000)
|
|
|
|
|
this.fileList = fileList
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.$message.success(res.message);
|
|
|
|
|
this.$message.success(res.message)
|
|
|
|
|
this.fileList = []
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message);
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
}
|
|
|
|
|
this.uploadLoading.close();
|
|
|
|
|
this.uploadLoading.close()
|
|
|
|
|
},
|
|
|
|
|
beforeUpload(file) {
|
|
|
|
|
const isXML = file.name.endsWith('.txt');
|
|
|
|
|
const isLt5M = file.size / 1024 / 1024 < 100;
|
|
|
|
|
const isXML = file.name.endsWith('.txt')
|
|
|
|
|
const isLt5M = file.size / 1024 / 1024 < 100
|
|
|
|
|
if (!isXML) {
|
|
|
|
|
this.$message.error('上传文件只能是 TXT 格式!');
|
|
|
|
|
this.$message.error('上传文件只能是 TXT 格式!')
|
|
|
|
|
}
|
|
|
|
|
if (!isLt5M) {
|
|
|
|
|
this.$message.error('上传文件大小不能超过 10MB!');
|
|
|
|
|
this.$message.error('上传文件大小不能超过 10MB!')
|
|
|
|
|
}
|
|
|
|
|
return isXML && isLt5M;
|
|
|
|
|
return isXML && isLt5M
|
|
|
|
|
},
|
|
|
|
|
handleProgress() {
|
|
|
|
|
this.uploadLoading = this.$loading({
|
|
|
|
@ -496,18 +506,18 @@ export default {
|
|
|
|
|
text: '文件上传中…',
|
|
|
|
|
spinner: 'el-icon-loading',
|
|
|
|
|
background: 'rgba(0, 0, 0, 0.5)'
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleError() {
|
|
|
|
|
this.uploadLoading.close();
|
|
|
|
|
this.$message.error('文件上传失败,请检查文件大小或文件格式');
|
|
|
|
|
this.uploadLoading.close()
|
|
|
|
|
this.$message.error('文件上传失败,请检查文件大小或文件格式')
|
|
|
|
|
},
|
|
|
|
|
getList() {
|
|
|
|
|
getUdiInfos(this.filterQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.loading = false
|
|
|
|
|
this.list = response.data.list || []
|
|
|
|
|
this.mainIds = this.list.map(item => item.mainId);
|
|
|
|
|
this.mainIds = this.list.map(item => item.mainId)
|
|
|
|
|
this.total = response.data.total || 0
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
@ -517,24 +527,24 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
deleteDrug(row) {
|
|
|
|
|
this.$confirm("此操作将永久删除该药品信息, 是否继续?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
this.$confirm('此操作将永久删除该药品信息, 是否继续?', '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
let tquery = {
|
|
|
|
|
id: row.id + "",
|
|
|
|
|
};
|
|
|
|
|
id: row.id + ''
|
|
|
|
|
}
|
|
|
|
|
deletetUdiInfos(tquery).then(res => {
|
|
|
|
|
if (res.code != 20000) {
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
this.getList()
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.success("删除成功!")
|
|
|
|
|
this.$message.success('删除成功!')
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.$message.error("删除错误")
|
|
|
|
|
this.$message.error('删除错误')
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
@ -542,49 +552,49 @@ export default {
|
|
|
|
|
this.fromName = 'edit'
|
|
|
|
|
|
|
|
|
|
this.type = 2
|
|
|
|
|
this.uuid = row.uuid;
|
|
|
|
|
this.relId = row.id;
|
|
|
|
|
this.isImport = false;
|
|
|
|
|
this.thisData = row;
|
|
|
|
|
this.pId = row.id;
|
|
|
|
|
this.uuid = row.uuid
|
|
|
|
|
this.relId = row.id
|
|
|
|
|
this.isImport = false
|
|
|
|
|
this.thisData = row
|
|
|
|
|
this.pId = row.id
|
|
|
|
|
this.relevanceEdit = {
|
|
|
|
|
id: row.id,
|
|
|
|
|
isUseDy: row.isUseDy,
|
|
|
|
|
isDisable: row.isDisable,
|
|
|
|
|
isLock: row.isLock,
|
|
|
|
|
isAdavence: row.isAdavence,
|
|
|
|
|
};
|
|
|
|
|
this.editFormat = JSON.parse(JSON.stringify(row));
|
|
|
|
|
isAdavence: row.isAdavence
|
|
|
|
|
}
|
|
|
|
|
this.editFormat = JSON.parse(JSON.stringify(row))
|
|
|
|
|
this.rowData = row
|
|
|
|
|
this.addDrugVisible = true;
|
|
|
|
|
this.addDrugVisible = true
|
|
|
|
|
},
|
|
|
|
|
closeUdi(){
|
|
|
|
|
closeUdi() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
closeDialog() {
|
|
|
|
|
this.addDrugVisible = false;
|
|
|
|
|
this.chooseHouseDrugVisible = false;
|
|
|
|
|
this.addDrugVisible = false
|
|
|
|
|
this.chooseHouseDrugVisible = false
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
filters: {
|
|
|
|
|
statusFilterType(status) {
|
|
|
|
|
const statusMap = {
|
|
|
|
|
0: "info",
|
|
|
|
|
1: "success",
|
|
|
|
|
};
|
|
|
|
|
return statusMap[status];
|
|
|
|
|
0: 'info',
|
|
|
|
|
1: 'success'
|
|
|
|
|
}
|
|
|
|
|
return statusMap[status]
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
getHead("drugMaintain-ypzdwh", "1").then((re) => {
|
|
|
|
|
getHead('drugMaintain-ypzdwh', '1').then((re) => {
|
|
|
|
|
// 处理返回的数据
|
|
|
|
|
this.tableObj = re.data;
|
|
|
|
|
this.tableHeader = re.data.tableList;
|
|
|
|
|
this.queryList = re.data.queryList;
|
|
|
|
|
this.fromList = re.data.fromList;
|
|
|
|
|
});
|
|
|
|
|
this.tableObj = re.data
|
|
|
|
|
this.tableHeader = re.data.tableList
|
|
|
|
|
this.queryList = re.data.queryList
|
|
|
|
|
this.fromList = re.data.fromList
|
|
|
|
|
})
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|