Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

houlf 3 rokov pred
rodič
commit
64e49fed72

+ 2 - 0
.env.development

@@ -0,0 +1,2 @@
+VUE_APP_FILE_API = http://192.168.1.9:9114
+VUE_APP_GRID_API = http://192.168.1.19:9114

+ 2 - 0
.env.production

@@ -0,0 +1,2 @@
+VUE_APP_FILE_API =
+VUE_APP_GRID_API =

BIN
dist.zip


+ 1 - 1
package.json

@@ -25,6 +25,7 @@
     "luckyexcel": "^1.0.1",
     "moment": "^2.29.1",
     "qs": "^6.9.1",
+    "sass": "^1.46.0",
     "tinymce": "^5.7.1",
     "vue": "^2.6.11",
     "vue-axios": "^2.1.5",
@@ -44,7 +45,6 @@
     "compression-webpack-plugin": "^3.0.1",
     "eslint": "^5.16.0",
     "eslint-plugin-vue": "^5.0.0",
-    "node-sass": "^4.14.1",
     "sass-loader": "^8.0.0",
     "script-loader": "^0.7.2",
     "vue-template-compiler": "^2.6.11",

+ 438 - 0
src/pages/main/gridDivision/approvalExamination.vue

@@ -0,0 +1,438 @@
+<template>
+  <div class="simple-container approvalExamination-container">
+    <simple-form
+      :form="table_form"
+      :handle="table_handle"
+      @search="handleSearch"
+      @track="handleQueryTrack"
+      @batch="handleBatch"
+      @turn="handleReturn"
+    >
+    </simple-form>
+    <simple-table
+      :list="table_list"
+      :config="table_config"
+      :loading="table_loading"
+      :handle-row="table_handle_row"
+      @download="handleDownload"
+      @selection="handleSelect"
+      @back="handleBack"
+    ></simple-table>
+    <simple-pagination
+      :page="page"
+      :total="total"
+      @change="handleChange"
+    ></simple-pagination>
+    <simple-dialog
+      title="审批"
+      width="40%"
+      @cancel="handleVisible('opinion')"
+      :visible="opinion_visible"
+    >
+      <el-form label-width="80px" :model="opinion_form" ref="opinion_ref">
+        <el-form-item label="审批意见" prop="opinion">
+          <el-input
+            :rows="8"
+            type="textarea"
+            v-model="opinion_form.opinion"
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <template v-slot:footer>
+        <div>
+          <el-button v-if="!isAgree" @click="handleOpinion('1')" type="default"
+            >退回修改</el-button
+          >
+          <el-button v-else @click="handleOpinion('0')" type="primary"
+            >同意</el-button
+          >
+        </div>
+      </template>
+    </simple-dialog>
+    <simple-dialog
+      title="审批轨迹"
+      :fullscreen="true"
+      @cancel="handleVisible('track')"
+      :visible="track_visible"
+    >
+      <simple-table
+        :list="table_list_track"
+        :config="table_config_track"
+        :loading="table_loading_track"
+      ></simple-table>
+      <template v-slot:footer>
+        <!-- <div>
+          <el-button @click="handleVisible('track')" type="default"
+            >退回修改</el-button
+          >
+          <el-button @click="handleConsent" type="primary">同意</el-button>
+        </div> -->
+        <el-button @click="handleConsent" type="primary">确定</el-button>
+      </template>
+    </simple-dialog>
+  </div>
+</template>
+
+<script>
+import simpleForm from "../performance/components/form.vue";
+import simpleTable from "../performance/components/table.vue";
+import simpleDialog from "../performance/components/dialog.vue";
+import simplePagination from "../performance/components/pagination.vue";
+export default {
+  components: {
+    simpleForm,
+    simpleDialog,
+    simpleTable,
+    simplePagination,
+  },
+  data() {
+    return {
+      // 审批意见
+      opinion_visible: false,
+      track_visible: false,
+      opinion_form: {},
+      status:'',
+      isAgree: false,
+      // 单条审批id
+      ids: "",
+      parentId: "",
+      adoptIds: [],
+      page: 1,
+      rows: 10,
+      total: 0,
+      table_form: [
+        {
+          label: "公司名称",
+          props: "companyName",
+          type: "input",
+        },
+        {
+          label: "状态",
+          props: "sts",
+          type: "select",
+          // 0.待办  1.已办
+          dictionary: [
+            {
+              label: "待办",
+              value: "0",
+            },
+            {
+              label: "已办",
+              value: "1",
+            },
+          ],
+        },
+      ],
+      table_loading: false,
+      table_handle: [
+        {
+          label: "返回",
+          props: "turn",
+        },
+        {
+          label: "审批轨迹",
+          props: "track",
+        },
+        {
+          label: "批量审批",
+          props: "batch",
+        },
+      ],
+      // 列表数据
+      table_list: [],
+      // 表头配置
+      table_config: [
+        {
+          label: "序号",
+          props: "No",
+        },
+        {
+          label: "公司名称",
+          props: "companyName",
+        },
+        {
+          label: "提出人",
+          props: "proposer",
+        },
+        {
+          label: "联系电话",
+          props: "telephone",
+        },
+        {
+          label: "网格划分需求",
+          props: "wanggeText",
+        },
+        {
+          label: "附件",
+          props: "fileNames",
+          type: "file",
+        },
+        {
+          label: "状态",
+          props: "sts",
+          type: "dictionary",
+          dictionary: { 0: "待办", 1: "已办" },
+        },
+      ],
+      //   表格里的操作按钮
+      table_handle_row: [
+        {
+          label: "不通过",
+          props: "back",
+          visible: { sts: ["0"] },
+        },
+        {},
+        {},
+      ],
+      table_loading_track: false,
+      // 审批轨迹内表数据
+      table_list_track: [],
+      // 审批轨迹内表头配置
+      table_config_track: [
+        {
+          label: "编号",
+          props: "No",
+        },
+        {
+          label: "流程环节",
+          props: "taskName",
+        },
+        {
+          label: "处理人",
+          props: "opName",
+        },
+        {
+          label: "处理工号",
+          props: "opNo",
+        },
+        {
+          label: "处理时间",
+          props: "opTime",
+        },
+        {
+          label: "审批意见",
+          props: "remark",
+          // type: "dictionary",
+          // dictionary: { 0: "同意", 1: "不同意" },
+        },
+      ],
+    };
+  },
+  watch: {
+    parentId() {
+      this.handleInit();
+    },
+  },
+  mounted() {
+    this.parentId = this.$route.query.parentId;
+    this.status = this.$route.query.status;
+  },
+  methods: {
+    // 表格数据初始化
+    handleInit() {
+      this.table_loading = true;
+      let reqdata = {
+        ...this.table_search,
+        type: "2",
+        page: this.page,
+        parentId: this.parentId,
+        pageSize: this.rows,
+      };
+      this.$http({
+        url: "/market/mkWangge/queryPage",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: reqdata,
+      }).then(({ data: { count, data } }) => {
+        this.table_loading = false;
+        this.total = count;
+        this.table_list = data
+          ? data.map((element, index) => ({
+              ...element,
+              No: index + 1,
+              sts:Number(this.status)
+            }))
+          : [];
+        this.table_list && this.table_list[0].sts === "0"
+          ? (this.table_handle = [
+              {
+                label: "返回",
+                props: "turn",
+              },
+              {
+                label: "审批轨迹",
+                props: "track",
+              },
+              {
+                label: "批量审批",
+                props: "batch",
+              },
+            ])
+          : (this.table_handle = [
+              {
+                label: "返回",
+                props: "turn",
+              },
+              {
+                label: "审批轨迹",
+                props: "track",
+              },
+            ]);
+        data.forEach((item) => {
+          this.adoptIds.push(item.id.toString());
+        });
+        // console.log(this.table_list,'table_list');
+        // console.log(this.adoptIds);
+      });
+    },
+    // 搜索事件
+    handleSearch(data) {
+      this.table_search = data;
+      this.page = 1;
+      this.handleInit();
+    },
+    // 翻页
+    handleChange(page) {
+      this.page = page;
+      this.handleInit();
+    },
+    handleDownload(data) {
+      console.log(data, "data");
+    },
+    handleVisible(props) {
+      switch (props) {
+        case "opinion":
+          this.opinion_visible = !this.opinion_visible;
+          this.isAgree = false;
+          this.opinion_form = {};
+          break;
+        case "track":
+          this.track_visible = !this.track_visible;
+          break;
+        case "batch":
+          this.opinion_visible = !this.opinion_visible;
+          this.isAgree = true;
+          break;
+      }
+    },
+    // 查询审批轨迹
+    handleQueryTrack() {
+      // let type = this.parentId === null ? "1" : "0";
+      this.$http({
+        url: "/market/mkWangge/getMkWanggeById",
+        method: "get",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        params: {
+          id: this.parentId,
+          type: 0,
+        },
+      }).then(({ data }) => {
+        let body = data.body;
+        console.log(body, "body");
+        // this.ids = [body.id.toString()];
+        this.table_list_track = body.bpmTaskList.map((item, index) => ({
+          ...item,
+          No: index + 1,
+        }));
+      });
+      this.handleVisible("track");
+    },
+    // 批量审批
+    handleBatch() {
+      this.handleVisible("batch");
+    },
+    handleSelect(val) {
+      console.log(val);
+    },
+    // 审批不通过
+    handleBack(row) {
+      // console.log(row);
+      this.ids = row.id.toString();
+      this.handleVisible("opinion");
+      this.isAgree = false;
+    },
+    // 审批意见提交
+    handleOpinion(type) {
+      let reqdata = {};
+      if (type === "1") {
+        // 批量退回
+        reqdata = {
+          parentId: this.parentId,
+          mkWanggeList: [
+            {
+              id: this.ids,
+              remark: this.opinion_form.opinion,
+            },
+          ],
+        };
+        console.log(reqdata);
+        this.$http({
+          url: "/market/mkWangge/backList",
+          method: "post",
+          headers: {
+            "Content-Type": "application/json",
+          },
+          data: {
+            ...reqdata,
+          },
+        }).then((res) => {
+          console.log(res);
+          this.handleInit();
+        });
+      } else {
+        // 批量审批(多条)
+        reqdata = {
+          adoptIds: this.adoptIds,
+          remark: this.opinion_form.opinion,
+          parentId: this.parentId,
+          type: type,
+        };
+        console.log(reqdata);
+        this.$http({
+          url: "/market/mkWangge/reviewMore",
+          method: "post",
+          headers: {
+            "Content-Type": "application/json",
+          },
+          data: {
+            ...reqdata,
+          },
+        }).then((res) => {
+          console.log(res);
+          this.handleInit();
+        });
+      }
+
+      this.handleVisible("opinion");
+    },
+    handleReturn(){
+      this.$router.go(-1)
+    },
+    // 审批轨迹--确定关闭模态框
+    handleConsent() {
+      this.handleVisible("track");
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.approvalExamination-container {
+  background: #ffffff;
+  padding: 0 20px;
+  padding-top: 20px;
+  margin: 15px;
+  overflow: auto;
+  width: calc(100% - 30px);
+  max-width: calc(100% - 30px);
+  height: 100%;
+  overflow-x: hidden;
+}
+::v-deep .el-row {
+  padding-bottom: 12px;
+}
+</style>

+ 0 - 74
src/pages/main/gridDivision/components/dialog.vue

@@ -1,74 +0,0 @@
-<template>
-  <el-dialog
-    :modal="modal"
-    :title="title"
-    :visible.sync="visible"
-    :fullscreen="fullscreen"
-    :key="reload"
-    :before-close="handleCancel"
-    :modal-append-to-body="false"
-    :width="width"
-    :destroy-on-close="destroy"
-  >
-    <!-- 表格主体部分 -->
-    <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,
-    },
-    modal: {
-      type: Boolean,
-      default: true,
-    },
-    destroy: {
-      type: Boolean,
-      default: false
-    }
-  },
-  mounted() {
-  },
-  methods: {
-    //   确定的回调
-    handleConfirm() {
-      this.$emit("confirm", false);
-    },
-    //   取消的回调
-    handleCancel() {
-      this.$emit("cancel", false);
-    },
-  },
-};
-</script>
-
-<style></style>

+ 0 - 94
src/pages/main/gridDivision/components/form.vue

@@ -1,94 +0,0 @@
-<!--
- * @Author       : yuanrunwei
- * @Date         : 2021-11-01 18:03:02
- * @LastEditors  : yuanrunwei
- * @LastEditTime : 2021-12-04 17:53:54
- * @FilePath     : \spfm-market-front\src\pages\main\performance\components\form.vue
--->
-<template>
-    <el-form :inline="true" :model="object">
-        <el-row :gutter="24">
-            <el-col
-                v-for="({ props, label, type, dictionary }, index) in form"
-                :key="index"
-                :span="6"
-            >
-                <el-form-item :label="label">
-                    <template v-if="type === 'select'">
-                        <el-select
-                            v-model="object[props]"
-                            :placeholder="label"
-                            filterable
-                            clearable
-                        >
-                            <el-option
-                                :label="label"
-                                :value="value"
-                                v-for="({ label, value }, index) in dictionary"
-                                :key="index"
-                            ></el-option>
-                        </el-select>
-                    </template>
-                    <template v-else-if="['date', 'month'].includes(type)">
-                        <el-date-picker
-                            v-model="object[props]"
-                            :type="type"
-                            :placeholder="label"
-                        >
-                        </el-date-picker>
-                    </template>
-                    <template v-else>
-                        <el-input
-                            v-model="object[props]"
-                            :placeholder="label"
-                            clearable
-                        ></el-input>
-                    </template>
-                </el-form-item>
-            </el-col>
-            <el-col :span="6">
-                <el-form-item>
-                    <el-button type="primary" @click="handleSearch"
-                        >搜索</el-button
-                    >
-                </el-form-item>
-            </el-col>
-            <el-col class="flex-justify-align-end" :span="24">
-                <el-button
-                    v-for="({ label, props }, index) in handle"
-                    :key="index"
-                    @click="handleSubmit(props)"
-                >
-                    <i class="el-icon-document-add font-weight-bold" />{{
-                        label
-                    }}
-                </el-button>
-            </el-col>
-        </el-row>
-    </el-form>
-</template>
-<script>
-export default {
-    props: {
-        form: {
-            type: Array,
-            default: () => [],
-        },
-        handle: {
-            type: Array,
-            default: () => [],
-        },
-    },
-    data: () => ({
-        object: {},
-    }),
-    methods: {
-        handleSearch() {
-            this.$emit("search", this.object);
-        },
-        handleSubmit(params) {
-            this.$emit(params, this.object);
-        },
-    },
-};
-</script>

+ 0 - 38
src/pages/main/gridDivision/components/pagination.vue

@@ -1,38 +0,0 @@
-<!--
- * @Author       : yuanrunwei
- * @Date         : 2021-11-01 18:11:59
- * @LastEditors  : yuanrunwei
- * @LastEditTime : 2021-11-02 14:27:11
- * @FilePath     : \spfm-front\src\pages\main\dataConfig\components\pagination.vue
--->
-<template>
-    <el-pagination
-        class="simple-pagination"
-        @current-change="handleChange"
-        layout="prev, pager, next"
-        background
-        :current-page="page"
-        :total="total"
-    >
-    </el-pagination>
-</template>
-<script>
-export default {
-    props: {
-        page: {
-            type: Number,
-            default: 0
-        },
-        total: {
-            type: Number,
-            default: 0
-        }
-    },
-    data: () => ({}),
-    methods: {
-        handleChange(page) {
-            this.$emit("change", page);
-        }
-    }
-};
-</script>

+ 0 - 530
src/pages/main/gridDivision/components/sheet.vue

@@ -1,530 +0,0 @@
-<!--
- * @Author       : yuanrunwei
- * @Date         : 2021-12-04 14:23:58
- * @LastEditors  : yuanrunwei
- * @LastEditTime : 2021-12-28 20:20:48
- * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
--->
-
-<template>
-    <div class="sheet-container">
-        <div class="flex-justify-align-end margin-bottom-20">
-            <el-button
-                type="primary"
-                @click="handleVisible"
-                v-if="['template'].includes(attribute)"
-                >权限设置</el-button
-            >
-            <el-button type="primary" @click="handleDownload">导出</el-button>
-            <el-button type="primary" @click="handleFullscreen()"
-                >全屏显示</el-button
-            >
-            <template v-if="['edit'].includes(type)">
-                <el-upload
-                    v-if="!id"
-                    class="margin-right-10 margin-left-10"
-                    action
-                    :on-change="handleChange"
-                    :show-file-list="false"
-                >
-                    <el-button type="primary">上传</el-button>
-                </el-upload>
-                <el-button
-                    type="primary"
-                    @click="handleSave"
-                    :disabled="handleForbid()"
-                    ><span>{{ id ? "提交" : "新增" }}</span
-                    ><span>{{
-                        handleForbid() ? `(请先设置权限)` : ""
-                    }}</span></el-button
-                >
-            </template>
-        </div>
-        <div id="luckysheet" class="sheet-container-block"></div>
-        <simple-dialog
-            title="权限设置"
-            :visible="visible"
-            :modal="false"
-            width="700px"
-            @confirm="handleAuth"
-            @cancel="handleVisible"
-        >
-            <el-form ref="form" :model="form" label-width="100px">
-                <el-form-item
-                    label="可编辑列"
-                    prop="array"
-                    :rules="{
-                        required: true,
-                        message: '可编辑列不能为空',
-                        trigger: 'change',
-                    }"
-                    ><el-select
-                        v-model="form.array"
-                        placeholder="可编辑列"
-                        multiple
-                    >
-                        <el-option
-                            v-for="(value, index) in 10"
-                            :key="index"
-                            :label="index + 1"
-                            :value="index + 1"
-                        >
-                        </el-option> </el-select
-                ></el-form-item>
-                <el-form-item
-                    label="权限规则"
-                    prop="type"
-                    :rules="{
-                        required: true,
-                        message: '权限规则不能为空',
-                        trigger: 'change',
-                    }"
-                >
-                    <el-select v-model="form.type">
-                        <el-option
-                            v-for="item in type_options"
-                            :key="item.value"
-                            :label="item.label"
-                            :value="item.value"
-                        ></el-option> </el-select
-                ></el-form-item>
-                <el-form-item
-                    label="负责人"
-                    prop="charge"
-                    :rules="{
-                        required: true,
-                        message: '负责人不能为空',
-                        trigger: 'blur',
-                    }"
-                >
-                    <div
-                        class="flex-justify-start"
-                        v-for="(item, index) in form.charge"
-                        :key="index"
-                    >
-                        <el-select
-                            v-model="item.key"
-                            class="margin-bottom-20 margin-right-10 flex-1"
-                            placeholder="请选择指定列/行"
-                            multiple
-                        >
-                            <el-option
-                                v-for="(value, index) in 10"
-                                :key="index"
-                                :label="index + 1"
-                                :value="index + 1"
-                            >
-                            </el-option>
-                        </el-select>
-                        <el-select
-                            class="margin-bottom-20"
-                            placeholder="请选择负责人"
-                            v-model="item.value"
-                            filterable
-                        >
-                            <el-option
-                                v-for="({ label, value }, index) in charge_list"
-                                :key="index"
-                                :label="label"
-                                :value="value"
-                            ></el-option>
-                        </el-select>
-                    </div>
-
-                    <div>
-                        <el-button @click.prevent="handleCharge('add')"
-                            >添加</el-button
-                        >
-                        <el-button
-                            v-if="form.charge.length - 1"
-                            @click.prevent="handleCharge('delete')"
-                            >删除</el-button
-                        >
-                    </div>
-                </el-form-item>
-            </el-form>
-            <template v-if="!id" v-slot:footer><div></div></template>
-        </simple-dialog>
-    </div>
-</template>
-
-<script>
-import luckyexcel from "luckyexcel";
-import { exportExcel } from "../common/export";
-import simpleDialog from "./dialog.vue";
-export default {
-    components: {
-        simpleDialog,
-    },
-    props: {
-        type: {
-            type: String,
-            default: "view", // view 查看 edit 编辑
-        },
-        attribute: {
-            type: String,
-            default: "template", // template 模板 order 工单 file 文件
-        },
-        id: {
-            default: null,
-        },
-    },
-    data() {
-        return {
-            form: {
-                charge: [{ value: "" }],
-            },
-            issued_id: null,
-            template_id: null,
-            visible: false,
-            row_list: [],
-            column_list: [],
-            charge_list: [],
-            type_options: [
-                {
-                    value: 1,
-                    label: "按行",
-                },
-                // {
-                //     value: 2,
-                //     label: "按列",
-                // },
-            ],
-        };
-    },
-    methods: {
-        handleInit() {
-            if (this.id) {
-                this.handleQuery();
-            } else {
-                this.handleCreate();
-            }
-        },
-        handleAllow({ row, column }) {
-            return (
-                this.row_list.includes(row) && this.column_list.includes(column)
-            );
-        },
-        async handleQuery() {
-            let url = "";
-            let key = "";
-            switch (this.attribute) {
-                case "template":
-                    url = "/market/CMKFileTemplate/QueryCMKFileTemplateById";
-                    key = "templateId";
-                    break;
-                case "order":
-                    url = "/market/CMKIssued/CMKQueryIssuedById";
-                    key = "id";
-                    break;
-                case "file":
-                    url = "/market/CMKIssued/CMKIssuedProcessByUser";
-                    key = "id";
-                    break;
-            }
-            const {
-                data: {
-                    templateContent,
-                    templateName,
-                    issuedId,
-                    templateId,
-                    list,
-                },
-            } = await this.$http({
-                url,
-                method: "post",
-                headers: {
-                    "Content-Type": "application/json",
-                },
-                data: {
-                    [key]: this.id,
-                },
-            });
-            this.template_id = templateId;
-            this.issued_id = issuedId;
-            if (list && list.length) {
-                const [{ type, allowEditingColumns, rowNum }] = list;
-                this.form = {
-                    ...this.form,
-                    type: JSON.parse(type),
-                    array: allowEditingColumns
-                        ? allowEditingColumns.split(",")
-                        : [],
-                    charge: list.map(
-                        ({ principalId, principalName, rowNum }) => ({
-                            value: `${principalId},${principalName}`,
-                            key: rowNum.split(","),
-                        })
-                    ),
-                };
-                this.row_list =
-                    this.type === "edit"
-                        ? rowNum
-                              .split(",")
-                              .map((element) => JSON.parse(element) - 1)
-                        : [];
-                this.column_list =
-                    this.type === "edit"
-                        ? allowEditingColumns
-                              .split(",")
-                              .map((element) => JSON.parse(element) - 1)
-                        : [];
-            }
-            this.handleCreate({
-                json: templateContent ? JSON.parse(templateContent) : {},
-                name: templateName,
-                type: "json",
-            });
-        },
-        handleForbid() {
-            const object = {};
-            const { array, type, charge } = this.form;
-            charge.map(({ key, value }) => {
-                if (key && value) {
-                    object[key] = value;
-                }
-            });
-            return !(Object.keys(object).length && array.length && type);
-        },
-        async handleCreate({ file, json, type, name } = {}) {
-            let that = this;
-            const options = {
-                container: "luckysheet",
-                lang: "zh",
-                showsheetbar: false,
-                hook: {
-                    cellEditBefore: function ([
-                        { row_focus: row, column_focus: column },
-                    ]) {
-                        if (!that.handleAllow({ row, column })) {
-                            that.$message.error("您没有编辑权限");
-                        }
-                    },
-                    cellUpdateBefore: function (row, column) {
-                        if (!that.handleAllow({ row, column })) {
-                            return false;
-                        }
-                    },
-                    cellRenderAfter: function (cell, position) {
-                        const { r: row, c: column } = position;
-                        if (cell) {
-                            if (!that.handleAllow({ row, column })) {
-                                cell.bg = "#d5d5d5";
-                            } else {
-                                cell.bg = "#ffffff";
-                            }
-                        }
-                    },
-                },
-            };
-            switch (type) {
-                case "file":
-                    if (file) {
-                        await new Promise((resolve) => {
-                            luckyexcel.transformExcelToLucky(
-                                file,
-                                (export_json) => {
-                                    options.data = [
-                                        ...export_json.sheets.map(
-                                            (element) => ({
-                                                ...element,
-                                                zoomRatio: 0.75,
-                                            })
-                                        ),
-                                    ];
-                                    options.title = export_json.info.name;
-                                    resolve();
-                                }
-                            );
-                        });
-                    }
-                    break;
-                case "json":
-                    if (json) {
-                        options.data = [
-                            {
-                                ...json,
-                                zoomRatio: 0.75,
-                            },
-                        ];
-                        options.title = name;
-                    }
-                    break;
-            }
-
-            window.luckysheet.create(options);
-            let clock = setInterval(() => {
-                if (window.luckysheet) {
-                    window.luckysheet.refresh();
-                    clearInterval(clock);
-                }
-            }, 1000);
-        },
-        async handleChange(response) {
-            this.handleCreate({ file: response.raw, type: "file" });
-        },
-        handleDownload() {
-            exportExcel(
-                window.luckysheet.getAllSheets(),
-                window.luckysheet.getWorkbookName()
-            );
-        },
-        async handleAddAuth({ id }) {
-            const object = {};
-            const { array, charge, type } = this.form;
-            charge.map(({ key, value }) => {
-                if (key && value) {
-                    object[key] = value;
-                }
-            });
-            await this.$http({
-                url: this.id
-                    ? "/market/CMKFileTemplateAuthority/CMKFileTemplateAuthorityUpdate"
-                    : "/market/CMKFileTemplateAuthority/CMKFileTemplateAuthorityAdd",
-                method: "post",
-                headers: {
-                    "Content-Type": "application/json",
-                },
-                data: {
-                    allowEditingColumns: array.join(","),
-                    auth: JSON.stringify(object),
-                    templateId: id,
-                    type,
-                },
-            });
-            this.$message.success("操作成功");
-        },
-        async handleSave() {
-            let edit_url = "";
-            switch (this.attribute) {
-                case "template":
-                    edit_url = "";
-                    break;
-                case "order":
-                    edit_url = "";
-                    break;
-                case "file":
-                    edit_url = "/market/CMKIssued/CMKIssuedSubmit";
-                    break;
-            }
-            const sheet_name = window.luckysheet.getSheet().name;
-            const data = window.luckysheet.getSheet(sheet_name);
-            const workbook_name = window.luckysheet.getWorkbookName();
-            const {
-                data: { body },
-            } = await this.$http({
-                url: this.id
-                    ? edit_url // 编辑
-                    : "/market/CMKFileTemplate/CMKFileTemplateAdd", // 新增
-                method: "post",
-                headers: {
-                    "Content-Type": "application/json",
-                },
-                data: {
-                    id: this.template_id,
-                    templateContent: JSON.stringify(data),
-                    templateName: workbook_name,
-                    issuedId: this.issued_id,
-                },
-            });
-            // 新增时添加权限
-            if (!this.id) {
-                this.handleAddAuth({ id: body });
-            } else {
-                this.$message.success("提交成功");
-            }
-            this.$emit("save");
-        },
-        handleAuth() {
-            this.$refs["form"].validate((valid) => {
-                if (valid) {
-                    if (this.handleForbid()) {
-                        this.$message.error("请选择负责人编辑权限");
-                        return false;
-                    }
-                    this.handleVisible();
-                    if (this.id) {
-                        this.handleAddAuth({ id: this.id });
-                    } else {
-                        this.$message.success("设置成功");
-                    }
-                }
-            });
-        },
-        handleCharge(type) {
-            switch (type) {
-                case "add":
-                    this.form.charge.push({
-                        value: "",
-                    });
-                    break;
-                case "delete":
-                    this.form.charge.pop();
-                    break;
-            }
-        },
-        handleVisible() {
-            this.visible = !this.visible;
-        },
-        handleFullscreen() {
-            const element = document.body;
-            const is_fullscreen =
-                document.fullScreen ||
-                document.mozFullScreen ||
-                document.webkitIsFullScreen;
-            if (!is_fullscreen) {
-                //进入全屏,多重短路表达式
-                (element.requestFullscreen && element.requestFullscreen()) ||
-                    (element.mozRequestFullScreen &&
-                        element.mozRequestFullScreen()) ||
-                    (element.webkitRequestFullscreen &&
-                        element.webkitRequestFullscreen()) ||
-                    (element.msRequestFullscreen &&
-                        element.msRequestFullscreen());
-            } else {
-                //退出全屏,三目运算符
-                document.exitFullscreen
-                    ? document.exitFullscreen()
-                    : document.mozCancelFullScreen
-                    ? document.mozCancelFullScreen()
-                    : document.webkitExitFullscreen
-                    ? document.webkitExitFullscreen()
-                    : "";
-            }
-        },
-        handleChargeList() {
-            this.$http({
-                url: "/market/techcentergj/queryLeaderList",
-                method: "post",
-                headers: {
-                    "Content-Type": "application/json",
-                },
-                data: {},
-            }).then((response) => {
-                this.charge_list = response.data.map((element) => ({
-                    label: `${element.ou} ${element.secLeaderName}`,
-                    value: `${element.secLeaderLogin},${element.secLeaderName}`,
-                }));
-            });
-        },
-    },
-    mounted() {
-        this.handleInit();
-        this.handleChargeList();
-    },
-};
-</script>
-
-<style lang="scss" scope>
-.sheet-container {
-    position: fixed;
-    width: calc(100% - 40px);
-    height: 100%;
-    &-block {
-        overflow: hidden;
-        position: absolute;
-        width: 100%;
-        height: 75%;
-    }
-}
-</style>

+ 0 - 167
src/pages/main/gridDivision/components/table.vue

@@ -1,167 +0,0 @@
-<!--
- * @Author       : yuanrunwei
- * @Date         : 2021-11-01 18:02:58
- * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-01-06 12:02:24
- * @FilePath     : \spfm-market-front\src\pages\main\performance\components\table.vue
--->
-<template>
-  <el-table class="simple-table" :data="computed_list" v-loading="loading" @selection-change="handleSelectionChange">
-    <el-table-column type="selection" width="55" v-if="multiple" />
-    <el-table-column
-      v-for="(
-        { props, label, type, width, align, children, dictionary }, index
-      ) in config"
-      :key="index"
-      :prop="props"
-      :width="width"
-      :label="label"
-      :align="align || 'center'"
-    >
-      <template #default="scope">
-        <div v-if="type === 'edit'">
-          <el-input
-            v-if="scope.row[`edit`]"
-            v-model="scope.row[props]"
-            autosize
-            type="textarea"
-            @change="handleModify"
-          />
-        </div>
-        <div v-else-if="type === 'textarea'">
-          <pre class="simple-table-break">{{ scope.row[props] }}</pre>
-        </div>
-        <div v-else-if="type === 'date'">
-          <div>{{ $formatDate(scope.row[props], "YYYY-MM-DD") }}</div>
-        </div>
-        <div v-else-if="type === 'click'">
-          <div
-            class="simple-table-click cursor-pointer"
-            @click="handleClick(props, scope.row)"
-          >
-            {{ scope.row[props] }}
-          </div>
-        </div>
-        <div v-else-if="type === 'dictionary'">
-          {{ dictionary[scope.row[props]] }}
-        </div>
-        <div v-else>{{ scope.row[props] }}</div>
-      </template>
-      <template v-if="children">
-        <el-table-column
-          v-for="({ props, label, width, align, type }, index) in children"
-          :key="index"
-          :prop="props"
-          :width="width"
-          :label="label"
-          :align="align || 'center'"
-        >
-          <template #default="scope">
-            <div v-if="type === 'edit'">
-              <el-input
-                v-model="scope.row[props]"
-                @change="handleModify"
-                autosize
-                type="textarea"
-              />
-            </div>
-            <div v-else>{{ scope.row[props] }}</div>
-          </template>
-        </el-table-column>
-      </template>
-    </el-table-column>
-    <el-table-column
-      v-if="handleRow.length"
-      label="操作"
-      :width="handleRow.length * 50"
-    >
-      <template slot-scope="scope">
-        <span
-          v-for="({ label, props, popconfirm, visible }, index) in handleRow"
-          :key="index"
-          class="padding-right-5"
-        >
-          <span v-if="handleFormat(visible, scope.row)">
-            <el-popconfirm
-              v-if="popconfirm"
-              :title="`确定要${label}吗?`"
-              @confirm="handleClick(props, scope.row)"
-              @cancel="handleCancel"
-            >
-              <el-button slot="reference" type="text" size="small">{{
-                label
-              }}</el-button>
-            </el-popconfirm>
-            <el-button
-              v-else
-              @click="handleClick(props, scope.row)"
-              type="text"
-              size="small"
-              >{{ label }}</el-button
-            >
-          </span>
-        </span>
-      </template>
-    </el-table-column>
-  </el-table>
-</template>
-<script>
-export default {
-  props: {
-    list: {
-      type: Array,
-      default: () => [],
-    },
-    config: {
-      type: Array,
-      default: () => [],
-    },
-    multiple: {
-      type: Boolean,
-      default: false,
-    },
-    loading: {
-      type: Boolean,
-      default: false,
-    },
-    handleRow: {
-      type: Array,
-      default: () => [],
-    },
-  },
-  computed: {
-    computed_list() {
-      return this.list.map((element) => ({
-        ...element,
-      }));
-    },
-  },
-  methods: {
-    handleFormat(params, data) {
-      let visible = true;
-      if (params) {
-        visible = false;
-        Object.keys(params).forEach((element) => {
-          if (params[element].includes(data[element])) {
-            visible = true;
-          }
-        });
-      }
-      return visible;
-    },
-    handleClick(props, row) {
-      console.log("aaaaaaaaa");
-      this.$emit(props, row);
-    },
-    handleCancel() {
-      console.log("我被关闭了");
-    },
-    handleSelectionChange(val){
-        this.$emit("selection",val)
-    },
-    handleModify() {
-      this.$emit("modify", this.computed_list);
-    },
-  },
-};
-</script>

+ 551 - 151
src/pages/main/gridDivision/workersList.vue

@@ -1,135 +1,239 @@
 <template>
-  <div>
-    <div class="simple-container">
-      <simple-form
-        :form="table_form"
-        :handle="table_handle"
-        @search="handleSearch"
-        @summary="handleVisible('summary')"
-        @add="handleVisible('add')"
+  <div class="simple-container workersList-container">
+    <simple-form
+      :form="table_form"
+      :handle="table_handle"
+      @search="handleSearch"
+      @summary="handleVisible('summary')"
+      @add="handleVisible('add')"
+    >
+    </simple-form>
+    <simple-table
+      :list="table_list"
+      :config="table_config"
+      :loading="table_loading"
+      :multiple="true"
+      :handle-row="table_handle_row"
+      @selection="handleSelect"
+      :selectable="handleSelectFilter"
+      @check="handleCheck"
+      @edit="handleEdit"
+      @approve="handleApprove"
+    ></simple-table>
+    <simple-pagination
+      :page="page"
+      :total="total"
+      @change="handleChange"
+    ></simple-pagination>
+    <simple-dialog
+      :title="title"
+      :fullscreen="true"
+      @cancel="handleVisible('add')"
+      :visible="add_visible"
+    >
+      <el-form
+        label-width="120px"
+        :rules="rules"
+        :model="add_form"
+        ref="add_ref"
       >
-      </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-dialog
-        title="新建"
-        width="40%"
-        @cancel="handleVisible('add')"
-        @confirm="handleAdd"
-        :visible="add_visible"
-      >
-        <el-form
-          label-width="60px"
-          :model="add_form"
-          ref="add_ref"
+        <el-form-item label="提出人" prop="proposer">
+          <el-input
+            :disabled="title === '审批' || title === '查看'"
+            v-model="add_form.proposer"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="联系电话" prop="telephone">
+          <el-input
+            :disabled="title === '审批' || title === '查看'"
+            v-model="add_form.telephone"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="网格划分需求" prop="wanggeText">
+          <el-input
+            type="textarea"
+            :disabled="title === '审批' || title === '查看'"
+            v-model="add_form.wanggeText"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="附件上传" prop="file">
+          <myUpload
+            v-if="title === '新建' || title === '发起人处理'"
+            @uploadBack="uploadBack"
+            :fileInfo="fileInfo"
+            :fileList="fileInfo.fileList"
+          ></myUpload>
+          <div v-else>
+            <div v-if="fileInfo.fileList.length === 0">暂无附件</div>
+            <div
+              v-for="(item, index) in fileInfo.fileList"
+              :key="index"
+              class="simple-table-click cursor-pointer margin-left-10"
+              @click="handleDownload(item)"
+            >
+              {{ item.fileName }}
+            </div>
+          </div>
+        </el-form-item>
+        <el-form-item label="审批轨迹" prop="" v-if="edit_visible">
+          <simple-table
+            :list="table_list_approve"
+            :config="table_config_approve"
+            :loading="table_loading_approve"
+          ></simple-table>
+        </el-form-item>
+        <el-form-item
+          label="审批意见"
+          prop="desc"
+          v-if="edit_visible && approve_visible"
         >
-          <el-form-item
-            label="提出人"
-            prop="reason"
-            :rules="{
-                        required: true,
-                        message: '提出人不能为空',
-                        trigger: 'blur',
-                    }"
-          >
-            <el-input v-model="add_form.reason"></el-input>
-          </el-form-item>
-          <el-form-item
-            label="联系电话"
-            prop="precautions"
-            :rules="{
-                        required: true,
-                        message: '联系电话不能为空',
-                        trigger: 'blur',
-                    }"
+          <el-input type="textarea" v-model="add_form.remark"></el-input>
+        </el-form-item>
+      </el-form>
+      <template v-slot:footer>
+        <div v-if="title === '新建'">
+          <el-button @click="handleSubmit('save')" type="primary"
+            >保存</el-button
           >
-            <el-input v-model="add_form.precautions"></el-input>
-          </el-form-item>
-          <el-form-item
-            label="网格划分需求"
-            prop="endTime"
-            :rules="{
-                        required: true,
-                        message: '网格划分需求不能为空',
-                        trigger: 'blur',
-                    }"
+          <el-button @click="handleSubmit('add')" type="primary"
+            >提交</el-button
           >
-            <el-input
-              type="textarea"
-              v-model="add_form.desc"
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            label="附件上传"
-            prop=""
+          <el-button @click="handleVisible('add')" type="default"
+            >取消</el-button
           >
-            <el-upload
-              class="upload-demo"
-              drag
-              action="https://jsonplaceholder.typicode.com/posts/"
-              multiple
+        </div>
+        <div v-else-if="title === '查看'">
+          <div>
+            <el-button @click="handleVisible('add')" type="primary"
+              >确定</el-button
             >
-              <i class="el-icon-upload"></i>
-              <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
-            </el-upload>
-          </el-form-item>
-          <el-form-item
-            label="审批轨迹"
-            prop=""
+          </div>
+        </div>
+        <div v-else-if="title === '发起人处理'">
+          <el-button @click="handleSubmit('save')" type="primary"
+            >保存</el-button
+          >
+          <el-button @click="handleSubmit('add')" type="primary"
+            >重新提交</el-button
+          >
+          <el-button @click="handleVisible('add')" type="default"
+            >取消</el-button
+          >
+        </div>
+        <div v-else>
+          <el-button @click="handleSubmit('adopt')" type="primary"
+            >保存</el-button
+          >
+          <el-button @click="handleSubmit('failed')" type="default"
+            >退回修改</el-button
           >
-            <simple-table
-              :list="table_list_approve"
-              :config="table_config_approve"
-              :loading="table_loading_approve"
-            ></simple-table>
-          </el-form-item>
-        </el-form>
-      </simple-dialog>
-      <simple-dialog
-        title="工单汇总"
-        width="40%"
-        @cancel="handleVisible('summary')"
-        @confirm="handleAdd"
-        :visible="summary_visible"
-      >
-        <div class="summary">
-          <p>是否要对所选工单进行汇总?</p>
-          <p class="summary-tip">可对未审批的区县网格划分审批工单合并为同一条工单,由相关审批人员进行审批,减少审批工作量</p>
         </div>
-      </simple-dialog>
-    </div>
+      </template>
+    </simple-dialog>
+    <simple-dialog
+      title="工单汇总"
+      width="40%"
+      @cancel="handleVisible('summary')"
+      @confirm="handleSummary"
+      :visible="summary_visible"
+    >
+      <div class="summary">
+        <p>是否要对所选工单进行汇总?</p>
+        <p class="summary-tip">
+          可对未审批的区县网格划分审批工单合并为同一条工单,由相关审批人员进行审批,减少审批工作量
+        </p>
+      </div>
+    </simple-dialog>
   </div>
 </template>
 
 <script>
-import simpleForm from "./components/form.vue";
-import simpleTable from "./components/table.vue";
-import simpleDialog from "./components/dialog.vue";
-// import simplePagination from "./components/pagination.vue";
+import myUpload from "../../../components/upload";
+import simpleForm from "../performance/components/form.vue";
+import simpleTable from "../performance/components/table.vue";
+import simpleDialog from "../performance/components/dialog.vue";
+import simplePagination from "../performance/components/pagination.vue";
 
 export default {
   components: {
     simpleForm,
     simpleDialog,
+    myUpload,
     simpleTable,
-    // simplePagination,
+    simplePagination,
   },
   data() {
+    const chcekPhone = (rule, value, callback) => {
+      const phoneReg = /^1[3|4|5|7|8][0-9]{9}$/;
+      if (!value) {
+        return callback(new Error("联系人为空"));
+      }
+
+      setTimeout(() => {
+        if (!Number.isInteger(+value)) {
+          callback(new Error("请输入数字值"));
+        } else {
+          if (phoneReg.test(value)) {
+            callback();
+          } else {
+            callback(new Error("联系人格式不正确"));
+          }
+        }
+      }, 100);
+    };
     return {
+      rules: {
+        proposer: [
+          {
+            required: true,
+            message: "提出人不能为空",
+            trigger: "blur",
+          },
+        ],
+        telephone: [
+          {
+            required: true,
+            // message: "联系电话不能为空",
+            trigger: "blur",
+            validator: chcekPhone,
+          },
+        ],
+        wanggeText: [
+          {
+            required: true,
+            message: "网格划分需求不能为空",
+            trigger: "blur",
+          },
+        ],
+      },
+      // 当前用户标识
+      loginNoStr: "",
+      fileInfo: {
+        limit: 3,
+        url: "/market/mkWangge/upload",
+        fileList: [],
+      },
+      attList: [],
+      page: 1,
+      rows: 10,
+      total: 0,
+      // 模态框标题
+      title: "",
+      // 是否为查看状态
+      isCheck: false,
+      // 汇总id列表
+      summaryIds: [],
+      table_search: {},
       // 新建模态框
       add_visible: false,
       summary_visible: false,
       edit_visible: false,
+      approve_visible: false,
+      ids: [],
       add_form: {},
       table_handle: [
         {
-          label: "工作汇总",
+          label: "工汇总",
           props: "summary",
         },
         {
@@ -140,12 +244,12 @@ export default {
       table_form: [
         {
           label: "公司名称",
-          props: "name",
+          props: "companyName",
           type: "input",
         },
         {
           label: "状态",
-          props: "status",
+          props: "sts",
           type: "select",
           // 0.待办  1.已办
           dictionary: [
@@ -161,22 +265,7 @@ export default {
         },
       ],
       // 列表数据
-      table_list: [
-        {
-          number: 1,
-          cpmName: "xq",
-          person: "mll",
-          createTime: 1654563154824,
-          status: 0,
-        },
-        {
-          number: 2,
-          cpmName: "xq",
-          person: "mll",
-          createTime: 1654963568455,
-          status: 1,
-        },
-      ],
+      table_list: [],
       table_loading: false,
       //   表格里的操作按钮
       table_handle_row: [
@@ -185,10 +274,17 @@ export default {
           props: "check",
         },
         {
-          label: "处理",
+          label: "编辑",
           props: "edit",
           visible: {
-            status: [0],
+            isEdit: ["1"],
+          },
+        },
+        {
+          label: "处理",
+          props: "approve",
+          visible: {
+            deal: ["1"],
           },
         },
       ],
@@ -196,100 +292,400 @@ export default {
       table_config: [
         {
           label: "序号",
-          props: "number",
+          props: "No",
         },
         {
           label: "公司名称",
-          props: "cpmName",
+          props: "companyName",
         },
         {
           label: "发起人",
-          props: "person",
+          props: "proposer",
         },
         {
           label: "发起时间",
           props: "createTime",
-          type: "date",
         },
         {
           label: "状态",
-          props: "status",
+          props: "sts",
           type: "dictionary",
           dictionary: { 0: "待办", 1: "已办" },
         },
       ],
       // 模态框内表数据
-      table_list_approve:[],
-      table_loading_approve:false,
+      table_list_approve: [],
+      table_loading_approve: false,
       // 模态框内表头配置
-      table_config_approve:[
+      table_config_approve: [
         {
           label: "编号",
-          props: "number",
+          props: "No",
         },
         {
           label: "流程环节",
-          props: "cpmName",
+          props: "taskName",
         },
         {
           label: "处理人",
-          props: "person",
+          props: "opName",
         },
         {
           label: "处理工号",
-          props: "number",
+          props: "opNo",
         },
         {
           label: "处理时间",
-          props: "createTime",
-          type: "date",
+          props: "opTime",
         },
         {
           label: "审批意见",
-          props: "status",
-          type: "dictionary",
-          dictionary: { 0: "同意", 1: "不同意" },
+          props: "remark",
+          // type: "dictionary",
+          // dictionary: { 0: "同意", 1: "不同意" },
         },
-      ]
+      ],
     };
   },
+  mounted() {
+    this.handleInit();
+    this.loginNoStr = JSON.parse(sessionStorage.getItem("userInfo")).loginNoStr;
+  },
   methods: {
+    // 表格数据初始化
+    handleInit() {
+      this.table_loading = true;
+      // console.log(data);
+      let reqdata = {
+        ...this.table_search,
+        type: "1",
+        page: this.page,
+        pageSize: this.rows,
+      };
+      this.$http({
+        url: "/market/mkWangge/queryPage",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: reqdata,
+      }).then(({ data: { count, data } }) => {
+        this.table_loading = false;
+        this.total = count;
+        this.table_list = data
+          ? data.map((element, index) => ({
+              ...element,
+              deal: element.draft === "1" && element.sts === "0" ? "1" : "0",
+              isEdit:
+                element.draft === "0" && element.createId === this.loginNoStr
+                  ? "1"
+                  : "0",
+              No: index + 1,
+            }))
+          : [];
+        console.log(this.table_list);
+      });
+    },
     // 搜索事件
     handleSearch(data) {
       this.table_search = data;
       this.page = 1;
-      this.handleInit({ ...data, page: this.page, pageSize: this.rows });
+      this.handleInit();
     },
     handleVisible(props) {
+      this.approve_visible = false;
       switch (props) {
         case "add":
           this.add_visible = !this.add_visible;
+          this.edit_visible = false;
+          this.approve_visible = false;
+          this.title = "新建";
+          this.isCheck = false;
+          this.add_form = {};
+          this.fileInfo.fileList = [];
           break;
         case "summary":
           this.summary_visible = !this.summary_visible;
+          break;
+
+        case "edit":
+          this.edit_visible = !this.edit_visible;
+          this.add_visible = !this.add_visible;
+          this.title = "发起人处理";
+          this.isCheck = false;
+          break;
+        case "check":
+          this.edit_visible = !this.edit_visible;
+          this.add_visible = !this.add_visible;
+          this.title = "查看";
+          this.isCheck = true;
+          break;
+        case "approve":
+          this.edit_visible = !this.edit_visible;
+          this.add_visible = !this.add_visible;
+          this.title = "审批";
+          this.isCheck = false;
+          this.approve_visible = !this.approve_visible;
+          break;
       }
     },
+    handleSelect(val) {
+      this.summaryIds = val.map((item) => {
+        return item.id.toString();
+      });
+      // console.log(this.summaryIds);
+    },
+    //文件返回值
+    uploadBack(v) {
+      const fileName = [];
+      const fileIds = [];
+      v.forEach((element) => {
+        fileName.push(element.fileName);
+        fileIds.push(element.fileCode);
+      });
+      console.log(v);
+      this.add_form.fileNames = fileName.join(",");
+      this.add_form.fileIds = fileIds.join(",");
+      // console.log(this.add_form,'this.add_form')
+    },
+    // 获取模态框信息
+    getDialogData(row) {
+      let id = row.id;
+      let type = row.parentId === null ? "1" : "0";
+      this.$http({
+        url: "/market/mkWangge/getMkWanggeById",
+        method: "get",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        params: {
+          id,
+          type,
+        },
+      }).then(({ data: { body } }) => {
+        console.log(body, "body");
+        this.ids = [body.id.toString()];
+        this.add_form = {
+          id: body.id,
+          proposer: body.proposer,
+          telephone: body.telephone,
+          wanggeText: body.wanggeText,
+          fileNames: body.fileNames,
+          fileIds: body.fileIds,
+        };
+        this.table_list_approve = body.bpmTaskList
+          ? body.bpmTaskList.map((item, index) => ({
+              ...item,
+              No: index + 1,
+            }))
+          : [];
+        this.fileInfo.fileList = body.fileNames
+          ? body.fileNames.split(",").map((el, index) => ({
+              fileName: el,
+              name: el,
+              fileCode: body.fileIds.split(",")[index],
+            }))
+          : [];
+      });
+    },
     // 查看按钮
     handleCheck(row) {
-      console.log(row, "row");
-      // this.visible = true;
-      // this.edit_visible = false;
-      // this.edit_form = row;
+      if (row.parentLevel === "1") {
+        this.$router.push({
+          path: "/approvalExamination",
+          query: {
+            parentId: row.id.toString(),
+            status: row.sts.toString(),
+          },
+        });
+      } else {
+        this.getDialogData(row);
+        this.handleVisible("check");
+      }
     },
     // 编辑按钮
-    handleEdit() {},
-    handleAdd() {},
+    handleEdit(row) {
+      this.getDialogData(row);
+      this.handleVisible("edit");
+    },
+    // 处理按钮
+    handleApprove(row) {
+      if (row.parentLevel === "1") {
+        this.$router.push({
+          path: "/approvalExamination",
+          query: {
+            parentId: row.id.toString(),
+            status: row.sts.toString(),
+          },
+        });
+      } else {
+        this.getDialogData(row);
+        this.handleVisible("approve");
+      }
+    },
+    handleSubmit(type) {
+      // console.log(this.add_form);
+      // let _this = this;
+      let draft = "";
+      if (type === "add") {
+        draft = "1";
+      } else if (type === "save") {
+        draft = "0";
+      }
+      let isAdopt = "";
+      if (type === "adopt") {
+        isAdopt = "0";
+      } else if (type === "failed") {
+        isAdopt = "1";
+      }
+      this.$refs.add_ref.validate((valid) => {
+        if (valid) {
+          let reqdata = [
+            {
+              ...this.add_form,
+              procId: "729294602773110788",
+              draft: draft,
+              num: "1",
+            },
+          ];
+          if (!this.approve_visible) {
+            // 编辑/新增
+            this.$http({
+              url: "/market/mkWangge/saveOrUpdateList",
+              method: "post",
+              headers: {
+                "Content-Type": "application/json",
+              },
+              data: reqdata,
+            }).then((res) => {
+              console.log(res);
+              this.handleInit();
+            });
+          } else {
+            // 审批
+            let reqdata = {
+              ids: this.ids,
+              remark: this.add_form.remark,
+              type: isAdopt,
+            };
+            console.log(reqdata, "reqdata");
+            this.$http({
+              url: "/market/mkWangge/review",
+              method: "post",
+              headers: {
+                "Content-Type": "application/json",
+              },
+              data: {
+                ...reqdata,
+              },
+            }).then((res) => {
+              console.log(res);
+              this.handleInit();
+            });
+          }
+          this.edit_visible = false;
+          this.add_visible = false;
+          this.fileInfo.fileList = [];
+        }
+      });
+    },
+    handleSummary() {
+      if (this.summaryIds.length === 0) {
+        this.$message({
+          message: "还未选择要合并的项目",
+          type: "error",
+        });
+        this.handleVisible("summary");
+        return;
+      } else {
+        this.$http({
+          url: "/market/mkWangge/huizongWangge",
+          method: "post",
+          headers: {
+            "Content-Type": "application/json",
+          },
+          data: this.summaryIds,
+        }).then((res) => {
+          console.log(res);
+          if (res.data.result === 1) {
+            this.$message({
+              message: res.data.desc,
+              type: "error",
+            });
+          } else {
+            this.$message({
+              message: res.data.desc,
+              type: "success",
+            });
+          }
+          this.handleInit();
+        });
+        this.handleVisible("summary");
+      }
+    },
+    handleChange(page) {
+      this.page = page;
+      this.handleInit();
+    },
+    handleSelectFilter(row) {
+      // 过滤可被选中的数组
+      if (row.parentLevel === "1") {
+        return false;
+      } else {
+        return true;
+      }
+    },
+    // 附件下载
+    handleDownload({fileCode,fileName}) {
+      console.log(fileCode,fileName);
+      this.$http({
+        url: "/market/compatt/downfile",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        responseType: "blob",
+        data: { id: fileCode, fileName: fileName },
+      }).then((response) => {
+        if (window.navigator && window.navigator.msSaveOrOpenBlob) {
+          let blob = new Blob([response.data], {
+            type: "application/vnd.ms-excel",
+          });
+          window.navigator.msSaveOrOpenBlob(blob, fileName);
+        } else {
+          /* 火狐谷歌的文件下载方式 */
+          var blob = new Blob([response.data]);
+          var downloadElement = document.createElement("a");
+          var href = window.URL.createObjectURL(blob);
+          downloadElement.href = href;
+          downloadElement.download = fileName;
+          document.body.appendChild(downloadElement);
+          downloadElement.click();
+          document.body.removeChild(downloadElement);
+          window.URL.revokeObjectURL(href);
+        }
+      });
+      // // /market/compatt/downfile
+      // console.log(item);
+    },
   },
 };
 </script>
 
 <style lang="scss" scoped>
+.workersList-container {
+  background: #ffffff;
+  padding: 0 20px;
+  margin: 15px;
+  overflow: auto;
+  width: calc(100% - 30px);
+  max-width: calc(100% - 30px);
+  height: 100%;
+  overflow-x: hidden;
+}
 .simple-container .el-form-item {
   padding-bottom: 22px;
 }
-/deep/ .el-upload-dragger {
-  width: 608px;
-}
 .summary {
   padding: 20px 50px 100px;
   font-size: 16px;
@@ -298,4 +694,8 @@ export default {
     padding-top: 30px;
   }
 }
+::v-deep .el-row {
+  padding-top: 12px;
+  padding-bottom: 12px;
+}
 </style>

+ 75 - 79
src/pages/main/performance/components/form.vue

@@ -1,94 +1,90 @@
 <!--
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:03:02
- * @LastEditors  : yuanrunwei
- * @LastEditTime : 2021-12-04 17:53:54
+ * @LastEditors: Please set LastEditors
+ * @LastEditTime: 2022-01-10 19:27:43
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\form.vue
 -->
 <template>
-    <el-form :inline="true" :model="object">
-        <el-row :gutter="24">
-            <el-col
-                v-for="({ props, label, type, dictionary }, index) in form"
+  <el-form :inline="true" :model="object">
+    <el-row :gutter="24">
+      <el-col
+        v-for="({ props, label, type, dictionary }, index) in form"
+        :key="index"
+        :span="6"
+      >
+        <el-form-item :label="label">
+          <template v-if="type === 'select'">
+            <el-select
+              v-model="object[props]"
+              :placeholder="label"
+              filterable
+              clearable
+            >
+              <el-option
+                :label="label"
+                :value="value"
+                v-for="({ label, value }, index) in dictionary"
                 :key="index"
-                :span="6"
+              ></el-option>
+            </el-select>
+          </template>
+          <template v-else-if="['datetime', 'date', 'month'].includes(type)">
+            <el-date-picker
+              v-model="object[props]"
+              :type="type"
+              :placeholder="label"
             >
-                <el-form-item :label="label">
-                    <template v-if="type === 'select'">
-                        <el-select
-                            v-model="object[props]"
-                            :placeholder="label"
-                            filterable
-                            clearable
-                        >
-                            <el-option
-                                :label="label"
-                                :value="value"
-                                v-for="({ label, value }, index) in dictionary"
-                                :key="index"
-                            ></el-option>
-                        </el-select>
-                    </template>
-                    <template v-else-if="['date', 'month'].includes(type)">
-                        <el-date-picker
-                            v-model="object[props]"
-                            :type="type"
-                            :placeholder="label"
-                        >
-                        </el-date-picker>
-                    </template>
-                    <template v-else>
-                        <el-input
-                            v-model="object[props]"
-                            :placeholder="label"
-                            clearable
-                        ></el-input>
-                    </template>
-                </el-form-item>
-            </el-col>
-            <el-col :span="6">
-                <el-form-item>
-                    <el-button type="primary" @click="handleSearch"
-                        >搜索</el-button
-                    >
-                </el-form-item>
-            </el-col>
-            <el-col class="flex-justify-align-end" :span="24">
-                <el-button
-                    v-for="({ label, props }, index) in handle"
-                    :key="index"
-                    @click="handleSubmit(props)"
-                >
-                    <i class="el-icon-document-add font-weight-bold" />{{
-                        label
-                    }}
-                </el-button>
-            </el-col>
-        </el-row>
-    </el-form>
+            </el-date-picker>
+          </template>
+          <template v-else>
+            <el-input
+              v-model="object[props]"
+              :placeholder="label"
+              clearable
+            ></el-input>
+          </template>
+        </el-form-item>
+      </el-col>
+      <el-col :span="6">
+        <el-form-item>
+          <el-button type="primary" @click="handleSearch">搜索</el-button>
+        </el-form-item>
+      </el-col>
+      <el-col class="flex-justify-align-end" :span="24">
+        <el-button
+          v-for="({ label, props, unlogo }, index) in handle"
+          :key="index"
+          @click="handleSubmit(props)"
+        >
+          <i v-if="!unlogo" class="el-icon-document-add font-weight-bold" />{{ label }}
+        </el-button>
+      </el-col>
+    </el-row>
+  </el-form>
 </template>
 <script>
 export default {
-    props: {
-        form: {
-            type: Array,
-            default: () => [],
-        },
-        handle: {
-            type: Array,
-            default: () => [],
-        },
+  props: {
+    form: {
+      type: Array,
+      default: () => [],
+    },
+    handle: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data: () => ({
+    object: {},
+  }),
+  methods: {
+    handleSearch() {
+      this.$emit("search", this.object);
     },
-    data: () => ({
-        object: {},
-    }),
-    methods: {
-        handleSearch() {
-            this.$emit("search", this.object);
-        },
-        handleSubmit(params) {
-            this.$emit(params, this.object);
-        },
+    handleSubmit(params) {
+      this.$emit(params, this.object);
     },
+  },
 };
 </script>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 639 - 404
src/pages/main/performance/components/sheet.vue


+ 188 - 149
src/pages/main/performance/components/table.vue

@@ -2,166 +2,205 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:02:58
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2021-12-22 19:55:28
- * @FilePath     : \spfm-market-front\src\pages\main\performance\components\table.vue
+ * @LastEditTime: 2022-01-14 11:31:39
+ * @FilePath     : /spfm-market-front/src/pages/main/performance/components/table.vue
 -->
 <template>
-    <el-table class="simple-table" :data="computed_list" v-loading="loading">
+  <el-table
+    class="simple-table"
+    :data="computed_list"
+    v-loading="loading"
+    @selection-change="handleSelectionChange"
+  >
+    <el-table-column
+      type="selection"
+      width="55"
+      :selectable="selectable"
+      v-if="multiple"
+    />
+    <el-table-column
+      v-for="(
+        { props, label, type, width, align, children, dictionary, variable },
+        index
+      ) in config"
+      :key="index"
+      :prop="props"
+      :width="width"
+      :label="label"
+      :align="align || 'center'"
+    >
+      <template #default="scope">
+        <div v-if="type === 'edit'">
+          <el-input
+            v-if="scope.row[`edit`]"
+            v-model="scope.row[props]"
+            autosize
+            type="textarea"
+            @change="handleModify"
+          />
+        </div>
+        <div v-if="type === 'number'">{{ scope.$index + 1 }}</div>
+        <div v-else-if="type === 'textarea'">
+          <pre class="simple-table-break">{{ scope.row[props] }}</pre>
+        </div>
+        <div v-else-if="type === 'date'">
+          <div>{{ $formatDate(scope.row[props], "YYYY-MM-DD") }}</div>
+        </div>
+        <div v-else-if="type === 'time'">
+          <div>
+            {{ $formatDate(scope.row[props], "YYYY-MM-DD HH:00:00") }}
+          </div>
+        </div>
+        <div v-else-if="type === 'click'">
+          <div
+            class="simple-table-click cursor-pointer flex"
+            @click="handleClick(props, scope.row)"
+          >
+            {{ scope.row[props] }}
+          </div>
+        </div>
+        <div v-else-if="type === 'dictionary'">
+          {{ dictionary[scope.row[props]] }}
+        </div>
+        <div v-else-if="type === 'file'">
+          <div v-if="scope.row[props] && scope.row[props].length" class="flex-justify-center">
+            <span
+              v-for="(item, index) in scope.row[props].split(',')"
+              :key="index"
+              @click="downloadFile({index,rows:scope.row})"
+               class="simple-table-click cursor-pointer margin-left-10"
+            >
+              {{ item }}
+            </span>
+          </div>
+          <div v-else>{{ scope.row[props] }}</div>
+        </div>
+        <div v-else>{{ scope.row[props] }}</div>
+      </template>
+      <template v-if="children">
         <el-table-column
-            v-for="(
-                { props, label, type, width, align, children, dictionary },
-                index
-            ) in config"
-            :key="index"
-            :prop="props"
-            :width="width"
-            :label="label"
-            :align="align || 'center'"
+          v-for="({ props, label, width, align, type }, index) in children"
+          :key="index"
+          :prop="props"
+          :width="width"
+          :label="label"
+          :align="align || 'center'"
         >
-            <template #default="scope">
-                <div v-if="type === 'edit'">
-                    <el-input
-                        v-if="scope.row[`edit`]"
-                        v-model="scope.row[props]"
-                        autosize
-                        type="textarea"
-                        @change="handleModify"
-                    />
-                </div>
-                <div v-else-if="type === 'textarea'">
-                    <pre class="simple-table-break">{{ scope.row[props] }}</pre>
-                </div>
-                <div v-else-if="type === 'date'">
-                    <div>{{ $formatDate(scope.row[props], "YYYY-MM-DD") }}</div>
-                </div>
-                <div v-else-if="type === 'click'">
-                    <div
-                        class="simple-table-click cursor-pointer"
-                        @click="handleClick(props, scope.row)"
-                    >
-                        {{ scope.row[props] }}
-                    </div>
-                </div>
-                <div v-else-if="type === 'dictionary'">
-                    {{ dictionary[scope.row[props]] }}
-                </div>
-                <div v-else>{{ scope.row[props] }}</div>
-            </template>
-            <template v-if="children">
-                <el-table-column
-                    v-for="(
-                        { props, label, width, align, type }, index
-                    ) in children"
-                    :key="index"
-                    :prop="props"
-                    :width="width"
-                    :label="label"
-                    :align="align || 'center'"
-                >
-                    <template #default="scope">
-                        <div v-if="type === 'edit'">
-                            <el-input
-                                v-model="scope.row[props]"
-                                @change="handleModify"
-                                autosize
-                                type="textarea"
-                            />
-                        </div>
-                        <div v-else>{{ scope.row[props] }}</div>
-                    </template>
-                </el-table-column>
-            </template>
+          <template #default="scope">
+            <div v-if="type === 'edit'">
+              <el-input
+                v-model="scope.row[props]"
+                @change="handleModify"
+                autosize
+                type="textarea"
+              />
+            </div>
+            <div v-else>{{ scope.row[props] }}</div>
+          </template>
+          <template v-if="variable">
+            <div>{{ scope.row[props] }}</div>
+          </template>
         </el-table-column>
-        <el-table-column
-            v-if="handleRow.length"
-            label="操作"
-            :width="handleRow.length * 50"
+      </template>
+    </el-table-column>
+    <el-table-column
+      v-if="handleRow.length"
+      label="操作"
+      :align="'center'"
+      :width="handleRow.length * 50"
+    >
+      <template slot-scope="scope">
+        <span
+          v-for="({ label, props, popconfirm, visible }, index) in handleRow"
+          :key="index"
+          class="padding-right-5"
         >
-            <template slot-scope="scope">
-                <span
-                    v-for="(
-                        { label, props, popconfirm, visible }, index
-                    ) in handleRow"
-                    :key="index"
-                    class="padding-right-5"
-                >
-                    <span v-if="handleFormat(visible, scope.row)">
-                        <el-popconfirm
-                            v-if="popconfirm"
-                            :title="`确定要${label}吗?`"
-                            @confirm="handleClick(props,scope.row)"
-                            @cancel="handleCancel"
-                        >
-                            <el-button
-                                slot="reference"
-                                type="text"
-                                size="small"
-                                >{{ label }}</el-button
-                            >
-                        </el-popconfirm>
-                        <el-button
-                            v-else
-                            @click="handleClick(props, scope.row)"
-                            type="text"
-                            size="small"
-                            >{{ label }}</el-button
-                        >
-                    </span>
-                </span>
-            </template>
-        </el-table-column>
-    </el-table>
+          <span v-if="handleFormat(visible, scope.row)">
+            <el-popconfirm
+              v-if="popconfirm"
+              :title="`确定要${label}吗?`"
+              @onConfirm="handleClick(props, scope.row)"
+              @cancel="handleCancel"
+            >
+              <el-button slot="reference" type="text" size="small">{{
+                label
+              }}</el-button>
+            </el-popconfirm>
+            <el-button
+              v-else
+              @click="handleClick(props, scope.row)"
+              type="text"
+              size="small"
+              >{{ label }}</el-button
+            >
+          </span>
+        </span>
+      </template>
+    </el-table-column>
+  </el-table>
 </template>
 <script>
 export default {
-    props: {
-        list: {
-            type: Array,
-            default: () => [],
-        },
-        config: {
-            type: Array,
-            default: () => [],
-        },
-        loading: {
-            type: Boolean,
-            default: false,
-        },
-        handleRow: {
-            type: Array,
-            default: () => [],
-        },
+  props: {
+    list: {
+      type: Array,
+      default: () => [],
+    },
+    config: {
+      type: Array,
+      default: () => [],
+    },
+    multiple: {
+      type: Boolean,
+      default: false,
+    },
+    selectable: {
+      type: Function,
+    },
+    loading: {
+      type: Boolean,
+      default: false,
+    },
+    handleRow: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  computed: {
+    computed_list() {
+      return this.list.map((element) => ({
+        ...element,
+      }));
+    },
+  },
+  methods: {
+    handleFormat(params, data) {
+      let visible = true;
+      if (params) {
+        visible = false;
+        Object.keys(params).forEach((element) => {
+          if (params[element].includes(data[element])) {
+            visible = true;
+          }
+        });
+      }
+      return visible;
+    },
+    handleClick(props, row) {
+      this.$emit(props, row);
+    },
+    handleCancel() {
+      console.log("我被关闭了");
+    },
+    handleSelectionChange(val) {
+      this.$emit("selection", val);
     },
-    computed: {
-        computed_list() {
-            return this.list.map((element) => ({
-                ...element,
-            }));
-        },
+    downloadFile(val) {
+      this.$emit("download", val);
     },
-    methods: {
-        handleFormat(params, data) {
-            let visible = true;
-            if (params) {
-                visible = false;
-                Object.keys(params).forEach((element) => {
-                    if (params[element].includes(data[element])) {
-                        visible = true;
-                    }
-                });
-            }
-            return visible;
-        },
-        handleClick(props, row) {
-            console.log('aaaaaaaaa')
-            this.$emit(props, row);
-        },
-        handleCancel(){
-            console.log('我被关闭了')
-        },
-        handleModify() {
-            this.$emit("modify", this.computed_list);
-        },
+    handleModify() {
+      this.$emit("modify", this.computed_list);
     },
+  },
 };
 </script>

+ 424 - 134
src/pages/main/performance/department.vue

@@ -14,6 +14,8 @@
         :handle-row="table_handle_row"
         @check="handleCheck"
         @edit="handleEdit"
+        @delete="handleDelete"
+        @receiverName="handleReceiver"
       ></simple-table>
       <simple-pagination
         :page="page"
@@ -77,7 +79,10 @@
           v-if="visible"
           :id="edit_form.id"
           :type="
-            edit_visible && edit_form.status === '1' && duty === '9'
+            edit_visible &&
+            (((edit_form.status === '1' || edit_form.status === '2') &&
+              duty === '9') ||
+              edit_form.status === '0')
               ? 'edit'
               : 'view'
           "
@@ -95,6 +100,7 @@
       :visible="approve_visible"
       :reload="reload"
       width="500px"
+      class="approve"
       @cancel="handleCancel('approve_visible')"
     >
       <el-form :model="approveForm" ref="approveForm"
@@ -111,9 +117,13 @@
             <el-button @click="handleTurn('transfer')" type="primary"
               >转副总审批</el-button
             >
+            <el-button @click="handleTurn('transfermanger')" type="primary"
+              >转总经理审批</el-button
+            >
           </div>
           <div v-else-if="type === '2'">
             <el-button @click="handleTurn('finish')">结束</el-button>
+            <el-button @click="handleTurn('return')">退回</el-button>
             <el-button @click="handleTurn('back')">打回</el-button>
             <el-button @click="handleTurn('transfer')" type="primary"
               >转总经理审批</el-button
@@ -121,6 +131,7 @@
           </div>
           <div v-else>
             <el-button @click="handleTurn('back')">打回</el-button>
+            <el-button @click="handleTurn('return')">退回</el-button>
             <el-button @click="handleTurn('agree')" type="primary"
               >同意</el-button
             >
@@ -132,7 +143,7 @@
       title="转派"
       :visible="transfer_visible"
       :reload="reload"
-      width="500px"
+      width="1000px"
       @confirm="transferConfirm"
       @cancel="handleCancel('transfer_visible')"
     >
@@ -140,39 +151,96 @@
         :model="transfer_form"
         :rules="transfer_rules"
         ref="transfer_form"
+        label-width="80px"
       >
-        <el-form-item label="转派人员" prop="personnel">
-          <el-select
-            filterable
-            v-model="transfer_form.personnel"
-            placeholder="请选择转派人员"
-          >
-            <el-option
-              v-for="(item, index) in transfer_list"
-              :key="index"
-              :label="item.label"
-              :value="item.loginNoStr"
+        <el-form-item
+          label="转派人员"
+          v-for="(item, index) in transfer_form.charge"
+          :key="index"
+          :rules="{
+            required: true,
+            message: '负责人不能为空',
+            trigger: 'blur',
+          }"
+        >
+          <div class="flex">
+            <el-select
+              class="margin-bottom-20 margin-right-10"
+              placeholder="请选择负责人"
+              v-model="item.person"
+              @change="personChange"
+              filterable
             >
-            </el-option>
-          </el-select>
+              <el-option
+                v-for="({ label, value }, index) in transfer_list_orgin"
+                :key="index"
+                :label="label"
+                :value="value"
+              ></el-option>
+            </el-select>
+            <div v-if="permission_type === 2">
+              <span class="form-content">可编辑行:</span>
+              <el-select
+                class="margin-bottom-20 margin-right-10"
+                placeholder="请选择可编辑行"
+                multiple
+                v-model="item.allowEditingColumns"
+                @change="colsChange"
+              >
+                <el-option
+                  v-for="(item, index) in transfer_cols_orgin"
+                  :key="index"
+                  :label="item"
+                  :value="item"
+                ></el-option>
+              </el-select>
+            </div>
+            <div v-if="permission_type === 2">
+              <span class="form-content">可编辑列:</span>
+              <el-select
+                class="margin-bottom-20 margin-right-10"
+                placeholder="请选择可编辑列"
+                multiple
+                v-model="item.rowNum"
+                @change="rowsChange"
+              >
+                <el-option
+                  v-for="(item, index) in transfer_rows_orgin"
+                  :key="index"
+                  :label="item"
+                  :value="item"
+                ></el-option>
+              </el-select>
+            </div>
+          </div>
         </el-form-item>
-        <el-form-item label="可编辑行" prop="rows">
-          <el-select
-            v-model="transfer_form.rows"
-            placeholder="可编辑行"
-            multiple
+        <div>
+          <el-button
+            class="margin-right-10"
+            @click.prevent="handleCharge('add')"
+            type="primary"
+            >添加</el-button
           >
-            <el-option
-              v-for="(item, index) in transfer_rows"
-              :key="index"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
+          <el-button
+            v-if="transfer_form.charge.length - 1"
+            @click.prevent="handleCharge('delete')"
+            >删除</el-button
+          >
+        </div>
       </el-form>
     </simple-dialog>
+    <simple-dialog
+      title="回复详情"
+      width="1000px"
+      @cancel="handleCancel('principal_visible')"
+      @confirm="handleCancel('principal_visible')"
+      :visible="principal_visible"
+    >
+      <simple-table
+        :list="receiver_table_list"
+        :config="receiver_table_config"
+      ></simple-table>
+    </simple-dialog>
     <!-- <simple-dialog
       title="流程跟踪"
       :visible="track_visible"
@@ -226,6 +294,8 @@ export default {
       total: 0,
       reviewType: "",
       isCheck: false,
+      // 判断是否为2---特殊权限或者为1---公共权限
+      permission_type: 2,
       // 职位判断转派用
       duty: "",
       //   搜索参数
@@ -234,14 +304,46 @@ export default {
       transfer_visible: false,
       visible: false,
       edit_visible: false,
+      // 审批
       approve_visible: false,
+      // 转派
       track_visible: false,
+      // 回复详情
+      principal_visible: false,
       edit_form: {},
+      // 回复详情
+      receiver_table_list: [],
+      receiver_table_config: [
+        {
+          label: "接收人",
+          props: "receiveName",
+        },
+        {
+          label: "科室",
+          props: "dept",
+        },
+        {
+          label: "回复时间",
+          props: "createTime",
+        },
+        {
+          label: "审批记录",
+          props: "result",
+          type: "textarea",
+        },
+        {
+          label: "审批意见",
+          props: "opinion",
+          type: "textarea",
+        },
+      ],
+      transfer_list_orgin: [],
+      transfer_cols_orgin: [],
+      transfer_rows_orgin: [],
       transfer_list: [],
-      transfer_rows: [],
       transfer_form: {
-        personnel: "", // 转派人员
-        rows: [],
+        // personnel: "", // 转派人员
+        charge: [{ person: "", allowEditingColumns: [], rowNum: [] }],
       },
       reload: 0,
       // 判断类型
@@ -264,13 +366,20 @@ export default {
             trigger: "change",
           },
         ],
-        rows: [
+        col_start: [
           {
             required: true,
             message: "请选择行",
             trigger: "change",
           },
         ],
+        row_start: [
+          {
+            required: true,
+            message: "请选择列",
+            trigger: "change",
+          },
+        ],
       },
       // 审批意见
       approveForm: { comments: "" },
@@ -283,9 +392,9 @@ export default {
           type: "input",
         },
         {
-          label: "下发月份",
+          label: "截止时间",
           props: "issuedDate",
-          type: "month",
+          type: "datetime",
         },
         {
           label: "状态",
@@ -315,7 +424,7 @@ export default {
       //   列表数据
       table_list: [],
       table_loading: false,
-      //   表格里的操作按钮
+      //   表格里的操作按钮delete
       table_handle_row: [
         {
           label: "查看",
@@ -325,13 +434,25 @@ export default {
           label: "处理",
           props: "edit",
           visible: {
-            status: ["0", "1", "2"],
+            processFlag: ["0"],
+          },
+        },
+        {
+          label: "撤回",
+          props: "delete",
+          popconfirm: true,
+          visible: {
+            withdrawFlag: ["0"],
           },
         },
       ],
       //  表头配置
       table_config: [
         {
+          label: "序号",
+          type: "number",
+        },
+        {
           label: "模板名称",
           props: "templateName",
         },
@@ -346,13 +467,18 @@ export default {
         {
           label: "截止时间",
           props: "endTime",
-          type: "date",
+          // type: "time",
         },
         {
           label: "发起人",
           props: "loginNameStr",
         },
         {
+          label: "接受人",
+          props: "receiverName",
+          type: "click",
+        },
+        {
           label: "状态",
           props: "status",
           type: "dictionary",
@@ -361,6 +487,13 @@ export default {
       ],
     };
   },
+  watch:{
+    duty(){
+      if(this.duty==='9'){
+        this.table_config = this.table_config.filter(el=>el.props!=='receiverName')
+      }
+    }
+  },
   mounted() {
     this.handleInit({
       ...this.table_search,
@@ -389,7 +522,7 @@ export default {
   methods: {
     //   初始化
     handleInit(data) {
-      this.table_loading = true
+      this.table_loading = true;
       this.$http({
         url: "/market/CMKIssued/CMKIssuedListByUser",
         method: "post",
@@ -398,47 +531,9 @@ export default {
         },
         data: data,
       }).then(({ data: { count, data } }) => {
-        this.table_loading = false
+        this.table_loading = false;
         this.total = count;
         this.table_list = data || [];
-        // this.table_list = [
-        //   {
-        //     id: 10,
-        //     templateName: "模板名称",
-        //     loginNameStr: "发起人",
-        //     status: "0",
-        //     reason: "填报事由",
-        //     precautions: "填报注意事项",
-        //     endTime: new Date(),
-        //   },
-        //   {
-        //     id: 11,
-        //     templateName: "模板名称",
-        //     loginNameStr: "发起人",
-        //     status: "1",
-        //     reason: "填报事由",
-        //     precautions: "填报注意事项",
-        //     endTime: new Date(),
-        //   },
-        //   {
-        //     id: 12,
-        //     templateName: "模板名称",
-        //     loginNameStr: "发起人",
-        //     status: "2",
-        //     reason: "填报事由",
-        //     precautions: "填报注意事项",
-        //     endTime: new Date(),
-        //   },
-        //   {
-        //     id: 13,
-        //     templateName: "模板名称",
-        //     loginNameStr: "发起人",
-        //     status: "3",
-        //     reason: "填报事由",
-        //     precautions: "填报注意事项",
-        //     endTime: new Date(),
-        //   },
-        // ];
       });
     },
     handleChange(page) {
@@ -451,9 +546,18 @@ export default {
     },
     // 搜索事件
     handleSearch(data) {
-      this.table_search = data;
+      this.table_search = {
+        ...data,
+        issuedDate: data.issuedDate
+          ? this.$formatDate(data.issuedDate, "YYYY-MM-DD HH:00:00")
+          : data.issuedDate,
+      };
       this.page = 1;
-      this.handleInit({ ...data, page: this.page, pageSize: this.rows });
+      this.handleInit({
+        ...this.table_search,
+        page: this.page,
+        pageSize: this.rows,
+      });
     },
     // 编辑按钮
     handleEdit(row) {
@@ -469,8 +573,9 @@ export default {
           "Content-Type": "application/json",
         },
         data: { id: this.edit_form.id },
-      }).then(({ data: { reviewType } }) => {
+      }).then(({ data: { reviewType, list } }) => {
         // 判断审批按钮是否还存在
+        this.permission_type = Number(list[0].type);
         console.log(reviewType, "res");
         this.reviewType = reviewType;
         switch (reviewType) {
@@ -499,7 +604,27 @@ export default {
       this.edit_visible = false;
       this.edit_form = row;
     },
-    handleDelete() {},
+    // 原下发管理的撤回
+    handleDelete({ id }) {
+      console.log(id, "id");
+      this.$http({
+        url: "/market/CMKIssued/CMKDelIssuedById",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: {
+          id,
+        },
+      }).then(() => {
+        this.$message.success("撤回成功");
+        this.handleInit({
+          ...this.table_search,
+          page: this.page,
+          pageSize: this.rows,
+        });
+      });
+    },
     // dialog事件
     //权限管理事件
     handleApprove() {
@@ -508,48 +633,116 @@ export default {
     handleTrack() {
       this.track_visible = true;
     },
+    // 转派的增加或删除
+    handleCharge(type) {
+      switch (type) {
+        case "add":
+          this.transfer_form.charge.push({
+            person: "",
+            allowEditingColumns: [],
+            rowNum: [],
+          });
+          break;
+        case "delete":
+          this.transfer_form.charge.pop();
+          break;
+      }
+    },
+    // 三个change事件控制行列人员变动
+    personChange(val) {
+      console.log(val, this.transfer_list);
+      this.transfer_list = this.transfer_list.filter((el) => el.value !== val);
+      console.log(this.transfer_list, "this.transfer_list");
+    },
+    rowsChange(val) {
+      console.log(val, "rowsChange");
+    },
+    colsChange(val) {
+      console.log(val, "colsChange");
+    },
+    handleForbid() {
+      const permission_type = this.permission_type;
+      const { charge } = this.transfer_form;
+      let flag = 1;
+      console.log(permission_type, "permission_type");
+      if (permission_type === 1) {
+        // 公共权限 暂时不用可编辑行和列
+        charge.forEach((el) => {
+          if (el.person) {
+            flag = flag * 1;
+          } else {
+            flag = flag * 0;
+          }
+        });
+      } else if (permission_type === 2) {
+        // 特殊权限
+        console.log(permission_type, "permission_type");
+        charge.forEach((el) => {
+          if (el.person && el.allowEditingColumns.length && el.rowNum.length) {
+            flag = flag * 1;
+          } else {
+            flag = flag * 0;
+          }
+        });
+      }
+      return flag;
+    },
     // 转派的同意事件
-    transferConfirm() {
+    async transferConfirm() {
       this.$refs["transfer_form"].validate((valid) => {
         if (valid) {
-          let obj = {};
-          this.transfer_form.rows.forEach((el) => {
-            obj = {
-              ...obj,
-              [el]: this.transfer_form.personnel,
+          if (this.handleForbid()) {
+            const { charge } = this.transfer_form;
+            let params = {
+              issuedId: this.edit_form.id,
             };
-          });
-          let reqdata = {
-            forward: JSON.stringify(obj),
-            issuedId: this.edit_form.id,
-          };
-          this.$http({
-            url: "/market/CMKIssued/CMKIssuedTransfer",
-            method: "post",
-            headers: {
-              "Content-Type": "application/json",
-            },
-            data: reqdata,
-          }).then(({ data: { desc } }) => {
-            if (desc === "转派成功") {
-              this.$message({
-                type: "success",
-                message: desc,
-              });
-              this.transfer_visible = false;
-              this.handleInit({
-                ...this.table_search,
-                page: this.page,
-                pageSize: this.rows,
-              });
-              this.handleCancel("visible");
+            if (this.permission_type === 1) {
+              params.transferCommonAuthority = charge
+                .map((el) => {
+                  el = el.person.split(",")[0];
+                  return el;
+                })
+                .join(",");
+            } else if (this.permission_type === 2) {
+              params.transferAuthority = charge.map((el) =>
+                JSON.stringify({
+                  allowEditingColumns: el.allowEditingColumns.join(","),
+                  rowNum: el.rowNum.join(","),
+                  principalId: el.person.split(",")[0],
+                  principalName: el.person.split(",")[1],
+                })
+              );
             }
-          });
+            this.$http({
+              url: "/market/CMKIssued/CMKIssuedTransfer",
+              method: "post",
+              headers: {
+                "Content-Type": "application/json",
+              },
+              data: params,
+            }).then(({ data: { desc } }) => {
+              if (desc === "转派成功") {
+                this.$message({
+                  type: "success",
+                  message: desc,
+                });
+                this.transfer_visible = false;
+                this.handleInit({
+                  ...this.table_search,
+                  page: this.page,
+                  pageSize: this.rows,
+                });
+                this.handleCancel("visible");
+              }
+            });
+            console.log(params, "this.transfer_form");
+          } else {
+            this.$message.error("请填写必要的信息");
+          }
         }
       });
     },
     async handleTransfer() {
-      console.log(this.edit_form, "prams");
       let loginNoStr = JSON.parse(sessionStorage.userInfo).loginNoStr;
       let groupId = JSON.parse(sessionStorage.userInfo).groupId;
       await this.$http({
@@ -562,14 +755,16 @@ export default {
           groupId,
         },
       }).then(({ data }) => {
-        this.transfer_list = data
+        this.transfer_list_orgin = data
           .filter((el) => {
             return el.loginNoStr !== loginNoStr;
           })
           .map((el) => ({
             ...el,
-            label: el.loginNameStr,
+            label: `${el.loginNameStr}`,
+            value: `${el.loginNoStr},${el.loginNameStr}`,
           }));
+        this.transfer_list = this.transfer_list_orgin;
         // 可编辑行
       });
       await this.$http({
@@ -581,17 +776,14 @@ export default {
         data: {
           id: this.edit_form.id,
         },
-      }).then(({ data }) => {
-        console.log(data);
-        this.transfer_rows = data.map((el) => ({
-          label: el,
-          value: el,
-        }));
+      }).then(({ data: { column, row } }) => {
+        this.transfer_cols_orgin = column.split(",");
+        this.transfer_rows_orgin = row.split(",");
       });
       this.transfer_visible = true;
     },
     handleTurn(type) {
-      // finish 结束 transfer 转派 back //打回 // agree 同意
+      // finish 结束 transfer 转派 back //打回 // agree 同意  // transfermanger 转总经理审批
       let request = 0;
       let reqdata = {
         id: this.edit_form.id,
@@ -601,36 +793,50 @@ export default {
         case "finish":
           // status 0.打回 3.结束
           reqdata.status = "3";
+          reqdata.operateName = "结束";
           request = 1;
           break;
         case "transfer":
           // reviewType 2.副总经理 3总经理
           if (this.duty === "7") {
             reqdata.reviewType = 2;
+            reqdata.operateName = "转副总审批";
             request = 1;
           } else if (this.duty === "2") {
             reqdata.reviewType = 3;
             request = 1;
+            reqdata.operateName = "转总经理审批";
           }
           break;
+        case "transfermanger":
+          // transfermanger  这首直接转给总经理的流程
+          reqdata.reviewType = 3;
+          reqdata.operateName = "转总经理审批";
+          request = 1;
+          break;
         case "back":
           reqdata.status = "0";
           reqdata.reviewType = 1;
           request = 1;
+          reqdata.operateName = "打回";
+          break;
+        case "return":
+          reqdata.status = "0";
+          reqdata.operateName = "退回";
+          if (this.duty === "2") {
+            reqdata.reviewType = 1;
+          } else if (this.duty === "1") {
+            reqdata.reviewType = 2;
+          }
+          console.log(reqdata, "reqdata");
+          request = 1;
           break;
         case "agree":
+          reqdata.operateName = "同意";
           reqdata.status = "3";
           request = 1;
           break;
       }
-      console.log(reqdata, "reqdata");
-      this.handleInit({
-        ...this.table_search,
-        page: this.page,
-        pageSize: this.rows,
-      });
-      // this.handleCancel("visible");
-      // this.handleCancel("approve_visible");
       if (request) {
         // 这里调接口
         this.$http({
@@ -654,6 +860,58 @@ export default {
               page: this.page,
               pageSize: this.rows,
             });
+          } else if (desc === "存在未提交,是否还要审核") {
+            this.$confirm(desc, {
+              distinguishCancelAndClose: false,
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning",
+            })
+              .then((res) => {
+                this.$http({
+                  url: "/market/CMKIssued/CMKIssuedCheck",
+                  method: "post",
+                  headers: {
+                    "Content-Type": "application/json",
+                  },
+                  data: { ...reqdata, submitFlag: 1 },
+                }).then(({ data: { desc } }) => {
+                  if (desc === "审批成功") {
+                    this.$message({
+                      type: "success",
+                      message: desc,
+                    });
+                    this.handleCancel("visible");
+                    this.handleCancel("approve_visible");
+                    this.handleInit({
+                      ...this.table_search,
+                      page: this.page,
+                      pageSize: this.rows,
+                    });
+                  } else {
+                    this.$message({
+                      type: "error",
+                      message: desc,
+                    });
+                    this.handleCancel("visible");
+                    this.handleCancel("approve_visible");
+                    this.handleInit({
+                      ...this.table_search,
+                      page: this.page,
+                      pageSize: this.rows,
+                    });
+                  }
+                });
+              })
+              .catch((error) => {
+                this.handleCancel("visible");
+                this.handleCancel("approve_visible");
+                this.handleInit({
+                  ...this.table_search,
+                  page: this.page,
+                  pageSize: this.rows,
+                });
+              });
           }
         });
       }
@@ -673,7 +931,15 @@ export default {
       // this.handleCancel("approve_visible");
       // });
     },
-
+    // 通用方法用于转化全局
+    paramsArr(start, end) {
+      const arr = [];
+      console.log(start, end);
+      for (let i = Number(start); i <= Number(end); i++) {
+        arr.push(i);
+      }
+      return arr.join(",");
+    },
     handleConfirm(visible) {
       console.log(visible);
       this.track_visible = visible;
@@ -686,6 +952,21 @@ export default {
       });
       this.handleCancel("visible");
     },
+    handleReceiver({ id }) {
+      // 回复详情
+      console.log(id);
+      this.principal_visible = true;
+      this.$http({
+        url: "/market/CMKIssued/replyDetails",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: { issuedId: id },
+      }).then(({ data }) => {
+        this.receiver_table_list = data;
+      });
+    },
     // 关闭方法
     handleCancel(data) {
       switch (data) {
@@ -702,6 +983,9 @@ export default {
         case "transfer_visible":
           this.transfer_visible = false;
           break;
+        case "principal_visible":
+          this.principal_visible = false;
+          break;
       }
     },
     // handleBack() {
@@ -768,4 +1052,10 @@ export default {
 };
 </script>
 
-<style></style>
+<style lang="scss" scope>
+.approve {
+  .v-modal {
+    display: none !important;
+  }
+}
+</style>

+ 4 - 4
src/pages/main/performance/index.vue

@@ -47,10 +47,10 @@ export default {
                     label: "模板管理",
                     name: "mould",
                 },
-                {
-                    label: "下发管理",
-                    name: "issue",
-                },
+                // {
+                //     label: "下发管理",
+                //     name: "issue",
+                // },
                 {
                     label: "回复统计",
                     name: "reply",

+ 252 - 250
src/pages/main/performance/mould.vue

@@ -1,94 +1,94 @@
 <template>
-    <div>
-        <div class="simple-container">
-            <simple-form
-                :form="table_form"
-                :handle="table_handle"
-                @search="handleSearch"
-                @add="handleVisible('add')"
-            ></simple-form>
-            <simple-table
-                :list="table_list"
-                :config="table_config"
-                :loading="table_loading"
-                :handle-row="table_handle_row"
-                @issue="(params) => handleVisible('issue', params)"
-                @detail="(params) => handleVisible('template', params)"
-                @delete="handleDelete"
-            ></simple-table>
-            <simple-pagination
-                :page="page"
-                :total="total"
-                @change="handleChange"
-            ></simple-pagination>
-        </div>
-        <simple-dialog
-            title="下发"
-            width="500px"
-            @cancel="handleVisible('issue')"
-            @confirm="handleIssue"
-            :visible="issue_visible"
+  <div>
+    <div class="simple-container">
+      <simple-form
+        :form="table_form"
+        :handle="table_handle"
+        @search="handleSearch"
+        @add="handleVisible('add')"
+      ></simple-form>
+      <simple-table
+        :list="table_list"
+        :config="table_config"
+        :loading="table_loading"
+        :handle-row="table_handle_row"
+        @issue="(params) => handleVisible('issue', params)"
+        @detail="(params) => handleVisible('template', params)"
+        @delete="handleDelete"
+      ></simple-table>
+      <simple-pagination
+        :page="page"
+        :total="total"
+        @change="handleChange"
+      ></simple-pagination>
+    </div>
+    <simple-dialog
+      title="下发"
+      width="500px"
+      @cancel="handleVisible('issue')"
+      @confirm="handleIssue"
+      :visible="issue_visible"
+    >
+      <el-form label-width="120px" :model="issue_form" ref="issue_ref">
+        <el-form-item
+          label="填报事由"
+          prop="reason"
+          :rules="{
+            required: true,
+            message: '填报事由不能为空',
+            trigger: 'blur',
+          }"
         >
-            <el-form label-width="120px" :model="issue_form" ref="issue_ref">
-                <el-form-item
-                    label="填报事由"
-                    prop="reason"
-                    :rules="{
-                        required: true,
-                        message: '填报事由不能为空',
-                        trigger: 'blur',
-                    }"
-                >
-                    <el-input v-model="issue_form.reason"></el-input>
-                </el-form-item>
-                <el-form-item
-                    label="填报注意事项"
-                    prop="precautions"
-                    :rules="{
-                        required: true,
-                        message: '填报注意事项不能为空',
-                        trigger: 'blur',
-                    }"
-                >
-                    <el-input v-model="issue_form.precautions"></el-input>
-                </el-form-item>
-                <el-form-item
-                    label="截止时间"
-                    prop="endTime"
-                    :rules="{
-                        required: true,
-                        message: '截止时间不能为空',
-                        trigger: 'change',
-                    }"
-                >
-                    <el-date-picker v-model="issue_form.endTime" type="date">
-                    </el-date-picker>
-                </el-form-item>
-            </el-form>
-        </simple-dialog>
-        <simple-dialog
-            fullscreen
-            title="新增模板"
-            :visible="add_visible"
-            width="1200px"
-            @confirm="handleVisible('add')"
-            @cancel="handleVisible('add')"
+          <el-input v-model="issue_form.reason"></el-input>
+        </el-form-item>
+        <el-form-item
+          label="填报注意事项"
+          prop="precautions"
+          :rules="{
+            required: true,
+            message: '填报注意事项不能为空',
+            trigger: 'blur',
+          }"
         >
-            <el-form inline :model="form" label-width="100px"> </el-form>
-            <simple-sheet v-if="add_visible" @save="handleSave" type="edit" />
-            <template v-slot:footer><div></div></template>
-        </simple-dialog>
-        <simple-dialog
-            title="查看模板"
-            fullscreen
-            @cancel="handleVisible('template')"
-            @confirm="handleVisible('template')"
-            :visible="template_visible"
+          <el-input v-model="issue_form.precautions"></el-input>
+        </el-form-item>
+        <el-form-item
+          label="截止时间"
+          prop="endTime"
+          :rules="{
+            required: true,
+            message: '截止时间不能为空',
+            trigger: 'change',
+          }"
         >
-            <simple-sheet v-if="template_visible" :id="template_id" />
-            <template v-slot:footer><div></div></template>
-        </simple-dialog>
-    </div>
+          <el-date-picker v-model="issue_form.endTime" type="datetime" format="yyyy-MM-dd HH:00:00">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+    </simple-dialog>
+    <simple-dialog
+      fullscreen
+      title="新增模板"
+      :visible="add_visible"
+      width="1200px"
+      @confirm="handleVisible('add')"
+      @cancel="handleVisible('add')"
+    >
+      <el-form inline :model="form" label-width="100px"> </el-form>
+      <simple-sheet v-if="add_visible" @save="handleSave" type="edit" />
+      <template v-slot:footer><div></div></template>
+    </simple-dialog>
+    <simple-dialog
+      title="查看模板"
+      fullscreen
+      @cancel="handleVisible('template')"
+      @confirm="handleVisible('template')"
+      :visible="template_visible"
+    >
+      <simple-sheet v-if="template_visible" :id="template_id" />
+      <template v-slot:footer><div></div></template>
+    </simple-dialog>
+  </div>
 </template>
 
 <script>
@@ -98,180 +98,182 @@ import simpleTable from "./components/table.vue";
 import simpleDialog from "./components/dialog.vue";
 import simplePagination from "./components/pagination.vue";
 export default {
-    components: {
-        simpleTable,
-        simpleDialog,
-        simpleForm,
-        simpleSheet,
-        simplePagination,
-    },
-    data() {
-        return {
-            page: 1,
-            rows: 10,
-            total: 0,
-            form: {},
-            add_visible: false,
-            // template
-            template_visible: false,
-            template_id: null,
-            // issue
-            issue_visible: false,
-            issue_form: {},
-            issue_id: null,
-            // table
-            table_loading: false,
-            table_search: {},
-            table_form: [
-                {
-                    label: "模板名称",
-                    props: "templateName",
-                    type: "input",
-                },
-            ],
-            table_list: [],
-            table_handle: [
-                {
-                    label: "新增模板",
-                    props: "add",
-                },
-            ],
-            table_handle_row: [
-                {
-                    label: "下发",
-                    props: "issue",
-                },
-                {
-                    label: "查看",
-                    props: "detail",
-                },
-                {
-                    label: "删除",
-                    props: "delete",
-                    popconfirm: true,
-                },
-            ],
-            table_config: [
-                {
-                    label: "模板名称",
-                    props: "templateName",
-                },
-                {
-                    label: "配置时间",
-                    props: "updateTime",
-                },
-                {
-                    label: "配置人员",
-                    props: "createId",
-                },
-                {
-                    label: "模板状态",
-                    props: "status",
-                    type: "dictionary",
-                    dictionary: {
-                        0: "在用",
-                        1: "停用",
-                    },
-                },
-            ],
-        };
-    },
-    methods: {
-        async handleInit() {
-            this.table_loading = true;
-            this.$http({
-                url: "/market/CMKFileTemplate/CMKFileTemplateList",
-                method: "post",
-                headers: {
-                    "Content-Type": "application/json",
-                },
-                data: {
-                    page: this.page,
-                    pageSize: this.rows,
-                    templateName: this.table_search.templateName,
-                },
-            }).then(({ data: { count, data } }) => {
-                this.total = count;
-                this.table_list = data;
-                this.table_loading = false;
-            });
+  components: {
+    simpleTable,
+    simpleDialog,
+    simpleForm,
+    simpleSheet,
+    simplePagination,
+  },
+  data() {
+    return {
+      page: 1,
+      rows: 10,
+      total: 0,
+      form: {},
+      add_visible: false,
+      // template
+      template_visible: false,
+      template_id: null,
+      // issue
+      issue_visible: false,
+      issue_form: {},
+      issue_id: null,
+      // table
+      table_loading: false,
+      table_search: {},
+      table_form: [
+        {
+          label: "模板名称",
+          props: "templateName",
+          type: "input",
         },
-        handleSearch({ templateName }) {
-            this.table_search = { templateName };
-            this.handleReset();
-            this.handleInit();
+      ],
+      table_list: [],
+      table_handle: [
+        {
+          label: "新增模板",
+          props: "add",
         },
-        handleAdd() {},
-        handleChange(page) {
-            this.page = page;
-            this.handleInit();
+      ],
+      table_handle_row: [
+        {
+          label: "下发",
+          props: "issue",
         },
-        handleVisible(props, params) {
-            switch (props) {
-                case "add":
-                    this.add_visible = !this.add_visible;
-                    break;
-                case "template":
-                    this.template_visible = !this.template_visible;
-                    this.template_id = params?.id;
-                    break;
-                case "issue":
-                    this.issue_visible = !this.issue_visible;
-                    this.issue_id = params ? params.id : null;
-                    break;
-            }
+        {
+          label: "查看",
+          props: "detail",
         },
-        handleReset() {
-            this.page = 1;
+        {
+          label: "删除",
+          props: "delete",
+          popconfirm: true,
         },
-        handleDelete({ id }) {
-            this.$http({
-                url: "/market/CMKFileTemplate/delCMKFileTemplateById",
-                method: "post",
-                headers: {
-                    "Content-Type": "application/json",
-                },
-                data: {
-                    templateId: id,
-                },
-            }).then(() => {
-                this.$message.success("删除成功");
-                this.handleInit();
-            });
+      ],
+      table_config: [
+        {
+          label: "序号",
+          type: "number",
         },
-        handleIssue() {
-            this.$refs["issue_ref"].validate((valid) => {
-                if (valid) {
-                    this.$http({
-                        url: "/market/CMKFileTemplate/issuedCMKFileTemplateById",
-                        method: "post",
-                        headers: {
-                            "Content-Type": "application/json",
-                        },
-                        data: {
-                            ...this.issue_form,
-                            endTime: this.$formatDate(
-                                this.issue_form.endTime,
-                                "YYYY-MM-DD"
-                            ),
-                            templateId: this.issue_id,
-                        },
-                    }).then(() => {
-                        this.handleVisible("issue");
-                        this.$message.success("下发成功");
-                        this.handleInit();
-                    });
-                }
-            });
+        {
+          label: "模板名称",
+          props: "templateName",
         },
-        handleSave() {
-            this.handleVisible("add");
-            this.handleInit();
+        {
+          label: "配置时间",
+          props: "updateTime",
+        },
+        {
+          label: "配置人员",
+          props: "createId",
+        },
+        {
+          label: "模板状态",
+          props: "status",
+          type: "dictionary",
+          dictionary: {
+            0: "在用",
+            1: "停用",
+          },
+        },
+      ],
+    };
+  },
+  methods: {
+    async handleInit() {
+      this.table_loading = true;
+      this.$http({
+        url: "/market/CMKFileTemplate/CMKFileTemplateList",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
         },
+        data: {
+          page: this.page,
+          pageSize: this.rows,
+          templateName: this.table_search.templateName,
+        },
+      }).then(({ data: { count, data } }) => {
+        this.total = count;
+        this.table_list = data;
+        this.table_loading = false;
+      });
+    },
+    handleSearch({ templateName }) {
+      this.table_search = { templateName };
+      this.handleReset();
+      this.handleInit();
+    },
+    handleAdd() {},
+    handleChange(page) {
+      this.page = page;
+      this.handleInit();
+    },
+    handleVisible(props, params) {
+      switch (props) {
+        case "add":
+          this.add_visible = !this.add_visible;
+          break;
+        case "template":
+          this.template_visible = !this.template_visible;
+          // this.template_id = params?.id;
+          this.template_id = params ? params.id : null;
+          break;
+        case "issue":
+          this.issue_visible = !this.issue_visible;
+          this.issue_id = params ? params.id : null;
+          break;
+      }
+    },
+    handleReset() {
+      this.page = 1;
     },
-    mounted() {
+    handleDelete({ id }) {
+      this.$http({
+        url: "/market/CMKFileTemplate/delCMKFileTemplateById",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: {
+          templateId: id,
+        },
+      }).then(() => {
+        this.$message.success("删除成功");
         this.handleInit();
+      });
+    },
+    handleIssue() {
+      this.$refs["issue_ref"].validate((valid) => {
+        if (valid) {
+          this.$http({
+            url: "/market/CMKFileTemplate/issuedCMKFileTemplateById",
+            method: "post",
+            headers: {
+              "Content-Type": "application/json",
+            },
+            data: {
+              ...this.issue_form,
+              endTime: this.$formatDate(this.issue_form.endTime, "YYYY-MM-DD HH:00:00"),
+              templateId: this.issue_id,
+            },
+          }).then(() => {
+            this.handleVisible("issue");
+            this.$message.success("下发成功");
+            this.handleInit();
+          });
+        }
+      });
+    },
+    handleSave() {
+      this.handleVisible("add");
+      this.handleInit();
     },
+  },
+  mounted() {
+    this.handleInit();
+  },
 };
 </script>
 

+ 6 - 0
src/router/index.js

@@ -1667,6 +1667,12 @@ const routes = [{
             name: 'workersList',
             component: (resolve) => require( /* webpackChunkName: "system" */['../pages/main/gridDivision/workersList.vue'], resolve)
         },
+        {
+            meta: { name:  '地市网格负责人~市场部副总汇总后处理', keepAlive: false },
+            path: '/approvalExamination',
+            name: 'approvalExamination',
+            component: (resolve) => require( /* webpackChunkName: "system" */['../pages/main/gridDivision/approvalExamination.vue'], resolve)
+        },
     ]
 },
 {

+ 46 - 25
vue.config.js

@@ -1,31 +1,34 @@
-const CompressionPlugin = require('compression-webpack-plugin');
-const webpack = require('webpack');
-const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
+const CompressionPlugin = require("compression-webpack-plugin");
+const webpack = require("webpack");
+const BundleAnalyzerPlugin =
+    require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
 module.exports = {
-    publicPath: process.env.NODE_ENV === 'production' ? '' : '/',
+    publicPath: process.env.NODE_ENV === "production" ? "" : "/",
     productionSourceMap: false,
     lintOnSave: false,
 
-    chainWebpack: config => {
-        if (process.env.NODE_ENV === 'production') {
+    chainWebpack: (config) => {
+        if (process.env.NODE_ENV === "production") {
             if (process.env.npm_config_report) {
                 config
-                    .plugin('webpack-bundle-analyzer')
-                    .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
+                    .plugin("webpack-bundle-analyzer")
+                    .use(
+                        require("webpack-bundle-analyzer").BundleAnalyzerPlugin
+                    );
             }
-            config.plugins.delete('prefetch');
+            config.plugins.delete("prefetch");
         }
     },
-    configureWebpack: config => {
-        if (process.env.NODE_ENV === 'production') {
+    configureWebpack: (config) => {
+        if (process.env.NODE_ENV === "production") {
             config.optimization = {
                 splitChunks: {
-                    chunks: "all",          //async异步代码分割 initial同步代码分割 all同步异步分割都开启
-                    minSize: 10000,         //字节 引入的文件大于30kb才进行分割
+                    chunks: "all", //async异步代码分割 initial同步代码分割 all同步异步分割都开启
+                    minSize: 10000, //字节 引入的文件大于30kb才进行分割
                     // minChunks: 2,           //模块至少使用次数
                     // maxAsyncRequests: 25,    //同时加载的模块数量最多是5个,只分割出同时引入的前5个文件
                     // maxInitialRequests: 30,  //首页加载的时候引入的文件最多3个
-                    automaticNameDelimiter: '-', //缓存组和生成文件名称之间的连接符
+                    automaticNameDelimiter: "-", //缓存组和生成文件名称之间的连接符
                     // name: true,                  //缓存组里面的filename生效,覆盖默认命名
                     cacheGroups: {
                         // vue: {
@@ -53,9 +56,9 @@ module.exports = {
                         //     test: /[\\\/]node_modules[\\\/]/,
                         //     priority: -20
                         // },
-                    }
-                }
-            }
+                    },
+                },
+            };
             // return {
             //     plugins: [
             //         new CompressionPlugin({
@@ -83,25 +86,43 @@ module.exports = {
             //     // new BundleAnalyzerPlugin()
             // ]
         }
-
     },
     parallel: true,
 
     devServer: {
         proxy: {
-            '/': {
+            // 开发环境变化可注释 ⬇️⬇️
+            "/market/CMK": {
+                target: "http://192.168.1.9:9114",
+                ws: false,
+                changeOrigin: true,
+                pathRewrite: {
+                    "^/market": "",
+                },
+            },
+            "/mkWangge": {
+                target: "http://192.168.1.19:9114",
+                ws: false,
+                changeOrigin: true,
+                pathRewrite: {
+                    "^/market": "",
+                },
+            },
+            // 开发环境变化可注释 ⬆️⬆️
+            "/": {
                 // target: 'http://192.168.2.145:9600/spfm',
                 // target: 'http://192.168.2.149:9600',
                 // target: 'http://10.64.42.70:8088/',
                 // target: 'http://114.215.71.182:29600',
-                target: 'http://192.168.1.9:9600/spfm',
+                // target: 'http://192.168.1.9:9600/spfm',
                 // target: 'http://127.0.0.1:9600/',
                 // target: 'http://192.168.0.156:9600/',
                 // target: 'http://192.168.2.170:9600/',
                 // target: 'http://192.168.2.169:9600/',
-                changeOrigin: true
-            }
-        }
+                target: "http://192.168.1.228:9600/spfm",
+                changeOrigin: true,
+            },
+        },
     },
-    transpileDependencies: ['color-string'] // 此段为增加配置选项
-}
+    transpileDependencies: ["color-string"], // 此段为增加配置选项
+};