Browse Source

需求变更

凉纪 1 year ago
parent
commit
e8514fafc6

+ 28 - 14
src/components/HoursCell/index.vue

@@ -1,9 +1,9 @@
 <template>
-  <div class="date-cell" >
-    <van-cell v-if="disabled" :title="title" :label="label" />
-    <van-cell v-else :title="title" :label="label" @click="clickItem">
+  <div class="hours-cell" >
+    <van-cell v-if="disabled" :title="title" :value="isRow?label:''" :label="!isRow?label:''" />
+    <van-cell :required="required" v-else :title="title" :value="isRow?label:''" :label="!isRow?label:''" @click="clickItem">
       <template #right-icon>
-        <van-icon name="notes-o" class="date-icon"/>
+        <van-icon name="clock-o" class="date-icon"/>
       </template>
     </van-cell>
     <van-popup v-model="showPicker" round  position="bottom" :close-on-popstate="true" get-container="#app">
@@ -36,6 +36,15 @@ export default {
       type: String,
       default: null,
     },
+    required:{
+      type: Boolean,
+      default: null,
+    },
+    //单行显示或者多行显示
+    isRow:{
+      type: Boolean,
+      default: null,
+    },
     //标题
     title:{
       type: String,
@@ -86,16 +95,21 @@ export default {
 </script>
 
 <style lang="scss">
-.date-icon{
-  font-weight: 500;
-  width: 42px;
-  height: 6.4vw;
-  color: #008cd6;
-  font-size: 42px;
-  line-height: 6.4vw;
-}
-.van-cell__label{
-  margin: 0;
+.hours-cell{
+  .date-icon{
+    font-weight: 500;
+    width: 42px;
+    height: 6.4vw;
+    color: #008cd6;
+    font-size: 42px;
+    line-height: 6.4vw;
+  }
+  .van-cell__label{
+    margin: 0;
+  }
+  .van-cell__value{
+    padding-right: 20px;
+  }
 }
 </style>
 <!--<style lang="scss" scoped>-->

+ 6 - 5
src/components/orgTree/index.vue

@@ -2,6 +2,7 @@
   <div class="orgTree van-hairline--bottom">
     <tree-select
       :addendToBody="true"
+      @input="onInput"
       @select="onSelect"
       v-model="selected"
       :options="orgTree"
@@ -12,7 +13,6 @@
       :normalizer="tenantIdnormalizer"
       :show-count="true"
       :noChildrenText="''"
-     
       noResultsText="暂无符合条件的数据">
     </tree-select>
   </div>
@@ -21,7 +21,7 @@
 import TreeSelect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 import {mapGetters} from "vuex";
-export default {
+export default  {
   components: {
     TreeSelect
   },
@@ -73,13 +73,14 @@ export default {
       return {
         id: node.id,
         label: this.isOrgName?  node.shortName: node.name,
-        
         children: node.children
       }
     },
+    onInput(value){
+      this.$emit('change', value);
+    },
     onSelect(value) {
-      this.$emit('change', value.id)
-      this.$emit('changeItem', value)
+      this.$emit('changeItem', value);
     }
   },
   model: {

+ 7 - 1
src/views/menu/educationStatistics/index.vue

@@ -2,7 +2,9 @@
   <div class="educationStatistics">
     <NavBar />
     <div class="statistics-container">
-      <org-tree v-model="query.orgId" @change="getDataList"></org-tree>
+      <div class="org-line van-hairline--bottom">
+        <org-tree v-model="query.orgId" @change="getDataList"></org-tree>
+      </div>
       <div class="search-flex">
         <select-cell
           style="border-right:1px solid #f5f5f5;"
@@ -136,6 +138,10 @@ export default {
   height: calc(100vh - 420px);
   overflow: hidden;
 }
+.org-line{
+  padding:0 10px;
+  background-color: #fff;
+}
 .card-num {
   display: flex;
   align-items: center;

+ 1 - 1
src/views/menu/resumption/detail.vue

@@ -672,7 +672,7 @@ export default {
 
       saveTask(data).then(res => {
         this.$toast('保存成功')
-        this.$router.go(-1)
+        //this.$router.go(-1)
       })
     },
     submitResumptionData() {

+ 21 - 9
src/views/menu/securityCheckRegister/detail.vue

@@ -27,11 +27,13 @@
           />
         </van-cell-group>
       </div>
+      <!--  搜索框  -->
+      <van-search v-model="itemName" class="van-hairline--bottom" placeholder="请输入检查项名称"/>
       <!--  检查项目    -->
       <fieldset class="fieldset" :disabled="!enable">
         <div class="card">
           <p class="legend">检查项目 <span v-if="enable" @click="addCheck">添加检查内容</span></p>
-          <van-collapse v-model="activeNames" v-for="v in checkList" :key="v.itemId">
+          <van-collapse v-model="activeNames" v-for="v in resultList" :key="v.itemId">
             <van-collapse-item :title="v.itemName" :name="v.itemName">
               <div v-for="(item, index) in v.pointList" :key="item.pointId">
                 <van-cell>
@@ -85,7 +87,7 @@
                     rows="1"
                     autosize
                     label="情况描述:"
-                    type="textarea"                    
+                    type="textarea"
                     placeholder="请输入(255字以内)"
                   />
                   <select-cell
@@ -173,6 +175,7 @@ export default {
       enable: false,
       stateList: [],
       dayList: [],
+      itemName:null,
       preViewImages: {
         images: [],
         startPosition: 0
@@ -189,7 +192,7 @@ export default {
   },
   computed: {
     ...mapGetters(['dictionary',"roleList",'orgId']),
-    showGrantBtn(){      
+    showGrantBtn(){
       let userRoleIds = this.roleList.map((r) => r.roleId);
       let taskRoleIds = this.taskInfo.checkRoles
         ? this.taskInfo.checkRoles.map((r) => r.id)
@@ -200,7 +203,16 @@ export default {
         this.taskInfo.checkOrgId == this.orgId &&
         userRoleIds.find((ur) => taskRoleIds.includes(ur))
       );
-    }
+    },
+    resultList(){
+      let arr = [];
+      this.checkList.forEach(v=>{
+        if(v.itemName.indexOf(this.itemName) > -1){
+          arr.push(v)
+        }
+      })
+      return arr;
+    },
   },
   mounted() {
     this.id = this.$route.query.id
@@ -389,14 +401,14 @@ export default {
     },
     //初始化数据
     getData() {
-      let taskId = this.$route.query.id
+      let taskId = this.$route.query.id;
       registerDetail(taskId).then(res => {
         console.log(res, 'res')
-        this.taskInfo = res.data
-        this.enable = this.taskInfo.status === 1 || this.taskInfo.status === 2 //是否可编辑
-        this.checkList = res.data.checkList
+        this.taskInfo = res.data;
+        this.enable = this.taskInfo.status === 1 || this.taskInfo.status === 2; //是否可编辑
+        this.checkList = res.data.checkList;
         //设置默认展开项
-        this.activeNames = this.checkList.map(v => v.itemName)
+        this.activeNames = this.checkList.map(v => v.itemName);
       })
     },
     //保存数据

+ 6 - 17
src/views/menu/securityCheckRegister/index.vue

@@ -6,21 +6,10 @@
       <div style="background-color: #fff;">
         <!--需求改为只查看本检查机构、登录角色的任务-->
         <div class="org-line van-hairline--bottom">
-          <org-tree v-model="query.checkOrgId" placeholder="选择检查机构" @change="changeOrgId"></org-tree>
+          <org-tree clearable v-model="query.beCheckedOrgId" placeholder="选择受检机构" @change="changeOrgId"></org-tree>
         </div>
-
-<!--        <div class="org-line van-hairline&#45;&#45;bottom">-->
-<!--            <van-row>-->
-<!--              <van-col span="12">-->
-<!--                <org-tree v-model="query.beCheckedOrgId" clearable placeholder="选择受检机构" @change="refreshData"></org-tree>-->
-<!--              </van-col>-->
-<!--              <van-col span="12">-->
-<!--                <date-cell title="日期"  v-model="query.taskTime" date-type="date" @change="refreshData"/>-->
-<!--              </van-col>-->
-<!--            </van-row>-->
-<!--          </div>-->
-         <div>
-           <date-cell title="日期" :isRow="true" v-model="query.taskTime" date-type="date" @change="refreshData"/>
+        <div >
+           <date-cell title="日期" is-row v-model="query.taskTime" date-type="date" @change="refreshData"/>
 <!--           <search-select-cell-->
 <!--            class="van-hairline&#45;&#45;right"-->
 <!--            title="检查角色"-->
@@ -29,7 +18,7 @@
 <!--            :dataList="rolesList"-->
 <!--            :prop="prop"-->
 <!--            @change="refreshData"/> </div> -->
-          </div>
+        </div>
       </div>
 
       <div class="card-list">
@@ -187,7 +176,7 @@ export default {
       let data = {
         ...this.query
       }
-      if(!this.query.checkOrgId) return this.$toast('请选择机构');
+      //if(!this.query.checkOrgId) return this.$toast('请选择机构');
       data.roleIds= this.roleList.map(v=>{return v.roleId})
       dataList(data).then(res=>{
         console.log(res,'ressssssss')
@@ -269,7 +258,7 @@ export default {
   }
   .card-list{
     padding:0 20px 20px 20px;
-    height: calc(100vh - 318px);
+    height: calc(100vh - 370px);
     overflow: auto;
   }
   .list-item{

+ 27 - 5
src/views/menu/workTime/index.vue

@@ -13,12 +13,12 @@
       <!--   选择状态   -->
       <van-radio-group :disabled="formData.isDisabled" v-model="formData.isEnable">
         <van-cell-group>
-          <van-cell title="营业" clickable @click="formData.isDisabled?null: changeRadio('1')">
+          <van-cell required title="营业" clickable @click="formData.isDisabled?null: changeRadio('1')">
             <template #right-icon>
               <van-radio name="1" />
             </template>
           </van-cell>
-          <van-cell title="歇业" clickable @click="formData.isDisabled?null: changeRadio('0')">
+          <van-cell required title="歇业" clickable @click="formData.isDisabled?null: changeRadio('0')">
             <template #right-icon>
               <van-radio name="0" />
             </template>
@@ -28,11 +28,22 @@
 
       <!--  选择时间    -->
       <van-cell-group>
-        <hours-cell  :disabled="formData.isDisabled || !formData.isEnable || formData.isEnable =='0'" title="营业开始" v-model="formData.openTime"></hours-cell>
-        <hours-cell :disabled="formData.isDisabled || !formData.isEnable || formData.isEnable =='0'" title="营业结束" v-model="formData.closeTime"></hours-cell>
-      <!--   操作     -->
+        <hours-cell required is-row :disabled="formData.isDisabled || !formData.isEnable || formData.isEnable =='0'" title="营业开始" v-model="formData.openTime"></hours-cell>
+        <hours-cell required is-row :disabled="formData.isDisabled || !formData.isEnable || formData.isEnable =='0'" title="营业结束" v-model="formData.closeTime"></hours-cell>
       </van-cell-group>
+      <!--  选择时间    -->
       <van-cell-group>
+        <hours-cell required is-row :disabled="formData.isDisabled || !formData.isEnable || formData.isEnable =='0'" title="上班时间" v-model="formData.workTime"></hours-cell>
+        <hours-cell required is-row :disabled="formData.isDisabled || !formData.isEnable || formData.isEnable =='0'" title="下班时间" v-model="formData.workOffTime"></hours-cell>
+      </van-cell-group>
+
+      <!--   操作     -->
+      <van-cell-group>
+        <van-cell center title="是否值班打卡" v-if="!formData.isDisabled">
+          <template #right-icon>
+            <van-switch :size="20" active-value="1" inactive-value="0" v-model="formData.isDuty"></van-switch>
+          </template>
+        </van-cell>
         <van-cell center title="是否复制到全月" v-if="!formData.isDisabled">
           <template #right-icon>
             <van-button size="mini" type="info" @click="copyMouth">点击复制</van-button>
@@ -68,10 +79,13 @@ export default {
       formData:{
         openTime:null,
         closeTime:null,
+        workTime:null,
+        workOffTime:null,
         isEnable:null,
         ymdDate:null,
         isDisabled:false,
         orgId:null,
+        isDuty:'0'
       },
       dates:[],
       activeCalendar:['1'],
@@ -103,6 +117,8 @@ export default {
       this.formData.isEnable = s;
       this.formData.openTime = null;
       this.formData.closeTime = null;
+      this.formData.workTime = null;
+      this.formData.workOffTime = null;
     },
     //获取复制的数据
     getCopyData(arr){
@@ -158,7 +174,10 @@ export default {
           if(this.formData.isEnable == '1'){
             if(!this.formData.openTime) return this.$toast('请选择开始时间');
             if(!this.formData.closeTime) return this.$toast('请选择结束时间');
+            if(!this.formData.workTime) return this.$toast('请选择上班时间');
+            if(!this.formData.workOffTime) return this.$toast('请选择下班时间');
             if(!timeCheck([this.formData.openTime,this.formData.closeTime])) return this.$toast('开始时间不能大于结束时间');
+            if(!timeCheck([this.formData.workTime,this.formData.workOffTime])) return this.$toast('上班时间不能大于下班时间');
           }
         }
         let data = {
@@ -180,6 +199,9 @@ export default {
       this.formData.openTime = this.selectDate.openTime;
       this.formData.closeTime = this.selectDate.closeTime;
       this.formData.isDisabled = this.selectDate.isDisabled;
+      this.formData.workTime = this.selectDate.workTime;
+      this.formData.workOffTime = this.selectDate.workOffTime;
+      this.formData.isDuty = this.selectDate.isDuty;
     },
   }
 }