提交 5589801b 编写于 作者: 刘英杰's avatar 刘英杰

20241010 申请活动》物资排版优化〉基本完成,剩下一点,需要排查

上级 d0009b1e
流水线 #29740 已通过 ,包含阶段
in 34 second
...@@ -127,6 +127,7 @@ ...@@ -127,6 +127,7 @@
</van-radio-group> </van-radio-group>
</template> </template>
</van-field> </van-field>
<!-- 物资--> <!-- 物资-->
<van-field <van-field
v-if="init.radio === '1'" v-if="init.radio === '1'"
...@@ -140,12 +141,17 @@ ...@@ -140,12 +141,17 @@
:error-message="init.commodityTextError" :error-message="init.commodityTextError"
/> />
<van-cell v-if="init.radio === '1'"> <van-cell v-if="init.radio === '1'">
{{ init.commodityText }} <!-- {{ init.commodityText }}-->
<van-tag class="mx-1" color="#EEF9FF" text-color="#2D8FFF" v-for="(item,index) in init.commoditySelectArray" :key="index" closeable size="medium" type="primary" @close="closeTag(item,index)">
{{item.commodity_name}}
</van-tag>
</van-cell> </van-cell>
<cs-pop-up :show="init.commodity" position="bottom"> <cs-pop-up :show="init.commodity" position="bottom">
<template #content> <template #content>
<div class="w-full h-[90%] bg-gray-100 overflow-y-auto "> <div class="w-full h-[90%] bg-gray-100 overflow-y-auto ">
<Tree :data="init.commodityArray" show-checkbox @on-check-change="checkChange"></Tree> <Tree :key="asc" :data="init.commodityArray" show-checkbox @on-check-change="checkChange"></Tree>
</div> </div>
<div class="w-full h-[10%] flex items-center justify-center p-3 shadow-gray-600 shadow"> <div class="w-full h-[10%] flex items-center justify-center p-3 shadow-gray-600 shadow">
<van-button class="w-[95%]" round @click="init.commodity = false">关闭</van-button> <van-button class="w-[95%]" round @click="init.commodity = false">关闭</van-button>
...@@ -187,7 +193,8 @@ import * as hooks from '../../../../hooks/index.js' ...@@ -187,7 +193,8 @@ import * as hooks from '../../../../hooks/index.js'
import * as _ from 'lodash' import * as _ from 'lodash'
const asc = getCurrentInstance().appContext.config.globalProperties const asc = getCurrentInstance().appContext.config.globalProperties
const init = reactive({ let init = reactive({
error: '', error: '',
radio: '1', radio: '1',
...@@ -207,6 +214,7 @@ const init = reactive({ ...@@ -207,6 +214,7 @@ const init = reactive({
beginTimeText: '', beginTimeText: '',
endTimeText: '', endTimeText: '',
commodityText: '', commodityText: '',
timeRangeTextError: '', timeRangeTextError: '',
dateTextError: "", dateTextError: "",
placeTypeTextError: '', placeTypeTextError: '',
...@@ -220,6 +228,7 @@ const init = reactive({ ...@@ -220,6 +228,7 @@ const init = reactive({
beginTimeArray: '', beginTimeArray: '',
endTimeArray: '', endTimeArray: '',
commodityArray: [], commodityArray: [],
commoditySelectArray: [],
minDateStart: '', minDateStart: '',
maxDateStart: '', maxDateStart: '',
}) })
...@@ -303,6 +312,7 @@ function checkChange(all, item) { ...@@ -303,6 +312,7 @@ function checkChange(all, item) {
/*checkTreeArray.value = all /*checkTreeArray.value = all
checkTreeArray.value.splice(checkTreeArray.value.indexOf('1001'), 1) checkTreeArray.value.splice(checkTreeArray.value.indexOf('1001'), 1)
console.log("🚀🚀checkTreeArray.value🚀,", checkTreeArray.value)*/ console.log("🚀🚀checkTreeArray.value🚀,", checkTreeArray.value)*/
//选中物资树遍历获取ID //选中物资树遍历获取ID
let array = [] let array = []
init.commodityText = '' init.commodityText = ''
...@@ -313,35 +323,37 @@ function checkChange(all, item) { ...@@ -313,35 +323,37 @@ function checkChange(all, item) {
}) })
formValidate.data.commodity_list = array formValidate.data.commodity_list = array
} }
init.commoditySelectArray = all
console.log("🚀🚀🚀,",init.commoditySelectArray)
console.log("🚀all🚀🚀,",all);
console.log("🚀🚀🚀,",formValidate.data.commodity_list);
} }
function closeTag(item,index){
//关闭物资标签
function recursiveMethod(array1){
return array1.map((cur, ind) => {
if (cur.children.length !==0)cur.children = recursiveMethod(cur.children);
if (item.id === cur.id) delete cur.checked
return {
...cur,
}
})
}
console.log("🚀🚀recursiveMethod(init.commodityArray)🚀,",recursiveMethod(init.commodityArray))
let a= recursiveMethod(init.commodityArray)
console.log("🚀init.commodityArray🚀🚀,",a)
init.commodityArray = JSON.parse(JSON.stringify(a))
console.log("🚀🚀init.comm11odityArray🚀,",init.commodityArray)
}
function aaa(e, i) { function aaa(e, i) {
//1.push选中总数组索
//自定义下标数组 判断 i 是否存在 是则删除 否则 插入下标
// check.data.bs_arr.includes(i) ? check.data.bs_arr.splice(check.data.bs_arr.indexOf(i), 1) : check.data.bs_arr.push(i);
//
// console.log(11111, check.data.bs_arr)
// //2.排序
// check.data.bs_arr.sort(function (a, b) {
// return a - b;
// });
//
//
// //3.判断数组是否连续 自定义下标数组
// if (isConsecutive(check.data.bs_arr)) {
// if (check.data.bs_arr.length > 1) alert("连续的,很棒!!!")
// // check.data.checked.push(e);
// } else {
// console.log('check.data.bs_arr', check.data.bs_arr)
// //删除自定义数组
// check.data.bs_arr = check.data.bs_arr.splice(check.data.bs_arr.length, 1);
// check.data.checked.splice(check.data.checked.length - 1, 1);
// alert("@@@不连续,不是我想要的,呜呜呜呜~")
// }
// console.log('原数组', check.data.checked)
// console.log('@@@新数组', check.data.bs_arr)
//
// check.data.checked.push(e)
if (String(e.occupy_flag) === String(0)) { if (String(e.occupy_flag) === String(0)) {
if (check.data.checked.length >= 1) { if (check.data.checked.length >= 1) {
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或