代码备份

dev_drug
yewj 2 weeks ago
parent 70dcea1a11
commit 0be844df8f

@ -0,0 +1,547 @@
<template>
<div>
<el-card>
<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"
>
<el-input
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
@keyup.enter.native="executeFuc($event,'5',item.clickFuc)"
clearable
></el-input>
</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"
>
<el-autocomplete
class="inline-input"
style="width: 90%"
v-model="queryName"
:fetch-suggestions="queryProductName"
placeholder="请输入内容"
clearable
@select="handleSelect"
@clear="clearQueryProduct"
></el-autocomplete>
</el-form-item>
<el-form-item v-if="item.columnType == 'select' && executeEval(row,item.expression,true)"
: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
>
<el-option
v-for="dict in item.lableRuleObj"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
<span style="float: left">{{ item.name }}</span>
<span v-if="item.isShowXx == '1'" style="float: right; color: #8492a6; font-size: 13px">{{
item.code
}}</span>
</el-select>
</el-form-item>
<el-form-item v-if="item.columnType == 'selectServer' && executeEval(row,item.expression,true)"
:label="item.columnDesc+`:`"
>
<el-select
v-model="filterQuery[item.columnName]"
:placeholder="item.columnDesc"
:disabled="executeEval(null,item.disabledFuc,false)"
filterable
remote
@change="executeFuc($event,'5',item.checkRules)"
:remote-method="(query) => executeFuc(query,'5',item.clickFuc)"
clearable
>
<el-option
v-for="item in options[item.clickFuc]"
:key="item.code"
:label="item.label"
:value="item.code"
/>
<span style="float: left">{{ item.name }}</span>
<span v-if="item.isShowXx == '1'" style="float: right; color: #8492a6; font-size: 13px">{{
item.code
}}</span>
</el-select>
</el-form-item>
<el-form-item v-if="item.columnType == 'datePicker' && executeEval(row,item.expression,true)"
:label="item.columnDesc+`:`"
>
<el-date-picker
:picker-options="pickerOptions"
v-model="actDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item v-if="item.columnType == 'date' && executeEval(row,item.expression,true)"
:label="item.columnDesc+`:`"
>
<el-date-picker
v-model="filterQuery[item.columnName]"
:style="`width:${item.width+'px'}`"
value-format="yyyy-MM-dd"
:disabled="executeEval(null,item.disabledFuc,false)"
type="date"
:placeholder="item.columnDesc"
></el-date-picker>
</el-form-item>
</div>
</template>
</el-row>
</el-form>
<div class="top-right-btn" style="display: flex; align-items: center;">
<el-button-group>
<el-button icon="el-icon-view" type="primary" @click="hideSearch"></el-button>
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="onSubmit"></el-button>
</el-button-group>
</div>
<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="manuReview" width="90">
<template slot-scope="scope">
<el-tag :type="(scope.row.manuReview) | statusFilterType">
{{ statusMap[scope.row.manuReview] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="无码类型" prop="notCodeType" width="90">
<template slot-scope="scope">
<el-tag :type="(scope.row.notCodeType) | codeStatusFilterType">
{{ codeTypeMap[scope.row.notCodeType] }}
</el-tag>
</template>
</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>
<el-table-column label="剂型" prop="prepnUnit" width="90"></el-table-column>
<el-table-column label="包装规格" prop="bzgg" width="100"></el-table-column>
<el-table-column label="医保编码" prop="ybbm" width="200"></el-table-column>
<el-table-column label="产品编码" prop="nameCode" width="100"></el-table-column>
<el-table-column label="包装单位" prop="packUnit" width="90"></el-table-column>
<el-table-column label="价格" prop="price" width="90"></el-table-column>
<el-table-column label="批准文号" prop="zczbhhzbapzbh" width="90"></el-table-column>
<el-table-column label="生产企业" prop="manufactory" width="90"></el-table-column>
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="editDrug(scope.row)"
>编辑
</el-button>
<el-button
type="text"
size="small"
@click.native.stop="deleteDrug(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:limit.sync="filterQuery.limit"
:page.sync="filterQuery.page"
@pagination="getList"
>
</pagination>
<el-dialog
:title="fromMap[fromName]"
:visible.sync="addDrugVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="85%"
v-if="addDrugVisible"
@close="closeDialog"
>
<drugAdd
:closeDialog="closeDialog"
:rowData="rowData"
:type="type"
:relevanceEdit="relevanceEdit"
:uuid="uuid"
:relId="relId"
:thisData="thisData"
>
</drugAdd>
</el-dialog>
<el-dialog
title="选入-药品信息"
:visible.sync="chooseDrugVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="70%"
v-if="chooseDrugVisible"
>
<chooseDrug
>
</chooseDrug>
</el-dialog>
<el-dialog
title="药品字典-从指定系统添加药品字典"
:visible.sync="chooseHouseDrugVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="85%"
v-if="chooseHouseDrugVisible"
>
<chooseHouseDrug
:closeDialog="closeDialog"
:uuid="uuid"
:relId="relId"
:isImport="isImport"
:data="thisData"
:defaultSys="defaultSys"
:mainIds="mainIds"
@closeUdi="closeDialog"
:supEnable="false"
></chooseHouseDrug>
</el-dialog>
</el-card>
</div>
</template>
<script>
import {
getUdiInfos,
deletetUdiInfos,
updatetUdiInfos,
updatetSingleUdiInfo,
updateErpProduct,
uploadSmp,
thirdSysDetail,
removeRl,
sysFilterOptimize,
spcombie,
lockStatus,
removeDiRl,
disableUdi
} from '@/api/basic/product/udiRelevance'
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 {executeFuc, getHead} from '@/utils/customConfig'
export default {
components: {drugAdd, chooseDrug, chooseHouseDrug},
name: 'drugMaintain',
data() {
return {
//
tableHeader: [],
queryList: [],
fromList: [],
showSearch: false,
filterBadInv: true,
query: {},
list: [],
mainIds: [],
filterQuery: {
productsType: 2,
page: 1,
limit: 20,
addType: 1,
keyWords: ''
},
addDrugVisible: false,
chooseDrugVisible: false,
statusMap: {
0: '未完成',
1: '已完成'
},
// 01567
codeTypeMap: {
0: '有码',
1: '部分早期未赋予追溯码',
5: '最小包装无追溯码',
6: '无追溯码',
7: '其他原因'
},
fromName: '',
rowData: {},
//12
type: null,
fromMap: {
'add': '新增-药品信息',
'edit': '编辑-药品信息'
},
loading: false,
chooseHouseDrugVisible: false,
uuid: '111',
relId: '',
isImport: false,
pId: 0,
thisData: {
nameCode: null,
cpmctymc: null,
ggxh: null
},
relevanceEdit: {
id: null,
thirdId: '',
isDisable: null,
isUseDy: false,
isLock: null,
isAdavence: null,
allowNoBatch: null,
allowNoExpire: null,
allowNoProduct: null,
allowNoSerial: null,
pId: null
},
total: 0,
headers: {
ADMINID: getAdminId(),
ADMINTOKEN: getToken()
},
extraData: {'uuid': 'upload-txt'},
uploadLoading: false,
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: ''
})
this.filterQuery = {
productsType: 2,
page: 1,
limit: 20,
addType: 1,
keyWords: ''
}
this.getList()
},
hideSearch() {
this.showSearch = !this.showSearch
},
onSubmit() {
this.filterQuery.page = 1
this.getList()
},
addDrug() {
this.fromName = 'add'
this.type = 1
this.rowData = null
this.addDrugVisible = true
},
chooseDrug() {
this.chooseDrugVisible = true
},
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)
},
handlePreview(file) {
console.log(file)
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 5 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`)
},
handleSuccess(res, file, fileList) {
fileList = fileList.filter(item => item.response.code === 20000)
this.fileList = fileList
if (res.code === 20000) {
this.$message.success(res.message)
this.fileList = []
} else {
this.$message.error(res.message)
}
this.uploadLoading.close()
},
beforeUpload(file) {
const isXML = file.name.endsWith('.txt')
const isLt5M = file.size / 1024 / 1024 < 100
if (!isXML) {
this.$message.error('上传文件只能是 TXT 格式!')
}
if (!isLt5M) {
this.$message.error('上传文件大小不能超过 10MB!')
}
return isXML && isLt5M
},
handleProgress() {
this.uploadLoading = this.$loading({
lock: true,
text: '文件上传中…',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)'
})
},
handleError() {
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.total = response.data.total || 0
})
.catch(() => {
this.loading = false
this.list = []
this.total = 0
})
},
deleteDrug(row) {
this.$confirm('此操作将永久删除该药品信息, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let tquery = {
id: row.id + ''
}
deletetUdiInfos(tquery).then(res => {
if (res.code != 20000) {
this.$message.error(res.message)
this.getList()
} else {
this.$message.success('删除成功!')
this.getList()
}
}).catch(() => {
this.$message.error('删除错误')
})
})
},
editDrug(row) {
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.relevanceEdit = {
id: row.id,
isUseDy: row.isUseDy,
isDisable: row.isDisable,
isLock: row.isLock,
isAdavence: row.isAdavence
}
this.editFormat = JSON.parse(JSON.stringify(row))
this.rowData = row
this.addDrugVisible = true
},
closeUdi() {
},
closeDialog() {
this.addDrugVisible = false
this.chooseHouseDrugVisible = false
this.getList()
}
},
filters: {
statusFilterType(status) {
const statusMap = {
0: 'info',
1: 'success'
}
return statusMap[status]
},
codeStatusFilterType(status) {
const statusMap = {
0: 'success',
1: 'warn',
5: 'warn',
6: 'warn',
7: 'warn',
}
return statusMap[status]
}
},
created() {
getHead('drugMaintain-ypsjqx', '1').then((re) => {
//
this.tableObj = re.data
this.tableHeader = re.data.tableList
this.queryList = re.data.queryList
this.fromList = re.data.fromList
})
this.getList()
}
}
</script>
<style scoped>
.top-right-btn {
display: flex; /* 使用Flexbox布局 */
align-items: center; /* 垂直居中 */
flex-wrap: nowrap; /* 防止换行 */
}
.el-button-group {
display: flex; /* 确保按钮组内的元素也使用Flexbox布局 */
}
.el-upload {
display: inline-flex; /* 确保上传组件与其他按钮在同一行 */
}
</style>

@ -226,7 +226,6 @@
<el-table-column label="剂型" prop="prepnUnit" width="90"></el-table-column>
<el-table-column label="包装规格" prop="bzgg" width="100"></el-table-column>
<el-table-column label="包装单位" prop="packUnit" width="90"></el-table-column>
<!--<el-table-column label="包装比例" prop="packRatio" width="90"></el-table-column>-->
<el-table-column label="价格" prop="price" width="90"></el-table-column>
<el-table-column label="批准文号" prop="zczbhhzbapzbh" width="90"></el-table-column>
<el-table-column label="生产企业" prop="manufactory" width="90"></el-table-column>

Loading…
Cancel
Save