|
@@ -2,12 +2,22 @@
|
|
|
* @Author : yuanrunwei
|
|
|
* @Date : 2021-12-04 14:23:58
|
|
|
* @LastEditors: daiqisheng
|
|
|
- * @LastEditTime: 2022-03-07 17:40:14
|
|
|
+ * @LastEditTime: 2022-03-31 14:57:06
|
|
|
* @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">
|
|
|
+ <span
|
|
|
+ class="margin-right-10 font-size-16"
|
|
|
+ v-if="!status || status === '2'"
|
|
|
+ ><span class="sheet-container-require">*</span>模板类型:</span
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="templateType"
|
|
|
+ :disabled="type === 'view'"
|
|
|
+ v-if="!status || status === '2'"
|
|
|
+ ></el-input>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
@click="handleVisible"
|
|
@@ -16,6 +26,12 @@
|
|
|
>
|
|
|
<el-button type="primary" @click="handleDownload">导出</el-button>
|
|
|
<el-button type="primary" @click="handleFullscreen()">全屏显示</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-if="!status || superviseFlag === '1'"
|
|
|
+ @click="handleSupervise('confirm')"
|
|
|
+ >督办</el-button
|
|
|
+ >
|
|
|
<template v-if="['edit'].includes(type)">
|
|
|
<el-upload
|
|
|
v-if="!id"
|
|
@@ -53,6 +69,7 @@
|
|
|
</template>
|
|
|
</div>
|
|
|
<div id="luckysheet" class="sheet-container-block"></div>
|
|
|
+ <!-- 设置权限的 -->
|
|
|
<simple-dialog
|
|
|
title="权限设置"
|
|
|
:visible="visible"
|
|
@@ -162,6 +179,7 @@
|
|
|
><div></div
|
|
|
></template>
|
|
|
</simple-dialog>
|
|
|
+ <!-- 科室经理提交的 -->
|
|
|
<simpleDialog
|
|
|
title="提交"
|
|
|
:visible="manager_approve"
|
|
@@ -210,6 +228,56 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</simpleDialog>
|
|
|
+ <simpleDialog
|
|
|
+ title="督办"
|
|
|
+ :visible="supervise"
|
|
|
+ :modal="false"
|
|
|
+ @confirm="handleSupervise('confirm')"
|
|
|
+ @cancel="handleSupervise('cancel')"
|
|
|
+ >
|
|
|
+ <span class="margin-left-20"
|
|
|
+ >注:设置督办后,系统会按照设定的周期自动派发</span
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ :rules="superviserules"
|
|
|
+ :model="superviseForm"
|
|
|
+ ref="superviseForm"
|
|
|
+ class="margin-top-20"
|
|
|
+ label-width="120px"
|
|
|
+ >
|
|
|
+ <el-form-item prop="distribute" label="派发周期">
|
|
|
+ <el-select v-model="superviseForm.distribute" filterable>
|
|
|
+ <!-- 0.月 1.季度 2.半年 3.年 -->
|
|
|
+ <el-option
|
|
|
+ v-for="({ label, value }, index) in [
|
|
|
+ { label: '月', value: '0' },
|
|
|
+ { label: '季度', value: '1' },
|
|
|
+ { label: '半年', value: '2' },
|
|
|
+ { label: '年', value: '3' },
|
|
|
+ ]"
|
|
|
+ :key="index"
|
|
|
+ :label="label"
|
|
|
+ :value="value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="write" label="填报周期">
|
|
|
+ <el-date-picker v-model="superviseForm.write" type="date">
|
|
|
+ </el-date-picker
|
|
|
+ ></el-form-item>
|
|
|
+ <el-form-item prop="endTime" label="截止时间">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="superviseForm.endTime"
|
|
|
+ type="datetime"
|
|
|
+ format="yyyy-MM-dd HH:00:00"
|
|
|
+ >
|
|
|
+ </el-date-picker
|
|
|
+ ></el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template v-if="id && type === 'view'" v-slot:footer
|
|
|
+ ><div></div
|
|
|
+ ></template>
|
|
|
+ </simpleDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -233,10 +301,12 @@ export default {
|
|
|
id: {
|
|
|
default: null,
|
|
|
},
|
|
|
+ // 接收人
|
|
|
receiver: {
|
|
|
type: String,
|
|
|
default: "",
|
|
|
},
|
|
|
+ // 模板状态按钮判断
|
|
|
status: { type: String, default: "" },
|
|
|
},
|
|
|
data() {
|
|
@@ -277,14 +347,34 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
-
|
|
|
+ superviserules: {
|
|
|
+ distribute: [
|
|
|
+ { required: true, message: "请选择派发周期", trigger: "change" },
|
|
|
+ ],
|
|
|
+ write: [
|
|
|
+ { required: true, message: "请选择填报周期", trigger: "change" },
|
|
|
+ ],
|
|
|
+ endTime: [
|
|
|
+ { required: true, message: "请选择截止时间", trigger: "change" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ superviseForm: {
|
|
|
+ distribute: "", // 派单周期
|
|
|
+ write: "", // 填写周期
|
|
|
+ endTime: "", // 截止时间
|
|
|
+ },
|
|
|
// 可提交标志
|
|
|
addFlag: "0",
|
|
|
+ // 督办标志
|
|
|
+ superviseFlag: null,
|
|
|
rowList: [],
|
|
|
isDisable: true,
|
|
|
issued_id: null,
|
|
|
template_id: null,
|
|
|
visible: false,
|
|
|
+ templateType: "",
|
|
|
+ // 督办
|
|
|
+ supervise: false,
|
|
|
manager_approve: false,
|
|
|
row_list: [],
|
|
|
column_list: [],
|
|
@@ -356,7 +446,12 @@ export default {
|
|
|
issuedId,
|
|
|
templateId,
|
|
|
list,
|
|
|
+ superviseFlag,
|
|
|
+ templateType,
|
|
|
addFlag,
|
|
|
+ distributeEndTime,
|
|
|
+ distributeTime,
|
|
|
+ distributeType,
|
|
|
},
|
|
|
} = await this.$http({
|
|
|
url,
|
|
@@ -366,6 +461,15 @@ export default {
|
|
|
},
|
|
|
data: params,
|
|
|
});
|
|
|
+ this.superviseFlag = superviseFlag;
|
|
|
+ if (superviseFlag === "1") {
|
|
|
+ this.superviseForm = {
|
|
|
+ distribute: distributeType, // 派单周期
|
|
|
+ write: distributeTime, // 填写周期
|
|
|
+ endTime: distributeEndTime, // 截止时间
|
|
|
+ };
|
|
|
+ }
|
|
|
+ this.templateType = templateType;
|
|
|
this.template_id = templateId;
|
|
|
this.issued_id = issuedId;
|
|
|
this.addFlag = addFlag;
|
|
@@ -439,6 +543,33 @@ export default {
|
|
|
type: "json",
|
|
|
});
|
|
|
},
|
|
|
+ handleSupervise(data) {
|
|
|
+ if (data === "cancel") {
|
|
|
+ this.supervise = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.supervise === false) {
|
|
|
+ this.supervise = true;
|
|
|
+ } else {
|
|
|
+ let filled =
|
|
|
+ Object.keys(this.superviseForm).length === 3 &&
|
|
|
+ Object.values(this.superviseForm).filter((el) => el !== "").length ===
|
|
|
+ 3;
|
|
|
+ if (filled) {
|
|
|
+ this.superviseForm = {
|
|
|
+ ...this.superviseForm,
|
|
|
+ endTime: this.$formatDate(
|
|
|
+ this.superviseForm.endTime,
|
|
|
+ "YYYY-MM-DD HH:00:00"
|
|
|
+ ), // 督办设置的截止时间
|
|
|
+ write: this.$formatDate(this.superviseForm.write, "YYYY-MM-DD"), // 派发时间–或者叫—填报时间
|
|
|
+ };
|
|
|
+ this.supervise = false;
|
|
|
+ } else {
|
|
|
+ this.$message.error("请填写完整必要的信息");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
handleForbid() {
|
|
|
// const object = {};
|
|
|
const { permission_type } = this.form;
|
|
@@ -627,11 +758,42 @@ export default {
|
|
|
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();
|
|
|
if (!this.id) {
|
|
|
// 新增时添加权限
|
|
|
+ let value = {};
|
|
|
+ if (!this.templateType) {
|
|
|
+ this.$message.error("请输入模板类型");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ Object.values(this.superviseForm).filter((el) => el !== "").length ===
|
|
|
+ 3
|
|
|
+ ) {
|
|
|
+ value = {
|
|
|
+ distributeEndTime: this.superviseForm.endTime, // 督办设置的截止时间
|
|
|
+ distributeTime: this.superviseForm.write, // 派发时间–或者叫—填报时间
|
|
|
+ distributeType: this.superviseForm.distribute, //派发周期类型 派发周期类型 0.月 1.季度 2.半年 3.年
|
|
|
+ superviseFlag: 1, //督办标识 0.不是 1.是
|
|
|
+ templateType: this.templateType, //模板类型
|
|
|
+ templateContent: JSON.stringify(data), //文件内容
|
|
|
+ templateName: workbook_name, //模板名称
|
|
|
+ templateUrl: "", //文件链接
|
|
|
+ status: type,
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ value = {
|
|
|
+ superviseFlag: 0, //督办标识 0.不是 1.是
|
|
|
+ templateType: this.templateType, //模板类型
|
|
|
+ templateContent: JSON.stringify(data), //文件内容
|
|
|
+ templateName: workbook_name, //模板名称
|
|
|
+ templateUrl: "", //文件链接
|
|
|
+ status: type,
|
|
|
+ };
|
|
|
+ }
|
|
|
const {
|
|
|
data: { body },
|
|
|
} = await this.$http({
|
|
@@ -640,13 +802,7 @@ export default {
|
|
|
headers: {
|
|
|
"Content-Type": "application/json",
|
|
|
},
|
|
|
- data: {
|
|
|
- id: this.template_id,
|
|
|
- templateContent: JSON.stringify(data),
|
|
|
- templateName: workbook_name,
|
|
|
- issuedId: this.issued_id,
|
|
|
- status: type,
|
|
|
- },
|
|
|
+ data: value,
|
|
|
});
|
|
|
await this.handleAddAuth({ id: body });
|
|
|
this.$emit("save");
|
|
@@ -936,7 +1092,6 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
- console.log(this.destroy, "destroy");
|
|
|
this.handleInit();
|
|
|
this.handleChargeList();
|
|
|
},
|
|
@@ -957,6 +1112,13 @@ export default {
|
|
|
width: 100%;
|
|
|
height: 75%;
|
|
|
}
|
|
|
+ &-require {
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
+ .el-input {
|
|
|
+ width: 200px;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
.form {
|
|
|
&-input {
|