|
@@ -2,7 +2,7 @@
|
|
|
* @Author : yuanrunwei
|
|
|
* @Date : 2021-12-04 14:23:58
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
- * @LastEditTime: 2022-01-21 19:27:55
|
|
|
+ * @LastEditTime: 2022-01-23 19:05:08
|
|
|
* @FilePath : \spfm-market-front\src\pages\main\performance\components\sheet.vue
|
|
|
-->
|
|
|
|
|
@@ -27,11 +27,24 @@
|
|
|
>
|
|
|
<el-button type="primary">上传</el-button>
|
|
|
</el-upload>
|
|
|
-
|
|
|
+ <el-button
|
|
|
+ v-if="!status || status === '2'"
|
|
|
+ type="primary"
|
|
|
+ @click="handleSave('2')"
|
|
|
+ :disabled="handleForbid()"
|
|
|
+ >暂存</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="status === '2'"
|
|
|
+ type="primary"
|
|
|
+ @click="handleResave"
|
|
|
+ :disabled="handleForbid()"
|
|
|
+ >保存</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
v-if="addFlag === '0'"
|
|
|
type="primary"
|
|
|
- @click="handleSave"
|
|
|
+ @click="handleSave('0')"
|
|
|
:disabled="handleForbid()"
|
|
|
><span>{{ id ? "提交" : "新增" }}</span
|
|
|
><span>{{
|
|
@@ -220,7 +233,7 @@
|
|
|
</div>
|
|
|
</el-form-item> -->
|
|
|
</el-form>
|
|
|
- <template v-if="id" v-slot:footer><div></div></template>
|
|
|
+ <template v-if="id && status !== '2'" v-slot:footer><div></div></template>
|
|
|
</simple-dialog>
|
|
|
<simpleDialog
|
|
|
title="提交"
|
|
@@ -228,16 +241,15 @@
|
|
|
:modal="false"
|
|
|
@cancel="handleApprove"
|
|
|
>
|
|
|
- <el-form
|
|
|
- :model="approveForm"
|
|
|
- label-width="120px"
|
|
|
- :rules="{
|
|
|
- required: true,
|
|
|
- message: '请选择审批意见',
|
|
|
- trigger: 'change',
|
|
|
- }"
|
|
|
- >
|
|
|
- <el-form-item label="审批意见:">
|
|
|
+ <el-form :model="approveForm" label-width="120px">
|
|
|
+ <el-form-item
|
|
|
+ label="审批意见:"
|
|
|
+ :rules="{
|
|
|
+ required: true,
|
|
|
+ message: '请选择审批意见',
|
|
|
+ trigger: 'change',
|
|
|
+ }"
|
|
|
+ >
|
|
|
<el-select v-model="approveForm.type">
|
|
|
<el-option
|
|
|
v-for="item in approveForm.list"
|
|
@@ -294,6 +306,11 @@ export default {
|
|
|
id: {
|
|
|
default: null,
|
|
|
},
|
|
|
+ receiver: {
|
|
|
+ type: String,
|
|
|
+ default: "",
|
|
|
+ },
|
|
|
+ status: { type: String, default: "" },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -371,24 +388,32 @@ export default {
|
|
|
handleAllow({ row, column }) {
|
|
|
return (
|
|
|
(!this.form.permission_type && this.type === "edit") ||
|
|
|
- (this.row_list.includes(row) && this.column_list.includes(column))
|
|
|
+ (this.row_list.includes(row) && this.column_list.includes(column)) ||
|
|
|
+ (!(this.status === "2" && this.type === "edit"))
|
|
|
);
|
|
|
},
|
|
|
async handleQuery() {
|
|
|
let url = "";
|
|
|
- let key = "";
|
|
|
+ let params = {};
|
|
|
switch (this.attribute) {
|
|
|
case "template":
|
|
|
url = "/market/CMKFileTemplate/QueryCMKFileTemplateById";
|
|
|
- key = "templateId";
|
|
|
+ params = {
|
|
|
+ templateId: this.id,
|
|
|
+ };
|
|
|
break;
|
|
|
case "order":
|
|
|
url = "/market/CMKIssued/CMKQueryIssuedById";
|
|
|
- key = "id";
|
|
|
+ params = {
|
|
|
+ id: this.id,
|
|
|
+ };
|
|
|
break;
|
|
|
case "file":
|
|
|
url = "/market/CMKIssued/CMKIssuedProcessByUser";
|
|
|
- key = "id";
|
|
|
+ params = {
|
|
|
+ id: this.id,
|
|
|
+ receiverId: this.receiver,
|
|
|
+ };
|
|
|
break;
|
|
|
}
|
|
|
const {
|
|
@@ -406,9 +431,7 @@ export default {
|
|
|
headers: {
|
|
|
"Content-Type": "application/json",
|
|
|
},
|
|
|
- data: {
|
|
|
- [key]: this.id,
|
|
|
- },
|
|
|
+ data: params,
|
|
|
});
|
|
|
this.template_id = templateId;
|
|
|
this.issued_id = issuedId;
|
|
@@ -660,7 +683,7 @@ export default {
|
|
|
});
|
|
|
this.$message.success("操作成功");
|
|
|
},
|
|
|
- async handleSave() {
|
|
|
+ async handleSave(type) {
|
|
|
let edit_url = "";
|
|
|
switch (this.attribute) {
|
|
|
case "template":
|
|
@@ -691,6 +714,7 @@ export default {
|
|
|
templateContent: JSON.stringify(data),
|
|
|
templateName: workbook_name,
|
|
|
issuedId: this.issued_id,
|
|
|
+ status: type,
|
|
|
},
|
|
|
});
|
|
|
this.handleAddAuth({ id: body });
|
|
@@ -702,6 +726,24 @@ export default {
|
|
|
this.manager_approve = true;
|
|
|
} else {
|
|
|
// 员工提交
|
|
|
+ if (type === "2") {
|
|
|
+ // 暂存
|
|
|
+ await this.$http({
|
|
|
+ url: "/CMKFileTemplate/UptateCMKFileTemplateById", // 新增
|
|
|
+ method: "post",
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ id: this.template_id,
|
|
|
+ templateContent: JSON.stringify(data),
|
|
|
+ templateName: workbook_name,
|
|
|
+ status: type,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.$emit("save");
|
|
|
+ return;
|
|
|
+ }
|
|
|
await this.$http({
|
|
|
url: edit_url, // 新增
|
|
|
method: "post",
|
|
@@ -766,6 +808,15 @@ export default {
|
|
|
this.visible = !this.visible;
|
|
|
},
|
|
|
async handleApprove(type) {
|
|
|
+ if (this.approveForm.type) {
|
|
|
+ if (this.approveForm.type === "3" && !this.approveForm.comments) {
|
|
|
+ this.$message.error("请输入其他审批意见");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message.error("请选择审批意见");
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (type) {
|
|
|
const sheet_name = window.luckysheet.getSheet().name;
|
|
|
const data = window.luckysheet.getSheet(sheet_name);
|
|
@@ -786,7 +837,9 @@ export default {
|
|
|
let params = {
|
|
|
id: this.issued_id,
|
|
|
reviewOpinion:
|
|
|
- this.approveForm.type === "3" ? this.approveForm.comments : this.approveForm.type,
|
|
|
+ this.approveForm.type === "3"
|
|
|
+ ? this.approveForm.comments
|
|
|
+ : this.approveForm.type,
|
|
|
};
|
|
|
switch (type) {
|
|
|
case "1":
|
|
@@ -853,6 +906,24 @@ export default {
|
|
|
: "";
|
|
|
}
|
|
|
},
|
|
|
+ handleResave() {
|
|
|
+ const sheet_name = window.luckysheet.getSheet().name;
|
|
|
+ const data = window.luckysheet.getSheet(sheet_name);
|
|
|
+ const workbook_name = window.luckysheet.getWorkbookName();
|
|
|
+ this.$http({
|
|
|
+ url: "/market/CMKFileTemplate/QueryCMKFileTemplateById",
|
|
|
+ method: "post",
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ template_id: this.id,
|
|
|
+ templateContent: JSON.stringify(data),
|
|
|
+ templateName: workbook_name,
|
|
|
+ status: "0",
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
handleChargeList() {
|
|
|
this.$http({
|
|
|
url: "/market/techcentergj/queryLeaderList",
|
|
@@ -870,6 +941,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
+ console.log(this.status, "s");
|
|
|
this.handleInit();
|
|
|
this.handleChargeList();
|
|
|
},
|