|
@@ -2,12 +2,22 @@
|
|
|
* @Author : yuanrunwei
|
|
|
* @Date : 2021-12-04 14:23:58
|
|
|
* @LastEditors: daiqisheng
|
|
|
- * @LastEditTime: 2022-03-07 17:40:14
|
|
|
+ * @LastEditTime: 2022-04-18 18:09:32
|
|
|
* @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="['template'].includes(attribute)"
|
|
|
+ ><span class="sheet-container-require">*</span>模板类型:</span
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-if="['template'].includes(attribute)"
|
|
|
+ v-model="templateType"
|
|
|
+ :disabled="type === 'view' || (type === 'edit' && attribute === 'file')"
|
|
|
+ ></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"
|
|
|
+ @click="handleSupervise('confirm')"
|
|
|
+ v-if="['template'].includes(attribute)"
|
|
|
+ >督办</el-button
|
|
|
+ >
|
|
|
<template v-if="['edit'].includes(type)">
|
|
|
<el-upload
|
|
|
v-if="!id"
|
|
@@ -34,7 +50,11 @@
|
|
|
>暂存</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
- v-if="status === '2' || status === '3'"
|
|
|
+ v-if="
|
|
|
+ status === '2' ||
|
|
|
+ status === '3' ||
|
|
|
+ (status === '0' && superviseFlag === '1')
|
|
|
+ "
|
|
|
type="primary"
|
|
|
@click="handleResave"
|
|
|
:disabled="handleForbid()"
|
|
@@ -53,6 +73,7 @@
|
|
|
</template>
|
|
|
</div>
|
|
|
<div id="luckysheet" class="sheet-container-block"></div>
|
|
|
+ <!-- 设置权限的 -->
|
|
|
<simple-dialog
|
|
|
title="权限设置"
|
|
|
:visible="visible"
|
|
@@ -162,6 +183,7 @@
|
|
|
><div></div
|
|
|
></template>
|
|
|
</simple-dialog>
|
|
|
+ <!-- 科室经理提交的 -->
|
|
|
<simpleDialog
|
|
|
title="提交"
|
|
|
:visible="manager_approve"
|
|
@@ -210,6 +232,63 @@
|
|
|
</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"
|
|
|
+ @change="handleWrite"
|
|
|
+ :picker-options="pickWrite"
|
|
|
+ >
|
|
|
+ </el-date-picker
|
|
|
+ ></el-form-item>
|
|
|
+ <el-form-item prop="endTime" label="截止时间">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="superviseForm.endTime"
|
|
|
+ @change="handleEnd"
|
|
|
+ type="datetime"
|
|
|
+ :unlink-panels="true"
|
|
|
+ :picker-options="pickOptions"
|
|
|
+ >
|
|
|
+ </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 +312,12 @@ export default {
|
|
|
id: {
|
|
|
default: null,
|
|
|
},
|
|
|
+ // 接收人
|
|
|
receiver: {
|
|
|
type: String,
|
|
|
default: "",
|
|
|
},
|
|
|
+ // 模板状态按钮判断
|
|
|
status: { type: String, default: "" },
|
|
|
},
|
|
|
data() {
|
|
@@ -277,14 +358,45 @@ 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: "", // 截止时间
|
|
|
+ },
|
|
|
+ originSuperviseForm: {},
|
|
|
+ pickOptions: {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() < new Date().getTime() - 8.64e7;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ pickWrite: {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() < new Date().getTime() - 8.64e7;
|
|
|
+ },
|
|
|
+ },
|
|
|
// 可提交标志
|
|
|
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: [],
|
|
@@ -309,6 +421,47 @@ export default {
|
|
|
this.handleCreate();
|
|
|
}
|
|
|
},
|
|
|
+ // 填报日期
|
|
|
+ handleWrite(value) {
|
|
|
+ if (value) {
|
|
|
+ let range =
|
|
|
+ new Date().getTime() > value.getTime()
|
|
|
+ ? new Date().getTime()
|
|
|
+ : value.getTime();
|
|
|
+ this.pickOptions = {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() < range;
|
|
|
+ },
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ this.pickOptions = {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() < new Date().getTime() - 864000;
|
|
|
+ },
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleEnd(value) {
|
|
|
+ if (value) {
|
|
|
+ this.pickWrite = {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() > value.getTime();
|
|
|
+ },
|
|
|
+ };
|
|
|
+ if (
|
|
|
+ this.superviseForm.write &&
|
|
|
+ value.getTime() < this.superviseForm.write.getTime()
|
|
|
+ ) {
|
|
|
+ this.superviseForm.endTime = "";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.pickWrite = {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() - 864000 < new Date().getTime();
|
|
|
+ },
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
// // 权限选择
|
|
|
// handleRadio(e){
|
|
|
// console.log(e,'e');
|
|
@@ -356,7 +509,12 @@ export default {
|
|
|
issuedId,
|
|
|
templateId,
|
|
|
list,
|
|
|
+ superviseFlag,
|
|
|
+ templateType,
|
|
|
addFlag,
|
|
|
+ distributeEndTime,
|
|
|
+ distributeTime,
|
|
|
+ distributeType,
|
|
|
},
|
|
|
} = await this.$http({
|
|
|
url,
|
|
@@ -366,6 +524,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 +606,44 @@ export default {
|
|
|
type: "json",
|
|
|
});
|
|
|
},
|
|
|
+ handleSupervise(data) {
|
|
|
+ if (data === "cancel") {
|
|
|
+ this.supervise = false;
|
|
|
+ this.superviseForm = {
|
|
|
+ ...this.originSuperviseForm,
|
|
|
+ };
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.supervise === false) {
|
|
|
+ this.supervise = true;
|
|
|
+ this.originSuperviseForm = {
|
|
|
+ ...this.superviseForm,
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ let filled =
|
|
|
+ Object.keys(this.superviseForm).length === 3 &&
|
|
|
+ Object.values(this.superviseForm).filter((el) => el !== "").length ===
|
|
|
+ 3;
|
|
|
+ if (filled) {
|
|
|
+ let time = new Date().getTime();
|
|
|
+ if (time > this.superviseForm.endTime.getTime()) {
|
|
|
+ this.$message.error("截止时间不能小于当前时间");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.superviseForm = {
|
|
|
+ ...this.superviseForm,
|
|
|
+ endTime: this.$formatDate(
|
|
|
+ this.superviseForm.endTime,
|
|
|
+ "YYYY-MM-DD HH:mm:ss"
|
|
|
+ ), // 督办设置的截止时间
|
|
|
+ write: this.$formatDate(this.superviseForm.write, "YYYY-MM-DD"), // 派发时间–或者叫—填报时间
|
|
|
+ };
|
|
|
+ this.supervise = false;
|
|
|
+ } else {
|
|
|
+ this.$message.error("请填写完整必要的信息");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
handleForbid() {
|
|
|
// const object = {};
|
|
|
const { permission_type } = this.form;
|
|
@@ -581,7 +786,7 @@ export default {
|
|
|
});
|
|
|
reqdata.principalId = principalId.join(",");
|
|
|
reqdata.principalName = principalName.join(",");
|
|
|
- reqdata.principalMent = principalName.join(",");
|
|
|
+ reqdata.principalMent = principalMent.join(",");
|
|
|
} else {
|
|
|
const { charge } = this.form;
|
|
|
// 特殊权限
|
|
@@ -627,11 +832,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,36 +876,58 @@ 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");
|
|
|
} else {
|
|
|
// 职位
|
|
|
let duty = JSON.parse(sessionStorage.userInfo).duty;
|
|
|
- if (duty === "7") {
|
|
|
+ if (duty === "7" && type === "0") {
|
|
|
this.manager_approve = true;
|
|
|
} else {
|
|
|
if (type === "2") {
|
|
|
// 暂存
|
|
|
+ let value = {};
|
|
|
+ if (!this.templateType) {
|
|
|
+ this.$message.error("请输入模板类型");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ Object.values(this.superviseForm).filter((el) => el !== "")
|
|
|
+ .length === 3
|
|
|
+ ) {
|
|
|
+ value = {
|
|
|
+ templateId: this.id,
|
|
|
+ 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 = {
|
|
|
+ templateId: this.id,
|
|
|
+ superviseFlag: 0, //督办标识 0.不是 1.是
|
|
|
+ templateType: this.templateType, //模板类型
|
|
|
+ templateContent: JSON.stringify(data), //文件内容
|
|
|
+ templateName: workbook_name, //模板名称
|
|
|
+ templateUrl: "", //文件链接
|
|
|
+ status: type,
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
await this.$http({
|
|
|
- url: "/market/CMKFileTemplate/UptateCMKFileTemplateById", // 新增
|
|
|
+ url: "/market/CMKFileTemplate/UptateCMKFileTemplateById", //
|
|
|
method: "post",
|
|
|
headers: {
|
|
|
"Content-Type": "application/json",
|
|
|
},
|
|
|
- data: {
|
|
|
- templateId: this.id,
|
|
|
- templateContent: JSON.stringify(data),
|
|
|
- templateName: workbook_name,
|
|
|
- status: type,
|
|
|
- },
|
|
|
+ data: value,
|
|
|
});
|
|
|
this.$emit("save");
|
|
|
return;
|
|
@@ -903,19 +1161,51 @@ export default {
|
|
|
const sheet_name = window.luckysheet.getSheet().name;
|
|
|
const data = window.luckysheet.getSheet(sheet_name);
|
|
|
const workbook_name = window.luckysheet.getWorkbookName();
|
|
|
+
|
|
|
+ let value = {};
|
|
|
+ if (!this.templateType) {
|
|
|
+ this.$message.error("请输入模板类型");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ Object.values(this.superviseForm).filter((el) => el !== "").length === 3
|
|
|
+ ) {
|
|
|
+ value = {
|
|
|
+ templateId: this.id,
|
|
|
+ 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: "0",
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ value = {
|
|
|
+ templateId: this.id,
|
|
|
+ superviseFlag: 0, //督办标识 0.不是 1.是
|
|
|
+ templateType: this.templateType, //模板类型
|
|
|
+ templateContent: JSON.stringify(data), //文件内容
|
|
|
+ templateName: workbook_name, //模板名称
|
|
|
+ templateUrl: "", //文件链接
|
|
|
+ status: "0",
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
this.$http({
|
|
|
url: "/market/CMKFileTemplate/UptateCMKFileTemplateById",
|
|
|
method: "post",
|
|
|
headers: {
|
|
|
"Content-Type": "application/json",
|
|
|
},
|
|
|
- data: {
|
|
|
- templateId: this.id,
|
|
|
- templateContent: JSON.stringify(data),
|
|
|
- templateName: workbook_name,
|
|
|
- status: "0",
|
|
|
- },
|
|
|
+ data: value,
|
|
|
}).then(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "保存成功",
|
|
|
+ });
|
|
|
this.$emit("save");
|
|
|
});
|
|
|
},
|
|
@@ -936,7 +1226,8 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
- console.log(this.destroy, "destroy");
|
|
|
+ console.log(this.attribute, "attribute");
|
|
|
+ console.log(this.type, "type");
|
|
|
this.handleInit();
|
|
|
this.handleChargeList();
|
|
|
},
|
|
@@ -957,6 +1248,13 @@ export default {
|
|
|
width: 100%;
|
|
|
height: 75%;
|
|
|
}
|
|
|
+ &-require {
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
+ .el-input {
|
|
|
+ width: 200px;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
.form {
|
|
|
&-input {
|