Explorar el Código

Merge branch 'master' of https://git.agilestar.cn/spfm-group/spfm-market-front

noob hace 3 años
padre
commit
1c2ad7450a

+ 50 - 50
src/pages/main/performance/components/dialog.vue

@@ -1,61 +1,61 @@
 <template>
-    <el-dialog
-        :fullscreen="fullscreen"
-        :title="title"
-        :visible.sync="visible"
-        :key="reload"
-        :before-close="handleCancel"
-        :width="width"
-    >
-        <!-- 表格主体部分 -->
-        <slot></slot>
-        <!-- 表格底部 -->
-        <div slot="footer">
-            <el-button @click="handleCancel" size="small">取消</el-button>
-            <el-button @click="handleConfirm" type="primary" size="small"
-                >确定</el-button
-            >
-        </div>
-    </el-dialog>
+  <el-dialog
+    :title="title"
+    :visible.sync="visible"
+    :fullscreen="fullscreen"
+    :key="reload"
+    :before-close="handleCancel"
+    :width="width"
+  >
+    <!-- 表格主体部分 -->
+    <slot></slot>
+    <!-- 表格底部 -->
+    <div slot="footer">
+      <slot name="footer">
+        <el-button @click="handleCancel" size="small">取消</el-button>
+        <el-button @click="handleConfirm" type="primary" size="small">确定</el-button>
+        </slot>
+    </div>
+  </el-dialog>
 </template>
 
 <script>
 export default {
-    props: {
-        visible: {
-            type: Boolean,
-            default: false,
-        },
-        title: {
-            type: String,
-            default: "",
-        },
-        reload: {
-            type: Number,
-            default: 0,
-        },
-        width: {
-            type: String,
-            default: "500px",
-        },
-        fullscreen: {
-            type: Boolean,
-            default: false
-        }
+  props: {
+    visible: {
+      type: Boolean,
+      default: false,
     },
-    mounted() {
-        console.log("我被初始化了");
+    title: {
+      type: String,
+      default: "",
     },
-    methods: {
-        //   确定的回调
-        handleConfirm() {
-            this.$emit("confirm", false);
-        },
-        //   取消的回调
-        handleCancel() {
-            this.$emit("cancel", false);
-        },
+    reload: {
+      type: Number,
+      default: 0,
     },
+    width: {
+      type: String,
+      default: "500px",
+    },
+    fullscreen: {
+        type: Boolean,
+        default: false
+    }
+  },
+  mounted() {
+    console.log("我被初始化了");
+  },
+  methods: {
+    //   确定的回调
+    handleConfirm() {
+      this.$emit("confirm", false);
+    },
+    //   取消的回调
+    handleCancel() {
+      this.$emit("cancel", false);
+    },
+  },
 };
 </script>
 

+ 139 - 115
src/pages/main/performance/department.vue

@@ -1,54 +1,103 @@
 <template>
-  <div class="simple-container">
-    <simple-form :form="table_form" @search="handleSearch">
-      <!-- :handle="table_handle"
+  <div>
+    <div class="simple-container">
+      <simple-form :form="table_form" @search="handleSearch">
+        <!-- :handle="table_handle"
       @add="handleRulesVisible"
       @class="handleDrawer('class')"
       @download="handleDownload" -->
-    </simple-form>
-    <simple-table
-      :list="table_list"
-      :config="table_config"
-      :loading="table_loading"
-      :handle-row="table_handle_row"
-      @check="handleCheck"
-      @edit="handleEdit"
-    ></simple-table>
-    <simple-pagination
-      :page="page"
-      :total="total"
-      @change="handleChange"
-    ></simple-pagination>
+      </simple-form>
+      <simple-table
+        :list="table_list"
+        :config="table_config"
+        :loading="table_loading"
+        :handle-row="table_handle_row"
+        @check="handleCheck"
+        @edit="handleEdit"
+      ></simple-table>
+      <simple-pagination
+        :page="page"
+        :total="total"
+        @change="handleChange"
+      ></simple-pagination>
+    </div>
     <simple-dialog
-      :title="title"
+      title="部门绩效"
       :visible="visible"
       :reload="reload"
-      :width="width"
+      width="1200px"
+      @cancel="beforeCancel"
+    >
+      <template>
+        <!-- 按钮部分 -->
+        <div class="flex-justify-between">
+          <div>
+            <el-button type="primary">转派</el-button>
+            <el-button type="primary" @click="handleApprove">审批</el-button>
+            <el-button type="primary" @click="handleTrack">流程跟踪</el-button>
+            <el-button type="primary">导出</el-button>
+          </div>
+          <div>
+            <el-button @click="handleCancel" type="primary">返回</el-button>
+          </div>
+        </div>
+        <!-- 主体部分 -->
+        <analysis />
+      </template>
+      <template v-slot:footer><div></div></template>
+    </simple-dialog>
+    <simple-dialog
+      title="审批"
+      :visible="approve_visible"
+      :reload="reload"
+      width="500px"
+      @cancel="beforeCancel"
+    >
+      <el-form :model="approveForm" :rules="approverules" ref="approveForm"
+        ><el-form-item label="审批意见" prop="comments" label-width="80px"
+          ><el-input
+            type="textarea"
+            v-model="approveForm.comments"
+            autosize /></el-form-item
+      ></el-form>
+      <template v-slot:footer
+        ><div>
+          <div v-if="type === '1'">
+            <el-button @click="handleCancel">结束</el-button>
+            <el-button @click="handleTurn(type)" type="primary"
+              >转副总审批</el-button
+            >
+          </div>
+          <div v-else-if="type === '2'">
+            <el-button @click="handleCancel">结束</el-button>
+            <el-button @click="handleCancel">打回</el-button>
+            <el-button @click="handleTurn(type)" type="primary"
+              >转总经理审批</el-button
+            >
+          </div>
+          <div v-else>
+            <el-button @click="handleCancel">打回</el-button>
+            <el-button @click="handleTurn(type)" type="primary">同意</el-button>
+          </div>
+        </div>
+      </template>
+    </simple-dialog>
+    <simple-dialog
+      title="流程跟踪"
+      :visible="track_visible"
+      :reload="reload"
+      width="600px"
       @confirm="handleConfirm"
-      @cancel="handleCancel"
+      @cancel="beforeCancel"
     >
-      <el-form ref="form" :model="form" label-width="80px">
-        <el-form-item label="可编辑列"
-          ><el-input v-model="form.editrows"
-        /></el-form-item>
-        <el-form-item label="权限规则">
-          <el-select v-model="form.rule">
-            <el-option
-              v-for="item in ruleoptions"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            ></el-option> </el-select
-        ></el-form-item>
-        <el-form-item label="负责人">
-          <el-cascader-panel
-            v-model="form.charge"
-            :options="chargeoptions"
-            clearable
-            @change="handleCascader"
-          ></el-cascader-panel
-        ></el-form-item>
-      </el-form>
+      <el-table :data="trackList" border>
+        <el-table-column prop="link" label="流程环节" align="center" width="180">
+        </el-table-column>
+        <el-table-column prop="creatperson" label="处理人" align="center" width="180">
+        </el-table-column>
+        <el-table-column prop="explain" label="审批说明" align="center">
+        </el-table-column>
+      </el-table>
     </simple-dialog>
   </div>
 </template>
@@ -58,84 +107,44 @@ import simpleForm from "./components/form.vue";
 import simpleTable from "./components/table.vue";
 import simplePagination from "./components/pagination.vue";
 import simpleDialog from "./components/dialog.vue";
+import Analysis from "./analysis.vue";
 export default {
   components: {
     simpleForm,
     simpleTable,
     simplePagination,
     simpleDialog,
+    Analysis,
   },
   data() {
     return {
       page: 1,
       total: 5,
       //   dialog 参数
-      title: "权限设置",
       visible: false,
+      approve_visible: false,
+      track_visible: false,
       reload: 0,
-      width: "800px",
-      form: {},
-      ruleoptions: [
-        {
-          value: "按行号",
-          label: "按行号",
-        },
-        {
-          value: "按科室分配",
-          label: "按科室分配",
-        },
-        {
-          value: "按负责人分配",
-          label: "按负责人分配",
-        },
-        {
-          value: "所有人员",
-          label: "",
-        },
-      ],
-      chargeoptions: [
+      // 判断类型
+      type: "2",
+      approverules: {
+        comments: [
+          {
+            required: true,
+            message: "请输入审批意见",
+            trigger: "blur",
+          },
+        ],
+      },
+      // 审批意见
+      approveForm: { comments: "" },
+      trackList: [
         {
-          label: "科室名称1",
-          value: "科室名称1",
-          children: [
-            {
-              label: "负责人",
-              value: "负责人",
-              children: [{ label: "尹强", value: "尹强" }],
-            },
-          ],
+          link: "发起工单",
+          creatperson: "XXX  2021-06-08",
+          explain: "",
         },
       ],
-    //   //   弹出层具体的内容
-    //   dialog_content: [
-    //     {
-    //       props: "editrows",
-    //       type: "input",
-    //     },
-    //     {
-    //       label: "权限规则",
-    //       props: "rule",
-    //       type: "select",
-    //     },
-    //     {
-    //       label: "负责人",
-    //       props: "charge",
-    //       type: "cascader",
-    //       options: [
-    //         {
-    //           label: "科室名称1",
-    //           value: "科室名称1",
-    //           children: [
-    //             {
-    //               label: "负责人",
-    //               value: "负责人",
-    //               children: [{ label: "尹强", value: "尹强" }],
-    //             },
-    //           ],
-    //         },
-    //       ],
-    //     },
-    //   ],
       //   顶部form
       table_form: [
         {
@@ -285,7 +294,7 @@ export default {
       this.page = page;
       this.handleInit();
     },
-    // 搜索时间
+    // 搜索事件
     handleSearch(data) {
       console.log(data);
     },
@@ -294,23 +303,38 @@ export default {
       console.log(row, "row");
       this.visible = true;
     },
-    // 级联选择
-    handleCascader(data) {
-      console.log(data, "data");
-    },
     handleCheck() {},
     handleDelete() {},
-    handleConfirm(visible) {
+    // dialog事件
+    //权限管理事件
+    handleApprove() {
       this.reload++;
-      this.params = {};
-      this.visible = visible;
-      console.log(this.params, "handleConFirm");
+      this.visible = false;
+      this.approve_visible = true;
     },
-    handleCancel(data) {
+    handleTrack() {
       this.reload++;
-      this.params = {};
+      this.visible = false;
+      this.track_visible = true;
+    },
+    beforeCancel(data) {
       this.visible = data;
-      console.log(data, "handleCancel");
+      this.approve_visible = data;
+      this.track_visible = data;
+    },
+    handleTurn(type) {
+      console.log(type);
+    },
+    handleConfirm(visible) {
+      this.reload++;
+      this.track_visible = visible;
+    },
+    // 关闭方法
+    handleCancel() {
+      this.reload++;
+      this.visible = false;
+      this.approve_visible = false;
+      this.track_visible = false;
     },
   },
 };