|
@@ -0,0 +1,171 @@
|
|
|
+<template>
|
|
|
+ <el-form
|
|
|
+ ref="ruleForm"
|
|
|
+ :model="ruleForm"
|
|
|
+ status-icon
|
|
|
+ :rules="rulesThis"
|
|
|
+ label-width="100px"
|
|
|
+ class="demo-ruleForm"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12"
|
|
|
+ ><el-form-item label="审核状态" prop="state">
|
|
|
+ <el-select
|
|
|
+ v-model="ruleForm.state"
|
|
|
+ placeholder="请选择审核状态"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in stateList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="驳回节点" prop="status">
|
|
|
+ <el-select
|
|
|
+ v-model="ruleForm.status"
|
|
|
+ placeholder="请选择驳回节点"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <template v-for="item in statusList">
|
|
|
+ <el-option
|
|
|
+ v-if="!item.hidden"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </template>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item label="审核备注" prop="contactor" style="width: 100%">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入审核备注"
|
|
|
+ v-model="ruleForm.remark"
|
|
|
+ maxlength="250"
|
|
|
+ :autosize="{ minRows: 2, maxRows: 4 }"
|
|
|
+ show-word-limit
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: "exam-form",
|
|
|
+ // mixins: [resToken],
|
|
|
+ props: ["size", "statusList", "disabled"],
|
|
|
+ /**
|
|
|
+ * 属性集合
|
|
|
+ * @param {String} size : 组件大小 非必填
|
|
|
+ * @param {Array} statusList : 驳回至备选项 必填
|
|
|
+ * @param {Boolean} disabled : 是否禁用 必填
|
|
|
+ *
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 事件集合
|
|
|
+ * @searchChange : 选中值变化调用 抛出选中数据
|
|
|
+ */
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ stateList: [
|
|
|
+ {
|
|
|
+ value: "1",
|
|
|
+ label: "通过",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "0",
|
|
|
+ label: "驳回",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ showModelThis: this.showModel,
|
|
|
+ ruleForm: {
|
|
|
+ state: "1", // 通过or驳回
|
|
|
+ rebut: "", //驳回至
|
|
|
+ remark: "",
|
|
|
+ },
|
|
|
+ rulesThis: this.rules,
|
|
|
+ rules: {
|
|
|
+ state: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择审核状态",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ rebut: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择驳回节点",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ remark: [
|
|
|
+ { required: true, message: "请输入仓库详细地址", trigger: "blur" },
|
|
|
+ {
|
|
|
+ min: 1,
|
|
|
+ max: 250,
|
|
|
+ message: "长度在 1 到 250 个字符",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ isDetail: function (val, old) {
|
|
|
+ if (this.isDetail !== val) {
|
|
|
+ this.options = [];
|
|
|
+ this.selectLoading = false;
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.options = [];
|
|
|
+ this.selectLoading = false;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async selectChange(e) {
|
|
|
+ this.$emit("searchChange", e);
|
|
|
+ },
|
|
|
+ async getList() {
|
|
|
+ this.options = [];
|
|
|
+ const res = await asyncRequest.list({});
|
|
|
+ if (res && res.code === 0 && res.data) {
|
|
|
+ this.options = res.data;
|
|
|
+ this.recursion(this.options);
|
|
|
+ } else {
|
|
|
+ this.options = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ recursion(list) {
|
|
|
+ list.map((v) => {
|
|
|
+ if (v && Array.isArray(v.child)) {
|
|
|
+ v.value = v.id + "";
|
|
|
+ v.label = v.name;
|
|
|
+ if (v.child.length === 0) {
|
|
|
+ delete v["child"];
|
|
|
+ } else {
|
|
|
+ this.recursion(v.child);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+</style>
|