前端提交试验模块代码

This commit is contained in:
zzyuan 2024-08-13 18:47:56 +08:00
parent 765d2e3a50
commit a851efee67
13 changed files with 7833 additions and 1194 deletions

View File

@ -52,7 +52,22 @@
"style": {
"navigationStyle": "custom"
}
}
},{
"path" : "pages/test/testDetail",//-
"style": {
"navigationStyle": "custom"
}
},{
"path" : "pages/test/organization",//-
"style": {
"navigationStyle": "custom"
}
},{
"path" : "pages/test/testInfoFill",//-
"style": {
"navigationStyle": "custom"
}
}
],
"tabBar": {
// "custom": true, // tabBar

View File

@ -751,9 +751,6 @@
}
}
}
}
}
}
@ -784,7 +781,7 @@
width: 160rpx;
height: 70rpx;
margin-right: 20rpx;
line-height: 76rpx;
line-height: 70rpx;
text-align: center;
color: #FFF;
background: #0052D9;

View File

@ -878,7 +878,7 @@
width: 100%;
height: auto;
background-color: #fff;
border-radius: 20rpx;
border-radius: 10rpx;
margin: 20rpx 0;
.item-header{

View File

@ -0,0 +1,771 @@
<template>
<view>
<view class="topTab">
<view class="tab-header">
<view class="left" style="width: 20%;">
<image @click="customNavigateBack" src="@/static/img/back.png" mode=""></image>
</view>
<view class="center" v-if="!isView">编制</view>
<view class="center" v-if="isView">试验信息查看</view>
<view class="right" style="justify-content: flex-end;width:25%;">
</view>
</view>
</view>
<view class="page-content">
<scroll-view class="page-content-scroll" scroll-y>
<u--form ref="uForm" labelPosition="left" labelWidth="100px" :model="formData" :rules="rules">
<!-- 样品信息 -->
<view class="content-title">
<view class="title-left-border"></view>
<view class="title-text">样品信息</view>
</view>
<view class="content-box">
<u-form-item label="设备类别" prop="devTypeName" borderBottom required>
<u--input v-model="formData.devTypeName" readonly border="none"></u--input>
</u-form-item>
<u-form-item label="规格型号" prop="devModule" borderBottom required>
<u--input v-model="formData.devModule" readonly border="none"></u--input>
</u-form-item>
<u-form-item label="样品数量" prop="sampleQuantity" borderBottom required>
<u--input v-model="formData.sampleQuantity" readonly border="none"></u--input>
</u-form-item>
<u-form-item label="送样日期" prop="sampleDate" borderBottom required>
<u--input v-model="formData.sampleDate" readonly border="none"></u--input>
</u-form-item>
<u-form-item label="试验日期" prop="experTime" borderBottom required v-if="isView">
<u--input v-model="formData.experTime" readonly border="none"></u--input>
</u-form-item>
<u-form-item label="试验日期" prop="experTime" borderBottom required v-if="!isView" @click="experTimeShow=true">
<u--input v-model="formData.experTime" suffixIcon="arrow-right" readonly suffixIconStyle="color: #909399;fontSize:24px;" border="none"></u--input>
</u-form-item>
<u-datetime-picker
:show="experTimeShow"
mode="date"
@confirm="experTimeConfirm"
@cancel="experTimeShow = false"
></u-datetime-picker>
<u-form-item label="下次试验日期" prop="nextExperTime" borderBottom required v-if="isView">
<u--input v-model="formData.nextExperTime" readonly border="none"></u--input>
</u-form-item>
<u-form-item label="下次试验日期" prop="nextExperTime" borderBottom required v-if="!isView" @click="nextExperTimeShow=true">
<u--input v-model="formData.nextExperTime" suffixIcon="arrow-right" readonly suffixIconStyle="color: #909399;fontSize:24px;" border="none"></u--input>
</u-form-item>
<u-datetime-picker
:show="nextExperTimeShow"
mode="date"
@confirm="nextExperTimeConfirm"
@cancel="nextExperTimeShow = false"
></u-datetime-picker>
<u-form-item label="送检单位" prop="customName" borderBottom required>
<u--input v-model="formData.customName" readonly border="none"></u--input>
</u-form-item>
</view>
<!-- 试验地点 -->
<view class="content-title">
<view class="title-left-border"></view>
<view class="title-text">试验地点</view>
</view>
<view class="content-box">
<u-form-item label="试验地点" prop="experLocal" borderBottom required v-if="isView">
<u--input v-model="formData.experLocal" readonly border="none"></u--input>
</u-form-item>
<u-form-item label="试验地点" prop="experLocal" borderBottom required v-if="!isView" @click="experLocalShow=true">
<u--input v-model="formData.experLocal" suffixIcon="arrow-right" readonly suffixIconStyle="color: #909399;fontSize:24px;" border="none"></u--input>
</u-form-item>
<u-picker :show="experLocalShow" :columns="experLocalList" keyName="name"
@confirm="experLocalConfirm" title="试验地点"
@cancel="experLocalShow = false"
></u-picker>
</view>
<!-- 试验设备 -->
<view class="content-title">
<view class="title-left-border"></view>
<view class="title-text">试验设备</view>
</view>
<view class="content-box">
<u-form-item label="名称" prop="experDevName" borderBottom required v-if="isView">
<u--input v-model="formData.mainDevListData.experDevName" readonly border="none"></u--input>
</u-form-item>
<u-form-item label="名称" prop="experDevName" borderBottom required v-if="!isView" @click="experDevShow=true">
<u--input v-model="formData.mainDevListData.experDevName" suffixIcon="arrow-right" readonly suffixIconStyle="color: #909399;fontSize:24px;" border="none"></u--input>
</u-form-item>
<u-form-item label="型号" prop="mainDevListData.experDevModule" borderBottom required>
<u--input v-model="formData.mainDevListData.experDevModule" :readonly="isView" border="none" maxlength="30"></u--input>
</u-form-item>
<u-form-item label="编号" prop="mainDevListData.experDevCode" borderBottom required>
<u--input v-model="formData.mainDevListData.experDevCode" :readonly="isView" border="none" maxlength="30"></u--input>
</u-form-item>
<u-form-item label="合同有效期" prop="devContractDate" borderBottom required v-if="isView" >
<u--input v-model="formData.mainDevListData.devContractDate" readonly border="none"></u--input>
</u-form-item>
<u-form-item label="合同有效期" prop="devContractDate" borderBottom required v-if="!isView" @click="devContractDateShow=true">
<u--input v-model="formData.mainDevListData.devContractDate" suffixIcon="arrow-right" readonly suffixIconStyle="color: #909399;fontSize:24px;" border="none"></u--input>
</u-form-item>
<u-picker :show="experDevShow" :columns="experDevList" keyName="devName"
@confirm="experDevConfirm" title="试验设备"
@cancel="experDevShow = false"
></u-picker>
<u-datetime-picker
:show="devContractDateShow"
mode="date"
@confirm="devContractDateConfirm"
@cancel="devContractDateShow = false"
></u-datetime-picker>
</view>
<!-- 试验依据 -->
<view class="content-title">
<view class="title-left-border"></view>
<view class="title-text">试验依据</view>
</view>
<view class="content-box">
<u-form-item v-for="(item,index) in yjList" :key="index" label="" borderBottom v-if="isView" >
<u--input v-model="item.basisName" readonly border="none"></u--input>
</u-form-item>
<u-form-item v-for="(item,index) in yjList" :key="index" label="" borderBottom v-if="!isView" @click="chosenBasis(index)">
<u--input v-model="item.basisName" suffixIcon="arrow-right" readonly suffixIconStyle="color: #909399;fontSize:24px;" border="none"></u--input>
</u-form-item>
<u-picker :show="experBasisShow" :columns="basisList" keyName="name"
@confirm="experBasisConfirm" title="试验依据"
@cancel="experBasisShow = false"
></u-picker>
</view>
<view class="content-title" v-if="!isView">
<view class="add-btn" @click="addExperBasis">
<u-icon name="plus" color="#0052D9" size="24"></u-icon>
</view>
<view class="del-btn" @click="delExperBasis">
<u-icon name="minus" color="red" size="24"></u-icon>
</view>
</view>
<!-- 试验信息 -->
<view class="content-title">
<view class="title-left-border"></view>
<view class="title-text">试验信息</view>
</view>
<view class="content-box">
<view v-for="(item,index) in infoList" :key="index" style="width: 100%;height: auto;padding: 10rpx 0;display: flex;align-items: center;">
<view class="item-number">{{index+1}}</view>
<u-form-item style="width: 92%;" :label="formData.devTypeName" borderBottom>
<u--input v-model="item.devCode" readonly border="none" color="#999999">
<template slot="suffix">
<view v-if="!isView" @click="goFillPage(item,index)" style="color: #0052D9;">填写</view>
<view v-if="isView" @click="goFillPage(item,index)" style="color: #0052D9;">查看</view>
</template>
</u--input>
</u-form-item>
</view>
</view>
<!-- 试验结论 -->
<view class="content-title">
<view class="title-left-border"></view>
<view class="title-text">试验结论</view>
</view>
<view class="content-box">
<u-form-item label="技术要求" prop="experStand" borderBottom required>
<u--textarea v-model="formData.experStand" placeholder="请填写" :disabled="isView" style="padding-bottom:20rpx;" border="none" maxlength="100" count autoHeight></u--textarea>
</u-form-item>
<u-form-item label="检测结论" prop="experConclu" borderBottom required>
<u--textarea v-model="formData.experConclu" placeholder="请填写" :disabled="isView" style="padding-bottom:20rpx;" border="none" maxlength="100" count autoHeight></u--textarea>
</u-form-item>
<u-form-item label="备注" prop="remarsk" borderBottom required>
<u--textarea v-model="formData.remarsk" placeholder="请填写" :disabled="isView" style="padding-bottom:20rpx;" border="none" maxlength="100" count autoHeight></u--textarea>
</u-form-item>
</view>
<view style="width: 100%;height: 10vh;"></view>
<view class="submit-box" v-if="!isView">
<u-button shape="square" class="submit-btn2" @click="customNavigateBack"> </u-button>
<u-button shape="square" class="submit-btn" @click="sumbitConfirm"> </u-button>
</view>
</u--form>
</scroll-view>
</view>
</view>
</template>
<script>
import { getTestBasicInfo,viewTestData,editTestData,getDicts,getDevices,addTestData } from '@/service/url.js';
import tabHeader from '@/components/tab-Header.vue';
import AES from "@/utils/cryptoJs/aes.js";
export default {
components: {
tabHeader
},
data() {
return {
isView:false,
experId:'',
sampleId:'',
devTypeCode:'',
formData:{
sampleId:'',
devTypeCode:'',
devTypeName:'',
devModule:'',
sampleQuantity:'',
sampleDate:'',
experTime:'',//
nextExperTime:'',//
customId:'',
customName:'',
experLocalCode:'',//
experLocal:'',//
mainDevListData:{},//
experStand:'',//
experConclu:'',//
remarsk:'',//
paramsData:{}
},
nextExperTimeShow:false,//
experTimeShow:false,//
experLocalShow:false,//
experLocalList:[],//
experDevList:[],//
experDevShow:false,//
devContractDateShow:false,//
basisList:[],//
experBasisShow:false,//
basisIndex:0,//
yjList:[],//
infoList:[],//-
configItemsList:[],//-
// itemsList:[],//--
// experDevDataList:[],//--
rules: {
'experTime': {
type: 'string',
required: true,
message: '请选择试验日期',
trigger: ['blur', 'change']
},
'nextExperTime': {
type: 'string',
required: true,
message: '请选择试验日期',
trigger: ['blur', 'change']
},
'experLocal': {
type: 'string',
required: true,
message: '请选择试验地点',
trigger: ['blur', 'change']
},
'mainDevListData.experDevModule': {
type: 'string',
required: true,
message: '请填写试验设备型号',
trigger: ['blur', 'change']
},
'mainDevListData.experDevCode': {
type: 'string',
required: true,
message: '请填写试验设备编号',
trigger: ['blur', 'change']
},
'experStand': {
type: 'string',
required: true,
message: '请输入技术要求',
trigger: ['blur', 'change']
},
'experConclu': {
type: 'string',
required: true,
message: '请输入检测结论',
trigger: ['blur', 'change']
},
'remarsk': {
type: 'string',
required: true,
message: '请输入备注',
trigger: ['blur', 'change']
},
},
};
},
onLoad(option) {
console.log(option)
if(option.isView&&option.isView!=""){
this.isView=true;
}else{
this.isView=false;
}
this.sampleId = option.sampleId || '';
this.devTypeCode = option.devTypeCode || '';
this.experId = option.experId || '';
if(this.experId&&this.experId!=""){
this.viewTestData()
}else{
this.getTestBasicInfo()
}
//
this.getLocalDicts()
//
this.getDevices()
//
this.getBasisDicts()
},
onShow() {
},
methods: {
//
customNavigateBack() {
//
const pages = getCurrentPages(); //
const len = pages.length;
let backPage = ''; //
for (let i = len - 2; i >= 0; i--) {
//
if (pages[i].route !== 'pages/A/A') {
backPage = pages[i].route;
break;
}
}
if (backPage) {
uni.navigateBack({
delta: len - 1 - pages.findIndex(page => page.route === backPage) //
});
}
},
//
getLocalDicts(){
let obj = {
"code":"sy_local",
}
let param = {
// encryptedData: AES.encrypt(JSON.stringify(obj))
encryptedData: JSON.stringify(obj)
}
this.$http.post(getDicts,param).then(res => {
if (res) {
if(res.code == 200){
this.experLocalList.push(res.data);
}else{
this.experLocalList=[]
}
}
}).catch(error => {
console.log(error)
})
},
//
getDevices(){
let obj = {
"id":"",
}
let param = {
// encryptedData: AES.encrypt(JSON.stringify(obj))
encryptedData: JSON.stringify(obj)
}
this.$http.post(getDevices,param).then(res => {
if (res) {
if(res.code == 200){
this.experDevList.push(res.data);
}else{
this.experDevList=[]
}
}
}).catch(error => {
console.log(error)
})
},
//
getBasisDicts(){
let obj = {
"code":"sy_basis",
}
let param = {
// encryptedData: AES.encrypt(JSON.stringify(obj))
encryptedData: JSON.stringify(obj)
}
this.$http.post(getDicts,param).then(res => {
if (res) {
if(res.code == 200){
this.basisList.push(res.data);
}else{
this.basisList=[]
}
}
}).catch(error => {
console.log(error)
})
},
//
getTestBasicInfo(){
let obj = {
"id":this.sampleId,
"devTypeCode":this.devTypeCode,
}
let param = {
// encryptedData: AES.encrypt(JSON.stringify(obj))
encryptedData: JSON.stringify(obj)
}
this.$http.post(getTestBasicInfo,param).then(res => {
if (res) {
if(res.code == 200){
// this.$nextTick()
this.formData.sampleId=res.data.sampleId;
this.formData.devTypeCode=res.data.devTypeCode;
this.formData.devTypeName=res.data.devTypeName;
this.formData.devModule=res.data.devModule;
this.formData.sampleQuantity=res.data.sampleQuantity;
this.formData.sampleDate=res.data.sampleDate;
this.formData.customId=res.data.customId;
this.formData.customName=res.data.customName;
this.formData.experTime="";//
this.formData.nextExperTime="";//
this.formData.experLocalCode="";//
this.formData.experLocal="";//
this.formData.mainDevListData=res.data.mainDeviceVos[0];//
this.yjList=res.data.basisVos;//
this.infoList=res.data.sampleDeviceVos;//
this.configItemsList=res.data.configItemsVos;//-
}
}
}).catch(error => {
console.log(error)
})
},
//
viewTestData(){
let obj = {
"id":this.experId,
}
let param = {
// encryptedData: AES.encrypt(JSON.stringify(obj))
encryptedData: JSON.stringify(obj)
}
this.$http.post(viewTestData,param).then(res => {
if (res) {
if(res.code == 200){
// this.$nextTick()
this.formData.id=res.data.id
this.formData.sampleId=res.data.sampleId;
this.formData.devTypeCode=res.data.devTypeCode;
this.formData.devTypeName=res.data.devTypeName;
this.formData.devModule=res.data.devModule;
this.formData.sampleQuantity=res.data.sampleQuantity;
this.formData.sampleDate=res.data.sampleDate;
this.formData.customId=res.data.customId;
this.formData.customName=res.data.customName;
this.formData.experTime=res.data.experTime;//
this.formData.nextExperTime=res.data.nextExperTime;//
this.formData.experLocalCode=res.data.experLocalCode;//
this.formData.experLocal=res.data.experLocal;//
this.formData.mainDevListData=res.data.mainDeviceVos[0];//
this.yjList=res.data.basisVos;//
this.infoList=res.data.experDevVos;//
this.configItemsList=res.data.configItemsVos;//-
this.formData.experStand=res.data.experStand;//
this.formData.experConclu=res.data.experConclu;//
this.formData.remarsk=res.data.remarsk;//
}
}
}).catch(error => {
console.log(error)
})
},
experTimeConfirm(e){
this.experTimeShow = false;
this.formData.experTime = this.$u.date(e.value,'yyyy-mm-dd')
// this.$refs.eForm.validateField('experTime')
},
nextExperTimeConfirm(e){
this.nextExperTimeShow = false;
this.formData.nextExperTime = this.$u.date(e.value,'yyyy-mm-dd')
// this.$refs.eForm.validateField('nextExperTime')
},
//
experLocalConfirm(e){
this.experLocalShow = false;
this.formData.experLocalCode = e.value[0].id;
this.formData.experLocal = e.value[0].name;
// this.$refs.eForm.validateField('experLocal')
},
//
devContractDateConfirm(e){
this.devContractDateShow = false;
this.formData.mainDevListData.devContractDate = this.$u.date(e.value,'yyyy-mm-dd')
// this.$refs.eForm.validateField('experLocal')
},
experDevConfirm(e){
this.experDevShow = false;//experDevName experDevModule experDevCode devContractDate
this.formData.mainDevListData.experDevName = e.value[0].devName;
this.formData.mainDevListData.experDevModule = e.value[0].devModule;
this.formData.mainDevListData.experDevCode = e.value[0].devCode;
this.formData.mainDevListData.devContractDate = e.value[0].contractDate;
// this.$refs.eForm.validateField('experLocal')
},
//
//
addExperBasis(){
let obj={basisName:''}
let index=this.yjList.length-1
if(this.yjList.length<5){
if(this.yjList[index].basisName==''){
uni.showToast({
title: "请先选择试验依据后再添加",
icon: "none"
})
}else{
this.yjList.push(obj)
}
}
},
//
delExperBasis(){
let index=this.yjList.length-1
if(index>0){
this.yjList.splice(index,1)
}
},
chosenBasis(index){
console.log(index)
this.basisIndex = index;
this.experBasisShow = true;
},
experBasisConfirm(e){
this.experBasisShow = false;
this.yjList[this.basisIndex].basisName = e.value[0].name;
},
//-
goFillPage(item,index){
if(this.isView){
uni.navigateTo({//-
url: `/pages/test/testInfoFill?sampleId=${this.sampleId}&devTypeCode=${this.devTypeCode}&configItemsList=${JSON.stringify(this.configItemsList)}&itemData=${JSON.stringify(item)}&fillIndex=${index}&isView=isView`
})
}else{
uni.navigateTo({//-
url: `/pages/test/testInfoFill?sampleId=${this.sampleId}&devTypeCode=${this.devTypeCode}&configItemsList=${JSON.stringify(this.configItemsList)}&itemData=${JSON.stringify(item)}&fillIndex=${index}`
})
}
},
sumbitConfirm(){
this.$refs.uForm.validate().then(res=>{
let basisIndex=this.yjList.length-1;
if(this.yjList[basisIndex].basisName==''){
uni.showToast({
title: "试验依据不可为空,请选择或删除",
icon: "none"
})
}else{
this.formData.paramsData.yjList=this.yjList;
this.formData.paramsData.mainDevList=[this.formData.mainDevListData];
this.formData.paramsData.items=this.configItemsList.map(item=>{
item.item=item.itemList;
return item
});
let infoIndex=-1;
this.infoList.forEach((item,index)=>{
if(!item.devData||item.devData.length==0){
infoIndex=index
}
})
if(infoIndex>-1){
uni.showToast({
title: "试验信息未填写完整",
icon: "none"
})
}else{
this.formData.paramsData.experDevList=this.infoList;
console.log(this.formData)
let param = {
// encryptedData: AES.encrypt(JSON.stringify(obj))
encryptedData: JSON.stringify(this.formData)
}
if(this.formData.id&&this.formData.id!=""){
this.$http.post(editTestData,param).then(res => {
if (res) {
if(res.code == 200){
uni.showToast({
title: "试验编制修改成功",
icon: "none"
})
uni.navigateBack({
delta:1 //
})
}else{
uni.showToast({
title: "试验编制修改失败:"+res.msg,
icon: "none"
})
}
}
}).catch(error => {
console.log(error)
})
}else{
this.$http.post(addTestData,param).then(res => {
if (res) {
if(res.code == 200){
uni.showToast({
title: "试验编制成功",
icon: "none"
})
uni.navigateBack({
delta:1 //
})
}else{
uni.showToast({
title: "试验编制失败:"+res.msg,
icon: "none"
})
}
}
}).catch(error => {
console.log(error)
})
}
}
}
}).catch(err =>{
console.log(2222)
console.log('表单错误信息:', err);
})
},
},
}
</script>
<style lang="scss">
.page-content{
width: 100%;
height: 92vh;
position: absolute;
top:8vh;
padding: 0rpx 0;
background-color: #F3F3F3;
.page-content-scroll{
width: 100%;
height: 90vh;
margin: 20rpx 0;
// background-color: red;
}
.content-title{
width: 92%;
height: 80rpx;
margin: 0 auto;
display: flex;
align-items: center;
.title-left-border{
height: 28rpx;
width: 8rpx;
background: #0052D9;
margin-right: 8rpx;
}
.title-text{
font-weight: bold;
font-size: 28rpx;
}
}
.content-box{
width: 90%;
padding-left: 6%;
padding-right: 4%;
height: auto;
background: #FFF;
}
.add-btn{
width: 66rpx;
height: 34rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 40rpx;
border: 2rpx solid #0052D9;
margin:20rpx 20rpx;
}
.del-btn{
width: 66rpx;
height: 34rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 40rpx;
border: 2rpx solid red;
margin:20rpx 20rpx;
}
.item-number{
width: 30rpx;
height: 30rpx;
border-radius: 30rpx;
background:#0052D9;
color: #FFF;
line-height: 30rpx;
text-align: center;
font-size: 24rpx;
margin-right: 20rpx;
}
.submit-box {
width: 100%;
height: 100rpx;
position: fixed;
bottom: 0;
display: flex;
padding-bottom: 20rpx;
justify-content: space-between;
align-items: center;
background-color: #FFF;
.submit-btn {
width: 45%;
margin: 0 auto;
height: 75rpx;
font-size: 26rpx;
background: #0052D9;
color: #FFF;
box-shadow: 0px 4px 2px 0px rgba(81,147,254,0.15);
}
.submit-btn2{
width: 45%;
margin: 0 auto;
height: 75rpx;
font-size: 26rpx;
background: #F5F5F5;
box-shadow: 0px 4px 2px 0px rgba(81,147,254,0.15);
}
}
/deep/.u-textarea__count{
bottom: -20rpx;
}
/deep/.u-textarea--disabled{
background-color:#FFF;
}
}
</style>

View File

@ -0,0 +1,710 @@
<template>
<view>
<view class="topTab">
<view class="tab-header">
<view class="left" style="width: 30%;">
<image @click="customNavigateBack" src="@/static/img/back.png" mode=""></image>试验设备
</view>
<view class="right" style="justify-content: flex-end;width: 45%;">
<!-- 搜索 -->
<!-- <view class="text-btn" @click="openSearch">
<image src="@/static/images/search1.png" style="width: 40rpx;height: 40rpx;" mode=""></image>
</view> -->
<!-- 筛选 -->
<!-- <view class="text-btn" @click="filter">
<image src="@/static/images/filter.png" style="width: 50rpx;height: 50rpx;" mode=""></image>
</view> -->
<!-- 收样 -->
<!-- <view class="add-btn" @click="addCollect">
<u-icon name="plus" color="#FFF" size="24"></u-icon>
<text>收样</text>
</view> -->
</view>
</view>
</view>
<view class="page-content">
<view class="search" v-show="isShowSearch">
<u-search :showAction="true" style="width: 80%;margin: 0 auto;" :input-style="inputStyle" bgColor='#F3F3F3' :searchIconSize="36" v-model="searchValue" actionText="搜索" :animation="false" @custom="searchList" ></u-search>
</view>
<view class="main-box">
<!-- 列表 -->
<view class="list-box">
<u-list @scrolltolower="scrolltolower" :height="isShowSearch ? '76vh' : '82vh'">
<u-list-item v-for="(item, index) in listData" :key="index">
<view class="list-item" >
<view class="item-header" @click="checkDevice(item)">
<view class="header-name">
<u-checkbox-group v-model="item.checked" style="transform:scale(1.4)">
<u-checkbox :customStyle="{margin: '0rpx 20rpx'}" shape="circle" :label="''" :name="item.id"></u-checkbox>
</u-checkbox-group>
<text>{{item.devTypeName}} {{item.devModule}}</text>
</view>
<view style="margin-right: 40rpx;">
{{item.sampleNum}}
</view>
</view>
<view class="item-content">
<view class="content-box" v-if="item.remarks">
{{item.remarks}}
</view>
</view>
<view class="item-footer">
<view class="status-box">
<view class="foot-status">{{item.status}}</view>
<!-- <view class="foot-status2">审阅不通过</view> -->
</view>
<view class="btn-box">
<view class="foot-btn" v-if="item.status!='待试验'" @click="viewOrganization(item)">查看</view>
<view class="foot-btn1" v-if="item.status=='待试验'||item.status=='待提交'" @click="goOrganization(item)">编制</view>
</view>
</view>
</view>
</u-list-item>
</u-list>
</view>
</view>
<view class="bottom-box">
<!-- 固定底部 -->
<view style="width: 100%;height: 120rpx;position: absolute;bottom: 0;display: flex;background-color: #FFF;">
<view style="margin-left: 60rpx;font-size: 24rpx;margin-top: 10rpx;">
<u-checkbox-group v-model="checkAll" @change="checkedAll" style="transform:scale(1.4)">
<u-checkbox :customStyle="{marginTop: '20rpx'}" labelSize="12px" shape="circle" label="全选" name="1"></u-checkbox>
</u-checkbox-group>
</view>
<view style="margin-left: 20rpx;font-size: 24rpx;margin-top: 28rpx;">(已选{{chosenNum}})</view>
<view class="sumbit-btn" @click="commit">提交审阅</view>
</view>
</view>
<!-- 筛选表单 -->
<u-popup :show="showFilter" mode="right" @close="closeFilter" >
<view style="width: 100%;height: 96vh;position: relative;background-color: #eee;top: 4vh;">
<view class="search-box">
<view style="margin: 0 20rpx;"><u-icon name="arrow-left" size="36" @click="closeFilter"></u-icon></view>
<u-search style="margin-right:20rpx;" :showAction="true" :input-style="inputStyle" :searchIconSize="36" v-model="filterSearch" actionText="搜索" :animation="false" @custom="searchDevices" ></u-search>
</view>
<view class="filter-content">
<!-- 左侧一级分类 -->
<scroll-view class="primary" scroll-y>
<view class="item">
<text class="name"> 设备类别 </text>
</view>
</scroll-view>
<!-- 右侧二级分类 -->
<scroll-view class="secondary" scroll-y>
<view v-for="(item, index) in toolsList"
:key="item.id" class="item" @click="sampleDev = item.name">
<text class="name"> {{item.name}} </text>
<u-icon name="checkmark" color="#2979ff" size="32" v-if="sampleDev == item.name"></u-icon>
</view>
</scroll-view>
</view>
<view class="submit-box">
<u-button type="primary" shape="circle" class="submit-btn" @click="handleSearch"> </u-button>
<u-button shape="circle" class="submit-btn" @click="handleReset">重置</u-button>
</view>
</view>
</u-popup>
</view>
</view>
</template>
<script>
import { getDetailList,getToolsSelect,commitCheckTestData } from '@/service/url.js';
import tabHeader from '@/components/tab-Header.vue';
import eselect from '@/components/eselect.vue';
import searchSelect from '@/components/search-select.vue';
import AES from "@/utils/cryptoJs/aes.js";
export default {
components: {
tabHeader,
eselect,
searchSelect
},
data() {
return {
isShowSearch:false,
searchValue:'',
filterSearch:'',//-
inputStyle:{
fontSize:'24rpx',//
height:'60rpx',
},
sampleDev:'',
toolsList:[],
showFilter: false,
testId:'',
page:1,
listData:[],
checkAll:[],
chosenNum:0,
};
},
onLoad(option) {
console.log(option)
this.testId = option.id || '';
this.getToolsSelect()
},
onShow() {
this.loadmore()
},
methods: {
//
customNavigateBack() {
//
const pages = getCurrentPages(); //
const len = pages.length;
let backPage = ''; //
for (let i = len - 2; i >= 0; i--) {
//
if (pages[i].route !== 'pages/A/A') {
backPage = pages[i].route;
break;
}
}
if (backPage) {
uni.navigateBack({
delta: len - 1 - pages.findIndex(page => page.route === backPage) //
});
}
},
//
searchList(value){//
this.page = 1;
this.listData=[]
this.loadmore()
},
//
openSearch(){
this.searchValue="";
this.page = 1;
this.listData=[]
this.loadmore()
this.isShowSearch=!this.isShowSearch;
},
//-
searchDevices(value){
this.getToolsSelect()
},
//
getToolsSelect(){
let obj = {
"keyWord":this.filterSearch,
}
let param = {
// encryptedData: AES.encrypt(JSON.stringify(obj))
encryptedData: JSON.stringify(obj)
}
this.$http.post(getToolsSelect,param).then(res => {
if (res) {
if(res.code == '200'){
this.toolsList=res.data
}else{
this.toolsList=[]
}
}
}).catch(error => {
console.log(error)
})
},
//-
handleSearch(){
//
this.page = 1;
this.listData=[]
this.showFilter=false
this.loadmore()
},
//
handleReset(){
this.sampleDev = ''
this.handleSearch()
},
//1
scrolltolower() {
this.page += 1;
this.loadmore()
},
//
loadmore() {
let obj = {
"id":this.testId,
"page":this.page,
"limit":"10"
}
let param = {
// encryptedData: AES.encrypt(JSON.stringify(obj))
encryptedData: JSON.stringify(obj)
}
this.$http.post(getDetailList,param).then(res => {
if (res) {
console.log(res)
if(res.code == 200){
if(res.data?.length>0){
res.data.forEach(item=>{
item.checked=[];
// item.remarks=""
})
if(this.page == 1){
this.listData = res.data;
}else{
this.listData = [...this.listData, ...res.data];
}
}else{
console.log("没有更多了")
}
}
}
}).catch(error => {
console.log(error)
})
},
//
checkedAll(n){
if(n.length>0){
this.listData.forEach(item=>{
item.checked=[item.id]
})
this.chosenNum=this.listData.length;
}else{
this.listData.forEach(item=>{
item.checked=[]
})
this.chosenNum=0;
}
},
//
checkDevice(chosen){
this.listData.forEach(item=>{
if(item.id==chosen.id){
if(item.checked.length==0){
item.checked=[item.id]
}else{
item.checked=[]
}
}
})
},
//---
goOrganization(item){
if(item.status&&item.status!="待试验"){
uni.navigateTo({
url: `/pages/test/organization?experId=${item.experId}&sampleId=${item.sampleId}&devTypeCode=${item.devTypeCode}`
})
}else{
uni.navigateTo({
url: `/pages/test/organization?sampleId=${item.sampleId}&devTypeCode=${item.devTypeCode}`
})
}
},
//---
viewOrganization(item){
uni.navigateTo({
url: `/pages/test/organization?experId=${item.experId}&sampleId=${item.sampleId}&devTypeCode=${item.devTypeCode}&isView=isView`
})
},
//
commit(){
let arr = [];
this.listData.forEach(item=>{
if(item.checked.length>0){
arr.push(item.sampleId)
}
})
console.log(arr)
let obj = {
"ids":arr,
}
let param = {
// encryptedData: AES.encrypt(JSON.stringify(obj))
encryptedData: JSON.stringify(obj)
}
this.$http.post(commitCheckTestData,param).then(res => {
if (res) {
console.log(res)
if(res.code == 200){
uni.showToast({
title: "提交审阅成功",
icon: "none"
})
this.page = 1;
this.listData=[]
this.loadmore()
}
}
}).catch(error => {
console.log(error)
})
},
//Popup-
closeFilter() {
this.showFilter = false
console.log('closeFilter');
},
//Popup-
filter(){
this.showFilter = true;
console.log("筛选打开")
},
},
}
</script>
<style lang="scss">
/deep/.u-popup .u-slide-right-enter-active{
left: 0;
}
.searchInput{
height: 100%;
}
.page-content{
width: 100%;
height: 90vh;
position: absolute;
top:8.5vh;
padding: 0rpx 0;
background-color: #F3F3F3;
.search{
width: 90%;
height: 100rpx;
padding: 0 5%;
display: flex;
justify-content: center;
align-items: center;
background-color: #FFF;
}
.main-box{
width: 100%;
height: auto;
.list-box{
width: 94%;
max-height: 76vh;
overflow: hidden;
margin: 20rpx auto;
.list-item{
width: 100%;
height: auto;
background-color: #fff;
border-radius: 20rpx;
margin: 20rpx 0;
.item-header{
width: 100%;
height: auto;
line-height: 72rpx;
font-size: 28rpx;
// border: 1px dashed #E3E9FA;
display: flex;
align-items: center;
justify-content: space-between;
}
.header-name{
padding:10rpx 20rpx;
font-weight: bold;
display: flex;
align-items: center;
}
.item-content{
width: 100%;
height: auto;
border: 1px dashed #E3E9FA;
font-size: 24rpx;
.content-box{
width: 92%;
height: auto;
margin: 20rpx;
background-color: #F8F9FC;
padding: 10rpx;
}
}
.item-footer{
width: 100%;
height: 100rpx;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
.status-box{
width: 40%;
height:100%;
display: flex;
align-items: center;
.foot-status{
height: 48rpx;
padding: 0 10rpx;
line-height: 48rpx;
text-align: center;
background: #DDEFFF;
border-radius: 10rpx;
color: #007DEB;
font-size: 20rpx;
margin-left: 20rpx;
}
.foot-status2{
height: 48rpx;
padding: 0 10rpx;
line-height: 48rpx;
text-align: center;
background: #FFE7EB;
border-radius: 10rpx;
color: #FC4D72;
font-size: 20rpx;
margin-left: 20rpx;
}
}
.btn-box{
width: 45%;
height:100%;
display: flex;
align-items: center;
justify-content: flex-end;
.foot-btn{
width: 100rpx;
height: 50rpx;
line-height: 50rpx;
text-align: center;
background: #FFF;
border-radius: 10rpx;
color: #5973FD;
font-weight: bold;
font-size: 28rpx;
border: 1rpx solid #5973FD;
margin-right: 20rpx;
}
.foot-btn1{
width: 100rpx;
height: 50rpx;
line-height: 50rpx;
text-align: center;
background: #5973FD;
border-radius: 10rpx;
color: #FFF;
font-weight: bold;
font-size: 28rpx;
// border: 2rpx solid #5973FD;
margin-right: 20rpx;
}
}
}
}
}
}
.bottom-box{
width: 100%;
min-height: 120rpx;
transition: min-height 0.8s ease;
background-color: #FFF;
position: fixed;
bottom: 0;
.add-form{
width: 98%;
height: auto;
padding: 10rpx;
background-color: #FFF;
border-top-right-radius: 60rpx;
border-top-left-radius: 60rpx;
}
.sumbit-btn{
width: 160rpx;
height: 70rpx;
margin-right: 20rpx;
line-height: 70rpx;
text-align: center;
color: #FFF;
background: #0052D9;
position: absolute;right: 20rpx;top: 20rpx;
border-radius: 10rpx;
}
.open-btn{
width: 100%;
height: 40rpx;
position: absolute;
top: -30rpx;
display: flex;
justify-content: center;
}
}
.more-add-btn{
width: 120rpx;height: 60rpx;line-height: 60rpx;text-align: center;font-size: 26rpx;background: #CFE1FF;color: #0052D9;border-radius: 10rpx;
}
}
.visitor-form{
width: auto;
padding: 80rpx 20rpx;
}
.visitor-input-box{
}
.search-box{
width: 100%;
height: 100rpx;
position: fixed;
top: 4vh;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #FFF;
}
.filter-content{
width: 100%;
height: 87%;
position: absolute;
top: 100rpx;
flex: 1;
display: flex;
}
.submit-box {
width: 100%;
height: 100rpx;
position: fixed;
bottom: 0;
display: flex;
padding-bottom: 20rpx;
justify-content: space-between;
align-items: center;
background-color: #FFF;
.submit-btn {
width: 40%;
margin: 0 auto;
height: 65rpx;
font-size: 26rpx;
// background: linear-gradient( 90deg, #5193FE 0%, #00EEF0 100%);
box-shadow: 0px 4px 2px 0px rgba(81,147,254,0.15);
border-radius: 32rpx;
}
.submit-add{
width: 80%;
margin: 0 auto;
height: 65rpx;
font-size: 26rpx;
background: #0052D9;
box-shadow: 0px 4px 2px 0px rgba(81,147,254,0.15);
}
}
/* 一级分类 */
.primary {
overflow: hidden;
height: 100%;
width: 24%;
flex: none;
background-color: #f6f6f6;
.item {
display: flex;
justify-content: center;
align-items: center;
height: 96rpx;
font-size: 26rpx;
color: #0052D9;
font-weight: 600;
position: relative;
background-color: #FFF;
&::after {
content: '';
position: absolute;
left: 42rpx;
bottom: 0;
width: 96rpx;
border-top: 1rpx solid #e3e4e7;
}
}
.active {
background-color: #fff;
&::before {
content: '';
position: absolute;
left: 0;
top: 0;
width: 8rpx;
height: 100%;
background-color: #27ba9b;
}
}
}
.primary .item:last-child::after,
.primary .active::after {
display: none;
}
.secondary{
overflow: hidden;
height: 100%;
width: 80%;
background-color: #fff;
.item {
display: flex;
justify-content: space-between;
align-items: center;
height: 96rpx;
font-size: 26rpx;
padding: 0 50rpx;
position: relative;
&::after {
content: '';
position: absolute;
left: 42rpx;
bottom: 0;
width: 96rpx;
// border-top: 1rpx solid #e3e4e7;
}
}
.active {
background-color: #fff;
&::before {
content: '';
position: absolute;
left: 0;
top: 0;
width: 8rpx;
height: 50%;
background-color: #27ba9b;
}
}
}
.add-header{
width: 100%;
height: 80rpx;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
}
.add-form{
width: 100%;
height: 26vh;
background-color: #fff;
}
</style>

View File

@ -0,0 +1,360 @@
<template>
<view>
<view class="topTab">
<view class="tab-header">
<view class="left" style="width: 20%;">
<image @click="customNavigateBack" src="@/static/img/back.png" mode=""></image>
</view>
<view class="center" v-if="!isView">试验信息填写</view>
<view class="center" v-if="isView">试验信息查看</view>
<view class="right" style="justify-content: flex-end;width:25%;">
</view>
</view>
</view>
<view class="page-content">
<scroll-view class="page-content-scroll" scroll-y>
<u--form ref="uForm" labelPosition="left" labelWidth="100px" :model="formData" :rules="rules">
<!-- 样品信息 -->
<view class="content-title">
<view class="title-left-border"></view>
<view class="title-text">样品信息</view>
</view>
<view class="content-box">
<u-form-item label="设备类别" prop="devTypeName" borderBottom required>
<u--input v-model="formData.devTypeName" readonly border="none"></u--input>
</u-form-item>
<u-form-item label="规格型号" prop="devModule" borderBottom required>
<u--input v-model="formData.devModule" readonly border="none"></u--input>
</u-form-item>
<u-form-item label="生产厂家" prop="manufacturer" borderBottom required>
<u--input v-model="formData.manufacturer" border="none" :readonly="isView" maxlength="30" placeholder="请填写生产厂家"></u--input>
</u-form-item>
<u-form-item label="生产日期" prop="manufactureDate" borderBottom required v-if="isView">
<u--input v-model="formData.manufactureDate" placeholder="请选择生产日期" readonly border="none"></u--input>
</u-form-item>
<u-form-item label="生产日期" prop="manufactureDate" borderBottom required v-if="!isView" @click="manufactureDateShow=true">
<u--input v-model="formData.manufactureDate" suffixIcon="arrow-right" placeholder="请选择生产日期" readonly suffixIconStyle="color: #909399;fontSize:24px;" border="none"></u--input>
</u-form-item>
<u-datetime-picker
:show="manufactureDateShow"
mode="date"
@confirm="manufactureDateConfirm"
@cancel="manufactureDateShow = false"
></u-datetime-picker>
</view>
<!-- 外观状态 -->
<view class="content-title">
<view class="title-left-border"></view>
<view class="title-text">外观状态</view>
</view>
<view class="content-box">
<u-form-item label="外观状态" prop="devStatus" borderBottom required>
<u--input v-model="formData.devStatus" border="none" maxlength="30" :readonly="isView" placeholder="请填写外观状态"></u--input>
</u-form-item>
</view>
<!-- 测试 -->
<view v-for="(item,index) in configItemsList" :key="index">
<view class="content-title">
<view class="title-left-border"></view>
<view class="title-text">{{item.experTypeName}}</view>
</view>
<view class="content-box">
<u-form-item v-for="(titem,tindex) in item.itemList" :key="tindex" :label="titem.itemName" borderBottom>
<u--input v-model="titem.value" border="none" maxlength="30" :readonly="isView" placeholder="请填写"></u--input>
</u-form-item>
</view>
</view>
<view style="width: 100%;height: 10vh;"></view>
<view class="submit-box" v-if="!isView">
<u-button shape="square" class="submit-btn2" @click="customNavigateBack"> </u-button>
<u-button shape="square" class="submit-btn" @click="sumbitConfirm"> </u-button>
</view>
</u--form>
</scroll-view>
</view>
</view>
</template>
<script>
import { getTestBasicInfo,getDicts,getDevices } from '@/service/url.js';
import tabHeader from '@/components/tab-Header.vue';
import AES from "@/utils/cryptoJs/aes.js";
export default {
components: {
tabHeader
},
data() {
return {
isView:false,
sampleId:'',
devTypeCode:'',
fillIndex:0,
itemData:{},
configItemsList:[],
formData:{
// experId:'',
devId:'',// ID
departmentId:'',// ID
devTypeName:'',//
devModule:'',//
devCode:'',// ID
manufacturer:'',//
manufactureDate:'',//
devStatus:'',//
amount:"0", // -0
remarks:"''" ,//
devData:[]
},
manufactureDateShow:false,//
rules: {
'manufacturer': {
type: 'string',
required: true,
message: '请填写生产厂家',
trigger: ['blur', 'change']
},
'manufactureDate': {
type: 'string',
required: true,
message: '请选择生产日期',
trigger: ['blur', 'change']
},
'devStatus': {
type: 'string',
required: true,
message: '请填写外观状态',
trigger: ['blur', 'change']
},
},
};
},
onLoad(option) {
console.log(option)
if(option.isView&&option.isView!=""){
this.isView=true;
}else{
this.isView=false;
}
this.sampleId = option.sampleId || '';
this.devTypeCode = option.devTypeCode || '';
this.fillIndex = option.fillIndex || 0;
this.itemData = JSON.parse(option.itemData) || {};
this.configItemsList = JSON.parse(option.configItemsList) || [];
console.log(this.itemData)
if(this.itemData.devId){
this.formData.devId=this.itemData.devId;
this.formData.experId=this.itemData.experId;
this.formData.devStatus=this.itemData.devStatus;
this.formData.amount=this.itemData.amount;
this.formData.manufacturer=this.itemData.manufacturer;
this.formData.manufactureDate=this.itemData.manufactureDate;
this.formData.devData=JSON.parse(this.itemData.devData) || [];;
let sum=0;
this.configItemsList.forEach(item=>{
// item.itemList.length
item.itemList.forEach(sitem=>{
sitem.value=this.formData.devData[sum]||'';
sum=sum+1;
})
})
}else{
this.formData.devId=this.itemData.id;
this.configItemsList.forEach(item=>{
item.itemList.forEach(sitem=>{
sitem.value="";
})
})
}
this.formData.departmentId=this.itemData.departmentId;
this.formData.devCode=this.itemData.devCode;
this.formData.devModule=this.itemData.devModule;
this.formData.devTypeName=this.itemData.devTypeName;
},
onShow() {
},
methods: {
//
customNavigateBack() {
//
const pages = getCurrentPages(); //
const len = pages.length;
let backPage = ''; //
for (let i = len - 2; i >= 0; i--) {
//
if (pages[i].route !== 'pages/A/A') {
backPage = pages[i].route;
break;
}
}
if (backPage) {
uni.navigateBack({
delta: len - 1 - pages.findIndex(page => page.route === backPage) //
});
}
},
manufactureDateConfirm(e){
this.manufactureDateShow = false;
this.formData.manufactureDate = this.$u.date(e.value,'yyyy-mm-dd')
},
sumbitConfirm(){
let pages = getCurrentPages()//
let nowPage = pages[ pages.length - 1 ] //
let prevPage = pages[ pages.length - 2 ] //
this.$refs.uForm.validate().then(res=>{
// console.log('', this.formData);
// console.log(this.configItemsList)
var index=-1;
this.formData.devData=[]
this.configItemsList.forEach(item=>{
item.itemList.forEach((sitem,sindex)=>{
if(sitem.value==""){
index=sindex;
}else{
this.formData.devData.push(sitem.value)
}
})
})
if(index>-1){
uni.showToast({
title: "试验信息未填写完整,请填写完整或填无",
icon: "none"
})
}else{// prevPage.$vm.status = false //
prevPage.$vm.infoList[this.fillIndex]=this.formData;
uni.navigateBack({
delta:1 //
})
}
}).catch(err =>{
console.log(2222)
console.log('表单错误信息:', err);
})
},
},
}
</script>
<style lang="scss">
.page-content{
width: 100%;
height: 92vh;
position: absolute;
top:8vh;
padding: 0rpx 0;
background-color: #F3F3F3;
.page-content-scroll{
width: 100%;
height: 90vh;
margin: 20rpx 0;
// background-color: red;
}
.content-title{
width: 92%;
height: 80rpx;
margin: 0 auto;
display: flex;
align-items: center;
.title-left-border{
height: 28rpx;
width: 8rpx;
background: #0052D9;
margin-right: 8rpx;
}
.title-text{
font-weight: bold;
font-size: 28rpx;
}
}
.content-box{
width: 90%;
padding-left: 6%;
padding-right: 4%;
height: auto;
background: #FFF;
}
.add-btn{
width: 66rpx;
height: 34rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 40rpx;
border: 2rpx solid #0052D9;
margin:20rpx 20rpx;
}
.del-btn{
width: 66rpx;
height: 34rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 40rpx;
border: 2rpx solid red;
margin:20rpx 20rpx;
}
.item-number{
width: 30rpx;
height: 30rpx;
border-radius: 30rpx;
background:#0052D9;
color: #FFF;
line-height: 30rpx;
text-align: center;
font-size: 24rpx;
margin-right: 20rpx;
}
.submit-box {
width: 100%;
height: 100rpx;
position: fixed;
bottom: 0;
display: flex;
padding-bottom: 20rpx;
justify-content: space-between;
align-items: center;
background-color: #FFF;
.submit-btn {
width: 45%;
margin: 0 auto;
height: 75rpx;
font-size: 26rpx;
background: #0052D9;
color: #FFF;
box-shadow: 0px 4px 2px 0px rgba(81,147,254,0.15);
}
.submit-btn2{
width: 45%;
margin: 0 auto;
height: 75rpx;
font-size: 26rpx;
background: #F5F5F5;
box-shadow: 0px 4px 2px 0px rgba(81,147,254,0.15);
}
}
/deep/.u-textarea__count{
bottom: -20rpx;
}
}
</style>

View File

@ -34,13 +34,13 @@
<u-list @scrolltolower="scrolltolower" :height="isShowSearch ? '82vh' : '88vh'">
<u-list-item v-for="(item, index) in listData" :key="index">
<view class="list-item" >
<view class="item-header" @click="goCollectDetail(item)">
<view class="item-header" @click="goTestDetail(item)">
<view class="header-name">
{{item.customName}}
</view>
</view>
<view class="item-content" >
<view class="content-box" @click="goCollectDetail(item)">
<view class="content-box" @click="goTestDetail(item)">
<view class="item-text" >
<image class="iconImg" src="../../static/images/time.png" alt="">
<text class="label">派工时间</text>
@ -116,7 +116,7 @@
</template>
<script>
import { getTestList,getToolsSelect,getCustomNameSelected } from '@/service/url.js';
import { getTestList,getToolsSelect } from '@/service/url.js';
import tabHeader from '@/components/tab-Header.vue';
import eselect from '@/components/eselect.vue';
import searchSelect from '@/components/search-select.vue';
@ -138,91 +138,13 @@
},
sampleDev:'',
toolsList:[],
item:{
id:'111111122222222',
name1:"国网安徽省电力公司宿州市埇桥区供电公司解集供电所",
name2:"2024-7-10",
name3:"安全帽、白棕绳、测距杆、登高板、安全带",
name4:"P20240730-01",
name5:"人脸验证已通过!",
state:'1'
},
options: [{
value: "1",
label: "国网1111"
}, {
value: "2",
label: "国网2222",
}, {
value: "3",
label: "国网3333",
}, {
value: "4",
label: "国网4444",
}],
showFilter: false,
//
addPopup: false,
customerList:[],
addForm:{
customName:'',
customId:'',
sampleUser:'',
sampleTime:''
},
showDate: false,
showDept: false,
rules: {
'customName': {
type: 'string',
required: true,
message: '请选择单位',
trigger: ['blur', 'change']
},
'sampleTime': {
type: 'string',
required: true,
message: '请选择日期',
trigger: ['blur', 'change']
},
},
//
editPopup: false,
editForm:{
customName:'',
customId:'',
sampleUser:'',
sampleTime:''
},
showDate2: false,
showDept2: false,
eRules: {
'customName': {
type: 'string',
required: true,
message: '请选择单位',
trigger: ['blur', 'change']
},
'sampleTime': {
type: 'string',
required: true,
message: '请选择日期',
trigger: ['blur', 'change']
},
},
page:1,
page1:1,
listData:[],
listData1:[],
showTeam: false,//picked
teamList:[],//
sentData:{},//
editData:{},//
};
},
onLoad() {
this.getToolsSelect()
this.getCustomNameSelected()
},
onShow() {
this.loadmore()
@ -251,12 +173,14 @@
searchList(value){//
this.page = 1;
this.listData=[]
this.page1 = 1;
this.listData1=[]
this.loadmore()
},
//
openSearch(){
this.searchValue="";
this.page = 1;
this.listData=[]
this.loadmore()
this.isShowSearch=!this.isShowSearch;
},
//-
@ -289,8 +213,6 @@
//
this.page = 1;
this.listData=[]
this.page1 = 1;
this.listData1=[]
this.showFilter=false
this.loadmore()
},
@ -304,11 +226,6 @@
this.page += 1;
this.loadmore()
},
//2
scrolltolower1() {
this.page1 += 1;
this.loadmore()
},
//
loadmore() {
let obj = {
@ -340,38 +257,13 @@
}).catch(error => {
console.log(error)
})
// for (let i = 0; i < 15; i++) {
// this.listData.push(
// this.item
// )
// }
// console.log(this.listData)
},
//
goCollectDetail(item){
goTestDetail(item){
uni.navigateTo({
url: `/pages/samples/collectDevices?id=${item.id}&customName=${item.customName}&customId=${item.customId}&batchCode=${item.batchCode}`
url: `/pages/test/testDetail?id=${item.id}`
})
},
//-
closeAdd() {
this.addPopup = false
},
//
getCustomNameSelected(){
let obj = {}
this.$http.post(getCustomNameSelected,{}).then(res => {
if (res) {
if(res.code == '200'){
this.customerList.push(res.data);
}else{
this.customerList=[]
}
}
}).catch(error => {
console.log(error)
})
},
//Popup-
closeFilter() {
this.showFilter = false

View File

@ -18,6 +18,10 @@ export const getTestTeamSelected = '/szgqj/app/select/getTestTeamSelected';
export const getCustomNameSelected = '/szgqj/app/select/getCustomNameSelected';
//根据单位id获取部门下拉选
export const getDeptSelectedById = '/szgqj/app/select/getDeptSelectedById';
//试验地点下拉选
export const getDicts = '/szgqj/app/select/getDicts';
//试验地点下拉选
export const getDevices = '/szgqj/app/select/getDevices';
//权限
// 查询是否具有派工/收样权限
@ -47,15 +51,17 @@ export const getSampleLabelByQrCode = '/szgqj/app/qrCode/getSampleLabelByQrCode'
//试验管理
// 试验管理-列表
export const getTestList = '/szgqj/app/experimental/getList';
// 试验管理-详情
export const getDetailList = '/szgqj/app/experimental/getDetailList';
// 试验管理-编制页面基础数据
export const getTestBasicInfo = '/szgqj/app/experimental/getTestBasicInfo';
// 试验管理-新增试验数据
export const addTestData = '/szgqj/app/experimental/addTestData';
// 试验管理-查看试验数据详情
export const viewTestData = '/szgqj/app/experimental/viewTestData';
// 试验管理-修改试验数据
export const editTestData = '/szgqj/app/experimental/editTestData';
// 试验管理-提交审阅
export const commitCheckTestData = '/szgqj/app/experimental/commitCheckTestData';

View File

@ -1,8 +1,8 @@
var isReady=false;var onReadyCallbacks=[];
var isServiceReady=false;var onServiceReadyCallbacks=[];
var __uniConfig = {"pages":["pages/login/login","pages/index/index","pages/workbench/workbench","pages/my/my","pages/collectSamples/collectSamples","pages/collectSamples/searchCollect","pages/collectSamples/collectDevices","pages/collectSamples/addDevice"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#fff","backgroundColor":"#fff"},"tabBar":{"backgroundColor":"#fff","color":"#000000","selectedColor":"#0052D9","borderStyle":"black","list":[{"text":"首页","pagePath":"pages/index/index"},{"text":"工作台","pagePath":"pages/workbench/workbench"},{"text":"我的","pagePath":"pages/my/my"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"智慧楼宇","compilerVersion":"4.23","entryPagePath":"pages/login/login","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniRoutes = [{"path":"/pages/login/login","meta":{"isQuit":true},"window":{"navigationBarTitleText":"登录","enablePullDownRefresh":false,"navigationStyle":"custom"}},{"path":"/pages/index/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/workbench/workbench","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/my/my","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/collectSamples/collectSamples","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/collectSamples/searchCollect","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/collectSamples/collectDevices","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/collectSamples/addDevice","meta":{},"window":{"navigationStyle":"custom"}}];
var __uniConfig = {"pages":["pages/login/login","pages/index/index","pages/workbench/workbench","pages/my/my","pages/samples/collectSamples","pages/samples/searchCollect","pages/samples/collectDevices","pages/samples/addDevice","pages/test/testList","pages/test/testDetail","pages/test/organization"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#fff","backgroundColor":"#fff"},"tabBar":{"backgroundColor":"#fff","color":"#000000","selectedColor":"#0052D9","borderStyle":"black","list":[{"text":"首页","pagePath":"pages/index/index"},{"text":"工作台","pagePath":"pages/workbench/workbench"},{"text":"我的","pagePath":"pages/my/my"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"智慧楼宇","compilerVersion":"4.23","entryPagePath":"pages/login/login","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniRoutes = [{"path":"/pages/login/login","meta":{"isQuit":true},"window":{"navigationBarTitleText":"登录","enablePullDownRefresh":false,"navigationStyle":"custom"}},{"path":"/pages/index/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/workbench/workbench","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/my/my","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/samples/collectSamples","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/samples/searchCollect","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/samples/collectDevices","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/samples/addDevice","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/test/testList","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/test/testDetail","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/test/organization","meta":{},"window":{"navigationStyle":"custom"}}];
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 180 B

View File

Before

Width:  |  Height:  |  Size: 410 B

After

Width:  |  Height:  |  Size: 410 B