686 lines
18 KiB
Vue
686 lines
18 KiB
Vue
|
|
<template>
|
|||
|
|
<view class="app">
|
|||
|
|
<view class="body">
|
|||
|
|
<u-form :model="formxcjyListadd" ref="uForm" :label-width='200' :rules="rules">
|
|||
|
|
<u-form-item label="评价名称 " labelWidth="130" prop="pjname"><u-input v-model="formxcjyListadd.pjname"
|
|||
|
|
placeholder="{企业简称首字母}-{企业全名}-{年月日}-{序列号}" /></u-form-item>
|
|||
|
|
|
|||
|
|
<u-form-item label="评价机构名称" prop="pjjgname">
|
|||
|
|
<lx-input class="input" placeholder="请选择机构" v-model="formxcjyListadd.pjjgname" :list="testname"
|
|||
|
|
:hidden.sync="hidden" @clickItem="confirm" @input="input"></lx-input>
|
|||
|
|
<!-- <u-select v-model="showitem" mode="single-column" :list="testname" @confirm="confirm"
|
|||
|
|
@cancel="cancel"></u-select>
|
|||
|
|
|
|||
|
|
<u-input v-model="formxcjyListadd.pjjgname" type="select" @tap="showitemlist" placeholder="请选择机构" /> -->
|
|||
|
|
</u-form-item>
|
|||
|
|
<view class="" @tap="showdays()">
|
|||
|
|
<u-form-item label="评价时间" labelWidth="140" prop="pjtime">
|
|||
|
|
<view class="button" v-if="button">请选择评价时间</view>
|
|||
|
|
<u-calendar v-model="showday" :mode="mode" @change="changepjtime">
|
|||
|
|
</u-calendar>
|
|||
|
|
{{formxcjyListadd.pjtime | formatDate('-')}}
|
|||
|
|
</u-form-item>
|
|||
|
|
</view>
|
|||
|
|
<u-form-item label="下次评价时间" prop="nextpjtime">
|
|||
|
|
<u-radio-group v-model="formxcjyListadd.reportPeriod">
|
|||
|
|
<u-radio shape="circle" name="半年" @change="halfChange">半年</u-radio>
|
|||
|
|
<u-radio shape="circle" name="一年" @change="oneChange">一年</u-radio>
|
|||
|
|
<u-radio shape="circle" name="两年" @change="twoChange">两年</u-radio>
|
|||
|
|
<u-radio shape="circle" name="三年" @change="threeChange">三年</u-radio>
|
|||
|
|
<view class="time" v-if="formxcjyListadd.nextpjtime">
|
|||
|
|
{{ formxcjyListadd.nextpjtime }}
|
|||
|
|
</view>
|
|||
|
|
</u-radio-group>
|
|||
|
|
</u-form-item>
|
|||
|
|
<u-form-item label="有无文件" prop="isFile">
|
|||
|
|
<u-radio-group v-model="formxcjyListadd.isFile">
|
|||
|
|
<u-radio shape="circle" name="有" @change="FileChange">有</u-radio>
|
|||
|
|
<u-radio shape="circle" name="无" @change="FilefalseChange">无</u-radio>
|
|||
|
|
</u-radio-group>
|
|||
|
|
</u-form-item>
|
|||
|
|
<view class="" v-if="showisFile">
|
|||
|
|
<u-form-item label="职业病危害现状评价报告" labelWidth="250" prop="bgcontent">
|
|||
|
|
<lsj-upload ref="lsjUpload" childId="upload1" :option="option"
|
|||
|
|
:size="size" :formats="formats" :debug="debug" :instantly="instantly" @uploadEnd="onuploadEnd"
|
|||
|
|
@progress="onprogre" @change="change">
|
|||
|
|
<u-button type="primary" size="medium" class="up">文件上传</u-button>
|
|||
|
|
<u-icon name="checkbox-mark" v-if="formxcjyListadd.bgcontent" class="icon"></u-icon>
|
|||
|
|
</lsj-upload>
|
|||
|
|
<!-- <u-button type="primary" size="medium" @click="upload" class="up">文件上传</u-button>
|
|||
|
|
<u-icon name="checkbox-mark" v-if="formxcjyListadd.bgcontent" class="icon"></u-icon> -->
|
|||
|
|
</u-form-item>
|
|||
|
|
<u-form-item label="是否同步检测" prop="check" v-if="checkshow">
|
|||
|
|
<u-radio-group v-model="formxcjyListadd.check">
|
|||
|
|
<u-radio shape="circle" name="是" @change="tureChange">是</u-radio>
|
|||
|
|
<u-radio shape="circle" name="" @change="falseChange">否</u-radio>
|
|||
|
|
</u-radio-group>
|
|||
|
|
</u-form-item>
|
|||
|
|
<u-form-item label="下次检测时间" prop="nextpjtime2" v-if="radioshow">
|
|||
|
|
<u-radio-group v-model="formxcjyListadd.reportPeriod1">
|
|||
|
|
<u-radio shape="circle" name="半年" @change="nexthalfChange">半年</u-radio>
|
|||
|
|
<u-radio shape="circle" name="一年" @change="nextoneChange">一年</u-radio>
|
|||
|
|
<u-radio shape="circle" name="两年" @change="nexttwoChange">两年</u-radio>
|
|||
|
|
<u-radio shape="circle" name="三年" @change="nextthreeChange">三年</u-radio>
|
|||
|
|
<view class="time" v-if="formxcjyListadd.nextpjtime2">
|
|||
|
|
{{ formxcjyListadd.nextpjtime2 }}
|
|||
|
|
</view>
|
|||
|
|
</u-radio-group>
|
|||
|
|
</u-form-item>
|
|||
|
|
</view>
|
|||
|
|
</u-form>
|
|||
|
|
<view class="but">
|
|||
|
|
<view class="sub">
|
|||
|
|
<u-button type="primary" text="确定" @tap="submit()">提交</u-button>
|
|||
|
|
</view>
|
|||
|
|
<view class="res">
|
|||
|
|
<u-button type="primary" text="确定" @tap="reset()">重置</u-button>
|
|||
|
|
|
|||
|
|
</view>
|
|||
|
|
</view>
|
|||
|
|
<u-toast ref="uToast" />
|
|||
|
|
|
|||
|
|
|
|||
|
|
</view>
|
|||
|
|
</view>
|
|||
|
|
</template>
|
|||
|
|
|
|||
|
|
<script>
|
|||
|
|
import {
|
|||
|
|
pjjgListno,
|
|||
|
|
insertPjxxnoadd,
|
|||
|
|
insertJcxxno,
|
|||
|
|
} from "@/api/StatusReport/StatusReport.js";
|
|||
|
|
import baseUrl from '@/api/baseurl.js'
|
|||
|
|
|
|||
|
|
import moment from 'moment'
|
|||
|
|
export default {
|
|||
|
|
data() {
|
|||
|
|
return {
|
|||
|
|
formxcjyListadd: {
|
|||
|
|
id: "",
|
|||
|
|
enterpriseid: "",
|
|||
|
|
pjname: "",
|
|||
|
|
selectInputUser: "",
|
|||
|
|
pjtime: "",
|
|||
|
|
reportPeriod: "三年",
|
|||
|
|
nextpjtime: "",
|
|||
|
|
file: "",
|
|||
|
|
file_url: "",
|
|||
|
|
reportPeriod1: "",
|
|||
|
|
nextpjtime2: "",
|
|||
|
|
pjjgname: "",
|
|||
|
|
pjjgid: "",
|
|||
|
|
bgcontent: "",
|
|||
|
|
isFile: '有',
|
|||
|
|
check: '',
|
|||
|
|
zwkz: 0,
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
|
|||
|
|
showday: false, //报告时间
|
|||
|
|
showitem: false,
|
|||
|
|
radioshow: false, //下次评价时间
|
|||
|
|
showisFile: true, //有无文件
|
|||
|
|
checkshow: true, //同步检测
|
|||
|
|
mode: 'date',
|
|||
|
|
value: '',
|
|||
|
|
token: '',
|
|||
|
|
tadytime: '',
|
|||
|
|
jiansheadd: [],
|
|||
|
|
testname: [],
|
|||
|
|
button:true,
|
|||
|
|
rules: {
|
|||
|
|
pjname: [{
|
|||
|
|
required: true,
|
|||
|
|
message: "请填写报告名称",
|
|||
|
|
trigger: "blur"
|
|||
|
|
}, ],
|
|||
|
|
pjjgname: [{
|
|||
|
|
required: true,
|
|||
|
|
message: "请选择评价机构名称",
|
|||
|
|
trigger: "blur"
|
|||
|
|
}, ],
|
|||
|
|
pjtime: [{
|
|||
|
|
required: true,
|
|||
|
|
message: "请选择评价时间",
|
|||
|
|
trigger: "blur"
|
|||
|
|
}, ],
|
|||
|
|
nextpjtime: [{
|
|||
|
|
required: true,
|
|||
|
|
message: "请选择下次评价时间",
|
|||
|
|
trigger: "blur"
|
|||
|
|
}, ],
|
|||
|
|
bgcontent: [{
|
|||
|
|
required: true,
|
|||
|
|
message: "请上传文件",
|
|||
|
|
trigger: "blur"
|
|||
|
|
}, ]
|
|||
|
|
},
|
|||
|
|
hidden: false,
|
|||
|
|
/////////////////////////////////////////////////////////////
|
|||
|
|
// 上传接口参数
|
|||
|
|
option: {
|
|||
|
|
// 上传服务器地址,需要替换为你的接口地址
|
|||
|
|
url: baseUrl + `/dzzyb/a/zyb/ar/uploadFile`, // 该地址非真实路径,需替换为你项目自己的接口地址
|
|||
|
|
// 上传附件的key
|
|||
|
|
name: 'file',
|
|||
|
|
// 根据你接口需求自定义请求头,默认不要写content-type,让浏览器自适配
|
|||
|
|
header: {
|
|||
|
|
// 示例参数可删除
|
|||
|
|
token: '',
|
|||
|
|
},
|
|||
|
|
// 根据你接口需求自定义body参数
|
|||
|
|
formData: {
|
|||
|
|
// 'orderId': 1000
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
// 选择文件后是否立即自动上传,true=选择后立即上传
|
|||
|
|
instantly: true,
|
|||
|
|
// 必传宽高且宽高应与slot宽高保持一致
|
|||
|
|
// width: '300rpx',
|
|||
|
|
// height: '120rpx',
|
|||
|
|
// 限制允许上传的格式,空串=不限制,默认为空
|
|||
|
|
formats: '',
|
|||
|
|
// 文件上传大小限制
|
|||
|
|
size: 30,
|
|||
|
|
// 文件数量限制
|
|||
|
|
count: 1,
|
|||
|
|
// 文件回显列表
|
|||
|
|
files: new Map(),
|
|||
|
|
// 微信小程序Map对象for循环不显示,所以转成普通数组,不要问为什么,我也不知道
|
|||
|
|
wxFiles: [],
|
|||
|
|
// 是否打印日志
|
|||
|
|
debug: true,
|
|||
|
|
// 演示用
|
|||
|
|
tabIndex: 0,
|
|||
|
|
list: [],
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
created() {
|
|||
|
|
this.token = uni.getStorageSync("token")
|
|||
|
|
console.log(this.token)
|
|||
|
|
console.log(moment().format("YYYY-MM-DD HH:mm"))
|
|||
|
|
this.getlist()
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
filters: {
|
|||
|
|
// 时间戳处理
|
|||
|
|
formatDate: function(value, spe = '/') {
|
|||
|
|
if (value) {
|
|||
|
|
value = value
|
|||
|
|
let data = new Date(value);
|
|||
|
|
let year = data.getFullYear();
|
|||
|
|
let month = data.getMonth() + 1;
|
|||
|
|
let day = data.getDate();
|
|||
|
|
// let h = data.getHours();
|
|||
|
|
// let mm = data.getMinutes();
|
|||
|
|
// let s = data.getSeconds();
|
|||
|
|
month = month >= 10 ? month : "0" + month;
|
|||
|
|
day = day >= 10 ? day : "0" + day;
|
|||
|
|
// h = h >= 10 ? h : "0" + h;
|
|||
|
|
// mm = mm >= 10 ? mm : "0" + mm;
|
|||
|
|
// s = s >= 10 ? s : "0" + s;
|
|||
|
|
return `${year}${spe}${month}${spe}${day}`;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
//如果是封装的组件需要在mounted调用,不然校验有时会不生效
|
|||
|
|
//不是的话在onReady调用也可
|
|||
|
|
// mounted() {
|
|||
|
|
// this.$refs.uForm.setRules(this.rules)
|
|||
|
|
// },
|
|||
|
|
onReady() {
|
|||
|
|
this.$refs.uForm.setRules(this.rules);
|
|||
|
|
},
|
|||
|
|
methods: {
|
|||
|
|
/**
|
|||
|
|
* 某文件上传结束回调(成功失败都回调)
|
|||
|
|
* @param {Object} item 当前上传完成的文件
|
|||
|
|
*/
|
|||
|
|
onuploadEnd(item) {
|
|||
|
|
// 更新当前窗口状态变化的文件
|
|||
|
|
this.files.set(item.name, item);
|
|||
|
|
if (item['responseText']) {
|
|||
|
|
// console.log('演示服务器返回的字符串JSON转Object对象');
|
|||
|
|
this.files.get(item.name).responseText = JSON.parse(item.responseText);
|
|||
|
|
this.formxcjyListadd.bgcontent=this.files.get(item.name).responseText.data.src
|
|||
|
|
this.$refs.uToast.show({
|
|||
|
|
title: '上传成功',
|
|||
|
|
type: 'success',
|
|||
|
|
duration: 1500
|
|||
|
|
})
|
|||
|
|
uni.hideLoading();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
// #ifdef MP-WEIXIN
|
|||
|
|
this.wxFiles = [...this.files.values()];
|
|||
|
|
// #endif
|
|||
|
|
// 强制更新视图
|
|||
|
|
this.$forceUpdate();
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
/**
|
|||
|
|
* 上传进度回调
|
|||
|
|
* 如果网页上md文档没有渲染出事件名称onprogre,请复制代码的小伙伴自行添加上哈,没有哪个事件是只(item)的
|
|||
|
|
* @param {Object} item 当前正在上传的文件
|
|||
|
|
*/
|
|||
|
|
onprogre(item) {
|
|||
|
|
// uni.showLoading({
|
|||
|
|
// title: '文件上传中'
|
|||
|
|
// });
|
|||
|
|
// 更新当前状态变化的文件
|
|||
|
|
this.files.set(item.name, item);
|
|||
|
|
// console.log('打印对象', JSON.parse(JSON.stringify(this.files.get(item.name))));
|
|||
|
|
// #ifdef MP-WEIXIN
|
|||
|
|
this.wxFiles = [...this.files.values()];
|
|||
|
|
// #endif
|
|||
|
|
// 强制更新视图
|
|||
|
|
this.$forceUpdate();
|
|||
|
|
},
|
|||
|
|
/**
|
|||
|
|
* 文件选择回调
|
|||
|
|
* @param {Object} files 已选择的所有文件Map集合
|
|||
|
|
*/
|
|||
|
|
change(files) {
|
|||
|
|
// console.log('当前选择的文件列表:', JSON.stringify([...files.values()]));
|
|||
|
|
// 更新选择的文件
|
|||
|
|
this.files = files;
|
|||
|
|
// 强制更新视图
|
|||
|
|
this.$forceUpdate();
|
|||
|
|
// 微信小程序Map对象for循环不显示,所以转成普通数组,不要问为什么,我也不知道
|
|||
|
|
// #ifdef MP-WEIXIN
|
|||
|
|
this.wxFiles = [...this.files.values()];
|
|||
|
|
// #endif
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
|||
|
|
|
|||
|
|
// 报告时间
|
|||
|
|
showdays() {
|
|||
|
|
this.showday = true;
|
|||
|
|
},
|
|||
|
|
// 报告时间点击事件
|
|||
|
|
changepjtime(e) {
|
|||
|
|
console.log(e)
|
|||
|
|
this.formxcjyListadd.pjtime = e.result
|
|||
|
|
this.button=false
|
|||
|
|
// 获取当前时间
|
|||
|
|
// 获取半年后时间
|
|||
|
|
console.log(this.formxcjyListadd.reportPeriod)
|
|||
|
|
|
|||
|
|
if (this.formxcjyListadd.reportPeriod == '三年') {
|
|||
|
|
// 赋值给新值
|
|||
|
|
this.tadytime = e.result
|
|||
|
|
let newdate = moment(this.tadytime).subtract(-3, 'year').format('YYYY-MM-DD') // 三年
|
|||
|
|
this.formxcjyListadd.nextpjtime = newdate
|
|||
|
|
} else if (this.formxcjyListadd.reportPeriod == '半年') {
|
|||
|
|
this.tadytime = e.result
|
|||
|
|
let newdate = moment(this.tadytime).subtract(-0.5, 'year').format('YYYY-MM-DD')
|
|||
|
|
this.formxcjyListadd.nextpjtime = newdate
|
|||
|
|
|
|||
|
|
} else if (this.formxcjyListadd.reportPeriod == '一年') {
|
|||
|
|
this.tadytime = e.result
|
|||
|
|
let newdate = moment(this.tadytime).subtract(-1, 'year').format('YYYY-MM-DD')
|
|||
|
|
this.formxcjyListadd.nextpjtime = newdate
|
|||
|
|
|
|||
|
|
} else if (this.formxcjyListadd.reportPeriod == '两年') {
|
|||
|
|
this.tadytime = e.result
|
|||
|
|
let newdate = moment(this.tadytime).subtract(-2, 'year').format('YYYY-MM-DD')
|
|||
|
|
this.formxcjyListadd.nextpjtime = newdate
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
// 检测机构名称
|
|||
|
|
getlist() {
|
|||
|
|
pjjgListno().then(res => {
|
|||
|
|
this.jiansheadd = res
|
|||
|
|
this.testname = []
|
|||
|
|
this.jiansheadd.forEach((e) => {
|
|||
|
|
var obj = {
|
|||
|
|
label: e.companyName,
|
|||
|
|
value: e.id
|
|||
|
|
};
|
|||
|
|
this.testname.push(obj);
|
|||
|
|
})
|
|||
|
|
})
|
|||
|
|
},
|
|||
|
|
// getlist() {
|
|||
|
|
// pjjgListno().then(res => {
|
|||
|
|
// this.jiansheadd = res
|
|||
|
|
// })
|
|||
|
|
// },
|
|||
|
|
// showitemlist() {
|
|||
|
|
// this.testname = [],
|
|||
|
|
// this.showitem = true
|
|||
|
|
// this.jiansheadd.forEach((e) => {
|
|||
|
|
|
|||
|
|
// var obj = {
|
|||
|
|
// label: e.companyName,
|
|||
|
|
// value: e.id
|
|||
|
|
// };
|
|||
|
|
// this.testname.push(obj);
|
|||
|
|
|
|||
|
|
// })
|
|||
|
|
// },
|
|||
|
|
// 检测机构名称确定
|
|||
|
|
|
|||
|
|
confirm(e) {
|
|||
|
|
this.formxcjyListadd.pjjgname = e.label
|
|||
|
|
this.formxcjyListadd.pjjgid = e.value
|
|||
|
|
// console.log(e);
|
|||
|
|
},
|
|||
|
|
input(e) {
|
|||
|
|
if(e){
|
|||
|
|
this.formxcjyListadd.pjjgname = e
|
|||
|
|
this.formxcjyListadd.pjjgid = ''
|
|||
|
|
console.log(e)
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
cancel(e) {
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
actionSheetCallback(index) {
|
|||
|
|
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
// 半年
|
|||
|
|
halfChange(e) {
|
|||
|
|
console.log(e)
|
|||
|
|
this.formxcjyListadd.reportPeriod = e
|
|||
|
|
if (this.formxcjyListadd.pjtime) {
|
|||
|
|
let newdate = moment(this.formxcjyListadd.pjtime).subtract(-0.5, 'year').format('YYYY-MM-DD')
|
|||
|
|
this.formxcjyListadd.nextpjtime = newdate
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
// 一年
|
|||
|
|
oneChange(e) {
|
|||
|
|
this.formxcjyListadd.reportPeriod = e
|
|||
|
|
if (this.formxcjyListadd.pjtime) {
|
|||
|
|
let newdate = moment(this.formxcjyListadd.pjtime).subtract(-1, 'year').format('YYYY-MM-DD')
|
|||
|
|
this.formxcjyListadd.nextpjtime = newdate
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
// 两年
|
|||
|
|
twoChange(e) {
|
|||
|
|
this.formxcjyListadd.reportPeriod = e
|
|||
|
|
if (this.formxcjyListadd.pjtime) {
|
|||
|
|
let newdate = moment(this.formxcjyListadd.pjtime).subtract(-2, 'year').format('YYYY-MM-DD')
|
|||
|
|
this.formxcjyListadd.nextpjtime = newdate
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
// 三年
|
|||
|
|
threeChange(e) {
|
|||
|
|
this.formxcjyListadd.reportPeriod = e
|
|||
|
|
if (this.formxcjyListadd.pjtime) {
|
|||
|
|
let newdate = moment(this.formxcjyListadd.pjtime).subtract(-3, 'year').format('YYYY-MM-DD')
|
|||
|
|
this.formxcjyListadd.nextpjtime = newdate
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
// 下次半年
|
|||
|
|
nexthalfChange(e) {
|
|||
|
|
if (this.formxcjyListadd.pjtime) {
|
|||
|
|
let newdate = moment(this.formxcjyListadd.pjtime).subtract(-0.5, 'year').format('YYYY-MM-DD')
|
|||
|
|
this.formxcjyListadd.nextpjtime2 = newdate
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
// 一年
|
|||
|
|
nextoneChange(e) {
|
|||
|
|
if (this.formxcjyListadd.pjtime) {
|
|||
|
|
let newdate = moment(this.formxcjyListadd.pjtime).subtract(-1, 'year').format('YYYY-MM-DD')
|
|||
|
|
this.formxcjyListadd.nextpjtime2 = newdate
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
// 两年
|
|||
|
|
nexttwoChange(e) {
|
|||
|
|
if (this.formxcjyListadd.pjtime) {
|
|||
|
|
let newdate = moment(this.formxcjyListadd.pjtime).subtract(-2, 'year').format('YYYY-MM-DD')
|
|||
|
|
this.formxcjyListadd.nextpjtime2 = newdate
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
// 三年
|
|||
|
|
nextthreeChange(e) {
|
|||
|
|
if (this.formxcjyListadd.pjtime) {
|
|||
|
|
let newdate = moment(this.formxcjyListadd.pjtime).subtract(-3, 'year').format('YYYY-MM-DD')
|
|||
|
|
this.formxcjyListadd.nextpjtime2 = newdate
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
// 是否同步检测
|
|||
|
|
tureChange() {
|
|||
|
|
this.formxcjyListadd.check = "是"
|
|||
|
|
this.radioshow = true
|
|||
|
|
},
|
|||
|
|
falseChange() {
|
|||
|
|
this.formxcjyListadd.check = "否"
|
|||
|
|
this.radioshow = false
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
// 有无文件
|
|||
|
|
FilefalseChange() {
|
|||
|
|
this.showisFile = false;
|
|||
|
|
},
|
|||
|
|
FileChange() {
|
|||
|
|
this.showisFile = true;
|
|||
|
|
},
|
|||
|
|
// 选中任一radio时,由radio-group触发
|
|||
|
|
radioGroupChange(e) {
|
|||
|
|
// console.log(e);
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
// 重置
|
|||
|
|
reset() {
|
|||
|
|
this.radioshow = false,
|
|||
|
|
this.showisFile = true;
|
|||
|
|
this.button=true
|
|||
|
|
// this.value='',
|
|||
|
|
// this.formxcjyListadd.reportPeriod = ''
|
|||
|
|
this.formxcjyListadd = {
|
|||
|
|
id: "",
|
|||
|
|
enterpriseid: "",
|
|||
|
|
pjname: "",
|
|||
|
|
selectInputUser: "",
|
|||
|
|
pjtime: "",
|
|||
|
|
reportPeriod: "三年",
|
|||
|
|
nextpjtime: "",
|
|||
|
|
file: "",
|
|||
|
|
file_url: "",
|
|||
|
|
reportPeriod1: "",
|
|||
|
|
nextpjtime2: "",
|
|||
|
|
pjjgname: "",
|
|||
|
|
pjjgid: "",
|
|||
|
|
bgcontent: "",
|
|||
|
|
isFile: '有',
|
|||
|
|
check: '',
|
|||
|
|
zwkz: 0,
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
// 提交
|
|||
|
|
submit() {
|
|||
|
|
console.log(this.formxcjyListadd)
|
|||
|
|
|
|||
|
|
|
|||
|
|
this.$refs.uForm.validate(valid => {
|
|||
|
|
if (valid) {
|
|||
|
|
var obj = {
|
|||
|
|
bgname: this.formxcjyListadd.pjname,
|
|||
|
|
jcjgname: this.formxcjyListadd.pjjgname,
|
|||
|
|
reportPeriod: this.formxcjyListadd.reportPeriod1,
|
|||
|
|
bgtime: this.formxcjyListadd.pjtime,
|
|||
|
|
nextjctime: this.formxcjyListadd.nextpjtime2,
|
|||
|
|
bgcontent: this.formxcjyListadd.bgcontent,
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (this.formxcjyListadd.check == '是') {
|
|||
|
|
insertPjxxnoadd(this.formxcjyListadd).then(response => {
|
|||
|
|
if (response.code == 0 && response.mess == '下次评价日期重复!') {
|
|||
|
|
this.$refs.uToast.show({
|
|||
|
|
title: response.mess,
|
|||
|
|
type: 'error',
|
|||
|
|
duration: 1500
|
|||
|
|
})
|
|||
|
|
} else {
|
|||
|
|
insertJcxxno(obj).then(response => {
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
this.$refs.uToast.show({
|
|||
|
|
title: '新增成功',
|
|||
|
|
type: 'success',
|
|||
|
|
duration: 1500
|
|||
|
|
})
|
|||
|
|
uni.$emit('update', '1')
|
|||
|
|
setTimeout(function() {
|
|||
|
|
uni.switchTab({
|
|||
|
|
url: '/pages/homepage/homepage'
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
}, 2000);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
} else {
|
|||
|
|
insertPjxxnoadd(this.formxcjyListadd).then(response => {
|
|||
|
|
if (response.code == 0 && response.mess == '下次评价日期重复!') {
|
|||
|
|
this.$refs.uToast.show({
|
|||
|
|
title: response.mess,
|
|||
|
|
type: 'error',
|
|||
|
|
duration: 1500
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
} else {
|
|||
|
|
this.$refs.uToast.show({
|
|||
|
|
title: '新增成功',
|
|||
|
|
type: 'success',
|
|||
|
|
duration: 1500
|
|||
|
|
})
|
|||
|
|
uni.$emit('update', '1')
|
|||
|
|
setTimeout(function() {
|
|||
|
|
uni.switchTab({
|
|||
|
|
url: '/pages/homepage/homepage'
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
}, 2000);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
</script>
|
|||
|
|
<style lang="scss">
|
|||
|
|
//css函数 声明函数
|
|||
|
|
@function tovmin($rpx) {
|
|||
|
|
//$rpx为需要转换的字号
|
|||
|
|
@return #{$rpx * 100 / 750}vmin;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
::v-deep .u-form-item {
|
|||
|
|
padding-left: tovmin(50) !important;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ::v-deep .u-iconfont {
|
|||
|
|
// margin-right: tovmin(30);
|
|||
|
|
|
|||
|
|
// }
|
|||
|
|
::v-deep .u-icon__icon uicon-checkbox-mark u-iconfont {
|
|||
|
|
left: tovmin(8)
|
|||
|
|
}
|
|||
|
|
::v-deep .srollViewBox .scrollView-item {
|
|||
|
|
padding-left: 0 !important;
|
|||
|
|
line-height: tovmin(50) !important;
|
|||
|
|
color: #3C9CFF !important;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
::v-deep .inputBox .focusBox .inputStyle {
|
|||
|
|
width: 100% !important;
|
|||
|
|
color: #000 !important;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
::v-deep .uni-input-placeholder {
|
|||
|
|
font-size: tovmin(27) !important;
|
|||
|
|
color: #C0C4CC !important;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
::v-deep .srollViewBox .scrollView{
|
|||
|
|
height: tovmin(200) !important;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
::v-deep .srollViewBox{
|
|||
|
|
height: tovmin(220) !important;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
::v-deep .uni-input-input{
|
|||
|
|
font-size: tovmin(27) !important;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.app {
|
|||
|
|
color: #C3C1C1;
|
|||
|
|
font-weight: 400;
|
|||
|
|
height: 100vh;
|
|||
|
|
|
|||
|
|
.body {
|
|||
|
|
margin-top: tovmin(30);
|
|||
|
|
.but {
|
|||
|
|
display: flex;
|
|||
|
|
justify-content: space-around;
|
|||
|
|
margin-top: tovmin(50);
|
|||
|
|
|
|||
|
|
.res {
|
|||
|
|
width: tovmin(170);
|
|||
|
|
height: tovmin(70);
|
|||
|
|
line-height: tovmin(70);
|
|||
|
|
text-align: center;
|
|||
|
|
color: #fff;
|
|||
|
|
background-color: #3C9CFF;
|
|||
|
|
border-radius: tovmin(10);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.sub {
|
|||
|
|
width: tovmin(170);
|
|||
|
|
height: tovmin(70);
|
|||
|
|
line-height: tovmin(70);
|
|||
|
|
text-align: center;
|
|||
|
|
color: #fff;
|
|||
|
|
background-color: #3C9CFF;
|
|||
|
|
border-radius: tovmin(10);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.up {
|
|||
|
|
// background-color: red;
|
|||
|
|
position: absolute;
|
|||
|
|
// right: tovmin(120);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.icon {
|
|||
|
|
position: absolute;
|
|||
|
|
right: tovmin(60);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
.button{
|
|||
|
|
color:#C0C4CC;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
</style>
|