diff --git a/admin/src/views/PlanMngr/PlanModel - 副本.vue b/admin/src/views/PlanMngr/PlanModel - 副本.vue new file mode 100644 index 0000000..bb65218 --- /dev/null +++ b/admin/src/views/PlanMngr/PlanModel - 副本.vue @@ -0,0 +1,546 @@ + + + + + \ No newline at end of file diff --git a/admin/src/views/PlanMngr/PlanModel.vue b/admin/src/views/PlanMngr/PlanModel.vue index bb65218..caa5c35 100644 --- a/admin/src/views/PlanMngr/PlanModel.vue +++ b/admin/src/views/PlanMngr/PlanModel.vue @@ -44,8 +44,8 @@ :page-sizes="[15, 50, 100, 200]" layout="total,sizes, prev, pager, next" :total="total" @size-change="PageSizeChange" @current-change="PageCurrentChange" /> - -
+ +
@@ -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.time}}
+
+
未选中则为预留号源
-
未选中则为预留号源
- -
+ +
{{SelectedPlanType.name}} 批量选择号源
+
+ 开始时间: + +
+
+ 号源间隔: +
+
+ 号源数量: 需要勾选几个 +
+ +
+ +
{{SelectedPlanType.name}}号源转为:
+
+
{{item.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{ + if(v.class == "timelist_button_selected" && v.type_color==null){ + timeList.value[i].class = "" + } + }) + ElMessage.error("剩余号源数量不足,请调整参数") + } + + }else{ + ElMessage.error("请设置全部参数") + } + } + const PiLiangZhuanFunc=(id,color)=>{ + + timeList.value.forEach((v,i)=>{ + if(v.plan_type_id==SelectedPlanType.value.id){ + if(id>0){ + timeList.value[i].class = "timelist_button_selected" + timeList.value[i].type_color =color + timeList.value[i].plan_type_id =id + } + if(id===0){ + timeList.value[i].class = "" + timeList.value[i].type_color =null + timeList.value[i].plan_type_id =null + PlanUseCount.value-- + PlanUnuseCount.value++ + } + PlabTypeList.value.forEach((t_v,t_i)=>{//新类型数量增加 + if(id==t_v.id){ + t_v.count++ + } + if(SelectedPlanType.value.id==t_v.id){ //之前的数量减少 + t_v.count-- + } + }) + } + + }) + ZhuanHuanDialogVisible.value=false; + + } onMounted(() => { GetList() }) @@ -528,6 +713,10 @@ background-color: #8fc2ff; color: #fff } + .mubankuang{ + margin-top: -30px; + margin-bottom: -30px; + } .plan_type_list{ display: flex; color: #fff; @@ -538,9 +727,28 @@ margin-left: 8px; cursor: pointer; } + .plan_type2{ + padding: 4px 8px; + border-radius: 6px; + margin-left: 8px; + cursor: pointer; + box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5); + } .TypeCount{ font-size: 14px; font-weight: 900; } + .button2{ + border: 1px solid #ccc; + width: 160px; + text-align: center; + padding: 4px; + border-radius: 4px; + background-color: #f4f4f4; + cursor: pointer; + } + .el-form-item{ + margin-bottom: 8px; + } \ No newline at end of file