feat: 增加页面的医保耗材信息调用功能

dev_ksck2.0
chenhc 1 year ago
parent 3da3083c5c
commit a187bcb9c0

@ -217,6 +217,12 @@ export function getGgxhListOptimize(params) {
}
export function getYbHcflDetail(query) {
return axios({
url: "/udi/udirel/ybHcflDetail",
method: "post",
data: query
});
}

@ -1134,6 +1134,67 @@
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="12" class="el-col">
<div class="text item">
<div class="itemTag">
<span>一级分类:&nbsp;</span>
</div>
<el-input
style="width: 65%"
size="small"
:disabled="true"
splaceholder="请输入内容"
v-model="editQuery.catalogname1"
></el-input>
</div>
</el-col>
<el-col :span="12" class="el-col">
<div class="text item">
<div class="itemTag">
<span>二级分类:&nbsp;</span>
</div>
<el-input
style="width: 65%"
:disabled="true"
size="small"
splaceholder="请输入内容"
v-model="editQuery.catalogname2"
></el-input>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="12" class="el-col">
<div class="text item">
<div class="itemTag">
<span>三级分类:&nbsp;</span>
</div>
<el-input
style="width: 65%"
size="small"
:disabled="true"
splaceholder="请输入内容"
v-model="editQuery.catalogname3"
></el-input>
</div>
</el-col>
<el-col :span="12" class="el-col">
<div class="text item">
<div class="itemTag">
<span>耗材材质:&nbsp;</span>
</div>
<el-input
style="width: 65%"
:disabled="true"
size="small"
splaceholder="请输入内容"
v-model="editQuery.matrial"
></el-input>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="12" class="el-col">
<div class="text item">
@ -1840,6 +1901,10 @@ export default {
packUnit: null,
measname: null,
nameCode: null,
catalogname1: "",
catalogname2: "",
catalogname3: "",
matrial: "",
},
isDisableMap: {
true: "停用",
@ -2334,6 +2399,9 @@ export default {
this.loading = false;
});
},
closeHandler(){
// this.visible = false;
},
closeUdi(val) {
this.selectUdiDialogVisible = false;
this.selectErpDialogVisible = false;

@ -6,6 +6,16 @@
<el-input style="width: 90%" size="small" placeholder="请输入产品名称" v-model.trim="newProductData.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" type="flex">
<el-form-item label="耗材分类:" prop="hcType">
<el-select v-model="newProductData.hcType" style="width: 90%" placeholder="选择耗材分类" clearable>
<el-option label="高值耗材" :value="1"></el-option>
<el-option label="普通耗材" :value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="11" type="flex">
<el-form-item label="产品属性:" prop="name">
<el-select v-model="newProductData.attributeType" style="width: 90%" placeholder="选择产品属性" clearable>
@ -78,7 +88,31 @@
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="医保编码:" prop="ybbm">
<el-input style="width: 90%" size="small" placeholder="请输入医保编码" v-model.trim="newProductData.ybbm"></el-input>
<el-input style="width: 90%" size="small" placeholder="请输入医保编码" v-model.trim="newProductData.ybbm" v-debounce-input:500ms="getYbHcData" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="一级分类名称:" prop="sptm">
<el-input style="width: 90%" size="small" placeholder="请输入一级分类名称" v-model.trim="newProductData.catalogname1" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="二级分类名称:" prop="ybbm">
<el-input style="width: 90%" size="small" placeholder="请输入二级分类名称" v-model.trim="newProductData.catalogname2" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="三级分类名称:" prop="sptm">
<el-input style="width: 90%" size="small" placeholder="请输入三级分类名称" v-model.trim="newProductData.catalogname3" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="耗材材质:" prop="ybbm">
<el-input style="width: 90%" size="small" placeholder="请输入耗材材质" v-model.trim="newProductData.matrial" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
@ -113,7 +147,7 @@
</template>
<script>
import {addProduct} from '@/api/basic/product/udiRelevance'
import {getYbHcflDetail,addProduct} from '@/api/basic/product/udiRelevance'
export default {
name: 'productAdd',
@ -125,6 +159,7 @@ export default {
},
data() {
return {
ybHcflDetail:{},
newProductData: {
name: null,
spec: null,
@ -141,19 +176,47 @@ export default {
tyshxydm: null,
qxlb: null,
cpms: null,
attributeType: null, hcType: null,
attributeType: null,
hcType: null,
},
thirdSys: []
}
},
methods: {
getYbHcData(){
let query = {
specificationCode: this.newProductData.ybbm
};
getYbHcflDetail(query).then((response) => {
if (response.code == 20000) {
this.ybHcflDetail = response.data
this.newProductData.catalogname1 = this.ybHcflDetail.catalogname1
this.newProductData.catalogname2 = this.ybHcflDetail.catalogname2
this.newProductData.catalogname3 = this.ybHcflDetail.catalogname3
this.newProductData.matrial = this.ybHcflDetail.matrial
this.$forceUpdate();
}else {
this.newProductData.catalogname1 = ""
this.newProductData.catalogname2 = ""
this.newProductData.catalogname3 = ""
this.newProductData.matrial = ""
this.$forceUpdate();
}
}).catch(() => {
})
},
saveNewProduct() {
this.addProductDialogVisible = false
if (this.$isBlank(this.newProductData.name)) {
this.$message.warning('产品名称不能为空!')
return
}
if (this.$isBlank(this.newProductData.hcType)) {
this.$message.warning('耗材类型不能为空')
return
}
if (this.$isBlank(this.newProductData.spec)) {
this.$message.warning('规格型号不能为空')
return
@ -192,6 +255,19 @@ export default {
}
},
created() {
},
directives: {
'debounce-input': {
inserted(el, binding) {
let timeout
el.addEventListener('input', () => {
clearTimeout(timeout)
timeout = setTimeout(() => {
binding.value()
}, parseInt(binding.arg) || 300)
})
}
}
}
}
</script>

@ -120,10 +120,62 @@
size="small"
splaceholder="请输入内容"
v-model="editQuery.ybbm"
v-debounce-input:500ms="getYbHcData"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex" class="edit-row">
<el-col :span="12">
<el-form-item label="一级分类名称:">
<el-input
style="width: 80%"
size="small"
splaceholder="请输入内容"
v-model="editQuery.catalogname1"
disabled
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="二级分类名称:">
<el-input
style="width: 80%"
size="small"
splaceholder="请输入内容"
v-model="editQuery.catalogname2"
disabled
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex" class="edit-row">
<el-col :span="12">
<el-form-item label="三级分类名称:">
<el-input
style="width: 80%"
size="small"
splaceholder="请输入内容"
v-model="editQuery.catalogname3"
disabled
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="耗材材质:">
<el-input
style="width: 80%"
size="small"
splaceholder="请输入内容"
v-model="editQuery.matrial"
disabled
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex" class="edit-row">
<el-col :span="12">
<el-form-item label="库存积压预警数量:">
@ -643,7 +695,7 @@
</template>
<script>
import {disableUdi, removeDiRl, removeRl, thirdSysDetail, updatetSingleUdiInfo} from "@/api/basic/product/udiRelevance";
import {getYbHcflDetail,disableUdi, removeDiRl, removeRl, thirdSysDetail, updatetSingleUdiInfo} from "@/api/basic/product/udiRelevance";
import {isBlank} from "@/utils/strUtil";
import {filterByUuid} from "@/api/basic/product/udiInfo";
import ProductSingleEdit from "@/views/basic/product/productSingleEdit";
@ -695,6 +747,7 @@ export default {
data() {
return {
loading: false,
ybHcflDetail: {},
isUseDyCheck: true,
useNumEnable: true,
sysList: [],
@ -738,6 +791,32 @@ export default {
}
},
methods: {
getYbHcData(){
let query = {
specificationCode: this.editQuery.ybbm
};
getYbHcflDetail(query).then((response) => {
if (response.code == 20000) {
this.ybHcflDetail = response.data
this.editQuery.catalogname1 = this.ybHcflDetail.catalogname1
this.editQuery.catalogname2 = this.ybHcflDetail.catalogname2
this.editQuery.catalogname3 = this.ybHcflDetail.catalogname3
this.editQuery.matrial = this.ybHcflDetail.matrial
this.$forceUpdate();
}else {
this.editQuery.catalogname1 = ""
this.editQuery.catalogname2 = ""
this.editQuery.catalogname3 = ""
this.editQuery.matrial = ""
this.$forceUpdate();
}
}).catch(() => {
})
},
onClose(){
this.$emit("onClose")
},
diableChange() {
let query = {
relId: this.pId
@ -986,7 +1065,21 @@ export default {
children: node.children
};
},
},
directives: {
'debounce-input': {
inserted(el, binding) {
let timeout
el.addEventListener('input', () => {
clearTimeout(timeout)
timeout = setTimeout(() => {
binding.value()
}, parseInt(binding.arg) || 300)
})
}
}
}
}
</script>

@ -195,10 +195,22 @@
</el-tab-pane>
<el-tab-pane label="维修记录" v-if="this.visible">
<invDeviceInspectEditDialog
:idQuery="filterQuery"
:rowData="this.rowData">
</invDeviceInspectEditDialog>
</el-tab-pane>
<el-tab-pane label="巡检记录" v-if="this.visible">
<invDeviceCheckEditDialog
:idQuery="filterQuery"
:rowData="this.rowData">
</invDeviceCheckEditDialog>
</el-tab-pane>
<el-tab-pane label="使用记录" v-if="this.visible">
<invDeviceUsageEditDialog
:idQuery="filterQuery"
:rowData="this.rowData">
</invDeviceUsageEditDialog>
</el-tab-pane>
</el-tabs>
@ -258,6 +270,9 @@ import inspectSetModifyDialog from "@/views/dev/InspectSetModifyDialog.vue";
import checkResultPanel from "@/views/dev/invDeviceEditDialog.vue";
import technical from "@/views/dev/invTechniclDialog.vue";
import invDeviceUserEditDialog from "@/views/dev/invDeviceUserEditDialog.vue";
import invDeviceUsageEditDialog from "@/views/dev/invDeviceUsageEditDialog.vue";
import invDeviceInspectEditDialog from "@/views/dev/invDeviceInspectEditDialog.vue";
import invDeviceCheckEditDialog from "@/views/dev/invDeviceCheckEditDialog.vue";
import {getBasicUnitMaintains, getCorpList} from "@/api/basic/basicUnitMaintain";
export default {
@ -575,7 +590,10 @@ export default {
inspectSetModifyDialog,
DeviceModelDetail,
deviceModifyDialog,
invDeviceUserEditDialog
invDeviceUserEditDialog,
invDeviceUsageEditDialog,
invDeviceInspectEditDialog,
invDeviceCheckEditDialog,
},
created() {
this.filterQuery = this.rowData

@ -0,0 +1,456 @@
<template>
<div>
<el-form :model="inputQuery" :rules="rules" ref="inputQuery" label-width="100px">
<div style=" float: right;
text-align: right;
margin-bottom: 8px;"
>
<el-button type="primary" size="mini" icon="search" @click="addCert"
style="text-align:right"
>添加相关人员
</el-button>
</div>
<el-table v-loading="certLoading" :data="certList" style=" width: 100%;margin-top: 20px" border
highlight-current-row
>
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="人员类别" prop="userType">
<template slot-scope="scope">
<span>{{ dict.type.device_user_type[scope.row.userType].label }}</span>
</template>
</el-table-column>
<el-table-column label="人员名称" prop="userName"></el-table-column>
<el-table-column label="联系电话" prop="contact1"></el-table-column>
<el-table-column label="其他联系方式" prop="contact2"></el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="操作" width="140">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="addCert(scope.row)"
>编辑
</el-button
>
<el-button
type="text"
size="small"
@click.native="deleteDeviceCert(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer"
:url-list="imgList"
/>
<pagination
v-show="certTotal>0"
:total="certTotal"
:page.sync="certQuery.page"
:limit.sync="certQuery.limit"
@pagination="certHandleCurrentChange"
></pagination>
<el-dialog
:title="formMap[formName]"
:visible.sync="addCertVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="70%"
v-if="addCertVisible"
append-to-body
@close="closeLocalDialog"
>
<depUserAddDialog
:closeDialog="closeLocalDialog"
:inputQuery="inputQuery"
:addType="addType"
:editTye="editTye"
:deviceUserType="dict.type.device_user_type"
></depUserAddDialog>
</el-dialog>
</el-form>
</div>
</template>
<script>
import { modifyCompany, addCompany, bindCorp, previewImage } from '@/api/purchase/supCompany'
import store from '@/store'
import { regionDataPlus, CodeToText } from 'element-china-area-data'
import { filterDeviceUser,insertCompanyUser,deleteDeviceUser,updateDeviceUser } from '@/api/dev/deviceUser'
import corpMaintainSelect from '@/views/basic/corpMaintain/corpMaintainSelect'
import depUserAddDialog from '@/views/inventory/user/depUserAddDialog.vue'
import draggable from 'vuedraggable'
import { getUUID, isBlank } from '@/utils/strUtil'
import supCertSetSelectDialog from '@/views/purchase/cert/supCertSetSelectDialog'
import { getBasicUnitMaintains, getCorpList } from '@/api/basic/basicUnitMaintain'
import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
export default {
name: 'invDeviceCheckEditDialog',
dicts: ['device_user_type'],
props: {
// closeDialog: {
// type: Function,
// required: true,
// },
// inputEdit: {
// type: Object,
// required: true,
// },
// editType: {
// type: Number,
// required: true,
// }
idQuery: {
type: Object,
required: true
},
rowData: {
type: Object,
required: true
}
},
watch: {
rowData: function(newVal, oldVal) {
this.searchData(newVal)
}
}
,
data() {
return {
formName: null,
formMap: {
"add": "添加相关人员",
"edit": "编辑相关人员"
},
BASE_URL: process.env.VUE_APP_BASE_API,
headers: {},
classesDisplay: false,
selectedOptions: [],
imgViewerVisible: false,
imgList: [],
options: regionDataPlus,
inputQuery: {
// customerId: null,
devCodeFk: null,
companyName: null,
contacts: null,
mobile: null,
detailAddr: null
},
rules: {
companyName: [
{
required: true,
message: '请输入企业名称',
trigger: 'blur'
}
],
creditNum: [
{
required: true,
message: '请输入统一社会信用代码',
trigger: 'blur'
}
],
classes: [
{
required: true,
message: '请选择企业类别',
trigger: 'change'
}
],
area: [
{
required: true,
message: '请选择所属地区',
trigger: 'change'
}
],
detailAddr: [
{
required: true,
message: '请输入详细地址',
trigger: 'change'
}
],
contacts: [
{
required: true,
message: '请输入联系人',
trigger: 'change'
}
],
mobile: [
{
required: true,
message: '请输入联系电话',
trigger: 'change'
}
],
email: [
{
required: true,
message: '请输入邮箱',
trigger: 'change'
}
],
updateCause: [
{
required: true,
message: '请输入变更原因',
trigger: 'change'
}
]
},
uploadUrl: '',
fileUrl: '',
certFileUrl: '',
url: 'http://127.0.0.1:9996/udiwms/image/register/file/getImage?type=image1&name=t11111.jpg',
certQuery: {
devCodeFk: '',
page: 1,
limit: 20,
type: 1
},
expire: {
0: '有效',
1: '失效'
},
certList: [],
certTotal: 0,
certLoading: false,
addCertVisible: false,
salesmanQuery: {
name: '',
page: 1,
limit: 20
},
salesmanList: [],
salesmanTotal: 0,
salesmanLoading: false,
addSalesmanVisible: false,
certTypeMap: {
1: '身份证'
},
selectLocalVisible: false,
productQuery: {
ylqxzcrbarmc: '',
cpmctymc: '',
ggxh: '',
page: 1,
limit: 20
},
maintainsList: [],
productList: [],
productTotal: 0,
productLoading: false,
uuid: null,
companyApplyUpdateVisible: false,
companyEditDisabled: true,
companyEditButtonStr: '编辑',
addType: '1', //12
checkFlag: {
0: '草稿',
1: '已通过',
2: '已拒绝',
3: '变更未审核',
6: '未审核'
},
editTye: 1,
selectCorpVisible: false,
selectCertVisible: false,
certType: 1,
customerId: null
}
}
,
methods: {
searchData(query) {
console.log('完成!')
console.log(query)
this.idQuery = { ...query }
this.getDeviceCertList()
},
//
showImgViewer(row) {
this.certFileUrl = this.BASE_URL + '/udiwms/image/register/file/getImage?type=image2&name='
this.imgList = []
previewImage({ imageUrl: row.filePath, certFileUrl: this.certFileUrl }).then(response => {
if (response.code === 20000) {
this.imgList = response.data
}
})
this.imgViewerVisible = true
const m = (e) => {
e.preventDefault()
}
document.body.style.overflow = 'hidden'
document.addEventListener('touchmove', m, false) //
},
closeImgViewer() {
this.imgViewerVisible = false
const m = (e) => {
e.preventDefault()
}
document.body.style.overflow = 'auto'
document.removeEventListener('touchmove', m, true)
},
selectBasicCorp() {
this.selectCorpVisible = true
},
cancelDialog() {
this.closeDialog()
},
//
closeLocalDialog() {
this.addCertVisible = false
this.selectCertVisible = false
// this.getCompanyCertList();
this.getDeviceCertList()
}
,
//
addCert(row) {
// console.log("this.inputQuery.devCodeFk",this.inputQuery.devCodeFk)
if (isBlank(this.inputQuery.devCodeFk)) {
return this.$message.error('请先选择设备')
}
// console.log(this.inputQuery.devCodeFk)
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
this.formName = "edit"
this.inputQuery.formData = row
this.editTye = 2
} else {
this.formName = "add"
this.inputQuery.formData = {}
this.inputQuery.formData.addType = 1
this.editTye = 1
}
this.addCertVisible = true
}
,
//
certHandleCurrentChange(val) {
this.certQuery.page = val.page
// this.getCompanyCertList();
this.getDeviceCertList()
},
getDeviceCertList() {
this.certLoading = true
// let certRuery = {}
// this.certQuery.customerId = this.inputEdit.customerId;
// console.log('idQuery')
// console.log(this.idQuery)
this.certQuery.devCodeFk = this.idQuery.devCodeFk
this.certQuery.type = 1
this.inputQuery = { ...this.idQuery }
this.inputQuery.devCodeFk = this.idQuery.devCodeFk
// console.log(this.inputQuery)
// console.log('this.certQuery:')
// console.log(this.certQuery)
filterDeviceUser(this.certQuery)
.then((response) => {
this.certLoading = false
this.certList = response.data.list || []
this.certTotal = response.data.total
})
.catch(() => {
this.certLoading = false
this.certList = []
})
},
deleteDeviceCert(row) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.certLoading = true
let tquery = {
id: row.id,
filePath: row.filePath
}
deleteDeviceUser(tquery)
.then((response) => {
this.certLoading = false
if (response.code === 20000) {
this.getDeviceCertList()
this.$message({
type: 'success',
message: '删除成功!'
})
} else {
this.$message.error(response.message)
}
})
.catch(() => {
this.certLoading = false
})
}).catch(() => {
})
}
}
,
created() {
// // console.log(" idQuery",this.idQuery)
// // if (this.rowData.editType == 1) {
// this.getDeviceCertList()
// // }
// // this.getBasicUnitMaintainsList();
// this.headers = {
// ADMINID: store.getters.adminId,
// ADMINTOKEN: store.getters.token
// }
},
components: {
draggable, depUserAddDialog, corpMaintainSelect, supCertSetSelectDialog, ElImageViewer
}
}
</script>
<style scoped>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 120px;
}
.text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-card {
margin-right: 20px;
margin-top: 15px;
/*transition: all .5s;*/
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>

@ -0,0 +1,456 @@
<template>
<div>
<el-form :model="inputQuery" :rules="rules" ref="inputQuery" label-width="100px">
<div style=" float: right;
text-align: right;
margin-bottom: 8px;"
>
<el-button type="primary" size="mini" icon="search" @click="addCert"
style="text-align:right"
>添加相关人员
</el-button>
</div>
<el-table v-loading="certLoading" :data="certList" style=" width: 100%;margin-top: 20px" border
highlight-current-row
>
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="人员类别" prop="userType">
<template slot-scope="scope">
<span>{{ dict.type.device_user_type[scope.row.userType].label }}</span>
</template>
</el-table-column>
<el-table-column label="人员名称" prop="userName"></el-table-column>
<el-table-column label="联系电话" prop="contact1"></el-table-column>
<el-table-column label="其他联系方式" prop="contact2"></el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="操作" width="140">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="addCert(scope.row)"
>编辑
</el-button
>
<el-button
type="text"
size="small"
@click.native="deleteDeviceCert(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer"
:url-list="imgList"
/>
<pagination
v-show="certTotal>0"
:total="certTotal"
:page.sync="certQuery.page"
:limit.sync="certQuery.limit"
@pagination="certHandleCurrentChange"
></pagination>
<el-dialog
:title="formMap[formName]"
:visible.sync="addCertVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="70%"
v-if="addCertVisible"
append-to-body
@close="closeLocalDialog"
>
<depUserAddDialog
:closeDialog="closeLocalDialog"
:inputQuery="inputQuery"
:addType="addType"
:editTye="editTye"
:deviceUserType="dict.type.device_user_type"
></depUserAddDialog>
</el-dialog>
</el-form>
</div>
</template>
<script>
import { modifyCompany, addCompany, bindCorp, previewImage } from '@/api/purchase/supCompany'
import store from '@/store'
import { regionDataPlus, CodeToText } from 'element-china-area-data'
import { filterDeviceUser,insertCompanyUser,deleteDeviceUser,updateDeviceUser } from '@/api/dev/deviceUser'
import corpMaintainSelect from '@/views/basic/corpMaintain/corpMaintainSelect'
import depUserAddDialog from '@/views/inventory/user/depUserAddDialog.vue'
import draggable from 'vuedraggable'
import { getUUID, isBlank } from '@/utils/strUtil'
import supCertSetSelectDialog from '@/views/purchase/cert/supCertSetSelectDialog'
import { getBasicUnitMaintains, getCorpList } from '@/api/basic/basicUnitMaintain'
import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
export default {
name: 'invDeviceInspectEditDialog',
dicts: ['device_user_type'],
props: {
// closeDialog: {
// type: Function,
// required: true,
// },
// inputEdit: {
// type: Object,
// required: true,
// },
// editType: {
// type: Number,
// required: true,
// }
idQuery: {
type: Object,
required: true
},
rowData: {
type: Object,
required: true
}
},
watch: {
rowData: function(newVal, oldVal) {
this.searchData(newVal)
}
}
,
data() {
return {
formName: null,
formMap: {
"add": "添加相关人员",
"edit": "编辑相关人员"
},
BASE_URL: process.env.VUE_APP_BASE_API,
headers: {},
classesDisplay: false,
selectedOptions: [],
imgViewerVisible: false,
imgList: [],
options: regionDataPlus,
inputQuery: {
// customerId: null,
devCodeFk: null,
companyName: null,
contacts: null,
mobile: null,
detailAddr: null
},
rules: {
companyName: [
{
required: true,
message: '请输入企业名称',
trigger: 'blur'
}
],
creditNum: [
{
required: true,
message: '请输入统一社会信用代码',
trigger: 'blur'
}
],
classes: [
{
required: true,
message: '请选择企业类别',
trigger: 'change'
}
],
area: [
{
required: true,
message: '请选择所属地区',
trigger: 'change'
}
],
detailAddr: [
{
required: true,
message: '请输入详细地址',
trigger: 'change'
}
],
contacts: [
{
required: true,
message: '请输入联系人',
trigger: 'change'
}
],
mobile: [
{
required: true,
message: '请输入联系电话',
trigger: 'change'
}
],
email: [
{
required: true,
message: '请输入邮箱',
trigger: 'change'
}
],
updateCause: [
{
required: true,
message: '请输入变更原因',
trigger: 'change'
}
]
},
uploadUrl: '',
fileUrl: '',
certFileUrl: '',
url: 'http://127.0.0.1:9996/udiwms/image/register/file/getImage?type=image1&name=t11111.jpg',
certQuery: {
devCodeFk: '',
page: 1,
limit: 20,
type: 1
},
expire: {
0: '有效',
1: '失效'
},
certList: [],
certTotal: 0,
certLoading: false,
addCertVisible: false,
salesmanQuery: {
name: '',
page: 1,
limit: 20
},
salesmanList: [],
salesmanTotal: 0,
salesmanLoading: false,
addSalesmanVisible: false,
certTypeMap: {
1: '身份证'
},
selectLocalVisible: false,
productQuery: {
ylqxzcrbarmc: '',
cpmctymc: '',
ggxh: '',
page: 1,
limit: 20
},
maintainsList: [],
productList: [],
productTotal: 0,
productLoading: false,
uuid: null,
companyApplyUpdateVisible: false,
companyEditDisabled: true,
companyEditButtonStr: '编辑',
addType: '1', //12
checkFlag: {
0: '草稿',
1: '已通过',
2: '已拒绝',
3: '变更未审核',
6: '未审核'
},
editTye: 1,
selectCorpVisible: false,
selectCertVisible: false,
certType: 1,
customerId: null
}
}
,
methods: {
searchData(query) {
console.log('完成!')
console.log(query)
this.idQuery = { ...query }
this.getDeviceCertList()
},
//
showImgViewer(row) {
this.certFileUrl = this.BASE_URL + '/udiwms/image/register/file/getImage?type=image2&name='
this.imgList = []
previewImage({ imageUrl: row.filePath, certFileUrl: this.certFileUrl }).then(response => {
if (response.code === 20000) {
this.imgList = response.data
}
})
this.imgViewerVisible = true
const m = (e) => {
e.preventDefault()
}
document.body.style.overflow = 'hidden'
document.addEventListener('touchmove', m, false) //
},
closeImgViewer() {
this.imgViewerVisible = false
const m = (e) => {
e.preventDefault()
}
document.body.style.overflow = 'auto'
document.removeEventListener('touchmove', m, true)
},
selectBasicCorp() {
this.selectCorpVisible = true
},
cancelDialog() {
this.closeDialog()
},
//
closeLocalDialog() {
this.addCertVisible = false
this.selectCertVisible = false
// this.getCompanyCertList();
this.getDeviceCertList()
}
,
//
addCert(row) {
// console.log("this.inputQuery.devCodeFk",this.inputQuery.devCodeFk)
if (isBlank(this.inputQuery.devCodeFk)) {
return this.$message.error('请先选择设备')
}
// console.log(this.inputQuery.devCodeFk)
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
this.formName = "edit"
this.inputQuery.formData = row
this.editTye = 2
} else {
this.formName = "add"
this.inputQuery.formData = {}
this.inputQuery.formData.addType = 1
this.editTye = 1
}
this.addCertVisible = true
}
,
//
certHandleCurrentChange(val) {
this.certQuery.page = val.page
// this.getCompanyCertList();
this.getDeviceCertList()
},
getDeviceCertList() {
this.certLoading = true
// let certRuery = {}
// this.certQuery.customerId = this.inputEdit.customerId;
// console.log('idQuery')
// console.log(this.idQuery)
this.certQuery.devCodeFk = this.idQuery.devCodeFk
this.certQuery.type = 1
this.inputQuery = { ...this.idQuery }
this.inputQuery.devCodeFk = this.idQuery.devCodeFk
// console.log(this.inputQuery)
// console.log('this.certQuery:')
// console.log(this.certQuery)
filterDeviceUser(this.certQuery)
.then((response) => {
this.certLoading = false
this.certList = response.data.list || []
this.certTotal = response.data.total
})
.catch(() => {
this.certLoading = false
this.certList = []
})
},
deleteDeviceCert(row) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.certLoading = true
let tquery = {
id: row.id,
filePath: row.filePath
}
deleteDeviceUser(tquery)
.then((response) => {
this.certLoading = false
if (response.code === 20000) {
this.getDeviceCertList()
this.$message({
type: 'success',
message: '删除成功!'
})
} else {
this.$message.error(response.message)
}
})
.catch(() => {
this.certLoading = false
})
}).catch(() => {
})
}
}
,
created() {
// // console.log(" idQuery",this.idQuery)
// // if (this.rowData.editType == 1) {
// this.getDeviceCertList()
// // }
// // this.getBasicUnitMaintainsList();
// this.headers = {
// ADMINID: store.getters.adminId,
// ADMINTOKEN: store.getters.token
// }
},
components: {
draggable, depUserAddDialog, corpMaintainSelect, supCertSetSelectDialog, ElImageViewer
}
}
</script>
<style scoped>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 120px;
}
.text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-card {
margin-right: 20px;
margin-top: 15px;
/*transition: all .5s;*/
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>

@ -0,0 +1,456 @@
<template>
<div>
<el-form :model="inputQuery" :rules="rules" ref="inputQuery" label-width="100px">
<div style=" float: right;
text-align: right;
margin-bottom: 8px;"
>
<el-button type="primary" size="mini" icon="search" @click="addCert"
style="text-align:right"
>添加相关人员
</el-button>
</div>
<el-table v-loading="certLoading" :data="certList" style=" width: 100%;margin-top: 20px" border
highlight-current-row
>
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="人员类别" prop="userType">
<template slot-scope="scope">
<span>{{ dict.type.device_user_type[scope.row.userType].label }}</span>
</template>
</el-table-column>
<el-table-column label="人员名称" prop="userName"></el-table-column>
<el-table-column label="联系电话" prop="contact1"></el-table-column>
<el-table-column label="其他联系方式" prop="contact2"></el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="操作" width="140">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="addCert(scope.row)"
>编辑
</el-button
>
<el-button
type="text"
size="small"
@click.native="deleteDeviceCert(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer"
:url-list="imgList"
/>
<pagination
v-show="certTotal>0"
:total="certTotal"
:page.sync="certQuery.page"
:limit.sync="certQuery.limit"
@pagination="certHandleCurrentChange"
></pagination>
<el-dialog
:title="formMap[formName]"
:visible.sync="addCertVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="70%"
v-if="addCertVisible"
append-to-body
@close="closeLocalDialog"
>
<depUserAddDialog
:closeDialog="closeLocalDialog"
:inputQuery="inputQuery"
:addType="addType"
:editTye="editTye"
:deviceUserType="dict.type.device_user_type"
></depUserAddDialog>
</el-dialog>
</el-form>
</div>
</template>
<script>
import { modifyCompany, addCompany, bindCorp, previewImage } from '@/api/purchase/supCompany'
import store from '@/store'
import { regionDataPlus, CodeToText } from 'element-china-area-data'
import { filterDeviceUser,insertCompanyUser,deleteDeviceUser,updateDeviceUser } from '@/api/dev/deviceUser'
import corpMaintainSelect from '@/views/basic/corpMaintain/corpMaintainSelect'
import depUserAddDialog from '@/views/inventory/user/depUserAddDialog.vue'
import draggable from 'vuedraggable'
import { getUUID, isBlank } from '@/utils/strUtil'
import supCertSetSelectDialog from '@/views/purchase/cert/supCertSetSelectDialog'
import { getBasicUnitMaintains, getCorpList } from '@/api/basic/basicUnitMaintain'
import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
export default {
name: 'invDeviceUsageEditDialog',
dicts: ['device_user_type'],
props: {
// closeDialog: {
// type: Function,
// required: true,
// },
// inputEdit: {
// type: Object,
// required: true,
// },
// editType: {
// type: Number,
// required: true,
// }
idQuery: {
type: Object,
required: true
},
rowData: {
type: Object,
required: true
}
},
watch: {
rowData: function(newVal, oldVal) {
this.searchData(newVal)
}
}
,
data() {
return {
formName: null,
formMap: {
"add": "添加相关人员",
"edit": "编辑相关人员"
},
BASE_URL: process.env.VUE_APP_BASE_API,
headers: {},
classesDisplay: false,
selectedOptions: [],
imgViewerVisible: false,
imgList: [],
options: regionDataPlus,
inputQuery: {
// customerId: null,
devCodeFk: null,
companyName: null,
contacts: null,
mobile: null,
detailAddr: null
},
rules: {
companyName: [
{
required: true,
message: '请输入企业名称',
trigger: 'blur'
}
],
creditNum: [
{
required: true,
message: '请输入统一社会信用代码',
trigger: 'blur'
}
],
classes: [
{
required: true,
message: '请选择企业类别',
trigger: 'change'
}
],
area: [
{
required: true,
message: '请选择所属地区',
trigger: 'change'
}
],
detailAddr: [
{
required: true,
message: '请输入详细地址',
trigger: 'change'
}
],
contacts: [
{
required: true,
message: '请输入联系人',
trigger: 'change'
}
],
mobile: [
{
required: true,
message: '请输入联系电话',
trigger: 'change'
}
],
email: [
{
required: true,
message: '请输入邮箱',
trigger: 'change'
}
],
updateCause: [
{
required: true,
message: '请输入变更原因',
trigger: 'change'
}
]
},
uploadUrl: '',
fileUrl: '',
certFileUrl: '',
url: 'http://127.0.0.1:9996/udiwms/image/register/file/getImage?type=image1&name=t11111.jpg',
certQuery: {
devCodeFk: '',
page: 1,
limit: 20,
type: 1
},
expire: {
0: '有效',
1: '失效'
},
certList: [],
certTotal: 0,
certLoading: false,
addCertVisible: false,
salesmanQuery: {
name: '',
page: 1,
limit: 20
},
salesmanList: [],
salesmanTotal: 0,
salesmanLoading: false,
addSalesmanVisible: false,
certTypeMap: {
1: '身份证'
},
selectLocalVisible: false,
productQuery: {
ylqxzcrbarmc: '',
cpmctymc: '',
ggxh: '',
page: 1,
limit: 20
},
maintainsList: [],
productList: [],
productTotal: 0,
productLoading: false,
uuid: null,
companyApplyUpdateVisible: false,
companyEditDisabled: true,
companyEditButtonStr: '编辑',
addType: '1', //12
checkFlag: {
0: '草稿',
1: '已通过',
2: '已拒绝',
3: '变更未审核',
6: '未审核'
},
editTye: 1,
selectCorpVisible: false,
selectCertVisible: false,
certType: 1,
customerId: null
}
}
,
methods: {
searchData(query) {
console.log('完成!')
console.log(query)
this.idQuery = { ...query }
this.getDeviceCertList()
},
//
showImgViewer(row) {
this.certFileUrl = this.BASE_URL + '/udiwms/image/register/file/getImage?type=image2&name='
this.imgList = []
previewImage({ imageUrl: row.filePath, certFileUrl: this.certFileUrl }).then(response => {
if (response.code === 20000) {
this.imgList = response.data
}
})
this.imgViewerVisible = true
const m = (e) => {
e.preventDefault()
}
document.body.style.overflow = 'hidden'
document.addEventListener('touchmove', m, false) //
},
closeImgViewer() {
this.imgViewerVisible = false
const m = (e) => {
e.preventDefault()
}
document.body.style.overflow = 'auto'
document.removeEventListener('touchmove', m, true)
},
selectBasicCorp() {
this.selectCorpVisible = true
},
cancelDialog() {
this.closeDialog()
},
//
closeLocalDialog() {
this.addCertVisible = false
this.selectCertVisible = false
// this.getCompanyCertList();
this.getDeviceCertList()
}
,
//
addCert(row) {
// console.log("this.inputQuery.devCodeFk",this.inputQuery.devCodeFk)
if (isBlank(this.inputQuery.devCodeFk)) {
return this.$message.error('请先选择设备')
}
// console.log(this.inputQuery.devCodeFk)
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
this.formName = "edit"
this.inputQuery.formData = row
this.editTye = 2
} else {
this.formName = "add"
this.inputQuery.formData = {}
this.inputQuery.formData.addType = 1
this.editTye = 1
}
this.addCertVisible = true
}
,
//
certHandleCurrentChange(val) {
this.certQuery.page = val.page
// this.getCompanyCertList();
this.getDeviceCertList()
},
getDeviceCertList() {
this.certLoading = true
// let certRuery = {}
// this.certQuery.customerId = this.inputEdit.customerId;
// console.log('idQuery')
// console.log(this.idQuery)
this.certQuery.devCodeFk = this.idQuery.devCodeFk
this.certQuery.type = 1
this.inputQuery = { ...this.idQuery }
this.inputQuery.devCodeFk = this.idQuery.devCodeFk
// console.log(this.inputQuery)
// console.log('this.certQuery:')
// console.log(this.certQuery)
filterDeviceUser(this.certQuery)
.then((response) => {
this.certLoading = false
this.certList = response.data.list || []
this.certTotal = response.data.total
})
.catch(() => {
this.certLoading = false
this.certList = []
})
},
deleteDeviceCert(row) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.certLoading = true
let tquery = {
id: row.id,
filePath: row.filePath
}
deleteDeviceUser(tquery)
.then((response) => {
this.certLoading = false
if (response.code === 20000) {
this.getDeviceCertList()
this.$message({
type: 'success',
message: '删除成功!'
})
} else {
this.$message.error(response.message)
}
})
.catch(() => {
this.certLoading = false
})
}).catch(() => {
})
}
}
,
created() {
// // console.log(" idQuery",this.idQuery)
// // if (this.rowData.editType == 1) {
// this.getDeviceCertList()
// // }
// // this.getBasicUnitMaintainsList();
// this.headers = {
// ADMINID: store.getters.adminId,
// ADMINTOKEN: store.getters.token
// }
},
components: {
draggable, depUserAddDialog, corpMaintainSelect, supCertSetSelectDialog, ElImageViewer
}
}
</script>
<style scoped>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 120px;
}
.text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-card {
margin-right: 20px;
margin-top: 15px;
/*transition: all .5s;*/
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>
Loading…
Cancel
Save