123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485 |
- <template>
- <view>
- <view class="head-approve-main" >
- <view class="head-approve">
- <view class="head-approve-a">
- <view class="head-approve-a1">
- <u-avatar size="36" :src="formData.headImg" class="img"></u-avatar>
- <view class="head-approve-2">
- {{formData.applyPersonName}}
- </view>
- </view>
-
- <view class="head-approve-3">申请了<span class="head-approve-2" style="color:#2196F3;">{{fieldInfo.title}}</span></view>
- </view>
- <view class="head-approve-b" :style="{
- color:recordStatusColor(formData.status),
- borderColor:recordStatusColor(formData.status),
- }" >
- <span >{{formData.statusN}}</span>
- </view>
-
- </view>
- <view class="head-approve-info">
- <view>申请人部门:{{formData.orgName}}</view>
- <view>申请时间:{{formData.createTime}}</view>
- </view>
- </view>
-
- <view class="businessMain" :style="'font-size:'+fieldInfo.fontsize+'rpx'">
-
-
- <view class="businessTitle" v-if="false">{{fieldInfo.title}}</view>
- <view v-for="(item,i) in fieldList" :key="i" class="oawork-item" :class="getClass(item)">
- <template v-if="item.type.indexOf('uview')>-1">
- <view v-if="item.type.indexOf('divider')>-1">
- <u-divider bg-color="#fff" border-color="#6d6d6d">{{item.text}}</u-divider>
- </view>
- <view v-if="item.type.indexOf('stepBtn')>-1&&item.isEdit" style=" text-align: center;" >
- <u-button @click="stepBtn" type="warning" size="medium">{{item.text}}</u-button>
- </view>
- </template>
- <template v-else>
-
-
- <view class="oawork-item1">
- <view class="oawork-item1_a">{{item.serial}}{{item.text}}
- </view>
- <view class="oawork-item1_b">
- <template v-if="item.view">
- {{formData[item.key]?formData[item.key]:getViewItem(item)}}
- </template>
- <template v-else>
- <template v-if="item.type.indexOf('text')>-1">
- <u-input v-if="item.isEdit" v-model="formData[item.key]" :placeholder="'请输入'+item.text"
- :placeholderStyle="placeholderStyle" class="oawork-line"
- :customStyle="{textAlign: 'right'}" />
- <span v-else >{{formData[item.key]}}</span>
-
-
- </template>
- <template v-if="item.type.indexOf('textnumber')>-1">
- {{formData[item.key]}}
-
- </template>
-
- <template v-if="item.type.indexOf('radio')>-1">
-
- <u-radio-group v-model="formData[item.key]">
- <u-radio v-for="(item, index) in item.list?item.list:radioListDefault"
- :key="index" :name="item.value">
- {{item.name}}
- </u-radio>
- </u-radio-group>
-
-
- </template>
-
-
- <template v-if="item.type.indexOf('selecttime')>-1">
-
- <!-- <u-calendar max-date="2060-01-01" v-model="showCalendar" mode="date"
- @change="changeCalendar"></u-calendar>
- <view @click="showCalendar = true,keyCalendar=item">
- {{formData[item.key]?formData[item.key]:getViewItem(item)}}</view> -->
- {{formData[item.key]?formData[item.key]:getViewItem(item)}}
- </template>
- <template v-if="item.type.indexOf('selecttime2')>-1">
-
- <!-- <u-calendar max-date="2060-01-01" v-model="showCalendar" mode="range"
- @change="changeCalendar2"></u-calendar>
- <view @click="showCalendar = true,keyCalendar=item">
- {{formData[item.key]?formData[item.key]:createTime}}至{{formData[item.key2]?formData[item.key2]:createTime}}
- </view>
- -->
- {{formData[item.key]?formData[item.key]:createTime}}至{{formData[item.key2]?formData[item.key2]:createTime}}
- </template>
- </template>
-
-
- </view>
- <view class="oawork-item1_c" v-if="item.type.indexOf('unit')>-1">
- {{item.unit}}
- </view>
- </view>
-
- <view class="oawork-item2">
-
- <template v-if="item.type.indexOf('textlong')>-1">
-
- <u-input v-if="item.isEdit" v-model="formData[item.key]" :placeholder="'请输入'+item.text"
- :placeholderStyle="placeholderStyle" class="oawork-line" type="textarea" />
-
- <u-input v-else v-model="formData[item.key]" placeholder="" :disabled="true"
- :placeholderStyle="placeholderStyle" class="oawork-line" type="textarea" />
-
- </template>
- <template v-if="item.type.indexOf('upload')>-1">
- <view class="upload">
-
- <u-upload-file-all :isedit="0" ref="uUpload" :max-size="50 * 1024 * 1024"
- :file-max-size="50 * 1024 * 1024"
- :file-list="fileList"></u-upload-file-all>
- </view>
- </template>
- <template v-if="item.type.indexOf('texteditor')>-1">
-
- <view class="ql-containerMain">
-
- <editor id="editor" class="ql-container"
-
- show-img-size
- show-img-toolbar show-img-resize
- :read-only="true" @ready="onEditorReady(formData[item.key])">
- </editor>
- </view>
- </template>
-
- </view>
- </template>
-
- </view>
-
- </view>
- </view>
- </template>
- <script>
- import * as API from '@/apis/pagejs/oa.js'
- export default {
- name:"ApproveInfo",
- props:{
- fieldInfo: {},
- personInfo: {},
- createTime: "",
- createTime2: "",
- stepNum:"",
-
- fileList:{
- type: Array,
- default () {
- return [];
- }
- },
- formData: {},
- placeholderStyle: "font-size: 24rpx",
- },
- watch: {
- fieldInfo: {
- immediate: true,
- handler(val) {
- //("fieldList",val)
- if(val){
- this.fieldList=val.list
- }
-
- }
- },
-
- // 监听lists的变化,发出事件
- lists(n) {
- this.$emit('on-list-change', n, this.index);
- }
- },
- data() {
- return {
- stepSubmit:false,
- radioListDefault: [{
- name: '是',
- value: '1'
- }, {
- name: '否',
- value: '0'
- }, ],
- fieldList: [],
- };
- },
- created() {
-
- },
- methods:{
- submitApi() {
-
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- this.formData.draftStatus = 0
- this.formData.applyDate=""
- API.application(this.fieldInfo.url, this.formData).then((res) => {
- uni.hideLoading();
-
- uni.showModal({
- title:"提示",
- showCancel:false,
- content:"操作成功!",
-
- success() {
-
- }
- })
- ////(this.formData.maintenanceDescription,res.data.applyContent.maintenanceDescription)
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- stepBtn(){
- this.submitApi()
- },
- // getRole(item){
- // if(item.role){
- // if(item.role.indexOf("step1")>-1){
- // this.stepSubmit=true
- // return true
- // }
- // }else{
- // return false
- // }
- // },
- onEditorReady(html) {
- // #ifdef MP-BAIDU
- this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editor');
- // #endif
-
- // #ifdef APP-PLUS || MP-WEIXIN || H5
- uni.createSelectorQuery().select('#editor').context((res) => {
- this.editorCtx = res.context
-
- if(this.editorCtx){
- var _this=this
- console.log(html)
- this.editorCtx.setContents({
- html:html
- })
- }
-
- }).exec()
- // #endif
- },
-
- init() {
- // this.personInfo = this.carhelp.getPersonInfo()
- // this.createTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}');
- // this.createTime2 = parseUnixTime(currentTimeStamp());
-
- for (var i in this.fieldList) {
- var obj = this.fieldList[i];
- this.formData[obj.key] = ""
- }
-
- //this.action = process.car.BASE_URL + "uploadPicture"
-
- //this.uploadData.subFolder = "oawork11" + this.oatype;
- //接口应该免登陆
- var token = this.carhelp.getToken()
-
- this.header = {
- 'Authorization': token
- }
- },
- getViewItem(item) {
- //(item)
- if (item.viewSql) {
- var obj = this;
- for (var i in item.viewSql) {
- var k = item.viewSql[i];
- //("viewSql",k,obj)
- obj = obj[k]
- }
- return obj;
- }
- },
- getClass(item) {
-
- if (item) {
- var list = item.type.map(it => {
- return 'oawork-' + it
- })
- return list.join(' ')
- }
-
- },
- }
-
- }
- </script>
- <style scoped lang="scss">
- .oawork-line {
- border-bottom: 1px solid #c8c8c8;
- }
- .oawork-paddingTop {
- padding-top: 40rpx;
- }
- .businessMain {
- /deep/.uni-input-input {
- font-size: 24rpx;
- }
- font-size: 32rpx;
- background: #fff;
- padding-top: 10rpx;
- padding-bottom: 50rpx;
- margin-bottom: 40rpx;
- display: flex;
- flex-wrap: wrap;
- .oawork-item {
- padding: 4rpx 16rpx 4rpx 16rpx;
- width: 100%;
-
- .oawork-item1 {
- display: flex;
- align-items: center;
- .oawork-item1_a {
- min-width: 160rpx;
- //font-weight: bold;
- color: #777777;
- }
- .oawork-item1_b {
- //color: #777777;
- width: 100%;
- text-align: right;
- }
- .oawork-item1_c {
- padding-left: 16rpx;
- }
- }
- }
- .oawork-selecttime,
- .oawork-selecttime2 {
- margin: 10rpx 0;
- display: flex;
- .oawork-item1 {
- width: 100%;
- }
- .oawork-item1_b {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- height: 100%;
- border-bottom: 1px solid #c8c8c8;
- }
- }
- .oawork-itemrow {
- .oawork-item1_a {
- font-weight: 400 !important;
- width: 200%;
- }
- }
- .oawork-textlong {
- .oawork-item1_a {
- width: 100%;
- }
- }
- .oawork-title {
- padding: 20rpx 0px 4rpx 20rpx;
- .oawork-item1_a {
- width: 100%;
- font-size: 32rpx;
- }
- }
- .width200 {
- // padding:20rpx 0px 4rpx 20rpx;
- .oawork-item1_a {}
- }
- /deep/.oawork-width49 {
- display: flex;
- padding: 4rpx 0px 4rpx 20rpx;
- width: 49%;
- .oawork-item1_a {
- font-size: 28rpx;
- min-width: 140rpx !important;
- }
- }
- }
- .submitBtn {
- bottom: 0;
- position: fixed;
- width: 100%;
- padding: 20rpx 40rpx;
- background-color: #fff;
- border-top: 3px solid #f3f4f4;
- z-index: 9999;
- display: flex;
- .submitBtn30 {
- width: 30%;
- }
- .submitBtn60 {
- width: 60%;
- }
- }
- .head-approve-main{
- background: #ffffff;
- .head-approve-info{
- background: #ffffff;
- margin-bottom: 8px;
- padding: 0px 8px 8px 8px;
- }
- .head-approve{
- padding: 8px 8px;
- background: #ffffff;
-
-
- font-size: 32rpx;
-
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- justify-content: space-between;
-
- .head-approve-a{
- display: flex;
- align-items: center;
- }
- .head-approve-a1{
- display: flex;
- align-items: center;
- }
- .head-approve-2{
- padding: 0 3px
- }
- .head-approve-b{
- padding: 2px 9px;
- border: 1px solid;
- border-radius: 18px;
- font-size: 24rpx;
- }
-
-
- }
- }
- //@import "../data/editor-icon.css";
- .ql-containerMain{
- border: 1px solid;
- }
- </style>
|