Forráskód Böngészése

更改要事日记

sunyanqiang 3 éve
szülő
commit
2fbc78769c

+ 45 - 31
src/views/grassrootsregistration/bdgldiary/index.vue

@@ -520,13 +520,12 @@
           <el-form-item prop="contents">
             <div class="box4">
               <el-input
-              v-model="form.contents"
-              placeholder="请输入审批不通过原因"
-              type="textarea"
-              autosize
-            />
+                v-model="form.contents"
+                placeholder="请输入审批不通过原因"
+                type="textarea"
+                autosize
+              />
             </div>
-            
           </el-form-item>
 
           <div class="jiben">查铺查哨</div>
@@ -895,31 +894,46 @@ export default {
   methods: {
     // 应到人数失去焦点触发
     yinDao() {
-      if (
-        this.xunlian[0].shouldArrive != null &&
-        this.xunlian[0].realTo != null
-      ) {
-        var str = (
-          (this.xunlian[0].realTo / this.xunlian[0].shouldArrive) *
-          100
-        ).toFixed(2);
-        str += "%";
-        this.xunlian[0].percentage = str;
-      }
+      this.xunlian.forEach((item) => {
+        if (item.shouldArrive != null && item.realTo != null) {
+          var str = ((item.realTo / item.shouldArrive) * 100).toFixed(2);
+          str += "%";
+          item.percentage = str;
+        }
+      });
+      // if (
+      //   this.xunlian[0].shouldArrive != null &&
+      //   this.xunlian[0].realTo != null
+      // ) {
+      //   var str = (
+      //     (this.xunlian[0].realTo / this.xunlian[0].shouldArrive) *
+      //     100
+      //   ).toFixed(2);
+      //   str += "%";
+      //   this.xunlian[0].percentage = str;
+      // }
     },
     // 实到人数失去焦点触发
     shiDao() {
-      if (
-        this.xunlian[0].shouldArrive != null &&
-        this.xunlian[0].realTo != null
-      ) {
-        var str = (
-          (this.xunlian[0].realTo / this.xunlian[0].shouldArrive) *
-          100
-        ).toFixed(2);
-        str += "%";
-        this.xunlian[0].percentage = str;
-      }
+      this.xunlian.forEach((item) => {
+        if (item.shouldArrive != null && item.realTo != null) {
+          var str = ((item.realTo / item.shouldArrive) * 100).toFixed(2);
+          str += "%";
+          item.percentage = str;
+        }
+      });
+
+      // if (
+      //   this.xunlian[0].shouldArrive != null &&
+      //   this.xunlian[0].realTo != null
+      // ) {
+      //   var str = (
+      //     (this.xunlian[0].realTo / this.xunlian[0].shouldArrive) *
+      //     100
+      //   ).toFixed(2);
+      //   str += "%";
+      //   this.xunlian[0].percentage = str;
+      // }
     },
     // 获取训练
     XunLian(id, tiem) {
@@ -1289,7 +1303,7 @@ export default {
 ::v-deep .el-dialog {
   width: 1060px !important;
   background-color: #004d86;
-  margin:  auto;
+  margin: auto;
 }
 ::v-deep .el-dialog__header {
   border-bottom: 1px solid #718a9d;
@@ -1616,10 +1630,10 @@ export default {
 ::v-deep .el-dialog__body {
   padding: none !important;
 }
-::v-deep .box4 .el-textarea__inner{
+::v-deep .box4 .el-textarea__inner {
   min-height: 120px !important;
 }
-aaaa{
+aaaa {
   height: 30px;
 }
 </style>

+ 285 - 32
src/views/peopleChuRu/bdglLeave/index.vue

@@ -412,7 +412,7 @@
             placeholder="请输入内容"
           />
         </el-form-item>
-         <div class="jiben" v-if="statussp == '2'">驳回原因</div>
+        <div class="jiben" v-if="statussp == '2'">驳回原因</div>
         <el-form-item v-if="statussp == '2'" prop="reasons">
           <el-input
             v-model="form.reasons"
@@ -420,7 +420,7 @@
             placeholder="请输入内容"
           />
         </el-form-item>
-          <div class="jiben" v-if="statussp == '2'">特殊审批原因</div>
+        <div class="jiben" v-if="statussp == '2'">特殊审批原因</div>
         <el-form-item v-if="statussp == '2'" prop="reasons">
           <el-input
             v-model="form.specialApproval"
@@ -437,9 +437,200 @@
         <el-button type="primary" @click="submitForms">通过</el-button>
         <el-button @click="boHui">驳回</el-button>
       </div>
-      <div v-if="statussp == '2'" class="dialog-footer" slot="footer">
-        <el-button type="primary" @click="submitForms">通过</el-button>
-        <el-button @click="boHui">驳回</el-button>
+    </el-dialog>
+
+    <!--特殊审批对话框 -->
+    <el-dialog
+      :title="title"
+      :visible.sync="opens"
+      width="500px"
+      append-to-body
+    >
+      <el-form
+        ref="forms"
+        :model="form"
+        :rules="rulesform"
+        label-width="80px"
+        inline
+      >
+        <el-form-item label="单位" prop="unitId">
+          <treeselect
+            v-model="form.unitId"
+            :options="deptOptions"
+            placeholder="选择单位"
+            @select="selectPeo"
+            @open="blurSelect"
+          />
+        </el-form-item>
+        <el-form-item label="请假人员" prop="peopleId">
+          <!-- <el-input v-model="form.peopleId" placeholder="请输入请假人员" /> -->
+          <el-select
+            v-model="form.peopleId"
+            placeholder="请输入请假人员"
+            ref="headerSearchSelect"
+          >
+            <el-option
+              v-for="(item, i) in renYuan"
+              :key="i"
+              :label="item.name"
+              :value="item.id"
+              @click.native="qingRen(item.name)"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="请假开始时间" prop="startTime">
+          <el-date-picker
+            clearable
+            size="small"
+            v-model="form.startTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择请假开始时间"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="请假结束时间" prop="endTime">
+          <el-date-picker
+            clearable
+            size="small"
+            v-model="form.endTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择请假结束时间"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="请假类型" prop="leaveType">
+          <el-select v-model="form.leaveType" placeholder="请选择请假类型">
+            <!-- <el-option label="请选择字典生成" value="" /> -->
+            <el-option
+              v-for="item in ziDian"
+              :key="item.dictCode"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="离队时间" prop="departureTime">
+          <el-date-picker
+            clearable
+            size="small"
+            v-model="form.departureTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="请输入离队时间"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="归队时间" prop="returnTime">
+          <el-date-picker
+            clearable
+            size="small"
+            v-model="form.returnTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="请输入归队时间"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="一级审批人" prop="peopleId2">
+          <el-select
+            v-model="form.peopleId1"
+            filterable
+            placeholder="请输入一级审批人"
+            ref="abcdef"
+          >
+            <el-option
+              v-for="(item, i) in yongHu"
+              :key="i"
+              :label="item.userName"
+              :value="item.userId"
+              @click.native="oneRen(item.userName)"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="二级审批人" prop="peopleId2">
+          <el-select
+            v-model="form.peopleId2"
+            filterable
+            placeholder="请输入二级审批人"
+            ref="abcde"
+          >
+            <el-option
+              v-for="(item, i) in yongHu"
+              :key="i"
+              :label="item.userName"
+              :value="item.userId"
+              @click.native="twoRen(item.userName)"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="三级审批人" prop="peopleId3">
+          <el-select
+            v-model="form.peopleId3"
+            filterable
+            placeholder="请输入三级审批人"
+            ref="abcd"
+          >
+            <el-option
+              v-for="(item, i) in yongHu"
+              :key="i"
+              :label="item.userName"
+              :value="item.userId"
+              @click.native="thereRen(item.userName)"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="四级审批人" prop="peopleId4">
+          <el-select
+            v-model="form.peopleId4"
+            filterable
+            placeholder="请输入四级审批人"
+            ref="abc"
+          >
+            <el-option
+              v-for="(item, i) in yongHu"
+              :key="i"
+              :label="item.userName"
+              :value="item.userId"
+              @click.native="fourRen(item.userName)"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <div class="jiben">请假原因</div>
+        <el-form-item prop="leaveReason">
+          <el-input
+            v-model="form.leaveReason"
+            type="textarea"
+            placeholder="请输入内容"
+          />
+        </el-form-item>
+        <div class="jiben">驳回原因</div>
+        <el-form-item  prop="reasons">
+          <el-input
+            v-model="form.reasons"
+            type="textarea"
+            placeholder="请输入内容"
+          />
+        </el-form-item>
+        <div class="jiben">特殊审批原因</div>
+        <el-form-item  prop="specialApproval">
+          <el-input
+            v-model="form.specialApproval"
+            type="textarea"
+            placeholder="请输入内容"
+          />
+        </el-form-item>
+      </el-form>
+      <div   class="dialog-footer" slot="footer">
+        <el-button type="primary" @click="CJsubmitForms">通过</el-button>
+        <el-button @click="CJboHui">驳回</el-button>
       </div>
     </el-dialog>
   </div>
@@ -494,6 +685,8 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
+      // 是否显示特殊权限弹出层
+      opens: false,
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -538,7 +731,16 @@ export default {
         leaveType: [
           { required: true, message: "请假类型不能为空", trigger: "blur" },
         ],
-        specialApproval:[
+        specialApproval: [
+          { required: true, message: "审批原因不能为空", trigger: "blur" },
+        ],
+      },
+      // 特殊审批表单验证
+      rulesform:{
+           reasons: [
+          { required: true, message: "请填写驳回原因", trigger: "blur" },
+        ],
+        specialApproval: [
           { required: true, message: "审批原因不能为空", trigger: "blur" },
         ],
       },
@@ -574,6 +776,22 @@ export default {
       this.getdict();
       this.reset();
       const id = row.id || this.ids;
+      getBdglLeave(id).then((response) => {
+        this.form = response.data;
+        this.getYong(this.form.unitId);
+        this.getRen(this.form.unitId);
+        this.opens = true;
+        this.title = "审批人员请假";
+      });
+    },
+    // 审批按钮操作
+    handleUpdates(row) {
+      this.statussp = "1";
+      this.getBuMeng();
+      // 获取字典类型
+      this.getdict();
+      this.reset();
+      const id = row.id || this.ids;
       getBdglLeave(id).then((response) => {
         this.form = response.data;
         this.getYong(this.form.unitId);
@@ -582,7 +800,7 @@ export default {
         this.title = "审批人员请假";
       });
     },
-    // 让select失去焦点
+    // 让单位失去焦点
     blurSelect() {
       this.$refs.headerSearchSelect.blur();
       this.$refs.abc.blur();
@@ -663,7 +881,7 @@ export default {
       this.open = false;
       this.reset();
     },
-    // 通过按钮
+    //审批通过按钮
     submitForms() {
       // this.tongGuo = "1";
       this.bdglLeaveList.forEach((item) => {
@@ -687,7 +905,7 @@ export default {
         this.getList();
       });
     },
-    // 驳回按钮
+    // 审批驳回按钮
     boHui() {
       this.$refs["form"].validate((valid) => {
         if (valid) {
@@ -715,6 +933,57 @@ export default {
         }
       });
     },
+   //超级审批通过按钮
+    CJsubmitForms() {
+      this.bdglLeaveList.forEach((item) => {
+        if (item.shenPiJiBie == "一级") {
+          this.form.status1 = 1;
+          this.form.contents = "一级审批通过";
+        } else if (item.shenPiJiBie == "二级") {
+          this.form.status2 = 1;
+          this.form.contents = "二级审批通过";
+        } else if (item.shenPiJiBie == "三级") {
+          this.form.status3 = 1;
+          this.form.contents = "三级审批通过";
+        } else if (item.shenPiJiBie == "四级") {
+          this.form.status4 = 1;
+          this.form.contents = "四级审批通过";
+        }
+      });
+      updateBdglLeave(this.form).then((response) => {
+        this.$modal.msgSuccess("审批成功");
+        this.open = false;
+        this.getList();
+      });
+    },
+    // 超级审批驳回按钮
+    CJboHui() {
+      this.$refs["forms"].validate((valid) => {
+        if (valid) {
+          this.bdglLeaveList.forEach((item) => {
+            if (item.shenPiJiBie == "一级") {
+              this.form.status1 = 2;
+              return (this.form.contents = "一级审批驳回");
+            } else if (item.shenPiJiBie == "二级") {
+              this.form.status2 = 2;
+              return (this.form.contents = "二级审批驳回");
+            } else if (item.shenPiJiBie == "三级") {
+              this.form.status3 = 2;
+              return (this.form.contents = "三级审批驳回");
+            } else if (item.shenPiJiBie == "四级") {
+              this.form.status4 = 2;
+              return (this.form.contents = "四级审批驳回");
+            }
+          });
+          console.log(this.form);
+          updateBdglLeave(this.form).then((response) => {
+            this.$modal.msgSuccess("审批成功");
+            this.open = false;
+            this.getList();
+          });
+        }
+      });
+    },
     // 表单重置
     reset() {
       this.form = {
@@ -791,22 +1060,6 @@ export default {
         this.title = "修改人员请假";
       });
     },
-    // 审批按钮操作
-    handleUpdates(row) {
-      this.statussp = "1";
-      this.getBuMeng();
-      // 获取字典类型
-      this.getdict();
-      this.reset();
-      const id = row.id || this.ids;
-      getBdglLeave(id).then((response) => {
-        this.form = response.data;
-        this.getYong(this.form.unitId);
-        this.getRen(this.form.unitId);
-        this.open = true;
-        this.title = "审批人员请假";
-      });
-    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate((valid) => {
@@ -996,12 +1249,12 @@ export default {
 }
 .el-button--mini {
   width: 80px !important;
-    border: 1px solid transparent;
-    padding: 3px 8px;
-    font-size: 14px;
-    line-height: 1.5;
-    border-radius: 3px;
-    color: #fff;
-    background-color: #1890ff;
+  border: 1px solid transparent;
+  padding: 3px 8px;
+  font-size: 14px;
+  line-height: 1.5;
+  border-radius: 3px;
+  color: #fff;
+  background-color: #1890ff;
 }
 </style>