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.
udi-spms-vue/src/views/supplier/company/basicCompanyproductEdit.vue

708 lines
24 KiB
Vue

2 years ago
<template>
<div>
<el-card>
<el-table :data="sysList" style="width: 100%; margin-bottom: 8px" key="2" border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="第三方系统名称" prop="sysName" show-overflow-tooltip></el-table-column>
<el-table-column label="第三方系统物资编码" prop="thirdId" show-overflow-tooltip></el-table-column>
<el-table-column label="第三方系统物资名称" prop="thirdName" show-overflow-tooltip></el-table-column>
<el-table-column label="第三方系统规格型号" prop="spec" show-overflow-tooltip></el-table-column>
2 years ago
<el-table-column label="注册/备案号" prop="registerNo" show-overflow-tooltip></el-table-column>
<el-table-column label="生产企业" prop="manufactory" show-overflow-tooltip></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="addSelectErp(scope.row)" :disabled="scope.row.thirdId==editQuery.nameCode">
关联
</el-button>
<el-button type="text" @click.native.stop="removeErp(scope.row)"
:disabled="editQuery.flbm==null || scope.row.thirdId==null || scope.row.thirdId==''">解绑
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card>
<div style=" float: left;
text-align: left;
font-weight: bold;
margin-bottom: 8px">
<span>产品标识:</span>
</div>
<div style=" float: right;
text-align: right;
margin-bottom: 8px;">
<el-button type="primary" size="mini" icon="search" @click="removeDi" v-if="productType!=1"
style="text-align:right">解绑DI器械信息
</el-button>
</div>
<el-table v-loading="loading" :data="detailList" style="width: 100%; " border key="3" highlight-current-row>
<el-table-column label="产品最小销售标识" prop="nameCode" show-overflow-tooltip></el-table-column>
<el-table-column label="物资名称" prop="cpmctymc" show-overflow-tooltip></el-table-column>
<el-table-column label="包装级别" prop="packLevel" show-overflow-tooltip></el-table-column>
<el-table-column label="包装层级" prop="bzcj" show-overflow-tooltip></el-table-column>
</el-table>
</el-card>
<el-card>
<el-form :model="editQuery" :rules="rules" ref="editQuery" border label-width="120px" style="margin-top: 20px; ">
<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.sptm"></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.spmc"></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.measname"></el-input>
</el-form-item>
</el-col>
11 months ago
<!--<el-col :span="12">-->
<!-- <el-form-item label="生产企业:">-->
<!-- <el-input style="width: 80%" size="small" splaceholder="请输入内容" v-model="editQuery.manufactory"-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
<!--</el-col>-->
<el-col :span="12" >
<el-form-item :label="'生产企业:'">
<el-select
v-model="editQuery.manufactory"
filterable
remote
clearable="true"
reserve-keyword
placeholder="请选择生产企业"
:remote-method="findProducts"
style="width: 80%"
>
<el-option
v-for="item in probucts"
:key="item.unitId"
:label="item.name"
:value="item.unitId"
>
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.unitId }}</span>
</el-option>
</el-select>
</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.price"></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.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="采购类型">
<el-select
v-model="editQuery.purType"
placeholder="请选择"
clearable
style="width: 80%"
>
<el-option label="普通入账产品" :value="1"></el-option>
<el-option label="预验收产品" :value="2"></el-option>
<el-option label="寄售产品" :value="3"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品属性">
<el-select
v-model="editQuery.attributeType"
placeholder="请选择"
clearable
style="width: 65%"
>
<el-option label="设备" :value="1"></el-option>
<el-option label="耗材" :value="2"></el-option>
<el-option label="伴随服务费" :value="3"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex" class="edit-row">
<el-col :span="12" v-if="productRemarkSet.remarkEnable1">
<el-form-item :label="productRemarkSet.remarkTitle1+':'">
<el-input
style="width: 80%"
size="small"
splaceholder="请输入内容"
v-model="editQuery.basicPrductRemak1"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12" v-if="productRemarkSet.remarkEnable2">
<el-form-item :label="productRemarkSet.remarkTitle2+':'">
<el-input
style="width: 80%"
size="small"
splaceholder="请输入内容"
v-model="editQuery.basicPrductRemak2"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex" class="edit-row">
<el-col :span="12" v-if="productRemarkSet.remarkEnable3">
<el-form-item :label="productRemarkSet.remarkTitle3+':'">
<el-input
style="width: 80%"
size="small"
splaceholder="请输入内容"
v-model="editQuery.basicPrductRemak3"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12" v-if="productRemarkSet.remarkEnable4">
<el-form-item :label="productRemarkSet.remarkTitle4+':'">
<el-input
style="width: 80%"
size="small"
splaceholder="请输入内容"
v-model="editQuery.basicPrductRemak4"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex" class="edit-row">
<el-col :span="12" v-if="productRemarkSet.remarkEnable5">
<el-form-item :label="productRemarkSet.remarkTitle5+':'">
<el-input
style="width: 80%"
size="small"
splaceholder="请输入内容"
v-model="editQuery.basicPrductRemak5"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12" v-if="productRemarkSet.remarkEnable6">
<el-form-item :label="productRemarkSet.remarkTitle6+':'">
<el-select
v-model="editQuery.basicPrductRemak6"
placeholder="请选择"
clearable
style="width: 80%"
>
<el-option label="扣费" value="1"></el-option>
<el-option label="不扣费" value="0"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex" class="edit-row">
<el-col :span="12" v-if="productRemarkSet.remarkEnable7">
<el-form-item :label="productRemarkSet.remarkTitle7+':'">
<el-select
v-model="editQuery.basicPrductRemak7"
filterable
remote
clearable="true"
reserve-keyword
placeholder="请选择物资类别"
:remote-method="findThrTypeMethod"
style="width: 80%"
>
<el-option
v-for="item in thrTypeOptions"
:key="item.code"
:label="item.name"
:value="item.code"
>
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.code }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="productRemarkSet.remarkEnable8==true && editQuery.basicPrductRemak6=='1'">
<el-form-item :label="productRemarkSet.remarkTitle8+':'">
<el-select
v-model="editQuery.basicPrductRemak8"
filterable
remote
clearable="true"
reserve-keyword
placeholder="请选择物价类别"
:remote-method="findHsflMethod"
style="width: 80%"
>
<el-option
v-for="item in hsflOptions"
:key="item.hsbm"
:label="item.hsmc"
:value="item.hsbm"
>
<span style="float: left">{{ item.hsmc }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.hsbm }}</span>
</el-option>
</el-select>
</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.cpms"></el-input>
</el-form-item>
</el-col>
2 years ago
<el-col :span="12">
<el-form-item
label="是否可集采:"
prop="spUse"
class="query-form-item"
>
<el-radio-group v-model="editQuery.groupBuy">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
2 years ago
</el-col>
</el-row>
<el-row type="flex" class="edit-row">
<el-col :span="12">
<el-form-item
label="耗材类别:"
prop="hcType"
class="query-form-item"
>
<el-radio-group v-model="editQuery.hcType">
<el-radio :label=1>高值耗材</el-radio>
<el-radio :label=2>普通耗材</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item class="query-form-item" >
</el-form-item>
</el-col>
</el-row>
<el-row class="edit-row">
<el-button-group style="display: flex">
<el-button type="primary" @click.native="submitUpload()" style="margin: 0 60px 10px auto; height: 35px"
:loading="loading"
>提交
</el-button>
</el-button-group>
</el-row>
</el-form>
</el-card>
<el-dialog
title="耗材字典-从指定系统添加器械信息"
:visible.sync="selectErpDialogVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="80%"
append-to-body
v-if="selectErpDialogVisible"
>
<selectErp
:closeDialog="closeDialog"
:uuid="uuid"
:relId="relId"
:isImport="isImport"
:data="thisData"
:defaultSys="defaultSys"
@closeUdi="closeUdi2"
:supEnable="false"
></selectErp>
</el-dialog>
2 years ago
</div>
</template>
<script>
import {getYbHcflDetail,disableUdi, removeDiRl, removeRl, thirdSysDetail} from '@/api/basic/product/udiRelevance'
import {updateById} from '@/api/basic/udiRelevance'
import {filterByUuid} from '@/api/basic/udiInfo'
import selectErp from "./udiInfoselectErpUdi";
import selectUdiVersion from '@/views/basic/product/UdiinfoSelectVersion'
11 months ago
import {getHslbs, getThrProductType,getTBasicProducts} from "@/api/thrsys/thrHsfl";
2 years ago
export default {
name: 'productEdit',
props: {
editQuery: {
type: Object,
required: true
},
productRemarkSet: {
type: Object,
required: true
},
2 years ago
closeDialog: {
type: Function,
required: true
},
},
data() {
return {
ybHcflDetail: {},
2 years ago
isUseDyCheck: false,
useNumEnable: true,
editDialogVisible: false,
sysList: {},
relId: null,
defaultSys: null,
detailList: {},
isImport: null,
thisData: {
nameCode: null,
cpmctymc: null,
ggxh: null
},
selectVersionVisible: false,
originUuid: null,
uuid: null,
editSingleFormat: {
uuid: null,
relId: null,
sptm: null,
packUnit: null,
measname: null,
},
editSingleDiDialogVisible: false,
selectErpDialogVisible: false, //选入ERP产品
hsflOptions: [],
thrTypeOptions: [],
11 months ago
probucts:[],
2 years ago
}
},
methods: {
getYbHcData(){
let query = {
specificationCode: this.editQuery.ybbm
};
getYbHcflDetail(query).then((response) => {
if (response.code == 20000) {
this.ybHcflDetail = response.data
this.editQuery.catalogcode = this.ybHcflDetail.catalogcode
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.catalogcode = ""
this.editQuery.catalogname1 = ""
this.editQuery.catalogname2 = ""
this.editQuery.catalogname3 = ""
this.editQuery.matrial = ""
this.$forceUpdate();
}
}).catch(() => {
})
},
onClose(){
this.$emit("onClose")
},
2 years ago
submitUpload() {
var data = {
id: this.editQuery.prid,
1 year ago
uid: this.editQuery.rlId,
2 years ago
sptm: this.editQuery.sptm,
spmc: this.editQuery.spmc,
measname: this.editQuery.measname,
manufactory: this.editQuery.manufactory,
price: this.editQuery.price,
cpms: this.editQuery.cpms,
ybbm: this.editQuery.ybbm,
purType: this.editQuery.purType,
attributeType: this.editQuery.attributeType,
hcType: this.editQuery.hcType,
overStockNum: this.editQuery.overStockNum,
lowStockNum: this.editQuery.lowStockNum,
recentDateTime: this.editQuery.recentDateTime,
isDateBy: this.editQuery.isDateBy,
relSupId: this.editQuery.id,
groupBuy: this.editQuery.groupBuy,
basicPrductRemak1: this.editQuery.basicPrductRemak1,
basicPrductRemak2: this.editQuery.basicPrductRemak2,
basicPrductRemak3: this.editQuery.basicPrductRemak3,
basicPrductRemak4: this.editQuery.basicPrductRemak4,
basicPrductRemak5: this.editQuery.basicPrductRemak5,
basicPrductRemak6: this.editQuery.basicPrductRemak6,
basicPrductRemak7: this.editQuery.basicPrductRemak7,
basicPrductRemak8: this.editQuery.basicPrductRemak8,
catalogcode: this.editQuery.catalogcode,
catalogname1: this.editQuery.catalogname1,
catalogname2: this.editQuery.catalogname2,
catalogname3: this.editQuery.catalogname3,
matrial: this.editQuery.matrial,
2 years ago
}
updateById(data).then(res => {
if (res.code == 20000) {
2 years ago
this.closeDialog();
} else {
2 years ago
this.$message.error(response.message);
}
})
},
getThirdSysDetail() {
let query = {
id: this.editQuery.rlId,
};
thirdSysDetail(query)
.then((response) => {
this.loading = false;
this.sysList = response.data.list || [];
})
.catch(() => {
this.loading = false;
this.sysList = [];
});
},
addSelectErp(row) {
this.defaultSys = row.sysId;
this.isImport = false;
this.relId = this.editQuery.rlId;
this.thisData = this.editQuery;
this.selectErpDialogVisible = true;
},
removeErp(row) {
this.$confirm("此操作将解除该绑定产品信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let query = {
relId: this.editQuery.rlId,
thirdSys: row.sysId
};
removeRl(query)
.then((response) => {
if (response.code == 20000) {
this.$message({
type: "success",
message: "删除成功!",
});
this.getThirdSysDetail();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
});
})
.catch(() => {
});
},
removeDi() {
this.$confirm("此操作将解除该绑定DI器械信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let query = {
relId: this.editQuery.rlId,
};
removeDiRl(query)
.then((response) => {
if (response.code == 20000) {
this.$message({
type: "success",
message: "删除成功!",
});
this.editDialogVisible = false;
this.closeDialog();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
});
})
.catch(() => {
});
},
getDetailList(detailQuery) {
this.loading = true;
filterByUuid(detailQuery)
.then((response) => {
this.loading = false;
this.detailList = response.data || [];
})
.catch(() => {
this.loading = false;
this.detailList = [];
});
},
closeUdi2() {
this.selectUdiDialogVisible = false;
this.selectErpDialogVisible = false;
this.selectLocalVisible = false;
this.selectVersionVisible = false;
this.getThirdSysDetail();
},
findHsflMethod(query) {
this.hsflOptions = [];
let cQuery = {
key: query,
page: 1,
limit: 20
};
getHslbs(cQuery)
.then((response) => {
this.loading = false;
this.hsflOptions = response.data.list || [];
})
.catch(() => {
this.loading = false;
});
},
findThrTypeMethod(query) {
this.thrTypeOptions = [];
let cQuery = {
key: query,
page: 1,
limit: 20
};
getThrProductType(cQuery)
.then((response) => {
this.loading = false;
this.thrTypeOptions = response.data.list || [];
})
.catch(() => {
this.loading = false;
});
},
11 months ago
findProducts(query) {
this.probucts = [];
let cQuery = {
key: query,
page: 1,
limit: 20
};
getTBasicProducts(cQuery)
.then((response) => {
console.log("heiheiehi",response)
this.loading = false;
this.probucts = response.data.list || [];
})
.catch(() => {
this.loading = false;
});
},
},
components: {
selectErp
},
created() {
this.getThirdSysDetail();
var ttquery = {
id: this.editQuery.rlId,
page: 1,
limit: 10,
};
this.getDetailList(ttquery);
// if (this.editQuery.basicPrductRemak8 != null) {
this.findHsflMethod(this.editQuery.basicPrductRemak8);
// }
11 months ago
// if (this.editQuery.basicPrductRemak7 != null) { manufactory
this.findThrTypeMethod(this.editQuery.basicPrductRemak7);
11 months ago
this.findProducts()
// }
console.log("editQuery:",this.editQuery)
}, directives: {
'debounce-input': {
inserted(el, binding) {
let timeout
el.addEventListener('input', () => {
clearTimeout(timeout)
timeout = setTimeout(() => {
binding.value()
}, parseInt(binding.arg) || 300)
})
}
}
}
2 years ago
}
</script>
<style scoped>
</style>