| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- <template>
- <div>
- <el-drawer
- title="创建用户"
- :visible.sync="drawer"
- size="90%"
- direction="rtl"
- append-to-body
- :wrapper-closable="false"
- >
- <div class="drawer__panel">
- <el-row :gutter="16">
- <el-col :span="13">
- <div class="container normal-panel normal-margin">
- <p class="normal-title normal-margin">提报设置</p>
- <el-row :gutter="16">
- <el-form ref="form" :model="form" :rules="rules" label-width="80px" label-position="left" size="small">
- <el-col :span="24">
- <el-form-item label="标题" prop="title">
- <el-input v-model="form.title" placeholder="标题"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="提报类型" prop="onceonly">
- <el-select v-model="form.onceonly" placeholder="选择提报类型">
- <el-option label="一事一报" :value="1"></el-option>
- <el-option label="一事多报" :value="0"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="生效日期" prop="begdate">
- <el-date-picker style="width:100%" v-model="form.begdate" value-format="yyyy-MM-dd" type="date"
- placeholder="生效日期">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="截止日期" prop="enddate">
- <el-date-picker style="width:100%" v-model="form.enddate" value-format="yyyy-MM-dd" type="date"
- placeholder="截止日期">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="提报要求" prop="notes">
- <el-input v-model="form.notes" placeholder="提报要求"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="提报形式" prop="type">
- <el-checkbox-group v-model="form.type" @change="onCheckboxChange">
- <el-checkbox label="附件提报" name="isattrequired"></el-checkbox>
- <el-checkbox label="文字提报" name="istextrequired"></el-checkbox>
- </el-checkbox-group>
- <!-- <!– <el-checkbox :true-label="1" :false-label="0" v-model="form.isattrequired">附件提报</el-checkbox>
- <el-checkbox :true-label="1" :false-label="0" v-model="form.istextrequired">文字提报</el-checkbox> –>-->
- </el-form-item>
- </el-col>
- </el-form>
- </el-row>
- </div>
- <div class="container normal-panel normal-margin">
- <attachmentList :attinfos="form.attinfos" @onSuccess="querySubmitMain" :onlyread="store.state.pageOnlyRead">
- <upload slot="upload" :folderid="folderid"
- :bindData="{ ownertable: 'sat_submiteditmodel', ownerid: form.sat_submiteditmodelid, usetype: 'default' }"
- @onSuccess="onSubmit()"></upload>
- </attachmentList>
- </div>
- </el-col>
- <el-col :span="11">
- <scopeOfauth :defaultData="defaultData" appidname="sat_submiteditmodelid" obiectName="sat_submiteditmodel" :dataid="$route.query.id"
- @onChecked="onChecked"></scopeOfauth>
- </el-col>
- </el-row>
- </div>
- <div class="fixed__btn__panel">
- <el-button size="small" @click="onclose" class="normal-btn-width">取 消</el-button>
- <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
- </div>
- </el-drawer>
- <!-- <div class="container normal-panel normal-margin">
- <el-button type="warning" size="small" icon="el-icon-s-claim" @click="onSubmit((res)=>tool.showMessage(res))">保 存
- </el-button>
- </div>
- <div style="overflow-x:hidden">
- <el-row :gutter="16">
- <el-col :span="13">
- <div class="container normal-panel normal-margin">
- <p class="normal-title normal-margin">提报设置</p>
- <el-row :gutter="16">
- <el-form ref="form" :model="form" :rules="rules" label-width="80px" label-position="left" size="small">
- <el-col :span="24">
- <el-form-item label="标题" prop="title">
- <el-input v-model="form.title" placeholder="标题"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="提报类型" prop="onceonly">
- <el-select v-model="form.onceonly" placeholder="选择提报类型">
- <el-option label="一事一报" :value="1"></el-option>
- <el-option label="一事多报" :value="0"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="生效日期" prop="begdate">
- <el-date-picker style="width:100%" v-model="form.begdate" value-format="yyyy-MM-dd" type="date"
- placeholder="生效日期">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="截止日期" prop="enddate">
- <el-date-picker style="width:100%" v-model="form.enddate" value-format="yyyy-MM-dd" type="date"
- placeholder="截止日期">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="提报要求" prop="notes">
- <el-input v-model="form.notes" placeholder="提报要求"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="提报形式" prop="type">
- <el-checkbox-group v-model="form.type" @change="onCheckboxChange">
- <el-checkbox label="附件提报" name="isattrequired"></el-checkbox>
- <el-checkbox label="文字提报" name="istextrequired"></el-checkbox>
- </el-checkbox-group>
- <!– <el-checkbox :true-label="1" :false-label="0" v-model="form.isattrequired">附件提报</el-checkbox>
- <el-checkbox :true-label="1" :false-label="0" v-model="form.istextrequired">文字提报</el-checkbox> –>
- </el-form-item>
- </el-col>
- </el-form>
- </el-row>
- </div>
- <div class="container normal-panel normal-margin">
- <attachmentList :attinfos="form.attinfos" @onSuccess="querySubmitMain" :onlyread="store.state.pageOnlyRead">
- <upload slot="upload" :folderid="folderid"
- :bindData="{ ownertable: 'sat_submiteditmodel', ownerid: form.sat_submiteditmodelid, usetype: 'default' }"
- @onSuccess="onSubmit()"></upload>
- </attachmentList>
- </div>
- </el-col>
- <el-col :span="11">
- <scopeOfauth :defaultData="defaultData" appidname="sat_submiteditmodelid" obiectName="sat_submiteditmodel" :dataid="$route.query.id"
- @onChecked="onChecked"></scopeOfauth>
- </el-col>
- </el-row>
- </div>-->
- </div>
- </template>
- <script>
- import attachmentList from '@/components/attachment_list/index.vue'
- import upload from '@/components/upload/hw_obs_upload.vue'
- import scopeOfauth from '@/components/scopeOfAuthority/index.vue'
- import store from '@/store'
- export default {
- components: {
- attachmentList,
- upload,
- scopeOfauth
- },
- data() {
- return {
- drawer:false,
- store,
- folderid: JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
- defaultData: {},
- rules: {
- title: [
- { required: true, message: '请输入课程名称', trigger: 'blur' },
- ],
- begdate: [
- { required: true, message: '请选择生效日期', trigger: 'change' }
- ],
- enddate: [
- { required: true, message: '请选择截止日期', trigger: 'change' }
- ],
- onceonly: [
- { required: true, message: '请选择版块', trigger: 'change' }
- ],
- notes: [
- { required: true, message: '请输入提报要求', trigger: 'blur' },
- ],
- type: [
- { type: 'array', required: true, message: '请至少选择一个提报形式', trigger: 'change' }
- ],
- },
- form: {
- "title": "",
- "notes": "",
- "istextrequired": 1,
- "isattrequired": 1,
- "onceonly": 1,
- "sat_submiteditmodelid": "0",
- "begdate": "",
- "enddate": "",
- "type": []
- }
- }
- },
- methods: {
- async querySubmitMain() {
- const res = await this.$api.requested({
- /*"classname": "webmanage.saletool.submitedit.submitedit",
- "method": "select_submitdetailed",*/
- "id":"20221102093602",
- "content": {
- "sat_submiteditmodelid": this.$route.query.id
- }
- })
- res.data.notes == '初始化数据' + JSON.parse(sessionStorage.getItem('active_account')).userid ? res.data.notes = '' : '';
- this.form = Object.assign({}, this.form, res.data)
- if (this.form.isattrequired === 1) { this.form.type.push('附件提报') }
- if (this.form.istextrequired === 1) { this.form.type.push('文字提报') }
- this.form.status !== '新建' ? store.state.pageOnlyRead = true : store.state.pageOnlyRead = false
- },
- onSubmit(callback) {
- this.$refs['form'].validate(async (valid) => {
- if (!valid) return false;
- const res = await this.$api.requested({
- /*"classname": "webmanage.saletool.submitedit.submitedit",
- "method": "insertorupdate",*/
- "id":20221102093702,
- "content": this.form
- })
- this.insertCoursewareauth()
- callback?callback(res):''
- this.drawer = false
- this.$router.go(-1)
- })
- },
- // 监听提报形式
- onCheckboxChange(val) {
- this.form.isattrequired = val.indexOf('附件提报') === -1 ? 0 : 1
- this.form.istextrequired = val.indexOf('文字提报') === -1 ? 0 : 1
- },
- // 获取保存授权范围数据
- onChecked(param) {
- this.authData = param
- console.log("授权数据")
- console.log(this.authData)
- },
- // 新增授权范围
- async insertCoursewareauth() {
- const res = await this.$api.requested({
- /*"classname": "webmanage.saletool.submitedit.submiteditauth",
- "method": "insertOrUpdate",*/
- "id":"20221102094402",
- "content": this.authData
- })
- res.code === 0 ? this.$notify({
- title: '失败',
- message: res.data,
- type: 'error'
- }) : this.querySubmitMain()
- },
- // 查询授权信息
- async query_auth() {
- console.log("查询授权信息")
- const res = await this.$api.requested({
- /*"classname": "webmanage.saletool.submitedit.submiteditauth",
- "method": "selectAuth",*/
- "id":'20221102094602',
- "content": {
- "sat_submiteditmodelid": this.$route.query.id
- }
- })
- this.defaultData = res.data
- },
- async onclose(){
- this.drawer = false
- const res = this.$api.requested({
- "id": 20221102094102,
- "content": {
- "sat_submiteditmodelids":[this.$route.query.id]
- }
- })
- this.$router.go(-1)
- }
- },
- mounted() {
- /*this.drawer = true*/
- console.log("输出")
- console.log(this.$route.query.id)
- if (this.$route.query.id !== ''){
- this.drawer = true
- /* this.querySubmitMain()
- this.query_auth()*/
- /*this.query_auth()*/
- }
- },
- created() {
- console.log("输出")
- console.log(this.$route.query.id)
- /*this.drawer = true*/
- /*this.querySubmitMain()
- this.query_auth()*/
- },
- }
- </script>
- <style>
- </style>
|