zhgdyunapp/pages/projectEnd/dangerBigProject/addFinallyAcceptance.vue

374 lines
8.9 KiB
Vue
Raw Normal View History

2024-04-28 15:34:42 +08:00
<template>
<view class="addPlan">
<headers class="fixedheader" :themeType="true" :showBack="true">
<view class="headerName">
2024-04-28 18:40:19 +08:00
{{title}}
2024-04-28 15:34:42 +08:00
</view>
</headers>
2024-04-28 18:40:19 +08:00
<view :style="{ 'padding-top': statusBarHeight + 45 + 'px' }">
2024-04-28 15:34:42 +08:00
<view class="plan-form">
2024-05-07 12:47:28 +08:00
<view class="form-item b-bottom">
<view class="form-lable">危大工程</view>
<view class="">{{engineeringName}}</view>
</view>
2024-04-28 15:34:42 +08:00
<view class="form-item b-bottom">
2024-04-28 18:40:19 +08:00
<view class="form-lable"><text class="tag">*</text>验收单位</view>
2024-05-05 14:31:08 +08:00
<picker @change="bindPickerChangeEnterprise" :value="enterpriseIndex" range-key="enterpriseName" :range="enterpriseInfoList">
2024-04-28 18:40:19 +08:00
<view style="display: flex;align-items: center;">
2024-05-05 14:31:08 +08:00
<view class="uni-input" style="margin-right: 10px;">{{enterpriseInfoList[enterpriseIndex] ? enterpriseInfoList[enterpriseIndex].enterpriseName : ""}}</view>
2024-04-28 18:40:19 +08:00
<uni-icons2 type="arrowright" size="20"></uni-icons2>
2024-04-28 15:34:42 +08:00
</view>
2024-04-28 18:40:19 +08:00
</picker>
</view>
<view class="form-item b-bottom">
<view class="form-lable"><text class="tag">*</text>验收人</view>
2024-05-05 14:31:08 +08:00
<picker @change="bindPickerChangePerson" :value="acceptanceIndex" range-key="workerName" :range="acceptancePersonList">
2024-04-28 18:40:19 +08:00
<view style="display: flex;align-items: center;">
2024-05-05 14:31:08 +08:00
<view class="uni-input" style="margin-right: 10px;">{{acceptancePersonList[acceptanceIndex] ? acceptancePersonList[acceptanceIndex].workerName : ""}}</view>
2024-04-28 18:40:19 +08:00
<uni-icons2 type="arrowright" size="20"></uni-icons2>
2024-04-28 15:34:42 +08:00
</view>
2024-04-28 18:40:19 +08:00
</picker>
</view>
<view class="form-item b-bottom">
<view class="form-lable"><text class="tag">*</text>验收时间</view>
<dateTimePicker :placeholder="'请选择验收时间'" :disabled="isDisabled"
2024-05-07 12:47:28 +08:00
:start="getNowTime()" :fields="'minute'" :default-value="planTime"
@change="bindPickerChange($event,'planTime')"
2024-04-28 18:40:19 +08:00
class="form-content">
<view class="uni-input">
<!-- <text>{{addForm.inspectTime}}</text> -->
<uni-icons v-if="!isDisabled" type="arrowright" color="#6C7178" />
</view>
</dateTimePicker>
</view>
2024-04-28 15:34:42 +08:00
</view>
2024-04-28 18:40:19 +08:00
</view>
2024-05-07 12:47:28 +08:00
<view class="save-btn" @click="saveForm">提交验收申请</view>
2024-04-28 15:34:42 +08:00
</view>
</template>
<script>
2024-04-28 18:40:19 +08:00
import dateTimePicker from '@/components/dateTimePicker/index.vue'
2024-05-05 14:31:08 +08:00
import { computed } from "vue";
2024-04-28 15:34:42 +08:00
export default {
2024-04-28 18:40:19 +08:00
components:{
dateTimePicker
},
2024-04-28 15:34:42 +08:00
data(){
return{
2024-05-07 12:47:28 +08:00
engineeringId: '',
//验收人相关属性
2024-05-05 14:31:08 +08:00
acceptanceIndex: '',
acceptancePerson: '',
acceptancePersonList: [],
2024-05-07 12:47:28 +08:00
//验收单位相关属性
2024-05-05 14:31:08 +08:00
enterpriseId: '',
enterpriseIndex: '',
2024-05-04 16:13:57 +08:00
enterpriseInfoList: [],
2024-05-05 14:31:08 +08:00
projectSn: '',
2024-05-04 16:13:57 +08:00
isDisabled: false,
2024-05-07 12:47:28 +08:00
planTime: '',
2024-05-04 16:13:57 +08:00
2024-04-28 15:34:42 +08:00
statusBarHeight: 0,
2024-05-08 14:36:13 +08:00
// title: "下发验证任务",
title: "验收申请",
2024-04-28 18:40:19 +08:00
inspectTime:'',
2024-05-07 12:47:28 +08:00
userInfo: {}
2024-04-28 15:34:42 +08:00
}
},
2024-05-04 16:13:57 +08:00
created() {
2024-05-05 14:31:08 +08:00
// this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn
2024-05-04 16:13:57 +08:00
},
2024-04-28 15:34:42 +08:00
onShow(){
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
},
onLoad(val){
2024-05-07 12:47:28 +08:00
console.log("========================");
console.log(val);
console.log("========================");
2024-05-05 14:31:08 +08:00
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn
2024-05-07 12:47:28 +08:00
this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
this.engineeringId = val.id
this.engineeringName = val.name
2024-05-04 16:13:57 +08:00
this.getEnterpriseInfoList()
2024-04-28 15:34:42 +08:00
},
2024-05-05 14:31:08 +08:00
watch:{
enterpriseId(newVal,oldVal){
if(newVal !== oldVal) {
this.sendRequest({
// url:'xmgl/enterpriseInfo/list',
url:'xmgl/systemUser/getProjectChilderSystemUserList',
method:'post',
data:{
enterpriseId: this.enterpriseId,
projectSn: this.projectSn,
},
success:res=>{
uni.hideLoading()
this.acceptancePersonList = res.result
console.log(this.acceptancePersonList);
}
})
}
}
},
2024-04-28 15:34:42 +08:00
methods:{
2024-05-05 14:31:08 +08:00
getEnterpriseInfoList(){
this.sendRequest({
2024-05-04 16:13:57 +08:00
url:'xmgl/enterpriseInfo/list',
method:'post',
data:{
// engineeringId: this.detailId,
projectSn: this.projectSn,
2024-05-05 14:31:08 +08:00
// projectSn: JSON.parse(uni.getStorageSync('projectDetail')).projectSn,
2024-05-04 16:13:57 +08:00
},
success:res=>{
uni.hideLoading()
console.log("xmgl/xzDangerousEngineeringAcceptance/list",res);
this.enterpriseInfoList = res.result;
}
})
},
2024-04-28 15:34:42 +08:00
saveForm(){
let data = {
2024-05-07 12:47:28 +08:00
projectSn: this.projectSn,
engineeringId: this.engineeringId, //危大工程Id
//申请验收相关属性
applyAcceptanceUnitId: this.userInfo.userEnterpriseId, //申请验收单位id
applyAcceptanceUserId: this.userInfo.userId, //申请验收人id
//验收相关属性
acceptanceUnitId: this.enterpriseId,
acceptanceUserId: this.acceptancePerson.userId,
planTime: this.planTime,
2024-04-28 15:34:42 +08:00
}
2024-05-07 12:47:28 +08:00
console.log(data);
if(!data.acceptanceUnitId){
2024-04-28 18:40:19 +08:00
uni.showToast({
2024-05-07 12:47:28 +08:00
title: '请选择验收单位',
2024-04-28 18:40:19 +08:00
icon: "none",
duration: 2000
});
return;
}
2024-05-07 12:47:28 +08:00
if(!data.acceptanceUserId){
2024-04-28 15:34:42 +08:00
uni.showToast({
2024-05-07 12:47:28 +08:00
title: '请选择验收人',
icon: "none",
duration: 2000
});
return;
}
if(!data.planTime){
uni.showToast({
title: '请选择验收时间',
2024-04-28 15:34:42 +08:00
icon: "none",
duration: 2000
});
return;
}
console.log(data)
this.sendRequest({
2024-05-07 12:47:28 +08:00
url:'xmgl/xzDangerousEngineeringAcceptance/add',
2024-04-28 15:34:42 +08:00
method:'post',
data: data,
success:res=>{
uni.hideLoading()
if(res.code==200){
uni.showToast({
title:'保存成功'
})
uni.navigateBack({})
}
console.log(res)
}
})
2024-04-28 18:40:19 +08:00
},
2024-05-07 12:47:28 +08:00
bindPickerChange(e){
this.planTime = e.f3
},
bindPickerChangePerson(e){
this.acceptanceIndex = e.target.value
this.acceptancePerson = this.acceptancePersonList[e.target.value]
},
bindPickerChangeEnterprise(e){
this.enterpriseIndex = e.target.value
this.enterpriseId = this.enterpriseInfoList[e.target.value].id
},
2024-05-05 14:31:08 +08:00
getNowTime() {
let dateTime
let yy = new Date().getFullYear()
let mm = new Date().getMonth() + 1
let dd = new Date().getDate()
let hh = new Date().getHours()
let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
dateTime = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss
console.log(dateTime)
return dateTime
2024-04-28 15:34:42 +08:00
}
}
}
</script>
<style lang="scss" scoped>
.addPlan{
min-height: 100%;
background: #F6F6F6;
.fixedheader{
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 2;
}
.save-btn{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 96rpx;
background: #2b8df3;
color: #fff;
text-align: center;
line-height: 96rpx;
}
.imgBox_wrap {
display: flex;
flex-wrap: wrap;
margin-top: 20rpx;
width: 100%;
min-height: 120rpx;
}
.imgBox {
width: 120rpx;
height: 120rpx;
display: inline-flex;
position: relative;
margin-right: 30rpx;
margin-bottom: 16rpx;
.img {
width: 100%;
height: 100%;
border-radius: 12rpx;
}
.deleteImg {
position: absolute;
right: -12rpx;
top: -18rpx;
uni-image{
width: 20rpx;
height: 20rpx;
}
}
}
.addImgBox {
border: 1px solid rgba(42, 43, 91, 0.1);
background-color: #f6f5f8;
width: 120rpx;
height: 120rpx;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 20rpx;
font-size: 24rpx;
margin-right: 12rpx;
uni-image{
width: 100%;
height: 100%;
}
// .icon-add {
// width: 36rpx;
// height: 36rpx;
// }
}
.b-bottom{
border-bottom: 1px solid #F6F6F6;
}
.f-column{
flex-direction: column;
}
.plan-form{
padding-top: 20rpx;
padding-bottom: 96rpx;
.form-item{
padding: 28rpx 24rpx;
display: flex;
justify-content: space-between;
2024-04-28 18:40:19 +08:00
align-items: center;
2024-04-28 15:34:42 +08:00
background: #fff;
.form-lable{
white-space: nowrap;
.tag{
color: #DD524D;
}
}
.from-input{
text-align: right;
}
2024-04-28 18:40:19 +08:00
.form-result{
.form-radio{
display: flex;
margin-left: 30rpx;
border: 1px solid #E5E5E5;
padding: 0;
border-radius: 12rpx;
overflow: hidden;
li{
list-style: none;
font-size: 14px;
background: #EEEEEE;
text-align: center;
width: 156rpx;
padding: 12rpx 0;
}
.active-radio{
background: #2b8df3;
color: #fff;
}
}
}
2024-04-28 15:34:42 +08:00
}
.txt-length{
color: #888;
text-align: right;
margin-top: 20rpx;
font-size: 14px;
}
.form-textarea{
margin-top: 30rpx;
width: 100%;
background: #F8F8F8;
border: 1px solid #f0f0f0;
height: 160rpx;
padding: 20rpx;
box-sizing: border-box;
// overflow: auto;
/deep/uni-textarea{
width: 100%;
height: 100%;
font-size: 28rpx;
.uni-textarea-compute{
width: 100%;
height: 100%;
overflow: auto;
}
}
}
2024-04-28 18:40:19 +08:00
.a-none{
align-items: initial;
}
2024-04-28 15:34:42 +08:00
}
}
</style>