hldy_app_mini/pages/procurement/addtory.vue

376 lines
8.3 KiB
Vue
Raw Normal View History

2025-12-12 14:41:44 +08:00
<template>
<view class="all-bgc">
2026-02-10 17:27:00 +08:00
<view class="tablist">
<view class="lefts">
<view class="pddl">盘点单</view>
<view class="pdh">{{pddobj.pddNo}}</view>
<view class="nms">{{pddobj.pddStartBy}} | {{pddobj.pddStartTime?.substring(0,10).replace(/-/g, '.')}}
</view>
<view class="shypk">
{{pddobj.nuName}}
</view>
2025-12-12 14:41:44 +08:00
</view>
<view class="rith">
<view class="left-selecttype">
<view :class="selectType===index?`selecttype-target`: `selecttype`"
2025-12-12 17:30:33 +08:00
v-for="(item,index) in ['全部','盘盈','盘亏','已盘点','未盘点']" @click="changetype(index)">
2025-12-12 14:41:44 +08:00
{{ item }}
</view>
<view class="heng-blue" :style="{ left: `${selectType === 0 ? 11.5 : 10.6 + selectType * 19}%` }">
</view>
</view>
2025-12-12 17:30:33 +08:00
<view class="pdbt">{{pddobj.pddType_dictText}}</view>
<!-- <view class="pdbt">{{已完成}}</view> -->
2025-12-12 14:41:44 +08:00
</view>
2026-02-10 17:27:00 +08:00
</view>
<view class="list">
<toryitem :pddlist="pddlist" @scrolltolower="scrolltolower" :pddType="pddobj?.pddType" :status="status"
@tabitem="tabitem" @right="right"></toryitem>
</view>
<view class="submit" v-if="pddobj.pddType=='1'">
<view @click="pddzfshow = true">取消盘点</view>
<view @click="subitshowing">提交盘点单</view>
</view>
<errorshow :show="openerror" :font="errmsg" @close="openerror=false" />
<pddsub :show="subitshow" :pddobj="pddobj" @close="subitshow=false"></pddsub>
<tanchuang :show="pddzfshow" font="确定要作废盘点单吗" @back="pddzfshow=false;" @right="pddzf"> </tanchuang>
2025-12-12 14:41:44 +08:00
</view>
</template>
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, computed, nextTick, watch, reactive } from 'vue';
2026-02-10 17:27:00 +08:00
import { onShow, onLoad, onHide, onPageScroll } from "@dcloudio/uni-app"
import { queryPddInfoList, editPddInfo, voidedPddMain } from './api/lunpan.js'
2025-12-12 14:41:44 +08:00
import toryitem from './common/toryitem.vue'
2025-12-15 17:13:43 +08:00
import pddsub from './common/pddsub.vue'
2025-12-12 14:41:44 +08:00
const leftscrolltop = ref(0)
2025-12-12 17:30:33 +08:00
const pddobj = ref({})
2025-12-15 17:13:43 +08:00
const openerror = ref(false)
const errmsg = ref('');
const subitshow = ref(false)
2025-12-16 08:48:22 +08:00
const pddzfshow = ref(false)
2025-12-12 14:41:44 +08:00
const selectType = ref(0)
2026-02-10 17:27:00 +08:00
const props = defineProps({
specialitem: {
type: Object
},
});
2025-12-12 14:41:44 +08:00
const changetype = (index : number) => {
if ((selectType.value == index) && index) {
return
}
leftscrolltop.value = 1
setTimeout(() => {
leftscrolltop.value = 0
}, 50)
2025-12-15 17:13:43 +08:00
selectType.value = index;
pageNo.value = 1;
pddlist.value = [];
2026-02-10 17:27:00 +08:00
uni.removeStorage({ key: 'valitem' })
2025-12-15 17:13:43 +08:00
pandian();
2025-12-12 17:30:33 +08:00
}
2026-02-10 17:27:00 +08:00
2025-12-12 17:30:33 +08:00
const pageNo = ref(1);
const status = ref('loadmore');
const pddlist = ref([]);
2026-02-10 17:27:00 +08:00
const pandian = () => {
2025-12-12 17:30:33 +08:00
let obj = {
2026-02-10 17:27:00 +08:00
pddId: pddobj.value.id,
paramType: selectType.value == 0 ? '' : selectType.value,
pageNo: pageNo.value,
pageSize: 10
2025-12-12 17:30:33 +08:00
}
2026-02-10 17:27:00 +08:00
queryPddInfoList(obj).then(res => {
res.result.records.forEach((item, i) => {
2025-12-15 17:13:43 +08:00
item.picPatharr = [];
item.zk = false;
2026-02-10 17:27:00 +08:00
item.yczk = false;
item.bz = false;
item.pz = false;
if (item.picPath != '' && item.picPath != null) {
2025-12-15 17:13:43 +08:00
item.picPatharr = item.picPath.split(",");
item.picPatharr = item.picPatharr.filter(item => item !== '');
}
2026-02-10 17:27:00 +08:00
2026-01-12 17:20:37 +08:00
})
2026-02-10 17:27:00 +08:00
2026-01-12 17:20:37 +08:00
pddlist.value.push(...res.result.records);
let s = Math.ceil(res.result.total / 3);
2026-02-10 17:27:00 +08:00
pddlist.value.forEach((item, i) => {
if (Math.ceil((i + 1) / 3) == s && s > 2) {
2025-12-15 17:13:43 +08:00
item.dczk = true;
}
})
2026-01-12 17:20:37 +08:00
status.value = (res.result.total == pddlist.value.length ? 'nomore' : 'loadmore');
2026-02-10 17:27:00 +08:00
2025-12-12 17:30:33 +08:00
})
}
2026-02-10 17:27:00 +08:00
const scrolltolower = () => {
if (status.value == 'loading' || status.value == 'nomore') { return }
2025-12-12 17:30:33 +08:00
status.value = 'loading'
pageNo.value++;
pandian()
2025-12-12 14:41:44 +08:00
}
2026-02-10 17:27:00 +08:00
const tabitem = (i, v) => {
2025-12-15 17:13:43 +08:00
pddlist.value[i] = v;
}
2026-02-10 17:27:00 +08:00
const right = (e, i) => {
2025-12-15 17:13:43 +08:00
let obj = {
2026-02-10 17:27:00 +08:00
id: e.id,
dqkcsl: e.dqkcsl,
pdsl: e.pdsl,
content: e.content,
picPath: e.picPath
2025-12-15 17:13:43 +08:00
}
2026-02-10 17:27:00 +08:00
editPddInfo(obj).then(res => {
if (res.success) {
2025-12-15 17:13:43 +08:00
res.result.zk = false;
2026-02-10 17:27:00 +08:00
res.result.yczk = false;
res.result.bz = false;
res.result.pz = false;
2025-12-15 17:13:43 +08:00
res.result.picPatharr = [];
2026-02-10 17:27:00 +08:00
if (res.result.picPath != '' && res.result.picPath != null) {
2025-12-15 17:13:43 +08:00
res.result.picPatharr = res.result.picPath.split(",");
res.result.picPatharr = res.result.picPatharr.filter(item => item !== '');
}
2026-02-10 17:27:00 +08:00
if (e.dczk == true) {
2025-12-16 11:26:01 +08:00
res.result.dczk = true;
}
2025-12-15 17:13:43 +08:00
pddlist.value[i] = res.result;
2026-02-10 17:27:00 +08:00
uni.removeStorage({ key: 'valitem' })
} else {
2025-12-15 17:13:43 +08:00
errmsg.value = res.message;
openerror.value = true;
}
})
}
2026-02-10 17:27:00 +08:00
const subitshowing = () => {
2025-12-15 17:13:43 +08:00
let obj = {
2026-02-10 17:27:00 +08:00
pddId: pddobj.value.id,
paramType: 4,
pageNo: -1,
pageSize: 10
2025-12-15 17:13:43 +08:00
}
2026-02-10 17:27:00 +08:00
queryPddInfoList(obj).then(res => {
if (res.result.total == 0) {
2025-12-15 17:13:43 +08:00
subitshow.value = true;
2026-02-10 17:27:00 +08:00
} else {
2025-12-15 17:13:43 +08:00
errmsg.value = '有未完成的盘点信息,不能提交盘点单';
openerror.value = true;
}
})
}
2026-02-10 17:27:00 +08:00
const pddzf = () => {
voidedPddMain({ id: pddobj.value.id }).then(res => {
if (res.success) {
2025-12-16 08:48:22 +08:00
pddzfshow.value = true;
2026-02-10 17:27:00 +08:00
setTimeout(() => {
2025-12-16 08:48:22 +08:00
uni.navigateBack()
2026-02-10 17:27:00 +08:00
}, 800)
} else {
2025-12-16 08:48:22 +08:00
errmsg.value = res.message;
openerror.value = true;
}
})
}
2026-02-10 17:27:00 +08:00
onMounted(() => {
pddobj.value = props.specialitem
pandian()
})
2025-12-12 14:41:44 +08:00
</script>
<style scoped lang="less">
2026-02-10 17:27:00 +08:00
.pdbt {
2025-12-12 14:53:37 +08:00
width: 7.1vw;
height: 3.2vw;
background: linear-gradient(0deg, #CAE0F9, #E9F4FF);
border-radius: 1.6vw;
2026-02-10 17:27:00 +08:00
border: 1px solid rgba(3, 133, 250, 0.34);
2025-12-12 14:53:37 +08:00
font-weight: 400;
font-size: 1.4vw;
color: #1083F8;
2026-02-10 17:27:00 +08:00
// margin-left: 0.7vw;
2025-12-12 14:53:37 +08:00
display: flex;
justify-content: center;
align-items: center;
2026-02-10 17:27:00 +08:00
margin-right: 2vw;
2025-12-12 14:53:37 +08:00
}
2026-02-10 17:27:00 +08:00
.submit {
width: 100.5%;
height: 4vw;
margin-top: 0.5vw;
padding-right: 0.7vw;
2025-12-12 14:41:44 +08:00
display: flex;
justify-content: flex-end;
2026-02-10 17:27:00 +08:00
align-items: center;
background-color: #fff;
border-radius: 35rpx;
view {
2025-12-12 14:41:44 +08:00
display: flex;
justify-content: center;
align-items: center;
2026-02-10 17:27:00 +08:00
&:nth-child(1) {
2025-12-12 14:41:44 +08:00
width: 8.7vw;
height: 3.2vw;
2026-02-10 17:27:00 +08:00
background: #fff;
2025-12-12 14:41:44 +08:00
border-radius: 1.6vw;
border: 1px solid #E5E5E5;
font-weight: 400;
font-size: 1.4vw;
color: #555555;
}
2026-02-10 17:27:00 +08:00
&:nth-child(2) {
2025-12-12 14:41:44 +08:00
width: 10.2vw;
height: 3.2vw;
background: linear-gradient(0deg, #CAE0F9, #E9F4FF);
border-radius: 1.6vw;
2026-02-10 17:27:00 +08:00
border: 1px solid rgba(3, 133, 250, 0.34);
2025-12-12 14:41:44 +08:00
font-weight: 400;
font-size: 1.4vw;
color: #1083F8;
margin-left: 0.7vw;
}
}
}
2026-02-10 17:27:00 +08:00
.list {
width: 91vw;
height: 53vw;
margin: 0vw auto 0;
2025-12-12 14:41:44 +08:00
overflow: hidden;
2026-02-10 17:27:00 +08:00
2025-12-12 14:41:44 +08:00
}
2026-02-10 17:27:00 +08:00
.tablist {
width: 91vw;
2025-12-12 14:41:44 +08:00
height: 3.3vw;
display: flex;
justify-content: space-between;
2026-02-10 17:27:00 +08:00
// padding: 0 2vw;
// margin-top: -3.3vw;
.rith {
2025-12-12 14:41:44 +08:00
.left-selecttype {
width: 30vw;
height: 70rpx;
border-radius: 40rpx;
// background-color: #FFFFFF;
display: flex;
padding-right: 30rpx;
padding-left: 15rpx;
position: relative;
2026-02-10 17:27:00 +08:00
2025-12-12 14:41:44 +08:00
.heng-blue {
position: absolute;
2026-02-10 17:27:00 +08:00
bottom: 3rpx;
2025-12-12 14:41:44 +08:00
left: 50%;
transform: translateX(-50%);
2026-02-10 17:27:00 +08:00
width: 30rpx;
height: 5rpx;
2025-12-12 14:41:44 +08:00
border-radius: 10rpx;
background-color: #1083F8;
transition: 0.3s all ease;
2026-02-10 17:27:00 +08:00
2025-12-12 14:41:44 +08:00
}
2026-02-10 17:27:00 +08:00
2025-12-12 14:41:44 +08:00
.selecttype {
width: 20%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
color: #999999;
font-size: 31rpx;
position: relative;
2026-02-10 17:27:00 +08:00
2025-12-12 14:41:44 +08:00
}
2026-02-10 17:27:00 +08:00
2025-12-12 14:41:44 +08:00
.selecttype-target {
width: 20%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
color: #222222;
font-size: 31rpx;
font-weight: 600;
position: relative;
}
}
}
2026-02-10 17:27:00 +08:00
.lefts {
height: 100%;
align-items: center;
.shypk {
// width: 7.5vw;
2025-12-12 14:41:44 +08:00
height: 2.3vw;
background: #DFEFFF;
border-radius: 0.5vw;
border: 1px solid #C7D2E4;
font-weight: 400;
font-size: 1.2vw;
2026-02-10 17:27:00 +08:00
padding: 0 15rpx;
2025-12-12 14:41:44 +08:00
color: #1083F8;
display: flex;
justify-content: center;
align-items: center;
margin-left: 0.9vw;
2026-02-10 17:27:00 +08:00
}
.nms {
font-weight: 400;
font-size: 1.3vw;
color: #222222;
margin-left: 1.3vw;
}
.pdh {
font-weight: bold;
font-size: 1.8vw;
color: #222222;
margin-left: 0.7vw;
}
.pddl {
width: 5.7vw;
height: 2.2vw;
background: #fff;
border-radius: 0.5vw;
font-weight: 400;
font-size: 1.4vw;
color: #555555;
display: flex;
justify-content: center;
align-items: center;
}
2025-12-12 14:41:44 +08:00
}
2026-02-10 17:27:00 +08:00
>view {
2025-12-12 14:41:44 +08:00
width: 50%;
display: flex;
2026-02-10 17:27:00 +08:00
&:nth-child(2) {
2025-12-12 14:41:44 +08:00
justify-content: flex-end;
}
}
}
2026-02-10 17:27:00 +08:00
2025-12-12 14:41:44 +08:00
.all-bgc {
2026-02-10 17:27:00 +08:00
width: 91vw;
2025-12-12 14:41:44 +08:00
height: 100vh;
2026-02-10 17:27:00 +08:00
padding: 0 1vw;
// background-color: red;
// padding-top: 2.5vh;
2025-12-12 14:41:44 +08:00
}
2026-02-10 17:27:00 +08:00
</style>