qa-prevention-gwj-first-app/pages/application/accesscontrol/carmanage/depttoexamine/detail.vue

445 lines
14 KiB
Vue
Raw Normal View History

2023-11-07 09:43:46 +08:00
<template>
<view>
<cu-custom bgColor="bg-gradual-blueness" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">车辆入场申请</block>
</cu-custom>
<view class="form">
<view class="wui-form-list">
<view class="cu-form-group">
<view class="title">申请来源</view>
<input :disabled="forbidEdit" placeholder="请输入编号" :value="validStr(form.EXAMINE_DEPARTMENT_ID) ? '外来车辆扫码申请' : form.NAME+'申请'"></input>
</view>
<view class="cu-form-group">
<view class="title">来源单位</view>
<input :disabled="forbidEdit" v-model="form.SOURCE_UNIT" placeholder="请输入编号"></input>
</view>
<view class="cu-form-group">
<view class="title">车牌号</view>
<input :disabled="forbidEdit" v-model="form.LICENSE_PLATE" placeholder="请输入编号"></input>
</view>
<view class="cu-form-group">
<view class="title">申请用时</view>
<input :disabled="forbidEdit" v-model="form.APPLICATION_TIME" placeholder="请输入编号"></input>
</view>
<view class="cu-form-group">
<view class="title">车型</view>
<input :disabled="forbidEdit" v-model="form.MODEL_NAME" placeholder="请输入编号"></input>
</view>
<view class="cu-form-group">
<view class="title">来港事由</view>
<input :disabled="forbidEdit" v-model="form.COMING_REASON" placeholder="请输入来港事由"></input>
</view>
<view class="cu-form-group">
<view class="title">驾驶证照片</view>
{{form.driverImageList.length}}/1
</view>
<view class="cu-form-group" style="padding-top:20upx">
<view class="grid col-4 grid-square flex-sub">
<view class="bg-img" v-for="(item,index) in form.driverImageList" :key="index" @tap="showImg($event, 'driverImageList')" :data-url="baseImgPath+form.driverImageList[index].FILEPATH">
<image :src="baseImgPath+form.driverImageList[index].FILEPATH" mode="aspectFill"></image>
<view class="cu-tag bg-red" @tap.stop="delImg($event, 'driverImageList')" :data-index="index" v-if="!forbidEdit">
<text class='cuIcon-close'></text>
</view>
</view>
<view class="solids" @tap="chooseImg('driverImageList')" v-if="form.driverImageList.length<1 && !forbidEdit">
<text class='cuIcon-cameraadd'></text>
</view>
</view>
</view>
<view class="cu-form-group">
<view class="title">行驶证照片</view>
{{form.drivingImageList.length}}/1
</view>
<view class="cu-form-group" style="padding-top:20upx">
<view class="grid col-4 grid-square flex-sub">
<view class="bg-img" v-for="(item,index) in form.drivingImageList" :key="index" @tap="showImg($event, 'drivingImageList')" :data-url="baseImgPath+form.drivingImageList[index].FILEPATH">
<image :src="baseImgPath+form.drivingImageList[index].FILEPATH" mode="aspectFill"></image>
<view class="cu-tag bg-red" @tap.stop="delImg($event, 'drivingImageList')" :data-index="index" v-if="!forbidEdit">
<text class='cuIcon-close'></text>
</view>
</view>
<view class="solids" @tap="chooseImg('drivingImageList')" v-if="form.drivingImageList.length<1 && !forbidEdit">
<text class='cuIcon-cameraadd'></text>
</view>
</view>
</view>
<view class="cu-form-group">
<view class="title">车内人员数</view>
<input :disabled="forbidEdit" v-model="form.NUMBER_PEOPLE_CAR" placeholder="请输入编号"></input>
</view>
<view v-if="form.EXAMINE_PEOPLE" class="cu-form-group">
<view class="title">审核人</view>
<input :disabled="forbidEdit" v-model="form.EXAMINE_PEOPLE"></input>
</view>
<view v-if="form.APPROVE_PEOPLE" class="cu-form-group">
<view class="title">审批人</view>
<input :disabled="forbidEdit" v-model="form.APPROVE_PEOPLE"></input>
</view>
<view v-if="form.CONFIRM_PEOPLE" class="cu-form-group">
<view class="title">确认人</view>
<input :disabled="forbidEdit" v-model="form.CONFIRM_PEOPLE"></input>
</view>
<view class="cu-form-group">
<view class="title">状态</view>
<text>
{{translate(form.STATE)}}
</text>
</view>
<view v-if="form.REJECTOPINION && form.STATE === '6'" class="cu-form-group">
<view class="title">打回原因</view>
<input :disabled="forbidEdit" v-model="form.REJECTOPINION"></input>
</view>
<view v-if="form.TIME_IN" class="cu-form-group">
<view class="title">进场时间</view>
<input :disabled="forbidEdit" v-model="form.TIME_IN"></input>
</view>
<view v-if="form.TIME_OUT" class="cu-form-group">
<view class="title">出场时间</view>
<input :disabled="forbidEdit" v-model="form.TIME_OUT"></input>
</view>
</view>
<view class="wui-form-list" style="padding-bottom: 10upx;">
<view class="cu-form-group">
<view class="title">来访人员列表</view>
</view>
<view v-for="(item,index) of form.personList" :key="item.FOREIGNCAR_DETAILS_ID" :data-id="item.FOREIGNCAR_DETAILS_ID" class="add_pard_item">
<view class="cu-form-group">
<text>姓名:{{item.NAME}}</text>
</view>
<view class="cu-form-group">
<text>手机号:{{item.PHONO_NUMBER}}</text>
</view>
</view>
</view>
</view>
<view class="cu-bar btn-group" style="margin-top: 30upx;">
<button v-if="!forbidEdit" class="cu-btn bg-blue margin-tb-sm lg" @click="$noMultipleClicks(goSubmit)">
</button>
<button v-if="forbidEdit" class="cu-btn bg-green margin-tb-sm lg" @click="$noMultipleClicks(goback)"></button>
</view>
<view class="padding flex flex-direction"></view>
</view>
</template>
<script>
import {
basePath,
corpinfoId,
loginUser,
loginSession,
formatDate,
baseImgPath
} from '@/common/tool.js';
import tkiTree from "@/components/select-tree/select-tree.vue"
import ruiDatePicker from '@/components/rattenking-dtpicker/rattenking-dtpicker.vue';
import sign from '@/components/sign/sign.vue';
export default {
components: {
tkiTree,
ruiDatePicker,
sign
},
data() {
return {
noClick: true,
baseImgPath:baseImgPath,
msg:'add',
form: {
SOURCE_UNIT: '',
LICENSE_PLATE: '',
MODEL: '',
NUMBER_PEOPLE_CAR: '',
},
statusList: [
{ id: '0', name: '未提交' },
{ id: '1', name: '待审核' },
{ id: '2', name: '待审批' },
{ id: '3', name: '待确认' },
{ id: '4', name: '进场' },
{ id: '5', name: '出场' },
{ id: '6', name: '已打回' },
{ id: '7', name: '待归档' },
{ id: '8', name: '已归档' }
],
rules: [
{name: 'SOURCE_UNIT', message: '请输入来源单位'},
{name: 'LICENSE_PLATE', message: '请输入车牌号'},
{name: 'STARTTIME', message: '请选择开始时间'},
{name: 'ENDTIME', message: '请选择结束时间'},
{name: 'MODEL', message: '请输入车型'},
{name: 'NUMBER_PEOPLE_CAR', message: '请输入人员数'},
],
treeNode: [],
forbidEdit: false,
todayDate: formatDate(new Date(), 'yyyy-MM-dd hh:mm'),
modalShow: false,
imgList: [],
workUnitManagerList: [],
branchApproverList: [],
}
},
onLoad(event) {
if (event.id) {
console.log(event.id)
this.FOREIGNCAR_ID = event.id
this.forbidEdit = true
this.getData();
}
},
methods: {
getData() {
var _this = this;
uni.showLoading({
title: '请稍候'
})
uni.request({
url: basePath + '/app/foreigncar/goEdit',
method: 'POST',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
FOREIGNCAR_ID: this.FOREIGNCAR_ID,
CORPINFO_ID :corpinfoId,
},
success: (res) => {
if ("success" === res.data.result) {
this.form = res.data.pd;
console.log(this.form)
uni.hideLoading();
} else if ("exception" === res.data.result) {
uni.showToast({
title: '错误',
duration: 2000
});
}
}
});
},
goSubmit() {
var _this = this;
let required = true
uni.showLoading({
title: '请稍候'
})
this.rules.map(({name,message}) => {
if (!this.form[name]) {
uni.showToast({
icon: 'none',
title: message,
duration: 1500
});
required = false
}
})
if (!required) {
return
}
const formData={}
Object.keys(this.form).map(key => {
formData[key]=this.form[key]
})
formData.CORPINFO_ID=corpinfoId
formData.loginUserId=loginUser.USER_ID
formData.loginUserName=loginUser.USERNAME
formData.DEPARTMENT_ID=loginUser.DEPARTMENT_ID,
uni.request({
url: basePath + "/app/foreigncar/"+_this.msg,
method: 'POST',
dataType: 'json',
header:{
'Content-type':'application/x-www-form-urlencoded'
},
data: formData,
success: (res) => {
uni.showToast({
icon:'none',
title: '保存成功',
duration: 2000
});
_this.goback()
},
fail: (err) => {
uni.hideLoading();
uni.showModal({
content: err.errMsg,
showCancel: false
});
}
})
},
changeJobStartTime(e) {
this.form.STARTTIME = e
},
changeJobEndTime(e) {
this.form.ENDTIME = e
},
zgtreeCancel(e) {
this.isUps = false;
},
translate(id) {
for (var i = 0; i < this.statusList.length; i++) {
if (this.statusList[i].id == id) return this.statusList[i].name
}
},
getUserList(list, DEPARTMENT_ID) {
//发送 post 请求
var _this = this;
uni.request({
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
url: basePath + '/app/sys/listUser',
data: {
DEPARTMENT_ID, NOMAIN:'1',
tm: new Date().getTime()
},
success: function (res) {
if ("success" == res.data.result) {
_this[list] = res.data.userList;
} else {
uni.showToast({
title: res.data.message,
duration: 2000
});
}
}
})
},
chooseLocation() {
var _this = this
uni.navigateTo({
2023-12-11 17:15:23 +08:00
url: '/pages/map/mapPro',
2023-11-07 09:43:46 +08:00
events: {
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
acceptDataFromOpenedPage: function (e) {
_this.form.LONGITUDE = e.data.longitue;
_this.form.LATITUDE = e.data.latitude;
}
},
})
},
chooseImg(list) {
var _this = this
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['camera', 'album'], //从相册选择
success: (res) => {
for (let i = 0; i < res.tempFilePaths.length; i++) {
let img = {};
img.id = Math.random();
img.FILEPATH = res.tempFilePaths[i];
_this.form[list].push(img)
}
}
})
},
showImg(e,list) {
let files =[];
for(var i = 0; i < this.form[list].length; i++){
files.push(this.baseImgPath+this.form[list][i].FILEPATH)
}
uni.previewImage({
urls: files,
current: e.currentTarget.dataset.url
});
},
delImg(e, list) {
var _this = this
var modalText = '确定要删除驾驶证照片吗?'
if (list === 'drivingImageList') {
modalText = '确定要删除行驶证照片吗?'
}
uni.showModal({
title: '双控平台',
content: modalText,
cancelColor: "#000000",
cancelText: '取消',
confirmText: '确定',
success: res => {
if (res.confirm) {
_this.form[list].splice(e.currentTarget.dataset.index, 1)
}
}
})
},
goback() {
uni.navigateBack({
delta: 1
});
uni.hideLoading();
},
}
}
</script>
<style>
.right_icon {
position: relative;
padding-right: 36upx;
width: 200upx;
text-align: right;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.right_icon ::after {
font-family: cuIcon;
display: block;
content: "\e6a3";
position: absolute;
font-size: 17px;
color: #8799a3;
line-height: 50px;
width: 30px;
text-align: center;
top: -28upx;
bottom: 0;
right: -22upx;
margin: auto;
}
.modal_content {
display: flex;
text-align: left;
}
.modal_left {
flex-basis: 50%;
padding: 50upx 20upx;
border-right: 1px solid #000000;
}
.modal_right {
flex-basis: 50%;
padding: 50upx;
}
.modal_left_title, .modal_right_title {
font-size: 16px;
color: #000000;
font-weight: 700;
}
.checkbox-item {
display: flex;
align-items: center;
padding: 0 30upx;
min-height: 100upx;
background-color: #ffffff;
border-bottom: 1upx solid #ddd;
}
.checkbox-item:last-child {
border-bottom: none;
}
</style>