@@ -78,17 +78,45 @@
:active-value="1" :inactive-value="0" />
-
-
设为 {{item.name}}-{{item.count}}
-
-
-
{{item.time}}
-
+
+
+
批量勾选
+
+
+
总数:{{PlanCount}}
+
已使用:{{PlanUseCount}}
+
未使用:{{PlanUnuseCount}}
+
+
+
+
+
+
设为 {{item.name}}-{{item.count}}
+
+
+
+
+
+ 为 {{item.name}} 批量设置
+ 将{{item.name}}号源转换为其他类型
+
+
+ 批量 {{item.name}}-{{item.count}}
+
+
+
+
+
+
+
未选中则为预留号源
-
未选中则为预留号源
-
-
+
+ 为 {{SelectedPlanType.name}} 批量选择号源
+
+ 开始时间:
+
+
+
+ 号源间隔:
+
+
+ 号源数量: 需要勾选几个
+
+
+
+
+
+
+ 把{{SelectedPlanType.name}}号源转为:
+
+ 预留号
+
+
@@ -199,6 +263,18 @@
let currentPage = ref(1) //当前页码
let pageSize = ref(15) //每页数量
let total = 0 //总数量
+ let AutoSelectedStatus=ref(0);//自动批量勾选开关
+ let PiLiangDialogVisible=ref(false);
+ let ZhuanHuanDialogVisible=ref(false)
+ let PiLiangStep=ref('');
+ let PiLiangTimeListStart=ref('')
+ let PiLiangTimeListEnd=ref('')
+ let PiliangSelectedStartTime=ref('')//批量勾选时,选中的开始时间
+ let PiLiangJianGe=ref(0)//批量勾选时,间隔多少个号源勾选一次
+ let PiLiangNeedCount=ref(0)//批量勾选时,需要勾选几个
+ let PlanCount=ref(0)
+ let PlanUseCount=ref(0)
+ let PlanUnuseCount=ref(0)
const PageSizeChange = (e) => { // 修改每页数量
pageSize.value = e
GetList()
@@ -207,6 +283,11 @@
currentPage.value = e
GetList()
}
+ const SetPiLiangCanShu=(interval_time,start,end)=>{
+ PiLiangStep.value="00:"+interval_time
+ PiLiangTimeListStart.value=start
+ PiLiangTimeListEnd.value=end
+ }
const GetList = () => {
loading.value = true
PlanModelGetList({
@@ -235,6 +316,7 @@
dialogVisible.value = true
await GetPlanTypeList()
GetTimeList()
+
}
let PlabTypeList = ref([]); //所有可用的号源类型
const GetPlanTypeList = async () => {
@@ -304,7 +386,11 @@
}
timeList.value.push(time_obj)
})
- console.log('---------',PlabTypeList.value)
+ PlanCount.value=res.data.list.length
+ PlanUseCount.value=0;
+ PlanUnuseCount.value=0
+ SetPiLiangCanShu(Info.value.interval_time,Info.value.TimeRange[0],Info.value.TimeRange[1])
+
} else {
ElMessage.error(res.msg)
}
@@ -312,6 +398,10 @@
}
//点击时间
const TimeClick = (index) => {
+ if(AutoSelectedStatus.value===1){//自动勾选时禁止点击
+ ElMessage.error("请关闭 批量勾选")
+ return false
+ }
if (timeList.value[index].class == "timelist_button_selected") {
timeList.value[index].class = ""
timeList.value[index].type_color = null
@@ -348,6 +438,7 @@
}
})
}
+
const Edit = async(row) => {
dialogVisible.value = true
await GetPlanTypeList()
@@ -361,7 +452,11 @@
loading.value = false
if (res.status) {
Info.value = res.data
+ SetPiLiangCanShu(Info.value.interval_time,Info.value.start_time,Info.value.end_time)
//GetTimeList('detail')
+ PlanCount.value=Info.value.count
+ PlanUseCount.value=0
+ PlanUnuseCount.value=0
timeList.value=Info.value.list
timeList.value.forEach((v,i)=>{
PlabTypeList.value.forEach((t_v,t_i)=>{
@@ -371,6 +466,9 @@
})
if(v.type==1){
timeList.value[i].class = "timelist_button_selected"
+ PlanUseCount.value++
+ }else{
+ PlanUnuseCount.value++
}
})
} else {
@@ -451,7 +549,7 @@
})
return r_status;
}
- const SetPlanType=(item)=>{
+ const SetPlanType=(item)=>{
timeList.value.forEach((v,i)=>{
if(v.class == "timelist_button_selected" && v.type_color==null){
timeList.value[i].type_color =item.color
@@ -461,9 +559,96 @@
t_v.count++
}
})
+ PlanUseCount.value++
+ PlanUnuseCount.value--
}
})
}
+ let SelectedPlanType=ref(null)//批处理选中 要操作的号源类型
+ const PiLiangOpenFunc=(type)=>{
+ SelectedPlanType.value=type
+ PiLiangDialogVisible.value=true
+ }
+ const ZhuanHuanOpenFunc=(type)=>{
+ SelectedPlanType.value=type
+ ZhuanHuanDialogVisible.value=true
+ }
+ const PiLiangSelectFunc=()=>{
+ if(!!PiliangSelectedStartTime.value && !!PiLiangJianGe.value && !!PiLiangNeedCount.value){
+ let start_k=null
+ let j=0
+ let count=0
+ console.log('timeList.value:',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){
+ if( (v.type_color==null && j==0) || v.plan_type_id===SelectedPlanType.value.id){ //已经选中的同类型也算作数量
+ console.log(v.time)
+ if(count