Browse Source

代码上传

zhangqiOMG 3 years ago
parent
commit
615a86fefd

+ 0 - 6
src/HManagement/archives_sc/list/modules/add.vue

@@ -86,15 +86,9 @@ export default {
         "sat_courseware_classid": '9999' + JSON.parse(sessionStorage.getItem('active_account')).userid,
         "notes": "",
         "canfiledownload": 1,
-<<<<<<< HEAD
         "begdate":(new Date()).toLocaleDateString(),
         "enddate":(new Date()).toLocaleDateString(),
         "tag":[]
-=======
-        "begdate": (new Date()).toLocaleDateString(),
-        "enddate": (new Date()).toLocaleDateString(),
-        "tag": []
->>>>>>> f300e7fafb05f0e3c390e3c75e52ac3b2756ce27
       }
     }
   },

+ 1 - 1
src/HManagement/submit/index.vue

@@ -6,7 +6,7 @@
         <el-button class="inline-16" type="text" size="mini" @click="$router.push({path:'/submit_detail',query:{id:scope.data.data.sat_submiteditmodelid}})">明 细</el-button>
       </template>
       <template v-if="tool.checkAuth($route.name,'update')" v-slot:edit="scope">
-        <el-button class="inline-16" type="text" size="mini" @click="$router.push({path:'/submit_edit',query:{id:scope.data.data.sat_submiteditmodelid}})">编 辑</el-button>
+        <el-button class="inline-16" style="margin-left:0 !important;" type="text" size="mini" @click="$router.push({path:'/submit_edit',query:{id:scope.data.data.sat_submiteditmodelid}})">编 辑</el-button>
       </template>
       <template v-if="tool.checkAuth($route.name,'update')" v-slot:release="scope">
         <release :data="scope.data.data" @onSuccess="onSuccess"></release>

+ 69 - 58
src/HManagement/submit/list/list.vue

@@ -1,76 +1,87 @@
 <template>
-<div>
-  <div class="container normal-panel normal-margin">
-    <slot name="add"></slot>
-  </div>
-  <div class="container normal-panel">
-    <!-- 表格搜索 -->
-    <div class="flex-align-center  search-panel normal-margin">
-      <p>搜索:</p>
-      <el-input style="width:200px" size="small" placeholder="请输入查询内容" @keyup.native.enter="listData('search')" @clear="listData('search')" v-model="params.content.where.condition" prefix-icon="el-icon-search" clearable></el-input>
+  <div>
+    <div class="container normal-panel normal-margin">
+      <slot name="add"></slot>
     </div>
-    <!-- 表格 -->
-    <tableLayout :layout="tablecols" :data="list" :custom="true" :height="tableHieght">
-      <template v-slot:customcol="scope">
-        <div v-if="scope.column.columnname === 'status'">
-          <span :style="scope.column.data.status === '发布'?'color:#52C41A':''">{{scope.column.data.status}}</span>
-        </div>
-        <div v-else-if="scope.column.columnname === 'onceonly'">
-          <span>{{scope.column.data.onceonly === 1?'一事一报':'一事多报'}}</span>
-        </div>
-        <p v-else>{{scope.column.data[scope.column.columnname]}}</p>
-      </template>
-      <template v-slot:opreation="scope">
-        <slot name="detail" :data="scope"></slot>
-        <slot name="edit" :data="scope"></slot>
-        <slot name="release" :data="scope"></slot>
-        <slot name="data_statistics" :data="scope"></slot>
-        <slot name="del" :data="scope"></slot>
-      </template>
-    </tableLayout>
-    <div style="margin-top:16px;text-align:right">
-      <el-pagination
-        background
-        small
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage"
-        :page-size="params.content.pageSize"
-        layout="total, prev, pager, next, jumper"
-        :total="total">
-      </el-pagination>
+    <div class="container normal-panel">
+      <!-- 表格搜索 -->
+      <div class="flex-align-center  search-panel normal-margin">
+        <p>搜索:</p>
+        <el-input style="width:200px" size="small" placeholder="请输入查询内容" @keyup.native.enter="listData('search')"
+          @clear="listData('search')" v-model="params.content.where.condition" prefix-icon="el-icon-search" clearable>
+        </el-input>
+      </div>
+      <!-- 表格 -->
+      <tableLayout :layout="tablecols" :data="list" :custom="true" :height="tableHieght">
+        <template v-slot:customcol="scope">
+          <div v-if="scope.column.columnname === 'status'">
+            <span :style="scope.column.data.status === '发布' ? 'color:#52C41A' : ''">{{ scope.column.data.status
+            }}</span>
+          </div>
+          <div v-else-if="scope.column.columnname === 'onceonly'">
+            <span>{{ scope.column.data.onceonly === 1 ? '一事一报' : '一事多报' }}</span>
+          </div>
+          <p v-else>{{ scope.column.data[scope.column.columnname] }}</p>
+        </template>
+        <template v-slot:opreation="scope">
+          <slot name="detail" :data="scope"></slot>
+          <slot name="edit" :data="scope"></slot>
+          <slot name="release" :data="scope"></slot>
+          <slot name="data_statistics" :data="scope"></slot>
+          <slot name="del" :data="scope"></slot>
+        </template>
+      </tableLayout>
+      <div style="margin-top:16px;text-align:right">
+        <el-pagination background small @size-change="handleSizeChange" @current-change="handleCurrentChange"
+          :current-page="currentPage" :page-size="params.content.pageSize" layout="total, prev, pager, next, jumper"
+          :total="total">
+        </el-pagination>
+      </div>
     </div>
   </div>
-</div>
 </template>
 
 <script>
 export default {
-  data () {
+  data() {
     return {
-      params:{
+      params: {
         "classname": "webmanage.saletool.submitedit.submitedit",
         "method": "selectsubmitlist",
         "content": {
-            "pageNumber": 1,
-            "pageSize": 10,
-            "where": {
-              "condition": "",
-            }
+          "pageNumber": 1,
+          "pageSize": 10,
+          "where": {
+            "condition": "",
+          }
         }
       },
-      tablecols:[],
-      list:[],
-      total:0,
-      currentPage:0
+      tablecols: [],
+      list: [],
+      total: 0,
+      currentPage: 0
     }
   },
-  methods:{
-    async listData () {
+  methods: {
+    async listData() {
       const res = await this.$api.requested(this.params)
+      let deteleList = [];
+      res.data.forEach(v => {
+        if (v.notes == '初始化数据' + JSON.parse(sessionStorage.getItem('active_account')).userid && v.title == '' && v.status == '新建') {
+          deteleList.push(v.sat_submiteditmodelid)
+          this.$api.requested({
+            "classname": "webmanage.saletool.submitedit.submitedit",
+            "method": "delete",
+            "content": {
+              "sat_submiteditmodelid": v.sat_submiteditmodelid
+            }
+          })
+        }
+      })
       this.list = res.data
       this.total = res.total
       this.currentPage = res.pageNumber
+      if (deteleList.length != 0) this.listData();
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
@@ -83,10 +94,10 @@ export default {
       this.listData()
     }
   },
-  mounted () {
+  mounted() {
     this.listData()
   },
-  created () {
+  created() {
     //获取表结构
     this.tablecols = this.tool.tabelCol(this.$route.name)['tableSubmitlist'].tablecols
   }
@@ -96,8 +107,8 @@ export default {
 <style>
 </style>
 <style scoped>
-.search-panel p{
-  width:40px;
-  font-size:14px
+.search-panel p {
+  width: 40px;
+  font-size: 14px
 }
 </style>

+ 18 - 18
src/HManagement/submit/list/modules/submit_add.vue

@@ -6,37 +6,37 @@
 
 <script>
 export default {
-  components:{
+  components: {
   },
-  data () {
+  data() {
     return {
-      defaultData:{},
-      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
-      form:{
-        "title":"",
-        "notes":"",
-        "istextrequired":1,
-        "isattrequired":1,
-        "onceonly":1,
-        "sat_submiteditmodelid":"0",
-        "begdate":(new Date()).toLocaleDateString(),
-        "enddate":(new Date()).toLocaleDateString()
+      defaultData: {},
+      folderid: JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
+      form: {
+        "title": "",
+        "notes": '初始化数据' + JSON.parse(sessionStorage.getItem('active_account')).userid,
+        "istextrequired": 1,
+        "isattrequired": 1,
+        "onceonly": 1,
+        "sat_submiteditmodelid": "0",
+        "begdate": (new Date()).toLocaleDateString(),
+        "enddate": (new Date()).toLocaleDateString()
       }
     }
   },
-  methods:{
-    onChecked () {},
-    async onSubmit () {
+  methods: {
+    onChecked() { },
+    async onSubmit() {
       const res = await this.$api.requested({
         "classname": "webmanage.saletool.submitedit.submitedit",
         "method": "insertorupdate",
         "content": this.form
       })
-      res.code === 1?this.$router.replace({path:'/submit_edit',query:{id:res.data.sat_submiteditmodelid}}):''
+      res.code === 1 ? this.$router.replace({ path: '/submit_edit', query: { id: res.data.sat_submiteditmodelid } }) : ''
     },
 
   },
-  mounted () {
+  mounted() {
     this.onSubmit()
   }
 }

+ 52 - 55
src/HManagement/submit/list/modules/submit_edit.vue

@@ -1,7 +1,8 @@
 <template>
   <div>
     <div v-if="!store.state.pageOnlyRead" class="container normal-panel normal-margin">
-      <el-button type="warning" size="small" icon="el-icon-s-claim" style="background:#FA8C16" @click="onSubmit">保 存</el-button>
+      <el-button type="warning" size="small" icon="el-icon-s-claim" style="background:#FA8C16" @click="onSubmit">保 存
+      </el-button>
     </div>
     <div style="overflow-x:hidden">
       <el-row :gutter="16">
@@ -25,22 +26,14 @@
                 </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"
+                    <el-date-picker style="width:100%" v-model="form.begdate" value-format="yyyy-MM-dd" type="date"
                       placeholder="生效日期">
-                    </el-date-picker>                  
+                    </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"
+                    <el-date-picker style="width:100%" v-model="form.enddate" value-format="yyyy-MM-dd" type="date"
                       placeholder="截止日期">
                     </el-date-picker>
                   </el-form-item>
@@ -65,12 +58,15 @@
           </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>
+              <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" :dataid="$route.query.id" @onChecked="onChecked"></scopeOfauth>
+          <scopeOfauth :defaultData="defaultData" appidname="sat_submiteditmodelid" :dataid="$route.query.id"
+            @onChecked="onChecked"></scopeOfauth>
         </el-col>
       </el-row>
     </div>
@@ -83,65 +79,66 @@ import upload from '@/components/upload/hw_obs_upload.vue'
 import scopeOfauth from '@/components/scopeOfAuthority/index.vue'
 import store from '@/store'
 export default {
-  components:{
+  components: {
     attachmentList,
     upload,
     scopeOfauth
   },
-  data () {
+  data() {
     return {
       store,
-      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
-      defaultData:{},
-      rules:{
+      folderid: JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
+      defaultData: {},
+      rules: {
         title: [
           { required: true, message: '请输入课程名称', trigger: 'blur' },
         ],
         begdate: [
-          {  required: true, message: '请选择生效日期', trigger: 'change' }
+          { required: true, message: '请选择生效日期', trigger: 'change' }
         ],
         enddate: [
-          {  required: true, message: '请选择截止日期', trigger: 'change' }
+          { required: true, message: '请选择截止日期', trigger: 'change' }
         ],
         onceonly: [
-          {  required: true, message: '请选择版块', trigger: 'change' }
+          { required: true, message: '请选择版块', trigger: 'change' }
         ],
-        notes:[
+        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":[]
+      form: {
+        "title": "",
+        "notes": "",
+        "istextrequired": 1,
+        "isattrequired": 1,
+        "onceonly": 1,
+        "sat_submiteditmodelid": "0",
+        "begdate": "",
+        "enddate": "",
+        "type": []
       }
     }
   },
-  methods:{
-    async querySubmitMain () {
+  methods: {
+    async querySubmitMain() {
       const res = await this.$api.requested({
         "classname": "webmanage.saletool.submitedit.submitedit",
         "method": "select_submitdetailed",
-        "content": {   
-          "sat_submiteditmodelid":this.$route.query.id
+        "content": {
+          "sat_submiteditmodelid": this.$route.query.id
         }
       })
-      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('文字提报')}
+      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
+      this.form.status === '发布' ? store.state.pageOnlyRead = true : store.state.pageOnlyRead = false
     },
-    onSubmit () {
+    onSubmit() {
       this.$refs['form'].validate(async (valid) => {
         if (!valid) return false;
         const res = await this.$api.requested({
@@ -154,31 +151,31 @@ export default {
       })
     },
     // 监听提报形式
-    onCheckboxChange (val) {
-      this.form.isattrequired = val.indexOf('附件提报') === -1?0:1
-      this.form.istextrequired = val.indexOf('文字提报') === -1?0:1
+    onCheckboxChange(val) {
+      this.form.isattrequired = val.indexOf('附件提报') === -1 ? 0 : 1
+      this.form.istextrequired = val.indexOf('文字提报') === -1 ? 0 : 1
     },
     // 获取保存授权范围数据
-    onChecked (param) {
+    onChecked(param) {
       this.authData = param
       console.log(this.authData)
     },
     // 新增授权范围
-    async insertCoursewareauth () {
+    async insertCoursewareauth() {
       const res = await this.$api.requested({
         "classname": "webmanage.saletool.submitedit.submiteditauth",
         "method": "insertOrUpdate",
         "content": this.authData
       })
-      res.code === 0?this.$notify({
-        title:'失败',
-        message:res.data,
-        type:'error'
-      }):this.querySubmitMain()
-      
+      res.code === 0 ? this.$notify({
+        title: '失败',
+        message: res.data,
+        type: 'error'
+      }) : this.querySubmitMain()
+
     },
     // 查询授权信息
-    async query_auth () {
+    async query_auth() {
       const res = await this.$api.requested({
         "classname": "webmanage.saletool.submitedit.submiteditauth",
         "method": "selectAuth",
@@ -190,7 +187,7 @@ export default {
     },
 
   },
-  created () {
+  created() {
     this.querySubmitMain()
     this.query_auth()
   },