<template>
|
<view class="page" id="pageContent">
|
<view class="search-condition-zone">
|
<view class="form-item">
|
<view class="left">
|
日期:
|
</view>
|
<view class="daterange" style="flex: 1;">
|
<view class="right general">
|
<uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HBeginDate">
|
<view>{{hform.HBeginDate}}</view>
|
</uni-datetime-picker>
|
</view>
|
<view>—</view>
|
<view class="right general">
|
<uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HEndDate">
|
<view>{{hform.HEndDate}}</view>
|
</uni-datetime-picker>
|
</view>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="left">
|
器具编码:
|
</view>
|
<view class="right general">
|
<input type="text" v-model="hform.HMoNumber" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="left">
|
器具名称:
|
</view>
|
<view class="right general">
|
<input type="text" v-model="hform.HMoName" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="left">
|
单据号:
|
</view>
|
<view class="right general">
|
<input type="text" v-model="hform.HBillNo" />
|
</view>
|
</view>
|
</view>
|
<view class="button-zone">
|
<button type="default" class="btn-a" size="mini" @tap="cmdAdd">新增</button>
|
<button type="default" class="btn-a" size="mini" @tap="cmdSearch">查询</button>
|
<button type="default" class="btn-c" size="mini" @tap="exit">退出</button>
|
</view>
|
<view class="info-list-zone" id="scroll-content" :style="{height: scrollContentHeight + 'px'}">
|
<view class="card-item" v-for="(item, index) in listDataShow">
|
<uni-card :title="item['单据号']" :extra="'日期:' + item['日期'].split('T')[0]"
|
@tap="showDetail = showDetail==index?-1:index">
|
<view class="card-detail">
|
<view class="detail" v-if="item['发现人代码']">
|
<text>发现人代码:</text>{{item['发现人代码']}}
|
</view>
|
<view class="detail" v-if="item['发现人']">
|
<text>发现人:</text>{{item['发现人']}}
|
</view>
|
<view class="detail" v-if="item['故障类别代码']">
|
<text>故障类别代码:</text>{{item['故障类别代码']}}
|
</view>
|
<view class="detail" v-if="item['故障类别']">
|
<text>故障类别:</text>{{item['故障类别']}}
|
</view>
|
<view class="detail" v-if="item['负责人代码']">
|
<text>负责人代码:</text>{{item['负责人代码']}}
|
</view>
|
<view class="detail" v-if="item['负责人']">
|
<text>负责人:</text>{{item['负责人']}}
|
</view>
|
</view>
|
<view class="card-detail" v-if="showDetail == index">
|
<view class="detail" v-if="item.使用部门代码">
|
<text>使用部门代码:</text>{{item.使用部门代码}}
|
</view>
|
<view class="detail" v-if="item.使用部门">
|
<text>使用部门:</text>{{item.使用部门}}
|
</view>
|
<view class="detail" v-if="item.产品模具代码">
|
<text>器具编码:</text>{{item.产品模具代码}}
|
</view>
|
<view class="detail" v-if="item.产品模具">
|
<text>产品器具:</text>{{item.产品模具}}
|
</view>
|
<view class="detail" v-if="item.模具规格">
|
<text>器具规格:</text>{{item.模具规格}}
|
</view>
|
<view class="detail" v-if="item.模具型号">
|
<text>器具型号:</text>{{item.模具型号}}
|
</view>
|
<view class="detail" v-if="item.故障发生日期">
|
<text>故障发生日期:</text>{{item.故障发生日期.split("T")[0]}}
|
</view>
|
<view class="detail" v-if="item.要求完善日期">
|
<text>要求完善日期:</text>{{item.要求完善日期.split("T")[0]}}
|
</view>
|
<view class="detail" v-if="item.摘要">
|
<text>摘要:</text>{{item.摘要}}
|
</view>
|
<view class="detail" v-if="item.内部单据号">
|
<text>内部单据号:</text>{{item.内部单据号}}
|
</view>
|
<view class="detail" v-if="item.故障描述">
|
<text>故障描述:</text>{{item.故障描述}}
|
</view>
|
<view class="detail" v-if="item.备注">
|
<text>备注:</text>{{item.备注}}
|
</view>
|
<view class="detail" v-if="item.故障原因代码">
|
<text>故障原因代码:</text>{{item.故障原因代码}}
|
</view>
|
<view class="detail" v-if="item.故障原因">
|
<text>故障原因:</text>{{item.故障原因}}
|
</view>
|
<view class="detail" v-if="item.故障原因描述">
|
<text>故障原因描述:</text>{{item.故障原因描述}}
|
</view>
|
<view class="detail" v-if="item.子负责人代码">
|
<text>子负责人代码:</text>{{item.子负责人代码}}
|
</view>
|
<view class="detail" v-if="item.子负责人">
|
<text>子负责人:</text>{{item.子负责人}}
|
</view>
|
<view class="detail" v-if="item.关联数量">
|
<text>关联数量:</text>{{item.关联数量}}
|
</view>
|
<view class="detail" v-if="item.行关闭人">
|
<text>行关闭人:</text>{{item.行关闭人}}
|
</view>
|
<view class="detail" v-if="item.关闭类型">
|
<text>关闭类型:</text>{{item.关闭类型}}
|
</view>
|
<view class="detail" v-if="item.制单人">
|
<text>制单人:</text>{{item.制单人}}
|
</view>
|
<view class="detail" v-if="item.制单日期">
|
<text>制单日期:</text>{{item.制单日期.split('T')[0]}}
|
</view>
|
<view class="detail" v-if="item.修改人">
|
<text>修改人:</text>{{item.修改人}}
|
</view>
|
<view class="detail" v-if="item.修改日期">
|
<text>修改日期:</text>{{item.修改日期.split('T')[0]}}
|
</view>
|
<view class="detail" v-if="item.关闭人">
|
<text>关闭人:</text>{{item.关闭人}}
|
</view>
|
<view class="detail" v-if="item.关闭日期">
|
<text>关闭日期:</text>{{item.关闭日期.split('T')[0]}}
|
</view>
|
<view class="detail" v-if="item.作废人">
|
<text>作废人:</text>{{item.作废人}}
|
</view>
|
<view class="detail" v-if="item.作废日期">
|
<text>作废日期:</text>{{item.作废日期.split('T')[0]}}
|
</view>
|
<view class="detail" v-if="item.源单单号">
|
<text>源单单号:</text>{{item.源单单号}}
|
</view>
|
<view class="detail" v-if="item.源单类型">
|
<text>源单类型:</text>{{item.源单类型}}
|
</view>
|
</view>
|
<view class="more" v-if="showDetail == index && operations != index">
|
<view class="part" style="border-right: 1px solid #eee;">
|
<uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>收起
|
</view>
|
<view class="part" @tap.stop="operations = operations==index?-1:index">
|
<uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;"
|
size="14"></uni-icons>操作
|
</view>
|
</view>
|
<view class="more" v-if="showDetail != index && operations != index">
|
<view class="part" style="border-right: 1px solid #eee;">
|
<uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>更多信息
|
</view>
|
<view class="part" @tap.stop="operations = operations==index?-1:index">
|
<uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;"
|
size="14"></uni-icons>操作
|
</view>
|
</view>
|
<view class="op" v-if="operations == index">
|
<!-- <button class="op3" size="mini" plain @tap.stop="edit(item)">编辑</button> -->
|
<button class="op4" size="mini" plain @tap.stop="del(item)">删除</button>
|
<button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button>
|
</view>
|
</uni-card>
|
</view>
|
<view class="over" v-if="listDataShow.length == 0">暂无数据</view>
|
</view>
|
|
<view class="pagination-zone" id="pagination-zone">
|
<uni-pagination show-icon :page-size="paginationMeta.pageSize" :total="paginationMeta.total"
|
:current="paginationMeta.current" @change="onPaginationChangeHandler"></uni-pagination>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import {
|
CommonUtils
|
} from '../../../utils/common'
|
import {
|
getUserInfo
|
} from '../../../utils/auth'
|
import dayjs, {
|
Dayjs
|
} from 'dayjs'
|
export default {
|
data() {
|
return {
|
|
navHeight: 0,
|
scrollTop: 0,
|
|
showDetail: -1,
|
operations: -1,
|
|
hform: {
|
HBeginDate: dayjs(new Date).subtract(30, 'd').format('YYYY-MM-DD'),
|
HEndDate: dayjs(new Date).format('YYYY-MM-DD'),
|
HMoNumber: '',
|
HMoName: '',
|
HBillNo: ''
|
},
|
|
paginationMeta: {
|
current: 1,
|
total: 0,
|
pageSize: 30,
|
},
|
|
pageMeta: {
|
scrollContentTop: 0,
|
bottomBtnTop: 0,
|
},
|
|
listData: [],
|
listDataShow: [],
|
}
|
},
|
computed: {
|
scrollContentHeight: {
|
get() {
|
return this.pageMeta.bottomBtnTop - this.pageMeta.scrollContentTop
|
}
|
}
|
},
|
methods: {
|
exit() {
|
uni.navigateBack()
|
},
|
cmdAdd() {
|
uni.navigateTo({
|
url: "/pages/MJGL/Sc_MouldConkBookBill/Sc_MouldConkBookBill?operationType=1"
|
})
|
},
|
async cmdSearch() {
|
let sWhere = ''
|
if (this.hform.HBeginDate != "" && this.hform.HEndDate != "") {
|
sWhere += " and CONVERT(varchar(100),日期, 23) between '" + this.hform.HBeginDate + "' and '" +
|
this.hform.HEndDate + "' ";
|
}
|
if (this.hform.HMoNumber != "") {
|
sWhere += " and 产品模具代码 like '%" + this.hform.HMoNumber + "%'"
|
}
|
if (this.hform.HMoName != "") {
|
sWhere += " and 产品模具 like '%" + this.hform.HMoName + "%'"
|
}
|
if (this.hform.HBillNo != "") {
|
sWhere += " and 单据号 like '%" + this.hform.HBillNo + "%'"
|
}
|
try {
|
let res = await CommonUtils.doRequest2Sync({
|
url: '/Sc_MouldConkBookBill/GetMouldConkBookBillList_PDA',
|
data: {
|
"sWhere": sWhere,
|
"user": getUserInfo()["Czymc"]
|
},
|
})
|
|
if (!res) {
|
return
|
}
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count > 0) {
|
this.listData = data
|
this.paginationMeta.total = data.length
|
this.onPaginationChangeHandler({
|
current: 1
|
})
|
} else {
|
uni.showToast({
|
icon: 'none',
|
title: Message
|
})
|
}
|
} catch (err) {
|
console.warn(err);
|
uni.showToast({
|
title: '接口请求失败:' + err,
|
icon: 'none'
|
})
|
}
|
},
|
async onPaginationChangeHandler({
|
current
|
}) {
|
this.listDataShow =
|
this.listData.slice((current - 1) * this.paginationMeta.pageSize,
|
current * this.paginationMeta.pageSize)
|
|
},
|
async del(item) {
|
console.log("delItem: ", item);
|
uni.showModal({
|
title: '提示',
|
content: '确认要删除记录?删除后不能恢复',
|
success: async (res) => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
try {
|
let res = await CommonUtils.doRequest2Sync({
|
url: '/Sc_MouldConkBookBill/DeltetMouldConkBookBill',
|
data: {
|
"HInterID": item.hmainid,
|
"user": getUserInfo()["Czymc"]
|
}
|
})
|
|
if (!res) {
|
return
|
}
|
|
let {
|
count,
|
code,
|
Message
|
} = res.data
|
if (count == 0) {
|
return uni.showModal({
|
title: '错误提示',
|
content: `删除错误: ${Message}`,
|
showCancel: false
|
})
|
}
|
uni.showToast({
|
title: '删除成功',
|
icon: 'none'
|
})
|
this.cmdSearch()
|
} catch (err) {
|
uni.showModal({
|
title: '错误提示',
|
content: `接口请求失败: ${err}`,
|
showCancel: false
|
})
|
}
|
}
|
},
|
})
|
|
},
|
edit(item) {
|
console.log("editItem:", item)
|
uni.navigateTo({
|
url: `/pages/qijvguzhangdengji/mouldMistakeBill?operationType=2&linterid=${item.hmainid}&hsubid=${item.hsubid}`
|
})
|
}
|
},
|
onLoad() {
|
|
this.$nextTick(() => {
|
this.cmdSearch()
|
})
|
},
|
onReady() {
|
// #ifndef MP-WEIXIN
|
let query = uni.createSelectorQuery().in(this)
|
query.select("#scroll-content").boundingClientRect((data) => {
|
this.pageMeta.scrollContentTop = data.top
|
}).exec()
|
query.select("#pagination-zone").boundingClientRect((data) => {
|
this.pageMeta.bottomBtnTop = data.top
|
}).exec()
|
// #endif
|
// #ifdef MP-WEIXIN
|
// 微信不支持 uni.createSelectorQuery().in(this)
|
// #endif
|
|
},
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.page {
|
box-sizing: border-box;
|
display: flex;
|
flex-direction: column;
|
gap: 20rpx;
|
padding: 20rpx 0;
|
position: relative;
|
|
.button-zone {
|
height: auto;
|
box-sizing: border-box;
|
padding-top: 20rpx;
|
display: flex;
|
flex-direction: row;
|
justify-content: space-between;
|
flex-wrap: wrap;
|
|
button {
|
border-radius: 50rpx;
|
width: 180rpx;
|
height: 66rpx;
|
line-height: 66rpx;
|
font-size: 28rpx;
|
}
|
|
.btn-a {
|
background-color: #3a78ff;
|
color: #fff;
|
}
|
|
.btn-c {
|
background-color: #ff5722;
|
color: #fff;
|
}
|
}
|
|
.search-condition-zone {
|
height: auto;
|
box-sizing: border-box;
|
padding: 0 60rpx;
|
display: flex;
|
flex-direction: column;
|
gap: 20rpx;
|
|
.form-item {
|
display: flex;
|
flex-direction: row;
|
gap: 20rpx;
|
align-items: center;
|
font-size: 28rpx;
|
|
.left {
|
width: 4rem;
|
}
|
|
.right {
|
flex: 1;
|
padding: 8rpx 16rpx;
|
|
.search {
|
width: 28rpx;
|
height: 28rpx;
|
}
|
|
input {
|
font-size: 28rpx;
|
}
|
|
.uni-combox {
|
padding: 0;
|
margin: 0;
|
|
::v-deep .uni-combox__input {
|
font-size: 28rpx;
|
height: auto;
|
}
|
}
|
}
|
|
.general {
|
border-radius: 22rpx;
|
border: 1px solid #acacac;
|
}
|
|
.disabled {
|
border-radius: 22rpx;
|
border: 1px solid #e4e4e4;
|
background-color: #e4e4e4;
|
}
|
}
|
}
|
|
.info-list-zone {
|
overflow-y: auto;
|
|
.card-item {
|
.card-detail {
|
width: 100%;
|
display: flex;
|
flex-wrap: wrap;
|
justify-content: space-between;
|
line-height: 120%;
|
|
.detail {
|
// width: 50%;
|
font-size: 26rpx;
|
margin-bottom: 12rpx;
|
color: #555;
|
margin-right: 20rpx;
|
|
text {
|
color: #999;
|
font-size: 26rpx;
|
}
|
}
|
}
|
}
|
}
|
|
.daterange {
|
display: flex;
|
flex-direction: row;
|
gap: 10rpx;
|
justify-content: center;
|
align-items: center;
|
}
|
|
.more {
|
color: #888;
|
font-size: 24rpx;
|
display: flex;
|
border-top: 1px solid #eee;
|
padding-top: 20rpx;
|
|
.part {
|
width: 50%;
|
text-align: center;
|
}
|
}
|
|
.op {
|
display: flex;
|
justify-content: space-around;
|
margin-top: 20rpx;
|
|
button {
|
padding: 0;
|
width: 150rpx;
|
font-size: 25rpx;
|
}
|
|
.op1 {
|
border: 1px solid #41a863;
|
color: #41a863;
|
}
|
|
.op2 {
|
border: 1px solid #d98d00;
|
color: #d98d00;
|
}
|
|
.op3 {
|
border: 1px solid #3a78ff;
|
color: #3a78ff;
|
}
|
|
.op4 {
|
border: 1px solid #da0000;
|
color: #da0000;
|
}
|
|
.op5 {
|
border: 1px solid #888;
|
color: #888;
|
}
|
}
|
|
.pagination-zone {
|
position: fixed;
|
bottom: 0;
|
box-sizing: border-box;
|
background-color: #fff;
|
box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
|
padding: 20rpx 40rpx 20rpx 40rpx;
|
display: flex;
|
flex-direction: column;
|
gap: 20rpx;
|
justify-content: space-between;
|
width: 100%;
|
}
|
}
|
</style>
|