|
|
|
|
@ -81,14 +81,15 @@
|
|
|
|
|
<el-dialog v-model="ItemDialogVisible" title="编辑项目" width="40%">
|
|
|
|
|
<div class="row"><span class="title">医嘱名称:</span>{{selectedItemInfo.item_name}}</div>
|
|
|
|
|
<div class="row"><span class="title">预约方式:</span>
|
|
|
|
|
<!-- <el-select style=" width: 200px;" clearable
|
|
|
|
|
<!-- <el-select style=" width: 200px;" clearable
|
|
|
|
|
v-model="selectedItemInfo.reservation_method" placeholder="预约方式">
|
|
|
|
|
<el-option v-for="(item, index) in yuyueType" :key="index" :label="item.name" :value="item.id" />
|
|
|
|
|
</el-select> -->
|
|
|
|
|
<el-checkbox-group v-if="yuyueType" v-model="selectedItemInfo.reservation_method">
|
|
|
|
|
<el-checkbox v-for="(item, index) in yuyueType" :label="item.id" :value="item.id" :key="index">{{item.name}}</el-checkbox>
|
|
|
|
|
<el-checkbox v-for="(item, index) in yuyueType" :label="item.id" :value="item.id"
|
|
|
|
|
:key="index">{{item.name}}</el-checkbox>
|
|
|
|
|
</el-checkbox-group>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row"><span class="title">空腹:</span><el-select :filterable="true" clearable
|
|
|
|
|
v-model="selectedItemInfo.limosis" placeholder="是否空腹" style=" width: 100px;">
|
|
|
|
|
<el-option label="否" :value="0" />
|
|
|
|
|
@ -99,7 +100,9 @@
|
|
|
|
|
<div class="row"><span class="title">检查时间:</span><el-input v-model="selectedItemInfo.check_time"
|
|
|
|
|
placeholder="请输入此项检查的时长" style="width: 200px;" /></div>
|
|
|
|
|
<div class="row"><span class="title">等待时间:</span><el-input v-model="selectedItemInfo.check_begin_time"
|
|
|
|
|
placeholder="开医嘱后,等待时间" style="width: 200px;" /><div style="margin-left: 4px;">医嘱开具后,预约时间需在设定的等待期之后,单位分钟</div></div>
|
|
|
|
|
placeholder="开医嘱后,等待时间" style="width: 200px;" />
|
|
|
|
|
<div style="margin-left: 4px;">医嘱开具后,预约时间需在设定的等待期之后,单位分钟</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="row"><span class="title">检查须知:</span><el-input v-model="selectedItemInfo.check_notice"
|
|
|
|
|
@ -114,9 +117,9 @@
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<el-dialog v-model="HuChiDialogVisible" :title="'为 '+SelectedHuChiItemInfo.name+' 设置互斥'" width="80%" >
|
|
|
|
|
<el-dialog v-model="HuChiDialogVisible" :title="'为 '+SelectedHuChiItemInfo.name+' 设置互斥'" width="80%">
|
|
|
|
|
请输入想要与 <span style="font-weight: 900;font-size: 16px;">{{SelectedHuChiItemInfo.name}}</span> 互斥的项目名称
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <div v-if="itemHuChiList.length>0">
|
|
|
|
|
<div class="row" v-for="(item,index) in itemHuChiList" :key="index">
|
|
|
|
|
<div class="col">{{item.code1_item_name}}</div>
|
|
|
|
|
@ -126,35 +129,62 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div> -->
|
|
|
|
|
|
|
|
|
|
<div style="display: flex;margin-top: 20px;">
|
|
|
|
|
|
|
|
|
|
<div style="width: 30%;border-right: 1px solid #ccc;padding:4px 20px;">
|
|
|
|
|
<div class="row" v-loading="HuChiLoading" style="border-bottom: 1px solid #ccc;padding-bottom: 12px;margin-bottom: 20px;">
|
|
|
|
|
<el-input v-model="HuChi_InputItem" placeholder="项目搜索" style="width: 200px;" />
|
|
|
|
|
<el-button type="success" style="margin-left: 8px;" @click="HuChi_SearchItem()">查询</el-button>
|
|
|
|
|
<div v-loading="HuChiLoading"
|
|
|
|
|
style="border-bottom: 1px solid #ccc;padding-bottom: 12px;margin-bottom: 20px;">
|
|
|
|
|
<div style="display: flex;margin-bottom: 8px;">
|
|
|
|
|
<el-select clearable :filterable="true" v-model="HuChi_bigClass"
|
|
|
|
|
@change="GetItemClassList('Dialog')" placeholder="所有医嘱大类">
|
|
|
|
|
<el-option v-for="(item, index) in DialogBigClassList" :key="index"
|
|
|
|
|
:label="item.item_class_name" :value="item.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
|
|
<el-select :filterable="true" clearable v-model="HuChi_smallClass" placeholder="所有医嘱小类" @change="HuChi_SearchItem()"
|
|
|
|
|
style="margin-left: 10px;">
|
|
|
|
|
<el-option v-for="(item, index) in DialogSmallClassList" :key="index"
|
|
|
|
|
:label="item.item_class_name" :value="item.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-input v-model="HuChi_InputItem" placeholder="项目搜索" style="width: 200px;" />
|
|
|
|
|
<el-button type="success" style="margin-left: 8px;" @click="HuChi_SearchItem()">查询</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div style="padding-left: 40px;max-height: 400px;overflow-y:scroll;">
|
|
|
|
|
<el-checkbox-group v-model="HuChiCheckedItems" style="display: flex;flex-direction: column;">
|
|
|
|
|
<el-checkbox v-for="(item1,index1) in HuChiSelectItemList" :key="index1" :label="item1.item_code" >{{item1.item_name}}</el-checkbox>
|
|
|
|
|
</el-checkbox-group>
|
|
|
|
|
<el-checkbox v-for="(item1,index1) in HuChiSelectItemList" :key="index1"
|
|
|
|
|
:label="item1.item_code">{{item1.item_name}}</el-checkbox>
|
|
|
|
|
</el-checkbox-group>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="width: 100px;border-right: 1px solid #ccc;text-align: center;height:400px;line-height: 400px;">
|
|
|
|
|
<el-button type="primary" :icon="ArrowRight" circle @click="AddHuChiItem()" />
|
|
|
|
|
<div
|
|
|
|
|
style="width: 100px;border-right: 1px solid #ccc;text-align: center;height:400px;line-height: 400px;">
|
|
|
|
|
<el-button type="primary" :icon="ArrowRight" circle @click="AddHuChiItem()" />
|
|
|
|
|
</div>
|
|
|
|
|
<div style="width: 60%;padding-left: 20px;max-height: 450px;overflow-y:scroll;">
|
|
|
|
|
<div style="color: #999;margin-bottom: 4px;font-size: 12px;">已经存在互斥项({{itemHuChiList.length}})</div>
|
|
|
|
|
<table id="huchi_table" v-if="itemHuChiList.length>0">
|
|
|
|
|
<tr v-for="(item,index) in itemHuChiList" :key="index">
|
|
|
|
|
<td >{{item.code2_item_name}}</td>
|
|
|
|
|
<td ><el-input v-model="itemHuChiList[index].time" placeholder="时间,0为永久互斥" style="width: 150px;" /><span style="font-size: 12px;color:#bbb;"> 小时</span></td>
|
|
|
|
|
<td >
|
|
|
|
|
<td>{{item.code2_item_name}}</td>
|
|
|
|
|
<td><el-input v-model="itemHuChiList[index].time" placeholder="时间,0为永久互斥"
|
|
|
|
|
style="width: 150px;" /><span style="font-size: 12px;color:#bbb;"> 小时</span></td>
|
|
|
|
|
<td>
|
|
|
|
|
<span v-if="item.id" style="display: flex;">
|
|
|
|
|
<el-button type="danger" style="margin-left: 8px;" @click="HuChi_Del(item.id)">解除</el-button>
|
|
|
|
|
<el-button type="primary" style="margin-left: 8px;" @click="HuChi_Save(SelectedHuChiItemInfo.code,item.code2,itemHuChiList[index].time,item.id)">更新</el-button>
|
|
|
|
|
<el-button type="danger" style="margin-left: 8px;"
|
|
|
|
|
@click="HuChi_Del(item.id)">解除</el-button>
|
|
|
|
|
<el-button type="primary" style="margin-left: 8px;"
|
|
|
|
|
@click="HuChi_Save(SelectedHuChiItemInfo.code,item.code2,itemHuChiList[index].time,item.id)">更新</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
<span v-else style="display: flex;">
|
|
|
|
|
<el-button type="success" style="margin-left: 8px;" @click="HuChi_Save(SelectedHuChiItemInfo.code,item.code2,itemHuChiList[index].time)">保存</el-button>
|
|
|
|
|
<el-button style="margin-left: 8px;" @click="HuChi_YiChu(item)">移除</el-button>
|
|
|
|
|
<el-button type="success" style="margin-left: 8px;"
|
|
|
|
|
@click="HuChi_Save(SelectedHuChiItemInfo.code,item.code2,itemHuChiList[index].time)">保存</el-button>
|
|
|
|
|
<el-button style="margin-left: 8px;" @click="HuChi_YiChu(item)">移除</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
@ -164,17 +194,22 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<el-dialog v-model="HuChiSelectDialogVisible" :title="'为 '+SelectedHuChiItemInfo.name+' 设置互斥'" width="50%">
|
|
|
|
|
<div v-loading="HuChiLoading">
|
|
|
|
|
<span style="font-weight: 900;">设置互斥时间,单位小时,0为永久互斥</span>
|
|
|
|
|
<div class="row" v-for="(item,index) in HuChiSelectItemList" :key="index" >
|
|
|
|
|
<div style="margin-right: 12px;">{{SelectedHuChiItemInfo.name}} </div>
|
|
|
|
|
<el-icon><DArrowLeft /></el-icon><el-icon><DArrowRight /></el-icon>
|
|
|
|
|
<div style="margin-left: 12px; width: 250px;">{{item.item_name}} </div>
|
|
|
|
|
<el-input v-model="HuChi_InputTimeList[index]" placeholder="时间,0为永久互斥" style="width: 150px;" />
|
|
|
|
|
<el-button type="danger" style="margin-left: 8px;" @click="HuChi_Save(SelectedHuChiItemInfo.code,item.item_code,HuChi_InputTimeList[index])">添加</el-button>
|
|
|
|
|
<div class="row" v-for="(item,index) in HuChiSelectItemList" :key="index">
|
|
|
|
|
<div style="margin-right: 12px;">{{SelectedHuChiItemInfo.name}} </div>
|
|
|
|
|
<el-icon>
|
|
|
|
|
<DArrowLeft />
|
|
|
|
|
</el-icon><el-icon>
|
|
|
|
|
<DArrowRight />
|
|
|
|
|
</el-icon>
|
|
|
|
|
<div style="margin-left: 12px; width: 250px;">{{item.item_name}} </div>
|
|
|
|
|
<el-input v-model="HuChi_InputTimeList[index]" placeholder="时间,0为永久互斥" style="width: 150px;" />
|
|
|
|
|
<el-button type="danger" style="margin-left: 8px;"
|
|
|
|
|
@click="HuChi_Save(SelectedHuChiItemInfo.code,item.item_code,HuChi_InputTimeList[index])">添加</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
@ -182,7 +217,6 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
ref,
|
|
|
|
|
onMounted
|
|
|
|
|
@ -199,7 +233,8 @@
|
|
|
|
|
GetHuChiList
|
|
|
|
|
} from '@/api/api.js'
|
|
|
|
|
import {
|
|
|
|
|
ElMessage,ElMessageBox
|
|
|
|
|
ElMessage,
|
|
|
|
|
ElMessageBox
|
|
|
|
|
} from 'element-plus'
|
|
|
|
|
import {
|
|
|
|
|
ArrowRight
|
|
|
|
|
@ -219,21 +254,34 @@
|
|
|
|
|
limosis: '',
|
|
|
|
|
reservation_method: '',
|
|
|
|
|
check_time: '',
|
|
|
|
|
check_begin_time:'',
|
|
|
|
|
check_begin_time: '',
|
|
|
|
|
check_notice: ''
|
|
|
|
|
})
|
|
|
|
|
//获取检查项目类别list
|
|
|
|
|
let BigClassList = ref([]);
|
|
|
|
|
let SmallClassList = ref([]);
|
|
|
|
|
const GetItemClassList = () => {
|
|
|
|
|
let DialogBigClassList = ref([]);
|
|
|
|
|
let DialogSmallClassList = ref([]);
|
|
|
|
|
const GetItemClassList = (type='') => {
|
|
|
|
|
let searchData={}
|
|
|
|
|
searchData= { ...searchInfo.value }
|
|
|
|
|
if(type=='Dialog'){
|
|
|
|
|
searchData.bigClass=HuChi_bigClass.value
|
|
|
|
|
}
|
|
|
|
|
loading.value = true
|
|
|
|
|
GetCheckItemClassList({
|
|
|
|
|
searchInfo: searchInfo.value
|
|
|
|
|
searchInfo: searchData
|
|
|
|
|
}).then(res => {
|
|
|
|
|
loading.value = false
|
|
|
|
|
if (res.status) {
|
|
|
|
|
BigClassList.value = res.data.bigClass
|
|
|
|
|
SmallClassList.value = res.data.smallClass
|
|
|
|
|
if(type=='Dialog'){
|
|
|
|
|
DialogBigClassList.value = res.data.bigClass
|
|
|
|
|
DialogSmallClassList.value = res.data.smallClass
|
|
|
|
|
}else{
|
|
|
|
|
BigClassList.value = res.data.bigClass
|
|
|
|
|
SmallClassList.value = res.data.smallClass
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetItemList()
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.msg)
|
|
|
|
|
@ -256,7 +304,7 @@
|
|
|
|
|
}).then(res => {
|
|
|
|
|
loading.value = false
|
|
|
|
|
if (res.status) {
|
|
|
|
|
let list =res.data.list;
|
|
|
|
|
let list = res.data.list;
|
|
|
|
|
// list.forEach(function(v,i){
|
|
|
|
|
// if(v.reservation_method){
|
|
|
|
|
// list[i].reservation_method=v.reservation_method.split(",")
|
|
|
|
|
@ -332,8 +380,8 @@
|
|
|
|
|
selectedItemInfo.value.limosis = row.limosis
|
|
|
|
|
selectedItemInfo.value.reservation_method = row.reservation_method
|
|
|
|
|
selectedItemInfo.value.check_time = row.check_time
|
|
|
|
|
if(row.check_begin_time=='' || row.check_begin_time==null){
|
|
|
|
|
row.check_begin_time=0
|
|
|
|
|
if (row.check_begin_time == '' || row.check_begin_time == null) {
|
|
|
|
|
row.check_begin_time = 0
|
|
|
|
|
}
|
|
|
|
|
selectedItemInfo.value.check_begin_time = row.check_begin_time
|
|
|
|
|
selectedItemInfo.value.check_notice = row.check_notice
|
|
|
|
|
@ -351,7 +399,7 @@
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
//保存项目信息
|
|
|
|
|
const SaveItemInfoFunc = () => {
|
|
|
|
|
const SaveItemInfoFunc = () => {
|
|
|
|
|
SaveItemInfo({
|
|
|
|
|
Info: selectedItemInfo.value
|
|
|
|
|
}).then(res => {
|
|
|
|
|
@ -365,40 +413,47 @@
|
|
|
|
|
}
|
|
|
|
|
let HuChiDialogVisible = ref(false);
|
|
|
|
|
let HuChi_InputItem = ref('');
|
|
|
|
|
let HuChi_smallClass=ref(null);
|
|
|
|
|
let HuChi_bigClass=ref(null)
|
|
|
|
|
let HuChiSelectItemList = ref(null)
|
|
|
|
|
let HuChiSelectDialogVisible=ref(false);
|
|
|
|
|
let HuChi_InputTimeList=ref([]);//设置互斥时间
|
|
|
|
|
let HuChiLoading=ref(false);
|
|
|
|
|
let HuChiCheckedItems=ref([]);//左侧勾选的检查项目
|
|
|
|
|
let SelectedHuChiItemInfo=ref({
|
|
|
|
|
code:'',
|
|
|
|
|
name:''
|
|
|
|
|
let HuChiSelectDialogVisible = ref(false);
|
|
|
|
|
let HuChi_InputTimeList = ref([]); //设置互斥时间
|
|
|
|
|
let HuChiLoading = ref(false);
|
|
|
|
|
let HuChiCheckedItems = ref([]); //左侧勾选的检查项目
|
|
|
|
|
let SelectedHuChiItemInfo = ref({
|
|
|
|
|
code: '',
|
|
|
|
|
name: ''
|
|
|
|
|
})
|
|
|
|
|
const HuChi = (row) => {
|
|
|
|
|
HuChiDialogVisible.value = true
|
|
|
|
|
SelectedHuChiItemInfo.value.name = row.item_name
|
|
|
|
|
SelectedHuChiItemInfo.value.code = row.item_code
|
|
|
|
|
HuChiSelectItemList.value=[];
|
|
|
|
|
HuChi_InputItem.value='';
|
|
|
|
|
HuChiSelectItemList.value = [];
|
|
|
|
|
HuChi_InputItem.value = '';
|
|
|
|
|
GetItemClassList('Dialog')
|
|
|
|
|
HuChiList()
|
|
|
|
|
}
|
|
|
|
|
const HuChi_SearchItem = () => {
|
|
|
|
|
if(HuChi_InputItem.value=='' || HuChi_InputItem.value==null) return
|
|
|
|
|
HuChiLoading.value=true
|
|
|
|
|
HuChi_InputTimeList.value=[];
|
|
|
|
|
|
|
|
|
|
HuChiLoading.value = true
|
|
|
|
|
HuChi_InputTimeList.value = [];
|
|
|
|
|
GetCheckItemList({
|
|
|
|
|
searchInfo: {name:HuChi_InputItem.value},
|
|
|
|
|
searchInfo: {
|
|
|
|
|
name: HuChi_InputItem.value,
|
|
|
|
|
bigClass: HuChi_bigClass.value,
|
|
|
|
|
smallClass: HuChi_smallClass.value
|
|
|
|
|
},
|
|
|
|
|
page: 1,
|
|
|
|
|
pageSize: 100
|
|
|
|
|
}).then(res => {
|
|
|
|
|
HuChiLoading.value=false
|
|
|
|
|
HuChiLoading.value = false
|
|
|
|
|
if (res.status) {
|
|
|
|
|
if(res.data.list.length>0){
|
|
|
|
|
if (res.data.list.length > 0) {
|
|
|
|
|
HuChiSelectItemList.value = res.data.list
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error('未找到相关项目')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
@ -406,115 +461,121 @@
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
//向右侧添加项目
|
|
|
|
|
const AddHuChiItem=()=>{
|
|
|
|
|
const AddHuChiItem = () => {
|
|
|
|
|
console.log(HuChiCheckedItems.value);
|
|
|
|
|
//HuChiSelectItemList.value
|
|
|
|
|
let newArr = [];
|
|
|
|
|
let removedArr = [];
|
|
|
|
|
//检测右侧是否有将要移入的项目
|
|
|
|
|
let enable=true
|
|
|
|
|
itemHuChiList.value.forEach(function(v,i){
|
|
|
|
|
HuChiCheckedItems.value.forEach(function(v2,i2){
|
|
|
|
|
if(v.code2==v2){
|
|
|
|
|
ElMessage.error(v.code2_item_name+" 已经存在于右侧,不能重复添加")
|
|
|
|
|
enable=false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
if(!enable) return false;
|
|
|
|
|
|
|
|
|
|
HuChiSelectItemList.value.forEach(item => {
|
|
|
|
|
if (HuChiCheckedItems.value.includes(item.item_code)) {
|
|
|
|
|
itemHuChiList.value.push({code2:item.item_code,code2_item_name:item.item_name}); // 如果id在要移除的id列表中,将该项添加到removedArr
|
|
|
|
|
} else {
|
|
|
|
|
newArr.push(item); // 否则,将该项添加到newArr
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
HuChiSelectItemList.value=newArr;
|
|
|
|
|
|
|
|
|
|
console.log(removedArr);
|
|
|
|
|
console.log(itemHuChiList.value);
|
|
|
|
|
HuChiCheckedItems.value=[]
|
|
|
|
|
let newArr = [];
|
|
|
|
|
let removedArr = [];
|
|
|
|
|
//检测右侧是否有将要移入的项目
|
|
|
|
|
let enable = true
|
|
|
|
|
itemHuChiList.value.forEach(function(v, i) {
|
|
|
|
|
HuChiCheckedItems.value.forEach(function(v2, i2) {
|
|
|
|
|
if (v.code2 == v2) {
|
|
|
|
|
ElMessage.error(v.code2_item_name + " 已经存在于右侧,不能重复添加")
|
|
|
|
|
enable = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
if (!enable) return false;
|
|
|
|
|
|
|
|
|
|
HuChiSelectItemList.value.forEach(item => {
|
|
|
|
|
if (HuChiCheckedItems.value.includes(item.item_code)) {
|
|
|
|
|
itemHuChiList.value.push({
|
|
|
|
|
code2: item.item_code,
|
|
|
|
|
code2_item_name: item.item_name
|
|
|
|
|
}); // 如果id在要移除的id列表中,将该项添加到removedArr
|
|
|
|
|
} else {
|
|
|
|
|
newArr.push(item); // 否则,将该项添加到newArr
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
HuChiSelectItemList.value = newArr;
|
|
|
|
|
|
|
|
|
|
console.log(removedArr);
|
|
|
|
|
console.log(itemHuChiList.value);
|
|
|
|
|
HuChiCheckedItems.value = []
|
|
|
|
|
}
|
|
|
|
|
//移动回左侧
|
|
|
|
|
const HuChi_YiChu=(y_item)=>{
|
|
|
|
|
itemHuChiList.value=itemHuChiList.value.filter(item => item.code2 != y_item.code2);
|
|
|
|
|
if(!HuChiSelectItemList.value.find(item => item.item_code==y_item.code2)){
|
|
|
|
|
HuChiSelectItemList.value.push({item_code:y_item.code2,item_name:y_item.code2_item_name});
|
|
|
|
|
const HuChi_YiChu = (y_item) => {
|
|
|
|
|
itemHuChiList.value = itemHuChiList.value.filter(item => item.code2 != y_item.code2);
|
|
|
|
|
if (!HuChiSelectItemList.value.find(item => item.item_code == y_item.code2)) {
|
|
|
|
|
HuChiSelectItemList.value.push({
|
|
|
|
|
item_code: y_item.code2,
|
|
|
|
|
item_name: y_item.code2_item_name
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//保存互斥设置
|
|
|
|
|
const HuChi_Save=(code1,code2,time,id=0)=>{
|
|
|
|
|
HuChiLoading.value=true
|
|
|
|
|
const HuChi_Save = (code1, code2, time, id = 0) => {
|
|
|
|
|
HuChiLoading.value = true
|
|
|
|
|
SetHuChi({
|
|
|
|
|
id:id,
|
|
|
|
|
id: id,
|
|
|
|
|
code1: code1,
|
|
|
|
|
code2: code2,
|
|
|
|
|
time: time
|
|
|
|
|
}).then(res => {
|
|
|
|
|
HuChiLoading.value=false
|
|
|
|
|
HuChiLoading.value = false
|
|
|
|
|
if (res.status) {
|
|
|
|
|
ElMessage({
|
|
|
|
|
message: res.msg,
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: res.msg,
|
|
|
|
|
type: 'success',
|
|
|
|
|
})
|
|
|
|
|
itemHuChiList.value.forEach(function(v,i){
|
|
|
|
|
if(v.code2==res.data.code2){
|
|
|
|
|
itemHuChiList.value.forEach(function(v, i) {
|
|
|
|
|
if (v.code2 == res.data.code2) {
|
|
|
|
|
console.log(333);
|
|
|
|
|
itemHuChiList.value[i].id=res.data.id
|
|
|
|
|
itemHuChiList.value[i].id = res.data.id
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
//获取项目已经设置的互相列表
|
|
|
|
|
let itemHuChiList=ref([]);
|
|
|
|
|
const HuChiList=()=>{
|
|
|
|
|
HuChiLoading.value=true
|
|
|
|
|
let itemHuChiList = ref([]);
|
|
|
|
|
const HuChiList = () => {
|
|
|
|
|
HuChiLoading.value = true
|
|
|
|
|
GetHuChiList({
|
|
|
|
|
code: SelectedHuChiItemInfo.value.code
|
|
|
|
|
}).then(res => {
|
|
|
|
|
HuChiLoading.value=false
|
|
|
|
|
HuChiLoading.value = false
|
|
|
|
|
if (res.status) {
|
|
|
|
|
itemHuChiList.value=res.data
|
|
|
|
|
itemHuChiList.value = res.data
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
//解除互斥
|
|
|
|
|
const HuChi_Del=(id)=>{
|
|
|
|
|
const HuChi_Del = (id) => {
|
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
|
'确定解除此项互斥关系吗?',
|
|
|
|
|
'提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
.then(() => {
|
|
|
|
|
HuChiLoading.value=true
|
|
|
|
|
DelHuChi({
|
|
|
|
|
id:id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
HuChiLoading.value=false
|
|
|
|
|
if (res.status) {
|
|
|
|
|
ElMessage({
|
|
|
|
|
message: res.msg,
|
|
|
|
|
type: 'success',
|
|
|
|
|
})
|
|
|
|
|
HuChiList();
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
'确定解除此项互斥关系吗?',
|
|
|
|
|
'提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
.then(() => {
|
|
|
|
|
HuChiLoading.value = true
|
|
|
|
|
DelHuChi({
|
|
|
|
|
id: id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
HuChiLoading.value = false
|
|
|
|
|
if (res.status) {
|
|
|
|
|
ElMessage({
|
|
|
|
|
message: res.msg,
|
|
|
|
|
type: 'success',
|
|
|
|
|
})
|
|
|
|
|
HuChiList();
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
GetItemClassList()
|
|
|
|
|
@ -548,23 +609,27 @@
|
|
|
|
|
width: 100px;
|
|
|
|
|
text-align: left;
|
|
|
|
|
}
|
|
|
|
|
.col{
|
|
|
|
|
|
|
|
|
|
.col {
|
|
|
|
|
border: 1px solid #ddd;
|
|
|
|
|
padding: 4px;
|
|
|
|
|
width: 400px;
|
|
|
|
|
}
|
|
|
|
|
#huchi_table{
|
|
|
|
|
width: 100%;border: 1px solid #ccc;
|
|
|
|
|
border-collapse: collapse;
|
|
|
|
|
|
|
|
|
|
#huchi_table {
|
|
|
|
|
width: 100%;
|
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
|
border-collapse: collapse;
|
|
|
|
|
}
|
|
|
|
|
#huchi_table tr{
|
|
|
|
|
|
|
|
|
|
#huchi_table tr {
|
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#huchi_table td{
|
|
|
|
|
|
|
|
|
|
#huchi_table td {
|
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
|
padding: 4px 8px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|