<template>
|
<view>
|
<uni-popup ref="popup" type="bottom" @change="popupChangeHandler">
|
<view class="content">
|
<view class="search-condition">
|
<view class="title"><text>日期: </text></view>
|
<view class="daterange" style="flex: 1;">
|
<view class="right general">
|
<uni-datetime-picker type="date" :clear-icon="false" v-model="HBeginDate">
|
<view>{{HBeginDate}}</view>
|
</uni-datetime-picker>
|
</view>
|
<view>—</view>
|
<view class="right general">
|
<uni-datetime-picker type="date" :clear-icon="false" v-model="HEndDate">
|
<view>{{HEndDate}}</view>
|
</uni-datetime-picker>
|
</view>
|
</view>
|
</view>
|
<view class="search-condition">
|
<view class="title"><text>物料编码: </text></view>
|
<view class="right"><input type="text" v-model="HCode" @confirm="getBillList" /></view>
|
</view>
|
<view class="search-condition">
|
<view class="title"><text>业务状态: </text></view>
|
<view class="right">
|
<uni-combox :candidates="HStatusList" v-model="HStatus"></uni-combox>
|
</view>
|
</view>
|
<view class="buttons">
|
<button size="mini" type="primary" @click="search">查询</button>
|
<view style="flex: 1;"></view>
|
<button size="mini" type="primary" @click="exit">退出</button>
|
</view>
|
<scroll-view id="#BillListPanel" scroll-y="true" style="height: 55vh;">
|
<view class="options-wrapper" v-show="HBillList.length != 0">
|
<uni-card :is-active="bill.isActive" :class="bill.isActive?'uni-card--is-active':''"
|
v-for="(bill, index) in HBillList" :key="index" :title="bill['日期']" :extra="`${bill['日期']}`"
|
@tap="clickCard(bill, index)">
|
<view class="item-wrapper">
|
<view class="item" v-if="bill['单据状态']">
|
<view class="left">单据状态: </view>
|
<view class="right">{{bill['单据状态']}}</view>
|
</view>
|
<view class="item" v-if="bill['状态']">
|
<view class="left" >状态: </view>
|
<view class="right">{{bill['状态']}}</view>
|
</view>
|
<view class="item" v-if="bill['领料状态']">
|
<view class="left" >领料状态: </view>
|
<view class="right">{{bill['领料状态']}}</view>
|
</view>
|
<view class="item" v-if="bill['是否排产']">
|
<view class="left" >是否排产: </view>
|
<view class="right">{{bill['是否排产']}}</view>
|
</view>
|
<view class="item" v-if="bill['已汇报数量']">
|
<view class="left" >已汇报数量: </view>
|
<view class="right">{{bill['已汇报数量']}}</view>
|
</view>
|
<view class="item" v-if="bill['已汇报审核数量']">
|
<view class="left" >已汇报审核数量: </view>
|
<view class="right">{{bill['已汇报审核数量']}}</view>
|
</view>
|
<view class="item" v-if="bill['工艺路线代码']">
|
<view class="left" >工艺路线代码: </view>
|
<view class="right">{{bill['工艺路线代码']}}</view>
|
</view>
|
<view class="item" v-if="bill['工艺路线']">
|
<view class="left" >工艺路线: </view>
|
<view class="right">{{bill['工艺路线']}}</view>
|
</view>
|
<view class="item" v-if="bill['齐套数量']">
|
<view class="left" >齐套数量: </view>
|
<view class="right">{{bill['齐套数量']}}</view>
|
</view>
|
<view class="item" v-if="bill['产品代码']">
|
<view class="left">产品代码: </view>
|
<view class="right">{{bill['产品代码']}}</view>
|
</view>
|
<view class="item" v-if="bill['产品名称']">
|
<view class="left" >产品名称: </view>
|
<view class="right">{{bill['产品名称']}}</view>
|
</view>
|
<view class="item" v-if="bill['规格型号']">
|
<view class="left">规格型号: </view>
|
<view class="right">{{bill['规格型号']}}</view>
|
</view>
|
<view class="item" v-if="bill['计量单位代码']">
|
<view class="left" >计量单位代码: </view>
|
<view class="right">{{bill['计量单位代码']}}</view>
|
</view>
|
<view class="item" v-if="bill['计量单位']">
|
<view class="left">计量单位: </view>
|
<view class="right">{{bill['计量单位']}}</view>
|
</view>
|
<view class="item" v-if="bill['生产任务单数量']">
|
<view class="left">生产任务单数量: </view>
|
<view class="right">{{bill['生产任务单数量']}}</view>
|
</view>
|
<view class="item" v-if="bill['流转卡数量']">
|
<view class="left">流转卡数量: </view>
|
<view class="right">{{bill['流转卡数量']}}</view>
|
</view>
|
</view>
|
</uni-card>
|
</view>
|
<view class="over" v-show="HBillList.length == 0">暂无数据</view>
|
</scroll-view>
|
<uni-pagination id="#pagination" title="标题文字" v-model="curPage" :pageSize="size" :total="length"
|
@update:modelValue="pageUpdate"></uni-pagination>
|
</view>
|
|
</uni-popup>
|
</view>
|
</template>
|
|
<script>
|
import dayjs from 'dayjs';
|
import {
|
CommonUtils
|
} from '@/utils/common';
|
import {
|
getUserInfo
|
} from '@/utils/auth';
|
export default {
|
name: "SampleSchemePopup",
|
emits: ["update:modelValue"],
|
data() {
|
return {
|
dayjs: dayjs,
|
enablefocus: false,
|
size: 20,
|
curPage: 1,
|
length: 0,
|
page: 0,
|
HStatus: '开工',
|
HStatusList: ['开工', '计划', '计划确认', '下达', '全部', '完工', '结案'],
|
HCode: '',
|
HBillList: [],
|
HBeginDate: dayjs(new Date()).subtract(30, 'd').format("YYYY-MM-DD"),
|
HEndDate: dayjs(new Date()).format("YYYY-MM-DD"),
|
panelHeight: 0,
|
|
multiSouceBillList: []
|
};
|
},
|
props: {
|
bindKey: {
|
type: [String, Number],
|
required: true
|
},
|
HStockOrgID: {
|
type: [String, Number],
|
},
|
},
|
methods: {
|
async pageUpdate(e) {
|
console.log('e: ', e);
|
this.curPage = e
|
await this.$nextTick()
|
this.getBillList()
|
},
|
popupChangeHandler(e) {
|
if (e.show === true) {
|
this.getBillList()
|
}
|
},
|
async exit() {
|
this.size = 20
|
this.curPage = 1
|
this.length = 0
|
this.page = 0
|
this.HSourceBillNo = ''
|
this.HMater = ''
|
this.HCustom = ''
|
this.HBillList = []
|
this.enablefocus = false
|
this.multiSouceBillList = []
|
// 需要等待页面内的数据赋值完毕
|
await this.$nextTick()
|
this.$refs.popup.close();
|
},
|
search() {
|
this.getBillList()
|
},
|
showPopup() {
|
this.$refs.popup.open();
|
},
|
clickCard(bill, index) {
|
let retVal = {}
|
retVal[this.bindKey] = bill
|
console.log('retVal: ', retVal);
|
this.$emit("update", {
|
retVal: retVal
|
})
|
},
|
getsWhere() {
|
let sWhere =
|
` and 单据状态 = '已审核' and 行状态 = '' and HPRDORGID = '${uni.getStorageSync("OrganizationID")}'`
|
|
if (this.HBeginDate && this.HEndDate) {
|
sWhere += ` and CONVERT(varchar(100),日期, 23) between '${this.HBeginDate}' and '${this.HEndDate}'`
|
}
|
if (this.HCode) {
|
sWhere += ` and 物料编码 like '%${this.HCode}%'`
|
}
|
if (this.HStatus) {
|
sWhere += ` and 状态 like '%${this.HStatus}%'`
|
}
|
return sWhere
|
},
|
getBillList() {
|
this.HBillList = []
|
this.length = this.length || 0
|
this.page = 0
|
this.curPage = this.curPage || 1
|
CommonUtils.doRequest(
|
"/LEMS/MES_IF_ICMOBillList_Json_byPage", {
|
sWhere: this.getsWhere(),
|
user: getUserInfo()['Czymc'],
|
Organization: uni.getStorageSync("Organization"),
|
page: this.curPage,
|
size: this.size
|
},
|
(res) => {
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count > 0) {
|
this.length = count
|
// const result = [];
|
// for (let i = 0; i < data.length; i += this.size) {
|
// result.push(data.slice(i, i + this.size));
|
// }
|
this.HBillList = data
|
// this.page = result.length
|
setTimeout(() => {
|
this.enablefocus = true
|
}, 500)
|
} else {
|
setTimeout(() => {
|
this.enablefocus = true
|
}, 500)
|
uni.showToast({
|
icon: 'none',
|
title: Message
|
})
|
}
|
}
|
)
|
},
|
},
|
}
|
</script>
|
|
<style lang="scss">
|
button {}
|
|
.content {
|
box-sizing: border-box;
|
border-radius: 15rpx 15rpx 0 0;
|
padding: 20rpx 20rpx 40rpx 20rpx;
|
background-color: #fff;
|
display: flex;
|
flex-direction: column;
|
gap: 10rpx;
|
|
.search-condition {
|
display: flex;
|
flex-direction: row;
|
align-items: center;
|
gap: 20rpx;
|
font-size: 30rpx;
|
|
.title {
|
width: 5rem;
|
text-align: right;
|
}
|
|
.right {
|
flex: 1;
|
border-radius: 22rpx;
|
border: 1px solid #acacac;
|
height: auto;
|
padding: 8rpx 16rpx;
|
|
input {
|
width: 100%;
|
font-size: 30rpx;
|
}
|
|
.uni-combox {
|
padding: 0;
|
height: auto;
|
|
.uni-input-placeholder,
|
.uni-input-input {
|
font-size: 26rpx;
|
}
|
}
|
}
|
}
|
|
.buttons {
|
display: flex;
|
flex-direction: row;
|
gap: 20rpx;
|
justify-content: flex-end;
|
|
>button {
|
display: inline-flex;
|
width: 4rem;
|
}
|
}
|
|
.options-wrapper {
|
padding: 20rpx;
|
display: flex;
|
flex-direction: column;
|
gap: 20rpx;
|
|
.item-wrapper {
|
display: flex;
|
flex-direction: row;
|
flex-wrap: wrap;
|
gap: 8rpx 0;
|
}
|
|
view {
|
margin: 0 !important;
|
box-sizing: border-box;
|
|
}
|
|
.item {
|
display: flex;
|
flex-direction: row;
|
align-items: center;
|
|
.left {
|
padding: 0 20rpx;
|
}
|
|
.right {}
|
}
|
}
|
|
.uni-card--is-active {
|
background-color: rgba(0, 122, 255, 0.2);
|
}
|
|
.daterange {
|
display: flex;
|
flex-direction: row;
|
gap: 10rpx;
|
justify-content: center;
|
align-items: center;
|
|
}
|
}
|
</style>
|