This commit is contained in:
Teng 2025-11-18 15:59:01 +08:00
parent 4e0428b95b
commit c5266e9d7b
2 changed files with 241 additions and 43 deletions

View File

@ -1,7 +1,6 @@
<template>
<view v-if="visible" class="overlay" @touchmove.prevent.self>
<view class="box" :style="boxStyle" @touchstart.stop.prevent="onDragStartTouch"
@mousedown.stop.prevent="onDragStartMouse">
<view v-if="visible" class="overlay">
<view class="box" :style="boxStyle" >
<view class="header" ref="headerRef">
<view class="title">{{ title }}</view>
<view class="actions">
@ -349,6 +348,7 @@
}
function confirm() {
console.log("111")
const result = selectedIndexes.value.map((idx, ci) => {
const col = rawColumns.value[ci] || [];
const display = (displayColumns.value[ci] && displayColumns.value[ci][idx] !== undefined) ?
@ -360,6 +360,7 @@
display
};
});
emit('confirm', result);
visible.value = false;
}

View File

@ -4,8 +4,32 @@
class="mengban"
@click="moreindex=-1; topbuttontarget=-1;openjianhuo=false;opengaijia=false;opendata=false;opencgr=false">
</view>
<!-- 给模糊搜索用的 -->
<view v-show="filteredCgrListsecond.length&&gysvalue" class="mengban" @click="closefilteredCgrListsecond"></view>
<view class="input-next" style="bottom: 450rpx;" v-if="filteredCgrListsecond.length && gysvalue">
<view v-show="filteredCgrListsecond[0].suppliersName!=`暂无数据`" class="next-father"
v-for="(item, index) in filteredCgrListsecond.slice(0, 5)" :key="index" @click="clickfilteredCgrListsecond(item,index)">
{{ item.suppliersName }}
</view>
<view class="nomessage" v-if="filteredCgrListsecond[0].suppliersName===`暂无数据`">
暂无数据
</view>
</view>
<!-- 给模糊搜索用的 -->
<view v-show="filteredCgrList.length&&cgrvalue" class="mengban" @click="closefilteredCgrList"></view>
<view class="input-next" v-if="filteredCgrList.length && cgrvalue">
<view v-show="filteredCgrList[0].cgBy!=`暂无数据`" class="next-father"
v-for="(item, index) in filteredCgrList.slice(0, 5)" :key="index" @click="clickfilteredCgrList(item)">
{{ item.cgBy }}
</view>
<view class="nomessage" v-if="filteredCgrList[0].cgBy===`暂无数据`">
暂无数据
</view>
</view>
<!-- 日期 -->
<view class="calendar-father" v-show="opendata">
<view class="calendar-father" v-show="opendata" v-if="xiaohui">
<calendar @datachange="dateget" />
</view>
<!-- 改价 -->
@ -27,11 +51,11 @@
</view>
<view style="position: absolute;right: 30rpx;bottom: 30rpx;">
<view style="display: flex;">
<view
<view
style="width: 160rpx;height: 75rpx;background-color: #ebeced;color: #888888;display: flex;justify-content: center;align-items: center;font-size: 30rpx;border-radius: 40rpx;">
取消
</view>
<view
<view
style="width: 160rpx;height: 75rpx;;color: #0385FA;display: flex;justify-content: center;align-items: center;font-size: 30rpx;border-radius: 40rpx;border: 1rpx solid #0385FA;background: linear-gradient(to bottom,#E9F4FF,#CAE0F9);margin: 0 40rpx;">
确定
</view>
@ -343,10 +367,10 @@
<view class="contain-left">
<view class="left-select-more" v-show="openselect">
<view class="more-bottom">
<view class="bottom-left">
<view class="bottom-left" @click="chongzhi">
重置
</view>
<view class="bottom-right">
<view class="bottom-right" @click="openselect=false">
确定
<text style="font-size: 25rpx;margin-top: 5rpx;" v-if="alltotal>=99">
(99+采购单)
@ -399,18 +423,19 @@
采购人
</view>
<view class="more-time-select" @click="opencgr=true">
<view class="more-gray" style="margin-left: 30rpx;">
请输入采购人
</view>
<input class="more-gray" v-model="cgrvalue" placeholder="请输入采购人" placeholder-style="color: #BFBFBF;"
style="margin-left: 30rpx;width: 400rpx;" @input="changeArray"></input>
<image class="select-img" src="/static/index/warehouse/procurement/picking/center.png" />
</view>
<view class="more-select">
供应商
</view>
<view class="more-time-select" @click="opengys=true">
<view class="more-gray" style="margin-left: 30rpx;">
<!-- <view class="more-gray" style="margin-left: 30rpx;">
请输入供应商
</view>
</view> -->
<input class="more-gray" v-model="gysvalue" placeholder="请输入供应商" placeholder-style="color: #BFBFBF;"
style="margin-left: 30rpx;width: 400rpx;" @input="changeArraysecond"></input>
<image class="select-img" src="/static/index/warehouse/procurement/picking/center.png" />
</view>
</view>
@ -610,12 +635,12 @@
</view>
</view>
<view class="contain-right-middle">
<scroll-view scroll-x="true" class="middle-Y" >
<scroll-view scroll-x="true" class="middle-Y">
<view class="middle-Y-father">
<view class="middle-one" v-for="(v,i) in InvoicingList" :key='i'
:style="{border: middletarget === i? '4rpx solid #1083F8': '4rpx solid transparent'}"
@click="clickmiddle(i)">
<view :class="v.status<2?`up-tags-target`: `up-tags`" >
<view :class="v.status<2?`up-tags-target`: `up-tags`">
{{v.status_dictText}}
</view>
<image class="middle-img"
@ -733,14 +758,18 @@
<view style="width: 95%;height: 0.5rpx; background-color: #eff1f3;margin-left: 5%;"></view>
<view class="right-bottom" v-show="!typechange">
<view class="right-bottom-left">
<image class="left-img"
<image class="left-img"
:src="showvalue?.materialImg?serverUrl + showvalue?.materialImg : '/static/zhiniaoku.png'"
mode="aspectFill"></image>
<view class="left-tags">
<view class="tags-one" v-if="showvalue.categoryId_dictText">{{showvalue.categoryId_dictText}}</view>
<view class="tags-one" v-if="showvalue.categoryId_dictText">
{{showvalue.categoryId_dictText}}
</view>
<view class="tags-one" v-if="showvalue.typeId_dictText">{{showvalue.typeId_dictText}}</view>
<view class="tags-one" v-if="showvalue.medicationId_dictText">{{showvalue.medicationId_dictText}}</view>
<view class="tags-one" v-if="showvalue.medicationId_dictText">
{{showvalue.medicationId_dictText}}
</view>
</view>
</view>
<view class="right-bottom-right">
@ -1012,8 +1041,8 @@
</view>
<!-- <u-select v-model="opencgr" :list="cgrlist" label-name="cgBy" value-name="cgBy" ></u-select> -->
<!-- <u-select v-model="opengys" :list="gyslist" label-name="suppliersName" value-name="suppliers" ></u-select> -->
<superpicker v-model:modelValue="opengys" :columns="[gyslist]" nameKey="suppliersName" :init-left="80" :init-top="120" :init-width="360"
:init-height="360" @close="opengys=false" @confirm="gysclick" />
<!-- <superpicker v-model:modelValue="opengys" :columns="[gyslist]" nameKey="suppliersName" :init-left="80" :init-top="120" :init-width="360"
:init-height="360" @close="opengys=false" @confirm="gysclick" /> -->
</view>
</template>
@ -1022,34 +1051,159 @@
import { queryInvoicingList, getCgdMaterialTreeData, queryNuInfoByNuId, updateKfstatus, queryCgdList, queryCgdInfoList, queryWlInfoByWlId, voidedCgdMain, getCgrLis, getGysList } from './api/lunpan.js'
import { onShow, onLoad, onHide, onPageScroll } from "@dcloudio/uni-app"
import calendar from '@/component/public/calendar.vue'
import superpicker from '@/component/public/superpicker.vue'
// import superpicker from '@/component/public/superpicker.vue'
const typechange = ref(0);
const serverUrl = ref("");
const opengaijia = ref(false);
const openjianhuo = ref(false);
const opendata = ref(false);
//
//
const filteredCgrList = ref([]);
const closefilteredCgrList = () => {
filteredCgrList.value = [];
cgrvalue.value = plzinfo.cgBy;
}
const clickfilteredCgrList = (item : any) => {
filteredCgrList.value = [];
plzinfo.cgBy = item.cgBy
cgrvalue.value = plzinfo.cgBy;
search()
}
// --- ---
function fuzzyMatch(text : unknown, q : string) {
const s = String(text ?? '').toLowerCase()
const ql = String(q ?? '').toLowerCase().trim()
if (!ql) return true
if (s.includes(ql)) return true
// subsequence
let i = 0
for (let j = 0; j < s.length && i < ql.length; j++) {
if (s[j] === ql[i]) i++
}
return i === ql.length
}
// --- 0.3 ---
let debounceTimer : number | null = null
/**
* changeArray - 防抖搜索0.3 秒后无再次输入才执行
*/
function changeArray(res : any) {
if (!res.detail.value) {
plzinfo.cgBy = "";
filteredCgrList.value = [];
search()
return
}
const keyword = String(
typeof res === 'string' ? res : res?.detail?.value ?? ''
).trim()
//
if (debounceTimer) clearTimeout(debounceTimer)
// 300ms
debounceTimer = setTimeout(() => {
if (!keyword) {
filteredCgrList.value = cgrlist.value.slice()
return
}
filteredCgrList.value = cgrlist.value.filter(item =>
fuzzyMatch(item?.cgBy, keyword)
)
filteredCgrList.value = [...filteredCgrList.value, ...filteredCgrList.value, ...filteredCgrList.value, ...filteredCgrList.value, ...filteredCgrList.value]
if (!filteredCgrList.value.length) {
filteredCgrList.value.push({ cgBy: `暂无数据` })
}
}, 300)
}
//
const filteredCgrListsecond = ref([]);
const secondindex = ref(-1)
const gysclick = (res:any) => {
console.log("///",res);
opengys.value=false;
const closefilteredCgrListsecond = () => {
filteredCgrListsecond.value = [];
gysvalue.value = "";
plzinfo.suppliers = "";
search()
}
const clickfilteredCgrListsecond = (item : any,index:number) => {
filteredCgrListsecond.value = [];
plzinfo.suppliers = item.suppliers;
gysvalue.value = item.suppliersName;
secondindex.value = index;
search()
}
// --- ---
// function fuzzyMatch(text : unknown, q : string) {
// const s = String(text ?? '').toLowerCase()
// const ql = String(q ?? '').toLowerCase().trim()
// if (!ql) return true
// if (s.includes(ql)) return true
// // subsequence
// let i = 0
// for (let j = 0; j < s.length && i < ql.length; j++) {
// if (s[j] === ql[i]) i++
// }
// return i === ql.length
// }
// // --- 0.3 ---
// let debounceTimer : number | null = null
/**
* changeArray - 防抖搜索0.3 秒后无再次输入才执行
*/
function changeArraysecond(res : any) {
if (!res.detail.value) {
plzinfo.suppliers = "";
filteredCgrListsecond.value = [];
secondindex.value = -1;
gysvalue.value = "";
search()
return
}
const keyword = String(
typeof res === 'string' ? res : res?.detail?.value ?? ''
).trim()
//
if (debounceTimer) clearTimeout(debounceTimer)
// 300ms
debounceTimer = setTimeout(() => {
if (!keyword) {
filteredCgrListsecond.value = gyslist.value.slice()
return
}
filteredCgrListsecond.value = gyslist.value.filter(item =>
fuzzyMatch(item?.suppliersName, keyword)
)
// filteredCgrListsecond.value = [...filteredCgrListsecond.value, ...filteredCgrListsecond.value, ...filteredCgrListsecond.value, ...filteredCgrList.value, ...filteredCgrList.value]
if (!filteredCgrListsecond.value.length) {
filteredCgrListsecond.value.push({ suppliersName: `暂无数据` })
}
}, 300)
}
const openjianhuoclick = () => {
openjianhuo.value = true;
donghuaopo.value = false;
setTimeout(() => {
donghuaopo.value = true;
}, 100)
}
const opengaijiaclick = () => {
opengaijia.value = true;
donghuaopo.value = false;
setTimeout(() => {
donghuaopo.value = true;
}, 100)
}
onLoad(() => {
firstgetqueryCgdList();
serverUrl.value = uni.getStorageSync('serverUrl') + '/sys/common/static/';
@ -1057,6 +1211,8 @@
})
const opencgr = ref(false);
const opengys = ref(false);
const cgrvalue = ref("");
const gysvalue = ref("");
const cgrlist = ref([]);
const gyslist = ref([]);
@ -1064,10 +1220,11 @@
const getSelectList = () => {
getCgrLis().then((res : any) => {
cgrlist.value = res.result;
console.log("采购人", res)
})
getGysList().then((res : any) => {
gyslist.value = res.result;
console.log("isright",res)
console.log("供应商", res)
})
}
@ -1210,7 +1367,17 @@
cgdId: "",
isWaring: 0
}
const tagsArray = [`待入库`,`挂账中`, `已入库`, `已销账`, ]
//
const xiaohui = ref(true);
const chongzhi = () => {
xiaohui.value = false;
setTimeout(()=>{
xiaohui.value = true;
},300)
Object.assign(plzinfo, mobanplzinfo);
search()
}
const tagsArray = [`待入库`, `挂账中`, `已入库`, `已销账`,]
const clickmiddle = (index : number) => {
middletarget.value = index;
showvalue.value = InvoicingList.value[index];
@ -1224,7 +1391,7 @@
// InvoicingList.value.push(...res.result.records);
// }
console.log(res.result.records)
// console.log(res.result.records)
InvoicingList.value.push(...res.result.records);
clickmiddle(0);
@ -1515,7 +1682,7 @@
position: relative;
.more-gray {
color: #BFBFBF;
color: #cacaca;
font-size: 30rpx;
width: 200rpx;
display: flex;
@ -2039,6 +2206,7 @@
display: none;
}
}
.right-bottom {
width: 100%;
height: 600rpx;
@ -2686,4 +2854,33 @@
background-color: #fff;
z-index: 999;
}
.input-next {
position: fixed;
bottom: 660rpx;
left: 40rpx;
width: 610rpx;
// height: 300rpx;
border-radius: 30rpx;
z-index: 999;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
padding: 40rpx 30rpx;
.next-father {
color: #999;
margin: 10rpx;
font-size: 28rpx;
}
}
.nomessage {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 200rpx;
font-size: 34rpx;
color: #999;
}
</style>