<template>
|
<view class="">
|
<!-- 整改信息 -->
|
<view class="workOrderDetail">
|
<view class="headerCont">
|
<p class="title">整改信息</p>
|
</view>
|
<u-line color="#bbb" />
|
<view>
|
<view class="mainContent">
|
<u--form labelPosition="left" label-width="80" :model="form" :border-bottom="false" :rules="rules"
|
ref="uForm">
|
<view class="" v-if="pageState">
|
<p class="rowTip">
|
<view class="rowTipContenet">
|
<view class="wholeLine">
|
<text class="rowTipContenetLabel">是否整改:</text>
|
<text class="rowTipContenetAll">
|
{{ dictObj.yesOrNo[basicInfor.isChange] ||''}}
|
</text>
|
</view>
|
</view>
|
<view class="rowTipContenet">
|
<view class="wholeLine">
|
<text class="rowTipContenetLabel">整改人:</text>
|
<text class="rowTipContenetAll">{{ basicInfor.changeName ||''}}</text>
|
</view>
|
</view>
|
</p>
|
</view>
|
<view class="" v-else>
|
<view class="formItemContent">
|
<u-form-item label="是否整改:" :required="!pageState" :border-bottom="false">
|
<u-radio-group v-model="form.isChange" @change="radioGroupChange">
|
<u-radio :key="index" v-for="(item, index) in list"
|
:custom-style="{marginRight: '8px'}" :label="item.name"
|
:name="item.value" />
|
</u-radio-group>
|
</u-form-item>
|
</view>
|
<view class="formItemContent">
|
<u-form-item label="整改人:" prop="changeName" :border-bottom="false"
|
:required="!pageState">
|
<u-input v-model="form.changeName" border="none" placeholder="请输入" type="text" />
|
</u-form-item>
|
</view>
|
</view>
|
<view class="formItemContent">
|
<u-form-item label="整改反馈:" prop="changeDescribe" :border-bottom="false"
|
:required="!pageState">
|
<view class="fonttest" v-if="pageState">
|
{{ basicInfor.changeDescribe ||''}}
|
</view>
|
<u--textarea v-else v-model="form.changeDescribe" border="none" />
|
</u-form-item>
|
</view>
|
<view class="formItemContent">
|
<u-form-item label="相关附件:" :border-bottom="false">
|
<view class="fileBox" v-if="pageState">
|
<cl-upload v-model="fileList" :add="false" :action="`''`" cloud-type="other"
|
:remove="false" />
|
</view>
|
<view class="fileBox" v-else>
|
<fileUpload class="rowTipContenetAll" :sys-code="sysCode"
|
@handleFile="handleFile" />
|
</view>
|
</u-form-item>
|
</view>
|
</u--form>
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
<script>
|
import fileUpload from '../components/fileUpload.vue'
|
export default {
|
components: {
|
fileUpload
|
},
|
props: {
|
basicInfor: {
|
type: Object,
|
default: () => {}
|
},
|
},
|
watch: {
|
basicInfor: {
|
handler: function(newValue, oldValue) {
|
// 响应数据变化
|
this.basicInfor = newValue
|
},
|
deep: true
|
}
|
},
|
computed: {
|
pageState() {
|
return this.basicInfor.pageState === 'view' || this.basicInfor.state >= 30
|
}
|
},
|
data() {
|
return {
|
sysCode: '1010202',
|
list: [{
|
name: '是',
|
value: 0,
|
}, {
|
name: '否',
|
value: 1,
|
}, ],
|
form: {
|
isChange: 0,
|
changeName: '',
|
changeDescribe: '',
|
},
|
dictObj: JSON.parse(uni.getStorageSync('dictObj') || '[]'),
|
fileList: [],
|
fileBaseList: [],
|
baseUrl: this.$storage.get('baseUrl'),
|
rules: {
|
'changeName': {
|
required: true,
|
message: '请输入',
|
trigger: ['blur', 'change']
|
},
|
'changeDescribe': {
|
required: true,
|
message: '请输入',
|
trigger: ['blur', 'change']
|
},
|
}
|
}
|
},
|
onLoad: function(option) {
|
//option为object类型,会序列化上个页面传递的参数
|
console.log(option) //打印出上个页面传递的参数。
|
},
|
onReady() {
|
//onReady 为uni-app支持的生命周期之一
|
this.$refs.uForm.setRules(this.rules)
|
},
|
mounted() {
|
if (this.basicInfor.fileChangeList && this.basicInfor.fileChangeList.length > 0) {
|
this.basicInfor.fileChangeList.forEach(item => {
|
let name = item.fileType === 1 ? 'name.png' : 'name.mp4'
|
this.fileList.push(`${this.baseUrl}/file/preview/${item.fileId}?${name}`) // 原图
|
})
|
}
|
let userInfor = JSON.parse(uni.getStorageSync('userInfor') || '{}')
|
console.log('userInfor', userInfor)
|
if (this.basicInfor.pageState === 'edit') {
|
this.form.changeName = userInfor.userName
|
}
|
},
|
methods: {
|
radioGroupChange(e) {
|
console.log('radioGroupe,e', e)
|
},
|
handleFile(data) {
|
this.fileBaseList = data
|
this.form.fileChangeList = this.fileBaseList
|
},
|
formVali() {
|
return new Promise((resolve, reject) => {
|
if (!this.pageState) {
|
this.$refs.uForm.validate().then(res => {
|
resolve(true)
|
}).catch(errors => {
|
reject(false)
|
uni.$u.toast('校验失败')
|
})
|
} else {
|
resolve(true)
|
}
|
})
|
}
|
},
|
}
|
</script>
|
<style scoped lang="scss">
|
/deep/.u-line {
|
margin: 19.23rpx 0px !important;
|
}
|
|
.workOrderDetail {
|
border: 1px solid #bbb;
|
border-radius: 5px;
|
margin: 19.23rpx;
|
padding: 19.23rpx;
|
color: #101010;
|
font-weight: 700;
|
font-size: 30.77rpx;
|
|
.headerCont {
|
display: flex;
|
justify-content: space-between;
|
font-size: 30.77rpx;
|
}
|
|
.mainContent {
|
margin-bottom: 10px;
|
font-weight: 500;
|
|
.rowTip {
|
display: flex;
|
padding: 5px 0;
|
border-bottom: 1px dashed #bbb;
|
|
.wholeLine {
|
display: flex;
|
width: 100%;
|
align-items: center;
|
|
.rowTipContenetLabel {
|
min-width: 144.23rpx;
|
font-size: 28.85rpx;
|
text-align: left;
|
}
|
|
.rowTipContenetAll {
|
font-size: 28.85rpx;
|
width: calc(100% - 144.23rpx);
|
}
|
}
|
|
.rowTipContenet {
|
width: 50%;
|
text-align: left;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
white-space: nowrap;
|
|
.butsName {
|
display: inline-block;
|
margin-left: 19.23rpx;
|
color: #1990ff;
|
}
|
}
|
}
|
|
.rowTipContenet_right {
|
text-align: right !important;
|
}
|
}
|
}
|
</style>
|