|
@@ -14,7 +14,8 @@
|
|
|
:loading="table_loading"
|
|
|
:multiple="true"
|
|
|
:handle-row="table_handle_row"
|
|
|
- @selection="handleaaa"
|
|
|
+ @selection="handleSelect"
|
|
|
+ :selectable="handleSelectFilter"
|
|
|
@check="handleCheck"
|
|
|
@edit="handleEdit"
|
|
|
@approve="handleApprove"
|
|
@@ -87,14 +88,39 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template v-slot:footer>
|
|
|
- <div v-if="!isCheck">
|
|
|
- <el-button @click="handleSubmit" type="primary">保存</el-button>
|
|
|
- <el-button type="primary">重新提交</el-button>
|
|
|
+ <div v-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-if="title === '查看'">
|
|
|
+ <div></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></div>
|
|
|
+ <div v-else>
|
|
|
+ <el-button @click="handleSubmit('adopt')" type="primary"
|
|
|
+ >保存</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="handleSubmit('failed')" type="default"
|
|
|
+ >退回修改</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</simple-dialog>
|
|
|
<simple-dialog
|
|
@@ -152,7 +178,7 @@ export default {
|
|
|
summary_visible: false,
|
|
|
edit_visible: false,
|
|
|
approve_visible: false,
|
|
|
- ids:[],
|
|
|
+ ids: [],
|
|
|
add_form: {},
|
|
|
table_handle: [
|
|
|
{
|
|
@@ -172,7 +198,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "状态",
|
|
|
- props: "approve",
|
|
|
+ props: "sts",
|
|
|
type: "select",
|
|
|
// 0.待办 1.已办
|
|
|
dictionary: [
|
|
@@ -215,14 +241,14 @@ export default {
|
|
|
label: "编辑",
|
|
|
props: "edit",
|
|
|
visible: {
|
|
|
- sts: ["0"],
|
|
|
+ draft: ["0"],
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
label: "处理",
|
|
|
props: "approve",
|
|
|
visible: {
|
|
|
- sts: ["0"],
|
|
|
+ deal: ["1"],
|
|
|
},
|
|
|
},
|
|
|
],
|
|
@@ -230,7 +256,7 @@ export default {
|
|
|
table_config: [
|
|
|
{
|
|
|
label: "序号",
|
|
|
- props: "id",
|
|
|
+ props: "No",
|
|
|
},
|
|
|
{
|
|
|
label: "公司名称",
|
|
@@ -258,11 +284,11 @@ export default {
|
|
|
table_config_approve: [
|
|
|
{
|
|
|
label: "编号",
|
|
|
- props: "number",
|
|
|
+ props: "No",
|
|
|
},
|
|
|
{
|
|
|
label: "流程环节",
|
|
|
- props: "procName",
|
|
|
+ props: "taskName",
|
|
|
},
|
|
|
{
|
|
|
label: "处理人",
|
|
@@ -287,42 +313,42 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.handleInit({
|
|
|
- ...this.table_search,
|
|
|
- type: "1",
|
|
|
- page: this.page,
|
|
|
- pageSize: this.rows,
|
|
|
- });
|
|
|
+ this.handleInit();
|
|
|
},
|
|
|
methods: {
|
|
|
// 表格数据初始化
|
|
|
- handleInit(data) {
|
|
|
+ handleInit() {
|
|
|
// this.table_loading = true;
|
|
|
// console.log(data);
|
|
|
+ let reqdata = {
|
|
|
+ ...this.table_search,
|
|
|
+ type: "1",
|
|
|
+ page: this.page,
|
|
|
+ pageSize: this.rows,
|
|
|
+ };
|
|
|
this.$http({
|
|
|
url: "/mkWangge/queryPage",
|
|
|
method: "post",
|
|
|
headers: {
|
|
|
"Content-Type": "application/json",
|
|
|
},
|
|
|
- data: data,
|
|
|
+ data: reqdata,
|
|
|
}).then(({ data: { count, data } }) => {
|
|
|
this.table_loading = false;
|
|
|
this.total = count;
|
|
|
- this.table_list = data || [];
|
|
|
- console.log(data);
|
|
|
+ this.table_list = data.map((element,index) => ({
|
|
|
+ ...element,
|
|
|
+ deal: element.draft === "1" && element.sts === "0" ? "1" : "0",
|
|
|
+ No: index + 1
|
|
|
+ }));
|
|
|
+ console.log(this.table_list);
|
|
|
});
|
|
|
},
|
|
|
// 搜索事件
|
|
|
handleSearch(data) {
|
|
|
this.table_search = data;
|
|
|
this.page = 1;
|
|
|
- this.handleInit({
|
|
|
- ...data,
|
|
|
- type: "0",
|
|
|
- page: this.page,
|
|
|
- pageSize: this.rows,
|
|
|
- });
|
|
|
+ this.handleInit();
|
|
|
},
|
|
|
handleVisible(props) {
|
|
|
this.approve_visible = false;
|
|
@@ -330,9 +356,11 @@ export default {
|
|
|
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;
|
|
@@ -350,9 +378,16 @@ export default {
|
|
|
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;
|
|
|
}
|
|
|
},
|
|
|
- handleaaa(val) {
|
|
|
+ handleSelect(val) {
|
|
|
this.summaryIds = val.map((item) => {
|
|
|
return item.id.toString();
|
|
|
});
|
|
@@ -360,11 +395,21 @@ export default {
|
|
|
},
|
|
|
//文件返回值
|
|
|
uploadBack(v) {
|
|
|
- console.log(v);
|
|
|
- this.attList = v;
|
|
|
+ const fileName = [];
|
|
|
+ const fileIds = [];
|
|
|
+ v.forEach((element) => {
|
|
|
+ fileName.push(element.fileName);
|
|
|
+ fileIds.push(element.fileCode);
|
|
|
+ });
|
|
|
+ // this.add_form = {
|
|
|
+ // fileNames: fileName.join(","),
|
|
|
+ // fileIds: fileIds.join(","),
|
|
|
+ // };
|
|
|
+ this.add_form.fileNames = fileName.join(",")
|
|
|
+ this.add_form.fileIds = fileIds.join(",")
|
|
|
},
|
|
|
- // 查看按钮
|
|
|
- handleCheck(row) {
|
|
|
+ // 获取模态框信息
|
|
|
+ getDialogData(row) {
|
|
|
let id = row.id;
|
|
|
let type = row.parentId === null ? "1" : "0";
|
|
|
this.$http({
|
|
@@ -380,87 +425,80 @@ export default {
|
|
|
}).then(({ data }) => {
|
|
|
let body = data.body;
|
|
|
console.log(body, "body");
|
|
|
+ this.ids = [body.id.toString()];
|
|
|
this.add_form = {
|
|
|
id: body.id,
|
|
|
- proposer: body.createName,
|
|
|
+ proposer: body.proposer,
|
|
|
telephone: body.telephone,
|
|
|
wanggeText: body.wanggeText,
|
|
|
+ fileNames: body.fileNames,
|
|
|
+ fileIds: body.fileIds,
|
|
|
};
|
|
|
- this.table_list_approve = body.bpmTaskList;
|
|
|
+ // this.fileInfo.fileList = body.fileNames.split(',')
|
|
|
+ this.table_list_approve = body.bpmTaskList.map((item,index) => ({
|
|
|
+ ...item,
|
|
|
+ No: index + 1
|
|
|
+ }));
|
|
|
});
|
|
|
- this.handleVisible("check");
|
|
|
+ },
|
|
|
+ // 查看按钮
|
|
|
+ handleCheck(row) {
|
|
|
+ if (row.parentLevel === "1") {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/approvalExamination",
|
|
|
+ query: row,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.getDialogData(row);
|
|
|
+ this.handleVisible("check");
|
|
|
+ }
|
|
|
},
|
|
|
// 编辑按钮
|
|
|
handleEdit(row) {
|
|
|
- let id = row.id;
|
|
|
- let type = row.parentId === null ? "1" : "0";
|
|
|
- this.$http({
|
|
|
- url: "/mkWangge/getMkWanggeById",
|
|
|
- method: "get",
|
|
|
- headers: {
|
|
|
- "Content-Type": "application/json",
|
|
|
- },
|
|
|
- params: {
|
|
|
- id,
|
|
|
- type,
|
|
|
- },
|
|
|
- }).then(({ data }) => {
|
|
|
- let body = data.body;
|
|
|
- console.log(body, "body");
|
|
|
- this.add_form = {
|
|
|
- id: body.id,
|
|
|
- proposer: body.proposer,
|
|
|
- telephone: body.telephone,
|
|
|
- wanggeText: body.wanggeText,
|
|
|
- };
|
|
|
- this.table_list_approve = body.bpmTaskList;
|
|
|
- });
|
|
|
+ this.getDialogData(row);
|
|
|
this.handleVisible("edit");
|
|
|
},
|
|
|
// 处理按钮
|
|
|
handleApprove(row) {
|
|
|
- let id = row.id;
|
|
|
- let type = row.parentId === null ? "1" : "0";
|
|
|
- this.$http({
|
|
|
- url: "/mkWangge/getMkWanggeById",
|
|
|
- method: "get",
|
|
|
- headers: {
|
|
|
- "Content-Type": "application/json",
|
|
|
- },
|
|
|
- params: {
|
|
|
- id,
|
|
|
- type,
|
|
|
- },
|
|
|
- }).then(({ data }) => {
|
|
|
- let body = 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,
|
|
|
- };
|
|
|
- this.table_list_approve = body.bpmTaskList;
|
|
|
- });
|
|
|
- this.handleVisible("edit");
|
|
|
- this.approve_visible = true;
|
|
|
+ if (row.parentLevel === "1") {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/approvalExamination",
|
|
|
+ query: {
|
|
|
+ parentId: row.id.toString(),
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.getDialogData(row);
|
|
|
+ this.handleVisible("approve");
|
|
|
+ }
|
|
|
},
|
|
|
- handleSubmit() {
|
|
|
+ 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: "1",
|
|
|
+ draft: draft,
|
|
|
num: "1",
|
|
|
},
|
|
|
];
|
|
|
if (!this.approve_visible) {
|
|
|
- // 编辑
|
|
|
+ // 编辑/新增
|
|
|
this.$http({
|
|
|
url: "/mkWangge/saveOrUpdateList",
|
|
|
method: "post",
|
|
@@ -470,21 +508,16 @@ export default {
|
|
|
data: reqdata,
|
|
|
}).then((res) => {
|
|
|
console.log(res);
|
|
|
- });
|
|
|
- this.handleInit({
|
|
|
- ...this.table_search,
|
|
|
- type: "0",
|
|
|
- page: this.page,
|
|
|
- pageSize: this.rows,
|
|
|
+ this.handleInit();
|
|
|
});
|
|
|
} else {
|
|
|
// 审批
|
|
|
let reqdata = {
|
|
|
ids: this.ids,
|
|
|
remark: this.add_form.remark,
|
|
|
- type: '0'
|
|
|
- }
|
|
|
- console.log(reqdata,'reqdata');
|
|
|
+ type: isAdopt,
|
|
|
+ };
|
|
|
+ console.log(reqdata, "reqdata");
|
|
|
this.$http({
|
|
|
url: "/mkWangge/review",
|
|
|
method: "post",
|
|
@@ -492,13 +525,16 @@ export default {
|
|
|
"Content-Type": "application/json",
|
|
|
},
|
|
|
data: {
|
|
|
- ...reqdata
|
|
|
+ ...reqdata,
|
|
|
},
|
|
|
+ }).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ this.handleInit();
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
this.edit_visible = false;
|
|
|
this.add_visible = false;
|
|
|
+ this.fileInfo.fileList = []
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -531,18 +567,22 @@ export default {
|
|
|
type: "success",
|
|
|
});
|
|
|
}
|
|
|
+ this.handleInit();
|
|
|
});
|
|
|
this.handleVisible("summary");
|
|
|
}
|
|
|
},
|
|
|
handleChange(page) {
|
|
|
this.page = page;
|
|
|
- this.handleInit({
|
|
|
- ...this.table_search,
|
|
|
- type: "0",
|
|
|
- page: this.page,
|
|
|
- pageSize: this.rows,
|
|
|
- });
|
|
|
+ this.handleInit();
|
|
|
+ },
|
|
|
+ handleSelectFilter(row) {
|
|
|
+ // 过滤可被选中的数组
|
|
|
+ if (row.parentLevel === "1") {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
};
|