|
|
|
|
@ -201,7 +201,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<el-dialog v-model="PiLiangDialogVisible" >
|
|
|
|
|
<div style="margin-top: -30px;font-size: 16px;margin-bottom: 10px;font-weight: 700;">为 <span style="color: #00aeb7;font-weight: 900;">{{SelectedPlanType.name}}</span> 批量选择号源</div>
|
|
|
|
|
<div style="margin-top: -30px;font-size: 16px;margin-bottom: 10px;font-weight: 700;">为 <span style="color: #00aeb7;font-weight: 900;"><span v-if="ToPlanType!==null">{{ToPlanType.name}}</span><span v-else>{{SelectedPlanType.name}}</span></span> 批量选择号源</div>
|
|
|
|
|
<div style="margin-bottom: 10px;">
|
|
|
|
|
开始时间:
|
|
|
|
|
<el-time-select
|
|
|
|
|
@ -210,8 +210,17 @@
|
|
|
|
|
:start="PiLiangTimeListStart"
|
|
|
|
|
:step="PiLiangStep"
|
|
|
|
|
:end="PiLiangTimeListEnd"
|
|
|
|
|
placeholder="Select time"
|
|
|
|
|
placeholder="开始时间"
|
|
|
|
|
/>
|
|
|
|
|
结束时间:
|
|
|
|
|
<el-time-select
|
|
|
|
|
v-model="PiliangSelectedEndTime"
|
|
|
|
|
style="width: 240px"
|
|
|
|
|
:start="PiLiangTimeListStart"
|
|
|
|
|
:step="PiLiangStep"
|
|
|
|
|
:end="PiLiangTimeListEnd"
|
|
|
|
|
placeholder="结束时间"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin-bottom: 10px;">
|
|
|
|
|
号源间隔:<el-input-number v-model="PiLiangJianGe" :min="1" :max="10" />
|
|
|
|
|
@ -228,12 +237,30 @@
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<el-dialog v-model="ZhuanHuanDialogVisible" style="width: 200px;" >
|
|
|
|
|
<el-dialog v-model="ZhuanHuanDialogVisible" style="width: 400px;" >
|
|
|
|
|
<div style="margin-top: -30px;font-size: 16px;margin-bottom: 10px;font-weight: 700;">把<span style="color: #00aeb7;font-weight: 900;">{{SelectedPlanType.name}}</span>号源转为:</div>
|
|
|
|
|
<div style="margin-bottom: 10px;" v-for="(item,index) in PlabTypeList" :key="index">
|
|
|
|
|
<div class="button2" :style="'background-color:'+ item.color" v-if="item.id != SelectedPlanType.id" @click="PiLiangZhuanFunc(item.id,item.color)">{{item.name}}</div>
|
|
|
|
|
<div style=" display: flex;" v-if="item.id != SelectedPlanType.id">
|
|
|
|
|
<div class="button2" :style="'background-color:'+ item.color" >{{item.name}}</div>
|
|
|
|
|
<el-button type="primary" @click="PiLiangZhuanFunc(item.id,item.color)">
|
|
|
|
|
全部转换
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="primary" @click="PiLiangOpenFunc2(item)">
|
|
|
|
|
批量勾选
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div class="button2" @click="PiLiangZhuanFunc(0,null)">预留号</div>
|
|
|
|
|
<div style=" display: flex;">
|
|
|
|
|
<div class="button2" >预留号</div>
|
|
|
|
|
<el-button type="primary" @click="PiLiangZhuanFunc(0,null)">
|
|
|
|
|
全部转换
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="primary" @click="PiLiangOpenFunc2()">
|
|
|
|
|
批量勾选
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
@ -270,6 +297,7 @@
|
|
|
|
|
let PiLiangTimeListStart=ref('')
|
|
|
|
|
let PiLiangTimeListEnd=ref('')
|
|
|
|
|
let PiliangSelectedStartTime=ref('')//批量勾选时,选中的开始时间
|
|
|
|
|
let PiliangSelectedEndTime=ref('')//批量勾选时,选中的结束时间
|
|
|
|
|
let PiLiangJianGe=ref(0)//批量勾选时,间隔多少个号源勾选一次
|
|
|
|
|
let PiLiangNeedCount=ref(0)//批量勾选时,需要勾选几个
|
|
|
|
|
let PlanCount=ref(0)
|
|
|
|
|
@ -578,14 +606,24 @@
|
|
|
|
|
}
|
|
|
|
|
let SelectedPlanType=ref(null)//批处理选中 要操作的号源类型
|
|
|
|
|
const PiLiangOpenFunc=(type)=>{
|
|
|
|
|
ToPlanType.value=null
|
|
|
|
|
SelectedPlanType.value=type
|
|
|
|
|
PiLiangDialogVisible.value=true
|
|
|
|
|
}
|
|
|
|
|
let ToPlanType=ref(null)
|
|
|
|
|
const PiLiangOpenFunc2=(type)=>{ //从原来类型转换为目标类型,记录目标类型
|
|
|
|
|
ToPlanType.value=type
|
|
|
|
|
PiLiangDialogVisible.value=true
|
|
|
|
|
}
|
|
|
|
|
const ZhuanHuanOpenFunc=(type)=>{
|
|
|
|
|
SelectedPlanType.value=type
|
|
|
|
|
ZhuanHuanDialogVisible.value=true
|
|
|
|
|
}
|
|
|
|
|
const PiLiangSelectFunc=()=>{
|
|
|
|
|
if(ToPlanType.value!==null){
|
|
|
|
|
PiLiangSelectFunc2()
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
if(!!PiliangSelectedStartTime.value && !!PiLiangJianGe.value && !!PiLiangNeedCount.value){
|
|
|
|
|
let start_k=null
|
|
|
|
|
let j=0
|
|
|
|
|
@ -596,7 +634,7 @@
|
|
|
|
|
if(v.time==PiliangSelectedStartTime.value+':00' || v.time==PiliangSelectedStartTime.value){
|
|
|
|
|
start_k=i
|
|
|
|
|
}
|
|
|
|
|
if(start_k !==null){
|
|
|
|
|
if(start_k !==null && (v.time<=PiliangSelectedEndTime.value+':00' || v.time<=PiliangSelectedEndTime.value)){
|
|
|
|
|
if( (v.type_color==null && j==0) || v.plan_type_id===SelectedPlanType.value.id){ //已经选中的同类型也算作数量
|
|
|
|
|
console.log(v.time)
|
|
|
|
|
if(count<PiLiangNeedCount.value){
|
|
|
|
|
@ -631,6 +669,63 @@
|
|
|
|
|
ElMessage.error("请设置全部参数")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const PiLiangSelectFunc2=()=>{ //选定一种类型,只勾选此类型的号源,根据参数 转为目标类型
|
|
|
|
|
|
|
|
|
|
if(!!PiliangSelectedStartTime.value && !!PiLiangJianGe.value && !!PiLiangNeedCount.value){
|
|
|
|
|
let start_k=null
|
|
|
|
|
let j=0
|
|
|
|
|
let count=0
|
|
|
|
|
console.log('timeList.value:',timeList.value)
|
|
|
|
|
|
|
|
|
|
const originalTimeList = JSON.parse(JSON.stringify(timeList.value));//深度拷贝原始号源列表
|
|
|
|
|
timeList.value.forEach((v,i)=>{
|
|
|
|
|
if(v.type_color==undefined) v.type_color=null
|
|
|
|
|
if(v.time==PiliangSelectedStartTime.value+':00' || v.time==PiliangSelectedStartTime.value){
|
|
|
|
|
start_k=i
|
|
|
|
|
}
|
|
|
|
|
if(start_k !==null && (v.time<=PiliangSelectedEndTime.value+':00' || v.time<=PiliangSelectedEndTime.value)){
|
|
|
|
|
if( (v.plan_type_id==SelectedPlanType.value.id && j==0) || v.plan_type_id===ToPlanType.value.id){ //已经选中的同类型也算作数量
|
|
|
|
|
console.log(v.time)
|
|
|
|
|
if(count<PiLiangNeedCount.value){
|
|
|
|
|
|
|
|
|
|
timeList.value[i].class = "timelist_button_selected"
|
|
|
|
|
timeList.value[i].type_color =ToPlanType.value.color
|
|
|
|
|
timeList.value[i].plan_type_id =ToPlanType.value.id
|
|
|
|
|
count++
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
j++
|
|
|
|
|
if(j%PiLiangJianGe.value===0){
|
|
|
|
|
j=0
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if(count==PiLiangNeedCount.value){
|
|
|
|
|
PlabTypeList.value.forEach((t_v,t_i)=>{//新类型数量增加
|
|
|
|
|
if(ToPlanType.value.id==t_v.id){
|
|
|
|
|
t_v.count=t_v.count+count
|
|
|
|
|
}
|
|
|
|
|
if(SelectedPlanType.value.id==t_v.id){ //之前的数量减少
|
|
|
|
|
t_v.count=t_v.count-count
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
PiLiangDialogVisible.value=false
|
|
|
|
|
ZhuanHuanDialogVisible.value=false
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
console.log('count:',count)
|
|
|
|
|
console.log('need:',PiLiangNeedCount.value)
|
|
|
|
|
timeList.value = originalTimeList;//还原
|
|
|
|
|
ElMessage.error("剩余号源数量不足,请调整参数")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
ElMessage.error("请设置全部参数")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const PiLiangZhuanFunc=(id,color)=>{
|
|
|
|
|
|
|
|
|
|
timeList.value.forEach((v,i)=>{
|
|
|
|
|
@ -758,7 +853,7 @@
|
|
|
|
|
padding: 4px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
background-color: #f4f4f4;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
/* cursor: pointer; */
|
|
|
|
|
}
|
|
|
|
|
.el-form-item{
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
|