150 lines
4.4 KiB
Vue
150 lines
4.4 KiB
Vue
<!-- 立项审批 -->
|
|
<template>
|
|
<view class="container">
|
|
<scroll-view scroll-y style="padding-bottom: 180rpx;background-color: #fff;">
|
|
<uni-forms v-model="form" label-width="150rpx" ref="customForm" :rules="customRules">
|
|
<ticketd :ticket_="form.ticket_"></ticketd>
|
|
<uni-forms-item label="立项日期" required>
|
|
<uni-datetime-picker type="date" :clear-icon="false" v-model="form.date" @change="dateChange"
|
|
v-if="mode!='show'"/>
|
|
<span v-else>{{form.date}}</span>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="归口部门" required>
|
|
<uni-data-select
|
|
v-model="form.mroom"
|
|
:localdata="mroomList"
|
|
:disabled="mode=='show'"
|
|
@change="mdateChange"
|
|
></uni-data-select>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="负责人" required>
|
|
<uni-easyinput v-model="form.author" placeholder="请输入负责人" :disabled="mode=='show'"/>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="建设期" required>
|
|
<uni-easyinput v-model="form.author" placeholder="请输入建设期" :disabled="mode=='show'"/>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="项目组员" required>
|
|
<uni-easyinput v-model="form.author" placeholder="请输入项目组员" :disabled="mode=='show'"/>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="项目预算" required>
|
|
<uni-easyinput v-model="form.author" placeholder="请输入项目预算" :disabled="mode=='show'"/>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="立项类型">
|
|
<uni-data-checkbox multiple v-model="form.type" :localdata="hobby" @change="typeChange"></uni-data-checkbox>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="平台基本情况与目标绩效" label-width="750" required>
|
|
</uni-forms-item>
|
|
<uni-forms-item label-width="100">
|
|
<textarea placeholder-style="color:#efefef" placeholder="平台基本情况与目标绩效" style="width:100%; border: 2upx solid #e5e5e5;padding: 10upx;"/>
|
|
</uni-forms-item>
|
|
</uni-forms>
|
|
</scroll-view>
|
|
<view class="footer_fixed">
|
|
<ticketd_b :workflow_key="'wf_patent'" :title="form.filename + '-印章申请'" :t_id="form.id" :ticket_="form.ticket_"
|
|
@success="submitSuccess" :submit_b_func="submit_b_func" ref="ticketd_b_start"></ticketd_b>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import ticketd_b from "../wf/ticketd_b.vue"
|
|
import ticketd from "../wf/ticketd.vue"
|
|
import {actStateEnum} from "@/utils/enum.js"
|
|
export default {
|
|
components: { ticketd_b, ticketd },
|
|
data(){
|
|
return{
|
|
mode:"add",
|
|
t_id: null,
|
|
form:{
|
|
id:null,
|
|
file:"",
|
|
filename:"",
|
|
file_count:"",
|
|
is_lending:false,
|
|
contacts:"",
|
|
belong_dept:"",
|
|
ticket_:null,
|
|
},
|
|
type:0,
|
|
hobby: [
|
|
{text: '省级项目',value: '省级项目'},
|
|
{text: '市级项目',value: '市级项目'},
|
|
{text: '自立项目',value: '自立项目'},
|
|
],
|
|
header:"",
|
|
customRules: {
|
|
filename: {
|
|
rules: [{
|
|
required: true,
|
|
errorMessage: '姓名不能为空'
|
|
}]
|
|
},
|
|
age: {
|
|
rules: [{
|
|
required: true,
|
|
errorMessage: '年龄不能为空'
|
|
}]
|
|
},
|
|
},
|
|
}
|
|
},
|
|
async onLoad(options) {
|
|
let that = this;
|
|
that.form.id='';
|
|
that.mode = options.mode?options.mode:'show';
|
|
that.t_id = options.t_id?options.t_id:null;
|
|
if(that.mode != "add"){
|
|
if(that.t_id) {
|
|
that.form = await that.$api.sealItem(that.t_id);
|
|
if(that.form.ticket_.state_.type == 1 && that.form.create_by == uni.getStorageSync("userInfo").id ) {
|
|
that.mode = "edit";
|
|
}else{
|
|
that.mode = "show";
|
|
}
|
|
}else{
|
|
that.form = uni.getStorageSync("currentBooking");
|
|
}
|
|
}
|
|
},
|
|
methods:{
|
|
sealChange(){
|
|
console.log('seal1',this.seal1)
|
|
},
|
|
async submit_b_func(id){
|
|
let that = this;
|
|
that.$refs.customForm.validate().then(res => {
|
|
|
|
}).catch(err => {
|
|
console.log('err', err);
|
|
})
|
|
if (that.mode != 'show') {
|
|
if(that.form.id) {
|
|
await that.$api.patentUpdate(that.form.id, that.form)
|
|
}else{
|
|
let res = await that.$api.patentCreate(that.form)
|
|
that.form.id = res.id;
|
|
}
|
|
}
|
|
},
|
|
submitSuccess(){
|
|
uni.navigateTo({
|
|
url: "/pages/index/index"
|
|
})
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.uni-data-checklist .checklist-group .checklist-box{
|
|
margin: 10px 0!important;
|
|
}
|
|
.flex_file_picker>.uni-file-picker__files{
|
|
flex-direction: row;
|
|
}
|
|
.flex_file_picker{
|
|
width: 90px;
|
|
flex: none;
|
|
}
|
|
</style> |