Browse Source

更新面试结果

gcz 3 years ago
parent
commit
cf16de0a51
1 changed files with 45 additions and 3 deletions
  1. 45 3
      src/components/applys.vue

+ 45 - 3
src/components/applys.vue

@@ -139,9 +139,13 @@
           label="邀请入职时间"
           :label-width="formLabelWidth"
         >
+          <!-- value-format=" yyyy-MM-dd HH:mm"
+            format="yyyy-MM-dd HH:mm" -->
           <el-date-picker
             v-model="form.hiredate"
+            format="yyyy-MM-dd HH:mm"
             type="datetime"
+            default-time="09:00:00"
             placeholder="选择日期"
           >
           </el-date-picker>
@@ -157,6 +161,7 @@
 
 <script>
 import { getApplyList, updateStatus, getDicData } from "@/utils/api";
+import { parseTime } from "@/utils/index";
 import Empty from "@/components/empty.vue";
 export default {
   name: "",
@@ -280,13 +285,50 @@ export default {
       this.dialogVisible = true;
     },
     submit() {
-      this.$confirm("确认更新?")
+      // console.log("this.form", this.form);
+      // console.log("parseTime", parseTime);
+      this.form.hiredate = parseTime(this.form.hiredate);
+      this.form.interviewTime = parseTime(this.form.interviewTime);
+      let that = this;
+      let param = {
+        id: this.form.id,
+        status: this.form.status,
+        interviewMethod: this.form.interviewMethod,
+        interviewArea: this.form.interviewArea,
+        interviewTime: this.form.interviewTime,
+        interviewAddress: this.form.interviewAddress,
+        hiredate: this.form.hiredate,
+      };
+      if (this.form.status == "50") {
+        param = {
+          id: this.form.id,
+          status: this.form.status,
+          hiredate: this.form.hiredate,
+        };
+      }
+
+      // console.log("res", res);
+
+      updateStatus(param)
         .then((res) => {
-          console.log("res", res);
           this.dialogVisible = false;
+          this.handlegetApplyList();
+          this.$message({
+            message: res.msg,
+            type: "success",
+            duration: 1000,
+            onClose: function () {},
+          });
+          // console.log("updateStatus", res);
         })
         .catch((err) => {
-          console.log("err", err);
+          // console.log("err", err);
+          this.$message({
+            message: err.msg,
+            type: "error",
+            duration: 1000,
+            onClose: function () {},
+          });
         });
     },
     handleCurrentChange(val) {