|
|
@@ -47,7 +47,7 @@
|
|
|
</el-icon>
|
|
|
</el-tooltip>
|
|
|
</el-button>
|
|
|
- <el-popconfirm title="确定删除该单位?">
|
|
|
+ <el-popconfirm title="确定删除该单位?" @confirm="deleterow(scope.row)">
|
|
|
<template #reference>
|
|
|
<el-button link
|
|
|
><el-tooltip effect="dark" content="删除"
|
|
|
@@ -67,7 +67,7 @@
|
|
|
:title="`${edittype == 1 ? '新增' : edittype == 2 ? '编辑' : '查看'}单位`"
|
|
|
v-model="detailshow"
|
|
|
>
|
|
|
- <el-form :inline="true" :model="dwform" label-width="120px">
|
|
|
+ <el-form :inline="true" :model="dwform" label-width="120px" class="showdialog">
|
|
|
<el-form-item label="名称">
|
|
|
<el-input v-model="dwform.name" :disabled="edittype==3"/>
|
|
|
</el-form-item>
|
|
|
@@ -81,7 +81,15 @@
|
|
|
<el-input v-model="dwform.isStandard" :disabled="edittype==3"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="单位分类">
|
|
|
- <el-input v-model="dwform.unitType" :disabled="edittype==3"/>
|
|
|
+ <el-select-v2
|
|
|
+ v-model="dwform.unitType"
|
|
|
+ :options="typeoptions"
|
|
|
+ placeholder="请输入"
|
|
|
+ allow-create
|
|
|
+ style="width: 100%"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="换算比例">
|
|
|
<el-input v-model="dwform.toStandardRatio" type="number" :disabled="edittype==3"/>
|
|
|
@@ -115,6 +123,7 @@ const detailshow = ref(false);
|
|
|
|
|
|
const dwtypetable =ref();
|
|
|
|
|
|
+const typeoptions = ref([]);
|
|
|
const dwform = ref({});
|
|
|
const doinint =()=>{
|
|
|
dwform.value = {
|
|
|
@@ -148,6 +157,13 @@ const gettbheight = () => {
|
|
|
return window.innerHeight - 200;
|
|
|
}
|
|
|
|
|
|
+const deleterow = (item) =>{
|
|
|
+ delUnit(item.id).then(res=>{
|
|
|
+ ElMessage.success('删除成功');
|
|
|
+ getalldata();
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
const alldata = ref([]);
|
|
|
const getalldata = () => {
|
|
|
listUnit({}).then(res=>{
|
|
|
@@ -155,6 +171,8 @@ const getalldata = () => {
|
|
|
dwtabledata.value = res["data"];
|
|
|
dwtypetabledata.value = (["全部"].concat(_.uniq(res.data.map(item=>item.unitType)))).map(i=> {return {"name":i};});
|
|
|
dwtypetable.value.setCurrentRow(dwtypetabledata.value[0]);
|
|
|
+
|
|
|
+ typeoptions.value = _.uniq(res.data.map(item=>item.unitType)).map(i=>({value:i,label:i}))
|
|
|
})
|
|
|
};
|
|
|
|
|
|
@@ -191,6 +209,14 @@ onMounted(()=>{
|
|
|
|
|
|
|
|
|
</script>
|
|
|
+<style lang="scss">
|
|
|
+.showdialog{
|
|
|
+ .el-form-item__content {
|
|
|
+ width: 180px !important;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.card-header {
|
|
|
@@ -198,4 +224,6 @@ onMounted(()=>{
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
</style>
|