|
@@ -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>
|