dev:暂存危大工程代码

This commit is contained in:
Vce 2024-05-05 14:31:08 +08:00
parent 76a22d8f59
commit 49c6b0294e

View File

@ -9,18 +9,18 @@
<view class="plan-form">
<view class="form-item b-bottom">
<view class="form-lable"><text class="tag">*</text>验收单位</view>
<picker @change="bindPickerChange" :value="typeIndex" range-key="enterpriseName" :range="enterpriseInfoList">
<picker @change="bindPickerChangeEnterprise" :value="enterpriseIndex" range-key="enterpriseName" :range="enterpriseInfoList">
<view style="display: flex;align-items: center;">
<view class="uni-input" style="margin-right: 10px;">{{enterpriseInfoList[typeIndex] ? enterpriseInfoList[typeIndex].name : ""}}</view>
<view class="uni-input" style="margin-right: 10px;">{{enterpriseInfoList[enterpriseIndex] ? enterpriseInfoList[enterpriseIndex].enterpriseName : ""}}</view>
<uni-icons2 type="arrowright" size="20"></uni-icons2>
</view>
</picker>
</view>
<view class="form-item b-bottom">
<view class="form-lable"><text class="tag">*</text>验收人</view>
<picker @change="bindPickerChange" :value="typeIndex" range-key="name" :range="typeList">
<picker @change="bindPickerChangePerson" :value="acceptanceIndex" range-key="workerName" :range="acceptancePersonList">
<view style="display: flex;align-items: center;">
<view class="uni-input" style="margin-right: 10px;">{{typeList[typeIndex] ? typeList[typeIndex].name : ""}}</view>
<view class="uni-input" style="margin-right: 10px;">{{acceptancePersonList[acceptanceIndex] ? acceptancePersonList[acceptanceIndex].workerName : ""}}</view>
<uni-icons2 type="arrowright" size="20"></uni-icons2>
</view>
</picker>
@ -28,8 +28,8 @@
<view class="form-item b-bottom">
<view class="form-lable"><text class="tag">*</text>验收时间</view>
<dateTimePicker :placeholder="'请选择验收时间'" :disabled="isDisabled"
:start="checkedTime" :fields="'minute'" :default-value="inspectTime"
@change="bindPickerChange($event,'checkedTime')"
:start="getNowTime()" :fields="'minute'" :default-value="acceptanceTime"
@change="bindPickerChange($event,'acceptanceTime')"
class="form-content">
<view class="uni-input">
<!-- <text>{{addForm.inspectTime}}</text> -->
@ -45,17 +45,24 @@
<script>
import dateTimePicker from '@/components/dateTimePicker/index.vue'
import { computed } from "vue";
import { computed } from "vue";
export default {
components:{
dateTimePicker
},
data(){
return{
projectSn: '',
acceptanceIndex: '',
acceptancePerson: '',
acceptancePersonList: [],
enterpriseId: '',
enterpriseIndex: '',
enterpriseInfoList: [],
projectSn: '',
isDisabled: false,
checkedTime: '',
acceptanceTime: '',
statusBarHeight: 0,
title: "下发验证任务",
@ -80,23 +87,45 @@ import { computed } from "vue";
}
},
created() {
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail'))
// this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn
},
onShow(){
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
},
onLoad(val){
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn
this.formData.dangerousEngineeringId = val.id
this.getEnterpriseInfoList()
},
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);
}
})
}
}
},
methods:{
async getEnterpriseInfoList(){
await this.sendRequest({
getEnterpriseInfoList(){
this.sendRequest({
url:'xmgl/enterpriseInfo/list',
method:'post',
data:{
// engineeringId: this.detailId,
projectSn: this.projectSn,
// projectSn: JSON.parse(uni.getStorageSync('projectDetail')).projectSn,
},
success:res=>{
uni.hideLoading()
@ -108,97 +137,12 @@ import { computed } from "vue";
})
},
checkRadio(val){
this.formData.acceptanceResult = val
},
bindTextAreaBlur(e){
console.log(e)
this.formData.acceptanceDescribe = e.detail.value
},
bindInputBlur(e){
console.log(e)
this.formData.acceptanceRegion = e.detail.value
},
uploadImg() {
var that = this
uni.chooseImage({
count: 5 - that.formData.imgFileList.length,
success(res) {
const tempFilePaths = res.tempFilePaths;
uni.uploadFile({
url: that.url_config + 'upload/image', //
filePath: tempFilePaths[0],
name: 'files',
success: (uploadFileRes) => {
let data = {
name: JSON.parse(uploadFileRes.data).data[0].filename,
url: JSON.parse(uploadFileRes.data).data[0].imageUrl
};
that.formData.imgFileList.push(data)
}
});
}
})
},
//
deleteImg(val, type) {
let that = this;
uni.showModal({
title: '提示',
content: '确定删除该附件吗?',
success: function(res) {
if (res.confirm) {
if (type == 1) {
let fileArr = JSON.parse(JSON.stringify(that.formData.imgFileList));
fileArr.forEach((item, index) => {
if (item.url == val.url) {
fileArr.splice(index, 1)
}
})
that.formData.imgFileList = fileArr;
} else if (type == 2) {
let fileArr = JSON.parse(JSON.stringify(that.videoFileList));
fileArr.forEach((item, index) => {
if (item.url == val.url) {
fileArr.splice(index, 1)
}
})
that.videoFileList = fileArr;
}
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
previewImage(url) {
uni.previewImage({
urls: [url]
})
},
bindLength(e){
// console.log(e)
this.textareaLengh = e.detail.value.split('').length
},
saveForm(){
// console.log(this.formData)
let data = {
acceptanceDescribe: this.formData.acceptanceDescribe,
acceptanceRegion: this.formData.acceptanceRegion,
acceptanceResult: this.formData.acceptanceResult,
acceptanceType: this.formData.acceptanceType,
dangerousEngineeringId: this.formData.dangerousEngineeringId
aaa: this.formData.acceptanceDescribe,
bbb: this.formData.acceptanceRegion,
ccc: this.formData.acceptanceResult,
}
data.createUser = JSON.parse(uni.getStorageSync('userInfo')).userId;
let arr = []
@ -239,10 +183,34 @@ import { computed } from "vue";
}
})
},
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
},
bindPickerChange(e){
this.typeIndex = e.target.value
this.formData.acceptanceType = this.typeList[e.target.value].id
this.acceptanceTime = e.f3
console.log(this.acceptanceTime);
console.log("timetimetimetimetimetimetimetimetimetimetimetimetimetimetimetimetimetimetimetime");
console.log(e);
},
bindPickerChangePerson(e){
this.acceptanceIndex = e.target.value
this.acceptancePerson = this.typeList[e.target.value]
},
bindPickerChangeEnterprise(e){
this.enterpriseIndex = e.target.value
this.enterpriseId = this.enterpriseInfoList[e.target.value].id
console.log("=======================================================");
console.log(this.enterpriseId);
}
}
}