|
@@ -2,7 +2,7 @@
|
|
|
* @Author : yuanrunwei
|
|
|
* @Date : 2021-12-04 14:23:58
|
|
|
* @LastEditors: daiqisheng
|
|
|
- * @LastEditTime: 2022-02-15 15:59:58
|
|
|
+ * @LastEditTime: 2022-03-07 17:40:14
|
|
|
* @FilePath : \spfm-market-front\src\pages\main\performance\components\sheet.vue
|
|
|
-->
|
|
|
<template>
|
|
@@ -34,7 +34,7 @@
|
|
|
>暂存</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
- v-if="status === '2'"
|
|
|
+ v-if="status === '2' || status === '3'"
|
|
|
type="primary"
|
|
|
@click="handleResave"
|
|
|
:disabled="handleForbid()"
|
|
@@ -158,7 +158,9 @@
|
|
|
</el-form-item>
|
|
|
</el-radio-group>
|
|
|
</el-form>
|
|
|
- <template v-if="id && status !== '2'" v-slot:footer><div></div></template>
|
|
|
+ <template v-if="id && status !== '2' && status !== '3'" v-slot:footer
|
|
|
+ ><div></div
|
|
|
+ ></template>
|
|
|
</simple-dialog>
|
|
|
<simpleDialog
|
|
|
title="提交"
|
|
@@ -313,7 +315,9 @@ export default {
|
|
|
// },
|
|
|
handleAllow({ row, column }) {
|
|
|
let public_permisson =
|
|
|
- (!this.form.permission_type || this.status === "2") &&
|
|
|
+ (!this.form.permission_type ||
|
|
|
+ this.status === "2" ||
|
|
|
+ this.status === "3") &&
|
|
|
this.type === "edit";
|
|
|
let editable =
|
|
|
this.row_list.includes(row) && this.column_list.includes(column);
|
|
@@ -374,7 +378,7 @@ export default {
|
|
|
this.form = {
|
|
|
permission_type: Number(type) - 1,
|
|
|
person: list.map((el) => {
|
|
|
- return `${el.principalId},${el.principalName}`;
|
|
|
+ return `${el.principalMent}-${el.principalId},${el.principalName}`;
|
|
|
}),
|
|
|
charge: [
|
|
|
{
|
|
@@ -395,7 +399,7 @@ export default {
|
|
|
row_start: "",
|
|
|
row_end: "",
|
|
|
charge: list.map((el) => ({
|
|
|
- person: el.principalId + "," + el.principalName,
|
|
|
+ person: `${el.principalMent}-${el.principalId},${el.principalName}`,
|
|
|
col_start: el.allowEditingColumns.split(",")[0],
|
|
|
col_end:
|
|
|
el.allowEditingColumns.split(",")[
|
|
@@ -435,10 +439,6 @@ export default {
|
|
|
type: "json",
|
|
|
});
|
|
|
},
|
|
|
- // formateNumber(String) {
|
|
|
- // console.log(String, "daa");
|
|
|
- // if(String.split(','))
|
|
|
- // },
|
|
|
handleForbid() {
|
|
|
// const object = {};
|
|
|
const { permission_type } = this.form;
|
|
@@ -508,7 +508,7 @@ export default {
|
|
|
});
|
|
|
let changedList = middle.join(",").split(",");
|
|
|
that.rowList.push(...changedList);
|
|
|
- console.log(that.rowList,'that.rowList');
|
|
|
+ console.log(that.rowList, "that.rowList");
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -570,14 +570,18 @@ export default {
|
|
|
if (!permission_type) {
|
|
|
// 公共权限
|
|
|
const { person } = this.form;
|
|
|
+
|
|
|
const principalId = [];
|
|
|
const principalName = [];
|
|
|
+ const principalMent = [];
|
|
|
person.forEach((el) => {
|
|
|
- principalId.push(el.split(",")[0]);
|
|
|
+ principalMent.push(el.split(",")[0].split("-")[0]);
|
|
|
+ principalId.push(el.split(",")[0].split("-")[1]);
|
|
|
principalName.push(el.split(",")[1]);
|
|
|
});
|
|
|
reqdata.principalId = principalId.join(",");
|
|
|
reqdata.principalName = principalName.join(",");
|
|
|
+ reqdata.principalMent = principalName.join(",");
|
|
|
} else {
|
|
|
const { charge } = this.form;
|
|
|
// 特殊权限
|
|
@@ -585,7 +589,8 @@ export default {
|
|
|
JSON.stringify({
|
|
|
allowEditingColumns: `${el.col_start},${el.col_end}`,
|
|
|
rowNum: `${el.row_start},${el.row_end}`,
|
|
|
- principalId: el.person.split(",")[0],
|
|
|
+ principalMent: el.person.split(",")[0].split("-")[0],
|
|
|
+ principalId: el.person.split(",")[0].split("-")[1],
|
|
|
principalName: el.person.split(",")[1],
|
|
|
})
|
|
|
);
|
|
@@ -648,56 +653,6 @@ export default {
|
|
|
} else {
|
|
|
// 职位
|
|
|
let duty = JSON.parse(sessionStorage.userInfo).duty;
|
|
|
- // let { permission_type, charge } = this.form;
|
|
|
- this.rowList.shift();
|
|
|
- let reqdata = {
|
|
|
- rowIndex: [...new Set(this.rowList)]
|
|
|
- .sort(function (a, b) {
|
|
|
- return a - b;
|
|
|
- })
|
|
|
- .join(","),
|
|
|
- rowContent: [...new Set(this.rowList)]
|
|
|
- .sort(function (a, b) {
|
|
|
- return a - b;
|
|
|
- })
|
|
|
- .map((el) => {
|
|
|
- return data.data[el];
|
|
|
- }),
|
|
|
- };
|
|
|
- console.log(reqdata, "reqdata");
|
|
|
- // if (permission_type) {
|
|
|
- // // 特殊权限
|
|
|
- // reqdata = {
|
|
|
- // ...reqdata,
|
|
|
- // rowIndex: this.paramsArr(
|
|
|
- // charge[0].row_start - 1,
|
|
|
- // charge[0].row_end - 1
|
|
|
- // ),
|
|
|
- // rowContent: this.paramsArr(
|
|
|
- // charge[0].row_start - 1,
|
|
|
- // charge[0].row_end - 1
|
|
|
- // )
|
|
|
- // .split(",")
|
|
|
- // .map((el) => {
|
|
|
- // return data.data[el];
|
|
|
- // }),
|
|
|
- // };
|
|
|
- // } else {
|
|
|
- // // 公共权限
|
|
|
- // const RowList = [];
|
|
|
- // const RowContent = [];
|
|
|
- // data.data.forEach((item, rowIndex) => {
|
|
|
- // if (this.confirmArrayData(item)) {
|
|
|
- // RowList.push(rowIndex);
|
|
|
- // RowContent.push(item);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // reqdata = {
|
|
|
- // ...reqdata,
|
|
|
- // rowIndex: RowList.join(","),
|
|
|
- // rowContent: RowContent,
|
|
|
- // };
|
|
|
- // }
|
|
|
if (duty === "7") {
|
|
|
this.manager_approve = true;
|
|
|
} else {
|
|
@@ -720,6 +675,21 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
// 员工提交
|
|
|
+ this.rowList.shift();
|
|
|
+ let reqdata = {
|
|
|
+ rowIndex: [...new Set(this.rowList)]
|
|
|
+ .sort(function (a, b) {
|
|
|
+ return a - b;
|
|
|
+ })
|
|
|
+ .join(","),
|
|
|
+ rowContent: [...new Set(this.rowList)]
|
|
|
+ .sort(function (a, b) {
|
|
|
+ return a - b;
|
|
|
+ })
|
|
|
+ .map((el) => {
|
|
|
+ return data.data[el];
|
|
|
+ }),
|
|
|
+ };
|
|
|
await this.$http({
|
|
|
url: edit_url, //提交
|
|
|
method: "post",
|
|
@@ -827,7 +797,7 @@ export default {
|
|
|
const sheet_name = window.luckysheet.getSheet().name;
|
|
|
const data = window.luckysheet.getSheet(sheet_name);
|
|
|
const workbook_name = window.luckysheet.getWorkbookName();
|
|
|
- // let { permission_type, charge } = this.form;
|
|
|
+ // 经理提交
|
|
|
this.rowList.shift();
|
|
|
let reqdata = {
|
|
|
rowIndex: [...new Set(this.rowList)]
|
|
@@ -843,39 +813,6 @@ export default {
|
|
|
return data.data[el];
|
|
|
}),
|
|
|
};
|
|
|
- // if (permission_type) {
|
|
|
- // // 特殊权限
|
|
|
- // reqdata = {
|
|
|
- // ...reqdata,
|
|
|
- // rowIndex: this.paramsArr(
|
|
|
- // charge[0].row_start - 1,
|
|
|
- // charge[0].row_end - 1
|
|
|
- // ),
|
|
|
- // rowContent: this.paramsArr(
|
|
|
- // charge[0].row_start - 1,
|
|
|
- // charge[0].row_end - 1
|
|
|
- // )
|
|
|
- // .split(",")
|
|
|
- // .map((el) => {
|
|
|
- // return data.data[el];
|
|
|
- // }),
|
|
|
- // };
|
|
|
- // } else {
|
|
|
- // // 公共权限
|
|
|
- // const RowList = [];
|
|
|
- // const RowContent = [];
|
|
|
- // data.data.forEach((item, rowIndex) => {
|
|
|
- // if (this.confirmArrayData(item)) {
|
|
|
- // RowList.push(rowIndex);
|
|
|
- // RowContent.push(item);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // reqdata = {
|
|
|
- // ...reqdata,
|
|
|
- // rowIndex: RowList.join(","),
|
|
|
- // rowContent: RowContent,
|
|
|
- // };
|
|
|
- // }
|
|
|
await this.$http({
|
|
|
url: "/market/CMKIssued/CMKIssuedSubmit", // 提交
|
|
|
method: "post",
|
|
@@ -993,16 +930,19 @@ export default {
|
|
|
}).then((response) => {
|
|
|
this.charge_list = response.data.map((element) => ({
|
|
|
label: `${element.ou} ${element.secLeaderName}`,
|
|
|
- value: `${element.secLeaderLogin},${element.secLeaderName}`,
|
|
|
+ value: `${element.ou}-${element.secLeaderLogin},${element.secLeaderName}`,
|
|
|
}));
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
- console.log(this.status, "s");
|
|
|
+ console.log(this.destroy, "destroy");
|
|
|
this.handleInit();
|
|
|
this.handleChargeList();
|
|
|
},
|
|
|
+ destroyed() {
|
|
|
+ window.luckysheet.destroy();
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|