pad-app/pages/quality/index.vue

641 lines
15 KiB
Vue
Raw Normal View History

<template>
<view class="app">
2023-08-18 17:28:11 +08:00
<head-info :navIndex="3"></head-info>
<view class="container">
<view class="content">
2023-11-13 18:02:20 +08:00
<view class="addBtn" @click="modify('add')">+ </view>
<view class="form">
2023-11-13 18:02:20 +08:00
<view class="left">
<uni-easyinput suffixIcon="search" v-model="carValue" placeholder="请输入车架号"
@iconClick="iconClick">
</uni-easyinput>
2023-11-16 18:04:18 +08:00
</view>
2023-12-14 17:02:53 +08:00
<view class="right" @click="screen">
2023-12-22 17:48:52 +08:00
<p>船名/航次<uni-icons type="bottom" style="margin-left: 5px;" size="16"></uni-icons></p>
2023-12-14 17:02:53 +08:00
<p>质损环节<uni-icons type="bottom" style="margin-left: 5px;" size="16"></uni-icons></p>
<p>品牌<uni-icons type="bottom" style="margin-left: 5px;" size="16"></uni-icons></p>
</view>
</view>
<view class="itemList">
2023-09-23 20:16:54 +08:00
<template v-if="itemList.length > 0">
<view class="item" v-for="(item,index) in itemList" :key="index" @click="details(item)">
2023-11-13 10:11:34 +08:00
<view class="headTop">
<view class="leftHead">
<image src="../../static/images/zlIcon.png" mode=""></image>
<text>{{item.vinCode}}</text>
</view>
2023-11-13 18:02:20 +08:00
<view class="rightHead">
2023-11-16 18:04:18 +08:00
<view class="delBtn" @click.stop="del(item)" v-if="item.removableFlag == 1">
2023-11-13 18:02:20 +08:00
<image src="../../static/images/delBtn.png"></image>
<text>删除</text>
</view>
<view class="editBtn" @click.stop="modify('edit',item)">
<image src="../../static/images/editBtn.png"></image>
<text>编辑</text>
</view>
2023-11-13 10:11:34 +08:00
</view>
</view>
2023-09-23 20:16:54 +08:00
<view class="row">
2023-11-13 10:11:34 +08:00
<view class="col">
2023-11-16 18:04:18 +08:00
<text
v-if="item.spmIdAndVvyId != null && item.spmIdAndVvyId != ''">船名/航次{{item.spmIdAndVvyId}}</text>
<text v-else>/</text>
2023-09-23 20:16:54 +08:00
</view>
<view class="col">
2023-11-13 10:11:34 +08:00
作业时间{{item.workTime}}
2023-09-23 20:16:54 +08:00
</view>
2023-11-13 10:11:34 +08:00
</view>
<view class="row">
2023-09-23 20:16:54 +08:00
<view class="col">
货物状态{{item.godStatusName}}
</view>
2023-11-13 10:11:34 +08:00
<view class="col">
质损概况{{item.damageSituationName}}
</view>
</view>
2023-09-23 20:16:54 +08:00
<view class="row">
<view class="col">
2023-11-13 10:11:34 +08:00
质损发生环节{{item.qdLinkName}}
2023-09-23 20:16:54 +08:00
</view>
<view class="col">
车型{{item.bvmName}}
</view>
</view>
2023-09-23 20:16:54 +08:00
<view class="row">
<view class="col">
2023-11-13 10:11:34 +08:00
品牌{{item.brdName}}
2023-09-23 20:16:54 +08:00
</view>
<view class="col">
2023-11-13 10:11:34 +08:00
场位{{item.pos}}
2023-09-23 20:16:54 +08:00
</view>
</view>
2023-09-23 20:16:54 +08:00
<view class="row">
<view class="col">
2023-11-13 10:11:34 +08:00
作业人{{item.qdLiablePerson}}
2023-09-23 20:16:54 +08:00
</view>
<view class="col">
处置情况{{item.disposalSituationName}}
</view>
</view>
</view>
2023-09-23 20:16:54 +08:00
</template>
<o-empty v-else height="70vh" bg="#f5f6fa" />
</view>
<view class="pageBox" v-if="itemList.length > 0">
<uni-pagination :show-icon="true" :total="total" :pageSize="pageSize" :current="current"
@change="changePage" />
</view>
2023-12-14 17:02:53 +08:00
<uni-drawer ref="showRight" mode="right" :mask-click="false">
<view class="scroll-view">
<scroll-view class="scroll-view-box" scroll-y="true">
<view class="drawerTop" @click="back">
<image src="../../static/images/leftJt.png" mode=""></image>
<text>返回</text>
</view>
2023-12-22 17:48:52 +08:00
<view class="drawerTitle">
船名/航次
</view>
<superwei-combox class="select" :candidates="shipList" :isJSON="true" keyName="shipVvy"
placeholder="船名/航次" v-model="shipValue" @select="shipChange"
@input="shipInput"></superwei-combox>
2023-12-14 17:02:53 +08:00
<view class="drawerTitle">
质损环节
</view>
<superwei-combox class="select" :candidates="zshjList" :isJSON="true" keyName="name"
placeholder="质损环节" v-model="zshjName" @select="zshjChange"></superwei-combox>
<view class="drawerTitle">
品牌
</view>
<superwei-combox class="select" :candidates="brandList" :isJSON="true" keyName="brdName"
placeholder="品牌" v-model="brandValue" @select="brandChange"></superwei-combox>
<view class="bottomBtn">
<view class="btn czBtn" @click="reset">
重置
</view>
<view class="btn qrBtn" @click="confirm">
确认
</view>
</view>
</scroll-view>
</view>
</uni-drawer>
2023-09-23 20:16:54 +08:00
<uni-popup ref="popup" type="dialog">
2023-11-01 18:40:05 +08:00
<uni-popup-dialog confirmText="确定" content="是否删除该条数据?" @confirm="delConfirm"></uni-popup-dialog>
2023-09-23 20:16:54 +08:00
</uni-popup>
</view>
</view>
</view>
</template>
<script>
import HeadInfo from '@/components/head-info/head-info';
export default {
data() {
return {
2023-09-23 20:16:54 +08:00
loginObj: {},
2023-11-13 18:02:20 +08:00
// 查询值(车架号)
carValue: '',
2023-09-23 20:16:54 +08:00
// 品牌下拉
brandId: "",
brandValue: "",
brandList: [],
// 列表数据
itemList: [],
// 分页
total: 0,
pageSize: 10,
current: 1,
// 当前行数据
rowInfo: {},
// 港区信息
portObj: {},
// 船名下拉
shipList: [],
shipId: "",
shipValue: "",
2023-11-13 10:11:34 +08:00
shipSr: "",
2023-09-23 20:16:54 +08:00
vvyId: "",
2023-11-13 18:02:20 +08:00
// 质损发生环节下拉
zshjList: [],
zshjId: "",
zshjName: "",
}
},
onLoad() {
2023-09-23 20:16:54 +08:00
this.loginObj = uni.getStorageSync('loginObj')
this.portObj = uni.getStorageSync('portObj')
2023-11-16 18:04:18 +08:00
uni.setStorageSync('signImg', "")
uni.setStorageSync('hzzsImg', "")
2024-01-26 18:02:31 +08:00
uni.setStorageSync('isSign', true)
2023-09-23 20:16:54 +08:00
this.initData()
this.getBrand()
this.getShip()
2023-11-13 18:02:20 +08:00
this.getRadio()
2023-09-23 20:16:54 +08:00
},
onBackPress(options) {
// 触发返回就会调用此方法,这里实现的是禁用物理返回,顶部导航栏的自定义返回 uni.navigateBack 仍可使用
if (options.from == 'backbutton') {
return true;
} else if (options.from == 'navigateBack') {
return false;
}
},
components: {
HeadInfo
},
methods: {
2023-11-13 18:02:20 +08:00
// 点击图标搜索
iconClick() {
this.initData()
},
2023-12-14 17:02:53 +08:00
// 点击筛选
screen() {
this.$refs.showRight.open();
},
// 返回
back() {
this.$refs.showRight.close();
},
// 重置
reset() {
2023-12-22 17:48:52 +08:00
// 船名/航次
this.shipId = ""
this.shipValue = ""
this.vvyId = ""
2023-12-14 17:02:53 +08:00
// 质损环节下拉
this.zshjId = ""
this.zshjName = ""
// 品牌
this.brandId = ""
this.brandValue = ""
},
// 筛选确认
confirm() {
this.current = 1
this.initData()
this.$refs.showRight.close();
},
2023-09-23 20:16:54 +08:00
// 获取列表数据
initData() {
uni.request({
2023-11-13 18:02:20 +08:00
url: `${this.$local}/api/goodsQuality/page?current=${this.current}&page=${this.pageSize}&brdId=${this.brandId}&vvyId=${this.vvyId}&qdLink=${this.zshjId}&vinCode=${this.carValue}`,
2023-09-23 20:16:54 +08:00
header: {
'Content-Type': 'application/json', //自定义请求头信息
'Authorization': `Bearer ${this.loginObj.access_token}`
},
method: 'GET', //请求方式,必须为大写
success: (res) => {
if (res.statusCode == 200) {
this.itemList = res.data.data.records
this.total = res.data.data.total
}
}
})
},
2023-09-23 20:16:54 +08:00
// 获取船名
getShip() {
let ieType = ""
let pamId = this.portObj.portId
let spmId = ""
let tradeType = ""
uni.request({
2023-11-13 10:11:34 +08:00
url: `${this.$local}/api/shipInstructions/queryByKey?ieType=${ieType}&key=${this.shipSr}&pamId=${this.portObj.portId}&spmId=${spmId}&tradeType=${tradeType}`,
2023-09-23 20:16:54 +08:00
header: {
'Content-Type': 'application/json', //自定义请求头信息
'Authorization': `Bearer ${this.loginObj.access_token}`
},
method: 'GET', //请求方式,必须为大写
success: (res) => {
if (res.statusCode == 200) {
this.shipList = res.data.data
2023-11-13 10:11:34 +08:00
this.shipList.forEach(v => {
this.$set(v, "shipVvy", `${v.vslCnname} / ${v.vvyName} `)
})
2023-09-23 20:16:54 +08:00
}
}
})
},
2023-09-23 20:16:54 +08:00
// 船名/航次
shipChange(e) {
this.shipId = e.vslCd
2023-11-13 10:11:34 +08:00
this.shipValue = e.shipVvy
2023-09-23 20:16:54 +08:00
this.vvyId = e.vvyId
},
2023-11-13 18:02:20 +08:00
// 质损环节下拉
zshjChange(e) {
this.zshjId = e.value
this.zshjName = e.name
},
// 获取枚举(质损发生环节)
getRadio() {
uni.request({
url: this.$local + '/api/miniapp/typeRef/domain/QUALITY_DAMAGE_LINK',
header: {
'Content-Type': 'application/json', //自定义请求头信息
'Authorization': `Bearer ${this.loginObj.access_token}`
},
method: 'GET', //请求方式,必须为大写
success: (res) => {
if (res.data.status == 200) {
res.data.data.forEach(v => {
this.zshjList.push({
value: v.ptrCode,
name: v.ptrDesc
})
})
}
}
})
},
2023-11-13 10:11:34 +08:00
// 选择船输入框
shipInput(e) {
this.shipSr = e
2023-11-16 18:04:18 +08:00
if (e == '') {
this.vvyId = ""
this.vvyName = ""
this.shipId = ""
}
2023-11-13 10:11:34 +08:00
this.getShip()
},
2023-09-23 20:16:54 +08:00
// 获取品牌
getBrand() {
uni.request({
url: `${this.$local}/api/miniapp/queryBrand`,
header: {
'Content-Type': 'application/json', //自定义请求头信息
'Authorization': `Bearer ${this.loginObj.access_token}`
},
method: 'GET', //请求方式,必须为大写
success: (res) => {
if (res.statusCode == 200) {
this.brandList = res.data.data
}
}
})
},
2023-09-23 20:16:54 +08:00
// 品牌下拉选择
brandChange(e) {
this.brandId = e.brdId
this.brandValue = e.brdName
},
// 点击新增/编辑
modify(type, item) {
2023-11-13 18:02:20 +08:00
if (type == 'edit') {
let obj = {
2023-11-24 15:55:58 +08:00
type: "edit",
2023-11-13 18:02:20 +08:00
ygqId: item.ygqId
}
const params = encodeURIComponent(JSON.stringify(obj));
uni.navigateTo({
url: `/pages/quality/edit?params=${params}`
})
} else {
2023-11-24 15:55:58 +08:00
let obj = {
type: "add",
ygqId: ""
}
const params = encodeURIComponent(JSON.stringify(obj));
2023-11-13 18:02:20 +08:00
uni.navigateTo({
2023-11-24 15:55:58 +08:00
url: `/pages/quality/edit?params=${params}`
2023-11-13 18:02:20 +08:00
})
2023-09-23 20:16:54 +08:00
}
},
// 点击详情
2023-09-23 20:16:54 +08:00
details(item) {
let obj = {
ygqId: item.ygqId
}
const params = encodeURIComponent(JSON.stringify(obj));
uni.navigateTo({
2023-09-23 20:16:54 +08:00
url: `/pages/quality/details?params=${params}`
})
},
// 点击删除
del(item) {
this.$refs.popup.open()
this.rowInfo = item
},
// 删除确认
delConfirm() {
uni.request({
url: `${this.$local}/api/goodsQuality/delQuality/${this.rowInfo.ygqId}`,
header: {
'Content-Type': 'application/json', //自定义请求头信息
'Authorization': `Bearer ${this.loginObj.access_token}`
},
method: 'DELETE', //请求方式,必须为大写
success: (res) => {
console.log('接口返回------', res);
if (res.statusCode == 200) {
uni.showToast({
icon: 'success',
title: '删除成功'
});
this.initData()
} else {
uni.showToast({
icon: 'error',
title: `${res.data.error_description}`
});
this.initData()
2023-09-23 20:16:54 +08:00
}
}
})
},
2023-09-23 20:16:54 +08:00
// 点击分页
changePage(e) {
this.current = e.current;
this.initData()
},
}
};
</script>
<style lang="less" scoped>
.content {
flex: 1;
2023-11-13 10:11:34 +08:00
padding-bottom: 20px;
margin-top: 115px;
2023-11-13 18:02:20 +08:00
.addBtn {
position: fixed;
right: 50px;
bottom: 50px;
2023-12-22 17:48:52 +08:00
width: 90px;
height: 90px;
2023-11-13 18:02:20 +08:00
border-radius: 50%;
background-color: #2979ff;
color: #fff;
2023-12-22 17:48:52 +08:00
font-size: 22px;
2023-11-13 18:02:20 +08:00
text-align: center;
2023-12-22 17:48:52 +08:00
line-height: 90px;
2023-11-13 18:02:20 +08:00
font-weight: bold;
z-index: 999;
}
.form {
2023-11-13 10:11:34 +08:00
width: 100%;
display: flex;
2023-11-13 18:02:20 +08:00
justify-content: space-between;
2023-11-13 10:11:34 +08:00
background: #FAFAFA;
border-top: 1px solid #EEEEEE;
border-bottom: 1px solid #EEEEEE;
2023-12-22 17:48:52 +08:00
padding: 10px 16px;
2023-11-13 10:11:34 +08:00
position: fixed;
top: 66px;
2023-11-13 18:02:20 +08:00
z-index: 995;
.button {
width: 90px;
2023-09-23 20:16:54 +08:00
height: 35px;
line-height: 35px;
text-align: center;
margin: 0;
}
2023-11-13 18:02:20 +08:00
.left {
2023-11-16 18:04:18 +08:00
display: flex;
2023-11-13 18:02:20 +08:00
/deep/.is-input-border {
border-radius: 20px;
width: 300px;
2023-11-16 18:04:18 +08:00
margin-right: 10px;
2023-11-13 18:02:20 +08:00
}
/deep/.uni-easyinput__placeholder-class {
padding-left: 10px;
}
2023-12-22 17:48:52 +08:00
/deep/.content-clear-icon {
display: none;
}
/deep/.uni-easyinput__placeholder-class {
font-size: 14px;
color: #666;
}
2023-11-16 18:04:18 +08:00
.btn {
height: 35px;
line-height: 35px;
margin-left: 0;
font-size: 16px;
color: #fff;
background-color: #0067CF;
margin-left: 10px;
2023-11-13 18:02:20 +08:00
}
}
.right {
display: flex;
2023-11-13 10:11:34 +08:00
2023-12-14 17:02:53 +08:00
p {
margin-left: 10px;
line-height: 40px;
}
}
}
.itemList {
2023-11-13 10:11:34 +08:00
padding: 16px;
display: flex;
flex-direction: column;
.item {
2023-11-13 10:11:34 +08:00
padding: 15px;
border-radius: 8px;
background-color: #fff;
display: flex;
2023-11-13 10:11:34 +08:00
flex-wrap: wrap;
justify-content: space-between;
2023-11-13 10:11:34 +08:00
font-family: PingFangSC-Regular;
font-size: 14px;
2023-11-21 17:43:02 +08:00
color: #23262E;
2023-11-16 18:04:18 +08:00
margin-bottom: 16px;
2023-11-13 10:11:34 +08:00
.headTop {
width: 100%;
display: flex;
justify-content: space-between;
2023-12-08 17:42:10 +08:00
margin-bottom: 10px;
2023-11-13 10:11:34 +08:00
.leftHead {
font-size: 16px;
color: #23262E;
font-weight: bold;
display: flex;
image {
width: 18px;
height: 18px;
margin-right: 7px;
}
}
.rightHead {
font-size: 16px;
color: #1677FF;
display: flex;
2023-11-13 18:02:20 +08:00
.delBtn {
display: flex;
margin-right: 10px;
}
.editBtn {
display: flex;
}
2023-11-13 10:11:34 +08:00
image {
width: 16px;
height: 16px;
margin-right: 8px;
margin-top: 3px;
}
}
}
.row {
2023-11-13 10:11:34 +08:00
width: 18%;
flex-direction: column;
display: flex;
}
2023-08-18 17:28:11 +08:00
.col {
margin-bottom: 10px;
2023-12-22 17:48:52 +08:00
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
2023-08-18 17:28:11 +08:00
}
}
}
2023-09-23 20:16:54 +08:00
2023-12-14 17:02:53 +08:00
// 右侧抽屉筛选
/deep/.uni-drawer__content {
width: 300px;
}
.scroll-view {
/* #ifndef APP-NVUE */
width: 100%;
height: 100%;
/* #endif */
flex: 1
}
// 处理抽屉内容滚动
.scroll-view-box {
flex: 1;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding: 0 16px 80px;
.drawerTop {
display: flex;
2023-12-22 17:48:52 +08:00
margin-top: 24px;
2023-12-14 17:02:53 +08:00
margin-bottom: 30px;
image {
2023-12-22 17:48:52 +08:00
width: 10px;
height: 14px;
margin-right: 10px;
margin-top: 6px;
2023-12-14 17:02:53 +08:00
}
text {
font-size: 20px;
color: #23262E;
font-weight: bold;
}
}
.drawerTitle {
font-size: 14px;
color: #23262E;
margin: 8px 0;
}
.bottomBtn {
width: 100%;
height: 60px;
display: flex;
justify-content: space-between;
padding: 12px 16px;
background: #FFFFFF;
box-shadow: 0 -3px 7px 0 rgba(0, 0, 0, 0.10);
position: fixed;
bottom: 0px;
right: 0px;
.btn {
width: 116px;
height: 36px;
font-size: 16px;
text-align: center;
line-height: 36px;
border-radius: 4px;
}
.czBtn {
color: #0067CF;
border: 1px solid #0067CF;
}
.qrBtn {
color: #fff;
background: #0067CF;
}
}
}
}
</style>