代码优化

This commit is contained in:
BianLzhaoMin 2024-08-23 13:21:58 +08:00
parent cf7c7eb8d6
commit 07361ae8b6
13 changed files with 1249 additions and 461 deletions

View File

@ -15,14 +15,19 @@
</view>
<view>
<span>待退料数量</span>
<h4>{{ fetch.manageType == 2 ? fetch.partNum : fetch.num }}</h4>
<h4>{{ fetch.num }}</h4>
</view>
<text
<!-- <text
v-show="fetch.manageType == 2"
class="see-item"
@click.stop="openPopup3(fetch.maTypeDetails)">
查看配件
</text>
</text> -->
<h5>点击退料</h5>
</view>
<view class="btm-sticky">
<view class="exam" @click="totalBack"> 完成退料 </view>
</view>
<uni-popup ref="popup1" type="center" :mask-click="false">
<view class="popup1">
@ -198,6 +203,7 @@
this.transMaCode = list.code;
this.sendTypeId = list.typeId;
this.parentId = list.id;
/* if (list.manageType == '2') {
return
@ -346,7 +352,7 @@
const urlStr = QS.stringify(params);
console.log("urlSTR", urlStr);
uni.navigateTo({
url: `/pages/codeReceive/codeReceive?${urlStr}&maCode=${this.transMaCode}`,
url: `/pages/codeReceive/codeReceive?params=${urlStr}&maCode=${this.transMaCode}`,
});
},
rfidOut() {
@ -481,6 +487,44 @@
console.log("numaccumulator", sum);
return sum;
},
totalBack() {
console.log("完成退料");
// let that = this;
// let submitList = that.fetchList.filter(
// (item) => item.checked == true && Number(item.num) == 0
// );
// if (submitList.length != 0) {
// console.log(submitList);
// let typeIdStr;
// let typeIdArr = [];
// submitList.forEach((item) => {
// typeIdArr.push(item.modelId);
// });
// typeIdStr = typeIdArr.join(",");
// console.log(typeIdStr);
// uni.showModal({
// title: "退",
// content: "退",
// success: (res) => {
// if (res.confirm) {
// that.endBackMaFn({
// createBy:
// uni.getStorageSync("userInfo").userid,
// parentId: submitList[0].id,
// taskId: submitList[0].taskId,
// typeId: typeIdStr,
// });
// }
// },
// });
// } else {
// uni.showToast({
// icon: "none",
// title: "退",
// });
// }
},
},
onLoad(params) {
console.log(params);
@ -715,4 +759,17 @@
}
}
}
.btm-sticky {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
box-sizing: border-box;
padding: 15rpx 30rpx;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
}
</style>

View File

@ -0,0 +1,730 @@
<template>
<view>
<view
class="single-fetch"
v-for="(fetch, index) in fetchList"
:key="index">
<view>
<checkbox-group
@change="checkClick(fetch)"
style="margin-right: 15rpx"
v-show="fetch.backStatus == '0' && Number(fetch.num) == 0">
<checkbox :checked="fetch.checked" />
</checkbox-group>
</view>
<view class="info-cont">
<view>
<span>类型名称</span>
<h4>{{ fetch.typeName }}</h4>
</view>
<view>
<span>规格型号</span>
<h4>{{ fetch.typeCode }}</h4>
</view>
<view>
<span>待退料数量</span>
<h4>{{ fetch.num }}</h4>
</view>
<h5 @click="openPopup(fetch)">点击退料</h5>
</view>
</view>
<view class="btm-sticky">
<view class="checked">
<checkbox-group @tap="checkAll" style="margin-right: 15rpx">
<checkbox :checked="allChecked" />
</checkbox-group>
<text>全选</text>
</view>
<view class="exam" @click="totalBack"> 完成退料 </view>
</view>
<uni-popup ref="popup1" type="center" :mask-click="false">
<view class="popup1">
<view class="pop-top">
<h4>退料接收</h4>
<uni-icons
style="color: #aaaaaa; font-weight: bold"
type="closeempty"
size="20"
@click="closePopup1">
</uni-icons>
</view>
<h5
style="
width: 85%;
margin: 2vh auto;
font-weight: normal;
text-align: center;
">
请选择接收方式
</h5>
<view class="select-area">
<view @click="scanCode">二维码</view>
<view @click="codeOut">编码接收</view>
<view @click="rfidOut">RFID接收</view>
</view>
<!-- <view class="ipt-area">
<uni-easyinput v-model="codeVal" placeholder="请输入编码"></uni-easyinput>
</view> -->
</view>
</uni-popup>
<uni-popup ref="popup2" type="center" :mask-click="false">
<view class="popup2">
<view class="pop-top">
<h4>退料接收</h4>
<uni-icons
style="color: #aaaaaa; font-weight: bold"
type="closeempty"
size="20"
@click="closePopup2">
</uni-icons>
</view>
<view class="info-area">
<view>
<h4>类型名称</h4>
<span>{{ infoList.typeName }}</span>
</view>
<view>
<h4>规格型号</h4>
<span>{{ infoList.typeModelName }}</span>
</view>
<view>
<h4>待入库数量</h4>
<span>{{ infoList.preNum }}</span>
</view>
<!-- <view style="flex-direction: column;">
<h4 style="margin-bottom: 30rpx;">待修状态</h4>
<uni-data-checkbox v-model="fixVal" :localdata="fixRange"></uni-data-checkbox>
</view> -->
<view>
<h4>合格数量</h4>
<uni-easyinput
type="number"
v-model="passedNum"
placeholder="请输入"></uni-easyinput>
</view>
<view>
<h4>待修数量</h4>
<uni-easyinput
type="number"
v-model="waitRepairNum"
placeholder="请输入"></uni-easyinput>
</view>
<view>
<h4>待报废数量</h4>
<uni-easyinput
type="number"
v-model="waitCrashNum"
placeholder="请输入"></uni-easyinput>
</view>
</view>
<view class="sub-btn" @click="multiOut"> 退料接收 </view>
</view>
</uni-popup>
</view>
</template>
<script>
import QS from "qs";
export default {
data() {
return {
pageNum: 1,
pageSize: 10,
pageTotal: 0,
allChecked: false,
fetchList: [],
codeVal: "",
manageType: "",
infoList: "",
multiNum: 1,
subList: {},
fixVal: "",
fixRange: [
{
text: "合格",
value: "0",
},
{
text: "待修",
value: "1",
},
{
text: "待报废",
value: "2",
},
],
passedNum: "",
waitRepairNum: "",
waitCrashNum: "",
detailsId: "",
taskId: "",
submitFlag: false,
taskStatus: "",
transMaCode: "",
rfidNum: "",
sendTypeId: "",
parentId: "",
};
},
methods: {
openPopup(list) {
console.log(list);
this.infoList = list;
this.rfidNum = list.num;
this.transMaCode = list.code;
this.sendTypeId = list.typeId;
this.parentId = list.id;
if (Number(list.num) == 0) {
uni.showToast({
icon: "none",
title: "待退料数据为0请勿再点击",
});
return;
}
if (this.infoList.manageType == "0") {
this.$refs.popup1.open();
} else {
const userInfo = uni.getStorageSync("userInfo");
console.log("userInfo", userInfo);
const userId = userInfo.userid;
const {
taskId,
id,
typeId,
modelId,
manageType,
typeName,
typeCode,
num,
} = this.infoList;
const params = {
taskId,
id,
typeId,
modelId,
manageType,
userId,
typeName,
typeCode,
num,
};
const urlStr = QS.stringify(params);
console.log("urlSTR", urlStr);
uni.navigateTo({
url: `/pages/numReceive/numReceive?${urlStr}`,
});
}
},
closePopup1() {
this.$refs.popup1.close();
},
closePopup2() {
this.$refs.popup2.close();
},
checkClick(item) {
item.checked = !item.checked;
if (!item.checked) {
this.allChecked = false;
} else {
const goods = this.fetchList.every((item) => {
return item.checked === true;
});
if (goods) {
this.allChecked = true;
} else {
this.allChecked = false;
}
}
},
checkAll() {
this.allChecked = !this.allChecked;
if (this.allChecked) {
this.fetchList.map((item) => {
if (item.checked == false) {
item.checked = true;
}
});
} else {
this.fetchList.map((item) => {
if (item.checked == true) {
item.checked = false;
}
});
}
},
scanCode() {
const that = this;
that.closePopup1();
/* uni.scanCode({
success: (res) => {
console.log("beforeScan", res);
const userInfo = uni.getStorageSync('userInfo');
console.log("beforeScan11111", userInfo,that.taskId)
const userId = userInfo.userid
uni.navigateTo({
url: `/pages/scanReceive/scanReceive?code=${res.result}&typeId=${that.infoList.typeId}&num=${that.infoList.num}&parentId=${that.infoList.id}&manageType=${that.infoList.manageType}&taskId=${that.taskId}&createBy=${userId}&scanType="back"`
})
}
}) */
const userId = uni.getStorageSync("userInfo").userid;
uni.navigateTo({
url: `/pages/QRIn/QRIn?typeId=${that.infoList.modelId}&num=${that.infoList.num}&parentId=${that.infoList.id}&manageType=${that.infoList.manageType}&taskId=${that.taskId}&createBy=${userId}&scanType="back"`,
});
},
codeOut() {
this.closePopup1();
const userInfo = uni.getStorageSync("userInfo");
console.log("userInfo", userInfo);
const userId = userInfo.userid;
const {
taskId,
id,
typeId,
modelId,
manageType,
typeName,
typeCode,
num,
} = this.infoList;
const params = {
taskId,
id,
typeId,
modelId,
manageType,
userId,
typeName,
typeCode,
num,
};
const urlStr = QS.stringify(params);
console.log("urlSTR", urlStr);
uni.navigateTo({
url: `/pages/codeReceive/codeReceive?${urlStr}&maCode=${this.transMaCode}`,
});
},
rfidOut() {
this.closePopup1();
uni.navigateTo({
url: `/pages/rfidReceive/rfidReceive?waitOut=${this.rfidNum}&typeId=${this.sendTypeId}&parentId=${this.parentId}&taskId=${this.taskId}`,
});
},
multiOut() {
let that = this;
this.closePopup2();
that.subList = {
parentId: that.infoList.parenntId,
typeId: that.infoList.typeId,
outNum: that.multiNum,
companyId: uni.getStorageSync("userInfo").sysUser.companyId,
};
console.log(that.subList);
that.$api.fetchMaterialOutStore
.subOutStore(that.subList, null)
.then((res) => {
console.log(res);
if (res.data.code == 200) {
uni.showToast({
icon: "none",
title: "退料接收成功!",
success: () => {
uni.navigateBack();
},
});
} else {
uni.showToast({
icon: "none",
title: "退料接收失败!",
});
}
})
.catch((err) => {
console.log(err);
});
},
initListData() {
let that = this;
console.log(that.detailsId);
that.$api.backMaterialReceive
.backMaterialReceiveDetail({
id: that.detailsId,
taskId: that.taskId,
pageNum: that.pageNum,
pageSize: that.pageSize,
})
.then((res) => {
console.log(res);
if (res.data.code == 200) {
that.pageTotal = res.data.data.total;
res.data.data.rows.forEach((item) => {
if (item.backStatus == "0")
item.checked = false;
});
/* res.data.data.forEach(item => {
item.checked = false
}) */
that.fetchList = [
...that.fetchList,
...res.data.data.rows,
];
console.log(that.fetchList);
}
})
.catch((err) => {
console.log(err);
});
},
backReceiveEndBackFn() {
const that = this;
let total = that.reduceNumTotal();
console.log("total==", total);
if (total > 0) {
uni.showToast({
icon: "none",
title: "请完成退料接收后才能结束任务",
});
return;
}
// submitFlag false
if (that.submitFlag == true) {
return;
}
that.submitFlag = true;
console.log(that.taskId, that.detailsId);
that.$api.backMaterialReceive
.backReceiveEndBack({
createBy: uni.getStorageSync("userInfo").userid,
taskId: that.taskId,
parentId: that.detailsId,
})
.then((res) => {
console.log(res);
if (res.data.code == 200) {
uni.showToast({
icon: "none",
title: "结束任务成功",
});
console.log("退料结束", res);
that.submitFlag = false;
uni.navigateBack();
} else {
uni.showToast({
icon: "none",
title: res.data.msg,
});
}
})
.catch((err) => {
that.submitFlag = false;
})
.finally((result) => {
that.submitFlag = false;
});
},
reduceNumTotal() {
const that = this;
let sum = that.fetchList.reduce((accumulator, currentValue) => {
return accumulator + Number(currentValue.num);
}, 0);
console.log("numaccumulator", sum);
return sum;
},
endBackMaFn(obj) {
let that = this;
console.log(obj);
// 退
that.$api.backMaterialReceive
.backReceiveEndBack(obj)
.then((res) => {
console.log(res);
if (res.data.code == 200) {
uni.showToast({
icon: "none",
title: res.data.msg,
});
uni.navigateBack();
} else {
uni.showToast({
icon: "none",
title: res.data.msg,
});
}
})
.catch((err) => {
console.log(err);
});
},
totalBack() {
let that = this;
let submitList = that.fetchList.filter(
(item) => item.checked == true && Number(item.num) == 0
);
if (submitList.length != 0) {
console.log(submitList);
let typeIdStr;
let typeIdArr = [];
submitList.forEach((item) => {
typeIdArr.push(item.modelId);
});
typeIdStr = typeIdArr.join(",");
console.log(typeIdStr);
uni.showModal({
title: "完成退料",
content: "确认完成退料吗?",
success: (res) => {
if (res.confirm) {
that.endBackMaFn({
createBy:
uni.getStorageSync("userInfo").userid,
parentId: submitList[0].id,
taskId: submitList[0].taskId,
typeId: typeIdStr,
});
}
},
});
} else {
uni.showToast({
icon: "none",
title: "未选中完成退料项!",
});
}
},
},
onLoad(params) {
console.log(params);
this.taskId = params.taskId;
this.detailsId = params.id;
this.taskStatus = params.taskStatus;
},
onShow() {
this.fetchList = [];
this.initListData();
},
onNavigationBarButtonTap(ev) {
let that = this;
/* if (ev.text == '') {
if(this.taskStatus=="40"){
uni.showToast({
icon: 'none',
title: '请勿再点击'
})
return
}
that.backReceiveEndBackFn()
} */
let submitList = that.fetchList.filter(
(item) => item.checked == true
);
if (submitList.length != 0) {
console.log(submitList);
} else {
uni.showToast({
icon: "none",
title: "未选中完成退料项!",
});
}
},
onReachBottom() {
if (this.fetchList.length >= this.pageTotal) return;
this.pageNum++;
this.initListData();
},
};
</script>
<style lang="scss">
body {
background-color: #fafdff;
box-sizing: border-box;
padding-bottom: 10vh;
}
.single-fetch {
width: 100%;
box-sizing: border-box;
padding: 30rpx;
border-bottom: 1px solid #dddddd;
display: flex;
align-items: center;
.info-cont {
view {
display: flex;
align-items: center;
margin-bottom: 25rpx;
span {
color: #a7a7a7;
padding-right: 20rpx;
}
h4 {
font-size: 14px;
font-weight: normal;
}
}
view:last-child {
margin-bottom: 0;
}
h5 {
width: 150rpx;
font-size: 14px;
font-weight: normal;
box-sizing: border-box;
padding: 10rpx;
display: flex;
align-items: center;
justify-content: center;
background-color: #3788ff;
color: #fff;
border-radius: 15rpx;
}
}
}
.btm-exam {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
box-sizing: border-box;
padding: 20rpx 40rpx;
display: flex;
justify-content: flex-end;
border-top: 2px solid #f6f8ff;
.exam {
box-sizing: border-box;
padding: 10rpx 50rpx;
border-radius: 30rpx;
background-color: #3788ff;
font-size: 14px;
color: #fff;
}
}
.btm-sticky {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
box-sizing: border-box;
padding: 15rpx 30rpx;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
.checked {
display: flex;
align-items: center;
}
.exam {
box-sizing: border-box;
padding: 10rpx 50rpx;
border-radius: 30rpx;
background-color: #3788ff;
font-size: 14px;
color: #fff;
}
}
.popup1 {
width: 80vw;
height: 20vh;
background-color: #fff;
border-radius: 15rpx;
overflow: hidden;
background: linear-gradient(#d9e7fe, #fff, #fff, #fff);
.pop-top {
width: 100%;
height: 5vh;
box-sizing: border-box;
padding: 0 25rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.select-area {
width: 85%;
margin: 40rpx auto;
display: flex;
justify-content: space-around;
align-items: center;
view {
box-sizing: border-box;
font-size: 14px;
padding: 10rpx 20rpx;
border: 1px solid #d5d5d4;
border-radius: 20rpx;
}
}
.ipt-area {
width: 85%;
margin: 40rpx auto;
}
}
.popup2 {
width: 80vw;
height: 60vh;
background-color: #fff;
border-radius: 15rpx;
overflow: hidden;
background: linear-gradient(#d9e7fe, #fff, #fff, #fff);
.pop-top {
width: 100%;
height: 5vh;
box-sizing: border-box;
padding: 0 25rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.info-area {
width: 85%;
margin: 30rpx auto;
display: flex;
flex-direction: column;
view {
margin-bottom: 15rpx;
display: flex;
align-items: center;
h4 {
font-weight: normal;
color: #989898;
font-size: 14px;
width: 35%;
}
span {
font-size: 14px;
}
}
}
.sub-btn {
width: 85%;
margin: 30rpx auto;
background-color: #3788ff;
color: #fff;
box-sizing: border-box;
padding: 15rpx 0;
display: flex;
justify-content: center;
align-items: center;
border-radius: 40rpx;
font-size: 14px;
}
}
</style>

View File

@ -204,7 +204,7 @@
font-weight: normal;
text-align: center;
">
是否通过审批
是否确认审批
</h4>
<view class="select-area">
<view @click="modalConfirm">通过</view>

View File

@ -1,58 +1,66 @@
<template>
<view>
<view class="ipt-area">
<uni-easyinput suffixIcon="search" v-model="keywordVal" placeholder="请输入领料单号"
@iconClick="searchKeyword"></uni-easyinput>
</view>
<view class="single-fetch" v-for="(fetch, index) in fetchMaterialList" :key="index">
<view class="fetch-upper">
<!-- {{ fetch.taskStatus }} -->
<!-- <checkbox-group
<view>
<view class="ipt-area">
<uni-easyinput
suffixIcon="search"
v-model="keywordVal"
placeholder="请输入领料单号"
@iconClick="searchKeyword"></uni-easyinput>
</view>
<view
class="single-fetch"
v-for="(fetch, index) in fetchMaterialList"
:key="index">
<view class="fetch-upper">
<!-- {{ fetch.taskStatus }} -->
<!-- <checkbox-group
v-show="fetch.taskStatus != '35'"
style="margin-right: 15rpx;"
@change="checkClick(fetch)"
>
<checkbox :checked="fetch.checked" />
</checkbox-group> -->
<view class="upper-lef">
{{ fetch.createBy.slice(0, 1) }}
</view>
<view class="upper-rig">
<h4 style="font-size: 16px;">{{ fetch.createBy }}</h4>
<h4 style="color: #989898;">{{ fetch.phoneNumber }}</h4>
</view>
</view>
<view class="fetch-lower" @click="seeDetail(fetch.taskId, fetch.taskStatus, fetch.id)">
<view>
<span>领料申请单位</span>
<h4>{{ fetch.unitName }}</h4>
</view>
<view>
<span>领料申请工程</span>
<h4>{{ fetch.proName }}</h4>
</view>
<view>
<span>领料单号</span>
<h4>{{ fetch.code }}</h4>
</view>
<!-- <view>
<view class="upper-lef">
{{ fetch.createBy.slice(0, 1) }}
</view>
<view class="upper-rig">
<h4 style="font-size: 16px">{{ fetch.createBy }}</h4>
<h4 style="color: #989898">{{ fetch.phoneNumber }}</h4>
</view>
</view>
<view
class="fetch-lower"
@click="seeDetail(fetch.taskId, fetch.taskStatus, fetch.id)">
<view>
<span>领料申请单位</span>
<h4>{{ fetch.unitName }}</h4>
</view>
<view>
<span>领料申请工程</span>
<h4>{{ fetch.proName }}</h4>
</view>
<view>
<span>领料单号</span>
<h4>{{ fetch.code }}</h4>
</view>
<!-- <view>
<span>工机具类型</span>
<h4>{{ fetch.fetchType }}</h4>
</view> -->
<view>
<span>申请数量</span>
<h4>{{ fetch.preCountNum }}</h4>
</view>
<view>
<span>申请时间</span>
<h4>{{ fetch.updateTimes }}</h4>
</view>
<view>
<span>已出库数量</span>
<h4>{{ fetch.alNum }}</h4>
</view>
</view>
<!-- <view class="fetch-btns">
<view>
<span>申请数量</span>
<h4>{{ fetch.preCountNum }}</h4>
</view>
<view>
<span>申请时间</span>
<h4>{{ fetch.updateTimes }}</h4>
</view>
<view>
<span>已出库数量</span>
<h4>{{ fetch.alNum }}</h4>
</view>
</view>
<!-- <view class="fetch-btns">
<view
style="background-color: #3788FF;"
@click="seeDetail(fetch.taskId)"
@ -70,28 +78,32 @@
审核
</view>
</view> -->
<view class="sticky-area">
<h4 v-show="fetch.taskStatus == '33'">
待出库
</h4>
<h4 v-show="fetch.taskStatus == '34'">
出库进行中
</h4>
<h4 v-show="fetch.taskStatus == '35'" style="border: 1px solid #27D870; color: #27D870;">
出库完成
</h4>
<h4 v-show="fetch.taskStatus == '98'" style="border: 1px solid #EE603D; color: #EE603D;">
分公司审核驳回
</h4>
<h4 v-show="fetch.taskStatus == '99'" style="border: 1px solid #EE603D; color: #EE603D;">
分管审核驳回
</h4>
<h4 v-show="fetch.taskStatus == '100'" style="border: 1px solid #EE603D; color: #EE603D;">
内部审核驳回
</h4>
</view>
</view>
<!-- <view class="btm-sticky">
<view class="sticky-area">
<h4 v-show="fetch.taskStatus == '33'">待出库</h4>
<h4 v-show="fetch.taskStatus == '34'">出库进行中</h4>
<h4
v-show="fetch.taskStatus == '35'"
style="border: 1px solid #27d870; color: #27d870">
出库完成
</h4>
<h4
v-show="fetch.taskStatus == '98'"
style="border: 1px solid #ee603d; color: #ee603d">
分公司审核驳回
</h4>
<h4
v-show="fetch.taskStatus == '99'"
style="border: 1px solid #ee603d; color: #ee603d">
分管审核驳回
</h4>
<h4
v-show="fetch.taskStatus == '100'"
style="border: 1px solid #ee603d; color: #ee603d">
内部审核驳回
</h4>
</view>
</view>
<!-- <view class="btm-sticky">
<view class="checked">
<checkbox-group @tap="checkAll" style="margin-right: 15rpx;">
<checkbox :checked="allChecked" />
@ -105,33 +117,34 @@
审核
</view>
</view> -->
<u-loading-page :loading="showLoading" color="#000" loading-text="加载中,请稍后..."></u-loading-page>
</view>
<u-loading-page
:loading="showLoading"
color="#000"
loading-text="加载中,请稍后..."></u-loading-page>
</view>
</template>
<script>
import { basePath } from '../../public'
export default {
data() {
return {
keywordVal: '',
showLoading: false,
allChecked: false,
fetchMaterialList: [
],
examList: []
}
},
methods: {
seeDetail(taskId, taskStatus, id) {
// if (taskStatus == 33) {
uni.navigateTo({
url: `/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail?taskId=${taskId}&taskStatus=${taskStatus}&id=${id}`
})
// }
},
/* checkAll() {
import { basePath } from "../../public";
export default {
data() {
return {
keywordVal: "",
showLoading: false,
allChecked: false,
fetchMaterialList: [],
examList: [],
};
},
methods: {
seeDetail(taskId, taskStatus, id) {
// if (taskStatus == 33) {
uni.navigateTo({
url: `/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail?taskId=${taskId}&taskStatus=${taskStatus}&id=${id}`,
});
// }
},
/* checkAll() {
this.allChecked = !this.allChecked
if (this.allChecked) {
this.fetchMaterialList.map(item => {
@ -162,197 +175,202 @@ export default {
}
}
}, */
toggleExam() {
let that = this
that.examList = that.fetchMaterialList.filter((item) => {
return item.checked == true
}).map((subItem) => {
return {
name: subItem['name'],
number: subItem['fetchNum']
}
})
console.log(that.examList);
},
closePopup() {
this.$refs.popup.close()
},
seeExam(name) {
console.log(name);
this.$refs.popup.open()
},
formSubmit() {
let that = this
that.$refs.examForm.validate().then(formData => {
console.log(formData);
that.$refs.popup.close()
})
},
initFetch(code) {
let that = this
that.showLoading = true
//
that.$api.fetchExam.fetchExamList({
code,
role: uni.getStorageSync('roles').join(','),
flag: 0
}).then(res => {
console.log(res);
if (res.data.code == 200) {
if (res.data.data.rows.length == 0) {
that.showLoading = false
uni.showToast({
icon: 'none',
title: '未查询到相关数据!'
})
} else {
that.showLoading = false
that.fetchMaterialList = res.data.data.rows
}
} else {
that.showLoading = false
uni.showToast({
icon: 'none',
title: res.data.msg
})
}
}).catch(err => {
console.log(err);
})
},
searchKeyword() {
this.initFetch(this.keywordVal)
}
},
onShow() {
let that = this
console.log(uni.getStorageSync('roles').join(','));
that.initFetch('')
}
}
toggleExam() {
let that = this;
that.examList = that.fetchMaterialList
.filter((item) => {
return item.checked == true;
})
.map((subItem) => {
return {
name: subItem["name"],
number: subItem["fetchNum"],
};
});
console.log(that.examList);
},
closePopup() {
this.$refs.popup.close();
},
seeExam(name) {
console.log(name);
this.$refs.popup.open();
},
formSubmit() {
let that = this;
that.$refs.examForm.validate().then((formData) => {
console.log(formData);
that.$refs.popup.close();
});
},
initFetch(code) {
let that = this;
that.showLoading = true;
//
that.$api.fetchExam
.fetchExamList({
code,
role: uni.getStorageSync("roles").join(","),
flag: 0,
})
.then((res) => {
console.log(res);
if (res.data.code == 200) {
if (res.data.data.rows.length == 0) {
that.showLoading = false;
uni.showToast({
icon: "none",
title: "未查询到相关数据!",
});
} else {
that.showLoading = false;
that.fetchMaterialList = res.data.data.rows;
}
} else {
that.showLoading = false;
uni.showToast({
icon: "none",
title: res.data.msg,
});
}
})
.catch((err) => {
console.log(err);
});
},
searchKeyword() {
this.initFetch(this.keywordVal);
},
},
onShow() {
let that = this;
console.log(uni.getStorageSync("roles").join(","));
that.initFetch("");
},
};
</script>
<style lang="scss">
body {
background-color: #f8f8f8;
box-sizing: border-box;
padding-bottom: 10vh;
}
body {
background-color: #f8f8f8;
box-sizing: border-box;
padding-bottom: 10vh;
}
.ipt-area {
width: 95%;
margin: 20rpx auto;
}
.ipt-area {
width: 95%;
margin: 20rpx auto;
}
.single-fetch {
width: 95%;
margin: 20rpx auto;
background-color: #fff;
border-radius: 15rpx;
box-sizing: border-box;
padding: 15rpx;
position: relative;
.single-fetch {
width: 95%;
margin: 20rpx auto;
background-color: #fff;
border-radius: 15rpx;
box-sizing: border-box;
padding: 15rpx;
position: relative;
.fetch-upper {
width: 100%;
box-sizing: border-box;
padding: 15rpx;
border-bottom: 1px solid #D7D7D7;
display: flex;
align-items: center;
.fetch-upper {
width: 100%;
box-sizing: border-box;
padding: 15rpx;
border-bottom: 1px solid #d7d7d7;
display: flex;
align-items: center;
.upper-lef {
width: 12%;
height: 5vh;
border-radius: 15rpx;
display: flex;
justify-content: center;
align-items: center;
background-color: #3789FD;
color: #fff;
font-size: 24px;
}
.upper-lef {
width: 12%;
height: 5vh;
border-radius: 15rpx;
display: flex;
justify-content: center;
align-items: center;
background-color: #3789fd;
color: #fff;
font-size: 24px;
}
.upper-rig {
flex: 1;
box-sizing: border-box;
padding: 10rpx 20rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
.upper-rig {
flex: 1;
box-sizing: border-box;
padding: 10rpx 20rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
h4 {
font-weight: normal;
font-size: 14px;
}
}
}
h4 {
font-weight: normal;
font-size: 14px;
}
}
}
.fetch-lower {
width: 100%;
box-sizing: border-box;
padding: 15rpx;
.fetch-lower {
width: 100%;
box-sizing: border-box;
padding: 15rpx;
view {
width: 100%;
display: flex;
align-items: center;
margin-bottom: 15rpx;
font-size: 14px;
view {
width: 100%;
display: flex;
align-items: center;
margin-bottom: 15rpx;
font-size: 14px;
span {
color: #9D9D9D;
padding-right: 20rpx;
}
span {
color: #9d9d9d;
padding-right: 20rpx;
}
h4 {
color: #000;
font-size: 14px;
font-weight: normal;
}
}
h4 {
color: #000;
font-size: 14px;
font-weight: normal;
}
}
view:last-child {
margin-bottom: 0;
}
}
view:last-child {
margin-bottom: 0;
}
}
.fetch-btns {
width: 100%;
box-sizing: border-box;
padding: 15rpx;
display: flex;
justify-content: flex-end;
.fetch-btns {
width: 100%;
box-sizing: border-box;
padding: 15rpx;
display: flex;
justify-content: flex-end;
view {
box-sizing: border-box;
padding: 8rpx 25rpx;
border-radius: 15rpx;
color: #fff;
margin-right: 15rpx;
font-size: 14px;
}
view {
box-sizing: border-box;
padding: 8rpx 25rpx;
border-radius: 15rpx;
color: #fff;
margin-right: 15rpx;
font-size: 14px;
}
view:last-child {
margin-right: 0;
}
}
view:last-child {
margin-right: 0;
}
}
.sticky-area {
position: absolute;
top: 20rpx;
right: 20rpx;
.sticky-area {
position: absolute;
top: 20rpx;
right: 20rpx;
h4 {
box-sizing: border-box;
padding: 8rpx 20rpx;
border-radius: 15rpx;
font-size: 14px;
font-weight: normal;
background-color: #fff;
border: 1px solid #3788FF;
color: #3788FF;
}
}
}
h4 {
box-sizing: border-box;
padding: 8rpx 20rpx;
border-radius: 15rpx;
font-size: 14px;
font-weight: normal;
background-color: #fff;
border: 1px solid #3788ff;
color: #3788ff;
}
}
}
</style>

Binary file not shown.

View File

@ -1 +1 @@
https://app.liuyingyong.cn/build/download/5ea5fa10-5eb7-11ef-a37e-dbd0aa17c117
https://app.liuyingyong.cn/build/download/ace9e090-602c-11ef-a76c-b5b4f2c19209

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long