戴艳蓉 3 years ago
parent
commit
c51749283f

+ 2 - 1
src/views/interest/handover/components/addEdit.vue

@@ -4,7 +4,7 @@
     :center="true"
     align="left"
     top="22vh"
-    width="700px"
+    width="600px"
     :close-on-click-modal="false"
     :visible.sync="showModelThis"
     element-loading-text="拼命加载中"
@@ -16,6 +16,7 @@
       <add-edit-form
         v-if="showModel"
         :id="id"
+        :sitem="{}"
         :show-model="showModel"
         :is-detail="isDetail"
         @closeModel="handClick"

+ 67 - 17
src/views/interest/handover/components/addEditForm.vue

@@ -46,15 +46,46 @@
           />
         </el-form-item>
       </el-col>
-      <el-col :span="24" style="text-align: right;padding:0 0  20px 0"    v-if="
-            id === 'add' ||
-            (status === '0' && powers.some((item) => item == '005'))
-          ">
-        <el-button
-          type="primary"
-          :size="'mini'"
-          @click="submitForm"
-       
+      <el-col :span="id !== 'add' ? 12 : 24">
+        <el-form-item label="生效时间" prop="expire_date">
+          <el-date-picker
+            v-model="ruleForm.expire_date"
+            type="datetime"
+            style="width: 100%"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            placeholder="生效时间"
+            :disabled="
+              !(
+                id === 'add' ||
+                (status === '0' && powers.some((item) => item == '005'))
+              )
+            "
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="审核备注" prop="remark">
+          <el-input
+            type="textarea"
+            disabled
+            :autosize="{ minRows: 4, maxRows: 4 }"
+            placeholder="审核备注"
+            maxlength="250"
+            show-word-limit
+            v-model="ruleForm.remark"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col
+        :span="id !== 'add' ? 12 : 24"
+        style="text-align: right; padding: 0 0 20px 0"
+        v-if="
+          id === 'add' ||
+          (status === '0' && powers.some((item) => item == '005'))
+        "
+      >
+        <el-button type="primary" :size="'mini'" @click="submitForm"
           >保 存</el-button
         >
       </el-col>
@@ -66,7 +97,7 @@ import asyncRequest from "@/apis/service/interest/handover";
 import resToken from "@/mixins/resToken";
 export default {
   name: "handover",
-  props: ["id", "newTime","sitem"],
+  props: ["id", "newTime", "sitem"],
   mixins: [resToken],
   data() {
     return {
@@ -78,6 +109,8 @@ export default {
       ruleForm: {
         hand_uid: [],
         resign_uid: [],
+        expire_date: "",
+        remark: "",
       },
       rulesThis: this.rules,
       // 验证规则
@@ -98,6 +131,13 @@ export default {
             trigger: "change",
           },
         ],
+        expire_date: [
+          {
+            required: true,
+            message: "请选择生效时间",
+            trigger: "blur",
+          },
+        ],
       },
     };
   },
@@ -141,20 +181,29 @@ export default {
     async resetForm() {
       this.resign_name = "";
       this.hand_name = "";
-      this.status = "";
       // 重置
       await this.$nextTick(() => {
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
-          let { status, resign_name, hand_name, hand_uid, resign_uid } =
-            this.sitem;
-          this.resign_name = resign_name;
-          this.hand_name = hand_name;
-          this.status = status;
+          console.log(this.sitem);
+          const {
+            status,
+            resign_name,
+            hand_name,
+            hand_uid,
+            resign_uid,
+            expire_date,
+            remark,
+          } = this.sitem;
+          this.resign_name = resign_name || "";
+          this.hand_name = hand_name || "";
+          this.status = status || "";
           this.ruleForm = {
             hand_uid: hand_uid ? hand_uid.split(",") : [],
             resign_uid: resign_uid ? resign_uid.split(",") : [],
+            expire_date: expire_date || "",
+            remark: remark || "",
           };
         }
       });
@@ -162,7 +211,7 @@ export default {
     async submitForm() {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
-          const { resign_uid, hand_uid } = this.ruleForm;
+          const { resign_uid, hand_uid, expire_date } = this.ruleForm;
           let rUid = resign_uid.toString(),
             hUid = hand_uid.toString();
           if (rUid === hUid) {
@@ -174,6 +223,7 @@ export default {
             id: this.id,
             resign_uid: rUid,
             hand_uid: hUid,
+            expire_date: expire_date,
           };
           let res = {};
           if (this.id === "add") {

+ 123 - 10
src/views/interest/handover/detail.vue

@@ -33,9 +33,9 @@
         :options="statusOptions"
         :status="status"
       />
-      <el-tabs v-model="activeTabs" >
+      <el-tabs v-model="activeTabs">
         <el-tab-pane label="业务详情" name="1">
-          <el-collapse v-model="activeNames" style="margin:-18px 0 0 0">
+          <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
             <el-collapse-item title="离职交接详情" name="0">
               <add-edit-form
                 :id="queryId"
@@ -67,12 +67,70 @@
             >
               <div style="height: 50px; padding: 0 0px 20px 0">
                 <el-button
-                  @click="statusConfirm('2', '通过审核')"
+                  @click="dialogFormVisible = true"
+                  type="danger"
+                  class="fr"
+                  :size="'mini'"
+                  plain
+                  style="margin: 0 0 0 12px"
+                  >审核不通过</el-button
+                >
+                <el-button
+                  @click="statusConfirm('3', '通过审核')"
                   type="primary"
                   class="fr"
                   :size="'mini'"
                   >通过审核</el-button
                 >
+                <el-dialog
+                  title="审核备注"
+                  :visible.sync="dialogFormVisible"
+                  :center="true"
+                  align="left"
+                  top="22vh"
+                  width="600px"
+                  :close-on-click-modal="false"
+                  element-loading-text="拼命加载中"
+                  element-loading-spinner="el-icon-loading"
+                  element-loading-background="rgba(0, 0, 0, 0.8)"
+                  @close="dialogFormVisible = false"
+                >
+                  <el-card style="margin-top: -20px">
+                    <el-form
+                      :model="ruleForm"
+                      ref="ruleForm"
+                      status-icon
+                      :rules="rulesThis"
+                    >
+                      <el-form-item label="审核备注" prop="remark">
+                        <el-input
+                          type="textarea"
+                          :autosize="{ minRows: 4, maxRows: 4 }"
+                          placeholder="审核备注"
+                          maxlength="250"
+                          show-word-limit
+                          v-model="ruleForm.remark"
+                        />
+                      </el-form-item>
+                    </el-form>
+                    <div class="clear">
+                      <el-button
+                        type="primary"
+                        class="fr"
+                        :size="'mini'"
+                        style="margin: 0 0 0 12px"
+                        @click="submitForm"
+                        >确 定</el-button
+                      >
+                      <el-button
+                        @click="dialogFormVisible = false"
+                        class="fr"
+                        :size="'mini'"
+                        >取 消</el-button
+                      >
+                    </div>
+                  </el-card>
+                </el-dialog>
               </div>
             </el-collapse-item>
           </el-collapse>
@@ -117,15 +175,33 @@ export default {
       }
     },
   },
+  watch: {
+    dialogFormVisible: function (val) {
+      if (val) {
+        this.initForm();
+      }
+    },
+  },
   data() {
     return {
+      dialogFormVisible: false,
       activeTabs: "1",
       activeNames: ["0", "1", "2", "3"],
-      statusOptions: [
-        { value: "0", label: "待发起审核流程" },
-        { value: "1", label: "待离职交接审核" },
-        { value: "2", label: "离职交接已成功" },
-      ],
+      statusOptions: [],
+      ruleForm: {
+        remark: "",
+      },
+      rulesThis: this.rules,
+      // 验证规则
+      rules: {
+        remark: [
+          {
+            required: true,
+            message: "审核备注不能为空!",
+            trigger: "blur",
+          },
+        ],
+      },
       queryId: "",
       sitem: null,
       newTime: "",
@@ -147,6 +223,20 @@ export default {
         this.sitem = res.data;
         let { status } = this.sitem;
         this.status = status;
+        if (this.status === "2") {
+          this.statusOptions = [
+            { value: "0", label: "待发起审核流程" },
+            { value: "1", label: "待离职交接审核" },
+            { value: "2", label: "审核不通过" },
+          ];
+        } else {
+          this.statusOptions = [
+            { value: "0", label: "待发起审核流程" },
+            { value: "1", label: "待离职交接审核" },
+            { value: "3", label: "待系统更新数据" },
+            { value: "4", label: "离职交接已成功" },
+          ];
+        }
 
         this.getNewTime();
       } else if (res && res.code >= 100 && res.code <= 104) {
@@ -155,6 +245,18 @@ export default {
         this.$message.warning(res.message);
       }
     },
+    async initForm() {
+      await this.$nextTick(() => {
+        this.rulesThis = this.rules;
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          this.ruleForm = {
+            remark: "",
+          };
+        }
+      });
+    },
     async statusConfirm(status, message) {
       await this.$confirm(`确定要${message}?`, {
         confirmButtonText: "确定",
@@ -189,13 +291,14 @@ export default {
       }
     },
 
-    async setStatus(status, message) {
+    async setStatus(status, message, remark) {
       let model = {
         id: this.queryId,
-        remark: "",
+        remark: remark || "",
         status: status,
       };
       const res = await asyncRequest.status(model);
+      this.dialogFormVisible = false;
       this.loading = false;
       if (res && res.code === 0) {
         this.$notify.success({
@@ -209,6 +312,16 @@ export default {
         this.$message.warning(res.message);
       }
     },
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.setStatus("2", "审核提交", this.ruleForm.remark);
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
   },
 };
 </script>

+ 9 - 1
src/views/interest/handover/index.vue

@@ -212,7 +212,9 @@ export default {
       status_options: [
         { value: "0", label: "待发起审核流程" },
         { value: "1", label: "待离职交接审核" },
-        { value: "2", label: "离职交接已成功" },
+        { value: "2", label: "审核不通过" },
+        { value: "3", label: "待系统更新数据" },
+        { value: "4", label: "离职交接已成功" },
       ],
       loading: true,
       showModel: false,
@@ -259,6 +261,11 @@ export default {
           prop: "status",
           label: "状态",
           _slot_: "status",
+        },
+          {
+          prop: "expire_date",
+          label: "生效时间",
+          sortable: true,
         },
         {
           prop: "addtime",
@@ -269,6 +276,7 @@ export default {
           prop: "",
           label: "操作",
           fixed: "right",
+          width:50,
           _noset_: true,
           _slot_: "operation",
         },

+ 1 - 9
src/views/purchaseIn/stockApply/components/addEdit.vue

@@ -65,7 +65,6 @@
               value-format="yyyy-MM-dd HH:mm:ss"
               placeholder="选择日期"
               :picker-options="pickerOptions"
-              @change="selectTime"
               :disabled="
                 !(
                   id === 'add' ||
@@ -288,10 +287,6 @@ export default {
       this.showPDF = true;
       console.log(34567);
     },
-    // 最晚入库时间选择
-    selectTime(e) {
-      this.ruleForm.expecttime = e;
-    },
   
     // 执行点击商品名称的抛出事件
     addGoodsRes(e) {
@@ -308,10 +303,7 @@ export default {
       }
       this.showGoodsModel = true;
     },
-    // 最晚入库时间选择
-    selectTime(e) {
-      this.ruleForm.last_go_stock = e;
-    },
+   
     closeModel() {
       this.$emit("closeModel");
     },

+ 1 - 1
src/views/purchaseIn/stockApply/components/purchaseBack.vue

@@ -268,7 +268,7 @@
         </el-col>
         <el-col
           :span="
-            status === '1' && powers.some((item) => item == '024') ? 12 : 24
+            status === '1' && powers.some((item) => item == '024') ? 12 : 12
           "
           ><el-form-item label="备注" prop="remark" :size="'mini'">
             <el-input